@authhero/adapter-interfaces 0.5.1 → 0.5.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function St(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n}function wt(t,e){var n;return((n=t==null?void 0:t._def)===null||n===void 0?void 0:n.typeName)===e}function J(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...r){const a=n.apply(this,r);return a._def.openapi=this._def.openapi,a}}function Tt(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(a,i){var o,c,u,l,m,x;const z=typeof a=="string"?i:a,B=z??{},{param:We}=B,bt=St(B,["param"]),Ge=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof a=="string"?{refId:a}:void 0),qe=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),bt),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||We?{param:Object.assign(Object.assign({},(x=(m=this._def.openapi)===null||m===void 0?void 0:m.metadata)===null||x===void 0?void 0:x.param),We)}:void 0),He=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(Ge).length>0?{_internal:Ge}:void 0),Object.keys(qe).length>0?{metadata:qe}:void 0)}));if(wt(this,"ZodObject")){const kt=this.extend;He.extend=function(...xt){var Se,we,Te,Ce,Oe,Ee;const je=kt.apply(this,xt);return je._def.openapi={_internal:{extendedFrom:!((we=(Se=this._def.openapi)===null||Se===void 0?void 0:Se._internal)===null||we===void 0)&&we.refId?{refId:(Ce=(Te=this._def.openapi)===null||Te===void 0?void 0:Te._internal)===null||Ce===void 0?void 0:Ce.refId,schema:this}:(Oe=this._def.openapi)===null||Oe===void 0?void 0:Oe._internal.extendedFrom},metadata:(Ee=je._def.openapi)===null||Ee===void 0?void 0:Ee.metadata},je}}return He},J(t,"optional"),J(t,"nullable"),J(t,"default"),J(t,"transform"),J(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const a=this._def.shape(),i=e.apply(this),o=i._def.shape();return Object.entries(o).forEach(([c,u])=>{var l,m;u._def.openapi=(m=(l=a[c])===null||l===void 0?void 0:l._def)===null||m===void 0?void 0:m.openapi}),i._def.openapi=void 0,i};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...a){const i=n.apply(this,a);return i._def.openapi=void 0,i};const r=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...a){const i=r.apply(this,a);return i._def.openapi=void 0,i}}new Set(".\\+*[^]$()");var b;(function(t){t.assertEqual=a=>a;function e(a){}t.assertIs=e;function n(a){throw new Error}t.assertNever=n,t.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),o={};for(const c of i)o[c]=a[c];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},t.find=(a,i)=>{for(const o of a)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(b||(b={}));var Ne;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ne||(Ne={}));const h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),A=t=>{switch(typeof t){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(t)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(t)?h.array:t===null?h.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?h.promise:typeof Map<"u"&&t instanceof Map?h.map:typeof Set<"u"&&t instanceof Set?h.set:typeof Date<"u"&&t instanceof Date?h.date:h.object;default:return h.unknown}},d=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ct=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class T extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let c=r,u=0;for(;u<o.path.length;){const l=o.path[u];u===o.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(n(o))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}};return a(this),r}static assert(e){if(!(e instanceof T))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}T.create=t=>new T(t);const H=(t,e)=>{let n;switch(t.code){case d.invalid_type:t.received===h.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,b.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${b.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${b.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:n="Invalid function arguments";break;case d.invalid_return_type:n="Invalid function return type";break;case d.invalid_date:n="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:b.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case d.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case d.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case d.custom:n="Invalid input";break;case d.invalid_intersection_types:n="Intersection results could not be merged";break;case d.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:n="Number must be finite";break;default:n=e.defaultError,b.assertNever(t)}return{message:n}};let Je=H;function Ot(t){Je=t}function fe(){return Je}const me=t=>{const{data:e,path:n,errorMaps:r,issueData:a}=t,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let c="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...a,path:i,message:c}},Et=[];function p(t,e){const n=fe(),r=me({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===H?void 0:H].filter(a=>!!a)});t.common.issues.push(r)}class S{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if(a.status==="aborted")return _;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return S.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return _;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const _=Object.freeze({status:"aborted"}),G=t=>({status:"dirty",value:t}),w=t=>({status:"valid",value:t}),Ie=t=>t.status==="aborted",Re=t=>t.status==="dirty",Q=t=>t.status==="valid",ee=t=>typeof Promise<"u"&&t instanceof Promise;function ge(t,e,n,r){if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Fe(t,e,n,r,a){if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var f;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(f||(f={}));var F,X;class Z{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ke=(t,e)=>{if(Q(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new T(t.common.issues);return this._error=n,this._error}}};function y(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,c)=>{var u,l;const{message:m}=t;return o.code==="invalid_enum_value"?{message:m??c.defaultError}:typeof c.data>"u"?{message:(u=m??r)!==null&&u!==void 0?u:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(l=m??n)!==null&&l!==void 0?l:c.defaultError}},description:a}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return A(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ee(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},i=this._parseSync({data:e,path:a.path,parent:a});return Ke(a,i)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(ee(a)?a:Promise.resolve(a));return Ke(r,i)}refine(e,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=e(a),c=()=>i.addIssue({code:d.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new E({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return j.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this,this._def)}promise(){return Y.create(this,this._def)}or(e){return se.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new E({...y(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new le({...y(this._def),innerType:this,defaultValue:n,typeName:g.ZodDefault})}brand(){return new Pe({typeName:g.ZodBranded,type:this,...y(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ue({...y(this._def),innerType:this,catchValue:n,typeName:g.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return he.create(this,e)}readonly(){return pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jt=/^c[^\s-]{8,}$/i,Zt=/^[0-9a-z]+$/,Nt=/^[0-9A-HJKMNP-TV-Z]{26}$/,It=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rt=/^[a-z0-9_-]{21}$/i,At=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ze;const $t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Dt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ut=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Vt=new RegExp(`^${Xe}$`);function Qe(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Lt(t){return new RegExp(`^${Qe(t)}$`)}function et(t){let e=`${Xe}T${Qe(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function zt(t,e){return!!((e==="v4"||!e)&&$t.test(t)||(e==="v6"||!e)&&Dt.test(t))}class C extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.string,received:i.parsedType}),_}const r=new S;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(a=this._getOrReturnCtx(e,a),o?p(a,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&p(a,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Pt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"email",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Ze||(Ze=new RegExp(Mt,"u")),Ze.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"emoji",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")It.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"uuid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Rt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"nanoid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")jt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Zt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid2",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Nt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ulid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),p(a,{validation:"url",code:d.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"regex",code:d.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?et(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Vt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Lt(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?At.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"duration",code:d.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?zt(e.data,i.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ip",code:d.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Ut.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64",code:d.invalid_string,message:i.message}),r.dirty()):b.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),{validation:n,code:d.invalid_string,...f.errToObj(r)})}_addCheck(e){return new C({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...f.errToObj(e)})}url(e){return this._addCheck({kind:"url",...f.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...f.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...f.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...f.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...f.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...f.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...f.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...f.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...f.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...f.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...f.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...f.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...f.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...f.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...f.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...f.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...f.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...f.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...f.errToObj(n)})}nonempty(e){return this.min(1,f.errToObj(e))}trim(){return new C({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}C.create=t=>{var e;return new C({checks:[],typeName:g.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};function Bt(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,i=parseInt(t.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}class P extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==h.number){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.number,received:i.parsedType}),_}let r;const a=new S;for(const i of this._def.checks)i.kind==="int"?b.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Bt(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_finite,message:i.message}),a.dirty()):b.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,f.toString(n))}gt(e,n){return this.setLimit("min",e,!1,f.toString(n))}lte(e,n){return this.setLimit("max",e,!0,f.toString(n))}lt(e,n){return this.setLimit("max",e,!1,f.toString(n))}setLimit(e,n,r,a){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:f.toString(a)}]})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:f.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:f.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}P.create=t=>new P({checks:[],typeName:g.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...y(t)});class M extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==h.bigint){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.bigint,received:i.parsedType}),_}let r;const a=new S;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):b.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,f.toString(n))}gt(e,n){return this.setLimit("min",e,!1,f.toString(n))}lte(e,n){return this.setLimit("max",e,!0,f.toString(n))}lt(e,n){return this.setLimit("max",e,!1,f.toString(n))}setLimit(e,n,r,a){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:f.toString(a)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}M.create=t=>{var e;return new M({checks:[],typeName:g.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};class te extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.boolean,received:r.parsedType}),_}return w(e.data)}}te.create=t=>new te({typeName:g.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...y(t)});class V extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.date,received:i.parsedType}),_}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_date}),_}const r=new S;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):b.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:f.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:f.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}V.create=t=>new V({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:g.ZodDate,...y(t)});class _e extends v{_parse(e){if(this._getType(e)!==h.symbol){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.symbol,received:r.parsedType}),_}return w(e.data)}}_e.create=t=>new _e({typeName:g.ZodSymbol,...y(t)});class ne extends v{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.undefined,received:r.parsedType}),_}return w(e.data)}}ne.create=t=>new ne({typeName:g.ZodUndefined,...y(t)});class re extends v{_parse(e){if(this._getType(e)!==h.null){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.null,received:r.parsedType}),_}return w(e.data)}}re.create=t=>new re({typeName:g.ZodNull,...y(t)});class K extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}}K.create=t=>new K({typeName:g.ZodAny,...y(t)});class U extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}U.create=t=>new U({typeName:g.ZodUnknown,...y(t)});class R extends v{_parse(e){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:h.never,received:n.parsedType}),_}}R.create=t=>new R({typeName:g.ZodNever,...y(t)});class ye extends v{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.void,received:r.parsedType}),_}return w(e.data)}}ye.create=t=>new ye({typeName:g.ZodVoid,...y(t)});class O extends v{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==h.array)return p(n,{code:d.invalid_type,expected:h.array,received:n.parsedType}),_;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,c=n.data.length<a.exactLength.value;(o||c)&&(p(n,{code:o?d.too_big:d.too_small,minimum:c?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(p(n,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(p(n,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>a.type._parseAsync(new Z(n,o,n.path,c)))).then(o=>S.mergeArray(r,o));const i=[...n.data].map((o,c)=>a.type._parseSync(new Z(n,o,n.path,c)));return S.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new O({...this._def,minLength:{value:e,message:f.toString(n)}})}max(e,n){return new O({...this._def,maxLength:{value:e,message:f.toString(n)}})}length(e,n){return new O({...this._def,exactLength:{value:e,message:f.toString(n)}})}nonempty(e){return this.min(1,e)}}O.create=(t,e)=>new O({type:t,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...y(e)});function W(t){if(t instanceof k){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=j.create(W(r))}return new k({...t._def,shape:()=>e})}else return t instanceof O?new O({...t._def,type:W(t.element)}):t instanceof j?j.create(W(t.unwrap())):t instanceof D?D.create(W(t.unwrap())):t instanceof N?N.create(t.items.map(e=>W(e))):t}class k extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=b.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==h.object){const l=this._getOrReturnCtx(e);return p(l,{code:d.invalid_type,expected:h.object,received:l.parsedType}),_}const{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||c.push(l);const u=[];for(const l of o){const m=i[l],x=a.data[l];u.push({key:{status:"valid",value:l},value:m._parse(new Z(a,x,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof R){const l=this._def.unknownKeys;if(l==="passthrough")for(const m of c)u.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(l==="strict")c.length>0&&(p(a,{code:d.unrecognized_keys,keys:c}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const m of c){const x=a.data[m];u.push({key:{status:"valid",value:m},value:l._parse(new Z(a,x,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const m of u){const x=await m.key,z=await m.value;l.push({key:x,value:z,alwaysSet:m.alwaysSet})}return l}).then(l=>S.mergeObjectSync(r,l)):S.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var a,i,o,c;const u=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=f.errToObj(e).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:g.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const n={};return b.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new k({...this._def,shape:()=>n})}omit(e){const n={};return b.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new k({...this._def,shape:()=>n})}deepPartial(){return W(this)}partial(e){const n={};return b.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a.optional()}),new k({...this._def,shape:()=>n})}required(e){const n={};return b.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof j;)i=i._def.innerType;n[r]=i}}),new k({...this._def,shape:()=>n})}keyof(){return tt(b.objectKeys(this.shape))}}k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...y(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:g.ZodObject,...y(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...y(e)});class se extends v{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function a(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=i.map(c=>new T(c.ctx.common.issues));return p(n,{code:d.invalid_union,unionErrors:o}),_}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},m=u._parseSync({data:n.data,path:n.path,parent:l});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const c=o.map(u=>new T(u));return p(n,{code:d.invalid_union,unionErrors:c}),_}}get options(){return this._def.options}}se.create=(t,e)=>new se({options:t,typeName:g.ZodUnion,...y(e)});const I=t=>t instanceof oe?I(t.schema):t instanceof E?I(t.innerType()):t instanceof ce?[t.value]:t instanceof $?t.options:t instanceof de?b.objectValues(t.enum):t instanceof le?I(t._def.innerType):t instanceof ne?[void 0]:t instanceof re?[null]:t instanceof j?[void 0,...I(t.unwrap())]:t instanceof D?[null,...I(t.unwrap())]:t instanceof Pe||t instanceof pe?I(t.unwrap()):t instanceof ue?I(t._def.innerType):[];class ke extends v{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==h.object)return p(n,{code:d.invalid_type,expected:h.object,received:n.parsedType}),_;const r=this.discriminator,a=n.data[r],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const a=new Map;for(const i of n){const o=I(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(a.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);a.set(c,i)}}return new ke({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:a,...y(r)})}}function Ae(t,e){const n=A(t),r=A(e);if(t===e)return{valid:!0,data:t};if(n===h.object&&r===h.object){const a=b.objectKeys(e),i=b.objectKeys(t).filter(c=>a.indexOf(c)!==-1),o={...t,...e};for(const c of i){const u=Ae(t[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===h.array&&r===h.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const o=t[i],c=e[i],u=Ae(o,c);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return n===h.date&&r===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ae extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=(i,o)=>{if(Ie(i)||Ie(o))return _;const c=Ae(i.value,o.value);return c.valid?((Re(i)||Re(o))&&n.dirty(),{status:n.value,value:c.data}):(p(r,{code:d.invalid_intersection_types}),_)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ae.create=(t,e,n)=>new ae({left:t,right:e,typeName:g.ZodIntersection,...y(n)});class N extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return p(r,{code:d.invalid_type,expected:h.array,received:r.parsedType}),_;if(r.data.length<this._def.items.length)return p(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Z(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>S.mergeArray(n,o)):S.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new N({...this._def,rest:e})}}N.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new N({items:t,typeName:g.ZodTuple,rest:null,...y(e)})};class ie extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return p(r,{code:d.invalid_type,expected:h.object,received:r.parsedType}),_;const a=[],i=this._def.keyType,o=this._def.valueType;for(const c in r.data)a.push({key:i._parse(new Z(r,c,r.path,c)),value:o._parse(new Z(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?S.mergeObjectAsync(n,a):S.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof v?new ie({keyType:e,valueType:n,typeName:g.ZodRecord,...y(r)}):new ie({keyType:C.create(),valueType:e,typeName:g.ZodRecord,...y(n)})}}class ve extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return p(r,{code:d.invalid_type,expected:h.map,received:r.parsedType}),_;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([c,u],l)=>({key:a._parse(new Z(r,c,r.path,[l,"key"])),value:i._parse(new Z(r,u,r.path,[l,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,m=await u.value;if(l.status==="aborted"||m.status==="aborted")return _;(l.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(l.value,m.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const l=u.key,m=u.value;if(l.status==="aborted"||m.status==="aborted")return _;(l.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(l.value,m.value)}return{status:n.value,value:c}}}}ve.create=(t,e,n)=>new ve({valueType:e,keyType:t,typeName:g.ZodMap,...y(n)});class L extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return p(r,{code:d.invalid_type,expected:h.set,received:r.parsedType}),_;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(p(r,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(p(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const l=new Set;for(const m of u){if(m.status==="aborted")return _;m.status==="dirty"&&n.dirty(),l.add(m.value)}return{status:n.value,value:l}}const c=[...r.data.values()].map((u,l)=>i._parse(new Z(r,u,r.path,l)));return r.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new L({...this._def,minSize:{value:e,message:f.toString(n)}})}max(e,n){return new L({...this._def,maxSize:{value:e,message:f.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}L.create=(t,e)=>new L({valueType:t,minSize:null,maxSize:null,typeName:g.ZodSet,...y(e)});class q extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==h.function)return p(n,{code:d.invalid_type,expected:h.function,received:n.parsedType}),_;function r(c,u){return me({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fe(),H].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function a(c,u){return me({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fe(),H].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Y){const c=this;return w(async function(...u){const l=new T([]),m=await c._def.args.parseAsync(u,i).catch(B=>{throw l.addIssue(r(u,B)),l}),x=await Reflect.apply(o,this,m);return await c._def.returns._def.type.parseAsync(x,i).catch(B=>{throw l.addIssue(a(x,B)),l})})}else{const c=this;return w(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new T([r(u,l.error)]);const m=Reflect.apply(o,this,l.data),x=c._def.returns.safeParse(m,i);if(!x.success)throw new T([a(m,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new q({...this._def,args:N.create(e).rest(U.create())})}returns(e){return new q({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new q({args:e||N.create([]).rest(U.create()),returns:n||U.create(),typeName:g.ZodFunction,...y(r)})}}class oe extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}oe.create=(t,e)=>new oe({getter:t,typeName:g.ZodLazy,...y(e)});class ce extends v{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}ce.create=(t,e)=>new ce({value:t,typeName:g.ZodLiteral,...y(e)});function tt(t,e){return new $({values:t,typeName:g.ZodEnum,...y(e)})}class $ extends v{constructor(){super(...arguments),F.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:b.joinValues(r),received:n.parsedType,code:d.invalid_type}),_}if(ge(this,F)||Fe(this,F,new Set(this._def.values)),!ge(this,F).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:r}),_}return w(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return $.create(e,{...this._def,...n})}exclude(e,n=this._def){return $.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}F=new WeakMap;$.create=tt;class de extends v{constructor(){super(...arguments),X.set(this,void 0)}_parse(e){const n=b.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){const a=b.objectValues(n);return p(r,{expected:b.joinValues(a),received:r.parsedType,code:d.invalid_type}),_}if(ge(this,X)||Fe(this,X,new Set(b.getValidEnumValues(this._def.values))),!ge(this,X).has(e.data)){const a=b.objectValues(n);return p(r,{received:r.data,code:d.invalid_enum_value,options:a}),_}return w(e.data)}get enum(){return this._def.values}}X=new WeakMap;de.create=(t,e)=>new de({values:t,typeName:g.ZodNativeEnum,...y(e)});class Y extends v{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==h.promise&&n.common.async===!1)return p(n,{code:d.invalid_type,expected:h.promise,received:n.parsedType}),_;const r=n.parsedType===h.promise?n.data:Promise.resolve(n.data);return w(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Y.create=(t,e)=>new Y({type:t,typeName:g.ZodPromise,...y(e)});class E extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{p(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return _;const u=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return u.status==="aborted"?_:u.status==="dirty"||n.value==="dirty"?G(u.value):u});{if(n.value==="aborted")return _;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?_:c.status==="dirty"||n.value==="dirty"?G(c.value):c}}if(a.type==="refinement"){const o=c=>{const u=a.refinement(c,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?_:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?_:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Q(o))return o;const c=a.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Q(o)?Promise.resolve(a.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);b.assertNever(a)}}E.create=(t,e,n)=>new E({schema:t,typeName:g.ZodEffects,effect:e,...y(n)});E.createWithPreprocess=(t,e,n)=>new E({schema:e,effect:{type:"preprocess",transform:t},typeName:g.ZodEffects,...y(n)});class j extends v{_parse(e){return this._getType(e)===h.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(t,e)=>new j({innerType:t,typeName:g.ZodOptional,...y(e)});class D extends v{_parse(e){return this._getType(e)===h.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(t,e)=>new D({innerType:t,typeName:g.ZodNullable,...y(e)});class le extends v{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}le.create=(t,e)=>new le({innerType:t,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ue extends v{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ee(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ue.create=(t,e)=>new ue({innerType:t,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class be extends v{_parse(e){if(this._getType(e)!==h.nan){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.nan,received:r.parsedType}),_}return{status:"valid",value:e.data}}}be.create=t=>new be({typeName:g.ZodNaN,...y(t)});const Wt=Symbol("zod_brand");class Pe extends v{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class he extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_:i.status==="dirty"?(n.dirty(),G(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new he({in:e,out:n,typeName:g.ZodPipeline})}}class pe extends v{_parse(e){const n=this._def.innerType._parse(e),r=a=>(Q(a)&&(a.value=Object.freeze(a.value)),a);return ee(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:g.ZodReadonly,...y(e)});function nt(t,e={},n){return t?K.create().superRefine((r,a)=>{var i,o;if(!t(r)){const c=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,u=(o=(i=c.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,l=typeof c=="string"?{message:c}:c;a.addIssue({code:"custom",...l,fatal:u})}}):K.create()}const Gt={object:k.lazycreate};var g;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(g||(g={}));const qt=(t,e={message:`Input not instance of ${t.name}`})=>nt(n=>n instanceof t,e),rt=C.create,st=P.create,Ht=be.create,Kt=M.create,at=te.create,Yt=V.create,Jt=_e.create,Ft=ne.create,Xt=re.create,Qt=K.create,en=U.create,tn=R.create,nn=ye.create,rn=O.create,sn=k.create,an=k.strictCreate,on=se.create,cn=ke.create,dn=ae.create,ln=N.create,un=ie.create,pn=ve.create,hn=L.create,fn=q.create,mn=oe.create,gn=ce.create,_n=$.create,yn=de.create,vn=Y.create,Ye=E.create,bn=j.create,kn=D.create,xn=E.createWithPreprocess,Sn=he.create,wn=()=>rt().optional(),Tn=()=>st().optional(),Cn=()=>at().optional(),On={string:t=>C.create({...t,coerce:!0}),number:t=>P.create({...t,coerce:!0}),boolean:t=>te.create({...t,coerce:!0}),bigint:t=>M.create({...t,coerce:!0}),date:t=>V.create({...t,coerce:!0})},En=_;var s=Object.freeze({__proto__:null,defaultErrorMap:H,setErrorMap:Ot,getErrorMap:fe,makeIssue:me,EMPTY_PATH:Et,addIssueToContext:p,ParseStatus:S,INVALID:_,DIRTY:G,OK:w,isAborted:Ie,isDirty:Re,isValid:Q,isAsync:ee,get util(){return b},get objectUtil(){return Ne},ZodParsedType:h,getParsedType:A,ZodType:v,datetimeRegex:et,ZodString:C,ZodNumber:P,ZodBigInt:M,ZodBoolean:te,ZodDate:V,ZodSymbol:_e,ZodUndefined:ne,ZodNull:re,ZodAny:K,ZodUnknown:U,ZodNever:R,ZodVoid:ye,ZodArray:O,ZodObject:k,ZodUnion:se,ZodDiscriminatedUnion:ke,ZodIntersection:ae,ZodTuple:N,ZodRecord:ie,ZodMap:ve,ZodSet:L,ZodFunction:q,ZodLazy:oe,ZodLiteral:ce,ZodEnum:$,ZodNativeEnum:de,ZodPromise:Y,ZodEffects:E,ZodTransformer:E,ZodOptional:j,ZodNullable:D,ZodDefault:le,ZodCatch:ue,ZodNaN:be,BRAND:Wt,ZodBranded:Pe,ZodPipeline:he,ZodReadonly:pe,custom:nt,Schema:v,ZodSchema:v,late:Gt,get ZodFirstPartyTypeKind(){return g},coerce:On,any:Qt,array:rn,bigint:Kt,boolean:at,date:Yt,discriminatedUnion:cn,effect:Ye,enum:_n,function:fn,instanceof:qt,intersection:dn,lazy:mn,literal:gn,map:pn,nan:Ht,nativeEnum:yn,never:tn,null:Xt,nullable:kn,number:st,object:sn,oboolean:Cn,onumber:Tn,optional:bn,ostring:wn,pipeline:Sn,preprocess:xn,promise:vn,record:un,set:hn,strictObject:an,string:rt,symbol:Jt,transformer:Ye,tuple:ln,undefined:Ft,union:on,unknown:en,void:nn,NEVER:En,ZodIssueCode:d,quotelessJson:Ct,ZodError:T});Tt(s);const jn=s.object({start:s.number(),limit:s.number(),length:s.number()}),Me=s.object({created_at:s.string(),updated_at:s.string()}),Zn=s.object({email:s.string().optional(),email_verified:s.boolean().optional(),name:s.string().optional(),username:s.string().optional(),given_name:s.string().optional(),phone_number:s.string().optional(),phone_verified:s.boolean().optional(),family_name:s.string().optional()}).catchall(s.any()),Nn=s.object({connection:s.string(),user_id:s.string(),provider:s.string(),isSocial:s.boolean(),access_token:s.string().optional(),access_token_secret:s.string().optional(),refresh_token:s.string().optional(),profileData:Zn.optional()}),$e=s.object({email:s.string().optional(),username:s.string().optional(),given_name:s.string().optional(),family_name:s.string().optional(),nickname:s.string().optional(),name:s.string().optional(),picture:s.string().optional(),locale:s.string().optional(),linked_to:s.string().optional(),profileData:s.string().optional(),user_id:s.string().optional()}),it=$e.extend({email_verified:s.boolean().default(!1),verify_email:s.boolean().optional(),last_ip:s.string().optional(),last_login:s.string().optional(),user_id:s.string().optional(),provider:s.string().default("email"),connection:s.string().default("email")}),ot=it.extend(Me.shape).extend({user_id:s.string(),email:s.string(),is_social:s.boolean(),login_count:s.number(),identities:s.array(Nn).optional()}),In=ot,Rn=$e.extend({email:s.string(),login_count:s.number(),multifactor:s.array(s.string()).optional(),last_ip:s.string().optional(),last_login:s.string().optional(),user_id:s.string()}).catchall(s.any());var ct=(t=>(t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_SILENT_AUTH="ssa",t.FAILED_SILENT_AUTH="fsa",t.SUCCESS_SIGNUP="ss",t.FAILED_SIGNUP="fs",t.SUCCESS_LOGIN="s",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.SUCCESS_LOGOUT="slo",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.CODE_LINK_SENT="cls",t.NOT_IMPLEMENTED_1="seccft",t))(ct||{});const An=s.enum(["sapi","ssa","fsa","ss","ssa","fs","s","f","fp","slo","scoa","fcoa","seccft","cls","seacft","serft"]),dt=s.object({name:s.string(),version:s.string(),env:s.object({node:s.string().optional()}).optional()}),Pn=s.object({type:An,date:s.string(),description:s.string().optional(),log_id:s.string().optional(),_id:s.string().optional(),ip:s.string(),user_agent:s.string(),details:s.any().optional(),isMobile:s.boolean(),user_id:s.string().optional(),user_name:s.string().optional(),connection:s.string().optional(),connection_id:s.string().optional(),client_id:s.string().optional(),client_name:s.string().optional(),audience:s.string().optional(),scope:s.array(s.string()).optional(),strategy:s.string().optional(),strategy_type:s.string().optional(),hostname:s.string().optional(),auth0_client:dt.optional()}),lt=s.object({id:s.string(),name:s.string(),allowed_web_origins:s.string().transform(t=>t===null?"":t).default(""),allowed_callback_urls:s.string().transform(t=>t===null?"":t).default(""),allowed_logout_urls:s.string().transform(t=>t===null?"":t).default(""),email_validation:s.enum(["enabled","disabled","enforced"]).default("enforced"),client_secret:s.string().default(""),disable_sign_ups:s.boolean().default(!1)}),Mn=s.object({created_at:s.string().transform(t=>t===null?"":t),updated_at:s.string().transform(t=>t===null?"":t)}).extend(lt.shape);var De=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(De||{}),Ue=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t))(Ue||{}),Ve=(t=>(t.S265="S256",t.plain="plain",t))(Ve||{});const xe=s.object({client_id:s.string(),vendor_id:s.string().optional(),response_type:s.nativeEnum(De).optional(),response_mode:s.nativeEnum(Ue).optional(),redirect_uri:s.string().optional(),audience:s.string().optional(),state:s.string().optional(),nonce:s.string().optional(),scope:s.string().optional(),code_challenge_method:s.nativeEnum(Ve).optional(),code_challenge:s.string().optional(),username:s.string().optional()}),$n=s.object({authParams:xe,nonce:s.string().optional(),code:s.string(),user_id:s.string(),created_at:s.string(),expires_at:s.string(),used_at:s.string().optional()}),Dn=s.object({colors:s.object({primary:s.string(),page_background:s.object({type:s.string().optional(),start:s.string().optional(),end:s.string().optional(),angle_deg:s.number().optional()}).optional()}).optional(),logo_url:s.string().optional(),favicon_url:s.string().optional(),font:s.object({url:s.string()}).optional()}),ut=s.object({id:s.string().optional(),name:s.string(),client_id:s.string().optional(),client_secret:s.string().optional(),authorization_endpoint:s.string().optional(),response_type:s.custom().optional(),response_mode:s.custom().optional(),private_key:s.string().optional(),kid:s.string().optional(),team_id:s.string().optional(),token_endpoint:s.string().optional(),token_exchange_basic_auth:s.boolean().optional(),userinfo_endpoint:s.string().optional(),scope:s.string().optional()}),Le=s.object({id:s.string(),created_at:s.string().transform(t=>t===null?"":t),updated_at:s.string().transform(t=>t===null?"":t)}).extend(ut.shape),Un=s.object({domain:s.string(),dkim_private_key:s.string().optional(),dkim_public_key:s.string().optional(),email_api_key:s.string().optional(),email_service:s.union([s.literal("mailgun"),s.literal("mailchannels")]).optional()}),pt=s.object({id:s.string(),name:s.string(),domains:s.array(Un),allowed_callback_urls:s.array(s.string()),allowed_logout_urls:s.array(s.string()),allowed_web_origins:s.array(s.string()),email_validation:s.union([s.literal("enabled"),s.literal("disabled"),s.literal("enforced")]),tenant_id:s.string(),client_secret:s.string(),disable_sign_ups:s.boolean(),tenant:s.object({name:s.string(),audience:s.string().optional(),logo:s.string().optional(),primary_color:s.string().optional(),secondary_color:s.string().optional(),sender_email:s.string(),sender_name:s.string(),support_url:s.string().optional(),language:s.string().length(2).optional()})}),Vn=pt.extend({connections:s.array(Le)}),Ln=pt.extend({connections:s.array(Le.partial())}),ht=s.object({domain:s.string(),dkim_private_key:s.string().optional(),dkim_public_key:s.string().optional(),email_api_key:s.string().optional(),email_service:s.enum(["mailgun","mailchannels"])}),zn=Me.extend({...ht.shape,id:s.string()}),ft=s.object({trigger_id:s.enum(["post-user-registration","post-user-login"]),enabled:s.boolean().default(!1),url:s.string(),hook_id:s.string().optional()}),Bn=ft.extend({...Me.shape,hook_id:s.string()}),mt=s.object({alg:s.string(),e:s.string(),kid:s.string(),kty:s.string(),n:s.string(),use:s.string().optional()}),Wn=s.object({keys:s.array(mt)}),Gn=s.object({issuer:s.string(),authorization_endpoint:s.string(),token_endpoint:s.string(),device_authorization_endpoint:s.string(),userinfo_endpoint:s.string(),mfa_challenge_endpoint:s.string(),jwks_uri:s.string(),registration_endpoint:s.string(),revocation_endpoint:s.string(),scopes_supported:s.array(s.string()),response_types_supported:s.array(s.string()),code_challenge_methods_supported:s.array(s.string()),response_modes_supported:s.array(s.string()),subject_types_supported:s.array(s.string()),id_token_signing_alg_values_supported:s.array(s.string()),token_endpoint_auth_methods_supported:s.array(s.string()),claims_supported:s.array(s.string()),request_uri_parameter_supported:s.boolean(),request_parameter_supported:s.boolean(),token_endpoint_auth_signing_alg_values_supported:s.array(s.string())}),gt=s.object({id:s.string(),tenant_id:s.string(),client_id:s.string(),email:s.string(),code:s.string(),ip:s.string().optional(),send:s.string().optional(),authParams:xe,expires_at:s.string(),used_at:s.string().optional(),user_id:s.string().optional()}),qn=s.object({created_at:s.string(),...gt.shape}),_t=s.object({session_id:s.string(),client_id:s.string(),expires_at:s.string(),used_at:s.string(),deleted_at:s.string().optional(),user_id:s.string()});s.object({created_at:s.string(),..._t.shape});const Hn=s.object({private_key:s.string(),public_key:s.string(),kid:s.string(),created_at:s.string(),revoked_at:s.string().optional()}),Kn=s.object({kid:s.string().openapi({description:"The key id of the signing key"}),cert:s.string().openapi({description:"The public certificate of the signing key"}),fingerprint:s.string().openapi({description:"The cert fingerprint"}),thumbprint:s.string().openapi({description:"The cert thumbprint"}),pkcs7:s.string().optional().openapi({description:"The public certificate of the signing key in pkcs7 format"}),current:s.boolean().optional().openapi({description:"True if the key is the current key"}),next:s.boolean().optional().openapi({description:"True if the key is the next key"}),previous:s.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:s.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:s.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:s.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:s.string().optional().openapi({description:"The date and time when the key was revoked"})}),yt=s.object({name:s.string(),audience:s.string(),sender_email:s.string().email(),sender_name:s.string(),support_url:s.string().url().optional(),logo:s.string().url().optional(),primary_color:s.string().optional(),secondary_color:s.string().optional(),language:s.string().optional()}),Yn=yt.extend({created_at:s.string().transform(t=>t===null?"":t),updated_at:s.string().transform(t=>t===null?"":t)}),Jn=s.object({logoUrl:s.string(),loginBackgroundImage:s.string().nullish(),style:s.object({primaryColor:s.string(),buttonTextColor:s.string(),primaryHoverColor:s.string()}),supportEmail:s.string().nullable(),supportUrl:s.string().nullable(),name:s.string(),showGreyishBackground:s.boolean().optional(),termsAndConditionsUrl:s.string().nullable(),companyName:s.string().optional(),checkoutHideSocial:s.boolean().optional(),siteUrl:s.string().nullable(),manageSubscriptionsUrl:s.string().optional()});var ze=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(ze||{});const Be=s.nativeEnum(ze),Fn=s.object({grant_type:Be.refine(t=>t==="authorization_code"),code:s.string(),client_secret:s.string(),client_id:s.string()}),Xn=s.object({grant_type:Be.refine(t=>t==="authorization_code"),code:s.string(),code_verifier:s.string(),client_id:s.string().optional(),redirect_uri:s.string()}),Qn=s.object({grant_type:Be.refine(t=>t==="client_credentials"),scope:s.string().optional(),client_secret:s.string(),client_id:s.string(),audience:s.string().optional()});s.object({access_token:s.string(),id_token:s.string().optional(),scope:s.string().optional(),state:s.string().optional(),refresh_token:s.string().optional(),token_type:s.string(),expires_in:s.number()});s.object({code:s.string(),state:s.string().optional()});const vt=s.object({id:s.string(),expires_at:s.string(),auth0Client:s.string().optional(),authParams:xe}),er=s.object({...vt.shape,created_at:s.string(),updated_at:s.string()}),tr="tmp";exports.Auth0Client=dt;exports.AuthorizationResponseMode=Ue;exports.AuthorizationResponseType=De;exports.ClientSchema=Vn;exports.CodeChallengeMethod=Ve;exports.GrantType=ze;exports.LogTypes=ct;exports.PartialClientSchema=Ln;exports.applicationInsertSchema=lt;exports.applicationSchema=Mn;exports.auth0UserResponseSchema=In;exports.authParamsSchema=xe;exports.authenticationCodeSchema=$n;exports.authorizationCodeGrantTypeParamsSchema=Fn;exports.baseUserSchema=$e;exports.brandingSchema=Dn;exports.certificateSchema=Hn;exports.clientCredentialGrantTypeParamsSchema=Qn;exports.connectionInsertSchema=ut;exports.connectionSchema=Le;exports.domainInsertSchema=ht;exports.domainSchema=zn;exports.hookInsertSchema=ft;exports.hookSchema=Bn;exports.jwksKeySchema=Wn;exports.jwksSchema=mt;exports.logSchema=Pn;exports.openIDConfigurationSchema=Gn;exports.otpInsertSchema=gt;exports.otpSchema=qn;exports.pkceAuthorizationCodeGrantTypeParamsSchema=Xn;exports.sessionInsertSchema=_t;exports.signingKeySchema=Kn;exports.tenantInsertSchema=yt;exports.tenantSchema=Yn;exports.tmp=tr;exports.totalsSchema=jn;exports.universalLoginSessionInsertSchema=vt;exports.universalLoginSessionSchema=er;exports.userInsertSchema=it;exports.userResponseSchema=Rn;exports.userSchema=ot;exports.vendorSettingsSchema=Jn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function wt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n}function Tt(t,e){var n;return((n=t==null?void 0:t._def)===null||n===void 0?void 0:n.typeName)===e}function J(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...r){const a=n.apply(this,r);return a._def.openapi=this._def.openapi,a}}function Ct(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(a,i){var o,c,u,l,m,x;const z=typeof a=="string"?i:a,B=z??{},{param:We}=B,kt=wt(B,["param"]),Ge=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof a=="string"?{refId:a}:void 0),qe=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),kt),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||We?{param:Object.assign(Object.assign({},(x=(m=this._def.openapi)===null||m===void 0?void 0:m.metadata)===null||x===void 0?void 0:x.param),We)}:void 0),He=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(Ge).length>0?{_internal:Ge}:void 0),Object.keys(qe).length>0?{metadata:qe}:void 0)}));if(Tt(this,"ZodObject")){const xt=this.extend;He.extend=function(...St){var Se,we,Te,Ce,Oe,Ee;const je=xt.apply(this,St);return je._def.openapi={_internal:{extendedFrom:!((we=(Se=this._def.openapi)===null||Se===void 0?void 0:Se._internal)===null||we===void 0)&&we.refId?{refId:(Ce=(Te=this._def.openapi)===null||Te===void 0?void 0:Te._internal)===null||Ce===void 0?void 0:Ce.refId,schema:this}:(Oe=this._def.openapi)===null||Oe===void 0?void 0:Oe._internal.extendedFrom},metadata:(Ee=je._def.openapi)===null||Ee===void 0?void 0:Ee.metadata},je}}return He},J(t,"optional"),J(t,"nullable"),J(t,"default"),J(t,"transform"),J(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const a=this._def.shape(),i=e.apply(this),o=i._def.shape();return Object.entries(o).forEach(([c,u])=>{var l,m;u._def.openapi=(m=(l=a[c])===null||l===void 0?void 0:l._def)===null||m===void 0?void 0:m.openapi}),i._def.openapi=void 0,i};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...a){const i=n.apply(this,a);return i._def.openapi=void 0,i};const r=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...a){const i=r.apply(this,a);return i._def.openapi=void 0,i}}new Set(".\\+*[^]$()");var b;(function(t){t.assertEqual=a=>a;function e(a){}t.assertIs=e;function n(a){throw new Error}t.assertNever=n,t.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),o={};for(const c of i)o[c]=a[c];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},t.find=(a,i)=>{for(const o of a)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(b||(b={}));var Ie;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ie||(Ie={}));const h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),A=t=>{switch(typeof t){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(t)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(t)?h.array:t===null?h.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?h.promise:typeof Map<"u"&&t instanceof Map?h.map:typeof Set<"u"&&t instanceof Set?h.set:typeof Date<"u"&&t instanceof Date?h.date:h.object;default:return h.unknown}},d=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ot=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class T extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let c=r,u=0;for(;u<o.path.length;){const l=o.path[u];u===o.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(n(o))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}};return a(this),r}static assert(e){if(!(e instanceof T))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}T.create=t=>new T(t);const H=(t,e)=>{let n;switch(t.code){case d.invalid_type:t.received===h.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,b.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${b.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${b.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:n="Invalid function arguments";break;case d.invalid_return_type:n="Invalid function return type";break;case d.invalid_date:n="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:b.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case d.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case d.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case d.custom:n="Invalid input";break;case d.invalid_intersection_types:n="Intersection results could not be merged";break;case d.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:n="Number must be finite";break;default:n=e.defaultError,b.assertNever(t)}return{message:n}};let Je=H;function Et(t){Je=t}function fe(){return Je}const me=t=>{const{data:e,path:n,errorMaps:r,issueData:a}=t,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let c="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...a,path:i,message:c}},jt=[];function p(t,e){const n=fe(),r=me({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===H?void 0:H].filter(a=>!!a)});t.common.issues.push(r)}class S{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if(a.status==="aborted")return _;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return S.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return _;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const _=Object.freeze({status:"aborted"}),G=t=>({status:"dirty",value:t}),w=t=>({status:"valid",value:t}),Ne=t=>t.status==="aborted",Re=t=>t.status==="dirty",Q=t=>t.status==="valid",ee=t=>typeof Promise<"u"&&t instanceof Promise;function ge(t,e,n,r){if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Fe(t,e,n,r,a){if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var f;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(f||(f={}));var F,X;class Z{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ke=(t,e)=>{if(Q(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new T(t.common.issues);return this._error=n,this._error}}};function y(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,c)=>{var u,l;const{message:m}=t;return o.code==="invalid_enum_value"?{message:m??c.defaultError}:typeof c.data>"u"?{message:(u=m??r)!==null&&u!==void 0?u:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(l=m??n)!==null&&l!==void 0?l:c.defaultError}},description:a}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return A(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ee(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},i=this._parseSync({data:e,path:a.path,parent:a});return Ke(a,i)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(ee(a)?a:Promise.resolve(a));return Ke(r,i)}refine(e,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=e(a),c=()=>i.addIssue({code:d.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new E({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return j.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this,this._def)}promise(){return Y.create(this,this._def)}or(e){return se.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new E({...y(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new le({...y(this._def),innerType:this,defaultValue:n,typeName:g.ZodDefault})}brand(){return new Pe({typeName:g.ZodBranded,type:this,...y(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ue({...y(this._def),innerType:this,catchValue:n,typeName:g.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return he.create(this,e)}readonly(){return pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zt=/^c[^\s-]{8,}$/i,It=/^[0-9a-z]+$/,Nt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Rt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,At=/^[a-z0-9_-]{21}$/i,Pt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Mt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ze;const Dt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ut=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Vt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Lt=new RegExp(`^${Xe}$`);function Qe(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function zt(t){return new RegExp(`^${Qe(t)}$`)}function et(t){let e=`${Xe}T${Qe(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Bt(t,e){return!!((e==="v4"||!e)&&Dt.test(t)||(e==="v6"||!e)&&Ut.test(t))}class C extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.string,received:i.parsedType}),_}const r=new S;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(a=this._getOrReturnCtx(e,a),o?p(a,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&p(a,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Mt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"email",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Ze||(Ze=new RegExp($t,"u")),Ze.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"emoji",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Rt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"uuid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")At.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"nanoid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Zt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")It.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid2",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Nt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ulid",code:d.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),p(a,{validation:"url",code:d.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"regex",code:d.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?et(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Lt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?zt(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Pt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"duration",code:d.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Bt(e.data,i.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ip",code:d.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Vt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64",code:d.invalid_string,message:i.message}),r.dirty()):b.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),{validation:n,code:d.invalid_string,...f.errToObj(r)})}_addCheck(e){return new C({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...f.errToObj(e)})}url(e){return this._addCheck({kind:"url",...f.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...f.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...f.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...f.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...f.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...f.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...f.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...f.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...f.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...f.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...f.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...f.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...f.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...f.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...f.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...f.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...f.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...f.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...f.errToObj(n)})}nonempty(e){return this.min(1,f.errToObj(e))}trim(){return new C({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}C.create=t=>{var e;return new C({checks:[],typeName:g.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};function Wt(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,i=parseInt(t.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}class P extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==h.number){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.number,received:i.parsedType}),_}let r;const a=new S;for(const i of this._def.checks)i.kind==="int"?b.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Wt(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_finite,message:i.message}),a.dirty()):b.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,f.toString(n))}gt(e,n){return this.setLimit("min",e,!1,f.toString(n))}lte(e,n){return this.setLimit("max",e,!0,f.toString(n))}lt(e,n){return this.setLimit("max",e,!1,f.toString(n))}setLimit(e,n,r,a){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:f.toString(a)}]})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:f.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:f.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}P.create=t=>new P({checks:[],typeName:g.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...y(t)});class M extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==h.bigint){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.bigint,received:i.parsedType}),_}let r;const a=new S;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):b.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,f.toString(n))}gt(e,n){return this.setLimit("min",e,!1,f.toString(n))}lte(e,n){return this.setLimit("max",e,!0,f.toString(n))}lt(e,n){return this.setLimit("max",e,!1,f.toString(n))}setLimit(e,n,r,a){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:f.toString(a)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}M.create=t=>{var e;return new M({checks:[],typeName:g.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};class te extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.boolean,received:r.parsedType}),_}return w(e.data)}}te.create=t=>new te({typeName:g.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...y(t)});class V extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_type,expected:h.date,received:i.parsedType}),_}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_date}),_}const r=new S;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):b.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:f.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:f.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}V.create=t=>new V({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:g.ZodDate,...y(t)});class _e extends v{_parse(e){if(this._getType(e)!==h.symbol){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.symbol,received:r.parsedType}),_}return w(e.data)}}_e.create=t=>new _e({typeName:g.ZodSymbol,...y(t)});class ne extends v{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.undefined,received:r.parsedType}),_}return w(e.data)}}ne.create=t=>new ne({typeName:g.ZodUndefined,...y(t)});class re extends v{_parse(e){if(this._getType(e)!==h.null){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.null,received:r.parsedType}),_}return w(e.data)}}re.create=t=>new re({typeName:g.ZodNull,...y(t)});class K extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}}K.create=t=>new K({typeName:g.ZodAny,...y(t)});class U extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}U.create=t=>new U({typeName:g.ZodUnknown,...y(t)});class R extends v{_parse(e){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:h.never,received:n.parsedType}),_}}R.create=t=>new R({typeName:g.ZodNever,...y(t)});class ye extends v{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.void,received:r.parsedType}),_}return w(e.data)}}ye.create=t=>new ye({typeName:g.ZodVoid,...y(t)});class O extends v{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==h.array)return p(n,{code:d.invalid_type,expected:h.array,received:n.parsedType}),_;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,c=n.data.length<a.exactLength.value;(o||c)&&(p(n,{code:o?d.too_big:d.too_small,minimum:c?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(p(n,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(p(n,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>a.type._parseAsync(new Z(n,o,n.path,c)))).then(o=>S.mergeArray(r,o));const i=[...n.data].map((o,c)=>a.type._parseSync(new Z(n,o,n.path,c)));return S.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new O({...this._def,minLength:{value:e,message:f.toString(n)}})}max(e,n){return new O({...this._def,maxLength:{value:e,message:f.toString(n)}})}length(e,n){return new O({...this._def,exactLength:{value:e,message:f.toString(n)}})}nonempty(e){return this.min(1,e)}}O.create=(t,e)=>new O({type:t,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...y(e)});function W(t){if(t instanceof k){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=j.create(W(r))}return new k({...t._def,shape:()=>e})}else return t instanceof O?new O({...t._def,type:W(t.element)}):t instanceof j?j.create(W(t.unwrap())):t instanceof D?D.create(W(t.unwrap())):t instanceof I?I.create(t.items.map(e=>W(e))):t}class k extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=b.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==h.object){const l=this._getOrReturnCtx(e);return p(l,{code:d.invalid_type,expected:h.object,received:l.parsedType}),_}const{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||c.push(l);const u=[];for(const l of o){const m=i[l],x=a.data[l];u.push({key:{status:"valid",value:l},value:m._parse(new Z(a,x,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof R){const l=this._def.unknownKeys;if(l==="passthrough")for(const m of c)u.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(l==="strict")c.length>0&&(p(a,{code:d.unrecognized_keys,keys:c}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const m of c){const x=a.data[m];u.push({key:{status:"valid",value:m},value:l._parse(new Z(a,x,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const m of u){const x=await m.key,z=await m.value;l.push({key:x,value:z,alwaysSet:m.alwaysSet})}return l}).then(l=>S.mergeObjectSync(r,l)):S.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var a,i,o,c;const u=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=f.errToObj(e).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:g.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const n={};return b.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new k({...this._def,shape:()=>n})}omit(e){const n={};return b.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new k({...this._def,shape:()=>n})}deepPartial(){return W(this)}partial(e){const n={};return b.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a.optional()}),new k({...this._def,shape:()=>n})}required(e){const n={};return b.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof j;)i=i._def.innerType;n[r]=i}}),new k({...this._def,shape:()=>n})}keyof(){return tt(b.objectKeys(this.shape))}}k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...y(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:g.ZodObject,...y(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...y(e)});class se extends v{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function a(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=i.map(c=>new T(c.ctx.common.issues));return p(n,{code:d.invalid_union,unionErrors:o}),_}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},m=u._parseSync({data:n.data,path:n.path,parent:l});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const c=o.map(u=>new T(u));return p(n,{code:d.invalid_union,unionErrors:c}),_}}get options(){return this._def.options}}se.create=(t,e)=>new se({options:t,typeName:g.ZodUnion,...y(e)});const N=t=>t instanceof oe?N(t.schema):t instanceof E?N(t.innerType()):t instanceof ce?[t.value]:t instanceof $?t.options:t instanceof de?b.objectValues(t.enum):t instanceof le?N(t._def.innerType):t instanceof ne?[void 0]:t instanceof re?[null]:t instanceof j?[void 0,...N(t.unwrap())]:t instanceof D?[null,...N(t.unwrap())]:t instanceof Pe||t instanceof pe?N(t.unwrap()):t instanceof ue?N(t._def.innerType):[];class ke extends v{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==h.object)return p(n,{code:d.invalid_type,expected:h.object,received:n.parsedType}),_;const r=this.discriminator,a=n.data[r],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const a=new Map;for(const i of n){const o=N(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(a.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);a.set(c,i)}}return new ke({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:a,...y(r)})}}function Ae(t,e){const n=A(t),r=A(e);if(t===e)return{valid:!0,data:t};if(n===h.object&&r===h.object){const a=b.objectKeys(e),i=b.objectKeys(t).filter(c=>a.indexOf(c)!==-1),o={...t,...e};for(const c of i){const u=Ae(t[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===h.array&&r===h.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const o=t[i],c=e[i],u=Ae(o,c);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return n===h.date&&r===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ae extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=(i,o)=>{if(Ne(i)||Ne(o))return _;const c=Ae(i.value,o.value);return c.valid?((Re(i)||Re(o))&&n.dirty(),{status:n.value,value:c.data}):(p(r,{code:d.invalid_intersection_types}),_)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ae.create=(t,e,n)=>new ae({left:t,right:e,typeName:g.ZodIntersection,...y(n)});class I extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return p(r,{code:d.invalid_type,expected:h.array,received:r.parsedType}),_;if(r.data.length<this._def.items.length)return p(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Z(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>S.mergeArray(n,o)):S.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new I({...this._def,rest:e})}}I.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:t,typeName:g.ZodTuple,rest:null,...y(e)})};class ie extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return p(r,{code:d.invalid_type,expected:h.object,received:r.parsedType}),_;const a=[],i=this._def.keyType,o=this._def.valueType;for(const c in r.data)a.push({key:i._parse(new Z(r,c,r.path,c)),value:o._parse(new Z(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?S.mergeObjectAsync(n,a):S.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof v?new ie({keyType:e,valueType:n,typeName:g.ZodRecord,...y(r)}):new ie({keyType:C.create(),valueType:e,typeName:g.ZodRecord,...y(n)})}}class ve extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return p(r,{code:d.invalid_type,expected:h.map,received:r.parsedType}),_;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([c,u],l)=>({key:a._parse(new Z(r,c,r.path,[l,"key"])),value:i._parse(new Z(r,u,r.path,[l,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,m=await u.value;if(l.status==="aborted"||m.status==="aborted")return _;(l.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(l.value,m.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const l=u.key,m=u.value;if(l.status==="aborted"||m.status==="aborted")return _;(l.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(l.value,m.value)}return{status:n.value,value:c}}}}ve.create=(t,e,n)=>new ve({valueType:e,keyType:t,typeName:g.ZodMap,...y(n)});class L extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return p(r,{code:d.invalid_type,expected:h.set,received:r.parsedType}),_;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(p(r,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(p(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const l=new Set;for(const m of u){if(m.status==="aborted")return _;m.status==="dirty"&&n.dirty(),l.add(m.value)}return{status:n.value,value:l}}const c=[...r.data.values()].map((u,l)=>i._parse(new Z(r,u,r.path,l)));return r.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new L({...this._def,minSize:{value:e,message:f.toString(n)}})}max(e,n){return new L({...this._def,maxSize:{value:e,message:f.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}L.create=(t,e)=>new L({valueType:t,minSize:null,maxSize:null,typeName:g.ZodSet,...y(e)});class q extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==h.function)return p(n,{code:d.invalid_type,expected:h.function,received:n.parsedType}),_;function r(c,u){return me({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fe(),H].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function a(c,u){return me({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fe(),H].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Y){const c=this;return w(async function(...u){const l=new T([]),m=await c._def.args.parseAsync(u,i).catch(B=>{throw l.addIssue(r(u,B)),l}),x=await Reflect.apply(o,this,m);return await c._def.returns._def.type.parseAsync(x,i).catch(B=>{throw l.addIssue(a(x,B)),l})})}else{const c=this;return w(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new T([r(u,l.error)]);const m=Reflect.apply(o,this,l.data),x=c._def.returns.safeParse(m,i);if(!x.success)throw new T([a(m,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new q({...this._def,args:I.create(e).rest(U.create())})}returns(e){return new q({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new q({args:e||I.create([]).rest(U.create()),returns:n||U.create(),typeName:g.ZodFunction,...y(r)})}}class oe extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}oe.create=(t,e)=>new oe({getter:t,typeName:g.ZodLazy,...y(e)});class ce extends v{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}ce.create=(t,e)=>new ce({value:t,typeName:g.ZodLiteral,...y(e)});function tt(t,e){return new $({values:t,typeName:g.ZodEnum,...y(e)})}class $ extends v{constructor(){super(...arguments),F.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:b.joinValues(r),received:n.parsedType,code:d.invalid_type}),_}if(ge(this,F)||Fe(this,F,new Set(this._def.values)),!ge(this,F).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:r}),_}return w(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return $.create(e,{...this._def,...n})}exclude(e,n=this._def){return $.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}F=new WeakMap;$.create=tt;class de extends v{constructor(){super(...arguments),X.set(this,void 0)}_parse(e){const n=b.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){const a=b.objectValues(n);return p(r,{expected:b.joinValues(a),received:r.parsedType,code:d.invalid_type}),_}if(ge(this,X)||Fe(this,X,new Set(b.getValidEnumValues(this._def.values))),!ge(this,X).has(e.data)){const a=b.objectValues(n);return p(r,{received:r.data,code:d.invalid_enum_value,options:a}),_}return w(e.data)}get enum(){return this._def.values}}X=new WeakMap;de.create=(t,e)=>new de({values:t,typeName:g.ZodNativeEnum,...y(e)});class Y extends v{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==h.promise&&n.common.async===!1)return p(n,{code:d.invalid_type,expected:h.promise,received:n.parsedType}),_;const r=n.parsedType===h.promise?n.data:Promise.resolve(n.data);return w(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Y.create=(t,e)=>new Y({type:t,typeName:g.ZodPromise,...y(e)});class E extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{p(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return _;const u=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return u.status==="aborted"?_:u.status==="dirty"||n.value==="dirty"?G(u.value):u});{if(n.value==="aborted")return _;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?_:c.status==="dirty"||n.value==="dirty"?G(c.value):c}}if(a.type==="refinement"){const o=c=>{const u=a.refinement(c,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?_:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?_:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Q(o))return o;const c=a.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Q(o)?Promise.resolve(a.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);b.assertNever(a)}}E.create=(t,e,n)=>new E({schema:t,typeName:g.ZodEffects,effect:e,...y(n)});E.createWithPreprocess=(t,e,n)=>new E({schema:e,effect:{type:"preprocess",transform:t},typeName:g.ZodEffects,...y(n)});class j extends v{_parse(e){return this._getType(e)===h.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(t,e)=>new j({innerType:t,typeName:g.ZodOptional,...y(e)});class D extends v{_parse(e){return this._getType(e)===h.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(t,e)=>new D({innerType:t,typeName:g.ZodNullable,...y(e)});class le extends v{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}le.create=(t,e)=>new le({innerType:t,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ue extends v{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ee(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ue.create=(t,e)=>new ue({innerType:t,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class be extends v{_parse(e){if(this._getType(e)!==h.nan){const r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:h.nan,received:r.parsedType}),_}return{status:"valid",value:e.data}}}be.create=t=>new be({typeName:g.ZodNaN,...y(t)});const Gt=Symbol("zod_brand");class Pe extends v{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class he extends v{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_:i.status==="dirty"?(n.dirty(),G(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new he({in:e,out:n,typeName:g.ZodPipeline})}}class pe extends v{_parse(e){const n=this._def.innerType._parse(e),r=a=>(Q(a)&&(a.value=Object.freeze(a.value)),a);return ee(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:g.ZodReadonly,...y(e)});function nt(t,e={},n){return t?K.create().superRefine((r,a)=>{var i,o;if(!t(r)){const c=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,u=(o=(i=c.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,l=typeof c=="string"?{message:c}:c;a.addIssue({code:"custom",...l,fatal:u})}}):K.create()}const qt={object:k.lazycreate};var g;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(g||(g={}));const Ht=(t,e={message:`Input not instance of ${t.name}`})=>nt(n=>n instanceof t,e),rt=C.create,st=P.create,Kt=be.create,Yt=M.create,at=te.create,Jt=V.create,Ft=_e.create,Xt=ne.create,Qt=re.create,en=K.create,tn=U.create,nn=R.create,rn=ye.create,sn=O.create,an=k.create,on=k.strictCreate,cn=se.create,dn=ke.create,ln=ae.create,un=I.create,pn=ie.create,hn=ve.create,fn=L.create,mn=q.create,gn=oe.create,_n=ce.create,yn=$.create,vn=de.create,bn=Y.create,Ye=E.create,kn=j.create,xn=D.create,Sn=E.createWithPreprocess,wn=he.create,Tn=()=>rt().optional(),Cn=()=>st().optional(),On=()=>at().optional(),En={string:t=>C.create({...t,coerce:!0}),number:t=>P.create({...t,coerce:!0}),boolean:t=>te.create({...t,coerce:!0}),bigint:t=>M.create({...t,coerce:!0}),date:t=>V.create({...t,coerce:!0})},jn=_;var s=Object.freeze({__proto__:null,defaultErrorMap:H,setErrorMap:Et,getErrorMap:fe,makeIssue:me,EMPTY_PATH:jt,addIssueToContext:p,ParseStatus:S,INVALID:_,DIRTY:G,OK:w,isAborted:Ne,isDirty:Re,isValid:Q,isAsync:ee,get util(){return b},get objectUtil(){return Ie},ZodParsedType:h,getParsedType:A,ZodType:v,datetimeRegex:et,ZodString:C,ZodNumber:P,ZodBigInt:M,ZodBoolean:te,ZodDate:V,ZodSymbol:_e,ZodUndefined:ne,ZodNull:re,ZodAny:K,ZodUnknown:U,ZodNever:R,ZodVoid:ye,ZodArray:O,ZodObject:k,ZodUnion:se,ZodDiscriminatedUnion:ke,ZodIntersection:ae,ZodTuple:I,ZodRecord:ie,ZodMap:ve,ZodSet:L,ZodFunction:q,ZodLazy:oe,ZodLiteral:ce,ZodEnum:$,ZodNativeEnum:de,ZodPromise:Y,ZodEffects:E,ZodTransformer:E,ZodOptional:j,ZodNullable:D,ZodDefault:le,ZodCatch:ue,ZodNaN:be,BRAND:Gt,ZodBranded:Pe,ZodPipeline:he,ZodReadonly:pe,custom:nt,Schema:v,ZodSchema:v,late:qt,get ZodFirstPartyTypeKind(){return g},coerce:En,any:en,array:sn,bigint:Yt,boolean:at,date:Jt,discriminatedUnion:dn,effect:Ye,enum:yn,function:mn,instanceof:Ht,intersection:ln,lazy:gn,literal:_n,map:hn,nan:Kt,nativeEnum:vn,never:nn,null:Qt,nullable:xn,number:st,object:an,oboolean:On,onumber:Cn,optional:kn,ostring:Tn,pipeline:wn,preprocess:Sn,promise:bn,record:pn,set:fn,strictObject:on,string:rt,symbol:Ft,transformer:Ye,tuple:un,undefined:Xt,union:cn,unknown:tn,void:rn,NEVER:jn,ZodIssueCode:d,quotelessJson:Ot,ZodError:T});Ct(s);const Zn=s.object({start:s.number(),limit:s.number(),length:s.number()}),Me=s.object({created_at:s.string(),updated_at:s.string()}),In=s.object({email:s.string().optional(),email_verified:s.boolean().optional(),name:s.string().optional(),username:s.string().optional(),given_name:s.string().optional(),phone_number:s.string().optional(),phone_verified:s.boolean().optional(),family_name:s.string().optional()}).catchall(s.any()),Nn=s.object({connection:s.string(),user_id:s.string(),provider:s.string(),isSocial:s.boolean(),access_token:s.string().optional(),access_token_secret:s.string().optional(),refresh_token:s.string().optional(),profileData:In.optional()}),$e=s.object({email:s.string().optional(),username:s.string().optional(),given_name:s.string().optional(),family_name:s.string().optional(),nickname:s.string().optional(),name:s.string().optional(),picture:s.string().optional(),locale:s.string().optional(),linked_to:s.string().optional(),profileData:s.string().optional(),user_id:s.string().optional()}),it=$e.extend({email_verified:s.boolean().default(!1),verify_email:s.boolean().optional(),last_ip:s.string().optional(),last_login:s.string().optional(),user_id:s.string().optional(),provider:s.string().default("email"),connection:s.string().default("email")}),ot=it.extend(Me.shape).extend({user_id:s.string(),email:s.string(),is_social:s.boolean(),login_count:s.number(),identities:s.array(Nn).optional()}),Rn=ot,An=$e.extend({email:s.string(),login_count:s.number(),multifactor:s.array(s.string()).optional(),last_ip:s.string().optional(),last_login:s.string().optional(),user_id:s.string()}).catchall(s.any());var ct=(t=>(t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_SILENT_AUTH="ssa",t.FAILED_SILENT_AUTH="fsa",t.SUCCESS_SIGNUP="ss",t.FAILED_SIGNUP="fs",t.SUCCESS_LOGIN="s",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.SUCCESS_LOGOUT="slo",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.CODE_LINK_SENT="cls",t.NOT_IMPLEMENTED_1="seccft",t))(ct||{});const Pn=s.enum(["sapi","ssa","fsa","ss","ssa","fs","s","f","fp","slo","scoa","fcoa","seccft","cls","seacft","serft"]),dt=s.object({name:s.string(),version:s.string(),env:s.object({node:s.string().optional()}).optional()}),Mn=s.object({type:Pn,date:s.string(),description:s.string().optional(),log_id:s.string().optional(),_id:s.string().optional(),ip:s.string(),user_agent:s.string(),details:s.any().optional(),isMobile:s.boolean(),user_id:s.string().optional(),user_name:s.string().optional(),connection:s.string().optional(),connection_id:s.string().optional(),client_id:s.string().optional(),client_name:s.string().optional(),audience:s.string().optional(),scope:s.array(s.string()).optional(),strategy:s.string().optional(),strategy_type:s.string().optional(),hostname:s.string().optional(),auth0_client:dt.optional()}),lt=s.object({id:s.string(),name:s.string(),allowed_web_origins:s.string().transform(t=>t===null?"":t).default(""),allowed_callback_urls:s.string().transform(t=>t===null?"":t).default(""),allowed_logout_urls:s.string().transform(t=>t===null?"":t).default(""),email_validation:s.enum(["enabled","disabled","enforced"]).default("enforced"),client_secret:s.string().default(""),disable_sign_ups:s.boolean().default(!1)}),$n=s.object({created_at:s.string().transform(t=>t===null?"":t),updated_at:s.string().transform(t=>t===null?"":t)}).extend(lt.shape);var De=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(De||{}),Ue=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t))(Ue||{}),Ve=(t=>(t.S265="S256",t.plain="plain",t))(Ve||{});const xe=s.object({client_id:s.string(),vendor_id:s.string().optional(),response_type:s.nativeEnum(De).optional(),response_mode:s.nativeEnum(Ue).optional(),redirect_uri:s.string().optional(),audience:s.string().optional(),state:s.string().optional(),nonce:s.string().optional(),scope:s.string().optional(),code_challenge_method:s.nativeEnum(Ve).optional(),code_challenge:s.string().optional(),username:s.string().optional()}),ut=s.object({authParams:xe,code:s.string(),user_id:s.string(),created_at:s.string(),expires_at:s.string(),used_at:s.string().optional()}),Dn=s.object({...ut.shape,created_at:s.string()}),Un=s.object({colors:s.object({primary:s.string(),page_background:s.object({type:s.string().optional(),start:s.string().optional(),end:s.string().optional(),angle_deg:s.number().optional()}).optional()}).optional(),logo_url:s.string().optional(),favicon_url:s.string().optional(),font:s.object({url:s.string()}).optional()}),pt=s.object({id:s.string().optional(),name:s.string(),client_id:s.string().optional(),client_secret:s.string().optional(),authorization_endpoint:s.string().optional(),response_type:s.custom().optional(),response_mode:s.custom().optional(),private_key:s.string().optional(),kid:s.string().optional(),team_id:s.string().optional(),token_endpoint:s.string().optional(),token_exchange_basic_auth:s.boolean().optional(),userinfo_endpoint:s.string().optional(),scope:s.string().optional()}),Le=s.object({id:s.string(),created_at:s.string().transform(t=>t===null?"":t),updated_at:s.string().transform(t=>t===null?"":t)}).extend(pt.shape),Vn=s.object({domain:s.string(),dkim_private_key:s.string().optional(),dkim_public_key:s.string().optional(),email_api_key:s.string().optional(),email_service:s.union([s.literal("mailgun"),s.literal("mailchannels")]).optional()}),ht=s.object({id:s.string(),name:s.string(),domains:s.array(Vn),allowed_callback_urls:s.array(s.string()),allowed_logout_urls:s.array(s.string()),allowed_web_origins:s.array(s.string()),email_validation:s.union([s.literal("enabled"),s.literal("disabled"),s.literal("enforced")]),tenant_id:s.string(),client_secret:s.string(),disable_sign_ups:s.boolean(),tenant:s.object({name:s.string(),audience:s.string().optional(),logo:s.string().optional(),primary_color:s.string().optional(),secondary_color:s.string().optional(),sender_email:s.string(),sender_name:s.string(),support_url:s.string().optional(),language:s.string().length(2).optional()})}),Ln=ht.extend({connections:s.array(Le)}),zn=ht.extend({connections:s.array(Le.partial())}),ft=s.object({domain:s.string(),dkim_private_key:s.string().optional(),dkim_public_key:s.string().optional(),email_api_key:s.string().optional(),email_service:s.enum(["mailgun","mailchannels"])}),Bn=Me.extend({...ft.shape,id:s.string()}),mt=s.object({trigger_id:s.enum(["post-user-registration","post-user-login"]),enabled:s.boolean().default(!1),url:s.string(),hook_id:s.string().optional()}),Wn=mt.extend({...Me.shape,hook_id:s.string()}),gt=s.object({alg:s.string(),e:s.string(),kid:s.string(),kty:s.string(),n:s.string(),use:s.string().optional()}),Gn=s.object({keys:s.array(gt)}),qn=s.object({issuer:s.string(),authorization_endpoint:s.string(),token_endpoint:s.string(),device_authorization_endpoint:s.string(),userinfo_endpoint:s.string(),mfa_challenge_endpoint:s.string(),jwks_uri:s.string(),registration_endpoint:s.string(),revocation_endpoint:s.string(),scopes_supported:s.array(s.string()),response_types_supported:s.array(s.string()),code_challenge_methods_supported:s.array(s.string()),response_modes_supported:s.array(s.string()),subject_types_supported:s.array(s.string()),id_token_signing_alg_values_supported:s.array(s.string()),token_endpoint_auth_methods_supported:s.array(s.string()),claims_supported:s.array(s.string()),request_uri_parameter_supported:s.boolean(),request_parameter_supported:s.boolean(),token_endpoint_auth_signing_alg_values_supported:s.array(s.string())}),_t=s.object({id:s.string(),email:s.string(),code:s.string(),ip:s.string().optional(),send:s.enum(["email","link"]),authParams:xe,expires_at:s.string(),used_at:s.string().optional(),user_id:s.string().optional()}),Hn=s.object({created_at:s.string(),..._t.shape}),yt=s.object({session_id:s.string(),client_id:s.string(),expires_at:s.string(),used_at:s.string(),deleted_at:s.string().optional(),user_id:s.string()}),Kn=s.object({created_at:s.string(),...yt.shape}),Yn=s.object({private_key:s.string(),public_key:s.string(),kid:s.string(),created_at:s.string(),revoked_at:s.string().optional()}),Jn=s.object({kid:s.string().openapi({description:"The key id of the signing key"}),cert:s.string().openapi({description:"The public certificate of the signing key"}),fingerprint:s.string().openapi({description:"The cert fingerprint"}),thumbprint:s.string().openapi({description:"The cert thumbprint"}),pkcs7:s.string().optional().openapi({description:"The public certificate of the signing key in pkcs7 format"}),current:s.boolean().optional().openapi({description:"True if the key is the current key"}),next:s.boolean().optional().openapi({description:"True if the key is the next key"}),previous:s.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:s.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:s.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:s.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:s.string().optional().openapi({description:"The date and time when the key was revoked"})}),vt=s.object({name:s.string(),audience:s.string(),sender_email:s.string().email(),sender_name:s.string(),support_url:s.string().url().optional(),logo:s.string().url().optional(),primary_color:s.string().optional(),secondary_color:s.string().optional(),language:s.string().optional()}),Fn=vt.extend({created_at:s.string().transform(t=>t===null?"":t),updated_at:s.string().transform(t=>t===null?"":t)}),Xn=s.object({logoUrl:s.string(),loginBackgroundImage:s.string().nullish(),style:s.object({primaryColor:s.string(),buttonTextColor:s.string(),primaryHoverColor:s.string()}),supportEmail:s.string().nullable(),supportUrl:s.string().nullable(),name:s.string(),showGreyishBackground:s.boolean().optional(),termsAndConditionsUrl:s.string().nullable(),companyName:s.string().optional(),checkoutHideSocial:s.boolean().optional(),siteUrl:s.string().nullable(),manageSubscriptionsUrl:s.string().optional()});var ze=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(ze||{});const Be=s.nativeEnum(ze),Qn=s.object({grant_type:Be.refine(t=>t==="authorization_code"),code:s.string(),client_secret:s.string(),client_id:s.string()}),er=s.object({grant_type:Be.refine(t=>t==="authorization_code"),code:s.string(),code_verifier:s.string(),client_id:s.string().optional(),redirect_uri:s.string()}),tr=s.object({grant_type:Be.refine(t=>t==="client_credentials"),scope:s.string().optional(),client_secret:s.string(),client_id:s.string(),audience:s.string().optional()});s.object({access_token:s.string(),id_token:s.string().optional(),scope:s.string().optional(),state:s.string().optional(),refresh_token:s.string().optional(),token_type:s.string(),expires_in:s.number()});s.object({code:s.string(),state:s.string().optional()});const bt=s.object({id:s.string(),expires_at:s.string(),auth0Client:s.string().optional(),authParams:xe}),nr=s.object({...bt.shape,created_at:s.string(),updated_at:s.string()}),rr="tmp";exports.Auth0Client=dt;exports.AuthorizationResponseMode=Ue;exports.AuthorizationResponseType=De;exports.ClientSchema=Ln;exports.CodeChallengeMethod=Ve;exports.GrantType=ze;exports.LogTypes=ct;exports.PartialClientSchema=zn;exports.applicationInsertSchema=lt;exports.applicationSchema=$n;exports.auth0UserResponseSchema=Rn;exports.authParamsSchema=xe;exports.authenticationCodeInsertSchema=ut;exports.authenticationCodeSchema=Dn;exports.authorizationCodeGrantTypeParamsSchema=Qn;exports.baseUserSchema=$e;exports.brandingSchema=Un;exports.certificateSchema=Yn;exports.clientCredentialGrantTypeParamsSchema=tr;exports.connectionInsertSchema=pt;exports.connectionSchema=Le;exports.domainInsertSchema=ft;exports.domainSchema=Bn;exports.hookInsertSchema=mt;exports.hookSchema=Wn;exports.jwksKeySchema=Gn;exports.jwksSchema=gt;exports.logSchema=Mn;exports.openIDConfigurationSchema=qn;exports.otpInsertSchema=_t;exports.otpSchema=Hn;exports.pkceAuthorizationCodeGrantTypeParamsSchema=er;exports.sessionInsertSchema=yt;exports.sessionSchema=Kn;exports.signingKeySchema=Jn;exports.tenantInsertSchema=vt;exports.tenantSchema=Fn;exports.tmp=rr;exports.totalsSchema=Zn;exports.universalLoginSessionInsertSchema=bt;exports.universalLoginSessionSchema=nr;exports.userInsertSchema=it;exports.userResponseSchema=An;exports.userSchema=ot;exports.vendorSettingsSchema=Xn;
|
|
@@ -861,7 +861,7 @@ export declare const authParamsSchema: z.ZodObject<{
|
|
|
861
861
|
code_challenge?: string | undefined;
|
|
862
862
|
}>;
|
|
863
863
|
export type AuthParams = z.infer<typeof authParamsSchema>;
|
|
864
|
-
export declare const
|
|
864
|
+
export declare const authenticationCodeInsertSchema: z.ZodObject<{
|
|
865
865
|
authParams: z.ZodObject<{
|
|
866
866
|
client_id: z.ZodString;
|
|
867
867
|
vendor_id: z.ZodOptional<z.ZodString>;
|
|
@@ -902,7 +902,6 @@ export declare const authenticationCodeSchema: z.ZodObject<{
|
|
|
902
902
|
code_challenge_method?: CodeChallengeMethod | undefined;
|
|
903
903
|
code_challenge?: string | undefined;
|
|
904
904
|
}>;
|
|
905
|
-
nonce: z.ZodOptional<z.ZodString>;
|
|
906
905
|
code: z.ZodString;
|
|
907
906
|
user_id: z.ZodString;
|
|
908
907
|
created_at: z.ZodString;
|
|
@@ -927,7 +926,6 @@ export declare const authenticationCodeSchema: z.ZodObject<{
|
|
|
927
926
|
code_challenge?: string | undefined;
|
|
928
927
|
};
|
|
929
928
|
expires_at: string;
|
|
930
|
-
nonce?: string | undefined;
|
|
931
929
|
used_at?: string | undefined;
|
|
932
930
|
}, {
|
|
933
931
|
code: string;
|
|
@@ -948,7 +946,94 @@ export declare const authenticationCodeSchema: z.ZodObject<{
|
|
|
948
946
|
code_challenge?: string | undefined;
|
|
949
947
|
};
|
|
950
948
|
expires_at: string;
|
|
951
|
-
|
|
949
|
+
used_at?: string | undefined;
|
|
950
|
+
}>;
|
|
951
|
+
export type AuthenticationCodeInsert = z.infer<typeof authenticationCodeInsertSchema>;
|
|
952
|
+
export declare const authenticationCodeSchema: z.ZodObject<{
|
|
953
|
+
created_at: z.ZodString;
|
|
954
|
+
authParams: z.ZodObject<{
|
|
955
|
+
client_id: z.ZodString;
|
|
956
|
+
vendor_id: z.ZodOptional<z.ZodString>;
|
|
957
|
+
response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
|
|
958
|
+
response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
|
|
959
|
+
redirect_uri: z.ZodOptional<z.ZodString>;
|
|
960
|
+
audience: z.ZodOptional<z.ZodString>;
|
|
961
|
+
state: z.ZodOptional<z.ZodString>;
|
|
962
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
963
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
964
|
+
code_challenge_method: z.ZodOptional<z.ZodNativeEnum<typeof CodeChallengeMethod>>;
|
|
965
|
+
code_challenge: z.ZodOptional<z.ZodString>;
|
|
966
|
+
username: z.ZodOptional<z.ZodString>;
|
|
967
|
+
}, "strip", z.ZodTypeAny, {
|
|
968
|
+
client_id: string;
|
|
969
|
+
username?: string | undefined;
|
|
970
|
+
audience?: string | undefined;
|
|
971
|
+
scope?: string | undefined;
|
|
972
|
+
vendor_id?: string | undefined;
|
|
973
|
+
response_type?: AuthorizationResponseType | undefined;
|
|
974
|
+
response_mode?: AuthorizationResponseMode | undefined;
|
|
975
|
+
redirect_uri?: string | undefined;
|
|
976
|
+
state?: string | undefined;
|
|
977
|
+
nonce?: string | undefined;
|
|
978
|
+
code_challenge_method?: CodeChallengeMethod | undefined;
|
|
979
|
+
code_challenge?: string | undefined;
|
|
980
|
+
}, {
|
|
981
|
+
client_id: string;
|
|
982
|
+
username?: string | undefined;
|
|
983
|
+
audience?: string | undefined;
|
|
984
|
+
scope?: string | undefined;
|
|
985
|
+
vendor_id?: string | undefined;
|
|
986
|
+
response_type?: AuthorizationResponseType | undefined;
|
|
987
|
+
response_mode?: AuthorizationResponseMode | undefined;
|
|
988
|
+
redirect_uri?: string | undefined;
|
|
989
|
+
state?: string | undefined;
|
|
990
|
+
nonce?: string | undefined;
|
|
991
|
+
code_challenge_method?: CodeChallengeMethod | undefined;
|
|
992
|
+
code_challenge?: string | undefined;
|
|
993
|
+
}>;
|
|
994
|
+
code: z.ZodString;
|
|
995
|
+
user_id: z.ZodString;
|
|
996
|
+
expires_at: z.ZodString;
|
|
997
|
+
used_at: z.ZodOptional<z.ZodString>;
|
|
998
|
+
}, "strip", z.ZodTypeAny, {
|
|
999
|
+
code: string;
|
|
1000
|
+
created_at: string;
|
|
1001
|
+
user_id: string;
|
|
1002
|
+
authParams: {
|
|
1003
|
+
client_id: string;
|
|
1004
|
+
username?: string | undefined;
|
|
1005
|
+
audience?: string | undefined;
|
|
1006
|
+
scope?: string | undefined;
|
|
1007
|
+
vendor_id?: string | undefined;
|
|
1008
|
+
response_type?: AuthorizationResponseType | undefined;
|
|
1009
|
+
response_mode?: AuthorizationResponseMode | undefined;
|
|
1010
|
+
redirect_uri?: string | undefined;
|
|
1011
|
+
state?: string | undefined;
|
|
1012
|
+
nonce?: string | undefined;
|
|
1013
|
+
code_challenge_method?: CodeChallengeMethod | undefined;
|
|
1014
|
+
code_challenge?: string | undefined;
|
|
1015
|
+
};
|
|
1016
|
+
expires_at: string;
|
|
1017
|
+
used_at?: string | undefined;
|
|
1018
|
+
}, {
|
|
1019
|
+
code: string;
|
|
1020
|
+
created_at: string;
|
|
1021
|
+
user_id: string;
|
|
1022
|
+
authParams: {
|
|
1023
|
+
client_id: string;
|
|
1024
|
+
username?: string | undefined;
|
|
1025
|
+
audience?: string | undefined;
|
|
1026
|
+
scope?: string | undefined;
|
|
1027
|
+
vendor_id?: string | undefined;
|
|
1028
|
+
response_type?: AuthorizationResponseType | undefined;
|
|
1029
|
+
response_mode?: AuthorizationResponseMode | undefined;
|
|
1030
|
+
redirect_uri?: string | undefined;
|
|
1031
|
+
state?: string | undefined;
|
|
1032
|
+
nonce?: string | undefined;
|
|
1033
|
+
code_challenge_method?: CodeChallengeMethod | undefined;
|
|
1034
|
+
code_challenge?: string | undefined;
|
|
1035
|
+
};
|
|
1036
|
+
expires_at: string;
|
|
952
1037
|
used_at?: string | undefined;
|
|
953
1038
|
}>;
|
|
954
1039
|
export type AuthenticationCode = z.infer<typeof authenticationCodeSchema>;
|
|
@@ -1810,12 +1895,13 @@ export interface LoginState {
|
|
|
1810
1895
|
}
|
|
1811
1896
|
export declare const otpInsertSchema: z.ZodObject<{
|
|
1812
1897
|
id: z.ZodString;
|
|
1813
|
-
tenant_id: z.ZodString;
|
|
1814
|
-
client_id: z.ZodString;
|
|
1815
1898
|
email: z.ZodString;
|
|
1816
1899
|
code: z.ZodString;
|
|
1817
1900
|
ip: z.ZodOptional<z.ZodString>;
|
|
1818
|
-
send: z.
|
|
1901
|
+
send: z.ZodEnum<[
|
|
1902
|
+
"email",
|
|
1903
|
+
"link"
|
|
1904
|
+
]>;
|
|
1819
1905
|
authParams: z.ZodObject<{
|
|
1820
1906
|
client_id: z.ZodString;
|
|
1821
1907
|
vendor_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1862,7 +1948,6 @@ export declare const otpInsertSchema: z.ZodObject<{
|
|
|
1862
1948
|
}, "strip", z.ZodTypeAny, {
|
|
1863
1949
|
code: string;
|
|
1864
1950
|
email: string;
|
|
1865
|
-
client_id: string;
|
|
1866
1951
|
id: string;
|
|
1867
1952
|
authParams: {
|
|
1868
1953
|
client_id: string;
|
|
@@ -1879,15 +1964,13 @@ export declare const otpInsertSchema: z.ZodObject<{
|
|
|
1879
1964
|
code_challenge?: string | undefined;
|
|
1880
1965
|
};
|
|
1881
1966
|
expires_at: string;
|
|
1882
|
-
|
|
1967
|
+
send: "email" | "link";
|
|
1883
1968
|
user_id?: string | undefined;
|
|
1884
1969
|
ip?: string | undefined;
|
|
1885
1970
|
used_at?: string | undefined;
|
|
1886
|
-
send?: string | undefined;
|
|
1887
1971
|
}, {
|
|
1888
1972
|
code: string;
|
|
1889
1973
|
email: string;
|
|
1890
|
-
client_id: string;
|
|
1891
1974
|
id: string;
|
|
1892
1975
|
authParams: {
|
|
1893
1976
|
client_id: string;
|
|
@@ -1904,21 +1987,21 @@ export declare const otpInsertSchema: z.ZodObject<{
|
|
|
1904
1987
|
code_challenge?: string | undefined;
|
|
1905
1988
|
};
|
|
1906
1989
|
expires_at: string;
|
|
1907
|
-
|
|
1990
|
+
send: "email" | "link";
|
|
1908
1991
|
user_id?: string | undefined;
|
|
1909
1992
|
ip?: string | undefined;
|
|
1910
1993
|
used_at?: string | undefined;
|
|
1911
|
-
send?: string | undefined;
|
|
1912
1994
|
}>;
|
|
1913
1995
|
export type OTPInsert = z.infer<typeof otpInsertSchema>;
|
|
1914
1996
|
export declare const otpSchema: z.ZodObject<{
|
|
1915
1997
|
id: z.ZodString;
|
|
1916
|
-
tenant_id: z.ZodString;
|
|
1917
|
-
client_id: z.ZodString;
|
|
1918
1998
|
email: z.ZodString;
|
|
1919
1999
|
code: z.ZodString;
|
|
1920
2000
|
ip: z.ZodOptional<z.ZodString>;
|
|
1921
|
-
send: z.
|
|
2001
|
+
send: z.ZodEnum<[
|
|
2002
|
+
"email",
|
|
2003
|
+
"link"
|
|
2004
|
+
]>;
|
|
1922
2005
|
authParams: z.ZodObject<{
|
|
1923
2006
|
client_id: z.ZodString;
|
|
1924
2007
|
vendor_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1967,7 +2050,6 @@ export declare const otpSchema: z.ZodObject<{
|
|
|
1967
2050
|
code: string;
|
|
1968
2051
|
created_at: string;
|
|
1969
2052
|
email: string;
|
|
1970
|
-
client_id: string;
|
|
1971
2053
|
id: string;
|
|
1972
2054
|
authParams: {
|
|
1973
2055
|
client_id: string;
|
|
@@ -1984,16 +2066,14 @@ export declare const otpSchema: z.ZodObject<{
|
|
|
1984
2066
|
code_challenge?: string | undefined;
|
|
1985
2067
|
};
|
|
1986
2068
|
expires_at: string;
|
|
1987
|
-
|
|
2069
|
+
send: "email" | "link";
|
|
1988
2070
|
user_id?: string | undefined;
|
|
1989
2071
|
ip?: string | undefined;
|
|
1990
2072
|
used_at?: string | undefined;
|
|
1991
|
-
send?: string | undefined;
|
|
1992
2073
|
}, {
|
|
1993
2074
|
code: string;
|
|
1994
2075
|
created_at: string;
|
|
1995
2076
|
email: string;
|
|
1996
|
-
client_id: string;
|
|
1997
2077
|
id: string;
|
|
1998
2078
|
authParams: {
|
|
1999
2079
|
client_id: string;
|
|
@@ -2010,11 +2090,10 @@ export declare const otpSchema: z.ZodObject<{
|
|
|
2010
2090
|
code_challenge?: string | undefined;
|
|
2011
2091
|
};
|
|
2012
2092
|
expires_at: string;
|
|
2013
|
-
|
|
2093
|
+
send: "email" | "link";
|
|
2014
2094
|
user_id?: string | undefined;
|
|
2015
2095
|
ip?: string | undefined;
|
|
2016
2096
|
used_at?: string | undefined;
|
|
2017
|
-
send?: string | undefined;
|
|
2018
2097
|
}>;
|
|
2019
2098
|
export type OTP = z.infer<typeof otpSchema>;
|
|
2020
2099
|
export interface PasswordResponse {
|
|
@@ -2048,7 +2127,7 @@ export declare const sessionInsertSchema: z.ZodObject<{
|
|
|
2048
2127
|
deleted_at?: string | undefined;
|
|
2049
2128
|
}>;
|
|
2050
2129
|
export type SessionInsert = z.infer<typeof sessionInsertSchema>;
|
|
2051
|
-
declare const sessionSchema: z.ZodObject<{
|
|
2130
|
+
export declare const sessionSchema: z.ZodObject<{
|
|
2052
2131
|
session_id: z.ZodString;
|
|
2053
2132
|
client_id: z.ZodString;
|
|
2054
2133
|
expires_at: z.ZodString;
|
|
@@ -2670,7 +2749,7 @@ export interface ApplicationsAdapter {
|
|
|
2670
2749
|
update(tenant_id: string, id: string, application: Partial<Application>): Promise<boolean>;
|
|
2671
2750
|
}
|
|
2672
2751
|
export interface UniversalLoginSessionsAdapter {
|
|
2673
|
-
create: (tenant_id: string, session: UniversalLoginSessionInsert) => Promise<
|
|
2752
|
+
create: (tenant_id: string, session: UniversalLoginSessionInsert) => Promise<UniversalLoginSession>;
|
|
2674
2753
|
update: (tenant_id: string, id: string, session: UniversalLoginSession) => Promise<boolean>;
|
|
2675
2754
|
get: (id: string) => Promise<UniversalLoginSession | null>;
|
|
2676
2755
|
}
|
|
@@ -2714,10 +2793,14 @@ export interface HooksAdapter {
|
|
|
2714
2793
|
update: (tenant_id: string, hook_id: string, hook: Partial<HookInsert>) => Promise<boolean>;
|
|
2715
2794
|
list: (tenant_id: string, params: ListParams) => Promise<ListHooksResponse>;
|
|
2716
2795
|
}
|
|
2796
|
+
export interface ClientsAdapter {
|
|
2797
|
+
get: (id: string) => Promise<PartialClient | null>;
|
|
2798
|
+
}
|
|
2717
2799
|
export interface DataAdapters {
|
|
2718
2800
|
applications: ApplicationsAdapter;
|
|
2719
2801
|
branding: BrandingAdapter;
|
|
2720
2802
|
codes: CodesAdapter;
|
|
2803
|
+
clients: ClientsAdapter;
|
|
2721
2804
|
OTP: OTPAdapter;
|
|
2722
2805
|
passwords: PasswordsAdapter;
|
|
2723
2806
|
sessions: SessionsAdapter;
|