schemas/libraries/ata-validator/download_compiled/minified.jsCopy to clipboardvar e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o(((e,t)=>{let n={Object,Array,Function,Number,String,Date,RegExp,Promise,Map,Set,WeakMap,WeakSet,Buffer:typeof Buffer<`u`?Buffer:void 0,Uint8Array,ArrayBuffer};function r(e,t){let i=[];if(!e||typeof e!=`object`||!e.properties)return i;for(let[a,o]of Object.entries(e.properties)){if(!o||typeof o!=`object`)continue;let e=t?t+`/`+a:`/`+a;if(o.instanceof){let t=Array.isArray(o.instanceof)?o.instanceof:[o.instanceof],r=t.map(e=>n[e]).filter(Boolean);if(r.length>0){let n=Object.freeze({keyword:`instanceof`,instancePath:e,schemaPath:``,params:Object.freeze({expected:t.join(` | `)}),message:`expected instanceof `+t.join(` | `)});i.push({key:a,ctors:r,type:`instanceof`,error:n})}}if(o.typeof){let t=Array.isArray(o.typeof)?o.typeof:[o.typeof],n=Object.freeze({keyword:`typeof`,instancePath:e,schemaPath:``,params:Object.freeze({expected:t.join(` | `)}),message:`expected typeof `+t.join(` | `)});i.push({key:a,types:t,type:`typeof`,error:n})}if(o.properties){let t=r(o,e);t.length>0&&i.push({key:a,type:`nested`,sub:t})}}return i}function i(e,t,n){for(let r=0;r<t.length;r++){let a=t[r],o=e[a.key];if(o!==void 0)if(a.type===`instanceof`){let e=!1;for(let t=0;t<a.ctors.length;t++)if(o instanceof a.ctors[t]){e=!0;break}e||n.push(a.error)}else if(a.type===`typeof`){let e=!1;for(let t=0;t<a.types.length;t++)if(typeof o===a.types[t]){e=!0;break}e||n.push(a.error)}else a.type===`nested`&&o&&typeof o==`object`&&!Array.isArray(o)&&i(o,a.sub,n)}}function a(e){let t=e._schemaObj,n=r(t,``);e.validate({});let a=e.validate;return n.length===0||(e.validate=function(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=[];if(i(e,n,t),t.length>0)return{valid:!1,errors:t}}return a(e)}),e}a.CONSTRUCTORS=n,t.exports={withKeywords:a,CONSTRUCTORS:n}})),u=o((()=>{})),d=o(((e,t)=>{t.exports={name:`ata`,napi_versions:[10]}})),f=o(((e,t)=>{let n={type:e=>`must be ${e.type}`,required:e=>`must have required property '${e.missingProperty}'`,additionalProperties:()=>`must NOT have additional properties`,enum:()=>`must be equal to one of the allowed values`,const:()=>`must be equal to constant`,minimum:e=>`must be >= ${e.limit}`,maximum:e=>`must be <= ${e.limit}`,exclusiveMinimum:e=>`must be > ${e.limit}`,exclusiveMaximum:e=>`must be < ${e.limit}`,minLength:e=>`must NOT have fewer than ${e.limit} characters`,maxLength:e=>`must NOT have more than ${e.limit} characters`,pattern:e=>`must match pattern "${e.pattern}"`,format:e=>`must match format "${e.format}"`,minItems:e=>`must NOT have fewer than ${e.limit} items`,maxItems:e=>`must NOT have more than ${e.limit} items`,uniqueItems:e=>`must NOT have duplicate items (items ## ${e.j} and ${e.i} are identical)`,minProperties:e=>`must NOT have fewer than ${e.limit} properties`,maxProperties:e=>`must NOT have more than ${e.limit} properties`,multipleOf:e=>`must be multiple of ${e.multipleOf}`,oneOf:()=>`must match exactly one schema in oneOf`,anyOf:()=>`must match a schema in anyOf`,allOf:()=>`must match all schemas in allOf`,not:()=>`must NOT be valid`,if:e=>`must match "${e.failingKeyword}" schema`};function r(e,t,n){if(typeof e==`boolean`)return e?()=>!0:()=>!1;if(typeof e!=`object`||!e||!t&&!u(e,n))return null;let s=t||i(e);if(e.patternProperties||e.dependentSchemas||e.propertyNames)return null;let l=[];if(e.$ref){let t=a(e.$ref,s,n);if(!t)return null;l.push(t)}if(e.type){let t=Array.isArray(e.type)?e.type:[e.type];l.push(o(t))}if(e.enum){let t=e.enum,n=t.filter(e=>typeof e!=`object`||!e),r=t.filter(e=>typeof e==`object`&&!!e),i=new Set(n.map(e=>e===null?`null`:typeof e==`string`?`s:`+e:`n:`+e)),a=r.map(e=>JSON.stringify(e));l.push(e=>{let t=e===null?`null`:typeof e==`string`?`s:`+e:typeof e==`number`||typeof e==`boolean`?`n:`+e:null;if(t!==null&&i.has(t))return!0;let r=JSON.stringify(e);for(let e=0;e<a.length;e++)if(r===a[e])return!0;for(let t=0;t<n.length;t++)if(e===n[t])return!0;return!1})}if(e.const!==void 0){let t=e.const;if(typeof t!=`object`||!t)l.push(e=>e===t);else{let e=JSON.stringify(t);l.push(t=>JSON.stringify(t)===e)}}if(e.required&&Array.isArray(e.required))for(let t of e.required)l.push(e=>typeof e==`object`&&!!e&&t in e);if(e.properties)for(let[t,n]of Object.entries(e.properties)){let e=r(n,s);if(!e)return null;l.push(n=>typeof n!=`object`||!n||!(t in n)?!0:e(n[t]))}if(e.additionalProperties!==void 0&&e.properties){if(e.additionalProperties===!1){let t=new Set(Object.keys(e.properties));l.push(e=>{if(typeof e!=`object`||!e||Array.isArray(e))return!0;let n=Object.keys(e);for(let e=0;e<n.length;e++)if(!t.has(n[e]))return!1;return!0})}else if(typeof e.additionalProperties==`object`){let t=r(e.additionalProperties,s);if(!t)return null;let n=new Set(Object.keys(e.properties||{}));l.push(e=>{if(typeof e!=`object`||!e||Array.isArray(e))return!0;let r=Object.keys(e);for(let i=0;i<r.length;i++)if(!n.has(r[i])&&!t(e[r[i]]))return!1;return!0})}}if(e.dependentRequired)for(let[t,n]of Object.entries(e.dependentRequired))l.push(e=>{if(typeof e!=`object`||!e||!(t in e))return!0;for(let t=0;t<n.length;t++)if(!(n[t]in e))return!1;return!0});if(e.items){let t=r(e.items,s);if(!t)return null;l.push(e=>{if(!Array.isArray(e))return!0;for(let n=0;n<e.length;n++)if(!t(e[n]))return!1;return!0})}if(e.prefixItems){let t=[];for(let n of e.prefixItems){let e=r(n,s);if(!e)return null;t.push(e)}l.push(e=>{if(!Array.isArray(e))return!0;for(let n=0;n<t.length&&n<e.length;n++)if(!t[n](e[n]))return!1;return!0})}if(e.contains){let t=r(e.contains,s);if(!t)return null;let n=e.minContains===void 0?1:e.minContains,i=e.maxContains===void 0?1/0:e.maxContains;l.push(e=>{if(!Array.isArray(e))return!0;let r=0;for(let n=0;n<e.length;n++)t(e[n])&&r++;return r>=n&&r<=i})}if(e.uniqueItems){let e=t=>typeof t!=`object`||!t?typeof t+`:`+t:Array.isArray(t)?`[`+t.map(e).join(`,`)+`]`:`{`+Object.keys(t).sort().map(n=>JSON.stringify(n)+`:`+e(t[n])).join(`,`)+`}`;l.push(t=>{if(!Array.isArray(t))return!0;let n=new Set;for(let r=0;r<t.length;r++){let i=e(t[r]);if(n.has(i))return!1;n.add(i)}return!0})}if(e.minimum!==void 0){let t=e.minimum;l.push(e=>typeof e!=`number`||e>=t)}if(e.maximum!==void 0){let t=e.maximum;l.push(e=>typeof e!=`number`||e<=t)}if(e.exclusiveMinimum!==void 0){let t=e.exclusiveMinimum;l.push(e=>typeof e!=`number`||e>t)}if(e.exclusiveMaximum!==void 0){let t=e.exclusiveMaximum;l.push(e=>typeof e!=`number`||e<t)}if(e.multipleOf!==void 0){let t=e.multipleOf;l.push(e=>typeof e!=`number`||e%t===0)}if(e.minLength!==void 0){let t=e.minLength;l.push(e=>typeof e!=`string`||e.length>=t)}if(e.maxLength!==void 0){let t=e.maxLength;l.push(e=>typeof e!=`string`||e.length<=t)}if(e.pattern)try{let t=new RegExp(e.pattern);l.push(e=>typeof e!=`string`||t.test(e))}catch{return null}if(e.format){let t=c[e.format];t&&l.push(e=>typeof e!=`string`||t(e))}if(e.minItems!==void 0){let t=e.minItems;l.push(e=>!Array.isArray(e)||e.length>=t)}if(e.maxItems!==void 0){let t=e.maxItems;l.push(e=>!Array.isArray(e)||e.length<=t)}if(e.minProperties!==void 0){let t=e.minProperties;l.push(e=>typeof e!=`object`||!e||Object.keys(e).length>=t)}if(e.maxProperties!==void 0){let t=e.maxProperties;l.push(e=>typeof e!=`object`||!e||Object.keys(e).length<=t)}if(e.allOf){let t=[];for(let n of e.allOf){let e=r(n,s);if(!e)return null;t.push(e)}l.push(e=>{for(let n=0;n<t.length;n++)if(!t[n](e))return!1;return!0})}if(e.anyOf){let t=[];for(let n of e.anyOf){let e=r(n,s);if(!e)return null;t.push(e)}l.push(e=>{for(let n=0;n<t.length;n++)if(t[n](e))return!0;return!1})}if(e.oneOf){let t=[];for(let n of e.oneOf){let e=r(n,s);if(!e)return null;t.push(e)}l.push(e=>{let n=0;for(let r=0;r<t.length;r++)if(t[r](e)&&n++,n>1)return!1;return n===1})}if(e.not){let t=r(e.not,s);if(!t)return null;l.push(e=>!t(e))}if(e.if){let t=r(e.if,s);if(!t)return null;let n=e.then?r(e.then,s):null,i=e.else?r(e.else,s):null;if(e.then&&!n||e.else&&!i)return null;l.push(e=>t(e)?n?n(e):!0:i?i(e):!0)}return l.length===0?()=>!0:l.length===1?l[0]:e=>{for(let t=0;t<l.length;t++)if(!l[t](e))return!1;return!0}}function i(e){let t={},n=e.$defs||e.definitions;if(n&&typeof n==`object`)for(let[e,i]of Object.entries(n)){let n;t[e]={get fn(){return n===void 0&&(n=null,n=r(i,t)),n||(()=>!0)},raw:i}}return t}function a(e,t,n){if(t){let n=e.match(/^#\/(?:\$defs|definitions)\/(.+)$/);if(n){let e=t[n[1]];if(e)return t=>{let n=e.fn;return n?n(t):!0}}}return n&&n.has(e)?r(n.get(e),null,n)||(()=>!0):null}function o(e){if(e.length===1)return s[e[0]]||(()=>!0);let t=e.map(e=>s[e]).filter(Boolean);return e=>{for(let n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}let s={string:e=>typeof e==`string`,number:e=>typeof e==`number`&&isFinite(e),integer:e=>Number.isInteger(e),boolean:e=>typeof e==`boolean`,null:e=>e===null,array:e=>Array.isArray(e),object:e=>typeof e==`object`&&!!e&&!Array.isArray(e)},c={email:e=>{let t=e.indexOf(`@`);return t>0&&t<e.length-1&&e.indexOf(`.`,t)>t+1},date:e=>e.length===10&&/^\d{4}-\d{2}-\d{2}$/.test(e),uuid:e=>e.length===36&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e),ipv4:e=>{let t=e.split(`.`);return t.length===4&&t.every(e=>{let t=+e;return t>=0&&t<=255&&String(t)===e})},hostname:e=>e.length>0&&e.length<=253&&/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i.test(e)},l=new Set([`__proto__`,`constructor`,`toString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`]);function u(e,t){if(typeof e==`boolean`||typeof e!=`object`||!e)return!0;if(e.items===!1||e.items===!0&&!e.unevaluatedItems)return!1;if(e.additionalProperties===!0)return!0;if(e.properties){for(let n of Object.values(e.properties))if(n===!1||n!==!0&&!u(n,t))return!1}if(e.required){for(let t of e.required)if(l.has(t))return!1}if(e.properties){for(let t of Object.keys(e.properties))if(l.has(t)||t===`$ref`)return!1}if(e.pattern&&/\\[pP]\{/.test(e.pattern))return!1;if(e.$ref){let n=/^#\/(?:\$defs|definitions)\/[^/]+$/.test(e.$ref),r=!n&&t&&t.has(e.$ref);if(!n&&!r||Object.keys(e).filter(e=>e!==`$ref`&&e!==`$defs`&&e!==`definitions`&&e!==`$schema`&&e!==`$id`).length>0&&e.unevaluatedProperties===void 0&&e.unevaluatedItems===void 0)return!1}if(typeof e.additionalProperties==`object`||e.additionalProperties===!1&&!e.properties||e.propertyNames===!1||e.unevaluatedProperties!==void 0&&typeof e.unevaluatedProperties==`object`&&e.unevaluatedProperties!==null&&!u(e.unevaluatedProperties,t)||e.unevaluatedItems!==void 0&&typeof e.unevaluatedItems==`object`&&e.unevaluatedItems!==null&&!u(e.unevaluatedItems,t))return!1;let n=e.$defs||e.definitions;if(n){for(let[e,r]of Object.entries(n))if(/[~/"']/.test(e)||typeof r==`boolean`||typeof r==`object`&&r&&(r.$id||r.$ref||!u(r,t)))return!1}let r=[e.items,e.contains,e.not,e.if,e.then,e.else,...e.prefixItems||[],...e.allOf||[],...e.anyOf||[],...e.oneOf||[]];typeof e.additionalProperties==`object`&&r.push(e.additionalProperties);for(let e of r)if(e!=null&&(e===!1||e!==!0&&!u(e,t)))return!1;return!0}function d(e,t){if(typeof e==`boolean`)return e?()=>!0:()=>!1;if(typeof e!=`object`||!e||!u(e,t))return null;let n=e.$defs||e.definitions||null;if(e.patternProperties){for(let[n,r]of Object.entries(e.patternProperties))if(typeof r==`boolean`||/\\[pP]\{/.test(n)||typeof r==`object`&&r&&!u(r,t))return null}if(e.dependentSchemas){for(let n of Object.values(e.dependentSchemas))if(typeof n==`boolean`||typeof n==`object`&&n&&!u(n,t))return null}if(e.propertyNames){if(typeof e.propertyNames==`boolean`)return null;let t=e.propertyNames,n=[`maxLength`,`minLength`,`pattern`,`const`,`enum`];if(Object.keys(t).filter(e=>e!==`$schema`).some(e=>!n.includes(e)))return null}let r={varCounter:0,helpers:[],helperCode:[],closureVars:[],closureVals:[],rootDefs:n,refStack:new Set,schemaMap:t||null},i=[];if(p(e,`d`,i,r),r.deferredChecks)for(let e of r.deferredChecks)i.push(e);if(i.length===0)return()=>!0;let a=i.join(` `),o=r.closureVars,s=r.closureVals;for(let e of r.helperCode){let t=e.match(/^const (_re\d+)=new RegExp\((.+)\)$/);t&&(o.push(t[1]),s.push(new RegExp(JSON.parse(t[2]))))}let c=a+` return true`;try{let e;e=o.length>0?Function(...o,`return function(d){${c}}`)(...s):Function(`d`,c);let t=f(a+` return R`);try{let n=Function(...o,`R`,`E`,`return function(d){${t}}`);e._hybridFactory=(e,t)=>n(...s,e,t)}catch{}let n=r.helperCode.length?r.helperCode.join(` `)+` `:``;return e._source=n+c,e._hybridSource=n+t,e}catch{return null}}function f(e){let t=``,n=0;for(;n<e.length;)if(e.startsWith(`function`,n)&&(n===0||/[^a-zA-Z_$]/.test(e[n-1]))){let r=n+8;for(;r<e.length&&e[r]!==`{`;)r++;t+=e.slice(n,r+1),n=r+1;let i=1;for(;n<e.length&&i>0;)e[n]===`{`?i++:e[n]===`}`&&i--,i>0?t+=e[n]:t+=`}`,n++}else e.startsWith(`return false`,n)?(t+=`return E(d)`,n+=12):e.startsWith(`return true`,n)&&(n+11>=e.length||!/[a-zA-Z_$]/.test(e[n+11]))?(t+=`return R`,n+=11):(t+=e[n],n++);return t}function p(e,t,n,r,i){if(typeof e!=`object`||!e)return;let a=e.$ref&&(e.unevaluatedProperties!==void 0||e.unevaluatedItems!==void 0);if(e.$ref){let o=e.$ref.match(/^#\/(?:\$defs|definitions)\/(.+)$/);if(o&&r.rootDefs&&r.rootDefs[o[1]]){if(r.refStack.has(e.$ref)){if(!a)return}else if(r.refStack.add(e.$ref),p(r.rootDefs[o[1]],t,n,r,i),r.refStack.delete(e.$ref),!a)return}else if(r.schemaMap&&r.schemaMap.has(e.$ref)){if(r.refStack.has(e.$ref)){if(!a)return}else if(r.refStack.add(e.$ref),p(r.schemaMap.get(e.$ref),t,n,r,i),r.refStack.delete(e.$ref),!a)return}else if(!a)return}let o=e.type?Array.isArray(e.type)?e.type:[e.type]:null,s=i;if(o){if(!i){let e=o.map(e=>{switch(e){case`object`:return`(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t}))`;case`array`:return`Array.isArray(${t})`;case`string`:return`typeof ${t}==='string'`;case`number`:return`(typeof ${t}==='number'&&isFinite(${t}))`;case`integer`:return`Number.isInteger(${t})`;case`boolean`:return`(${t}===true||${t}===false)`;case`null`:return`${t}===null`;default:return`true`}});n.push(`if(!(${e.join(`||`)}))return false`)}o.length===1&&(s=o[0])}let c=s===`object`,l=s===`array`,u=s===`string`,d=s===`number`||s===`integer`,f=c?``:`typeof ${t}==='object'&&${t}!==null&&`;if(c||`${t}${t}`,e.enum){let r=e.enum,i=r.filter(e=>typeof e!=`object`||!e),a=r.filter(e=>typeof e==`object`&&!!e),o=[i.map(e=>`${t}===${JSON.stringify(e)}`).join(`||`),a.map(e=>`JSON.stringify(${t})===${JSON.stringify(JSON.stringify(e))}`).join(`||`)].filter(Boolean).join(`||`);n.push(`if(!(${o||`false`}))return false`)}if(e.const!==void 0){let r=e.const;typeof r!=`object`||!r?n.push(`if(${t}!==${JSON.stringify(r)})return false`):n.push(`if(JSON.stringify(${t})!==${JSON.stringify(JSON.stringify(r))})return false`)}let g=new Set(e.required||[]),v={};if(e.required&&e.properties&&c){let r=[];for(let n of e.required){v[n]=`${t}[${JSON.stringify(n)}]`;let i=e.properties[n];i&&(i.type||i.enum||i.const!==void 0)||r.push(`${t}[${JSON.stringify(n)}]===undefined`)}r.length>0&&n.push(`if(${r.join(`||`)})return false`)}else if(e.required&&e.required.length>0)if(c){let r=e.required.map(e=>`${t}[${JSON.stringify(e)}]===undefined`);n.push(`if(${r.join(`||`)})return false`)}else for(let r of e.required)n.push(`if(typeof ${t}!=='object'||${t}===null||!(${JSON.stringify(r)} in ${t}))return false`);if(e.unevaluatedProperties===!1&&e.properties&&e.required&&c){let i=E(e,r.schemaMap,r.rootDefs);if(!i.dynamic&&!i.allProps){let a=i.props,o=a.length;e.required.length>=o&&a.every(t=>e.required.includes(t))&&o>0&&(o<=15?n.push(`var _n=0;for(var _k in ${t})_n++;if(_n!==${o})return false`):n.push(`if(Object.keys(${t}).length!==${o})return false`),r._earlyKeyCount=!0)}}if(e.minimum!==void 0&&n.push(d?`if(${t}<${e.minimum})return false`:`if(typeof ${t}==='number'&&${t}<${e.minimum})return false`),e.maximum!==void 0&&n.push(d?`if(${t}>${e.maximum})return false`:`if(typeof ${t}==='number'&&${t}>${e.maximum})return false`),e.exclusiveMinimum!==void 0&&n.push(d?`if(${t}<=${e.exclusiveMinimum})return false`:`if(typeof ${t}==='number'&&${t}<=${e.exclusiveMinimum})return false`),e.exclusiveMaximum!==void 0&&n.push(d?`if(${t}>=${e.exclusiveMaximum})return false`:`if(typeof ${t}==='number'&&${t}>=${e.exclusiveMaximum})return false`),e.multipleOf!==void 0&&n.push(d?`if(${t}%${e.multipleOf}!==0)return false`:`if(typeof ${t}==='number'&&${t}%${e.multipleOf}!==0)return false`),e.minLength!==void 0&&n.push(u?`if(${t}.length<${e.minLength})return false`:`if(typeof ${t}==='string'&&${t}.length<${e.minLength})return false`),e.maxLength!==void 0&&n.push(u?`if(${t}.length>${e.maxLength})return false`:`if(typeof ${t}==='string'&&${t}.length>${e.maxLength})return false`),e.minItems!==void 0&&n.push(l?`if(${t}.length<${e.minItems})return false`:`if(Array.isArray(${t})&&${t}.length<${e.minItems})return false`),e.maxItems!==void 0&&n.push(l?`if(${t}.length>${e.maxItems})return false`:`if(Array.isArray(${t})&&${t}.length>${e.maxItems})return false`),e.minProperties!==void 0&&n.push(`if(${f}Object.keys(${t}).length<${e.minProperties})return false`),e.maxProperties!==void 0&&n.push(`if(${f}Object.keys(${t}).length>${e.maxProperties})return false`),e.pattern){let i=_(e.pattern,t);if(i)n.push(u?`if(!(${i}))return false`:`if(typeof ${t}==='string'&&!(${i}))return false`);else{let i=r.varCounter++;r.helperCode.push(`const _re${i}=new RegExp(${JSON.stringify(e.pattern)})`),n.push(u?`if(!_re${i}.test(${t}))return false`:`if(typeof ${t}==='string'&&!_re${i}.test(${t}))return false`)}}if(e.format){let r=m[e.format];r&&n.push(r(t,u))}if(e.uniqueItems){let i=r.varCounter++,a=e.items&&typeof e.items==`object`&&e.items.type,o=a===`string`||a===`number`||a===`integer`,s=e.maxItems,c=o&&s&&s<=16?`for(let _i=1;_i<${t}.length;_i++){for(let _k=0;_k<_i;_k++){if(${t}[_i]===${t}[_k])return false}}`:o?`const _s${i}=new Set();for(let _i=0;_i<${t}.length;_i++){if(_s${i}.has(${t}[_i]))return false;_s${i}.add(${t}[_i])}`:`const _cn${i}=function(x){if(x===null||typeof x!=='object')return typeof x+':'+x;if(Array.isArray(x))return'['+x.map(_cn${i}).join(',')+']';return'{'+Object.keys(x).sort().map(function(k){return JSON.stringify(k)+':'+_cn${i}(x[k])}).join(',')+'}'};const _s${i}=new Set();for(let _i=0;_i<${t}.length;_i++){const _k=_cn${i}(${t}[_i]);if(_s${i}.has(_k))return false;_s${i}.add(_k)}`;n.push(l?`{${c}}`:`if(Array.isArray(${t})){${c}}`)}if(e.additionalProperties===!1&&e.properties&&!e.patternProperties){let n=Object.keys(e.properties).length,i=e.required&&e.required.length===n?n<=15?`var _n=0;for(var _k in ${t})_n++;if(_n!==${n})return false`:`if(Object.keys(${t}).length!==${n})return false`:`for(var _k in ${t})if(${Object.keys(e.properties).map(e=>`_k!==${JSON.stringify(e)}`).join(`&&`)})return false`;r.deferredChecks||=[],r.deferredChecks.push(c?i:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${i}}`)}if(e.dependentRequired)for(let[r,i]of Object.entries(e.dependentRequired)){let e=i.map(e=>`!('${h(e)}' in ${t})`).join(`||`);n.push(`if(${f}'${h(r)}' in ${t}&&(${e}))return false`)}if(e.patternProperties){let i=Object.entries(e.patternProperties),a=e.propertyNames&&typeof e.propertyNames==`object`?e.propertyNames:null,o=r.varCounter++,s=`_ppk${o}`,l=[];for(let[e]of i){let t=b(e,s);if(t)l.push({check:t});else{let t=r.varCounter++;r.closureVars.push(`_re${t}`),r.closureVals.push(new RegExp(e)),l.push({check:`_re${t}.test(${s})`})}}for(let e=0;e<i.length;e++){let[,t]=i[e],n=[];p(t,`_ppv`,n,r);let a=n.length===0?`return true`:`${n.join(`;`)};return true`,s=`_ppf${o}_${e}`;r.closureVars.push(s),r.closureVals.push(Function(`_ppv`,a))}let u=c?``:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t}))`;if(e.additionalProperties===!1&&e.properties){r._ppHandledAdditional=!0,r._ppHandledPropertyNames=!!a;let c=Object.keys(e.properties);if(n.push(`${u}{for(const ${s} in ${t}){`),a){if(a.minLength!==void 0&&n.push(`if(${s}.length<${a.minLength})return false`),a.maxLength!==void 0&&n.push(`if(${s}.length>${a.maxLength})return false`),a.pattern){let e=b(a.pattern,s);if(e)n.push(`if(!(${e}))return false`);else{let e=r.varCounter++;r.closureVars.push(`_re${e}`),r.closureVals.push(new RegExp(a.pattern)),n.push(`if(!_re${e}.test(${s}))return false`)}}if(a.const!==void 0&&n.push(`if(${s}!==${JSON.stringify(a.const)})return false`),a.enum){let e=r.varCounter++;r.closureVars.push(`_es${e}`),r.closureVals.push(new Set(a.enum)),n.push(`if(!_es${e}.has(${s}))return false`)}}let d=c.map(e=>`case ${JSON.stringify(e)}:`).join(``);n.push(`switch(${s}){${d}break;default:`);let f=[];for(let e=0;e<i.length;e++)f.push(`if(${l[e].check}){if(!_ppf${o}_${e}(${t}[${s}]))return false}else{return false}`);f.length>0?n.push(f.join(``)):n.push(`return false`),n.push(`}`),n.push(`}}`)}else{if(r._ppHandledPropertyNames=!!a,n.push(`${u}{for(const ${s} in ${t}){`),a){if(a.minLength!==void 0&&n.push(`if(${s}.length<${a.minLength})return false`),a.maxLength!==void 0&&n.push(`if(${s}.length>${a.maxLength})return false`),a.pattern){let e=b(a.pattern,s);if(e)n.push(`if(!(${e}))return false`);else{let e=r.varCounter++;r.closureVars.push(`_re${e}`),r.closureVals.push(new RegExp(a.pattern)),n.push(`if(!_re${e}.test(${s}))return false`)}}if(a.const!==void 0&&n.push(`if(${s}!==${JSON.stringify(a.const)})return false`),a.enum){let e=r.varCounter++;r.closureVars.push(`_es${e}`),r.closureVals.push(new Set(a.enum)),n.push(`if(!_es${e}.has(${s}))return false`)}}for(let e=0;e<i.length;e++)n.push(`if(${l[e].check}&&!_ppf${o}_${e}(${t}[${s}]))return false`);n.push(`}}`)}}if(e.dependentSchemas)for(let[i,a]of Object.entries(e.dependentSchemas)){let e=c?``:`typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&`;n.push(`if(${e}${JSON.stringify(i)} in ${t}){`),p(a,t,n,r,s),n.push(`}`)}if(e.propertyNames&&typeof e.propertyNames==`object`&&!r._ppHandledPropertyNames){let i=e.propertyNames,a=r.varCounter++,o=c?``:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t}))`;if(n.push(`${o}{for(const _k${a} in ${t}){`),i.minLength!==void 0&&n.push(`if(_k${a}.length<${i.minLength})return false`),i.maxLength!==void 0&&n.push(`if(_k${a}.length>${i.maxLength})return false`),i.pattern){let e=b(i.pattern,`_k${a}`);if(e)n.push(`if(!(${e}))return false`);else{let e=r.varCounter++;r.closureVars.push(`_re${e}`),r.closureVals.push(new RegExp(i.pattern)),n.push(`if(!_re${e}.test(_k${a}))return false`)}}if(i.const!==void 0&&n.push(`if(_k${a}!==${JSON.stringify(i.const)})return false`),i.enum){let e=r.varCounter++;r.closureVars.push(`_es${e}`),r.closureVals.push(new Set(i.enum)),n.push(`if(!_es${e}.has(_k${a}))return false`)}n.push(`}}`)}if(e.properties)for(let[i,a]of Object.entries(e.properties))if(g.has(i)&&c)p(a,v[i]||`${t}[${JSON.stringify(i)}]`,n,r);else if(c){let e=`_o${r.varCounter++}`;n.push(`{const ${e}=${t}[${JSON.stringify(i)}];if(${e}!==undefined){`),p(a,e,n,r),n.push(`}}`)}else n.push(`if(typeof ${t}==='object'&&${t}!==null&&${JSON.stringify(i)} in ${t}){`),p(a,`${t}[${JSON.stringify(i)}]`,n,r),n.push(`}`);if(e.items){let i=`_j${r.varCounter}`,a=`_e${r.varCounter}`;r.varCounter++,n.push(l?`for(let ${i}=0;${i}<${t}.length;${i}++){const ${a}=${t}[${i}]`:`if(Array.isArray(${t})){for(let ${i}=0;${i}<${t}.length;${i}++){const ${a}=${t}[${i}]`),p(e.items,a,n,r),n.push(l?`}`:`}}`)}if(e.prefixItems){for(let i=0;i<e.prefixItems.length;i++){let a=`_p${r.varCounter}_${i}`;n.push(l?`if(${t}.length>${i}){const ${a}=${t}[${i}]`:`if(Array.isArray(${t})&&${t}.length>${i}){const ${a}=${t}[${i}]`),p(e.prefixItems[i],a,n,r),n.push(`}`)}r.varCounter++}if(e.contains){let i=r.varCounter++,a=e.minContains===void 0?1:e.minContains,o=e.maxContains===void 0?1/0:e.maxContains,s=[];p(e.contains,`_cv`,s,r);let c=s.length===0?`return true`:`${s.join(`;`)};return true`,u=l?``:`if(!Array.isArray(${t})){}else `;n.push(`${u}{const _cf${i}=function(_cv){${c}};let _cc${i}=0`),n.push(`for(let _ci${i}=0;_ci${i}<${t}.length;_ci${i}++){if(_cf${i}(${t}[_ci${i}]))_cc${i}++}`),o===1/0?n.push(`if(_cc${i}<${a})return false}`):n.push(`if(_cc${i}<${a}||_cc${i}>${o})return false}`)}if(e.allOf)for(let i of e.allOf)p(i,t,n,r,s);if(e.anyOf&&e.unevaluatedProperties===void 0){let i=[];for(let t=0;t<e.anyOf.length;t++){let n=[];p(e.anyOf[t],`_av`,n,r),n.length===0?i.push(`function(_av){return true}`):i.push(`function(_av){${n.join(`;`)};return true}`)}let a=r.varCounter++;n.push(`{const _af${a}=[${i.join(`,`)}];let _am${a}=false;for(let _ai=0;_ai<_af${a}.length;_ai++){if(_af${a}[_ai](${t})){_am${a}=true;break}}if(!_am${a})return false}`)}if(e.oneOf){let i=[];for(let t=0;t<e.oneOf.length;t++){let n=[];p(e.oneOf[t],`_ov`,n,r),n.length===0?i.push(`function(_ov){return true}`):i.push(`function(_ov){${n.join(`;`)};return true}`)}let a=r.varCounter++;n.push(`{const _of${a}=[${i.join(`,`)}];let _oc${a}=0;for(let _oi=0;_oi<_of${a}.length;_oi++){if(_of${a}[_oi](${t}))_oc${a}++;if(_oc${a}>1)return false}if(_oc${a}!==1)return false}`)}if(e.not){let i=[];if(p(e.not,`_nv`,i,r),i.length===0)n.push(`return false`);else{let e=r.varCounter++;n.push(`{const _nf${e}=(function(_nv){${i.join(`;`)};return true});if(_nf${e}(${t}))return false}`)}}if(e.if){let i=[];p(e.if,`_iv`,i,r);let a=r.varCounter++,o=i.length===0?`function(_iv){return true}`:`function(_iv){${i.join(`;`)};return true}`,s=`null`,c=`null`;if(e.then){let t=[];p(e.then,`_tv`,t,r),s=t.length===0?`function(_tv){return true}`:`function(_tv){${t.join(`;`)};return true}`}if(e.else){let t=[];p(e.else,`_ev`,t,r),c=t.length===0?`function(_ev){return true}`:`function(_ev){${t.join(`;`)};return true}`}n.push(`{const _if${a}=${o};const _th${a}=${s};const _el${a}=${c}`),n.push(`if(_if${a}(${t})){if(_th${a}&&!_th${a}(${t}))return false}else{if(_el${a}&&!_el${a}(${t}))return false}}`)}if(e.unevaluatedProperties!==void 0){let i=E(e,r.schemaMap,r.rootDefs);if(!(i.allProps||e.unevaluatedProperties===!0))if(i.dynamic){let i={props:[],items:null,allProps:!1,allItems:!1,dynamic:!1};if(e.properties)for(let t of Object.keys(e.properties))i.props.includes(t)||i.props.push(t);if(e.allOf)for(let t of e.allOf){let e=E(t,r.schemaMap,r.rootDefs);if(!e.dynamic&&e.props)for(let t of e.props)i.props.includes(t)||i.props.push(t)}let a=i.props,o=e.anyOf?`anyOf`:e.oneOf?`oneOf`:null;if(e.unevaluatedProperties===!1){if(e.if&&(e.then||e.else)&&!o&&!e.patternProperties&&!e.dependentSchemas){let i=[];p(e.if,`_iv2`,i,r);let o=r.varCounter++,s=i.length===0?`function(_iv2){return true}`:`function(_iv2){${i.join(`;`)};return true}`,l=[];e.if&&e.if.properties&&l.push(...Object.keys(e.if.properties));let u=e.then?E(e.then,r.schemaMap,r.rootDefs):{props:[]},d=e.else?E(e.else,r.schemaMap,r.rootDefs):{props:[]},f=[...new Set([...a,...l,...u.props||[]])],m=[...new Set([...a,...d.props||[]])],h=x(f,t),g=x(m,t),_=c?``:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t}))`;n.push(`${_}{const _uif${o}=${s};if(_uif${o}(${t})){${h}}else{${g}}}`)}else if(o){let i=e[o],s=[];for(let e of i){let t=E(e,r.schemaMap,r.rootDefs);s.push(t.props||[])}let l=[...new Set(s.flat())].filter(e=>!a.includes(e));if(l.length>0&&l.length<=32){let e=`_ev${r.varCounter++}`,u=new Map;l.forEach((e,t)=>u.set(e,t));let d=s.map(e=>{let t=0;for(let n of e)u.has(n)&&(t|=1<<u.get(n));return t}),f=r.varCounter++;n.push(`{let ${e}=0`);let m=[];for(let e=0;e<i.length;e++){let t=[];p(i[e],`_bv`,t,r);let a=`_bf${f}_${e}`;m.push(a);let o=t.length===0?`function(_bv){return true}`:`function(_bv){${t.join(`;`)};return true}`;n.push(`const ${a}=${o}`)}if(o===`oneOf`){n.push(`let _oc${f}=0`);for(let r=0;r<i.length;r++)n.push(`if(${m[r]}(${t})){_oc${f}++;${e}=${d[r]};if(_oc${f}>1)return false}`);n.push(`if(_oc${f}!==1)return false`)}else{n.push(`let _am${f}=false`);for(let r=0;r<i.length;r++)n.push(`if(${m[r]}(${t})){_am${f}=true;${e}|=${d[r]}}`);n.push(`if(!_am${f})return false`)}let h=a.length>0?a.map(e=>`_k===${JSON.stringify(e)}`).join(`||`):``,g=new Map;for(let e of l){let t=e.charCodeAt(0);g.has(t)||g.set(t,[]),g.get(t).push(e)}let _=``;for(let[t,n]of g){let r=n.map(t=>`_k===${JSON.stringify(t)}&&(${e}&${1<<u.get(t)})`).join(`||`);_+=`case ${t}:if(${r})continue;break;`}let v=`switch(_k.charCodeAt(0)){${_}default:break}`,y=h?`for(var _k in ${t}){if(${h})continue;${v}return false}`:`for(var _k in ${t}){${v}return false}`;r.deferredChecks||=[],r.deferredChecks.push(c?y+`}`:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${y}}}`)}else{let e=`_ev${r.varCounter++}`,l=[];for(let e=0;e<i.length;e++){let t=[];p(i[e],`_bv`,t,r),l.push(t.length===0?`function(_bv){return true}`:`function(_bv){${t.join(`;`)};return true}`)}let u=r.varCounter++;r.closureVars.push(`_bk${u}`),r.closureVals.push(s),n.push(`{const ${e}={}`);for(let t of a)n.push(`${e}[${JSON.stringify(t)}]=1`);n.push(`const _bf${u}=[${l.join(`,`)}]`),o===`oneOf`?n.push(`let _oc${u}=0;for(let _bi=0;_bi<_bf${u}.length;_bi++){if(_bf${u}[_bi](${t})){_oc${u}++;for(const _p of _bk${u}[_bi])${e}[_p]=1;if(_oc${u}>1)return false}}if(_oc${u}!==1)return false`):n.push(`let _am${u}=false;for(let _bi=0;_bi<_bf${u}.length;_bi++){if(_bf${u}[_bi](${t})){_am${u}=true;for(const _p of _bk${u}[_bi])${e}[_p]=1}}if(!_am${u})return false`);let d=`for(var _k in ${t}){if(!${e}[_k])return false}`;r.deferredChecks||=[],r.deferredChecks.push(c?d+`}`:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${d}}}`)}}else if(e.dependentSchemas){let i=`_ev${r.varCounter++}`;n.push(`{const ${i}={}`);for(let e of a)n.push(`${i}[${JSON.stringify(e)}]=1`);for(let[a,o]of Object.entries(e.dependentSchemas)){let e=E(o,r.schemaMap,r.rootDefs);e.props&&e.props.length>0&&n.push(`if(${JSON.stringify(a)} in ${t}){${e.props.map(e=>`${i}[${JSON.stringify(e)}]=1`).join(`;`)}}`)}let o=`for(var _k in ${t}){if(!${i}[_k])return false}`;r.deferredChecks||=[],r.deferredChecks.push(c?o+`}`:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${o}}}`)}else if(e.patternProperties){let i=`_ev${r.varCounter++}`;n.push(`{const ${i}={}`);for(let e of a)n.push(`${i}[${JSON.stringify(e)}]=1`);let o=Object.keys(e.patternProperties),s=[];for(let e of o){let t=r.varCounter++;r.closureVars.push(`_ure${t}`),r.closureVals.push(new RegExp(e)),s.push(`_ure${t}`)}let l=`for(var _k in ${t}){if(${i}[_k])continue;${s.map(e=>`if(${e}.test(_k)){${i}[_k]=1;continue}`).join(``)}return false}`;r.deferredChecks||=[],r.deferredChecks.push(c?l+`}`:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${l}}}`)}}else if(typeof e.unevaluatedProperties==`object`){let i=r.varCounter++,s=`_ev${i}`,l=`_uk${i}`;n.push(`{const ${s}={}`);for(let e of a)n.push(`${s}[${JSON.stringify(e)}]=1`);if(o){let i=e[o],a=[];for(let e of i){let t=E(e,r.schemaMap,r.rootDefs);a.push(t.props||[])}let c=[];for(let e=0;e<i.length;e++){let t=[];p(i[e],`_bv`,t,r),c.push(t.length===0?`function(_bv){return true}`:`function(_bv){${t.join(`;`)};return true}`)}let l=r.varCounter++;r.closureVars.push(`_bk${l}`),r.closureVals.push(a),n.push(`const _bf${l}=[${c.join(`,`)}]`),o===`oneOf`?n.push(`for(let _bi=0;_bi<_bf${l}.length;_bi++){if(_bf${l}[_bi](${t})){for(const _p of _bk${l}[_bi])${s}[_p]=1;break}}`):n.push(`for(let _bi=0;_bi<_bf${l}.length;_bi++){if(_bf${l}[_bi](${t})){for(const _p of _bk${l}[_bi])${s}[_p]=1}}`)}let u=[];if(p(e.unevaluatedProperties,`${t}[${l}]`,u,r),u.length>0){let e=`for(var ${l} in ${t}){if(${s}[${l}])continue;${u.join(`;`)}}`;r.deferredChecks||=[],r.deferredChecks.push(c?e+`}`:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${e}}}`)}else n.push(`}`)}}else{let n=i.props,a=n.length;if(e.unevaluatedProperties===!1){let i=e.required&&e.required.length>=a&&n.every(t=>e.required.includes(t)),o;i&&a>0?r._earlyKeyCount||(o=a<=15?`var _n=0;for(var _k in ${t})_n++;if(_n!==${a})return false`:`if(Object.keys(${t}).length!==${a})return false`,r.deferredChecks||=[],r.deferredChecks.push(c?o:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${o}}`)):a>0?(o=x(n,t),r.deferredChecks||=[],r.deferredChecks.push(c?o:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${o}}`)):(o=`for(var _k in ${t})return false`,r.deferredChecks||=[],r.deferredChecks.push(c?o:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${o}}`))}else if(typeof e.unevaluatedProperties==`object`){let i=`_uk${r.varCounter++}`,a=[];if(p(e.unevaluatedProperties,`${t}[${i}]`,a,r),a.length>0){let e=a.join(`;`),o=n.map(e=>`${i}===${JSON.stringify(e)}`).join(`||`),s=`for(var ${i} in ${t}){${n.length>0?`if(${o})continue;`:``}${e}}`;r.deferredChecks||=[],r.deferredChecks.push(c?s:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${s}}`)}}}}if(e.unevaluatedItems!==void 0){let i=E(e,r.schemaMap,r.rootDefs);if(!(i.allItems||e.unevaluatedItems===!0)){if(i.dynamic){let a=i.items||0,o=e.anyOf?`anyOf`:e.oneOf?`oneOf`:null;if(o&&(e.unevaluatedItems===!1||typeof e.unevaluatedItems==`object`)){let i=e[o],s=[];for(let e of i){let t=E(e,r.schemaMap,r.rootDefs);s.push(t.items||0)}let c=[];for(let e=0;e<i.length;e++){let t=[];p(i[e],`_bv`,t,r),c.push(t.length===0?`function(_bv){return true}`:`function(_bv){${t.join(`;`)};return true}`)}let u=r.varCounter++,d=`_eidx${r.varCounter++}`;n.push(`{let ${d}=${a}`),n.push(`const _bf${u}=[${c.join(`,`)}]`);let f=s.map((e,t)=>`_bi===${t}?${Math.max(e,a)}`).join(`:`)+`:${a}`;if(o===`oneOf`?n.push(`for(let _bi=0;_bi<_bf${u}.length;_bi++){if(_bf${u}[_bi](${t})){${d}=${f};break}}`):n.push(`for(let _bi=0;_bi<_bf${u}.length;_bi++){if(_bf${u}[_bi](${t})){const _m=${f};if(_m>${d})${d}=_m}}`),e.unevaluatedItems===!1){let e=`if(${t}.length>${d})return false`;r.deferredChecks||=[],r.deferredChecks.push(l?e+`}`:`if(Array.isArray(${t})){${e}}}`)}else{let i=r.varCounter++,a=`_ue${i}`,o=`_ui${i}`,s=[];if(p(e.unevaluatedItems,a,s,r),s.length>0){let e=`for(let ${o}=${d};${o}<${t}.length;${o}++){const ${a}=${t}[${o}];${s.join(`;`)}}`;r.deferredChecks||=[],r.deferredChecks.push(l?e+`}`:`if(Array.isArray(${t})){${e}}}`)}else n.push(`}`)}}else if(e.if&&(e.then||e.else)&&(e.unevaluatedItems===!1||typeof e.unevaluatedItems==`object`)){let i=E(e.if,r.schemaMap,r.rootDefs),o=e.then?E(e.then,r.schemaMap,r.rootDefs):{items:null},s=e.else?E(e.else,r.schemaMap,r.rootDefs):{items:null},c=i.items||0,u=Math.max(a,c,o.items||0),d=Math.max(a,s.items||0),f=[];p(e.if,`_iv3`,f,r);let m=r.varCounter++,h=f.length===0?`function(_iv3){return true}`:`function(_iv3){${f.join(`;`)};return true}`;if(e.unevaluatedItems===!1){let e=l?``:`if(Array.isArray(${t}))`;n.push(`${e}{const _uif${m}=${h};if(_uif${m}(${t})){if(${t}.length>${u})return false}else{if(${t}.length>${d})return false}}`)}}else if(e.unevaluatedItems===!1){let e=`if(${t}.length>${i.items||0})return false`;r.deferredChecks||=[],r.deferredChecks.push(l?e:`if(Array.isArray(${t})){${e}}`)}}else if(e.unevaluatedItems===!1){let e=`if(${t}.length>${i.items||0})return false`;r.deferredChecks||=[],r.deferredChecks.push(l?e:`if(Array.isArray(${t})){${e}}`)}else if(typeof e.unevaluatedItems==`object`){let n=i.items||0,a=r.varCounter++,o=`_ue${a}`,s=`_ui${a}`,c=[];if(p(e.unevaluatedItems,o,c,r),c.length>0){let e=`for(let ${s}=${n};${s}<${t}.length;${s}++){const ${o}=${t}[${s}];${c.join(`;`)}}`;r.deferredChecks||=[],r.deferredChecks.push(l?e:`if(Array.isArray(${t})){${e}}`)}}}}}let m={email:(e,t)=>(t||`${e}`,t?`{const _at=${e}.indexOf('@');if(_at<=0||_at>=${e}.length-1||${e}.indexOf('.',_at)<=_at+1)return false}`:`if(typeof ${e}==='string'){const _at=${e}.indexOf('@');if(_at<=0||_at>=${e}.length-1||${e}.indexOf('.',_at)<=_at+1)return false}`),date:(e,t)=>t?`if(${e}.length!==10||!/^\\d{4}-\\d{2}-\\d{2}$/.test(${e}))return false`:`if(typeof ${e}==='string'&&(${e}.length!==10||!/^\\d{4}-\\d{2}-\\d{2}$/.test(${e})))return false`,uuid:(e,t)=>t?`if(${e}.length!==36||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(${e}))return false`:`if(typeof ${e}==='string'&&(${e}.length!==36||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(${e})))return false`,"date-time":(e,t)=>t?`if(!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$/.test(${e})||isNaN(Date.parse(${e})))return false`:`if(typeof ${e}==='string'&&(!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$/.test(${e})||isNaN(Date.parse(${e}))))return false`,time:(e,t)=>t?`if(!/^([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?$/.test(${e}))return false`:`if(typeof ${e}==='string'&&!/^([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?$/.test(${e}))return false`,duration:(e,t)=>t?`if(!/^P(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$/.test(${e})||${e}==='P')return false`:`if(typeof ${e}==='string'&&(!/^P(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$/.test(${e})||${e}==='P'))return false`,uri:(e,t)=>t?`if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(${e}))return false`:`if(typeof ${e}==='string'&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(${e}))return false`,"uri-reference":(e,t)=>t?`if(${e}===''||/\\s/.test(${e}))return false`:`if(typeof ${e}==='string'&&(${e}===''||/\\s/.test(${e})))return false`,ipv4:(e,t)=>t?`{const _p=${e}.split('.');if(_p.length!==4||!_p.every(function(n){var x=+n;return x>=0&&x<=255&&String(x)===n}))return false}`:`if(typeof ${e}==='string'){const _p=${e}.split('.');if(_p.length!==4||!_p.every(function(n){var x=+n;return x>=0&&x<=255&&String(x)===n}))return false}`,ipv6:(e,t)=>t?`{const _s=${e};if(_s===''||!/^[0-9a-fA-F:]+$/.test(_s)||_s.split(':').length<3||_s.split(':').length>8)return false}`:`if(typeof ${e}==='string'){const _s=${e};if(_s===''||!/^[0-9a-fA-F:]+$/.test(_s)||_s.split(':').length<3||_s.split(':').length>8)return false}`,hostname:(e,t)=>t?`if(!/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(${e}))return false`:`if(typeof ${e}==='string'&&!/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(${e}))return false`};function h(e){return JSON.stringify(e).slice(1,-1)}function g(e,t){return e?e.startsWith(`'`)&&!e.includes(`+`)?`'${e.slice(1,-1)}/${t}'`:`${e}+'/${t}'`:`'/${t}'`}function _(e,t){let n=e.match(/^\^(\[[\w\-]+\])\{(\d+)\}\$$/);if(n){let e=v(n[1],`${t}.charCodeAt(_pi)`);if(!e)return null;let r=parseInt(n[2]);return`${t}.length===${r}&&(()=>{for(let _pi=0;_pi<${r};_pi++){if(!(${e}))return false}return true})()`}if(n=e.match(/^\^(\[[\w\-]+\])\+\$$/),n){let e=v(n[1],`${t}.charCodeAt(_pi)`);return e?`${t}.length>0&&(()=>{for(let _pi=0;_pi<${t}.length;_pi++){if(!(${e}))return false}return true})()`:null}if(n=e.match(/^\^(\[[\w\-]+\])\{(\d+),(\d+)\}\$$/),n){let e=v(n[1],`${t}.charCodeAt(_pi)`);return e?`${t}.length>=${parseInt(n[2])}&&${t}.length<=${parseInt(n[3])}&&(()=>{for(let _pi=0;_pi<${t}.length;_pi++){if(!(${e}))return false}return true})()`:null}return null}function v(e,t){let n=e.slice(1,-1),r=[],i=0;for(;i<n.length;)i+2<n.length&&n[i+1]===`-`?(r.push([n.charCodeAt(i),n.charCodeAt(i+2)]),i+=3):(r.push([n.charCodeAt(i),n.charCodeAt(i)]),i++);return r.length===0?null:r.map(([e,n])=>e===n?`${t}===${e}`:`(${t}>=${e}&&${t}<=${n})`).join(`||`)}function y(e,t){return e?`${e}+'/'+${t}`:`'/'+${t}`}function b(e,t){let n=e.match(/^\^([a-zA-Z0-9_\-./]+)$/);if(!n)return null;let r=n[1];return r.length===0||r.length>8?null:r.length===1?`${t}.charCodeAt(0)===${r.charCodeAt(0)}`:r.length===2?`${t}.charCodeAt(0)===${r.charCodeAt(0)}&&${t}.charCodeAt(1)===${r.charCodeAt(1)}`:`${t}.startsWith(${JSON.stringify(r)})`}function x(e,t){if(e.length===0)return`for(var _k in ${t})return false`;if(e.length<=3)return`for(var _k in ${t})if(${e.map(e=>`_k!==${JSON.stringify(e)}`).join(`&&`)})return false`;let n=new Map;for(let t of e){let e=t.charCodeAt(0);n.has(e)||n.set(e,[]),n.get(e).push(t)}let r=``;for(let[e,t]of n){let n=t.map(e=>`_k===${JSON.stringify(e)}`).join(`||`);r+=`case ${e}:if(${n})continue;break;`}return`for(var _k in ${t}){switch(_k.charCodeAt(0)){${r}default:break}return false}`}function S(e,t){if(typeof e==`object`&&e){let t=JSON.stringify(e);if(t.includes(`unevaluatedProperties`)||t.includes(`unevaluatedItems`))return null}if(typeof e==`boolean`)return e?()=>({valid:!0,errors:[]}):()=>({valid:!1,errors:[{keyword:`false schema`,instancePath:``,schemaPath:`#`,params:{},message:`boolean schema is false`}]});if(typeof e!=`object`||!e||!u(e,t))return null;if(e.patternProperties){for(let[n,r]of Object.entries(e.patternProperties))if(typeof r==`boolean`||/\\[pP]\{/.test(n)||typeof r==`object`&&r&&!u(r,t))return null}if(e.dependentSchemas){for(let n of Object.values(e.dependentSchemas))if(typeof n==`boolean`||typeof n==`object`&&n&&!u(n,t))return null}if(e.propertyNames){if(typeof e.propertyNames==`boolean`)return null;let t=e.propertyNames,n=[`maxLength`,`minLength`,`pattern`,`const`,`enum`];if(Object.keys(t).filter(e=>e!==`$schema`).some(e=>!n.includes(e)))return null}let n={varCounter:0,helperCode:[],rootDefs:e.$defs||e.definitions||null,refStack:new Set,schemaMap:t||null},r=[];if(C(e,`d`,``,r,n,`#`),r.length===0)return e=>({valid:!0,errors:[]});let i=`const _e=[]; `+(n.helperCode.length?n.helperCode.join(` `)+` `:``)+r.join(` `)+` return{valid:_e.length===0,errors:_e}`;try{let e=Function(`d`,`_all`,i);return e._errSource=i,e}catch{return null}}function C(e,t,n,r,i,a){if(a||=`#`,typeof e!=`object`||!e)return;if(e.$ref){let o=e.$ref.match(/^#\/(?:\$defs|definitions)\/(.+)$/);if(o&&i.rootDefs&&i.rootDefs[o[1]]){if(i.refStack.has(e.$ref))return;i.refStack.add(e.$ref),C(i.rootDefs[o[1]],t,n,r,i,a),i.refStack.delete(e.$ref);return}if(i.schemaMap&&i.schemaMap.has(e.$ref)){if(i.refStack.has(e.$ref))return;i.refStack.add(e.$ref),C(i.schemaMap.get(e.$ref),t,n,r,i,a),i.refStack.delete(e.$ref);return}}let o=e.type?Array.isArray(e.type)?e.type:[e.type]:null;if(o){let e=o.map(e=>{switch(e){case`object`:return`(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t}))`;case`array`:return`Array.isArray(${t})`;case`string`:return`typeof ${t}==='string'`;case`number`:return`(typeof ${t}==='number'&&isFinite(${t}))`;case`integer`:return`Number.isInteger(${t})`;case`boolean`:return`(${t}===true||${t}===false)`;case`null`:return`${t}===null`;default:return`true`}}),i=o.join(`, `);r.push(`if(!(${e.join(`||`)})){_e.push({keyword:'type',instancePath:${n||`""`},schemaPath:'${a}/type',params:{type:'${i}'},message:'must be ${i}'});if(!_all)return{valid:false,errors:_e}}`)}let s=(e,t,r,i)=>{let o=a+`/`+t;return`_e.push({keyword:'${e}',instancePath:${n||`""`},schemaPath:'${o}',params:${r},message:${i}});if(!_all)return{valid:false,errors:_e}`};if(e.enum){let n=e.enum,i=n.filter(e=>typeof e!=`object`||!e),a=n.filter(e=>typeof e==`object`&&!!e),o=[i.map(e=>`${t}===${JSON.stringify(e)}`).join(`||`),a.map(e=>`JSON.stringify(${t})===${JSON.stringify(JSON.stringify(e))}`).join(`||`)].filter(Boolean).join(`||`);r.push(`if(!(${o||`false`})){${s(`enum`,`enum`,`{allowedValues:${JSON.stringify(e.enum)}}`,`'must be equal to one of the allowed values'`)}}`)}if(e.const!==void 0){let n=e.const;if(typeof n!=`object`||!n)r.push(`if(${t}!==${JSON.stringify(n)}){${s(`const`,`const`,`{allowedValue:${JSON.stringify(e.const)}}`,`'must be equal to constant'`)}}`);else{let a=`_cnE${i.varCounter++}`;i.helperCode.push(`const ${a}=function(x){if(x===null||typeof x!=='object')return JSON.stringify(x);if(Array.isArray(x))return'['+x.map(${a}).join(',')+']';return'{'+Object.keys(x).sort().map(function(k){return JSON.stringify(k)+':'+${a}(x[k])}).join(',')+'}'};`);let o=a+`(`+JSON.stringify(n)+`)`;r.push(`if(${a}(${t})!==${o}){${s(`const`,`const`,`{allowedValue:${JSON.stringify(e.const)}}`,`'must be equal to constant'`)}}`)}}if(new Set(e.required||[]),e.required)for(let i of e.required)r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&!(${JSON.stringify(i)} in ${t})){_e.push({keyword:'required',instancePath:${n||`""`},schemaPath:'${a}/required',params:{missingProperty:'${h(i)}'},message:"must have required property '${h(i)}'"});if(!_all)return{valid:false,errors:_e}}`);if(e.minimum!==void 0){let n=`typeof ${t}==='number'&&${t}<${e.minimum}`;r.push(`if(${n}){${s(`minimum`,`minimum`,`{comparison:'>=',limit:${e.minimum}}`,`'must be >= ${e.minimum}'`)}}`)}if(e.maximum!==void 0){let n=`typeof ${t}==='number'&&${t}>${e.maximum}`;r.push(`if(${n}){${s(`maximum`,`maximum`,`{comparison:'<=',limit:${e.maximum}}`,`'must be <= ${e.maximum}'`)}}`)}if(e.exclusiveMinimum!==void 0){let n=`typeof ${t}==='number'&&${t}<=${e.exclusiveMinimum}`;r.push(`if(${n}){${s(`exclusiveMinimum`,`exclusiveMinimum`,`{comparison:'>',limit:${e.exclusiveMinimum}}`,`'must be > ${e.exclusiveMinimum}'`)}}`)}if(e.exclusiveMaximum!==void 0){let n=`typeof ${t}==='number'&&${t}>=${e.exclusiveMaximum}`;r.push(`if(${n}){${s(`exclusiveMaximum`,`exclusiveMaximum`,`{comparison:'<',limit:${e.exclusiveMaximum}}`,`'must be < ${e.exclusiveMaximum}'`)}}`)}if(e.multipleOf!==void 0){let n=e.multipleOf,a=i.varCounter++;r.push(`{const _r${a}=typeof ${t}==='number'?${t}%${n}:NaN;if(typeof ${t}==='number'&&Math.abs(_r${a})>1e-8&&Math.abs(_r${a}-${n})>1e-8){${s(`multipleOf`,`multipleOf`,`{multipleOf:${n}}`,`'must be multiple of ${n}'`)}}}`)}if(e.minLength!==void 0){let n=`typeof ${t}==='string'&&${t}.length<${e.minLength}`;r.push(`if(${n}){${s(`minLength`,`minLength`,`{limit:${e.minLength}}`,`'must NOT have fewer than ${e.minLength} characters'`)}}`)}if(e.maxLength!==void 0){let n=`typeof ${t}==='string'&&${t}.length>${e.maxLength}`;r.push(`if(${n}){${s(`maxLength`,`maxLength`,`{limit:${e.maxLength}}`,`'must NOT have more than ${e.maxLength} characters'`)}}`)}if(e.pattern){let n=_(e.pattern,t);if(n){let i=`typeof ${t}==='string'&&!(${n})`;r.push(`if(${i}){${s(`pattern`,`pattern`,`{pattern:${JSON.stringify(e.pattern)}}`,`'must match pattern "${e.pattern}"'`)}}`)}else{let n=i.varCounter++;i.helperCode.push(`const _re${n}=new RegExp(${JSON.stringify(e.pattern)})`);let a=`typeof ${t}==='string'&&!_re${n}.test(${t})`;r.push(`if(${a}){${s(`pattern`,`pattern`,`{pattern:${JSON.stringify(e.pattern)}}`,`'must match pattern "${e.pattern}"'`)}}`)}}if(e.format){let o=m[e.format];if(o){i.varCounter++;let s=[];s.push(o(t,!1));let c=s.join(`;`).replace(/return false/g,`{_e.push({keyword:'format',instancePath:${n||`""`},schemaPath:'${a}/format',params:{format:'${h(e.format)}'},message:'must match format "${h(e.format)}"'});if(!_all)return{valid:false,errors:_e}}`);r.push(c)}}if(e.minItems!==void 0){let n=`Array.isArray(${t})&&${t}.length<${e.minItems}`;r.push(`if(${n}){${s(`minItems`,`minItems`,`{limit:${e.minItems}}`,`'must NOT have fewer than ${e.minItems} items'`)}}`)}if(e.maxItems!==void 0){let n=`Array.isArray(${t})&&${t}.length>${e.maxItems}`;r.push(`if(${n}){${s(`maxItems`,`maxItems`,`{limit:${e.maxItems}}`,`'must NOT have more than ${e.maxItems} items'`)}}`)}if(e.uniqueItems){let n=i.varCounter++,a=e.items&&typeof e.items==`object`&&e.items.type,o=a===`string`||a===`number`||a===`integer`,c=e.maxItems,l=(e,t)=>s(`uniqueItems`,`uniqueItems`,`{i:${e},j:${t}}`,`'must NOT have duplicate items (items ## '+${t}+' and '+${e}+' are identical)'`),u;u=o&&c&&c<=16?`for(let _i=1;_i<${t}.length;_i++){for(let _k=0;_k<_i;_k++){if(${t}[_i]===${t}[_k]){${l(`_k`,`_i`)};break}}}`:o?`const _s${n}=new Map();for(let _i=0;_i<${t}.length;_i++){const _prev=_s${n}.get(${t}[_i]);if(_prev!==undefined){${l(`_prev`,`_i`)};break};_s${n}.set(${t}[_i],_i)}`:`const _cn${n}=function(x){if(x===null||typeof x!=='object')return typeof x+':'+x;if(Array.isArray(x))return'['+x.map(_cn${n}).join(',')+']';return'{'+Object.keys(x).sort().map(function(k){return JSON.stringify(k)+':'+_cn${n}(x[k])}).join(',')+'}'};const _s${n}=new Map();for(let _i=0;_i<${t}.length;_i++){const _k=_cn${n}(${t}[_i]);const _prev=_s${n}.get(_k);if(_prev!==undefined){${l(`_prev`,`_i`)};break};_s${n}.set(_k,_i)}`,r.push(`if(Array.isArray(${t})){${u}}`)}if(e.minProperties!==void 0&&r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&Object.keys(${t}).length<${e.minProperties}){${s(`minProperties`,`minProperties`,`{limit:${e.minProperties}}`,`'must NOT have fewer than ${e.minProperties} properties'`)}}`),e.maxProperties!==void 0&&r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&Object.keys(${t}).length>${e.maxProperties}){${s(`maxProperties`,`maxProperties`,`{limit:${e.maxProperties}}`,`'must NOT have more than ${e.maxProperties} properties'`)}}`),e.additionalProperties===!1&&e.properties){let o=Object.keys(e.properties).map(e=>`${JSON.stringify(e)}`).join(`,`),s=i.varCounter++,c=`const _k${s}=Object.keys(${t});const _a${s}=new Set([${o}]);for(let _i=0;_i<_k${s}.length;_i++){if(!_a${s}.has(_k${s}[_i])){_e.push({keyword:'additionalProperties',instancePath:${n||`""`},schemaPath:'${a}/additionalProperties',params:{additionalProperty:_k${s}[_i]},message:'must NOT have additional properties'});if(!_all)return{valid:false,errors:_e}}}`;r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){${c}}`)}if(e.dependentRequired)for(let[i,o]of Object.entries(e.dependentRequired))for(let e of o)r.push(`if(typeof ${t}==='object'&&${t}!==null&&${JSON.stringify(i)} in ${t}&&!(${JSON.stringify(e)} in ${t})){_e.push({keyword:'required',instancePath:${n||`""`},schemaPath:'${a}/dependentRequired',params:{missingProperty:'${h(e)}'},message:"must have required property '${h(e)}'"});if(!_all)return{valid:false,errors:_e}}`);if(e.properties)for(let[o,s]of Object.entries(e.properties)){let e=g(n,h(o));r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&${JSON.stringify(o)} in ${t}){`),C(s,`${t}[${JSON.stringify(o)}]`,e,r,i,a+`/properties/`+o),r.push(`}`)}if(e.patternProperties)for(let[o,s]of Object.entries(e.patternProperties)){let e=i.varCounter++;i.helperCode.push(`const _re${e}=new RegExp(${JSON.stringify(o)})`);let c=i.varCounter++;r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){for(const _k${c} in ${t}){if(_re${e}.test(_k${c})){`);let l=n?`${n}+'/'+_k${c}`:`'/'+_k${c}`;C(s,`${t}[_k${c}]`,l,r,i,a+`/patternProperties`),r.push(`}}}`)}if(e.dependentSchemas)for(let[o,s]of Object.entries(e.dependentSchemas))r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&${JSON.stringify(o)} in ${t}){`),C(s,t,n,r,i,a+`/dependentSchemas/`+o),r.push(`}`);if(e.propertyNames&&typeof e.propertyNames==`object`){let n=e.propertyNames,a=i.varCounter++;if(r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){for(const _k${a} in ${t}){`),n.minLength!==void 0&&r.push(`if(_k${a}.length<${n.minLength}){${s(`minLength`,`propertyNames/minLength`,`{limit:${n.minLength}}`,`'must NOT have fewer than ${n.minLength} characters'`)}}`),n.maxLength!==void 0&&r.push(`if(_k${a}.length>${n.maxLength}){${s(`maxLength`,`propertyNames/maxLength`,`{limit:${n.maxLength}}`,`'must NOT have more than ${n.maxLength} characters'`)}}`),n.pattern){let e=i.varCounter++;i.helperCode.push(`const _re${e}=new RegExp(${JSON.stringify(n.pattern)})`),r.push(`if(!_re${e}.test(_k${a})){${s(`pattern`,`propertyNames/pattern`,`{pattern:${JSON.stringify(n.pattern)}}`,`'must match pattern "${n.pattern}"'`)}}`)}if(n.const!==void 0&&r.push(`if(_k${a}!==${JSON.stringify(n.const)}){${s(`const`,`propertyNames/const`,`{allowedValue:${JSON.stringify(n.const)}}`,`'must be equal to constant'`)}}`),n.enum){let e=i.varCounter++;i.helperCode.push(`const _es${e}=new Set(${JSON.stringify(n.enum)})`),r.push(`if(!_es${e}.has(_k${a})){${s(`enum`,`propertyNames/enum`,`{allowedValues:${JSON.stringify(n.enum)}}`,`'must be equal to one of the allowed values'`)}}`)}r.push(`}}`)}if(e.items){let o=e.prefixItems?e.prefixItems.length:0,s=`_j${i.varCounter}`,c=`_ei${i.varCounter}`;i.varCounter++;let l=y(n,s);r.push(`if(Array.isArray(${t})){for(let ${s}=${o};${s}<${t}.length;${s}++){const ${c}=${t}[${s}]`),C(e.items,c,l,r,i,a+`/items`),r.push(`}}`)}if(e.prefixItems)for(let o=0;o<e.prefixItems.length;o++){let s=g(n,String(o));r.push(`if(Array.isArray(${t})&&${t}.length>${o}){`),C(e.prefixItems[o],`${t}[${o}]`,s,r,i,a+`/prefixItems/`+o),r.push(`}`)}if(e.contains){let n=i.varCounter++,a=[];p(e.contains,`_cv`,a,i);let o=a.length===0?`return true`:`${a.join(`;`)};return true`,c=e.minContains===void 0?1:e.minContains,l=e.maxContains;r.push(`if(Array.isArray(${t})){const _cf${n}=function(_cv){${o}};let _cc${n}=0;for(let _ci${n}=0;_ci${n}<${t}.length;_ci${n}++){if(_cf${n}(${t}[_ci${n}]))_cc${n}++}`),r.push(`if(_cc${n}<${c}){${s(`contains`,`contains`,`{limit:${c}}`,`'contains: need at least ${c} match(es)'`)}}`),l!==void 0&&r.push(`if(_cc${n}>${l}){${s(`contains`,`contains`,`{limit:${l}}`,`'contains: at most ${l} match(es)'`)}}`),r.push(`}`)}if(e.allOf)for(let o=0;o<e.allOf.length;o++)C(e.allOf[o],t,n,r,i,a+`/allOf/`+o);if(e.anyOf){let n=i.varCounter++,a=e.anyOf.map((e,t)=>{let n=[];return p(e,`_av`,n,i),n.length===0?`function(_av){return true}`:`function(_av){${n.join(`;`)};return true}`});r.push(`{const _af${n}=[${a.join(`,`)}];let _am${n}=false;for(let _ai=0;_ai<_af${n}.length;_ai++){if(_af${n}[_ai](${t})){_am${n}=true;break}}if(!_am${n}){${s(`anyOf`,`anyOf`,`{}`,`'must match a schema in anyOf'`)}}}`)}if(e.oneOf){let n=i.varCounter++,a=e.oneOf.map((e,t)=>{let n=[];return p(e,`_ov`,n,i),n.length===0?`function(_ov){return true}`:`function(_ov){${n.join(`;`)};return true}`});r.push(`{const _of${n}=[${a.join(`,`)}];let _oc${n}=0;for(let _oi=0;_oi<_of${n}.length;_oi++){if(_of${n}[_oi](${t}))_oc${n}++;if(_oc${n}>1)break}if(_oc${n}!==1){${s(`oneOf`,`oneOf`,`{}`,`'must match exactly one schema in oneOf'`)}}}`)}if(e.not){let n=[];p(e.not,`_nv`,n,i);let a=n.length===0?`function(_nv){return true}`:`function(_nv){${n.join(`;`)};return true}`,o=i.varCounter++;r.push(`{const _nf${o}=${a};if(_nf${o}(${t})){${s(`not`,`not`,`{}`,`'must NOT be valid'`)}}}`)}if(e.if){let o=[];p(e.if,`_iv`,o,i);let s=i.varCounter++,c=o.length===0?`function(_iv){return true}`:`function(_iv){${o.join(`;`)};return true}`;r.push(`{const _if${s}=${c}`),e.then&&(r.push(`if(_if${s}(${t})){`),C(e.then,t,n,r,i,a+`/then`),r.push(`}`)),e.else&&(r.push(`${e.then?`else`:`if(!_if${s}(${t}))`}{`),C(e.else,t,n,r,i,a+`/else`),r.push(`}`)),r.push(`}`)}}function w(e,t,n){if(typeof e==`object`&&e){let t=JSON.stringify(e);if(t.includes(`unevaluatedProperties`)||t.includes(`unevaluatedItems`))return null}if(typeof e==`boolean`)return e?()=>t:()=>({valid:!1,errors:[{keyword:`false schema`,instancePath:``,schemaPath:`#`,params:{},message:`boolean schema is false`}]});if(typeof e!=`object`||!e||!u(e,n))return null;if(e.patternProperties){for(let[t,r]of Object.entries(e.patternProperties))if(typeof r==`boolean`||/\\[pP]\{/.test(t)||typeof r==`object`&&r&&!u(r,n))return null}if(e.dependentSchemas){for(let t of Object.values(e.dependentSchemas))if(typeof t==`boolean`||typeof t==`object`&&t&&!u(t,n))return null}if(e.propertyNames){if(typeof e.propertyNames==`boolean`)return null;let t=e.propertyNames,n=[`maxLength`,`minLength`,`pattern`,`const`,`enum`];if(Object.keys(t).filter(e=>e!==`$schema`).some(e=>!n.includes(e)))return null}let r={varCounter:0,helperCode:[],closureVars:[],closureVals:[],rootDefs:e.$defs||e.definitions||null,refStack:new Set,schemaMap:n||null},i=[];if(T(e,`d`,``,i,r,`#`),i.length===0)return()=>t;let a=r.closureVars.join(`,`),o=`let _e; `+(r.helperCode.length?r.helperCode.join(` `)+` `:``)+i.join(` `)+` return _e?{valid:false,errors:_e}:R`;try{return process.env.ATA_DUMP_CODEGEN&&console.log(`=== COMBINED CODEGEN === `+o+` === CLOSURE VARS: `+r.closureVars.length+` ===`),Function(`R`+(a?`,`+a:``),`return function(d){${o}}`)(t,...r.closureVals)}catch(e){return process.env.ATA_DEBUG&&console.error(`compileToJSCombined error:`,e.message,` `,o.slice(0,500)),null}}function T(e,t,n,r,i,a){if(a||=`#`,typeof e!=`object`||!e)return;if(e.$ref){let o=e.$ref.match(/^#\/(?:\$defs|definitions)\/(.+)$/);if(o&&i.rootDefs&&i.rootDefs[o[1]]){if(i.refStack.has(e.$ref))return;i.refStack.add(e.$ref),T(i.rootDefs[o[1]],t,n,r,i,a),i.refStack.delete(e.$ref);return}if(i.schemaMap&&i.schemaMap.has(e.$ref)){if(i.refStack.has(e.$ref))return;i.refStack.add(e.$ref),T(i.schemaMap.get(e.$ref),t,n,r,i,a),i.refStack.delete(e.$ref);return}}let o=e.type?Array.isArray(e.type)?e.type:[e.type]:null,s=!1,c=!1,l=!1,u=!1,d=!n||n.startsWith(`'`)&&!n.includes(`+`),f=(e,t,r,o)=>{let s=a+`/`+t;if(d&&o.startsWith(`'`)&&!o.includes(`+`)){let t;try{t=Function(`return `+r)()}catch{}if(t!==void 0){let r=`_E${i.varCounter++}`,a=n?n.slice(1,-1):``,c=o.slice(1,-1);return i.closureVars.push(r),i.closureVals.push(Object.freeze({keyword:e,instancePath:a,schemaPath:s,params:Object.freeze(t),message:c})),`(_e||(_e=[])).push(${r})`}}return`(_e||(_e=[])).push({keyword:'${e}',instancePath:${n||`""`},schemaPath:'${s}',params:${r},message:${o}})`};if(o){let e=o.map(e=>{switch(e){case`object`:return`(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t}))`;case`array`:return`Array.isArray(${t})`;case`string`:return`typeof ${t}==='string'`;case`number`:return`(typeof ${t}==='number'&&isFinite(${t}))`;case`integer`:return`Number.isInteger(${t})`;case`boolean`:return`(${t}===true||${t}===false)`;case`null`:return`${t}===null`;default:return`true`}}),n=o.join(`, `),a=`_tok${i.varCounter++}`;r.push(`const ${a}=${e.join(`||`)}`),r.push(`if(!${a}){${f(`type`,`type`,`{type:'${n}'}`,`'must be ${n}'`)}}`),o.length===1&&(s=o[0]===`object`,c=o[0]===`array`,l=o[0]===`string`,u=o[0]===`number`||o[0]===`integer`),r.push(`if(${a}){`)}if(e.enum){let n=e.enum,i=n.filter(e=>typeof e!=`object`||!e),a=n.filter(e=>typeof e==`object`&&!!e),o=[i.map(e=>`${t}===${JSON.stringify(e)}`).join(`||`),a.map(e=>`JSON.stringify(${t})===${JSON.stringify(JSON.stringify(e))}`).join(`||`)].filter(Boolean).join(`||`);r.push(`if(!(${o||`false`})){${f(`enum`,`enum`,`{allowedValues:${JSON.stringify(e.enum)}}`,`'must be equal to one of the allowed values'`)}}`)}if(e.const!==void 0){let n=e.const;if(typeof n!=`object`||!n)r.push(`if(${t}!==${JSON.stringify(n)}){${f(`const`,`const`,`{allowedValue:${JSON.stringify(e.const)}}`,`'must be equal to constant'`)}}`);else{let a=`_cn${i.varCounter++}`;i.helperCode.push(`const ${a}=function(x){if(x===null||typeof x!=='object')return JSON.stringify(x);if(Array.isArray(x))return'['+x.map(${a}).join(',')+']';return'{'+Object.keys(x).sort().map(function(k){return JSON.stringify(k)+':'+${a}(x[k])}).join(',')+'}'};`),r.push(`if(${a}(${t})!==${a}(${JSON.stringify(n)})){${f(`const`,`const`,`{allowedValue:${JSON.stringify(e.const)}}`,`'must be equal to constant'`)}}`)}}let v=new Set(e.required||[]),x={};if(e.required&&e.properties&&s){let o=[];for(let t of e.required)if(e.properties[t]){let e=`_h${i.varCounter++}`;x[t]=e,o.push(`${JSON.stringify(t)}:${e}`)}o.length>0&&r.push(`const{${o.join(`,`)}}=${t}`);for(let o of e.required){let e=x[o]?`${x[o]}===undefined`:`${t}[${JSON.stringify(o)}]===undefined`;if(d){let t=`_E${i.varCounter++}`,s=n?n.slice(1,-1):``;i.closureVars.push(t),i.closureVals.push(Object.freeze({keyword:`required`,instancePath:s,schemaPath:`${a}/required`,params:Object.freeze({missingProperty:o}),message:`must have required property '${o}'`})),r.push(`if(${e}){(_e||(_e=[])).push(${t})}`)}else r.push(`if(${e}){(_e||(_e=[])).push({keyword:'required',instancePath:${n||`""`},schemaPath:'${a}/required',params:{missingProperty:'${h(o)}'},message:"must have required property '${h(o)}'"})}`)}}else if(e.required)for(let o of e.required)if(!n||n.startsWith(`'`)&&!n.includes(`+`)){let e=`_E${i.varCounter++}`,s=n?n.slice(1,-1):``;i.closureVars.push(e),i.closureVals.push(Object.freeze({keyword:`required`,instancePath:s,schemaPath:`${a}/required`,params:Object.freeze({missingProperty:o}),message:`must have required property '${o}'`})),r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&!(${JSON.stringify(o)} in ${t})){(_e||(_e=[])).push(${e})}`)}else r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&!(${JSON.stringify(o)} in ${t})){(_e||(_e=[])).push({keyword:'required',instancePath:${n||`""`},schemaPath:'${a}/required',params:{missingProperty:'${h(o)}'},message:"must have required property '${h(o)}'"})}`);if(e.minimum!==void 0){let n=u?`${t}<${e.minimum}`:`typeof ${t}==='number'&&${t}<${e.minimum}`;r.push(`if(${n}){${f(`minimum`,`minimum`,`{comparison:'>=',limit:${e.minimum}}`,`'must be >= ${e.minimum}'`)}}`)}if(e.maximum!==void 0){let n=u?`${t}>${e.maximum}`:`typeof ${t}==='number'&&${t}>${e.maximum}`;r.push(`if(${n}){${f(`maximum`,`maximum`,`{comparison:'<=',limit:${e.maximum}}`,`'must be <= ${e.maximum}'`)}}`)}if(e.exclusiveMinimum!==void 0){let n=u?`${t}<=${e.exclusiveMinimum}`:`typeof ${t}==='number'&&${t}<=${e.exclusiveMinimum}`;r.push(`if(${n}){${f(`exclusiveMinimum`,`exclusiveMinimum`,`{comparison:'>',limit:${e.exclusiveMinimum}}`,`'must be > ${e.exclusiveMinimum}'`)}}`)}if(e.exclusiveMaximum!==void 0){let n=u?`${t}>=${e.exclusiveMaximum}`:`typeof ${t}==='number'&&${t}>=${e.exclusiveMaximum}`;r.push(`if(${n}){${f(`exclusiveMaximum`,`exclusiveMaximum`,`{comparison:'<',limit:${e.exclusiveMaximum}}`,`'must be < ${e.exclusiveMaximum}'`)}}`)}if(e.multipleOf!==void 0){let n=e.multipleOf,a=i.varCounter++;r.push(`{const _r${a}=typeof ${t}==='number'?${t}%${n}:NaN;if(typeof ${t}==='number'&&Math.abs(_r${a})>1e-8&&Math.abs(_r${a}-${n})>1e-8){${f(`multipleOf`,`multipleOf`,`{multipleOf:${n}}`,`'must be multiple of ${n}'`)}}}`)}if(e.minLength!==void 0){let n=l?`${t}.length<${e.minLength}`:`typeof ${t}==='string'&&${t}.length<${e.minLength}`;r.push(`if(${n}){${f(`minLength`,`minLength`,`{limit:${e.minLength}}`,`'must NOT have fewer than ${e.minLength} characters'`)}}`)}if(e.maxLength!==void 0){let n=l?`${t}.length>${e.maxLength}`:`typeof ${t}==='string'&&${t}.length>${e.maxLength}`;r.push(`if(${n}){${f(`maxLength`,`maxLength`,`{limit:${e.maxLength}}`,`'must NOT have more than ${e.maxLength} characters'`)}}`)}if(e.pattern){let n=_(e.pattern,t);if(n){let i=l?`!(${n})`:`typeof ${t}==='string'&&!(${n})`;r.push(`if(${i}){${f(`pattern`,`pattern`,`{pattern:${JSON.stringify(e.pattern)}}`,`'must match pattern "${e.pattern}"'`)}}`)}else{let n=`_re${i.varCounter++}`;i.closureVars.push(n),i.closureVals.push(new RegExp(e.pattern));let a=l?`!${n}.test(${t})`:`typeof ${t}==='string'&&!${n}.test(${t})`;r.push(`if(${a}){${f(`pattern`,`pattern`,`{pattern:${JSON.stringify(e.pattern)}}`,`'must match pattern "${e.pattern}"'`)}}`)}}if(e.format){let n=m[e.format];if(n){let i=n(t,l).replace(/return false/g,`{${f(`format`,`format`,`{format:'${h(e.format)}'}`,`'must match format "${h(e.format)}"'`)}}`);r.push(i)}}if(e.minItems!==void 0){let n=c?`${t}.length<${e.minItems}`:`Array.isArray(${t})&&${t}.length<${e.minItems}`;r.push(`if(${n}){${f(`minItems`,`minItems`,`{limit:${e.minItems}}`,`'must NOT have fewer than ${e.minItems} items'`)}}`)}if(e.maxItems!==void 0){let n=c?`${t}.length>${e.maxItems}`:`Array.isArray(${t})&&${t}.length>${e.maxItems}`;r.push(`if(${n}){${f(`maxItems`,`maxItems`,`{limit:${e.maxItems}}`,`'must NOT have more than ${e.maxItems} items'`)}}`)}if(e.uniqueItems){let n=i.varCounter++,a=e.items&&typeof e.items==`object`&&e.items.type,o=a===`string`||a===`number`||a===`integer`,s=e.maxItems,l=(e,t)=>f(`uniqueItems`,`uniqueItems`,`{i:${e},j:${t}}`,`'must NOT have duplicate items (items ## '+${t}+' and '+${e}+' are identical)'`),u;u=o&&s&&s<=16?`for(let _i=1;_i<${t}.length;_i++){for(let _k=0;_k<_i;_k++){if(${t}[_i]===${t}[_k]){${l(`_k`,`_i`)};break}}}`:o?`const _s${n}=new Map();for(let _i=0;_i<${t}.length;_i++){const _prev=_s${n}.get(${t}[_i]);if(_prev!==undefined){${l(`_prev`,`_i`)};break};_s${n}.set(${t}[_i],_i)}`:`const _cn${n}=function(x){if(x===null||typeof x!=='object')return typeof x+':'+x;if(Array.isArray(x))return'['+x.map(_cn${n}).join(',')+']';return'{'+Object.keys(x).sort().map(function(k){return JSON.stringify(k)+':'+_cn${n}(x[k])}).join(',')+'}'};const _s${n}=new Map();for(let _i=0;_i<${t}.length;_i++){const _k=_cn${n}(${t}[_i]);const _prev=_s${n}.get(_k);if(_prev!==undefined){${l(`_prev`,`_i`)};break};_s${n}.set(_k,_i)}`,r.push(c?`{${u}}`:`if(Array.isArray(${t})){${u}}`)}if(e.minProperties!==void 0&&r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&Object.keys(${t}).length<${e.minProperties}){${f(`minProperties`,`minProperties`,`{limit:${e.minProperties}}`,`'must NOT have fewer than ${e.minProperties} properties'`)}}`),e.maxProperties!==void 0&&r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&Object.keys(${t}).length>${e.maxProperties}){${f(`maxProperties`,`maxProperties`,`{limit:${e.maxProperties}}`,`'must NOT have more than ${e.maxProperties} properties'`)}}`),e.additionalProperties===!1&&e.properties&&!e.patternProperties){let n=Object.keys(e.properties),a=i.varCounter++;if(n.length<=8){let e=n.map(e=>`_k${a}[_i]!==${JSON.stringify(e)}`).join(`&&`);r.push(s?`{const _k${a}=Object.keys(${t});for(let _i=0;_i<_k${a}.length;_i++)if(${e}){${f(`additionalProperties`,`additionalProperties`,`{additionalProperty:_k${a}[_i]}`,`'must NOT have additional properties'`)}}}`:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){const _k${a}=Object.keys(${t});for(let _i=0;_i<_k${a}.length;_i++)if(${e}){${f(`additionalProperties`,`additionalProperties`,`{additionalProperty:_k${a}[_i]}`,`'must NOT have additional properties'`)}}}`)}else{let e=n.map(e=>JSON.stringify(e)).join(`,`);r.push(s?`{const _k${a}=Object.keys(${t});const _a${a}=new Set([${e}]);for(let _i=0;_i<_k${a}.length;_i++)if(!_a${a}.has(_k${a}[_i])){${f(`additionalProperties`,`additionalProperties`,`{additionalProperty:_k${a}[_i]}`,`'must NOT have additional properties'`)}}}`:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){const _k${a}=Object.keys(${t});const _a${a}=new Set([${e}]);for(let _i=0;_i<_k${a}.length;_i++)if(!_a${a}.has(_k${a}[_i])){${f(`additionalProperties`,`additionalProperties`,`{additionalProperty:_k${a}[_i]}`,`'must NOT have additional properties'`)}}}`)}}if(e.dependentRequired)for(let[o,s]of Object.entries(e.dependentRequired))for(let e of s)if(!n||n.startsWith(`'`)&&!n.includes(`+`)){let s=`_E${i.varCounter++}`,c=n?n.slice(1,-1):``;i.closureVars.push(s),i.closureVals.push(Object.freeze({keyword:`required`,instancePath:c,schemaPath:`${a}/dependentRequired`,params:Object.freeze({missingProperty:e}),message:`must have required property '${e}'`})),r.push(`if(typeof ${t}==='object'&&${t}!==null&&${JSON.stringify(o)} in ${t}&&!(${JSON.stringify(e)} in ${t})){(_e||(_e=[])).push(${s})}`)}else r.push(`if(typeof ${t}==='object'&&${t}!==null&&${JSON.stringify(o)} in ${t}&&!(${JSON.stringify(e)} in ${t})){(_e||(_e=[])).push({keyword:'required',instancePath:${n||`""`},schemaPath:'${a}/dependentRequired',params:{missingProperty:'${h(e)}'},message:"must have required property '${h(e)}'"})}`);if(e.properties)for(let[o,c]of Object.entries(e.properties)){let e=x[o]||`${t}[${JSON.stringify(o)}]`,l=g(n,h(o));if(v.has(o)&&s)r.push(`if(${e}!==undefined){`),T(c,e,l,r,i,a+`/properties/`+o),r.push(`}`);else if(s){let e=i.varCounter++;r.push(`{const _o${e}=${t}[${JSON.stringify(o)}];if(_o${e}!==undefined){`),T(c,`_o${e}`,l,r,i,a+`/properties/`+o),r.push(`}}`)}else r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&${JSON.stringify(o)} in ${t}){`),T(c,`${t}[${JSON.stringify(o)}]`,l,r,i,a+`/properties/`+o),r.push(`}`)}if(e.patternProperties){let n=Object.entries(e.patternProperties),a=e.propertyNames&&typeof e.propertyNames==`object`?e.propertyNames:null,o=i.varCounter++,c=[];for(let[e]of n){let t=b(e,`_k${o}`);if(t)c.push({check:t});else{let t=i.varCounter++;i.closureVars.push(`_re${t}`),i.closureVals.push(new RegExp(e)),c.push({check:`_re${t}.test(_k${o})`})}}for(let e=0;e<n.length;e++){let[,t]=n[e],r=[];p(t,`_ppv`,r,i);let a=r.length===0?`return true`:`${r.join(`;`)};return true`,s=`_ppf${o}_${e}`;i.closureVars.push(s),i.closureVals.push(Function(`_ppv`,a))}let l=s?``:`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t}))`,u=`_k${o}`;if(e.additionalProperties===!1&&e.properties){i._ppHandledPropertyNamesC=!!a;let s=Object.keys(e.properties),d=s.length<=8?s.map(e=>`${u}===${JSON.stringify(e)}`).join(`||`):null;if(!d){let e=`_as${o}`;i.closureVars.push(e),i.closureVals.push(new Set(s))}if(r.push(`${l}{for(const ${u} in ${t}){`),a){if(a.minLength!==void 0&&r.push(`if(${u}.length<${a.minLength}){${f(`minLength`,`propertyNames/minLength`,`{limit:${a.minLength}}`,`'must NOT have fewer than ${a.minLength} characters'`)}}`),a.maxLength!==void 0&&r.push(`if(${u}.length>${a.maxLength}){${f(`maxLength`,`propertyNames/maxLength`,`{limit:${a.maxLength}}`,`'must NOT have more than ${a.maxLength} characters'`)}}`),a.pattern){let e=b(a.pattern,u);if(e)r.push(`if(!(${e})){${f(`pattern`,`propertyNames/pattern`,`{pattern:${JSON.stringify(a.pattern)}}`,`'must match pattern "${a.pattern}"'`)}}`);else{let e=i.varCounter++;i.closureVars.push(`_re${e}`),i.closureVals.push(new RegExp(a.pattern)),r.push(`if(!_re${e}.test(${u})){${f(`pattern`,`propertyNames/pattern`,`{pattern:${JSON.stringify(a.pattern)}}`,`'must match pattern "${a.pattern}"'`)}}`)}}if(a.const!==void 0&&r.push(`if(${u}!==${JSON.stringify(a.const)}){${f(`const`,`propertyNames/const`,`{allowedValue:${JSON.stringify(a.const)}}`,`'must be equal to constant'`)}}`),a.enum){let e=i.varCounter++;i.closureVars.push(`_es${e}`),i.closureVals.push(new Set(a.enum)),r.push(`if(!_es${e}.has(${u})){${f(`enum`,`propertyNames/enum`,`{allowedValues:${JSON.stringify(a.enum)}}`,`'must be equal to one of the allowed values'`)}}`)}}let p=d||`_as${o}.has(${u})`;r.push(`let _m${o}=${p}`);for(let e=0;e<n.length;e++)r.push(`if(${c[e].check}){_m${o}=true;if(!_ppf${o}_${e}(${t}[${u}])){${f(`pattern`,`patternProperties`,`{pattern:'${n[e][0]}'}`,`'patternProperties: value invalid for key '+${u}`)}}}`);r.push(`if(!_m${o}){${f(`additionalProperties`,`additionalProperties`,`{additionalProperty:${u}}`,`'must NOT have additional properties'`)}}`),r.push(`}}`)}else{if(i._ppHandledPropertyNamesC=!!a,r.push(`${l}{for(const ${u} in ${t}){`),a){if(a.minLength!==void 0&&r.push(`if(${u}.length<${a.minLength}){${f(`minLength`,`propertyNames/minLength`,`{limit:${a.minLength}}`,`'must NOT have fewer than ${a.minLength} characters'`)}}`),a.maxLength!==void 0&&r.push(`if(${u}.length>${a.maxLength}){${f(`maxLength`,`propertyNames/maxLength`,`{limit:${a.maxLength}}`,`'must NOT have more than ${a.maxLength} characters'`)}}`),a.pattern){let e=b(a.pattern,u);if(e)r.push(`if(!(${e})){${f(`pattern`,`propertyNames/pattern`,`{pattern:${JSON.stringify(a.pattern)}}`,`'must match pattern "${a.pattern}"'`)}}`);else{let e=i.varCounter++;i.closureVars.push(`_re${e}`),i.closureVals.push(new RegExp(a.pattern)),r.push(`if(!_re${e}.test(${u})){${f(`pattern`,`propertyNames/pattern`,`{pattern:${JSON.stringify(a.pattern)}}`,`'must match pattern "${a.pattern}"'`)}}`)}}if(a.const!==void 0&&r.push(`if(${u}!==${JSON.stringify(a.const)}){${f(`const`,`propertyNames/const`,`{allowedValue:${JSON.stringify(a.const)}}`,`'must be equal to constant'`)}}`),a.enum){let e=i.varCounter++;i.closureVars.push(`_es${e}`),i.closureVals.push(new Set(a.enum)),r.push(`if(!_es${e}.has(${u})){${f(`enum`,`propertyNames/enum`,`{allowedValues:${JSON.stringify(a.enum)}}`,`'must be equal to one of the allowed values'`)}}`)}}for(let e=0;e<n.length;e++)r.push(`if(${c[e].check}&&!_ppf${o}_${e}(${t}[${u}])){${f(`pattern`,`patternProperties`,`{pattern:'${n[e][0]}'}`,`'patternProperties: value invalid for key '+${u}`)}}`);r.push(`}}`)}}if(e.dependentSchemas)for(let[o,s]of Object.entries(e.dependentSchemas))r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})&&${JSON.stringify(o)} in ${t}){`),T(s,t,n,r,i,a+`/dependentSchemas/`+o),r.push(`}`);if(e.propertyNames&&typeof e.propertyNames==`object`&&!i._ppHandledPropertyNamesC){let n=e.propertyNames,a=i.varCounter++;if(r.push(`if(typeof ${t}==='object'&&${t}!==null&&!Array.isArray(${t})){for(const _k${a} in ${t}){`),n.minLength!==void 0&&r.push(`if(_k${a}.length<${n.minLength}){${f(`minLength`,`propertyNames/minLength`,`{limit:${n.minLength}}`,`'must NOT have fewer than ${n.minLength} characters'`)}}`),n.maxLength!==void 0&&r.push(`if(_k${a}.length>${n.maxLength}){${f(`maxLength`,`propertyNames/maxLength`,`{limit:${n.maxLength}}`,`'must NOT have more than ${n.maxLength} characters'`)}}`),n.pattern){let e=i.varCounter++;i.closureVars.push(`_re${e}`),i.closureVals.push(new RegExp(n.pattern)),r.push(`if(!_re${e}.test(_k${a})){${f(`pattern`,`propertyNames/pattern`,`{pattern:${JSON.stringify(n.pattern)}}`,`'must match pattern "${n.pattern}"'`)}}`)}if(n.const!==void 0&&r.push(`if(_k${a}!==${JSON.stringify(n.const)}){${f(`const`,`propertyNames/const`,`{allowedValue:${JSON.stringify(n.const)}}`,`'must be equal to constant'`)}}`),n.enum){let e=i.varCounter++;i.closureVars.push(`_es${e}`),i.closureVals.push(new Set(n.enum)),r.push(`if(!_es${e}.has(_k${a})){${f(`enum`,`propertyNames/enum`,`{allowedValues:${JSON.stringify(n.enum)}}`,`'must be equal to one of the allowed values'`)}}`)}r.push(`}}`)}if(e.items){let o=e.prefixItems?e.prefixItems.length:0,s=`_j${i.varCounter}`,c=`_ei${i.varCounter}`;i.varCounter++;let l=y(n,s);r.push(`if(Array.isArray(${t})){for(let ${s}=${o};${s}<${t}.length;${s}++){const ${c}=${t}[${s}]`),T(e.items,c,l,r,i,a+`/items`),r.push(`}}`)}if(e.prefixItems)for(let o=0;o<e.prefixItems.length;o++){let s=g(n,String(o));r.push(`if(Array.isArray(${t})&&${t}.length>${o}){`),T(e.prefixItems[o],`${t}[${o}]`,s,r,i,a+`/prefixItems/`+o),r.push(`}`)}if(e.contains){let n=i.varCounter++,a=[];p(e.contains,`_cv`,a,i);let o=a.length===0?`return true`:`${a.join(`;`)};return true`,s=e.minContains===void 0?1:e.minContains,c=e.maxContains;r.push(`if(Array.isArray(${t})){const _cf${n}=function(_cv){${o}};let _cc${n}=0;for(let _ci${n}=0;_ci${n}<${t}.length;_ci${n}++){if(_cf${n}(${t}[_ci${n}]))_cc${n}++}`),r.push(`if(_cc${n}<${s}){${f(`contains`,`contains`,`{limit:${s}}`,`'contains: need at least ${s} match(es)'`)}}`),c!==void 0&&r.push(`if(_cc${n}>${c}){${f(`contains`,`contains`,`{limit:${c}}`,`'contains: at most ${c} match(es)'`)}}`),r.push(`}`)}if(e.allOf)for(let o=0;o<e.allOf.length;o++)T(e.allOf[o],t,n,r,i,a+`/allOf/`+o);if(e.anyOf){let n=i.varCounter++,a=e.anyOf.map(e=>{let t=[];return p(e,`_av`,t,i),t.length===0?`function(_av){return true}`:`function(_av){${t.join(`;`)};return true}`});r.push(`{const _af${n}=[${a.join(`,`)}];let _am=false;for(let _ai=0;_ai<_af${n}.length;_ai++){if(_af${n}[_ai](${t})){_am=true;break}}if(!_am){${f(`anyOf`,`anyOf`,`{}`,`'must match a schema in anyOf'`)}}}`)}if(e.oneOf){let n=i.varCounter++,a=e.oneOf.map(e=>{let t=[];return p(e,`_ov`,t,i),t.length===0?`function(_ov){return true}`:`function(_ov){${t.join(`;`)};return true}`});r.push(`{const _of${n}=[${a.join(`,`)}];let _oc=0;for(let _oi=0;_oi<_of${n}.length;_oi++){if(_of${n}[_oi](${t}))_oc++;if(_oc>1)break}if(_oc!==1){${f(`oneOf`,`oneOf`,`{}`,`'must match exactly one schema in oneOf'`)}}}`)}if(e.not){let n=[];p(e.not,`_nv`,n,i);let a=n.length===0?`function(_nv){return true}`:`function(_nv){${n.join(`;`)};return true}`,o=i.varCounter++;r.push(`{const _nf${o}=${a};if(_nf${o}(${t})){${f(`not`,`not`,`{}`,`'must NOT be valid'`)}}}`)}if(e.if){let o=[];p(e.if,`_iv`,o,i);let s=i.varCounter++,c=o.length===0?`function(_iv){return true}`:`function(_iv){${o.join(`;`)};return true}`;r.push(`{const _if${s}=${c}`),e.then&&(r.push(`if(_if${s}(${t})){`),T(e.then,t,n,r,i,a+`/then`),r.push(`}`)),e.else&&(r.push(`${e.then?`else`:`if(!_if${s}(${t}))`}{`),T(e.else,t,n,r,i,a+`/else`),r.push(`}`)),r.push(`}`)}o&&r.push(`}`)}function E(e,t,n){if(typeof e!=`object`||!e)return{props:[],items:null,allProps:!1,allItems:!1,dynamic:!1};let r=n||e.$defs||e.definitions||null,i={props:[],items:null,allProps:!1,allItems:!1,dynamic:!1};return D(e,i,r,t,new Set,!0),i}function D(e,t,n,r,i,a){if(!(typeof e!=`object`||!e)&&!(t.allProps&&t.allItems)){if(e.$ref){let a=e.$ref.match(/^#\/(?:\$defs|definitions)\/(.+)$/);if(a&&n&&n[a[1]]){if(i.has(e.$ref)){t.dynamic=!0;return}i.add(e.$ref),D(n[a[1]],t,n,r,i),i.delete(e.$ref)}else if(r&&typeof r.get==`function`&&r.has(e.$ref)){if(i.has(e.$ref)){t.dynamic=!0;return}i.add(e.$ref),D(r.get(e.$ref),t,n,r,i),i.delete(e.$ref)}if(!Object.keys(e).some(e=>e!==`$ref`&&e!==`$defs`&&e!==`definitions`&&e!==`$schema`&&e!==`$id`))return}if(e.properties)for(let n of Object.keys(e.properties))t.props.includes(n)||t.props.push(n);if(e.additionalProperties!==void 0&&e.additionalProperties!==!1&&(t.allProps=!0),e.patternProperties&&(t.dynamic=!0),e.prefixItems){let n=e.prefixItems.length;t.items=t.items===null?n:Math.max(t.items,n)}if(e.items&&typeof e.items==`object`&&(t.allItems=!0),e.items===!0&&(t.allItems=!0),e.contains&&(a&&e.unevaluatedItems!==void 0?t.dynamic=!0:t.allItems=!0),!a&&(e.unevaluatedProperties===!0||typeof e.unevaluatedProperties==`object`&&e.unevaluatedProperties!==null)&&(t.allProps=!0),!a&&(e.unevaluatedItems===!0||typeof e.unevaluatedItems==`object`&&e.unevaluatedItems!==null)&&(t.allItems=!0),e.allOf)for(let a of e.allOf)D(a,t,n,r,i);if(e.anyOf||e.oneOf){t.dynamic=!0;let a=e.anyOf||e.oneOf;for(let e of a)D(e,t,n,r,i)}if(e.if&&(e.then||e.else)&&(t.dynamic=!0,D(e.if,t,n,r,i),e.then&&D(e.then,t,n,r,i),e.else&&D(e.else,t,n,r,i)),e.dependentSchemas){t.dynamic=!0;for(let a of Object.values(e.dependentSchemas))D(a,t,n,r,i)}}}t.exports={compileToJS:r,compileToJSCodegen:d,compileToJSCodegenWithErrors:S,compileToJSCombined:w,collectEvaluated:E,AJV_MESSAGES:n}})),p=o(((e,t)=>{let n=new Set([`http://json-schema.org/draft-07/schema#`,`http://json-schema.org/draft-07/schema`]);function r(e){return!!(e&&e.$schema&&n.has(e.$schema))}function i(e){return r(e)&&a(e),e}function a(e){if(!(typeof e!=`object`||!e)){if(e.definitions&&!e.$defs&&(e.$defs=e.definitions,delete e.definitions),e.dependencies){for(let[t,n]of Object.entries(e.dependencies))Array.isArray(n)?(e.dependentRequired||={},e.dependentRequired[t]=n):(e.dependentSchemas||={},e.dependentSchemas[t]=n);delete e.dependencies}Array.isArray(e.items)&&(e.prefixItems=e.items,e.additionalItems===void 0?delete e.items:(e.items=e.additionalItems,delete e.additionalItems));for(let t of[`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`])if(e[t]&&typeof e[t]==`object`)for(let n of Object.values(e[t]))typeof n==`object`&&n&&a(n);for(let t of[`allOf`,`anyOf`,`oneOf`,`prefixItems`])if(Array.isArray(e[t]))for(let n of e[t])typeof n==`object`&&n&&a(n);for(let t of[`items`,`contains`,`not`,`if`,`then`,`else`,`additionalProperties`,`propertyNames`])typeof e[t]==`object`&&e[t]!==null&&a(e[t])}}t.exports={isDraft7:r,normalizeDraft7:i}})),m=o(((e,t)=>{t.exports={name:`ata-validator`,version:`0.7.3`,description:`Ultra-fast JSON Schema validator. 4.7x faster validation, 1,800x faster compilation. Works without native addon. Cross-schema $ref, Draft 2020-12 + Draft 7, V8-optimized JS codegen, simdjson, RE2, multi-core. Standard Schema V1 compatible.`,main:`index.js`,module:`index.mjs`,types:`index.d.ts`,exports:{".":{types:`./index.d.ts`,browser:{import:`./index.browser.mjs`,require:`./index.js`},import:`./index.mjs`,require:`./index.js`},"./compat":{types:`./compat.d.ts`,import:`./compat.mjs`,require:`./compat.js`}},sideEffects:!1,browser:{"pkg-prebuilds":!1},scripts:{install:`node scripts/install.js`,build:`cmake-js build --target ata`,rebuild:`cmake-js rebuild --target ata`,prebuild:`pkg-prebuilds-copy --baseDir build/Release --source ata.node --name=ata --strip --napi_version=10`,"prebuild-all":`npm run prebuild -- --arch x64 && npm run prebuild -- --arch arm64`,test:`node test.js`,"test:suite":`node tests/run_suite.js`,"test:compat":`node tests/test_compat.js`,"test:standard-schema":`node tests/test_standard_schema.js`,"test:browser":`node tests/test_browser.js`,bench:`node benchmark/bench_large.js`,fuzz:`node tests/fuzz_differential.js`,"fuzz:long":`FUZZ_ITERATIONS=100000 node tests/fuzz_differential.js`},keywords:[`json`,`json-schema`,`schema`,`validator`,`validation`,`fast`,`native`,`simdjson`,`napi`,`ajv`,`ajv-alternative`,`standard-schema`,`fastify`],author:`Mert Can Altin <mertcanaltin01@gmail.com>`,license:`MIT`,repository:{type:`git`,url:`git+https://github.com/mertcanaltin/ata-validator.git`},bugs:{url:`https://github.com/mertcanaltin/ata-validator/issues`},homepage:`https://ata-validator.com`,engines:{node:`>=18.0.0`},files:[`index.js`,`index.mjs`,`index.browser.mjs`,`index.d.ts`,`lib/`,`compat.js`,`compat.mjs`,`compat.d.ts`,`binding-options.js`,`binding/`,`include/`,`src/`,`deps/`,`prebuilds/`,`scripts/`,`CMakeLists.txt`,`README.md`,`LICENSE`],dependencies:{"node-addon-api":`^8.7.0`,"node-api-headers":`^1.8.0`,"pkg-prebuilds":`^1.0.0`},devDependencies:{"@sinclair/typebox":`^0.34.49`,"cmake-js":`^8.0.0`,mitata:`^1.0.34`,typebox:`^1.1.7`,valibot:`^1.3.1`,zod:`^4.3.6`},binary:{napi_versions:[10]}}})),h=o(((e,t)=>{let n;try{n=u()(__dirname,d())}catch{}let{compileToJS:r,compileToJSCodegen:i,compileToJSCodegenWithErrors:a,compileToJSCombined:o}=f(),{normalizeDraft7:s}=p();function c(e){if(typeof e!=`object`||!e)return null;let t=[];return l(e,t),t.length===0?null:e=>{for(let n=0;n<t.length;n++)t[n](e)}}function l(e,t,n){if(typeof e!=`object`||!e)return;let r=e.properties;if(r)for(let[e,i]of Object.entries(r)){if(i&&typeof i==`object`&&i.default!==void 0){let r=i.default;if(!n)t.push(t=>{typeof t==`object`&&t&&!(e in t)&&(t[e]=typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r)});else{let i=n;t.push(t=>{let n=t;for(let e=0;e<i.length;e++){if(typeof n!=`object`||!n)return;n=n[i[e]]}typeof n==`object`&&n&&!(e in n)&&(n[e]=typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r)})}}i&&typeof i==`object`&&i.properties&&l(i,t,(n||[]).concat(e))}}function h(e){if(typeof e!=`object`||!e)return null;let t=[];return g(e,t),t.length===0?null:e=>{for(let n=0;n<t.length;n++)t[n](e)}}function g(e,t,n){if(typeof e!=`object`||!e)return;let r=e.properties;if(r)for(let[e,i]of Object.entries(r)){if(!i||typeof i!=`object`||!i.type)continue;let r=Array.isArray(i.type)?null:i.type;if(!r)continue;let a=_(r);if(a){if(!n)t.push(t=>{if(typeof t==`object`&&t&&e in t){let n=a(t[e]);n!==void 0&&(t[e]=n)}});else{let r=n;t.push(t=>{let n=t;for(let e=0;e<r.length;e++){if(typeof n!=`object`||!n)return;n=n[r[e]]}if(typeof n==`object`&&n&&e in n){let t=a(n[e]);t!==void 0&&(n[e]=t)}})}i.properties&&g(i,t,(n||[]).concat(e))}}}function _(e){switch(e){case`number`:return e=>{if(typeof e==`string`){let t=Number(e);if(e!==``&&!isNaN(t))return t}if(typeof e==`boolean`)return+!!e};case`integer`:return e=>{if(typeof e==`string`){let t=Number(e);if(e!==``&&Number.isInteger(t))return t}if(typeof e==`boolean`)return+!!e};case`string`:return e=>{if(typeof e==`number`||typeof e==`boolean`)return String(e)};case`boolean`:return e=>{if(e===`true`||e===`1`)return!0;if(e===`false`||e===`0`)return!1};default:return null}}function v(e){if(typeof e!=`object`||!e)return null;let t=[];return y(e,t),t.length===0?null:e=>{for(let n=0;n<t.length;n++)t[n](e)}}function y(e,t,n){if(!(typeof e!=`object`||!e||!e.properties)){if(e.additionalProperties===!1){let r=new Set(Object.keys(e.properties));if(!n)t.push(e=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.keys(e);for(let n=0;n<t.length;n++)r.has(t[n])||delete e[t[n]]});else{let e=n;t.push(t=>{let n=t;for(let t=0;t<e.length;t++){if(typeof n!=`object`||!n)return;n=n[e[t]]}if(typeof n!=`object`||!n||Array.isArray(n))return;let i=Object.keys(n);for(let e=0;e<i.length;e++)r.has(i[e])||delete n[i[e]]})}}for(let[r,i]of Object.entries(e.properties))i&&typeof i==`object`&&i.properties&&y(i,t,(n||[]).concat(r))}}function b(e,t){if(typeof e!=`object`||!e||!e.properties)return null;let n=[],r=e.properties,i=Object.keys(r);if(t.removeAdditional&&e.additionalProperties===!1){let e=i.map(e=>`_k!==${JSON.stringify(e)}`).join(`&&`);n.push(`for(var _k in d)if(${e})delete d[_k]`)}if(t.coerceTypes)for(let[e,t]of Object.entries(r)){if(!t||typeof t!=`object`||!t.type)continue;let r=Array.isArray(t.type)?null:t.type;if(!r)continue;let i=JSON.stringify(e);r===`integer`?(n.push(`if(typeof d[${i}]==='string'){var _n=Number(d[${i}]);if(d[${i}]!==''&&Number.isInteger(_n))d[${i}]=_n}`),n.push(`if(typeof d[${i}]==='boolean')d[${i}]=d[${i}]?1:0`)):r===`number`?(n.push(`if(typeof d[${i}]==='string'){var _n=Number(d[${i}]);if(d[${i}]!==''&&!isNaN(_n))d[${i}]=_n}`),n.push(`if(typeof d[${i}]==='boolean')d[${i}]=d[${i}]?1:0`)):r===`string`?n.push(`if(typeof d[${i}]==='number'||typeof d[${i}]==='boolean')d[${i}]=String(d[${i}])`):r===`boolean`&&(n.push(`if(d[${i}]==='true'||d[${i}]==='1')d[${i}]=true`),n.push(`if(d[${i}]==='false'||d[${i}]==='0')d[${i}]=false`))}for(let[e,t]of Object.entries(r))if(t&&typeof t==`object`&&t.default!==void 0){let r=JSON.stringify(e),i=JSON.stringify(t.default);n.push(`if(!(${r} in d))d[${r}]=${i}`)}if(n.length===0)return null;try{return Function(`d`,n.join(` `))}catch{return null}}let x=new Map,S=Object.freeze({valid:!0,errors:Object.freeze([])}),C=8192;function w(e){return e?e.split(`/`).filter(Boolean).map(e=>({key:e.replace(/~1/g,`/`).replace(/~0/g,`~`)})):[]}function T(e){if(typeof Buffer>`u`)throw Error(`createPaddedBuffer requires Node.js Buffer`);let t=Buffer.from(e),n=Buffer.allocUnsafe(t.length+64);return t.copy(n),n.fill(0,t.length),{buffer:n,length:t.length}}function E(e){if(!e)return null;let t=new Map;if(Array.isArray(e))for(let n of e){s(n);let e=n.$id;if(!e)throw Error(`Schema in schemas option must have $id`);t.set(e,n)}else for(let[n,r]of Object.entries(e))s(r),t.set(r.$id||n,r);return t}var D=class e{constructor(e,t){let r=t||{},i=typeof e==`string`?JSON.parse(e):e;s(i),this._schemaStr=JSON.stringify(i),this._schemaObj=i,this._options=r,this._initialized=!1,this._nativeReady=!1,this._compiled=null,this._fastSlot=-1,this._jsFn=null,this._preprocess=null,this._applyDefaults=null,this._schemaMap=E(r.schemas)||new Map,this.validate=e=>(this._ensureCompiled(),this.validate(e)),this.isValidObject=e=>(this._ensureCodegen(),this.isValidObject(e)),this.validateJSON=e=>(this._ensureCompiled(),this.validateJSON(e)),this.isValidJSON=e=>(this._ensureCompiled(),this.isValidJSON(e)),this.isValid=e=>{if(!n)throw Error(`Native addon required for isValid() — use validate() or isValidObject() instead`);return this._ensureCompiled(),this.isValid(e)},this.countValid=e=>{if(!n)throw Error(`Native addon required for countValid()`);return this._ensureCompiled(),this.countValid(e)},this.batchIsValid=e=>{if(!n)throw Error(`Native addon required for batchIsValid()`);return this._ensureCompiled(),this.batchIsValid(e)};let a=this;Object.defineProperty(this,`~standard`,{value:Object.freeze({version:1,vendor:`ata-validator`,validate(e){let t=a.validate(e);return t.valid?{value:e}:{issues:t.errors.map(e=>({message:e.message,path:w(e.instancePath)}))}}}),writable:!1,enumerable:!1,configurable:!1})}_ensureCompiled(){if(this._initialized)return;this._initialized=!0;let e=this._schemaObj,t=this._options,s=this._schemaMap.size>0?this._schemaMap:null,l=this._schemaMap.size>0?this._schemaStr+`\0`+[...this._schemaMap.keys()].sort().join(`\0`):this._schemaStr,u=x.get(l),d,f,p;var m=typeof process<`u`&&process.env&&process.env.ATA_FORCE_NAPI;u&&!m?(d=u.jsFn,f=u.combined,p=u.errFn):m?(d=null,f=null,p=null):(d=i(e,s)||r(e,null,s),f=o(e,S,s),p=a(e,s),x.set(l,{jsFn:d,combined:f,errFn:p})),this._jsFn=d;let g=b(e,t);if(!g){let n=c(e),r=t.coerceTypes?h(e):null,i=[t.removeAdditional?v(e):null,r,n].filter(Boolean);g=i.length===0?null:i.length===1?i[0]:e=>{for(let t=0;t<i.length;t++)i[t](e)}}this._applyDefaults=g,this._preprocess=g;let _=!(e&&(e.items||e.prefixItems||e.contains||e.properties&&Object.values(e.properties).some(e=>e&&(e.items||e.prefixItems||e.contains))));if(d){let t=null;if(p)try{p({},!0),t=e=>p(e,!0)}catch{}let r=e&&JSON.stringify(e).includes(`unevaluatedProperties`)||JSON.stringify(e).includes(`unevaluatedItems`),i=t||(r?e=>({valid:d(e),errors:d(e)?[]:[{code:`unevaluated`,path:``,message:`unevaluated property or item`}]}):e=>(this._ensureNative(),this._compiled.validate(e))),a=null;if(f)try{let t={};if(e&&e.properties)for(let n of Object.keys(e.properties))t[n]=``;if(e&&e.if&&e.if.properties)for(let n of Object.keys(e.if.properties))t[n]=``;f(t),f({}),f(null),f(0),a=f}catch{}if(a&&d)this.validate=g?e=>(g(e),d(e)?S:a(e)):e=>d(e)?S:a(e);else if(a)this.validate=g?e=>(g(e),a(e)):a;else{let e=d._hybridFactory?d._hybridFactory(S,i):null;this.validate=e?g?t=>(g(t),e(t)):e:g?e=>(g(e),d(e)?S:i(e)):e=>d(e)?S:i(e)}this.isValidObject=d;let o=d._hybridFactory?d._hybridFactory(S,i):null,s=a||o||(e=>d(e)?S:i(e));if(this.validateJSON=_&&n?e=>{if(e.length>=C){this._ensureNative();let t=Buffer.from(e);return n.rawFastValidate(this._fastSlot,t)?S:this._compiled.validateJSON(e)}try{return s(JSON.parse(e))}catch(e){if(!(e instanceof SyntaxError))throw e}return this._ensureNative(),this._compiled.validateJSON(e)}:e=>{try{return s(JSON.parse(e))}catch(e){if(!(e instanceof SyntaxError))throw e;if(!n)return{valid:!1,errors:[{keyword:`syntax`,instancePath:``,schemaPath:`#`,params:{},message:e.message}]}}return this._ensureNative(),this._compiled.validateJSON(e)},this.isValidJSON=_&&n?e=>{if(e.length>=C)return this._ensureNative(),n.rawFastValidate(this._fastSlot,Buffer.from(e));try{return d(JSON.parse(e))}catch(e){if(!(e instanceof SyntaxError))throw e;return!1}}:e=>{try{return d(JSON.parse(e))}catch(e){if(!(e instanceof SyntaxError))throw e;return!1}},n){let e=this;this.isValid=t=>{e._ensureNative();let r=e._fastSlot;return e.isValid=e=>(typeof e==`string`&&(e=Buffer.from(e)),n.rawFastValidate(r,e)),e.isValid(t)},this.countValid=t=>{e._ensureNative();let r=e._fastSlot;return e.countValid=e=>{typeof e==`string`&&(e=Buffer.from(e));let t=n.rawNDJSONValidate(r,e),i=0;for(let e=0;e<t.length;e++)t[e]&&i++;return i},e.countValid(t)},this.batchIsValid=t=>{e._ensureNative();let r=e._fastSlot;return e.batchIsValid=e=>{let t=0;for(let i of e)n.rawFastValidate(r,i)&&t++;return t},e.batchIsValid(t)}}}else if(n){this._ensureNative(),this.validate=g?e=>(g(e),this._compiled.validate(e)):e=>this._compiled.validate(e),this.isValidObject=e=>this._compiled.validate(e).valid,this.validateJSON=e=>this._compiled.validateJSON(e),this.isValidJSON=e=>this._compiled.isValidJSON(e);{let e=this._fastSlot;this.isValid=t=>(typeof t==`string`&&(t=Buffer.from(t)),n.rawFastValidate(e,t))}{let e=this._fastSlot;this.countValid=t=>{typeof t==`string`&&(t=Buffer.from(t));let r=n.rawNDJSONValidate(e,t),i=0;for(let e=0;e<r.length;e++)r[e]&&i++;return i}}{let e=this._fastSlot;this.batchIsValid=t=>{let r=0;for(let i of t)n.rawFastValidate(e,i)&&r++;return r}}}}_ensureNative(){if(this._nativeReady||(this._nativeReady=!0,!n))return;let e=this._schemaStr;if(this._schemaMap.size>0){let t=JSON.parse(this._schemaStr);t.$defs||={};for(let[e,n]of this._schemaMap)t.$defs[`__ext_`+e.replace(/[^a-zA-Z0-9]/g,`_`)]=n;e=JSON.stringify(t)}this._compiled=new n.CompiledSchema(e),this._fastSlot=n.fastRegister(e)}addSchema(e){if(this._initialized)throw Error(`Cannot add schema after compilation — call addSchema() before validate()`);if(!e||!e.$id)throw Error(`Schema must have $id`);s(e),this._schemaMap.set(e.$id,e)}_ensureCodegen(){if(this._jsFn||typeof process<`u`&&process.env&&process.env.ATA_FORCE_NAPI)return;let e=this._schemaMap.size>0?this._schemaMap:null,t=this._schemaMap.size>0?this._schemaStr+`\0`+[...this._schemaMap.keys()].sort().join(`\0`):this._schemaStr,n=x.get(t);if(n&&n.jsFn){this._jsFn=n.jsFn,this.isValidObject=n.jsFn;return}let a=i(this._schemaObj,e)||r(this._schemaObj,null,e);this._jsFn=a,a&&(this.isValidObject=a,n?n.jsFn=a:x.set(t,{jsFn:a,combined:null,errFn:null}))}toStandalone(){this._ensureCompiled();let e=this._jsFn;if(!e||!e._source)return null;let t=e._source,n=e._hybridSource||``,r=a(typeof this._schemaObj==`object`?this._schemaObj:{}),i=r&&r._errSource?r._errSource:``;return`// Auto-generated by ata-validator — do not edit 'use strict'; const boolFn = function(d) { ${t} }; const hybridFactory = function(R, E) { return function(d) { ${n} }; }; ${i?`const errFn = function(d, _all) {\n ${i}\n};`:`const errFn = null;`} module.exports = { boolFn, hybridFactory, errFn }; `}static fromStandalone(t,n,r){let i=r||{},o=typeof n==`string`?JSON.parse(n):n,s=Object.create(e.prototype);s._jsFn=t.boolFn,s._compiled=null,s._fastSlot=-1;let l=c(o),u=i.coerceTypes?h(o):null,d=[i.removeAdditional?v(o):null,u,l].filter(Boolean),f=d.length===0?null:d.length===1?d[0]:e=>{for(let t=0;t<d.length;t++)d[t](e)};s._preprocess=f;let p=e=>({valid:!1,errors:[{code:`validation_failed`,path:``,message:`validation failed`}]});if(t.errFn)p=e=>t.errFn(e,!0);else{let e=a(o);if(e)try{e({},!0),p=t=>e(t,!0)}catch{}}let m=t.hybridFactory?t.hybridFactory(S,p):null;return s.validate=m?f?e=>(f(e),m(e)):m:f?e=>(f(e),t.boolFn(e)?S:p(e)):e=>t.boolFn(e)?S:p(e),s.isValidObject=t.boolFn,s.isValidJSON=e=>{try{return t.boolFn(JSON.parse(e))}catch{return!1}},s.validateJSON=e=>{try{let n=JSON.parse(e);return m?m(n):t.boolFn(n)?S:p(n)}catch{return{valid:!1,errors:[{code:`invalid_json`,path:``,message:`invalid JSON`}]}}},Object.defineProperty(s,`~standard`,{value:Object.freeze({version:1,vendor:`ata-validator`,validate(e){let t=s.validate(e);return t.valid?{value:e}:{issues:t.errors.map(e=>({message:e.message,path:w(e.instancePath)}))}}}),writable:!1,enumerable:!1,configurable:!1}),s}isValid(e){if(!n)throw Error(`Native addon required for isValid() — install build tools or use validate() instead`);return this._ensureNative(),n.rawFastValidate(this._fastSlot,e)}isValidPrepadded(e,t){if(!n)throw Error(`Native addon required for isValidPrepadded()`);return this._ensureNative(),n.rawFastValidate(this._fastSlot,e,t)}isValidParallel(e){if(!n)throw Error(`Native addon required for isValidParallel()`);return this._ensureNative(),n.rawParallelValidate(this._fastSlot,e)}countValid(e){if(!n)throw Error(`Native addon required for countValid()`);return this._ensureNative(),n.rawParallelCount(this._fastSlot,e)}isValidNDJSON(e){if(!n)throw Error(`Native addon required for isValidNDJSON()`);return this._ensureNative(),n.rawNDJSONValidate(this._fastSlot,e)}};function O(e,t){if(n){let r=typeof e==`string`?e:JSON.stringify(e);return n.validate(r,t)}return new D(typeof e==`string`?JSON.parse(e):e).validate(t)}function k(){if(n)return n.version();try{return m().version}catch{return`unknown`}}D.bundle=function(e,t){return`'use strict'; module.exports = [ `+e.map(e=>{let n=new D(e,t).toStandalone();return n?`(function(){`+n.replace(`'use strict';`,``).replace(`module.exports = `,`return `)+`})()`:`null`}).join(`, `)+` ]; `},D.bundleStandalone=function(e,t){return`'use strict';\nvar R=Object.freeze({valid:true,errors:Object.freeze([])});\nmodule.exports=[${e.map(e=>{let n=new D(e,t);n._ensureCompiled();let r=n._jsFn;if(!r||!r._hybridSource)return`null`;let i=a(typeof e==`string`?JSON.parse(e):e);return`(function(R){var E=function(d){var _all=true;${i&&i._errSource?i._errSource:`return{valid:false,errors:[{code:'error',path:'',message:'validation failed'}]}`}};return function(d){${r._hybridSource}}})(R)`}).join(`,`)}];\n`},D.bundleCompact=function(e,t){let n=e.map(e=>{let n=new D(e,t);n._ensureCompiled();let r=n._jsFn;if(!r||!r._hybridSource)return null;let i=a(typeof e==`string`?JSON.parse(e):e);return{hybrid:r._hybridSource,err:i&&i._errSource?i._errSource:null}}),r=new Map,i=[],o=new Map,s=[],c=n.map(e=>{if(!e)return[-1,-1];let t=r.get(e.hybrid);t===void 0&&(t=i.length,i.push(e.hybrid),r.set(e.hybrid,t));let n=-1;return e.err&&(n=o.get(e.err),n===void 0&&(n=s.length,s.push(e.err),o.set(e.err,n))),[t,n]}),l=`'use strict'; `;return l+=`var R=Object.freeze({valid:true,errors:Object.freeze([])}); `,l+=`var H=[ `,l+=i.map(e=>`function(R,E){return function(d){${e}}}`).join(`, `),l+=` ]; `,l+=`var EF=[ `,l+=s.map(e=>`function(d){var _all=true;${e}}`).join(`, `),l+=` ]; `,l+=`module.exports=[`,l+=c.map(([e,t])=>e<0?`null`:t>=0?`H[${e}](R,EF[${t}])`:`H[${e}](R,function(){return{valid:false,errors:[]}})`).join(`,`),l+=`]; `,l},D.loadBundle=function(e,t,n){return t.map((t,r)=>e[r]?D.fromStandalone(e[r],t,n):new D(t,n))},t.exports={Validator:D,validate:O,version:k,createPaddedBuffer:T,SIMDJSON_PADDING:64}})),g=l();const{Validator:_,validate:v,version:y,createPaddedBuffer:b,SIMDJSON_PADDING:x}=c(h(),1).default,S={type:`object`,instanceof:`Date`,required:[]},C={type:`object`,properties:{id:{type:`number`},created:S,title:{type:`string`,minLength:1,maxLength:100},type:{type:`string`,enum:[`jpg`,`png`]},size:{type:`number`},url:{type:`string`,format:`url`}},required:[`id`,`created`,`title`,`type`,`size`,`url`]};(0,g.withKeywords)(new _({type:`object`,properties:{id:{type:`number`},created:S,title:{type:`string`,minLength:1,maxLength:100},brand:{type:`string`,minLength:1,maxLength:30},description:{type:`string`,minLength:1,maxLength:500},price:{type:`number`,minimum:1,maximum:1e4},discount:{oneOf:[{type:`number`,minimum:1,maximum:100},{type:`null`}]},quantity:{type:`number`,minimum:0,maximum:10},tags:{type:`array`,items:{type:`string`,minLength:1,maxLength:30}},images:{type:`array`,items:C},ratings:{type:`array`,items:{type:`object`,properties:{id:{type:`number`},stars:{type:`number`,minimum:0,maximum:5},title:{type:`string`,minLength:1,maxLength:100},text:{type:`string`,minLength:1,maxLength:1e3},images:{type:`array`,items:C}},required:[`id`,`stars`,`title`,`text`,`images`]}}},required:[`id`,`created`,`title`,`brand`,`description`,`price`,`discount`,`quantity`,`tags`,`images`,`ratings`]})).validate({});