@schmock/faker 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{ResourceLimitError as S4,SchemaGenerationError as c7,SchemaValidationError as s0}from"@schmock/core";var a0="2.5.0";var E=1e4,r=3,P0=15,e0=20,B0=50000,i=1e6,o=1e4,g=65536,c=16777216,T0="2024-01-01T00:00:00.000Z",q6=0.05;import{base as t9,en as a9,Faker as e9}from"@faker-js/faker";function v4(q){let j=q|0;return()=>{j=j+1831565813|0;let K=Math.imul(j^j>>>15,1|j);return K=K+Math.imul(K^K>>>7,61|K)^K,((K^K>>>14)>>>0)/4294967296}}function I6(q){let j=v4(q),K=0,z={next(){return K++,j()},int(b,P){return b+Math.floor(z.next()*(P-b+1))},bool(b=0.5){return z.next()<b},pick(b){return b[z.int(0,b.length-1)]},shuffle(b){let P=[...b];for(let B=P.length-1;B>0;B--){let F=z.int(0,B);[P[B],P[F]]=[P[F],P[B]]}return P},fork(){let b=Math.floor(z.next()*4294967296);return I6(b)}};return z}function f4(q){return null}function E4(q){return q.random.bool()}function C6(q,j,K=!1){let z=-1000,b=1000,P=!1,B=!1;if(q.minimum!==void 0)z=q.minimum;if(q.maximum!==void 0)b=q.maximum;if(q.exclusiveMinimum!==void 0)z=q.exclusiveMinimum,P=!0;if(q.exclusiveMaximum!==void 0)b=q.exclusiveMaximum,B=!0;if(q.multipleOf!==void 0)return x4(q.multipleOf,z,b,P,B,j);if(K){let W=P?Math.floor(z)+1:Math.ceil(z),V=B?Math.ceil(b)-1:Math.floor(b);return j.random.int(W,V)}let F=P?z+Number.EPSILON:z,G=B?b-Number.EPSILON:b;return F+j.random.next()*(G-F)}function x4(q,j,K,z,b,P){let B=Math.ceil(j/q),F=Math.floor(K/q);if(z&&B*q===j)B++;if(b&&F*q===K)F--;if(B>F)return B*q;return P.random.int(B,F)*q}function X4(q,j){if(q.autoIncrement){let K=q.initialOffset??1,z=u4(j.path),b=j.autoIncrementCounters??new Map,P=(b.get(z)??K-1)+1;if(b.set(z,P),j.autoIncrementCounters)j.autoIncrementCounters.set(z,P);return P}return C6(q,j,!0)}function u4(q){let j=new Set(["items","prefixItems","contains","additionalItems"]),K=q.split("/").filter((z)=>z!=="");return K.filter((z,b)=>{let P=K[b-1];return!(/^\d+$/.test(z)&&P!==void 0&&j.has(P))}).join("/")}function j6(q,j){let K=O6(q,0);return q0(K.node,j)}function q0(q,j){switch(q.type){case"literal":return q.value;case"dot":return j.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return p4(q,j);case"sequence":return q.nodes.map((K)=>q0(K,j)).join("");case"alternation":return q0(j.pick(q.branches),j);case"quantifier":{let K=j.int(q.min,Math.min(q.max,q.min+5));return Array.from({length:K},()=>q0(q.node,j)).join("")}case"group":return q0(q.node,j)}}function p4(q,j){if(!q.negated)return j.pick(q.chars);let K=new Set(q.chars),z=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter((b)=>!K.has(b));return z.length>0?j.pick(z):"a"}function O6(q,j){let K=[],z=[];while(j<q.length){let b=q[j];if(b===")")break;if(b==="|"){K.push(K6(z)),z=[],j++;continue}if(b==="("){let F=j+1;if(q[F]==="?")if(q[F+1]===":")F+=2;else if(q[F+1]==="="||q[F+1]==="!"){let L=1,O=F;while(O<q.length&&L>0){if(O++,q[O]==="(")L++;if(q[O]===")")L--}j=O+1;continue}else{F+=2;while(F<q.length&&q[F]!==">")F++;F++}let G=O6(q,F),W={type:"group",node:G.node};j=G.pos+1;let V=e(q,j,W);z.push(V.node),j=V.pos;continue}if(b==="["){let F=d4(q,j),G=e(q,F.pos,F.node);z.push(G.node),j=G.pos;continue}if(b==="."){let F={type:"dot"};j++;let G=e(q,j,F);z.push(G.node),j=G.pos;continue}if(b==="^"||b==="$"){z.push({type:"anchor"}),j++;continue}if(b==="\\"){j++;let F=l4(q,j);j=F.pos;let G=e(q,j,F.node);z.push(G.node),j=G.pos;continue}let P={type:"literal",value:b};j++;let B=e(q,j,P);z.push(B.node),j=B.pos}return K.push(K6(z)),{node:K.length===1?K[0]:{type:"alternation",branches:K},pos:j}}function K6(q){if(q.length===0)return{type:"literal",value:""};if(q.length===1)return q[0];return{type:"sequence",nodes:q}}function l4(q,j){let K=q[j];switch(j++,K){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:j};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:j};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:j};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:j};case"s":return{node:{type:"charClass",chars:[...`
1
+ import{ResourceLimitError as S4,SchemaGenerationError as c5,SchemaValidationError as s0}from"@schmock/core";var a0="2.6.0";var E=1e4,r=3,P0=15,e0=20,B0=50000,i=1e6,o=1e4,g=65536,c=16777216,T0="2024-01-01T00:00:00.000Z",q6=0.05;import{base as t9,en as a9,Faker as e9}from"@faker-js/faker";function v4(q){let j=q|0;return()=>{j=j+1831565813|0;let K=Math.imul(j^j>>>15,1|j);return K=K+Math.imul(K^K>>>7,61|K)^K,((K^K>>>14)>>>0)/4294967296}}function I6(q){let j=v4(q),K=0,z={next(){return K++,j()},int(b,P){return b+Math.floor(z.next()*(P-b+1))},bool(b=0.5){return z.next()<b},pick(b){return b[z.int(0,b.length-1)]},shuffle(b){let P=[...b];for(let B=P.length-1;B>0;B--){let F=z.int(0,B);[P[B],P[F]]=[P[F],P[B]]}return P},fork(){let b=Math.floor(z.next()*4294967296);return I6(b)}};return z}function f4(q){return null}function E4(q){return q.random.bool()}function C6(q,j,K=!1){let z=-1000,b=1000,P=!1,B=!1;if(q.minimum!==void 0)z=q.minimum;if(q.maximum!==void 0)b=q.maximum;if(q.exclusiveMinimum!==void 0)z=q.exclusiveMinimum,P=!0;if(q.exclusiveMaximum!==void 0)b=q.exclusiveMaximum,B=!0;if(q.multipleOf!==void 0)return x4(q.multipleOf,z,b,P,B,j);if(K){let W=P?Math.floor(z)+1:Math.ceil(z),V=B?Math.ceil(b)-1:Math.floor(b);return j.random.int(W,V)}let F=P?z+Number.EPSILON:z,G=B?b-Number.EPSILON:b;return F+j.random.next()*(G-F)}function x4(q,j,K,z,b,P){let B=Math.ceil(j/q),F=Math.floor(K/q);if(z&&B*q===j)B++;if(b&&F*q===K)F--;if(B>F)return B*q;return P.random.int(B,F)*q}function X4(q,j){if(q.autoIncrement){let K=q.initialOffset??1,z=u4(j.path),b=j.autoIncrementCounters??new Map,P=(b.get(z)??K-1)+1;if(b.set(z,P),j.autoIncrementCounters)j.autoIncrementCounters.set(z,P);return P}return C6(q,j,!0)}function u4(q){let j=new Set(["items","prefixItems","contains","additionalItems"]),K=q.split("/").filter((z)=>z!=="");return K.filter((z,b)=>{let P=K[b-1];return!(/^\d+$/.test(z)&&P!==void 0&&j.has(P))}).join("/")}function j6(q,j){let K=O6(q,0);return q0(K.node,j)}function q0(q,j){switch(q.type){case"literal":return q.value;case"dot":return j.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return p4(q,j);case"sequence":return q.nodes.map((K)=>q0(K,j)).join("");case"alternation":return q0(j.pick(q.branches),j);case"quantifier":{let K=j.int(q.min,Math.min(q.max,q.min+5));return Array.from({length:K},()=>q0(q.node,j)).join("")}case"group":return q0(q.node,j)}}function p4(q,j){if(!q.negated)return j.pick(q.chars);let K=new Set(q.chars),z=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter((b)=>!K.has(b));return z.length>0?j.pick(z):"a"}function O6(q,j){let K=[],z=[];while(j<q.length){let b=q[j];if(b===")")break;if(b==="|"){K.push(K6(z)),z=[],j++;continue}if(b==="("){let F=j+1;if(q[F]==="?")if(q[F+1]===":")F+=2;else if(q[F+1]==="="||q[F+1]==="!"){let L=1,O=F;while(O<q.length&&L>0){if(O++,q[O]==="(")L++;if(q[O]===")")L--}j=O+1;continue}else{F+=2;while(F<q.length&&q[F]!==">")F++;F++}let G=O6(q,F),W={type:"group",node:G.node};j=G.pos+1;let V=e(q,j,W);z.push(V.node),j=V.pos;continue}if(b==="["){let F=d4(q,j),G=e(q,F.pos,F.node);z.push(G.node),j=G.pos;continue}if(b==="."){let F={type:"dot"};j++;let G=e(q,j,F);z.push(G.node),j=G.pos;continue}if(b==="^"||b==="$"){z.push({type:"anchor"}),j++;continue}if(b==="\\"){j++;let F=l4(q,j);j=F.pos;let G=e(q,j,F.node);z.push(G.node),j=G.pos;continue}let P={type:"literal",value:b};j++;let B=e(q,j,P);z.push(B.node),j=B.pos}return K.push(K6(z)),{node:K.length===1?K[0]:{type:"alternation",branches:K},pos:j}}function K6(q){if(q.length===0)return{type:"literal",value:""};if(q.length===1)return q[0];return{type:"sequence",nodes:q}}function l4(q,j){let K=q[j];switch(j++,K){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:j};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:j};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:j};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:j};case"s":return{node:{type:"charClass",chars:[...`
2
2
  `],negated:!1},pos:j};case"S":return{node:{type:"charClass",chars:[...`
3
3
  `],negated:!0},pos:j};case"b":case"B":return{node:{type:"anchor"},pos:j};default:return{node:{type:"literal",value:K},pos:j}}}function d4(q,j){j++;let K=!1;if(q[j]==="^")K=!0,j++;let z=[];while(j<q.length&&q[j]!=="]"){if(q[j]==="\\"&&j+1<q.length){j++;let b=q[j];switch(b){case"d":z.push(..."0123456789");break;case"w":z.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":z.push(...`
4
- `);break;default:z.push(b)}j++;continue}if(j+2<q.length&&q[j+1]==="-"&&q[j+2]!=="]"){let b=q.charCodeAt(j),P=q.charCodeAt(j+2);for(let B=b;B<=P;B++)z.push(String.fromCharCode(B));j+=3;continue}z.push(q[j]),j++}return j++,{node:{type:"charClass",chars:z,negated:K},pos:j}}function e(q,j,K){if(j>=q.length)return{node:K,pos:j};let z=q[j],b,P;switch(z){case"*":b=0,P=5,j++;break;case"+":b=1,P=5,j++;break;case"?":b=0,P=1,j++;break;case"{":{let B=Z4(q,j);if(B)b=B.min,P=B.max,j=B.pos;else return{node:K,pos:j};break}default:return{node:K,pos:j}}if(j<q.length&&(q[j]==="?"||q[j]==="+"))j++;return{node:{type:"quantifier",node:K,min:b,max:P},pos:j}}function Z4(q,j){let K=q.slice(j).match(/^\{(\d+)(?:,(\d*))?\}/);if(!K)return null;let z=parseInt(K[1],10),b;if(K[2]===void 0)b=z;else if(K[2]==="")b=z+5;else b=parseInt(K[2],10);return{min:z,max:b,pos:j+K[0].length}}function l(q){return q<10?`0${q}`:`${q}`}function h4(q,j){return new Date(q,j,0).getDate()}var L6="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function m4(q){if(q==="^"||q==="$"||q==="^$")return!1;return!0}function i4(q,j){if(q.format){if(q.format==="date-time"&&(j.minDateTime!==void 0||j.maxDateTime!==void 0))return o4(j);let B=j.formatRegistry.get(q.format);if(B){let F=B(j.random),G=j.minLength??q.minLength,W=j.maxLength??q.maxLength;if(G!==void 0&&F.length<G)return Y0(F,G,j);if(W!==void 0&&F.length>W)return F.slice(0,W);return F}}if(q.pattern){let B=j.minLength??q.minLength,F=j.maxLength??q.maxLength,G=50;for(let L=0;L<50;L++){let O=j6(q.pattern,j.random);if(B!==void 0&&O.length<B)continue;if(F!==void 0&&O.length>F)continue;return O}let W=j6(q.pattern,j.random),V=m4(q.pattern);if(B!==void 0&&W.length<B){if(V)return Y0(W,B,j)}if(F!==void 0&&W.length>F)return W.slice(0,F);return W}let K=q.minLength??0,z=q.maxLength??Math.max(K+10,10),b=j.random.int(K,z),P="";for(let B=0;B<b;B++)P+=j.random.pick([...L6]);if(j.maxLength!==void 0&&P.length>j.maxLength)P=P.slice(0,j.maxLength);if(j.minLength!==void 0&&P.length<j.minLength)P=Y0(P,j.minLength,j);return P}function Y0(q,j,K){while(q.length<j)q+=K.random.pick([...L6]);return q}function o4(q){let j=q.minDateTime?new Date(q.minDateTime):new Date("1970-01-01"),K=q.maxDateTime?new Date(q.maxDateTime):new Date,z=j.getTime(),b=K.getTime(),P=z+q.random.next()*(b-z),B=new Date(P),F=B.getFullYear(),G=l(B.getMonth()+1),W=l(B.getDate());return`${F}-${G}-${W}T01:01:01.0Z`}function z6(q,j){if(q.const!==void 0)return structuredClone(q.const);if(q.enum!==void 0&&q.enum.length>0){let K=q.enum;if(q.minimum!==void 0||q.maximum!==void 0||q.exclusiveMinimum!==void 0||q.exclusiveMaximum!==void 0||q.multipleOf!==void 0){let b=q.exclusiveMinimum??q.minimum??-1/0,P=q.exclusiveMaximum??q.maximum??1/0,B=q.exclusiveMinimum!==void 0,F=q.exclusiveMaximum!==void 0;K=K.filter((G)=>{if(typeof G!=="number")return!0;let W=B?G>b:G>=b,V=F?G<P:G<=P;if(!W||!V)return!1;if(q.multipleOf!==void 0){let L=q.multipleOf,O=L.toString().includes(".")?L.toString().split(".")[1].length:0,J=Math.pow(10,O),A=Math.round(G*J),w=Math.round(L*J);if(A%w!==0)return!1}return!0})}if(q.minLength!==void 0||q.maxLength!==void 0){let b=q.minLength??0,P=q.maxLength??1/0;K=K.filter((B)=>{if(typeof B!=="string")return!0;return B.length>=b&&B.length<=P})}if(q.minItems!==void 0||q.maxItems!==void 0){let b=q.minItems??0,P=q.maxItems??1/0;K=K.filter((B)=>{if(!Array.isArray(B))return!0;return B.length>=b&&B.length<=P})}if(q.minProperties!==void 0||q.maxProperties!==void 0){let b=q.minProperties??0,P=q.maxProperties??1/0;K=K.filter((B)=>{if(typeof B!=="object"||B===null||Array.isArray(B))return!0;return Object.keys(B).length>=b&&Object.keys(B).length<=P})}if(K.length===0){let b=[];if(q.minLength!==void 0)b.push(`minLength: ${q.minLength}`);if(q.maxLength!==void 0)b.push(`maxLength: ${q.maxLength}`);if(q.minItems!==void 0)b.push(`minItems: ${q.minItems}`);if(q.maxItems!==void 0)b.push(`maxItems: ${q.maxItems}`);if(q.minProperties!==void 0)b.push(`minProperties: ${q.minProperties}`);if(q.maxProperties!==void 0)b.push(`maxProperties: ${q.maxProperties}`);if(q.minimum!==void 0)b.push(`minimum: ${q.minimum}`);if(q.maximum!==void 0)b.push(`maximum: ${q.maximum}`);if(q.exclusiveMinimum!==void 0)b.push(`exclusiveMinimum: ${q.exclusiveMinimum}`);if(q.exclusiveMaximum!==void 0)b.push(`exclusiveMaximum: ${q.exclusiveMaximum}`);if(q.multipleOf!==void 0)b.push(`multipleOf: ${q.multipleOf}`);throw Error(`enum values conflict with constraints [${b.join(", ")}] at ${j.path}`)}let z=j.random.pick(K);return typeof z==="object"&&z!==null?structuredClone(z):z}throw Error(`generateEnumConst called without enum or const at ${j.path}`)}function w0(q){return typeof q==="object"&&q!==null&&"then"in q&&typeof q.then==="function"}var R6=Symbol("walkCall");function T(q,j){return{[R6]:!0,schema:q,ctx:j}}function k6(q){return typeof q==="object"&&q!==null&&R6 in q}function G0(q,j){q.push({gen:j,sent:void 0,hasThrown:!1,threw:void 0})}function J6(q){let j=q[q.length-1],K;try{K=j.hasThrown?j.gen.throw(j.threw):j.gen.next(j.sent)}catch(z){if(q.pop(),q.length===0)throw z;let b=q[q.length-1];b.hasThrown=!0,b.threw=z;return}return j.hasThrown=!1,K}async function $4(q,j){let K=[];G0(K,q);for(;;){let z=J6(K);if(z===void 0)continue;if(z.done){if(K.pop(),K.length===0)return z.value;K[K.length-1].sent=z.value;continue}if(k6(z.value)){G0(K,j(z.value.schema,z.value.ctx));continue}let b=K[K.length-1];try{b.sent=await z.value}catch(P){b.hasThrown=!0,b.threw=P}}}function n4(q,j){let K=[];G0(K,q);for(;;){let z=J6(K);if(z===void 0)continue;if(z.done){if(K.pop(),K.length===0)return z.value;K[K.length-1].sent=z.value;continue}if(k6(z.value)){G0(K,j(z.value.schema,z.value.ctx));continue}if(w0(z.value))throw Error("generateSync() encountered an unexpected asynchronous operation.");K[K.length-1].sent=z.value}}function p(q){let j={};for(let K of q){if(typeof K==="boolean"){if(!K)return{not:{}};continue}T6(j,K)}return j}function M6(q,j){if(typeof q==="boolean"||typeof j==="boolean")return{};if(typeof q!=="object"||q===null)return typeof j==="object"&&j!==null?j:{};if(typeof j!=="object"||j===null)return q;let K={...q};return T6(K,j),K}function T6(q,j){if(j.type!==void 0)if(q.type===void 0)q.type=j.type;else q.type=r4(q.type,j.type);if(j.minimum!==void 0)q.minimum=q.minimum!==void 0?Math.max(q.minimum,j.minimum):j.minimum;if(j.maximum!==void 0)q.maximum=q.maximum!==void 0?Math.min(q.maximum,j.maximum):j.maximum;if(j.exclusiveMinimum!==void 0)q.exclusiveMinimum=q.exclusiveMinimum!==void 0?Math.max(q.exclusiveMinimum,j.exclusiveMinimum):j.exclusiveMinimum;if(j.exclusiveMaximum!==void 0)q.exclusiveMaximum=q.exclusiveMaximum!==void 0?Math.min(q.exclusiveMaximum,j.exclusiveMaximum):j.exclusiveMaximum;if(j.multipleOf!==void 0)q.multipleOf=j.multipleOf;if(j.minLength!==void 0)q.minLength=q.minLength!==void 0?Math.max(q.minLength,j.minLength):j.minLength;if(j.maxLength!==void 0)q.maxLength=q.maxLength!==void 0?Math.min(q.maxLength,j.maxLength):j.maxLength;if(j.pattern!==void 0)q.pattern=j.pattern;if(j.format!==void 0)q.format=j.format;if(j.minItems!==void 0)q.minItems=q.minItems!==void 0?Math.max(q.minItems,j.minItems):j.minItems;if(j.maxItems!==void 0)q.maxItems=q.maxItems!==void 0?Math.min(q.maxItems,j.maxItems):j.maxItems;if(j.uniqueItems)q.uniqueItems=!0;if(j.items!==void 0)q.items=j.items;if(j.prefixItems!==void 0)if(q.prefixItems===void 0)q.prefixItems=j.prefixItems;else{let K=[],z=Math.max(q.prefixItems.length,j.prefixItems.length);for(let b=0;b<z;b++){let P=q.prefixItems[b],B=j.prefixItems[b];if(P!==void 0&&B!==void 0)K.push(M6(P,B));else if(P!==void 0)K.push(P);else if(B!==void 0)K.push(B)}q.prefixItems=K}if(j.contains!==void 0)if(q.containsAll!==void 0)q.containsAll=[...q.containsAll,j.contains];else if(q.contains!==void 0)q.containsAll=[q.contains,j.contains],delete q.contains;else q.contains=j.contains;if(j.properties)q.properties=c4(q.properties??{},j.properties);if(j.required)q.required=[...new Set([...q.required??[],...j.required])];if(j.additionalProperties!==void 0)q.additionalProperties=j.additionalProperties;if(j.patternProperties)q.patternProperties={...q.patternProperties??{},...j.patternProperties};if(j.minProperties!==void 0)q.minProperties=q.minProperties!==void 0?Math.max(q.minProperties,j.minProperties):j.minProperties;if(j.maxProperties!==void 0)q.maxProperties=q.maxProperties!==void 0?Math.min(q.maxProperties,j.maxProperties):j.maxProperties;if(j.const!==void 0)q.const=j.const;if(j.enum!==void 0)if(q.enum!==void 0){let K=new Set(j.enum.map((z)=>JSON.stringify(z)));q.enum=q.enum.filter((z)=>K.has(JSON.stringify(z)))}else q.enum=j.enum;if(j.$ref)q.$ref=j.$ref;if(j.$defs)q.$defs={...q.$defs??{},...j.$defs};if(j.allOf)q.allOf=[...q.allOf??[],...j.allOf];if(j.anyOf)q.anyOf=j.anyOf;if(j.oneOf)q.oneOf=j.oneOf}function r4(q,j){let K=Array.isArray(q)?q:[q],z=Array.isArray(j)?j:[j],b=K.filter((P)=>z.includes(P));if(b.length===0)return K[0];if(b.length===1)return b[0];return b}function c4(q,j){let K={...q};for(let[z,b]of Object.entries(j)){let P=q[z];if(P===void 0)K[z]=b;else if(typeof P==="object"&&typeof b==="object")K[z]=M6(P,b);else K[z]=b}return K}var D0=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function Y6(q){if(typeof q!=="object"||q===null)return!1;return Object.keys(q).some((j)=>D0.has(j))}function N0(q){if(q.properties)return q.properties;if(q.type==="object"||q.type===void 0){let j={},K=!1;for(let[z,b]of Object.entries(q)){if(D0.has(z))continue;if(Y6(b))j[z]=b,K=!0;else j[z]={const:b},K=!0}if(K)return j}return{}}function y6(q,j){if(q.required)return q.required;if(q.properties===void 0&&Object.keys(j).length>0)return Object.keys(j);return[]}function A6(q,j){let K=q.alwaysFakeOptionals??!1,z=q.fixedProbabilities??!1,b=q.optionalsProbability??0.5,P;if(z&&!K&&j.length>0){let B=Math.round(j.length*b);P=new Set(j.slice(0,B))}return(B)=>{if(K)return!0;if(P)return P.has(B);return q.random.bool(b)}}function N6(q){return typeof q==="object"&&q!==null&&!Array.isArray(q)}function s4(q){return q.replace(/~/g,"~0").replace(/\//g,"~1")}function d(q,j){let K=s4(j),z=q.outputPath==="/"?`/${K}`:`${q.outputPath}/${K}`,b=q.path==="/"?`/${K}`:`${q.path}/${K}`;return{...q,path:b,outputPath:z}}function t4(q){let j=N0(q);if(Object.keys(j).length>0)return j;if(Array.isArray(q.allOf)){let K={};for(let z of q.allOf){if(typeof z!=="object"||z===null)continue;let b=N0(z);Object.assign(K,b)}return K}return{}}function a4(q,j){let K=y6(q,j);if(K.length>0)return K;if(Array.isArray(q.allOf)){let z=[];for(let b of q.allOf){if(typeof b!=="object"||b===null)continue;let P=b;if(Array.isArray(P.required))z.push(...P.required)}if(z.length>0)return[...new Set(z)]}return[]}function e4(q,j,K){if(!N6(q)||typeof j!=="object"||j===null)return q;return Q6(q,j,K)}function Q6(q,j,K){if(K.alwaysFakeOptionals===!0)return q;let z=t4(j);if(Object.keys(z).length===0)return q;let b=a4(j,z),P=new Set(b),B=new Set(Object.keys(z)),F=[...B].filter((J)=>!P.has(J)),G=A6(K,F),W=new Set([...B,...Object.keys(q)]),V=K.path==="/"?"/properties":`${K.path}/properties`,L={...K,depth:K.depth+1,path:V},O={};for(let J of W){if(!(J in q))continue;let A=d(L,J),w=z[J]??!0;if(!(B.has(J)&&!P.has(J))||G(J))O[J]=e4(q[J],w,A)}return O}function y0(q,j,K){if(!K.filterExampleDefaults||!N6(q))return q;return Q6(q,j,K)}function b6(q,j){if(typeof j!=="object"||j===null)return!1;let K=j;if(K.const!==void 0)return q===K.const;if(K.enum!==void 0)return K.enum.some((z)=>z===q);return!1}function S6(q){if(typeof q==="boolean")return!q;if(typeof q!=="object"||q===null)return!1;if(q.not===!0||typeof q.not==="object"&&q.not!==null&&Object.keys(q.not).length===0)return!0;return!1}function A0(q){let j=[];if(q.dependentRequired){for(let[K,z]of Object.entries(q.dependentRequired))if(Array.isArray(z))j.push([K,z.filter((b)=>typeof b==="string")])}if(q.dependencies){for(let[K,z]of Object.entries(q.dependencies))if(Array.isArray(z))j.push([K,z.filter((b)=>typeof b==="string")])}return j}function q9(q){let j=[];if(q.dependencies){for(let[K,z]of Object.entries(q.dependencies))if(!Array.isArray(z))j.push([K,z])}if(q.dependentSchemas)for(let[K,z]of Object.entries(q.dependentSchemas))j.push([K,z]);return j}function*j9(q,j,K,z,b,P,B={type:"string"}){if(K[P]!==void 0)return;let F=j[P];if(F===void 0&&q.patternProperties){let V=[];for(let[L,O]of Object.entries(q.patternProperties))try{if(new RegExp(L).test(P))V.push(O)}catch{}if(V.length>0)F=V.length===1?V[0]:p(V)}if(F===void 0){if(q.additionalProperties===!1)return;F=q.additionalProperties!==void 0&&q.additionalProperties!==!0?q.additionalProperties:B}if(S6(F))return;let G=d(b,P),W=yield T(F,G);if(W!==void 0)K[P]=W,z.add(P)}function*K9(q,j){let K=N0(q),z=y6(q,K);if(j.depth>=j.maxDepth){let w=new Set(z);for(let[D,R]of A0(q))if(w.has(D))for(let k of R)w.add(k);if(w.size===0)return{};let U={};for(let D of w){let R=K[D];if(R&&typeof R==="object"&&R!==null){let k=R;if(k.const!==void 0)U[D]=k.const;else if(k.default!==void 0)U[D]=k.default;else if(k.enum!==void 0&&k.enum.length>0)U[D]=k.enum[0];else U[D]=P9(k.type)}else U[D]=null}return U}if(q.additionalProperties===!1){let w=Object.keys(K).length>0,U=q.patternProperties&&Object.keys(q.patternProperties).length>0,D=new Set(Object.keys(K)),R=[...new Set(z)].filter((k)=>!D.has(k));if((q.minProperties??0)>0&&!w&&!U)throw Error(`missing properties for ${q.minProperties} in ${j.path}: additionalProperties is false but no properties or patternProperties defined`);if(R.length>0&&!U&&!w)throw Error(`missing properties for ${R.join(", ")} in ${j.path}: additionalProperties is false but required properties not defined in properties`)}let b=j.path==="/"?"/properties":`${j.path}/properties`,P={...j,depth:j.depth+1,path:b},B={},F=new Set,G=new Set(z);for(let[w,U]of A0(q))if(G.has(w))for(let D of U)G.add(D);let W=j.fillProperties??!0,V=Object.keys(K).filter((w)=>!G.has(w)),L=A6(j,V);if(Object.keys(K).length>0)for(let[w,U]of Object.entries(K)){if(S6(U))continue;F.add(w);let D=d(P,w),R=G.has(w),k=typeof U==="object"&&U!==null&&U.type==="object",I=U;if(q.patternProperties&&typeof U==="object"&&U!==null){let C=[];for(let[M,Y]of Object.entries(q.patternProperties))try{if(new RegExp(M).test(w))C.push(Y)}catch{}if(C.length>0)I=p([U,...C])}if(R){let C=yield T(I,D);if(C!==void 0)B[w]=C}else if(L(w)){let C=yield T(I,D);if(C!==void 0)B[w]=C}else if(k&&!W){let C=U.required??[];if(C.length>0){let M={};for(let Y of C){let f=(U.properties??{})[Y]??{},H=d(D,Y),m=yield T(f,H);if(m!==void 0)M[Y]=m}B[w]=M}}}for(let w of G){if(B[w]!==void 0||F.has(w))continue;if(q.patternProperties){let U=[];for(let[D,R]of Object.entries(q.patternProperties))if(new RegExp(D).test(w))U.push(R);if(U.length>0){let D=U.length===1?U[0]:p(U),R=d(P,w),k=yield T(D,R);if(k!==void 0)B[w]=k;F.add(w)}}if(!F.has(w)){let U=q.additionalProperties??!0;if(U!==!1){let D=d(P,w),R=yield T(U===!0?{}:U,D);if(R!==void 0)B[w]=R;F.add(w)}}}let O=!0;while(O){O=!1;for(let[w,U]of A0(q)){if(B[w]===void 0)continue;for(let D of U){let R=B[D];if(yield*j9(q,K,B,F,P,D),R===void 0&&B[D]!==void 0)O=!0;if(B[D]!==void 0)G.add(D)}}}for(let[w,U]of q9(q))if(B[w]!==void 0&&!F.has(w+"_dep")){if(F.add(w+"_dep"),typeof U==="boolean")continue;let D=U.oneOf??U.anyOf??U.allOf??[U],R=null;for(let I of D){if(typeof I!=="object"||I===null)continue;let{properties:C,not:M}=I;if(C&&C[w]){let Y=C[w],f=B[w];if(b6(f,Y)){R=I;break}}if(M?.properties){let Y=M.properties[w];if(Y){let f=B[w];if(!b6(f,Y)){R=I;break}}}}if(!R&&D.length>0&&typeof D[0]==="object")R=D[0];if(R?.not){let I=R.not;if(I.required&&Array.isArray(I.required))for(let C of I.required)delete B[C]}let k=new Set;if(R?.required)for(let I of R.required){if(I===w)continue;if(B[I]!==void 0)continue;k.add(I);let C=R.properties?.[I]??K[I]??{type:"object"},M=d(P,I),Y=yield T(C,M);if(Y!==void 0)B[I]=Y}if(R&&R.properties)for(let[I,C]of Object.entries(R.properties)){if(I===w)continue;if(k.has(I))continue;let M=d(P,I),Y=yield T(C,M);if(Y!==void 0)B[I]=Y}}let J=q.minProperties??0,A=q.maxProperties;if(Object.keys(B).length<J){if(q.patternProperties&&Object.keys(q.patternProperties).length>0){let w=Object.entries(q.patternProperties),U=0,D=1000;while(Object.keys(B).length<J&&U<D){U++;let[R,k]=j.random.pick(w),I=b9(R,j);if(I&&!B[I]){let C=d(P,I),M=yield T(k,C);if(M!==void 0)B[I]=M;F.add(I)}}}if(Object.keys(B).length<J){let w=q.additionalProperties,U=w===void 0||w===!0?{type:"string"}:w;if(U!==!1){let D=0,R=1000;while(Object.keys(B).length<J&&D<R){D++;let k=`prop${j.random.int(0,99999)}`;if(!B[k]){let I=d(P,k),C=yield T(U,I);if(C!==void 0)B[k]=C;F.add(k)}}}}if(Object.keys(B).length<J){let w=Object.keys(K).join(", ");throw Error(`properties '${w}' were not found while additionalProperties is false in ${j.path}`)}}if(A!==void 0&&Object.keys(B).length>A){let w=Object.keys(B).filter((U)=>!G.has(U));j.random.shuffle(w);while(Object.keys(B).length>A&&w.length>0){let U=w.pop();delete B[U]}}if(j.pruneProperties&&j.pruneProperties.length>0)Q0(B,j.pruneProperties);return z9(B,K),B}function z9(q,j){for(let[K,z]of Object.entries(j)){if(typeof z!=="object"||z===null)continue;let b=z;if(b.template===void 0)continue;let P=b.template;if(typeof P!=="string")continue;let B=P.replace(/#\{(\w+)\}/g,(F,G)=>{let W=q[G];return W!==void 0?String(W):""});q[K]=B}}function b9(q,j){let K=q.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(K){let G=K[1],W=K[2];if(W===".*"||W?.includes("?:")){let V=j.random.int(0,10),L="abcdefghijklmnopqrstuvwxyz",O="";for(let J=0;J<V;J++)O+=j.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return G+O}return G}let z=q.match(/(.*\*)?([a-zA-Z]+)\$$/);if(z){let G=z[2],W=j.random.int(1,10),V="abcdefghijklmnopqrstuvwxyz",L="";for(let O=0;O<W;O++)L+=j.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return L+G}let b=q.match(/^\^([a-zA-Z]+)\$$/);if(b)return b[1];let P=j.random.int(3,10),B="abcdefghijklmnopqrstuvwxyz",F="";for(let G=0;G<P;G++)F+=j.random.pick(B.split(""));try{if(new RegExp(q).test(F))return F}catch{}return null}function Q0(q,j){if(typeof q!=="object"||q===null)return;if(Array.isArray(q)){for(let z of q)Q0(z,j);return}let K=q;for(let z of Object.keys(K))if(j.includes(z))delete K[z];else Q0(K[z],j)}function P9(q){switch(Array.isArray(q)?q[0]:q){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}function*B9(q,j){if(j.depth>=j.maxDepth){let D=q.minItems??0;return D>0?Array.from({length:D},()=>null):[]}if(j.refDepthReached){let D=q.minItems??0;return D>0?Array.from({length:D},()=>null):[]}if(q.items===!1&&(q.minItems??0)>0){let D=q.prefixItems?.length??0;if((q.minItems??0)>D)throw Error(`missing items for ${q.minItems} in ${j.path}: items is false but minItems (${q.minItems}) exceeds prefixItems count (${D})`)}let K=j.path==="/"?"/items":`${j.path}/items`,z={...j,depth:j.depth+1,path:K},b=[],P=j.refDepthMax,B=j.minItems??q.minItems??0,F=j.maxItems??q.maxItems??Math.max(B,j.maxDefaultItems);if(q.maxItems!==void 0&&F>q.maxItems)F=q.maxItems;if(q.minItems!==void 0&&B<q.minItems)B=q.minItems;if(F<B)if(q.maxItems!==void 0)B=F;else F=B;if(j.alwaysFakeOptionals)F=Math.max(B,F);let G=q.uniqueItems?new Set:null;function*W(D,R){let k=yield T(D,R);if(k===void 0)return"omitted";if(G){let I=JSON.stringify(k);if(G.has(I)){for(let C=0;C<50;C++){if(k=yield T(D,h(z,b.length)),k===void 0)continue;let M=JSON.stringify(k);if(!G.has(M))return G.add(M),b.push(k),"added"}return"failed"}G.add(I)}return b.push(k),"added"}if(q.prefixItems)for(let D=0;D<q.prefixItems.length&&b.length<F;D++){let R=h(z,D);if((yield*W(q.prefixItems[D],R))==="failed")break}let V;if(P!==void 0&&j.refDepth>=P-1){let D=q.minItems??0;return D>0?Array.from({length:D},()=>null):[]}let L=j.alwaysFakeOptionals??!1,O=j.fixedProbabilities??!1,J=j.optionalsProbability??0.5;if(L)V=F;else if(O){let D=F-Math.max(B,b.length),R=Math.round(D*J);V=Math.max(B,b.length)+R}else V=j.random.int(Math.max(B,b.length),F);let A=q.prefixItems!==void 0,w=q.additionalItems!==void 0,U;if(A){if(w)U=q.additionalItems;else if(q.items!==void 0)U=q.items}else U=q.items;if(U!==!1&&U!==void 0){let D=U??{},R=0,k=Math.max(V*20,50);while(b.length<V){let I=yield*W(D,h(z,b.length));if(I==="added"){R=0;continue}if(R++,I==="failed"||R>=k)break}}if(q.contains){let D=q.minContains??1,R=q.maxContains??Math.max(D,1),k=j.random.int(D,R);for(let I=0;I<k;I++){let C=yield T(q.contains,h(z,b.length));if(C===void 0)continue;if(G){let M=JSON.stringify(C);if(G.has(M)){let Y=!1;for(let f=0;f<50;f++){if(C=yield T(q.contains,h(z,b.length)),C===void 0)continue;let H=JSON.stringify(C);if(!G.has(H)){G.add(H),Y=!0;break}}if(!Y)continue}else G.add(M)}if(b.length<F){let M=j.random.int(0,b.length);b.splice(M,0,C)}else if(b.length>0){let M=j.random.int(0,b.length-1);b[M]=C}}while(b.length>F)b.pop()}if(q.containsAll){let D=new Set;for(let R of q.containsAll){let k=yield T(R,h(z,b.length));if(k===void 0)continue;if(G){let I=JSON.stringify(k);if(G.has(I)){let C=!1;for(let M=0;M<50;M++){if(k=yield T(R,h(z,b.length)),k===void 0)continue;let Y=JSON.stringify(k);if(!G.has(Y)){G.add(Y),C=!0;break}}if(!C)continue}else G.add(I)}if(b.length<F){let I=j.random.int(0,b.length);b.splice(I,0,k);let C=new Set;for(let M of D)C.add(M>=I?M+1:M);D.clear();for(let M of C)D.add(M);D.add(I)}else if(b.length>0){let I=Array.from({length:b.length},(C,M)=>M).filter((C)=>!D.has(C));if(I.length>0){let C=I[j.random.int(0,I.length-1)];b[C]=k,D.add(C)}else b.push(k),D.add(b.length-1)}}while(b.length>F)b.pop()}if(q.uniqueItems&&b.length>0)return yield*F9(b,q,z,B,F,G);return b}function*F9(q,j,K,z,b,P){let B=j.items??{},F=0,G=100;while(q.length<z&&F<G){F++;let W=yield T(B,h(K,q.length));if(W===void 0)continue;let V=JSON.stringify(W);if(!P.has(V))P.add(V),q.push(W)}while(q.length>b)q.pop();return q}function h(q,j){let K=q.outputPath==="/"?`/${j}`:`${q.outputPath}/${j}`;return{...q,path:`${q.path}/${j}`,outputPath:K}}function P6(q,j){if(!j||j==="")return q;if(typeof q!=="object"||q===null)throw Error(`Cannot resolve fragment "${j}" in non-object schema`);if(j.startsWith("/"))return G9(q,j);throw Error(`Unsupported fragment type: ${j}. Only JSON pointers (starting with /) are supported.`)}function G9(q,j){if(j===""||j==="/")return q;let K=j.slice(1).split("/"),z=q;for(let b of K){let P=b.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof z!=="object"||z===null)throw Error(`Cannot resolve JSON pointer "${j}": not an object at "${P}"`);if(Array.isArray(z)){let B=parseInt(P,10);if(isNaN(B)||B<0||B>=z.length)throw Error(`Cannot resolve JSON pointer "${j}": invalid array index "${P}"`);z=z[B]}else{if(!(P in z))throw Error(`Cannot resolve JSON pointer "${j}": property "${P}" not found`);z=z[P]}}return z}function*B6(q,j){let K=j.refResolver(q);if(j.__sync&&w0(K))throw Promise.resolve(K).catch(()=>{}),Error(`Cannot use async refResolver in generateSync(): resolving '${q}' returned a Promise`);return yield K}function W9(q){let j=new Map;if(typeof q==="boolean")return j;if(q.$id&&typeof q==="object"){let K=q,z=K.$id,{$id:b,...P}=K;j.set(z,P)}if(q.$defs)for(let[K,z]of Object.entries(q.$defs))j.set(`#/$defs/${K}`,z);return j}function*W0(q,j){let K=q.$ref;if(!K)return{schema:q,ctx:j};let z=j.refDepth+1;if(j.refDepthMax!==void 0&&z>=j.refDepthMax)return{schema:{},ctx:{...j,refDepthReached:!0}};if(j.refStack.has(K)){if(j.refDepthMax!==void 0){if(j.refDepth>=j.refDepthMax)return{schema:{},ctx:{...j,refDepthReached:!0}}}else if(j.depth>=j.maxDepth)return{schema:{type:"null"},ctx:j}}let b,P;if(K.startsWith("#/")){if(b=j.refRegistry.get(K),b===void 0&&K.length>2){let L=j.refRegistry.get("#");if(L!==void 0&&typeof L==="object")try{b=P6(L,K.slice(1))}catch{}}if(b===void 0&&j.refResolver){if(b=yield*B6(K,j),b!==void 0)j.refRegistry.set(K,b)}}else if(K==="#")b=j.refRegistry.get("#")??{};else if(b=j.refRegistry.get(K),b===void 0&&j.refResolver){P=yield*B6(K,j);let L=K.indexOf("#");if(L!==-1){let O=K.slice(L+1);if(O)b=P6(P,O);else b=P}else b=P;if(P&&typeof P==="object"&&P!==null){let O=P;if(O.$defs)for(let[J,A]of Object.entries(O.$defs))j.refRegistry.set(`#/$defs/${J}`,A)}}else if(b===void 0&&j.__sync)throw Error(`Remote $ref '${K}' cannot be resolved in generateSync(); pre-resolve refs or use generate()`);if(b===void 0)throw Error(`Unresolved $ref: ${K}`);let B=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:F,...G}=q,W=Object.fromEntries(Object.entries(G).filter(([L])=>!B.has(L)));if(Object.keys(W).length>0&&typeof b==="object"&&b!==null)b={...b,...W};let V={...j,refStack:new Set([...j.refStack,K]),refDepth:j.refDepth+1};return{schema:b,ctx:V}}function V9(q,j){if(typeof q==="boolean")return;j.set("#",q),S0(q,"#",j)}function S0(q,j,K){if(q.$id){let{$id:z,...b}=q;K.set(z,b)}if(q.$defs)for(let[z,b]of Object.entries(q.$defs)){let P=`${j}/$defs/${z}`;if(K.set(P,b),typeof b==="object"&&b!==null)S0(b,P,K)}if(q.properties){for(let[z,b]of Object.entries(q.properties))if(typeof b==="object"&&b!==null)S0(b,`${j}/properties/${z}`,K)}}function*w9(q,j){if(!q.$ref)return q;return(yield*W0(q,j)).schema}function*D9(q,j){let K=[];for(let z of q)if(typeof z==="object"&&z!==null&&"$ref"in z){let b=yield*w9(z,j);K.push(b)}else if(typeof z==="object"&&z!==null)K.push(z);return K}function*U9(q,j){let{allOf:K,anyOf:z,oneOf:b,not:P,if:B,then:F,else:G,...W}=q;if(K){let V=yield*D9(K,j),L=p([W,...V]);return yield T(L,j)}if(b){let V=j.random.shuffle([...b]),L=W.required??[];for(let k of V){let I=typeof k==="object"&&k!==null?k:{};if(I.$ref)I=(yield*W0(I,j)).schema;let C=I.required??[],M=[...new Set([...L,...C])],Y={...W,required:M},f=p([Y,I]),H={...j,optionalsProbability:0,alwaysFakeOptionals:!1};try{return yield T(f,H)}catch{}}let O=b[0],J=typeof O==="object"&&O!==null?O:{};if(J.$ref)J=(yield*W0(J,j)).schema;let A=J.required??[],w=[...new Set([...L,...A])],U={...W,required:w},D=p([U,J]),R={...j,optionalsProbability:0,alwaysFakeOptionals:!1};return yield T(D,R)}if(z){let V=j.random.shuffle([...z]);for(let J of V){let A=p([W,J]);try{return yield T(A,j)}catch{}}let L=z[0],O=p([W,L]);return yield T(O,j)}if(B!==void 0)return yield*I9(W,B,F,G,j);if(P)return yield*C9(W,P,j);return yield T(W,j)}function*I9(q,j,K,z,b){if(K!==void 0){let P=p([q,j,K]);try{return yield T(P,b)}catch{}}if(z!==void 0){let P=p([q,z]);try{return yield T(P,b)}catch{}}return yield T(q,b)}function*C9(q,j,K){if(typeof j==="boolean"){if(j===!0)throw Error(`Cannot generate value for 'not: true' at ${K.path}`);return yield T(q,K)}if(j.type&&!j.enum&&!j.const){let z=Array.isArray(j.type)?j.type:[j.type],b=["string","number","integer","boolean","null","object","array"].filter((P)=>!z.includes(P));if(b.length>0){let P=K.random.pick(b),B=p([q,{type:P}]);return yield T(B,K)}}if(j.const!==void 0||j.enum!==void 0){let z=j.enum??[j.const],b=new Set(z.map((P)=>JSON.stringify(P)));for(let P=0;P<20;P++){let B=yield T(q,K);if(!b.has(JSON.stringify(B)))return B}}return yield T(q,K)}class _6{extensions=new Map;define(q,j){this.extensions.set(q,{callback:j,context:{}})}has(q){return this.extensions.has(q)}reset(q){if(q){let j=this.extensions.get(q);if(j)j.context={},this.extensions.delete(q)}else this.extensions.clear()}keys(){return this.extensions.keys()}*generateGen(q,j){let K=Object.keys(q);for(let z=K.length-1;z>=0;z--){let b=K[z],P=b.startsWith("x-")?b.slice(2):b,B=this.extensions.get(P);if(B){let F=q[b],G=B.callback.call(B.context,F,q,j);if(j.__sync&&w0(G))throw Promise.resolve(G).catch(()=>{}),Error(`Cannot use async extension '${P}' in generateSync()`);let W=yield G;if(W!==void 0)return W}}return}getContext(q){return this.extensions.get(q)?.context}}var O9=new _6;function*L9(q,j){return yield*O9.generateGen(q,j)}var R9=["string","number","integer","boolean","null","object","array"];function F6(q,j,K){if(q.faker!==void 0&&q.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${j.path}`);if(q.faker!==void 0)try{let z=k9(q.faker,j),b=W6(z,K??q.type,j.path);if(typeof b==="string"&&q.format)return G6(b,q.format,j);return b}catch{}if(q.chance!==void 0)try{let z=J9(q.chance,j),b=W6(z,K??q.type,j.path);if(typeof b==="string"&&q.format)return G6(b,q.format,j);return b}catch{}return}function G6(q,j,K){if(j==="date"){let z=typeof q==="string"?new Date(q):q;if(z instanceof Date&&!isNaN(z.getTime())){let b=z.getFullYear(),P=l(z.getMonth()+1),B=l(z.getDate());return`${b}-${P}-${B}`}if(typeof q==="string"){let b=Date.parse(q);if(!isNaN(b)){let P=new Date(b),B=P.getFullYear(),F=l(P.getMonth()+1),G=l(P.getDate());return`${B}-${F}-${G}`}}}if(j==="date-time"){let z=typeof q==="string"?new Date(q):q;if(z instanceof Date&&!isNaN(z.getTime()))return z.toISOString();if(typeof q==="string"&&Date.parse(q))return new Date(q).toISOString()}return q}function W6(q,j,K){if(j===void 0)return q;let z=Array.isArray(j)?j[0]:j;switch(z){case"string":return q===null?"null":q===void 0?"undefined":String(q);case"number":case"integer":let b=Number(q);return z==="integer"?Math.floor(b):b;case"boolean":return Boolean(q);case"null":return null;default:return q}}function k9(q,j){if(!j.extensions?.faker){let B=typeof q==="string"?q:JSON.stringify(q);throw Error(`cannot resolve faker-generator for ${B} in ${j.path}`)}let K,z;if(typeof q==="object"&&q!==null){let B=q,F=Object.keys(B);if(F.length>0)K=F[0],z=B[K];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(q)} in ${j.path}`)}else K=q;let b=K.split("."),P=j.extensions.faker;for(let B of b)try{P=P[B]}catch{throw Error(`failed to resolve .${B} (${K})`)}if(typeof P==="function")return z?P(...z):P();else throw Error(`cannot resolve faker-generator for ${K} in ${j.path}`)}function J9(q,j){if(!j.extensions?.chance){let K=typeof q==="string"?q:Object.keys(q)[0];throw Error(`cannot resolve chance-generator for ${K} in ${j.path}`)}if(typeof q==="string"){let K=j.extensions.chance[q];if(typeof K==="function")return K.call(j.extensions.chance);throw Error(`cannot resolve chance-generator for ${q} in ${j.path}`)}if(typeof q==="object"&&q!==null){let K=q,z=Object.keys(K)[0],b=K[z],P=j.extensions.chance[z];if(typeof P==="function")return b?P.call(j.extensions.chance,b):P.call(j.extensions.chance)}throw Error(`cannot resolve chance-generator in ${j.path}`)}function M9(q,j){let K=q.path==="/"?`/${j}`:`${q.path}/${j}`;return{...q,depth:q.depth+1,path:K,refDepthReached:q.refDepthReached}}function*_(q,j,K){if(!K.outputTransform)return q;let z=K.outputTransform(q,j,K.outputPath);if(K.__sync&&w0(z))throw Promise.resolve(z).catch(()=>{}),Error("Cannot use async outputTransform in generateSync()");return yield z}function*j0(q,j){if(q===!0)return yield*j0({},j);if(q===!1)throw Error(`Cannot generate value for 'false' schema at ${j.path}`);let K=null;if(typeof q==="object"&&q!==null&&q.$defs){K=[];for(let[z,b]of Object.entries(q.$defs)){let P=`#/$defs/${z}`;K.push([P,j.refRegistry.has(P)?j.refRegistry.get(P):void 0]),j.refRegistry.set(P,b)}}try{return yield*T9(q,j)}finally{if(K)for(let[z,b]of K)if(b===void 0)j.refRegistry.delete(z);else j.refRegistry.set(z,b)}}function*T9(q,j){if(j.propAliases){let B=null;for(let[F,G]of Object.entries(j.propAliases))if(F in q&&!(G in q)){if(!B)B={...q};B[G]=B[F],delete B[F]}if(B)q=B}let K;if(Array.isArray(q.type)){let B=q.type;K=j.random.pick(B);let F={...j,resolvedType:K},G=F6(q,F,K);if(G!==void 0){if(typeof G==="string"&&F.maxLength!==void 0&&G.length>F.maxLength)return yield*_(G.slice(0,F.maxLength),q,F);return yield*_(G,q,F)}}else{let B=F6(q,j,K);if(B!==void 0){if(typeof B==="string"&&j.maxLength!==void 0&&B.length>j.maxLength)return yield*_(B.slice(0,j.maxLength),q,j);return yield*_(B,q,j)}}let z={...j,proceed:(B,F)=>(j.__sync?g6:H6)(B,{...j,...F})},b=yield*L9(q,z);if(b!==void 0)return yield*_(b,q,z);if(q.$ref){let B=yield*W0(q,j);return yield T(B.schema,M9(B.ctx,"$ref"))}if(q.allOf||q.anyOf||q.oneOf||q.not||q.if)return yield*U9(q,j);if(q.const!==void 0)return yield*_(z6(q,j),q,j);if(j.useDefaultValue&&q.default!==void 0)return yield*_(y0(q.default,q,j),q,j);if(q.enum!==void 0)return yield*_(z6(q,j),q,j);if(j.useExamplesValue){if(Array.isArray(q.examples)&&q.examples.length>0){let B=j.random.pick(q.examples);return yield*_(y0(B,q,j),q,j)}if(q.example!==void 0)return yield*_(y0(q.example,q,j),q,j)}let P=Y9(q,j);if(P===null){if(j.failOnInvalidTypes===!1){if(j.defaultInvalidTypeProduct!==void 0){let B=j.defaultInvalidTypeProduct;if(typeof B==="string")return A9(B);return B}return null}throw Error(`unknown primitive ${q.type} in ${j.path}/type`)}switch(P){case"null":return yield*_(f4(j),q,j);case"boolean":return yield*_(E4(j),q,j);case"number":return yield*_(C6(q,j),q,j);case"integer":return yield*_(X4(q,j),q,j);case"string":return yield*_(i4(q,j),q,j);case"object":return yield*_(yield*K9(q,j),q,j);case"array":return yield*_(yield*B9(q,j),q,j);default:throw Error(`Unknown type: ${P} at ${j.path}`)}}function Y9(q,j){if(j.resolvedType!==void 0)return j.resolvedType;if(typeof q.type==="string"){if(!["string","number","integer","boolean","null","object","array"].includes(q.type))return null;return q.type}if(Array.isArray(q.type))return j.random.pick(q.type);if(q.properties||q.required||q.additionalProperties!==void 0||q.patternProperties||q.minProperties!==void 0||q.maxProperties!==void 0)return"object";if(y9(q))return"object";if(q.items||q.prefixItems||q.contains||q.minItems!==void 0||q.maxItems!==void 0||q.uniqueItems)return"array";if(q.minimum!==void 0||q.maximum!==void 0||q.exclusiveMinimum!==void 0||q.exclusiveMaximum!==void 0||q.multipleOf!==void 0)return"number";if(q.minLength!==void 0||q.maxLength!==void 0||q.pattern||q.format||q.faker!==void 0||q.chance!==void 0)return"string";return j.random.pick(R9)}function y9(q){if(q.properties||q.type==="object"||q.type==="array")return!1;for(let j of Object.keys(q)){if(D0.has(j))continue;let K=q[j];if(typeof K==="object"&&K!==null&&!Array.isArray(K))return!0}return!1}function A9(q){switch(q){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function H6(q,j){return $4(j0(q,j),j0)}function g6(q,j){return n4(j0(q,j),j0)}function N9(q){let j=v6(q),K=f6(q);return`${j}T${K}`}function v6(q){let j=q.int(2000,2030),K=q.int(1,12),z=h4(j,K),b=q.int(1,z);return`${j}-${l(K)}-${l(b)}`}function f6(q){let j=q.int(0,23),K=q.int(0,59),z=q.int(0,59);return`${l(j)}:${l(K)}:${l(z)}Z`}var Q9=["alice","bob","charlie","dave","eve","frank","grace","heidi"],S9=["example.com","test.org","demo.net","sample.io"];function V6(q){let j=q.pick(Q9),K=q.int(1,999),z=q.pick(S9);return`${j}${K}@${z}`}var _9=["https"],H9=["example.com","test.org","demo.net"],g9=["api","v1","users","items","data","resource"];function F0(q){let j=q.pick(_9),K=q.pick(H9),z=q.int(1,3),b=[];for(let P=0;P<z;P++)b.push(q.pick(g9));return`${j}://${K}/${b.join("/")}`}var v9=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],f9=["com","org","net","io","dev"];function w6(q){let j=q.int(1,3),K=[];for(let z=0;z<j;z++)K.push(q.pick(v9));return K.push(q.pick(f9)),K.join(".")}function E9(q){return`${q.int(1,254)}.${q.int(0,255)}.${q.int(0,255)}.${q.int(1,254)}`}function x9(q){let j=[];for(let K=0;K<8;K++)j.push(q.int(0,65535).toString(16));return j.join(":")}function X9(q){let j=(K)=>{let z="";for(let b=0;b<K;b++)z+=q.int(0,15).toString(16);return z};return`${j(8)}-${j(4)}-4${j(3)}-${["8","9","a","b"][q.int(0,3)]}${j(3)}-${j(12)}`}var u9=["foo","bar","baz","items","0","1","2","name","value"];function D6(q){let j=q.int(1,4),K=[];for(let z=0;z<j;z++)K.push(q.pick(u9));return"/"+K.join("/")}function p9(q){let j=["P"],K=q.bool(),z=q.bool();if(K){if(q.bool())j.push(`${q.int(0,100)}Y`);if(q.bool())j.push(`${q.int(0,12)}M`);if(q.bool())j.push(`${q.int(0,30)}D`)}if(z){if(j.push("T"),q.bool())j.push(`${q.int(0,23)}H`);if(q.bool())j.push(`${q.int(0,59)}M`);if(q.bool())j.push(`${q.int(0,59)}S`)}if(j.length===1||j.length===2&&j[1]==="T")j.push("0D");return j.join("")}var l9=new Map([["date-time",N9],["date",v6],["time",f6],["duration",p9],["email",V6],["idn-email",V6],["uri",F0],["uri-reference",F0],["iri",F0],["iri-reference",F0],["hostname",w6],["idn-hostname",w6],["ipv4",E9],["ipv6",x9],["uuid",X9],["json-pointer",D6],["relative-json-pointer",(q)=>`${q.int(0,5)}${D6(q)}`]]);function E6(q){let j=new Map(l9);if(q)for(let[K,z]of Object.entries(q))j.set(K,z);return j}function d9(q,j){if(!q.startsWith("$"))throw Error(`Invalid JSONPath: ${q} (must start with $)`);let K=Z9(q),z=[j];for(let b of K){let P=[];if(b===""){for(let B of z)_0(B,P);P.push(...z),z=P;continue}for(let B of z){if(B===null||B===void 0)continue;if(b.startsWith("q:")){let F=b.slice(2);if(typeof B==="object"&&B!==null&&F in B)P.push(B[F])}else if(b==="*"){if(Array.isArray(B))P.push(...B)}else if(/^\d+$/.test(b)){let F=parseInt(b,10);if(Array.isArray(B)&&F<B.length)P.push(B[F])}else if(typeof B==="object"&&B!==null&&b in B)P.push(B[b])}z=P}return z}function _0(q,j){if(q===null||q===void 0)return;if(Array.isArray(q))for(let K of q)j.push(K),_0(K,j);else if(typeof q==="object")for(let K of Object.values(q))j.push(K),_0(K,j)}function Z9(q){if(!q.startsWith("$"))throw Error(`Invalid JSONPath: ${q}`);let j=[],K=q.slice(1);while(K.length>0)if(K.startsWith(".")){if(K=K.slice(1),K.startsWith("."))K=K.slice(1),j.push("");let z=K.match(/^([a-zA-Z_][a-zA-Z0-9_]*)/);if(z)j.push(z[1]),K=K.slice(z[1].length);else break}else if(K.startsWith("[")){let z=K.indexOf("]");if(z===-1)break;let b=K.slice(1,z),P=h9(b),B=b[0]==='"'||b[0]==="'";j.push(B?`q:${P}`:P),K=K.slice(z+1)}else break;return j}function h9(q){let j=q[0];if((j==='"'||j==="'")&&q[q.length-1]===j)return q.slice(1,-1).replace(/\\(["'\\])/g,"$1");return q}function m9(q){if(q.properties)return q.properties;if(q.type==="object"||q.type===void 0){let j={},K=!1;for(let[z,b]of Object.entries(q)){if(D0.has(z))continue;if(Y6(b))j[z]=b,K=!0;else j[z]={const:b},K=!0}if(K)return j}return{}}function V0(q,j,K,z){if(!K.resolveJsonPath)return q;let b=z??q;if(j===!0||j===!1)return q;if(j.$ref)return q;let P=j;if(P.allOf||P.anyOf||P.oneOf)return q;if(typeof q==="object"&&q!==null&&!Array.isArray(q)){let B={...q},F=m9(P);for(let[G,W]of Object.entries(F))if(G in B){let V=B[G];if(typeof W==="object"&&W!==null&&"jsonPath"in W&&typeof W.jsonPath==="string"){let L=d9(W.jsonPath,b);if(L.length>0)B[G]=K.random.pick(L)}else B[G]=V0(V,W,K,b)}return B}if(Array.isArray(q)&&P.items)return q.map((B)=>V0(B,P.items,K,b));return q}var i9=E6(),U6=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);function x6(q,j){if(j?.validateSchemaVersion===!0&&!j?.propAliases){if(typeof q==="object"&&q!==null&&"$schema"in q){let V=q.$schema;if(typeof V==="string"&&!U6.has(V))throw Error(`Unsupported JSON Schema version: ${V}. Supported versions: ${[...U6].join(", ")}`)}}let K=$9(j),z=I6(j?.seed??1),b=K.propAliases?o9(q,K.propAliases):q,P=W9(b);V9(b,P);let B=K.formats?E6(K.formats):new Map(i9),F=K.refDepthMin??K.refDepth,G=K.refDepthMax??K.refDepth;if(F!==void 0&&G!==void 0&&F>G)throw Error(`refDepthMin (${F}) cannot be greater than refDepthMax (${G})`);let W={random:z,maxDepth:K.maxDepth??(G?G+20:5),maxDefaultItems:K.maxDefaultItems??3,optionalsProbability:K.optionalsProbability??0.5,depth:0,refRegistry:P,refStack:new Set,formatRegistry:B,minItems:K.minItems,maxItems:K.maxItems,minLength:K.minLength,maxLength:K.maxLength,useDefaultValue:K.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:K.alwaysFakeOptionals,fixedProbabilities:K.fixedProbabilities,fillProperties:K.fillProperties,extensions:K.extensions,resolveJsonPath:K.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:F,refDepthMax:G,useExamplesValue:K.useExamplesValue,filterExampleDefaults:K.filterExampleDefaults??!1,pruneProperties:K.pruneProperties,failOnInvalidTypes:K.failOnInvalidTypes,defaultInvalidTypeProduct:K.defaultInvalidTypeProduct,minDateTime:K.minDateTime,maxDateTime:K.maxDateTime,propAliases:K.propAliases,outputTransform:K.outputTransform};return{schema_:b,normalizedOptions:K,ctx:W}}async function X6(q,j){let{schema_:K,normalizedOptions:z,ctx:b}=x6(q,j);b.refResolver=z.refResolver;let P=await H6(K,b);if(z.resolveJsonPath)return V0(P,q,b,P);return P}function u6(q,j){let{schema_:K,normalizedOptions:z,ctx:b}=x6(q,j);b.__sync=!0,b.refResolver=z.refResolver;let P=g6(K,b);if(z.resolveJsonPath)return V0(P,q,b,P);return P}function o9(q,j){if(typeof q!=="object"||q===null)return q;let K=q,z=null;for(let[b,P]of Object.entries(j))if(b in K&&!(P in K)){if(!z)z={...K};z[P]=z[b],delete z[b]}return z??q}function $9(q){if(!q)return{};let j=q,K={...q};if(j.requiredOnly===!0&&K.optionalsProbability===void 0)K={...K,optionalsProbability:0,alwaysFakeOptionals:!1};if(j.ignoreProperties&&j.ignoreProperties.length>0)K={...K,outputTransform:n9(K.outputTransform,r9(j.ignoreProperties))};return K}function n9(q,j){if(!q)return j;if(!j)return q;return(K,z,b)=>{let P=q(K,z,b);if(P&&typeof P==="object"&&"then"in P&&typeof P.then==="function")return P.then((B)=>j(B,z,b));return j(P,z,b)}}function r9(q){return(j,K,z)=>{if(z==="/")return j;let b=c9(z.slice(z.lastIndexOf("/")+1));return q.some((P)=>{if(typeof P==="string")return P===b;if(P instanceof RegExp)return P.test(b);return P(K)})?void 0:j}}function c9(q){return q.replace(/~1/g,"/").replace(/~0/g,"~")}import{ResourceLimitError as K0}from"@schmock/core";function z0(q){let j=[{value:q,exiting:!1}],K=new Set,z=0,b=0,P=(B)=>{if(b+=B,b>c)throw new K0("generated_chars",c,b)};while(j.length>0){let B=j.pop();if(!B)break;let F=B.value;if(B.exiting){if(typeof F==="object"&&F!==null)K.delete(F);continue}if(z+=1,z>i)throw new K0("generated_nodes",i,z);if(typeof F==="string"){if(F.length>g)throw new K0("string_length",g,F.length);P(F.length);continue}if(typeof F!=="object"||F===null||K.has(F))continue;if(K.add(F),j.push({value:F,exiting:!0}),Array.isArray(F)){if(F.length>E)throw new K0("array_size",E,F.length);for(let W=0;W<F.length;W+=1)j.push({value:F[W],exiting:!1});continue}let G=Object.entries(F);if(G.length>o)throw new K0("object_properties",o,G.length);for(let[W,V]of G)P(W.length),j.push({value:V,exiting:!1})}}function Q(q){return typeof q==="object"&&q!==null&&!Array.isArray(q)}function y(q){return Q(q)}function s(q){for(let j of["u",""])try{return new RegExp(q,j)}catch{}return}var Z={depthCost:1,frameCost:0},x={depthCost:0,frameCost:1},p6=[{keyword:"properties",shape:"map",generates:!0,costs:Z,typedAs:"object"},{keyword:"definitions",shape:"map",generates:!1,costs:x},{keyword:"$defs",shape:"map",generates:!1,costs:x},{keyword:"patternProperties",shape:"map",generates:!0,costs:Z},{keyword:"items",shape:"single",generates:!0,costs:Z,typedAs:"array",tupleForm:!0},{keyword:"additionalItems",shape:"single",generates:!0,costs:Z},{keyword:"prefixItems",shape:"array",generates:!0,costs:Z,typedAs:"array"},{keyword:"allOf",shape:"array",generates:!0,costs:x},{keyword:"anyOf",shape:"array",generates:!0,costs:x},{keyword:"oneOf",shape:"array",generates:!0,costs:x},{keyword:"additionalProperties",shape:"single",generates:!0,costs:Z},{keyword:"contains",shape:"single",generates:!0,costs:Z},{keyword:"not",shape:"single",generates:!1,costs:x},{keyword:"if",shape:"single",generates:!1,generatesWith:"then",costs:x},{keyword:"then",shape:"single",generates:!0,costs:x},{keyword:"else",shape:"single",generates:!0,costs:x},{keyword:"propertyNames",shape:"single",generates:!0,costs:Z},{keyword:"dependencies",shape:"map",generates:!0,costs:x},{keyword:"contentSchema",shape:"single",generates:!0,costs:x},{keyword:"dependentSchemas",shape:"map",generates:!0,costs:x},{keyword:"containsAll",shape:"array",generates:!0,costs:Z}];function l6(q,j){let K=Reflect.get(q,j.keyword);if(K===void 0)return;if(j.shape==="array"||j.tupleForm===!0&&Array.isArray(K)){if(!Array.isArray(K))return;return{descriptor:j,form:"array",entries:K.map((b,P)=>({value:b,location:{form:"array",index:P}}))}}if(j.shape==="map"){if(typeof K!=="object"||K===null)return;return{descriptor:j,form:"map",entries:Object.entries(K).map(([b,P])=>({value:P,location:{form:"map",name:b}}))}}return{descriptor:j,form:"single",entries:[{value:K,location:{form:"single"}}]}}function d6(q){for(let j of p6)if(Reflect.get(q,j.keyword)!==void 0&&l6(q,j)===void 0)return j.keyword;return}function*Z6(q){for(let j of p6){let K=l6(q,j);if(K)yield K}}function s9(q){switch(q.form){case"single":return"";case"array":return`[${q.index}]`;case"map":return`.${q.name}`}}function h6(q,j){let K=(b)=>q.type===b||Array.isArray(q.type)&&q.type.includes(b),z=[];for(let{descriptor:b,entries:P}of Z6(q)){let B=b.typedAs!==void 0&&K(b.typedAs),F=b.generates||b.generatesWith!==void 0&&Reflect.get(q,b.generatesWith)!==void 0;for(let{value:G,location:W}of P){if(!y(G))continue;z.push({schema:G,keyword:b.keyword,path:`${j}.${b.keyword}${s9(W)}`,depthCost:b.costs.depthCost,frameCost:b.costs.frameCost,typedContinuation:B,generates:F})}}return z}function*U0(q,j){for(let{descriptor:K,form:z,entries:b}of Z6(q)){let{keyword:P}=K;if(z==="single"){let[{value:B,location:F}]=b,G=j(B,{keyword:P,location:F});if(G!==void 0)yield{keyword:P,form:z,value:G}}else if(z==="array"){let B=[];for(let{value:F,location:G}of b){let W=j(F,{keyword:P,location:G});if(W!==void 0)B.push(W)}yield{keyword:P,form:z,value:B}}else{let B={};for(let{value:F,location:G}of b){let W=j(F,{keyword:P,location:G});if(W===void 0||G.form!=="map")continue;Object.defineProperty(B,G.name,{value:W,writable:!0,enumerable:!0,configurable:!0})}yield{keyword:P,form:z,value:B}}}}var i6=2147483647,I0=1000,C0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function q5(q){let j=Array.from({length:q.int(1,48)},()=>q.int(0,255)),K="";for(let z=0;z<j.length;z+=3){let b=j.length-z,P=j[z]<<16|(b>1?j[z+1]:0)<<8|(b>2?j[z+2]:0);K+=C0[P>>18&63],K+=C0[P>>12&63],K+=b>1?C0[P>>6&63]:"=",K+=b>2?C0[P&63]:"="}return K}var j5={byte:q5},K5=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","definitions","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","autoIncrement","initialOffset","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","additionalItems","contains","containsAll","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependencies","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","default","examples","description","title","readOnly","writeOnly","deprecated","faker","chance","jsonPath","template","example"]);function g0(q,j){let K=new e9({locale:[a9,t9]});if(q!==void 0)K.seed(q);if(j!==void 0)K.setDefaultRefDate(j);return K}function H0(q,j){if(q===null||typeof q!=="object")return q;if(j.has(q))return q;if(q instanceof Date)return new Date(q.getTime());let K=Object.getPrototypeOf(q),z=K===Object.prototype||K===null;if(!Array.isArray(q)&&!z)try{return structuredClone(q)}catch{return q}j.add(q);try{if(Array.isArray(q))return q.map((P)=>H0(P,j));let b={};for(let[P,B]of Object.entries(q))Object.defineProperty(b,P,{value:H0(B,j),writable:!0,enumerable:!0,configurable:!0});return b}finally{j.delete(q)}}function O0(q){return H0(q,new Set)}function t(q,j){if(q===null||typeof q!=="object")return q;let K=j.get(q);if(K!==void 0)return K;if(q instanceof Date){let P=new Date(q.getTime());return j.set(q,P),P}if(q instanceof RegExp){let P=new RegExp(q.source,q.flags);return P.lastIndex=q.lastIndex,j.set(q,P),P}if(q instanceof Map){let P=new Map;j.set(q,P);for(let[B,F]of q)P.set(t(B,j),t(F,j));return P}if(q instanceof Set){let P=new Set;j.set(q,P);for(let B of q)P.add(t(B,j));return P}if(q instanceof ArrayBuffer){let P=q.slice(0);return j.set(q,P),P}if(ArrayBuffer.isView(q)){let P=structuredClone(q);return j.set(q,P),P}if(q instanceof URL){let P=new URL(q.href);return j.set(q,P),P}if(Array.isArray(q)){let P=Array(q.length);j.set(q,P);for(let B=0;B<q.length;B+=1)if(Object.hasOwn(q,B))P[B]=t(q[B],j);return P}let z=Object.getPrototypeOf(q);if(z!==Object.prototype&&z!==null)return q;let b=Object.create(z);j.set(q,b);for(let[P,B]of Object.entries(q))Object.defineProperty(b,P,{value:t(B,j),writable:!0,enumerable:!0,configurable:!0});return b}function o6(q){let j=new Map;return q.map((K)=>t(K,j))}function $6(q){return q??Math.floor(Math.random()*i6)}function n6(q){let j=q;return()=>{j+=1831565813;let K=j;return K=Math.imul(K^K>>>15,K|1),K^=K+Math.imul(K^K>>>7,K|61),((K^K>>>14)>>>0)/4294967296}}var z5=new Set(["items","prefixItems"]);function b5(q,j,K){if(typeof q==="boolean")return q;if(y(q))return r6(q,K);if(j.keyword==="dependencies"&&Array.isArray(q))return[...q];if(j.location.form==="array"&&z5.has(j.keyword))return!0;return}function P5(q){if(Array.isArray(q.items)){if(Reflect.get(q,"prefixItems")===void 0)return q;let j={...q};return Reflect.deleteProperty(j,"prefixItems"),j}if(q.items===void 0&&q.additionalItems!==void 0){let j={...q};return Reflect.deleteProperty(j,"additionalItems"),j}return q}var B5={items:"prefixItems",additionalItems:"items"};function F5(q,j={}){return r6(q,{normalizedSchemas:new Map,patternKeySeed:j.patternKeySeed,patternKeyCount:0})}function r6(q,j){let K=j.normalizedSchemas.get(q);if(K)return K;let z={};j.normalizedSchemas.set(q,z);for(let[B,F]of Object.entries(q))if(K5.has(B))z[B]=F;G5(q,z);let b=Array.isArray(q.items);if(b)z.items=!0,delete z.additionalItems;let P=U0(P5(q),(B,F)=>b5(B,F,j));for(let{keyword:B,value:F}of P)if(z[b?B5[B]??B:B]=F,B==="patternProperties"&&z.patternProperties)w5({schema:q,normalized:z,patternProperties:z.patternProperties,context:j});return z}function m6(q,j,K){let z=[q,j].filter((b)=>typeof b==="number");if(z.length===0)return;return z.reduce(K)}function G5(q,j){if(q.multipleOf!==void 0)return;let K=m6(q.minimum,q.exclusiveMinimum,Math.max),z=m6(q.maximum,q.exclusiveMaximum,Math.min);if(K!==void 0&&z===void 0&&K>=I0)j.maximum=K+I0;else if(z!==void 0&&K===void 0&&z<=-I0)j.minimum=z-I0}var W5=8;function V5(q,j){try{let K=u6({type:"string",pattern:q},{seed:j});return typeof K==="string"?K:void 0}catch{return}}function w5(q){let{schema:j,normalized:K,patternProperties:z,context:b}=q,P=b.patternKeySeed;if(P===void 0)return;let B=Object.keys(z).flatMap((J)=>{let A=s(J);return A?[{source:J,regex:A}]:[]});if(B.length===0)return;let F={...y(K.properties)?K.properties:{}},G=Object.keys(F).length,W=Math.max(1,(j.minProperties??0)-G),V=j.maxProperties===void 0?W:Math.max(0,j.maxProperties-G),L=Math.min(W,V),O=[];for(let J=0;J<L;J+=1){let{source:A}=B[J%B.length];for(let w=0;w<W5;w+=1){b.patternKeyCount+=1;let U=V5(A,(P+b.patternKeyCount*7919)%i6);if(U===void 0)break;let D=w===0?U:`${U}${w}`,R=B.filter((k)=>k.regex.test(D));if(Object.hasOwn(F,D)||R.length!==1||R[0].source!==A)continue;Object.defineProperty(F,D,{value:z[A],writable:!0,enumerable:!0,configurable:!0}),O.push(D);break}}if(O.length===0)return;K.properties=F,K.required=[...Array.isArray(K.required)?K.required:[],...O]}async function c6(q,j,K){let z={seed:j,maxDepth:e0,optionalsProbability:1,alwaysFakeOptionals:!0,useDefaultValue:!0,failOnInvalidTypes:!1,formats:{...j5},extensions:{faker:g0(j,K)}},b=await X6(F5(q,{patternKeySeed:j}),z);return z0(b),O0(b)}var t6=new Set(["__proto__","constructor","prototype"]);function a6(q,j,K=Math.random){if(j!==void 0&&!Number.isNaN(j)){if(j<0)return 0;return Math.floor(j)}if(q.minItems!==void 0&&q.maxItems!==void 0){let z=q.minItems,b=Math.max(z,q.maxItems);return Math.floor(K()*(b-z+1))+z}if(q.minItems!==void 0)return Math.max(q.minItems,r);if(q.maxItems!==void 0)return Math.min(q.maxItems,r);if(Array.isArray(q.items))return q.items.length;return r}function E0(q,j,K,z,b){if(!j)return q;if(!Q(q))return q;let P=structuredClone(q);return v0(P,j,{params:K,state:z,query:b}),P}function v0(q,j,K){for(let[z,b]of Object.entries(j)){if(t6.has(z))continue;if(z.includes("."))I5(q,z,b,K);else U5(q,z,b,K)}}function D5(q,j){if(!/^(0|[1-9]\d*)$/.test(j))return;let K=Number(j);return K<q.length?K:void 0}function f0(q,j){if(t6.has(j))return;if(Array.isArray(q)){let K=D5(q,j);if(K===void 0)return;return{read:()=>q[K],write:(z)=>{q[K]=z}}}return{read:()=>q[j],write:(K)=>{q[j]=K}}}function e6(q,j){if(typeof q==="string"&&q.includes("{{"))return C5(q,j);return O0(q)}function U5(q,j,K,z){let b=f0(q,j);if(!b)return;if(!Q(K)){b.write(e6(K,z));return}let P=b.read();if(Q(P)||Array.isArray(P))v0(P,K,z);else if(P===void 0||P===null){let B={};v0(B,K,z),b.write(B)}}function I5(q,j,K,z){let b=j.split("."),P=q;for(let F=0;F<b.length-1;F++){let G=f0(P,b[F]);if(!G)return;let W=G.read();if(Q(W)||Array.isArray(W))P=W;else if(W===void 0||W===null){let V={};G.write(V),P=V}else return}let B=f0(P,b[b.length-1]);if(B)B.write(e6(K,z))}function s6(q,j){let K=j.trim().split("."),z=q;for(let b of K)if(Q(z))z=z[b];else return;return z}function C5(q,j){let K=q.match(/^\{\{\s*([^}]+)\s*\}\}$/);if(K){let z=s6(j,K[1]);return z!==void 0?O0(z):q}return q.replace(/\{\{\s*([^}]+)\s*\}\}/g,(z,b)=>{let P=s6(j,b);return P!==void 0?String(P):z})}function j4(q,j,K){return x0(q,[j],{root:j,random:K,patterns:new Map})}var O5=4;function x0(q,j,K){if(q===null||q===void 0)return q;let z=[],b=new Set;for(let B of j)K4({schema:B,data:q,context:K,seen:b,found:z},!1);if(z.length===0)return q;if(R5(z)){if(K.random()<q6)return null}let P=z.map((B)=>B.schema);if(Q(q))for(let B of Object.keys(q)){let F=P.flatMap((G)=>b4(G,B,K).schemas);if(F.length>0)q[B]=x0(q[B],F,K)}else if(Array.isArray(q))for(let B=0;B<q.length;B++){let F=P.flatMap((G)=>J5(G,B));if(F.length>0)q[B]=x0(q[B],F,K)}return q}function X0(q){return Reflect.get(q,"schmockNullable")===!0}function L5(q){if(X0(q))return!0;if(q.const!==void 0&&q.const!==null)return!1;if(Array.isArray(q.enum)&&!q.enum.includes(null))return!1;if(q.type===void 0)return!0;return Array.isArray(q.type)?q.type.includes("null"):q.type==="null"}function R5(q){if(!q.some((j)=>X0(j.schema)))return!1;return q.every((j)=>!j.vetoes||L5(j.schema))}function K4(q,j){let{schema:K,data:z,context:b,seen:P,found:B}=q;if(P.has(K))return;P.add(K),B.push({schema:K,vetoes:!j});let F=j||X0(K),G=(V)=>K4({...q,schema:V},F),W=z4(K,b.root);if(W)G(W);for(let V of K.allOf??[])if(y(V))G(V);for(let V of["anyOf","oneOf"]){let O=(K[V]??[]).filter(y).filter((J)=>L0(z,J,b,O5));if(O.length===1)G(O[0])}}function z4(q,j){let K=q.$ref;if(typeof K!=="string"||!K.startsWith("#"))return;if(K==="#")return j;if(!K.startsWith("#/"))return;let z=j;for(let b of K.slice(2).split("/")){let P;try{P=decodeURIComponent(b)}catch{return}if(P=P.replace(/~1/g,"/").replace(/~0/g,"~"),Array.isArray(z))z=/^(0|[1-9]\d*)$/.test(P)?z[Number(P)]:void 0;else if(Q(z)&&Object.hasOwn(z,P))z=z[P];else return}return y(z)?z:void 0}function k5(q,j){if(!j.patterns.has(q))j.patterns.set(q,s(q));return j.patterns.get(q)}function b4(q,j,K){let z=[],b=q.properties!==void 0&&Object.hasOwn(q.properties,j);if(b){let F=q.properties?.[j];if(y(F))z.push(F)}let P=!1;for(let[F,G]of Object.entries(q.patternProperties??{}))if(k5(F,K)?.test(j)){if(P=!0,y(G))z.push(G)}let B=b||P;if(!B&&y(q.additionalProperties))z.push(q.additionalProperties);return{schemas:z,covered:B}}function J5(q,j){let K=Reflect.get(q,"prefixItems"),z=Array.isArray(q.items)?q.items:Array.isArray(K)?K:void 0;if(z){let b=j<z.length?z[j]:Array.isArray(q.items)?q.additionalItems:q.items;return y(b)?[b]:[]}return y(q.items)?[q.items]:[]}function M5(q,j){switch(j){case"null":return q===null;case"boolean":return typeof q==="boolean";case"string":return typeof q==="string";case"integer":return Number.isInteger(q);case"number":return typeof q==="number";case"array":return Array.isArray(q);case"object":return Q(q);default:return!0}}function q4(q,j){if(q===j)return!0;if(typeof q!=="object"||typeof j!=="object")return!1;return JSON.stringify(q)===JSON.stringify(j)}function L0(q,j,K,z){if(z<=0)return!0;let b=z4(j,K.root);if(b&&!L0(q,b,K,z-1))return!1;if(j.type!==void 0){if(!(Array.isArray(j.type)?j.type:[j.type]).some((B)=>M5(q,B)))return!1}if(j.const!==void 0&&!q4(j.const,q))return!1;if(Array.isArray(j.enum)&&!j.enum.some((P)=>q4(P,q)))return!1;if(Q(q)){for(let P of j.required??[])if(!Object.hasOwn(q,P))return!1;for(let[P,B]of Object.entries(q)){let{schemas:F,covered:G}=b4(j,P,K);if(!G&&j.additionalProperties===!1)return!1;for(let W of F)if(B!==null&&!L0(B,W,K,z-1))return!1}}for(let P of j.allOf??[])if(y(P)&&!L0(q,P,K,z-1))return!1;return!0}var T5=[{keywords:["email"],fakerMethod:"internet.email",schemaType:"string",minScore:0.6,format:"email"},{keywords:["username","user_name","login","handle","nickname"],fakerMethod:"internet.username",schemaType:"string",minScore:0.6},{keywords:["password","passwd","secret"],fakerMethod:"internet.password",schemaType:"string",minScore:0.6},{keywords:["token","api_key","apikey","access_token","refresh_token"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.8}],Y5=[{keywords:["first_name","firstname","given_name","forename"],fakerMethod:"person.firstName",schemaType:"string",minScore:0.6},{keywords:["last_name","lastname","surname","family_name"],fakerMethod:"person.lastName",schemaType:"string",minScore:0.6},{keywords:["full_name","fullname","display_name","displayname","full_name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["middle_name","middlename"],fakerMethod:"person.middleName",schemaType:"string",minScore:0.8},{keywords:["prefix","honorific","salutation"],fakerMethod:"person.prefix",schemaType:"string",minScore:0.8},{keywords:["suffix"],fakerMethod:"person.suffix",schemaType:"string",minScore:0.9},{keywords:["gender","sex"],fakerMethod:"person.sex",schemaType:"string",minScore:0.8},{keywords:["bio","biography"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.8},{keywords:["job_title","jobtitle","position","occupation","job","role"],fakerMethod:"person.jobTitle",schemaType:"string",minScore:0.6},{keywords:["job_area","department","division","team"],fakerMethod:"person.jobArea",schemaType:"string",minScore:0.8},{keywords:["zodiac","zodiac_sign"],fakerMethod:"person.zodiacSign",schemaType:"string",minScore:0.9}],y5=[{keywords:["phone","mobile","cell","tel","telephone","cellphone","fax"],fakerMethod:"phone.number",schemaType:"string",minScore:0.6},{keywords:["imei"],fakerMethod:"phone.imei",schemaType:"string",minScore:0.9}],A5=[{keywords:["street","street_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["address","mailing_address","postal_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["city","town"],fakerMethod:"location.city",schemaType:"string",minScore:0.6},{keywords:["state","province","region"],fakerMethod:"location.state",schemaType:"string",minScore:0.8},{keywords:["country"],fakerMethod:"location.country",schemaType:"string",minScore:0.8},{keywords:["country_code","countrycode"],fakerMethod:"location.countryCode",schemaType:"string",minScore:0.8},{keywords:["county"],fakerMethod:"location.county",schemaType:"string",minScore:0.9},{keywords:["continent"],fakerMethod:"location.continent",schemaType:"string",minScore:0.9},{keywords:["zip","zipcode","zip_code","postal","postal_code"],fakerMethod:"location.zipCode",schemaType:"string",minScore:0.6},{keywords:["latitude","lat"],fakerMethod:"location.latitude",schemaType:"number",minScore:0.6},{keywords:["longitude","lng","lon","long"],fakerMethod:"location.longitude",schemaType:"number",minScore:0.6},{keywords:["timezone","time_zone","tz"],fakerMethod:"location.timeZone",schemaType:"string",minScore:0.8},{keywords:["building_number"],fakerMethod:"location.buildingNumber",schemaType:"string",minScore:0.9}],N5=[{keywords:["url","website","link","href","homepage","webpage"],fakerMethod:"internet.url",schemaType:"string",minScore:0.6},{keywords:["avatar","photo_url","profile_image","image_url","picture","thumbnail","icon"],fakerMethod:"image.avatar",schemaType:"string",minScore:0.6},{keywords:["domain","hostname","domain_name"],fakerMethod:"internet.domainName",schemaType:"string",minScore:0.8},{keywords:["ip","ip_address","ipaddress","ipv4"],fakerMethod:"internet.ipv4",schemaType:"string",minScore:0.8},{keywords:["ipv6"],fakerMethod:"internet.ipv6",schemaType:"string",minScore:0.9},{keywords:["mac","mac_address"],fakerMethod:"internet.mac",schemaType:"string",minScore:0.9},{keywords:["user_agent","useragent"],fakerMethod:"internet.userAgent",schemaType:"string",minScore:0.9},{keywords:["port"],fakerMethod:"internet.port",schemaType:"number",minScore:0.9},{keywords:["protocol"],fakerMethod:"internet.protocol",schemaType:"string",minScore:0.9}],Q5=[{keywords:["uuid","guid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.6},{keywords:["sku"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.9},{keywords:["slug"],fakerMethod:"lorem.slug",schemaType:"string",minScore:0.8},{keywords:["isbn"],fakerMethod:"commerce.isbn",schemaType:"string",minScore:0.9},{keywords:["vin"],fakerMethod:"vehicle.vin",schemaType:"string",minScore:0.9},{keywords:["iban"],fakerMethod:"finance.iban",schemaType:"string",minScore:0.9},{keywords:["bic","swift"],fakerMethod:"finance.bic",schemaType:"string",minScore:0.9},{keywords:["ssn","social_security"],fakerMethod:"string.numeric",schemaType:"string",minScore:0.9}],S5=[{keywords:["description","desc","summary","overview","about","excerpt"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.6},{keywords:["content","body","text","message"],fakerMethod:"lorem.paragraphs",schemaType:"string",minScore:0.6},{keywords:["title","heading","subject","headline"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.6},{keywords:["tag","label","category","keyword"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.8},{keywords:["comment","note","remark","feedback","review"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.8},{keywords:["sentence"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.9},{keywords:["paragraph"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.9},{keywords:["word"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.9}],_5=[{keywords:["company","organization","org","employer","brand","operator"],fakerMethod:"company.name",schemaType:"string",minScore:0.6},{keywords:["product","product_name","item_name"],fakerMethod:"commerce.productName",schemaType:"string",minScore:0.8},{keywords:["price","amount","cost","fee","salary","wage","total","subtotal","balance","revenue","income"],fakerMethod:"commerce.price",minScore:0.6},{keywords:["currency","currency_code"],fakerMethod:"finance.currencyCode",schemaType:"string",minScore:0.8},{keywords:["currency_name"],fakerMethod:"finance.currencyName",schemaType:"string",minScore:0.8},{keywords:["currency_symbol"],fakerMethod:"finance.currencySymbol",schemaType:"string",minScore:0.8},{keywords:["account_number","account_no"],fakerMethod:"finance.accountNumber",schemaType:"string",minScore:0.8},{keywords:["credit_card","card_number"],fakerMethod:"finance.creditCardNumber",schemaType:"string",minScore:0.8},{keywords:["cvv"],fakerMethod:"finance.creditCardCVV",schemaType:"string",minScore:0.9},{keywords:["transaction_type"],fakerMethod:"finance.transactionType",schemaType:"string",minScore:0.9}],H5=[{keywords:["created_at","createdat","creation_date","date_created","createddate"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["updated_at","updatedat","modified_at","modifiedat","date_updated","last_modified","date_modified"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["deleted_at","deletedat"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["published_at","publishedat","publish_date"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["expires_at","expiresat","expiration","expiry"],fakerMethod:"date.future",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["birthday","date_of_birth","dob","birthdate","born"],fakerMethod:"date.birthdate",schemaType:"string",minScore:0.8,format:"date-time"},{keywords:["start_date","begin_date"],fakerMethod:"date.past",schemaType:"string",minScore:0.8,format:"date-time"},{keywords:["end_date","due_date","deadline"],fakerMethod:"date.future",schemaType:"string",minScore:0.8,format:"date-time"},{keywords:["timestamp","ts"],fakerMethod:"date.recent",schemaType:"string",minScore:0.8,format:"date-time"}],g5=[{keywords:["color","colour"],fakerMethod:"color.human",schemaType:"string",minScore:0.8},{keywords:["hex_color","hexcolor"],fakerMethod:"color.rgb",schemaType:"string",minScore:0.9}],v5=[{keywords:["age"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:18,max:80}},{keywords:["rating","score","stars"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:5}},{keywords:["count","quantity","qty"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:100}},{keywords:["percentage","percent"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:0,max:100}},{keywords:["weight"],fakerMethod:"number.float",schemaType:"number",minScore:0.8,fakerArgs:{min:0.1,max:200}},{keywords:["height"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:100,max:220}},{keywords:["width","length","depth"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:1000}},{keywords:["priority","order","rank","level"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:10}},{keywords:["version"],fakerMethod:"system.semver",schemaType:"string",minScore:0.8}],f5=[{keywords:["is_active","isactive","active","enabled","is_enabled"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.9},{keywords:["is_deleted","isdeleted","deleted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.05},{keywords:["is_archived","isarchived","archived"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_verified","isverified","verified","confirmed","is_confirmed"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.8},{keywords:["is_admin","isadmin","admin"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_public","ispublic","public","visible","is_visible"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.7},{keywords:["is_read","isread","read","seen","is_seen"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.6},{keywords:["is_default","isdefault"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.1},{keywords:["is_required","isrequired","required","mandatory"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.5},{keywords:["is_featured","isfeatured","featured","promoted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.15},{keywords:["available","in_stock"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.85}],E5=[{keywords:["filename","file_name"],fakerMethod:"system.fileName",schemaType:"string",minScore:0.8},{keywords:["file_type","filetype","mime_type","mimetype","content_type"],fakerMethod:"system.mimeType",schemaType:"string",minScore:0.8},{keywords:["file_ext","extension"],fakerMethod:"system.fileExt",schemaType:"string",minScore:0.9},{keywords:["file_path","filepath","path"],fakerMethod:"system.filePath",schemaType:"string",minScore:0.9},{keywords:["cron","cron_expression"],fakerMethod:"system.cron",schemaType:"string",minScore:0.9},{keywords:["semver"],fakerMethod:"system.semver",schemaType:"string",minScore:0.9}],x5=[{keywords:["aircraft_type","airplane","aircraft"],fakerMethod:"airline.aircraftType",schemaType:"string",minScore:0.9},{keywords:["flight_number","flight"],fakerMethod:"airline.flightNumber",schemaType:"string",minScore:0.9},{keywords:["record_locator","booking_ref","pnr"],fakerMethod:"airline.recordLocator",schemaType:"string",minScore:0.9},{keywords:["seat","seat_number"],fakerMethod:"airline.seat",schemaType:"string",minScore:0.9}],X5=[{keywords:["animal","animal_type","species"],fakerMethod:"animal.type",schemaType:"string",minScore:0.9},{keywords:["pet_name"],fakerMethod:"animal.petName",schemaType:"string",minScore:0.9},{keywords:["breed"],fakerMethod:"animal.dog",schemaType:"string",minScore:0.9},{keywords:["bird"],fakerMethod:"animal.bird",schemaType:"string",minScore:0.9},{keywords:["fish"],fakerMethod:"animal.fish",schemaType:"string",minScore:0.9},{keywords:["horse"],fakerMethod:"animal.horse",schemaType:"string",minScore:0.9},{keywords:["insect"],fakerMethod:"animal.insect",schemaType:"string",minScore:0.9}],u5=[{keywords:["book_title"],fakerMethod:"book.title",schemaType:"string",minScore:0.9},{keywords:["author","book_author","writer"],fakerMethod:"book.author",schemaType:"string",minScore:0.9},{keywords:["genre","book_genre"],fakerMethod:"book.genre",schemaType:"string",minScore:0.9},{keywords:["publisher","publishing_house"],fakerMethod:"book.publisher",schemaType:"string",minScore:0.9},{keywords:["book_series","series_name"],fakerMethod:"book.series",schemaType:"string",minScore:0.9}],p5=[{keywords:["dish","meal","recipe_name"],fakerMethod:"food.dish",schemaType:"string",minScore:0.9},{keywords:["ingredient"],fakerMethod:"food.ingredient",schemaType:"string",minScore:0.9},{keywords:["spice"],fakerMethod:"food.spice",schemaType:"string",minScore:0.9},{keywords:["fruit"],fakerMethod:"food.fruit",schemaType:"string",minScore:0.9},{keywords:["vegetable"],fakerMethod:"food.vegetable",schemaType:"string",minScore:0.9},{keywords:["meat"],fakerMethod:"food.meat",schemaType:"string",minScore:0.9},{keywords:["food_description"],fakerMethod:"food.description",schemaType:"string",minScore:0.9},{keywords:["ethnic_category","cuisine"],fakerMethod:"food.ethnicCategory",schemaType:"string",minScore:0.9}],l5=[{keywords:["song","song_name","track","track_name"],fakerMethod:"music.songName",schemaType:"string",minScore:0.9},{keywords:["album","album_name"],fakerMethod:"music.album",schemaType:"string",minScore:0.9},{keywords:["artist","musician","band"],fakerMethod:"music.artist",schemaType:"string",minScore:0.9},{keywords:["music_genre"],fakerMethod:"music.genre",schemaType:"string",minScore:0.9}],d5=[],Z5=[{keywords:["vehicle","vehicle_name"],fakerMethod:"vehicle.vehicle",schemaType:"string",minScore:0.9},{keywords:["vehicle_type"],fakerMethod:"vehicle.type",schemaType:"string",minScore:0.9},{keywords:["vehicle_manufacturer","car_make"],fakerMethod:"vehicle.manufacturer",schemaType:"string",minScore:0.9},{keywords:["vehicle_model","car_model"],fakerMethod:"vehicle.model",schemaType:"string",minScore:0.9},{keywords:["fuel","fuel_type"],fakerMethod:"vehicle.fuel",schemaType:"string",minScore:0.9},{keywords:["bicycle"],fakerMethod:"vehicle.bicycle",schemaType:"string",minScore:0.9},{keywords:["vehicle_color","car_color"],fakerMethod:"vehicle.color",schemaType:"string",minScore:0.9}],h5=[{keywords:["branch","branch_name","git_branch"],fakerMethod:"git.branch",schemaType:"string",minScore:0.9},{keywords:["commit_sha","commit_hash","sha"],fakerMethod:"git.commitSha",schemaType:"string",minScore:0.9},{keywords:["commit_message"],fakerMethod:"git.commitMessage",schemaType:"string",minScore:0.9}],m5=[{keywords:["db_column","column_name"],fakerMethod:"database.column",schemaType:"string",minScore:0.9},{keywords:["db_type","column_type"],fakerMethod:"database.type",schemaType:"string",minScore:0.9},{keywords:["db_engine","database_engine"],fakerMethod:"database.engine",schemaType:"string",minScore:0.9},{keywords:["collation"],fakerMethod:"database.collation",schemaType:"string",minScore:0.9},{keywords:["mongodb_id","object_id"],fakerMethod:"database.mongodbObjectId",schemaType:"string",minScore:0.9}],i5=[{keywords:["abbreviation","tech_abbreviation"],fakerMethod:"hacker.abbreviation",schemaType:"string",minScore:0.9},{keywords:["hacker_phrase","tech_phrase"],fakerMethod:"hacker.phrase",schemaType:"string",minScore:0.9}],o5=[{keywords:["adjective"],fakerMethod:"word.adjective",schemaType:"string",minScore:0.8},{keywords:["adverb"],fakerMethod:"word.adverb",schemaType:"string",minScore:0.8},{keywords:["noun"],fakerMethod:"word.noun",schemaType:"string",minScore:0.8},{keywords:["verb"],fakerMethod:"word.verb",schemaType:"string",minScore:0.8}],P4=[...T5,...Y5,...y5,...A5,...N5,...Q5,...S5,..._5,...H5,...g5,...v5,...f5,...E5,...x5,...X5,...u5,...p5,...l5,...d5,...Z5,...h5,...m5,...i5,...o5];var u0=new Set(["date-time","date","time","duration","email","idn-email","hostname","idn-hostname","ipv4","ipv6","uri","uri-reference","iri","iri-reference","json-pointer","relative-json-pointer","uuid","byte"]);function $5(q){return typeof q==="string"&&u0.has(q)}function B4(q){return q>=65&&q<=90}function F4(q){return q>=97&&q<=122}function n5(q){return q>=48&&q<=57}function r5(q,j){let K=0;for(let z=1;z<q.length;z++){let b=q.charCodeAt(z);if(!B4(b))continue;let P=q.charCodeAt(z-1);if(F4(P)||n5(P)||B4(P)&&z+1<q.length&&F4(q.charCodeAt(z+1)))j.push(q.slice(K,z).toLowerCase()),K=z}j.push(q.slice(K).toLowerCase())}function W4(q){let j=[];for(let K of q.split(/[_-]/))if(K)r5(K,j);return j}function c5(q){let j=W4(q);return{tokens:j,joined:j.join("")}}var G4=new WeakMap;function s5(q){let j=G4.get(q);if(!j)j=q.keywords.map(c5),G4.set(q,j);return j}var t5=new Set(["type","status","format","code","kind"]),a5=5;function e5(q){let j=new Set,K=new Set,z=0;for(let P of q)j.add(z),z+=P.length,K.add(z);let b=q[q.length-1];return{tokens:q,joined:q.join(""),starts:j,ends:K,qualifier:q.length>1&&b!==void 0&&t5.has(b)?b:void 0}}function q7(q,j,K){if(!q.starts.has(j))return!1;if(q.ends.has(K))return!0;let z=q.joined.slice(K,K+2);return q.ends.has(K+1)&&z.startsWith("s")||q.ends.has(K+2)&&z==="es"}function j7(q,j){if(j.length<3)return!1;let K=q.joined.indexOf(j);while(K!==-1){if(j.length>=a5||q7(q,K,K+j.length))return!0;K=q.joined.indexOf(j,K+1)}return!1}function K7(q,j){let{tokens:K,joined:z}=q,b=0;for(let{tokens:P,joined:B}of j){if(z===B)return 1;if(P.length>0&&P.length<=K.length){if(K.slice(-P.length).every((G,W)=>G===P[W]))b=Math.max(b,0.8)}if(q.qualifier!==void 0&&P[P.length-1]!==q.qualifier)continue;if(P.length>0&&P.every((F)=>K.includes(F))){let G=P.length/K.length>0.5?0.9:0.65;b=Math.max(b,G)}if(j7(q,B))b=Math.max(b,0.7)}return b}function R0(q){return q.default!==void 0||q.const!==void 0||q.enum!==void 0||q.pattern!==void 0||q.$ref!==void 0||"faker"in q&&Boolean(q.faker)}function z7(q){if(!Array.isArray(q.type))return{mappable:!0,type:q.type};let j=q.type.filter((K)=>K!=="null");if(j.length===1)return{mappable:!0,type:j[0]};return{mappable:!1}}function p0(q,j,K=P4){if(R0(j))return;let z=z7(j);if(!z.mappable)return;let b=z.type;if(b==="string"&&j.format==="uuid")return{mapping:{keywords:["uuid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:1};if($5(j.format)||b==="string"&&(j.minLength!==void 0||j.maxLength!==void 0))return;let P=j.minimum!==void 0||j.maximum!==void 0||j.exclusiveMinimum!==void 0||j.exclusiveMaximum!==void 0||j.multipleOf!==void 0,B=b==="number"||b==="integer",F=W4(q),G=e5(F),W;for(let V of K){if(P&&(B||V.schemaType==="number"||V.schemaType==="integer"))continue;if(b==="object"||b==="array")continue;if(V.schemaType&&b&&V.schemaType!==b){if(!(V.schemaType==="number"&&b==="integer"||V.schemaType==="integer"&&b==="number"))continue}let L=K7(G,s5(V));if(L>=V.minScore&&(!W||L>W.score))W={mapping:V,score:L}}if(b==="string"){if(F[F.length-1]==="id"&&F.length>1){if(!W||W.score<0.8)W={mapping:{keywords:["id"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:0.8}}}return W}import{ResourceLimitError as u,SchemaValidationError as S}from"@schmock/core";var l0,V4=200;function $(q,j){return q.type===j||Array.isArray(q.type)&&q.type.includes(j)}var a={height:0,nodes:1,chars:0};function n0(q,j="$",K){if(!q||typeof q!=="object")throw new S(j,"Schema must be a valid JSON Schema object");let z={visited:0,circular:!1,edges:new Map,postOrder:[],resolveRef:G7(q)};if(b7(q,j,z),z.circular)throw new S(j,"Schema contains circular references which are not supported");B7(q,j,z);let b=v7(K),B=D7(q,z,b).get(q)??a,{maxDepth:F,maxFrames:G}=R7(q,z);if(F>P0)throw new u("schema_nesting_depth",P0,F);if(G>V4)z.composition??={resource:"schema_composition_depth",limit:V4,actual:G,path:j};for(let W of[z.composition,z.arraySize,z.objectSize,z.stringLength])if(W)throw new u(W.resource,W.limit,W.actual,W.path);if(b!==void 0&&T4(q)&&b>E)throw new u("array_size",E,b);if(B.nodes>i)throw new u("generated_nodes",i,B.nodes);if(B.chars>c)throw new u("generated_chars",c,B.chars)}function b7(q,j,K){let z=new Set,b=new Set,P=[{schema:q,path:j,typedChain:!0,exiting:!1}];while(P.length>0){let B=P.pop();if(!B)break;if(B.exiting){z.delete(B.schema),b.add(B.schema),K.postOrder.push(B.schema);continue}if(b.has(B.schema)){if(B.typedChain)U4(B.schema,B.path,!0);continue}if(z.has(B.schema)){K.circular=!0;continue}if(K.visited+=1,K.visited>B0)throw new u("schema_nodes",B0,K.visited);U4(B.schema,B.path,B.typedChain);let F=F7(B.schema,B.path,K.resolveRef);K.edges.set(B.schema,F),z.add(B.schema),P.push({...B,exiting:!0});for(let G=F.length-1;G>=0;G-=1){let W=F[G];if(z.has(W.schema))K.circular=!0;else if(!b.has(W.schema))P.push({schema:W.schema,path:W.path,typedChain:B.typedChain&&W.typedContinuation,exiting:!1})}}}var d0={};function P7(...q){let j={};for(let K of q){if(!y(K))continue;for(let z of["maxItems","maxLength","maxProperties"]){let b=K[z];if(typeof b!=="number")continue;j[z]=Math.min(j[z]??b,b)}}return j}function r0(q,j){return j===void 0?q:Math.min(q,j)}function B7(q,j,K){let z=new Set,b=[{schema:q,path:j,caps:d0}];while(b.length>0){let P=b.pop();if(!P||z.has(P.schema))continue;if(P.caps===d0)z.add(P.schema);f7(P.schema,P.path,K,P.caps),E7(P.schema,P.path,K,P.caps),x7(P.schema,P.path,K,P.caps);let B=K.edges.get(P.schema)??[];for(let F=B.length-1;F>=0;F-=1){let G=B[F];if(G.generates&&!z.has(G.schema))b.push({schema:G.schema,path:G.path,caps:G.keyword==="if"?P7(P.schema,P.schema.then):d0})}}}function F7(q,j,K){let z=L4(q,j);for(let b of["$ref","$dynamicRef"]){let P=Reflect.get(q,b);if(typeof P!=="string")continue;let B=K(q,P);if(y(B))z.unshift({schema:B,keyword:b,path:`${j}.${b}`,depthCost:0,frameCost:1,typedContinuation:!1,generates:!0})}return z}function L4(q,j){return h6(q,j)}var w4="schmock://local/root.json";function G7(q){let j=W7(q),K=new Map;return(z,b)=>{let P=K.get(z);if(!P)P=new Map,K.set(z,P);let B=P.get(b);if(B!==void 0)return B===null?void 0:B;let F=j.scopes.get(z)??j.rootScope,G=w7(b,F,j.resources);return P.set(b,G??null),G}}function W7(q){let j=new Map,K=new Map,z={baseUri:w4,resourceRoot:q};j.set(w4,q);let b=[{schema:q,inheritedScope:z,path:"$"}];while(b.length>0){let P=b.pop();if(!P||K.has(P.schema))continue;let B=V7(P.schema,P.inheritedScope,j,P.path);K.set(P.schema,B);for(let F of L4(P.schema,P.path))b.push({schema:F.schema,inheritedScope:B,path:F.path})}return{resources:j,scopes:K,rootScope:K.get(q)??z}}function V7(q,j,K,z){let b=j;if(typeof q.$id==="string"){let P=R4(q.$id,j.baseUri);if(P)if(Z0(K,P,q,z),k4(P)===""){let B=$0(P);Z0(K,B,q,z),b={baseUri:B,resourceRoot:q}}else b={...j,baseUri:P}}for(let P of["$anchor","$dynamicAnchor"]){let B=Reflect.get(q,P);if(typeof B==="string"&&B.length>0)Z0(K,`${$0(b.baseUri)}#${B}`,q,`${z}.${P}`)}return b}function Z0(q,j,K,z){let b=q.get(j);if(b!==void 0&&b!==K)throw new S(z,`Duplicate canonical schema identifier: "${j}"`,"Give each embedded resource and anchor a unique canonical identifier");q.set(j,K)}function w7(q,j,K){if(q==="#")return j.resourceRoot;if(q.startsWith("#/"))return D4(j.resourceRoot,q.slice(1));let z=R4(q,j.baseUri);if(!z)return;let b=K.get(z);if(b!==void 0)return b;let P=K.get($0(z));if(P===void 0)return;let B=k4(z);if(B==="")return P;return B.startsWith("/")?D4(P,B):void 0}function R4(q,j){try{return new URL(q,j).href}catch{return}}function $0(q){let j=new URL(q);return j.hash="",j.href}function k4(q){return new URL(q).hash.slice(1)}function D4(q,j){let K;try{K=decodeURIComponent(j)}catch{return}if(K==="")return q;if(!K.startsWith("/"))return;let z=q;for(let b of K.slice(1).split("/")){let P=b.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof z!=="object"||z===null||!Object.hasOwn(z,P))return;z=Reflect.get(z,P)}return typeof z==="boolean"||y(z)?z:void 0}function D7(q,j,K){let z=new Map;for(let b of j.postOrder)z.set(b,L7(b,z,j,b===q?{explicitCount:K}:void 0));return z}var U7=["contentSchema","propertyNames"],I7=["items","additionalItems","prefixItems","contains","containsAll"],C7=["properties","patternProperties","additionalProperties"],O7=["allOf","anyOf","oneOf","if","then","else"];function L7(q,j,K,z){let b=typeof q.$ref==="string"?q.$ref:Reflect.get(q,"$dynamicRef");if(typeof b==="string")return h0(K.resolveRef(q,b),j);let P=0,B=1,F=q.type==="string"&&typeof q.minLength==="number"?Math.max(0,q.minLength):0,G=new Set([...U7,...O7]),W=(w)=>{let U=h0(w,j);return P=Math.max(P,U.height+1),U},V=(w)=>{let U=h0(w,j);return P=Math.max(P,U.height),U};if(T4(q)){for(let H of I7)G.add(H);let w=z?.explicitCount??g7(q),U=z?z.explicitCount??q.minItems??0:w,D=Reflect.get(q,"prefixItems"),R=Array.isArray(q.items),k=Array.isArray(q.items)?q.items:Array.isArray(D)?D:[],I=0,C=0;k.forEach((H,m)=>{let t0=W(H);if(m<w)I=N(I+t0.nodes);if(m<U)C=N(C+t0.chars)});let M=R?q.additionalItems:q.items,Y=M===void 0?a:W(M);if(I=N(I+Math.max(0,w-k.length)*Y.nodes),C=N(C+Math.max(0,U-k.length)*Y.chars),q.contains!==void 0){let H=Reflect.get(q,"minContains"),m=Math.max(1,Math.min(typeof H==="number"?H:1,w));I=N(I+m*W(q.contains).nodes)}let f=Reflect.get(q,"containsAll");if(Array.isArray(f))for(let H of f)I=N(I+W(H).nodes);B=N(B+I),F=N(F+C)}if(Y4(q)){for(let I of C7)G.add(I);let w=new Set(Object.keys(q.properties??{}));for(let I of Object.values(q.properties??{})){let C=W(I);B=N(B+C.nodes),F=N(F+C.chars)}let U=a;for(let I of Object.values(q.patternProperties??{})){let C=W(I);if(B=N(B+C.nodes),C.nodes>U.nodes)U=C}if(q.additionalProperties!==void 0){let I=W(q.additionalProperties);if(I.nodes>U.nodes)U=I}if(q.propertyNames!==void 0)W(q.propertyNames);let D=new Set((q.required??[]).filter((I)=>!w.has(I))).size,R=Math.max(0,(q.minProperties??0)-w.size),k=Math.max(D,R);B=N(B+k*U.nodes)}for(let w of q.allOf??[]){let U=V(w);B=N(B+Math.max(0,U.nodes-1)),F=Math.max(F,U.chars)}let L=0;for(let w of["anyOf","oneOf"])for(let U of q[w]??[])L=Math.max(L,V(U).nodes-1);B=N(B+Math.max(0,L));let O=q.if===void 0?a:V(q.if),J=0;if(q.then!==void 0)J=V(q.then).nodes-1+(O.nodes-1);if(q.else!==void 0)J=Math.max(J,V(q.else).nodes-1);if(B=N(B+Math.max(0,J)),q.not!==void 0)V(q.not);for(let w of K.edges.get(q)??[]){if(!w.generates||G.has(w.keyword))continue;let U=w.depthCost===1,D=U?W(w.schema):V(w.schema);B=N(B+D.nodes-(U?0:1))}let A=$(q,"null")||Reflect.get(q,"schmockNullable")===!0;return{height:P,nodes:B,chars:A?0:F}}function h0(q,j){return y(q)?j.get(q)??a:a}function R7(q,j){let K=new Map([[q,0]]),z=new Map([[q,0]]),b=0,P=0;for(let B=j.postOrder.length-1;B>=0;B-=1){let F=j.postOrder[B],G=K.get(F),W=z.get(F);if(G===void 0||W===void 0)continue;b=Math.max(b,G),P=Math.max(P,W);for(let V of j.edges.get(F)??[]){let L=G+V.depthCost,O=W+V.frameCost;if(L>(K.get(V.schema)??-1))K.set(V.schema,L);if(O>(z.get(V.schema)??-1))z.set(V.schema,O)}}return{maxDepth:b,maxFrames:P}}function U4(q,j,K){if(K&&Object.keys(q).length===0)throw new S(j,"Schema cannot be empty");let z=["object","array","string","number","integer","boolean","null"],b=Array.isArray(q.type)?q.type:q.type?[q.type]:[];for(let B of b)if(!z.includes(B))throw new S(j,`Invalid schema type: ${JSON.stringify(B)}`,"Supported types are: object, array, string, number, integer, boolean, null");if(Reflect.get(q,"chance")!==void 0)throw new S(`${j}.chance`,"chance generators are not supported",'Use the faker keyword instead, for example "faker": "lorem.paragraph"');if(q.properties!==void 0&&(typeof q.properties!=="object"||Array.isArray(q.properties)))throw new S(`${j}.properties`,"Properties must be an object mapping property names to schemas",'Use { "propertyName": { "type": "string" } } format');let P=d6(q);if(P!==void 0)throw new S(`${j}.${P}`,`"${P}" has the wrong shape`,"Composition and positional keywords take a list of schemas; property maps take an object");for(let B of["items","prefixItems"]){let F=Reflect.get(q,B);if(!Array.isArray(F))continue;F.forEach((G,W)=>{if(typeof G!=="boolean"&&!y(G))throw new S(`${j}.${B}[${W}]`,"Positional item schemas must be schema objects or booleans",'Use a schema such as { "type": "string" }, or true to allow anything')})}if($(q,"array")){if(q.items===null||q.items===void 0)throw new S(`${j}.items`,"Array schema must have valid items definition","Define items as a schema object or array of schemas");if(Array.isArray(q.items)&&q.items.length===0)throw new S(`${j}.items`,"Array items cannot be empty array","Provide at least one item schema")}if("faker"in q&&q.faker!==void 0)try{k7(q.faker)}catch(B){if(B instanceof S){let F=B.context,G="Invalid faker method",W;if(F&&typeof F==="object"){if("issue"in F&&typeof F.issue==="string")G=F.issue;if("suggestion"in F&&typeof F.suggestion==="string")W=F.suggestion}throw new S(`${j}.faker`,G,W)}if(B instanceof u)throw H7(B,`${j}.faker`);if(B instanceof Error)throw B;throw Error(String(B))}}function k7(q){if(typeof q==="string"){M0(q);return}if(typeof q!=="object"||q===null||Array.isArray(q))throw new S("$.faker","Faker must be a method string or an object with exactly one own method key",'Use "person.fullName" or { "number.int": [{ "min": 1, "max": 2 }] }');let j=Reflect.ownKeys(q),K=Object.keys(q);if(j.length!==1||K.length!==1||typeof j[0]!=="string"||j[0]!==K[0])throw new S("$.faker","Object-form faker must contain exactly one own method key",'Use { "number.int": [{ "min": 1, "max": 2 }] }');let z=K[0],b=Object.getOwnPropertyDescriptor(q,z);if(!b||!("value"in b)||!Array.isArray(b.value))throw new S("$.faker",`Arguments for faker method "${z}" must be an array`,'Wrap options in an array, for example [{ "min": 1, "max": 2 }]');M0(z),J4(z,b.value)}var v={resource:"string_length",limit:g},k0={resource:"array_size",limit:E};function c0(q){return{resource:"string_length",limit:Math.floor(g/q)}}var J0=c0(2),m0=c0(7),J7=c0(21),M7={"string.fromCharacters":[{argumentIndex:1,direct:!0,...v}],"string.alpha":[{argumentIndex:0,direct:!0,property:"length",...v}],"string.alphanumeric":[{argumentIndex:0,direct:!0,property:"length",...v}],"string.binary":[{argumentIndex:0,direct:!1,property:"length",...v}],"string.octal":[{argumentIndex:0,direct:!1,property:"length",...v}],"string.hexadecimal":[{argumentIndex:0,direct:!1,property:"length",...v}],"string.numeric":[{argumentIndex:0,direct:!0,property:"length",...v}],"string.sample":[{argumentIndex:0,direct:!0,...v}],"string.nanoid":[{argumentIndex:0,direct:!0,...v}],"string.symbol":[{argumentIndex:0,direct:!0,...v}],"word.sample":[{argumentIndex:0,direct:!0,property:"length",...v}],"word.words":[{argumentIndex:0,direct:!0,property:"count",...J0}],"lorem.word":[{argumentIndex:0,direct:!0,property:"length",...v}],"lorem.words":[{argumentIndex:0,direct:!0,...J0}],"lorem.sentence":[{argumentIndex:0,direct:!0,...J0}],"lorem.sentences":[{argumentIndex:0,direct:!0,...m0}],"lorem.slug":[{argumentIndex:0,direct:!0,...J0}],"lorem.lines":[{argumentIndex:0,direct:!0,...m0}],"lorem.paragraph":[{argumentIndex:0,direct:!0,...m0}],"lorem.paragraphs":[{argumentIndex:0,direct:!0,...J7}],"lorem.text":[{argumentIndex:0,direct:!0,...v}],"internet.password":[{argumentIndex:0,direct:!1,property:"length",...v}],"helpers.uniqueArray":[{argumentIndex:1,direct:!0,...k0}],"helpers.arrayElements":[{argumentIndex:1,direct:!0,...k0}],"helpers.multiple":[{argumentIndex:1,direct:!1,property:"count",...k0}],"date.betweens":[{argumentIndex:0,direct:!1,property:"count",...k0}]};function J4(q,j){for(let b of M7[q]??[]){let P=j[b.argumentIndex],B=b.direct?I4(P):0;if(b.property&&Q(P))B=Math.max(B,I4(Reflect.get(P,b.property)));if(B>b.limit)throw new u(b.resource,b.limit,B)}T7(q,j);let K=[...j],z=new Set;while(K.length>0){let b=K.pop();if(typeof b==="string"&&b.length>g)throw new u("string_length",g,b.length);if(typeof b!=="object"||b===null||z.has(b))continue;if(z.add(b),Array.isArray(b)){for(let P of b)K.push(P);continue}for(let P of Object.values(b))K.push(P)}}function I4(q){if(typeof q==="number")return q;if(!Q(q))return 0;let j=0;for(let K of["min","max"]){let z=Reflect.get(q,K);if(typeof z==="number")j=Math.max(j,z)}return j}function T7(q,j){switch(q){case"helpers.fake":Y7(j[0]);return;case"helpers.mustache":A7(j[0],j[1]);return;case"helpers.fromRegExp":if(typeof j[0]==="string"){let{max:K}=M4(j[0]);if(K>g)throw new u("string_length",g,K)}return;default:return}}function Y7(q){let j=Array.isArray(q)?q:[q];for(let K of j){if(typeof K!=="string")continue;for(let z of K.matchAll(/\{\{(.+?)\}\}/g)){let b=z[1],P=b.indexOf("("),B=b.lastIndexOf(")");if(P===-1||B<P)continue;J4(b.slice(0,P).trim(),y7(b.slice(P+1,B)))}}}function y7(q){try{let j=JSON.parse(`[${q}]`);if(Array.isArray(j))return j}catch{}return[q]}function A7(q,j){if(typeof q!=="string"||!Q(j))return;let K=q.length;for(let[z,b]of Object.entries(j)){let P=`{{${z}}}`,B=q.split(P).length-1;if(B===0)continue;let F=typeof b==="string"?b.length:String(b).length;K=N(K+B*(F-P.length))}if(K>g)throw new u("string_length",g,K)}var b0={min:0,max:0},X={min:1,max:1};function M4(q){let j=[C4(!1)],K=0;while(K<q.length){let z=q[K],b=j[j.length-1];if(z==="|"){b.alternatives.push({min:b.min,max:b.max}),b.min=0,b.max=0,K+=1;continue}if(z==="("){let G=N7(q,K);j.push(C4(G.zeroWidth)),K+=G.length;continue}let P;if(z===")"){let G=j.length>1?j.pop():void 0;P=G?i0(G):X,K+=1}else if(z==="[")K=Q7(q,K),P=X;else if(z==="\\"){let G=S7(q,K);K=G.next,P=G.width}else if(z==="^"||z==="$")K+=1,P=b0;else K+=1,P=X;let B=_7(q,K);if(B)K=B.next,P={min:O4(P.min,B.min),max:O4(P.max,B.max)};let F=j[j.length-1];F.min=N(F.min+P.min),F.max=N(F.max+P.max)}while(j.length>1){let z=j.pop();if(!z)break;let b=i0(z),P=j[j.length-1];P.min=N(P.min+b.min),P.max=N(P.max+b.max)}return i0(j[0])}function C4(q){return{min:0,max:0,alternatives:[],zeroWidth:q}}function i0(q){if(q.zeroWidth)return b0;let{min:j,max:K}=q;for(let z of q.alternatives)j=Math.min(j,z.min),K=Math.max(K,z.max);return{min:j,max:K}}function N7(q,j){for(let K of["(?<=","(?<!","(?=","(?!"])if(q.startsWith(K,j))return{length:K.length,zeroWidth:!0};if(q.startsWith("(?<",j)){let K=q.indexOf(">",j);return{length:K===-1?3:K-j+1,zeroWidth:!1}}if(q.startsWith("(?:",j))return{length:3,zeroWidth:!1};return{length:1,zeroWidth:!1}}function Q7(q,j){let K=j+1;while(K<q.length)if(q[K]==="\\")K+=2;else if(q[K]==="]")return K+1;else K+=1;return q.length}function S7(q,j){let K=q[j+1],z=(b,P)=>{let B=q.indexOf(b,j+2);return B===-1?P:B+1};switch(K){case void 0:return{next:j+1,width:X};case"b":case"B":return{next:j+2,width:b0};case"k":return q[j+2]==="<"?{next:z(">",j+2),width:b0}:{next:j+2,width:X};case"u":return q[j+2]==="{"?{next:z("}",j+2),width:X}:{next:j+6,width:X};case"x":return{next:j+4,width:X};case"c":return{next:j+3,width:X};case"p":case"P":return q[j+2]==="{"?{next:z("}",j+2),width:X}:{next:j+2,width:X};default:if(K>="1"&&K<="9"){let b=j+2;while(b<q.length&&/\d/.test(q[b]))b+=1;return{next:b,width:b0}}return{next:j+2,width:X}}}function _7(q,j){let K=q[j],z;if(K==="*")z={min:0,max:0,next:j+1};else if(K==="+")z={min:1,max:1,next:j+1};else if(K==="?")z={min:0,max:1,next:j+1};else if(K==="{"){let b=/\{(\d+)(,(\d*))?\}/y;b.lastIndex=j;let P=b.exec(q);if(P){let B=Number(P[1]),F=P[2]===void 0||P[3]===""?B:Number(P[3]);z={min:B,max:Math.max(B,F),next:j+P[0].length}}}if(z&&q[z.next]==="?")z.next+=1;return z}function O4(q,j){return q===0||j===0?0:N(q*j)}function H7(q,j){let K=q.context;if(!Q(K))return q;let{resource:z,limit:b,actual:P}=K;if(typeof z!=="string"||typeof b!=="number")return q;return new u(z,b,typeof P==="number"?P:void 0,j)}function T4(q){return $(q,"array")||q.items!==void 0||q.minItems!==void 0||q.maxItems!==void 0}function g7(q){let{minItems:j,maxItems:K}=q;if(j!==void 0&&K!==void 0)return Math.max(j,K);if(K!==void 0)return K;if(j!==void 0)return j;return r}function v7(q){if(q===void 0||Number.isNaN(q))return;return Math.floor(Math.max(0,q))}function f7(q,j,K,z){let b=r0(Math.max(q.minItems??0,q.maxItems??0),z.maxItems);if(b>E)K.arraySize??={resource:"array_max_items",limit:E,actual:b,path:j}}function E7(q,j,K,z){if(!Y4(q))return;let b=new Set(Object.keys(q.properties??{})),P=new Set((q.required??[]).filter((F)=>!b.has(F))).size,B=Math.max(r0(q.minProperties??0,z.maxProperties),b.size+P);if(B>o)K.objectSize??={resource:"object_properties",limit:o,actual:B,path:j}}function x7(q,j,K,z){if(X7(q)){for(let b of[q.minLength,q.maxLength])if(b!==void 0)o0(r0(b,z.maxLength),j,K);if(typeof q.pattern==="string"&&s(q.pattern)!==void 0)o0(M4(q.pattern).min,j,K)}for(let b of[q.const,q.default,q.enum,Reflect.get(q,"template")])o0(u7(b),j,K)}function X7(q){if(q.type!==void 0)return $(q,"string");if(q.const!==void 0)return typeof q.const==="string";if(q.enum!==void 0)return q.enum.some((j)=>typeof j==="string");if(q.default!==void 0)return typeof q.default==="string";return!0}function o0(q,j,K){if(q>g&&(!K.stringLength||q>K.stringLength.actual))K.stringLength={resource:"string_length",limit:g,actual:q,path:j}}function u7(q){let j=[q],K=new Set,z=0;while(j.length>0){let b=j.pop();if(typeof b==="string"){z=Math.max(z,b.length);continue}if(typeof b!=="object"||b===null||K.has(b))continue;K.add(b),j.push(...Object.values(b))}return z}function Y4(q){if(q.type!==void 0)return $(q,"object");return q.properties!==void 0||q.required!==void 0||q.additionalProperties!==void 0||q.patternProperties!==void 0||q.minProperties!==void 0||q.maxProperties!==void 0}function N(q){return Math.min(q,Number.MAX_SAFE_INTEGER)}function M0(q){let j=q.split(".");if(j.length<2)throw new S("$.faker",`Invalid faker method format: "${q}"`,"Use format like 'person.firstName' or 'internet.email'");if(!l0)l0=g0();let z=l0;for(let b of j){let P=Object.hasOwn(Object.prototype,b)||b.startsWith("_");if(z&&typeof z==="object"&&!P&&b in z)z=Reflect.get(z,b);else throw new S("$.faker",`Invalid faker method: "${q}"`,"Check faker.js documentation for valid methods")}if(typeof z!=="function")throw new S("$.faker",`Invalid faker method: "${q}" is not a function`,"Check faker.js documentation for valid methods")}function y4(q){return q.type==="string"&&q.faker===void 0&&q.format===void 0&&q.minLength===void 0&&q.maxLength===void 0&&!R0(q)}function A4(q){return y(q)&&q.type==="null"&&Object.keys(q).length===1}function p7(q,j){for(let K of["anyOf","oneOf"]){let z=q[K];if(!Array.isArray(z)||z.length!==2)continue;let[b,P]=z,B=A4(b)?P:A4(P)?b:void 0;if(!y(B))continue;let{[K]:F,...G}=q;if(j&&Object.keys(G).some((W)=>Object.hasOwn(B,W)))return;return{...B,...G,schmockNullable:!0}}return}function l7(q){if(q.schmockNullable===!1)return q;let j=q.schmockNullable===!0,K=p7(q,!j);if(K)return K;if(!j&&!d7(q))return q;if(q.schmockNullable=!0,Array.isArray(q.type)){let z=q.type.filter((b)=>b!=="null");if(z.length===1)q.type=z[0];else if(z.length>0)q.type=z}if(Array.isArray(q.enum)){let z=q.enum.filter((b)=>b!==null);if(z.length>0)q.enum=z}return q}function d7(q){if(!Array.isArray(q.type)||!q.type.includes("null"))return!1;if(!q.type.some((j)=>j!=="null"))return!1;if(q.const===null)return!1;if(Array.isArray(q.enum)&&q.enum.every((j)=>j===null))return!1;return!0}var n=Symbol("root-schema"),Z7=new Set(["string","number","integer","boolean"]);function h7(q){let j=Array.isArray(q.type)?q.type.filter((K)=>K!=="null"):[q.type];return j.length===1&&Z7.has(String(j[0]))}function m7(q){let j=[];if(/ies$/i.test(q))j.push(`${q.slice(0,-3)}y`);if(/[^s]s$/i.test(q))j.push(q.slice(0,-1));if(/(ses|xes|zes|ches|shes)$/i.test(q))j.push(q.slice(0,-2));return j}function i7(q,j){if(q===n||!h7(j))return n;for(let K of m7(q))if(p0(K,j))return K;return n}function N4(q){if(!q||typeof q!=="object")return q;return Q4(q,{cache:new Map},n)}function Q4(q,j,K){let z=j.cache.get(q);if(!z)z=new Map,j.cache.set(q,z);let b=z.get(K);if(b)return b;let P=l7({...q});if(z.set(K,P),K!==n&&P.faker){if(typeof P.faker==="string")M0(P.faker)}else o7(P,j,K),n7(P,K);return r7(P),P}function o7(q,j,K){let z=U0(q,(b,P)=>y(b)?Q4(b,j,$7({context:K,child:b,slot:P})):b);for(let{keyword:b,value:P}of z)Reflect.set(q,b,P)}function $7(q){let{context:j,child:K,slot:z}=q;if(z.keyword==="properties"&&z.location.form==="map")return z.location.name;if(z.keyword==="items"&&z.location.form==="single")return i7(j,K);return n}function n7(q,j){if(j===n){if(y4(q))q.faker="lorem.word";return}if(q.allOf||q.anyOf||q.oneOf||R0(q))return;let z=p0(j,q);if(z){let{fakerMethod:b,format:P,trueProbability:B,fakerArgs:F}=z.mapping;if(q.faker=F?{[b]:[F]}:b,P&&(typeof q.format!=="string"||!u0.has(q.format)))q.format=P;if(B!==void 0&&q.schmockTrueProbability===void 0)q.schmockTrueProbability=B}else if(y4(q))q.faker="lorem.word"}function r7(q){let j=q.schmockTrueProbability;if(q.type!=="boolean"||typeof j!=="number"||!Number.isFinite(j)||q.const!==void 0||q.enum!==void 0)return;q.faker={"datatype.boolean":[{probability:j}]}}function _4(q){return{schema:q,enhanced:N4(q)}}function s7(q,j){return n0(q,"$",j),_4(q)}function i3(q){let[j,K]=o6([q.schema,q.overrides]);if(!y(j))throw new s0("$","Schema must be a valid JSON Schema object");if(K!==void 0&&!Q(K))throw new s0("$.overrides","Overrides must be an object mapping paths to values");let z=j,b=K,P=q.count,B=q.seed;n0(z,"$",P);let F;return{name:"faker",version:a0,async process(G,W){if(W!==void 0&&W!==null)return{context:G,response:W};try{F??=_4(z);let V=await H4(F,{schema:z,count:P,overrides:b,params:G.params,state:G.routeState,query:G.query,seed:B});return{context:G,response:V}}catch(V){if(V instanceof s0||V instanceof S4)throw V;throw new c7(G.path,V instanceof Error?V:Error(String(V)),z)}}}}async function o3(q){return H4(s7(q.schema,q.count),q)}async function H4(q,j){let{count:K,overrides:z,params:b,state:P,query:B,seed:F}=j,{schema:G}=q,W=$6(F),V=n6(W),L=q.enhanced;if($(G,"array")&&G.items){let J=a6(G,K,V);if(J>E)throw new S4("array_size",E,J);L={...L,minItems:J,maxItems:J}}let O=await c6(L,W,F!==void 0?T0:void 0);if(O=j4(O,L,V),Array.isArray(O)){let J=O.map((A)=>E0(A,z,b,P,B));return z0(J),J}return O=E0(O,z,b,P,B),z0(O),O}export{o3 as generateFromSchema,i3 as fakerPlugin,g as MAX_STRING_LENGTH,B0 as MAX_SCHEMA_NODES,o as MAX_OBJECT_PROPERTIES,P0 as MAX_NESTING_DEPTH,i as MAX_GENERATED_NODES,E as MAX_ARRAY_SIZE};
4
+ `);break;default:z.push(b)}j++;continue}if(j+2<q.length&&q[j+1]==="-"&&q[j+2]!=="]"){let b=q.charCodeAt(j),P=q.charCodeAt(j+2);for(let B=b;B<=P;B++)z.push(String.fromCharCode(B));j+=3;continue}z.push(q[j]),j++}return j++,{node:{type:"charClass",chars:z,negated:K},pos:j}}function e(q,j,K){if(j>=q.length)return{node:K,pos:j};let z=q[j],b,P;switch(z){case"*":b=0,P=5,j++;break;case"+":b=1,P=5,j++;break;case"?":b=0,P=1,j++;break;case"{":{let B=Z4(q,j);if(B)b=B.min,P=B.max,j=B.pos;else return{node:K,pos:j};break}default:return{node:K,pos:j}}if(j<q.length&&(q[j]==="?"||q[j]==="+"))j++;return{node:{type:"quantifier",node:K,min:b,max:P},pos:j}}function Z4(q,j){let K=q.slice(j).match(/^\{(\d+)(?:,(\d*))?\}/);if(!K)return null;let z=parseInt(K[1],10),b;if(K[2]===void 0)b=z;else if(K[2]==="")b=z+5;else b=parseInt(K[2],10);return{min:z,max:b,pos:j+K[0].length}}function l(q){return q<10?`0${q}`:`${q}`}function h4(q,j){return new Date(q,j,0).getDate()}var L6="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function m4(q){if(q==="^"||q==="$"||q==="^$")return!1;return!0}function i4(q,j){if(q.format){if(q.format==="date-time"&&(j.minDateTime!==void 0||j.maxDateTime!==void 0))return o4(j);let B=j.formatRegistry.get(q.format);if(B){let F=B(j.random),G=j.minLength??q.minLength,W=j.maxLength??q.maxLength;if(G!==void 0&&F.length<G)return Y0(F,G,j);if(W!==void 0&&F.length>W)return F.slice(0,W);return F}}if(q.pattern){let B=j.minLength??q.minLength,F=j.maxLength??q.maxLength,G=50;for(let L=0;L<50;L++){let O=j6(q.pattern,j.random);if(B!==void 0&&O.length<B)continue;if(F!==void 0&&O.length>F)continue;return O}let W=j6(q.pattern,j.random),V=m4(q.pattern);if(B!==void 0&&W.length<B){if(V)return Y0(W,B,j)}if(F!==void 0&&W.length>F)return W.slice(0,F);return W}let K=q.minLength??0,z=q.maxLength??Math.max(K+10,10),b=j.random.int(K,z),P="";for(let B=0;B<b;B++)P+=j.random.pick([...L6]);if(j.maxLength!==void 0&&P.length>j.maxLength)P=P.slice(0,j.maxLength);if(j.minLength!==void 0&&P.length<j.minLength)P=Y0(P,j.minLength,j);return P}function Y0(q,j,K){while(q.length<j)q+=K.random.pick([...L6]);return q}function o4(q){let j=q.minDateTime?new Date(q.minDateTime):new Date("1970-01-01"),K=q.maxDateTime?new Date(q.maxDateTime):new Date,z=j.getTime(),b=K.getTime(),P=z+q.random.next()*(b-z),B=new Date(P),F=B.getFullYear(),G=l(B.getMonth()+1),W=l(B.getDate());return`${F}-${G}-${W}T01:01:01.0Z`}function z6(q,j){if(q.const!==void 0)return structuredClone(q.const);if(q.enum!==void 0&&q.enum.length>0){let K=q.enum;if(q.minimum!==void 0||q.maximum!==void 0||q.exclusiveMinimum!==void 0||q.exclusiveMaximum!==void 0||q.multipleOf!==void 0){let b=q.exclusiveMinimum??q.minimum??-1/0,P=q.exclusiveMaximum??q.maximum??1/0,B=q.exclusiveMinimum!==void 0,F=q.exclusiveMaximum!==void 0;K=K.filter((G)=>{if(typeof G!=="number")return!0;let W=B?G>b:G>=b,V=F?G<P:G<=P;if(!W||!V)return!1;if(q.multipleOf!==void 0){let L=q.multipleOf,O=L.toString().includes(".")?L.toString().split(".")[1].length:0,J=Math.pow(10,O),A=Math.round(G*J),w=Math.round(L*J);if(A%w!==0)return!1}return!0})}if(q.minLength!==void 0||q.maxLength!==void 0){let b=q.minLength??0,P=q.maxLength??1/0;K=K.filter((B)=>{if(typeof B!=="string")return!0;return B.length>=b&&B.length<=P})}if(q.minItems!==void 0||q.maxItems!==void 0){let b=q.minItems??0,P=q.maxItems??1/0;K=K.filter((B)=>{if(!Array.isArray(B))return!0;return B.length>=b&&B.length<=P})}if(q.minProperties!==void 0||q.maxProperties!==void 0){let b=q.minProperties??0,P=q.maxProperties??1/0;K=K.filter((B)=>{if(typeof B!=="object"||B===null||Array.isArray(B))return!0;return Object.keys(B).length>=b&&Object.keys(B).length<=P})}if(K.length===0){let b=[];if(q.minLength!==void 0)b.push(`minLength: ${q.minLength}`);if(q.maxLength!==void 0)b.push(`maxLength: ${q.maxLength}`);if(q.minItems!==void 0)b.push(`minItems: ${q.minItems}`);if(q.maxItems!==void 0)b.push(`maxItems: ${q.maxItems}`);if(q.minProperties!==void 0)b.push(`minProperties: ${q.minProperties}`);if(q.maxProperties!==void 0)b.push(`maxProperties: ${q.maxProperties}`);if(q.minimum!==void 0)b.push(`minimum: ${q.minimum}`);if(q.maximum!==void 0)b.push(`maximum: ${q.maximum}`);if(q.exclusiveMinimum!==void 0)b.push(`exclusiveMinimum: ${q.exclusiveMinimum}`);if(q.exclusiveMaximum!==void 0)b.push(`exclusiveMaximum: ${q.exclusiveMaximum}`);if(q.multipleOf!==void 0)b.push(`multipleOf: ${q.multipleOf}`);throw Error(`enum values conflict with constraints [${b.join(", ")}] at ${j.path}`)}let z=j.random.pick(K);return typeof z==="object"&&z!==null?structuredClone(z):z}throw Error(`generateEnumConst called without enum or const at ${j.path}`)}function w0(q){return typeof q==="object"&&q!==null&&"then"in q&&typeof q.then==="function"}var R6=Symbol("walkCall");function T(q,j){return{[R6]:!0,schema:q,ctx:j}}function k6(q){return typeof q==="object"&&q!==null&&R6 in q}function G0(q,j){q.push({gen:j,sent:void 0,hasThrown:!1,threw:void 0})}function J6(q){let j=q[q.length-1],K;try{K=j.hasThrown?j.gen.throw(j.threw):j.gen.next(j.sent)}catch(z){if(q.pop(),q.length===0)throw z;let b=q[q.length-1];b.hasThrown=!0,b.threw=z;return}return j.hasThrown=!1,K}async function $4(q,j){let K=[];G0(K,q);for(;;){let z=J6(K);if(z===void 0)continue;if(z.done){if(K.pop(),K.length===0)return z.value;K[K.length-1].sent=z.value;continue}if(k6(z.value)){G0(K,j(z.value.schema,z.value.ctx));continue}let b=K[K.length-1];try{b.sent=await z.value}catch(P){b.hasThrown=!0,b.threw=P}}}function n4(q,j){let K=[];G0(K,q);for(;;){let z=J6(K);if(z===void 0)continue;if(z.done){if(K.pop(),K.length===0)return z.value;K[K.length-1].sent=z.value;continue}if(k6(z.value)){G0(K,j(z.value.schema,z.value.ctx));continue}if(w0(z.value))throw Error("generateSync() encountered an unexpected asynchronous operation.");K[K.length-1].sent=z.value}}function p(q){let j={};for(let K of q){if(typeof K==="boolean"){if(!K)return{not:{}};continue}T6(j,K)}return j}function M6(q,j){if(typeof q==="boolean"||typeof j==="boolean")return{};if(typeof q!=="object"||q===null)return typeof j==="object"&&j!==null?j:{};if(typeof j!=="object"||j===null)return q;let K={...q};return T6(K,j),K}function T6(q,j){if(j.type!==void 0)if(q.type===void 0)q.type=j.type;else q.type=r4(q.type,j.type);if(j.minimum!==void 0)q.minimum=q.minimum!==void 0?Math.max(q.minimum,j.minimum):j.minimum;if(j.maximum!==void 0)q.maximum=q.maximum!==void 0?Math.min(q.maximum,j.maximum):j.maximum;if(j.exclusiveMinimum!==void 0)q.exclusiveMinimum=q.exclusiveMinimum!==void 0?Math.max(q.exclusiveMinimum,j.exclusiveMinimum):j.exclusiveMinimum;if(j.exclusiveMaximum!==void 0)q.exclusiveMaximum=q.exclusiveMaximum!==void 0?Math.min(q.exclusiveMaximum,j.exclusiveMaximum):j.exclusiveMaximum;if(j.multipleOf!==void 0)q.multipleOf=j.multipleOf;if(j.minLength!==void 0)q.minLength=q.minLength!==void 0?Math.max(q.minLength,j.minLength):j.minLength;if(j.maxLength!==void 0)q.maxLength=q.maxLength!==void 0?Math.min(q.maxLength,j.maxLength):j.maxLength;if(j.pattern!==void 0)q.pattern=j.pattern;if(j.format!==void 0)q.format=j.format;if(j.minItems!==void 0)q.minItems=q.minItems!==void 0?Math.max(q.minItems,j.minItems):j.minItems;if(j.maxItems!==void 0)q.maxItems=q.maxItems!==void 0?Math.min(q.maxItems,j.maxItems):j.maxItems;if(j.uniqueItems)q.uniqueItems=!0;if(j.items!==void 0)q.items=j.items;if(j.prefixItems!==void 0)if(q.prefixItems===void 0)q.prefixItems=j.prefixItems;else{let K=[],z=Math.max(q.prefixItems.length,j.prefixItems.length);for(let b=0;b<z;b++){let P=q.prefixItems[b],B=j.prefixItems[b];if(P!==void 0&&B!==void 0)K.push(M6(P,B));else if(P!==void 0)K.push(P);else if(B!==void 0)K.push(B)}q.prefixItems=K}if(j.contains!==void 0)if(q.containsAll!==void 0)q.containsAll=[...q.containsAll,j.contains];else if(q.contains!==void 0)q.containsAll=[q.contains,j.contains],delete q.contains;else q.contains=j.contains;if(j.properties)q.properties=c4(q.properties??{},j.properties);if(j.required)q.required=[...new Set([...q.required??[],...j.required])];if(j.additionalProperties!==void 0)q.additionalProperties=j.additionalProperties;if(j.patternProperties)q.patternProperties={...q.patternProperties??{},...j.patternProperties};if(j.minProperties!==void 0)q.minProperties=q.minProperties!==void 0?Math.max(q.minProperties,j.minProperties):j.minProperties;if(j.maxProperties!==void 0)q.maxProperties=q.maxProperties!==void 0?Math.min(q.maxProperties,j.maxProperties):j.maxProperties;if(j.const!==void 0)q.const=j.const;if(j.enum!==void 0)if(q.enum!==void 0){let K=new Set(j.enum.map((z)=>JSON.stringify(z)));q.enum=q.enum.filter((z)=>K.has(JSON.stringify(z)))}else q.enum=j.enum;if(j.$ref)q.$ref=j.$ref;if(j.$defs)q.$defs={...q.$defs??{},...j.$defs};if(j.allOf)q.allOf=[...q.allOf??[],...j.allOf];if(j.anyOf)q.anyOf=j.anyOf;if(j.oneOf)q.oneOf=j.oneOf}function r4(q,j){let K=Array.isArray(q)?q:[q],z=Array.isArray(j)?j:[j],b=K.filter((P)=>z.includes(P));if(b.length===0)return K[0];if(b.length===1)return b[0];return b}function c4(q,j){let K={...q};for(let[z,b]of Object.entries(j)){let P=q[z];if(P===void 0)K[z]=b;else if(typeof P==="object"&&typeof b==="object")K[z]=M6(P,b);else K[z]=b}return K}var D0=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function Y6(q){if(typeof q!=="object"||q===null)return!1;return Object.keys(q).some((j)=>D0.has(j))}function N0(q){if(q.properties)return q.properties;if(q.type==="object"||q.type===void 0){let j={},K=!1;for(let[z,b]of Object.entries(q)){if(D0.has(z))continue;if(Y6(b))j[z]=b,K=!0;else j[z]={const:b},K=!0}if(K)return j}return{}}function y6(q,j){if(q.required)return q.required;if(q.properties===void 0&&Object.keys(j).length>0)return Object.keys(j);return[]}function A6(q,j){let K=q.alwaysFakeOptionals??!1,z=q.fixedProbabilities??!1,b=q.optionalsProbability??0.5,P;if(z&&!K&&j.length>0){let B=Math.round(j.length*b);P=new Set(j.slice(0,B))}return(B)=>{if(K)return!0;if(P)return P.has(B);return q.random.bool(b)}}function N6(q){return typeof q==="object"&&q!==null&&!Array.isArray(q)}function s4(q){return q.replace(/~/g,"~0").replace(/\//g,"~1")}function d(q,j){let K=s4(j),z=q.outputPath==="/"?`/${K}`:`${q.outputPath}/${K}`,b=q.path==="/"?`/${K}`:`${q.path}/${K}`;return{...q,path:b,outputPath:z}}function t4(q){let j=N0(q);if(Object.keys(j).length>0)return j;if(Array.isArray(q.allOf)){let K={};for(let z of q.allOf){if(typeof z!=="object"||z===null)continue;let b=N0(z);Object.assign(K,b)}return K}return{}}function a4(q,j){let K=y6(q,j);if(K.length>0)return K;if(Array.isArray(q.allOf)){let z=[];for(let b of q.allOf){if(typeof b!=="object"||b===null)continue;let P=b;if(Array.isArray(P.required))z.push(...P.required)}if(z.length>0)return[...new Set(z)]}return[]}function e4(q,j,K){if(!N6(q)||typeof j!=="object"||j===null)return q;return Q6(q,j,K)}function Q6(q,j,K){if(K.alwaysFakeOptionals===!0)return q;let z=t4(j);if(Object.keys(z).length===0)return q;let b=a4(j,z),P=new Set(b),B=new Set(Object.keys(z)),F=[...B].filter((J)=>!P.has(J)),G=A6(K,F),W=new Set([...B,...Object.keys(q)]),V=K.path==="/"?"/properties":`${K.path}/properties`,L={...K,depth:K.depth+1,path:V},O={};for(let J of W){if(!(J in q))continue;let A=d(L,J),w=z[J]??!0;if(!(B.has(J)&&!P.has(J))||G(J))O[J]=e4(q[J],w,A)}return O}function y0(q,j,K){if(!K.filterExampleDefaults||!N6(q))return q;return Q6(q,j,K)}function b6(q,j){if(typeof j!=="object"||j===null)return!1;let K=j;if(K.const!==void 0)return q===K.const;if(K.enum!==void 0)return K.enum.some((z)=>z===q);return!1}function S6(q){if(typeof q==="boolean")return!q;if(typeof q!=="object"||q===null)return!1;if(q.not===!0||typeof q.not==="object"&&q.not!==null&&Object.keys(q.not).length===0)return!0;return!1}function A0(q){let j=[];if(q.dependentRequired){for(let[K,z]of Object.entries(q.dependentRequired))if(Array.isArray(z))j.push([K,z.filter((b)=>typeof b==="string")])}if(q.dependencies){for(let[K,z]of Object.entries(q.dependencies))if(Array.isArray(z))j.push([K,z.filter((b)=>typeof b==="string")])}return j}function q9(q){let j=[];if(q.dependencies){for(let[K,z]of Object.entries(q.dependencies))if(!Array.isArray(z))j.push([K,z])}if(q.dependentSchemas)for(let[K,z]of Object.entries(q.dependentSchemas))j.push([K,z]);return j}function*j9(q,j,K,z,b,P,B={type:"string"}){if(K[P]!==void 0)return;let F=j[P];if(F===void 0&&q.patternProperties){let V=[];for(let[L,O]of Object.entries(q.patternProperties))try{if(new RegExp(L).test(P))V.push(O)}catch{}if(V.length>0)F=V.length===1?V[0]:p(V)}if(F===void 0){if(q.additionalProperties===!1)return;F=q.additionalProperties!==void 0&&q.additionalProperties!==!0?q.additionalProperties:B}if(S6(F))return;let G=d(b,P),W=yield T(F,G);if(W!==void 0)K[P]=W,z.add(P)}function*K9(q,j){let K=N0(q),z=y6(q,K);if(j.depth>=j.maxDepth){let w=new Set(z);for(let[D,R]of A0(q))if(w.has(D))for(let k of R)w.add(k);if(w.size===0)return{};let U={};for(let D of w){let R=K[D];if(R&&typeof R==="object"&&R!==null){let k=R;if(k.const!==void 0)U[D]=k.const;else if(k.default!==void 0)U[D]=k.default;else if(k.enum!==void 0&&k.enum.length>0)U[D]=k.enum[0];else U[D]=P9(k.type)}else U[D]=null}return U}if(q.additionalProperties===!1){let w=Object.keys(K).length>0,U=q.patternProperties&&Object.keys(q.patternProperties).length>0,D=new Set(Object.keys(K)),R=[...new Set(z)].filter((k)=>!D.has(k));if((q.minProperties??0)>0&&!w&&!U)throw Error(`missing properties for ${q.minProperties} in ${j.path}: additionalProperties is false but no properties or patternProperties defined`);if(R.length>0&&!U&&!w)throw Error(`missing properties for ${R.join(", ")} in ${j.path}: additionalProperties is false but required properties not defined in properties`)}let b=j.path==="/"?"/properties":`${j.path}/properties`,P={...j,depth:j.depth+1,path:b},B={},F=new Set,G=new Set(z);for(let[w,U]of A0(q))if(G.has(w))for(let D of U)G.add(D);let W=j.fillProperties??!0,V=Object.keys(K).filter((w)=>!G.has(w)),L=A6(j,V);if(Object.keys(K).length>0)for(let[w,U]of Object.entries(K)){if(S6(U))continue;F.add(w);let D=d(P,w),R=G.has(w),k=typeof U==="object"&&U!==null&&U.type==="object",I=U;if(q.patternProperties&&typeof U==="object"&&U!==null){let C=[];for(let[M,Y]of Object.entries(q.patternProperties))try{if(new RegExp(M).test(w))C.push(Y)}catch{}if(C.length>0)I=p([U,...C])}if(R){let C=yield T(I,D);if(C!==void 0)B[w]=C}else if(L(w)){let C=yield T(I,D);if(C!==void 0)B[w]=C}else if(k&&!W){let C=U.required??[];if(C.length>0){let M={};for(let Y of C){let f=(U.properties??{})[Y]??{},H=d(D,Y),m=yield T(f,H);if(m!==void 0)M[Y]=m}B[w]=M}}}for(let w of G){if(B[w]!==void 0||F.has(w))continue;if(q.patternProperties){let U=[];for(let[D,R]of Object.entries(q.patternProperties))if(new RegExp(D).test(w))U.push(R);if(U.length>0){let D=U.length===1?U[0]:p(U),R=d(P,w),k=yield T(D,R);if(k!==void 0)B[w]=k;F.add(w)}}if(!F.has(w)){let U=q.additionalProperties??!0;if(U!==!1){let D=d(P,w),R=yield T(U===!0?{}:U,D);if(R!==void 0)B[w]=R;F.add(w)}}}let O=!0;while(O){O=!1;for(let[w,U]of A0(q)){if(B[w]===void 0)continue;for(let D of U){let R=B[D];if(yield*j9(q,K,B,F,P,D),R===void 0&&B[D]!==void 0)O=!0;if(B[D]!==void 0)G.add(D)}}}for(let[w,U]of q9(q))if(B[w]!==void 0&&!F.has(w+"_dep")){if(F.add(w+"_dep"),typeof U==="boolean")continue;let D=U.oneOf??U.anyOf??U.allOf??[U],R=null;for(let I of D){if(typeof I!=="object"||I===null)continue;let{properties:C,not:M}=I;if(C&&C[w]){let Y=C[w],f=B[w];if(b6(f,Y)){R=I;break}}if(M?.properties){let Y=M.properties[w];if(Y){let f=B[w];if(!b6(f,Y)){R=I;break}}}}if(!R&&D.length>0&&typeof D[0]==="object")R=D[0];if(R?.not){let I=R.not;if(I.required&&Array.isArray(I.required))for(let C of I.required)delete B[C]}let k=new Set;if(R?.required)for(let I of R.required){if(I===w)continue;if(B[I]!==void 0)continue;k.add(I);let C=R.properties?.[I]??K[I]??{type:"object"},M=d(P,I),Y=yield T(C,M);if(Y!==void 0)B[I]=Y}if(R&&R.properties)for(let[I,C]of Object.entries(R.properties)){if(I===w)continue;if(k.has(I))continue;let M=d(P,I),Y=yield T(C,M);if(Y!==void 0)B[I]=Y}}let J=q.minProperties??0,A=q.maxProperties;if(Object.keys(B).length<J){if(q.patternProperties&&Object.keys(q.patternProperties).length>0){let w=Object.entries(q.patternProperties),U=0,D=1000;while(Object.keys(B).length<J&&U<D){U++;let[R,k]=j.random.pick(w),I=b9(R,j);if(I&&!B[I]){let C=d(P,I),M=yield T(k,C);if(M!==void 0)B[I]=M;F.add(I)}}}if(Object.keys(B).length<J){let w=q.additionalProperties,U=w===void 0||w===!0?{type:"string"}:w;if(U!==!1){let D=0,R=1000;while(Object.keys(B).length<J&&D<R){D++;let k=`prop${j.random.int(0,99999)}`;if(!B[k]){let I=d(P,k),C=yield T(U,I);if(C!==void 0)B[k]=C;F.add(k)}}}}if(Object.keys(B).length<J){let w=Object.keys(K).join(", ");throw Error(`properties '${w}' were not found while additionalProperties is false in ${j.path}`)}}if(A!==void 0&&Object.keys(B).length>A){let w=Object.keys(B).filter((U)=>!G.has(U));j.random.shuffle(w);while(Object.keys(B).length>A&&w.length>0){let U=w.pop();delete B[U]}}if(j.pruneProperties&&j.pruneProperties.length>0)Q0(B,j.pruneProperties);return z9(B,K),B}function z9(q,j){for(let[K,z]of Object.entries(j)){if(typeof z!=="object"||z===null)continue;let b=z;if(b.template===void 0)continue;let P=b.template;if(typeof P!=="string")continue;let B=P.replace(/#\{(\w+)\}/g,(F,G)=>{let W=q[G];return W!==void 0?String(W):""});q[K]=B}}function b9(q,j){let K=q.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(K){let G=K[1],W=K[2];if(W===".*"||W?.includes("?:")){let V=j.random.int(0,10),L="abcdefghijklmnopqrstuvwxyz",O="";for(let J=0;J<V;J++)O+=j.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return G+O}return G}let z=q.match(/(.*\*)?([a-zA-Z]+)\$$/);if(z){let G=z[2],W=j.random.int(1,10),V="abcdefghijklmnopqrstuvwxyz",L="";for(let O=0;O<W;O++)L+=j.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return L+G}let b=q.match(/^\^([a-zA-Z]+)\$$/);if(b)return b[1];let P=j.random.int(3,10),B="abcdefghijklmnopqrstuvwxyz",F="";for(let G=0;G<P;G++)F+=j.random.pick(B.split(""));try{if(new RegExp(q).test(F))return F}catch{}return null}function Q0(q,j){if(typeof q!=="object"||q===null)return;if(Array.isArray(q)){for(let z of q)Q0(z,j);return}let K=q;for(let z of Object.keys(K))if(j.includes(z))delete K[z];else Q0(K[z],j)}function P9(q){switch(Array.isArray(q)?q[0]:q){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}function*B9(q,j){if(j.depth>=j.maxDepth){let D=q.minItems??0;return D>0?Array.from({length:D},()=>null):[]}if(j.refDepthReached){let D=q.minItems??0;return D>0?Array.from({length:D},()=>null):[]}if(q.items===!1&&(q.minItems??0)>0){let D=q.prefixItems?.length??0;if((q.minItems??0)>D)throw Error(`missing items for ${q.minItems} in ${j.path}: items is false but minItems (${q.minItems}) exceeds prefixItems count (${D})`)}let K=j.path==="/"?"/items":`${j.path}/items`,z={...j,depth:j.depth+1,path:K},b=[],P=j.refDepthMax,B=j.minItems??q.minItems??0,F=j.maxItems??q.maxItems??Math.max(B,j.maxDefaultItems);if(q.maxItems!==void 0&&F>q.maxItems)F=q.maxItems;if(q.minItems!==void 0&&B<q.minItems)B=q.minItems;if(F<B)if(q.maxItems!==void 0)B=F;else F=B;if(j.alwaysFakeOptionals)F=Math.max(B,F);let G=q.uniqueItems?new Set:null;function*W(D,R){let k=yield T(D,R);if(k===void 0)return"omitted";if(G){let I=JSON.stringify(k);if(G.has(I)){for(let C=0;C<50;C++){if(k=yield T(D,h(z,b.length)),k===void 0)continue;let M=JSON.stringify(k);if(!G.has(M))return G.add(M),b.push(k),"added"}return"failed"}G.add(I)}return b.push(k),"added"}if(q.prefixItems)for(let D=0;D<q.prefixItems.length&&b.length<F;D++){let R=h(z,D);if((yield*W(q.prefixItems[D],R))==="failed")break}let V;if(P!==void 0&&j.refDepth>=P-1){let D=q.minItems??0;return D>0?Array.from({length:D},()=>null):[]}let L=j.alwaysFakeOptionals??!1,O=j.fixedProbabilities??!1,J=j.optionalsProbability??0.5;if(L)V=F;else if(O){let D=F-Math.max(B,b.length),R=Math.round(D*J);V=Math.max(B,b.length)+R}else V=j.random.int(Math.max(B,b.length),F);let A=q.prefixItems!==void 0,w=q.additionalItems!==void 0,U;if(A){if(w)U=q.additionalItems;else if(q.items!==void 0)U=q.items}else U=q.items;if(U!==!1&&U!==void 0){let D=U??{},R=0,k=Math.max(V*20,50);while(b.length<V){let I=yield*W(D,h(z,b.length));if(I==="added"){R=0;continue}if(R++,I==="failed"||R>=k)break}}if(q.contains){let D=q.minContains??1,R=q.maxContains??Math.max(D,1),k=j.random.int(D,R);for(let I=0;I<k;I++){let C=yield T(q.contains,h(z,b.length));if(C===void 0)continue;if(G){let M=JSON.stringify(C);if(G.has(M)){let Y=!1;for(let f=0;f<50;f++){if(C=yield T(q.contains,h(z,b.length)),C===void 0)continue;let H=JSON.stringify(C);if(!G.has(H)){G.add(H),Y=!0;break}}if(!Y)continue}else G.add(M)}if(b.length<F){let M=j.random.int(0,b.length);b.splice(M,0,C)}else if(b.length>0){let M=j.random.int(0,b.length-1);b[M]=C}}while(b.length>F)b.pop()}if(q.containsAll){let D=new Set;for(let R of q.containsAll){let k=yield T(R,h(z,b.length));if(k===void 0)continue;if(G){let I=JSON.stringify(k);if(G.has(I)){let C=!1;for(let M=0;M<50;M++){if(k=yield T(R,h(z,b.length)),k===void 0)continue;let Y=JSON.stringify(k);if(!G.has(Y)){G.add(Y),C=!0;break}}if(!C)continue}else G.add(I)}if(b.length<F){let I=j.random.int(0,b.length);b.splice(I,0,k);let C=new Set;for(let M of D)C.add(M>=I?M+1:M);D.clear();for(let M of C)D.add(M);D.add(I)}else if(b.length>0){let I=Array.from({length:b.length},(C,M)=>M).filter((C)=>!D.has(C));if(I.length>0){let C=I[j.random.int(0,I.length-1)];b[C]=k,D.add(C)}else b.push(k),D.add(b.length-1)}}while(b.length>F)b.pop()}if(q.uniqueItems&&b.length>0)return yield*F9(b,q,z,B,F,G);return b}function*F9(q,j,K,z,b,P){let B=j.items??{},F=0,G=100;while(q.length<z&&F<G){F++;let W=yield T(B,h(K,q.length));if(W===void 0)continue;let V=JSON.stringify(W);if(!P.has(V))P.add(V),q.push(W)}while(q.length>b)q.pop();return q}function h(q,j){let K=q.outputPath==="/"?`/${j}`:`${q.outputPath}/${j}`;return{...q,path:`${q.path}/${j}`,outputPath:K}}function P6(q,j){if(!j||j==="")return q;if(typeof q!=="object"||q===null)throw Error(`Cannot resolve fragment "${j}" in non-object schema`);if(j.startsWith("/"))return G9(q,j);throw Error(`Unsupported fragment type: ${j}. Only JSON pointers (starting with /) are supported.`)}function G9(q,j){if(j===""||j==="/")return q;let K=j.slice(1).split("/"),z=q;for(let b of K){let P=b.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof z!=="object"||z===null)throw Error(`Cannot resolve JSON pointer "${j}": not an object at "${P}"`);if(Array.isArray(z)){let B=parseInt(P,10);if(isNaN(B)||B<0||B>=z.length)throw Error(`Cannot resolve JSON pointer "${j}": invalid array index "${P}"`);z=z[B]}else{if(!(P in z))throw Error(`Cannot resolve JSON pointer "${j}": property "${P}" not found`);z=z[P]}}return z}function*B6(q,j){let K=j.refResolver(q);if(j.__sync&&w0(K))throw Promise.resolve(K).catch(()=>{}),Error(`Cannot use async refResolver in generateSync(): resolving '${q}' returned a Promise`);return yield K}function W9(q){let j=new Map;if(typeof q==="boolean")return j;if(q.$id&&typeof q==="object"){let K=q,z=K.$id,{$id:b,...P}=K;j.set(z,P)}if(q.$defs)for(let[K,z]of Object.entries(q.$defs))j.set(`#/$defs/${K}`,z);return j}function*W0(q,j){let K=q.$ref;if(!K)return{schema:q,ctx:j};let z=j.refDepth+1;if(j.refDepthMax!==void 0&&z>=j.refDepthMax)return{schema:{},ctx:{...j,refDepthReached:!0}};if(j.refStack.has(K)){if(j.refDepthMax!==void 0){if(j.refDepth>=j.refDepthMax)return{schema:{},ctx:{...j,refDepthReached:!0}}}else if(j.depth>=j.maxDepth)return{schema:{type:"null"},ctx:j}}let b,P;if(K.startsWith("#/")){if(b=j.refRegistry.get(K),b===void 0&&K.length>2){let L=j.refRegistry.get("#");if(L!==void 0&&typeof L==="object")try{b=P6(L,K.slice(1))}catch{}}if(b===void 0&&j.refResolver){if(b=yield*B6(K,j),b!==void 0)j.refRegistry.set(K,b)}}else if(K==="#")b=j.refRegistry.get("#")??{};else if(b=j.refRegistry.get(K),b===void 0&&j.refResolver){P=yield*B6(K,j);let L=K.indexOf("#");if(L!==-1){let O=K.slice(L+1);if(O)b=P6(P,O);else b=P}else b=P;if(P&&typeof P==="object"&&P!==null){let O=P;if(O.$defs)for(let[J,A]of Object.entries(O.$defs))j.refRegistry.set(`#/$defs/${J}`,A)}}else if(b===void 0&&j.__sync)throw Error(`Remote $ref '${K}' cannot be resolved in generateSync(); pre-resolve refs or use generate()`);if(b===void 0)throw Error(`Unresolved $ref: ${K}`);let B=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:F,...G}=q,W=Object.fromEntries(Object.entries(G).filter(([L])=>!B.has(L)));if(Object.keys(W).length>0&&typeof b==="object"&&b!==null)b={...b,...W};let V={...j,refStack:new Set([...j.refStack,K]),refDepth:j.refDepth+1};return{schema:b,ctx:V}}function V9(q,j){if(typeof q==="boolean")return;j.set("#",q),S0(q,"#",j)}function S0(q,j,K){if(q.$id){let{$id:z,...b}=q;K.set(z,b)}if(q.$defs)for(let[z,b]of Object.entries(q.$defs)){let P=`${j}/$defs/${z}`;if(K.set(P,b),typeof b==="object"&&b!==null)S0(b,P,K)}if(q.properties){for(let[z,b]of Object.entries(q.properties))if(typeof b==="object"&&b!==null)S0(b,`${j}/properties/${z}`,K)}}function*w9(q,j){if(!q.$ref)return q;return(yield*W0(q,j)).schema}function*D9(q,j){let K=[];for(let z of q)if(typeof z==="object"&&z!==null&&"$ref"in z){let b=yield*w9(z,j);K.push(b)}else if(typeof z==="object"&&z!==null)K.push(z);return K}function*U9(q,j){let{allOf:K,anyOf:z,oneOf:b,not:P,if:B,then:F,else:G,...W}=q;if(K){let V=yield*D9(K,j),L=p([W,...V]);return yield T(L,j)}if(b){let V=j.random.shuffle([...b]),L=W.required??[];for(let k of V){let I=typeof k==="object"&&k!==null?k:{};if(I.$ref)I=(yield*W0(I,j)).schema;let C=I.required??[],M=[...new Set([...L,...C])],Y={...W,required:M},f=p([Y,I]),H={...j,optionalsProbability:0,alwaysFakeOptionals:!1};try{return yield T(f,H)}catch{}}let O=b[0],J=typeof O==="object"&&O!==null?O:{};if(J.$ref)J=(yield*W0(J,j)).schema;let A=J.required??[],w=[...new Set([...L,...A])],U={...W,required:w},D=p([U,J]),R={...j,optionalsProbability:0,alwaysFakeOptionals:!1};return yield T(D,R)}if(z){let V=j.random.shuffle([...z]);for(let J of V){let A=p([W,J]);try{return yield T(A,j)}catch{}}let L=z[0],O=p([W,L]);return yield T(O,j)}if(B!==void 0)return yield*I9(W,B,F,G,j);if(P)return yield*C9(W,P,j);return yield T(W,j)}function*I9(q,j,K,z,b){if(K!==void 0){let P=p([q,j,K]);try{return yield T(P,b)}catch{}}if(z!==void 0){let P=p([q,z]);try{return yield T(P,b)}catch{}}return yield T(q,b)}function*C9(q,j,K){if(typeof j==="boolean"){if(j===!0)throw Error(`Cannot generate value for 'not: true' at ${K.path}`);return yield T(q,K)}if(j.type&&!j.enum&&!j.const){let z=Array.isArray(j.type)?j.type:[j.type],b=["string","number","integer","boolean","null","object","array"].filter((P)=>!z.includes(P));if(b.length>0){let P=K.random.pick(b),B=p([q,{type:P}]);return yield T(B,K)}}if(j.const!==void 0||j.enum!==void 0){let z=j.enum??[j.const],b=new Set(z.map((P)=>JSON.stringify(P)));for(let P=0;P<20;P++){let B=yield T(q,K);if(!b.has(JSON.stringify(B)))return B}}return yield T(q,K)}class _6{extensions=new Map;define(q,j){this.extensions.set(q,{callback:j,context:{}})}has(q){return this.extensions.has(q)}reset(q){if(q){let j=this.extensions.get(q);if(j)j.context={},this.extensions.delete(q)}else this.extensions.clear()}keys(){return this.extensions.keys()}*generateGen(q,j){let K=Object.keys(q);for(let z=K.length-1;z>=0;z--){let b=K[z],P=b.startsWith("x-")?b.slice(2):b,B=this.extensions.get(P);if(B){let F=q[b],G=B.callback.call(B.context,F,q,j);if(j.__sync&&w0(G))throw Promise.resolve(G).catch(()=>{}),Error(`Cannot use async extension '${P}' in generateSync()`);let W=yield G;if(W!==void 0)return W}}return}getContext(q){return this.extensions.get(q)?.context}}var O9=new _6;function*L9(q,j){return yield*O9.generateGen(q,j)}var R9=["string","number","integer","boolean","null","object","array"];function F6(q,j,K){if(q.faker!==void 0&&q.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${j.path}`);if(q.faker!==void 0)try{let z=k9(q.faker,j),b=W6(z,K??q.type,j.path);if(typeof b==="string"&&q.format)return G6(b,q.format,j);return b}catch{}if(q.chance!==void 0)try{let z=J9(q.chance,j),b=W6(z,K??q.type,j.path);if(typeof b==="string"&&q.format)return G6(b,q.format,j);return b}catch{}return}function G6(q,j,K){if(j==="date"){let z=typeof q==="string"?new Date(q):q;if(z instanceof Date&&!isNaN(z.getTime())){let b=z.getFullYear(),P=l(z.getMonth()+1),B=l(z.getDate());return`${b}-${P}-${B}`}if(typeof q==="string"){let b=Date.parse(q);if(!isNaN(b)){let P=new Date(b),B=P.getFullYear(),F=l(P.getMonth()+1),G=l(P.getDate());return`${B}-${F}-${G}`}}}if(j==="date-time"){let z=typeof q==="string"?new Date(q):q;if(z instanceof Date&&!isNaN(z.getTime()))return z.toISOString();if(typeof q==="string"&&Date.parse(q))return new Date(q).toISOString()}return q}function W6(q,j,K){if(j===void 0)return q;let z=Array.isArray(j)?j[0]:j;switch(z){case"string":return q===null?"null":q===void 0?"undefined":String(q);case"number":case"integer":let b=Number(q);return z==="integer"?Math.floor(b):b;case"boolean":return Boolean(q);case"null":return null;default:return q}}function k9(q,j){if(!j.extensions?.faker){let B=typeof q==="string"?q:JSON.stringify(q);throw Error(`cannot resolve faker-generator for ${B} in ${j.path}`)}let K,z;if(typeof q==="object"&&q!==null){let B=q,F=Object.keys(B);if(F.length>0)K=F[0],z=B[K];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(q)} in ${j.path}`)}else K=q;let b=K.split("."),P=j.extensions.faker;for(let B of b)try{P=P[B]}catch{throw Error(`failed to resolve .${B} (${K})`)}if(typeof P==="function")return z?P(...z):P();else throw Error(`cannot resolve faker-generator for ${K} in ${j.path}`)}function J9(q,j){if(!j.extensions?.chance){let K=typeof q==="string"?q:Object.keys(q)[0];throw Error(`cannot resolve chance-generator for ${K} in ${j.path}`)}if(typeof q==="string"){let K=j.extensions.chance[q];if(typeof K==="function")return K.call(j.extensions.chance);throw Error(`cannot resolve chance-generator for ${q} in ${j.path}`)}if(typeof q==="object"&&q!==null){let K=q,z=Object.keys(K)[0],b=K[z],P=j.extensions.chance[z];if(typeof P==="function")return b?P.call(j.extensions.chance,b):P.call(j.extensions.chance)}throw Error(`cannot resolve chance-generator in ${j.path}`)}function M9(q,j){let K=q.path==="/"?`/${j}`:`${q.path}/${j}`;return{...q,depth:q.depth+1,path:K,refDepthReached:q.refDepthReached}}function*_(q,j,K){if(!K.outputTransform)return q;let z=K.outputTransform(q,j,K.outputPath);if(K.__sync&&w0(z))throw Promise.resolve(z).catch(()=>{}),Error("Cannot use async outputTransform in generateSync()");return yield z}function*j0(q,j){if(q===!0)return yield*j0({},j);if(q===!1)throw Error(`Cannot generate value for 'false' schema at ${j.path}`);let K=null;if(typeof q==="object"&&q!==null&&q.$defs){K=[];for(let[z,b]of Object.entries(q.$defs)){let P=`#/$defs/${z}`;K.push([P,j.refRegistry.has(P)?j.refRegistry.get(P):void 0]),j.refRegistry.set(P,b)}}try{return yield*T9(q,j)}finally{if(K)for(let[z,b]of K)if(b===void 0)j.refRegistry.delete(z);else j.refRegistry.set(z,b)}}function*T9(q,j){if(j.propAliases){let B=null;for(let[F,G]of Object.entries(j.propAliases))if(F in q&&!(G in q)){if(!B)B={...q};B[G]=B[F],delete B[F]}if(B)q=B}let K;if(Array.isArray(q.type)){let B=q.type;K=j.random.pick(B);let F={...j,resolvedType:K},G=F6(q,F,K);if(G!==void 0){if(typeof G==="string"&&F.maxLength!==void 0&&G.length>F.maxLength)return yield*_(G.slice(0,F.maxLength),q,F);return yield*_(G,q,F)}}else{let B=F6(q,j,K);if(B!==void 0){if(typeof B==="string"&&j.maxLength!==void 0&&B.length>j.maxLength)return yield*_(B.slice(0,j.maxLength),q,j);return yield*_(B,q,j)}}let z={...j,proceed:(B,F)=>(j.__sync?g6:H6)(B,{...j,...F})},b=yield*L9(q,z);if(b!==void 0)return yield*_(b,q,z);if(q.$ref){let B=yield*W0(q,j);return yield T(B.schema,M9(B.ctx,"$ref"))}if(q.allOf||q.anyOf||q.oneOf||q.not||q.if)return yield*U9(q,j);if(q.const!==void 0)return yield*_(z6(q,j),q,j);if(j.useDefaultValue&&q.default!==void 0)return yield*_(y0(q.default,q,j),q,j);if(q.enum!==void 0)return yield*_(z6(q,j),q,j);if(j.useExamplesValue){if(Array.isArray(q.examples)&&q.examples.length>0){let B=j.random.pick(q.examples);return yield*_(y0(B,q,j),q,j)}if(q.example!==void 0)return yield*_(y0(q.example,q,j),q,j)}let P=Y9(q,j);if(P===null){if(j.failOnInvalidTypes===!1){if(j.defaultInvalidTypeProduct!==void 0){let B=j.defaultInvalidTypeProduct;if(typeof B==="string")return A9(B);return B}return null}throw Error(`unknown primitive ${q.type} in ${j.path}/type`)}switch(P){case"null":return yield*_(f4(j),q,j);case"boolean":return yield*_(E4(j),q,j);case"number":return yield*_(C6(q,j),q,j);case"integer":return yield*_(X4(q,j),q,j);case"string":return yield*_(i4(q,j),q,j);case"object":return yield*_(yield*K9(q,j),q,j);case"array":return yield*_(yield*B9(q,j),q,j);default:throw Error(`Unknown type: ${P} at ${j.path}`)}}function Y9(q,j){if(j.resolvedType!==void 0)return j.resolvedType;if(typeof q.type==="string"){if(!["string","number","integer","boolean","null","object","array"].includes(q.type))return null;return q.type}if(Array.isArray(q.type))return j.random.pick(q.type);if(q.properties||q.required||q.additionalProperties!==void 0||q.patternProperties||q.minProperties!==void 0||q.maxProperties!==void 0)return"object";if(y9(q))return"object";if(q.items||q.prefixItems||q.contains||q.minItems!==void 0||q.maxItems!==void 0||q.uniqueItems)return"array";if(q.minimum!==void 0||q.maximum!==void 0||q.exclusiveMinimum!==void 0||q.exclusiveMaximum!==void 0||q.multipleOf!==void 0)return"number";if(q.minLength!==void 0||q.maxLength!==void 0||q.pattern||q.format||q.faker!==void 0||q.chance!==void 0)return"string";return j.random.pick(R9)}function y9(q){if(q.properties||q.type==="object"||q.type==="array")return!1;for(let j of Object.keys(q)){if(D0.has(j))continue;let K=q[j];if(typeof K==="object"&&K!==null&&!Array.isArray(K))return!0}return!1}function A9(q){switch(q){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function H6(q,j){return $4(j0(q,j),j0)}function g6(q,j){return n4(j0(q,j),j0)}function N9(q){let j=v6(q),K=f6(q);return`${j}T${K}`}function v6(q){let j=q.int(2000,2030),K=q.int(1,12),z=h4(j,K),b=q.int(1,z);return`${j}-${l(K)}-${l(b)}`}function f6(q){let j=q.int(0,23),K=q.int(0,59),z=q.int(0,59);return`${l(j)}:${l(K)}:${l(z)}Z`}var Q9=["alice","bob","charlie","dave","eve","frank","grace","heidi"],S9=["example.com","test.org","demo.net","sample.io"];function V6(q){let j=q.pick(Q9),K=q.int(1,999),z=q.pick(S9);return`${j}${K}@${z}`}var _9=["https"],H9=["example.com","test.org","demo.net"],g9=["api","v1","users","items","data","resource"];function F0(q){let j=q.pick(_9),K=q.pick(H9),z=q.int(1,3),b=[];for(let P=0;P<z;P++)b.push(q.pick(g9));return`${j}://${K}/${b.join("/")}`}var v9=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],f9=["com","org","net","io","dev"];function w6(q){let j=q.int(1,3),K=[];for(let z=0;z<j;z++)K.push(q.pick(v9));return K.push(q.pick(f9)),K.join(".")}function E9(q){return`${q.int(1,254)}.${q.int(0,255)}.${q.int(0,255)}.${q.int(1,254)}`}function x9(q){let j=[];for(let K=0;K<8;K++)j.push(q.int(0,65535).toString(16));return j.join(":")}function X9(q){let j=(K)=>{let z="";for(let b=0;b<K;b++)z+=q.int(0,15).toString(16);return z};return`${j(8)}-${j(4)}-4${j(3)}-${["8","9","a","b"][q.int(0,3)]}${j(3)}-${j(12)}`}var u9=["foo","bar","baz","items","0","1","2","name","value"];function D6(q){let j=q.int(1,4),K=[];for(let z=0;z<j;z++)K.push(q.pick(u9));return"/"+K.join("/")}function p9(q){let j=["P"],K=q.bool(),z=q.bool();if(K){if(q.bool())j.push(`${q.int(0,100)}Y`);if(q.bool())j.push(`${q.int(0,12)}M`);if(q.bool())j.push(`${q.int(0,30)}D`)}if(z){if(j.push("T"),q.bool())j.push(`${q.int(0,23)}H`);if(q.bool())j.push(`${q.int(0,59)}M`);if(q.bool())j.push(`${q.int(0,59)}S`)}if(j.length===1||j.length===2&&j[1]==="T")j.push("0D");return j.join("")}var l9=new Map([["date-time",N9],["date",v6],["time",f6],["duration",p9],["email",V6],["idn-email",V6],["uri",F0],["uri-reference",F0],["iri",F0],["iri-reference",F0],["hostname",w6],["idn-hostname",w6],["ipv4",E9],["ipv6",x9],["uuid",X9],["json-pointer",D6],["relative-json-pointer",(q)=>`${q.int(0,5)}${D6(q)}`]]);function E6(q){let j=new Map(l9);if(q)for(let[K,z]of Object.entries(q))j.set(K,z);return j}function d9(q,j){if(!q.startsWith("$"))throw Error(`Invalid JSONPath: ${q} (must start with $)`);let K=Z9(q),z=[j];for(let b of K){let P=[];if(b===""){for(let B of z)_0(B,P);P.push(...z),z=P;continue}for(let B of z){if(B===null||B===void 0)continue;if(b.startsWith("q:")){let F=b.slice(2);if(typeof B==="object"&&B!==null&&F in B)P.push(B[F])}else if(b==="*"){if(Array.isArray(B))P.push(...B)}else if(/^\d+$/.test(b)){let F=parseInt(b,10);if(Array.isArray(B)&&F<B.length)P.push(B[F])}else if(typeof B==="object"&&B!==null&&b in B)P.push(B[b])}z=P}return z}function _0(q,j){if(q===null||q===void 0)return;if(Array.isArray(q))for(let K of q)j.push(K),_0(K,j);else if(typeof q==="object")for(let K of Object.values(q))j.push(K),_0(K,j)}function Z9(q){if(!q.startsWith("$"))throw Error(`Invalid JSONPath: ${q}`);let j=[],K=q.slice(1);while(K.length>0)if(K.startsWith(".")){if(K=K.slice(1),K.startsWith("."))K=K.slice(1),j.push("");let z=K.match(/^([a-zA-Z_][a-zA-Z0-9_]*)/);if(z)j.push(z[1]),K=K.slice(z[1].length);else break}else if(K.startsWith("[")){let z=K.indexOf("]");if(z===-1)break;let b=K.slice(1,z),P=h9(b),B=b[0]==='"'||b[0]==="'";j.push(B?`q:${P}`:P),K=K.slice(z+1)}else break;return j}function h9(q){let j=q[0];if((j==='"'||j==="'")&&q[q.length-1]===j)return q.slice(1,-1).replace(/\\(["'\\])/g,"$1");return q}function m9(q){if(q.properties)return q.properties;if(q.type==="object"||q.type===void 0){let j={},K=!1;for(let[z,b]of Object.entries(q)){if(D0.has(z))continue;if(Y6(b))j[z]=b,K=!0;else j[z]={const:b},K=!0}if(K)return j}return{}}function V0(q,j,K,z){if(!K.resolveJsonPath)return q;let b=z??q;if(j===!0||j===!1)return q;if(j.$ref)return q;let P=j;if(P.allOf||P.anyOf||P.oneOf)return q;if(typeof q==="object"&&q!==null&&!Array.isArray(q)){let B={...q},F=m9(P);for(let[G,W]of Object.entries(F))if(G in B){let V=B[G];if(typeof W==="object"&&W!==null&&"jsonPath"in W&&typeof W.jsonPath==="string"){let L=d9(W.jsonPath,b);if(L.length>0)B[G]=K.random.pick(L)}else B[G]=V0(V,W,K,b)}return B}if(Array.isArray(q)&&P.items)return q.map((B)=>V0(B,P.items,K,b));return q}var i9=E6(),U6=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);function x6(q,j){if(j?.validateSchemaVersion===!0&&!j?.propAliases){if(typeof q==="object"&&q!==null&&"$schema"in q){let V=q.$schema;if(typeof V==="string"&&!U6.has(V))throw Error(`Unsupported JSON Schema version: ${V}. Supported versions: ${[...U6].join(", ")}`)}}let K=$9(j),z=I6(j?.seed??1),b=K.propAliases?o9(q,K.propAliases):q,P=W9(b);V9(b,P);let B=K.formats?E6(K.formats):new Map(i9),F=K.refDepthMin??K.refDepth,G=K.refDepthMax??K.refDepth;if(F!==void 0&&G!==void 0&&F>G)throw Error(`refDepthMin (${F}) cannot be greater than refDepthMax (${G})`);let W={random:z,maxDepth:K.maxDepth??(G?G+20:5),maxDefaultItems:K.maxDefaultItems??3,optionalsProbability:K.optionalsProbability??0.5,depth:0,refRegistry:P,refStack:new Set,formatRegistry:B,minItems:K.minItems,maxItems:K.maxItems,minLength:K.minLength,maxLength:K.maxLength,useDefaultValue:K.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:K.alwaysFakeOptionals,fixedProbabilities:K.fixedProbabilities,fillProperties:K.fillProperties,extensions:K.extensions,resolveJsonPath:K.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:F,refDepthMax:G,useExamplesValue:K.useExamplesValue,filterExampleDefaults:K.filterExampleDefaults??!1,pruneProperties:K.pruneProperties,failOnInvalidTypes:K.failOnInvalidTypes,defaultInvalidTypeProduct:K.defaultInvalidTypeProduct,minDateTime:K.minDateTime,maxDateTime:K.maxDateTime,propAliases:K.propAliases,outputTransform:K.outputTransform};return{schema_:b,normalizedOptions:K,ctx:W}}async function X6(q,j){let{schema_:K,normalizedOptions:z,ctx:b}=x6(q,j);b.refResolver=z.refResolver;let P=await H6(K,b);if(z.resolveJsonPath)return V0(P,q,b,P);return P}function u6(q,j){let{schema_:K,normalizedOptions:z,ctx:b}=x6(q,j);b.__sync=!0,b.refResolver=z.refResolver;let P=g6(K,b);if(z.resolveJsonPath)return V0(P,q,b,P);return P}function o9(q,j){if(typeof q!=="object"||q===null)return q;let K=q,z=null;for(let[b,P]of Object.entries(j))if(b in K&&!(P in K)){if(!z)z={...K};z[P]=z[b],delete z[b]}return z??q}function $9(q){if(!q)return{};let j=q,K={...q};if(j.requiredOnly===!0&&K.optionalsProbability===void 0)K={...K,optionalsProbability:0,alwaysFakeOptionals:!1};if(j.ignoreProperties&&j.ignoreProperties.length>0)K={...K,outputTransform:n9(K.outputTransform,r9(j.ignoreProperties))};return K}function n9(q,j){if(!q)return j;if(!j)return q;return(K,z,b)=>{let P=q(K,z,b);if(P&&typeof P==="object"&&"then"in P&&typeof P.then==="function")return P.then((B)=>j(B,z,b));return j(P,z,b)}}function r9(q){return(j,K,z)=>{if(z==="/")return j;let b=c9(z.slice(z.lastIndexOf("/")+1));return q.some((P)=>{if(typeof P==="string")return P===b;if(P instanceof RegExp)return P.test(b);return P(K)})?void 0:j}}function c9(q){return q.replace(/~1/g,"/").replace(/~0/g,"~")}import{ResourceLimitError as K0}from"@schmock/core";function z0(q){let j=[{value:q,exiting:!1}],K=new Set,z=0,b=0,P=(B)=>{if(b+=B,b>c)throw new K0("generated_chars",c,b)};while(j.length>0){let B=j.pop();if(!B)break;let F=B.value;if(B.exiting){if(typeof F==="object"&&F!==null)K.delete(F);continue}if(z+=1,z>i)throw new K0("generated_nodes",i,z);if(typeof F==="string"){if(F.length>g)throw new K0("string_length",g,F.length);P(F.length);continue}if(typeof F!=="object"||F===null||K.has(F))continue;if(K.add(F),j.push({value:F,exiting:!0}),Array.isArray(F)){if(F.length>E)throw new K0("array_size",E,F.length);for(let W=0;W<F.length;W+=1)j.push({value:F[W],exiting:!1});continue}let G=Object.entries(F);if(G.length>o)throw new K0("object_properties",o,G.length);for(let[W,V]of G)P(W.length),j.push({value:V,exiting:!1})}}function Q(q){return typeof q==="object"&&q!==null&&!Array.isArray(q)}function y(q){return Q(q)}function s(q){for(let j of["u",""])try{return new RegExp(q,j)}catch{}return}var Z={depthCost:1,frameCost:0},x={depthCost:0,frameCost:1},p6=[{keyword:"properties",shape:"map",generates:!0,costs:Z,typedAs:"object"},{keyword:"definitions",shape:"map",generates:!1,costs:x},{keyword:"$defs",shape:"map",generates:!1,costs:x},{keyword:"patternProperties",shape:"map",generates:!0,costs:Z},{keyword:"items",shape:"single",generates:!0,costs:Z,typedAs:"array",tupleForm:!0},{keyword:"additionalItems",shape:"single",generates:!0,costs:Z},{keyword:"prefixItems",shape:"array",generates:!0,costs:Z,typedAs:"array"},{keyword:"allOf",shape:"array",generates:!0,costs:x},{keyword:"anyOf",shape:"array",generates:!0,costs:x},{keyword:"oneOf",shape:"array",generates:!0,costs:x},{keyword:"additionalProperties",shape:"single",generates:!0,costs:Z},{keyword:"contains",shape:"single",generates:!0,costs:Z},{keyword:"not",shape:"single",generates:!1,costs:x},{keyword:"if",shape:"single",generates:!1,generatesWith:"then",costs:x},{keyword:"then",shape:"single",generates:!0,costs:x},{keyword:"else",shape:"single",generates:!0,costs:x},{keyword:"propertyNames",shape:"single",generates:!0,costs:Z},{keyword:"dependencies",shape:"map",generates:!0,costs:x},{keyword:"contentSchema",shape:"single",generates:!0,costs:x},{keyword:"dependentSchemas",shape:"map",generates:!0,costs:x},{keyword:"containsAll",shape:"array",generates:!0,costs:Z}];function l6(q,j){let K=Reflect.get(q,j.keyword);if(K===void 0)return;if(j.shape==="array"||j.tupleForm===!0&&Array.isArray(K)){if(!Array.isArray(K))return;return{descriptor:j,form:"array",entries:K.map((b,P)=>({value:b,location:{form:"array",index:P}}))}}if(j.shape==="map"){if(typeof K!=="object"||K===null)return;return{descriptor:j,form:"map",entries:Object.entries(K).map(([b,P])=>({value:P,location:{form:"map",name:b}}))}}return{descriptor:j,form:"single",entries:[{value:K,location:{form:"single"}}]}}function d6(q){for(let j of p6)if(Reflect.get(q,j.keyword)!==void 0&&l6(q,j)===void 0)return j.keyword;return}function*Z6(q){for(let j of p6){let K=l6(q,j);if(K)yield K}}function s9(q){switch(q.form){case"single":return"";case"array":return`[${q.index}]`;case"map":return`.${q.name}`}}function h6(q,j){let K=(b)=>q.type===b||Array.isArray(q.type)&&q.type.includes(b),z=[];for(let{descriptor:b,entries:P}of Z6(q)){let B=b.typedAs!==void 0&&K(b.typedAs),F=b.generates||b.generatesWith!==void 0&&Reflect.get(q,b.generatesWith)!==void 0;for(let{value:G,location:W}of P){if(!y(G))continue;z.push({schema:G,keyword:b.keyword,path:`${j}.${b.keyword}${s9(W)}`,depthCost:b.costs.depthCost,frameCost:b.costs.frameCost,typedContinuation:B,generates:F})}}return z}function*U0(q,j){for(let{descriptor:K,form:z,entries:b}of Z6(q)){let{keyword:P}=K;if(z==="single"){let[{value:B,location:F}]=b,G=j(B,{keyword:P,location:F});if(G!==void 0)yield{keyword:P,form:z,value:G}}else if(z==="array"){let B=[];for(let{value:F,location:G}of b){let W=j(F,{keyword:P,location:G});if(W!==void 0)B.push(W)}yield{keyword:P,form:z,value:B}}else{let B={};for(let{value:F,location:G}of b){let W=j(F,{keyword:P,location:G});if(W===void 0||G.form!=="map")continue;Object.defineProperty(B,G.name,{value:W,writable:!0,enumerable:!0,configurable:!0})}yield{keyword:P,form:z,value:B}}}}var i6=2147483647,I0=1000,C0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function q7(q){let j=Array.from({length:q.int(1,48)},()=>q.int(0,255)),K="";for(let z=0;z<j.length;z+=3){let b=j.length-z,P=j[z]<<16|(b>1?j[z+1]:0)<<8|(b>2?j[z+2]:0);K+=C0[P>>18&63],K+=C0[P>>12&63],K+=b>1?C0[P>>6&63]:"=",K+=b>2?C0[P&63]:"="}return K}var j7={byte:q7},K7=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","definitions","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","autoIncrement","initialOffset","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","additionalItems","contains","containsAll","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependencies","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","default","examples","description","title","readOnly","writeOnly","deprecated","faker","chance","jsonPath","template","example"]);function g0(q,j){let K=new e9({locale:[a9,t9]});if(q!==void 0)K.seed(q);if(j!==void 0)K.setDefaultRefDate(j);return K}function H0(q,j){if(q===null||typeof q!=="object")return q;if(j.has(q))return q;if(q instanceof Date)return new Date(q.getTime());let K=Object.getPrototypeOf(q),z=K===Object.prototype||K===null;if(!Array.isArray(q)&&!z)try{return structuredClone(q)}catch{return q}j.add(q);try{if(Array.isArray(q))return q.map((P)=>H0(P,j));let b={};for(let[P,B]of Object.entries(q))Object.defineProperty(b,P,{value:H0(B,j),writable:!0,enumerable:!0,configurable:!0});return b}finally{j.delete(q)}}function O0(q){return H0(q,new Set)}function t(q,j){if(q===null||typeof q!=="object")return q;let K=j.get(q);if(K!==void 0)return K;if(q instanceof Date){let P=new Date(q.getTime());return j.set(q,P),P}if(q instanceof RegExp){let P=new RegExp(q.source,q.flags);return P.lastIndex=q.lastIndex,j.set(q,P),P}if(q instanceof Map){let P=new Map;j.set(q,P);for(let[B,F]of q)P.set(t(B,j),t(F,j));return P}if(q instanceof Set){let P=new Set;j.set(q,P);for(let B of q)P.add(t(B,j));return P}if(q instanceof ArrayBuffer){let P=q.slice(0);return j.set(q,P),P}if(ArrayBuffer.isView(q)){let P=structuredClone(q);return j.set(q,P),P}if(q instanceof URL){let P=new URL(q.href);return j.set(q,P),P}if(Array.isArray(q)){let P=Array(q.length);j.set(q,P);for(let B=0;B<q.length;B+=1)if(Object.hasOwn(q,B))P[B]=t(q[B],j);return P}let z=Object.getPrototypeOf(q);if(z!==Object.prototype&&z!==null)return q;let b=Object.create(z);j.set(q,b);for(let[P,B]of Object.entries(q))Object.defineProperty(b,P,{value:t(B,j),writable:!0,enumerable:!0,configurable:!0});return b}function o6(q){let j=new Map;return q.map((K)=>t(K,j))}function $6(q){return q??Math.floor(Math.random()*i6)}function n6(q){let j=q;return()=>{j+=1831565813;let K=j;return K=Math.imul(K^K>>>15,K|1),K^=K+Math.imul(K^K>>>7,K|61),((K^K>>>14)>>>0)/4294967296}}var z7=new Set(["items","prefixItems"]);function b7(q,j,K){if(typeof q==="boolean")return q;if(y(q))return r6(q,K);if(j.keyword==="dependencies"&&Array.isArray(q))return[...q];if(j.location.form==="array"&&z7.has(j.keyword))return!0;return}function P7(q){if(Array.isArray(q.items)){if(Reflect.get(q,"prefixItems")===void 0)return q;let j={...q};return Reflect.deleteProperty(j,"prefixItems"),j}if(q.items===void 0&&q.additionalItems!==void 0){let j={...q};return Reflect.deleteProperty(j,"additionalItems"),j}return q}var B7={items:"prefixItems",additionalItems:"items"};function F7(q,j={}){return r6(q,{normalizedSchemas:new Map,patternKeySeed:j.patternKeySeed,patternKeyCount:0})}function r6(q,j){let K=j.normalizedSchemas.get(q);if(K)return K;let z={};j.normalizedSchemas.set(q,z);for(let[B,F]of Object.entries(q))if(K7.has(B))z[B]=F;G7(q,z);let b=Array.isArray(q.items);if(b)z.items=!0,delete z.additionalItems;let P=U0(P7(q),(B,F)=>b7(B,F,j));for(let{keyword:B,value:F}of P)if(z[b?B7[B]??B:B]=F,B==="patternProperties"&&z.patternProperties)w7({schema:q,normalized:z,patternProperties:z.patternProperties,context:j});return z}function m6(q,j,K){let z=[q,j].filter((b)=>typeof b==="number");if(z.length===0)return;return z.reduce(K)}function G7(q,j){if(q.multipleOf!==void 0)return;let K=m6(q.minimum,q.exclusiveMinimum,Math.max),z=m6(q.maximum,q.exclusiveMaximum,Math.min);if(K!==void 0&&z===void 0&&K>=I0)j.maximum=K+I0;else if(z!==void 0&&K===void 0&&z<=-I0)j.minimum=z-I0}var W7=8;function V7(q,j){try{let K=u6({type:"string",pattern:q},{seed:j});return typeof K==="string"?K:void 0}catch{return}}function w7(q){let{schema:j,normalized:K,patternProperties:z,context:b}=q,P=b.patternKeySeed;if(P===void 0)return;let B=Object.keys(z).flatMap((J)=>{let A=s(J);return A?[{source:J,regex:A}]:[]});if(B.length===0)return;let F={...y(K.properties)?K.properties:{}},G=Object.keys(F).length,W=Math.max(1,(j.minProperties??0)-G),V=j.maxProperties===void 0?W:Math.max(0,j.maxProperties-G),L=Math.min(W,V),O=[];for(let J=0;J<L;J+=1){let{source:A}=B[J%B.length];for(let w=0;w<W7;w+=1){b.patternKeyCount+=1;let U=V7(A,(P+b.patternKeyCount*7919)%i6);if(U===void 0)break;let D=w===0?U:`${U}${w}`,R=B.filter((k)=>k.regex.test(D));if(Object.hasOwn(F,D)||R.length!==1||R[0].source!==A)continue;Object.defineProperty(F,D,{value:z[A],writable:!0,enumerable:!0,configurable:!0}),O.push(D);break}}if(O.length===0)return;K.properties=F,K.required=[...Array.isArray(K.required)?K.required:[],...O]}async function c6(q,j,K){let z={seed:j,maxDepth:e0,optionalsProbability:1,alwaysFakeOptionals:!0,useDefaultValue:!0,failOnInvalidTypes:!1,formats:{...j7},extensions:{faker:g0(j,K)}},b=await X6(F7(q,{patternKeySeed:j}),z);return z0(b),O0(b)}var t6=new Set(["__proto__","constructor","prototype"]);function a6(q,j,K=Math.random){if(j!==void 0&&!Number.isNaN(j)){if(j<0)return 0;return Math.floor(j)}if(q.minItems!==void 0&&q.maxItems!==void 0){let z=q.minItems,b=Math.max(z,q.maxItems);return Math.floor(K()*(b-z+1))+z}if(q.minItems!==void 0)return Math.max(q.minItems,r);if(q.maxItems!==void 0)return Math.min(q.maxItems,r);if(Array.isArray(q.items))return q.items.length;return r}function E0(q,j,K,z,b){if(!j)return q;if(!Q(q))return q;let P=structuredClone(q);return v0(P,j,{params:K,state:z,query:b}),P}function v0(q,j,K){for(let[z,b]of Object.entries(j)){if(t6.has(z))continue;if(z.includes("."))I7(q,z,b,K);else U7(q,z,b,K)}}function D7(q,j){if(!/^(0|[1-9]\d*)$/.test(j))return;let K=Number(j);return K<q.length?K:void 0}function f0(q,j){if(t6.has(j))return;if(Array.isArray(q)){let K=D7(q,j);if(K===void 0)return;return{read:()=>q[K],write:(z)=>{q[K]=z}}}return{read:()=>q[j],write:(K)=>{q[j]=K}}}function e6(q,j){if(typeof q==="string"&&q.includes("{{"))return C7(q,j);return O0(q)}function U7(q,j,K,z){let b=f0(q,j);if(!b)return;if(!Q(K)){b.write(e6(K,z));return}let P=b.read();if(Q(P)||Array.isArray(P))v0(P,K,z);else if(P===void 0||P===null){let B={};v0(B,K,z),b.write(B)}}function I7(q,j,K,z){let b=j.split("."),P=q;for(let F=0;F<b.length-1;F++){let G=f0(P,b[F]);if(!G)return;let W=G.read();if(Q(W)||Array.isArray(W))P=W;else if(W===void 0||W===null){let V={};G.write(V),P=V}else return}let B=f0(P,b[b.length-1]);if(B)B.write(e6(K,z))}function s6(q,j){let K=j.trim().split("."),z=q;for(let b of K)if(Q(z))z=z[b];else return;return z}function C7(q,j){let K=q.match(/^\{\{\s*([^}]+)\s*\}\}$/);if(K){let z=s6(j,K[1]);return z!==void 0?O0(z):q}return q.replace(/\{\{\s*([^}]+)\s*\}\}/g,(z,b)=>{let P=s6(j,b);return P!==void 0?String(P):z})}function j4(q,j,K){return x0(q,[j],{root:j,random:K,patterns:new Map})}var O7=4;function x0(q,j,K){if(q===null||q===void 0)return q;let z=[],b=new Set;for(let B of j)K4({schema:B,data:q,context:K,seen:b,found:z},!1);if(z.length===0)return q;if(R7(z)){if(K.random()<q6)return null}let P=z.map((B)=>B.schema);if(Q(q))for(let B of Object.keys(q)){let F=P.flatMap((G)=>b4(G,B,K).schemas);if(F.length>0)q[B]=x0(q[B],F,K)}else if(Array.isArray(q))for(let B=0;B<q.length;B++){let F=P.flatMap((G)=>J7(G,B));if(F.length>0)q[B]=x0(q[B],F,K)}return q}function X0(q){return Reflect.get(q,"schmockNullable")===!0}function L7(q){if(X0(q))return!0;if(q.const!==void 0&&q.const!==null)return!1;if(Array.isArray(q.enum)&&!q.enum.includes(null))return!1;if(q.type===void 0)return!0;return Array.isArray(q.type)?q.type.includes("null"):q.type==="null"}function R7(q){if(!q.some((j)=>X0(j.schema)))return!1;return q.every((j)=>!j.vetoes||L7(j.schema))}function K4(q,j){let{schema:K,data:z,context:b,seen:P,found:B}=q;if(P.has(K))return;P.add(K),B.push({schema:K,vetoes:!j});let F=j||X0(K),G=(V)=>K4({...q,schema:V},F),W=z4(K,b.root);if(W)G(W);for(let V of K.allOf??[])if(y(V))G(V);for(let V of["anyOf","oneOf"]){let O=(K[V]??[]).filter(y).filter((J)=>L0(z,J,b,O7));if(O.length===1)G(O[0])}}function z4(q,j){let K=q.$ref;if(typeof K!=="string"||!K.startsWith("#"))return;if(K==="#")return j;if(!K.startsWith("#/"))return;let z=j;for(let b of K.slice(2).split("/")){let P;try{P=decodeURIComponent(b)}catch{return}if(P=P.replace(/~1/g,"/").replace(/~0/g,"~"),Array.isArray(z))z=/^(0|[1-9]\d*)$/.test(P)?z[Number(P)]:void 0;else if(Q(z)&&Object.hasOwn(z,P))z=z[P];else return}return y(z)?z:void 0}function k7(q,j){if(!j.patterns.has(q))j.patterns.set(q,s(q));return j.patterns.get(q)}function b4(q,j,K){let z=[],b=q.properties!==void 0&&Object.hasOwn(q.properties,j);if(b){let F=q.properties?.[j];if(y(F))z.push(F)}let P=!1;for(let[F,G]of Object.entries(q.patternProperties??{}))if(k7(F,K)?.test(j)){if(P=!0,y(G))z.push(G)}let B=b||P;if(!B&&y(q.additionalProperties))z.push(q.additionalProperties);return{schemas:z,covered:B}}function J7(q,j){let K=Reflect.get(q,"prefixItems"),z=Array.isArray(q.items)?q.items:Array.isArray(K)?K:void 0;if(z){let b=j<z.length?z[j]:Array.isArray(q.items)?q.additionalItems:q.items;return y(b)?[b]:[]}return y(q.items)?[q.items]:[]}function M7(q,j){switch(j){case"null":return q===null;case"boolean":return typeof q==="boolean";case"string":return typeof q==="string";case"integer":return Number.isInteger(q);case"number":return typeof q==="number";case"array":return Array.isArray(q);case"object":return Q(q);default:return!0}}function q4(q,j){if(q===j)return!0;if(typeof q!=="object"||typeof j!=="object")return!1;return JSON.stringify(q)===JSON.stringify(j)}function L0(q,j,K,z){if(z<=0)return!0;let b=z4(j,K.root);if(b&&!L0(q,b,K,z-1))return!1;if(j.type!==void 0){if(!(Array.isArray(j.type)?j.type:[j.type]).some((B)=>M7(q,B)))return!1}if(j.const!==void 0&&!q4(j.const,q))return!1;if(Array.isArray(j.enum)&&!j.enum.some((P)=>q4(P,q)))return!1;if(Q(q)){for(let P of j.required??[])if(!Object.hasOwn(q,P))return!1;for(let[P,B]of Object.entries(q)){let{schemas:F,covered:G}=b4(j,P,K);if(!G&&j.additionalProperties===!1)return!1;for(let W of F)if(B!==null&&!L0(B,W,K,z-1))return!1}}for(let P of j.allOf??[])if(y(P)&&!L0(q,P,K,z-1))return!1;return!0}var T7=[{keywords:["email"],fakerMethod:"internet.email",schemaType:"string",minScore:0.6,format:"email"},{keywords:["username","user_name","login","handle","nickname"],fakerMethod:"internet.username",schemaType:"string",minScore:0.6},{keywords:["password","passwd","secret"],fakerMethod:"internet.password",schemaType:"string",minScore:0.6},{keywords:["token","api_key","apikey","access_token","refresh_token"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.8}],Y7=[{keywords:["first_name","firstname","given_name","forename"],fakerMethod:"person.firstName",schemaType:"string",minScore:0.6},{keywords:["last_name","lastname","surname","family_name"],fakerMethod:"person.lastName",schemaType:"string",minScore:0.6},{keywords:["full_name","fullname","display_name","displayname","full_name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["middle_name","middlename"],fakerMethod:"person.middleName",schemaType:"string",minScore:0.8},{keywords:["prefix","honorific","salutation"],fakerMethod:"person.prefix",schemaType:"string",minScore:0.8},{keywords:["suffix"],fakerMethod:"person.suffix",schemaType:"string",minScore:0.9},{keywords:["gender","sex"],fakerMethod:"person.sex",schemaType:"string",minScore:0.8},{keywords:["bio","biography"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.8},{keywords:["job_title","jobtitle","position","occupation","job","role"],fakerMethod:"person.jobTitle",schemaType:"string",minScore:0.6},{keywords:["job_area","department","division","team"],fakerMethod:"person.jobArea",schemaType:"string",minScore:0.8},{keywords:["zodiac","zodiac_sign"],fakerMethod:"person.zodiacSign",schemaType:"string",minScore:0.9}],y7=[{keywords:["phone","mobile","cell","tel","telephone","cellphone","fax"],fakerMethod:"phone.number",schemaType:"string",minScore:0.6},{keywords:["imei"],fakerMethod:"phone.imei",schemaType:"string",minScore:0.9}],A7=[{keywords:["street","street_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["address","mailing_address","postal_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["city","town"],fakerMethod:"location.city",schemaType:"string",minScore:0.6},{keywords:["state","province","region"],fakerMethod:"location.state",schemaType:"string",minScore:0.8},{keywords:["country"],fakerMethod:"location.country",schemaType:"string",minScore:0.8},{keywords:["country_code","countrycode"],fakerMethod:"location.countryCode",schemaType:"string",minScore:0.8},{keywords:["county"],fakerMethod:"location.county",schemaType:"string",minScore:0.9},{keywords:["continent"],fakerMethod:"location.continent",schemaType:"string",minScore:0.9},{keywords:["zip","zipcode","zip_code","postal","postal_code"],fakerMethod:"location.zipCode",schemaType:"string",minScore:0.6},{keywords:["latitude","lat"],fakerMethod:"location.latitude",schemaType:"number",minScore:0.6},{keywords:["longitude","lng","lon","long"],fakerMethod:"location.longitude",schemaType:"number",minScore:0.6},{keywords:["timezone","time_zone","tz"],fakerMethod:"location.timeZone",schemaType:"string",minScore:0.8},{keywords:["building_number"],fakerMethod:"location.buildingNumber",schemaType:"string",minScore:0.9}],N7=[{keywords:["url","website","link","href","homepage","webpage"],fakerMethod:"internet.url",schemaType:"string",minScore:0.6},{keywords:["avatar","photo_url","profile_image","image_url","picture","thumbnail","icon"],fakerMethod:"image.avatar",schemaType:"string",minScore:0.6},{keywords:["domain","hostname","domain_name"],fakerMethod:"internet.domainName",schemaType:"string",minScore:0.8},{keywords:["ip","ip_address","ipaddress","ipv4"],fakerMethod:"internet.ipv4",schemaType:"string",minScore:0.8},{keywords:["ipv6"],fakerMethod:"internet.ipv6",schemaType:"string",minScore:0.9},{keywords:["mac","mac_address"],fakerMethod:"internet.mac",schemaType:"string",minScore:0.9},{keywords:["user_agent","useragent"],fakerMethod:"internet.userAgent",schemaType:"string",minScore:0.9},{keywords:["port"],fakerMethod:"internet.port",schemaType:"number",minScore:0.9},{keywords:["protocol"],fakerMethod:"internet.protocol",schemaType:"string",minScore:0.9}],Q7=[{keywords:["uuid","guid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.6},{keywords:["sku"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.9},{keywords:["slug"],fakerMethod:"lorem.slug",schemaType:"string",minScore:0.8},{keywords:["isbn"],fakerMethod:"commerce.isbn",schemaType:"string",minScore:0.9},{keywords:["vin"],fakerMethod:"vehicle.vin",schemaType:"string",minScore:0.9},{keywords:["iban"],fakerMethod:"finance.iban",schemaType:"string",minScore:0.9},{keywords:["bic","swift"],fakerMethod:"finance.bic",schemaType:"string",minScore:0.9},{keywords:["ssn","social_security"],fakerMethod:"string.numeric",schemaType:"string",minScore:0.9}],S7=[{keywords:["description","desc","summary","overview","about","excerpt"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.6},{keywords:["content","body","text","message"],fakerMethod:"lorem.paragraphs",schemaType:"string",minScore:0.6},{keywords:["title","heading","subject","headline"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.6},{keywords:["tag","label","category","keyword"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.8},{keywords:["comment","note","remark","feedback","review"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.8},{keywords:["sentence"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.9},{keywords:["paragraph"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.9},{keywords:["word"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.9}],_7=[{keywords:["company","organization","org","employer","brand","operator"],fakerMethod:"company.name",schemaType:"string",minScore:0.6},{keywords:["product","product_name","item_name"],fakerMethod:"commerce.productName",schemaType:"string",minScore:0.8},{keywords:["price","amount","cost","fee","salary","wage","total","subtotal","balance","revenue","income"],fakerMethod:"commerce.price",minScore:0.6},{keywords:["currency","currency_code"],fakerMethod:"finance.currencyCode",schemaType:"string",minScore:0.8},{keywords:["currency_name"],fakerMethod:"finance.currencyName",schemaType:"string",minScore:0.8},{keywords:["currency_symbol"],fakerMethod:"finance.currencySymbol",schemaType:"string",minScore:0.8},{keywords:["account_number","account_no"],fakerMethod:"finance.accountNumber",schemaType:"string",minScore:0.8},{keywords:["credit_card","card_number"],fakerMethod:"finance.creditCardNumber",schemaType:"string",minScore:0.8},{keywords:["cvv"],fakerMethod:"finance.creditCardCVV",schemaType:"string",minScore:0.9},{keywords:["transaction_type"],fakerMethod:"finance.transactionType",schemaType:"string",minScore:0.9}],H7=[{keywords:["created_at","createdat","creation_date","date_created","createddate"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["updated_at","updatedat","modified_at","modifiedat","date_updated","last_modified","date_modified"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["deleted_at","deletedat"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["published_at","publishedat","publish_date"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["expires_at","expiresat","expiration","expiry"],fakerMethod:"date.future",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["birthday","date_of_birth","dob","birthdate","born"],fakerMethod:"date.birthdate",schemaType:"string",minScore:0.8,format:"date-time"},{keywords:["start_date","begin_date"],fakerMethod:"date.past",schemaType:"string",minScore:0.8,format:"date-time"},{keywords:["end_date","due_date","deadline"],fakerMethod:"date.future",schemaType:"string",minScore:0.8,format:"date-time"},{keywords:["timestamp","ts"],fakerMethod:"date.recent",schemaType:"string",minScore:0.8,format:"date-time"}],g7=[{keywords:["color","colour"],fakerMethod:"color.human",schemaType:"string",minScore:0.8},{keywords:["hex_color","hexcolor"],fakerMethod:"color.rgb",schemaType:"string",minScore:0.9}],v7=[{keywords:["age"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:18,max:80}},{keywords:["rating","score","stars"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:5}},{keywords:["count","quantity","qty"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:100}},{keywords:["percentage","percent"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:0,max:100}},{keywords:["weight"],fakerMethod:"number.float",schemaType:"number",minScore:0.8,fakerArgs:{min:0.1,max:200}},{keywords:["height"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:100,max:220}},{keywords:["width","length","depth"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:1000}},{keywords:["priority","order","rank","level"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:10}},{keywords:["version"],fakerMethod:"system.semver",schemaType:"string",minScore:0.8}],f7=[{keywords:["is_active","isactive","active","enabled","is_enabled"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.9},{keywords:["is_deleted","isdeleted","deleted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.05},{keywords:["is_archived","isarchived","archived"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_verified","isverified","verified","confirmed","is_confirmed"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.8},{keywords:["is_admin","isadmin","admin"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_public","ispublic","public","visible","is_visible"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.7},{keywords:["is_read","isread","read","seen","is_seen"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.6},{keywords:["is_default","isdefault"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.1},{keywords:["is_required","isrequired","required","mandatory"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.5},{keywords:["is_featured","isfeatured","featured","promoted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.15},{keywords:["available","in_stock"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.85}],E7=[{keywords:["filename","file_name"],fakerMethod:"system.fileName",schemaType:"string",minScore:0.8},{keywords:["file_type","filetype","mime_type","mimetype","content_type"],fakerMethod:"system.mimeType",schemaType:"string",minScore:0.8},{keywords:["file_ext","extension"],fakerMethod:"system.fileExt",schemaType:"string",minScore:0.9},{keywords:["file_path","filepath","path"],fakerMethod:"system.filePath",schemaType:"string",minScore:0.9},{keywords:["cron","cron_expression"],fakerMethod:"system.cron",schemaType:"string",minScore:0.9},{keywords:["semver"],fakerMethod:"system.semver",schemaType:"string",minScore:0.9}],x7=[{keywords:["aircraft_type","airplane","aircraft"],fakerMethod:"airline.aircraftType",schemaType:"string",minScore:0.9},{keywords:["flight_number","flight"],fakerMethod:"airline.flightNumber",schemaType:"string",minScore:0.9},{keywords:["record_locator","booking_ref","pnr"],fakerMethod:"airline.recordLocator",schemaType:"string",minScore:0.9},{keywords:["seat","seat_number"],fakerMethod:"airline.seat",schemaType:"string",minScore:0.9}],X7=[{keywords:["animal","animal_type","species"],fakerMethod:"animal.type",schemaType:"string",minScore:0.9},{keywords:["pet_name"],fakerMethod:"animal.petName",schemaType:"string",minScore:0.9},{keywords:["breed"],fakerMethod:"animal.dog",schemaType:"string",minScore:0.9},{keywords:["bird"],fakerMethod:"animal.bird",schemaType:"string",minScore:0.9},{keywords:["fish"],fakerMethod:"animal.fish",schemaType:"string",minScore:0.9},{keywords:["horse"],fakerMethod:"animal.horse",schemaType:"string",minScore:0.9},{keywords:["insect"],fakerMethod:"animal.insect",schemaType:"string",minScore:0.9}],u7=[{keywords:["book_title"],fakerMethod:"book.title",schemaType:"string",minScore:0.9},{keywords:["author","book_author","writer"],fakerMethod:"book.author",schemaType:"string",minScore:0.9},{keywords:["genre","book_genre"],fakerMethod:"book.genre",schemaType:"string",minScore:0.9},{keywords:["publisher","publishing_house"],fakerMethod:"book.publisher",schemaType:"string",minScore:0.9},{keywords:["book_series","series_name"],fakerMethod:"book.series",schemaType:"string",minScore:0.9}],p7=[{keywords:["dish","meal","recipe_name"],fakerMethod:"food.dish",schemaType:"string",minScore:0.9},{keywords:["ingredient"],fakerMethod:"food.ingredient",schemaType:"string",minScore:0.9},{keywords:["spice"],fakerMethod:"food.spice",schemaType:"string",minScore:0.9},{keywords:["fruit"],fakerMethod:"food.fruit",schemaType:"string",minScore:0.9},{keywords:["vegetable"],fakerMethod:"food.vegetable",schemaType:"string",minScore:0.9},{keywords:["meat"],fakerMethod:"food.meat",schemaType:"string",minScore:0.9},{keywords:["food_description"],fakerMethod:"food.description",schemaType:"string",minScore:0.9},{keywords:["ethnic_category","cuisine"],fakerMethod:"food.ethnicCategory",schemaType:"string",minScore:0.9}],l7=[{keywords:["song","song_name","track","track_name"],fakerMethod:"music.songName",schemaType:"string",minScore:0.9},{keywords:["album","album_name"],fakerMethod:"music.album",schemaType:"string",minScore:0.9},{keywords:["artist","musician","band"],fakerMethod:"music.artist",schemaType:"string",minScore:0.9},{keywords:["music_genre"],fakerMethod:"music.genre",schemaType:"string",minScore:0.9}],d7=[],Z7=[{keywords:["vehicle","vehicle_name"],fakerMethod:"vehicle.vehicle",schemaType:"string",minScore:0.9},{keywords:["vehicle_type"],fakerMethod:"vehicle.type",schemaType:"string",minScore:0.9},{keywords:["vehicle_manufacturer","car_make"],fakerMethod:"vehicle.manufacturer",schemaType:"string",minScore:0.9},{keywords:["vehicle_model","car_model"],fakerMethod:"vehicle.model",schemaType:"string",minScore:0.9},{keywords:["fuel","fuel_type"],fakerMethod:"vehicle.fuel",schemaType:"string",minScore:0.9},{keywords:["bicycle"],fakerMethod:"vehicle.bicycle",schemaType:"string",minScore:0.9},{keywords:["vehicle_color","car_color"],fakerMethod:"vehicle.color",schemaType:"string",minScore:0.9}],h7=[{keywords:["branch","branch_name","git_branch"],fakerMethod:"git.branch",schemaType:"string",minScore:0.9},{keywords:["commit_sha","commit_hash","sha"],fakerMethod:"git.commitSha",schemaType:"string",minScore:0.9},{keywords:["commit_message"],fakerMethod:"git.commitMessage",schemaType:"string",minScore:0.9}],m7=[{keywords:["db_column","column_name"],fakerMethod:"database.column",schemaType:"string",minScore:0.9},{keywords:["db_type","column_type"],fakerMethod:"database.type",schemaType:"string",minScore:0.9},{keywords:["db_engine","database_engine"],fakerMethod:"database.engine",schemaType:"string",minScore:0.9},{keywords:["collation"],fakerMethod:"database.collation",schemaType:"string",minScore:0.9},{keywords:["mongodb_id","object_id"],fakerMethod:"database.mongodbObjectId",schemaType:"string",minScore:0.9}],i7=[{keywords:["abbreviation","tech_abbreviation"],fakerMethod:"hacker.abbreviation",schemaType:"string",minScore:0.9},{keywords:["hacker_phrase","tech_phrase"],fakerMethod:"hacker.phrase",schemaType:"string",minScore:0.9}],o7=[{keywords:["adjective"],fakerMethod:"word.adjective",schemaType:"string",minScore:0.8},{keywords:["adverb"],fakerMethod:"word.adverb",schemaType:"string",minScore:0.8},{keywords:["noun"],fakerMethod:"word.noun",schemaType:"string",minScore:0.8},{keywords:["verb"],fakerMethod:"word.verb",schemaType:"string",minScore:0.8}],P4=[...T7,...Y7,...y7,...A7,...N7,...Q7,...S7,..._7,...H7,...g7,...v7,...f7,...E7,...x7,...X7,...u7,...p7,...l7,...d7,...Z7,...h7,...m7,...i7,...o7];var u0=new Set(["date-time","date","time","duration","email","idn-email","hostname","idn-hostname","ipv4","ipv6","uri","uri-reference","iri","iri-reference","json-pointer","relative-json-pointer","uuid","byte"]);function $7(q){return typeof q==="string"&&u0.has(q)}function B4(q){return q>=65&&q<=90}function F4(q){return q>=97&&q<=122}function n7(q){return q>=48&&q<=57}function r7(q,j){let K=0;for(let z=1;z<q.length;z++){let b=q.charCodeAt(z);if(!B4(b))continue;let P=q.charCodeAt(z-1);if(F4(P)||n7(P)||B4(P)&&z+1<q.length&&F4(q.charCodeAt(z+1)))j.push(q.slice(K,z).toLowerCase()),K=z}j.push(q.slice(K).toLowerCase())}function W4(q){let j=[];for(let K of q.split(/[_-]/))if(K)r7(K,j);return j}function c7(q){let j=W4(q);return{tokens:j,joined:j.join("")}}var G4=new WeakMap;function s7(q){let j=G4.get(q);if(!j)j=q.keywords.map(c7),G4.set(q,j);return j}var t7=new Set(["type","status","format","code","kind"]),a7=5;function e7(q){let j=new Set,K=new Set,z=0;for(let P of q)j.add(z),z+=P.length,K.add(z);let b=q[q.length-1];return{tokens:q,joined:q.join(""),starts:j,ends:K,qualifier:q.length>1&&b!==void 0&&t7.has(b)?b:void 0}}function q5(q,j,K){if(!q.starts.has(j))return!1;if(q.ends.has(K))return!0;let z=q.joined.slice(K,K+2);return q.ends.has(K+1)&&z.startsWith("s")||q.ends.has(K+2)&&z==="es"}function j5(q,j){if(j.length<3)return!1;let K=q.joined.indexOf(j);while(K!==-1){if(j.length>=a7||q5(q,K,K+j.length))return!0;K=q.joined.indexOf(j,K+1)}return!1}function K5(q,j){let{tokens:K,joined:z}=q,b=0;for(let{tokens:P,joined:B}of j){if(z===B)return 1;if(P.length>0&&P.length<=K.length){if(K.slice(-P.length).every((G,W)=>G===P[W]))b=Math.max(b,0.8)}if(q.qualifier!==void 0&&P[P.length-1]!==q.qualifier)continue;if(P.length>0&&P.every((F)=>K.includes(F))){let G=P.length/K.length>0.5?0.9:0.65;b=Math.max(b,G)}if(j5(q,B))b=Math.max(b,0.7)}return b}function R0(q){return q.default!==void 0||q.const!==void 0||q.enum!==void 0||q.pattern!==void 0||q.$ref!==void 0||"faker"in q&&Boolean(q.faker)}function z5(q){if(!Array.isArray(q.type))return{mappable:!0,type:q.type};let j=q.type.filter((K)=>K!=="null");if(j.length===1)return{mappable:!0,type:j[0]};return{mappable:!1}}function p0(q,j,K=P4){if(R0(j))return;let z=z5(j);if(!z.mappable)return;let b=z.type;if(b==="string"&&j.format==="uuid")return{mapping:{keywords:["uuid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:1};if($7(j.format)||b==="string"&&(j.minLength!==void 0||j.maxLength!==void 0))return;let P=j.minimum!==void 0||j.maximum!==void 0||j.exclusiveMinimum!==void 0||j.exclusiveMaximum!==void 0||j.multipleOf!==void 0,B=b==="number"||b==="integer",F=W4(q),G=e7(F),W;for(let V of K){if(P&&(B||V.schemaType==="number"||V.schemaType==="integer"))continue;if(b==="object"||b==="array")continue;if(V.schemaType&&b&&V.schemaType!==b){if(!(V.schemaType==="number"&&b==="integer"||V.schemaType==="integer"&&b==="number"))continue}let L=K5(G,s7(V));if(L>=V.minScore&&(!W||L>W.score))W={mapping:V,score:L}}if(b==="string"){if(F[F.length-1]==="id"&&F.length>1){if(!W||W.score<0.8)W={mapping:{keywords:["id"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:0.8}}}return W}import{ResourceLimitError as u,SchemaValidationError as S}from"@schmock/core";var l0,V4=200;function $(q,j){return q.type===j||Array.isArray(q.type)&&q.type.includes(j)}var a={height:0,nodes:1,chars:0};function n0(q,j="$",K){if(!q||typeof q!=="object")throw new S(j,"Schema must be a valid JSON Schema object");let z={visited:0,circular:!1,edges:new Map,postOrder:[],resolveRef:G5(q)};if(b5(q,j,z),z.circular)throw new S(j,"Schema contains circular references which are not supported");B5(q,j,z);let b=v5(K),B=D5(q,z,b).get(q)??a,{maxDepth:F,maxFrames:G}=R5(q,z);if(F>P0)throw new u("schema_nesting_depth",P0,F);if(G>V4)z.composition??={resource:"schema_composition_depth",limit:V4,actual:G,path:j};for(let W of[z.composition,z.arraySize,z.objectSize,z.stringLength])if(W)throw new u(W.resource,W.limit,W.actual,W.path);if(b!==void 0&&T4(q)&&b>E)throw new u("array_size",E,b);if(B.nodes>i)throw new u("generated_nodes",i,B.nodes);if(B.chars>c)throw new u("generated_chars",c,B.chars)}function b5(q,j,K){let z=new Set,b=new Set,P=[{schema:q,path:j,typedChain:!0,exiting:!1}];while(P.length>0){let B=P.pop();if(!B)break;if(B.exiting){z.delete(B.schema),b.add(B.schema),K.postOrder.push(B.schema);continue}if(b.has(B.schema)){if(B.typedChain)U4(B.schema,B.path,!0);continue}if(z.has(B.schema)){K.circular=!0;continue}if(K.visited+=1,K.visited>B0)throw new u("schema_nodes",B0,K.visited);U4(B.schema,B.path,B.typedChain);let F=F5(B.schema,B.path,K.resolveRef);K.edges.set(B.schema,F),z.add(B.schema),P.push({...B,exiting:!0});for(let G=F.length-1;G>=0;G-=1){let W=F[G];if(z.has(W.schema))K.circular=!0;else if(!b.has(W.schema))P.push({schema:W.schema,path:W.path,typedChain:B.typedChain&&W.typedContinuation,exiting:!1})}}}var d0={};function P5(...q){let j={};for(let K of q){if(!y(K))continue;for(let z of["maxItems","maxLength","maxProperties"]){let b=K[z];if(typeof b!=="number")continue;j[z]=Math.min(j[z]??b,b)}}return j}function r0(q,j){return j===void 0?q:Math.min(q,j)}function B5(q,j,K){let z=new Set,b=[{schema:q,path:j,caps:d0}];while(b.length>0){let P=b.pop();if(!P||z.has(P.schema))continue;if(P.caps===d0)z.add(P.schema);f5(P.schema,P.path,K,P.caps),E5(P.schema,P.path,K,P.caps),x5(P.schema,P.path,K,P.caps);let B=K.edges.get(P.schema)??[];for(let F=B.length-1;F>=0;F-=1){let G=B[F];if(G.generates&&!z.has(G.schema))b.push({schema:G.schema,path:G.path,caps:G.keyword==="if"?P5(P.schema,P.schema.then):d0})}}}function F5(q,j,K){let z=L4(q,j);for(let b of["$ref","$dynamicRef"]){let P=Reflect.get(q,b);if(typeof P!=="string")continue;let B=K(q,P);if(y(B))z.unshift({schema:B,keyword:b,path:`${j}.${b}`,depthCost:0,frameCost:1,typedContinuation:!1,generates:!0})}return z}function L4(q,j){return h6(q,j)}var w4="schmock://local/root.json";function G5(q){let j=W5(q),K=new Map;return(z,b)=>{let P=K.get(z);if(!P)P=new Map,K.set(z,P);let B=P.get(b);if(B!==void 0)return B===null?void 0:B;let F=j.scopes.get(z)??j.rootScope,G=w5(b,F,j.resources);return P.set(b,G??null),G}}function W5(q){let j=new Map,K=new Map,z={baseUri:w4,resourceRoot:q};j.set(w4,q);let b=[{schema:q,inheritedScope:z,path:"$"}];while(b.length>0){let P=b.pop();if(!P||K.has(P.schema))continue;let B=V5(P.schema,P.inheritedScope,j,P.path);K.set(P.schema,B);for(let F of L4(P.schema,P.path))b.push({schema:F.schema,inheritedScope:B,path:F.path})}return{resources:j,scopes:K,rootScope:K.get(q)??z}}function V5(q,j,K,z){let b=j;if(typeof q.$id==="string"){let P=R4(q.$id,j.baseUri);if(P)if(Z0(K,P,q,z),k4(P)===""){let B=$0(P);Z0(K,B,q,z),b={baseUri:B,resourceRoot:q}}else b={...j,baseUri:P}}for(let P of["$anchor","$dynamicAnchor"]){let B=Reflect.get(q,P);if(typeof B==="string"&&B.length>0)Z0(K,`${$0(b.baseUri)}#${B}`,q,`${z}.${P}`)}return b}function Z0(q,j,K,z){let b=q.get(j);if(b!==void 0&&b!==K)throw new S(z,`Duplicate canonical schema identifier: "${j}"`,"Give each embedded resource and anchor a unique canonical identifier");q.set(j,K)}function w5(q,j,K){if(q==="#")return j.resourceRoot;if(q.startsWith("#/"))return D4(j.resourceRoot,q.slice(1));let z=R4(q,j.baseUri);if(!z)return;let b=K.get(z);if(b!==void 0)return b;let P=K.get($0(z));if(P===void 0)return;let B=k4(z);if(B==="")return P;return B.startsWith("/")?D4(P,B):void 0}function R4(q,j){try{return new URL(q,j).href}catch{return}}function $0(q){let j=new URL(q);return j.hash="",j.href}function k4(q){return new URL(q).hash.slice(1)}function D4(q,j){let K;try{K=decodeURIComponent(j)}catch{return}if(K==="")return q;if(!K.startsWith("/"))return;let z=q;for(let b of K.slice(1).split("/")){let P=b.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof z!=="object"||z===null||!Object.hasOwn(z,P))return;z=Reflect.get(z,P)}return typeof z==="boolean"||y(z)?z:void 0}function D5(q,j,K){let z=new Map;for(let b of j.postOrder)z.set(b,L5(b,z,j,b===q?{explicitCount:K}:void 0));return z}var U5=["contentSchema","propertyNames"],I5=["items","additionalItems","prefixItems","contains","containsAll"],C5=["properties","patternProperties","additionalProperties"],O5=["allOf","anyOf","oneOf","if","then","else"];function L5(q,j,K,z){let b=typeof q.$ref==="string"?q.$ref:Reflect.get(q,"$dynamicRef");if(typeof b==="string")return h0(K.resolveRef(q,b),j);let P=0,B=1,F=q.type==="string"&&typeof q.minLength==="number"?Math.max(0,q.minLength):0,G=new Set([...U5,...O5]),W=(w)=>{let U=h0(w,j);return P=Math.max(P,U.height+1),U},V=(w)=>{let U=h0(w,j);return P=Math.max(P,U.height),U};if(T4(q)){for(let H of I5)G.add(H);let w=z?.explicitCount??g5(q),U=z?z.explicitCount??q.minItems??0:w,D=Reflect.get(q,"prefixItems"),R=Array.isArray(q.items),k=Array.isArray(q.items)?q.items:Array.isArray(D)?D:[],I=0,C=0;k.forEach((H,m)=>{let t0=W(H);if(m<w)I=N(I+t0.nodes);if(m<U)C=N(C+t0.chars)});let M=R?q.additionalItems:q.items,Y=M===void 0?a:W(M);if(I=N(I+Math.max(0,w-k.length)*Y.nodes),C=N(C+Math.max(0,U-k.length)*Y.chars),q.contains!==void 0){let H=Reflect.get(q,"minContains"),m=Math.max(1,Math.min(typeof H==="number"?H:1,w));I=N(I+m*W(q.contains).nodes)}let f=Reflect.get(q,"containsAll");if(Array.isArray(f))for(let H of f)I=N(I+W(H).nodes);B=N(B+I),F=N(F+C)}if(Y4(q)){for(let I of C5)G.add(I);let w=new Set(Object.keys(q.properties??{}));for(let I of Object.values(q.properties??{})){let C=W(I);B=N(B+C.nodes),F=N(F+C.chars)}let U=a;for(let I of Object.values(q.patternProperties??{})){let C=W(I);if(B=N(B+C.nodes),C.nodes>U.nodes)U=C}if(q.additionalProperties!==void 0){let I=W(q.additionalProperties);if(I.nodes>U.nodes)U=I}if(q.propertyNames!==void 0)W(q.propertyNames);let D=new Set((q.required??[]).filter((I)=>!w.has(I))).size,R=Math.max(0,(q.minProperties??0)-w.size),k=Math.max(D,R);B=N(B+k*U.nodes)}for(let w of q.allOf??[]){let U=V(w);B=N(B+Math.max(0,U.nodes-1)),F=Math.max(F,U.chars)}let L=0;for(let w of["anyOf","oneOf"])for(let U of q[w]??[])L=Math.max(L,V(U).nodes-1);B=N(B+Math.max(0,L));let O=q.if===void 0?a:V(q.if),J=0;if(q.then!==void 0)J=V(q.then).nodes-1+(O.nodes-1);if(q.else!==void 0)J=Math.max(J,V(q.else).nodes-1);if(B=N(B+Math.max(0,J)),q.not!==void 0)V(q.not);for(let w of K.edges.get(q)??[]){if(!w.generates||G.has(w.keyword))continue;let U=w.depthCost===1,D=U?W(w.schema):V(w.schema);B=N(B+D.nodes-(U?0:1))}let A=$(q,"null")||Reflect.get(q,"schmockNullable")===!0;return{height:P,nodes:B,chars:A?0:F}}function h0(q,j){return y(q)?j.get(q)??a:a}function R5(q,j){let K=new Map([[q,0]]),z=new Map([[q,0]]),b=0,P=0;for(let B=j.postOrder.length-1;B>=0;B-=1){let F=j.postOrder[B],G=K.get(F),W=z.get(F);if(G===void 0||W===void 0)continue;b=Math.max(b,G),P=Math.max(P,W);for(let V of j.edges.get(F)??[]){let L=G+V.depthCost,O=W+V.frameCost;if(L>(K.get(V.schema)??-1))K.set(V.schema,L);if(O>(z.get(V.schema)??-1))z.set(V.schema,O)}}return{maxDepth:b,maxFrames:P}}function U4(q,j,K){if(K&&Object.keys(q).length===0)throw new S(j,"Schema cannot be empty");let z=["object","array","string","number","integer","boolean","null"],b=Array.isArray(q.type)?q.type:q.type?[q.type]:[];for(let B of b)if(!z.includes(B))throw new S(j,`Invalid schema type: ${JSON.stringify(B)}`,"Supported types are: object, array, string, number, integer, boolean, null");if(Reflect.get(q,"chance")!==void 0)throw new S(`${j}.chance`,"chance generators are not supported",'Use the faker keyword instead, for example "faker": "lorem.paragraph"');if(q.properties!==void 0&&(typeof q.properties!=="object"||Array.isArray(q.properties)))throw new S(`${j}.properties`,"Properties must be an object mapping property names to schemas",'Use { "propertyName": { "type": "string" } } format');let P=d6(q);if(P!==void 0)throw new S(`${j}.${P}`,`"${P}" has the wrong shape`,"Composition and positional keywords take a list of schemas; property maps take an object");for(let B of["items","prefixItems"]){let F=Reflect.get(q,B);if(!Array.isArray(F))continue;F.forEach((G,W)=>{if(typeof G!=="boolean"&&!y(G))throw new S(`${j}.${B}[${W}]`,"Positional item schemas must be schema objects or booleans",'Use a schema such as { "type": "string" }, or true to allow anything')})}if($(q,"array")){if(q.items===null||q.items===void 0)throw new S(`${j}.items`,"Array schema must have valid items definition","Define items as a schema object or array of schemas");if(Array.isArray(q.items)&&q.items.length===0)throw new S(`${j}.items`,"Array items cannot be empty array","Provide at least one item schema")}if("faker"in q&&q.faker!==void 0)try{k5(q.faker)}catch(B){if(B instanceof S){let F=B.context,G="Invalid faker method",W;if(F&&typeof F==="object"){if("issue"in F&&typeof F.issue==="string")G=F.issue;if("suggestion"in F&&typeof F.suggestion==="string")W=F.suggestion}throw new S(`${j}.faker`,G,W)}if(B instanceof u)throw H5(B,`${j}.faker`);if(B instanceof Error)throw B;throw Error(String(B))}}function k5(q){if(typeof q==="string"){M0(q);return}if(typeof q!=="object"||q===null||Array.isArray(q))throw new S("$.faker","Faker must be a method string or an object with exactly one own method key",'Use "person.fullName" or { "number.int": [{ "min": 1, "max": 2 }] }');let j=Reflect.ownKeys(q),K=Object.keys(q);if(j.length!==1||K.length!==1||typeof j[0]!=="string"||j[0]!==K[0])throw new S("$.faker","Object-form faker must contain exactly one own method key",'Use { "number.int": [{ "min": 1, "max": 2 }] }');let z=K[0],b=Object.getOwnPropertyDescriptor(q,z);if(!b||!("value"in b)||!Array.isArray(b.value))throw new S("$.faker",`Arguments for faker method "${z}" must be an array`,'Wrap options in an array, for example [{ "min": 1, "max": 2 }]');M0(z),J4(z,b.value)}var v={resource:"string_length",limit:g},k0={resource:"array_size",limit:E};function c0(q){return{resource:"string_length",limit:Math.floor(g/q)}}var J0=c0(2),m0=c0(7),J5=c0(21),M5={"string.fromCharacters":[{argumentIndex:1,direct:!0,...v}],"string.alpha":[{argumentIndex:0,direct:!0,property:"length",...v}],"string.alphanumeric":[{argumentIndex:0,direct:!0,property:"length",...v}],"string.binary":[{argumentIndex:0,direct:!1,property:"length",...v}],"string.octal":[{argumentIndex:0,direct:!1,property:"length",...v}],"string.hexadecimal":[{argumentIndex:0,direct:!1,property:"length",...v}],"string.numeric":[{argumentIndex:0,direct:!0,property:"length",...v}],"string.sample":[{argumentIndex:0,direct:!0,...v}],"string.nanoid":[{argumentIndex:0,direct:!0,...v}],"string.symbol":[{argumentIndex:0,direct:!0,...v}],"word.sample":[{argumentIndex:0,direct:!0,property:"length",...v}],"word.words":[{argumentIndex:0,direct:!0,property:"count",...J0}],"lorem.word":[{argumentIndex:0,direct:!0,property:"length",...v}],"lorem.words":[{argumentIndex:0,direct:!0,...J0}],"lorem.sentence":[{argumentIndex:0,direct:!0,...J0}],"lorem.sentences":[{argumentIndex:0,direct:!0,...m0}],"lorem.slug":[{argumentIndex:0,direct:!0,...J0}],"lorem.lines":[{argumentIndex:0,direct:!0,...m0}],"lorem.paragraph":[{argumentIndex:0,direct:!0,...m0}],"lorem.paragraphs":[{argumentIndex:0,direct:!0,...J5}],"lorem.text":[{argumentIndex:0,direct:!0,...v}],"internet.password":[{argumentIndex:0,direct:!1,property:"length",...v}],"helpers.uniqueArray":[{argumentIndex:1,direct:!0,...k0}],"helpers.arrayElements":[{argumentIndex:1,direct:!0,...k0}],"helpers.multiple":[{argumentIndex:1,direct:!1,property:"count",...k0}],"date.betweens":[{argumentIndex:0,direct:!1,property:"count",...k0}]};function J4(q,j){for(let b of M5[q]??[]){let P=j[b.argumentIndex],B=b.direct?I4(P):0;if(b.property&&Q(P))B=Math.max(B,I4(Reflect.get(P,b.property)));if(B>b.limit)throw new u(b.resource,b.limit,B)}T5(q,j);let K=[...j],z=new Set;while(K.length>0){let b=K.pop();if(typeof b==="string"&&b.length>g)throw new u("string_length",g,b.length);if(typeof b!=="object"||b===null||z.has(b))continue;if(z.add(b),Array.isArray(b)){for(let P of b)K.push(P);continue}for(let P of Object.values(b))K.push(P)}}function I4(q){if(typeof q==="number")return q;if(!Q(q))return 0;let j=0;for(let K of["min","max"]){let z=Reflect.get(q,K);if(typeof z==="number")j=Math.max(j,z)}return j}function T5(q,j){switch(q){case"helpers.fake":Y5(j[0]);return;case"helpers.mustache":A5(j[0],j[1]);return;case"helpers.fromRegExp":if(typeof j[0]==="string"){let{max:K}=M4(j[0]);if(K>g)throw new u("string_length",g,K)}return;default:return}}function Y5(q){let j=Array.isArray(q)?q:[q];for(let K of j){if(typeof K!=="string")continue;for(let z of K.matchAll(/\{\{(.+?)\}\}/g)){let b=z[1],P=b.indexOf("("),B=b.lastIndexOf(")");if(P===-1||B<P)continue;J4(b.slice(0,P).trim(),y5(b.slice(P+1,B)))}}}function y5(q){try{let j=JSON.parse(`[${q}]`);if(Array.isArray(j))return j}catch{}return[q]}function A5(q,j){if(typeof q!=="string"||!Q(j))return;let K=q.length;for(let[z,b]of Object.entries(j)){let P=`{{${z}}}`,B=q.split(P).length-1;if(B===0)continue;let F=typeof b==="string"?b.length:String(b).length;K=N(K+B*(F-P.length))}if(K>g)throw new u("string_length",g,K)}var b0={min:0,max:0},X={min:1,max:1};function M4(q){let j=[C4(!1)],K=0;while(K<q.length){let z=q[K],b=j[j.length-1];if(z==="|"){b.alternatives.push({min:b.min,max:b.max}),b.min=0,b.max=0,K+=1;continue}if(z==="("){let G=N5(q,K);j.push(C4(G.zeroWidth)),K+=G.length;continue}let P;if(z===")"){let G=j.length>1?j.pop():void 0;P=G?i0(G):X,K+=1}else if(z==="[")K=Q5(q,K),P=X;else if(z==="\\"){let G=S5(q,K);K=G.next,P=G.width}else if(z==="^"||z==="$")K+=1,P=b0;else K+=1,P=X;let B=_5(q,K);if(B)K=B.next,P={min:O4(P.min,B.min),max:O4(P.max,B.max)};let F=j[j.length-1];F.min=N(F.min+P.min),F.max=N(F.max+P.max)}while(j.length>1){let z=j.pop();if(!z)break;let b=i0(z),P=j[j.length-1];P.min=N(P.min+b.min),P.max=N(P.max+b.max)}return i0(j[0])}function C4(q){return{min:0,max:0,alternatives:[],zeroWidth:q}}function i0(q){if(q.zeroWidth)return b0;let{min:j,max:K}=q;for(let z of q.alternatives)j=Math.min(j,z.min),K=Math.max(K,z.max);return{min:j,max:K}}function N5(q,j){for(let K of["(?<=","(?<!","(?=","(?!"])if(q.startsWith(K,j))return{length:K.length,zeroWidth:!0};if(q.startsWith("(?<",j)){let K=q.indexOf(">",j);return{length:K===-1?3:K-j+1,zeroWidth:!1}}if(q.startsWith("(?:",j))return{length:3,zeroWidth:!1};return{length:1,zeroWidth:!1}}function Q5(q,j){let K=j+1;while(K<q.length)if(q[K]==="\\")K+=2;else if(q[K]==="]")return K+1;else K+=1;return q.length}function S5(q,j){let K=q[j+1],z=(b,P)=>{let B=q.indexOf(b,j+2);return B===-1?P:B+1};switch(K){case void 0:return{next:j+1,width:X};case"b":case"B":return{next:j+2,width:b0};case"k":return q[j+2]==="<"?{next:z(">",j+2),width:b0}:{next:j+2,width:X};case"u":return q[j+2]==="{"?{next:z("}",j+2),width:X}:{next:j+6,width:X};case"x":return{next:j+4,width:X};case"c":return{next:j+3,width:X};case"p":case"P":return q[j+2]==="{"?{next:z("}",j+2),width:X}:{next:j+2,width:X};default:if(K>="1"&&K<="9"){let b=j+2;while(b<q.length&&/\d/.test(q[b]))b+=1;return{next:b,width:b0}}return{next:j+2,width:X}}}function _5(q,j){let K=q[j],z;if(K==="*")z={min:0,max:0,next:j+1};else if(K==="+")z={min:1,max:1,next:j+1};else if(K==="?")z={min:0,max:1,next:j+1};else if(K==="{"){let b=/\{(\d+)(,(\d*))?\}/y;b.lastIndex=j;let P=b.exec(q);if(P){let B=Number(P[1]),F=P[2]===void 0||P[3]===""?B:Number(P[3]);z={min:B,max:Math.max(B,F),next:j+P[0].length}}}if(z&&q[z.next]==="?")z.next+=1;return z}function O4(q,j){return q===0||j===0?0:N(q*j)}function H5(q,j){let K=q.context;if(!Q(K))return q;let{resource:z,limit:b,actual:P}=K;if(typeof z!=="string"||typeof b!=="number")return q;return new u(z,b,typeof P==="number"?P:void 0,j)}function T4(q){return $(q,"array")||q.items!==void 0||q.minItems!==void 0||q.maxItems!==void 0}function g5(q){let{minItems:j,maxItems:K}=q;if(j!==void 0&&K!==void 0)return Math.max(j,K);if(K!==void 0)return K;if(j!==void 0)return j;return r}function v5(q){if(q===void 0||Number.isNaN(q))return;return Math.floor(Math.max(0,q))}function f5(q,j,K,z){let b=r0(Math.max(q.minItems??0,q.maxItems??0),z.maxItems);if(b>E)K.arraySize??={resource:"array_max_items",limit:E,actual:b,path:j}}function E5(q,j,K,z){if(!Y4(q))return;let b=new Set(Object.keys(q.properties??{})),P=new Set((q.required??[]).filter((F)=>!b.has(F))).size,B=Math.max(r0(q.minProperties??0,z.maxProperties),b.size+P);if(B>o)K.objectSize??={resource:"object_properties",limit:o,actual:B,path:j}}function x5(q,j,K,z){if(X5(q)){for(let b of[q.minLength,q.maxLength])if(b!==void 0)o0(r0(b,z.maxLength),j,K);if(typeof q.pattern==="string"&&s(q.pattern)!==void 0)o0(M4(q.pattern).min,j,K)}for(let b of[q.const,q.default,q.enum,Reflect.get(q,"template")])o0(u5(b),j,K)}function X5(q){if(q.type!==void 0)return $(q,"string");if(q.const!==void 0)return typeof q.const==="string";if(q.enum!==void 0)return q.enum.some((j)=>typeof j==="string");if(q.default!==void 0)return typeof q.default==="string";return!0}function o0(q,j,K){if(q>g&&(!K.stringLength||q>K.stringLength.actual))K.stringLength={resource:"string_length",limit:g,actual:q,path:j}}function u5(q){let j=[q],K=new Set,z=0;while(j.length>0){let b=j.pop();if(typeof b==="string"){z=Math.max(z,b.length);continue}if(typeof b!=="object"||b===null||K.has(b))continue;K.add(b),j.push(...Object.values(b))}return z}function Y4(q){if(q.type!==void 0)return $(q,"object");return q.properties!==void 0||q.required!==void 0||q.additionalProperties!==void 0||q.patternProperties!==void 0||q.minProperties!==void 0||q.maxProperties!==void 0}function N(q){return Math.min(q,Number.MAX_SAFE_INTEGER)}function M0(q){let j=q.split(".");if(j.length<2)throw new S("$.faker",`Invalid faker method format: "${q}"`,"Use format like 'person.firstName' or 'internet.email'");if(!l0)l0=g0();let z=l0;for(let b of j){let P=Object.hasOwn(Object.prototype,b)||b.startsWith("_");if(z&&typeof z==="object"&&!P&&b in z)z=Reflect.get(z,b);else throw new S("$.faker",`Invalid faker method: "${q}"`,"Check faker.js documentation for valid methods")}if(typeof z!=="function")throw new S("$.faker",`Invalid faker method: "${q}" is not a function`,"Check faker.js documentation for valid methods")}function y4(q){return q.type==="string"&&q.faker===void 0&&q.format===void 0&&q.minLength===void 0&&q.maxLength===void 0&&!R0(q)}function A4(q){return y(q)&&q.type==="null"&&Object.keys(q).length===1}function p5(q,j){for(let K of["anyOf","oneOf"]){let z=q[K];if(!Array.isArray(z)||z.length!==2)continue;let[b,P]=z,B=A4(b)?P:A4(P)?b:void 0;if(!y(B))continue;let{[K]:F,...G}=q;if(j&&Object.keys(G).some((W)=>Object.hasOwn(B,W)))return;return{...B,...G,schmockNullable:!0}}return}function l5(q){if(q.schmockNullable===!1)return q;let j=q.schmockNullable===!0,K=p5(q,!j);if(K)return K;if(!j&&!d5(q))return q;if(q.schmockNullable=!0,Array.isArray(q.type)){let z=q.type.filter((b)=>b!=="null");if(z.length===1)q.type=z[0];else if(z.length>0)q.type=z}if(Array.isArray(q.enum)){let z=q.enum.filter((b)=>b!==null);if(z.length>0)q.enum=z}return q}function d5(q){if(!Array.isArray(q.type)||!q.type.includes("null"))return!1;if(!q.type.some((j)=>j!=="null"))return!1;if(q.const===null)return!1;if(Array.isArray(q.enum)&&q.enum.every((j)=>j===null))return!1;return!0}var n=Symbol("root-schema"),Z5=new Set(["string","number","integer","boolean"]);function h5(q){let j=Array.isArray(q.type)?q.type.filter((K)=>K!=="null"):[q.type];return j.length===1&&Z5.has(String(j[0]))}function m5(q){let j=[];if(/ies$/i.test(q))j.push(`${q.slice(0,-3)}y`);if(/[^s]s$/i.test(q))j.push(q.slice(0,-1));if(/(ses|xes|zes|ches|shes)$/i.test(q))j.push(q.slice(0,-2));return j}function i5(q,j){if(q===n||!h5(j))return n;for(let K of m5(q))if(p0(K,j))return K;return n}function N4(q){if(!q||typeof q!=="object")return q;return Q4(q,{cache:new Map},n)}function Q4(q,j,K){let z=j.cache.get(q);if(!z)z=new Map,j.cache.set(q,z);let b=z.get(K);if(b)return b;let P=l5({...q});if(z.set(K,P),K!==n&&P.faker){if(typeof P.faker==="string")M0(P.faker)}else o5(P,j,K),n5(P,K);return r5(P),P}function o5(q,j,K){let z=U0(q,(b,P)=>y(b)?Q4(b,j,$5({context:K,child:b,slot:P})):b);for(let{keyword:b,value:P}of z)Reflect.set(q,b,P)}function $5(q){let{context:j,child:K,slot:z}=q;if(z.keyword==="properties"&&z.location.form==="map")return z.location.name;if(z.keyword==="items"&&z.location.form==="single")return i5(j,K);return n}function n5(q,j){if(j===n){if(y4(q))q.faker="lorem.word";return}if(q.allOf||q.anyOf||q.oneOf||R0(q))return;let z=p0(j,q);if(z){let{fakerMethod:b,format:P,trueProbability:B,fakerArgs:F}=z.mapping;if(q.faker=F?{[b]:[F]}:b,P&&(typeof q.format!=="string"||!u0.has(q.format)))q.format=P;if(B!==void 0&&q.schmockTrueProbability===void 0)q.schmockTrueProbability=B}else if(y4(q))q.faker="lorem.word"}function r5(q){let j=q.schmockTrueProbability;if(q.type!=="boolean"||typeof j!=="number"||!Number.isFinite(j)||q.const!==void 0||q.enum!==void 0)return;q.faker={"datatype.boolean":[{probability:j}]}}function _4(q){return{schema:q,enhanced:N4(q)}}function s5(q,j){return n0(q,"$",j),_4(q)}function i3(q){let[j,K]=o6([q.schema,q.overrides]);if(!y(j))throw new s0("$","Schema must be a valid JSON Schema object");if(K!==void 0&&!Q(K))throw new s0("$.overrides","Overrides must be an object mapping paths to values");let z=j,b=K,P=q.count,B=q.seed;n0(z,"$",P);let F;return{name:"faker",version:a0,async process(G,W){if(W!==void 0&&W!==null)return{context:G,response:W};try{F??=_4(z);let V=await H4(F,{schema:z,count:P,overrides:b,params:G.params,state:G.routeState,query:G.query,seed:B});return{context:G,response:V}}catch(V){if(V instanceof s0||V instanceof S4)throw V;throw new c5(G.path,V instanceof Error?V:Error(String(V)),z)}}}}async function o3(q){return H4(s5(q.schema,q.count),q)}async function H4(q,j){let{count:K,overrides:z,params:b,state:P,query:B,seed:F}=j,{schema:G}=q,W=$6(F),V=n6(W),L=q.enhanced;if($(G,"array")&&G.items){let J=a6(G,K,V);if(J>E)throw new S4("array_size",E,J);L={...L,minItems:J,maxItems:J}}let O=await c6(L,W,F!==void 0?T0:void 0);if(O=j4(O,L,V),Array.isArray(O)){let J=O.map((A)=>E0(A,z,b,P,B));return z0(J),J}return O=E0(O,z,b,P,B),z0(O),O}export{o3 as generateFromSchema,i3 as fakerPlugin,g as MAX_STRING_LENGTH,B0 as MAX_SCHEMA_NODES,o as MAX_OBJECT_PROPERTIES,P0 as MAX_NESTING_DEPTH,i as MAX_GENERATED_NODES,E as MAX_ARRAY_SIZE};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@schmock/faker",
3
3
  "description": "Faker-powered automatic data generation for Schmock",
4
- "version": "2.5.0",
4
+ "version": "2.6.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  "@faker-js/faker": "^10.5.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@schmock/core": "^2.5.0"
50
+ "@schmock/core": "^2.6.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@amiceli/vitest-cucumber": "^7.0.0",