@ht-rnd/json-schema-editor 2.0.4 → 2.0.6
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/lib/main.es.js +2601 -2592
- package/dist/lib/main.umd.js +10 -10
- package/package.json +1 -1
package/dist/lib/main.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(Se,ee){typeof exports=="object"&&typeof module<"u"?ee(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ee):(Se=typeof globalThis<"u"?globalThis:Se||self,ee(Se["json-schema-editor"]={},Se.React))})(this,(function(Se,ee){"use strict";const ps=["string","integer","number","boolean","object","array"],Ka=[...ps,"ref"],Ja=["int-32","int-64"],Ha=["float","double","big-decimal"],Ga=["date","date-time","local-date-time","time","duration","email","hostname","ipv4","ipv6","password","html","json","json-path","uri","uri-refrence","uri-template","relative-json-pointer","json-pointer","regex","uuid"],yn="http://json-schema.org/draft/2020-12/schema",Ba=()=>({type:"object",$schema:yn,additionalProperties:!0}),Wa=()=>({type:"array",$schema:yn,items:{type:"string"}}),Ya=e=>({id:e,key:`field_${e}`,isRequired:!1,schema:{type:"string"}}),Xa="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Qe=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Xa[r[e]&63];return t};const Qa=e=>e?e.includes("draft-04")?"draft04":e.includes("draft-07")||e.includes("draft-06")?"legacy":"modern":"modern",ec=["enumEnabled","enumInput","isModifiable"],tc=(e,t)=>{const r={...e};if(r.enumEnabled&&Array.isArray(r.enumInput)&&r.enumInput.length>0){let n=r.enumInput;r.type==="number"?n=r.enumInput.map(Number).filter(s=>!Number.isNaN(s)):r.type==="integer"&&(n=r.enumInput.map(Number).filter(s=>Number.isInteger(s))),n.length>0&&(r.enum=n)}r.exclusiveMin!=null&&(t==="draft04"?(r.minimum=r.exclusiveMin,r.exclusiveMinimum=!0):r.exclusiveMinimum=r.exclusiveMin,delete r.exclusiveMin),r.exclusiveMax!=null&&(t==="draft04"?(r.maximum=r.exclusiveMax,r.exclusiveMaximum=!0):r.exclusiveMaximum=r.exclusiveMax,delete r.exclusiveMax),(r.format==="none"||r.format==="")&&delete r.format;for(const n of ec)delete r[n];return r},vn=e=>{const t=a=>{if(a==null||a==="")return;if(typeof a!="object"||a instanceof Date)return a;if(Array.isArray(a))return a.map(t).filter(u=>u!==void 0);const c={};for(const u in a){const m=t(a[u]);m!==void 0&&(c[u]=m)}return c},r=Qa(e.root.$schema),n=(a,c)=>{if(a.type==="ref"&&a.$ref)return t({$ref:a.$ref,...a.title&&{title:a.title},...a.description&&{description:a.description}});const u=tc({...a},c);if(u.type==="ref"&&delete u.type,Array.isArray(u.properties)){const m={},v=[];u.properties.forEach(l=>{l.key&&(m[l.key]=n(l.schema,c),l.isRequired&&v.push(l.key))}),u.properties=m,v.length>0&&(u.required=v)}return typeof u.items=="object"&&u.items!==null&&!Array.isArray(u.items)?u.items=n(u.items,c):Array.isArray(u.items)&&(u.items=u.items.map(m=>n(m,c))),t(u)},s={...n(e.root,r)},o={},i=[];if(e.properties.forEach(a=>{a.key&&(o[a.key]=n(a.schema,r),a.isRequired&&i.push(a.key))}),Object.keys(o).length>0&&(s.properties=o),i.length>0&&(s.required=i),e.definitions&&e.definitions.length>0){const a={};e.definitions.forEach(c=>{c.key&&(a[c.key]=n(c.schema,r))}),r!=="modern"?s.definitions=a:s.$defs=a}return s},ys=e=>{const t=v=>{const l={...v};if(l.$ref&&(l.type="ref"),Array.isArray(l.enum)&&l.enum.length>0&&(l.enumEnabled=!0,l.enumInput=l.enum.map(h=>String(h))),l.exclusiveMinimum!=null&&(typeof l.exclusiveMinimum=="boolean"?l.exclusiveMinimum===!0&&l.minimum!=null&&(l.exclusiveMin=l.minimum,delete l.minimum):l.exclusiveMin=l.exclusiveMinimum,delete l.exclusiveMinimum),l.exclusiveMaximum!=null&&(typeof l.exclusiveMaximum=="boolean"?l.exclusiveMaximum===!0&&l.maximum!=null&&(l.exclusiveMax=l.maximum,delete l.maximum):l.exclusiveMax=l.exclusiveMaximum,delete l.exclusiveMaximum),typeof l.properties=="object"&&!Array.isArray(l.properties)){const h=[];Object.keys(l.properties).forEach(w=>{const S=l.properties[w];h.push({id:Qe(6),key:w,isRequired:l.required?.includes(w)||!1,schema:t(S)})}),l.properties=h}return typeof l.items=="object"&&l.items!==null&&!Array.isArray(l.items)?l.items=t(l.items):Array.isArray(l.items)&&(l.items=l.items.map(h=>t(h))),l},{properties:r,required:n,$defs:s,definitions:o,...i}=e,a=s??o,c=t(i),u=[];r&&Object.keys(r).forEach(v=>{u.push({id:Qe(6),key:v,isRequired:n?.includes(v)||!1,schema:t(r[v])})});const m=[];return a&&Object.keys(a).forEach(v=>{m.push({id:Qe(6),key:v,schema:t(a[v])})}),{root:c,properties:u,definitions:m}};function D(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,m=Object.keys(u);for(let v=0;v<m.length;v++){const l=m[v];l in a||(a[l]=u[l].bind(a))}}const s=r?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var c;const u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const m of u._zod.deferred)m();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class _t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vs extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const gs={};function st(e){return gs}function _s(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function gn(e,t){return typeof t=="bigint"?t.toString():t}function _n(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $n(e){return e==null}function bn(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function rc(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let s=(n.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const o=r>s?r:s,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}const $s=Symbol("evaluating");function de(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==$s)return n===void 0&&(n=$s,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function mt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ot(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function bs(e){return JSON.stringify(e)}function nc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ws="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const sc=_n(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function $t(e){if(xt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(xt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ss(e){return $t(e)?{...e}:Array.isArray(e)?[...e]:e}const oc=new Set(["string","number","symbol"]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function te(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 ic(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const ac={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]};function cc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=ot(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return mt(this,"shape",i),i},checks:[]});return it(e,o)}function uc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=ot(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return mt(this,"shape",i),i},checks:[]});return it(e,o)}function dc(e,t){if(!$t(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=ot(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return mt(this,"shape",o),o}});return it(e,s)}function lc(e,t){if(!$t(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ot(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return mt(this,"shape",n),n}});return it(e,r)}function fc(e,t){const r=ot(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return mt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return it(e,r)}function mc(e,t,r){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ot(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(r)for(const u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return mt(this,"shape",c),c},checks:[]});return it(t,i)}function hc(e,t,r){const n=ot(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return mt(this,"shape",o),o}});return it(t,n)}function bt(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 wt(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Kt(e){return typeof e=="string"?e:e?.message}function at(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=Kt(e.inst?._zod.def?.error?.(e))??Kt(t?.error?.(e))??Kt(r.customError?.(e))??Kt(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tt(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Es=(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,gn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sn=D("$ZodError",Es),Jt=D("$ZodError",Es,{Parent:Error});function pc(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function yc(e,t=r=>r.message){const r={_errors:[]},n=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>n({issues:i}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let i=r,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return n(e),r}const Ht=e=>(t,r,n,s)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new _t;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>at(c,o,st())));throw ws(a,s?.callee),a}return i.value},vc=Ht(Jt),Gt=e=>async(t,r,n,s)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>at(c,o,st())));throw ws(a,s?.callee),a}return i.value},gc=Gt(Jt),Bt=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new _t;return o.issues.length?{success:!1,error:new(e??Sn)(o.issues.map(i=>at(i,s,st())))}:{success:!0,data:o.value}},_c=Bt(Jt),Wt=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>at(i,s,st())))}:{success:!0,data:o.value}},$c=Wt(Jt),bc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ht(e)(t,r,s)},wc=e=>(t,r,n)=>Ht(e)(t,r,n),Sc=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Gt(e)(t,r,s)},Ec=e=>async(t,r,n)=>Gt(e)(t,r,n),kc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Bt(e)(t,r,s)},Pc=e=>(t,r,n)=>Bt(e)(t,r,n),Oc=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wt(e)(t,r,s)},jc=e=>async(t,r,n)=>Wt(e)(t,r,n),Ac=/^[cC][^\s-]{8,}$/,Nc=/^[0-9a-z]+$/,zc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rc=/^[0-9a-vA-V]{20}$/,Ic=/^[A-Za-z0-9]{27}$/,Tc=/^[a-zA-Z0-9_-]{21}$/,Cc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mc=/^([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})$/,ks=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)$/,Dc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fc(){return new RegExp(Vc,"u")}const qc=/^(?:(?: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])$/,Zc=/^(([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}|:))$/,Uc=/^((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])$/,xc=/^(([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])$/,Lc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ps=/^[A-Za-z0-9_-]*$/,Kc=/^\+[1-9]\d{6,14}$/,Os="(?:(?:\\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])))",Jc=new RegExp(`^${Os}$`);function js(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 Hc(e){return new RegExp(`^${js(e)}$`)}function Gc(e){const t=js({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Os}T(?:${n})$`)}const Bc=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Wc=/^-?\d+$/,As=/^-?\d+(?:\.\d+)?$/,Yc=/^(?:true|false)$/i,Xc=/^[^A-Z]*$/,Qc=/^[^a-z]*$/,De=D("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ns={number:"number",bigint:"bigint",object:"date"},zs=D("$ZodCheckLessThan",(e,t)=>{De.init(e,t);const r=Ns[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rs=D("$ZodCheckGreaterThan",(e,t)=>{De.init(e,t);const r=Ns[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eu=D("$ZodCheckMultipleOf",(e,t)=>{De.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.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):rc(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})}}),tu=D("$ZodCheckNumberFormat",(e,t)=>{De.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[s,o]=ac[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,r&&(a.pattern=Wc)}),e._zod.check=i=>{const a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),ru=D("$ZodCheckMaxLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const i=wn(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),nu=D("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const i=wn(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),su=D("$ZodCheckLengthEquals",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,o=s.length;if(o===t.length)return;const i=wn(s),a=o>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Yt=D("$ZodCheckStringFormat",(e,t)=>{var r,n;De.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ou=D("$ZodCheckRegex",(e,t)=>{Yt.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})}}),iu=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Xc),Yt.init(e,t)}),au=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Qc),Yt.init(e,t)}),cu=D("$ZodCheckIncludes",(e,t)=>{De.init(e,t);const r=Lt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),uu=D("$ZodCheckStartsWith",(e,t)=>{De.init(e,t);const r=new RegExp(`^${Lt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),du=D("$ZodCheckEndsWith",(e,t)=>{De.init(e,t);const r=new RegExp(`.*${Lt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),lu=D("$ZodCheckOverwrite",(e,t)=>{De.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class fu{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 n=t.split(`
|
|
1
|
+
(function(Se,ee){typeof exports=="object"&&typeof module<"u"?ee(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ee):(Se=typeof globalThis<"u"?globalThis:Se||self,ee(Se["json-schema-editor"]={},Se.React))})(this,(function(Se,ee){"use strict";const ps=["string","integer","number","boolean","object","array"],Ja=[...ps,"ref"],Ha=["int-32","int-64"],Ga=["float","double","big-decimal"],Ba=["date","date-time","local-date-time","time","duration","email","hostname","ipv4","ipv6","password","html","json","json-path","uri","uri-refrence","uri-template","relative-json-pointer","json-pointer","regex","uuid"],yn="http://json-schema.org/draft/2020-12/schema",Wa=()=>({type:"object",$schema:yn,additionalProperties:!0}),Ya=()=>({type:"array",$schema:yn,items:{type:"string"}}),Xa=e=>({id:e,key:`field_${e}`,isRequired:!1,schema:{type:"string"}}),Qa="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Ye=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Qa[r[e]&63];return t};const ec=e=>e?e.includes("draft-04")?"draft04":e.includes("draft-07")||e.includes("draft-06")?"legacy":"modern":"modern",tc=["enumEnabled","enumInput","isModifiable"],rc=(e,t)=>{const r={...e};if(r.enumEnabled&&Array.isArray(r.enumInput)&&r.enumInput.length>0){let n=r.enumInput;r.type==="number"?n=r.enumInput.map(Number).filter(s=>!Number.isNaN(s)):r.type==="integer"&&(n=r.enumInput.map(Number).filter(s=>Number.isInteger(s))),n.length>0&&(r.enum=n)}r.exclusiveMin!=null&&(t==="draft04"?(r.minimum=r.exclusiveMin,r.exclusiveMinimum=!0):r.exclusiveMinimum=r.exclusiveMin,delete r.exclusiveMin),r.exclusiveMax!=null&&(t==="draft04"?(r.maximum=r.exclusiveMax,r.exclusiveMaximum=!0):r.exclusiveMaximum=r.exclusiveMax,delete r.exclusiveMax),(r.format==="none"||r.format==="")&&delete r.format;for(const n of tc)delete r[n];return r},vn=e=>{const t=a=>{if(a==null||a==="")return;if(typeof a!="object"||a instanceof Date)return a;if(Array.isArray(a))return a.map(t).filter(u=>u!==void 0);const c={};for(const u in a){const m=t(a[u]);m!==void 0&&(c[u]=m)}return c},r=ec(e.root.$schema),n=(a,c)=>{if(a.type==="ref"&&a.$ref)return t({$ref:a.$ref,...a.title&&{title:a.title},...a.description&&{description:a.description}});const u=rc({...a},c);if(u.type==="ref"&&delete u.type,Array.isArray(u.properties)){const m={},y=[];u.properties.forEach(f=>{f.key&&(m[f.key]=n(f.schema,c),f.isRequired&&y.push(f.key))}),u.properties=m,y.length>0&&(u.required=y)}return typeof u.items=="object"&&u.items!==null&&!Array.isArray(u.items)?u.items=n(u.items,c):Array.isArray(u.items)&&(u.items=u.items.map(m=>n(m,c))),t(u)},s={...n(e.root,r)},o={},i=[];if(e.properties.forEach(a=>{a.key&&(o[a.key]=n(a.schema,r),a.isRequired&&i.push(a.key))}),Object.keys(o).length>0&&(s.properties=o),i.length>0&&(s.required=i),e.definitions&&e.definitions.length>0){const a={};e.definitions.forEach(c=>{c.key&&(a[c.key]=n(c.schema,r))}),r!=="modern"?s.definitions=a:s.$defs=a}return s},ys=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};for(const r of["properties","$defs","definitions"])t[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&!Array.isArray(t[r])&&(t[r]=Object.fromEntries(Object.entries(t[r]).map(([n,s])=>[n,ys(s)])));return t.items===null&&delete t.items,t},vs=e=>{e=ys(e);const t=y=>{const f={...y};if(f.$ref&&(f.type="ref"),Array.isArray(f.enum)&&f.enum.length>0&&(f.enumEnabled=!0,f.enumInput=f.enum.map(h=>String(h))),f.exclusiveMinimum!=null&&(typeof f.exclusiveMinimum=="boolean"?f.exclusiveMinimum===!0&&f.minimum!=null&&(f.exclusiveMin=f.minimum,delete f.minimum):f.exclusiveMin=f.exclusiveMinimum,delete f.exclusiveMinimum),f.exclusiveMaximum!=null&&(typeof f.exclusiveMaximum=="boolean"?f.exclusiveMaximum===!0&&f.maximum!=null&&(f.exclusiveMax=f.maximum,delete f.maximum):f.exclusiveMax=f.exclusiveMaximum,delete f.exclusiveMaximum),typeof f.properties=="object"&&!Array.isArray(f.properties)){const h=[];Object.keys(f.properties).forEach(w=>{const S=f.properties[w];h.push({id:Ye(6),key:w,isRequired:f.required?.includes(w)||!1,schema:t(S)})}),f.properties=h}return typeof f.items=="object"&&f.items!==null&&!Array.isArray(f.items)?f.items=t(f.items):Array.isArray(f.items)&&(f.items=f.items.map(h=>t(h))),f},{properties:r,required:n,$defs:s,definitions:o,...i}=e,a=s??o,c=t(i),u=[];r&&Object.keys(r).forEach(y=>{u.push({id:Ye(6),key:y,isRequired:n?.includes(y)||!1,schema:t(r[y])})}),u.length===0&&(i.type==="object"||!i.type)&&u.push({id:Ye(6),key:"",isRequired:!1,schema:{type:"string"}});const m=[];return a&&Object.keys(a).forEach(y=>{m.push({id:Ye(6),key:y,schema:t(a[y])})}),{root:c,properties:u,definitions:m}};function M(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,m=Object.keys(u);for(let y=0;y<m.length;y++){const f=m[y];f in a||(a[f]=u[f].bind(a))}}const s=r?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var c;const u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const m of u._zod.deferred)m();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class _t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gs extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const _s={};function st(e){return _s}function $s(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function gn(e,t){return typeof t=="bigint"?t.toString():t}function _n(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $n(e){return e==null}function bn(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function nc(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let s=(n.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const o=r>s?r:s,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}const bs=Symbol("evaluating");function de(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bs)return n===void 0&&(n=bs,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function mt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ot(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function ws(e){return JSON.stringify(e)}function sc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ss="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const oc=_n(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function $t(e){if(xt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(xt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Es(e){return $t(e)?{...e}:Array.isArray(e)?[...e]:e}const ic=new Set(["string","number","symbol"]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function te(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 ac(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const cc={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]};function uc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=ot(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return mt(this,"shape",i),i},checks:[]});return it(e,o)}function dc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=ot(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return mt(this,"shape",i),i},checks:[]});return it(e,o)}function lc(e,t){if(!$t(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=ot(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return mt(this,"shape",o),o}});return it(e,s)}function fc(e,t){if(!$t(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ot(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return mt(this,"shape",n),n}});return it(e,r)}function mc(e,t){const r=ot(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return mt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return it(e,r)}function hc(e,t,r){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ot(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(r)for(const u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return mt(this,"shape",c),c},checks:[]});return it(t,i)}function pc(e,t,r){const n=ot(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return mt(this,"shape",o),o}});return it(t,n)}function bt(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 wt(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Kt(e){return typeof e=="string"?e:e?.message}function at(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=Kt(e.inst?._zod.def?.error?.(e))??Kt(t?.error?.(e))??Kt(r.customError?.(e))??Kt(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tt(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const ks=(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,gn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sn=M("$ZodError",ks),Jt=M("$ZodError",ks,{Parent:Error});function yc(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function vc(e,t=r=>r.message){const r={_errors:[]},n=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>n({issues:i}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let i=r,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return n(e),r}const Ht=e=>(t,r,n,s)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new _t;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>at(c,o,st())));throw Ss(a,s?.callee),a}return i.value},gc=Ht(Jt),Gt=e=>async(t,r,n,s)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>at(c,o,st())));throw Ss(a,s?.callee),a}return i.value},_c=Gt(Jt),Bt=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new _t;return o.issues.length?{success:!1,error:new(e??Sn)(o.issues.map(i=>at(i,s,st())))}:{success:!0,data:o.value}},$c=Bt(Jt),Wt=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>at(i,s,st())))}:{success:!0,data:o.value}},bc=Wt(Jt),wc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ht(e)(t,r,s)},Sc=e=>(t,r,n)=>Ht(e)(t,r,n),Ec=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Gt(e)(t,r,s)},kc=e=>async(t,r,n)=>Gt(e)(t,r,n),Pc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Bt(e)(t,r,s)},Oc=e=>(t,r,n)=>Bt(e)(t,r,n),jc=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wt(e)(t,r,s)},Ac=e=>async(t,r,n)=>Wt(e)(t,r,n),Nc=/^[cC][^\s-]{8,}$/,zc=/^[0-9a-z]+$/,Rc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ic=/^[0-9a-vA-V]{20}$/,Tc=/^[A-Za-z0-9]{27}$/,Cc=/^[a-zA-Z0-9_-]{21}$/,Mc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dc=/^([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})$/,Ps=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)$/,Vc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fc(){return new RegExp(qc,"u")}const Zc=/^(?:(?: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])$/,Uc=/^(([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}|:))$/,xc=/^((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])$/,Lc=/^(([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])$/,Kc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Os=/^[A-Za-z0-9_-]*$/,Jc=/^\+[1-9]\d{6,14}$/,js="(?:(?:\\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])))",Hc=new RegExp(`^${js}$`);function As(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 Gc(e){return new RegExp(`^${As(e)}$`)}function Bc(e){const t=As({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${js}T(?:${n})$`)}const Wc=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Yc=/^-?\d+$/,Ns=/^-?\d+(?:\.\d+)?$/,Xc=/^(?:true|false)$/i,Qc=/^[^A-Z]*$/,eu=/^[^a-z]*$/,De=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),zs={number:"number",bigint:"bigint",object:"date"},Rs=M("$ZodCheckLessThan",(e,t)=>{De.init(e,t);const r=zs[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Is=M("$ZodCheckGreaterThan",(e,t)=>{De.init(e,t);const r=zs[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tu=M("$ZodCheckMultipleOf",(e,t)=>{De.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.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):nc(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})}}),ru=M("$ZodCheckNumberFormat",(e,t)=>{De.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[s,o]=cc[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,r&&(a.pattern=Yc)}),e._zod.check=i=>{const a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),nu=M("$ZodCheckMaxLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const i=wn(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),su=M("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const i=wn(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ou=M("$ZodCheckLengthEquals",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,o=s.length;if(o===t.length)return;const i=wn(s),a=o>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Yt=M("$ZodCheckStringFormat",(e,t)=>{var r,n;De.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),iu=M("$ZodCheckRegex",(e,t)=>{Yt.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})}}),au=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qc),Yt.init(e,t)}),cu=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eu),Yt.init(e,t)}),uu=M("$ZodCheckIncludes",(e,t)=>{De.init(e,t);const r=Lt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),du=M("$ZodCheckStartsWith",(e,t)=>{De.init(e,t);const r=new RegExp(`^${Lt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),lu=M("$ZodCheckEndsWith",(e,t)=>{De.init(e,t);const r=new RegExp(`.*${Lt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),fu=M("$ZodCheckOverwrite",(e,t)=>{De.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class mu{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 n=t.split(`
|
|
2
2
|
`).filter(i=>i),s=Math.min(...n.map(i=>i.length-i.trimStart().length)),o=n.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of o)this.content.push(i)}compile(){const t=Function,r=this?.args,s=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,s.join(`
|
|
3
|
-
`))}}const
|
|
3
|
+
`))}}const hu={major:4,minor:3,patch:6},_e=M("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hu;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const o of s._zod.onattach)o(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,a,c)=>{let u=bt(i),m;for(const y of a){if(y._zod.def.when){if(!y._zod.def.when(i))continue}else if(u)continue;const f=i.issues.length,h=y._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new _t;if(m||h instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await h,i.issues.length!==f&&(u||(u=bt(i,f)))});else{if(i.issues.length===f)continue;u||(u=bt(i,f))}}return m?m.then(()=>i):i},o=(i,a,c)=>{if(bt(i))return i.aborted=!0,i;const u=s(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new _t;return u.then(m=>e._zod.parse(m,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(m=>o(m,i,a)):o(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new _t;return c.then(u=>s(u,n,a))}return s(c,n,a)}}de(e,"~standard",()=>({validate:s=>{try{const o=$c(e,s);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return bc(e,s).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),En=M("$ZodString",(e,t)=>{_e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Wc(e._zod.bag),e._zod.parse=(r,n)=>{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=M("$ZodStringFormat",(e,t)=>{Yt.init(e,t),En.init(e,t)}),pu=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Dc),$e.init(e,t)}),yu=M("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ps(n))}else t.pattern??(t.pattern=Ps());$e.init(e,t)}),vu=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vc),$e.init(e,t)}),gu=M("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.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(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.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=s.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),_u=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fc()),$e.init(e,t)}),$u=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cc),$e.init(e,t)}),bu=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Nc),$e.init(e,t)}),wu=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zc),$e.init(e,t)}),Su=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Rc),$e.init(e,t)}),Eu=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ic),$e.init(e,t)}),ku=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Tc),$e.init(e,t)}),Pu=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Bc(t)),$e.init(e,t)}),Ou=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Hc),$e.init(e,t)}),ju=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Gc(t)),$e.init(e,t)}),Au=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Mc),$e.init(e,t)}),Nu=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Zc),$e.init(e,t),e._zod.bag.format="ipv4"}),zu=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Uc),$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})}}}),Ru=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=xc),$e.init(e,t)}),Iu=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Lc),$e.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[s,o]=n;if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ts(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Tu=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Kc),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ts(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Cu(e){if(!Os.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ts(r)}const Mu=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Os),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Cu(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Du=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Jc),$e.init(e,t)});function Vu(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const qu=M("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=r=>{Vu(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Cs=M("$ZodNumber",(e,t)=>{_e.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ns,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const s=r.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return r;const o=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...o?{received:o}:{}}),r}}),Fu=M("$ZodNumberFormat",(e,t)=>{ru.init(e,t),Cs.init(e,t)}),Zu=M("$ZodBoolean",(e,t)=>{_e.init(e,t),e._zod.pattern=Xc,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),Uu=M("$ZodAny",(e,t)=>{_e.init(e,t),e._zod.parse=r=>r}),xu=M("$ZodUnknown",(e,t)=>{_e.init(e,t),e._zod.parse=r=>r}),Lu=M("$ZodNever",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Ms(e,t,r){e.issues.length&&t.issues.push(...wt(r,e.issues)),t.value[r]=e.value}const Ku=M("$ZodArray",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const o=[];for(let i=0;i<s.length;i++){const a=s[i],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?o.push(c.then(u=>Ms(u,r,i))):Ms(c,r,i)}return o.length?Promise.all(o).then(()=>r):r}});function Xt(e,t,r,n,s){if(e.issues.length){if(s&&!(r in n))return;t.issues.push(...wt(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Ds(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=ac(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Vs(e,t,r,n,s,o){const i=[],a=s.keySet,c=s.catchall._zod,u=c.def.type,m=c.optout==="optional";for(const y in t){if(a.has(y))continue;if(u==="never"){i.push(y);continue}const f=c.run({value:t[y],issues:[]},n);f instanceof Promise?e.push(f.then(h=>Xt(h,r,y,t,m))):Xt(f,r,y,t,m)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Ju=M("$ZodObject",(e,t)=>{if(_e.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=_n(()=>Ds(t));de(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const m=a[u]._zod;if(m.values){c[u]??(c[u]=new Set);for(const y of m.values)c[u].add(y)}}return c});const s=xt,o=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=n.value);const u=a.value;if(!s(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const m=[],y=i.shape;for(const f of i.keys){const h=y[f],w=h._zod.optout==="optional",S=h._zod.run({value:u[f],issues:[]},c);S instanceof Promise?m.push(S.then(p=>Xt(p,a,f,u,w))):Xt(S,a,f,u,w)}return o?Vs(m,u,a,c,n.value,e):m.length?Promise.all(m).then(()=>a):a}}),Hu=M("$ZodObjectJIT",(e,t)=>{Ju.init(e,t);const r=e._zod.parse,n=_n(()=>Ds(t)),s=f=>{const h=new mu(["shape","payload","ctx"]),w=n.value,S=v=>{const g=ws(v);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};h.write("const input = payload.value;");const p=Object.create(null);let _=0;for(const v of w.keys)p[v]=`key_${_++}`;h.write("const newResult = {};");for(const v of w.keys){const g=p[v],d=ws(v),E=f[v]?._zod?.optout==="optional";h.write(`const ${g} = ${S(v)};`),E?h.write(`
|
|
4
4
|
if (${g}.issues.length) {
|
|
5
5
|
if (${d} in input) {
|
|
6
6
|
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
newResult[${d}] = ${g}.value;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
`)}h.write("payload.value = newResult;"),h.write("return payload;");const f=h.compile();return(y,g)=>f(l,y,g)};let o;const i=xt,a=!gs.jitless,u=a&&sc.value,m=t.catchall;let v;e._zod.parse=(l,h)=>{v??(v=n.value);const w=l.value;return i(w)?a&&u&&h?.async===!1&&h.jitless!==!0?(o||(o=s(t.shape)),l=o(l,h),m?Ds([],w,l,h,v,e):l):r(l,h):(l.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),l)}});function Vs(e,t,r,n){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!bt(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>at(i,n,st())))}),t)}const Hu=D("$ZodUnion",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),de(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),de(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),de(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>bn(o.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(r)return n(s,o);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:s.value,issues:[]},o);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Vs(c,s,e,o)):Vs(a,s,e,o)}}),Gu=D("$ZodIntersection",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,o=t.left._zod.run({value:s,issues:[]},n),i=t.right._zod.run({value:s,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,u])=>Fs(r,c,u)):Fs(r,o,i)}});function kn(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($t(e)&&$t(t)){const r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),s={...e,...t};for(const o of n){const i=kn(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],o=t[n],i=kn(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Fs(e,t,r){const n=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(a);for(const a of r.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(a);const o=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),bt(e))return e;const i=kn(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Bu=D("$ZodRecord",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!$t(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const o=[],i=t.keyType._zod.values;if(i){r.value={};const a=new Set;for(const u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const m=t.valueType._zod.run({value:s[u],issues:[]},n);m instanceof Promise?o.push(m.then(v=>{v.issues.length&&r.issues.push(...wt(u,v.issues)),r.value[u]=v.value})):(m.issues.length&&r.issues.push(...wt(u,m.issues)),r.value[u]=m.value)}let c;for(const u in s)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{r.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&As.test(a)&&c.issues.length){const v=t.keyType._zod.run({value:Number(a),issues:[]},n);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(c=v)}if(c.issues.length){t.mode==="loose"?r.value[a]=s[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(v=>at(v,n,st())),input:a,path:[a],inst:e});continue}const m=t.valueType._zod.run({value:s[a],issues:[]},n);m instanceof Promise?o.push(m.then(v=>{v.issues.length&&r.issues.push(...wt(a,v.issues)),r.value[c.value]=v.value})):(m.issues.length&&r.issues.push(...wt(a,m.issues)),r.value[c.value]=m.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Wu=D("$ZodEnum",(e,t)=>{_e.init(e,t);const r=_s(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>oc.has(typeof s)).map(s=>typeof s=="string"?Lt(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return n.has(i)||s.issues.push({code:"invalid_value",values:r,input:i,inst:e}),s}}),Yu=D("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new vs(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(r.value=i,r));if(s instanceof Promise)throw new _t;return r.value=s,r}});function qs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Zs=D("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>qs(o,r.value)):qs(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Xu=D("$ZodExactOptional",(e,t)=>{Zs.init(e,t),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Qu=D("$ZodNullable",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)}|null)$`):void 0}),de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),ed=D("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Us(o,t)):Us(s,t)}});function Us(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const td=D("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),rd=D("$ZodNonOptional",(e,t)=>{_e.init(e,t),de(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>xs(o,e)):xs(s,e)}});function xs(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 nd=D("$ZodCatch",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>at(i,n,st()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(o=>at(o,n,st()))},input:r.value}),r.issues=[]),r)}}),sd=D("$ZodPipe",(e,t)=>{_e.init(e,t),de(e._zod,"values",()=>t.in._zod.values),de(e._zod,"optin",()=>t.in._zod.optin),de(e._zod,"optout",()=>t.out._zod.optout),de(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=t.out._zod.run(r,n);return o instanceof Promise?o.then(i=>Qt(i,t.in,n)):Qt(o,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(o=>Qt(o,t.out,n)):Qt(s,t.out,n)}});function Qt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const od=D("$ZodReadonly",(e,t)=>{_e.init(e,t),de(e._zod,"propValues",()=>t.innerType._zod.propValues),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"optin",()=>t.innerType?._zod?.optin),de(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(Ls):Ls(s)}});function Ls(e){return e.value=Object.freeze(e.value),e}const id=D("$ZodLazy",(e,t)=>{_e.init(e,t),de(e._zod,"innerType",()=>t.getter()),de(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),de(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),de(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),de(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),ad=D("$ZodCustom",(e,t)=>{De.init(e,t),_e.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(o=>Ks(o,r,n,e));Ks(s,r,n,e)}});function Ks(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Tt(s))}}var Js;class cd{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.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 n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ud(){return new cd}(Js=globalThis).__zod_globalRegistry??(Js.__zod_globalRegistry=ud());const Ct=globalThis.__zod_globalRegistry;function dd(e,t){return new e({type:"string",...te(t)})}function ld(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function Hs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function fd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function md(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function hd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function pd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function yd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function vd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function gd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function _d(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function $d(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function bd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function wd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function Sd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function Ed(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function kd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function Pd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function Od(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function jd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Ad(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function Nd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function zd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Rd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function Id(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Td(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function Cd(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Md(e,t){return new e({type:"number",checks:[],...te(t)})}function Dd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function Vd(e,t){return new e({type:"boolean",...te(t)})}function Fd(e){return new e({type:"any"})}function qd(e){return new e({type:"unknown"})}function Zd(e,t){return new e({type:"never",...te(t)})}function Gs(e,t){return new zs({check:"less_than",...te(t),value:e,inclusive:!1})}function Pn(e,t){return new zs({check:"less_than",...te(t),value:e,inclusive:!0})}function Bs(e,t){return new Rs({check:"greater_than",...te(t),value:e,inclusive:!1})}function On(e,t){return new Rs({check:"greater_than",...te(t),value:e,inclusive:!0})}function Ws(e,t){return new eu({check:"multiple_of",...te(t),value:e})}function Ys(e,t){return new ru({check:"max_length",...te(t),maximum:e})}function er(e,t){return new nu({check:"min_length",...te(t),minimum:e})}function Xs(e,t){return new su({check:"length_equals",...te(t),length:e})}function Ud(e,t){return new ou({check:"string_format",format:"regex",...te(t),pattern:e})}function xd(e){return new iu({check:"string_format",format:"lowercase",...te(e)})}function Ld(e){return new au({check:"string_format",format:"uppercase",...te(e)})}function Kd(e,t){return new cu({check:"string_format",format:"includes",...te(t),includes:e})}function Jd(e,t){return new uu({check:"string_format",format:"starts_with",...te(t),prefix:e})}function Hd(e,t){return new du({check:"string_format",format:"ends_with",...te(t),suffix:e})}function St(e){return new lu({check:"overwrite",tx:e})}function Gd(e){return St(t=>t.normalize(e))}function Bd(){return St(e=>e.trim())}function Wd(){return St(e=>e.toLowerCase())}function Yd(){return St(e=>e.toUpperCase())}function Xd(){return St(e=>nc(e))}function Qd(e,t,r){return new e({type:"array",element:t,...te(r)})}function el(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function tl(e){const t=rl(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Tt(n,r.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Tt(s))}},e(r.value,r)));return t}function rl(e,t){const r=new De({check:"custom",...te(t)});return r._zod.check=e,r}function Qs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ct,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ee(e,t,r={path:[],schemaPath:[]}){var n;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{const l=i.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,l,m)}const v=e._zod.parent;v&&(i.ref||(i.ref=v),Ee(v,t,m),t.seen.get(v).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&Ie(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function eo(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(i[0])?.id,l=e.external.uri??(w=>w);if(v)return{ref:l(v)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${l("__shared")}#/${a}/${h}`}}if(i[1]===r)return{ref:"#"};const u=`#/${a}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:u+m}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=s(i);a.def={...a.schema},u&&(a.defId=u);const m=a.schema;for(const v in m)delete m[v];m.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
37
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const l=h.compile();return(v,g)=>l(f,v,g)};let o;const i=xt,a=!_s.jitless,u=a&&oc.value,m=t.catchall;let y;e._zod.parse=(f,h)=>{y??(y=n.value);const w=f.value;return i(w)?a&&u&&h?.async===!1&&h.jitless!==!0?(o||(o=s(t.shape)),f=o(f,h),m?Vs([],w,f,h,y,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),f)}});function qs(e,t,r,n){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!bt(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>at(i,n,st())))}),t)}const Gu=M("$ZodUnion",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),de(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),de(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),de(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>bn(o.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(r)return n(s,o);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:s.value,issues:[]},o);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>qs(c,s,e,o)):qs(a,s,e,o)}}),Bu=M("$ZodIntersection",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,o=t.left._zod.run({value:s,issues:[]},n),i=t.right._zod.run({value:s,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,u])=>Fs(r,c,u)):Fs(r,o,i)}});function kn(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($t(e)&&$t(t)){const r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),s={...e,...t};for(const o of n){const i=kn(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],o=t[n],i=kn(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Fs(e,t,r){const n=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(a);for(const a of r.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(a);const o=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),bt(e))return e;const i=kn(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Wu=M("$ZodRecord",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!$t(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const o=[],i=t.keyType._zod.values;if(i){r.value={};const a=new Set;for(const u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const m=t.valueType._zod.run({value:s[u],issues:[]},n);m instanceof Promise?o.push(m.then(y=>{y.issues.length&&r.issues.push(...wt(u,y.issues)),r.value[u]=y.value})):(m.issues.length&&r.issues.push(...wt(u,m.issues)),r.value[u]=m.value)}let c;for(const u in s)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{r.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Ns.test(a)&&c.issues.length){const y=t.keyType._zod.run({value:Number(a),issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(c=y)}if(c.issues.length){t.mode==="loose"?r.value[a]=s[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(y=>at(y,n,st())),input:a,path:[a],inst:e});continue}const m=t.valueType._zod.run({value:s[a],issues:[]},n);m instanceof Promise?o.push(m.then(y=>{y.issues.length&&r.issues.push(...wt(a,y.issues)),r.value[c.value]=y.value})):(m.issues.length&&r.issues.push(...wt(a,m.issues)),r.value[c.value]=m.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Yu=M("$ZodEnum",(e,t)=>{_e.init(e,t);const r=$s(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>ic.has(typeof s)).map(s=>typeof s=="string"?Lt(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return n.has(i)||s.issues.push({code:"invalid_value",values:r,input:i,inst:e}),s}}),Xu=M("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new gs(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(r.value=i,r));if(s instanceof Promise)throw new _t;return r.value=s,r}});function Zs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Us=M("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Zs(o,r.value)):Zs(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Qu=M("$ZodExactOptional",(e,t)=>{Us.init(e,t),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ed=M("$ZodNullable",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)}|null)$`):void 0}),de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),td=M("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>xs(o,t)):xs(s,t)}});function xs(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const rd=M("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),nd=M("$ZodNonOptional",(e,t)=>{_e.init(e,t),de(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Ls(o,e)):Ls(s,e)}});function Ls(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 sd=M("$ZodCatch",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>at(i,n,st()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(o=>at(o,n,st()))},input:r.value}),r.issues=[]),r)}}),od=M("$ZodPipe",(e,t)=>{_e.init(e,t),de(e._zod,"values",()=>t.in._zod.values),de(e._zod,"optin",()=>t.in._zod.optin),de(e._zod,"optout",()=>t.out._zod.optout),de(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=t.out._zod.run(r,n);return o instanceof Promise?o.then(i=>Qt(i,t.in,n)):Qt(o,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(o=>Qt(o,t.out,n)):Qt(s,t.out,n)}});function Qt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const id=M("$ZodReadonly",(e,t)=>{_e.init(e,t),de(e._zod,"propValues",()=>t.innerType._zod.propValues),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"optin",()=>t.innerType?._zod?.optin),de(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(Ks):Ks(s)}});function Ks(e){return e.value=Object.freeze(e.value),e}const ad=M("$ZodLazy",(e,t)=>{_e.init(e,t),de(e._zod,"innerType",()=>t.getter()),de(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),de(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),de(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),de(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),cd=M("$ZodCustom",(e,t)=>{De.init(e,t),_e.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(o=>Js(o,r,n,e));Js(s,r,n,e)}});function Js(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Tt(s))}}var Hs;class ud{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.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 n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dd(){return new ud}(Hs=globalThis).__zod_globalRegistry??(Hs.__zod_globalRegistry=dd());const Ct=globalThis.__zod_globalRegistry;function ld(e,t){return new e({type:"string",...te(t)})}function fd(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function Gs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function md(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function hd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function pd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function yd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function vd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function gd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function _d(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function $d(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function bd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function wd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function Sd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function Ed(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function kd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function Pd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function Od(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function jd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function Ad(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Nd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function zd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function Rd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Id(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function Td(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Cd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function Md(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Dd(e,t){return new e({type:"number",checks:[],...te(t)})}function Vd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function qd(e,t){return new e({type:"boolean",...te(t)})}function Fd(e){return new e({type:"any"})}function Zd(e){return new e({type:"unknown"})}function Ud(e,t){return new e({type:"never",...te(t)})}function Bs(e,t){return new Rs({check:"less_than",...te(t),value:e,inclusive:!1})}function Pn(e,t){return new Rs({check:"less_than",...te(t),value:e,inclusive:!0})}function Ws(e,t){return new Is({check:"greater_than",...te(t),value:e,inclusive:!1})}function On(e,t){return new Is({check:"greater_than",...te(t),value:e,inclusive:!0})}function Ys(e,t){return new tu({check:"multiple_of",...te(t),value:e})}function Xs(e,t){return new nu({check:"max_length",...te(t),maximum:e})}function er(e,t){return new su({check:"min_length",...te(t),minimum:e})}function Qs(e,t){return new ou({check:"length_equals",...te(t),length:e})}function xd(e,t){return new iu({check:"string_format",format:"regex",...te(t),pattern:e})}function Ld(e){return new au({check:"string_format",format:"lowercase",...te(e)})}function Kd(e){return new cu({check:"string_format",format:"uppercase",...te(e)})}function Jd(e,t){return new uu({check:"string_format",format:"includes",...te(t),includes:e})}function Hd(e,t){return new du({check:"string_format",format:"starts_with",...te(t),prefix:e})}function Gd(e,t){return new lu({check:"string_format",format:"ends_with",...te(t),suffix:e})}function St(e){return new fu({check:"overwrite",tx:e})}function Bd(e){return St(t=>t.normalize(e))}function Wd(){return St(e=>e.trim())}function Yd(){return St(e=>e.toLowerCase())}function Xd(){return St(e=>e.toUpperCase())}function Qd(){return St(e=>sc(e))}function el(e,t,r){return new e({type:"array",element:t,...te(r)})}function tl(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function rl(e){const t=nl(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Tt(n,r.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Tt(s))}},e(r.value,r)));return t}function nl(e,t){const r=new De({check:"custom",...te(t)});return r._zod.check=e,r}function eo(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ct,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ee(e,t,r={path:[],schemaPath:[]}){var n;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{const f=i.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,f,m)}const y=e._zod.parent;y&&(i.ref||(i.ref=y),Ee(y,t,m),t.seen.get(y).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&Ie(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function to(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(i[0])?.id,f=e.external.uri??(w=>w);if(y)return{ref:f(y)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===r)return{ref:"#"};const u=`#/${a}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:u+m}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=s(i);a.def={...a.schema},u&&(a.defId=u);const m=a.schema;for(const y in m)delete m[y];m.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
38
|
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function to(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},m=a.ref;if(a.ref=null,m){n(m);const l=e.seen.get(m),h=l.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),i._zod.parent===m)for(const S in c)S==="$ref"||S==="allOf"||S in u||delete c[S];if(h.$ref&&l.def)for(const S in c)S==="$ref"||S==="allOf"||S in l.def&&JSON.stringify(c[S])===JSON.stringify(l.def[S])&&delete c[S]}const v=i._zod.parent;if(v&&v!==m){n(v);const l=e.seen.get(v);if(l?.schema.$ref&&(c.$ref=l.schema.$ref,l.def))for(const h in c)h==="$ref"||h==="allOf"||h in l.def&&JSON.stringify(c[h])===JSON.stringify(l.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())n(i[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(i)}Object.assign(s,r.def??r.schema);const o=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const i=JSON.parse(JSON.stringify(s));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:tr(t,"input",e.processors),output:tr(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function Ie(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ie(n.element,r);if(n.type==="set")return Ie(n.valueType,r);if(n.type==="lazy")return Ie(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ie(n.innerType,r);if(n.type==="intersection")return Ie(n.left,r)||Ie(n.right,r);if(n.type==="record"||n.type==="map")return Ie(n.keyType,r)||Ie(n.valueType,r);if(n.type==="pipe")return Ie(n.in,r)||Ie(n.out,r);if(n.type==="object"){for(const s in n.shape)if(Ie(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(Ie(s,r))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(Ie(s,r))return!0;return!!(n.rest&&Ie(n.rest,r))}return!1}const nl=(e,t={})=>r=>{const n=Qs({...r,processors:t});return Ee(e,n),eo(n,e),to(n,e)},tr=(e,t,r={})=>n=>{const{libraryOptions:s,target:o}=n??{},i=Qs({...s??{},target:o,io:t,processors:r});return Ee(e,i),eo(i,e),to(i,e)},sl={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ol=(e,t,r,n)=>{const s=r;s.type="string";const{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=sl[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),u&&(s.contentEncoding=u),c&&c.size>0){const m=[...c];m.length===1?s.pattern=m[0].source:m.length>1&&(s.allOf=[...m.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},il=(e,t,r,n)=>{const s=r,{minimum:o,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:m}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=m,s.exclusiveMinimum=!0):s.exclusiveMinimum=m),typeof o=="number"&&(s.minimum=o,typeof m=="number"&&t.target!=="draft-04"&&(m>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof i=="number"&&(s.maximum=i,typeof u=="number"&&t.target!=="draft-04"&&(u<=i?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},al=(e,t,r,n)=>{r.type="boolean"},cl=(e,t,r,n)=>{r.not={}},ul=(e,t,r,n)=>{},dl=(e,t,r,n)=>{},ll=(e,t,r,n)=>{const s=e._zod.def,o=_s(s.entries);o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},fl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ml=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hl=(e,t,r,n)=>{const s=r,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Ee(o.element,t,{...n,path:[...n.path,"items"]})},pl=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const u in i)s.properties[u]=Ee(i[u],t,{...n,path:[...n.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const m=o.shape[u]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(s.required=Array.from(c)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=Ee(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},yl=(e,t,r,n)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>Ee(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},vl=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=Ee(s.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];r.allOf=c},gl=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object";const i=o.keyType,c=i._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){const m=Ee(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(const v of c)s.patternProperties[v.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Ee(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=Ee(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const u=i._zod.values;if(u){const m=[...u].filter(v=>typeof v=="string"||typeof v=="number");m.length>0&&(s.required=m)}},_l=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},$l=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},bl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},wl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Sl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},El=(e,t,r,n)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Ee(o,t,n);const i=t.seen.get(e);i.ref=o},kl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.readOnly=!0},ro=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},Pl=(e,t,r,n)=>{const s=e._zod.innerType;Ee(s,t,n);const o=t.seen.get(e);o.ref=s},Ol=D("ZodISODateTime",(e,t)=>{ku.init(e,t),we.init(e,t)});function jl(e){return Rd(Ol,e)}const Al=D("ZodISODate",(e,t)=>{Pu.init(e,t),we.init(e,t)});function Nl(e){return Id(Al,e)}const zl=D("ZodISOTime",(e,t)=>{Ou.init(e,t),we.init(e,t)});function Rl(e){return Td(zl,e)}const Il=D("ZodISODuration",(e,t)=>{ju.init(e,t),we.init(e,t)});function Tl(e){return Cd(Il,e)}const Ke=D("ZodError",(e,t)=>{Sn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>yc(e,r)},flatten:{value:r=>pc(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,gn,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,gn,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Cl=Ht(Ke),Ml=Gt(Ke),Dl=Bt(Ke),Vl=Wt(Ke),Fl=bc(Ke),ql=wc(Ke),Zl=Sc(Ke),Ul=Ec(Ke),xl=kc(Ke),Ll=Pc(Ke),Kl=Oc(Ke),Jl=jc(Ke),be=D("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tr(e,"input"),output:tr(e,"output")}}),e.toJSONSchema=nl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ot(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>it(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Cl(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Dl(e,r,n),e.parseAsync=async(r,n)=>Ml(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Vl(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Fl(e,r,n),e.decode=(r,n)=>ql(e,r,n),e.encodeAsync=async(r,n)=>Zl(e,r,n),e.decodeAsync=async(r,n)=>Ul(e,r,n),e.safeEncode=(r,n)=>xl(e,r,n),e.safeDecode=(r,n)=>Ll(e,r,n),e.safeEncodeAsync=async(r,n)=>Kl(e,r,n),e.safeDecodeAsync=async(r,n)=>Jl(e,r,n),e.refine=(r,n)=>e.check(Zf(r,n)),e.superRefine=r=>e.check(Uf(r)),e.overwrite=r=>e.check(St(r)),e.optional=()=>mo(e),e.exactOptional=()=>Of(e),e.nullable=()=>ho(e),e.nullish=()=>mo(ho(e)),e.nonoptional=r=>If(e,r),e.array=()=>Ye(e),e.or=r=>jn([e,r]),e.and=r=>wf(e,r),e.transform=r=>yo(e,kf(r)),e.default=r=>Nf(e,r),e.prefault=r=>Rf(e,r),e.catch=r=>Cf(e,r),e.pipe=r=>yo(e,r),e.readonly=()=>Vf(e),e.describe=r=>{const n=e.clone();return Ct.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ct.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ct.get(e);const n=e.clone();return Ct.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),no=D("_ZodString",(e,t)=>{En.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>ol(e,n,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Ud(...n)),e.includes=(...n)=>e.check(Kd(...n)),e.startsWith=(...n)=>e.check(Jd(...n)),e.endsWith=(...n)=>e.check(Hd(...n)),e.min=(...n)=>e.check(er(...n)),e.max=(...n)=>e.check(Ys(...n)),e.length=(...n)=>e.check(Xs(...n)),e.nonempty=(...n)=>e.check(er(1,...n)),e.lowercase=n=>e.check(xd(n)),e.uppercase=n=>e.check(Ld(n)),e.trim=()=>e.check(Bd()),e.normalize=(...n)=>e.check(Gd(...n)),e.toLowerCase=()=>e.check(Wd()),e.toUpperCase=()=>e.check(Yd()),e.slugify=()=>e.check(Xd())}),Hl=D("ZodString",(e,t)=>{En.init(e,t),no.init(e,t),e.email=r=>e.check(ld(Gl,r)),e.url=r=>e.check(yd(Bl,r)),e.jwt=r=>e.check(zd(lf,r)),e.emoji=r=>e.check(vd(Wl,r)),e.guid=r=>e.check(Hs(so,r)),e.uuid=r=>e.check(fd(rr,r)),e.uuidv4=r=>e.check(md(rr,r)),e.uuidv6=r=>e.check(hd(rr,r)),e.uuidv7=r=>e.check(pd(rr,r)),e.nanoid=r=>e.check(gd(Yl,r)),e.guid=r=>e.check(Hs(so,r)),e.cuid=r=>e.check(_d(Xl,r)),e.cuid2=r=>e.check($d(Ql,r)),e.ulid=r=>e.check(bd(ef,r)),e.base64=r=>e.check(jd(cf,r)),e.base64url=r=>e.check(Ad(uf,r)),e.xid=r=>e.check(wd(tf,r)),e.ksuid=r=>e.check(Sd(rf,r)),e.ipv4=r=>e.check(Ed(nf,r)),e.ipv6=r=>e.check(kd(sf,r)),e.cidrv4=r=>e.check(Pd(of,r)),e.cidrv6=r=>e.check(Od(af,r)),e.e164=r=>e.check(Nd(df,r)),e.datetime=r=>e.check(jl(r)),e.date=r=>e.check(Nl(r)),e.time=r=>e.check(Rl(r)),e.duration=r=>e.check(Tl(r))});function Te(e){return dd(Hl,e)}const we=D("ZodStringFormat",(e,t)=>{$e.init(e,t),no.init(e,t)}),Gl=D("ZodEmail",(e,t)=>{yu.init(e,t),we.init(e,t)}),so=D("ZodGUID",(e,t)=>{hu.init(e,t),we.init(e,t)}),rr=D("ZodUUID",(e,t)=>{pu.init(e,t),we.init(e,t)}),Bl=D("ZodURL",(e,t)=>{vu.init(e,t),we.init(e,t)}),Wl=D("ZodEmoji",(e,t)=>{gu.init(e,t),we.init(e,t)}),Yl=D("ZodNanoID",(e,t)=>{_u.init(e,t),we.init(e,t)}),Xl=D("ZodCUID",(e,t)=>{$u.init(e,t),we.init(e,t)}),Ql=D("ZodCUID2",(e,t)=>{bu.init(e,t),we.init(e,t)}),ef=D("ZodULID",(e,t)=>{wu.init(e,t),we.init(e,t)}),tf=D("ZodXID",(e,t)=>{Su.init(e,t),we.init(e,t)}),rf=D("ZodKSUID",(e,t)=>{Eu.init(e,t),we.init(e,t)}),nf=D("ZodIPv4",(e,t)=>{Au.init(e,t),we.init(e,t)}),sf=D("ZodIPv6",(e,t)=>{Nu.init(e,t),we.init(e,t)}),of=D("ZodCIDRv4",(e,t)=>{zu.init(e,t),we.init(e,t)}),af=D("ZodCIDRv6",(e,t)=>{Ru.init(e,t),we.init(e,t)}),cf=D("ZodBase64",(e,t)=>{Iu.init(e,t),we.init(e,t)}),uf=D("ZodBase64URL",(e,t)=>{Cu.init(e,t),we.init(e,t)}),df=D("ZodE164",(e,t)=>{Mu.init(e,t),we.init(e,t)}),lf=D("ZodJWT",(e,t)=>{Vu.init(e,t),we.init(e,t)}),oo=D("ZodNumber",(e,t)=>{Ts.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>il(e,n,s),e.gt=(n,s)=>e.check(Bs(n,s)),e.gte=(n,s)=>e.check(On(n,s)),e.min=(n,s)=>e.check(On(n,s)),e.lt=(n,s)=>e.check(Gs(n,s)),e.lte=(n,s)=>e.check(Pn(n,s)),e.max=(n,s)=>e.check(Pn(n,s)),e.int=n=>e.check(io(n)),e.safe=n=>e.check(io(n)),e.positive=n=>e.check(Bs(0,n)),e.nonnegative=n=>e.check(On(0,n)),e.negative=n=>e.check(Gs(0,n)),e.nonpositive=n=>e.check(Pn(0,n)),e.multipleOf=(n,s)=>e.check(Ws(n,s)),e.step=(n,s)=>e.check(Ws(n,s)),e.finite=()=>e;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 qe(e){return Md(oo,e)}const ff=D("ZodNumberFormat",(e,t)=>{Fu.init(e,t),oo.init(e,t)});function io(e){return Dd(ff,e)}const mf=D("ZodBoolean",(e,t)=>{qu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>al(e,r,n)});function nr(e){return Vd(mf,e)}const hf=D("ZodAny",(e,t)=>{Zu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ul()});function ao(){return Fd(hf)}const pf=D("ZodUnknown",(e,t)=>{Uu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>dl()});function co(){return qd(pf)}const yf=D("ZodNever",(e,t)=>{xu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>cl(e,r,n)});function vf(e){return Zd(yf,e)}const gf=D("ZodArray",(e,t)=>{Lu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>hl(e,r,n,s),e.element=t.element,e.min=(r,n)=>e.check(er(r,n)),e.nonempty=r=>e.check(er(1,r)),e.max=(r,n)=>e.check(Ys(r,n)),e.length=(r,n)=>e.check(Xs(r,n)),e.unwrap=()=>e.element});function Ye(e,t){return Qd(gf,e,t)}const _f=D("ZodObject",(e,t)=>{Ju.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pl(e,r,n,s),de(e,"shape",()=>t.shape),e.keyof=()=>lo(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:co()}),e.loose=()=>e.clone({...e._zod.def,catchall:co()}),e.strict=()=>e.clone({...e._zod.def,catchall:vf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>dc(e,r),e.safeExtend=r=>lc(e,r),e.merge=r=>fc(e,r),e.pick=r=>cc(e,r),e.omit=r=>uc(e,r),e.partial=(...r)=>mc(fo,e,r[0]),e.required=(...r)=>hc(po,e,r[0])});function sr(e,t){const r={type:"object",shape:e??{},...te(t)};return new _f(r)}const $f=D("ZodUnion",(e,t)=>{Hu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>yl(e,r,n,s),e.options=t.options});function jn(e,t){return new $f({type:"union",options:e,...te(t)})}const bf=D("ZodIntersection",(e,t)=>{Gu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vl(e,r,n,s)});function wf(e,t){return new bf({type:"intersection",left:e,right:t})}const Sf=D("ZodRecord",(e,t)=>{Bu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>gl(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function uo(e,t,r){return new Sf({type:"record",keyType:e,valueType:t,...te(r)})}const An=D("ZodEnum",(e,t)=>{Wu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>ll(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const o={};for(const i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new An({...t,checks:[],...te(s),entries:o})},e.exclude=(n,s)=>{const o={...t.entries};for(const i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new An({...t,checks:[],...te(s),entries:o})}});function lo(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new An({type:"enum",entries:r,...te(t)})}const Ef=D("ZodTransform",(e,t)=>{Yu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ml(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new vs(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(Tt(o,r.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Tt(i))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(o=>(r.value=o,r)):(r.value=s,r)}});function kf(e){return new Ef({type:"transform",transform:e})}const fo=D("ZodOptional",(e,t)=>{Zs.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ro(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function mo(e){return new fo({type:"optional",innerType:e})}const Pf=D("ZodExactOptional",(e,t)=>{Xu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ro(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Of(e){return new Pf({type:"optional",innerType:e})}const jf=D("ZodNullable",(e,t)=>{Qu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_l(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new jf({type:"nullable",innerType:e})}const Af=D("ZodDefault",(e,t)=>{ed.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nf(e,t){return new Af({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ss(t)}})}const zf=D("ZodPrefault",(e,t)=>{td.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>wl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Rf(e,t){return new zf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ss(t)}})}const po=D("ZodNonOptional",(e,t)=>{rd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>$l(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function If(e,t){return new po({type:"nonoptional",innerType:e,...te(t)})}const Tf=D("ZodCatch",(e,t)=>{nd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Sl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Cf(e,t){return new Tf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Mf=D("ZodPipe",(e,t)=>{sd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>El(e,r,n,s),e.in=t.in,e.out=t.out});function yo(e,t){return new Mf({type:"pipe",in:e,out:t})}const Df=D("ZodReadonly",(e,t)=>{od.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>kl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Vf(e){return new Df({type:"readonly",innerType:e})}const Ff=D("ZodLazy",(e,t)=>{id.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Pl(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});function ct(e){return new Ff({type:"lazy",getter:e})}const qf=D("ZodCustom",(e,t)=>{ad.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>fl(e,r)});function Zf(e,t={}){return el(qf,e,t)}function Uf(e){return tl(e)}const Ze=sr({type:lo(["string","number","integer","boolean","object","array","ref"]).optional(),title:Te().optional(),description:Te().optional(),default:ao().optional(),minimum:qe().optional(),maximum:qe().optional(),exclusiveMin:qe().optional(),exclusiveMax:qe().optional(),multipleOf:qe().optional(),minLength:qe().optional(),maxLength:qe().optional(),minContains:qe().optional(),maxContains:qe().optional(),minProperties:qe().optional(),maxProperties:qe().optional(),isModifiable:nr().optional(),"x-modifiable":Ye(Te()).optional(),pattern:Te().optional(),format:Te().optional(),minItems:qe().optional(),maxItems:qe().optional(),uniqueItems:nr().optional(),enum:Ye(ao()).optional(),$id:Te().optional(),$schema:Te().optional(),$ref:Te().optional()}).extend({properties:ct(()=>uo(Te(),Ze)).optional(),items:ct(()=>jn([Ze,Ye(Ze)])).optional(),required:Ye(Te()).optional(),additionalProperties:ct(()=>jn([nr(),Ze])).optional(),allOf:ct(()=>Ye(Ze)).optional(),anyOf:ct(()=>Ye(Ze)).optional(),oneOf:ct(()=>Ye(Ze)).optional(),not:ct(()=>Ze).optional(),$defs:ct(()=>uo(Te(),Ze)).optional()}),vo=sr({root:Ze,properties:Ye(sr({id:Te(),key:Te().min(1),isRequired:nr(),schema:Ze})),definitions:Ye(sr({id:Te(),key:Te().min(1),schema:Ze}))});var Mt=e=>e.type==="checkbox",ht=e=>e instanceof Date,Ve=e=>e==null;const go=e=>typeof e=="object";var Pe=e=>!Ve(e)&&!Array.isArray(e)&&go(e)&&!ht(e),xf=e=>Pe(e)&&e.target?Mt(e.target)?e.target.checked:e.target.value:e,Lf=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Kf=(e,t)=>e.has(Lf(t)),Jf=e=>{const t=e.constructor&&e.constructor.prototype;return Pe(t)&&t.hasOwnProperty("isPrototypeOf")},Nn=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Nn&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Pe(e)&&Jf(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=ge(e[s]));return n}var or=e=>/^\w*$/.test(e),ve=e=>e===void 0,ir=e=>Array.isArray(e)?e.filter(Boolean):[],zn=e=>ir(e.replace(/["|']|\]/g,"").split(/\.|\[/)),W=(e,t,r)=>{if(!t||!Pe(e))return r;const n=(or(t)?[t]:zn(t)).reduce((s,o)=>Ve(s)?s:s[o],e);return ve(n)||n===e?ve(e[t])?r:e[t]:n},Xe=e=>typeof e=="boolean",He=e=>typeof e=="function",he=(e,t,r)=>{let n=-1;const s=or(t)?[t]:zn(t),o=s.length,i=o-1;for(;++n<o;){const a=s[n];let c=r;if(n!==i){const u=e[a];c=Pe(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const _o={BLUR:"blur",FOCUS_OUT:"focusout"},Je={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},et={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},$o=ee.createContext(null);$o.displayName="HookFormControlContext";const Hf=()=>ee.useContext($o);var Gf=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==Je.all&&(t._proxyFormState[i]=!n||Je.all),e[i]}});return s};const bo=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;var Ue=e=>typeof e=="string",Bf=(e,t,r,n,s)=>Ue(e)?(n&&t.watch.add(e),W(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),W(r,o))):(n&&(t.watchAll=!0),r),Rn=e=>Ve(e)||!go(e);function ut(e,t,r=new WeakSet){if(Rn(e)||Rn(t))return Object.is(e,t);if(ht(e)&&ht(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const i=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(ht(i)&&ht(a)||Pe(i)&&Pe(a)||Array.isArray(i)&&Array.isArray(a)?!ut(i,a,r):!Object.is(i,a))return!1}}return!0}const Wf=ee.createContext(null);Wf.displayName="HookFormContext";var In=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Fe=e=>Array.isArray(e)?e:[e],wo=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function So(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&Pe(s)&&o){const i=So(s,o);Pe(i)&&(r[n]=i)}else e[n]&&(r[n]=o)}return r}var Re=e=>Pe(e)&&!Object.keys(e).length,Tn=e=>e.type==="file",ar=e=>{if(!Nn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Eo=e=>e.type==="select-multiple",Cn=e=>e.type==="radio",Yf=e=>Cn(e)||Mt(e),Mn=e=>ar(e)&&e.isConnected;function Xf(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=ve(e)?n++:e[t[n++]];return e}function Qf(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function ke(e,t){const r=Array.isArray(t)?t:or(t)?[t]:zn(t),n=r.length===1?e:Xf(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Pe(n)&&Re(n)||Array.isArray(n)&&Qf(n))&&ke(e,r.slice(0,-1)),e}var em=e=>{for(const t in e)if(He(e[t]))return!0;return!1};function ko(e){return Array.isArray(e)||Pe(e)&&!em(e)}function Dn(e,t={}){for(const r in e){const n=e[r];ko(n)?(t[r]=Array.isArray(n)?[]:{},Dn(n,t[r])):ve(n)||(t[r]=!0)}return t}function Et(e,t,r){r||(r=Dn(t));for(const n in e){const s=e[n];if(ko(s))ve(t)||Rn(r[n])?r[n]=Dn(s,Array.isArray(s)?[]:{}):Et(s,Ve(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!ut(s,o)}}return r}const Po={value:!1,isValid:!1},Oo={value:!0,isValid:!0};var jo=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ve(e[0].attributes.value)?ve(e[0].value)||e[0].value===""?Oo:{value:e[0].value,isValid:!0}:Oo:Po}return Po},Ao=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ve(e)?e:t?e===""?NaN:e&&+e:r&&Ue(e)?new Date(e):n?n(e):e;const No={isValid:!1,value:null};var zo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,No):No;function Ro(e){const t=e.ref;return Tn(t)?t.files:Cn(t)?zo(e.refs).value:Eo(t)?[...t.selectedOptions].map(({value:r})=>r):Mt(t)?jo(e.refs).value:Ao(ve(t.value)?e.ref.value:t.value,e)}var tm=(e,t,r,n)=>{const s={};for(const o of e){const i=W(t,o);i&&he(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},cr=e=>e instanceof RegExp,Dt=e=>ve(e)?e:cr(e)?e.source:Pe(e)?cr(e.value)?e.value.source:e.value:e,kt=e=>({isOnSubmit:!e||e===Je.onSubmit,isOnBlur:e===Je.onBlur,isOnChange:e===Je.onChange,isOnAll:e===Je.all,isOnTouch:e===Je.onTouched});const Io="AsyncFunction";var rm=e=>!!e&&!!e.validate&&!!(He(e.validate)&&e.validate.constructor.name===Io||Pe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Io)),nm=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Vn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Pt=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=W(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Pt(a,t))break}else if(Pe(a)&&Pt(a,t))break}}};function To(e,t,r){const n=W(e,r);if(n||or(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=W(t,o),a=W(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:r}}var sm=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Re(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||Je.all))},om=(e,t,r)=>!e||!t||e===t||Fe(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),im=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,am=(e,t)=>!ir(W(e,t)).length&&ke(e,t),Co=(e,t,r)=>{const n=Fe(W(e,r));return he(n,"root",t[r]),he(e,r,n),e};function Mo(e,t,r="validate"){if(Ue(e)||Array.isArray(e)&&e.every(Ue)||Xe(e)&&!e)return{type:r,message:Ue(e)?e:"",ref:t}}var Ot=e=>Pe(e)&&!cr(e)?e:{value:e,message:""},Fn=async(e,t,r,n,s,o)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:m,min:v,max:l,pattern:h,validate:w,name:S,valueAsNumber:p,mount:_}=e._f,f=W(r,S);if(!_||t.has(S))return{};const y=a?a[0]:i,g=V=>{s&&y.reportValidity&&(y.setCustomValidity(Xe(V)?"":V||""),y.reportValidity())},d={},$=Cn(i),E=Mt(i),R=$||E,Z=(p||Tn(i))&&ve(i.value)&&ve(f)||ar(i)&&i.value===""||f===""||Array.isArray(f)&&!f.length,L=In.bind(null,S,n,d),F=(V,U,K,re=et.maxLength,ye=et.minLength)=>{const me=V?U:K;d[S]={type:V?re:ye,message:me,ref:i,...L(V?re:ye,me)}};if(o?!Array.isArray(f)||!f.length:c&&(!R&&(Z||Ve(f))||Xe(f)&&!f||E&&!jo(a).isValid||$&&!zo(a).isValid)){const{value:V,message:U}=Ue(c)?{value:!!c,message:c}:Ot(c);if(V&&(d[S]={type:et.required,message:U,ref:y,...L(et.required,U)},!n))return g(U),d}if(!Z&&(!Ve(v)||!Ve(l))){let V,U;const K=Ot(l),re=Ot(v);if(!Ve(f)&&!isNaN(f)){const ye=i.valueAsNumber||f&&+f;Ve(K.value)||(V=ye>K.value),Ve(re.value)||(U=ye<re.value)}else{const ye=i.valueAsDate||new Date(f),me=M=>new Date(new Date().toDateString()+" "+M),ue=i.type=="time",Oe=i.type=="week";Ue(K.value)&&f&&(V=ue?me(f)>me(K.value):Oe?f>K.value:ye>new Date(K.value)),Ue(re.value)&&f&&(U=ue?me(f)<me(re.value):Oe?f<re.value:ye<new Date(re.value))}if((V||U)&&(F(!!V,K.message,re.message,et.max,et.min),!n))return g(d[S].message),d}if((u||m)&&!Z&&(Ue(f)||o&&Array.isArray(f))){const V=Ot(u),U=Ot(m),K=!Ve(V.value)&&f.length>+V.value,re=!Ve(U.value)&&f.length<+U.value;if((K||re)&&(F(K,V.message,U.message),!n))return g(d[S].message),d}if(h&&!Z&&Ue(f)){const{value:V,message:U}=Ot(h);if(cr(V)&&!f.match(V)&&(d[S]={type:et.pattern,message:U,ref:i,...L(et.pattern,U)},!n))return g(U),d}if(w){if(He(w)){const V=await w(f,r),U=Mo(V,y);if(U&&(d[S]={...U,...L(et.validate,U.message)},!n))return g(U.message),d}else if(Pe(w)){let V={};for(const U in w){if(!Re(V)&&!n)break;const K=Mo(await w[U](f,r),y,U);K&&(V={...K,...L(U,K.message)},g(K.message),n&&(d[S]=V))}if(!Re(V)&&(d[S]={ref:y,...V},!n))return d}}return g(!0),d};const cm={mode:Je.onSubmit,reValidateMode:Je.onChange,shouldFocusError:!0};function um(e={}){let t={...cm,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:He(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Pe(t.defaultValues)||Pe(t.values)?ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:ge(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={...m};let l={...v};const h={array:wo(),state:wo()},w=t.criteriaMode===Je.all,S=k=>N=>{clearTimeout(u),u=setTimeout(k,N)},p=async k=>{if(!i.keepIsValid&&!t.disabled&&(v.isValid||l.isValid||k)){let N;t.resolver?(N=Re((await R()).errors),_()):N=await L(n,!0),N!==r.isValid&&h.state.next({isValid:N})}},_=(k,N)=>{!t.disabled&&(v.isValidating||v.validatingFields||l.isValidating||l.validatingFields)&&((k||Array.from(a.mount)).forEach(I=>{I&&(N?he(r.validatingFields,I,N):ke(r.validatingFields,I))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Re(r.validatingFields)}))},f=(k,N=[],I,B,J=!0,x=!0)=>{if(B&&I&&!t.disabled){if(i.action=!0,x&&Array.isArray(W(n,k))){const Q=I(W(n,k),B.argA,B.argB);J&&he(n,k,Q)}if(x&&Array.isArray(W(r.errors,k))){const Q=I(W(r.errors,k),B.argA,B.argB);J&&he(r.errors,k,Q),am(r.errors,k)}if((v.touchedFields||l.touchedFields)&&x&&Array.isArray(W(r.touchedFields,k))){const Q=I(W(r.touchedFields,k),B.argA,B.argB);J&&he(r.touchedFields,k,Q)}(v.dirtyFields||l.dirtyFields)&&(r.dirtyFields=Et(s,o)),h.state.next({name:k,isDirty:V(k,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else he(o,k,N)},y=(k,N)=>{he(r.errors,k,N),h.state.next({errors:r.errors})},g=k=>{r.errors=k,h.state.next({errors:r.errors,isValid:!1})},d=(k,N,I,B)=>{const J=W(n,k);if(J){const x=W(o,k,ve(I)?W(s,k):I);ve(x)||B&&B.defaultChecked||N?he(o,k,N?x:Ro(J._f)):re(k,x),i.mount&&!i.action&&p()}},$=(k,N,I,B,J)=>{let x=!1,Q=!1;const le={name:k};if(!t.disabled){if(!I||B){(v.isDirty||l.isDirty)&&(Q=r.isDirty,r.isDirty=le.isDirty=V(),x=Q!==le.isDirty);const fe=ut(W(s,k),N);Q=!!W(r.dirtyFields,k),fe?ke(r.dirtyFields,k):he(r.dirtyFields,k,!0),le.dirtyFields=r.dirtyFields,x=x||(v.dirtyFields||l.dirtyFields)&&Q!==!fe}if(I){const fe=W(r.touchedFields,k);fe||(he(r.touchedFields,k,I),le.touchedFields=r.touchedFields,x=x||(v.touchedFields||l.touchedFields)&&fe!==I)}x&&J&&h.state.next(le)}return x?le:{}},E=(k,N,I,B)=>{const J=W(r.errors,k),x=(v.isValid||l.isValid)&&Xe(N)&&r.isValid!==N;if(t.delayError&&I?(c=S(()=>y(k,I)),c(t.delayError)):(clearTimeout(u),c=null,I?he(r.errors,k,I):ke(r.errors,k)),(I?!ut(J,I):J)||!Re(B)||x){const Q={...B,...x&&Xe(N)?{isValid:N}:{},errors:r.errors,name:k};r={...r,...Q},h.state.next(Q)}},R=async k=>(_(k,!0),await t.resolver(o,t.context,tm(k||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),Z=async k=>{const{errors:N}=await R(k);if(_(k),k)for(const I of k){const B=W(N,I);B?he(r.errors,I,B):ke(r.errors,I)}else r.errors=N;return N},L=async(k,N,I={valid:!0})=>{for(const B in k){const J=k[B];if(J){const{_f:x,...Q}=J;if(x){const le=a.array.has(x.name),fe=J._f&&rm(J._f);fe&&v.validatingFields&&_([x.name],!0);const ze=await Fn(J,a.disabled,o,w,t.shouldUseNativeValidation&&!N,le);if(fe&&v.validatingFields&&_([x.name]),ze[x.name]&&(I.valid=!1,N||e.shouldUseNativeValidation))break;!N&&(W(ze,x.name)?le?Co(r.errors,ze,x.name):he(r.errors,x.name,ze[x.name]):ke(r.errors,x.name))}!Re(Q)&&await L(Q,N,I)}}return I.valid},F=()=>{for(const k of a.unMount){const N=W(n,k);N&&(N._f.refs?N._f.refs.every(I=>!Mn(I)):!Mn(N._f.ref))&&Y(k)}a.unMount=new Set},V=(k,N)=>!t.disabled&&(k&&N&&he(o,k,N),!ut(O(),s)),U=(k,N,I)=>Bf(k,a,{...i.mount?o:ve(N)?s:Ue(k)?{[k]:N}:N},I,N),K=k=>ir(W(i.mount?o:s,k,t.shouldUnregister?W(s,k,[]):[])),re=(k,N,I={})=>{const B=W(n,k);let J=N;if(B){const x=B._f;x&&(!x.disabled&&he(o,k,Ao(N,x)),J=ar(x.ref)&&Ve(N)?"":N,Eo(x.ref)?[...x.ref.options].forEach(Q=>Q.selected=J.includes(Q.value)):x.refs?Mt(x.ref)?x.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(J)?Q.checked=!!J.find(le=>le===Q.value):Q.checked=J===Q.value||!!J)}):x.refs.forEach(Q=>Q.checked=Q.value===J):Tn(x.ref)?x.ref.value="":(x.ref.value=J,x.ref.type||h.state.next({name:k,values:ge(o)})))}(I.shouldDirty||I.shouldTouch)&&$(k,J,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&M(k)},ye=(k,N,I)=>{for(const B in N){if(!N.hasOwnProperty(B))return;const J=N[B],x=k+"."+B,Q=W(n,x);(a.array.has(k)||Pe(J)||Q&&!Q._f)&&!ht(J)?ye(x,J,I):re(x,J,I)}},me=(k,N,I={})=>{const B=W(n,k),J=a.array.has(k),x=ge(N);he(o,k,x),J?(h.array.next({name:k,values:ge(o)}),(v.isDirty||v.dirtyFields||l.isDirty||l.dirtyFields)&&I.shouldDirty&&h.state.next({name:k,dirtyFields:Et(s,o),isDirty:V(k,x)})):B&&!B._f&&!Ve(x)?ye(k,x,I):re(k,x,I),Vn(k,a)?h.state.next({...r,name:k,values:ge(o)}):h.state.next({name:i.mount?k:void 0,values:ge(o)})},ue=async k=>{i.mount=!0;const N=k.target;let I=N.name,B=!0;const J=W(n,I),x=fe=>{B=Number.isNaN(fe)||ht(fe)&&isNaN(fe.getTime())||ut(fe,W(o,I,fe))},Q=kt(t.mode),le=kt(t.reValidateMode);if(J){let fe,ze;const gt=N.type?Ro(J._f):xf(k),ft=k.type===_o.BLUR||k.type===_o.FOCUS_OUT,Uh=!nm(J._f)&&!t.resolver&&!W(r.errors,I)&&!J._f.deps||im(ft,W(r.touchedFields,I),r.isSubmitted,le,Q),ms=Vn(I,a,ft);he(o,I,gt),ft?(!N||!N.readOnly)&&(J._f.onBlur&&J._f.onBlur(k),c&&c(0)):J._f.onChange&&J._f.onChange(k);const hs=$(I,gt,ft),xh=!Re(hs)||ms;if(!ft&&h.state.next({name:I,type:k.type,values:ge(o)}),Uh)return(v.isValid||l.isValid)&&(t.mode==="onBlur"?ft&&p():ft||p()),xh&&h.state.next({name:I,...ms?{}:hs});if(!ft&&ms&&h.state.next({...r}),t.resolver){const{errors:xa}=await R([I]);if(_([I]),x(gt),B){const Lh=To(r.errors,n,I),La=To(xa,n,Lh.name||I);fe=La.error,I=La.name,ze=Re(xa)}}else _([I],!0),fe=(await Fn(J,a.disabled,o,w,t.shouldUseNativeValidation))[I],_([I]),x(gt),B&&(fe?ze=!1:(v.isValid||l.isValid)&&(ze=await L(n,!0)));B&&(J._f.deps&&(!Array.isArray(J._f.deps)||J._f.deps.length>0)&&M(J._f.deps),E(I,ze,fe,hs))}},Oe=(k,N)=>{if(W(r.errors,N)&&k.focus)return k.focus(),1},M=async(k,N={})=>{let I,B;const J=Fe(k);if(t.resolver){const x=await Z(ve(k)?k:J);I=Re(x),B=k?!J.some(Q=>W(x,Q)):I}else k?(B=(await Promise.all(J.map(async x=>{const Q=W(n,x);return await L(Q&&Q._f?{[x]:Q}:Q)}))).every(Boolean),!(!B&&!r.isValid)&&p()):B=I=await L(n);return h.state.next({...!Ue(k)||(v.isValid||l.isValid)&&I!==r.isValid?{}:{name:k},...t.resolver||!k?{isValid:I}:{},errors:r.errors}),N.shouldFocus&&!B&&Pt(n,Oe,k?J:a.mount),B},O=(k,N)=>{let I={...i.mount?o:s};return N&&(I=So(N.dirtyFields?r.dirtyFields:r.touchedFields,I)),ve(k)?I:Ue(k)?W(I,k):k.map(B=>W(I,B))},C=(k,N)=>({invalid:!!W((N||r).errors,k),isDirty:!!W((N||r).dirtyFields,k),error:W((N||r).errors,k),isValidating:!!W(r.validatingFields,k),isTouched:!!W((N||r).touchedFields,k)}),A=k=>{k&&Fe(k).forEach(N=>ke(r.errors,N)),h.state.next({errors:k?r.errors:{}})},b=(k,N,I)=>{const B=(W(n,k,{_f:{}})._f||{}).ref,J=W(r.errors,k)||{},{ref:x,message:Q,type:le,...fe}=J;he(r.errors,k,{...fe,...N,ref:B}),h.state.next({name:k,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&B&&B.focus&&B.focus()},P=(k,N)=>He(k)?h.state.subscribe({next:I=>"values"in I&&k(U(void 0,N),I)}):U(k,N,!0),T=k=>h.state.subscribe({next:N=>{om(k.name,N.name,k.exact)&&sm(N,k.formState||v,Le,k.reRenderRoot)&&k.callback({values:{...o},...r,...N,defaultValues:s})}}).unsubscribe,G=k=>(i.mount=!0,l={...l,...k.formState},T({...k,formState:{...m,...k.formState}})),Y=(k,N={})=>{for(const I of k?Fe(k):a.mount)a.mount.delete(I),a.array.delete(I),N.keepValue||(ke(n,I),ke(o,I)),!N.keepError&&ke(r.errors,I),!N.keepDirty&&ke(r.dirtyFields,I),!N.keepTouched&&ke(r.touchedFields,I),!N.keepIsValidating&&ke(r.validatingFields,I),!t.shouldUnregister&&!N.keepDefaultValue&&ke(s,I);h.state.next({values:ge(o)}),h.state.next({...r,...N.keepDirty?{isDirty:V()}:{}}),!N.keepIsValid&&p()},ie=({disabled:k,name:N})=>{if(Xe(k)&&i.mount||k||a.disabled.has(N)){const J=a.disabled.has(N)!==!!k;k?a.disabled.add(N):a.disabled.delete(N),J&&i.mount&&!i.action&&p()}},ae=(k,N={})=>{let I=W(n,k);const B=Xe(N.disabled)||Xe(t.disabled);return he(n,k,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:k}},name:k,mount:!0,...N}}),a.mount.add(k),I?ie({disabled:Xe(N.disabled)?N.disabled:t.disabled,name:k}):d(k,!0,N.value),{...B?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Dt(N.min),max:Dt(N.max),minLength:Dt(N.minLength),maxLength:Dt(N.maxLength),pattern:Dt(N.pattern)}:{},name:k,onChange:ue,onBlur:ue,ref:J=>{if(J){ae(k,N),I=W(n,k);const x=ve(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,Q=Yf(x),le=I._f.refs||[];if(Q?le.find(fe=>fe===x):x===I._f.ref)return;he(n,k,{_f:{...I._f,...Q?{refs:[...le.filter(Mn),x,...Array.isArray(W(s,k))?[{}]:[]],ref:{type:x.type,name:k}}:{ref:x}}}),d(k,!1,void 0,x)}else I=W(n,k,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Kf(a.array,k)&&i.action)&&a.unMount.add(k)}}},j=()=>t.shouldFocusError&&Pt(n,Oe,a.mount),z=k=>{Xe(k)&&(h.state.next({disabled:k}),Pt(n,(N,I)=>{const B=W(n,I);B&&(N.disabled=B._f.disabled||k,Array.isArray(B._f.refs)&&B._f.refs.forEach(J=>{J.disabled=B._f.disabled||k}))},0,!1))},q=(k,N)=>async I=>{let B;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let J=ge(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:x,values:Q}=await R();_(),r.errors=x,J=ge(Q)}else await L(n);if(a.disabled.size)for(const x of a.disabled)ke(J,x);if(ke(r.errors,"root"),Re(r.errors)){h.state.next({errors:{}});try{await k(J,I)}catch(x){B=x}}else N&&await N({...r.errors},I),j(),setTimeout(j);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Re(r.errors)&&!B,submitCount:r.submitCount+1,errors:r.errors}),B)throw B},H=(k,N={})=>{W(n,k)&&(ve(N.defaultValue)?me(k,ge(W(s,k))):(me(k,N.defaultValue),he(s,k,ge(N.defaultValue))),N.keepTouched||ke(r.touchedFields,k),N.keepDirty||(ke(r.dirtyFields,k),r.isDirty=N.defaultValue?V(k,ge(W(s,k))):V()),N.keepError||(ke(r.errors,k),v.isValid&&p()),h.state.next({...r}))},X=(k,N={})=>{const I=k?ge(k):s,B=ge(I),J=Re(k),x=J?s:B;if(N.keepDefaultValues||(s=I),!N.keepValues){if(N.keepDirtyValues){const Q=new Set([...a.mount,...Object.keys(Et(s,o))]);for(const le of Array.from(Q)){const fe=W(r.dirtyFields,le),ze=W(o,le),gt=W(x,le);fe&&!ve(ze)?he(x,le,ze):!fe&&!ve(gt)&&me(le,gt)}}else{if(Nn&&ve(k))for(const Q of a.mount){const le=W(n,Q);if(le&&le._f){const fe=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(ar(fe)){const ze=fe.closest("form");if(ze){ze.reset();break}}}}if(N.keepFieldsRef)for(const Q of a.mount)me(Q,W(x,Q));else n={}}o=t.shouldUnregister?N.keepDefaultValues?ge(s):{}:ge(x),h.array.next({values:{...x}}),h.state.next({values:{...x}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!v.isValid||!!N.keepIsValid||!!N.keepDirtyValues||!t.shouldUnregister&&!Re(x),i.watch=!!t.shouldUnregister,i.keepIsValid=!!N.keepIsValid,i.action=!1,N.keepErrors||(r.errors={}),h.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:J?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!ut(k,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:J?{}:N.keepDirtyValues?N.keepDefaultValues&&o?Et(s,o):r.dirtyFields:N.keepDefaultValues&&k?Et(s,k):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},se=(k,N)=>X(He(k)?k(o):k,{...t.resetOptions,...N}),je=(k,N={})=>{const I=W(n,k),B=I&&I._f;if(B){const J=B.refs?B.refs[0]:B.ref;J.focus&&setTimeout(()=>{J.focus(),N.shouldSelect&&He(J.select)&&J.select()})}},Le=k=>{r={...r,...k}},Ne={control:{register:ae,unregister:Y,getFieldState:C,handleSubmit:q,setError:b,_subscribe:T,_runSchema:R,_updateIsValidating:_,_focusError:j,_getWatch:U,_getDirty:V,_setValid:p,_setFieldArray:f,_setDisabledField:ie,_setErrors:g,_getFieldArray:K,_reset:X,_resetDefaultValues:()=>He(t.defaultValues)&&t.defaultValues().then(k=>{se(k,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:z,_subjects:h,_proxyFormState:v,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(k){i=k},get _defaultValues(){return s},get _names(){return a},set _names(k){a=k},get _formState(){return r},get _options(){return t},set _options(k){t={...t,...k}}},subscribe:G,trigger:M,register:ae,handleSubmit:q,watch:P,setValue:me,getValues:O,reset:se,resetField:H,clearErrors:A,unregister:Y,setError:b,setFocus:je,getFieldState:C};return{...Ne,formControl:Ne}}var dt=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},qn=(e,t,r={})=>r.shouldFocus||ve(r.shouldFocus)?r.focusName||`${e}.${ve(r.focusIndex)?t:r.focusIndex}.`:"",Zn=(e,t)=>[...e,...Fe(t)],Un=e=>Array.isArray(e)?e.map(()=>{}):void 0;function xn(e,t,r){return[...e.slice(0,t),...Fe(r),...e.slice(t)]}var Ln=(e,t,r)=>Array.isArray(e)?(ve(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],Kn=(e,t)=>[...Fe(t),...Fe(e)];function dm(e,t){let r=0;const n=[...e];for(const s of t)n.splice(s-r,1),r++;return ir(n).length?n:[]}var Jn=(e,t)=>ve(t)?[]:dm(e,Fe(t).sort((r,n)=>r-n)),Hn=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},Do=(e,t,r)=>(e[t]=r,e);function Vo(e){const t=Hf(),{control:r=t,name:n,keyName:s="id",shouldUnregister:o,rules:i}=e,[a,c]=ee.useState(r._getFieldArray(n)),u=ee.useRef(r._getFieldArray(n).map(dt)),m=ee.useRef(!1);r._names.array.add(n),ee.useMemo(()=>i&&a.length>=0&&r.register(n,i),[r,n,a.length,i]),bo(()=>r._subjects.array.subscribe({next:({values:g,name:d})=>{if(d===n||!d){const $=W(g,n);Array.isArray($)&&(c($),u.current=$.map(dt))}}}).unsubscribe,[r,n]);const v=ee.useCallback(g=>{m.current=!0,r._setFieldArray(n,g)},[r,n]),l=(g,d)=>{const $=Fe(ge(g)),E=Zn(r._getFieldArray(n),$);r._names.focus=qn(n,E.length-1,d),u.current=Zn(u.current,$.map(dt)),v(E),c(E),r._setFieldArray(n,E,Zn,{argA:Un(g)})},h=(g,d)=>{const $=Fe(ge(g)),E=Kn(r._getFieldArray(n),$);r._names.focus=qn(n,0,d),u.current=Kn(u.current,$.map(dt)),v(E),c(E),r._setFieldArray(n,E,Kn,{argA:Un(g)})},w=g=>{const d=Jn(r._getFieldArray(n),g);u.current=Jn(u.current,g),v(d),c(d),!Array.isArray(W(r._fields,n))&&he(r._fields,n,void 0),r._setFieldArray(n,d,Jn,{argA:g})},S=(g,d,$)=>{const E=Fe(ge(d)),R=xn(r._getFieldArray(n),g,E);r._names.focus=qn(n,g,$),u.current=xn(u.current,g,E.map(dt)),v(R),c(R),r._setFieldArray(n,R,xn,{argA:g,argB:Un(d)})},p=(g,d)=>{const $=r._getFieldArray(n);Hn($,g,d),Hn(u.current,g,d),v($),c($),r._setFieldArray(n,$,Hn,{argA:g,argB:d},!1)},_=(g,d)=>{const $=r._getFieldArray(n);Ln($,g,d),Ln(u.current,g,d),v($),c($),r._setFieldArray(n,$,Ln,{argA:g,argB:d},!1)},f=(g,d)=>{const $=ge(d),E=Do(r._getFieldArray(n),g,$);u.current=[...E].map((R,Z)=>!R||Z===g?dt():u.current[Z]),v(E),c([...E]),r._setFieldArray(n,E,Do,{argA:g,argB:$},!0,!1)},y=g=>{const d=Fe(ge(g));u.current=d.map(dt),v([...d]),c([...d]),r._setFieldArray(n,[...d],$=>$,{},!0,!1)};return ee.useEffect(()=>{if(r._state.action=!1,Vn(n,r._names)&&r._subjects.state.next({...r._formState}),m.current&&(!kt(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!kt(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(g=>{r._updateIsValidating([n]);const d=W(g.errors,n),$=W(r._formState.errors,n);($?!d&&$.type||d&&($.type!==d.type||$.message!==d.message):d&&d.type)&&(d?he(r._formState.errors,n,d):ke(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const g=W(r._fields,n);g&&g._f&&!(kt(r._options.reValidateMode).isOnSubmit&&kt(r._options.mode).isOnSubmit)&&Fn(g,r._names.disabled,r._formValues,r._options.criteriaMode===Je.all,r._options.shouldUseNativeValidation,!0).then(d=>!Re(d)&&r._subjects.state.next({errors:Co(r._formState.errors,d,n)}))}r._subjects.state.next({name:n,values:ge(r._formValues)}),r._names.focus&&Pt(r._fields,(g,d)=>{if(r._names.focus&&d.startsWith(r._names.focus)&&g.focus)return g.focus(),1}),r._names.focus="",r._setValid(),m.current=!1},[a,n,r]),ee.useEffect(()=>(!W(r._formValues,n)&&r._setFieldArray(n),()=>{const g=(d,$)=>{const E=W(r._fields,d);E&&E._f&&(E._f.mount=$)};r._options.shouldUnregister||o?r.unregister(n):g(n,!1)}),[n,r,s,o]),{swap:ee.useCallback(p,[v,n,r]),move:ee.useCallback(_,[v,n,r]),prepend:ee.useCallback(h,[v,n,r]),append:ee.useCallback(l,[v,n,r]),remove:ee.useCallback(w,[v,n,r]),insert:ee.useCallback(S,[v,n,r]),update:ee.useCallback(f,[v,n,r]),replace:ee.useCallback(y,[v,n,r]),fields:ee.useMemo(()=>a.map((g,d)=>({...g,[s]:u.current[d]||dt()})),[a,s])}}function lm(e={}){const t=ee.useRef(void 0),r=ee.useRef(void 0),[n,s]=ee.useState({isDirty:!1,isValidating:!1,isLoading:He(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:He(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!He(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=um(e);t.current={...a,formState:n}}const o=t.current.control;return o._options=e,bo(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),ee.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ee.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ee.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),ee.useEffect(()=>{var i;e.values&&!ut(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),ee.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=ee.useMemo(()=>Gf(n,o),[o,n]),t.current}const Fo=(e,t,r)=>{if(e&&"reportValidity"in e){const n=W(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Gn=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Fo(n.ref,r,e):n&&n.refs&&n.refs.forEach(s=>Fo(s,r,e))}},qo=(e,t)=>{t.shouldUseNativeValidation&&Gn(e,t);const r={};for(const n in e){const s=W(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(fm(t.names||Object.keys(e),n)){const i=Object.assign({},W(r,n));he(i,"root",o),he(r,n,i)}else he(r,n,o)}return r},fm=(e,t)=>{const r=Zo(t);return e.some(n=>Zo(n).match(`^${r}\\.\\d+`))};function Zo(e){return e.replace(/\]|\[/g,"")}function Uo(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function mm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(m){return m.errors.forEach(function(v){return e.push(v)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=In(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function hm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if(n.code==="invalid_union"&&n.errors.length>0){var a=n.errors[0][0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if(n.code==="invalid_union"&&n.errors.forEach(function(m){return m.forEach(function(v){return e.push(v)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=In(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function pm(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,s,o){try{return Promise.resolve(Uo(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(i){return o.shouldUseNativeValidation&&Gn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:qo(mm(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,s,o){try{return Promise.resolve(Uo(function(){return Promise.resolve((r.mode==="sync"?vc:gc)(e,n,t)).then(function(i){return o.shouldUseNativeValidation&&Gn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return a instanceof Sn})(i))return{values:{},errors:qo(hm(i.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dr={exports:{}},Bn={},tt={},pt={},Wn={},Yn={},Xn={},xo;function lr(){return xo||(xo=1,(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(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((y,g)=>`${y}${g}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((y,g)=>(g instanceof r&&(y[g.str]=(y[g.str]||0)+1),y),{})}}e._Code=n,e.nil=new n("");function s(_,...f){const y=[_[0]];let g=0;for(;g<f.length;)a(y,f[g]),y.push(_[++g]);return new n(y)}e._=s;const o=new n("+");function i(_,...f){const y=[h(_[0])];let g=0;for(;g<f.length;)y.push(o),a(y,f[g]),y.push(o,h(_[++g]));return c(y),new n(y)}e.str=i;function a(_,f){f instanceof n?_.push(...f._items):f instanceof r?_.push(f):_.push(v(f))}e.addCodeArg=a;function c(_){let f=1;for(;f<_.length-1;){if(_[f]===o){const y=u(_[f-1],_[f+1]);if(y!==void 0){_.splice(f-1,3,y);continue}_[f++]="+"}f++}}function u(_,f){if(f==='""')return _;if(_==='""')return f;if(typeof _=="string")return f instanceof r||_[_.length-1]!=='"'?void 0:typeof f!="string"?`${_.slice(0,-1)}${f}"`:f[0]==='"'?_.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(_ instanceof r))return`"${_}${f.slice(1)}`}function m(_,f){return f.emptyStr()?_:_.emptyStr()?f:i`${_}${f}`}e.strConcat=m;function v(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:h(Array.isArray(_)?_.join(","):_)}function l(_){return new n(h(_))}e.stringify=l;function h(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function w(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):s`[${_}]`}e.getProperty=w;function S(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=S;function p(_){return new n(_.toString())}e.regexpCode=p})(Xn)),Xn}var Qn={},Lo;function Ko(){return Lo||(Lo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=lr();class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:m}={}){this._names={},this._prefixes=u,this._parent=m}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const m=this._names[u]||this._nameGroup(u);return`${u}${m.index++}`}_nameGroup(u){var m,v;if(!((v=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||v===void 0)&&v.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=s;class o extends t.Name{constructor(u,m){super(m),this.prefix=u}setValue(u,{property:m,itemIndex:v}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(m)}[${v}]`}}e.ValueScopeName=o;const i=(0,t._)`\n`;class a extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?i:t.nil}}get(){return this._scope}name(u){return new o(u,this._newName(u))}value(u,m){var v;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const l=this.toName(u),{prefix:h}=l,w=(v=m.key)!==null&&v!==void 0?v:m.ref;let S=this._values[h];if(S){const f=S.get(w);if(f)return f}else S=this._values[h]=new Map;S.set(w,l);const p=this._scope[h]||(this._scope[h]=[]),_=p.length;return p[_]=m.ref,l.setValue(m,{property:h,itemIndex:_}),l}getValue(u,m){const v=this._values[u];if(v)return v.get(m)}scopeRefs(u,m=this._values){return this._reduceValues(m,v=>{if(v.scopePath===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return(0,t._)`${u}${v.scopePath}`})}scopeCode(u=this._values,m,v){return this._reduceValues(u,l=>{if(l.value===void 0)throw new Error(`CodeGen: name "${l}" has no value`);return l.value.code},m,v)}_reduceValues(u,m,v={},l){let h=t.nil;for(const w in u){const S=u[w];if(!S)continue;const p=v[w]=v[w]||new Map;S.forEach(_=>{if(p.has(_))return;p.set(_,n.Started);let f=m(_);if(f){const y=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${y} ${_} = ${f};${this.opts._n}`}else if(f=l?.(_))h=(0,t._)`${h}${f}${this.opts._n}`;else throw new r(_);p.set(_,n.Completed)})}return h}}e.ValueScope=a})(Qn)),Qn}var Jo;function ne(){return Jo||(Jo=1,(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=lr(),r=Ko();var n=lr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Ko();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.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 o{optimizeNodes(){return this}optimizeNames(b,P){return this}}class i extends o{constructor(b,P,T){super(),this.varKind=b,this.name=P,this.rhs=T}render({es5:b,_n:P}){const T=b?r.varKinds.var:this.varKind,G=this.rhs===void 0?"":` = ${this.rhs}`;return`${T} ${this.name}${G};`+P}optimizeNames(b,P){if(b[this.name.str])return this.rhs&&(this.rhs=K(this.rhs,b,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(b,P,T){super(),this.lhs=b,this.rhs=P,this.sideEffects=T}render({_n:b}){return`${this.lhs} = ${this.rhs};`+b}optimizeNames(b,P){if(!(this.lhs instanceof t.Name&&!b[this.lhs.str]&&!this.sideEffects))return this.rhs=K(this.rhs,b,P),this}get names(){const b=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(b,this.rhs)}}class c extends a{constructor(b,P,T,G){super(b,T,G),this.op=P}render({_n:b}){return`${this.lhs} ${this.op}= ${this.rhs};`+b}}class u extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`${this.label}:`+b}}class m extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`break${this.label?` ${this.label}`:""};`+b}}class v extends o{constructor(b){super(),this.error=b}render({_n:b}){return`throw ${this.error};`+b}get names(){return this.error.names}}class l extends o{constructor(b){super(),this.code=b}render({_n:b}){return`${this.code};`+b}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(b,P){return this.code=K(this.code,b,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(b=[]){super(),this.nodes=b}render(b){return this.nodes.reduce((P,T)=>P+T.render(b),"")}optimizeNodes(){const{nodes:b}=this;let P=b.length;for(;P--;){const T=b[P].optimizeNodes();Array.isArray(T)?b.splice(P,1,...T):T?b[P]=T:b.splice(P,1)}return b.length>0?this:void 0}optimizeNames(b,P){const{nodes:T}=this;let G=T.length;for(;G--;){const Y=T[G];Y.optimizeNames(b,P)||(re(b,Y.names),T.splice(G,1))}return T.length>0?this:void 0}get names(){return this.nodes.reduce((b,P)=>V(b,P.names),{})}}class w extends h{render(b){return"{"+b._n+super.render(b)+"}"+b._n}}class S extends h{}class p extends w{}p.kind="else";class _ extends w{constructor(b,P){super(P),this.condition=b}render(b){let P=`if(${this.condition})`+super.render(b);return this.else&&(P+="else "+this.else.render(b)),P}optimizeNodes(){super.optimizeNodes();const b=this.condition;if(b===!0)return this.nodes;let P=this.else;if(P){const T=P.optimizeNodes();P=this.else=Array.isArray(T)?new p(T):T}if(P)return b===!1?P instanceof _?P:P.nodes:this.nodes.length?this:new _(ye(b),P instanceof _?[P]:P.nodes);if(!(b===!1||!this.nodes.length))return this}optimizeNames(b,P){var T;if(this.else=(T=this.else)===null||T===void 0?void 0:T.optimizeNames(b,P),!!(super.optimizeNames(b,P)||this.else))return this.condition=K(this.condition,b,P),this}get names(){const b=super.names;return U(b,this.condition),this.else&&V(b,this.else.names),b}}_.kind="if";class f extends w{}f.kind="for";class y extends f{constructor(b){super(),this.iteration=b}render(b){return`for(${this.iteration})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iteration=K(this.iteration,b,P),this}get names(){return V(super.names,this.iteration.names)}}class g extends f{constructor(b,P,T,G){super(),this.varKind=b,this.name=P,this.from=T,this.to=G}render(b){const P=b.es5?r.varKinds.var:this.varKind,{name:T,from:G,to:Y}=this;return`for(${P} ${T}=${G}; ${T}<${Y}; ${T}++)`+super.render(b)}get names(){const b=U(super.names,this.from);return U(b,this.to)}}class d extends f{constructor(b,P,T,G){super(),this.loop=b,this.varKind=P,this.name=T,this.iterable=G}render(b){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iterable=K(this.iterable,b,P),this}get names(){return V(super.names,this.iterable.names)}}class $ extends w{constructor(b,P,T){super(),this.name=b,this.args=P,this.async=T}render(b){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(b)}}$.kind="func";class E extends h{render(b){return"return "+super.render(b)}}E.kind="return";class R extends w{render(b){let P="try"+super.render(b);return this.catch&&(P+=this.catch.render(b)),this.finally&&(P+=this.finally.render(b)),P}optimizeNodes(){var b,P;return super.optimizeNodes(),(b=this.catch)===null||b===void 0||b.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(b,P){var T,G;return super.optimizeNames(b,P),(T=this.catch)===null||T===void 0||T.optimizeNames(b,P),(G=this.finally)===null||G===void 0||G.optimizeNames(b,P),this}get names(){const b=super.names;return this.catch&&V(b,this.catch.names),this.finally&&V(b,this.finally.names),b}}class Z extends w{constructor(b){super(),this.error=b}render(b){return`catch(${this.error})`+super.render(b)}}Z.kind="catch";class L extends w{render(b){return"finally"+super.render(b)}}L.kind="finally";class F{constructor(b,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
|
|
40
|
-
`:""},this._extScope=b,this._scope=new r.Scope({parent:b}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(b){return this._scope.name(b)}scopeName(b){return this._extScope.name(b)}scopeValue(b,P){const T=this._extScope.value(b,P);return(this._values[T.prefix]||(this._values[T.prefix]=new Set)).add(T),T}getScopeValue(b,P){return this._extScope.getValue(b,P)}scopeRefs(b){return this._extScope.scopeRefs(b,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(b,P,T,G){const Y=this._scope.toName(P);return T!==void 0&&G&&(this._constants[Y.str]=T),this._leafNode(new i(b,Y,T)),Y}const(b,P,T){return this._def(r.varKinds.const,b,P,T)}let(b,P,T){return this._def(r.varKinds.let,b,P,T)}var(b,P,T){return this._def(r.varKinds.var,b,P,T)}assign(b,P,T){return this._leafNode(new a(b,P,T))}add(b,P){return this._leafNode(new c(b,e.operators.ADD,P))}code(b){return typeof b=="function"?b():b!==t.nil&&this._leafNode(new l(b)),this}object(...b){const P=["{"];for(const[T,G]of b)P.length>1&&P.push(","),P.push(T),(T!==G||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,G));return P.push("}"),new t._Code(P)}if(b,P,T){if(this._blockNode(new _(b)),P&&T)this.code(P).else().code(T).endIf();else if(P)this.code(P).endIf();else if(T)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(b){return this._elseNode(new _(b))}else(){return this._elseNode(new p)}endIf(){return this._endBlockNode(_,p)}_for(b,P){return this._blockNode(b),P&&this.code(P).endFor(),this}for(b,P){return this._for(new y(b),P)}forRange(b,P,T,G,Y=this.opts.es5?r.varKinds.var:r.varKinds.let){const ie=this._scope.toName(b);return this._for(new g(Y,ie,P,T),()=>G(ie))}forOf(b,P,T,G=r.varKinds.const){const Y=this._scope.toName(b);if(this.opts.es5){const ie=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${ie}.length`,ae=>{this.var(Y,(0,t._)`${ie}[${ae}]`),T(Y)})}return this._for(new d("of",G,Y,P),()=>T(Y))}forIn(b,P,T,G=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(b,(0,t._)`Object.keys(${P})`,T);const Y=this._scope.toName(b);return this._for(new d("in",G,Y,P),()=>T(Y))}endFor(){return this._endBlockNode(f)}label(b){return this._leafNode(new u(b))}break(b){return this._leafNode(new m(b))}return(b){const P=new E;if(this._blockNode(P),this.code(b),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(b,P,T){if(!P&&!T)throw new Error('CodeGen: "try" without "catch" and "finally"');const G=new R;if(this._blockNode(G),this.code(b),P){const Y=this.name("e");this._currNode=G.catch=new Z(Y),P(Y)}return T&&(this._currNode=G.finally=new L,this.code(T)),this._endBlockNode(Z,L)}throw(b){return this._leafNode(new v(b))}block(b,P){return this._blockStarts.push(this._nodes.length),b&&this.code(b).endBlock(P),this}endBlock(b){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const T=this._nodes.length-P;if(T<0||b!==void 0&&T!==b)throw new Error(`CodeGen: wrong number of nodes: ${T} vs ${b} expected`);return this._nodes.length=P,this}func(b,P=t.nil,T,G){return this._blockNode(new $(b,P,T)),G&&this.code(G).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(b=1){for(;b-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(b){return this._currNode.nodes.push(b),this}_blockNode(b){this._currNode.nodes.push(b),this._nodes.push(b)}_endBlockNode(b,P){const T=this._currNode;if(T instanceof b||P&&T instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${b.kind}/${P.kind}`:b.kind}"`)}_elseNode(b){const P=this._currNode;if(!(P instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=b,this}get _root(){return this._nodes[0]}get _currNode(){const b=this._nodes;return b[b.length-1]}set _currNode(b){const P=this._nodes;P[P.length-1]=b}}e.CodeGen=F;function V(A,b){for(const P in b)A[P]=(A[P]||0)+(b[P]||0);return A}function U(A,b){return b instanceof t._CodeOrName?V(A,b.names):A}function K(A,b,P){if(A instanceof t.Name)return T(A);if(!G(A))return A;return new t._Code(A._items.reduce((Y,ie)=>(ie instanceof t.Name&&(ie=T(ie)),ie instanceof t._Code?Y.push(...ie._items):Y.push(ie),Y),[]));function T(Y){const ie=P[Y.str];return ie===void 0||b[Y.str]!==1?Y:(delete b[Y.str],ie)}function G(Y){return Y instanceof t._Code&&Y._items.some(ie=>ie instanceof t.Name&&b[ie.str]===1&&P[ie.str]!==void 0)}}function re(A,b){for(const P in b)A[P]=(A[P]||0)-(b[P]||0)}function ye(A){return typeof A=="boolean"||typeof A=="number"||A===null?!A:(0,t._)`!${C(A)}`}e.not=ye;const me=O(e.operators.AND);function ue(...A){return A.reduce(me)}e.and=ue;const Oe=O(e.operators.OR);function M(...A){return A.reduce(Oe)}e.or=M;function O(A){return(b,P)=>b===t.nil?P:P===t.nil?b:(0,t._)`${C(b)} ${A} ${C(P)}`}function C(A){return A instanceof t.Name?A:(0,t._)`(${A})`}})(Yn)),Yn}var oe={},Ho;function ce(){if(Ho)return oe;Ho=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.checkStrictMode=oe.getErrorPath=oe.Type=oe.useFunc=oe.setEvaluated=oe.evaluatedPropsToName=oe.mergeEvaluated=oe.eachItem=oe.unescapeJsonPointer=oe.escapeJsonPointer=oe.escapeFragment=oe.unescapeFragment=oe.schemaRefOrVal=oe.schemaHasRulesButRef=oe.schemaHasRules=oe.checkUnknownRules=oe.alwaysValidSchema=oe.toHash=void 0;const e=ne(),t=lr();function r(d){const $={};for(const E of d)$[E]=!0;return $}oe.toHash=r;function n(d,$){return typeof $=="boolean"?$:Object.keys($).length===0?!0:(s(d,$),!o($,d.self.RULES.all))}oe.alwaysValidSchema=n;function s(d,$=d.schema){const{opts:E,self:R}=d;if(!E.strictSchema||typeof $=="boolean")return;const Z=R.RULES.keywords;for(const L in $)Z[L]||g(d,`unknown keyword: "${L}"`)}oe.checkUnknownRules=s;function o(d,$){if(typeof d=="boolean")return!d;for(const E in d)if($[E])return!0;return!1}oe.schemaHasRules=o;function i(d,$){if(typeof d=="boolean")return!d;for(const E in d)if(E!=="$ref"&&$.all[E])return!0;return!1}oe.schemaHasRulesButRef=i;function a({topSchemaRef:d,schemaPath:$},E,R,Z){if(!Z){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${d}${$}${(0,e.getProperty)(R)}`}oe.schemaRefOrVal=a;function c(d){return v(decodeURIComponent(d))}oe.unescapeFragment=c;function u(d){return encodeURIComponent(m(d))}oe.escapeFragment=u;function m(d){return typeof d=="number"?`${d}`:d.replace(/~/g,"~0").replace(/\//g,"~1")}oe.escapeJsonPointer=m;function v(d){return d.replace(/~1/g,"/").replace(/~0/g,"~")}oe.unescapeJsonPointer=v;function l(d,$){if(Array.isArray(d))for(const E of d)$(E);else $(d)}oe.eachItem=l;function h({mergeNames:d,mergeToName:$,mergeValues:E,resultToName:R}){return(Z,L,F,V)=>{const U=F===void 0?L:F instanceof e.Name?(L instanceof e.Name?d(Z,L,F):$(Z,L,F),F):L instanceof e.Name?($(Z,F,L),L):E(L,F);return V===e.Name&&!(U instanceof e.Name)?R(Z,U):U}}oe.mergeEvaluated={props:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>{d.if((0,e._)`${$} === true`,()=>d.assign(E,!0),()=>d.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${$})`))}),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>{$===!0?d.assign(E,!0):(d.assign(E,(0,e._)`${E} || {}`),S(d,E,$))}),mergeValues:(d,$)=>d===!0?!0:{...d,...$},resultToName:w}),items:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>d.assign(E,(0,e._)`${$} === true ? true : ${E} > ${$} ? ${E} : ${$}`)),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>d.assign(E,$===!0?!0:(0,e._)`${E} > ${$} ? ${E} : ${$}`)),mergeValues:(d,$)=>d===!0?!0:Math.max(d,$),resultToName:(d,$)=>d.var("items",$)})};function w(d,$){if($===!0)return d.var("props",!0);const E=d.var("props",(0,e._)`{}`);return $!==void 0&&S(d,E,$),E}oe.evaluatedPropsToName=w;function S(d,$,E){Object.keys(E).forEach(R=>d.assign((0,e._)`${$}${(0,e.getProperty)(R)}`,!0))}oe.setEvaluated=S;const p={};function _(d,$){return d.scopeValue("func",{ref:$,code:p[$.code]||(p[$.code]=new t._Code($.code))})}oe.useFunc=_;var f;(function(d){d[d.Num=0]="Num",d[d.Str=1]="Str"})(f||(oe.Type=f={}));function y(d,$,E){if(d instanceof e.Name){const R=$===f.Num;return E?R?(0,e._)`"[" + ${d} + "]"`:(0,e._)`"['" + ${d} + "']"`:R?(0,e._)`"/" + ${d}`:(0,e._)`"/" + ${d}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(d).toString():"/"+m(d)}oe.getErrorPath=y;function g(d,$,E=d.opts.strictSchema){if(E){if($=`strict mode: ${$}`,E===!0)throw new Error($);d.self.logger.warn($)}}return oe.checkStrictMode=g,oe}var fr={},Go;function Ge(){if(Go)return fr;Go=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=ne(),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 fr.default=t,fr}var Bo;function mr(){return Bo||(Bo=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=ne(),r=ce(),n=Ge();e.keywordError={message:({keyword:p})=>(0,t.str)`must pass "${p}" keyword validation`},e.keyword$DataError={message:({keyword:p,schemaType:_})=>_?(0,t.str)`"${p}" keyword must be ${_} ($data)`:(0,t.str)`"${p}" keyword is invalid ($data)`};function s(p,_=e.keywordError,f,y){const{it:g}=p,{gen:d,compositeRule:$,allErrors:E}=g,R=v(p,_,f);y??($||E)?c(d,R):u(g,(0,t._)`[${R}]`)}e.reportError=s;function o(p,_=e.keywordError,f){const{it:y}=p,{gen:g,compositeRule:d,allErrors:$}=y,E=v(p,_,f);c(g,E),d||$||u(y,n.default.vErrors)}e.reportExtraError=o;function i(p,_){p.assign(n.default.errors,_),p.if((0,t._)`${n.default.vErrors} !== null`,()=>p.if(_,()=>p.assign((0,t._)`${n.default.vErrors}.length`,_),()=>p.assign(n.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:p,keyword:_,schemaValue:f,data:y,errsCount:g,it:d}){if(g===void 0)throw new Error("ajv implementation error");const $=p.name("err");p.forRange("i",g,n.default.errors,E=>{p.const($,(0,t._)`${n.default.vErrors}[${E}]`),p.if((0,t._)`${$}.instancePath === undefined`,()=>p.assign((0,t._)`${$}.instancePath`,(0,t.strConcat)(n.default.instancePath,d.errorPath))),p.assign((0,t._)`${$}.schemaPath`,(0,t.str)`${d.errSchemaPath}/${_}`),d.opts.verbose&&(p.assign((0,t._)`${$}.schema`,f),p.assign((0,t._)`${$}.data`,y))})}e.extendErrors=a;function c(p,_){const f=p.const("err",_);p.if((0,t._)`${n.default.vErrors} === null`,()=>p.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),p.code((0,t._)`${n.default.errors}++`)}function u(p,_){const{gen:f,validateName:y,schemaEnv:g}=p;g.$async?f.throw((0,t._)`new ${p.ValidationError}(${_})`):(f.assign((0,t._)`${y}.errors`,_),f.return(!1))}const m={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 v(p,_,f){const{createErrors:y}=p.it;return y===!1?(0,t._)`{}`:l(p,_,f)}function l(p,_,f={}){const{gen:y,it:g}=p,d=[h(g,f),w(p,f)];return S(p,_,d),y.object(...d)}function h({errorPath:p},{instancePath:_}){const f=_?(0,t.str)`${p}${(0,r.getErrorPath)(_,r.Type.Str)}`:p;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function w({keyword:p,it:{errSchemaPath:_}},{schemaPath:f,parentSchema:y}){let g=y?_:(0,t.str)`${_}/${p}`;return f&&(g=(0,t.str)`${g}${(0,r.getErrorPath)(f,r.Type.Str)}`),[m.schemaPath,g]}function S(p,{params:_,message:f},y){const{keyword:g,data:d,schemaValue:$,it:E}=p,{opts:R,propertyName:Z,topSchemaRef:L,schemaPath:F}=E;y.push([m.keyword,g],[m.params,typeof _=="function"?_(p):_||(0,t._)`{}`]),R.messages&&y.push([m.message,typeof f=="function"?f(p):f]),R.verbose&&y.push([m.schema,$],[m.parentSchema,(0,t._)`${L}${F}`],[n.default.data,d]),Z&&y.push([m.propertyName,Z])}})(Wn)),Wn}var Wo;function ym(){if(Wo)return pt;Wo=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.boolOrEmptySchema=pt.topBoolOrEmptySchema=void 0;const e=mr(),t=ne(),r=Ge(),n={message:"boolean schema is false"};function s(a){const{gen:c,schema:u,validateName:m}=a;u===!1?i(a,!1):typeof u=="object"&&u.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${m}.errors`,null),c.return(!0))}pt.topBoolOrEmptySchema=s;function o(a,c){const{gen:u,schema:m}=a;m===!1?(u.var(c,!1),i(a)):u.var(c,!0)}pt.boolOrEmptySchema=o;function i(a,c){const{gen:u,data:m}=a,v={gen:u,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(v,n,void 0,c)}return pt}var Ae={},yt={},Yo;function Xo(){if(Yo)return yt;Yo=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.getRules=yt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(s){return typeof s=="string"&&t.has(s)}yt.isJSONType=r;function n(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return yt.getRules=n,yt}var rt={},Qo;function ei(){if(Qo)return rt;Qo=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.shouldUseRule=rt.shouldUseGroup=rt.schemaHasRulesForType=void 0;function e({schema:n,self:s},o){const i=s.RULES.types[o];return i&&i!==!0&&t(n,i)}rt.schemaHasRulesForType=e;function t(n,s){return s.rules.some(o=>r(n,o))}rt.shouldUseGroup=t;function r(n,s){var o;return n[s.keyword]!==void 0||((o=s.definition.implements)===null||o===void 0?void 0:o.some(i=>n[i]!==void 0))}return rt.shouldUseRule=r,rt}var ti;function hr(){if(ti)return Ae;ti=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.reportTypeError=Ae.checkDataTypes=Ae.checkDataType=Ae.coerceAndCheckDataType=Ae.getJSONTypes=Ae.getSchemaTypes=Ae.DataType=void 0;const e=Xo(),t=ei(),r=mr(),n=ne(),s=ce();var o;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(o||(Ae.DataType=o={}));function i(f){const y=a(f.type);if(y.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!y.length&&f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&y.push("null")}return y}Ae.getSchemaTypes=i;function a(f){const y=Array.isArray(f)?f:f?[f]:[];if(y.every(e.isJSONType))return y;throw new Error("type must be JSONType or JSONType[]: "+y.join(","))}Ae.getJSONTypes=a;function c(f,y){const{gen:g,data:d,opts:$}=f,E=m(y,$.coerceTypes),R=y.length>0&&!(E.length===0&&y.length===1&&(0,t.schemaHasRulesForType)(f,y[0]));if(R){const Z=w(y,d,$.strictNumbers,o.Wrong);g.if(Z,()=>{E.length?v(f,y,E):p(f)})}return R}Ae.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function m(f,y){return y?f.filter(g=>u.has(g)||y==="array"&&g==="array"):[]}function v(f,y,g){const{gen:d,data:$,opts:E}=f,R=d.let("dataType",(0,n._)`typeof ${$}`),Z=d.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&d.if((0,n._)`${R} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>d.assign($,(0,n._)`${$}[0]`).assign(R,(0,n._)`typeof ${$}`).if(w(y,$,E.strictNumbers),()=>d.assign(Z,$))),d.if((0,n._)`${Z} !== undefined`);for(const F of g)(u.has(F)||F==="array"&&E.coerceTypes==="array")&&L(F);d.else(),p(f),d.endIf(),d.if((0,n._)`${Z} !== undefined`,()=>{d.assign($,Z),l(f,Z)});function L(F){switch(F){case"string":d.elseIf((0,n._)`${R} == "number" || ${R} == "boolean"`).assign(Z,(0,n._)`"" + ${$}`).elseIf((0,n._)`${$} === null`).assign(Z,(0,n._)`""`);return;case"number":d.elseIf((0,n._)`${R} == "boolean" || ${$} === null
|
|
41
|
-
|| (${R} == "string" && ${$} && ${$} == +${$})`).assign(
|
|
42
|
-
|| (${R} === "string" && ${$} && ${$} == +${$} && !(${$} % 1))`).assign(
|
|
43
|
-
|| ${R} === "boolean" || ${$} === null`).assign(Z,(0,n._)`[${$}]`)}}}function l({gen:f,parentData:y,parentDataProperty:g},d){f.if((0,n._)`${y} !== undefined`,()=>f.assign((0,n._)`${y}[${g}]`,d))}function h(f,y,g,d=o.Correct){const $=d===o.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(f){case"null":return(0,n._)`${y} ${$} null`;case"array":E=(0,n._)`Array.isArray(${y})`;break;case"object":E=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":E=R((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":E=R();break;default:return(0,n._)`typeof ${y} ${$} ${f}`}return d===o.Correct?E:(0,n.not)(E);function R(Z=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,Z,g?(0,n._)`isFinite(${y})`:n.nil)}}Ae.checkDataType=h;function w(f,y,g,d){if(f.length===1)return h(f[0],y,g,d);let $;const E=(0,s.toHash)(f);if(E.array&&E.object){const R=(0,n._)`typeof ${y} != "object"`;$=E.null?R:(0,n._)`!${y} || ${R}`,delete E.null,delete E.array,delete E.object}else $=n.nil;E.number&&delete E.integer;for(const R in E)$=(0,n.and)($,h(R,y,g,d));return $}Ae.checkDataTypes=w;const S={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:y})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${y}}`};function p(f){const y=_(f);(0,r.reportError)(y,S)}Ae.reportTypeError=p;function _(f){const{gen:y,data:g,schema:d}=f,$=(0,s.schemaRefOrVal)(f,d,"type");return{gen:y,keyword:"type",data:g,schema:d.type,schemaCode:$,schemaValue:$,parentSchema:d,params:{},it:f}}return Ae}var Vt={},ri;function vm(){if(ri)return Vt;ri=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.assignDefaults=void 0;const e=ne(),t=ce();function r(s,o){const{properties:i,items:a}=s.schema;if(o==="object"&&i)for(const c in i)n(s,c,i[c].default);else o==="array"&&Array.isArray(a)&&a.forEach((c,u)=>n(s,u,c.default))}Vt.assignDefaults=r;function n(s,o,i){const{gen:a,compositeRule:c,data:u,opts:m}=s;if(i===void 0)return;const v=(0,e._)`${u}${(0,e.getProperty)(o)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${v}`);return}let l=(0,e._)`${v} === undefined`;m.useDefaults==="empty"&&(l=(0,e._)`${l} || ${v} === null || ${v} === ""`),a.if(l,(0,e._)`${v} = ${(0,e.stringify)(i)}`)}return Vt}var Be={},pe={},ni;function We(){if(ni)return pe;ni=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateUnion=pe.validateArray=pe.usePattern=pe.callValidateCode=pe.schemaProperties=pe.allSchemaProperties=pe.noPropertyInData=pe.propertyInData=pe.isOwnProperty=pe.hasPropFunc=pe.reportMissingProp=pe.checkMissingProp=pe.checkReportMissingProp=void 0;const e=ne(),t=ce(),r=Ge(),n=ce();function s(f,y){const{gen:g,data:d,it:$}=f;g.if(m(g,d,y,$.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${y}`},!0),f.error()})}pe.checkReportMissingProp=s;function o({gen:f,data:y,it:{opts:g}},d,$){return(0,e.or)(...d.map(E=>(0,e.and)(m(f,y,E,g.ownProperties),(0,e._)`${$} = ${E}`)))}pe.checkMissingProp=o;function i(f,y){f.setParams({missingProperty:y},!0),f.error()}pe.reportMissingProp=i;function a(f){return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}pe.hasPropFunc=a;function c(f,y,g){return(0,e._)`${a(f)}.call(${y}, ${g})`}pe.isOwnProperty=c;function u(f,y,g,d){const $=(0,e._)`${y}${(0,e.getProperty)(g)} !== undefined`;return d?(0,e._)`${$} && ${c(f,y,g)}`:$}pe.propertyInData=u;function m(f,y,g,d){const $=(0,e._)`${y}${(0,e.getProperty)(g)} === undefined`;return d?(0,e.or)($,(0,e.not)(c(f,y,g))):$}pe.noPropertyInData=m;function v(f){return f?Object.keys(f).filter(y=>y!=="__proto__"):[]}pe.allSchemaProperties=v;function l(f,y){return v(y).filter(g=>!(0,t.alwaysValidSchema)(f,y[g]))}pe.schemaProperties=l;function h({schemaCode:f,data:y,it:{gen:g,topSchemaRef:d,schemaPath:$,errorPath:E},it:R},Z,L,F){const V=F?(0,e._)`${f}, ${y}, ${d}${$}`:y,U=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,R.parentData],[r.default.parentDataProperty,R.parentDataProperty],[r.default.rootData,r.default.rootData]];R.opts.dynamicRef&&U.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const K=(0,e._)`${V}, ${g.object(...U)}`;return L!==e.nil?(0,e._)`${Z}.call(${L}, ${K})`:(0,e._)`${Z}(${K})`}pe.callValidateCode=h;const w=(0,e._)`new RegExp`;function S({gen:f,it:{opts:y}},g){const d=y.unicodeRegExp?"u":"",{regExp:$}=y.code,E=$(g,d);return f.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${$.code==="new RegExp"?w:(0,n.useFunc)(f,$)}(${g}, ${d})`})}pe.usePattern=S;function p(f){const{gen:y,data:g,keyword:d,it:$}=f,E=y.name("valid");if($.allErrors){const Z=y.let("valid",!0);return R(()=>y.assign(Z,!1)),Z}return y.var(E,!0),R(()=>y.break()),E;function R(Z){const L=y.const("len",(0,e._)`${g}.length`);y.forRange("i",0,L,F=>{f.subschema({keyword:d,dataProp:F,dataPropType:t.Type.Num},E),y.if((0,e.not)(E),Z)})}}pe.validateArray=p;function _(f){const{gen:y,schema:g,keyword:d,it:$}=f;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(L=>(0,t.alwaysValidSchema)($,L))&&!$.opts.unevaluated)return;const R=y.let("valid",!1),Z=y.name("_valid");y.block(()=>g.forEach((L,F)=>{const V=f.subschema({keyword:d,schemaProp:F,compositeRule:!0},Z);y.assign(R,(0,e._)`${R} || ${Z}`),f.mergeValidEvaluated(V,Z)||y.if((0,e.not)(R))})),f.result(R,()=>f.reset(),()=>f.error(!0))}return pe.validateUnion=_,pe}var si;function gm(){if(si)return Be;si=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.validateKeywordUsage=Be.validSchemaType=Be.funcKeywordCode=Be.macroKeywordCode=void 0;const e=ne(),t=Ge(),r=We(),n=mr();function s(l,h){const{gen:w,keyword:S,schema:p,parentSchema:_,it:f}=l,y=h.macro.call(f.self,p,_,f),g=u(w,S,y);f.opts.validateSchema!==!1&&f.self.validateSchema(y,!0);const d=w.name("valid");l.subschema({schema:y,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${S}`,topSchemaRef:g,compositeRule:!0},d),l.pass(d,()=>l.error(!0))}Be.macroKeywordCode=s;function o(l,h){var w;const{gen:S,keyword:p,schema:_,parentSchema:f,$data:y,it:g}=l;c(g,h);const d=!y&&h.compile?h.compile.call(g.self,_,f,g):h.validate,$=u(S,p,d),E=S.let("valid");l.block$data(E,R),l.ok((w=h.valid)!==null&&w!==void 0?w:E);function R(){if(h.errors===!1)F(),h.modifying&&i(l),V(()=>l.error());else{const U=h.async?Z():L();h.modifying&&i(l),V(()=>a(l,U))}}function Z(){const U=S.let("ruleErrs",null);return S.try(()=>F((0,e._)`await `),K=>S.assign(E,!1).if((0,e._)`${K} instanceof ${g.ValidationError}`,()=>S.assign(U,(0,e._)`${K}.errors`),()=>S.throw(K))),U}function L(){const U=(0,e._)`${$}.errors`;return S.assign(U,null),F(e.nil),U}function F(U=h.async?(0,e._)`await `:e.nil){const K=g.opts.passContext?t.default.this:t.default.self,re=!("compile"in h&&!y||h.schema===!1);S.assign(E,(0,e._)`${U}${(0,r.callValidateCode)(l,$,K,re)}`,h.modifying)}function V(U){var K;S.if((0,e.not)((K=h.valid)!==null&&K!==void 0?K:E),U)}}Be.funcKeywordCode=o;function i(l){const{gen:h,data:w,it:S}=l;h.if(S.parentData,()=>h.assign(w,(0,e._)`${S.parentData}[${S.parentDataProperty}]`))}function a(l,h){const{gen:w}=l;w.if((0,e._)`Array.isArray(${h})`,()=>{w.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${h} : ${t.default.vErrors}.concat(${h})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(l)},()=>l.error())}function c({schemaEnv:l},h){if(h.async&&!l.$async)throw new Error("async keyword in sync schema")}function u(l,h,w){if(w===void 0)throw new Error(`keyword "${h}" failed to compile`);return l.scopeValue("keyword",typeof w=="function"?{ref:w}:{ref:w,code:(0,e.stringify)(w)})}function m(l,h,w=!1){return!h.length||h.some(S=>S==="array"?Array.isArray(l):S==="object"?l&&typeof l=="object"&&!Array.isArray(l):typeof l==S||w&&typeof l>"u")}Be.validSchemaType=m;function v({schema:l,opts:h,self:w,errSchemaPath:S},p,_){if(Array.isArray(p.keyword)?!p.keyword.includes(_):p.keyword!==_)throw new Error("ajv implementation error");const f=p.dependencies;if(f?.some(y=>!Object.prototype.hasOwnProperty.call(l,y)))throw new Error(`parent schema must have dependencies of ${_}: ${f.join(",")}`);if(p.validateSchema&&!p.validateSchema(l[_])){const g=`keyword "${_}" value is invalid at path "${S}": `+w.errorsText(p.validateSchema.errors);if(h.validateSchema==="log")w.logger.error(g);else throw new Error(g)}}return Be.validateKeywordUsage=v,Be}var nt={},oi;function _m(){if(oi)return nt;oi=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.extendSubschemaMode=nt.extendSubschemaData=nt.getSubschema=void 0;const e=ne(),t=ce();function r(o,{keyword:i,schemaProp:a,schema:c,schemaPath:u,errSchemaPath:m,topSchemaRef:v}){if(i!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){const l=o.schema[i];return a===void 0?{schema:l,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}`,errSchemaPath:`${o.errSchemaPath}/${i}`}:{schema:l[a],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${i}/${(0,t.escapeFragment)(a)}`}}if(c!==void 0){if(u===void 0||m===void 0||v===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:v,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}nt.getSubschema=r;function n(o,i,{dataProp:a,dataPropType:c,data:u,dataTypes:m,propertyName:v}){if(u!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=i;if(a!==void 0){const{errorPath:w,dataPathArr:S,opts:p}=i,_=l.let("data",(0,e._)`${i.data}${(0,e.getProperty)(a)}`,!0);h(_),o.errorPath=(0,e.str)`${w}${(0,t.getErrorPath)(a,c,p.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${a}`,o.dataPathArr=[...S,o.parentDataProperty]}if(u!==void 0){const w=u instanceof e.Name?u:l.let("data",u,!0);h(w),v!==void 0&&(o.propertyName=v)}m&&(o.dataTypes=m);function h(w){o.data=w,o.dataLevel=i.dataLevel+1,o.dataTypes=[],i.definedProperties=new Set,o.parentData=i.data,o.dataNames=[...i.dataNames,w]}}nt.extendSubschemaData=n;function s(o,{jtdDiscriminator:i,jtdMetadata:a,compositeRule:c,createErrors:u,allErrors:m}){c!==void 0&&(o.compositeRule=c),u!==void 0&&(o.createErrors=u),m!==void 0&&(o.allErrors=m),o.jtdDiscriminator=i,o.jtdMetadata=a}return nt.extendSubschemaMode=s,nt}var Ce={},es,ii;function ai(){return ii||(ii=1,es=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 n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))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(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),es}var ts={exports:{}},ci;function $m(){if(ci)return ts.exports;ci=1;var e=ts.exports=function(n,s,o){typeof s=="function"&&(o=s,s={}),o=s.cb||o;var i=typeof o=="function"?o:o.pre||function(){},a=o.post||function(){};t(s,i,a,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(n,s,o,i,a,c,u,m,v,l){if(i&&typeof i=="object"&&!Array.isArray(i)){s(i,a,c,u,m,v,l);for(var h in i){var w=i[h];if(Array.isArray(w)){if(h in e.arrayKeywords)for(var S=0;S<w.length;S++)t(n,s,o,w[S],a+"/"+h+"/"+S,c,a,h,i,S)}else if(h in e.propsKeywords){if(w&&typeof w=="object")for(var p in w)t(n,s,o,w[p],a+"/"+h+"/"+r(p),c,a,h,i,p)}else(h in e.keywords||n.allKeys&&!(h in e.skipKeywords))&&t(n,s,o,w,a+"/"+h,c,a,h,i)}o(i,a,c,u,m,v,l)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return ts.exports}var ui;function pr(){if(ui)return Ce;ui=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.getSchemaRefs=Ce.resolveUrl=Ce.normalizeId=Ce._getFullPath=Ce.getFullPath=Ce.inlineRef=void 0;const e=ce(),t=ai(),r=$m(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(S,p=!0){return typeof S=="boolean"?!0:p===!0?!i(S):p?a(S)<=p:!1}Ce.inlineRef=s;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(S){for(const p in S){if(o.has(p))return!0;const _=S[p];if(Array.isArray(_)&&_.some(i)||typeof _=="object"&&i(_))return!0}return!1}function a(S){let p=0;for(const _ in S){if(_==="$ref")return 1/0;if(p++,!n.has(_)&&(typeof S[_]=="object"&&(0,e.eachItem)(S[_],f=>p+=a(f)),p===1/0))return 1/0}return p}function c(S,p="",_){_!==!1&&(p=v(p));const f=S.parse(p);return u(S,f)}Ce.getFullPath=c;function u(S,p){return S.serialize(p).split("#")[0]+"#"}Ce._getFullPath=u;const m=/#\/?$/;function v(S){return S?S.replace(m,""):""}Ce.normalizeId=v;function l(S,p,_){return _=v(_),S.resolve(p,_)}Ce.resolveUrl=l;const h=/^[a-z_][-a-z0-9._]*$/i;function w(S,p){if(typeof S=="boolean")return{};const{schemaId:_,uriResolver:f}=this.opts,y=v(S[_]||p),g={"":y},d=c(f,y,!1),$={},E=new Set;return r(S,{allKeys:!0},(L,F,V,U)=>{if(U===void 0)return;const K=d+F;let re=g[U];typeof L[_]=="string"&&(re=ye.call(this,L[_])),me.call(this,L.$anchor),me.call(this,L.$dynamicAnchor),g[F]=re;function ye(ue){const Oe=this.opts.uriResolver.resolve;if(ue=v(re?Oe(re,ue):ue),E.has(ue))throw Z(ue);E.add(ue);let M=this.refs[ue];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?R(L,M.schema,ue):ue!==v(K)&&(ue[0]==="#"?(R(L,$[ue],ue),$[ue]=L):this.refs[ue]=K),ue}function me(ue){if(typeof ue=="string"){if(!h.test(ue))throw new Error(`invalid anchor "${ue}"`);ye.call(this,`#${ue}`)}}}),$;function R(L,F,V){if(F!==void 0&&!t(L,F))throw Z(V)}function Z(L){return new Error(`reference "${L}" resolves to more than one schema`)}}return Ce.getSchemaRefs=w,Ce}var di;function jt(){if(di)return tt;di=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.getData=tt.KeywordCxt=tt.validateFunctionCode=void 0;const e=ym(),t=hr(),r=ei(),n=hr(),s=vm(),o=gm(),i=_m(),a=ne(),c=Ge(),u=pr(),m=ce(),v=mr();function l(j){if(d(j)&&(E(j),g(j))){p(j);return}h(j,()=>(0,e.topBoolOrEmptySchema)(j))}tt.validateFunctionCode=l;function h({gen:j,validateName:z,schema:q,schemaEnv:H,opts:X},se){X.code.es5?j.func(z,(0,a._)`${c.default.data}, ${c.default.valCxt}`,H.$async,()=>{j.code((0,a._)`"use strict"; ${f(q,X)}`),S(j,X),j.code(se)}):j.func(z,(0,a._)`${c.default.data}, ${w(X)}`,H.$async,()=>j.code(f(q,X)).code(se))}function w(j){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${j.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function S(j,z){j.if(c.default.valCxt,()=>{j.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),j.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),j.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),j.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),z.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{j.var(c.default.instancePath,(0,a._)`""`),j.var(c.default.parentData,(0,a._)`undefined`),j.var(c.default.parentDataProperty,(0,a._)`undefined`),j.var(c.default.rootData,c.default.data),z.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function p(j){const{schema:z,opts:q,gen:H}=j;h(j,()=>{q.$comment&&z.$comment&&U(j),L(j),H.let(c.default.vErrors,null),H.let(c.default.errors,0),q.unevaluated&&_(j),R(j),K(j)})}function _(j){const{gen:z,validateName:q}=j;j.evaluated=z.const("evaluated",(0,a._)`${q}.evaluated`),z.if((0,a._)`${j.evaluated}.dynamicProps`,()=>z.assign((0,a._)`${j.evaluated}.props`,(0,a._)`undefined`)),z.if((0,a._)`${j.evaluated}.dynamicItems`,()=>z.assign((0,a._)`${j.evaluated}.items`,(0,a._)`undefined`))}function f(j,z){const q=typeof j=="object"&&j[z.schemaId];return q&&(z.code.source||z.code.process)?(0,a._)`/*# sourceURL=${q} */`:a.nil}function y(j,z){if(d(j)&&(E(j),g(j))){$(j,z);return}(0,e.boolOrEmptySchema)(j,z)}function g({schema:j,self:z}){if(typeof j=="boolean")return!j;for(const q in j)if(z.RULES.all[q])return!0;return!1}function d(j){return typeof j.schema!="boolean"}function $(j,z){const{schema:q,gen:H,opts:X}=j;X.$comment&&q.$comment&&U(j),F(j),V(j);const se=H.const("_errs",c.default.errors);R(j,se),H.var(z,(0,a._)`${se} === ${c.default.errors}`)}function E(j){(0,m.checkUnknownRules)(j),Z(j)}function R(j,z){if(j.opts.jtd)return ye(j,[],!1,z);const q=(0,t.getSchemaTypes)(j.schema),H=(0,t.coerceAndCheckDataType)(j,q);ye(j,q,!H,z)}function Z(j){const{schema:z,errSchemaPath:q,opts:H,self:X}=j;z.$ref&&H.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(z,X.RULES)&&X.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function L(j){const{schema:z,opts:q}=j;z.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,m.checkStrictMode)(j,"default is ignored in the schema root")}function F(j){const z=j.schema[j.opts.schemaId];z&&(j.baseId=(0,u.resolveUrl)(j.opts.uriResolver,j.baseId,z))}function V(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function U({gen:j,schemaEnv:z,schema:q,errSchemaPath:H,opts:X}){const se=q.$comment;if(X.$comment===!0)j.code((0,a._)`${c.default.self}.logger.log(${se})`);else if(typeof X.$comment=="function"){const je=(0,a.str)`${H}/$comment`,Le=j.scopeValue("root",{ref:z.root});j.code((0,a._)`${c.default.self}.opts.$comment(${se}, ${je}, ${Le}.schema)`)}}function K(j){const{gen:z,schemaEnv:q,validateName:H,ValidationError:X,opts:se}=j;q.$async?z.if((0,a._)`${c.default.errors} === 0`,()=>z.return(c.default.data),()=>z.throw((0,a._)`new ${X}(${c.default.vErrors})`)):(z.assign((0,a._)`${H}.errors`,c.default.vErrors),se.unevaluated&&re(j),z.return((0,a._)`${c.default.errors} === 0`))}function re({gen:j,evaluated:z,props:q,items:H}){q instanceof a.Name&&j.assign((0,a._)`${z}.props`,q),H instanceof a.Name&&j.assign((0,a._)`${z}.items`,H)}function ye(j,z,q,H){const{gen:X,schema:se,data:je,allErrors:Le,opts:Me,self:Ne}=j,{RULES:k}=Ne;if(se.$ref&&(Me.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(se,k))){X.block(()=>G(j,"$ref",k.all.$ref.definition));return}Me.jtd||ue(j,z),X.block(()=>{for(const I of k.rules)N(I);N(k.post)});function N(I){(0,r.shouldUseGroup)(se,I)&&(I.type?(X.if((0,n.checkDataType)(I.type,je,Me.strictNumbers)),me(j,I),z.length===1&&z[0]===I.type&&q&&(X.else(),(0,n.reportTypeError)(j)),X.endIf()):me(j,I),Le||X.if((0,a._)`${c.default.errors} === ${H||0}`))}}function me(j,z){const{gen:q,schema:H,opts:{useDefaults:X}}=j;X&&(0,s.assignDefaults)(j,z.type),q.block(()=>{for(const se of z.rules)(0,r.shouldUseRule)(H,se)&&G(j,se.keyword,se.definition,z.type)})}function ue(j,z){j.schemaEnv.meta||!j.opts.strictTypes||(Oe(j,z),j.opts.allowUnionTypes||M(j,z),O(j,j.dataTypes))}function Oe(j,z){if(z.length){if(!j.dataTypes.length){j.dataTypes=z;return}z.forEach(q=>{A(j.dataTypes,q)||P(j,`type "${q}" not allowed by context "${j.dataTypes.join(",")}"`)}),b(j,z)}}function M(j,z){z.length>1&&!(z.length===2&&z.includes("null"))&&P(j,"use allowUnionTypes to allow union type keyword")}function O(j,z){const q=j.self.RULES.all;for(const H in q){const X=q[H];if(typeof X=="object"&&(0,r.shouldUseRule)(j.schema,X)){const{type:se}=X.definition;se.length&&!se.some(je=>C(z,je))&&P(j,`missing type "${se.join(",")}" for keyword "${H}"`)}}}function C(j,z){return j.includes(z)||z==="number"&&j.includes("integer")}function A(j,z){return j.includes(z)||z==="integer"&&j.includes("number")}function b(j,z){const q=[];for(const H of j.dataTypes)A(z,H)?q.push(H):z.includes("integer")&&H==="number"&&q.push("integer");j.dataTypes=q}function P(j,z){const q=j.schemaEnv.baseId+j.errSchemaPath;z+=` at "${q}" (strictTypes)`,(0,m.checkStrictMode)(j,z,j.opts.strictTypes)}class T{constructor(z,q,H){if((0,o.validateKeywordUsage)(z,q,H),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=H,this.data=z.data,this.schema=z.schema[H],this.$data=q.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(z,this.schema,H,this.$data),this.schemaType=q.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=q,this.$data)this.schemaCode=z.gen.const("vSchema",ae(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${H} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=z.gen.const("_errs",c.default.errors))}result(z,q,H){this.failResult((0,a.not)(z),q,H)}failResult(z,q,H){this.gen.if(z),H?H():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,q){this.failResult((0,a.not)(z),void 0,q)}fail(z){if(z===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);const{schemaCode:q}=this;this.fail((0,a._)`${q} !== undefined && (${(0,a.or)(this.invalid$data(),z)})`)}error(z,q,H){if(q){this.setParams(q),this._error(z,H),this.setParams({});return}this._error(z,H)}_error(z,q){(z?v.reportExtraError:v.reportError)(this,this.def.error,q)}$dataError(){(0,v.reportError)(this,this.def.$dataError||v.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,v.resetErrorsCount)(this.gen,this.errsCount)}ok(z){this.allErrors||this.gen.if(z)}setParams(z,q){q?Object.assign(this.params,z):this.params=z}block$data(z,q,H=a.nil){this.gen.block(()=>{this.check$data(z,H),q()})}check$data(z=a.nil,q=a.nil){if(!this.$data)return;const{gen:H,schemaCode:X,schemaType:se,def:je}=this;H.if((0,a.or)((0,a._)`${X} === undefined`,q)),z!==a.nil&&H.assign(z,!0),(se.length||je.validateSchema)&&(H.elseIf(this.invalid$data()),this.$dataError(),z!==a.nil&&H.assign(z,!1)),H.else()}invalid$data(){const{gen:z,schemaCode:q,schemaType:H,def:X,it:se}=this;return(0,a.or)(je(),Le());function je(){if(H.length){if(!(q instanceof a.Name))throw new Error("ajv implementation error");const Me=Array.isArray(H)?H:[H];return(0,a._)`${(0,n.checkDataTypes)(Me,q,se.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function Le(){if(X.validateSchema){const Me=z.scopeValue("validate$data",{ref:X.validateSchema});return(0,a._)`!${Me}(${q})`}return a.nil}}subschema(z,q){const H=(0,i.getSubschema)(this.it,z);(0,i.extendSubschemaData)(H,this.it,z),(0,i.extendSubschemaMode)(H,z);const X={...this.it,...H,items:void 0,props:void 0};return y(X,q),X}mergeEvaluated(z,q){const{it:H,gen:X}=this;H.opts.unevaluated&&(H.props!==!0&&z.props!==void 0&&(H.props=m.mergeEvaluated.props(X,z.props,H.props,q)),H.items!==!0&&z.items!==void 0&&(H.items=m.mergeEvaluated.items(X,z.items,H.items,q)))}mergeValidEvaluated(z,q){const{it:H,gen:X}=this;if(H.opts.unevaluated&&(H.props!==!0||H.items!==!0))return X.if(q,()=>this.mergeEvaluated(z,a.Name)),!0}}tt.KeywordCxt=T;function G(j,z,q,H){const X=new T(j,q,z);"code"in q?q.code(X,H):X.$data&&q.validate?(0,o.funcKeywordCode)(X,q):"macro"in q?(0,o.macroKeywordCode)(X,q):(q.compile||q.validate)&&(0,o.funcKeywordCode)(X,q)}const Y=/^\/(?:[^~]|~0|~1)*$/,ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ae(j,{dataLevel:z,dataNames:q,dataPathArr:H}){let X,se;if(j==="")return c.default.rootData;if(j[0]==="/"){if(!Y.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);X=j,se=c.default.rootData}else{const Ne=ie.exec(j);if(!Ne)throw new Error(`Invalid JSON-pointer: ${j}`);const k=+Ne[1];if(X=Ne[2],X==="#"){if(k>=z)throw new Error(Me("property/index",k));return H[z-k]}if(k>z)throw new Error(Me("data",k));if(se=q[z-k],!X)return se}let je=se;const Le=X.split("/");for(const Ne of Le)Ne&&(se=(0,a._)`${se}${(0,a.getProperty)((0,m.unescapeJsonPointer)(Ne))}`,je=(0,a._)`${je} && ${se}`);return je;function Me(Ne,k){return`Cannot access ${Ne} ${k} levels up, current level is ${z}`}}return tt.getData=ae,tt}var yr={},li;function Ft(){if(li)return yr;li=1,Object.defineProperty(yr,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return yr.default=e,yr}var vr={},fi;function At(){if(fi)return vr;fi=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=pr();class t extends Error{constructor(n,s,o,i){super(i||`can't resolve reference ${o} from id ${s}`),this.missingRef=(0,e.resolveUrl)(n,s,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return vr.default=t,vr}var xe={},mi;function gr(){if(mi)return xe;mi=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.resolveSchema=xe.getCompilingSchema=xe.resolveRef=xe.compileSchema=xe.SchemaEnv=void 0;const e=ne(),t=Ft(),r=Ge(),n=pr(),s=ce(),o=jt();class i{constructor(_){var f;this.refs={},this.dynamicAnchors={};let y;typeof _.schema=="object"&&(y=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(f=_.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(y?.[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=y?.$async,this.refs={}}}xe.SchemaEnv=i;function a(p){const _=m.call(this,p);if(_)return _;const f=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),{es5:y,lines:g}=this.opts.code,{ownProperties:d}=this.opts,$=new e.CodeGen(this.scope,{es5:y,lines:g,ownProperties:d});let E;p.$async&&(E=$.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=$.scopeName("validate");p.validateName=R;const Z={gen:$,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:R,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:f,baseId:p.baseId||f,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let L;try{this._compilations.add(p),(0,o.validateFunctionCode)(Z),$.optimize(this.opts.code.optimize);const F=$.toString();L=`${$.scopeRefs(r.default.scope)}return ${F}`,this.opts.code.process&&(L=this.opts.code.process(L,p));const U=new Function(`${r.default.self}`,`${r.default.scope}`,L)(this,this.scope.get());if(this.scope.value(R,{ref:U}),U.errors=null,U.schema=p.schema,U.schemaEnv=p,p.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:R,validateCode:F,scopeValues:$._values}),this.opts.unevaluated){const{props:K,items:re}=Z;U.evaluated={props:K instanceof e.Name?void 0:K,items:re instanceof e.Name?void 0:re,dynamicProps:K instanceof e.Name,dynamicItems:re instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return p.validate=U,p}catch(F){throw delete p.validate,delete p.validateName,L&&this.logger.error("Error compiling schema, function code:",L),F}finally{this._compilations.delete(p)}}xe.compileSchema=a;function c(p,_,f){var y;f=(0,n.resolveUrl)(this.opts.uriResolver,_,f);const g=p.refs[f];if(g)return g;let d=l.call(this,p,f);if(d===void 0){const $=(y=p.localRefs)===null||y===void 0?void 0:y[f],{schemaId:E}=this.opts;$&&(d=new i({schema:$,schemaId:E,root:p,baseId:_}))}if(d!==void 0)return p.refs[f]=u.call(this,d)}xe.resolveRef=c;function u(p){return(0,n.inlineRef)(p.schema,this.opts.inlineRefs)?p.schema:p.validate?p:a.call(this,p)}function m(p){for(const _ of this._compilations)if(v(_,p))return _}xe.getCompilingSchema=m;function v(p,_){return p.schema===_.schema&&p.root===_.root&&p.baseId===_.baseId}function l(p,_){let f;for(;typeof(f=this.refs[_])=="string";)_=f;return f||this.schemas[_]||h.call(this,p,_)}function h(p,_){const f=this.opts.uriResolver.parse(_),y=(0,n._getFullPath)(this.opts.uriResolver,f);let g=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&y===g)return S.call(this,f,p);const d=(0,n.normalizeId)(y),$=this.refs[d]||this.schemas[d];if(typeof $=="string"){const E=h.call(this,p,$);return typeof E?.schema!="object"?void 0:S.call(this,f,E)}if(typeof $?.schema=="object"){if($.validate||a.call(this,$),d===(0,n.normalizeId)(_)){const{schema:E}=$,{schemaId:R}=this.opts,Z=E[R];return Z&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,Z)),new i({schema:E,schemaId:R,root:p,baseId:g})}return S.call(this,f,$)}}xe.resolveSchema=h;const w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function S(p,{baseId:_,schema:f,root:y}){var g;if(((g=p.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const E of p.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const R=f[(0,s.unescapeFragment)(E)];if(R===void 0)return;f=R;const Z=typeof f=="object"&&f[this.opts.schemaId];!w.has(E)&&Z&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,Z))}let d;if(typeof f!="boolean"&&f.$ref&&!(0,s.schemaHasRulesButRef)(f,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,_,f.$ref);d=h.call(this,y,E)}const{schemaId:$}=this.opts;if(d=d||new i({schema:f,schemaId:$,root:y,baseId:_}),d.schema!==d.root.schema)return d}return xe}const bm={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var _r={},qt={exports:{}},rs,hi;function pi(){if(hi)return rs;hi=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=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);function r(l){let h="",w=0,S=0;for(S=0;S<l.length;S++)if(w=l[S].charCodeAt(0),w!==48){if(!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=l[S];break}for(S+=1;S<l.length;S++){if(w=l[S].charCodeAt(0),!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=l[S]}return h}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(l){return l.length=0,!0}function o(l,h,w){if(l.length){const S=r(l);if(S!=="")h.push(S);else return w.error=!0,!1;l.length=0}return!0}function i(l){let h=0;const w={error:!1,address:"",zone:""},S=[],p=[];let _=!1,f=!1,y=o;for(let g=0;g<l.length;g++){const d=l[g];if(!(d==="["||d==="]"))if(d===":"){if(_===!0&&(f=!0),!y(p,S,w))break;if(++h>7){w.error=!0;break}g>0&&l[g-1]===":"&&(_=!0),S.push(":");continue}else if(d==="%"){if(!y(p,S,w))break;y=s}else{p.push(d);continue}}return p.length&&(y===s?w.zone=p.join(""):f?S.push(p.join("")):S.push(r(p))),w.address=S.join(""),w}function a(l){if(c(l,":")<2)return{host:l,isIPV6:!1};const h=i(l);if(h.error)return{host:l,isIPV6:!1};{let w=h.address,S=h.address;return h.zone&&(w+="%"+h.zone,S+="%25"+h.zone),{host:w,isIPV6:!0,escapedHost:S}}}function c(l,h){let w=0;for(let S=0;S<l.length;S++)l[S]===h&&w++;return w}function u(l){let h=l;const w=[];let S=-1,p=0;for(;p=h.length;){if(p===1){if(h===".")break;if(h==="/"){w.push("/");break}else{w.push(h);break}}else if(p===2){if(h[0]==="."){if(h[1]===".")break;if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&(h[1]==="."||h[1]==="/")){w.push("/");break}}else if(p===3&&h==="/.."){w.length!==0&&w.pop(),w.push("/");break}if(h[0]==="."){if(h[1]==="."){if(h[2]==="/"){h=h.slice(3);continue}}else if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&h[1]==="."){if(h[2]==="/"){h=h.slice(2);continue}else if(h[2]==="."&&h[3]==="/"){h=h.slice(3),w.length!==0&&w.pop();continue}}if((S=h.indexOf("/",1))===-1){w.push(h);break}else w.push(h.slice(0,S)),h=h.slice(S)}return w.join("")}function m(l,h){const w=h!==!0?escape:unescape;return l.scheme!==void 0&&(l.scheme=w(l.scheme)),l.userinfo!==void 0&&(l.userinfo=w(l.userinfo)),l.host!==void 0&&(l.host=w(l.host)),l.path!==void 0&&(l.path=w(l.path)),l.query!==void 0&&(l.query=w(l.query)),l.fragment!==void 0&&(l.fragment=w(l.fragment)),l}function v(l){const h=[];if(l.userinfo!==void 0&&(h.push(l.userinfo),h.push("@")),l.host!==void 0){let w=unescape(l.host);if(!t(w)){const S=a(w);S.isIPV6===!0?w=`[${S.escapedHost}]`:w=l.host}h.push(w)}return(typeof l.port=="number"||typeof l.port=="string")&&(h.push(":"),h.push(String(l.port))),h.length?h.join(""):void 0}return rs={nonSimpleDomain:n,recomposeAuthority:v,normalizeComponentEncoding:m,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:r},rs}var ns,yi;function wm(){if(yi)return ns;yi=1;const{isUUID:e}=pi(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(d){return r.indexOf(d)!==-1}function s(d){return d.secure===!0?!0:d.secure===!1?!1:d.scheme?d.scheme.length===3&&(d.scheme[0]==="w"||d.scheme[0]==="W")&&(d.scheme[1]==="s"||d.scheme[1]==="S")&&(d.scheme[2]==="s"||d.scheme[2]==="S"):!1}function o(d){return d.host||(d.error=d.error||"HTTP URIs must have a host."),d}function i(d){const $=String(d.scheme).toLowerCase()==="https";return(d.port===($?443:80)||d.port==="")&&(d.port=void 0),d.path||(d.path="/"),d}function a(d){return d.secure=s(d),d.resourceName=(d.path||"/")+(d.query?"?"+d.query:""),d.path=void 0,d.query=void 0,d}function c(d){if((d.port===(s(d)?443:80)||d.port==="")&&(d.port=void 0),typeof d.secure=="boolean"&&(d.scheme=d.secure?"wss":"ws",d.secure=void 0),d.resourceName){const[$,E]=d.resourceName.split("?");d.path=$&&$!=="/"?$:void 0,d.query=E,d.resourceName=void 0}return d.fragment=void 0,d}function u(d,$){if(!d.path)return d.error="URN can not be parsed",d;const E=d.path.match(t);if(E){const R=$.scheme||d.scheme||"urn";d.nid=E[1].toLowerCase(),d.nss=E[2];const Z=`${R}:${$.nid||d.nid}`,L=g(Z);d.path=void 0,L&&(d=L.parse(d,$))}else d.error=d.error||"URN can not be parsed.";return d}function m(d,$){if(d.nid===void 0)throw new Error("URN without nid cannot be serialized");const E=$.scheme||d.scheme||"urn",R=d.nid.toLowerCase(),Z=`${E}:${$.nid||R}`,L=g(Z);L&&(d=L.serialize(d,$));const F=d,V=d.nss;return F.path=`${R||$.nid}:${V}`,$.skipEscape=!0,F}function v(d,$){const E=d;return E.uuid=E.nss,E.nss=void 0,!$.tolerant&&(!E.uuid||!e(E.uuid))&&(E.error=E.error||"UUID is not valid."),E}function l(d){const $=d;return $.nss=(d.uuid||"").toLowerCase(),$}const h={scheme:"http",domainHost:!0,parse:o,serialize:i},w={scheme:"https",domainHost:h.domainHost,parse:o,serialize:i},S={scheme:"ws",domainHost:!0,parse:a,serialize:c},p={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},y={http:h,https:w,ws:S,wss:p,urn:{scheme:"urn",parse:u,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:l,skipNormalize:!0}};Object.setPrototypeOf(y,null);function g(d){return d&&(y[d]||y[d.toLowerCase()])||void 0}return ns={wsIsSecure:s,SCHEMES:y,isValidSchemeName:n,getSchemeHandler:g},ns}var vi;function Sm(){if(vi)return qt.exports;vi=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:s,nonSimpleDomain:o}=pi(),{SCHEMES:i,getSchemeHandler:a}=wm();function c(p,_){return typeof p=="string"?p=l(w(p,_),_):typeof p=="object"&&(p=w(l(p,_),_)),p}function u(p,_,f){const y=f?Object.assign({scheme:"null"},f):{scheme:"null"},g=m(w(p,y),w(_,y),y,!0);return y.skipEscape=!0,l(g,y)}function m(p,_,f,y){const g={};return y||(p=w(l(p,f),f),_=w(l(_,f),f)),f=f||{},!f.tolerant&&_.scheme?(g.scheme=_.scheme,g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.path?(_.path[0]==="/"?g.path=t(_.path):((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?g.path="/"+_.path:p.path?g.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+_.path:g.path=_.path,g.path=t(g.path)),g.query=_.query):(g.path=p.path,_.query!==void 0?g.query=_.query:g.query=p.query),g.userinfo=p.userinfo,g.host=p.host,g.port=p.port),g.scheme=p.scheme),g.fragment=_.fragment,g}function v(p,_,f){return typeof p=="string"?(p=unescape(p),p=l(n(w(p,f),!0),{...f,skipEscape:!0})):typeof p=="object"&&(p=l(n(p,!0),{...f,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=l(n(w(_,f),!0),{...f,skipEscape:!0})):typeof _=="object"&&(_=l(n(_,!0),{...f,skipEscape:!0})),p.toLowerCase()===_.toLowerCase()}function l(p,_){const f={host:p.host,scheme:p.scheme,userinfo:p.userinfo,port:p.port,path:p.path,query:p.query,nid:p.nid,nss:p.nss,uuid:p.uuid,fragment:p.fragment,reference:p.reference,resourceName:p.resourceName,secure:p.secure,error:""},y=Object.assign({},_),g=[],d=a(y.scheme||f.scheme);d&&d.serialize&&d.serialize(f,y),f.path!==void 0&&(y.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),y.reference!=="suffix"&&f.scheme&&g.push(f.scheme,":");const $=r(f);if($!==void 0&&(y.reference!=="suffix"&&g.push("//"),g.push($),f.path&&f.path[0]!=="/"&&g.push("/")),f.path!==void 0){let E=f.path;!y.absolutePath&&(!d||!d.absolutePath)&&(E=t(E)),$===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),g.push(E)}return f.query!==void 0&&g.push("?",f.query),f.fragment!==void 0&&g.push("#",f.fragment),g.join("")}const h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(p,_){const f=Object.assign({},_),y={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let g=!1;f.reference==="suffix"&&(f.scheme?p=f.scheme+":"+p:p="//"+p);const d=p.match(h);if(d){if(y.scheme=d[1],y.userinfo=d[3],y.host=d[4],y.port=parseInt(d[5],10),y.path=d[6]||"",y.query=d[7],y.fragment=d[8],isNaN(y.port)&&(y.port=d[5]),y.host)if(s(y.host)===!1){const R=e(y.host);y.host=R.host.toLowerCase(),g=R.isIPV6}else g=!0;y.scheme===void 0&&y.userinfo===void 0&&y.host===void 0&&y.port===void 0&&y.query===void 0&&!y.path?y.reference="same-document":y.scheme===void 0?y.reference="relative":y.fragment===void 0?y.reference="absolute":y.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==y.reference&&(y.error=y.error||"URI is not a "+f.reference+" reference.");const $=a(f.scheme||y.scheme);if(!f.unicodeSupport&&(!$||!$.unicodeSupport)&&y.host&&(f.domainHost||$&&$.domainHost)&&g===!1&&o(y.host))try{y.host=URL.domainToASCII(y.host.toLowerCase())}catch(E){y.error=y.error||"Host's domain name can not be converted to ASCII: "+E}(!$||$&&!$.skipNormalize)&&(p.indexOf("%")!==-1&&(y.scheme!==void 0&&(y.scheme=unescape(y.scheme)),y.host!==void 0&&(y.host=unescape(y.host))),y.path&&(y.path=escape(unescape(y.path))),y.fragment&&(y.fragment=encodeURI(decodeURIComponent(y.fragment)))),$&&$.parse&&$.parse(y,f)}else y.error=y.error||"URI can not be parsed.";return y}const S={SCHEMES:i,normalize:c,resolve:u,resolveComponent:m,equal:v,serialize:l,parse:w};return qt.exports=S,qt.exports.default=S,qt.exports.fastUri=S,qt.exports}var gi;function Em(){if(gi)return _r;gi=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=Sm();return e.code='require("ajv/dist/runtime/uri").default',_r.default=e,_r}var _i;function ss(){return _i||(_i=1,(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=jt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ne();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 n=Ft(),s=At(),o=Xo(),i=gr(),a=ne(),c=pr(),u=hr(),m=ce(),v=bm,l=Em(),h=(M,O)=>new RegExp(M,O);h.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),p={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function y(M){var O,C,A,b,P,T,G,Y,ie,ae,j,z,q,H,X,se,je,Le,Me,Ne,k,N,I,B,J;const x=M.strict,Q=(O=M.code)===null||O===void 0?void 0:O.optimize,le=Q===!0||Q===void 0?1:Q||0,fe=(A=(C=M.code)===null||C===void 0?void 0:C.regExp)!==null&&A!==void 0?A:h,ze=(b=M.uriResolver)!==null&&b!==void 0?b:l.default;return{strictSchema:(T=(P=M.strictSchema)!==null&&P!==void 0?P:x)!==null&&T!==void 0?T:!0,strictNumbers:(Y=(G=M.strictNumbers)!==null&&G!==void 0?G:x)!==null&&Y!==void 0?Y:!0,strictTypes:(ae=(ie=M.strictTypes)!==null&&ie!==void 0?ie:x)!==null&&ae!==void 0?ae:"log",strictTuples:(z=(j=M.strictTuples)!==null&&j!==void 0?j:x)!==null&&z!==void 0?z:"log",strictRequired:(H=(q=M.strictRequired)!==null&&q!==void 0?q:x)!==null&&H!==void 0?H:!1,code:M.code?{...M.code,optimize:le,regExp:fe}:{optimize:le,regExp:fe},loopRequired:(X=M.loopRequired)!==null&&X!==void 0?X:f,loopEnum:(se=M.loopEnum)!==null&&se!==void 0?se:f,meta:(je=M.meta)!==null&&je!==void 0?je:!0,messages:(Le=M.messages)!==null&&Le!==void 0?Le:!0,inlineRefs:(Me=M.inlineRefs)!==null&&Me!==void 0?Me:!0,schemaId:(Ne=M.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(k=M.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(N=M.validateSchema)!==null&&N!==void 0?N:!0,validateFormats:(I=M.validateFormats)!==null&&I!==void 0?I:!0,unicodeRegExp:(B=M.unicodeRegExp)!==null&&B!==void 0?B:!0,int32range:(J=M.int32range)!==null&&J!==void 0?J:!0,uriResolver:ze}}class g{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...y(O)};const{es5:C,lines:A}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:S,es5:C,lines:A}),this.logger=V(O.logger);const b=O.validateFormats;O.validateFormats=!1,this.RULES=(0,o.getRules)(),d.call(this,p,O,"NOT SUPPORTED"),d.call(this,_,O,"DEPRECATED","warn"),this._metaOpts=L.call(this),O.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&Z.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),E.call(this),O.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:O,meta:C,schemaId:A}=this.opts;let b=v;A==="id"&&(b={...v},b.id=b.$id,delete b.$id),C&&O&&this.addMetaSchema(b,b[A],!1)}defaultMeta(){const{meta:O,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[C]||O:void 0}validate(O,C){let A;if(typeof O=="string"){if(A=this.getSchema(O),!A)throw new Error(`no schema with key or ref "${O}"`)}else A=this.compile(O);const b=A(C);return"$async"in A||(this.errors=A.errors),b}compile(O,C){const A=this._addSchema(O,C);return A.validate||this._compileSchemaEnv(A)}compileAsync(O,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:A}=this.opts;return b.call(this,O,C);async function b(ae,j){await P.call(this,ae.$schema);const z=this._addSchema(ae,j);return z.validate||T.call(this,z)}async function P(ae){ae&&!this.getSchema(ae)&&await b.call(this,{$ref:ae},!0)}async function T(ae){try{return this._compileSchemaEnv(ae)}catch(j){if(!(j instanceof s.default))throw j;return G.call(this,j),await Y.call(this,j.missingSchema),T.call(this,ae)}}function G({missingSchema:ae,missingRef:j}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${j} cannot be resolved`)}async function Y(ae){const j=await ie.call(this,ae);this.refs[ae]||await P.call(this,j.$schema),this.refs[ae]||this.addSchema(j,ae,C)}async function ie(ae){const j=this._loading[ae];if(j)return j;try{return await(this._loading[ae]=A(ae))}finally{delete this._loading[ae]}}}addSchema(O,C,A,b=this.opts.validateSchema){if(Array.isArray(O)){for(const T of O)this.addSchema(T,void 0,A,b);return this}let P;if(typeof O=="object"){const{schemaId:T}=this.opts;if(P=O[T],P!==void 0&&typeof P!="string")throw new Error(`schema ${T} must be string`)}return C=(0,c.normalizeId)(C||P),this._checkUnique(C),this.schemas[C]=this._addSchema(O,A,C,b,!0),this}addMetaSchema(O,C,A=this.opts.validateSchema){return this.addSchema(O,C,!0,A),this}validateSchema(O,C){if(typeof O=="boolean")return!0;let A;if(A=O.$schema,A!==void 0&&typeof A!="string")throw new Error("$schema must be a string");if(A=A||this.opts.defaultMeta||this.defaultMeta(),!A)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const b=this.validate(A,O);if(!b&&C){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return b}getSchema(O){let C;for(;typeof(C=$.call(this,O))=="string";)O=C;if(C===void 0){const{schemaId:A}=this.opts,b=new i.SchemaEnv({schema:{},schemaId:A});if(C=i.resolveSchema.call(this,b,O),!C)return;this.refs[O]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=$.call(this,O);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{const C=O;this._cache.delete(C);let A=O[this.opts.schemaId];return A&&(A=(0,c.normalizeId)(A),delete this.schemas[A],delete this.refs[A]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(const C of O)this.addKeyword(C);return this}addKeyword(O,C){let A;if(typeof O=="string")A=O,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=A);else if(typeof O=="object"&&C===void 0){if(C=O,A=C.keyword,Array.isArray(A)&&!A.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(K.call(this,A,C),!C)return(0,m.eachItem)(A,P=>re.call(this,P)),this;me.call(this,C);const b={...C,type:(0,u.getJSONTypes)(C.type),schemaType:(0,u.getJSONTypes)(C.schemaType)};return(0,m.eachItem)(A,b.type.length===0?P=>re.call(this,P,b):P=>b.type.forEach(T=>re.call(this,P,b,T))),this}getKeyword(O){const C=this.RULES.all[O];return typeof C=="object"?C.definition:!!C}removeKeyword(O){const{RULES:C}=this;delete C.keywords[O],delete C.all[O];for(const A of C.rules){const b=A.rules.findIndex(P=>P.keyword===O);b>=0&&A.rules.splice(b,1)}return this}addFormat(O,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[O]=C,this}errorsText(O=this.errors,{separator:C=", ",dataVar:A="data"}={}){return!O||O.length===0?"No errors":O.map(b=>`${A}${b.instancePath} ${b.message}`).reduce((b,P)=>b+C+P)}$dataMetaSchema(O,C){const A=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(const b of C){const P=b.split("/").slice(1);let T=O;for(const G of P)T=T[G];for(const G in A){const Y=A[G];if(typeof Y!="object")continue;const{$data:ie}=Y.definition,ae=T[G];ie&&ae&&(T[G]=Oe(ae))}}return O}_removeAllSchemas(O,C){for(const A in O){const b=O[A];(!C||C.test(A))&&(typeof b=="string"?delete O[A]:b&&!b.meta&&(this._cache.delete(b.schema),delete O[A]))}}_addSchema(O,C,A,b=this.opts.validateSchema,P=this.opts.addUsedSchema){let T;const{schemaId:G}=this.opts;if(typeof O=="object")T=O[G];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof O!="boolean")throw new Error("schema must be object or boolean")}let Y=this._cache.get(O);if(Y!==void 0)return Y;A=(0,c.normalizeId)(T||A);const ie=c.getSchemaRefs.call(this,O,A);return Y=new i.SchemaEnv({schema:O,schemaId:G,meta:C,baseId:A,localRefs:ie}),this._cache.set(Y.schema,Y),P&&!A.startsWith("#")&&(A&&this._checkUnique(A),this.refs[A]=Y),b&&this.validateSchema(O,!0),Y}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw new Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):i.compileSchema.call(this,O),!O.validate)throw new Error("ajv implementation error");return O.validate}_compileMetaSchema(O){const C=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,O)}finally{this.opts=C}}}g.ValidationError=n.default,g.MissingRefError=s.default,e.default=g;function d(M,O,C,A="error"){for(const b in M){const P=b;P in O&&this.logger[A](`${C}: option ${b}. ${M[P]}`)}}function $(M){return M=(0,c.normalizeId)(M),this.schemas[M]||this.refs[M]}function E(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const O in M)this.addSchema(M[O],O)}function R(){for(const M in this.opts.formats){const O=this.opts.formats[M];O&&this.addFormat(M,O)}}function Z(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const O in M){const C=M[O];C.keyword||(C.keyword=O),this.addKeyword(C)}}function L(){const M={...this.opts};for(const O of w)delete M[O];return M}const F={log(){},warn(){},error(){}};function V(M){if(M===!1)return F;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function K(M,O){const{RULES:C}=this;if((0,m.eachItem)(M,A=>{if(C.keywords[A])throw new Error(`Keyword ${A} is already defined`);if(!U.test(A))throw new Error(`Keyword ${A} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw new Error('$data keyword must have "code" or "validate" function')}function re(M,O,C){var A;const b=O?.post;if(C&&b)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let T=b?P.post:P.rules.find(({type:Y})=>Y===C);if(T||(T={type:C,rules:[]},P.rules.push(T)),P.keywords[M]=!0,!O)return;const G={keyword:M,definition:{...O,type:(0,u.getJSONTypes)(O.type),schemaType:(0,u.getJSONTypes)(O.schemaType)}};O.before?ye.call(this,T,G,O.before):T.rules.push(G),P.all[M]=G,(A=O.implements)===null||A===void 0||A.forEach(Y=>this.addKeyword(Y))}function ye(M,O,C){const A=M.rules.findIndex(b=>b.keyword===C);A>=0?M.rules.splice(A,0,O):(M.rules.push(O),this.logger.warn(`rule ${C} is not defined`))}function me(M){let{metaSchema:O}=M;O!==void 0&&(M.$data&&this.opts.$data&&(O=Oe(O)),M.validateSchema=this.compile(O,!0))}const ue={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Oe(M){return{anyOf:[M,ue]}}})(Bn)),Bn}var $r={},br={},wr={},$i;function km(){if($i)return wr;$i=1,Object.defineProperty(wr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return wr.default=e,wr}var lt={},bi;function os(){if(bi)return lt;bi=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.callRef=lt.getValidate=void 0;const e=At(),t=We(),r=ne(),n=Ge(),s=gr(),o=ce(),i={keyword:"$ref",schemaType:"string",code(u){const{gen:m,schema:v,it:l}=u,{baseId:h,schemaEnv:w,validateName:S,opts:p,self:_}=l,{root:f}=w;if((v==="#"||v==="#/")&&h===f.baseId)return g();const y=s.resolveRef.call(_,f,h,v);if(y===void 0)throw new e.default(l.opts.uriResolver,h,v);if(y instanceof s.SchemaEnv)return d(y);return $(y);function g(){if(w===f)return c(u,S,w,w.$async);const E=m.scopeValue("root",{ref:f});return c(u,(0,r._)`${E}.validate`,f,f.$async)}function d(E){const R=a(u,E);c(u,R,E,E.$async)}function $(E){const R=m.scopeValue("schema",p.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),Z=m.name("valid"),L=u.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:R,errSchemaPath:v},Z);u.mergeEvaluated(L),u.ok(Z)}}};function a(u,m){const{gen:v}=u;return m.validate?v.scopeValue("validate",{ref:m.validate}):(0,r._)`${v.scopeValue("wrapper",{ref:m})}.validate`}lt.getValidate=a;function c(u,m,v,l){const{gen:h,it:w}=u,{allErrors:S,schemaEnv:p,opts:_}=w,f=_.passContext?n.default.this:r.nil;l?y():g();function y(){if(!p.$async)throw new Error("async schema referenced by sync schema");const E=h.let("valid");h.try(()=>{h.code((0,r._)`await ${(0,t.callValidateCode)(u,m,f)}`),$(m),S||h.assign(E,!0)},R=>{h.if((0,r._)`!(${R} instanceof ${w.ValidationError})`,()=>h.throw(R)),d(R),S||h.assign(E,!1)}),u.ok(E)}function g(){u.result((0,t.callValidateCode)(u,m,f),()=>$(m),()=>d(m))}function d(E){const R=(0,r._)`${E}.errors`;h.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${R} : ${n.default.vErrors}.concat(${R})`),h.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function $(E){var R;if(!w.opts.unevaluated)return;const Z=(R=v?.validate)===null||R===void 0?void 0:R.evaluated;if(w.props!==!0)if(Z&&!Z.dynamicProps)Z.props!==void 0&&(w.props=o.mergeEvaluated.props(h,Z.props,w.props));else{const L=h.var("props",(0,r._)`${E}.evaluated.props`);w.props=o.mergeEvaluated.props(h,L,w.props,r.Name)}if(w.items!==!0)if(Z&&!Z.dynamicItems)Z.items!==void 0&&(w.items=o.mergeEvaluated.items(h,Z.items,w.items));else{const L=h.var("items",(0,r._)`${E}.evaluated.items`);w.items=o.mergeEvaluated.items(h,L,w.items,r.Name)}}}return lt.callRef=c,lt.default=i,lt}var wi;function Si(){if(wi)return br;wi=1,Object.defineProperty(br,"__esModule",{value:!0});const e=km(),t=os(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return br.default=r,br}var Sr={},Er={},Ei;function Pm(){if(Ei)return Er;Ei=1,Object.defineProperty(Er,"__esModule",{value:!0});const e=ne(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:o,schemaCode:i})=>(0,e.str)`must be ${r[o].okStr} ${i}`,params:({keyword:o,schemaCode:i})=>(0,e._)`{comparison: ${r[o].okStr}, limit: ${i}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(o){const{keyword:i,data:a,schemaCode:c}=o;o.fail$data((0,e._)`${a} ${r[i].fail} ${c} || isNaN(${a})`)}};return Er.default=s,Er}var kr={},ki;function Om(){if(ki)return kr;ki=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ne(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:o,schemaCode:i,it:a}=n,c=a.opts.multipleOfPrecision,u=s.let("res"),m=c?(0,e._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,e._)`${u} !== parseInt(${u})`;n.fail$data((0,e._)`(${i} === 0 || (${u} = ${o}/${i}, ${m}))`)}};return kr.default=r,kr}var Pr={},Or={},Pi;function jm(){if(Pi)return Or;Pi=1,Object.defineProperty(Or,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,s=0,o;for(;s<r;)n++,o=t.charCodeAt(s++),o>=55296&&o<=56319&&s<r&&(o=t.charCodeAt(s),(o&64512)===56320&&s++);return n}return Or.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Or}var Oi;function Am(){if(Oi)return Pr;Oi=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=ne(),t=ce(),r=jm(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:i}){const a=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:i,data:a,schemaCode:c,it:u}=o,m=i==="maxLength"?e.operators.GT:e.operators.LT,v=u.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${a})`;o.fail$data((0,e._)`${v} ${m} ${c}`)}};return Pr.default=s,Pr}var jr={},ji;function Nm(){if(ji)return jr;ji=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=We(),t=ce(),r=ne(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,r.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,r._)`{pattern: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:v}=o,l=v.opts.unicodeRegExp?"u":"";if(c){const{regExp:h}=v.opts.code,w=h.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(i,h),S=i.let("valid");i.try(()=>i.assign(S,(0,r._)`${w}(${m}, ${l}).test(${a})`),()=>i.assign(S,!1)),o.fail$data((0,r._)`!${S}`)}else{const h=(0,e.usePattern)(o,u);o.fail$data((0,r._)`!${h}.test(${a})`)}}};return jr.default=s,jr}var Ar={},Ai;function zm(){if(Ai)return Ar;Ai=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=ne(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${o}).length ${a} ${i}`)}};return Ar.default=r,Ar}var Nr={},Ni;function Rm(){if(Ni)return Nr;Ni=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=We(),t=ne(),r=ce(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:i,schema:a,schemaCode:c,data:u,$data:m,it:v}=o,{opts:l}=v;if(!m&&a.length===0)return;const h=a.length>=l.loopRequired;if(v.allErrors?w():S(),l.strictRequired){const f=o.parentSchema.properties,{definedProperties:y}=o.it;for(const g of a)if(f?.[g]===void 0&&!y.has(g)){const d=v.schemaEnv.baseId+v.errSchemaPath,$=`required property "${g}" is not defined at "${d}" (strictRequired)`;(0,r.checkStrictMode)(v,$,v.opts.strictRequired)}}function w(){if(h||m)o.block$data(t.nil,p);else for(const f of a)(0,e.checkReportMissingProp)(o,f)}function S(){const f=i.let("missing");if(h||m){const y=i.let("valid",!0);o.block$data(y,()=>_(f,y)),o.ok(y)}else i.if((0,e.checkMissingProp)(o,a,f)),(0,e.reportMissingProp)(o,f),i.else()}function p(){i.forOf("prop",c,f=>{o.setParams({missingProperty:f}),i.if((0,e.noPropertyInData)(i,u,f,l.ownProperties),()=>o.error())})}function _(f,y){o.setParams({missingProperty:f}),i.forOf(f,c,()=>{i.assign(y,(0,e.propertyInData)(i,u,f,l.ownProperties)),i.if((0,t.not)(y),()=>{o.error(),i.break()})},t.nil)}}};return Nr.default=s,Nr}var zr={},zi;function Im(){if(zi)return zr;zi=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=ne(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${o}.length ${a} ${i}`)}};return zr.default=r,zr}var Rr={},Ir={},Ri;function is(){if(Ri)return Ir;Ri=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=ai();return e.code='require("ajv/dist/runtime/equal").default',Ir.default=e,Ir}var Ii;function Tm(){if(Ii)return Rr;Ii=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e=hr(),t=ne(),r=ce(),n=is(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>(0,t._)`{i: ${i}, j: ${a}}`},code(i){const{gen:a,data:c,$data:u,schema:m,parentSchema:v,schemaCode:l,it:h}=i;if(!u&&!m)return;const w=a.let("valid"),S=v.items?(0,e.getSchemaTypes)(v.items):[];i.block$data(w,p,(0,t._)`${l} === false`),i.ok(w);function p(){const g=a.let("i",(0,t._)`${c}.length`),d=a.let("j");i.setParams({i:g,j:d}),a.assign(w,!0),a.if((0,t._)`${g} > 1`,()=>(_()?f:y)(g,d))}function _(){return S.length>0&&!S.some(g=>g==="object"||g==="array")}function f(g,d){const $=a.name("item"),E=(0,e.checkDataTypes)(S,$,h.opts.strictNumbers,e.DataType.Wrong),R=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${g}--;`,()=>{a.let($,(0,t._)`${c}[${g}]`),a.if(E,(0,t._)`continue`),S.length>1&&a.if((0,t._)`typeof ${$} == "string"`,(0,t._)`${$} += "_"`),a.if((0,t._)`typeof ${R}[${$}] == "number"`,()=>{a.assign(d,(0,t._)`${R}[${$}]`),i.error(),a.assign(w,!1).break()}).code((0,t._)`${R}[${$}] = ${g}`)})}function y(g,d){const $=(0,r.useFunc)(a,n.default),E=a.name("outer");a.label(E).for((0,t._)`;${g}--;`,()=>a.for((0,t._)`${d} = ${g}; ${d}--;`,()=>a.if((0,t._)`${$}(${c}[${g}], ${c}[${d}])`,()=>{i.error(),a.assign(w,!1).break(E)})))}}};return Rr.default=o,Rr}var Tr={},Ti;function Cm(){if(Ti)return Tr;Ti=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=ne(),t=ce(),r=is(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:i,data:a,$data:c,schemaCode:u,schema:m}=o;c||m&&typeof m=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(i,r.default)}(${a}, ${u})`):o.fail((0,e._)`${m} !== ${a}`)}};return Tr.default=s,Tr}var Cr={},Ci;function Mm(){if(Ci)return Cr;Ci=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=ne(),t=ce(),r=is(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:v}=o;if(!c&&u.length===0)throw new Error("enum must have non-empty array");const l=u.length>=v.opts.loopEnum;let h;const w=()=>h??(h=(0,t.useFunc)(i,r.default));let S;if(l||c)S=i.let("valid"),o.block$data(S,p);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const f=i.const("vSchema",m);S=(0,e.or)(...u.map((y,g)=>_(f,g)))}o.pass(S);function p(){i.assign(S,!1),i.forOf("v",m,f=>i.if((0,e._)`${w()}(${a}, ${f})`,()=>i.assign(S,!0).break()))}function _(f,y){const g=u[y];return typeof g=="object"&&g!==null?(0,e._)`${w()}(${a}, ${f}[${y}])`:(0,e._)`${a} === ${g}`}}};return Cr.default=s,Cr}var Mi;function Di(){if(Mi)return Sr;Mi=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=Pm(),t=Om(),r=Am(),n=Nm(),s=zm(),o=Rm(),i=Im(),a=Tm(),c=Cm(),u=Mm(),m=[e.default,t.default,r.default,n.default,s.default,o.default,i.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default];return Sr.default=m,Sr}var Mr={},Nt={},Vi;function Fi(){if(Vi)return Nt;Vi=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.validateAdditionalItems=void 0;const e=ne(),t=ce(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:i,it:a}=o,{items:c}=i;if(!Array.isArray(c)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(o,c)}};function s(o,i){const{gen:a,schema:c,data:u,keyword:m,it:v}=o;v.items=!0;const l=a.const("len",(0,e._)`${u}.length`);if(c===!1)o.setParams({len:i.length}),o.pass((0,e._)`${l} <= ${i.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(v,c)){const w=a.var("valid",(0,e._)`${l} <= ${i.length}`);a.if((0,e.not)(w),()=>h(w)),o.ok(w)}function h(w){a.forRange("i",i.length,l,S=>{o.subschema({keyword:m,dataProp:S,dataPropType:t.Type.Num},w),v.allErrors||a.if((0,e.not)(w),()=>a.break())})}}return Nt.validateAdditionalItems=s,Nt.default=n,Nt}var Dr={},zt={},qi;function Zi(){if(qi)return zt;qi=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.validateTuple=void 0;const e=ne(),t=ce(),r=We(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:i,it:a}=o;if(Array.isArray(i))return s(o,"additionalItems",i);a.items=!0,!(0,t.alwaysValidSchema)(a,i)&&o.ok((0,r.validateArray)(o))}};function s(o,i,a=o.schema){const{gen:c,parentSchema:u,data:m,keyword:v,it:l}=o;S(u),l.opts.unevaluated&&a.length&&l.items!==!0&&(l.items=t.mergeEvaluated.items(c,a.length,l.items));const h=c.name("valid"),w=c.const("len",(0,e._)`${m}.length`);a.forEach((p,_)=>{(0,t.alwaysValidSchema)(l,p)||(c.if((0,e._)`${w} > ${_}`,()=>o.subschema({keyword:v,schemaProp:_,dataProp:_},h)),o.ok(h))});function S(p){const{opts:_,errSchemaPath:f}=l,y=a.length,g=y===p.minItems&&(y===p.maxItems||p[i]===!1);if(_.strictTuples&&!g){const d=`"${v}" is ${y}-tuple, but minItems or maxItems/${i} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(l,d,_.strictTuples)}}}return zt.validateTuple=s,zt.default=n,zt}var Ui;function Dm(){if(Ui)return Dr;Ui=1,Object.defineProperty(Dr,"__esModule",{value:!0});const e=Zi(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Dr.default=t,Dr}var Vr={},xi;function Vm(){if(xi)return Vr;xi=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=ne(),t=ce(),r=We(),n=Fi(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{schema:a,parentSchema:c,it:u}=i,{prefixItems:m}=c;u.items=!0,!(0,t.alwaysValidSchema)(u,a)&&(m?(0,n.validateAdditionalItems)(i,m):i.ok((0,r.validateArray)(i)))}};return Vr.default=o,Vr}var Fr={},Li;function Fm(){if(Li)return Fr;Li=1,Object.defineProperty(Fr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:o}})=>o===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${o} valid item(s)`,params:({params:{min:s,max:o}})=>o===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${o}}`},code(s){const{gen:o,schema:i,parentSchema:a,data:c,it:u}=s;let m,v;const{minContains:l,maxContains:h}=a;u.opts.next?(m=l===void 0?1:l,v=h):m=1;const w=o.const("len",(0,e._)`${c}.length`);if(s.setParams({min:m,max:v}),v===void 0&&m===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(v!==void 0&&m>v){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(u,i)){let y=(0,e._)`${w} >= ${m}`;v!==void 0&&(y=(0,e._)`${y} && ${w} <= ${v}`),s.pass(y);return}u.items=!0;const S=o.name("valid");v===void 0&&m===1?_(S,()=>o.if(S,()=>o.break())):m===0?(o.let(S,!0),v!==void 0&&o.if((0,e._)`${c}.length > 0`,p)):(o.let(S,!1),p()),s.result(S,()=>s.reset());function p(){const y=o.name("_valid"),g=o.let("count",0);_(y,()=>o.if(y,()=>f(g)))}function _(y,g){o.forRange("i",0,w,d=>{s.subschema({keyword:"contains",dataProp:d,dataPropType:t.Type.Num,compositeRule:!0},y),g()})}function f(y){o.code((0,e._)`${y}++`),v===void 0?o.if((0,e._)`${y} >= ${m}`,()=>o.assign(S,!0).break()):(o.if((0,e._)`${y} > ${v}`,()=>o.assign(S,!1).break()),m===1?o.assign(S,!0):o.if((0,e._)`${y} >= ${m}`,()=>o.assign(S,!0)))}}};return Fr.default=n,Fr}var as={},Ki;function cs(){return Ki||(Ki=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ne(),r=ce(),n=We();e.error={message:({params:{property:c,depsCount:u,deps:m}})=>{const v=u===1?"property":"properties";return(0,t.str)`must have ${v} ${m} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:m,missingProperty:v}})=>(0,t._)`{property: ${c},
|
|
44
|
-
missingProperty: ${
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function ro(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},m=a.ref;if(a.ref=null,m){n(m);const f=e.seen.get(m),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),i._zod.parent===m)for(const S in c)S==="$ref"||S==="allOf"||S in u||delete c[S];if(h.$ref&&f.def)for(const S in c)S==="$ref"||S==="allOf"||S in f.def&&JSON.stringify(c[S])===JSON.stringify(f.def[S])&&delete c[S]}const y=i._zod.parent;if(y&&y!==m){n(y);const f=e.seen.get(y);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())n(i[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(i)}Object.assign(s,r.def??r.schema);const o=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const i=JSON.parse(JSON.stringify(s));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:tr(t,"input",e.processors),output:tr(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function Ie(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ie(n.element,r);if(n.type==="set")return Ie(n.valueType,r);if(n.type==="lazy")return Ie(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ie(n.innerType,r);if(n.type==="intersection")return Ie(n.left,r)||Ie(n.right,r);if(n.type==="record"||n.type==="map")return Ie(n.keyType,r)||Ie(n.valueType,r);if(n.type==="pipe")return Ie(n.in,r)||Ie(n.out,r);if(n.type==="object"){for(const s in n.shape)if(Ie(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(Ie(s,r))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(Ie(s,r))return!0;return!!(n.rest&&Ie(n.rest,r))}return!1}const sl=(e,t={})=>r=>{const n=eo({...r,processors:t});return Ee(e,n),to(n,e),ro(n,e)},tr=(e,t,r={})=>n=>{const{libraryOptions:s,target:o}=n??{},i=eo({...s??{},target:o,io:t,processors:r});return Ee(e,i),to(i,e),ro(i,e)},ol={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},il=(e,t,r,n)=>{const s=r;s.type="string";const{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=ol[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),u&&(s.contentEncoding=u),c&&c.size>0){const m=[...c];m.length===1?s.pattern=m[0].source:m.length>1&&(s.allOf=[...m.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},al=(e,t,r,n)=>{const s=r,{minimum:o,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:m}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=m,s.exclusiveMinimum=!0):s.exclusiveMinimum=m),typeof o=="number"&&(s.minimum=o,typeof m=="number"&&t.target!=="draft-04"&&(m>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof i=="number"&&(s.maximum=i,typeof u=="number"&&t.target!=="draft-04"&&(u<=i?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},cl=(e,t,r,n)=>{r.type="boolean"},ul=(e,t,r,n)=>{r.not={}},dl=(e,t,r,n)=>{},ll=(e,t,r,n)=>{},fl=(e,t,r,n)=>{const s=e._zod.def,o=$s(s.entries);o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},ml=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pl=(e,t,r,n)=>{const s=r,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Ee(o.element,t,{...n,path:[...n.path,"items"]})},yl=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const u in i)s.properties[u]=Ee(i[u],t,{...n,path:[...n.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const m=o.shape[u]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(s.required=Array.from(c)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=Ee(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},vl=(e,t,r,n)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>Ee(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},gl=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=Ee(s.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];r.allOf=c},_l=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object";const i=o.keyType,c=i._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){const m=Ee(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(const y of c)s.patternProperties[y.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Ee(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=Ee(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const u=i._zod.values;if(u){const m=[...u].filter(y=>typeof y=="string"||typeof y=="number");m.length>0&&(s.required=m)}},$l=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},bl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},wl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},Sl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},El=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},kl=(e,t,r,n)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Ee(o,t,n);const i=t.seen.get(e);i.ref=o},Pl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.readOnly=!0},no=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},Ol=(e,t,r,n)=>{const s=e._zod.innerType;Ee(s,t,n);const o=t.seen.get(e);o.ref=s},jl=M("ZodISODateTime",(e,t)=>{Pu.init(e,t),we.init(e,t)});function Al(e){return Id(jl,e)}const Nl=M("ZodISODate",(e,t)=>{Ou.init(e,t),we.init(e,t)});function zl(e){return Td(Nl,e)}const Rl=M("ZodISOTime",(e,t)=>{ju.init(e,t),we.init(e,t)});function Il(e){return Cd(Rl,e)}const Tl=M("ZodISODuration",(e,t)=>{Au.init(e,t),we.init(e,t)});function Cl(e){return Md(Tl,e)}const Ke=M("ZodError",(e,t)=>{Sn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>vc(e,r)},flatten:{value:r=>yc(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,gn,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,gn,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ml=Ht(Ke),Dl=Gt(Ke),Vl=Bt(Ke),ql=Wt(Ke),Fl=wc(Ke),Zl=Sc(Ke),Ul=Ec(Ke),xl=kc(Ke),Ll=Pc(Ke),Kl=Oc(Ke),Jl=jc(Ke),Hl=Ac(Ke),be=M("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tr(e,"input"),output:tr(e,"output")}}),e.toJSONSchema=sl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ot(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>it(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Ml(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Vl(e,r,n),e.parseAsync=async(r,n)=>Dl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ql(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Fl(e,r,n),e.decode=(r,n)=>Zl(e,r,n),e.encodeAsync=async(r,n)=>Ul(e,r,n),e.decodeAsync=async(r,n)=>xl(e,r,n),e.safeEncode=(r,n)=>Ll(e,r,n),e.safeDecode=(r,n)=>Kl(e,r,n),e.safeEncodeAsync=async(r,n)=>Jl(e,r,n),e.safeDecodeAsync=async(r,n)=>Hl(e,r,n),e.refine=(r,n)=>e.check(Uf(r,n)),e.superRefine=r=>e.check(xf(r)),e.overwrite=r=>e.check(St(r)),e.optional=()=>ho(e),e.exactOptional=()=>jf(e),e.nullable=()=>po(e),e.nullish=()=>ho(po(e)),e.nonoptional=r=>Tf(e,r),e.array=()=>Xe(e),e.or=r=>jn([e,r]),e.and=r=>Sf(e,r),e.transform=r=>vo(e,Pf(r)),e.default=r=>zf(e,r),e.prefault=r=>If(e,r),e.catch=r=>Mf(e,r),e.pipe=r=>vo(e,r),e.readonly=()=>qf(e),e.describe=r=>{const n=e.clone();return Ct.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ct.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ct.get(e);const n=e.clone();return Ct.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),so=M("_ZodString",(e,t)=>{En.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>il(e,n,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(xd(...n)),e.includes=(...n)=>e.check(Jd(...n)),e.startsWith=(...n)=>e.check(Hd(...n)),e.endsWith=(...n)=>e.check(Gd(...n)),e.min=(...n)=>e.check(er(...n)),e.max=(...n)=>e.check(Xs(...n)),e.length=(...n)=>e.check(Qs(...n)),e.nonempty=(...n)=>e.check(er(1,...n)),e.lowercase=n=>e.check(Ld(n)),e.uppercase=n=>e.check(Kd(n)),e.trim=()=>e.check(Wd()),e.normalize=(...n)=>e.check(Bd(...n)),e.toLowerCase=()=>e.check(Yd()),e.toUpperCase=()=>e.check(Xd()),e.slugify=()=>e.check(Qd())}),Gl=M("ZodString",(e,t)=>{En.init(e,t),so.init(e,t),e.email=r=>e.check(fd(Bl,r)),e.url=r=>e.check(vd(Wl,r)),e.jwt=r=>e.check(Rd(ff,r)),e.emoji=r=>e.check(gd(Yl,r)),e.guid=r=>e.check(Gs(oo,r)),e.uuid=r=>e.check(md(rr,r)),e.uuidv4=r=>e.check(hd(rr,r)),e.uuidv6=r=>e.check(pd(rr,r)),e.uuidv7=r=>e.check(yd(rr,r)),e.nanoid=r=>e.check(_d(Xl,r)),e.guid=r=>e.check(Gs(oo,r)),e.cuid=r=>e.check($d(Ql,r)),e.cuid2=r=>e.check(bd(ef,r)),e.ulid=r=>e.check(wd(tf,r)),e.base64=r=>e.check(Ad(uf,r)),e.base64url=r=>e.check(Nd(df,r)),e.xid=r=>e.check(Sd(rf,r)),e.ksuid=r=>e.check(Ed(nf,r)),e.ipv4=r=>e.check(kd(sf,r)),e.ipv6=r=>e.check(Pd(of,r)),e.cidrv4=r=>e.check(Od(af,r)),e.cidrv6=r=>e.check(jd(cf,r)),e.e164=r=>e.check(zd(lf,r)),e.datetime=r=>e.check(Al(r)),e.date=r=>e.check(zl(r)),e.time=r=>e.check(Il(r)),e.duration=r=>e.check(Cl(r))});function Te(e){return ld(Gl,e)}const we=M("ZodStringFormat",(e,t)=>{$e.init(e,t),so.init(e,t)}),Bl=M("ZodEmail",(e,t)=>{vu.init(e,t),we.init(e,t)}),oo=M("ZodGUID",(e,t)=>{pu.init(e,t),we.init(e,t)}),rr=M("ZodUUID",(e,t)=>{yu.init(e,t),we.init(e,t)}),Wl=M("ZodURL",(e,t)=>{gu.init(e,t),we.init(e,t)}),Yl=M("ZodEmoji",(e,t)=>{_u.init(e,t),we.init(e,t)}),Xl=M("ZodNanoID",(e,t)=>{$u.init(e,t),we.init(e,t)}),Ql=M("ZodCUID",(e,t)=>{bu.init(e,t),we.init(e,t)}),ef=M("ZodCUID2",(e,t)=>{wu.init(e,t),we.init(e,t)}),tf=M("ZodULID",(e,t)=>{Su.init(e,t),we.init(e,t)}),rf=M("ZodXID",(e,t)=>{Eu.init(e,t),we.init(e,t)}),nf=M("ZodKSUID",(e,t)=>{ku.init(e,t),we.init(e,t)}),sf=M("ZodIPv4",(e,t)=>{Nu.init(e,t),we.init(e,t)}),of=M("ZodIPv6",(e,t)=>{zu.init(e,t),we.init(e,t)}),af=M("ZodCIDRv4",(e,t)=>{Ru.init(e,t),we.init(e,t)}),cf=M("ZodCIDRv6",(e,t)=>{Iu.init(e,t),we.init(e,t)}),uf=M("ZodBase64",(e,t)=>{Tu.init(e,t),we.init(e,t)}),df=M("ZodBase64URL",(e,t)=>{Mu.init(e,t),we.init(e,t)}),lf=M("ZodE164",(e,t)=>{Du.init(e,t),we.init(e,t)}),ff=M("ZodJWT",(e,t)=>{qu.init(e,t),we.init(e,t)}),io=M("ZodNumber",(e,t)=>{Cs.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>al(e,n,s),e.gt=(n,s)=>e.check(Ws(n,s)),e.gte=(n,s)=>e.check(On(n,s)),e.min=(n,s)=>e.check(On(n,s)),e.lt=(n,s)=>e.check(Bs(n,s)),e.lte=(n,s)=>e.check(Pn(n,s)),e.max=(n,s)=>e.check(Pn(n,s)),e.int=n=>e.check(ao(n)),e.safe=n=>e.check(ao(n)),e.positive=n=>e.check(Ws(0,n)),e.nonnegative=n=>e.check(On(0,n)),e.negative=n=>e.check(Bs(0,n)),e.nonpositive=n=>e.check(Pn(0,n)),e.multipleOf=(n,s)=>e.check(Ys(n,s)),e.step=(n,s)=>e.check(Ys(n,s)),e.finite=()=>e;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 Fe(e){return Dd(io,e)}const mf=M("ZodNumberFormat",(e,t)=>{Fu.init(e,t),io.init(e,t)});function ao(e){return Vd(mf,e)}const hf=M("ZodBoolean",(e,t)=>{Zu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>cl(e,r,n)});function nr(e){return qd(hf,e)}const pf=M("ZodAny",(e,t)=>{Uu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>dl()});function co(){return Fd(pf)}const yf=M("ZodUnknown",(e,t)=>{xu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ll()});function uo(){return Zd(yf)}const vf=M("ZodNever",(e,t)=>{Lu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ul(e,r,n)});function gf(e){return Ud(vf,e)}const _f=M("ZodArray",(e,t)=>{Ku.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pl(e,r,n,s),e.element=t.element,e.min=(r,n)=>e.check(er(r,n)),e.nonempty=r=>e.check(er(1,r)),e.max=(r,n)=>e.check(Xs(r,n)),e.length=(r,n)=>e.check(Qs(r,n)),e.unwrap=()=>e.element});function Xe(e,t){return el(_f,e,t)}const $f=M("ZodObject",(e,t)=>{Hu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>yl(e,r,n,s),de(e,"shape",()=>t.shape),e.keyof=()=>fo(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:uo()}),e.loose=()=>e.clone({...e._zod.def,catchall:uo()}),e.strict=()=>e.clone({...e._zod.def,catchall:gf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>lc(e,r),e.safeExtend=r=>fc(e,r),e.merge=r=>mc(e,r),e.pick=r=>uc(e,r),e.omit=r=>dc(e,r),e.partial=(...r)=>hc(mo,e,r[0]),e.required=(...r)=>pc(yo,e,r[0])});function sr(e,t){const r={type:"object",shape:e??{},...te(t)};return new $f(r)}const bf=M("ZodUnion",(e,t)=>{Gu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vl(e,r,n,s),e.options=t.options});function jn(e,t){return new bf({type:"union",options:e,...te(t)})}const wf=M("ZodIntersection",(e,t)=>{Bu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>gl(e,r,n,s)});function Sf(e,t){return new wf({type:"intersection",left:e,right:t})}const Ef=M("ZodRecord",(e,t)=>{Wu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_l(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function lo(e,t,r){return new Ef({type:"record",keyType:e,valueType:t,...te(r)})}const An=M("ZodEnum",(e,t)=>{Yu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>fl(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const o={};for(const i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new An({...t,checks:[],...te(s),entries:o})},e.exclude=(n,s)=>{const o={...t.entries};for(const i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new An({...t,checks:[],...te(s),entries:o})}});function fo(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new An({type:"enum",entries:r,...te(t)})}const kf=M("ZodTransform",(e,t)=>{Xu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>hl(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new gs(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(Tt(o,r.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Tt(i))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(o=>(r.value=o,r)):(r.value=s,r)}});function Pf(e){return new kf({type:"transform",transform:e})}const mo=M("ZodOptional",(e,t)=>{Us.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>no(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new mo({type:"optional",innerType:e})}const Of=M("ZodExactOptional",(e,t)=>{Qu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>no(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function jf(e){return new Of({type:"optional",innerType:e})}const Af=M("ZodNullable",(e,t)=>{ed.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>$l(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function po(e){return new Af({type:"nullable",innerType:e})}const Nf=M("ZodDefault",(e,t)=>{td.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>wl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zf(e,t){return new Nf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Es(t)}})}const Rf=M("ZodPrefault",(e,t)=>{rd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Sl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function If(e,t){return new Rf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Es(t)}})}const yo=M("ZodNonOptional",(e,t)=>{nd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Tf(e,t){return new yo({type:"nonoptional",innerType:e,...te(t)})}const Cf=M("ZodCatch",(e,t)=>{sd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>El(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mf(e,t){return new Cf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Df=M("ZodPipe",(e,t)=>{od.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>kl(e,r,n,s),e.in=t.in,e.out=t.out});function vo(e,t){return new Df({type:"pipe",in:e,out:t})}const Vf=M("ZodReadonly",(e,t)=>{id.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Pl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function qf(e){return new Vf({type:"readonly",innerType:e})}const Ff=M("ZodLazy",(e,t)=>{ad.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ol(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});function ct(e){return new Ff({type:"lazy",getter:e})}const Zf=M("ZodCustom",(e,t)=>{cd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ml(e,r)});function Uf(e,t={}){return tl(Zf,e,t)}function xf(e){return rl(e)}const Ze=sr({type:fo(["string","number","integer","boolean","object","array","ref"]).optional(),title:Te().optional(),description:Te().optional(),default:co().optional(),minimum:Fe().optional(),maximum:Fe().optional(),exclusiveMin:Fe().optional(),exclusiveMax:Fe().optional(),multipleOf:Fe().optional(),minLength:Fe().optional(),maxLength:Fe().optional(),minContains:Fe().optional(),maxContains:Fe().optional(),minProperties:Fe().optional(),maxProperties:Fe().optional(),isModifiable:nr().optional(),"x-modifiable":Xe(Te()).optional(),pattern:Te().optional(),format:Te().optional(),minItems:Fe().optional(),maxItems:Fe().optional(),uniqueItems:nr().optional(),enum:Xe(co()).optional(),$id:Te().optional(),$schema:Te().optional(),$ref:Te().optional()}).extend({properties:ct(()=>lo(Te(),Ze)).optional(),items:ct(()=>jn([Ze,Xe(Ze)])).optional(),required:Xe(Te()).optional(),additionalProperties:ct(()=>jn([nr(),Ze])).optional(),allOf:ct(()=>Xe(Ze)).optional(),anyOf:ct(()=>Xe(Ze)).optional(),oneOf:ct(()=>Xe(Ze)).optional(),not:ct(()=>Ze).optional(),$defs:ct(()=>lo(Te(),Ze)).optional()}),go=sr({root:Ze,properties:Xe(sr({id:Te(),key:Te().min(1),isRequired:nr(),schema:Ze})),definitions:Xe(sr({id:Te(),key:Te().min(1),schema:Ze}))});var Mt=e=>e.type==="checkbox",ht=e=>e instanceof Date,Ve=e=>e==null;const _o=e=>typeof e=="object";var Pe=e=>!Ve(e)&&!Array.isArray(e)&&_o(e)&&!ht(e),Lf=e=>Pe(e)&&e.target?Mt(e.target)?e.target.checked:e.target.value:e,Kf=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Jf=(e,t)=>e.has(Kf(t)),Hf=e=>{const t=e.constructor&&e.constructor.prototype;return Pe(t)&&t.hasOwnProperty("isPrototypeOf")},Nn=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Nn&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Pe(e)&&Hf(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=ge(e[s]));return n}var or=e=>/^\w*$/.test(e),ve=e=>e===void 0,ir=e=>Array.isArray(e)?e.filter(Boolean):[],zn=e=>ir(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Y=(e,t,r)=>{if(!t||!Pe(e))return r;const n=(or(t)?[t]:zn(t)).reduce((s,o)=>Ve(s)?s:s[o],e);return ve(n)||n===e?ve(e[t])?r:e[t]:n},Qe=e=>typeof e=="boolean",He=e=>typeof e=="function",he=(e,t,r)=>{let n=-1;const s=or(t)?[t]:zn(t),o=s.length,i=o-1;for(;++n<o;){const a=s[n];let c=r;if(n!==i){const u=e[a];c=Pe(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const $o={BLUR:"blur",FOCUS_OUT:"focusout"},Je={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},et={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},bo=ee.createContext(null);bo.displayName="HookFormControlContext";const Gf=()=>ee.useContext(bo);var Bf=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==Je.all&&(t._proxyFormState[i]=!n||Je.all),e[i]}});return s};const wo=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;var Ue=e=>typeof e=="string",Wf=(e,t,r,n,s)=>Ue(e)?(n&&t.watch.add(e),Y(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),Y(r,o))):(n&&(t.watchAll=!0),r),Rn=e=>Ve(e)||!_o(e);function ut(e,t,r=new WeakSet){if(Rn(e)||Rn(t))return Object.is(e,t);if(ht(e)&&ht(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const i=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(ht(i)&&ht(a)||Pe(i)&&Pe(a)||Array.isArray(i)&&Array.isArray(a)?!ut(i,a,r):!Object.is(i,a))return!1}}return!0}const Yf=ee.createContext(null);Yf.displayName="HookFormContext";var In=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},qe=e=>Array.isArray(e)?e:[e],So=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function Eo(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&Pe(s)&&o){const i=Eo(s,o);Pe(i)&&(r[n]=i)}else e[n]&&(r[n]=o)}return r}var Re=e=>Pe(e)&&!Object.keys(e).length,Tn=e=>e.type==="file",ar=e=>{if(!Nn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ko=e=>e.type==="select-multiple",Cn=e=>e.type==="radio",Xf=e=>Cn(e)||Mt(e),Mn=e=>ar(e)&&e.isConnected;function Qf(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=ve(e)?n++:e[t[n++]];return e}function em(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function ke(e,t){const r=Array.isArray(t)?t:or(t)?[t]:zn(t),n=r.length===1?e:Qf(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Pe(n)&&Re(n)||Array.isArray(n)&&em(n))&&ke(e,r.slice(0,-1)),e}var tm=e=>{for(const t in e)if(He(e[t]))return!0;return!1};function Po(e){return Array.isArray(e)||Pe(e)&&!tm(e)}function Dn(e,t={}){for(const r in e){const n=e[r];Po(n)?(t[r]=Array.isArray(n)?[]:{},Dn(n,t[r])):ve(n)||(t[r]=!0)}return t}function Et(e,t,r){r||(r=Dn(t));for(const n in e){const s=e[n];if(Po(s))ve(t)||Rn(r[n])?r[n]=Dn(s,Array.isArray(s)?[]:{}):Et(s,Ve(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!ut(s,o)}}return r}const Oo={value:!1,isValid:!1},jo={value:!0,isValid:!0};var Ao=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ve(e[0].attributes.value)?ve(e[0].value)||e[0].value===""?jo:{value:e[0].value,isValid:!0}:jo:Oo}return Oo},No=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ve(e)?e:t?e===""?NaN:e&&+e:r&&Ue(e)?new Date(e):n?n(e):e;const zo={isValid:!1,value:null};var Ro=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,zo):zo;function Io(e){const t=e.ref;return Tn(t)?t.files:Cn(t)?Ro(e.refs).value:ko(t)?[...t.selectedOptions].map(({value:r})=>r):Mt(t)?Ao(e.refs).value:No(ve(t.value)?e.ref.value:t.value,e)}var rm=(e,t,r,n)=>{const s={};for(const o of e){const i=Y(t,o);i&&he(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},cr=e=>e instanceof RegExp,Dt=e=>ve(e)?e:cr(e)?e.source:Pe(e)?cr(e.value)?e.value.source:e.value:e,kt=e=>({isOnSubmit:!e||e===Je.onSubmit,isOnBlur:e===Je.onBlur,isOnChange:e===Je.onChange,isOnAll:e===Je.all,isOnTouch:e===Je.onTouched});const To="AsyncFunction";var nm=e=>!!e&&!!e.validate&&!!(He(e.validate)&&e.validate.constructor.name===To||Pe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===To)),sm=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Vn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Pt=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=Y(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Pt(a,t))break}else if(Pe(a)&&Pt(a,t))break}}};function Co(e,t,r){const n=Y(e,r);if(n||or(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=Y(t,o),a=Y(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:r}}var om=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Re(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||Je.all))},im=(e,t,r)=>!e||!t||e===t||qe(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),am=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,cm=(e,t)=>!ir(Y(e,t)).length&&ke(e,t),Mo=(e,t,r)=>{const n=qe(Y(e,r));return he(n,"root",t[r]),he(e,r,n),e};function Do(e,t,r="validate"){if(Ue(e)||Array.isArray(e)&&e.every(Ue)||Qe(e)&&!e)return{type:r,message:Ue(e)?e:"",ref:t}}var Ot=e=>Pe(e)&&!cr(e)?e:{value:e,message:""},qn=async(e,t,r,n,s,o)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:m,min:y,max:f,pattern:h,validate:w,name:S,valueAsNumber:p,mount:_}=e._f,l=Y(r,S);if(!_||t.has(S))return{};const v=a?a[0]:i,g=D=>{s&&v.reportValidity&&(v.setCustomValidity(Qe(D)?"":D||""),v.reportValidity())},d={},$=Cn(i),E=Mt(i),R=$||E,F=(p||Tn(i))&&ve(i.value)&&ve(l)||ar(i)&&i.value===""||l===""||Array.isArray(l)&&!l.length,L=In.bind(null,S,n,d),V=(D,Z,K,re=et.maxLength,ye=et.minLength)=>{const me=D?Z:K;d[S]={type:D?re:ye,message:me,ref:i,...L(D?re:ye,me)}};if(o?!Array.isArray(l)||!l.length:c&&(!R&&(F||Ve(l))||Qe(l)&&!l||E&&!Ao(a).isValid||$&&!Ro(a).isValid)){const{value:D,message:Z}=Ue(c)?{value:!!c,message:c}:Ot(c);if(D&&(d[S]={type:et.required,message:Z,ref:v,...L(et.required,Z)},!n))return g(Z),d}if(!F&&(!Ve(y)||!Ve(f))){let D,Z;const K=Ot(f),re=Ot(y);if(!Ve(l)&&!isNaN(l)){const ye=i.valueAsNumber||l&&+l;Ve(K.value)||(D=ye>K.value),Ve(re.value)||(Z=ye<re.value)}else{const ye=i.valueAsDate||new Date(l),me=U=>new Date(new Date().toDateString()+" "+U),ue=i.type=="time",Oe=i.type=="week";Ue(K.value)&&l&&(D=ue?me(l)>me(K.value):Oe?l>K.value:ye>new Date(K.value)),Ue(re.value)&&l&&(Z=ue?me(l)<me(re.value):Oe?l<re.value:ye<new Date(re.value))}if((D||Z)&&(V(!!D,K.message,re.message,et.max,et.min),!n))return g(d[S].message),d}if((u||m)&&!F&&(Ue(l)||o&&Array.isArray(l))){const D=Ot(u),Z=Ot(m),K=!Ve(D.value)&&l.length>+D.value,re=!Ve(Z.value)&&l.length<+Z.value;if((K||re)&&(V(K,D.message,Z.message),!n))return g(d[S].message),d}if(h&&!F&&Ue(l)){const{value:D,message:Z}=Ot(h);if(cr(D)&&!l.match(D)&&(d[S]={type:et.pattern,message:Z,ref:i,...L(et.pattern,Z)},!n))return g(Z),d}if(w){if(He(w)){const D=await w(l,r),Z=Do(D,v);if(Z&&(d[S]={...Z,...L(et.validate,Z.message)},!n))return g(Z.message),d}else if(Pe(w)){let D={};for(const Z in w){if(!Re(D)&&!n)break;const K=Do(await w[Z](l,r),v,Z);K&&(D={...K,...L(Z,K.message)},g(K.message),n&&(d[S]=D))}if(!Re(D)&&(d[S]={ref:v,...D},!n))return d}}return g(!0),d};const um={mode:Je.onSubmit,reValidateMode:Je.onChange,shouldFocusError:!0};function dm(e={}){let t={...um,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:He(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Pe(t.defaultValues)||Pe(t.values)?ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:ge(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},y={...m};let f={...y};const h={array:So(),state:So()},w=t.criteriaMode===Je.all,S=k=>N=>{clearTimeout(u),u=setTimeout(k,N)},p=async k=>{if(!i.keepIsValid&&!t.disabled&&(y.isValid||f.isValid||k)){let N;t.resolver?(N=Re((await R()).errors),_()):N=await L(n,!0),N!==r.isValid&&h.state.next({isValid:N})}},_=(k,N)=>{!t.disabled&&(y.isValidating||y.validatingFields||f.isValidating||f.validatingFields)&&((k||Array.from(a.mount)).forEach(T=>{T&&(N?he(r.validatingFields,T,N):ke(r.validatingFields,T))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Re(r.validatingFields)}))},l=(k,N=[],T,W,J=!0,x=!0)=>{if(W&&T&&!t.disabled){if(i.action=!0,x&&Array.isArray(Y(n,k))){const Q=T(Y(n,k),W.argA,W.argB);J&&he(n,k,Q)}if(x&&Array.isArray(Y(r.errors,k))){const Q=T(Y(r.errors,k),W.argA,W.argB);J&&he(r.errors,k,Q),cm(r.errors,k)}if((y.touchedFields||f.touchedFields)&&x&&Array.isArray(Y(r.touchedFields,k))){const Q=T(Y(r.touchedFields,k),W.argA,W.argB);J&&he(r.touchedFields,k,Q)}(y.dirtyFields||f.dirtyFields)&&(r.dirtyFields=Et(s,o)),h.state.next({name:k,isDirty:D(k,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else he(o,k,N)},v=(k,N)=>{he(r.errors,k,N),h.state.next({errors:r.errors})},g=k=>{r.errors=k,h.state.next({errors:r.errors,isValid:!1})},d=(k,N,T,W)=>{const J=Y(n,k);if(J){const x=Y(o,k,ve(T)?Y(s,k):T);ve(x)||W&&W.defaultChecked||N?he(o,k,N?x:Io(J._f)):re(k,x),i.mount&&!i.action&&p()}},$=(k,N,T,W,J)=>{let x=!1,Q=!1;const le={name:k};if(!t.disabled){if(!T||W){(y.isDirty||f.isDirty)&&(Q=r.isDirty,r.isDirty=le.isDirty=D(),x=Q!==le.isDirty);const fe=ut(Y(s,k),N);Q=!!Y(r.dirtyFields,k),fe?ke(r.dirtyFields,k):he(r.dirtyFields,k,!0),le.dirtyFields=r.dirtyFields,x=x||(y.dirtyFields||f.dirtyFields)&&Q!==!fe}if(T){const fe=Y(r.touchedFields,k);fe||(he(r.touchedFields,k,T),le.touchedFields=r.touchedFields,x=x||(y.touchedFields||f.touchedFields)&&fe!==T)}x&&J&&h.state.next(le)}return x?le:{}},E=(k,N,T,W)=>{const J=Y(r.errors,k),x=(y.isValid||f.isValid)&&Qe(N)&&r.isValid!==N;if(t.delayError&&T?(c=S(()=>v(k,T)),c(t.delayError)):(clearTimeout(u),c=null,T?he(r.errors,k,T):ke(r.errors,k)),(T?!ut(J,T):J)||!Re(W)||x){const Q={...W,...x&&Qe(N)?{isValid:N}:{},errors:r.errors,name:k};r={...r,...Q},h.state.next(Q)}},R=async k=>(_(k,!0),await t.resolver(o,t.context,rm(k||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),F=async k=>{const{errors:N}=await R(k);if(_(k),k)for(const T of k){const W=Y(N,T);W?he(r.errors,T,W):ke(r.errors,T)}else r.errors=N;return N},L=async(k,N,T={valid:!0})=>{for(const W in k){const J=k[W];if(J){const{_f:x,...Q}=J;if(x){const le=a.array.has(x.name),fe=J._f&&nm(J._f);fe&&y.validatingFields&&_([x.name],!0);const ze=await qn(J,a.disabled,o,w,t.shouldUseNativeValidation&&!N,le);if(fe&&y.validatingFields&&_([x.name]),ze[x.name]&&(T.valid=!1,N||e.shouldUseNativeValidation))break;!N&&(Y(ze,x.name)?le?Mo(r.errors,ze,x.name):he(r.errors,x.name,ze[x.name]):ke(r.errors,x.name))}!Re(Q)&&await L(Q,N,T)}}return T.valid},V=()=>{for(const k of a.unMount){const N=Y(n,k);N&&(N._f.refs?N._f.refs.every(T=>!Mn(T)):!Mn(N._f.ref))&&G(k)}a.unMount=new Set},D=(k,N)=>!t.disabled&&(k&&N&&he(o,k,N),!ut(O(),s)),Z=(k,N,T)=>Wf(k,a,{...i.mount?o:ve(N)?s:Ue(k)?{[k]:N}:N},T,N),K=k=>ir(Y(i.mount?o:s,k,t.shouldUnregister?Y(s,k,[]):[])),re=(k,N,T={})=>{const W=Y(n,k);let J=N;if(W){const x=W._f;x&&(!x.disabled&&he(o,k,No(N,x)),J=ar(x.ref)&&Ve(N)?"":N,ko(x.ref)?[...x.ref.options].forEach(Q=>Q.selected=J.includes(Q.value)):x.refs?Mt(x.ref)?x.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(J)?Q.checked=!!J.find(le=>le===Q.value):Q.checked=J===Q.value||!!J)}):x.refs.forEach(Q=>Q.checked=Q.value===J):Tn(x.ref)?x.ref.value="":(x.ref.value=J,x.ref.type||h.state.next({name:k,values:ge(o)})))}(T.shouldDirty||T.shouldTouch)&&$(k,J,T.shouldTouch,T.shouldDirty,!0),T.shouldValidate&&U(k)},ye=(k,N,T)=>{for(const W in N){if(!N.hasOwnProperty(W))return;const J=N[W],x=k+"."+W,Q=Y(n,x);(a.array.has(k)||Pe(J)||Q&&!Q._f)&&!ht(J)?ye(x,J,T):re(x,J,T)}},me=(k,N,T={})=>{const W=Y(n,k),J=a.array.has(k),x=ge(N);he(o,k,x),J?(h.array.next({name:k,values:ge(o)}),(y.isDirty||y.dirtyFields||f.isDirty||f.dirtyFields)&&T.shouldDirty&&h.state.next({name:k,dirtyFields:Et(s,o),isDirty:D(k,x)})):W&&!W._f&&!Ve(x)?ye(k,x,T):re(k,x,T),Vn(k,a)?h.state.next({...r,name:k,values:ge(o)}):h.state.next({name:i.mount?k:void 0,values:ge(o)})},ue=async k=>{i.mount=!0;const N=k.target;let T=N.name,W=!0;const J=Y(n,T),x=fe=>{W=Number.isNaN(fe)||ht(fe)&&isNaN(fe.getTime())||ut(fe,Y(o,T,fe))},Q=kt(t.mode),le=kt(t.reValidateMode);if(J){let fe,ze;const gt=N.type?Io(J._f):Lf(k),ft=k.type===$o.BLUR||k.type===$o.FOCUS_OUT,xh=!sm(J._f)&&!t.resolver&&!Y(r.errors,T)&&!J._f.deps||am(ft,Y(r.touchedFields,T),r.isSubmitted,le,Q),ms=Vn(T,a,ft);he(o,T,gt),ft?(!N||!N.readOnly)&&(J._f.onBlur&&J._f.onBlur(k),c&&c(0)):J._f.onChange&&J._f.onChange(k);const hs=$(T,gt,ft),Lh=!Re(hs)||ms;if(!ft&&h.state.next({name:T,type:k.type,values:ge(o)}),xh)return(y.isValid||f.isValid)&&(t.mode==="onBlur"?ft&&p():ft||p()),Lh&&h.state.next({name:T,...ms?{}:hs});if(!ft&&ms&&h.state.next({...r}),t.resolver){const{errors:La}=await R([T]);if(_([T]),x(gt),W){const Kh=Co(r.errors,n,T),Ka=Co(La,n,Kh.name||T);fe=Ka.error,T=Ka.name,ze=Re(La)}}else _([T],!0),fe=(await qn(J,a.disabled,o,w,t.shouldUseNativeValidation))[T],_([T]),x(gt),W&&(fe?ze=!1:(y.isValid||f.isValid)&&(ze=await L(n,!0)));W&&(J._f.deps&&(!Array.isArray(J._f.deps)||J._f.deps.length>0)&&U(J._f.deps),E(T,ze,fe,hs))}},Oe=(k,N)=>{if(Y(r.errors,N)&&k.focus)return k.focus(),1},U=async(k,N={})=>{let T,W;const J=qe(k);if(t.resolver){const x=await F(ve(k)?k:J);T=Re(x),W=k?!J.some(Q=>Y(x,Q)):T}else k?(W=(await Promise.all(J.map(async x=>{const Q=Y(n,x);return await L(Q&&Q._f?{[x]:Q}:Q)}))).every(Boolean),!(!W&&!r.isValid)&&p()):W=T=await L(n);return h.state.next({...!Ue(k)||(y.isValid||f.isValid)&&T!==r.isValid?{}:{name:k},...t.resolver||!k?{isValid:T}:{},errors:r.errors}),N.shouldFocus&&!W&&Pt(n,Oe,k?J:a.mount),W},O=(k,N)=>{let T={...i.mount?o:s};return N&&(T=Eo(N.dirtyFields?r.dirtyFields:r.touchedFields,T)),ve(k)?T:Ue(k)?Y(T,k):k.map(W=>Y(T,W))},C=(k,N)=>({invalid:!!Y((N||r).errors,k),isDirty:!!Y((N||r).dirtyFields,k),error:Y((N||r).errors,k),isValidating:!!Y(r.validatingFields,k),isTouched:!!Y((N||r).touchedFields,k)}),A=k=>{k&&qe(k).forEach(N=>ke(r.errors,N)),h.state.next({errors:k?r.errors:{}})},b=(k,N,T)=>{const W=(Y(n,k,{_f:{}})._f||{}).ref,J=Y(r.errors,k)||{},{ref:x,message:Q,type:le,...fe}=J;he(r.errors,k,{...fe,...N,ref:W}),h.state.next({name:k,errors:r.errors,isValid:!1}),T&&T.shouldFocus&&W&&W.focus&&W.focus()},P=(k,N)=>He(k)?h.state.subscribe({next:T=>"values"in T&&k(Z(void 0,N),T)}):Z(k,N,!0),I=k=>h.state.subscribe({next:N=>{im(k.name,N.name,k.exact)&&om(N,k.formState||y,Le,k.reRenderRoot)&&k.callback({values:{...o},...r,...N,defaultValues:s})}}).unsubscribe,B=k=>(i.mount=!0,f={...f,...k.formState},I({...k,formState:{...m,...k.formState}})),G=(k,N={})=>{for(const T of k?qe(k):a.mount)a.mount.delete(T),a.array.delete(T),N.keepValue||(ke(n,T),ke(o,T)),!N.keepError&&ke(r.errors,T),!N.keepDirty&&ke(r.dirtyFields,T),!N.keepTouched&&ke(r.touchedFields,T),!N.keepIsValidating&&ke(r.validatingFields,T),!t.shouldUnregister&&!N.keepDefaultValue&&ke(s,T);h.state.next({values:ge(o)}),h.state.next({...r,...N.keepDirty?{isDirty:D()}:{}}),!N.keepIsValid&&p()},ae=({disabled:k,name:N})=>{if(Qe(k)&&i.mount||k||a.disabled.has(N)){const J=a.disabled.has(N)!==!!k;k?a.disabled.add(N):a.disabled.delete(N),J&&i.mount&&!i.action&&p()}},se=(k,N={})=>{let T=Y(n,k);const W=Qe(N.disabled)||Qe(t.disabled);return he(n,k,{...T||{},_f:{...T&&T._f?T._f:{ref:{name:k}},name:k,mount:!0,...N}}),a.mount.add(k),T?ae({disabled:Qe(N.disabled)?N.disabled:t.disabled,name:k}):d(k,!0,N.value),{...W?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Dt(N.min),max:Dt(N.max),minLength:Dt(N.minLength),maxLength:Dt(N.maxLength),pattern:Dt(N.pattern)}:{},name:k,onChange:ue,onBlur:ue,ref:J=>{if(J){se(k,N),T=Y(n,k);const x=ve(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,Q=Xf(x),le=T._f.refs||[];if(Q?le.find(fe=>fe===x):x===T._f.ref)return;he(n,k,{_f:{...T._f,...Q?{refs:[...le.filter(Mn),x,...Array.isArray(Y(s,k))?[{}]:[]],ref:{type:x.type,name:k}}:{ref:x}}}),d(k,!1,void 0,x)}else T=Y(n,k,{}),T._f&&(T._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Jf(a.array,k)&&i.action)&&a.unMount.add(k)}}},j=()=>t.shouldFocusError&&Pt(n,Oe,a.mount),z=k=>{Qe(k)&&(h.state.next({disabled:k}),Pt(n,(N,T)=>{const W=Y(n,T);W&&(N.disabled=W._f.disabled||k,Array.isArray(W._f.refs)&&W._f.refs.forEach(J=>{J.disabled=W._f.disabled||k}))},0,!1))},q=(k,N)=>async T=>{let W;T&&(T.preventDefault&&T.preventDefault(),T.persist&&T.persist());let J=ge(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:x,values:Q}=await R();_(),r.errors=x,J=ge(Q)}else await L(n);if(a.disabled.size)for(const x of a.disabled)ke(J,x);if(ke(r.errors,"root"),Re(r.errors)){h.state.next({errors:{}});try{await k(J,T)}catch(x){W=x}}else N&&await N({...r.errors},T),j(),setTimeout(j);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Re(r.errors)&&!W,submitCount:r.submitCount+1,errors:r.errors}),W)throw W},H=(k,N={})=>{Y(n,k)&&(ve(N.defaultValue)?me(k,ge(Y(s,k))):(me(k,N.defaultValue),he(s,k,ge(N.defaultValue))),N.keepTouched||ke(r.touchedFields,k),N.keepDirty||(ke(r.dirtyFields,k),r.isDirty=N.defaultValue?D(k,ge(Y(s,k))):D()),N.keepError||(ke(r.errors,k),y.isValid&&p()),h.state.next({...r}))},X=(k,N={})=>{const T=k?ge(k):s,W=ge(T),J=Re(k),x=J?s:W;if(N.keepDefaultValues||(s=T),!N.keepValues){if(N.keepDirtyValues){const Q=new Set([...a.mount,...Object.keys(Et(s,o))]);for(const le of Array.from(Q)){const fe=Y(r.dirtyFields,le),ze=Y(o,le),gt=Y(x,le);fe&&!ve(ze)?he(x,le,ze):!fe&&!ve(gt)&&me(le,gt)}}else{if(Nn&&ve(k))for(const Q of a.mount){const le=Y(n,Q);if(le&&le._f){const fe=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(ar(fe)){const ze=fe.closest("form");if(ze){ze.reset();break}}}}if(N.keepFieldsRef)for(const Q of a.mount)me(Q,Y(x,Q));else n={}}o=t.shouldUnregister?N.keepDefaultValues?ge(s):{}:ge(x),h.array.next({values:{...x}}),h.state.next({values:{...x}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!y.isValid||!!N.keepIsValid||!!N.keepDirtyValues||!t.shouldUnregister&&!Re(x),i.watch=!!t.shouldUnregister,i.keepIsValid=!!N.keepIsValid,i.action=!1,N.keepErrors||(r.errors={}),h.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:J?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!ut(k,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:J?{}:N.keepDirtyValues?N.keepDefaultValues&&o?Et(s,o):r.dirtyFields:N.keepDefaultValues&&k?Et(s,k):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},oe=(k,N)=>X(He(k)?k(o):k,{...t.resetOptions,...N}),je=(k,N={})=>{const T=Y(n,k),W=T&&T._f;if(W){const J=W.refs?W.refs[0]:W.ref;J.focus&&setTimeout(()=>{J.focus(),N.shouldSelect&&He(J.select)&&J.select()})}},Le=k=>{r={...r,...k}},Ne={control:{register:se,unregister:G,getFieldState:C,handleSubmit:q,setError:b,_subscribe:I,_runSchema:R,_updateIsValidating:_,_focusError:j,_getWatch:Z,_getDirty:D,_setValid:p,_setFieldArray:l,_setDisabledField:ae,_setErrors:g,_getFieldArray:K,_reset:X,_resetDefaultValues:()=>He(t.defaultValues)&&t.defaultValues().then(k=>{oe(k,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:V,_disableForm:z,_subjects:h,_proxyFormState:y,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(k){i=k},get _defaultValues(){return s},get _names(){return a},set _names(k){a=k},get _formState(){return r},get _options(){return t},set _options(k){t={...t,...k}}},subscribe:B,trigger:U,register:se,handleSubmit:q,watch:P,setValue:me,getValues:O,reset:oe,resetField:H,clearErrors:A,unregister:G,setError:b,setFocus:je,getFieldState:C};return{...Ne,formControl:Ne}}var dt=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},Fn=(e,t,r={})=>r.shouldFocus||ve(r.shouldFocus)?r.focusName||`${e}.${ve(r.focusIndex)?t:r.focusIndex}.`:"",Zn=(e,t)=>[...e,...qe(t)],Un=e=>Array.isArray(e)?e.map(()=>{}):void 0;function xn(e,t,r){return[...e.slice(0,t),...qe(r),...e.slice(t)]}var Ln=(e,t,r)=>Array.isArray(e)?(ve(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],Kn=(e,t)=>[...qe(t),...qe(e)];function lm(e,t){let r=0;const n=[...e];for(const s of t)n.splice(s-r,1),r++;return ir(n).length?n:[]}var Jn=(e,t)=>ve(t)?[]:lm(e,qe(t).sort((r,n)=>r-n)),Hn=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},Vo=(e,t,r)=>(e[t]=r,e);function qo(e){const t=Gf(),{control:r=t,name:n,keyName:s="id",shouldUnregister:o,rules:i}=e,[a,c]=ee.useState(r._getFieldArray(n)),u=ee.useRef(r._getFieldArray(n).map(dt)),m=ee.useRef(!1);r._names.array.add(n),ee.useMemo(()=>i&&a.length>=0&&r.register(n,i),[r,n,a.length,i]),wo(()=>r._subjects.array.subscribe({next:({values:g,name:d})=>{if(d===n||!d){const $=Y(g,n);Array.isArray($)&&(c($),u.current=$.map(dt))}}}).unsubscribe,[r,n]);const y=ee.useCallback(g=>{m.current=!0,r._setFieldArray(n,g)},[r,n]),f=(g,d)=>{const $=qe(ge(g)),E=Zn(r._getFieldArray(n),$);r._names.focus=Fn(n,E.length-1,d),u.current=Zn(u.current,$.map(dt)),y(E),c(E),r._setFieldArray(n,E,Zn,{argA:Un(g)})},h=(g,d)=>{const $=qe(ge(g)),E=Kn(r._getFieldArray(n),$);r._names.focus=Fn(n,0,d),u.current=Kn(u.current,$.map(dt)),y(E),c(E),r._setFieldArray(n,E,Kn,{argA:Un(g)})},w=g=>{const d=Jn(r._getFieldArray(n),g);u.current=Jn(u.current,g),y(d),c(d),!Array.isArray(Y(r._fields,n))&&he(r._fields,n,void 0),r._setFieldArray(n,d,Jn,{argA:g})},S=(g,d,$)=>{const E=qe(ge(d)),R=xn(r._getFieldArray(n),g,E);r._names.focus=Fn(n,g,$),u.current=xn(u.current,g,E.map(dt)),y(R),c(R),r._setFieldArray(n,R,xn,{argA:g,argB:Un(d)})},p=(g,d)=>{const $=r._getFieldArray(n);Hn($,g,d),Hn(u.current,g,d),y($),c($),r._setFieldArray(n,$,Hn,{argA:g,argB:d},!1)},_=(g,d)=>{const $=r._getFieldArray(n);Ln($,g,d),Ln(u.current,g,d),y($),c($),r._setFieldArray(n,$,Ln,{argA:g,argB:d},!1)},l=(g,d)=>{const $=ge(d),E=Vo(r._getFieldArray(n),g,$);u.current=[...E].map((R,F)=>!R||F===g?dt():u.current[F]),y(E),c([...E]),r._setFieldArray(n,E,Vo,{argA:g,argB:$},!0,!1)},v=g=>{const d=qe(ge(g));u.current=d.map(dt),y([...d]),c([...d]),r._setFieldArray(n,[...d],$=>$,{},!0,!1)};return ee.useEffect(()=>{if(r._state.action=!1,Vn(n,r._names)&&r._subjects.state.next({...r._formState}),m.current&&(!kt(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!kt(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(g=>{r._updateIsValidating([n]);const d=Y(g.errors,n),$=Y(r._formState.errors,n);($?!d&&$.type||d&&($.type!==d.type||$.message!==d.message):d&&d.type)&&(d?he(r._formState.errors,n,d):ke(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const g=Y(r._fields,n);g&&g._f&&!(kt(r._options.reValidateMode).isOnSubmit&&kt(r._options.mode).isOnSubmit)&&qn(g,r._names.disabled,r._formValues,r._options.criteriaMode===Je.all,r._options.shouldUseNativeValidation,!0).then(d=>!Re(d)&&r._subjects.state.next({errors:Mo(r._formState.errors,d,n)}))}r._subjects.state.next({name:n,values:ge(r._formValues)}),r._names.focus&&Pt(r._fields,(g,d)=>{if(r._names.focus&&d.startsWith(r._names.focus)&&g.focus)return g.focus(),1}),r._names.focus="",r._setValid(),m.current=!1},[a,n,r]),ee.useEffect(()=>(!Y(r._formValues,n)&&r._setFieldArray(n),()=>{const g=(d,$)=>{const E=Y(r._fields,d);E&&E._f&&(E._f.mount=$)};r._options.shouldUnregister||o?r.unregister(n):g(n,!1)}),[n,r,s,o]),{swap:ee.useCallback(p,[y,n,r]),move:ee.useCallback(_,[y,n,r]),prepend:ee.useCallback(h,[y,n,r]),append:ee.useCallback(f,[y,n,r]),remove:ee.useCallback(w,[y,n,r]),insert:ee.useCallback(S,[y,n,r]),update:ee.useCallback(l,[y,n,r]),replace:ee.useCallback(v,[y,n,r]),fields:ee.useMemo(()=>a.map((g,d)=>({...g,[s]:u.current[d]||dt()})),[a,s])}}function fm(e={}){const t=ee.useRef(void 0),r=ee.useRef(void 0),[n,s]=ee.useState({isDirty:!1,isValidating:!1,isLoading:He(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:He(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!He(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=dm(e);t.current={...a,formState:n}}const o=t.current.control;return o._options=e,wo(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),ee.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ee.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ee.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),ee.useEffect(()=>{var i;e.values&&!ut(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),ee.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=ee.useMemo(()=>Bf(n,o),[o,n]),t.current}const Fo=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Y(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Gn=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Fo(n.ref,r,e):n&&n.refs&&n.refs.forEach(s=>Fo(s,r,e))}},Zo=(e,t)=>{t.shouldUseNativeValidation&&Gn(e,t);const r={};for(const n in e){const s=Y(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(mm(t.names||Object.keys(e),n)){const i=Object.assign({},Y(r,n));he(i,"root",o),he(r,n,i)}else he(r,n,o)}return r},mm=(e,t)=>{const r=Uo(t);return e.some(n=>Uo(n).match(`^${r}\\.\\d+`))};function Uo(e){return e.replace(/\]|\[/g,"")}function xo(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function hm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(m){return m.errors.forEach(function(y){return e.push(y)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=In(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function pm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if(n.code==="invalid_union"&&n.errors.length>0){var a=n.errors[0][0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if(n.code==="invalid_union"&&n.errors.forEach(function(m){return m.forEach(function(y){return e.push(y)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=In(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function ym(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,s,o){try{return Promise.resolve(xo(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(i){return o.shouldUseNativeValidation&&Gn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:Zo(hm(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,s,o){try{return Promise.resolve(xo(function(){return Promise.resolve((r.mode==="sync"?gc:_c)(e,n,t)).then(function(i){return o.shouldUseNativeValidation&&Gn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return a instanceof Sn})(i))return{values:{},errors:Zo(pm(i.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dr={exports:{}},Bn={},tt={},pt={},Wn={},Yn={},Xn={},Lo;function lr(){return Lo||(Lo=1,(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(l){if(super(),!e.IDENTIFIER.test(l))throw new Error("CodeGen: name must be a valid identifier");this.str=l}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(l){super(),this._items=typeof l=="string"?[l]:l}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const l=this._items[0];return l===""||l==='""'}get str(){var l;return(l=this._str)!==null&&l!==void 0?l:this._str=this._items.reduce((v,g)=>`${v}${g}`,"")}get names(){var l;return(l=this._names)!==null&&l!==void 0?l:this._names=this._items.reduce((v,g)=>(g instanceof r&&(v[g.str]=(v[g.str]||0)+1),v),{})}}e._Code=n,e.nil=new n("");function s(_,...l){const v=[_[0]];let g=0;for(;g<l.length;)a(v,l[g]),v.push(_[++g]);return new n(v)}e._=s;const o=new n("+");function i(_,...l){const v=[h(_[0])];let g=0;for(;g<l.length;)v.push(o),a(v,l[g]),v.push(o,h(_[++g]));return c(v),new n(v)}e.str=i;function a(_,l){l instanceof n?_.push(...l._items):l instanceof r?_.push(l):_.push(y(l))}e.addCodeArg=a;function c(_){let l=1;for(;l<_.length-1;){if(_[l]===o){const v=u(_[l-1],_[l+1]);if(v!==void 0){_.splice(l-1,3,v);continue}_[l++]="+"}l++}}function u(_,l){if(l==='""')return _;if(_==='""')return l;if(typeof _=="string")return l instanceof r||_[_.length-1]!=='"'?void 0:typeof l!="string"?`${_.slice(0,-1)}${l}"`:l[0]==='"'?_.slice(0,-1)+l.slice(1):void 0;if(typeof l=="string"&&l[0]==='"'&&!(_ instanceof r))return`"${_}${l.slice(1)}`}function m(_,l){return l.emptyStr()?_:_.emptyStr()?l:i`${_}${l}`}e.strConcat=m;function y(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:h(Array.isArray(_)?_.join(","):_)}function f(_){return new n(h(_))}e.stringify=f;function h(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function w(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):s`[${_}]`}e.getProperty=w;function S(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=S;function p(_){return new n(_.toString())}e.regexpCode=p})(Xn)),Xn}var Qn={},Ko;function Jo(){return Ko||(Ko=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=lr();class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:m}={}){this._names={},this._prefixes=u,this._parent=m}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const m=this._names[u]||this._nameGroup(u);return`${u}${m.index++}`}_nameGroup(u){var m,y;if(!((y=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||y===void 0)&&y.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=s;class o extends t.Name{constructor(u,m){super(m),this.prefix=u}setValue(u,{property:m,itemIndex:y}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(m)}[${y}]`}}e.ValueScopeName=o;const i=(0,t._)`\n`;class a extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?i:t.nil}}get(){return this._scope}name(u){return new o(u,this._newName(u))}value(u,m){var y;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const f=this.toName(u),{prefix:h}=f,w=(y=m.key)!==null&&y!==void 0?y:m.ref;let S=this._values[h];if(S){const l=S.get(w);if(l)return l}else S=this._values[h]=new Map;S.set(w,f);const p=this._scope[h]||(this._scope[h]=[]),_=p.length;return p[_]=m.ref,f.setValue(m,{property:h,itemIndex:_}),f}getValue(u,m){const y=this._values[u];if(y)return y.get(m)}scopeRefs(u,m=this._values){return this._reduceValues(m,y=>{if(y.scopePath===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return(0,t._)`${u}${y.scopePath}`})}scopeCode(u=this._values,m,y){return this._reduceValues(u,f=>{if(f.value===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return f.value.code},m,y)}_reduceValues(u,m,y={},f){let h=t.nil;for(const w in u){const S=u[w];if(!S)continue;const p=y[w]=y[w]||new Map;S.forEach(_=>{if(p.has(_))return;p.set(_,n.Started);let l=m(_);if(l){const v=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${v} ${_} = ${l};${this.opts._n}`}else if(l=f?.(_))h=(0,t._)`${h}${l}${this.opts._n}`;else throw new r(_);p.set(_,n.Completed)})}return h}}e.ValueScope=a})(Qn)),Qn}var Ho;function ne(){return Ho||(Ho=1,(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=lr(),r=Jo();var n=lr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Jo();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.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 o{optimizeNodes(){return this}optimizeNames(b,P){return this}}class i extends o{constructor(b,P,I){super(),this.varKind=b,this.name=P,this.rhs=I}render({es5:b,_n:P}){const I=b?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${B};`+P}optimizeNames(b,P){if(b[this.name.str])return this.rhs&&(this.rhs=K(this.rhs,b,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(b,P,I){super(),this.lhs=b,this.rhs=P,this.sideEffects=I}render({_n:b}){return`${this.lhs} = ${this.rhs};`+b}optimizeNames(b,P){if(!(this.lhs instanceof t.Name&&!b[this.lhs.str]&&!this.sideEffects))return this.rhs=K(this.rhs,b,P),this}get names(){const b=this.lhs instanceof t.Name?{}:{...this.lhs.names};return Z(b,this.rhs)}}class c extends a{constructor(b,P,I,B){super(b,I,B),this.op=P}render({_n:b}){return`${this.lhs} ${this.op}= ${this.rhs};`+b}}class u extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`${this.label}:`+b}}class m extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`break${this.label?` ${this.label}`:""};`+b}}class y extends o{constructor(b){super(),this.error=b}render({_n:b}){return`throw ${this.error};`+b}get names(){return this.error.names}}class f extends o{constructor(b){super(),this.code=b}render({_n:b}){return`${this.code};`+b}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(b,P){return this.code=K(this.code,b,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(b=[]){super(),this.nodes=b}render(b){return this.nodes.reduce((P,I)=>P+I.render(b),"")}optimizeNodes(){const{nodes:b}=this;let P=b.length;for(;P--;){const I=b[P].optimizeNodes();Array.isArray(I)?b.splice(P,1,...I):I?b[P]=I:b.splice(P,1)}return b.length>0?this:void 0}optimizeNames(b,P){const{nodes:I}=this;let B=I.length;for(;B--;){const G=I[B];G.optimizeNames(b,P)||(re(b,G.names),I.splice(B,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((b,P)=>D(b,P.names),{})}}class w extends h{render(b){return"{"+b._n+super.render(b)+"}"+b._n}}class S extends h{}class p extends w{}p.kind="else";class _ extends w{constructor(b,P){super(P),this.condition=b}render(b){let P=`if(${this.condition})`+super.render(b);return this.else&&(P+="else "+this.else.render(b)),P}optimizeNodes(){super.optimizeNodes();const b=this.condition;if(b===!0)return this.nodes;let P=this.else;if(P){const I=P.optimizeNodes();P=this.else=Array.isArray(I)?new p(I):I}if(P)return b===!1?P instanceof _?P:P.nodes:this.nodes.length?this:new _(ye(b),P instanceof _?[P]:P.nodes);if(!(b===!1||!this.nodes.length))return this}optimizeNames(b,P){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(b,P),!!(super.optimizeNames(b,P)||this.else))return this.condition=K(this.condition,b,P),this}get names(){const b=super.names;return Z(b,this.condition),this.else&&D(b,this.else.names),b}}_.kind="if";class l extends w{}l.kind="for";class v extends l{constructor(b){super(),this.iteration=b}render(b){return`for(${this.iteration})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iteration=K(this.iteration,b,P),this}get names(){return D(super.names,this.iteration.names)}}class g extends l{constructor(b,P,I,B){super(),this.varKind=b,this.name=P,this.from=I,this.to=B}render(b){const P=b.es5?r.varKinds.var:this.varKind,{name:I,from:B,to:G}=this;return`for(${P} ${I}=${B}; ${I}<${G}; ${I}++)`+super.render(b)}get names(){const b=Z(super.names,this.from);return Z(b,this.to)}}class d extends l{constructor(b,P,I,B){super(),this.loop=b,this.varKind=P,this.name=I,this.iterable=B}render(b){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iterable=K(this.iterable,b,P),this}get names(){return D(super.names,this.iterable.names)}}class $ extends w{constructor(b,P,I){super(),this.name=b,this.args=P,this.async=I}render(b){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(b)}}$.kind="func";class E extends h{render(b){return"return "+super.render(b)}}E.kind="return";class R extends w{render(b){let P="try"+super.render(b);return this.catch&&(P+=this.catch.render(b)),this.finally&&(P+=this.finally.render(b)),P}optimizeNodes(){var b,P;return super.optimizeNodes(),(b=this.catch)===null||b===void 0||b.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(b,P){var I,B;return super.optimizeNames(b,P),(I=this.catch)===null||I===void 0||I.optimizeNames(b,P),(B=this.finally)===null||B===void 0||B.optimizeNames(b,P),this}get names(){const b=super.names;return this.catch&&D(b,this.catch.names),this.finally&&D(b,this.finally.names),b}}class F extends w{constructor(b){super(),this.error=b}render(b){return`catch(${this.error})`+super.render(b)}}F.kind="catch";class L extends w{render(b){return"finally"+super.render(b)}}L.kind="finally";class V{constructor(b,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
|
|
40
|
+
`:""},this._extScope=b,this._scope=new r.Scope({parent:b}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(b){return this._scope.name(b)}scopeName(b){return this._extScope.name(b)}scopeValue(b,P){const I=this._extScope.value(b,P);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(b,P){return this._extScope.getValue(b,P)}scopeRefs(b){return this._extScope.scopeRefs(b,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(b,P,I,B){const G=this._scope.toName(P);return I!==void 0&&B&&(this._constants[G.str]=I),this._leafNode(new i(b,G,I)),G}const(b,P,I){return this._def(r.varKinds.const,b,P,I)}let(b,P,I){return this._def(r.varKinds.let,b,P,I)}var(b,P,I){return this._def(r.varKinds.var,b,P,I)}assign(b,P,I){return this._leafNode(new a(b,P,I))}add(b,P){return this._leafNode(new c(b,e.operators.ADD,P))}code(b){return typeof b=="function"?b():b!==t.nil&&this._leafNode(new f(b)),this}object(...b){const P=["{"];for(const[I,B]of b)P.length>1&&P.push(","),P.push(I),(I!==B||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,B));return P.push("}"),new t._Code(P)}if(b,P,I){if(this._blockNode(new _(b)),P&&I)this.code(P).else().code(I).endIf();else if(P)this.code(P).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(b){return this._elseNode(new _(b))}else(){return this._elseNode(new p)}endIf(){return this._endBlockNode(_,p)}_for(b,P){return this._blockNode(b),P&&this.code(P).endFor(),this}for(b,P){return this._for(new v(b),P)}forRange(b,P,I,B,G=this.opts.es5?r.varKinds.var:r.varKinds.let){const ae=this._scope.toName(b);return this._for(new g(G,ae,P,I),()=>B(ae))}forOf(b,P,I,B=r.varKinds.const){const G=this._scope.toName(b);if(this.opts.es5){const ae=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${ae}.length`,se=>{this.var(G,(0,t._)`${ae}[${se}]`),I(G)})}return this._for(new d("of",B,G,P),()=>I(G))}forIn(b,P,I,B=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(b,(0,t._)`Object.keys(${P})`,I);const G=this._scope.toName(b);return this._for(new d("in",B,G,P),()=>I(G))}endFor(){return this._endBlockNode(l)}label(b){return this._leafNode(new u(b))}break(b){return this._leafNode(new m(b))}return(b){const P=new E;if(this._blockNode(P),this.code(b),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(b,P,I){if(!P&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const B=new R;if(this._blockNode(B),this.code(b),P){const G=this.name("e");this._currNode=B.catch=new F(G),P(G)}return I&&(this._currNode=B.finally=new L,this.code(I)),this._endBlockNode(F,L)}throw(b){return this._leafNode(new y(b))}block(b,P){return this._blockStarts.push(this._nodes.length),b&&this.code(b).endBlock(P),this}endBlock(b){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-P;if(I<0||b!==void 0&&I!==b)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${b} expected`);return this._nodes.length=P,this}func(b,P=t.nil,I,B){return this._blockNode(new $(b,P,I)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(b=1){for(;b-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(b){return this._currNode.nodes.push(b),this}_blockNode(b){this._currNode.nodes.push(b),this._nodes.push(b)}_endBlockNode(b,P){const I=this._currNode;if(I instanceof b||P&&I instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${b.kind}/${P.kind}`:b.kind}"`)}_elseNode(b){const P=this._currNode;if(!(P instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=b,this}get _root(){return this._nodes[0]}get _currNode(){const b=this._nodes;return b[b.length-1]}set _currNode(b){const P=this._nodes;P[P.length-1]=b}}e.CodeGen=V;function D(A,b){for(const P in b)A[P]=(A[P]||0)+(b[P]||0);return A}function Z(A,b){return b instanceof t._CodeOrName?D(A,b.names):A}function K(A,b,P){if(A instanceof t.Name)return I(A);if(!B(A))return A;return new t._Code(A._items.reduce((G,ae)=>(ae instanceof t.Name&&(ae=I(ae)),ae instanceof t._Code?G.push(...ae._items):G.push(ae),G),[]));function I(G){const ae=P[G.str];return ae===void 0||b[G.str]!==1?G:(delete b[G.str],ae)}function B(G){return G instanceof t._Code&&G._items.some(ae=>ae instanceof t.Name&&b[ae.str]===1&&P[ae.str]!==void 0)}}function re(A,b){for(const P in b)A[P]=(A[P]||0)-(b[P]||0)}function ye(A){return typeof A=="boolean"||typeof A=="number"||A===null?!A:(0,t._)`!${C(A)}`}e.not=ye;const me=O(e.operators.AND);function ue(...A){return A.reduce(me)}e.and=ue;const Oe=O(e.operators.OR);function U(...A){return A.reduce(Oe)}e.or=U;function O(A){return(b,P)=>b===t.nil?P:P===t.nil?b:(0,t._)`${C(b)} ${A} ${C(P)}`}function C(A){return A instanceof t.Name?A:(0,t._)`(${A})`}})(Yn)),Yn}var ie={},Go;function ce(){if(Go)return ie;Go=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.checkStrictMode=ie.getErrorPath=ie.Type=ie.useFunc=ie.setEvaluated=ie.evaluatedPropsToName=ie.mergeEvaluated=ie.eachItem=ie.unescapeJsonPointer=ie.escapeJsonPointer=ie.escapeFragment=ie.unescapeFragment=ie.schemaRefOrVal=ie.schemaHasRulesButRef=ie.schemaHasRules=ie.checkUnknownRules=ie.alwaysValidSchema=ie.toHash=void 0;const e=ne(),t=lr();function r(d){const $={};for(const E of d)$[E]=!0;return $}ie.toHash=r;function n(d,$){return typeof $=="boolean"?$:Object.keys($).length===0?!0:(s(d,$),!o($,d.self.RULES.all))}ie.alwaysValidSchema=n;function s(d,$=d.schema){const{opts:E,self:R}=d;if(!E.strictSchema||typeof $=="boolean")return;const F=R.RULES.keywords;for(const L in $)F[L]||g(d,`unknown keyword: "${L}"`)}ie.checkUnknownRules=s;function o(d,$){if(typeof d=="boolean")return!d;for(const E in d)if($[E])return!0;return!1}ie.schemaHasRules=o;function i(d,$){if(typeof d=="boolean")return!d;for(const E in d)if(E!=="$ref"&&$.all[E])return!0;return!1}ie.schemaHasRulesButRef=i;function a({topSchemaRef:d,schemaPath:$},E,R,F){if(!F){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${d}${$}${(0,e.getProperty)(R)}`}ie.schemaRefOrVal=a;function c(d){return y(decodeURIComponent(d))}ie.unescapeFragment=c;function u(d){return encodeURIComponent(m(d))}ie.escapeFragment=u;function m(d){return typeof d=="number"?`${d}`:d.replace(/~/g,"~0").replace(/\//g,"~1")}ie.escapeJsonPointer=m;function y(d){return d.replace(/~1/g,"/").replace(/~0/g,"~")}ie.unescapeJsonPointer=y;function f(d,$){if(Array.isArray(d))for(const E of d)$(E);else $(d)}ie.eachItem=f;function h({mergeNames:d,mergeToName:$,mergeValues:E,resultToName:R}){return(F,L,V,D)=>{const Z=V===void 0?L:V instanceof e.Name?(L instanceof e.Name?d(F,L,V):$(F,L,V),V):L instanceof e.Name?($(F,V,L),L):E(L,V);return D===e.Name&&!(Z instanceof e.Name)?R(F,Z):Z}}ie.mergeEvaluated={props:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>{d.if((0,e._)`${$} === true`,()=>d.assign(E,!0),()=>d.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${$})`))}),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>{$===!0?d.assign(E,!0):(d.assign(E,(0,e._)`${E} || {}`),S(d,E,$))}),mergeValues:(d,$)=>d===!0?!0:{...d,...$},resultToName:w}),items:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>d.assign(E,(0,e._)`${$} === true ? true : ${E} > ${$} ? ${E} : ${$}`)),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>d.assign(E,$===!0?!0:(0,e._)`${E} > ${$} ? ${E} : ${$}`)),mergeValues:(d,$)=>d===!0?!0:Math.max(d,$),resultToName:(d,$)=>d.var("items",$)})};function w(d,$){if($===!0)return d.var("props",!0);const E=d.var("props",(0,e._)`{}`);return $!==void 0&&S(d,E,$),E}ie.evaluatedPropsToName=w;function S(d,$,E){Object.keys(E).forEach(R=>d.assign((0,e._)`${$}${(0,e.getProperty)(R)}`,!0))}ie.setEvaluated=S;const p={};function _(d,$){return d.scopeValue("func",{ref:$,code:p[$.code]||(p[$.code]=new t._Code($.code))})}ie.useFunc=_;var l;(function(d){d[d.Num=0]="Num",d[d.Str=1]="Str"})(l||(ie.Type=l={}));function v(d,$,E){if(d instanceof e.Name){const R=$===l.Num;return E?R?(0,e._)`"[" + ${d} + "]"`:(0,e._)`"['" + ${d} + "']"`:R?(0,e._)`"/" + ${d}`:(0,e._)`"/" + ${d}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(d).toString():"/"+m(d)}ie.getErrorPath=v;function g(d,$,E=d.opts.strictSchema){if(E){if($=`strict mode: ${$}`,E===!0)throw new Error($);d.self.logger.warn($)}}return ie.checkStrictMode=g,ie}var fr={},Bo;function Ge(){if(Bo)return fr;Bo=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=ne(),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 fr.default=t,fr}var Wo;function mr(){return Wo||(Wo=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=ne(),r=ce(),n=Ge();e.keywordError={message:({keyword:p})=>(0,t.str)`must pass "${p}" keyword validation`},e.keyword$DataError={message:({keyword:p,schemaType:_})=>_?(0,t.str)`"${p}" keyword must be ${_} ($data)`:(0,t.str)`"${p}" keyword is invalid ($data)`};function s(p,_=e.keywordError,l,v){const{it:g}=p,{gen:d,compositeRule:$,allErrors:E}=g,R=y(p,_,l);v??($||E)?c(d,R):u(g,(0,t._)`[${R}]`)}e.reportError=s;function o(p,_=e.keywordError,l){const{it:v}=p,{gen:g,compositeRule:d,allErrors:$}=v,E=y(p,_,l);c(g,E),d||$||u(v,n.default.vErrors)}e.reportExtraError=o;function i(p,_){p.assign(n.default.errors,_),p.if((0,t._)`${n.default.vErrors} !== null`,()=>p.if(_,()=>p.assign((0,t._)`${n.default.vErrors}.length`,_),()=>p.assign(n.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:p,keyword:_,schemaValue:l,data:v,errsCount:g,it:d}){if(g===void 0)throw new Error("ajv implementation error");const $=p.name("err");p.forRange("i",g,n.default.errors,E=>{p.const($,(0,t._)`${n.default.vErrors}[${E}]`),p.if((0,t._)`${$}.instancePath === undefined`,()=>p.assign((0,t._)`${$}.instancePath`,(0,t.strConcat)(n.default.instancePath,d.errorPath))),p.assign((0,t._)`${$}.schemaPath`,(0,t.str)`${d.errSchemaPath}/${_}`),d.opts.verbose&&(p.assign((0,t._)`${$}.schema`,l),p.assign((0,t._)`${$}.data`,v))})}e.extendErrors=a;function c(p,_){const l=p.const("err",_);p.if((0,t._)`${n.default.vErrors} === null`,()=>p.assign(n.default.vErrors,(0,t._)`[${l}]`),(0,t._)`${n.default.vErrors}.push(${l})`),p.code((0,t._)`${n.default.errors}++`)}function u(p,_){const{gen:l,validateName:v,schemaEnv:g}=p;g.$async?l.throw((0,t._)`new ${p.ValidationError}(${_})`):(l.assign((0,t._)`${v}.errors`,_),l.return(!1))}const m={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 y(p,_,l){const{createErrors:v}=p.it;return v===!1?(0,t._)`{}`:f(p,_,l)}function f(p,_,l={}){const{gen:v,it:g}=p,d=[h(g,l),w(p,l)];return S(p,_,d),v.object(...d)}function h({errorPath:p},{instancePath:_}){const l=_?(0,t.str)`${p}${(0,r.getErrorPath)(_,r.Type.Str)}`:p;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,l)]}function w({keyword:p,it:{errSchemaPath:_}},{schemaPath:l,parentSchema:v}){let g=v?_:(0,t.str)`${_}/${p}`;return l&&(g=(0,t.str)`${g}${(0,r.getErrorPath)(l,r.Type.Str)}`),[m.schemaPath,g]}function S(p,{params:_,message:l},v){const{keyword:g,data:d,schemaValue:$,it:E}=p,{opts:R,propertyName:F,topSchemaRef:L,schemaPath:V}=E;v.push([m.keyword,g],[m.params,typeof _=="function"?_(p):_||(0,t._)`{}`]),R.messages&&v.push([m.message,typeof l=="function"?l(p):l]),R.verbose&&v.push([m.schema,$],[m.parentSchema,(0,t._)`${L}${V}`],[n.default.data,d]),F&&v.push([m.propertyName,F])}})(Wn)),Wn}var Yo;function vm(){if(Yo)return pt;Yo=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.boolOrEmptySchema=pt.topBoolOrEmptySchema=void 0;const e=mr(),t=ne(),r=Ge(),n={message:"boolean schema is false"};function s(a){const{gen:c,schema:u,validateName:m}=a;u===!1?i(a,!1):typeof u=="object"&&u.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${m}.errors`,null),c.return(!0))}pt.topBoolOrEmptySchema=s;function o(a,c){const{gen:u,schema:m}=a;m===!1?(u.var(c,!1),i(a)):u.var(c,!0)}pt.boolOrEmptySchema=o;function i(a,c){const{gen:u,data:m}=a,y={gen:u,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(y,n,void 0,c)}return pt}var Ae={},yt={},Xo;function Qo(){if(Xo)return yt;Xo=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.getRules=yt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(s){return typeof s=="string"&&t.has(s)}yt.isJSONType=r;function n(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return yt.getRules=n,yt}var rt={},ei;function ti(){if(ei)return rt;ei=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.shouldUseRule=rt.shouldUseGroup=rt.schemaHasRulesForType=void 0;function e({schema:n,self:s},o){const i=s.RULES.types[o];return i&&i!==!0&&t(n,i)}rt.schemaHasRulesForType=e;function t(n,s){return s.rules.some(o=>r(n,o))}rt.shouldUseGroup=t;function r(n,s){var o;return n[s.keyword]!==void 0||((o=s.definition.implements)===null||o===void 0?void 0:o.some(i=>n[i]!==void 0))}return rt.shouldUseRule=r,rt}var ri;function hr(){if(ri)return Ae;ri=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.reportTypeError=Ae.checkDataTypes=Ae.checkDataType=Ae.coerceAndCheckDataType=Ae.getJSONTypes=Ae.getSchemaTypes=Ae.DataType=void 0;const e=Qo(),t=ti(),r=mr(),n=ne(),s=ce();var o;(function(l){l[l.Correct=0]="Correct",l[l.Wrong=1]="Wrong"})(o||(Ae.DataType=o={}));function i(l){const v=a(l.type);if(v.includes("null")){if(l.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!v.length&&l.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');l.nullable===!0&&v.push("null")}return v}Ae.getSchemaTypes=i;function a(l){const v=Array.isArray(l)?l:l?[l]:[];if(v.every(e.isJSONType))return v;throw new Error("type must be JSONType or JSONType[]: "+v.join(","))}Ae.getJSONTypes=a;function c(l,v){const{gen:g,data:d,opts:$}=l,E=m(v,$.coerceTypes),R=v.length>0&&!(E.length===0&&v.length===1&&(0,t.schemaHasRulesForType)(l,v[0]));if(R){const F=w(v,d,$.strictNumbers,o.Wrong);g.if(F,()=>{E.length?y(l,v,E):p(l)})}return R}Ae.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function m(l,v){return v?l.filter(g=>u.has(g)||v==="array"&&g==="array"):[]}function y(l,v,g){const{gen:d,data:$,opts:E}=l,R=d.let("dataType",(0,n._)`typeof ${$}`),F=d.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&d.if((0,n._)`${R} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>d.assign($,(0,n._)`${$}[0]`).assign(R,(0,n._)`typeof ${$}`).if(w(v,$,E.strictNumbers),()=>d.assign(F,$))),d.if((0,n._)`${F} !== undefined`);for(const V of g)(u.has(V)||V==="array"&&E.coerceTypes==="array")&&L(V);d.else(),p(l),d.endIf(),d.if((0,n._)`${F} !== undefined`,()=>{d.assign($,F),f(l,F)});function L(V){switch(V){case"string":d.elseIf((0,n._)`${R} == "number" || ${R} == "boolean"`).assign(F,(0,n._)`"" + ${$}`).elseIf((0,n._)`${$} === null`).assign(F,(0,n._)`""`);return;case"number":d.elseIf((0,n._)`${R} == "boolean" || ${$} === null
|
|
41
|
+
|| (${R} == "string" && ${$} && ${$} == +${$})`).assign(F,(0,n._)`+${$}`);return;case"integer":d.elseIf((0,n._)`${R} === "boolean" || ${$} === null
|
|
42
|
+
|| (${R} === "string" && ${$} && ${$} == +${$} && !(${$} % 1))`).assign(F,(0,n._)`+${$}`);return;case"boolean":d.elseIf((0,n._)`${$} === "false" || ${$} === 0 || ${$} === null`).assign(F,!1).elseIf((0,n._)`${$} === "true" || ${$} === 1`).assign(F,!0);return;case"null":d.elseIf((0,n._)`${$} === "" || ${$} === 0 || ${$} === false`),d.assign(F,null);return;case"array":d.elseIf((0,n._)`${R} === "string" || ${R} === "number"
|
|
43
|
+
|| ${R} === "boolean" || ${$} === null`).assign(F,(0,n._)`[${$}]`)}}}function f({gen:l,parentData:v,parentDataProperty:g},d){l.if((0,n._)`${v} !== undefined`,()=>l.assign((0,n._)`${v}[${g}]`,d))}function h(l,v,g,d=o.Correct){const $=d===o.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(l){case"null":return(0,n._)`${v} ${$} null`;case"array":E=(0,n._)`Array.isArray(${v})`;break;case"object":E=(0,n._)`${v} && typeof ${v} == "object" && !Array.isArray(${v})`;break;case"integer":E=R((0,n._)`!(${v} % 1) && !isNaN(${v})`);break;case"number":E=R();break;default:return(0,n._)`typeof ${v} ${$} ${l}`}return d===o.Correct?E:(0,n.not)(E);function R(F=n.nil){return(0,n.and)((0,n._)`typeof ${v} == "number"`,F,g?(0,n._)`isFinite(${v})`:n.nil)}}Ae.checkDataType=h;function w(l,v,g,d){if(l.length===1)return h(l[0],v,g,d);let $;const E=(0,s.toHash)(l);if(E.array&&E.object){const R=(0,n._)`typeof ${v} != "object"`;$=E.null?R:(0,n._)`!${v} || ${R}`,delete E.null,delete E.array,delete E.object}else $=n.nil;E.number&&delete E.integer;for(const R in E)$=(0,n.and)($,h(R,v,g,d));return $}Ae.checkDataTypes=w;const S={message:({schema:l})=>`must be ${l}`,params:({schema:l,schemaValue:v})=>typeof l=="string"?(0,n._)`{type: ${l}}`:(0,n._)`{type: ${v}}`};function p(l){const v=_(l);(0,r.reportError)(v,S)}Ae.reportTypeError=p;function _(l){const{gen:v,data:g,schema:d}=l,$=(0,s.schemaRefOrVal)(l,d,"type");return{gen:v,keyword:"type",data:g,schema:d.type,schemaCode:$,schemaValue:$,parentSchema:d,params:{},it:l}}return Ae}var Vt={},ni;function gm(){if(ni)return Vt;ni=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.assignDefaults=void 0;const e=ne(),t=ce();function r(s,o){const{properties:i,items:a}=s.schema;if(o==="object"&&i)for(const c in i)n(s,c,i[c].default);else o==="array"&&Array.isArray(a)&&a.forEach((c,u)=>n(s,u,c.default))}Vt.assignDefaults=r;function n(s,o,i){const{gen:a,compositeRule:c,data:u,opts:m}=s;if(i===void 0)return;const y=(0,e._)`${u}${(0,e.getProperty)(o)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${y}`);return}let f=(0,e._)`${y} === undefined`;m.useDefaults==="empty"&&(f=(0,e._)`${f} || ${y} === null || ${y} === ""`),a.if(f,(0,e._)`${y} = ${(0,e.stringify)(i)}`)}return Vt}var Be={},pe={},si;function We(){if(si)return pe;si=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateUnion=pe.validateArray=pe.usePattern=pe.callValidateCode=pe.schemaProperties=pe.allSchemaProperties=pe.noPropertyInData=pe.propertyInData=pe.isOwnProperty=pe.hasPropFunc=pe.reportMissingProp=pe.checkMissingProp=pe.checkReportMissingProp=void 0;const e=ne(),t=ce(),r=Ge(),n=ce();function s(l,v){const{gen:g,data:d,it:$}=l;g.if(m(g,d,v,$.opts.ownProperties),()=>{l.setParams({missingProperty:(0,e._)`${v}`},!0),l.error()})}pe.checkReportMissingProp=s;function o({gen:l,data:v,it:{opts:g}},d,$){return(0,e.or)(...d.map(E=>(0,e.and)(m(l,v,E,g.ownProperties),(0,e._)`${$} = ${E}`)))}pe.checkMissingProp=o;function i(l,v){l.setParams({missingProperty:v},!0),l.error()}pe.reportMissingProp=i;function a(l){return l.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}pe.hasPropFunc=a;function c(l,v,g){return(0,e._)`${a(l)}.call(${v}, ${g})`}pe.isOwnProperty=c;function u(l,v,g,d){const $=(0,e._)`${v}${(0,e.getProperty)(g)} !== undefined`;return d?(0,e._)`${$} && ${c(l,v,g)}`:$}pe.propertyInData=u;function m(l,v,g,d){const $=(0,e._)`${v}${(0,e.getProperty)(g)} === undefined`;return d?(0,e.or)($,(0,e.not)(c(l,v,g))):$}pe.noPropertyInData=m;function y(l){return l?Object.keys(l).filter(v=>v!=="__proto__"):[]}pe.allSchemaProperties=y;function f(l,v){return y(v).filter(g=>!(0,t.alwaysValidSchema)(l,v[g]))}pe.schemaProperties=f;function h({schemaCode:l,data:v,it:{gen:g,topSchemaRef:d,schemaPath:$,errorPath:E},it:R},F,L,V){const D=V?(0,e._)`${l}, ${v}, ${d}${$}`:v,Z=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,R.parentData],[r.default.parentDataProperty,R.parentDataProperty],[r.default.rootData,r.default.rootData]];R.opts.dynamicRef&&Z.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const K=(0,e._)`${D}, ${g.object(...Z)}`;return L!==e.nil?(0,e._)`${F}.call(${L}, ${K})`:(0,e._)`${F}(${K})`}pe.callValidateCode=h;const w=(0,e._)`new RegExp`;function S({gen:l,it:{opts:v}},g){const d=v.unicodeRegExp?"u":"",{regExp:$}=v.code,E=$(g,d);return l.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${$.code==="new RegExp"?w:(0,n.useFunc)(l,$)}(${g}, ${d})`})}pe.usePattern=S;function p(l){const{gen:v,data:g,keyword:d,it:$}=l,E=v.name("valid");if($.allErrors){const F=v.let("valid",!0);return R(()=>v.assign(F,!1)),F}return v.var(E,!0),R(()=>v.break()),E;function R(F){const L=v.const("len",(0,e._)`${g}.length`);v.forRange("i",0,L,V=>{l.subschema({keyword:d,dataProp:V,dataPropType:t.Type.Num},E),v.if((0,e.not)(E),F)})}}pe.validateArray=p;function _(l){const{gen:v,schema:g,keyword:d,it:$}=l;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(L=>(0,t.alwaysValidSchema)($,L))&&!$.opts.unevaluated)return;const R=v.let("valid",!1),F=v.name("_valid");v.block(()=>g.forEach((L,V)=>{const D=l.subschema({keyword:d,schemaProp:V,compositeRule:!0},F);v.assign(R,(0,e._)`${R} || ${F}`),l.mergeValidEvaluated(D,F)||v.if((0,e.not)(R))})),l.result(R,()=>l.reset(),()=>l.error(!0))}return pe.validateUnion=_,pe}var oi;function _m(){if(oi)return Be;oi=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.validateKeywordUsage=Be.validSchemaType=Be.funcKeywordCode=Be.macroKeywordCode=void 0;const e=ne(),t=Ge(),r=We(),n=mr();function s(f,h){const{gen:w,keyword:S,schema:p,parentSchema:_,it:l}=f,v=h.macro.call(l.self,p,_,l),g=u(w,S,v);l.opts.validateSchema!==!1&&l.self.validateSchema(v,!0);const d=w.name("valid");f.subschema({schema:v,schemaPath:e.nil,errSchemaPath:`${l.errSchemaPath}/${S}`,topSchemaRef:g,compositeRule:!0},d),f.pass(d,()=>f.error(!0))}Be.macroKeywordCode=s;function o(f,h){var w;const{gen:S,keyword:p,schema:_,parentSchema:l,$data:v,it:g}=f;c(g,h);const d=!v&&h.compile?h.compile.call(g.self,_,l,g):h.validate,$=u(S,p,d),E=S.let("valid");f.block$data(E,R),f.ok((w=h.valid)!==null&&w!==void 0?w:E);function R(){if(h.errors===!1)V(),h.modifying&&i(f),D(()=>f.error());else{const Z=h.async?F():L();h.modifying&&i(f),D(()=>a(f,Z))}}function F(){const Z=S.let("ruleErrs",null);return S.try(()=>V((0,e._)`await `),K=>S.assign(E,!1).if((0,e._)`${K} instanceof ${g.ValidationError}`,()=>S.assign(Z,(0,e._)`${K}.errors`),()=>S.throw(K))),Z}function L(){const Z=(0,e._)`${$}.errors`;return S.assign(Z,null),V(e.nil),Z}function V(Z=h.async?(0,e._)`await `:e.nil){const K=g.opts.passContext?t.default.this:t.default.self,re=!("compile"in h&&!v||h.schema===!1);S.assign(E,(0,e._)`${Z}${(0,r.callValidateCode)(f,$,K,re)}`,h.modifying)}function D(Z){var K;S.if((0,e.not)((K=h.valid)!==null&&K!==void 0?K:E),Z)}}Be.funcKeywordCode=o;function i(f){const{gen:h,data:w,it:S}=f;h.if(S.parentData,()=>h.assign(w,(0,e._)`${S.parentData}[${S.parentDataProperty}]`))}function a(f,h){const{gen:w}=f;w.if((0,e._)`Array.isArray(${h})`,()=>{w.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${h} : ${t.default.vErrors}.concat(${h})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(f)},()=>f.error())}function c({schemaEnv:f},h){if(h.async&&!f.$async)throw new Error("async keyword in sync schema")}function u(f,h,w){if(w===void 0)throw new Error(`keyword "${h}" failed to compile`);return f.scopeValue("keyword",typeof w=="function"?{ref:w}:{ref:w,code:(0,e.stringify)(w)})}function m(f,h,w=!1){return!h.length||h.some(S=>S==="array"?Array.isArray(f):S==="object"?f&&typeof f=="object"&&!Array.isArray(f):typeof f==S||w&&typeof f>"u")}Be.validSchemaType=m;function y({schema:f,opts:h,self:w,errSchemaPath:S},p,_){if(Array.isArray(p.keyword)?!p.keyword.includes(_):p.keyword!==_)throw new Error("ajv implementation error");const l=p.dependencies;if(l?.some(v=>!Object.prototype.hasOwnProperty.call(f,v)))throw new Error(`parent schema must have dependencies of ${_}: ${l.join(",")}`);if(p.validateSchema&&!p.validateSchema(f[_])){const g=`keyword "${_}" value is invalid at path "${S}": `+w.errorsText(p.validateSchema.errors);if(h.validateSchema==="log")w.logger.error(g);else throw new Error(g)}}return Be.validateKeywordUsage=y,Be}var nt={},ii;function $m(){if(ii)return nt;ii=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.extendSubschemaMode=nt.extendSubschemaData=nt.getSubschema=void 0;const e=ne(),t=ce();function r(o,{keyword:i,schemaProp:a,schema:c,schemaPath:u,errSchemaPath:m,topSchemaRef:y}){if(i!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){const f=o.schema[i];return a===void 0?{schema:f,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}`,errSchemaPath:`${o.errSchemaPath}/${i}`}:{schema:f[a],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${i}/${(0,t.escapeFragment)(a)}`}}if(c!==void 0){if(u===void 0||m===void 0||y===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:y,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}nt.getSubschema=r;function n(o,i,{dataProp:a,dataPropType:c,data:u,dataTypes:m,propertyName:y}){if(u!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:f}=i;if(a!==void 0){const{errorPath:w,dataPathArr:S,opts:p}=i,_=f.let("data",(0,e._)`${i.data}${(0,e.getProperty)(a)}`,!0);h(_),o.errorPath=(0,e.str)`${w}${(0,t.getErrorPath)(a,c,p.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${a}`,o.dataPathArr=[...S,o.parentDataProperty]}if(u!==void 0){const w=u instanceof e.Name?u:f.let("data",u,!0);h(w),y!==void 0&&(o.propertyName=y)}m&&(o.dataTypes=m);function h(w){o.data=w,o.dataLevel=i.dataLevel+1,o.dataTypes=[],i.definedProperties=new Set,o.parentData=i.data,o.dataNames=[...i.dataNames,w]}}nt.extendSubschemaData=n;function s(o,{jtdDiscriminator:i,jtdMetadata:a,compositeRule:c,createErrors:u,allErrors:m}){c!==void 0&&(o.compositeRule=c),u!==void 0&&(o.createErrors=u),m!==void 0&&(o.allErrors=m),o.jtdDiscriminator=i,o.jtdMetadata=a}return nt.extendSubschemaMode=s,nt}var Ce={},es,ai;function ci(){return ai||(ai=1,es=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 n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))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(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),es}var ts={exports:{}},ui;function bm(){if(ui)return ts.exports;ui=1;var e=ts.exports=function(n,s,o){typeof s=="function"&&(o=s,s={}),o=s.cb||o;var i=typeof o=="function"?o:o.pre||function(){},a=o.post||function(){};t(s,i,a,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(n,s,o,i,a,c,u,m,y,f){if(i&&typeof i=="object"&&!Array.isArray(i)){s(i,a,c,u,m,y,f);for(var h in i){var w=i[h];if(Array.isArray(w)){if(h in e.arrayKeywords)for(var S=0;S<w.length;S++)t(n,s,o,w[S],a+"/"+h+"/"+S,c,a,h,i,S)}else if(h in e.propsKeywords){if(w&&typeof w=="object")for(var p in w)t(n,s,o,w[p],a+"/"+h+"/"+r(p),c,a,h,i,p)}else(h in e.keywords||n.allKeys&&!(h in e.skipKeywords))&&t(n,s,o,w,a+"/"+h,c,a,h,i)}o(i,a,c,u,m,y,f)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return ts.exports}var di;function pr(){if(di)return Ce;di=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.getSchemaRefs=Ce.resolveUrl=Ce.normalizeId=Ce._getFullPath=Ce.getFullPath=Ce.inlineRef=void 0;const e=ce(),t=ci(),r=bm(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(S,p=!0){return typeof S=="boolean"?!0:p===!0?!i(S):p?a(S)<=p:!1}Ce.inlineRef=s;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(S){for(const p in S){if(o.has(p))return!0;const _=S[p];if(Array.isArray(_)&&_.some(i)||typeof _=="object"&&i(_))return!0}return!1}function a(S){let p=0;for(const _ in S){if(_==="$ref")return 1/0;if(p++,!n.has(_)&&(typeof S[_]=="object"&&(0,e.eachItem)(S[_],l=>p+=a(l)),p===1/0))return 1/0}return p}function c(S,p="",_){_!==!1&&(p=y(p));const l=S.parse(p);return u(S,l)}Ce.getFullPath=c;function u(S,p){return S.serialize(p).split("#")[0]+"#"}Ce._getFullPath=u;const m=/#\/?$/;function y(S){return S?S.replace(m,""):""}Ce.normalizeId=y;function f(S,p,_){return _=y(_),S.resolve(p,_)}Ce.resolveUrl=f;const h=/^[a-z_][-a-z0-9._]*$/i;function w(S,p){if(typeof S=="boolean")return{};const{schemaId:_,uriResolver:l}=this.opts,v=y(S[_]||p),g={"":v},d=c(l,v,!1),$={},E=new Set;return r(S,{allKeys:!0},(L,V,D,Z)=>{if(Z===void 0)return;const K=d+V;let re=g[Z];typeof L[_]=="string"&&(re=ye.call(this,L[_])),me.call(this,L.$anchor),me.call(this,L.$dynamicAnchor),g[V]=re;function ye(ue){const Oe=this.opts.uriResolver.resolve;if(ue=y(re?Oe(re,ue):ue),E.has(ue))throw F(ue);E.add(ue);let U=this.refs[ue];return typeof U=="string"&&(U=this.refs[U]),typeof U=="object"?R(L,U.schema,ue):ue!==y(K)&&(ue[0]==="#"?(R(L,$[ue],ue),$[ue]=L):this.refs[ue]=K),ue}function me(ue){if(typeof ue=="string"){if(!h.test(ue))throw new Error(`invalid anchor "${ue}"`);ye.call(this,`#${ue}`)}}}),$;function R(L,V,D){if(V!==void 0&&!t(L,V))throw F(D)}function F(L){return new Error(`reference "${L}" resolves to more than one schema`)}}return Ce.getSchemaRefs=w,Ce}var li;function jt(){if(li)return tt;li=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.getData=tt.KeywordCxt=tt.validateFunctionCode=void 0;const e=vm(),t=hr(),r=ti(),n=hr(),s=gm(),o=_m(),i=$m(),a=ne(),c=Ge(),u=pr(),m=ce(),y=mr();function f(j){if(d(j)&&(E(j),g(j))){p(j);return}h(j,()=>(0,e.topBoolOrEmptySchema)(j))}tt.validateFunctionCode=f;function h({gen:j,validateName:z,schema:q,schemaEnv:H,opts:X},oe){X.code.es5?j.func(z,(0,a._)`${c.default.data}, ${c.default.valCxt}`,H.$async,()=>{j.code((0,a._)`"use strict"; ${l(q,X)}`),S(j,X),j.code(oe)}):j.func(z,(0,a._)`${c.default.data}, ${w(X)}`,H.$async,()=>j.code(l(q,X)).code(oe))}function w(j){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${j.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function S(j,z){j.if(c.default.valCxt,()=>{j.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),j.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),j.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),j.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),z.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{j.var(c.default.instancePath,(0,a._)`""`),j.var(c.default.parentData,(0,a._)`undefined`),j.var(c.default.parentDataProperty,(0,a._)`undefined`),j.var(c.default.rootData,c.default.data),z.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function p(j){const{schema:z,opts:q,gen:H}=j;h(j,()=>{q.$comment&&z.$comment&&Z(j),L(j),H.let(c.default.vErrors,null),H.let(c.default.errors,0),q.unevaluated&&_(j),R(j),K(j)})}function _(j){const{gen:z,validateName:q}=j;j.evaluated=z.const("evaluated",(0,a._)`${q}.evaluated`),z.if((0,a._)`${j.evaluated}.dynamicProps`,()=>z.assign((0,a._)`${j.evaluated}.props`,(0,a._)`undefined`)),z.if((0,a._)`${j.evaluated}.dynamicItems`,()=>z.assign((0,a._)`${j.evaluated}.items`,(0,a._)`undefined`))}function l(j,z){const q=typeof j=="object"&&j[z.schemaId];return q&&(z.code.source||z.code.process)?(0,a._)`/*# sourceURL=${q} */`:a.nil}function v(j,z){if(d(j)&&(E(j),g(j))){$(j,z);return}(0,e.boolOrEmptySchema)(j,z)}function g({schema:j,self:z}){if(typeof j=="boolean")return!j;for(const q in j)if(z.RULES.all[q])return!0;return!1}function d(j){return typeof j.schema!="boolean"}function $(j,z){const{schema:q,gen:H,opts:X}=j;X.$comment&&q.$comment&&Z(j),V(j),D(j);const oe=H.const("_errs",c.default.errors);R(j,oe),H.var(z,(0,a._)`${oe} === ${c.default.errors}`)}function E(j){(0,m.checkUnknownRules)(j),F(j)}function R(j,z){if(j.opts.jtd)return ye(j,[],!1,z);const q=(0,t.getSchemaTypes)(j.schema),H=(0,t.coerceAndCheckDataType)(j,q);ye(j,q,!H,z)}function F(j){const{schema:z,errSchemaPath:q,opts:H,self:X}=j;z.$ref&&H.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(z,X.RULES)&&X.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function L(j){const{schema:z,opts:q}=j;z.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,m.checkStrictMode)(j,"default is ignored in the schema root")}function V(j){const z=j.schema[j.opts.schemaId];z&&(j.baseId=(0,u.resolveUrl)(j.opts.uriResolver,j.baseId,z))}function D(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function Z({gen:j,schemaEnv:z,schema:q,errSchemaPath:H,opts:X}){const oe=q.$comment;if(X.$comment===!0)j.code((0,a._)`${c.default.self}.logger.log(${oe})`);else if(typeof X.$comment=="function"){const je=(0,a.str)`${H}/$comment`,Le=j.scopeValue("root",{ref:z.root});j.code((0,a._)`${c.default.self}.opts.$comment(${oe}, ${je}, ${Le}.schema)`)}}function K(j){const{gen:z,schemaEnv:q,validateName:H,ValidationError:X,opts:oe}=j;q.$async?z.if((0,a._)`${c.default.errors} === 0`,()=>z.return(c.default.data),()=>z.throw((0,a._)`new ${X}(${c.default.vErrors})`)):(z.assign((0,a._)`${H}.errors`,c.default.vErrors),oe.unevaluated&&re(j),z.return((0,a._)`${c.default.errors} === 0`))}function re({gen:j,evaluated:z,props:q,items:H}){q instanceof a.Name&&j.assign((0,a._)`${z}.props`,q),H instanceof a.Name&&j.assign((0,a._)`${z}.items`,H)}function ye(j,z,q,H){const{gen:X,schema:oe,data:je,allErrors:Le,opts:Me,self:Ne}=j,{RULES:k}=Ne;if(oe.$ref&&(Me.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(oe,k))){X.block(()=>B(j,"$ref",k.all.$ref.definition));return}Me.jtd||ue(j,z),X.block(()=>{for(const T of k.rules)N(T);N(k.post)});function N(T){(0,r.shouldUseGroup)(oe,T)&&(T.type?(X.if((0,n.checkDataType)(T.type,je,Me.strictNumbers)),me(j,T),z.length===1&&z[0]===T.type&&q&&(X.else(),(0,n.reportTypeError)(j)),X.endIf()):me(j,T),Le||X.if((0,a._)`${c.default.errors} === ${H||0}`))}}function me(j,z){const{gen:q,schema:H,opts:{useDefaults:X}}=j;X&&(0,s.assignDefaults)(j,z.type),q.block(()=>{for(const oe of z.rules)(0,r.shouldUseRule)(H,oe)&&B(j,oe.keyword,oe.definition,z.type)})}function ue(j,z){j.schemaEnv.meta||!j.opts.strictTypes||(Oe(j,z),j.opts.allowUnionTypes||U(j,z),O(j,j.dataTypes))}function Oe(j,z){if(z.length){if(!j.dataTypes.length){j.dataTypes=z;return}z.forEach(q=>{A(j.dataTypes,q)||P(j,`type "${q}" not allowed by context "${j.dataTypes.join(",")}"`)}),b(j,z)}}function U(j,z){z.length>1&&!(z.length===2&&z.includes("null"))&&P(j,"use allowUnionTypes to allow union type keyword")}function O(j,z){const q=j.self.RULES.all;for(const H in q){const X=q[H];if(typeof X=="object"&&(0,r.shouldUseRule)(j.schema,X)){const{type:oe}=X.definition;oe.length&&!oe.some(je=>C(z,je))&&P(j,`missing type "${oe.join(",")}" for keyword "${H}"`)}}}function C(j,z){return j.includes(z)||z==="number"&&j.includes("integer")}function A(j,z){return j.includes(z)||z==="integer"&&j.includes("number")}function b(j,z){const q=[];for(const H of j.dataTypes)A(z,H)?q.push(H):z.includes("integer")&&H==="number"&&q.push("integer");j.dataTypes=q}function P(j,z){const q=j.schemaEnv.baseId+j.errSchemaPath;z+=` at "${q}" (strictTypes)`,(0,m.checkStrictMode)(j,z,j.opts.strictTypes)}class I{constructor(z,q,H){if((0,o.validateKeywordUsage)(z,q,H),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=H,this.data=z.data,this.schema=z.schema[H],this.$data=q.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(z,this.schema,H,this.$data),this.schemaType=q.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=q,this.$data)this.schemaCode=z.gen.const("vSchema",se(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${H} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=z.gen.const("_errs",c.default.errors))}result(z,q,H){this.failResult((0,a.not)(z),q,H)}failResult(z,q,H){this.gen.if(z),H?H():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,q){this.failResult((0,a.not)(z),void 0,q)}fail(z){if(z===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);const{schemaCode:q}=this;this.fail((0,a._)`${q} !== undefined && (${(0,a.or)(this.invalid$data(),z)})`)}error(z,q,H){if(q){this.setParams(q),this._error(z,H),this.setParams({});return}this._error(z,H)}_error(z,q){(z?y.reportExtraError:y.reportError)(this,this.def.error,q)}$dataError(){(0,y.reportError)(this,this.def.$dataError||y.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,y.resetErrorsCount)(this.gen,this.errsCount)}ok(z){this.allErrors||this.gen.if(z)}setParams(z,q){q?Object.assign(this.params,z):this.params=z}block$data(z,q,H=a.nil){this.gen.block(()=>{this.check$data(z,H),q()})}check$data(z=a.nil,q=a.nil){if(!this.$data)return;const{gen:H,schemaCode:X,schemaType:oe,def:je}=this;H.if((0,a.or)((0,a._)`${X} === undefined`,q)),z!==a.nil&&H.assign(z,!0),(oe.length||je.validateSchema)&&(H.elseIf(this.invalid$data()),this.$dataError(),z!==a.nil&&H.assign(z,!1)),H.else()}invalid$data(){const{gen:z,schemaCode:q,schemaType:H,def:X,it:oe}=this;return(0,a.or)(je(),Le());function je(){if(H.length){if(!(q instanceof a.Name))throw new Error("ajv implementation error");const Me=Array.isArray(H)?H:[H];return(0,a._)`${(0,n.checkDataTypes)(Me,q,oe.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function Le(){if(X.validateSchema){const Me=z.scopeValue("validate$data",{ref:X.validateSchema});return(0,a._)`!${Me}(${q})`}return a.nil}}subschema(z,q){const H=(0,i.getSubschema)(this.it,z);(0,i.extendSubschemaData)(H,this.it,z),(0,i.extendSubschemaMode)(H,z);const X={...this.it,...H,items:void 0,props:void 0};return v(X,q),X}mergeEvaluated(z,q){const{it:H,gen:X}=this;H.opts.unevaluated&&(H.props!==!0&&z.props!==void 0&&(H.props=m.mergeEvaluated.props(X,z.props,H.props,q)),H.items!==!0&&z.items!==void 0&&(H.items=m.mergeEvaluated.items(X,z.items,H.items,q)))}mergeValidEvaluated(z,q){const{it:H,gen:X}=this;if(H.opts.unevaluated&&(H.props!==!0||H.items!==!0))return X.if(q,()=>this.mergeEvaluated(z,a.Name)),!0}}tt.KeywordCxt=I;function B(j,z,q,H){const X=new I(j,q,z);"code"in q?q.code(X,H):X.$data&&q.validate?(0,o.funcKeywordCode)(X,q):"macro"in q?(0,o.macroKeywordCode)(X,q):(q.compile||q.validate)&&(0,o.funcKeywordCode)(X,q)}const G=/^\/(?:[^~]|~0|~1)*$/,ae=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function se(j,{dataLevel:z,dataNames:q,dataPathArr:H}){let X,oe;if(j==="")return c.default.rootData;if(j[0]==="/"){if(!G.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);X=j,oe=c.default.rootData}else{const Ne=ae.exec(j);if(!Ne)throw new Error(`Invalid JSON-pointer: ${j}`);const k=+Ne[1];if(X=Ne[2],X==="#"){if(k>=z)throw new Error(Me("property/index",k));return H[z-k]}if(k>z)throw new Error(Me("data",k));if(oe=q[z-k],!X)return oe}let je=oe;const Le=X.split("/");for(const Ne of Le)Ne&&(oe=(0,a._)`${oe}${(0,a.getProperty)((0,m.unescapeJsonPointer)(Ne))}`,je=(0,a._)`${je} && ${oe}`);return je;function Me(Ne,k){return`Cannot access ${Ne} ${k} levels up, current level is ${z}`}}return tt.getData=se,tt}var yr={},fi;function qt(){if(fi)return yr;fi=1,Object.defineProperty(yr,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return yr.default=e,yr}var vr={},mi;function At(){if(mi)return vr;mi=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=pr();class t extends Error{constructor(n,s,o,i){super(i||`can't resolve reference ${o} from id ${s}`),this.missingRef=(0,e.resolveUrl)(n,s,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return vr.default=t,vr}var xe={},hi;function gr(){if(hi)return xe;hi=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.resolveSchema=xe.getCompilingSchema=xe.resolveRef=xe.compileSchema=xe.SchemaEnv=void 0;const e=ne(),t=qt(),r=Ge(),n=pr(),s=ce(),o=jt();class i{constructor(_){var l;this.refs={},this.dynamicAnchors={};let v;typeof _.schema=="object"&&(v=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(l=_.baseId)!==null&&l!==void 0?l:(0,n.normalizeId)(v?.[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=v?.$async,this.refs={}}}xe.SchemaEnv=i;function a(p){const _=m.call(this,p);if(_)return _;const l=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),{es5:v,lines:g}=this.opts.code,{ownProperties:d}=this.opts,$=new e.CodeGen(this.scope,{es5:v,lines:g,ownProperties:d});let E;p.$async&&(E=$.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=$.scopeName("validate");p.validateName=R;const F={gen:$,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:R,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:l,baseId:p.baseId||l,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let L;try{this._compilations.add(p),(0,o.validateFunctionCode)(F),$.optimize(this.opts.code.optimize);const V=$.toString();L=`${$.scopeRefs(r.default.scope)}return ${V}`,this.opts.code.process&&(L=this.opts.code.process(L,p));const Z=new Function(`${r.default.self}`,`${r.default.scope}`,L)(this,this.scope.get());if(this.scope.value(R,{ref:Z}),Z.errors=null,Z.schema=p.schema,Z.schemaEnv=p,p.$async&&(Z.$async=!0),this.opts.code.source===!0&&(Z.source={validateName:R,validateCode:V,scopeValues:$._values}),this.opts.unevaluated){const{props:K,items:re}=F;Z.evaluated={props:K instanceof e.Name?void 0:K,items:re instanceof e.Name?void 0:re,dynamicProps:K instanceof e.Name,dynamicItems:re instanceof e.Name},Z.source&&(Z.source.evaluated=(0,e.stringify)(Z.evaluated))}return p.validate=Z,p}catch(V){throw delete p.validate,delete p.validateName,L&&this.logger.error("Error compiling schema, function code:",L),V}finally{this._compilations.delete(p)}}xe.compileSchema=a;function c(p,_,l){var v;l=(0,n.resolveUrl)(this.opts.uriResolver,_,l);const g=p.refs[l];if(g)return g;let d=f.call(this,p,l);if(d===void 0){const $=(v=p.localRefs)===null||v===void 0?void 0:v[l],{schemaId:E}=this.opts;$&&(d=new i({schema:$,schemaId:E,root:p,baseId:_}))}if(d!==void 0)return p.refs[l]=u.call(this,d)}xe.resolveRef=c;function u(p){return(0,n.inlineRef)(p.schema,this.opts.inlineRefs)?p.schema:p.validate?p:a.call(this,p)}function m(p){for(const _ of this._compilations)if(y(_,p))return _}xe.getCompilingSchema=m;function y(p,_){return p.schema===_.schema&&p.root===_.root&&p.baseId===_.baseId}function f(p,_){let l;for(;typeof(l=this.refs[_])=="string";)_=l;return l||this.schemas[_]||h.call(this,p,_)}function h(p,_){const l=this.opts.uriResolver.parse(_),v=(0,n._getFullPath)(this.opts.uriResolver,l);let g=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&v===g)return S.call(this,l,p);const d=(0,n.normalizeId)(v),$=this.refs[d]||this.schemas[d];if(typeof $=="string"){const E=h.call(this,p,$);return typeof E?.schema!="object"?void 0:S.call(this,l,E)}if(typeof $?.schema=="object"){if($.validate||a.call(this,$),d===(0,n.normalizeId)(_)){const{schema:E}=$,{schemaId:R}=this.opts,F=E[R];return F&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,F)),new i({schema:E,schemaId:R,root:p,baseId:g})}return S.call(this,l,$)}}xe.resolveSchema=h;const w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function S(p,{baseId:_,schema:l,root:v}){var g;if(((g=p.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const E of p.fragment.slice(1).split("/")){if(typeof l=="boolean")return;const R=l[(0,s.unescapeFragment)(E)];if(R===void 0)return;l=R;const F=typeof l=="object"&&l[this.opts.schemaId];!w.has(E)&&F&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,F))}let d;if(typeof l!="boolean"&&l.$ref&&!(0,s.schemaHasRulesButRef)(l,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,_,l.$ref);d=h.call(this,v,E)}const{schemaId:$}=this.opts;if(d=d||new i({schema:l,schemaId:$,root:v,baseId:_}),d.schema!==d.root.schema)return d}return xe}const wm={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var _r={},Ft={exports:{}},rs,pi;function yi(){if(pi)return rs;pi=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=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);function r(f){let h="",w=0,S=0;for(S=0;S<f.length;S++)if(w=f[S].charCodeAt(0),w!==48){if(!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=f[S];break}for(S+=1;S<f.length;S++){if(w=f[S].charCodeAt(0),!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=f[S]}return h}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(f){return f.length=0,!0}function o(f,h,w){if(f.length){const S=r(f);if(S!=="")h.push(S);else return w.error=!0,!1;f.length=0}return!0}function i(f){let h=0;const w={error:!1,address:"",zone:""},S=[],p=[];let _=!1,l=!1,v=o;for(let g=0;g<f.length;g++){const d=f[g];if(!(d==="["||d==="]"))if(d===":"){if(_===!0&&(l=!0),!v(p,S,w))break;if(++h>7){w.error=!0;break}g>0&&f[g-1]===":"&&(_=!0),S.push(":");continue}else if(d==="%"){if(!v(p,S,w))break;v=s}else{p.push(d);continue}}return p.length&&(v===s?w.zone=p.join(""):l?S.push(p.join("")):S.push(r(p))),w.address=S.join(""),w}function a(f){if(c(f,":")<2)return{host:f,isIPV6:!1};const h=i(f);if(h.error)return{host:f,isIPV6:!1};{let w=h.address,S=h.address;return h.zone&&(w+="%"+h.zone,S+="%25"+h.zone),{host:w,isIPV6:!0,escapedHost:S}}}function c(f,h){let w=0;for(let S=0;S<f.length;S++)f[S]===h&&w++;return w}function u(f){let h=f;const w=[];let S=-1,p=0;for(;p=h.length;){if(p===1){if(h===".")break;if(h==="/"){w.push("/");break}else{w.push(h);break}}else if(p===2){if(h[0]==="."){if(h[1]===".")break;if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&(h[1]==="."||h[1]==="/")){w.push("/");break}}else if(p===3&&h==="/.."){w.length!==0&&w.pop(),w.push("/");break}if(h[0]==="."){if(h[1]==="."){if(h[2]==="/"){h=h.slice(3);continue}}else if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&h[1]==="."){if(h[2]==="/"){h=h.slice(2);continue}else if(h[2]==="."&&h[3]==="/"){h=h.slice(3),w.length!==0&&w.pop();continue}}if((S=h.indexOf("/",1))===-1){w.push(h);break}else w.push(h.slice(0,S)),h=h.slice(S)}return w.join("")}function m(f,h){const w=h!==!0?escape:unescape;return f.scheme!==void 0&&(f.scheme=w(f.scheme)),f.userinfo!==void 0&&(f.userinfo=w(f.userinfo)),f.host!==void 0&&(f.host=w(f.host)),f.path!==void 0&&(f.path=w(f.path)),f.query!==void 0&&(f.query=w(f.query)),f.fragment!==void 0&&(f.fragment=w(f.fragment)),f}function y(f){const h=[];if(f.userinfo!==void 0&&(h.push(f.userinfo),h.push("@")),f.host!==void 0){let w=unescape(f.host);if(!t(w)){const S=a(w);S.isIPV6===!0?w=`[${S.escapedHost}]`:w=f.host}h.push(w)}return(typeof f.port=="number"||typeof f.port=="string")&&(h.push(":"),h.push(String(f.port))),h.length?h.join(""):void 0}return rs={nonSimpleDomain:n,recomposeAuthority:y,normalizeComponentEncoding:m,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:r},rs}var ns,vi;function Sm(){if(vi)return ns;vi=1;const{isUUID:e}=yi(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(d){return r.indexOf(d)!==-1}function s(d){return d.secure===!0?!0:d.secure===!1?!1:d.scheme?d.scheme.length===3&&(d.scheme[0]==="w"||d.scheme[0]==="W")&&(d.scheme[1]==="s"||d.scheme[1]==="S")&&(d.scheme[2]==="s"||d.scheme[2]==="S"):!1}function o(d){return d.host||(d.error=d.error||"HTTP URIs must have a host."),d}function i(d){const $=String(d.scheme).toLowerCase()==="https";return(d.port===($?443:80)||d.port==="")&&(d.port=void 0),d.path||(d.path="/"),d}function a(d){return d.secure=s(d),d.resourceName=(d.path||"/")+(d.query?"?"+d.query:""),d.path=void 0,d.query=void 0,d}function c(d){if((d.port===(s(d)?443:80)||d.port==="")&&(d.port=void 0),typeof d.secure=="boolean"&&(d.scheme=d.secure?"wss":"ws",d.secure=void 0),d.resourceName){const[$,E]=d.resourceName.split("?");d.path=$&&$!=="/"?$:void 0,d.query=E,d.resourceName=void 0}return d.fragment=void 0,d}function u(d,$){if(!d.path)return d.error="URN can not be parsed",d;const E=d.path.match(t);if(E){const R=$.scheme||d.scheme||"urn";d.nid=E[1].toLowerCase(),d.nss=E[2];const F=`${R}:${$.nid||d.nid}`,L=g(F);d.path=void 0,L&&(d=L.parse(d,$))}else d.error=d.error||"URN can not be parsed.";return d}function m(d,$){if(d.nid===void 0)throw new Error("URN without nid cannot be serialized");const E=$.scheme||d.scheme||"urn",R=d.nid.toLowerCase(),F=`${E}:${$.nid||R}`,L=g(F);L&&(d=L.serialize(d,$));const V=d,D=d.nss;return V.path=`${R||$.nid}:${D}`,$.skipEscape=!0,V}function y(d,$){const E=d;return E.uuid=E.nss,E.nss=void 0,!$.tolerant&&(!E.uuid||!e(E.uuid))&&(E.error=E.error||"UUID is not valid."),E}function f(d){const $=d;return $.nss=(d.uuid||"").toLowerCase(),$}const h={scheme:"http",domainHost:!0,parse:o,serialize:i},w={scheme:"https",domainHost:h.domainHost,parse:o,serialize:i},S={scheme:"ws",domainHost:!0,parse:a,serialize:c},p={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},v={http:h,https:w,ws:S,wss:p,urn:{scheme:"urn",parse:u,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:y,serialize:f,skipNormalize:!0}};Object.setPrototypeOf(v,null);function g(d){return d&&(v[d]||v[d.toLowerCase()])||void 0}return ns={wsIsSecure:s,SCHEMES:v,isValidSchemeName:n,getSchemeHandler:g},ns}var gi;function Em(){if(gi)return Ft.exports;gi=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:s,nonSimpleDomain:o}=yi(),{SCHEMES:i,getSchemeHandler:a}=Sm();function c(p,_){return typeof p=="string"?p=f(w(p,_),_):typeof p=="object"&&(p=w(f(p,_),_)),p}function u(p,_,l){const v=l?Object.assign({scheme:"null"},l):{scheme:"null"},g=m(w(p,v),w(_,v),v,!0);return v.skipEscape=!0,f(g,v)}function m(p,_,l,v){const g={};return v||(p=w(f(p,l),l),_=w(f(_,l),l)),l=l||{},!l.tolerant&&_.scheme?(g.scheme=_.scheme,g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.path?(_.path[0]==="/"?g.path=t(_.path):((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?g.path="/"+_.path:p.path?g.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+_.path:g.path=_.path,g.path=t(g.path)),g.query=_.query):(g.path=p.path,_.query!==void 0?g.query=_.query:g.query=p.query),g.userinfo=p.userinfo,g.host=p.host,g.port=p.port),g.scheme=p.scheme),g.fragment=_.fragment,g}function y(p,_,l){return typeof p=="string"?(p=unescape(p),p=f(n(w(p,l),!0),{...l,skipEscape:!0})):typeof p=="object"&&(p=f(n(p,!0),{...l,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=f(n(w(_,l),!0),{...l,skipEscape:!0})):typeof _=="object"&&(_=f(n(_,!0),{...l,skipEscape:!0})),p.toLowerCase()===_.toLowerCase()}function f(p,_){const l={host:p.host,scheme:p.scheme,userinfo:p.userinfo,port:p.port,path:p.path,query:p.query,nid:p.nid,nss:p.nss,uuid:p.uuid,fragment:p.fragment,reference:p.reference,resourceName:p.resourceName,secure:p.secure,error:""},v=Object.assign({},_),g=[],d=a(v.scheme||l.scheme);d&&d.serialize&&d.serialize(l,v),l.path!==void 0&&(v.skipEscape?l.path=unescape(l.path):(l.path=escape(l.path),l.scheme!==void 0&&(l.path=l.path.split("%3A").join(":")))),v.reference!=="suffix"&&l.scheme&&g.push(l.scheme,":");const $=r(l);if($!==void 0&&(v.reference!=="suffix"&&g.push("//"),g.push($),l.path&&l.path[0]!=="/"&&g.push("/")),l.path!==void 0){let E=l.path;!v.absolutePath&&(!d||!d.absolutePath)&&(E=t(E)),$===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),g.push(E)}return l.query!==void 0&&g.push("?",l.query),l.fragment!==void 0&&g.push("#",l.fragment),g.join("")}const h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(p,_){const l=Object.assign({},_),v={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let g=!1;l.reference==="suffix"&&(l.scheme?p=l.scheme+":"+p:p="//"+p);const d=p.match(h);if(d){if(v.scheme=d[1],v.userinfo=d[3],v.host=d[4],v.port=parseInt(d[5],10),v.path=d[6]||"",v.query=d[7],v.fragment=d[8],isNaN(v.port)&&(v.port=d[5]),v.host)if(s(v.host)===!1){const R=e(v.host);v.host=R.host.toLowerCase(),g=R.isIPV6}else g=!0;v.scheme===void 0&&v.userinfo===void 0&&v.host===void 0&&v.port===void 0&&v.query===void 0&&!v.path?v.reference="same-document":v.scheme===void 0?v.reference="relative":v.fragment===void 0?v.reference="absolute":v.reference="uri",l.reference&&l.reference!=="suffix"&&l.reference!==v.reference&&(v.error=v.error||"URI is not a "+l.reference+" reference.");const $=a(l.scheme||v.scheme);if(!l.unicodeSupport&&(!$||!$.unicodeSupport)&&v.host&&(l.domainHost||$&&$.domainHost)&&g===!1&&o(v.host))try{v.host=URL.domainToASCII(v.host.toLowerCase())}catch(E){v.error=v.error||"Host's domain name can not be converted to ASCII: "+E}(!$||$&&!$.skipNormalize)&&(p.indexOf("%")!==-1&&(v.scheme!==void 0&&(v.scheme=unescape(v.scheme)),v.host!==void 0&&(v.host=unescape(v.host))),v.path&&(v.path=escape(unescape(v.path))),v.fragment&&(v.fragment=encodeURI(decodeURIComponent(v.fragment)))),$&&$.parse&&$.parse(v,l)}else v.error=v.error||"URI can not be parsed.";return v}const S={SCHEMES:i,normalize:c,resolve:u,resolveComponent:m,equal:y,serialize:f,parse:w};return Ft.exports=S,Ft.exports.default=S,Ft.exports.fastUri=S,Ft.exports}var _i;function km(){if(_i)return _r;_i=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=Em();return e.code='require("ajv/dist/runtime/uri").default',_r.default=e,_r}var $i;function ss(){return $i||($i=1,(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=jt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ne();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 n=qt(),s=At(),o=Qo(),i=gr(),a=ne(),c=pr(),u=hr(),m=ce(),y=wm,f=km(),h=(U,O)=>new RegExp(U,O);h.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),p={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},l=200;function v(U){var O,C,A,b,P,I,B,G,ae,se,j,z,q,H,X,oe,je,Le,Me,Ne,k,N,T,W,J;const x=U.strict,Q=(O=U.code)===null||O===void 0?void 0:O.optimize,le=Q===!0||Q===void 0?1:Q||0,fe=(A=(C=U.code)===null||C===void 0?void 0:C.regExp)!==null&&A!==void 0?A:h,ze=(b=U.uriResolver)!==null&&b!==void 0?b:f.default;return{strictSchema:(I=(P=U.strictSchema)!==null&&P!==void 0?P:x)!==null&&I!==void 0?I:!0,strictNumbers:(G=(B=U.strictNumbers)!==null&&B!==void 0?B:x)!==null&&G!==void 0?G:!0,strictTypes:(se=(ae=U.strictTypes)!==null&&ae!==void 0?ae:x)!==null&&se!==void 0?se:"log",strictTuples:(z=(j=U.strictTuples)!==null&&j!==void 0?j:x)!==null&&z!==void 0?z:"log",strictRequired:(H=(q=U.strictRequired)!==null&&q!==void 0?q:x)!==null&&H!==void 0?H:!1,code:U.code?{...U.code,optimize:le,regExp:fe}:{optimize:le,regExp:fe},loopRequired:(X=U.loopRequired)!==null&&X!==void 0?X:l,loopEnum:(oe=U.loopEnum)!==null&&oe!==void 0?oe:l,meta:(je=U.meta)!==null&&je!==void 0?je:!0,messages:(Le=U.messages)!==null&&Le!==void 0?Le:!0,inlineRefs:(Me=U.inlineRefs)!==null&&Me!==void 0?Me:!0,schemaId:(Ne=U.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(k=U.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(N=U.validateSchema)!==null&&N!==void 0?N:!0,validateFormats:(T=U.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(W=U.unicodeRegExp)!==null&&W!==void 0?W:!0,int32range:(J=U.int32range)!==null&&J!==void 0?J:!0,uriResolver:ze}}class g{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...v(O)};const{es5:C,lines:A}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:S,es5:C,lines:A}),this.logger=D(O.logger);const b=O.validateFormats;O.validateFormats=!1,this.RULES=(0,o.getRules)(),d.call(this,p,O,"NOT SUPPORTED"),d.call(this,_,O,"DEPRECATED","warn"),this._metaOpts=L.call(this),O.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&F.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),E.call(this),O.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:O,meta:C,schemaId:A}=this.opts;let b=y;A==="id"&&(b={...y},b.id=b.$id,delete b.$id),C&&O&&this.addMetaSchema(b,b[A],!1)}defaultMeta(){const{meta:O,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[C]||O:void 0}validate(O,C){let A;if(typeof O=="string"){if(A=this.getSchema(O),!A)throw new Error(`no schema with key or ref "${O}"`)}else A=this.compile(O);const b=A(C);return"$async"in A||(this.errors=A.errors),b}compile(O,C){const A=this._addSchema(O,C);return A.validate||this._compileSchemaEnv(A)}compileAsync(O,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:A}=this.opts;return b.call(this,O,C);async function b(se,j){await P.call(this,se.$schema);const z=this._addSchema(se,j);return z.validate||I.call(this,z)}async function P(se){se&&!this.getSchema(se)&&await b.call(this,{$ref:se},!0)}async function I(se){try{return this._compileSchemaEnv(se)}catch(j){if(!(j instanceof s.default))throw j;return B.call(this,j),await G.call(this,j.missingSchema),I.call(this,se)}}function B({missingSchema:se,missingRef:j}){if(this.refs[se])throw new Error(`AnySchema ${se} is loaded but ${j} cannot be resolved`)}async function G(se){const j=await ae.call(this,se);this.refs[se]||await P.call(this,j.$schema),this.refs[se]||this.addSchema(j,se,C)}async function ae(se){const j=this._loading[se];if(j)return j;try{return await(this._loading[se]=A(se))}finally{delete this._loading[se]}}}addSchema(O,C,A,b=this.opts.validateSchema){if(Array.isArray(O)){for(const I of O)this.addSchema(I,void 0,A,b);return this}let P;if(typeof O=="object"){const{schemaId:I}=this.opts;if(P=O[I],P!==void 0&&typeof P!="string")throw new Error(`schema ${I} must be string`)}return C=(0,c.normalizeId)(C||P),this._checkUnique(C),this.schemas[C]=this._addSchema(O,A,C,b,!0),this}addMetaSchema(O,C,A=this.opts.validateSchema){return this.addSchema(O,C,!0,A),this}validateSchema(O,C){if(typeof O=="boolean")return!0;let A;if(A=O.$schema,A!==void 0&&typeof A!="string")throw new Error("$schema must be a string");if(A=A||this.opts.defaultMeta||this.defaultMeta(),!A)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const b=this.validate(A,O);if(!b&&C){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return b}getSchema(O){let C;for(;typeof(C=$.call(this,O))=="string";)O=C;if(C===void 0){const{schemaId:A}=this.opts,b=new i.SchemaEnv({schema:{},schemaId:A});if(C=i.resolveSchema.call(this,b,O),!C)return;this.refs[O]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=$.call(this,O);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{const C=O;this._cache.delete(C);let A=O[this.opts.schemaId];return A&&(A=(0,c.normalizeId)(A),delete this.schemas[A],delete this.refs[A]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(const C of O)this.addKeyword(C);return this}addKeyword(O,C){let A;if(typeof O=="string")A=O,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=A);else if(typeof O=="object"&&C===void 0){if(C=O,A=C.keyword,Array.isArray(A)&&!A.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(K.call(this,A,C),!C)return(0,m.eachItem)(A,P=>re.call(this,P)),this;me.call(this,C);const b={...C,type:(0,u.getJSONTypes)(C.type),schemaType:(0,u.getJSONTypes)(C.schemaType)};return(0,m.eachItem)(A,b.type.length===0?P=>re.call(this,P,b):P=>b.type.forEach(I=>re.call(this,P,b,I))),this}getKeyword(O){const C=this.RULES.all[O];return typeof C=="object"?C.definition:!!C}removeKeyword(O){const{RULES:C}=this;delete C.keywords[O],delete C.all[O];for(const A of C.rules){const b=A.rules.findIndex(P=>P.keyword===O);b>=0&&A.rules.splice(b,1)}return this}addFormat(O,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[O]=C,this}errorsText(O=this.errors,{separator:C=", ",dataVar:A="data"}={}){return!O||O.length===0?"No errors":O.map(b=>`${A}${b.instancePath} ${b.message}`).reduce((b,P)=>b+C+P)}$dataMetaSchema(O,C){const A=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(const b of C){const P=b.split("/").slice(1);let I=O;for(const B of P)I=I[B];for(const B in A){const G=A[B];if(typeof G!="object")continue;const{$data:ae}=G.definition,se=I[B];ae&&se&&(I[B]=Oe(se))}}return O}_removeAllSchemas(O,C){for(const A in O){const b=O[A];(!C||C.test(A))&&(typeof b=="string"?delete O[A]:b&&!b.meta&&(this._cache.delete(b.schema),delete O[A]))}}_addSchema(O,C,A,b=this.opts.validateSchema,P=this.opts.addUsedSchema){let I;const{schemaId:B}=this.opts;if(typeof O=="object")I=O[B];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof O!="boolean")throw new Error("schema must be object or boolean")}let G=this._cache.get(O);if(G!==void 0)return G;A=(0,c.normalizeId)(I||A);const ae=c.getSchemaRefs.call(this,O,A);return G=new i.SchemaEnv({schema:O,schemaId:B,meta:C,baseId:A,localRefs:ae}),this._cache.set(G.schema,G),P&&!A.startsWith("#")&&(A&&this._checkUnique(A),this.refs[A]=G),b&&this.validateSchema(O,!0),G}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw new Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):i.compileSchema.call(this,O),!O.validate)throw new Error("ajv implementation error");return O.validate}_compileMetaSchema(O){const C=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,O)}finally{this.opts=C}}}g.ValidationError=n.default,g.MissingRefError=s.default,e.default=g;function d(U,O,C,A="error"){for(const b in U){const P=b;P in O&&this.logger[A](`${C}: option ${b}. ${U[P]}`)}}function $(U){return U=(0,c.normalizeId)(U),this.schemas[U]||this.refs[U]}function E(){const U=this.opts.schemas;if(U)if(Array.isArray(U))this.addSchema(U);else for(const O in U)this.addSchema(U[O],O)}function R(){for(const U in this.opts.formats){const O=this.opts.formats[U];O&&this.addFormat(U,O)}}function F(U){if(Array.isArray(U)){this.addVocabulary(U);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const O in U){const C=U[O];C.keyword||(C.keyword=O),this.addKeyword(C)}}function L(){const U={...this.opts};for(const O of w)delete U[O];return U}const V={log(){},warn(){},error(){}};function D(U){if(U===!1)return V;if(U===void 0)return console;if(U.log&&U.warn&&U.error)return U;throw new Error("logger must implement log, warn and error methods")}const Z=/^[a-z_$][a-z0-9_$:-]*$/i;function K(U,O){const{RULES:C}=this;if((0,m.eachItem)(U,A=>{if(C.keywords[A])throw new Error(`Keyword ${A} is already defined`);if(!Z.test(A))throw new Error(`Keyword ${A} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw new Error('$data keyword must have "code" or "validate" function')}function re(U,O,C){var A;const b=O?.post;if(C&&b)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let I=b?P.post:P.rules.find(({type:G})=>G===C);if(I||(I={type:C,rules:[]},P.rules.push(I)),P.keywords[U]=!0,!O)return;const B={keyword:U,definition:{...O,type:(0,u.getJSONTypes)(O.type),schemaType:(0,u.getJSONTypes)(O.schemaType)}};O.before?ye.call(this,I,B,O.before):I.rules.push(B),P.all[U]=B,(A=O.implements)===null||A===void 0||A.forEach(G=>this.addKeyword(G))}function ye(U,O,C){const A=U.rules.findIndex(b=>b.keyword===C);A>=0?U.rules.splice(A,0,O):(U.rules.push(O),this.logger.warn(`rule ${C} is not defined`))}function me(U){let{metaSchema:O}=U;O!==void 0&&(U.$data&&this.opts.$data&&(O=Oe(O)),U.validateSchema=this.compile(O,!0))}const ue={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Oe(U){return{anyOf:[U,ue]}}})(Bn)),Bn}var $r={},br={},wr={},bi;function Pm(){if(bi)return wr;bi=1,Object.defineProperty(wr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return wr.default=e,wr}var lt={},wi;function os(){if(wi)return lt;wi=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.callRef=lt.getValidate=void 0;const e=At(),t=We(),r=ne(),n=Ge(),s=gr(),o=ce(),i={keyword:"$ref",schemaType:"string",code(u){const{gen:m,schema:y,it:f}=u,{baseId:h,schemaEnv:w,validateName:S,opts:p,self:_}=f,{root:l}=w;if((y==="#"||y==="#/")&&h===l.baseId)return g();const v=s.resolveRef.call(_,l,h,y);if(v===void 0)throw new e.default(f.opts.uriResolver,h,y);if(v instanceof s.SchemaEnv)return d(v);return $(v);function g(){if(w===l)return c(u,S,w,w.$async);const E=m.scopeValue("root",{ref:l});return c(u,(0,r._)`${E}.validate`,l,l.$async)}function d(E){const R=a(u,E);c(u,R,E,E.$async)}function $(E){const R=m.scopeValue("schema",p.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),F=m.name("valid"),L=u.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:R,errSchemaPath:y},F);u.mergeEvaluated(L),u.ok(F)}}};function a(u,m){const{gen:y}=u;return m.validate?y.scopeValue("validate",{ref:m.validate}):(0,r._)`${y.scopeValue("wrapper",{ref:m})}.validate`}lt.getValidate=a;function c(u,m,y,f){const{gen:h,it:w}=u,{allErrors:S,schemaEnv:p,opts:_}=w,l=_.passContext?n.default.this:r.nil;f?v():g();function v(){if(!p.$async)throw new Error("async schema referenced by sync schema");const E=h.let("valid");h.try(()=>{h.code((0,r._)`await ${(0,t.callValidateCode)(u,m,l)}`),$(m),S||h.assign(E,!0)},R=>{h.if((0,r._)`!(${R} instanceof ${w.ValidationError})`,()=>h.throw(R)),d(R),S||h.assign(E,!1)}),u.ok(E)}function g(){u.result((0,t.callValidateCode)(u,m,l),()=>$(m),()=>d(m))}function d(E){const R=(0,r._)`${E}.errors`;h.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${R} : ${n.default.vErrors}.concat(${R})`),h.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function $(E){var R;if(!w.opts.unevaluated)return;const F=(R=y?.validate)===null||R===void 0?void 0:R.evaluated;if(w.props!==!0)if(F&&!F.dynamicProps)F.props!==void 0&&(w.props=o.mergeEvaluated.props(h,F.props,w.props));else{const L=h.var("props",(0,r._)`${E}.evaluated.props`);w.props=o.mergeEvaluated.props(h,L,w.props,r.Name)}if(w.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(w.items=o.mergeEvaluated.items(h,F.items,w.items));else{const L=h.var("items",(0,r._)`${E}.evaluated.items`);w.items=o.mergeEvaluated.items(h,L,w.items,r.Name)}}}return lt.callRef=c,lt.default=i,lt}var Si;function Ei(){if(Si)return br;Si=1,Object.defineProperty(br,"__esModule",{value:!0});const e=Pm(),t=os(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return br.default=r,br}var Sr={},Er={},ki;function Om(){if(ki)return Er;ki=1,Object.defineProperty(Er,"__esModule",{value:!0});const e=ne(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:o,schemaCode:i})=>(0,e.str)`must be ${r[o].okStr} ${i}`,params:({keyword:o,schemaCode:i})=>(0,e._)`{comparison: ${r[o].okStr}, limit: ${i}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(o){const{keyword:i,data:a,schemaCode:c}=o;o.fail$data((0,e._)`${a} ${r[i].fail} ${c} || isNaN(${a})`)}};return Er.default=s,Er}var kr={},Pi;function jm(){if(Pi)return kr;Pi=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ne(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:o,schemaCode:i,it:a}=n,c=a.opts.multipleOfPrecision,u=s.let("res"),m=c?(0,e._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,e._)`${u} !== parseInt(${u})`;n.fail$data((0,e._)`(${i} === 0 || (${u} = ${o}/${i}, ${m}))`)}};return kr.default=r,kr}var Pr={},Or={},Oi;function Am(){if(Oi)return Or;Oi=1,Object.defineProperty(Or,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,s=0,o;for(;s<r;)n++,o=t.charCodeAt(s++),o>=55296&&o<=56319&&s<r&&(o=t.charCodeAt(s),(o&64512)===56320&&s++);return n}return Or.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Or}var ji;function Nm(){if(ji)return Pr;ji=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=ne(),t=ce(),r=Am(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:i}){const a=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:i,data:a,schemaCode:c,it:u}=o,m=i==="maxLength"?e.operators.GT:e.operators.LT,y=u.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${a})`;o.fail$data((0,e._)`${y} ${m} ${c}`)}};return Pr.default=s,Pr}var jr={},Ai;function zm(){if(Ai)return jr;Ai=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=We(),t=ce(),r=ne(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,r.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,r._)`{pattern: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:y}=o,f=y.opts.unicodeRegExp?"u":"";if(c){const{regExp:h}=y.opts.code,w=h.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(i,h),S=i.let("valid");i.try(()=>i.assign(S,(0,r._)`${w}(${m}, ${f}).test(${a})`),()=>i.assign(S,!1)),o.fail$data((0,r._)`!${S}`)}else{const h=(0,e.usePattern)(o,u);o.fail$data((0,r._)`!${h}.test(${a})`)}}};return jr.default=s,jr}var Ar={},Ni;function Rm(){if(Ni)return Ar;Ni=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=ne(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${o}).length ${a} ${i}`)}};return Ar.default=r,Ar}var Nr={},zi;function Im(){if(zi)return Nr;zi=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=We(),t=ne(),r=ce(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:i,schema:a,schemaCode:c,data:u,$data:m,it:y}=o,{opts:f}=y;if(!m&&a.length===0)return;const h=a.length>=f.loopRequired;if(y.allErrors?w():S(),f.strictRequired){const l=o.parentSchema.properties,{definedProperties:v}=o.it;for(const g of a)if(l?.[g]===void 0&&!v.has(g)){const d=y.schemaEnv.baseId+y.errSchemaPath,$=`required property "${g}" is not defined at "${d}" (strictRequired)`;(0,r.checkStrictMode)(y,$,y.opts.strictRequired)}}function w(){if(h||m)o.block$data(t.nil,p);else for(const l of a)(0,e.checkReportMissingProp)(o,l)}function S(){const l=i.let("missing");if(h||m){const v=i.let("valid",!0);o.block$data(v,()=>_(l,v)),o.ok(v)}else i.if((0,e.checkMissingProp)(o,a,l)),(0,e.reportMissingProp)(o,l),i.else()}function p(){i.forOf("prop",c,l=>{o.setParams({missingProperty:l}),i.if((0,e.noPropertyInData)(i,u,l,f.ownProperties),()=>o.error())})}function _(l,v){o.setParams({missingProperty:l}),i.forOf(l,c,()=>{i.assign(v,(0,e.propertyInData)(i,u,l,f.ownProperties)),i.if((0,t.not)(v),()=>{o.error(),i.break()})},t.nil)}}};return Nr.default=s,Nr}var zr={},Ri;function Tm(){if(Ri)return zr;Ri=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=ne(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${o}.length ${a} ${i}`)}};return zr.default=r,zr}var Rr={},Ir={},Ii;function is(){if(Ii)return Ir;Ii=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=ci();return e.code='require("ajv/dist/runtime/equal").default',Ir.default=e,Ir}var Ti;function Cm(){if(Ti)return Rr;Ti=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e=hr(),t=ne(),r=ce(),n=is(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>(0,t._)`{i: ${i}, j: ${a}}`},code(i){const{gen:a,data:c,$data:u,schema:m,parentSchema:y,schemaCode:f,it:h}=i;if(!u&&!m)return;const w=a.let("valid"),S=y.items?(0,e.getSchemaTypes)(y.items):[];i.block$data(w,p,(0,t._)`${f} === false`),i.ok(w);function p(){const g=a.let("i",(0,t._)`${c}.length`),d=a.let("j");i.setParams({i:g,j:d}),a.assign(w,!0),a.if((0,t._)`${g} > 1`,()=>(_()?l:v)(g,d))}function _(){return S.length>0&&!S.some(g=>g==="object"||g==="array")}function l(g,d){const $=a.name("item"),E=(0,e.checkDataTypes)(S,$,h.opts.strictNumbers,e.DataType.Wrong),R=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${g}--;`,()=>{a.let($,(0,t._)`${c}[${g}]`),a.if(E,(0,t._)`continue`),S.length>1&&a.if((0,t._)`typeof ${$} == "string"`,(0,t._)`${$} += "_"`),a.if((0,t._)`typeof ${R}[${$}] == "number"`,()=>{a.assign(d,(0,t._)`${R}[${$}]`),i.error(),a.assign(w,!1).break()}).code((0,t._)`${R}[${$}] = ${g}`)})}function v(g,d){const $=(0,r.useFunc)(a,n.default),E=a.name("outer");a.label(E).for((0,t._)`;${g}--;`,()=>a.for((0,t._)`${d} = ${g}; ${d}--;`,()=>a.if((0,t._)`${$}(${c}[${g}], ${c}[${d}])`,()=>{i.error(),a.assign(w,!1).break(E)})))}}};return Rr.default=o,Rr}var Tr={},Ci;function Mm(){if(Ci)return Tr;Ci=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=ne(),t=ce(),r=is(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:i,data:a,$data:c,schemaCode:u,schema:m}=o;c||m&&typeof m=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(i,r.default)}(${a}, ${u})`):o.fail((0,e._)`${m} !== ${a}`)}};return Tr.default=s,Tr}var Cr={},Mi;function Dm(){if(Mi)return Cr;Mi=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=ne(),t=ce(),r=is(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:y}=o;if(!c&&u.length===0)throw new Error("enum must have non-empty array");const f=u.length>=y.opts.loopEnum;let h;const w=()=>h??(h=(0,t.useFunc)(i,r.default));let S;if(f||c)S=i.let("valid"),o.block$data(S,p);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const l=i.const("vSchema",m);S=(0,e.or)(...u.map((v,g)=>_(l,g)))}o.pass(S);function p(){i.assign(S,!1),i.forOf("v",m,l=>i.if((0,e._)`${w()}(${a}, ${l})`,()=>i.assign(S,!0).break()))}function _(l,v){const g=u[v];return typeof g=="object"&&g!==null?(0,e._)`${w()}(${a}, ${l}[${v}])`:(0,e._)`${a} === ${g}`}}};return Cr.default=s,Cr}var Di;function Vi(){if(Di)return Sr;Di=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=Om(),t=jm(),r=Nm(),n=zm(),s=Rm(),o=Im(),i=Tm(),a=Cm(),c=Mm(),u=Dm(),m=[e.default,t.default,r.default,n.default,s.default,o.default,i.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default];return Sr.default=m,Sr}var Mr={},Nt={},qi;function Fi(){if(qi)return Nt;qi=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.validateAdditionalItems=void 0;const e=ne(),t=ce(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:i,it:a}=o,{items:c}=i;if(!Array.isArray(c)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(o,c)}};function s(o,i){const{gen:a,schema:c,data:u,keyword:m,it:y}=o;y.items=!0;const f=a.const("len",(0,e._)`${u}.length`);if(c===!1)o.setParams({len:i.length}),o.pass((0,e._)`${f} <= ${i.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(y,c)){const w=a.var("valid",(0,e._)`${f} <= ${i.length}`);a.if((0,e.not)(w),()=>h(w)),o.ok(w)}function h(w){a.forRange("i",i.length,f,S=>{o.subschema({keyword:m,dataProp:S,dataPropType:t.Type.Num},w),y.allErrors||a.if((0,e.not)(w),()=>a.break())})}}return Nt.validateAdditionalItems=s,Nt.default=n,Nt}var Dr={},zt={},Zi;function Ui(){if(Zi)return zt;Zi=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.validateTuple=void 0;const e=ne(),t=ce(),r=We(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:i,it:a}=o;if(Array.isArray(i))return s(o,"additionalItems",i);a.items=!0,!(0,t.alwaysValidSchema)(a,i)&&o.ok((0,r.validateArray)(o))}};function s(o,i,a=o.schema){const{gen:c,parentSchema:u,data:m,keyword:y,it:f}=o;S(u),f.opts.unevaluated&&a.length&&f.items!==!0&&(f.items=t.mergeEvaluated.items(c,a.length,f.items));const h=c.name("valid"),w=c.const("len",(0,e._)`${m}.length`);a.forEach((p,_)=>{(0,t.alwaysValidSchema)(f,p)||(c.if((0,e._)`${w} > ${_}`,()=>o.subschema({keyword:y,schemaProp:_,dataProp:_},h)),o.ok(h))});function S(p){const{opts:_,errSchemaPath:l}=f,v=a.length,g=v===p.minItems&&(v===p.maxItems||p[i]===!1);if(_.strictTuples&&!g){const d=`"${y}" is ${v}-tuple, but minItems or maxItems/${i} are not specified or different at path "${l}"`;(0,t.checkStrictMode)(f,d,_.strictTuples)}}}return zt.validateTuple=s,zt.default=n,zt}var xi;function Vm(){if(xi)return Dr;xi=1,Object.defineProperty(Dr,"__esModule",{value:!0});const e=Ui(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Dr.default=t,Dr}var Vr={},Li;function qm(){if(Li)return Vr;Li=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=ne(),t=ce(),r=We(),n=Fi(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{schema:a,parentSchema:c,it:u}=i,{prefixItems:m}=c;u.items=!0,!(0,t.alwaysValidSchema)(u,a)&&(m?(0,n.validateAdditionalItems)(i,m):i.ok((0,r.validateArray)(i)))}};return Vr.default=o,Vr}var qr={},Ki;function Fm(){if(Ki)return qr;Ki=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:o}})=>o===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${o} valid item(s)`,params:({params:{min:s,max:o}})=>o===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${o}}`},code(s){const{gen:o,schema:i,parentSchema:a,data:c,it:u}=s;let m,y;const{minContains:f,maxContains:h}=a;u.opts.next?(m=f===void 0?1:f,y=h):m=1;const w=o.const("len",(0,e._)`${c}.length`);if(s.setParams({min:m,max:y}),y===void 0&&m===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(y!==void 0&&m>y){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(u,i)){let v=(0,e._)`${w} >= ${m}`;y!==void 0&&(v=(0,e._)`${v} && ${w} <= ${y}`),s.pass(v);return}u.items=!0;const S=o.name("valid");y===void 0&&m===1?_(S,()=>o.if(S,()=>o.break())):m===0?(o.let(S,!0),y!==void 0&&o.if((0,e._)`${c}.length > 0`,p)):(o.let(S,!1),p()),s.result(S,()=>s.reset());function p(){const v=o.name("_valid"),g=o.let("count",0);_(v,()=>o.if(v,()=>l(g)))}function _(v,g){o.forRange("i",0,w,d=>{s.subschema({keyword:"contains",dataProp:d,dataPropType:t.Type.Num,compositeRule:!0},v),g()})}function l(v){o.code((0,e._)`${v}++`),y===void 0?o.if((0,e._)`${v} >= ${m}`,()=>o.assign(S,!0).break()):(o.if((0,e._)`${v} > ${y}`,()=>o.assign(S,!1).break()),m===1?o.assign(S,!0):o.if((0,e._)`${v} >= ${m}`,()=>o.assign(S,!0)))}}};return qr.default=n,qr}var as={},Ji;function cs(){return Ji||(Ji=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ne(),r=ce(),n=We();e.error={message:({params:{property:c,depsCount:u,deps:m}})=>{const y=u===1?"property":"properties";return(0,t.str)`must have ${y} ${m} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:m,missingProperty:y}})=>(0,t._)`{property: ${c},
|
|
44
|
+
missingProperty: ${y},
|
|
45
45
|
depsCount: ${u},
|
|
46
|
-
deps: ${m}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,m]=o(c);i(c,u),a(c,m)}};function o({schema:c}){const u={},m={};for(const v in c){if(v==="__proto__")continue;const l=Array.isArray(c[v])?u:m;l[v]=c[v]}return[u,m]}function i(c,u=c.schema){const{gen:m,data:v,it:l}=c;if(Object.keys(u).length===0)return;const h=m.let("missing");for(const w in u){const S=u[w];if(S.length===0)continue;const p=(0,n.propertyInData)(m,v,w,l.opts.ownProperties);c.setParams({property:w,depsCount:S.length,deps:S.join(", ")}),l.allErrors?m.if(p,()=>{for(const _ of S)(0,n.checkReportMissingProp)(c,_)}):(m.if((0,t._)`${p} && (${(0,n.checkMissingProp)(c,S,h)})`),(0,n.reportMissingProp)(c,h),m.else())}}e.validatePropertyDeps=i;function a(c,u=c.schema){const{gen:m,data:v,keyword:l,it:h}=c,w=m.name("valid");for(const S in u)(0,r.alwaysValidSchema)(h,u[S])||(m.if((0,n.propertyInData)(m,v,S,h.opts.ownProperties),()=>{const p=c.subschema({keyword:l,schemaProp:S},w);c.mergeValidEvaluated(p,w)},()=>m.var(w,!0)),c.ok(w))}e.validateSchemaDeps=a,e.default=s})(as)),as}var qr={},Ji;function qm(){if(Ji)return qr;Ji=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s;if((0,t.alwaysValidSchema)(c,i))return;const u=o.name("valid");o.forIn("key",a,m=>{s.setParams({propertyName:m}),s.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},u),o.if((0,e.not)(u),()=>{s.error(!0),c.allErrors||o.break()})}),s.ok(u)}};return qr.default=n,qr}var Zr={},Hi;function Gi(){if(Hi)return Zr;Hi=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=We(),t=ne(),r=Ge(),n=ce(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,t._)`{additionalProperty: ${i.additionalProperty}}`},code(i){const{gen:a,schema:c,parentSchema:u,data:m,errsCount:v,it:l}=i;if(!v)throw new Error("ajv implementation error");const{allErrors:h,opts:w}=l;if(l.props=!0,w.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(l,c))return;const S=(0,e.allSchemaProperties)(u.properties),p=(0,e.allSchemaProperties)(u.patternProperties);_(),i.ok((0,t._)`${v} === ${r.default.errors}`);function _(){a.forIn("key",m,$=>{!S.length&&!p.length?g($):a.if(f($),()=>g($))})}function f($){let E;if(S.length>8){const R=(0,n.schemaRefOrVal)(l,u.properties,"properties");E=(0,e.isOwnProperty)(a,R,$)}else S.length?E=(0,t.or)(...S.map(R=>(0,t._)`${$} === ${R}`)):E=t.nil;return p.length&&(E=(0,t.or)(E,...p.map(R=>(0,t._)`${(0,e.usePattern)(i,R)}.test(${$})`))),(0,t.not)(E)}function y($){a.code((0,t._)`delete ${m}[${$}]`)}function g($){if(w.removeAdditional==="all"||w.removeAdditional&&c===!1){y($);return}if(c===!1){i.setParams({additionalProperty:$}),i.error(),h||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(l,c)){const E=a.name("valid");w.removeAdditional==="failing"?(d($,E,!1),a.if((0,t.not)(E),()=>{i.reset(),y($)})):(d($,E),h||a.if((0,t.not)(E),()=>a.break()))}}function d($,E,R){const Z={keyword:"additionalProperties",dataProp:$,dataPropType:n.Type.Str};R===!1&&Object.assign(Z,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(Z,E)}}};return Zr.default=o,Zr}var Ur={},Bi;function Zm(){if(Bi)return Ur;Bi=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=jt(),t=We(),r=ce(),n=Gi(),s={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,parentSchema:c,data:u,it:m}=o;m.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(m,n.default,"additionalProperties"));const v=(0,t.allSchemaProperties)(a);for(const p of v)m.definedProperties.add(p);m.opts.unevaluated&&v.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(i,(0,r.toHash)(v),m.props));const l=v.filter(p=>!(0,r.alwaysValidSchema)(m,a[p]));if(l.length===0)return;const h=i.name("valid");for(const p of l)w(p)?S(p):(i.if((0,t.propertyInData)(i,u,p,m.opts.ownProperties)),S(p),m.allErrors||i.else().var(h,!0),i.endIf()),o.it.definedProperties.add(p),o.ok(h);function w(p){return m.opts.useDefaults&&!m.compositeRule&&a[p].default!==void 0}function S(p){o.subschema({keyword:"properties",schemaProp:p,dataProp:p},h)}}};return Ur.default=s,Ur}var xr={},Wi;function Um(){if(Wi)return xr;Wi=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=We(),t=ne(),r=ce(),n=ce(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,data:c,parentSchema:u,it:m}=o,{opts:v}=m,l=(0,e.allSchemaProperties)(a),h=l.filter(g=>(0,r.alwaysValidSchema)(m,a[g]));if(l.length===0||h.length===l.length&&(!m.opts.unevaluated||m.props===!0))return;const w=v.strictSchema&&!v.allowMatchingProperties&&u.properties,S=i.name("valid");m.props!==!0&&!(m.props instanceof t.Name)&&(m.props=(0,n.evaluatedPropsToName)(i,m.props));const{props:p}=m;_();function _(){for(const g of l)w&&f(g),m.allErrors?y(g):(i.var(S,!0),y(g),i.if(S))}function f(g){for(const d in w)new RegExp(g).test(d)&&(0,r.checkStrictMode)(m,`property ${d} matches pattern ${g} (use allowMatchingProperties)`)}function y(g){i.forIn("key",c,d=>{i.if((0,t._)`${(0,e.usePattern)(o,g)}.test(${d})`,()=>{const $=h.includes(g);$||o.subschema({keyword:"patternProperties",schemaProp:g,dataProp:d,dataPropType:n.Type.Str},S),m.opts.unevaluated&&p!==!0?i.assign((0,t._)`${p}[${d}]`,!0):!$&&!m.allErrors&&i.if((0,t.not)(S),()=>i.break())})})}}};return xr.default=s,xr}var Lr={},Yi;function xm(){if(Yi)return Lr;Yi=1,Object.defineProperty(Lr,"__esModule",{value:!0});const e=ce(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:o}=r;if((0,e.alwaysValidSchema)(o,s)){r.fail();return}const i=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Lr.default=t,Lr}var Kr={},Xi;function Lm(){if(Xi)return Kr;Xi=1,Object.defineProperty(Kr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:We().validateUnion,error:{message:"must match a schema in anyOf"}};return Kr.default=t,Kr}var Jr={},Qi;function Km(){if(Qi)return Jr;Qi=1,Object.defineProperty(Jr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:o,schema:i,parentSchema:a,it:c}=s;if(!Array.isArray(i))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const u=i,m=o.let("valid",!1),v=o.let("passing",null),l=o.name("_valid");s.setParams({passing:v}),o.block(h),s.result(m,()=>s.reset(),()=>s.error(!0));function h(){u.forEach((w,S)=>{let p;(0,t.alwaysValidSchema)(c,w)?o.var(l,!0):p=s.subschema({keyword:"oneOf",schemaProp:S,compositeRule:!0},l),S>0&&o.if((0,e._)`${l} && ${m}`).assign(m,!1).assign(v,(0,e._)`[${v}, ${S}]`).else(),o.if(l,()=>{o.assign(m,!0),o.assign(v,S),p&&s.mergeEvaluated(p,e.Name)})})}}};return Jr.default=n,Jr}var Hr={},ea;function Jm(){if(ea)return Hr;ea=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=ce(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:o}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const i=n.name("valid");s.forEach((a,c)=>{if((0,e.alwaysValidSchema)(o,a))return;const u=r.subschema({keyword:"allOf",schemaProp:c},i);r.ok(i),r.mergeEvaluated(u)})}};return Hr.default=t,Hr}var Gr={},ta;function Hm(){if(ta)return Gr;ta=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:i,parentSchema:a,it:c}=o;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const u=s(c,"then"),m=s(c,"else");if(!u&&!m)return;const v=i.let("valid",!0),l=i.name("_valid");if(h(),o.reset(),u&&m){const S=i.let("ifClause");o.setParams({ifClause:S}),i.if(l,w("then",S),w("else",S))}else u?i.if(l,w("then")):i.if((0,e.not)(l),w("else"));o.pass(v,()=>o.error(!0));function h(){const S=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);o.mergeEvaluated(S)}function w(S,p){return()=>{const _=o.subschema({keyword:S},l);i.assign(v,l),o.mergeValidEvaluated(_,v),p?i.assign(p,(0,e._)`${S}`):o.setParams({ifClause:S})}}}};function s(o,i){const a=o.schema[i];return a!==void 0&&!(0,t.alwaysValidSchema)(o,a)}return Gr.default=n,Gr}var Br={},ra;function Gm(){if(ra)return Br;ra=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=ce(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return Br.default=t,Br}var na;function sa(){if(na)return Mr;na=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=Fi(),t=Dm(),r=Zi(),n=Vm(),s=Fm(),o=cs(),i=qm(),a=Gi(),c=Zm(),u=Um(),m=xm(),v=Lm(),l=Km(),h=Jm(),w=Hm(),S=Gm();function p(_=!1){const f=[m.default,v.default,l.default,h.default,w.default,S.default,i.default,a.default,o.default,c.default,u.default];return _?f.push(t.default,n.default):f.push(e.default,r.default),f.push(s.default),f}return Mr.default=p,Mr}var Wr={},Yr={},oa;function Bm(){if(oa)return Yr;oa=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ne(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,s){const{gen:o,data:i,$data:a,schema:c,schemaCode:u,it:m}=n,{opts:v,errSchemaPath:l,schemaEnv:h,self:w}=m;if(!v.validateFormats)return;a?S():p();function S(){const _=o.scopeValue("formats",{ref:w.formats,code:v.code.formats}),f=o.const("fDef",(0,e._)`${_}[${u}]`),y=o.let("fType"),g=o.let("format");o.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>o.assign(y,(0,e._)`${f}.type || "string"`).assign(g,(0,e._)`${f}.validate`),()=>o.assign(y,(0,e._)`"string"`).assign(g,f)),n.fail$data((0,e.or)(d(),$()));function d(){return v.strictSchema===!1?e.nil:(0,e._)`${u} && !${g}`}function $(){const E=h.$async?(0,e._)`(${f}.async ? await ${g}(${i}) : ${g}(${i}))`:(0,e._)`${g}(${i})`,R=(0,e._)`(typeof ${g} == "function" ? ${E} : ${g}.test(${i}))`;return(0,e._)`${g} && ${g} !== true && ${y} === ${s} && !${R}`}}function p(){const _=w.formats[c];if(!_){d();return}if(_===!0)return;const[f,y,g]=$(_);f===s&&n.pass(E());function d(){if(v.strictSchema===!1){w.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${c}" ignored in schema at path "${l}"`}}function $(R){const Z=R instanceof RegExp?(0,e.regexpCode)(R):v.code.formats?(0,e._)`${v.code.formats}${(0,e.getProperty)(c)}`:void 0,L=o.scopeValue("formats",{key:c,ref:R,code:Z});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${L}.validate`]:["string",R,L]}function E(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!h.$async)throw new Error("async format in sync schema");return(0,e._)`await ${g}(${i})`}return typeof y=="function"?(0,e._)`${g}(${i})`:(0,e._)`${g}.test(${i})`}}}};return Yr.default=r,Yr}var ia;function aa(){if(ia)return Wr;ia=1,Object.defineProperty(Wr,"__esModule",{value:!0});const t=[Bm().default];return Wr.default=t,Wr}var vt={},ca;function ua(){return ca||(ca=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.contentVocabulary=vt.metadataVocabulary=void 0,vt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],vt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),vt}var da;function la(){if(da)return $r;da=1,Object.defineProperty($r,"__esModule",{value:!0});const e=Si(),t=Di(),r=sa(),n=aa(),s=ua(),o=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return $r.default=o,$r}var Xr={},Zt={},fa;function Wm(){if(fa)return Zt;fa=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Zt.DiscrError=e={})),Zt}var ma;function us(){if(ma)return Xr;ma=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=ne(),t=Wm(),r=gr(),n=At(),s=ce(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>(0,e._)`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){const{gen:c,data:u,schema:m,parentSchema:v,it:l}=a,{oneOf:h}=v;if(!l.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=m.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(m.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const S=c.let("valid",!1),p=c.const("tag",(0,e._)`${u}${(0,e.getProperty)(w)}`);c.if((0,e._)`typeof ${p} == "string"`,()=>_(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:p,tagName:w})),a.ok(S);function _(){const g=y();c.if(!1);for(const d in g)c.elseIf((0,e._)`${p} === ${d}`),c.assign(S,f(g[d]));c.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:p,tagName:w}),c.endIf()}function f(g){const d=c.name("valid"),$=a.subschema({keyword:"oneOf",schemaProp:g},d);return a.mergeEvaluated($,e.Name),d}function y(){var g;const d={},$=R(v);let E=!0;for(let F=0;F<h.length;F++){let V=h[F];if(V?.$ref&&!(0,s.schemaHasRulesButRef)(V,l.self.RULES)){const K=V.$ref;if(V=r.resolveRef.call(l.self,l.schemaEnv.root,l.baseId,K),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default(l.opts.uriResolver,l.baseId,K)}const U=(g=V?.properties)===null||g===void 0?void 0:g[w];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${w}"`);E=E&&($||R(V)),Z(U,F)}if(!E)throw new Error(`discriminator: "${w}" must be required`);return d;function R({required:F}){return Array.isArray(F)&&F.includes(w)}function Z(F,V){if(F.const)L(F.const,V);else if(F.enum)for(const U of F.enum)L(U,V);else throw new Error(`discriminator: "properties/${w}" must have "const" or "enum"`)}function L(F,V){if(typeof F!="string"||F in d)throw new Error(`discriminator: "${w}" values must be unique strings`);d[F]=V}}}};return Xr.default=i,Xr}const Ym={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0};var ha;function pa(){return ha||(ha=1,(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=ss(),n=la(),s=us(),o=Ym,i=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(w,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var m=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var v=Ft();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return v.default}});var l=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})})(dr,dr.exports)),dr.exports}var Xm=pa();const Qm=ur(Xm);var Qr={exports:{}},en={},Rt={},ya;function va(){if(ya)return Rt;ya=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.dynamicAnchor=void 0;const e=ne(),t=Ge(),r=gr(),n=os(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>o(a,a.schema)};function o(a,c){const{gen:u,it:m}=a;m.schemaEnv.root.dynamicAnchors[c]=!0;const v=(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`,l=m.errSchemaPath==="#"?m.validateName:i(a);u.if((0,e._)`!${v}`,()=>u.assign(v,l))}Rt.dynamicAnchor=o;function i(a){const{schemaEnv:c,schema:u,self:m}=a.it,{root:v,baseId:l,localRefs:h,meta:w}=c.root,{schemaId:S}=m.opts,p=new r.SchemaEnv({schema:u,schemaId:S,root:v,baseId:l,localRefs:h,meta:w});return r.compileSchema.call(m,p),(0,n.getValidate)(a,p)}return Rt.default=s,Rt}var It={},ga;function _a(){if(ga)return It;ga=1,Object.defineProperty(It,"__esModule",{value:!0}),It.dynamicRef=void 0;const e=ne(),t=Ge(),r=os(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>s(o,o.schema)};function s(o,i){const{gen:a,keyword:c,it:u}=o;if(i[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const m=i.slice(1);if(u.allErrors)v();else{const h=a.let("valid",!1);v(h),o.ok(h)}function v(h){if(u.schemaEnv.root.dynamicAnchors[m]){const w=a.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(m)}`);a.if(w,l(w,h),l(u.validateName,h))}else l(u.validateName,h)()}function l(h,w){return w?()=>a.block(()=>{(0,r.callRef)(o,h),a.let(w,!0)}):()=>(0,r.callRef)(o,h)}}return It.dynamicRef=s,It.default=n,It}var tn={},$a;function eh(){if($a)return tn;$a=1,Object.defineProperty(tn,"__esModule",{value:!0});const e=va(),t=ce(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,e.dynamicAnchor)(n,""):(0,t.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return tn.default=r,tn}var rn={},ba;function th(){if(ba)return rn;ba=1,Object.defineProperty(rn,"__esModule",{value:!0});const e=_a(),t={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,e.dynamicRef)(r,r.schema)};return rn.default=t,rn}var wa;function Sa(){if(wa)return en;wa=1,Object.defineProperty(en,"__esModule",{value:!0});const e=va(),t=_a(),r=eh(),n=th(),s=[e.default,t.default,r.default,n.default];return en.default=s,en}var nn={},sn={},Ea;function rh(){if(Ea)return sn;Ea=1,Object.defineProperty(sn,"__esModule",{value:!0});const e=cs(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return sn.default=t,sn}var on={},ka;function nh(){if(ka)return on;ka=1,Object.defineProperty(on,"__esModule",{value:!0});const e=cs(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,e.validateSchemaDeps)(r)};return on.default=t,on}var an={},Pa;function sh(){if(Pa)return an;Pa=1,Object.defineProperty(an,"__esModule",{value:!0});const e=ce(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:s}){n.contains===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "contains" is ignored`)}};return an.default=t,an}var Oa;function ja(){if(Oa)return nn;Oa=1,Object.defineProperty(nn,"__esModule",{value:!0});const e=rh(),t=nh(),r=sh(),n=[e.default,t.default,r.default];return nn.default=n,nn}var cn={},un={},Aa;function oh(){if(Aa)return un;Aa=1,Object.defineProperty(un,"__esModule",{value:!0});const e=ne(),t=ce(),r=Ge(),s={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:o})=>(0,e._)`{unevaluatedProperty: ${o.unevaluatedProperty}}`},code(o){const{gen:i,schema:a,data:c,errsCount:u,it:m}=o;if(!u)throw new Error("ajv implementation error");const{allErrors:v,props:l}=m;l instanceof e.Name?i.if((0,e._)`${l} !== true`,()=>i.forIn("key",c,p=>i.if(w(l,p),()=>h(p)))):l!==!0&&i.forIn("key",c,p=>l===void 0?h(p):i.if(S(l,p),()=>h(p))),m.props=!0,o.ok((0,e._)`${u} === ${r.default.errors}`);function h(p){if(a===!1){o.setParams({unevaluatedProperty:p}),o.error(),v||i.break();return}if(!(0,t.alwaysValidSchema)(m,a)){const _=i.name("valid");o.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:t.Type.Str},_),v||i.if((0,e.not)(_),()=>i.break())}}function w(p,_){return(0,e._)`!${p} || !${p}[${_}]`}function S(p,_){const f=[];for(const y in p)p[y]===!0&&f.push((0,e._)`${_} !== ${y}`);return(0,e.and)(...f)}}};return un.default=s,un}var dn={},Na;function ih(){if(Na)return dn;Na=1,Object.defineProperty(dn,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s,u=c.items||0;if(u===!0)return;const m=o.const("len",(0,e._)`${a}.length`);if(i===!1)s.setParams({len:u}),s.fail((0,e._)`${m} > ${u}`);else if(typeof i=="object"&&!(0,t.alwaysValidSchema)(c,i)){const l=o.var("valid",(0,e._)`${m} <= ${u}`);o.if((0,e.not)(l),()=>v(l,u)),s.ok(l)}c.items=!0;function v(l,h){o.forRange("i",h,m,w=>{s.subschema({keyword:"unevaluatedItems",dataProp:w,dataPropType:t.Type.Num},l),c.allErrors||o.if((0,e.not)(l),()=>o.break())})}}};return dn.default=n,dn}var za;function Ra(){if(za)return cn;za=1,Object.defineProperty(cn,"__esModule",{value:!0});const e=oh(),t=ih(),r=[e.default,t.default];return cn.default=r,cn}var ln={};const ah={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},ch={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},uh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},dh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},lh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},fh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},mh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Ia;function hh(){if(Ia)return ln;Ia=1,Object.defineProperty(ln,"__esModule",{value:!0});const e=ah,t=ch,r=uh,n=dh,s=lh,o=fh,i=mh,a=["/properties"];function c(u){return[e,t,r,n,m(this,s),o,m(this,i)].forEach(v=>this.addMetaSchema(v,void 0,!1)),this;function m(v,l){return u?v.$dataMetaSchema(l,a):l}}return ln.default=c,ln}var Ta;function ph(){return Ta||(Ta=1,(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.Ajv2019=void 0;const r=ss(),n=la(),s=Sa(),o=ja(),i=Ra(),a=us(),c=hh(),u="https://json-schema.org/draft/2019-09/schema";class m extends r.default{constructor(p={}){super({...p,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(s.default),n.default.forEach(p=>this.addVocabulary(p)),this.addVocabulary(o.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:p,meta:_}=this.opts;_&&(c.default.call(this,p),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv2019=m,e.exports=t=m,e.exports.Ajv2019=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var v=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return v.KeywordCxt}});var l=ne();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 h=Ft();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var w=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return w.default}})})(Qr,Qr.exports)),Qr.exports}var yh=ph();const vh=ur(yh);var fn={exports:{}},mn={},Ca;function gh(){if(Ca)return mn;Ca=1,Object.defineProperty(mn,"__esModule",{value:!0});const e=Si(),t=Di(),r=sa(),n=Sa(),s=ja(),o=Ra(),i=aa(),a=ua(),c=[n.default,e.default,t.default,(0,r.default)(!0),i.default,a.metadataVocabulary,a.contentVocabulary,s.default,o.default];return mn.default=c,mn}var hn={};const _h={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}},$h={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},bh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},wh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},Sh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},Eh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},kh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},Ph={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Ma;function Oh(){if(Ma)return hn;Ma=1,Object.defineProperty(hn,"__esModule",{value:!0});const e=_h,t=$h,r=bh,n=wh,s=Sh,o=Eh,i=kh,a=Ph,c=["/properties"];function u(m){return[e,t,r,n,s,v(this,o),i,v(this,a)].forEach(l=>this.addMetaSchema(l,void 0,!1)),this;function v(l,h){return m?l.$dataMetaSchema(h,c):h}}return hn.default=u,hn}var Da;function jh(){return Da||(Da=1,(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.Ajv2020=void 0;const r=ss(),n=gh(),s=us(),o=Oh(),i="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:w}=this.opts;w&&(o.default.call(this,h),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var c=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=Ft();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var v=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(fn,fn.exports)),fn.exports}var Ah=jh();const Nh=ur(Ah);var pn={exports:{}},ds={},Va;function zh(){return Va||(Va=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(F,V){return{validate:F,compare:V}}e.fullFormats={date:t(o,i),time:t(c(!0),u),"date-time":t(l(!0),h),"iso-time":t(c(),m),"iso-date-time":t(l(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"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:L,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:y,int32:{type:"number",validate:$},int64:{type:"number",validate:E},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),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,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"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,w),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(F){return F%4===0&&(F%100!==0||F%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(F){const V=n.exec(F);if(!V)return!1;const U=+V[1],K=+V[2],re=+V[3];return K>=1&&K<=12&&re>=1&&re<=(K===2&&r(U)?29:s[K])}function i(F,V){if(F&&V)return F>V?1:F<V?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(F){return function(U){const K=a.exec(U);if(!K)return!1;const re=+K[1],ye=+K[2],me=+K[3],ue=K[4],Oe=K[5]==="-"?-1:1,M=+(K[6]||0),O=+(K[7]||0);if(M>23||O>59||F&&!ue)return!1;if(re<=23&&ye<=59&&me<60)return!0;const C=ye-O*Oe,A=re-M*Oe-(C<0?1:0);return(A===23||A===-1)&&(C===59||C===-1)&&me<61}}function u(F,V){if(!(F&&V))return;const U=new Date("2020-01-01T"+F).valueOf(),K=new Date("2020-01-01T"+V).valueOf();if(U&&K)return U-K}function m(F,V){if(!(F&&V))return;const U=a.exec(F),K=a.exec(V);if(U&&K)return F=U[1]+U[2]+U[3],V=K[1]+K[2]+K[3],F>V?1:F<V?-1:0}const v=/t|\s/i;function l(F){const V=c(F);return function(K){const re=K.split(v);return re.length===2&&o(re[0])&&V(re[1])}}function h(F,V){if(!(F&&V))return;const U=new Date(F).valueOf(),K=new Date(V).valueOf();if(U&&K)return U-K}function w(F,V){if(!(F&&V))return;const[U,K]=F.split(v),[re,ye]=V.split(v),me=i(U,re);if(me!==void 0)return me||u(K,ye)}const S=/\/|:/,p=/^(?:[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 _(F){return S.test(F)&&p.test(F)}const f=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(F){return f.lastIndex=0,f.test(F)}const g=-2147483648,d=2**31-1;function $(F){return Number.isInteger(F)&&F<=d&&F>=g}function E(F){return Number.isInteger(F)}function R(){return!0}const Z=/[^\\]\\Z/;function L(F){if(Z.test(F))return!1;try{return new RegExp(F),!0}catch{return!1}}})(ds)),ds}var ls={},Fa;function Rh(){return Fa||(Fa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=pa(),r=ne(),n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:a,schemaCode:c})=>(0,r.str)`should be ${s[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,r._)`{comparison: ${s[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(a){const{gen:c,data:u,schemaCode:m,keyword:v,it:l}=a,{opts:h,self:w}=l;if(!h.validateFormats)return;const S=new t.KeywordCxt(l,w.RULES.all.format.definition,"format");S.$data?p():_();function p(){const y=c.scopeValue("formats",{ref:w.formats,code:h.code.formats}),g=c.const("fmt",(0,r._)`${y}[${S.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${g} != "object"`,(0,r._)`${g} instanceof RegExp`,(0,r._)`typeof ${g}.compare != "function"`,f(g)))}function _(){const y=S.schema,g=w.formats[y];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${v}": format "${y}" does not define "compare" function`);const d=c.scopeValue("formats",{key:y,ref:g,code:h.code.formats?(0,r._)`${h.code.formats}${(0,r.getProperty)(y)}`:void 0});a.fail$data(f(d))}function f(y){return(0,r._)`${y}.compare(${u}, ${m}) ${s[v].fail} 0`}},dependencies:["format"]};const i=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i})(ls)),ls}var qa;function Ih(){return qa||(qa=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=zh(),n=Rh(),s=ne(),o=new s.Name("fullFormats"),i=new s.Name("fastFormats"),a=(u,m={keywords:!0})=>{if(Array.isArray(m))return c(u,m,r.fullFormats,o),u;const[v,l]=m.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,o],h=m.formats||r.formatNames;return c(u,h,v,l),m.keywords&&(0,n.default)(u),u};a.get=(u,m="full")=>{const l=(m==="fast"?r.fastFormats:r.fullFormats)[u];if(!l)throw new Error(`Unknown format "${u}"`);return l};function c(u,m,v,l){var h,w;(h=(w=u.opts.code).formats)!==null&&h!==void 0||(w.formats=(0,s._)`require("ajv-formats/dist/formats").${l}`);for(const S of m)u.addFormat(S,v[S])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(pn,pn.exports)),pn.exports}var Th=Ih();const fs=ur(Th),Ch=fs(new Qm({strict:!1})),Mh=fs(new vh),Za=fs(new Nh),Dh=[{patterns:["draft-07","draft-06","draft-04"],ajv:Ch,metaUri:"http://json-schema.org/draft-07/schema"},{patterns:["draft/2019-09"],ajv:Mh,metaUri:"https://json-schema.org/draft/2019-09/schema"},{patterns:["draft/2020-12"],ajv:Za,metaUri:"https://json-schema.org/draft/2020-12/schema"}],Vh=Za,Fh="https://json-schema.org/draft/2020-12/schema";function qh(e){const t=e.$schema??"";for(const r of Dh)if(r.patterns.some(n=>t.includes(n)))return{ajv:r.ajv,metaUri:r.metaUri};return{ajv:Vh,metaUri:Fh}}function Ut(e,t=""){const r=[];if(e===null||typeof e!="object")return r;const n=p=>typeof p=="number"?p:void 0,s=n(e.minimum),o=n(e.maximum),i=e.exclusiveMinimum,a=e.exclusiveMaximum,c=n(e.minLength),u=n(e.maxLength),m=n(e.minItems),v=n(e.maxItems),l=n(e.minContains),h=n(e.maxContains),w=n(e.minProperties),S=n(e.maxProperties);if(s!==void 0&&o!==void 0&&(typeof i=="boolean"&&i||typeof a=="boolean"&&a?o<=s:o<s)&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be >= minimum (${s})`}),typeof i=="number"&&(o!==void 0&&o<=i&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be > exclusiveMinimum (${i})`}),s!==void 0&&i===s&&r.push({instancePath:`${t}/exclusiveMinimum`,message:`exclusiveMinimum (${i}) must not equal minimum (${s})`})),typeof a=="number"&&(s!==void 0&&a<=s&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > minimum (${s})`}),typeof i=="number"&&a<=i&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > exclusiveMinimum (${i})`}),o!==void 0&&a===o&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must not equal maximum (${o})`})),c!==void 0&&u!==void 0&&u<c&&r.push({instancePath:`${t}/maxLength`,message:`maxLength (${u}) must be >= minLength (${c})`}),m!==void 0&&v!==void 0&&v<m&&r.push({instancePath:`${t}/maxItems`,message:`maxItems (${v}) must be >= minItems (${m})`}),l!==void 0&&h!==void 0&&h<l&&r.push({instancePath:`${t}/maxContains`,message:`maxContains (${h}) must be >= minContains (${l})`}),w!==void 0&&S!==void 0&&S<w&&r.push({instancePath:`${t}/maxProperties`,message:`maxProperties (${S}) must be >= minProperties (${w})`}),e.properties&&typeof e.properties=="object"&&!Array.isArray(e.properties))for(const p of Object.keys(e.properties))r.push(...Ut(e.properties[p],`${t}/properties/${p}`));if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)&&r.push(...Ut(e.items,`${t}/items`)),e.$defs&&typeof e.$defs=="object")for(const p of Object.keys(e.$defs))r.push(...Ut(e.$defs[p],`${t}/$defs/${p}`));if(e.definitions&&typeof e.definitions=="object")for(const p of Object.keys(e.definitions))r.push(...Ut(e.definitions[p],`${t}/definitions/${p}`));return r}function Ua(e){const{ajv:t,metaUri:r}=qh(e),s=t.validate(r,e)?[]:t.errors??[],o=Ut(e),i=[...s,...o];return i.length>0?i:null}function Zh(e={}){const{rootType:t="object",defaultValue:r,onChange:n}=e,s=ee.useRef(n);s.current=n;const o=ee.useMemo(()=>Qe(6),[]),i=ee.useCallback(M=>({root:{type:t,$schema:"http://json-schema.org/draft/2020-12/schema",...t==="object"&&{additionalProperties:!0},...t==="array"&&{items:{type:"string"}}},properties:t==="object"?[{id:M,key:`field_${M}`,isRequired:!1,schema:{type:"number"}}]:[],definitions:[]}),[t]),a=lm({resolver:pm(vo),defaultValues:r?ys(r):i(o)}),{setError:c,clearErrors:u,setValue:m,reset:v,getValues:l}=a,{fields:h,append:w,remove:S}=Vo({control:a.control,name:"properties",keyName:"fieldId"}),{fields:p,append:_,remove:f}=Vo({control:a.control,name:"definitions",keyName:"defId"}),[y,g]=ee.useState(()=>vn(l())),[d,$]=ee.useState(null),[E,R]=ee.useState({isOpen:!1,fieldPath:null}),Z=ee.useRef("");ee.useEffect(()=>{const M=a.watch(O=>{const C=vn(O),A=JSON.stringify(C);if(A!==Z.current){Z.current=A,g(C),s.current?.(C);const b=Ua(C);$(P=>JSON.stringify(b)!==JSON.stringify(P)?b:P)}});return()=>M.unsubscribe()},[a]),ee.useEffect(()=>{const M={exclusiveMinimum:"exclusiveMin",exclusiveMaximum:"exclusiveMax"};if(u(),d){const O=l("properties");d.forEach(C=>{const A=C.instancePath.split("/").filter(Boolean);if(A[0]==="properties"&&A.length>=3){const b=O?.findIndex(P=>P.key===A[1])??-1;if(b!==-1){const P=A[2],T=M[P]??P;c(`properties.${b}.schema.${T}`,{type:"ajv",message:C.message})}}else if(A.length>0){const b=A[0],P=M[b]??b;c(`root.${P}`,{type:"ajv",message:C.message})}})}},[d,u,c,l]),ee.useEffect(()=>{if(!r){const M=Qe(6);v(i(M))}},[t,v,r,i]);const L=ee.useCallback(()=>{const M=Qe(6);w({id:M,key:`field_${M}`,isRequired:!1,schema:{type:"string"}})},[w]),F=ee.useCallback(M=>{S(M)},[S]),V=ee.useCallback(()=>{const M=Qe(6);_({id:M,key:`def_${M}`,schema:{type:"object",additionalProperties:!0}})},[_]),U=ee.useCallback(M=>{const O=l(`definitions.${M}.key`);K(O,null),f(M)},[l,f]),K=ee.useCallback((M,O)=>{const C=`#/$defs/${M}`,A=O?`#/$defs/${O}`:"",b=l(),P=(T,G)=>{G&&(G.schema&&G.schema.$ref===C&&m(`${T}.schema.$ref`,A),G.$ref===C&&m(`${T}.$ref`,A),G.schema?.properties&&Array.isArray(G.schema.properties)&&G.schema.properties.forEach((Y,ie)=>{P(`${T}.schema.properties.${ie}`,Y)}),G.properties&&Array.isArray(G.properties)&&G.properties.forEach((Y,ie)=>{P(`${T}.properties.${ie}`,Y)}),G.schema?.items&&(Array.isArray(G.schema.items)||P(`${T}.schema.items`,{schema:G.schema.items})))};b.properties&&b.properties.forEach((T,G)=>{P(`properties.${G}`,T)}),b.definitions&&b.definitions.forEach((T,G)=>{T.key!==M&&P(`definitions.${G}`,T)}),b.root&&b.root.$ref===C&&m("root.$ref",A)},[l,m]),re=ee.useCallback(M=>{R({isOpen:!0,fieldPath:M})},[]),ye=ee.useCallback(()=>{R({isOpen:!1,fieldPath:null})},[]),me=ee.useCallback((M,O)=>{let C={};O==="object"?C={type:"object",properties:[],additionalProperties:!0}:O==="array"?C={type:"array"}:O==="ref"?C={type:"ref",$ref:""}:C={type:O},m(`${M}.schema`,C)},[m]),ue=ee.useCallback(M=>{const O=Qe(6),C=l(`${M}.schema.properties`)||[];m(`${M}.schema.properties`,[...C,{id:O,key:`field_${O}`,isRequired:!1,schema:{type:"string"}}])},[m,l]),Oe=ee.useCallback(()=>{const M=Qe(6);v(i(M))},[v,i]);return{schema:y,errors:d,fields:h,definitions:p,form:a,settingsState:E,addField:L,removeField:F,addDefinition:V,removeDefinition:U,updateReferences:K,openSettings:re,closeSettings:ye,handleTypeChange:me,addNestedField:ue,reset:Oe}}Se.DEFAULT_SCHEMA_URI=yn,Se.INTEGER_FORMATS=Ja,Se.NUMBER_FORMATS=Ha,Se.SCHEMA_TYPES=ps,Se.SCHEMA_TYPES_WITH_REF=Ka,Se.STRING_FORMATS=Ga,Se.createDefaultArraySchema=Wa,Se.createDefaultField=Ya,Se.createDefaultObjectSchema=Ba,Se.formSchema=vo,Se.formToSchema=vn,Se.jsonSchemaZod=Ze,Se.schemaToForm=ys,Se.useJsonSchemaEditor=Zh,Se.validateSchema=Ua,Object.defineProperty(Se,Symbol.toStringTag,{value:"Module"})}));
|
|
46
|
+
deps: ${m}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,m]=o(c);i(c,u),a(c,m)}};function o({schema:c}){const u={},m={};for(const y in c){if(y==="__proto__")continue;const f=Array.isArray(c[y])?u:m;f[y]=c[y]}return[u,m]}function i(c,u=c.schema){const{gen:m,data:y,it:f}=c;if(Object.keys(u).length===0)return;const h=m.let("missing");for(const w in u){const S=u[w];if(S.length===0)continue;const p=(0,n.propertyInData)(m,y,w,f.opts.ownProperties);c.setParams({property:w,depsCount:S.length,deps:S.join(", ")}),f.allErrors?m.if(p,()=>{for(const _ of S)(0,n.checkReportMissingProp)(c,_)}):(m.if((0,t._)`${p} && (${(0,n.checkMissingProp)(c,S,h)})`),(0,n.reportMissingProp)(c,h),m.else())}}e.validatePropertyDeps=i;function a(c,u=c.schema){const{gen:m,data:y,keyword:f,it:h}=c,w=m.name("valid");for(const S in u)(0,r.alwaysValidSchema)(h,u[S])||(m.if((0,n.propertyInData)(m,y,S,h.opts.ownProperties),()=>{const p=c.subschema({keyword:f,schemaProp:S},w);c.mergeValidEvaluated(p,w)},()=>m.var(w,!0)),c.ok(w))}e.validateSchemaDeps=a,e.default=s})(as)),as}var Fr={},Hi;function Zm(){if(Hi)return Fr;Hi=1,Object.defineProperty(Fr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s;if((0,t.alwaysValidSchema)(c,i))return;const u=o.name("valid");o.forIn("key",a,m=>{s.setParams({propertyName:m}),s.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},u),o.if((0,e.not)(u),()=>{s.error(!0),c.allErrors||o.break()})}),s.ok(u)}};return Fr.default=n,Fr}var Zr={},Gi;function Bi(){if(Gi)return Zr;Gi=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=We(),t=ne(),r=Ge(),n=ce(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,t._)`{additionalProperty: ${i.additionalProperty}}`},code(i){const{gen:a,schema:c,parentSchema:u,data:m,errsCount:y,it:f}=i;if(!y)throw new Error("ajv implementation error");const{allErrors:h,opts:w}=f;if(f.props=!0,w.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(f,c))return;const S=(0,e.allSchemaProperties)(u.properties),p=(0,e.allSchemaProperties)(u.patternProperties);_(),i.ok((0,t._)`${y} === ${r.default.errors}`);function _(){a.forIn("key",m,$=>{!S.length&&!p.length?g($):a.if(l($),()=>g($))})}function l($){let E;if(S.length>8){const R=(0,n.schemaRefOrVal)(f,u.properties,"properties");E=(0,e.isOwnProperty)(a,R,$)}else S.length?E=(0,t.or)(...S.map(R=>(0,t._)`${$} === ${R}`)):E=t.nil;return p.length&&(E=(0,t.or)(E,...p.map(R=>(0,t._)`${(0,e.usePattern)(i,R)}.test(${$})`))),(0,t.not)(E)}function v($){a.code((0,t._)`delete ${m}[${$}]`)}function g($){if(w.removeAdditional==="all"||w.removeAdditional&&c===!1){v($);return}if(c===!1){i.setParams({additionalProperty:$}),i.error(),h||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(f,c)){const E=a.name("valid");w.removeAdditional==="failing"?(d($,E,!1),a.if((0,t.not)(E),()=>{i.reset(),v($)})):(d($,E),h||a.if((0,t.not)(E),()=>a.break()))}}function d($,E,R){const F={keyword:"additionalProperties",dataProp:$,dataPropType:n.Type.Str};R===!1&&Object.assign(F,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(F,E)}}};return Zr.default=o,Zr}var Ur={},Wi;function Um(){if(Wi)return Ur;Wi=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=jt(),t=We(),r=ce(),n=Bi(),s={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,parentSchema:c,data:u,it:m}=o;m.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(m,n.default,"additionalProperties"));const y=(0,t.allSchemaProperties)(a);for(const p of y)m.definedProperties.add(p);m.opts.unevaluated&&y.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(i,(0,r.toHash)(y),m.props));const f=y.filter(p=>!(0,r.alwaysValidSchema)(m,a[p]));if(f.length===0)return;const h=i.name("valid");for(const p of f)w(p)?S(p):(i.if((0,t.propertyInData)(i,u,p,m.opts.ownProperties)),S(p),m.allErrors||i.else().var(h,!0),i.endIf()),o.it.definedProperties.add(p),o.ok(h);function w(p){return m.opts.useDefaults&&!m.compositeRule&&a[p].default!==void 0}function S(p){o.subschema({keyword:"properties",schemaProp:p,dataProp:p},h)}}};return Ur.default=s,Ur}var xr={},Yi;function xm(){if(Yi)return xr;Yi=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=We(),t=ne(),r=ce(),n=ce(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,data:c,parentSchema:u,it:m}=o,{opts:y}=m,f=(0,e.allSchemaProperties)(a),h=f.filter(g=>(0,r.alwaysValidSchema)(m,a[g]));if(f.length===0||h.length===f.length&&(!m.opts.unevaluated||m.props===!0))return;const w=y.strictSchema&&!y.allowMatchingProperties&&u.properties,S=i.name("valid");m.props!==!0&&!(m.props instanceof t.Name)&&(m.props=(0,n.evaluatedPropsToName)(i,m.props));const{props:p}=m;_();function _(){for(const g of f)w&&l(g),m.allErrors?v(g):(i.var(S,!0),v(g),i.if(S))}function l(g){for(const d in w)new RegExp(g).test(d)&&(0,r.checkStrictMode)(m,`property ${d} matches pattern ${g} (use allowMatchingProperties)`)}function v(g){i.forIn("key",c,d=>{i.if((0,t._)`${(0,e.usePattern)(o,g)}.test(${d})`,()=>{const $=h.includes(g);$||o.subschema({keyword:"patternProperties",schemaProp:g,dataProp:d,dataPropType:n.Type.Str},S),m.opts.unevaluated&&p!==!0?i.assign((0,t._)`${p}[${d}]`,!0):!$&&!m.allErrors&&i.if((0,t.not)(S),()=>i.break())})})}}};return xr.default=s,xr}var Lr={},Xi;function Lm(){if(Xi)return Lr;Xi=1,Object.defineProperty(Lr,"__esModule",{value:!0});const e=ce(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:o}=r;if((0,e.alwaysValidSchema)(o,s)){r.fail();return}const i=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Lr.default=t,Lr}var Kr={},Qi;function Km(){if(Qi)return Kr;Qi=1,Object.defineProperty(Kr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:We().validateUnion,error:{message:"must match a schema in anyOf"}};return Kr.default=t,Kr}var Jr={},ea;function Jm(){if(ea)return Jr;ea=1,Object.defineProperty(Jr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:o,schema:i,parentSchema:a,it:c}=s;if(!Array.isArray(i))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const u=i,m=o.let("valid",!1),y=o.let("passing",null),f=o.name("_valid");s.setParams({passing:y}),o.block(h),s.result(m,()=>s.reset(),()=>s.error(!0));function h(){u.forEach((w,S)=>{let p;(0,t.alwaysValidSchema)(c,w)?o.var(f,!0):p=s.subschema({keyword:"oneOf",schemaProp:S,compositeRule:!0},f),S>0&&o.if((0,e._)`${f} && ${m}`).assign(m,!1).assign(y,(0,e._)`[${y}, ${S}]`).else(),o.if(f,()=>{o.assign(m,!0),o.assign(y,S),p&&s.mergeEvaluated(p,e.Name)})})}}};return Jr.default=n,Jr}var Hr={},ta;function Hm(){if(ta)return Hr;ta=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=ce(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:o}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const i=n.name("valid");s.forEach((a,c)=>{if((0,e.alwaysValidSchema)(o,a))return;const u=r.subschema({keyword:"allOf",schemaProp:c},i);r.ok(i),r.mergeEvaluated(u)})}};return Hr.default=t,Hr}var Gr={},ra;function Gm(){if(ra)return Gr;ra=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:i,parentSchema:a,it:c}=o;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const u=s(c,"then"),m=s(c,"else");if(!u&&!m)return;const y=i.let("valid",!0),f=i.name("_valid");if(h(),o.reset(),u&&m){const S=i.let("ifClause");o.setParams({ifClause:S}),i.if(f,w("then",S),w("else",S))}else u?i.if(f,w("then")):i.if((0,e.not)(f),w("else"));o.pass(y,()=>o.error(!0));function h(){const S=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},f);o.mergeEvaluated(S)}function w(S,p){return()=>{const _=o.subschema({keyword:S},f);i.assign(y,f),o.mergeValidEvaluated(_,y),p?i.assign(p,(0,e._)`${S}`):o.setParams({ifClause:S})}}}};function s(o,i){const a=o.schema[i];return a!==void 0&&!(0,t.alwaysValidSchema)(o,a)}return Gr.default=n,Gr}var Br={},na;function Bm(){if(na)return Br;na=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=ce(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return Br.default=t,Br}var sa;function oa(){if(sa)return Mr;sa=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=Fi(),t=Vm(),r=Ui(),n=qm(),s=Fm(),o=cs(),i=Zm(),a=Bi(),c=Um(),u=xm(),m=Lm(),y=Km(),f=Jm(),h=Hm(),w=Gm(),S=Bm();function p(_=!1){const l=[m.default,y.default,f.default,h.default,w.default,S.default,i.default,a.default,o.default,c.default,u.default];return _?l.push(t.default,n.default):l.push(e.default,r.default),l.push(s.default),l}return Mr.default=p,Mr}var Wr={},Yr={},ia;function Wm(){if(ia)return Yr;ia=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ne(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,s){const{gen:o,data:i,$data:a,schema:c,schemaCode:u,it:m}=n,{opts:y,errSchemaPath:f,schemaEnv:h,self:w}=m;if(!y.validateFormats)return;a?S():p();function S(){const _=o.scopeValue("formats",{ref:w.formats,code:y.code.formats}),l=o.const("fDef",(0,e._)`${_}[${u}]`),v=o.let("fType"),g=o.let("format");o.if((0,e._)`typeof ${l} == "object" && !(${l} instanceof RegExp)`,()=>o.assign(v,(0,e._)`${l}.type || "string"`).assign(g,(0,e._)`${l}.validate`),()=>o.assign(v,(0,e._)`"string"`).assign(g,l)),n.fail$data((0,e.or)(d(),$()));function d(){return y.strictSchema===!1?e.nil:(0,e._)`${u} && !${g}`}function $(){const E=h.$async?(0,e._)`(${l}.async ? await ${g}(${i}) : ${g}(${i}))`:(0,e._)`${g}(${i})`,R=(0,e._)`(typeof ${g} == "function" ? ${E} : ${g}.test(${i}))`;return(0,e._)`${g} && ${g} !== true && ${v} === ${s} && !${R}`}}function p(){const _=w.formats[c];if(!_){d();return}if(_===!0)return;const[l,v,g]=$(_);l===s&&n.pass(E());function d(){if(y.strictSchema===!1){w.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${c}" ignored in schema at path "${f}"`}}function $(R){const F=R instanceof RegExp?(0,e.regexpCode)(R):y.code.formats?(0,e._)`${y.code.formats}${(0,e.getProperty)(c)}`:void 0,L=o.scopeValue("formats",{key:c,ref:R,code:F});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${L}.validate`]:["string",R,L]}function E(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!h.$async)throw new Error("async format in sync schema");return(0,e._)`await ${g}(${i})`}return typeof v=="function"?(0,e._)`${g}(${i})`:(0,e._)`${g}.test(${i})`}}}};return Yr.default=r,Yr}var aa;function ca(){if(aa)return Wr;aa=1,Object.defineProperty(Wr,"__esModule",{value:!0});const t=[Wm().default];return Wr.default=t,Wr}var vt={},ua;function da(){return ua||(ua=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.contentVocabulary=vt.metadataVocabulary=void 0,vt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],vt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),vt}var la;function fa(){if(la)return $r;la=1,Object.defineProperty($r,"__esModule",{value:!0});const e=Ei(),t=Vi(),r=oa(),n=ca(),s=da(),o=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return $r.default=o,$r}var Xr={},Zt={},ma;function Ym(){if(ma)return Zt;ma=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Zt.DiscrError=e={})),Zt}var ha;function us(){if(ha)return Xr;ha=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=ne(),t=Ym(),r=gr(),n=At(),s=ce(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>(0,e._)`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){const{gen:c,data:u,schema:m,parentSchema:y,it:f}=a,{oneOf:h}=y;if(!f.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=m.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(m.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const S=c.let("valid",!1),p=c.const("tag",(0,e._)`${u}${(0,e.getProperty)(w)}`);c.if((0,e._)`typeof ${p} == "string"`,()=>_(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:p,tagName:w})),a.ok(S);function _(){const g=v();c.if(!1);for(const d in g)c.elseIf((0,e._)`${p} === ${d}`),c.assign(S,l(g[d]));c.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:p,tagName:w}),c.endIf()}function l(g){const d=c.name("valid"),$=a.subschema({keyword:"oneOf",schemaProp:g},d);return a.mergeEvaluated($,e.Name),d}function v(){var g;const d={},$=R(y);let E=!0;for(let V=0;V<h.length;V++){let D=h[V];if(D?.$ref&&!(0,s.schemaHasRulesButRef)(D,f.self.RULES)){const K=D.$ref;if(D=r.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,K),D instanceof r.SchemaEnv&&(D=D.schema),D===void 0)throw new n.default(f.opts.uriResolver,f.baseId,K)}const Z=(g=D?.properties)===null||g===void 0?void 0:g[w];if(typeof Z!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${w}"`);E=E&&($||R(D)),F(Z,V)}if(!E)throw new Error(`discriminator: "${w}" must be required`);return d;function R({required:V}){return Array.isArray(V)&&V.includes(w)}function F(V,D){if(V.const)L(V.const,D);else if(V.enum)for(const Z of V.enum)L(Z,D);else throw new Error(`discriminator: "properties/${w}" must have "const" or "enum"`)}function L(V,D){if(typeof V!="string"||V in d)throw new Error(`discriminator: "${w}" values must be unique strings`);d[V]=D}}}};return Xr.default=i,Xr}const Xm={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0};var pa;function ya(){return pa||(pa=1,(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=ss(),n=fa(),s=us(),o=Xm,i=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(w,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var m=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var y=qt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return y.default}});var f=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})(dr,dr.exports)),dr.exports}var Qm=ya();const eh=ur(Qm);var Qr={exports:{}},en={},Rt={},va;function ga(){if(va)return Rt;va=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.dynamicAnchor=void 0;const e=ne(),t=Ge(),r=gr(),n=os(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>o(a,a.schema)};function o(a,c){const{gen:u,it:m}=a;m.schemaEnv.root.dynamicAnchors[c]=!0;const y=(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`,f=m.errSchemaPath==="#"?m.validateName:i(a);u.if((0,e._)`!${y}`,()=>u.assign(y,f))}Rt.dynamicAnchor=o;function i(a){const{schemaEnv:c,schema:u,self:m}=a.it,{root:y,baseId:f,localRefs:h,meta:w}=c.root,{schemaId:S}=m.opts,p=new r.SchemaEnv({schema:u,schemaId:S,root:y,baseId:f,localRefs:h,meta:w});return r.compileSchema.call(m,p),(0,n.getValidate)(a,p)}return Rt.default=s,Rt}var It={},_a;function $a(){if(_a)return It;_a=1,Object.defineProperty(It,"__esModule",{value:!0}),It.dynamicRef=void 0;const e=ne(),t=Ge(),r=os(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>s(o,o.schema)};function s(o,i){const{gen:a,keyword:c,it:u}=o;if(i[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const m=i.slice(1);if(u.allErrors)y();else{const h=a.let("valid",!1);y(h),o.ok(h)}function y(h){if(u.schemaEnv.root.dynamicAnchors[m]){const w=a.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(m)}`);a.if(w,f(w,h),f(u.validateName,h))}else f(u.validateName,h)()}function f(h,w){return w?()=>a.block(()=>{(0,r.callRef)(o,h),a.let(w,!0)}):()=>(0,r.callRef)(o,h)}}return It.dynamicRef=s,It.default=n,It}var tn={},ba;function th(){if(ba)return tn;ba=1,Object.defineProperty(tn,"__esModule",{value:!0});const e=ga(),t=ce(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,e.dynamicAnchor)(n,""):(0,t.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return tn.default=r,tn}var rn={},wa;function rh(){if(wa)return rn;wa=1,Object.defineProperty(rn,"__esModule",{value:!0});const e=$a(),t={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,e.dynamicRef)(r,r.schema)};return rn.default=t,rn}var Sa;function Ea(){if(Sa)return en;Sa=1,Object.defineProperty(en,"__esModule",{value:!0});const e=ga(),t=$a(),r=th(),n=rh(),s=[e.default,t.default,r.default,n.default];return en.default=s,en}var nn={},sn={},ka;function nh(){if(ka)return sn;ka=1,Object.defineProperty(sn,"__esModule",{value:!0});const e=cs(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return sn.default=t,sn}var on={},Pa;function sh(){if(Pa)return on;Pa=1,Object.defineProperty(on,"__esModule",{value:!0});const e=cs(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,e.validateSchemaDeps)(r)};return on.default=t,on}var an={},Oa;function oh(){if(Oa)return an;Oa=1,Object.defineProperty(an,"__esModule",{value:!0});const e=ce(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:s}){n.contains===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "contains" is ignored`)}};return an.default=t,an}var ja;function Aa(){if(ja)return nn;ja=1,Object.defineProperty(nn,"__esModule",{value:!0});const e=nh(),t=sh(),r=oh(),n=[e.default,t.default,r.default];return nn.default=n,nn}var cn={},un={},Na;function ih(){if(Na)return un;Na=1,Object.defineProperty(un,"__esModule",{value:!0});const e=ne(),t=ce(),r=Ge(),s={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:o})=>(0,e._)`{unevaluatedProperty: ${o.unevaluatedProperty}}`},code(o){const{gen:i,schema:a,data:c,errsCount:u,it:m}=o;if(!u)throw new Error("ajv implementation error");const{allErrors:y,props:f}=m;f instanceof e.Name?i.if((0,e._)`${f} !== true`,()=>i.forIn("key",c,p=>i.if(w(f,p),()=>h(p)))):f!==!0&&i.forIn("key",c,p=>f===void 0?h(p):i.if(S(f,p),()=>h(p))),m.props=!0,o.ok((0,e._)`${u} === ${r.default.errors}`);function h(p){if(a===!1){o.setParams({unevaluatedProperty:p}),o.error(),y||i.break();return}if(!(0,t.alwaysValidSchema)(m,a)){const _=i.name("valid");o.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:t.Type.Str},_),y||i.if((0,e.not)(_),()=>i.break())}}function w(p,_){return(0,e._)`!${p} || !${p}[${_}]`}function S(p,_){const l=[];for(const v in p)p[v]===!0&&l.push((0,e._)`${_} !== ${v}`);return(0,e.and)(...l)}}};return un.default=s,un}var dn={},za;function ah(){if(za)return dn;za=1,Object.defineProperty(dn,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s,u=c.items||0;if(u===!0)return;const m=o.const("len",(0,e._)`${a}.length`);if(i===!1)s.setParams({len:u}),s.fail((0,e._)`${m} > ${u}`);else if(typeof i=="object"&&!(0,t.alwaysValidSchema)(c,i)){const f=o.var("valid",(0,e._)`${m} <= ${u}`);o.if((0,e.not)(f),()=>y(f,u)),s.ok(f)}c.items=!0;function y(f,h){o.forRange("i",h,m,w=>{s.subschema({keyword:"unevaluatedItems",dataProp:w,dataPropType:t.Type.Num},f),c.allErrors||o.if((0,e.not)(f),()=>o.break())})}}};return dn.default=n,dn}var Ra;function Ia(){if(Ra)return cn;Ra=1,Object.defineProperty(cn,"__esModule",{value:!0});const e=ih(),t=ah(),r=[e.default,t.default];return cn.default=r,cn}var ln={};const ch={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},uh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},dh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},lh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},fh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},mh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},hh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Ta;function ph(){if(Ta)return ln;Ta=1,Object.defineProperty(ln,"__esModule",{value:!0});const e=ch,t=uh,r=dh,n=lh,s=fh,o=mh,i=hh,a=["/properties"];function c(u){return[e,t,r,n,m(this,s),o,m(this,i)].forEach(y=>this.addMetaSchema(y,void 0,!1)),this;function m(y,f){return u?y.$dataMetaSchema(f,a):f}}return ln.default=c,ln}var Ca;function yh(){return Ca||(Ca=1,(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.Ajv2019=void 0;const r=ss(),n=fa(),s=Ea(),o=Aa(),i=Ia(),a=us(),c=ph(),u="https://json-schema.org/draft/2019-09/schema";class m extends r.default{constructor(p={}){super({...p,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(s.default),n.default.forEach(p=>this.addVocabulary(p)),this.addVocabulary(o.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:p,meta:_}=this.opts;_&&(c.default.call(this,p),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv2019=m,e.exports=t=m,e.exports.Ajv2019=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var y=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var f=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=qt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var w=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return w.default}})})(Qr,Qr.exports)),Qr.exports}var vh=yh();const gh=ur(vh);var fn={exports:{}},mn={},Ma;function _h(){if(Ma)return mn;Ma=1,Object.defineProperty(mn,"__esModule",{value:!0});const e=Ei(),t=Vi(),r=oa(),n=Ea(),s=Aa(),o=Ia(),i=ca(),a=da(),c=[n.default,e.default,t.default,(0,r.default)(!0),i.default,a.metadataVocabulary,a.contentVocabulary,s.default,o.default];return mn.default=c,mn}var hn={};const $h={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}},bh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},wh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},Sh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},Eh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},kh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},Ph={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},Oh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Da;function jh(){if(Da)return hn;Da=1,Object.defineProperty(hn,"__esModule",{value:!0});const e=$h,t=bh,r=wh,n=Sh,s=Eh,o=kh,i=Ph,a=Oh,c=["/properties"];function u(m){return[e,t,r,n,s,y(this,o),i,y(this,a)].forEach(f=>this.addMetaSchema(f,void 0,!1)),this;function y(f,h){return m?f.$dataMetaSchema(h,c):h}}return hn.default=u,hn}var Va;function Ah(){return Va||(Va=1,(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.Ajv2020=void 0;const r=ss(),n=_h(),s=us(),o=jh(),i="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:w}=this.opts;w&&(o.default.call(this,h),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var c=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=qt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var y=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return y.default}})})(fn,fn.exports)),fn.exports}var Nh=Ah();const zh=ur(Nh);var pn={exports:{}},ds={},qa;function Rh(){return qa||(qa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(V,D){return{validate:V,compare:D}}e.fullFormats={date:t(o,i),time:t(c(!0),u),"date-time":t(f(!0),h),"iso-time":t(c(),m),"iso-date-time":t(f(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"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:L,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:v,int32:{type:"number",validate:$},int64:{type:"number",validate:E},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),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,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"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,w),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(V){return V%4===0&&(V%100!==0||V%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(V){const D=n.exec(V);if(!D)return!1;const Z=+D[1],K=+D[2],re=+D[3];return K>=1&&K<=12&&re>=1&&re<=(K===2&&r(Z)?29:s[K])}function i(V,D){if(V&&D)return V>D?1:V<D?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(V){return function(Z){const K=a.exec(Z);if(!K)return!1;const re=+K[1],ye=+K[2],me=+K[3],ue=K[4],Oe=K[5]==="-"?-1:1,U=+(K[6]||0),O=+(K[7]||0);if(U>23||O>59||V&&!ue)return!1;if(re<=23&&ye<=59&&me<60)return!0;const C=ye-O*Oe,A=re-U*Oe-(C<0?1:0);return(A===23||A===-1)&&(C===59||C===-1)&&me<61}}function u(V,D){if(!(V&&D))return;const Z=new Date("2020-01-01T"+V).valueOf(),K=new Date("2020-01-01T"+D).valueOf();if(Z&&K)return Z-K}function m(V,D){if(!(V&&D))return;const Z=a.exec(V),K=a.exec(D);if(Z&&K)return V=Z[1]+Z[2]+Z[3],D=K[1]+K[2]+K[3],V>D?1:V<D?-1:0}const y=/t|\s/i;function f(V){const D=c(V);return function(K){const re=K.split(y);return re.length===2&&o(re[0])&&D(re[1])}}function h(V,D){if(!(V&&D))return;const Z=new Date(V).valueOf(),K=new Date(D).valueOf();if(Z&&K)return Z-K}function w(V,D){if(!(V&&D))return;const[Z,K]=V.split(y),[re,ye]=D.split(y),me=i(Z,re);if(me!==void 0)return me||u(K,ye)}const S=/\/|:/,p=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(V){return S.test(V)&&p.test(V)}const l=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(V){return l.lastIndex=0,l.test(V)}const g=-2147483648,d=2**31-1;function $(V){return Number.isInteger(V)&&V<=d&&V>=g}function E(V){return Number.isInteger(V)}function R(){return!0}const F=/[^\\]\\Z/;function L(V){if(F.test(V))return!1;try{return new RegExp(V),!0}catch{return!1}}})(ds)),ds}var ls={},Fa;function Ih(){return Fa||(Fa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=ya(),r=ne(),n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:a,schemaCode:c})=>(0,r.str)`should be ${s[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,r._)`{comparison: ${s[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(a){const{gen:c,data:u,schemaCode:m,keyword:y,it:f}=a,{opts:h,self:w}=f;if(!h.validateFormats)return;const S=new t.KeywordCxt(f,w.RULES.all.format.definition,"format");S.$data?p():_();function p(){const v=c.scopeValue("formats",{ref:w.formats,code:h.code.formats}),g=c.const("fmt",(0,r._)`${v}[${S.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${g} != "object"`,(0,r._)`${g} instanceof RegExp`,(0,r._)`typeof ${g}.compare != "function"`,l(g)))}function _(){const v=S.schema,g=w.formats[v];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${y}": format "${v}" does not define "compare" function`);const d=c.scopeValue("formats",{key:v,ref:g,code:h.code.formats?(0,r._)`${h.code.formats}${(0,r.getProperty)(v)}`:void 0});a.fail$data(l(d))}function l(v){return(0,r._)`${v}.compare(${u}, ${m}) ${s[y].fail} 0`}},dependencies:["format"]};const i=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i})(ls)),ls}var Za;function Th(){return Za||(Za=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Rh(),n=Ih(),s=ne(),o=new s.Name("fullFormats"),i=new s.Name("fastFormats"),a=(u,m={keywords:!0})=>{if(Array.isArray(m))return c(u,m,r.fullFormats,o),u;const[y,f]=m.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,o],h=m.formats||r.formatNames;return c(u,h,y,f),m.keywords&&(0,n.default)(u),u};a.get=(u,m="full")=>{const f=(m==="fast"?r.fastFormats:r.fullFormats)[u];if(!f)throw new Error(`Unknown format "${u}"`);return f};function c(u,m,y,f){var h,w;(h=(w=u.opts.code).formats)!==null&&h!==void 0||(w.formats=(0,s._)`require("ajv-formats/dist/formats").${f}`);for(const S of m)u.addFormat(S,y[S])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(pn,pn.exports)),pn.exports}var Ch=Th();const fs=ur(Ch),Mh=fs(new eh({strict:!1})),Dh=fs(new gh),Ua=fs(new zh),Vh=[{patterns:["draft-07","draft-06","draft-04"],ajv:Mh,metaUri:"http://json-schema.org/draft-07/schema"},{patterns:["draft/2019-09"],ajv:Dh,metaUri:"https://json-schema.org/draft/2019-09/schema"},{patterns:["draft/2020-12"],ajv:Ua,metaUri:"https://json-schema.org/draft/2020-12/schema"}],qh=Ua,Fh="https://json-schema.org/draft/2020-12/schema";function Zh(e){const t=e.$schema??"";for(const r of Vh)if(r.patterns.some(n=>t.includes(n)))return{ajv:r.ajv,metaUri:r.metaUri};return{ajv:qh,metaUri:Fh}}function Ut(e,t=""){const r=[];if(e===null||typeof e!="object")return r;const n=p=>typeof p=="number"?p:void 0,s=n(e.minimum),o=n(e.maximum),i=e.exclusiveMinimum,a=e.exclusiveMaximum,c=n(e.minLength),u=n(e.maxLength),m=n(e.minItems),y=n(e.maxItems),f=n(e.minContains),h=n(e.maxContains),w=n(e.minProperties),S=n(e.maxProperties);if(s!==void 0&&o!==void 0&&(typeof i=="boolean"&&i||typeof a=="boolean"&&a?o<=s:o<s)&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be >= minimum (${s})`}),typeof i=="number"&&(o!==void 0&&o<=i&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be > exclusiveMinimum (${i})`}),s!==void 0&&i===s&&r.push({instancePath:`${t}/exclusiveMinimum`,message:`exclusiveMinimum (${i}) must not equal minimum (${s})`})),typeof a=="number"&&(s!==void 0&&a<=s&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > minimum (${s})`}),typeof i=="number"&&a<=i&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > exclusiveMinimum (${i})`}),o!==void 0&&a===o&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must not equal maximum (${o})`})),c!==void 0&&u!==void 0&&u<c&&r.push({instancePath:`${t}/maxLength`,message:`maxLength (${u}) must be >= minLength (${c})`}),m!==void 0&&y!==void 0&&y<m&&r.push({instancePath:`${t}/maxItems`,message:`maxItems (${y}) must be >= minItems (${m})`}),f!==void 0&&h!==void 0&&h<f&&r.push({instancePath:`${t}/maxContains`,message:`maxContains (${h}) must be >= minContains (${f})`}),w!==void 0&&S!==void 0&&S<w&&r.push({instancePath:`${t}/maxProperties`,message:`maxProperties (${S}) must be >= minProperties (${w})`}),e.properties&&typeof e.properties=="object"&&!Array.isArray(e.properties))for(const p of Object.keys(e.properties))r.push(...Ut(e.properties[p],`${t}/properties/${p}`));if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)&&r.push(...Ut(e.items,`${t}/items`)),e.$defs&&typeof e.$defs=="object")for(const p of Object.keys(e.$defs))r.push(...Ut(e.$defs[p],`${t}/$defs/${p}`));if(e.definitions&&typeof e.definitions=="object")for(const p of Object.keys(e.definitions))r.push(...Ut(e.definitions[p],`${t}/definitions/${p}`));return r}function xa(e){const{ajv:t,metaUri:r}=Zh(e),s=t.validate(r,e)?[]:t.errors??[],o=Ut(e),i=[...s,...o];return i.length>0?i:null}function Uh(e={}){const{rootType:t="object",defaultValue:r,onChange:n}=e,s=r!=null&&Object.keys(r).length>0,o=ee.useRef(n);o.current=n;const i=ee.useMemo(()=>Ye(6),[]),a=ee.useCallback(O=>({root:{type:t,$schema:"http://json-schema.org/draft/2020-12/schema",...t==="object"&&{additionalProperties:!0},...t==="array"&&{items:{type:"string"}}},properties:t==="object"?[{id:O,key:`field_${O}`,isRequired:!1,schema:{type:"number"}}]:[],definitions:[]}),[t]),c=fm({resolver:ym(go),defaultValues:s?vs(r):a(i)}),{setError:u,clearErrors:m,setValue:y,reset:f,getValues:h}=c,{fields:w,append:S,remove:p}=qo({control:c.control,name:"properties",keyName:"fieldId"}),{fields:_,append:l,remove:v}=qo({control:c.control,name:"definitions",keyName:"defId"}),[g,d]=ee.useState(()=>vn(h())),[$,E]=ee.useState(null),[R,F]=ee.useState({isOpen:!1,fieldPath:null}),L=ee.useRef("");ee.useEffect(()=>{const O=c.watch(C=>{const A=vn(C),b=JSON.stringify(A);if(b!==L.current){L.current=b,d(A),o.current?.(A);const P=xa(A);E(I=>JSON.stringify(P)!==JSON.stringify(I)?P:I)}});return()=>O.unsubscribe()},[c]),ee.useEffect(()=>{const O={exclusiveMinimum:"exclusiveMin",exclusiveMaximum:"exclusiveMax"};if(m(),$){const C=h("properties");$.forEach(A=>{const b=A.instancePath.split("/").filter(Boolean);if(b[0]==="properties"&&b.length>=3){const P=C?.findIndex(I=>I.key===b[1])??-1;if(P!==-1){const I=b[2],B=O[I]??I;u(`properties.${P}.schema.${B}`,{type:"ajv",message:A.message})}}else if(b.length>0){const P=b[0],I=O[P]??P;u(`root.${I}`,{type:"ajv",message:A.message})}})}},[$,m,u,h]),ee.useEffect(()=>{if(!s){const O=Ye(6);f(a(O))}},[t,f,s,a]);const V=ee.useCallback(()=>{const O=Ye(6);S({id:O,key:`field_${O}`,isRequired:!1,schema:{type:"string"}})},[S]),D=ee.useCallback(O=>{p(O)},[p]),Z=ee.useCallback(()=>{const O=Ye(6);l({id:O,key:`def_${O}`,schema:{type:"object",additionalProperties:!0}})},[l]),K=ee.useCallback(O=>{const C=h(`definitions.${O}.key`);re(C,null),v(O)},[h,v]),re=ee.useCallback((O,C)=>{const A=`#/$defs/${O}`,b=C?`#/$defs/${C}`:"",P=h(),I=(B,G)=>{G&&(G.schema&&G.schema.$ref===A&&y(`${B}.schema.$ref`,b),G.$ref===A&&y(`${B}.$ref`,b),G.schema?.properties&&Array.isArray(G.schema.properties)&&G.schema.properties.forEach((ae,se)=>{I(`${B}.schema.properties.${se}`,ae)}),G.properties&&Array.isArray(G.properties)&&G.properties.forEach((ae,se)=>{I(`${B}.properties.${se}`,ae)}),G.schema?.items&&(Array.isArray(G.schema.items)||I(`${B}.schema.items`,{schema:G.schema.items})))};P.properties&&P.properties.forEach((B,G)=>{I(`properties.${G}`,B)}),P.definitions&&P.definitions.forEach((B,G)=>{B.key!==O&&I(`definitions.${G}`,B)}),P.root&&P.root.$ref===A&&y("root.$ref",b)},[h,y]),ye=ee.useCallback(O=>{F({isOpen:!0,fieldPath:O})},[]),me=ee.useCallback(()=>{F({isOpen:!1,fieldPath:null})},[]),ue=ee.useCallback((O,C)=>{let A={};C==="object"?A={type:"object",properties:[],additionalProperties:!0}:C==="array"?A={type:"array"}:C==="ref"?A={type:"ref",$ref:""}:A={type:C},y(`${O}.schema`,A)},[y]),Oe=ee.useCallback(O=>{const C=Ye(6),A=h(`${O}.schema.properties`)||[];y(`${O}.schema.properties`,[...A,{id:C,key:`field_${C}`,isRequired:!1,schema:{type:"string"}}])},[y,h]),U=ee.useCallback(()=>{const O=Ye(6);f(a(O))},[f,a]);return{schema:g,errors:$,fields:w,definitions:_,form:c,settingsState:R,addField:V,removeField:D,addDefinition:Z,removeDefinition:K,updateReferences:re,openSettings:ye,closeSettings:me,handleTypeChange:ue,addNestedField:Oe,reset:U}}Se.DEFAULT_SCHEMA_URI=yn,Se.INTEGER_FORMATS=Ha,Se.NUMBER_FORMATS=Ga,Se.SCHEMA_TYPES=ps,Se.SCHEMA_TYPES_WITH_REF=Ja,Se.STRING_FORMATS=Ba,Se.createDefaultArraySchema=Ya,Se.createDefaultField=Xa,Se.createDefaultObjectSchema=Wa,Se.formSchema=go,Se.formToSchema=vn,Se.jsonSchemaZod=Ze,Se.schemaToForm=vs,Se.useJsonSchemaEditor=Uh,Se.validateSchema=xa,Object.defineProperty(Se,Symbol.toStringTag,{value:"Module"})}));
|