@authhero/adapter-interfaces 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Mt(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(n[s[a]]=t[s[a]]);return n}function Dt(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(...s){const a=n.apply(this,s);return a._def.openapi=this._def.openapi,a}}function Ut(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(a,i){var o,c,u,l,m,x;const B=typeof a=="string"?i:a,W=B??{},{param:Be}=W,Rt=Mt(W,["param"]),We=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof a=="string"?{refId:a}:void 0),Ge=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),Rt),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||Be?{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),Be)}:void 0),He=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(We).length>0?{_internal:We}:void 0),Object.keys(Ge).length>0?{metadata:Ge}:void 0)}));if(Dt(this,"ZodObject")){const At=this.extend;He.extend=function(...Pt){var Se,we,Te,Ce,Ee,Oe;const Ie=At.apply(this,Pt);return Ie._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}:(Ee=this._def.openapi)===null||Ee===void 0?void 0:Ee._internal.extendedFrom},metadata:(Oe=Ie._def.openapi)===null||Oe===void 0?void 0:Oe.metadata},Ie}}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 s=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...a){const i=s.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 s(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=s,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"]),$t=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class T extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};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},s={_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)s._errors.push(n(o));else{let c=s,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),s}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={},s=[];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))):s.push(e(a));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}T.create=t=>new T(t);const F=(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 Ke=F;function Vt(t){Ke=t}function me(){return Ke}const _e=t=>{const{data:e,path:n,errorMaps:s,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=s.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...a,path:i,message:c}},Lt=[];function p(t,e){const n=me(),s=_e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===F?void 0:F].filter(a=>!!a)});t.common.issues.push(s)}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 s=[];for(const a of n){if(a.status==="aborted")return g;a.status==="dirty"&&e.dirty(),s.push(a.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const a of n){const i=await a.key,o=await a.value;s.push({key:i,value:o})}return S.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return g;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(s[i.value]=o.value)}return{status:e.value,value:s}}}const g=Object.freeze({status:"aborted"}),H=t=>({status:"dirty",value:t}),w=t=>({status:"valid",value:t}),Ze=t=>t.status==="aborted",Re=t=>t.status==="dirty",ee=t=>t.status==="valid",te=t=>typeof Promise<"u"&&t instanceof Promise;function ge(t,e,n,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Ye(t,e,n,s,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 Q,X;class j{constructor(e,n,s,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,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 qe=(t,e)=>{if(ee(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:s,description:a}=t;if(e&&(n||s))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??s)!==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(te(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 s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){var s;const a={common:{issues:[],async:(s=n==null?void 0:n.async)!==null&&s!==void 0?s:!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 qe(a,i)}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={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:s.path,parent:s}),i=await(te(a)?a:Promise.resolve(a));return qe(s,i)}refine(e,n){const s=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,...s(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((s,a)=>e(s)?!0:(a.addIssue(typeof n=="function"?n(s,a):n),!1))}_refinement(e){return new O({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return I.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this,this._def)}promise(){return Y.create(this,this._def)}or(e){return ae.create([this,e],this._def)}and(e){return ie.create(this,e,this._def)}transform(e){return new O({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ue({...y(this._def),innerType:this,defaultValue:n,typeName:_.ZodDefault})}brand(){return new Pe({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pe({...y(this._def),innerType:this,catchValue:n,typeName:_.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return fe.create(this,e)}readonly(){return he.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const zt=/^c[^\s-]{8,}$/i,Bt=/^[0-9a-z]+$/,Wt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Gt=/^[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,Ht=/^[a-z0-9_-]{21}$/i,qt=/^[-+]?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)?)??$/,Ft=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let je;const Yt=/^(?:(?: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])$/,Jt=/^(([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})))$/,Qt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Je="((\\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])))",Xt=new RegExp(`^${Je}$`);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 en(t){return new RegExp(`^${Qe(t)}$`)}function Xe(t){let e=`${Je}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 tn(t,e){return!!((e==="v4"||!e)&&Yt.test(t)||(e==="v6"||!e)&&Jt.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}),g}const s=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}),s.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}),s.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}),s.dirty())}else if(i.kind==="email")Ft.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"email",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")je||(je=new RegExp(Kt,"u")),je.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"emoji",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")Gt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"uuid",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")Ht.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"nanoid",code:d.invalid_string,message:i.message}),s.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}),s.dirty());else if(i.kind==="cuid2")Bt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid2",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Wt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ulid",code:d.invalid_string,message:i.message}),s.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}),s.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}),s.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}),s.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}),s.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}),s.dirty()):i.kind==="datetime"?Xe(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?Xt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?en(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?qt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"duration",code:d.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?tn(e.data,i.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ip",code:d.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?Qt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64",code:d.invalid_string,message:i.message}),s.dirty()):b.assertNever(i);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(a=>e.test(a),{validation:n,code:d.invalid_string,...f.errToObj(s)})}_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,s;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:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!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:_.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};function nn(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,a=n>s?n:s,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}),g}let s;const a=new S;for(const i of this._def.checks)i.kind==="int"?b.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?nn(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{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,s,a){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,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 s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}P.create=t=>new P({checks:[],typeName:_.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}),g}let s;const a=new S;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{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,s,a){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,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:_.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};class ne extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.boolean,received:s.parsedType}),g}return w(e.data)}}ne.create=t=>new ne({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...y(t)});class L 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}),g}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_date}),g}const s=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"}),s.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"}),s.dirty()):b.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new L({...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}}L.create=t=>new L({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...y(t)});class ye extends v{_parse(e){if(this._getType(e)!==h.symbol){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.symbol,received:s.parsedType}),g}return w(e.data)}}ye.create=t=>new ye({typeName:_.ZodSymbol,...y(t)});class re extends v{_parse(e){if(this._getType(e)!==h.undefined){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.undefined,received:s.parsedType}),g}return w(e.data)}}re.create=t=>new re({typeName:_.ZodUndefined,...y(t)});class se extends v{_parse(e){if(this._getType(e)!==h.null){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.null,received:s.parsedType}),g}return w(e.data)}}se.create=t=>new se({typeName:_.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:_.ZodAny,...y(t)});class V extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}V.create=t=>new V({typeName:_.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}),g}}R.create=t=>new R({typeName:_.ZodNever,...y(t)});class ve extends v{_parse(e){if(this._getType(e)!==h.undefined){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.void,received:s.parsedType}),g}return w(e.data)}}ve.create=t=>new ve({typeName:_.ZodVoid,...y(t)});class E extends v{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),a=this._def;if(n.parsedType!==h.array)return p(n,{code:d.invalid_type,expected:h.array,received:n.parsedType}),g;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}),s.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}),s.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}),s.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>a.type._parseAsync(new j(n,o,n.path,c)))).then(o=>S.mergeArray(s,o));const i=[...n.data].map((o,c)=>a.type._parseSync(new j(n,o,n.path,c)));return S.mergeArray(s,i)}get element(){return this._def.type}min(e,n){return new E({...this._def,minLength:{value:e,message:f.toString(n)}})}max(e,n){return new E({...this._def,maxLength:{value:e,message:f.toString(n)}})}length(e,n){return new E({...this._def,exactLength:{value:e,message:f.toString(n)}})}nonempty(e){return this.min(1,e)}}E.create=(t,e)=>new E({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function G(t){if(t instanceof k){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=I.create(G(s))}return new k({...t._def,shape:()=>e})}else return t instanceof E?new E({...t._def,type:G(t.element)}):t instanceof I?I.create(G(t.unwrap())):t instanceof U?U.create(G(t.unwrap())):t instanceof N?N.create(t.items.map(e=>G(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}),g}const{status:s,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 j(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}),s.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 j(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,B=await m.value;l.push({key:x,value:B,alwaysSet:m.alwaysSet})}return l}).then(l=>S.mergeObjectSync(s,l)):S.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var a,i,o,c;const u=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,s).message)!==null&&o!==void 0?o:s.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:_.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(s=>{e[s]&&this.shape[s]&&(n[s]=this.shape[s])}),new k({...this._def,shape:()=>n})}omit(e){const n={};return b.objectKeys(this.shape).forEach(s=>{e[s]||(n[s]=this.shape[s])}),new k({...this._def,shape:()=>n})}deepPartial(){return G(this)}partial(e){const n={};return b.objectKeys(this.shape).forEach(s=>{const a=this.shape[s];e&&!e[s]?n[s]=a:n[s]=a.optional()}),new k({...this._def,shape:()=>n})}required(e){const n={};return b.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])n[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof I;)i=i._def.innerType;n[s]=i}}),new k({...this._def,shape:()=>n})}keyof(){return et(b.objectKeys(this.shape))}}k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...y(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:_.ZodObject,...y(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...y(e)});class ae extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=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}),g}if(n.common.async)return Promise.all(s.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 s){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}),g}}get options(){return this._def.options}}ae.create=(t,e)=>new ae({options:t,typeName:_.ZodUnion,...y(e)});const Z=t=>t instanceof ce?Z(t.schema):t instanceof O?Z(t.innerType()):t instanceof de?[t.value]:t instanceof D?t.options:t instanceof le?b.objectValues(t.enum):t instanceof ue?Z(t._def.innerType):t instanceof re?[void 0]:t instanceof se?[null]:t instanceof I?[void 0,...Z(t.unwrap())]:t instanceof U?[null,...Z(t.unwrap())]:t instanceof Pe||t instanceof he?Z(t.unwrap()):t instanceof pe?Z(t._def.innerType):[];class xe 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}),g;const s=this.discriminator,a=n.data[s],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:[s]}),g)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,s){const a=new Map;for(const i of n){const o=Z(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 xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:a,...y(s)})}}function Ae(t,e){const n=A(t),s=A(e);if(t===e)return{valid:!0,data:t};if(n===h.object&&s===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&&s===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&&s===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ie extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),a=(i,o)=>{if(Ze(i)||Ze(o))return g;const c=Ae(i.value,o.value);return c.valid?((Re(i)||Re(o))&&n.dirty(),{status:n.value,value:c.data}):(p(s,{code:d.invalid_intersection_types}),g)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ie.create=(t,e,n)=>new ie({left:t,right:e,typeName:_.ZodIntersection,...y(n)});class N extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.array)return p(s,{code:d.invalid_type,expected:h.array,received:s.parsedType}),g;if(s.data.length<this._def.items.length)return p(s,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&s.data.length>this._def.items.length&&(p(s,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...s.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new j(s,o,s.path,c)):null}).filter(o=>!!o);return s.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:_.ZodTuple,rest:null,...y(e)})};class oe extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.object)return p(s,{code:d.invalid_type,expected:h.object,received:s.parsedType}),g;const a=[],i=this._def.keyType,o=this._def.valueType;for(const c in s.data)a.push({key:i._parse(new j(s,c,s.path,c)),value:o._parse(new j(s,s.data[c],s.path,c)),alwaysSet:c in s.data});return s.common.async?S.mergeObjectAsync(n,a):S.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,s){return n instanceof v?new oe({keyType:e,valueType:n,typeName:_.ZodRecord,...y(s)}):new oe({keyType:C.create(),valueType:e,typeName:_.ZodRecord,...y(n)})}}class be extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.map)return p(s,{code:d.invalid_type,expected:h.map,received:s.parsedType}),g;const a=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([c,u],l)=>({key:a._parse(new j(s,c,s.path,[l,"key"])),value:i._parse(new j(s,u,s.path,[l,"value"]))}));if(s.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 g;(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 g;(l.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(l.value,m.value)}return{status:n.value,value:c}}}}be.create=(t,e,n)=>new be({valueType:e,keyType:t,typeName:_.ZodMap,...y(n)});class z extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.set)return p(s,{code:d.invalid_type,expected:h.set,received:s.parsedType}),g;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(p(s,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(p(s,{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 g;m.status==="dirty"&&n.dirty(),l.add(m.value)}return{status:n.value,value:l}}const c=[...s.data.values()].map((u,l)=>i._parse(new j(s,u,s.path,l)));return s.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new z({...this._def,minSize:{value:e,message:f.toString(n)}})}max(e,n){return new z({...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)}}z.create=(t,e)=>new z({valueType:t,minSize:null,maxSize:null,typeName:_.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}),g;function s(c,u){return _e({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,me(),F].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function a(c,u){return _e({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,me(),F].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(W=>{throw l.addIssue(s(u,W)),l}),x=await Reflect.apply(o,this,m);return await c._def.returns._def.type.parseAsync(x,i).catch(W=>{throw l.addIssue(a(x,W)),l})})}else{const c=this;return w(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new T([s(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(V.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,s){return new q({args:e||N.create([]).rest(V.create()),returns:n||V.create(),typeName:_.ZodFunction,...y(s)})}}class ce 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})}}ce.create=(t,e)=>new ce({getter:t,typeName:_.ZodLazy,...y(e)});class de 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}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}de.create=(t,e)=>new de({value:t,typeName:_.ZodLiteral,...y(e)});function et(t,e){return new D({values:t,typeName:_.ZodEnum,...y(e)})}class D extends v{constructor(){super(...arguments),Q.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return p(n,{expected:b.joinValues(s),received:n.parsedType,code:d.invalid_type}),g}if(ge(this,Q)||Ye(this,Q,new Set(this._def.values)),!ge(this,Q).has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:s}),g}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 D.create(e,{...this._def,...n})}exclude(e,n=this._def){return D.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}Q=new WeakMap;D.create=et;class le extends v{constructor(){super(...arguments),X.set(this,void 0)}_parse(e){const n=b.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==h.string&&s.parsedType!==h.number){const a=b.objectValues(n);return p(s,{expected:b.joinValues(a),received:s.parsedType,code:d.invalid_type}),g}if(ge(this,X)||Ye(this,X,new Set(b.getValidEnumValues(this._def.values))),!ge(this,X).has(e.data)){const a=b.objectValues(n);return p(s,{received:s.data,code:d.invalid_enum_value,options:a}),g}return w(e.data)}get enum(){return this._def.values}}X=new WeakMap;le.create=(t,e)=>new le({values:t,typeName:_.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}),g;const s=n.parsedType===h.promise?n.data:Promise.resolve(n.data);return w(s.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Y.create=(t,e)=>new Y({type:t,typeName:_.ZodPromise,...y(e)});class O extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{p(s,o),o.fatal?n.abort():n.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return g;const u=await this._def.schema._parseAsync({data:c,path:s.path,parent:s});return u.status==="aborted"?g:u.status==="dirty"||n.value==="dirty"?H(u.value):u});{if(n.value==="aborted")return g;const c=this._def.schema._parseSync({data:o,path:s.path,parent:s});return c.status==="aborted"?g:c.status==="dirty"||n.value==="dirty"?H(c.value):c}}if(a.type==="refinement"){const o=c=>{const u=a.refinement(c,i);if(s.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(s.common.async===!1){const c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return c.status==="aborted"?g:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>c.status==="aborted"?g:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(a.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ee(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:s.data,path:s.path,parent:s}).then(o=>ee(o)?Promise.resolve(a.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);b.assertNever(a)}}O.create=(t,e,n)=>new O({schema:t,typeName:_.ZodEffects,effect:e,...y(n)});O.createWithPreprocess=(t,e,n)=>new O({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...y(n)});class I extends v{_parse(e){return this._getType(e)===h.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}I.create=(t,e)=>new I({innerType:t,typeName:_.ZodOptional,...y(e)});class U extends v{_parse(e){return this._getType(e)===h.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(t,e)=>new U({innerType:t,typeName:_.ZodNullable,...y(e)});class ue extends v{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===h.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ue.create=(t,e)=>new ue({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class pe extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return te(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class ke extends v{_parse(e){if(this._getType(e)!==h.nan){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.nan,received:s.parsedType}),g}return{status:"valid",value:e.data}}}ke.create=t=>new ke({typeName:_.ZodNaN,...y(t)});const rn=Symbol("zod_brand");class Pe extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class fe extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?g:i.status==="dirty"?(n.dirty(),H(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?g:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(e,n){return new fe({in:e,out:n,typeName:_.ZodPipeline})}}class he extends v{_parse(e){const n=this._def.innerType._parse(e),s=a=>(ee(a)&&(a.value=Object.freeze(a.value)),a);return te(n)?n.then(a=>s(a)):s(n)}unwrap(){return this._def.innerType}}he.create=(t,e)=>new he({innerType:t,typeName:_.ZodReadonly,...y(e)});function tt(t,e={},n){return t?K.create().superRefine((s,a)=>{var i,o;if(!t(s)){const c=typeof e=="function"?e(s):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 sn={object:k.lazycreate};var _;(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"})(_||(_={}));const an=(t,e={message:`Input not instance of ${t.name}`})=>tt(n=>n instanceof t,e),nt=C.create,rt=P.create,on=ke.create,cn=M.create,st=ne.create,dn=L.create,ln=ye.create,un=re.create,pn=se.create,hn=K.create,fn=V.create,mn=R.create,_n=ve.create,gn=E.create,yn=k.create,vn=k.strictCreate,bn=ae.create,kn=xe.create,xn=ie.create,Sn=N.create,wn=oe.create,Tn=be.create,Cn=z.create,En=q.create,On=ce.create,In=de.create,jn=D.create,Nn=le.create,Zn=Y.create,Fe=O.create,Rn=I.create,An=U.create,Pn=O.createWithPreprocess,Mn=fe.create,Dn=()=>nt().optional(),Un=()=>rt().optional(),$n=()=>st().optional(),Vn={string:t=>C.create({...t,coerce:!0}),number:t=>P.create({...t,coerce:!0}),boolean:t=>ne.create({...t,coerce:!0}),bigint:t=>M.create({...t,coerce:!0}),date:t=>L.create({...t,coerce:!0})},Ln=g;var r=Object.freeze({__proto__:null,defaultErrorMap:F,setErrorMap:Vt,getErrorMap:me,makeIssue:_e,EMPTY_PATH:Lt,addIssueToContext:p,ParseStatus:S,INVALID:g,DIRTY:H,OK:w,isAborted:Ze,isDirty:Re,isValid:ee,isAsync:te,get util(){return b},get objectUtil(){return Ne},ZodParsedType:h,getParsedType:A,ZodType:v,datetimeRegex:Xe,ZodString:C,ZodNumber:P,ZodBigInt:M,ZodBoolean:ne,ZodDate:L,ZodSymbol:ye,ZodUndefined:re,ZodNull:se,ZodAny:K,ZodUnknown:V,ZodNever:R,ZodVoid:ve,ZodArray:E,ZodObject:k,ZodUnion:ae,ZodDiscriminatedUnion:xe,ZodIntersection:ie,ZodTuple:N,ZodRecord:oe,ZodMap:be,ZodSet:z,ZodFunction:q,ZodLazy:ce,ZodLiteral:de,ZodEnum:D,ZodNativeEnum:le,ZodPromise:Y,ZodEffects:O,ZodTransformer:O,ZodOptional:I,ZodNullable:U,ZodDefault:ue,ZodCatch:pe,ZodNaN:ke,BRAND:rn,ZodBranded:Pe,ZodPipeline:fe,ZodReadonly:he,custom:tt,Schema:v,ZodSchema:v,late:sn,get ZodFirstPartyTypeKind(){return _},coerce:Vn,any:hn,array:gn,bigint:cn,boolean:st,date:dn,discriminatedUnion:kn,effect:Fe,enum:jn,function:En,instanceof:an,intersection:xn,lazy:On,literal:In,map:Tn,nan:on,nativeEnum:Nn,never:mn,null:pn,nullable:An,number:rt,object:yn,oboolean:$n,onumber:Un,optional:Rn,ostring:Dn,pipeline:Mn,preprocess:Pn,promise:Zn,record:wn,set:Cn,strictObject:vn,string:nt,symbol:ln,transformer:Fe,tuple:Sn,undefined:un,union:bn,unknown:fn,void:_n,NEVER:Ln,ZodIssueCode:d,quotelessJson:$t,ZodError:T});Ut(r);const zn=r.object({start:r.number(),limit:r.number(),length:r.number()}),Me=r.object({created_at:r.string(),updated_at:r.string()}),at=r.object({email:r.string().optional(),email_verified:r.boolean().optional(),name:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),phone_number:r.string().optional(),phone_verified:r.boolean().optional(),family_name:r.string().optional()}).catchall(r.any()),it=r.object({connection:r.string(),user_id:r.string(),provider:r.string(),isSocial:r.boolean(),access_token:r.string().optional(),access_token_secret:r.string().optional(),refresh_token:r.string().optional(),profileData:at.optional()}),De=r.object({email:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),family_name:r.string().optional(),nickname:r.string().optional(),name:r.string().optional(),picture:r.string().optional(),locale:r.string().optional(),linked_to:r.string().optional(),profileData:r.string().optional(),user_id:r.string().optional()}),ot=De.extend({email_verified:r.boolean().default(!1),verify_email:r.boolean().optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string().optional(),provider:r.string().default("email"),connection:r.string().default("email")}),ct=ot.extend(Me.shape).extend({user_id:r.string(),email:r.string(),is_social:r.boolean(),login_count:r.number(),identities:r.array(it).optional()}),Bn=ct,Wn=De.extend({email:r.string(),login_count:r.number(),multifactor:r.array(r.string()).optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string()}).catchall(r.any()),dt=r.object({audience:r.string().optional(),recipient:r.string().optional(),createUpnClaim:r.boolean().optional(),mapUnknownClaimsAsIs:r.boolean().optional(),passthroughClaimsWithNoMapping:r.boolean().optional(),mapIdentities:r.boolean().optional(),signatureAlgorithm:r.string().optional(),digestAlgorithm:r.string().optional(),issuer:r.string().optional(),destination:r.string().optional(),lifetimeInSeconds:r.number().optional(),signResponse:r.boolean().optional(),nameIdentifierFormat:r.string().optional(),nameIdentifierProbes:r.array(r.string()).optional(),authnContextClassRef:r.string().optional(),mappings:r.record(r.string()).optional()}),lt=r.object({id:r.string(),name:r.string(),callbacks:r.array(r.string()).openapi({description:"Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."}),allowed_origins:r.array(r.string()).openapi({description:"Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."}),web_origins:r.array(r.string()).openapi({description:"Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."}),allowed_logout_urls:r.array(r.string()).openapi({description:"Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."}),addons:r.object({samlp:dt.optional()}).optional().openapi({description:"Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."}),email_validation:r.enum(["enabled","disabled","enforced"]).default("enforced").openapi({description:"Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"}),client_secret:r.string().default(""),disable_sign_ups:r.boolean().default(!1).openapi({description:"Prevents users from signing up using the hosted login page. This is not available in auth0"})}),ut=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),...lt.shape});var Ue=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(Ue||{}),$e=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t.SAML_POST="saml_post",t))($e||{}),Ve=(t=>(t.S265="S256",t.plain="plain",t))(Ve||{});const pt=r.object({client_id:r.string(),vendor_id:r.string().optional(),response_type:r.nativeEnum(Ue).optional(),response_mode:r.nativeEnum($e).optional(),redirect_uri:r.string().optional(),audience:r.string().optional(),state:r.string().optional(),nonce:r.string().optional(),scope:r.string().optional(),code_challenge_method:r.nativeEnum(Ve).optional(),code_challenge:r.string().optional(),username:r.string().optional()}),Gn=r.object({colors:r.object({primary:r.string(),page_background:r.object({type:r.string().optional(),start:r.string().optional(),end:r.string().optional(),angle_deg:r.number().optional()}).optional()}).optional(),logo_url:r.string().optional(),favicon_url:r.string().optional(),font:r.object({url:r.string()}).optional()}),ht=r.object({id:r.string().optional(),name:r.string(),client_id:r.string().optional(),client_secret:r.string().optional(),authorization_endpoint:r.string().optional(),response_type:r.custom().optional(),response_mode:r.custom().optional(),private_key:r.string().optional(),kid:r.string().optional(),team_id:r.string().optional(),token_endpoint:r.string().optional(),token_exchange_basic_auth:r.boolean().optional(),userinfo_endpoint:r.string().optional(),scope:r.string().optional()}),ft=r.object({id:r.string(),created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(ht.shape),mt=r.object({name:r.string(),audience:r.string(),sender_email:r.string().email(),sender_name:r.string(),support_url:r.string().url().optional(),logo:r.string().url().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),language:r.string().optional()}),_t=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),id:r.string(),...mt.shape}),Hn=r.object({logoUrl:r.string(),loginBackgroundImage:r.string().nullish(),style:r.object({primaryColor:r.string(),buttonTextColor:r.string(),primaryHoverColor:r.string()}),supportEmail:r.string().nullable(),supportUrl:r.string().nullable(),name:r.string(),showGreyishBackground:r.boolean().optional(),termsAndConditionsUrl:r.string().nullable(),companyName:r.string().optional(),checkoutHideSocial:r.boolean().optional(),siteUrl:r.string().nullable(),manageSubscriptionsUrl:r.string().optional()}),qn=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.union([r.literal("mailgun"),r.literal("mailchannels")]).optional()});r.object({...ut.shape,domains:r.array(qn),tenant:_t,connections:r.array(ft)});const gt=r.enum(["password_reset","email_verification","otp","authorization_code","oauth2_state","ticket"]),yt=r.object({code_id:r.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:r.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:r.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:gt,expires_at:r.string(),used_at:r.string().optional(),user_id:r.string().optional()}),Fn=r.object({...yt.shape,created_at:r.string()}),vt=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.enum(["mailgun","mailchannels"])}),Kn=Me.extend({...vt.shape,id:r.string()}),bt=r.object({trigger_id:r.enum(["pre-user-signup","post-user-registration","post-user-login"]),enabled:r.boolean().default(!1),url:r.string(),hook_id:r.string().optional(),synchronous:r.boolean().default(!1),priority:r.number().optional()}),Yn=bt.extend({...Me.shape,hook_id:r.string()}),kt=r.object({alg:r.string(),e:r.string(),kid:r.string(),kty:r.string(),n:r.string(),use:r.string().optional()}),Jn=r.object({keys:r.array(kt)}),Qn=r.object({issuer:r.string(),authorization_endpoint:r.string(),token_endpoint:r.string(),device_authorization_endpoint:r.string(),userinfo_endpoint:r.string(),mfa_challenge_endpoint:r.string(),jwks_uri:r.string(),registration_endpoint:r.string(),revocation_endpoint:r.string(),scopes_supported:r.array(r.string()),response_types_supported:r.array(r.string()),code_challenge_methods_supported:r.array(r.string()),response_modes_supported:r.array(r.string()),subject_types_supported:r.array(r.string()),id_token_signing_alg_values_supported:r.array(r.string()),token_endpoint_auth_methods_supported:r.array(r.string()),claims_supported:r.array(r.string()),request_uri_parameter_supported:r.boolean(),request_parameter_supported:r.boolean(),token_endpoint_auth_signing_alg_values_supported:r.array(r.string())}),xt=r.object({auth0Client:r.string().optional(),authParams:pt,expires_at:r.string(),deleted_at:r.string().optional(),ip:r.string().optional()}).openapi({description:"This represents a login sesion"}),Xn=r.object({...xt.shape,login_id:r.string().openapi({description:"This is is used as the state in the universal login"}),created_at:r.string(),updated_at:r.string()});var St=(t=>(t.FAILED_SILENT_AUTH="fsa",t.FAILED_SIGNUP="fs",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.FAILED_CHANGE_PASSWORD="fcp",t.FAILED_BY_CONNECTOR="fc",t.FAILED_LOGIN_INVALID_EMAIL_USERNAME="fu",t.FAILED_HOOK="fh",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_CHANGE_PASSWORD="scp",t.SUCCESS_CHANGE_PASSWORD_REQUEST="scpr",t.SUCCESS_CHANGE_USERNAME="scu",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.SUCCESS_LOGIN="s",t.SUCCESS_LOGOUT="slo",t.SUCCESS_SIGNUP="ss",t.SUCCESS_SILENT_AUTH="ssa",t.SUCCESS_VERIFICATION_EMAIL="sv",t.SUCCESS_VERIFICATION_EMAIL_REQUEST="svr",t.CODE_LINK_SENT="cls",t))(St||{});const er=r.enum(["cls","fsa","fs","f","fc","fcoa","fcp","fh","fp","fs","fu","s","sapi","scoa","scp","scpr","scu","seacft","serft","slo","ss","ssa","sv","svr"]),wt=r.object({name:r.string(),version:r.string(),env:r.object({node:r.string().optional()}).optional()}),tr=r.object({type:er,date:r.string(),description:r.string().optional(),log_id:r.string().optional(),_id:r.string().optional(),ip:r.string(),user_agent:r.string(),details:r.any().optional(),isMobile:r.boolean(),user_id:r.string().optional(),user_name:r.string().optional(),connection:r.string().optional(),connection_id:r.string().optional(),client_id:r.string().optional(),client_name:r.string().optional(),audience:r.string().optional(),scope:r.array(r.string()).optional(),strategy:r.string().optional(),strategy_type:r.string().optional(),hostname:r.string().optional(),auth0_client:wt.optional()}),Tt=r.object({user_id:r.string(),password:r.string(),algorithm:r.enum(["bcrypt","argon2id"]).default("argon2id")}),nr=r.object({...Tt.shape,created_at:r.string(),updated_at:r.string()}),Ct=r.object({session_id:r.string(),client_id:r.string(),expires_at:r.string(),used_at:r.string(),deleted_at:r.string().optional(),user_id:r.string()}),rr=r.object({created_at:r.string(),...Ct.shape}),sr=r.object({kid:r.string().openapi({description:"The key id of the signing key"}),cert:r.string().openapi({description:"The public certificate of the signing key"}),fingerprint:r.string().openapi({description:"The cert fingerprint"}),thumbprint:r.string().openapi({description:"The cert thumbprint"}),pkcs7:r.string().optional().openapi({description:"The private key in pkcs7 format"}),current:r.boolean().optional().openapi({description:"True if the key is the current key"}),next:r.boolean().optional().openapi({description:"True if the key is the next key"}),previous:r.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:r.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:r.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:r.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:r.string().optional().openapi({description:"The date and time when the key was revoked"})});var Le=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(Le||{});const ze=r.nativeEnum(Le),ar=r.object({grant_type:ze.refine(t=>t==="authorization_code"),code:r.string(),client_secret:r.string(),client_id:r.string()}),ir=r.object({grant_type:ze.refine(t=>t==="authorization_code"),code:r.string(),code_verifier:r.string(),client_id:r.string().optional(),redirect_uri:r.string()}),or=r.object({grant_type:ze.refine(t=>t==="client_credentials"),scope:r.string().optional(),client_secret:r.string(),client_id:r.string(),audience:r.string().optional()});r.object({access_token:r.string(),id_token:r.string().optional(),scope:r.string().optional(),state:r.string().optional(),refresh_token:r.string().optional(),token_type:r.string(),expires_in:r.number()});r.object({code:r.string(),state:r.string().optional()});const Et=r.object({button_border_radius:r.number(),button_border_weight:r.number(),buttons_style:r.enum(["pill"]),input_border_radius:r.number(),input_border_weight:r.number(),inputs_style:r.enum(["pill"]),show_widget_shadow:r.boolean(),widget_border_weight:r.number(),widget_corner_radius:r.number()}),Ot=r.object({base_focus_color:r.string(),base_hover_color:r.string(),body_text:r.string(),captcha_widget_theme:r.enum(["auto"]),error:r.string(),header:r.string(),icons:r.string(),input_background:r.string(),input_border:r.string(),input_filled_text:r.string(),input_labels_placeholders:r.string(),links_focused_components:r.string(),primary_button:r.string(),primary_button_label:r.string(),secondary_button_border:r.string(),secondary_button_label:r.string(),success:r.string(),widget_background:r.string(),widget_border:r.string()}),$=r.object({bold:r.boolean(),size:r.number()}),It=r.object({body_text:$,buttons_text:$,font_url:r.string(),input_labels:$,links:$,links_style:r.enum(["normal"]),reference_text_size:r.number(),subtitle:$,title:$}),jt=r.object({background_color:r.string(),background_image_url:r.string(),page_layout:r.enum(["center"])}),Nt=r.object({header_text_alignment:r.enum(["center"]),logo_height:r.number(),logo_position:r.enum(["center"]),logo_url:r.string(),social_buttons_layout:r.enum(["bottom"])}),Zt=r.object({borders:Et,colors:Ot,displayName:r.string(),fonts:It,page_background:jt,widget:Nt}),cr=Zt.extend({themeId:r.string()});function dr(t){const[e,n]=t.split("|");if(!e||!n)throw new Error(`Invalid user_id: ${t}`);return{connection:e,id:n}}exports.Auth0Client=wt;exports.AuthorizationResponseMode=$e;exports.AuthorizationResponseType=Ue;exports.CodeChallengeMethod=Ve;exports.GrantType=Le;exports.LogTypes=St;exports.applicationInsertSchema=lt;exports.applicationSchema=ut;exports.auth0UserResponseSchema=Bn;exports.authParamsSchema=pt;exports.authorizationCodeGrantTypeParamsSchema=ar;exports.baseUserSchema=De;exports.bordersSchema=Et;exports.brandingSchema=Gn;exports.clientCredentialGrantTypeParamsSchema=or;exports.codeInsertSchema=yt;exports.codeSchema=Fn;exports.codeTypeSchema=gt;exports.colorsSchema=Ot;exports.connectionInsertSchema=ht;exports.connectionSchema=ft;exports.domainInsertSchema=vt;exports.domainSchema=Kn;exports.fontDetailsSchema=$;exports.fontsSchema=It;exports.hookInsertSchema=bt;exports.hookSchema=Yn;exports.identitySchema=it;exports.jwksKeySchema=Jn;exports.jwksSchema=kt;exports.logSchema=tr;exports.loginInsertSchema=xt;exports.loginSchema=Xn;exports.openIDConfigurationSchema=Qn;exports.pageBackgroundSchema=jt;exports.parseUserId=dr;exports.passwordInsertSchema=Tt;exports.passwordSchema=nr;exports.pkceAuthorizationCodeGrantTypeParamsSchema=ir;exports.profileDataSchema=at;exports.samlpAddon=dt;exports.sessionInsertSchema=Ct;exports.sessionSchema=rr;exports.signingKeySchema=sr;exports.tenantInsertSchema=mt;exports.tenantSchema=_t;exports.themeInsertSchema=Zt;exports.themeSchema=cr;exports.totalsSchema=zn;exports.userInsertSchema=ot;exports.userResponseSchema=Wn;exports.userSchema=ct;exports.vendorSettingsSchema=Hn;exports.widgetSchema=Nt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Mt(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(n[s[a]]=t[s[a]]);return n}function Dt(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(...s){const a=n.apply(this,s);return a._def.openapi=this._def.openapi,a}}function Ut(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(a,i){var o,c,u,l,m,x;const B=typeof a=="string"?i:a,W=B??{},{param:Be}=W,Rt=Mt(W,["param"]),We=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof a=="string"?{refId:a}:void 0),Ge=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),Rt),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||Be?{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),Be)}:void 0),He=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(We).length>0?{_internal:We}:void 0),Object.keys(Ge).length>0?{metadata:Ge}:void 0)}));if(Dt(this,"ZodObject")){const At=this.extend;He.extend=function(...Pt){var Se,we,Te,Ce,Ee,Oe;const Ie=At.apply(this,Pt);return Ie._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}:(Ee=this._def.openapi)===null||Ee===void 0?void 0:Ee._internal.extendedFrom},metadata:(Oe=Ie._def.openapi)===null||Oe===void 0?void 0:Oe.metadata},Ie}}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 s=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...a){const i=s.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 s(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=s,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"]),$t=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class T extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};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},s={_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)s._errors.push(n(o));else{let c=s,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),s}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={},s=[];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))):s.push(e(a));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}T.create=t=>new T(t);const F=(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 Ke=F;function Vt(t){Ke=t}function me(){return Ke}const _e=t=>{const{data:e,path:n,errorMaps:s,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=s.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...a,path:i,message:c}},Lt=[];function p(t,e){const n=me(),s=_e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===F?void 0:F].filter(a=>!!a)});t.common.issues.push(s)}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 s=[];for(const a of n){if(a.status==="aborted")return g;a.status==="dirty"&&e.dirty(),s.push(a.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const a of n){const i=await a.key,o=await a.value;s.push({key:i,value:o})}return S.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return g;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(s[i.value]=o.value)}return{status:e.value,value:s}}}const g=Object.freeze({status:"aborted"}),H=t=>({status:"dirty",value:t}),w=t=>({status:"valid",value:t}),Ze=t=>t.status==="aborted",Re=t=>t.status==="dirty",ee=t=>t.status==="valid",te=t=>typeof Promise<"u"&&t instanceof Promise;function ge(t,e,n,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Ye(t,e,n,s,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 Q,X;class j{constructor(e,n,s,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,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 qe=(t,e)=>{if(ee(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:s,description:a}=t;if(e&&(n||s))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??s)!==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(te(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 s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){var s;const a={common:{issues:[],async:(s=n==null?void 0:n.async)!==null&&s!==void 0?s:!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 qe(a,i)}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={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:s.path,parent:s}),i=await(te(a)?a:Promise.resolve(a));return qe(s,i)}refine(e,n){const s=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,...s(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((s,a)=>e(s)?!0:(a.addIssue(typeof n=="function"?n(s,a):n),!1))}_refinement(e){return new O({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return I.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this,this._def)}promise(){return Y.create(this,this._def)}or(e){return ae.create([this,e],this._def)}and(e){return ie.create(this,e,this._def)}transform(e){return new O({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ue({...y(this._def),innerType:this,defaultValue:n,typeName:_.ZodDefault})}brand(){return new Pe({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pe({...y(this._def),innerType:this,catchValue:n,typeName:_.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return fe.create(this,e)}readonly(){return he.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const zt=/^c[^\s-]{8,}$/i,Bt=/^[0-9a-z]+$/,Wt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Gt=/^[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,Ht=/^[a-z0-9_-]{21}$/i,qt=/^[-+]?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)?)??$/,Ft=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let je;const Yt=/^(?:(?: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])$/,Jt=/^(([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})))$/,Qt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Je="((\\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])))",Xt=new RegExp(`^${Je}$`);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 en(t){return new RegExp(`^${Qe(t)}$`)}function Xe(t){let e=`${Je}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 tn(t,e){return!!((e==="v4"||!e)&&Yt.test(t)||(e==="v6"||!e)&&Jt.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}),g}const s=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}),s.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}),s.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}),s.dirty())}else if(i.kind==="email")Ft.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"email",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")je||(je=new RegExp(Kt,"u")),je.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"emoji",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")Gt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"uuid",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")Ht.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"nanoid",code:d.invalid_string,message:i.message}),s.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}),s.dirty());else if(i.kind==="cuid2")Bt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid2",code:d.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Wt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ulid",code:d.invalid_string,message:i.message}),s.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}),s.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}),s.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}),s.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}),s.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}),s.dirty()):i.kind==="datetime"?Xe(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?Xt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?en(i).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?qt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"duration",code:d.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?tn(e.data,i.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ip",code:d.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?Qt.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64",code:d.invalid_string,message:i.message}),s.dirty()):b.assertNever(i);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(a=>e.test(a),{validation:n,code:d.invalid_string,...f.errToObj(s)})}_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,s;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:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!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:_.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};function nn(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,a=n>s?n:s,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}),g}let s;const a=new S;for(const i of this._def.checks)i.kind==="int"?b.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?nn(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{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,s,a){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,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 s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}P.create=t=>new P({checks:[],typeName:_.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}),g}let s;const a=new S;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{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)&&(s=this._getOrReturnCtx(e,s),p(s,{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,s,a){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,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:_.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...y(t)})};class ne extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.boolean,received:s.parsedType}),g}return w(e.data)}}ne.create=t=>new ne({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...y(t)});class L 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}),g}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_date}),g}const s=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"}),s.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"}),s.dirty()):b.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new L({...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}}L.create=t=>new L({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...y(t)});class ye extends v{_parse(e){if(this._getType(e)!==h.symbol){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.symbol,received:s.parsedType}),g}return w(e.data)}}ye.create=t=>new ye({typeName:_.ZodSymbol,...y(t)});class re extends v{_parse(e){if(this._getType(e)!==h.undefined){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.undefined,received:s.parsedType}),g}return w(e.data)}}re.create=t=>new re({typeName:_.ZodUndefined,...y(t)});class se extends v{_parse(e){if(this._getType(e)!==h.null){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.null,received:s.parsedType}),g}return w(e.data)}}se.create=t=>new se({typeName:_.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:_.ZodAny,...y(t)});class V extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}V.create=t=>new V({typeName:_.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}),g}}R.create=t=>new R({typeName:_.ZodNever,...y(t)});class ve extends v{_parse(e){if(this._getType(e)!==h.undefined){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.void,received:s.parsedType}),g}return w(e.data)}}ve.create=t=>new ve({typeName:_.ZodVoid,...y(t)});class E extends v{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),a=this._def;if(n.parsedType!==h.array)return p(n,{code:d.invalid_type,expected:h.array,received:n.parsedType}),g;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}),s.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}),s.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}),s.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>a.type._parseAsync(new j(n,o,n.path,c)))).then(o=>S.mergeArray(s,o));const i=[...n.data].map((o,c)=>a.type._parseSync(new j(n,o,n.path,c)));return S.mergeArray(s,i)}get element(){return this._def.type}min(e,n){return new E({...this._def,minLength:{value:e,message:f.toString(n)}})}max(e,n){return new E({...this._def,maxLength:{value:e,message:f.toString(n)}})}length(e,n){return new E({...this._def,exactLength:{value:e,message:f.toString(n)}})}nonempty(e){return this.min(1,e)}}E.create=(t,e)=>new E({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function G(t){if(t instanceof k){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=I.create(G(s))}return new k({...t._def,shape:()=>e})}else return t instanceof E?new E({...t._def,type:G(t.element)}):t instanceof I?I.create(G(t.unwrap())):t instanceof U?U.create(G(t.unwrap())):t instanceof N?N.create(t.items.map(e=>G(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}),g}const{status:s,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 j(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}),s.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 j(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,B=await m.value;l.push({key:x,value:B,alwaysSet:m.alwaysSet})}return l}).then(l=>S.mergeObjectSync(s,l)):S.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var a,i,o,c;const u=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,s).message)!==null&&o!==void 0?o:s.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:_.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(s=>{e[s]&&this.shape[s]&&(n[s]=this.shape[s])}),new k({...this._def,shape:()=>n})}omit(e){const n={};return b.objectKeys(this.shape).forEach(s=>{e[s]||(n[s]=this.shape[s])}),new k({...this._def,shape:()=>n})}deepPartial(){return G(this)}partial(e){const n={};return b.objectKeys(this.shape).forEach(s=>{const a=this.shape[s];e&&!e[s]?n[s]=a:n[s]=a.optional()}),new k({...this._def,shape:()=>n})}required(e){const n={};return b.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])n[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof I;)i=i._def.innerType;n[s]=i}}),new k({...this._def,shape:()=>n})}keyof(){return et(b.objectKeys(this.shape))}}k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...y(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:_.ZodObject,...y(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...y(e)});class ae extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=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}),g}if(n.common.async)return Promise.all(s.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 s){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}),g}}get options(){return this._def.options}}ae.create=(t,e)=>new ae({options:t,typeName:_.ZodUnion,...y(e)});const Z=t=>t instanceof ce?Z(t.schema):t instanceof O?Z(t.innerType()):t instanceof de?[t.value]:t instanceof D?t.options:t instanceof le?b.objectValues(t.enum):t instanceof ue?Z(t._def.innerType):t instanceof re?[void 0]:t instanceof se?[null]:t instanceof I?[void 0,...Z(t.unwrap())]:t instanceof U?[null,...Z(t.unwrap())]:t instanceof Pe||t instanceof he?Z(t.unwrap()):t instanceof pe?Z(t._def.innerType):[];class xe 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}),g;const s=this.discriminator,a=n.data[s],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:[s]}),g)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,s){const a=new Map;for(const i of n){const o=Z(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 xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:a,...y(s)})}}function Ae(t,e){const n=A(t),s=A(e);if(t===e)return{valid:!0,data:t};if(n===h.object&&s===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&&s===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&&s===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ie extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),a=(i,o)=>{if(Ze(i)||Ze(o))return g;const c=Ae(i.value,o.value);return c.valid?((Re(i)||Re(o))&&n.dirty(),{status:n.value,value:c.data}):(p(s,{code:d.invalid_intersection_types}),g)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ie.create=(t,e,n)=>new ie({left:t,right:e,typeName:_.ZodIntersection,...y(n)});class N extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.array)return p(s,{code:d.invalid_type,expected:h.array,received:s.parsedType}),g;if(s.data.length<this._def.items.length)return p(s,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&s.data.length>this._def.items.length&&(p(s,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...s.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new j(s,o,s.path,c)):null}).filter(o=>!!o);return s.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:_.ZodTuple,rest:null,...y(e)})};class oe extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.object)return p(s,{code:d.invalid_type,expected:h.object,received:s.parsedType}),g;const a=[],i=this._def.keyType,o=this._def.valueType;for(const c in s.data)a.push({key:i._parse(new j(s,c,s.path,c)),value:o._parse(new j(s,s.data[c],s.path,c)),alwaysSet:c in s.data});return s.common.async?S.mergeObjectAsync(n,a):S.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,s){return n instanceof v?new oe({keyType:e,valueType:n,typeName:_.ZodRecord,...y(s)}):new oe({keyType:C.create(),valueType:e,typeName:_.ZodRecord,...y(n)})}}class be extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.map)return p(s,{code:d.invalid_type,expected:h.map,received:s.parsedType}),g;const a=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([c,u],l)=>({key:a._parse(new j(s,c,s.path,[l,"key"])),value:i._parse(new j(s,u,s.path,[l,"value"]))}));if(s.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 g;(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 g;(l.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(l.value,m.value)}return{status:n.value,value:c}}}}be.create=(t,e,n)=>new be({valueType:e,keyType:t,typeName:_.ZodMap,...y(n)});class z extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.set)return p(s,{code:d.invalid_type,expected:h.set,received:s.parsedType}),g;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(p(s,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(p(s,{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 g;m.status==="dirty"&&n.dirty(),l.add(m.value)}return{status:n.value,value:l}}const c=[...s.data.values()].map((u,l)=>i._parse(new j(s,u,s.path,l)));return s.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new z({...this._def,minSize:{value:e,message:f.toString(n)}})}max(e,n){return new z({...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)}}z.create=(t,e)=>new z({valueType:t,minSize:null,maxSize:null,typeName:_.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}),g;function s(c,u){return _e({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,me(),F].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function a(c,u){return _e({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,me(),F].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(W=>{throw l.addIssue(s(u,W)),l}),x=await Reflect.apply(o,this,m);return await c._def.returns._def.type.parseAsync(x,i).catch(W=>{throw l.addIssue(a(x,W)),l})})}else{const c=this;return w(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new T([s(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(V.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,s){return new q({args:e||N.create([]).rest(V.create()),returns:n||V.create(),typeName:_.ZodFunction,...y(s)})}}class ce 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})}}ce.create=(t,e)=>new ce({getter:t,typeName:_.ZodLazy,...y(e)});class de 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}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}de.create=(t,e)=>new de({value:t,typeName:_.ZodLiteral,...y(e)});function et(t,e){return new D({values:t,typeName:_.ZodEnum,...y(e)})}class D extends v{constructor(){super(...arguments),Q.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return p(n,{expected:b.joinValues(s),received:n.parsedType,code:d.invalid_type}),g}if(ge(this,Q)||Ye(this,Q,new Set(this._def.values)),!ge(this,Q).has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:s}),g}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 D.create(e,{...this._def,...n})}exclude(e,n=this._def){return D.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}Q=new WeakMap;D.create=et;class le extends v{constructor(){super(...arguments),X.set(this,void 0)}_parse(e){const n=b.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==h.string&&s.parsedType!==h.number){const a=b.objectValues(n);return p(s,{expected:b.joinValues(a),received:s.parsedType,code:d.invalid_type}),g}if(ge(this,X)||Ye(this,X,new Set(b.getValidEnumValues(this._def.values))),!ge(this,X).has(e.data)){const a=b.objectValues(n);return p(s,{received:s.data,code:d.invalid_enum_value,options:a}),g}return w(e.data)}get enum(){return this._def.values}}X=new WeakMap;le.create=(t,e)=>new le({values:t,typeName:_.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}),g;const s=n.parsedType===h.promise?n.data:Promise.resolve(n.data);return w(s.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Y.create=(t,e)=>new Y({type:t,typeName:_.ZodPromise,...y(e)});class O extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{p(s,o),o.fatal?n.abort():n.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return g;const u=await this._def.schema._parseAsync({data:c,path:s.path,parent:s});return u.status==="aborted"?g:u.status==="dirty"||n.value==="dirty"?H(u.value):u});{if(n.value==="aborted")return g;const c=this._def.schema._parseSync({data:o,path:s.path,parent:s});return c.status==="aborted"?g:c.status==="dirty"||n.value==="dirty"?H(c.value):c}}if(a.type==="refinement"){const o=c=>{const u=a.refinement(c,i);if(s.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(s.common.async===!1){const c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return c.status==="aborted"?g:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>c.status==="aborted"?g:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(a.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ee(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:s.data,path:s.path,parent:s}).then(o=>ee(o)?Promise.resolve(a.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);b.assertNever(a)}}O.create=(t,e,n)=>new O({schema:t,typeName:_.ZodEffects,effect:e,...y(n)});O.createWithPreprocess=(t,e,n)=>new O({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...y(n)});class I extends v{_parse(e){return this._getType(e)===h.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}I.create=(t,e)=>new I({innerType:t,typeName:_.ZodOptional,...y(e)});class U extends v{_parse(e){return this._getType(e)===h.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(t,e)=>new U({innerType:t,typeName:_.ZodNullable,...y(e)});class ue extends v{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===h.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ue.create=(t,e)=>new ue({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class pe extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return te(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class ke extends v{_parse(e){if(this._getType(e)!==h.nan){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:h.nan,received:s.parsedType}),g}return{status:"valid",value:e.data}}}ke.create=t=>new ke({typeName:_.ZodNaN,...y(t)});const rn=Symbol("zod_brand");class Pe extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class fe extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?g:i.status==="dirty"?(n.dirty(),H(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?g:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(e,n){return new fe({in:e,out:n,typeName:_.ZodPipeline})}}class he extends v{_parse(e){const n=this._def.innerType._parse(e),s=a=>(ee(a)&&(a.value=Object.freeze(a.value)),a);return te(n)?n.then(a=>s(a)):s(n)}unwrap(){return this._def.innerType}}he.create=(t,e)=>new he({innerType:t,typeName:_.ZodReadonly,...y(e)});function tt(t,e={},n){return t?K.create().superRefine((s,a)=>{var i,o;if(!t(s)){const c=typeof e=="function"?e(s):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 sn={object:k.lazycreate};var _;(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"})(_||(_={}));const an=(t,e={message:`Input not instance of ${t.name}`})=>tt(n=>n instanceof t,e),nt=C.create,rt=P.create,on=ke.create,cn=M.create,st=ne.create,dn=L.create,ln=ye.create,un=re.create,pn=se.create,hn=K.create,fn=V.create,mn=R.create,_n=ve.create,gn=E.create,yn=k.create,vn=k.strictCreate,bn=ae.create,kn=xe.create,xn=ie.create,Sn=N.create,wn=oe.create,Tn=be.create,Cn=z.create,En=q.create,On=ce.create,In=de.create,jn=D.create,Nn=le.create,Zn=Y.create,Fe=O.create,Rn=I.create,An=U.create,Pn=O.createWithPreprocess,Mn=fe.create,Dn=()=>nt().optional(),Un=()=>rt().optional(),$n=()=>st().optional(),Vn={string:t=>C.create({...t,coerce:!0}),number:t=>P.create({...t,coerce:!0}),boolean:t=>ne.create({...t,coerce:!0}),bigint:t=>M.create({...t,coerce:!0}),date:t=>L.create({...t,coerce:!0})},Ln=g;var r=Object.freeze({__proto__:null,defaultErrorMap:F,setErrorMap:Vt,getErrorMap:me,makeIssue:_e,EMPTY_PATH:Lt,addIssueToContext:p,ParseStatus:S,INVALID:g,DIRTY:H,OK:w,isAborted:Ze,isDirty:Re,isValid:ee,isAsync:te,get util(){return b},get objectUtil(){return Ne},ZodParsedType:h,getParsedType:A,ZodType:v,datetimeRegex:Xe,ZodString:C,ZodNumber:P,ZodBigInt:M,ZodBoolean:ne,ZodDate:L,ZodSymbol:ye,ZodUndefined:re,ZodNull:se,ZodAny:K,ZodUnknown:V,ZodNever:R,ZodVoid:ve,ZodArray:E,ZodObject:k,ZodUnion:ae,ZodDiscriminatedUnion:xe,ZodIntersection:ie,ZodTuple:N,ZodRecord:oe,ZodMap:be,ZodSet:z,ZodFunction:q,ZodLazy:ce,ZodLiteral:de,ZodEnum:D,ZodNativeEnum:le,ZodPromise:Y,ZodEffects:O,ZodTransformer:O,ZodOptional:I,ZodNullable:U,ZodDefault:ue,ZodCatch:pe,ZodNaN:ke,BRAND:rn,ZodBranded:Pe,ZodPipeline:fe,ZodReadonly:he,custom:tt,Schema:v,ZodSchema:v,late:sn,get ZodFirstPartyTypeKind(){return _},coerce:Vn,any:hn,array:gn,bigint:cn,boolean:st,date:dn,discriminatedUnion:kn,effect:Fe,enum:jn,function:En,instanceof:an,intersection:xn,lazy:On,literal:In,map:Tn,nan:on,nativeEnum:Nn,never:mn,null:pn,nullable:An,number:rt,object:yn,oboolean:$n,onumber:Un,optional:Rn,ostring:Dn,pipeline:Mn,preprocess:Pn,promise:Zn,record:wn,set:Cn,strictObject:vn,string:nt,symbol:ln,transformer:Fe,tuple:Sn,undefined:un,union:bn,unknown:fn,void:_n,NEVER:Ln,ZodIssueCode:d,quotelessJson:$t,ZodError:T});Ut(r);const zn=r.object({start:r.number(),limit:r.number(),length:r.number()}),Me=r.object({created_at:r.string(),updated_at:r.string()}),at=r.object({email:r.string().optional(),email_verified:r.boolean().optional(),name:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),phone_number:r.string().optional(),phone_verified:r.boolean().optional(),family_name:r.string().optional()}).catchall(r.any()),it=r.object({connection:r.string(),user_id:r.string(),provider:r.string(),isSocial:r.boolean(),access_token:r.string().optional(),access_token_secret:r.string().optional(),refresh_token:r.string().optional(),profileData:at.optional()}),De=r.object({email:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),family_name:r.string().optional(),nickname:r.string().optional(),name:r.string().optional(),picture:r.string().optional(),locale:r.string().optional(),linked_to:r.string().optional(),profileData:r.string().optional(),user_id:r.string().optional()}),ot=De.extend({email_verified:r.boolean().default(!1),verify_email:r.boolean().optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string().optional(),provider:r.string().default("email"),connection:r.string().default("email")}),ct=ot.extend(Me.shape).extend({user_id:r.string(),email:r.string(),is_social:r.boolean(),login_count:r.number(),identities:r.array(it).optional()}),Bn=ct,Wn=De.extend({email:r.string(),login_count:r.number(),multifactor:r.array(r.string()).optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string()}).catchall(r.any()),dt=r.object({audience:r.string().optional(),recipient:r.string().optional(),createUpnClaim:r.boolean().optional(),mapUnknownClaimsAsIs:r.boolean().optional(),passthroughClaimsWithNoMapping:r.boolean().optional(),mapIdentities:r.boolean().optional(),signatureAlgorithm:r.string().optional(),digestAlgorithm:r.string().optional(),issuer:r.string().optional(),destination:r.string().optional(),lifetimeInSeconds:r.number().optional(),signResponse:r.boolean().optional(),nameIdentifierFormat:r.string().optional(),nameIdentifierProbes:r.array(r.string()).optional(),authnContextClassRef:r.string().optional(),mappings:r.record(r.string()).optional()}),lt=r.object({id:r.string(),name:r.string(),callbacks:r.array(r.string()).openapi({description:"Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."}),allowed_origins:r.array(r.string()).openapi({description:"Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."}),web_origins:r.array(r.string()).openapi({description:"Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."}),allowed_logout_urls:r.array(r.string()).openapi({description:"Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."}),addons:r.object({samlp:dt.optional()}).optional().openapi({description:"Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."}),email_validation:r.enum(["enabled","disabled","enforced"]).default("enforced").openapi({description:"Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"}),client_secret:r.string().default(""),disable_sign_ups:r.boolean().default(!1).openapi({description:"Prevents users from signing up using the hosted login page. This is not available in auth0"})}),ut=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),...lt.shape});var Ue=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(Ue||{}),$e=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t.SAML_POST="saml_post",t))($e||{}),Ve=(t=>(t.S265="S256",t.plain="plain",t))(Ve||{});const pt=r.object({client_id:r.string(),vendor_id:r.string().optional(),response_type:r.nativeEnum(Ue).optional(),response_mode:r.nativeEnum($e).optional(),redirect_uri:r.string().optional(),audience:r.string().optional(),state:r.string().optional(),nonce:r.string().optional(),scope:r.string().optional(),code_challenge_method:r.nativeEnum(Ve).optional(),code_challenge:r.string().optional(),username:r.string().optional()}),Gn=r.object({colors:r.object({primary:r.string(),page_background:r.object({type:r.string().optional(),start:r.string().optional(),end:r.string().optional(),angle_deg:r.number().optional()}).optional()}).optional(),logo_url:r.string().optional(),favicon_url:r.string().optional(),font:r.object({url:r.string()}).optional()}),ht=r.object({id:r.string().optional(),name:r.string(),client_id:r.string().optional(),client_secret:r.string().optional(),authorization_endpoint:r.string().optional(),response_type:r.custom().optional(),response_mode:r.custom().optional(),private_key:r.string().optional(),kid:r.string().optional(),team_id:r.string().optional(),token_endpoint:r.string().optional(),token_exchange_basic_auth:r.boolean().optional(),userinfo_endpoint:r.string().optional(),scope:r.string().optional()}),ft=r.object({id:r.string(),created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(ht.shape),mt=r.object({name:r.string(),audience:r.string(),sender_email:r.string().email(),sender_name:r.string(),support_url:r.string().url().optional(),logo:r.string().url().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),language:r.string().optional()}),_t=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),id:r.string(),...mt.shape}),Hn=r.object({logoUrl:r.string(),loginBackgroundImage:r.string().nullish(),style:r.object({primaryColor:r.string(),buttonTextColor:r.string(),primaryHoverColor:r.string()}),supportEmail:r.string().nullable(),supportUrl:r.string().nullable(),name:r.string(),showGreyishBackground:r.boolean().optional(),termsAndConditionsUrl:r.string().nullable(),companyName:r.string().optional(),checkoutHideSocial:r.boolean().optional(),siteUrl:r.string().nullable(),manageSubscriptionsUrl:r.string().optional()}),qn=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.union([r.literal("mailgun"),r.literal("mailchannels")]).optional()});r.object({...ut.shape,domains:r.array(qn),tenant:_t,connections:r.array(ft)});const gt=r.enum(["password_reset","email_verification","otp","authorization_code","oauth2_state","ticket"]),yt=r.object({code_id:r.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:r.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:r.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:gt,expires_at:r.string(),used_at:r.string().optional(),user_id:r.string().optional()}),Fn=r.object({...yt.shape,created_at:r.string()}),vt=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.enum(["mailgun","mailchannels"])}),Kn=Me.extend({...vt.shape,id:r.string()}),bt=r.object({trigger_id:r.enum(["pre-user-signup","post-user-registration","post-user-login"]),enabled:r.boolean().default(!1),url:r.string(),hook_id:r.string().optional(),synchronous:r.boolean().default(!1),priority:r.number().optional()}),Yn=bt.extend({...Me.shape,hook_id:r.string()}),kt=r.object({alg:r.enum(["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512"]),e:r.string(),kid:r.string(),kty:r.enum(["RSA","EC","oct"]),n:r.string(),x5t:r.string().optional(),x5c:r.array(r.string()).optional(),use:r.enum(["sig","enc"]).optional()}),Jn=r.object({keys:r.array(kt)}),Qn=r.object({issuer:r.string(),authorization_endpoint:r.string(),token_endpoint:r.string(),device_authorization_endpoint:r.string(),userinfo_endpoint:r.string(),mfa_challenge_endpoint:r.string(),jwks_uri:r.string(),registration_endpoint:r.string(),revocation_endpoint:r.string(),scopes_supported:r.array(r.string()),response_types_supported:r.array(r.string()),code_challenge_methods_supported:r.array(r.string()),response_modes_supported:r.array(r.string()),subject_types_supported:r.array(r.string()),id_token_signing_alg_values_supported:r.array(r.string()),token_endpoint_auth_methods_supported:r.array(r.string()),claims_supported:r.array(r.string()),request_uri_parameter_supported:r.boolean(),request_parameter_supported:r.boolean(),token_endpoint_auth_signing_alg_values_supported:r.array(r.string())}),xt=r.object({auth0Client:r.string().optional(),authParams:pt,expires_at:r.string(),deleted_at:r.string().optional(),ip:r.string().optional()}).openapi({description:"This represents a login sesion"}),Xn=r.object({...xt.shape,login_id:r.string().openapi({description:"This is is used as the state in the universal login"}),created_at:r.string(),updated_at:r.string()});var St=(t=>(t.FAILED_SILENT_AUTH="fsa",t.FAILED_SIGNUP="fs",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.FAILED_CHANGE_PASSWORD="fcp",t.FAILED_BY_CONNECTOR="fc",t.FAILED_LOGIN_INVALID_EMAIL_USERNAME="fu",t.FAILED_HOOK="fh",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_CHANGE_PASSWORD="scp",t.SUCCESS_CHANGE_PASSWORD_REQUEST="scpr",t.SUCCESS_CHANGE_USERNAME="scu",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.SUCCESS_LOGIN="s",t.SUCCESS_LOGOUT="slo",t.SUCCESS_SIGNUP="ss",t.SUCCESS_SILENT_AUTH="ssa",t.SUCCESS_VERIFICATION_EMAIL="sv",t.SUCCESS_VERIFICATION_EMAIL_REQUEST="svr",t.CODE_LINK_SENT="cls",t))(St||{});const er=r.enum(["cls","fsa","fs","f","fc","fcoa","fcp","fh","fp","fs","fu","s","sapi","scoa","scp","scpr","scu","seacft","serft","slo","ss","ssa","sv","svr"]),wt=r.object({name:r.string(),version:r.string(),env:r.object({node:r.string().optional()}).optional()}),tr=r.object({type:er,date:r.string(),description:r.string().optional(),log_id:r.string().optional(),_id:r.string().optional(),ip:r.string(),user_agent:r.string(),details:r.any().optional(),isMobile:r.boolean(),user_id:r.string().optional(),user_name:r.string().optional(),connection:r.string().optional(),connection_id:r.string().optional(),client_id:r.string().optional(),client_name:r.string().optional(),audience:r.string().optional(),scope:r.array(r.string()).optional(),strategy:r.string().optional(),strategy_type:r.string().optional(),hostname:r.string().optional(),auth0_client:wt.optional()}),Tt=r.object({user_id:r.string(),password:r.string(),algorithm:r.enum(["bcrypt","argon2id"]).default("argon2id")}),nr=r.object({...Tt.shape,created_at:r.string(),updated_at:r.string()}),Ct=r.object({session_id:r.string(),client_id:r.string(),expires_at:r.string(),used_at:r.string(),deleted_at:r.string().optional(),user_id:r.string()}),rr=r.object({created_at:r.string(),...Ct.shape}),sr=r.object({kid:r.string().openapi({description:"The key id of the signing key"}),cert:r.string().openapi({description:"The public certificate of the signing key"}),fingerprint:r.string().openapi({description:"The cert fingerprint"}),thumbprint:r.string().openapi({description:"The cert thumbprint"}),pkcs7:r.string().optional().openapi({description:"The private key in pkcs7 format"}),current:r.boolean().optional().openapi({description:"True if the key is the current key"}),next:r.boolean().optional().openapi({description:"True if the key is the next key"}),previous:r.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:r.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:r.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:r.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:r.string().optional().openapi({description:"The date and time when the key was revoked"})});var Le=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(Le||{});const ze=r.nativeEnum(Le),ar=r.object({grant_type:ze.refine(t=>t==="authorization_code"),code:r.string(),client_secret:r.string(),client_id:r.string()}),ir=r.object({grant_type:ze.refine(t=>t==="authorization_code"),code:r.string(),code_verifier:r.string(),client_id:r.string().optional(),redirect_uri:r.string()}),or=r.object({grant_type:ze.refine(t=>t==="client_credentials"),scope:r.string().optional(),client_secret:r.string(),client_id:r.string(),audience:r.string().optional()});r.object({access_token:r.string(),id_token:r.string().optional(),scope:r.string().optional(),state:r.string().optional(),refresh_token:r.string().optional(),token_type:r.string(),expires_in:r.number()});r.object({code:r.string(),state:r.string().optional()});const Et=r.object({button_border_radius:r.number(),button_border_weight:r.number(),buttons_style:r.enum(["pill"]),input_border_radius:r.number(),input_border_weight:r.number(),inputs_style:r.enum(["pill"]),show_widget_shadow:r.boolean(),widget_border_weight:r.number(),widget_corner_radius:r.number()}),Ot=r.object({base_focus_color:r.string(),base_hover_color:r.string(),body_text:r.string(),captcha_widget_theme:r.enum(["auto"]),error:r.string(),header:r.string(),icons:r.string(),input_background:r.string(),input_border:r.string(),input_filled_text:r.string(),input_labels_placeholders:r.string(),links_focused_components:r.string(),primary_button:r.string(),primary_button_label:r.string(),secondary_button_border:r.string(),secondary_button_label:r.string(),success:r.string(),widget_background:r.string(),widget_border:r.string()}),$=r.object({bold:r.boolean(),size:r.number()}),It=r.object({body_text:$,buttons_text:$,font_url:r.string(),input_labels:$,links:$,links_style:r.enum(["normal"]),reference_text_size:r.number(),subtitle:$,title:$}),jt=r.object({background_color:r.string(),background_image_url:r.string(),page_layout:r.enum(["center"])}),Nt=r.object({header_text_alignment:r.enum(["center"]),logo_height:r.number(),logo_position:r.enum(["center"]),logo_url:r.string(),social_buttons_layout:r.enum(["bottom"])}),Zt=r.object({borders:Et,colors:Ot,displayName:r.string(),fonts:It,page_background:jt,widget:Nt}),cr=Zt.extend({themeId:r.string()});function dr(t){const[e,n]=t.split("|");if(!e||!n)throw new Error(`Invalid user_id: ${t}`);return{connection:e,id:n}}exports.Auth0Client=wt;exports.AuthorizationResponseMode=$e;exports.AuthorizationResponseType=Ue;exports.CodeChallengeMethod=Ve;exports.GrantType=Le;exports.LogTypes=St;exports.applicationInsertSchema=lt;exports.applicationSchema=ut;exports.auth0UserResponseSchema=Bn;exports.authParamsSchema=pt;exports.authorizationCodeGrantTypeParamsSchema=ar;exports.baseUserSchema=De;exports.bordersSchema=Et;exports.brandingSchema=Gn;exports.clientCredentialGrantTypeParamsSchema=or;exports.codeInsertSchema=yt;exports.codeSchema=Fn;exports.codeTypeSchema=gt;exports.colorsSchema=Ot;exports.connectionInsertSchema=ht;exports.connectionSchema=ft;exports.domainInsertSchema=vt;exports.domainSchema=Kn;exports.fontDetailsSchema=$;exports.fontsSchema=It;exports.hookInsertSchema=bt;exports.hookSchema=Yn;exports.identitySchema=it;exports.jwksKeySchema=Jn;exports.jwksSchema=kt;exports.logSchema=tr;exports.loginInsertSchema=xt;exports.loginSchema=Xn;exports.openIDConfigurationSchema=Qn;exports.pageBackgroundSchema=jt;exports.parseUserId=dr;exports.passwordInsertSchema=Tt;exports.passwordSchema=nr;exports.pkceAuthorizationCodeGrantTypeParamsSchema=ir;exports.profileDataSchema=at;exports.samlpAddon=dt;exports.sessionInsertSchema=Ct;exports.sessionSchema=rr;exports.signingKeySchema=sr;exports.tenantInsertSchema=mt;exports.tenantSchema=_t;exports.themeInsertSchema=Zt;exports.themeSchema=cr;exports.totalsSchema=zn;exports.userInsertSchema=ot;exports.userResponseSchema=Wn;exports.userSchema=ct;exports.vendorSettingsSchema=Hn;exports.widgetSchema=Nt;
|
|
@@ -1847,67 +1847,117 @@ export declare const identitySchema: z.ZodObject<{
|
|
|
1847
1847
|
}>;
|
|
1848
1848
|
export type Identity = z.infer<typeof identitySchema>;
|
|
1849
1849
|
export declare const jwksSchema: z.ZodObject<{
|
|
1850
|
-
alg: z.
|
|
1850
|
+
alg: z.ZodEnum<[
|
|
1851
|
+
"RS256",
|
|
1852
|
+
"RS384",
|
|
1853
|
+
"RS512",
|
|
1854
|
+
"ES256",
|
|
1855
|
+
"ES384",
|
|
1856
|
+
"ES512",
|
|
1857
|
+
"HS256",
|
|
1858
|
+
"HS384",
|
|
1859
|
+
"HS512"
|
|
1860
|
+
]>;
|
|
1851
1861
|
e: z.ZodString;
|
|
1852
1862
|
kid: z.ZodString;
|
|
1853
|
-
kty: z.
|
|
1863
|
+
kty: z.ZodEnum<[
|
|
1864
|
+
"RSA",
|
|
1865
|
+
"EC",
|
|
1866
|
+
"oct"
|
|
1867
|
+
]>;
|
|
1854
1868
|
n: z.ZodString;
|
|
1855
|
-
|
|
1869
|
+
x5t: z.ZodOptional<z.ZodString>;
|
|
1870
|
+
x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1871
|
+
use: z.ZodOptional<z.ZodEnum<[
|
|
1872
|
+
"sig",
|
|
1873
|
+
"enc"
|
|
1874
|
+
]>>;
|
|
1856
1875
|
}, "strip", z.ZodTypeAny, {
|
|
1857
1876
|
kid: string;
|
|
1858
|
-
alg:
|
|
1877
|
+
alg: "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "HS256" | "HS384" | "HS512";
|
|
1859
1878
|
e: string;
|
|
1860
|
-
kty:
|
|
1879
|
+
kty: "RSA" | "EC" | "oct";
|
|
1861
1880
|
n: string;
|
|
1862
|
-
|
|
1881
|
+
x5t?: string | undefined;
|
|
1882
|
+
x5c?: string[] | undefined;
|
|
1883
|
+
use?: "sig" | "enc" | undefined;
|
|
1863
1884
|
}, {
|
|
1864
1885
|
kid: string;
|
|
1865
|
-
alg:
|
|
1886
|
+
alg: "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "HS256" | "HS384" | "HS512";
|
|
1866
1887
|
e: string;
|
|
1867
|
-
kty:
|
|
1888
|
+
kty: "RSA" | "EC" | "oct";
|
|
1868
1889
|
n: string;
|
|
1869
|
-
|
|
1890
|
+
x5t?: string | undefined;
|
|
1891
|
+
x5c?: string[] | undefined;
|
|
1892
|
+
use?: "sig" | "enc" | undefined;
|
|
1870
1893
|
}>;
|
|
1871
1894
|
export declare const jwksKeySchema: z.ZodObject<{
|
|
1872
1895
|
keys: z.ZodArray<z.ZodObject<{
|
|
1873
|
-
alg: z.
|
|
1896
|
+
alg: z.ZodEnum<[
|
|
1897
|
+
"RS256",
|
|
1898
|
+
"RS384",
|
|
1899
|
+
"RS512",
|
|
1900
|
+
"ES256",
|
|
1901
|
+
"ES384",
|
|
1902
|
+
"ES512",
|
|
1903
|
+
"HS256",
|
|
1904
|
+
"HS384",
|
|
1905
|
+
"HS512"
|
|
1906
|
+
]>;
|
|
1874
1907
|
e: z.ZodString;
|
|
1875
1908
|
kid: z.ZodString;
|
|
1876
|
-
kty: z.
|
|
1909
|
+
kty: z.ZodEnum<[
|
|
1910
|
+
"RSA",
|
|
1911
|
+
"EC",
|
|
1912
|
+
"oct"
|
|
1913
|
+
]>;
|
|
1877
1914
|
n: z.ZodString;
|
|
1878
|
-
|
|
1915
|
+
x5t: z.ZodOptional<z.ZodString>;
|
|
1916
|
+
x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1917
|
+
use: z.ZodOptional<z.ZodEnum<[
|
|
1918
|
+
"sig",
|
|
1919
|
+
"enc"
|
|
1920
|
+
]>>;
|
|
1879
1921
|
}, "strip", z.ZodTypeAny, {
|
|
1880
1922
|
kid: string;
|
|
1881
|
-
alg:
|
|
1923
|
+
alg: "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "HS256" | "HS384" | "HS512";
|
|
1882
1924
|
e: string;
|
|
1883
|
-
kty:
|
|
1925
|
+
kty: "RSA" | "EC" | "oct";
|
|
1884
1926
|
n: string;
|
|
1885
|
-
|
|
1927
|
+
x5t?: string | undefined;
|
|
1928
|
+
x5c?: string[] | undefined;
|
|
1929
|
+
use?: "sig" | "enc" | undefined;
|
|
1886
1930
|
}, {
|
|
1887
1931
|
kid: string;
|
|
1888
|
-
alg:
|
|
1932
|
+
alg: "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "HS256" | "HS384" | "HS512";
|
|
1889
1933
|
e: string;
|
|
1890
|
-
kty:
|
|
1934
|
+
kty: "RSA" | "EC" | "oct";
|
|
1891
1935
|
n: string;
|
|
1892
|
-
|
|
1936
|
+
x5t?: string | undefined;
|
|
1937
|
+
x5c?: string[] | undefined;
|
|
1938
|
+
use?: "sig" | "enc" | undefined;
|
|
1893
1939
|
}>, "many">;
|
|
1894
1940
|
}, "strip", z.ZodTypeAny, {
|
|
1895
1941
|
keys: {
|
|
1896
1942
|
kid: string;
|
|
1897
|
-
alg:
|
|
1943
|
+
alg: "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "HS256" | "HS384" | "HS512";
|
|
1898
1944
|
e: string;
|
|
1899
|
-
kty:
|
|
1945
|
+
kty: "RSA" | "EC" | "oct";
|
|
1900
1946
|
n: string;
|
|
1901
|
-
|
|
1947
|
+
x5t?: string | undefined;
|
|
1948
|
+
x5c?: string[] | undefined;
|
|
1949
|
+
use?: "sig" | "enc" | undefined;
|
|
1902
1950
|
}[];
|
|
1903
1951
|
}, {
|
|
1904
1952
|
keys: {
|
|
1905
1953
|
kid: string;
|
|
1906
|
-
alg:
|
|
1954
|
+
alg: "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "HS256" | "HS384" | "HS512";
|
|
1907
1955
|
e: string;
|
|
1908
|
-
kty:
|
|
1956
|
+
kty: "RSA" | "EC" | "oct";
|
|
1909
1957
|
n: string;
|
|
1910
|
-
|
|
1958
|
+
x5t?: string | undefined;
|
|
1959
|
+
x5c?: string[] | undefined;
|
|
1960
|
+
use?: "sig" | "enc" | undefined;
|
|
1911
1961
|
}[];
|
|
1912
1962
|
}>;
|
|
1913
1963
|
export declare const openIDConfigurationSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var adapterInterfaces=function(m){"use strict";function At(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(t);s<a.length;s++)e.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(t,a[s])&&(n[a[s]]=t[a[s]]);return n}typeof SuppressedError=="function"&&SuppressedError;function Pt(t,e){var n;return((n=t==null?void 0:t._def)===null||n===void 0?void 0:n.typeName)===e}function Q(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...a){const s=n.apply(this,a);return s._def.openapi=this._def.openapi,s}}function Mt(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(s,i){var o,c,u,l,_,w;const Y=typeof s=="string"?i:s,J=Y??{},{param:jt}=J,rr=At(J,["param"]),Nt=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof s=="string"?{refId:s}:void 0),Zt=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),rr),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||jt?{param:Object.assign(Object.assign({},(w=(_=this._def.openapi)===null||_===void 0?void 0:_.metadata)===null||w===void 0?void 0:w.param),jt)}:void 0),Rt=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(Nt).length>0?{_internal:Nt}:void 0),Object.keys(Zt).length>0?{metadata:Zt}:void 0)}));if(Pt(this,"ZodObject")){const ar=this.extend;Rt.extend=function(...sr){var De,Ue,$e,Ve,Le,ze;const Be=ar.apply(this,sr);return Be._def.openapi={_internal:{extendedFrom:!((Ue=(De=this._def.openapi)===null||De===void 0?void 0:De._internal)===null||Ue===void 0)&&Ue.refId?{refId:(Ve=($e=this._def.openapi)===null||$e===void 0?void 0:$e._internal)===null||Ve===void 0?void 0:Ve.refId,schema:this}:(Le=this._def.openapi)===null||Le===void 0?void 0:Le._internal.extendedFrom},metadata:(ze=Be._def.openapi)===null||ze===void 0?void 0:ze.metadata},Be}}return Rt},Q(t,"optional"),Q(t,"nullable"),Q(t,"default"),Q(t,"transform"),Q(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const s=this._def.shape(),i=e.apply(this),o=i._def.shape();return Object.entries(o).forEach(([c,u])=>{var l,_;u._def.openapi=(_=(l=s[c])===null||l===void 0?void 0:l._def)===null||_===void 0?void 0:_.openapi}),i._def.openapi=void 0,i};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...s){const i=n.apply(this,s);return i._def.openapi=void 0,i};const a=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...s){const i=a.apply(this,s);return i._def.openapi=void 0,i}}new Set(".\\+*[^]$()");var k;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of i)o[c]=s[c];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=a,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(k||(k={}));var we;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(we||(we={}));const h=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=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=k.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"]),Dt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class C extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};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},a={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)a._errors.push(n(o));else{let c=a,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 s(this),a}static assert(e){if(!(e instanceof C))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},a=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}C.create=t=>new C(t);const W=(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,k.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${k.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${k.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${k.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}"`:k.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,k.assertNever(t)}return{message:n}};let We=W;function Ut(t){We=t}function _e(){return We}const ge=t=>{const{data:e,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="";const u=a.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...s,path:i,message:c}},$t=[];function p(t,e){const n=_e(),a=ge({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===W?void 0:W].filter(s=>!!s)});t.common.issues.push(a)}class x{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const a=[];for(const s of n){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,n){const a=[];for(const s of n){const i=await s.key,o=await s.value;a.push({key:i,value:o})}return x.mergeObjectSync(e,a)}static mergeObjectSync(e,n){const a={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return y;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(a[i.value]=o.value)}return{status:e.value,value:a}}}const y=Object.freeze({status:"aborted"}),G=t=>({status:"dirty",value:t}),T=t=>({status:"valid",value:t}),Te=t=>t.status==="aborted",Ce=t=>t.status==="dirty",X=t=>t.status==="valid",ee=t=>typeof Promise<"u"&&t instanceof Promise;function ye(t,e,n,a){if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Ge(t,e,n,a,s){if(typeof e=="function"?t!==e||!s:!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}typeof SuppressedError=="function"&&SuppressedError;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 te,ne;class j{constructor(e,n,a,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=a,this._key=s}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 He=(t,e)=>{if(X(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 C(t.common.issues);return this._error=n,this._error}}};function v(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:a,description:s}=t;if(e&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,c)=>{var u,l;const{message:_}=t;return o.code==="invalid_enum_value"?{message:_??c.defaultError}:typeof c.data>"u"?{message:(u=_??a)!==null&&u!==void 0?u:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(l=_??n)!==null&&l!==void 0?l:c.defaultError}},description:s}}class b{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 P(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new x,ctx:{common:e.parent.common,data:e.data,parsedType:P(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 a=this.safeParse(e,n);if(a.success)return a.data;throw a.error}safeParse(e,n){var a;const s={common:{issues:[],async:(a=n==null?void 0:n.async)!==null&&a!==void 0?a:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},i=this._parseSync({data:e,path:s.path,parent:s});return He(s,i)}async parseAsync(e,n){const a=await this.safeParseAsync(e,n);if(a.success)return a.data;throw a.error}async safeParseAsync(e,n){const a={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:P(e)},s=this._parse({data:e,path:a.path,parent:a}),i=await(ee(s)?s:Promise.resolve(s));return He(a,i)}refine(e,n){const a=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),c=()=>i.addIssue({code:d.custom,...a(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((a,s)=>e(a)?!0:(s.addIssue(typeof n=="function"?n(a,s):n),!1))}_refinement(e){return new I({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Z.create(this,this._def)}nullable(){return $.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this,this._def)}promise(){return K.create(this,this._def)}or(e){return ie.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new I({...v(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new pe({...v(this._def),innerType:this,defaultValue:n,typeName:g.ZodDefault})}brand(){return new Ie({typeName:g.ZodBranded,type:this,...v(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new he({...v(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 fe.create(this,e)}readonly(){return me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vt=/^c[^\s-]{8,}$/i,Lt=/^[0-9a-z]+$/,zt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Bt=/^[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,Wt=/^[a-z0-9_-]{21}$/i,Gt=/^[-+]?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)?)??$/,Ht=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ee;const Ft=/^(?:(?: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])$/,Kt=/^(([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})))$/,Yt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qe="((\\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])))",Jt=new RegExp(`^${qe}$`);function Fe(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 Qt(t){return new RegExp(`^${Fe(t)}$`)}function Ke(t){let e=`${qe}T${Fe(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 Xt(t,e){return!!((e==="v4"||!e)&&Ft.test(t)||(e==="v6"||!e)&&Kt.test(t))}class E extends b{_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}),y}const a=new x;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(s=this._getOrReturnCtx(e,s),o?p(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&p(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")Ht.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"email",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")Ee||(Ee=new RegExp(qt,"u")),Ee.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"emoji",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")Bt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"uuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")Wt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"nanoid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Vt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")Lt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid2",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")zt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ulid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),p(s,{validation:"url",code:d.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"regex",code:d.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.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)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?Ke(i).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?Jt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?Qt(i).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?Gt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"duration",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?Xt(e.data,i.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ip",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?Yt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64",code:d.invalid_string,message:i.message}),a.dirty()):k.assertNever(i);return{status:a.value,value:e.data}}_regex(e,n,a){return this.refinement(s=>e.test(s),{validation:n,code:d.invalid_string,...f.errToObj(a)})}_addCheck(e){return new E({...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,a;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:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!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 E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...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}}E.create=t=>{var e;return new E({checks:[],typeName:g.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};function en(t,e){const n=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,s=n>a?n:a,i=parseInt(t.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class M extends b{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}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="int"?k.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?en(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.not_finite,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.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,a,s){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:f.toString(s)}]})}_addCheck(e){return new M({...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"&&k.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(n)&&Number.isFinite(e)}}M.create=t=>new M({checks:[],typeName:g.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class D extends b{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}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.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,a,s){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:f.toString(s)}]})}_addCheck(e){return new D({...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}}D.create=t=>{var e;return new D({checks:[],typeName:g.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};class re extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.boolean,received:a.parsedType}),y}return T(e.data)}}re.create=t=>new re({typeName:g.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class V extends b{_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}),y}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_date}),y}const a=new x;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):k.assertNever(i);return{status:a.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,...v(t)});class ve extends b{_parse(e){if(this._getType(e)!==h.symbol){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.symbol,received:a.parsedType}),y}return T(e.data)}}ve.create=t=>new ve({typeName:g.ZodSymbol,...v(t)});class ae extends b{_parse(e){if(this._getType(e)!==h.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.undefined,received:a.parsedType}),y}return T(e.data)}}ae.create=t=>new ae({typeName:g.ZodUndefined,...v(t)});class se extends b{_parse(e){if(this._getType(e)!==h.null){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.null,received:a.parsedType}),y}return T(e.data)}}se.create=t=>new se({typeName:g.ZodNull,...v(t)});class H extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}}H.create=t=>new H({typeName:g.ZodAny,...v(t)});class L extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}}L.create=t=>new L({typeName:g.ZodUnknown,...v(t)});class R extends b{_parse(e){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:h.never,received:n.parsedType}),y}}R.create=t=>new R({typeName:g.ZodNever,...v(t)});class be extends b{_parse(e){if(this._getType(e)!==h.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.void,received:a.parsedType}),y}return T(e.data)}}be.create=t=>new be({typeName:g.ZodVoid,...v(t)});class O extends b{_parse(e){const{ctx:n,status:a}=this._processInputParams(e),s=this._def;if(n.parsedType!==h.array)return p(n,{code:d.invalid_type,expected:h.array,received:n.parsedType}),y;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(p(n,{code:o?d.too_big:d.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(p(n,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(p(n,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>s.type._parseAsync(new j(n,o,n.path,c)))).then(o=>x.mergeArray(a,o));const i=[...n.data].map((o,c)=>s.type._parseSync(new j(n,o,n.path,c)));return x.mergeArray(a,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,...v(e)});function q(t){if(t instanceof S){const e={};for(const n in t.shape){const a=t.shape[n];e[n]=Z.create(q(a))}return new S({...t._def,shape:()=>e})}else return t instanceof O?new O({...t._def,type:q(t.element)}):t instanceof Z?Z.create(q(t.unwrap())):t instanceof $?$.create(q(t.unwrap())):t instanceof N?N.create(t.items.map(e=>q(e))):t}class S extends b{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=k.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}),y}const{status:a,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const l in s.data)o.includes(l)||c.push(l);const u=[];for(const l of o){const _=i[l],w=s.data[l];u.push({key:{status:"valid",value:l},value:_._parse(new j(s,w,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof R){const l=this._def.unknownKeys;if(l==="passthrough")for(const _ of c)u.push({key:{status:"valid",value:_},value:{status:"valid",value:s.data[_]}});else if(l==="strict")c.length>0&&(p(s,{code:d.unrecognized_keys,keys:c}),a.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const _ of c){const w=s.data[_];u.push({key:{status:"valid",value:_},value:l._parse(new j(s,w,s.path,_)),alwaysSet:_ in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const _ of u){const w=await _.key,Y=await _.value;l.push({key:w,value:Y,alwaysSet:_.alwaysSet})}return l}).then(l=>x.mergeObjectSync(a,l)):x.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new S({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,a)=>{var s,i,o,c;const u=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,n,a).message)!==null&&o!==void 0?o:a.defaultError;return n.code==="unrecognized_keys"?{message:(c=f.errToObj(e).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(e){return new S({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new S({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 S({...this._def,catchall:e})}pick(e){const n={};return k.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}omit(e){const n={};return k.objectKeys(this.shape).forEach(a=>{e[a]||(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}deepPartial(){return q(this)}partial(e){const n={};return k.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];e&&!e[a]?n[a]=s:n[a]=s.optional()}),new S({...this._def,shape:()=>n})}required(e){const n={};return k.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])n[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof Z;)i=i._def.innerType;n[a]=i}}),new S({...this._def,shape:()=>n})}keyof(){return Ye(k.objectKeys(this.shape))}}S.create=(t,e)=>new S({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...v(e)}),S.strictCreate=(t,e)=>new S({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:g.ZodObject,...v(e)}),S.lazycreate=(t,e)=>new S({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...v(e)});class ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=this._def.options;function s(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 C(c.ctx.common.issues));return p(n,{code:d.invalid_union,unionErrors:o}),y}if(n.common.async)return Promise.all(a.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(s);{let i;const o=[];for(const u of a){const l={...n,common:{...n.common,issues:[]},parent:null},_=u._parseSync({data:n.data,path:n.path,parent:l});if(_.status==="valid")return _;_.status==="dirty"&&!i&&(i={result:_,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 C(u));return p(n,{code:d.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}ie.create=(t,e)=>new ie({options:t,typeName:g.ZodUnion,...v(e)});const A=t=>t instanceof de?A(t.schema):t instanceof I?A(t.innerType()):t instanceof le?[t.value]:t instanceof U?t.options:t instanceof ue?k.objectValues(t.enum):t instanceof pe?A(t._def.innerType):t instanceof ae?[void 0]:t instanceof se?[null]:t instanceof Z?[void 0,...A(t.unwrap())]:t instanceof $?[null,...A(t.unwrap())]:t instanceof Ie||t instanceof me?A(t.unwrap()):t instanceof he?A(t._def.innerType):[];class ke extends b{_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}),y;const a=this.discriminator,s=n.data[a],i=this.optionsMap.get(s);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:[a]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,a){const s=new Map;for(const i of n){const o=A(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(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,i)}}return new ke({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...v(a)})}}function Oe(t,e){const n=P(t),a=P(e);if(t===e)return{valid:!0,data:t};if(n===h.object&&a===h.object){const s=k.objectKeys(e),i=k.objectKeys(t).filter(c=>s.indexOf(c)!==-1),o={...t,...e};for(const c of i){const u=Oe(t[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===h.array&&a===h.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],c=e[i],u=Oe(o,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===h.date&&a===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class oe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e),s=(i,o)=>{if(Te(i)||Te(o))return y;const c=Oe(i.value,o.value);return c.valid?((Ce(i)||Ce(o))&&n.dirty(),{status:n.value,value:c.data}):(p(a,{code:d.invalid_intersection_types}),y)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}oe.create=(t,e,n)=>new oe({left:t,right:e,typeName:g.ZodIntersection,...v(n)});class N extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.array)return p(a,{code:d.invalid_type,expected:h.array,received:a.parsedType}),y;if(a.data.length<this._def.items.length)return p(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&a.data.length>this._def.items.length&&(p(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...a.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new j(a,o,a.path,c)):null}).filter(o=>!!o);return a.common.async?Promise.all(i).then(o=>x.mergeArray(n,o)):x.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,...v(e)})};class ce extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.object)return p(a,{code:d.invalid_type,expected:h.object,received:a.parsedType}),y;const s=[],i=this._def.keyType,o=this._def.valueType;for(const c in a.data)s.push({key:i._parse(new j(a,c,a.path,c)),value:o._parse(new j(a,a.data[c],a.path,c)),alwaysSet:c in a.data});return a.common.async?x.mergeObjectAsync(n,s):x.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,a){return n instanceof b?new ce({keyType:e,valueType:n,typeName:g.ZodRecord,...v(a)}):new ce({keyType:E.create(),valueType:e,typeName:g.ZodRecord,...v(n)})}}class Se extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.map)return p(a,{code:d.invalid_type,expected:h.map,received:a.parsedType}),y;const s=this._def.keyType,i=this._def.valueType,o=[...a.data.entries()].map(([c,u],l)=>({key:s._parse(new j(a,c,a.path,[l,"key"])),value:i._parse(new j(a,u,a.path,[l,"value"]))}));if(a.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,_=await u.value;if(l.status==="aborted"||_.status==="aborted")return y;(l.status==="dirty"||_.status==="dirty")&&n.dirty(),c.set(l.value,_.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const l=u.key,_=u.value;if(l.status==="aborted"||_.status==="aborted")return y;(l.status==="dirty"||_.status==="dirty")&&n.dirty(),c.set(l.value,_.value)}return{status:n.value,value:c}}}}Se.create=(t,e,n)=>new Se({valueType:e,keyType:t,typeName:g.ZodMap,...v(n)});class z extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.set)return p(a,{code:d.invalid_type,expected:h.set,received:a.parsedType}),y;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(p(a,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(p(a,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const l=new Set;for(const _ of u){if(_.status==="aborted")return y;_.status==="dirty"&&n.dirty(),l.add(_.value)}return{status:n.value,value:l}}const c=[...a.data.values()].map((u,l)=>i._parse(new j(a,u,a.path,l)));return a.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new z({...this._def,minSize:{value:e,message:f.toString(n)}})}max(e,n){return new z({...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)}}z.create=(t,e)=>new z({valueType:t,minSize:null,maxSize:null,typeName:g.ZodSet,...v(e)});class F extends b{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}),y;function a(c,u){return ge({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function s(c,u){return ge({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].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 K){const c=this;return T(async function(...u){const l=new C([]),_=await c._def.args.parseAsync(u,i).catch(J=>{throw l.addIssue(a(u,J)),l}),w=await Reflect.apply(o,this,_);return await c._def.returns._def.type.parseAsync(w,i).catch(J=>{throw l.addIssue(s(w,J)),l})})}else{const c=this;return T(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new C([a(u,l.error)]);const _=Reflect.apply(o,this,l.data),w=c._def.returns.safeParse(_,i);if(!w.success)throw new C([s(_,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new F({...this._def,args:N.create(e).rest(L.create())})}returns(e){return new F({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,a){return new F({args:e||N.create([]).rest(L.create()),returns:n||L.create(),typeName:g.ZodFunction,...v(a)})}}class de extends b{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})}}de.create=(t,e)=>new de({getter:t,typeName:g.ZodLazy,...v(e)});class le extends b{_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}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}le.create=(t,e)=>new le({value:t,typeName:g.ZodLiteral,...v(e)});function Ye(t,e){return new U({values:t,typeName:g.ZodEnum,...v(e)})}class U extends b{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),a=this._def.values;return p(n,{expected:k.joinValues(a),received:n.parsedType,code:d.invalid_type}),y}if(ye(this,te)||Ge(this,te,new Set(this._def.values)),!ye(this,te).has(e.data)){const n=this._getOrReturnCtx(e),a=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:a}),y}return T(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 U.create(e,{...this._def,...n})}exclude(e,n=this._def){return U.create(this.options.filter(a=>!e.includes(a)),{...this._def,...n})}}te=new WeakMap,U.create=Ye;class ue extends b{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const n=k.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==h.string&&a.parsedType!==h.number){const s=k.objectValues(n);return p(a,{expected:k.joinValues(s),received:a.parsedType,code:d.invalid_type}),y}if(ye(this,ne)||Ge(this,ne,new Set(k.getValidEnumValues(this._def.values))),!ye(this,ne).has(e.data)){const s=k.objectValues(n);return p(a,{received:a.data,code:d.invalid_enum_value,options:s}),y}return T(e.data)}get enum(){return this._def.values}}ne=new WeakMap,ue.create=(t,e)=>new ue({values:t,typeName:g.ZodNativeEnum,...v(e)});class K extends b{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}),y;const a=n.parsedType===h.promise?n.data:Promise.resolve(n.data);return T(a.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}K.create=(t,e)=>new K({type:t,typeName:g.ZodPromise,...v(e)});class I extends b{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:a}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{p(a,o),o.fatal?n.abort():n.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(a.data,i);if(a.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:c,path:a.path,parent:a});return u.status==="aborted"?y:u.status==="dirty"||n.value==="dirty"?G(u.value):u});{if(n.value==="aborted")return y;const c=this._def.schema._parseSync({data:o,path:a.path,parent:a});return c.status==="aborted"?y:c.status==="dirty"||n.value==="dirty"?G(c.value):c}}if(s.type==="refinement"){const o=c=>{const u=s.refinement(c,i);if(a.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(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!X(o))return o;const c=s.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:a.data,path:a.path,parent:a}).then(o=>X(o)?Promise.resolve(s.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);k.assertNever(s)}}I.create=(t,e,n)=>new I({schema:t,typeName:g.ZodEffects,effect:e,...v(n)}),I.createWithPreprocess=(t,e,n)=>new I({schema:e,effect:{type:"preprocess",transform:t},typeName:g.ZodEffects,...v(n)});class Z extends b{_parse(e){return this._getType(e)===h.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Z.create=(t,e)=>new Z({innerType:t,typeName:g.ZodOptional,...v(e)});class $ extends b{_parse(e){return this._getType(e)===h.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$.create=(t,e)=>new $({innerType:t,typeName:g.ZodNullable,...v(e)});class pe extends b{_parse(e){const{ctx:n}=this._processInputParams(e);let a=n.data;return n.parsedType===h.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class he extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return ee(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new C(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new C(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}he.create=(t,e)=>new he({innerType:t,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class xe extends b{_parse(e){if(this._getType(e)!==h.nan){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.nan,received:a.parsedType}),y}return{status:"valid",value:e.data}}}xe.create=t=>new xe({typeName:g.ZodNaN,...v(t)});const tn=Symbol("zod_brand");class Ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class fe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?y:i.status==="dirty"?(n.dirty(),G(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?y:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(e,n){return new fe({in:e,out:n,typeName:g.ZodPipeline})}}class me extends b{_parse(e){const n=this._def.innerType._parse(e),a=s=>(X(s)&&(s.value=Object.freeze(s.value)),s);return ee(n)?n.then(s=>a(s)):a(n)}unwrap(){return this._def.innerType}}me.create=(t,e)=>new me({innerType:t,typeName:g.ZodReadonly,...v(e)});function Je(t,e={},n){return t?H.create().superRefine((a,s)=>{var i,o;if(!t(a)){const c=typeof e=="function"?e(a):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;s.addIssue({code:"custom",...l,fatal:u})}}):H.create()}const nn={object:S.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 rn=(t,e={message:`Input not instance of ${t.name}`})=>Je(n=>n instanceof t,e),Qe=E.create,Xe=M.create,an=xe.create,sn=D.create,et=re.create,on=V.create,cn=ve.create,dn=ae.create,ln=se.create,un=H.create,pn=L.create,hn=R.create,fn=be.create,mn=O.create,_n=S.create,gn=S.strictCreate,yn=ie.create,vn=ke.create,bn=oe.create,kn=N.create,Sn=ce.create,xn=Se.create,wn=z.create,Tn=F.create,Cn=de.create,En=le.create,On=U.create,In=ue.create,jn=K.create,tt=I.create,Nn=Z.create,Zn=$.create,Rn=I.createWithPreprocess,An=fe.create;var r=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:Ut,getErrorMap:_e,makeIssue:ge,EMPTY_PATH:$t,addIssueToContext:p,ParseStatus:x,INVALID:y,DIRTY:G,OK:T,isAborted:Te,isDirty:Ce,isValid:X,isAsync:ee,get util(){return k},get objectUtil(){return we},ZodParsedType:h,getParsedType:P,ZodType:b,datetimeRegex:Ke,ZodString:E,ZodNumber:M,ZodBigInt:D,ZodBoolean:re,ZodDate:V,ZodSymbol:ve,ZodUndefined:ae,ZodNull:se,ZodAny:H,ZodUnknown:L,ZodNever:R,ZodVoid:be,ZodArray:O,ZodObject:S,ZodUnion:ie,ZodDiscriminatedUnion:ke,ZodIntersection:oe,ZodTuple:N,ZodRecord:ce,ZodMap:Se,ZodSet:z,ZodFunction:F,ZodLazy:de,ZodLiteral:le,ZodEnum:U,ZodNativeEnum:ue,ZodPromise:K,ZodEffects:I,ZodTransformer:I,ZodOptional:Z,ZodNullable:$,ZodDefault:pe,ZodCatch:he,ZodNaN:xe,BRAND:tn,ZodBranded:Ie,ZodPipeline:fe,ZodReadonly:me,custom:Je,Schema:b,ZodSchema:b,late:nn,get ZodFirstPartyTypeKind(){return g},coerce:{string:t=>E.create({...t,coerce:!0}),number:t=>M.create({...t,coerce:!0}),boolean:t=>re.create({...t,coerce:!0}),bigint:t=>D.create({...t,coerce:!0}),date:t=>V.create({...t,coerce:!0})},any:un,array:mn,bigint:sn,boolean:et,date:on,discriminatedUnion:vn,effect:tt,enum:On,function:Tn,instanceof:rn,intersection:bn,lazy:Cn,literal:En,map:xn,nan:an,nativeEnum:In,never:hn,null:ln,nullable:Zn,number:Xe,object:_n,oboolean:()=>et().optional(),onumber:()=>Xe().optional(),optional:Nn,ostring:()=>Qe().optional(),pipeline:An,preprocess:Rn,promise:jn,record:Sn,set:wn,strictObject:gn,string:Qe,symbol:cn,transformer:tt,tuple:kn,undefined:dn,union:yn,unknown:pn,void:fn,NEVER:y,ZodIssueCode:d,quotelessJson:Dt,ZodError:C});Mt(r);const Pn=r.object({start:r.number(),limit:r.number(),length:r.number()}),je=r.object({created_at:r.string(),updated_at:r.string()}),nt=r.object({email:r.string().optional(),email_verified:r.boolean().optional(),name:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),phone_number:r.string().optional(),phone_verified:r.boolean().optional(),family_name:r.string().optional()}).catchall(r.any()),rt=r.object({connection:r.string(),user_id:r.string(),provider:r.string(),isSocial:r.boolean(),access_token:r.string().optional(),access_token_secret:r.string().optional(),refresh_token:r.string().optional(),profileData:nt.optional()}),Ne=r.object({email:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),family_name:r.string().optional(),nickname:r.string().optional(),name:r.string().optional(),picture:r.string().optional(),locale:r.string().optional(),linked_to:r.string().optional(),profileData:r.string().optional(),user_id:r.string().optional()}),at=Ne.extend({email_verified:r.boolean().default(!1),verify_email:r.boolean().optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string().optional(),provider:r.string().default("email"),connection:r.string().default("email")}),st=at.extend(je.shape).extend({user_id:r.string(),email:r.string(),is_social:r.boolean(),login_count:r.number(),identities:r.array(rt).optional()}),Mn=st,Dn=Ne.extend({email:r.string(),login_count:r.number(),multifactor:r.array(r.string()).optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string()}).catchall(r.any()),it=r.object({audience:r.string().optional(),recipient:r.string().optional(),createUpnClaim:r.boolean().optional(),mapUnknownClaimsAsIs:r.boolean().optional(),passthroughClaimsWithNoMapping:r.boolean().optional(),mapIdentities:r.boolean().optional(),signatureAlgorithm:r.string().optional(),digestAlgorithm:r.string().optional(),issuer:r.string().optional(),destination:r.string().optional(),lifetimeInSeconds:r.number().optional(),signResponse:r.boolean().optional(),nameIdentifierFormat:r.string().optional(),nameIdentifierProbes:r.array(r.string()).optional(),authnContextClassRef:r.string().optional(),mappings:r.record(r.string()).optional()}),ot=r.object({id:r.string(),name:r.string(),callbacks:r.array(r.string()).openapi({description:"Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."}),allowed_origins:r.array(r.string()).openapi({description:"Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."}),web_origins:r.array(r.string()).openapi({description:"Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."}),allowed_logout_urls:r.array(r.string()).openapi({description:"Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."}),addons:r.object({samlp:it.optional()}).optional().openapi({description:"Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."}),email_validation:r.enum(["enabled","disabled","enforced"]).default("enforced").openapi({description:"Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"}),client_secret:r.string().default(""),disable_sign_ups:r.boolean().default(!1).openapi({description:"Prevents users from signing up using the hosted login page. This is not available in auth0"})}),ct=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),...ot.shape});var Ze=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(Ze||{}),Re=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t.SAML_POST="saml_post",t))(Re||{}),Ae=(t=>(t.S265="S256",t.plain="plain",t))(Ae||{});const dt=r.object({client_id:r.string(),vendor_id:r.string().optional(),response_type:r.nativeEnum(Ze).optional(),response_mode:r.nativeEnum(Re).optional(),redirect_uri:r.string().optional(),audience:r.string().optional(),state:r.string().optional(),nonce:r.string().optional(),scope:r.string().optional(),code_challenge_method:r.nativeEnum(Ae).optional(),code_challenge:r.string().optional(),username:r.string().optional()}),Un=r.object({colors:r.object({primary:r.string(),page_background:r.object({type:r.string().optional(),start:r.string().optional(),end:r.string().optional(),angle_deg:r.number().optional()}).optional()}).optional(),logo_url:r.string().optional(),favicon_url:r.string().optional(),font:r.object({url:r.string()}).optional()}),lt=r.object({id:r.string().optional(),name:r.string(),client_id:r.string().optional(),client_secret:r.string().optional(),authorization_endpoint:r.string().optional(),response_type:r.custom().optional(),response_mode:r.custom().optional(),private_key:r.string().optional(),kid:r.string().optional(),team_id:r.string().optional(),token_endpoint:r.string().optional(),token_exchange_basic_auth:r.boolean().optional(),userinfo_endpoint:r.string().optional(),scope:r.string().optional()}),ut=r.object({id:r.string(),created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(lt.shape),pt=r.object({name:r.string(),audience:r.string(),sender_email:r.string().email(),sender_name:r.string(),support_url:r.string().url().optional(),logo:r.string().url().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),language:r.string().optional()}),ht=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),id:r.string(),...pt.shape}),$n=r.object({logoUrl:r.string(),loginBackgroundImage:r.string().nullish(),style:r.object({primaryColor:r.string(),buttonTextColor:r.string(),primaryHoverColor:r.string()}),supportEmail:r.string().nullable(),supportUrl:r.string().nullable(),name:r.string(),showGreyishBackground:r.boolean().optional(),termsAndConditionsUrl:r.string().nullable(),companyName:r.string().optional(),checkoutHideSocial:r.boolean().optional(),siteUrl:r.string().nullable(),manageSubscriptionsUrl:r.string().optional()}),Vn=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.union([r.literal("mailgun"),r.literal("mailchannels")]).optional()});r.object({...ct.shape,domains:r.array(Vn),tenant:ht,connections:r.array(ut)});const ft=r.enum(["password_reset","email_verification","otp","authorization_code","oauth2_state","ticket"]),mt=r.object({code_id:r.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:r.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:r.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:ft,expires_at:r.string(),used_at:r.string().optional(),user_id:r.string().optional()}),Ln=r.object({...mt.shape,created_at:r.string()}),_t=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.enum(["mailgun","mailchannels"])}),zn=je.extend({..._t.shape,id:r.string()}),gt=r.object({trigger_id:r.enum(["pre-user-signup","post-user-registration","post-user-login"]),enabled:r.boolean().default(!1),url:r.string(),hook_id:r.string().optional(),synchronous:r.boolean().default(!1),priority:r.number().optional()}),Bn=gt.extend({...je.shape,hook_id:r.string()}),yt=r.object({alg:r.string(),e:r.string(),kid:r.string(),kty:r.string(),n:r.string(),use:r.string().optional()}),Wn=r.object({keys:r.array(yt)}),Gn=r.object({issuer:r.string(),authorization_endpoint:r.string(),token_endpoint:r.string(),device_authorization_endpoint:r.string(),userinfo_endpoint:r.string(),mfa_challenge_endpoint:r.string(),jwks_uri:r.string(),registration_endpoint:r.string(),revocation_endpoint:r.string(),scopes_supported:r.array(r.string()),response_types_supported:r.array(r.string()),code_challenge_methods_supported:r.array(r.string()),response_modes_supported:r.array(r.string()),subject_types_supported:r.array(r.string()),id_token_signing_alg_values_supported:r.array(r.string()),token_endpoint_auth_methods_supported:r.array(r.string()),claims_supported:r.array(r.string()),request_uri_parameter_supported:r.boolean(),request_parameter_supported:r.boolean(),token_endpoint_auth_signing_alg_values_supported:r.array(r.string())}),vt=r.object({auth0Client:r.string().optional(),authParams:dt,expires_at:r.string(),deleted_at:r.string().optional(),ip:r.string().optional()}).openapi({description:"This represents a login sesion"}),Hn=r.object({...vt.shape,login_id:r.string().openapi({description:"This is is used as the state in the universal login"}),created_at:r.string(),updated_at:r.string()});var bt=(t=>(t.FAILED_SILENT_AUTH="fsa",t.FAILED_SIGNUP="fs",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.FAILED_CHANGE_PASSWORD="fcp",t.FAILED_BY_CONNECTOR="fc",t.FAILED_LOGIN_INVALID_EMAIL_USERNAME="fu",t.FAILED_HOOK="fh",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_CHANGE_PASSWORD="scp",t.SUCCESS_CHANGE_PASSWORD_REQUEST="scpr",t.SUCCESS_CHANGE_USERNAME="scu",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.SUCCESS_LOGIN="s",t.SUCCESS_LOGOUT="slo",t.SUCCESS_SIGNUP="ss",t.SUCCESS_SILENT_AUTH="ssa",t.SUCCESS_VERIFICATION_EMAIL="sv",t.SUCCESS_VERIFICATION_EMAIL_REQUEST="svr",t.CODE_LINK_SENT="cls",t))(bt||{});const qn=r.enum(["cls","fsa","fs","f","fc","fcoa","fcp","fh","fp","fs","fu","s","sapi","scoa","scp","scpr","scu","seacft","serft","slo","ss","ssa","sv","svr"]),kt=r.object({name:r.string(),version:r.string(),env:r.object({node:r.string().optional()}).optional()}),Fn=r.object({type:qn,date:r.string(),description:r.string().optional(),log_id:r.string().optional(),_id:r.string().optional(),ip:r.string(),user_agent:r.string(),details:r.any().optional(),isMobile:r.boolean(),user_id:r.string().optional(),user_name:r.string().optional(),connection:r.string().optional(),connection_id:r.string().optional(),client_id:r.string().optional(),client_name:r.string().optional(),audience:r.string().optional(),scope:r.array(r.string()).optional(),strategy:r.string().optional(),strategy_type:r.string().optional(),hostname:r.string().optional(),auth0_client:kt.optional()}),St=r.object({user_id:r.string(),password:r.string(),algorithm:r.enum(["bcrypt","argon2id"]).default("argon2id")}),Kn=r.object({...St.shape,created_at:r.string(),updated_at:r.string()}),xt=r.object({session_id:r.string(),client_id:r.string(),expires_at:r.string(),used_at:r.string(),deleted_at:r.string().optional(),user_id:r.string()}),Yn=r.object({created_at:r.string(),...xt.shape}),Jn=r.object({kid:r.string().openapi({description:"The key id of the signing key"}),cert:r.string().openapi({description:"The public certificate of the signing key"}),fingerprint:r.string().openapi({description:"The cert fingerprint"}),thumbprint:r.string().openapi({description:"The cert thumbprint"}),pkcs7:r.string().optional().openapi({description:"The private key in pkcs7 format"}),current:r.boolean().optional().openapi({description:"True if the key is the current key"}),next:r.boolean().optional().openapi({description:"True if the key is the next key"}),previous:r.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:r.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:r.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:r.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:r.string().optional().openapi({description:"The date and time when the key was revoked"})});var Pe=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(Pe||{});const Me=r.nativeEnum(Pe),Qn=r.object({grant_type:Me.refine(t=>t==="authorization_code"),code:r.string(),client_secret:r.string(),client_id:r.string()}),Xn=r.object({grant_type:Me.refine(t=>t==="authorization_code"),code:r.string(),code_verifier:r.string(),client_id:r.string().optional(),redirect_uri:r.string()}),er=r.object({grant_type:Me.refine(t=>t==="client_credentials"),scope:r.string().optional(),client_secret:r.string(),client_id:r.string(),audience:r.string().optional()});r.object({access_token:r.string(),id_token:r.string().optional(),scope:r.string().optional(),state:r.string().optional(),refresh_token:r.string().optional(),token_type:r.string(),expires_in:r.number()}),r.object({code:r.string(),state:r.string().optional()});const wt=r.object({button_border_radius:r.number(),button_border_weight:r.number(),buttons_style:r.enum(["pill"]),input_border_radius:r.number(),input_border_weight:r.number(),inputs_style:r.enum(["pill"]),show_widget_shadow:r.boolean(),widget_border_weight:r.number(),widget_corner_radius:r.number()}),Tt=r.object({base_focus_color:r.string(),base_hover_color:r.string(),body_text:r.string(),captcha_widget_theme:r.enum(["auto"]),error:r.string(),header:r.string(),icons:r.string(),input_background:r.string(),input_border:r.string(),input_filled_text:r.string(),input_labels_placeholders:r.string(),links_focused_components:r.string(),primary_button:r.string(),primary_button_label:r.string(),secondary_button_border:r.string(),secondary_button_label:r.string(),success:r.string(),widget_background:r.string(),widget_border:r.string()}),B=r.object({bold:r.boolean(),size:r.number()}),Ct=r.object({body_text:B,buttons_text:B,font_url:r.string(),input_labels:B,links:B,links_style:r.enum(["normal"]),reference_text_size:r.number(),subtitle:B,title:B}),Et=r.object({background_color:r.string(),background_image_url:r.string(),page_layout:r.enum(["center"])}),Ot=r.object({header_text_alignment:r.enum(["center"]),logo_height:r.number(),logo_position:r.enum(["center"]),logo_url:r.string(),social_buttons_layout:r.enum(["bottom"])}),It=r.object({borders:wt,colors:Tt,displayName:r.string(),fonts:Ct,page_background:Et,widget:Ot}),tr=It.extend({themeId:r.string()});function nr(t){const[e,n]=t.split("|");if(!e||!n)throw new Error(`Invalid user_id: ${t}`);return{connection:e,id:n}}return m.Auth0Client=kt,m.AuthorizationResponseMode=Re,m.AuthorizationResponseType=Ze,m.CodeChallengeMethod=Ae,m.GrantType=Pe,m.LogTypes=bt,m.applicationInsertSchema=ot,m.applicationSchema=ct,m.auth0UserResponseSchema=Mn,m.authParamsSchema=dt,m.authorizationCodeGrantTypeParamsSchema=Qn,m.baseUserSchema=Ne,m.bordersSchema=wt,m.brandingSchema=Un,m.clientCredentialGrantTypeParamsSchema=er,m.codeInsertSchema=mt,m.codeSchema=Ln,m.codeTypeSchema=ft,m.colorsSchema=Tt,m.connectionInsertSchema=lt,m.connectionSchema=ut,m.domainInsertSchema=_t,m.domainSchema=zn,m.fontDetailsSchema=B,m.fontsSchema=Ct,m.hookInsertSchema=gt,m.hookSchema=Bn,m.identitySchema=rt,m.jwksKeySchema=Wn,m.jwksSchema=yt,m.logSchema=Fn,m.loginInsertSchema=vt,m.loginSchema=Hn,m.openIDConfigurationSchema=Gn,m.pageBackgroundSchema=Et,m.parseUserId=nr,m.passwordInsertSchema=St,m.passwordSchema=Kn,m.pkceAuthorizationCodeGrantTypeParamsSchema=Xn,m.profileDataSchema=nt,m.samlpAddon=it,m.sessionInsertSchema=xt,m.sessionSchema=Yn,m.signingKeySchema=Jn,m.tenantInsertSchema=pt,m.tenantSchema=ht,m.themeInsertSchema=It,m.themeSchema=tr,m.totalsSchema=Pn,m.userInsertSchema=at,m.userResponseSchema=Dn,m.userSchema=st,m.vendorSettingsSchema=$n,m.widgetSchema=Ot,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({});
|
|
1
|
+
var adapterInterfaces=function(m){"use strict";function At(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(t);s<a.length;s++)e.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(t,a[s])&&(n[a[s]]=t[a[s]]);return n}typeof SuppressedError=="function"&&SuppressedError;function Pt(t,e){var n;return((n=t==null?void 0:t._def)===null||n===void 0?void 0:n.typeName)===e}function Q(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...a){const s=n.apply(this,a);return s._def.openapi=this._def.openapi,s}}function Mt(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(s,i){var o,c,u,l,_,w;const Y=typeof s=="string"?i:s,J=Y??{},{param:jt}=J,rr=At(J,["param"]),Nt=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof s=="string"?{refId:s}:void 0),Zt=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),rr),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||jt?{param:Object.assign(Object.assign({},(w=(_=this._def.openapi)===null||_===void 0?void 0:_.metadata)===null||w===void 0?void 0:w.param),jt)}:void 0),Rt=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(Nt).length>0?{_internal:Nt}:void 0),Object.keys(Zt).length>0?{metadata:Zt}:void 0)}));if(Pt(this,"ZodObject")){const ar=this.extend;Rt.extend=function(...sr){var De,Ue,$e,Ve,Le,ze;const Be=ar.apply(this,sr);return Be._def.openapi={_internal:{extendedFrom:!((Ue=(De=this._def.openapi)===null||De===void 0?void 0:De._internal)===null||Ue===void 0)&&Ue.refId?{refId:(Ve=($e=this._def.openapi)===null||$e===void 0?void 0:$e._internal)===null||Ve===void 0?void 0:Ve.refId,schema:this}:(Le=this._def.openapi)===null||Le===void 0?void 0:Le._internal.extendedFrom},metadata:(ze=Be._def.openapi)===null||ze===void 0?void 0:ze.metadata},Be}}return Rt},Q(t,"optional"),Q(t,"nullable"),Q(t,"default"),Q(t,"transform"),Q(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const s=this._def.shape(),i=e.apply(this),o=i._def.shape();return Object.entries(o).forEach(([c,u])=>{var l,_;u._def.openapi=(_=(l=s[c])===null||l===void 0?void 0:l._def)===null||_===void 0?void 0:_.openapi}),i._def.openapi=void 0,i};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...s){const i=n.apply(this,s);return i._def.openapi=void 0,i};const a=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...s){const i=a.apply(this,s);return i._def.openapi=void 0,i}}new Set(".\\+*[^]$()");var k;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of i)o[c]=s[c];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=a,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(k||(k={}));var we;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(we||(we={}));const h=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=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=k.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"]),Dt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class E extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};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},a={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)a._errors.push(n(o));else{let c=a,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 s(this),a}static assert(e){if(!(e instanceof E))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},a=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}E.create=t=>new E(t);const W=(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,k.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${k.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${k.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${k.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}"`:k.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,k.assertNever(t)}return{message:n}};let We=W;function Ut(t){We=t}function _e(){return We}const ge=t=>{const{data:e,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="";const u=a.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...s,path:i,message:c}},$t=[];function p(t,e){const n=_e(),a=ge({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===W?void 0:W].filter(s=>!!s)});t.common.issues.push(a)}class x{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const a=[];for(const s of n){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,n){const a=[];for(const s of n){const i=await s.key,o=await s.value;a.push({key:i,value:o})}return x.mergeObjectSync(e,a)}static mergeObjectSync(e,n){const a={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return y;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(a[i.value]=o.value)}return{status:e.value,value:a}}}const y=Object.freeze({status:"aborted"}),G=t=>({status:"dirty",value:t}),T=t=>({status:"valid",value:t}),Te=t=>t.status==="aborted",Ee=t=>t.status==="dirty",X=t=>t.status==="valid",ee=t=>typeof Promise<"u"&&t instanceof Promise;function ye(t,e,n,a){if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Ge(t,e,n,a,s){if(typeof e=="function"?t!==e||!s:!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}typeof SuppressedError=="function"&&SuppressedError;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 te,ne;class j{constructor(e,n,a,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=a,this._key=s}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 He=(t,e)=>{if(X(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 E(t.common.issues);return this._error=n,this._error}}};function v(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:a,description:s}=t;if(e&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,c)=>{var u,l;const{message:_}=t;return o.code==="invalid_enum_value"?{message:_??c.defaultError}:typeof c.data>"u"?{message:(u=_??a)!==null&&u!==void 0?u:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(l=_??n)!==null&&l!==void 0?l:c.defaultError}},description:s}}class b{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 P(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new x,ctx:{common:e.parent.common,data:e.data,parsedType:P(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 a=this.safeParse(e,n);if(a.success)return a.data;throw a.error}safeParse(e,n){var a;const s={common:{issues:[],async:(a=n==null?void 0:n.async)!==null&&a!==void 0?a:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},i=this._parseSync({data:e,path:s.path,parent:s});return He(s,i)}async parseAsync(e,n){const a=await this.safeParseAsync(e,n);if(a.success)return a.data;throw a.error}async safeParseAsync(e,n){const a={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:P(e)},s=this._parse({data:e,path:a.path,parent:a}),i=await(ee(s)?s:Promise.resolve(s));return He(a,i)}refine(e,n){const a=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),c=()=>i.addIssue({code:d.custom,...a(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((a,s)=>e(a)?!0:(s.addIssue(typeof n=="function"?n(a,s):n),!1))}_refinement(e){return new I({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Z.create(this,this._def)}nullable(){return $.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this,this._def)}promise(){return K.create(this,this._def)}or(e){return ie.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new I({...v(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new pe({...v(this._def),innerType:this,defaultValue:n,typeName:g.ZodDefault})}brand(){return new Ie({typeName:g.ZodBranded,type:this,...v(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new he({...v(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 fe.create(this,e)}readonly(){return me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vt=/^c[^\s-]{8,}$/i,Lt=/^[0-9a-z]+$/,zt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Bt=/^[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,Wt=/^[a-z0-9_-]{21}$/i,Gt=/^[-+]?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)?)??$/,Ht=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ce;const Ft=/^(?:(?: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])$/,Kt=/^(([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})))$/,Yt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qe="((\\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])))",Jt=new RegExp(`^${qe}$`);function Fe(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 Qt(t){return new RegExp(`^${Fe(t)}$`)}function Ke(t){let e=`${qe}T${Fe(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 Xt(t,e){return!!((e==="v4"||!e)&&Ft.test(t)||(e==="v6"||!e)&&Kt.test(t))}class C extends b{_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}),y}const a=new x;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(s=this._getOrReturnCtx(e,s),o?p(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&p(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")Ht.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"email",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")Ce||(Ce=new RegExp(qt,"u")),Ce.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"emoji",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")Bt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"uuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")Wt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"nanoid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Vt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")Lt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid2",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")zt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ulid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),p(s,{validation:"url",code:d.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"regex",code:d.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.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)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?Ke(i).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?Jt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?Qt(i).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:d.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?Gt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"duration",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?Xt(e.data,i.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ip",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?Yt.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64",code:d.invalid_string,message:i.message}),a.dirty()):k.assertNever(i);return{status:a.value,value:e.data}}_regex(e,n,a){return this.refinement(s=>e.test(s),{validation:n,code:d.invalid_string,...f.errToObj(a)})}_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,a;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:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!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,...v(t)})};function en(t,e){const n=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,s=n>a?n:a,i=parseInt(t.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class M extends b{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}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="int"?k.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?en(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.not_finite,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.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,a,s){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:f.toString(s)}]})}_addCheck(e){return new M({...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"&&k.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(n)&&Number.isFinite(e)}}M.create=t=>new M({checks:[],typeName:g.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class D extends b{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}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.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,a,s){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:f.toString(s)}]})}_addCheck(e){return new D({...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}}D.create=t=>{var e;return new D({checks:[],typeName:g.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};class re extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.boolean,received:a.parsedType}),y}return T(e.data)}}re.create=t=>new re({typeName:g.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class V extends b{_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}),y}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return p(i,{code:d.invalid_date}),y}const a=new x;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):k.assertNever(i);return{status:a.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,...v(t)});class ve extends b{_parse(e){if(this._getType(e)!==h.symbol){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.symbol,received:a.parsedType}),y}return T(e.data)}}ve.create=t=>new ve({typeName:g.ZodSymbol,...v(t)});class ae extends b{_parse(e){if(this._getType(e)!==h.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.undefined,received:a.parsedType}),y}return T(e.data)}}ae.create=t=>new ae({typeName:g.ZodUndefined,...v(t)});class se extends b{_parse(e){if(this._getType(e)!==h.null){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.null,received:a.parsedType}),y}return T(e.data)}}se.create=t=>new se({typeName:g.ZodNull,...v(t)});class H extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}}H.create=t=>new H({typeName:g.ZodAny,...v(t)});class L extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}}L.create=t=>new L({typeName:g.ZodUnknown,...v(t)});class R extends b{_parse(e){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:h.never,received:n.parsedType}),y}}R.create=t=>new R({typeName:g.ZodNever,...v(t)});class be extends b{_parse(e){if(this._getType(e)!==h.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.void,received:a.parsedType}),y}return T(e.data)}}be.create=t=>new be({typeName:g.ZodVoid,...v(t)});class O extends b{_parse(e){const{ctx:n,status:a}=this._processInputParams(e),s=this._def;if(n.parsedType!==h.array)return p(n,{code:d.invalid_type,expected:h.array,received:n.parsedType}),y;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(p(n,{code:o?d.too_big:d.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(p(n,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(p(n,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>s.type._parseAsync(new j(n,o,n.path,c)))).then(o=>x.mergeArray(a,o));const i=[...n.data].map((o,c)=>s.type._parseSync(new j(n,o,n.path,c)));return x.mergeArray(a,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,...v(e)});function q(t){if(t instanceof S){const e={};for(const n in t.shape){const a=t.shape[n];e[n]=Z.create(q(a))}return new S({...t._def,shape:()=>e})}else return t instanceof O?new O({...t._def,type:q(t.element)}):t instanceof Z?Z.create(q(t.unwrap())):t instanceof $?$.create(q(t.unwrap())):t instanceof N?N.create(t.items.map(e=>q(e))):t}class S extends b{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=k.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}),y}const{status:a,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const l in s.data)o.includes(l)||c.push(l);const u=[];for(const l of o){const _=i[l],w=s.data[l];u.push({key:{status:"valid",value:l},value:_._parse(new j(s,w,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof R){const l=this._def.unknownKeys;if(l==="passthrough")for(const _ of c)u.push({key:{status:"valid",value:_},value:{status:"valid",value:s.data[_]}});else if(l==="strict")c.length>0&&(p(s,{code:d.unrecognized_keys,keys:c}),a.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const _ of c){const w=s.data[_];u.push({key:{status:"valid",value:_},value:l._parse(new j(s,w,s.path,_)),alwaysSet:_ in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const _ of u){const w=await _.key,Y=await _.value;l.push({key:w,value:Y,alwaysSet:_.alwaysSet})}return l}).then(l=>x.mergeObjectSync(a,l)):x.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new S({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,a)=>{var s,i,o,c;const u=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,n,a).message)!==null&&o!==void 0?o:a.defaultError;return n.code==="unrecognized_keys"?{message:(c=f.errToObj(e).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(e){return new S({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new S({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 S({...this._def,catchall:e})}pick(e){const n={};return k.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}omit(e){const n={};return k.objectKeys(this.shape).forEach(a=>{e[a]||(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}deepPartial(){return q(this)}partial(e){const n={};return k.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];e&&!e[a]?n[a]=s:n[a]=s.optional()}),new S({...this._def,shape:()=>n})}required(e){const n={};return k.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])n[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof Z;)i=i._def.innerType;n[a]=i}}),new S({...this._def,shape:()=>n})}keyof(){return Ye(k.objectKeys(this.shape))}}S.create=(t,e)=>new S({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...v(e)}),S.strictCreate=(t,e)=>new S({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:g.ZodObject,...v(e)}),S.lazycreate=(t,e)=>new S({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:g.ZodObject,...v(e)});class ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=this._def.options;function s(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 E(c.ctx.common.issues));return p(n,{code:d.invalid_union,unionErrors:o}),y}if(n.common.async)return Promise.all(a.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(s);{let i;const o=[];for(const u of a){const l={...n,common:{...n.common,issues:[]},parent:null},_=u._parseSync({data:n.data,path:n.path,parent:l});if(_.status==="valid")return _;_.status==="dirty"&&!i&&(i={result:_,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 E(u));return p(n,{code:d.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}ie.create=(t,e)=>new ie({options:t,typeName:g.ZodUnion,...v(e)});const A=t=>t instanceof de?A(t.schema):t instanceof I?A(t.innerType()):t instanceof le?[t.value]:t instanceof U?t.options:t instanceof ue?k.objectValues(t.enum):t instanceof pe?A(t._def.innerType):t instanceof ae?[void 0]:t instanceof se?[null]:t instanceof Z?[void 0,...A(t.unwrap())]:t instanceof $?[null,...A(t.unwrap())]:t instanceof Ie||t instanceof me?A(t.unwrap()):t instanceof he?A(t._def.innerType):[];class ke extends b{_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}),y;const a=this.discriminator,s=n.data[a],i=this.optionsMap.get(s);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:[a]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,a){const s=new Map;for(const i of n){const o=A(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(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,i)}}return new ke({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...v(a)})}}function Oe(t,e){const n=P(t),a=P(e);if(t===e)return{valid:!0,data:t};if(n===h.object&&a===h.object){const s=k.objectKeys(e),i=k.objectKeys(t).filter(c=>s.indexOf(c)!==-1),o={...t,...e};for(const c of i){const u=Oe(t[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===h.array&&a===h.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],c=e[i],u=Oe(o,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===h.date&&a===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class oe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e),s=(i,o)=>{if(Te(i)||Te(o))return y;const c=Oe(i.value,o.value);return c.valid?((Ee(i)||Ee(o))&&n.dirty(),{status:n.value,value:c.data}):(p(a,{code:d.invalid_intersection_types}),y)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}oe.create=(t,e,n)=>new oe({left:t,right:e,typeName:g.ZodIntersection,...v(n)});class N extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.array)return p(a,{code:d.invalid_type,expected:h.array,received:a.parsedType}),y;if(a.data.length<this._def.items.length)return p(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&a.data.length>this._def.items.length&&(p(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...a.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new j(a,o,a.path,c)):null}).filter(o=>!!o);return a.common.async?Promise.all(i).then(o=>x.mergeArray(n,o)):x.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,...v(e)})};class ce extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.object)return p(a,{code:d.invalid_type,expected:h.object,received:a.parsedType}),y;const s=[],i=this._def.keyType,o=this._def.valueType;for(const c in a.data)s.push({key:i._parse(new j(a,c,a.path,c)),value:o._parse(new j(a,a.data[c],a.path,c)),alwaysSet:c in a.data});return a.common.async?x.mergeObjectAsync(n,s):x.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,a){return n instanceof b?new ce({keyType:e,valueType:n,typeName:g.ZodRecord,...v(a)}):new ce({keyType:C.create(),valueType:e,typeName:g.ZodRecord,...v(n)})}}class Se extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.map)return p(a,{code:d.invalid_type,expected:h.map,received:a.parsedType}),y;const s=this._def.keyType,i=this._def.valueType,o=[...a.data.entries()].map(([c,u],l)=>({key:s._parse(new j(a,c,a.path,[l,"key"])),value:i._parse(new j(a,u,a.path,[l,"value"]))}));if(a.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,_=await u.value;if(l.status==="aborted"||_.status==="aborted")return y;(l.status==="dirty"||_.status==="dirty")&&n.dirty(),c.set(l.value,_.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const l=u.key,_=u.value;if(l.status==="aborted"||_.status==="aborted")return y;(l.status==="dirty"||_.status==="dirty")&&n.dirty(),c.set(l.value,_.value)}return{status:n.value,value:c}}}}Se.create=(t,e,n)=>new Se({valueType:e,keyType:t,typeName:g.ZodMap,...v(n)});class z extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.set)return p(a,{code:d.invalid_type,expected:h.set,received:a.parsedType}),y;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(p(a,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(p(a,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const l=new Set;for(const _ of u){if(_.status==="aborted")return y;_.status==="dirty"&&n.dirty(),l.add(_.value)}return{status:n.value,value:l}}const c=[...a.data.values()].map((u,l)=>i._parse(new j(a,u,a.path,l)));return a.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new z({...this._def,minSize:{value:e,message:f.toString(n)}})}max(e,n){return new z({...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)}}z.create=(t,e)=>new z({valueType:t,minSize:null,maxSize:null,typeName:g.ZodSet,...v(e)});class F extends b{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}),y;function a(c,u){return ge({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function s(c,u){return ge({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].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 K){const c=this;return T(async function(...u){const l=new E([]),_=await c._def.args.parseAsync(u,i).catch(J=>{throw l.addIssue(a(u,J)),l}),w=await Reflect.apply(o,this,_);return await c._def.returns._def.type.parseAsync(w,i).catch(J=>{throw l.addIssue(s(w,J)),l})})}else{const c=this;return T(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new E([a(u,l.error)]);const _=Reflect.apply(o,this,l.data),w=c._def.returns.safeParse(_,i);if(!w.success)throw new E([s(_,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new F({...this._def,args:N.create(e).rest(L.create())})}returns(e){return new F({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,a){return new F({args:e||N.create([]).rest(L.create()),returns:n||L.create(),typeName:g.ZodFunction,...v(a)})}}class de extends b{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})}}de.create=(t,e)=>new de({getter:t,typeName:g.ZodLazy,...v(e)});class le extends b{_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}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}le.create=(t,e)=>new le({value:t,typeName:g.ZodLiteral,...v(e)});function Ye(t,e){return new U({values:t,typeName:g.ZodEnum,...v(e)})}class U extends b{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),a=this._def.values;return p(n,{expected:k.joinValues(a),received:n.parsedType,code:d.invalid_type}),y}if(ye(this,te)||Ge(this,te,new Set(this._def.values)),!ye(this,te).has(e.data)){const n=this._getOrReturnCtx(e),a=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:a}),y}return T(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 U.create(e,{...this._def,...n})}exclude(e,n=this._def){return U.create(this.options.filter(a=>!e.includes(a)),{...this._def,...n})}}te=new WeakMap,U.create=Ye;class ue extends b{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const n=k.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==h.string&&a.parsedType!==h.number){const s=k.objectValues(n);return p(a,{expected:k.joinValues(s),received:a.parsedType,code:d.invalid_type}),y}if(ye(this,ne)||Ge(this,ne,new Set(k.getValidEnumValues(this._def.values))),!ye(this,ne).has(e.data)){const s=k.objectValues(n);return p(a,{received:a.data,code:d.invalid_enum_value,options:s}),y}return T(e.data)}get enum(){return this._def.values}}ne=new WeakMap,ue.create=(t,e)=>new ue({values:t,typeName:g.ZodNativeEnum,...v(e)});class K extends b{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}),y;const a=n.parsedType===h.promise?n.data:Promise.resolve(n.data);return T(a.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}K.create=(t,e)=>new K({type:t,typeName:g.ZodPromise,...v(e)});class I extends b{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:a}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{p(a,o),o.fatal?n.abort():n.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(a.data,i);if(a.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:c,path:a.path,parent:a});return u.status==="aborted"?y:u.status==="dirty"||n.value==="dirty"?G(u.value):u});{if(n.value==="aborted")return y;const c=this._def.schema._parseSync({data:o,path:a.path,parent:a});return c.status==="aborted"?y:c.status==="dirty"||n.value==="dirty"?G(c.value):c}}if(s.type==="refinement"){const o=c=>{const u=s.refinement(c,i);if(a.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(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!X(o))return o;const c=s.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:a.data,path:a.path,parent:a}).then(o=>X(o)?Promise.resolve(s.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);k.assertNever(s)}}I.create=(t,e,n)=>new I({schema:t,typeName:g.ZodEffects,effect:e,...v(n)}),I.createWithPreprocess=(t,e,n)=>new I({schema:e,effect:{type:"preprocess",transform:t},typeName:g.ZodEffects,...v(n)});class Z extends b{_parse(e){return this._getType(e)===h.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Z.create=(t,e)=>new Z({innerType:t,typeName:g.ZodOptional,...v(e)});class $ extends b{_parse(e){return this._getType(e)===h.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$.create=(t,e)=>new $({innerType:t,typeName:g.ZodNullable,...v(e)});class pe extends b{_parse(e){const{ctx:n}=this._processInputParams(e);let a=n.data;return n.parsedType===h.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class he extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return ee(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new E(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new E(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}he.create=(t,e)=>new he({innerType:t,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class xe extends b{_parse(e){if(this._getType(e)!==h.nan){const a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:h.nan,received:a.parsedType}),y}return{status:"valid",value:e.data}}}xe.create=t=>new xe({typeName:g.ZodNaN,...v(t)});const tn=Symbol("zod_brand");class Ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class fe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?y:i.status==="dirty"?(n.dirty(),G(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?y:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(e,n){return new fe({in:e,out:n,typeName:g.ZodPipeline})}}class me extends b{_parse(e){const n=this._def.innerType._parse(e),a=s=>(X(s)&&(s.value=Object.freeze(s.value)),s);return ee(n)?n.then(s=>a(s)):a(n)}unwrap(){return this._def.innerType}}me.create=(t,e)=>new me({innerType:t,typeName:g.ZodReadonly,...v(e)});function Je(t,e={},n){return t?H.create().superRefine((a,s)=>{var i,o;if(!t(a)){const c=typeof e=="function"?e(a):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;s.addIssue({code:"custom",...l,fatal:u})}}):H.create()}const nn={object:S.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 rn=(t,e={message:`Input not instance of ${t.name}`})=>Je(n=>n instanceof t,e),Qe=C.create,Xe=M.create,an=xe.create,sn=D.create,et=re.create,on=V.create,cn=ve.create,dn=ae.create,ln=se.create,un=H.create,pn=L.create,hn=R.create,fn=be.create,mn=O.create,_n=S.create,gn=S.strictCreate,yn=ie.create,vn=ke.create,bn=oe.create,kn=N.create,Sn=ce.create,xn=Se.create,wn=z.create,Tn=F.create,En=de.create,Cn=le.create,On=U.create,In=ue.create,jn=K.create,tt=I.create,Nn=Z.create,Zn=$.create,Rn=I.createWithPreprocess,An=fe.create;var r=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:Ut,getErrorMap:_e,makeIssue:ge,EMPTY_PATH:$t,addIssueToContext:p,ParseStatus:x,INVALID:y,DIRTY:G,OK:T,isAborted:Te,isDirty:Ee,isValid:X,isAsync:ee,get util(){return k},get objectUtil(){return we},ZodParsedType:h,getParsedType:P,ZodType:b,datetimeRegex:Ke,ZodString:C,ZodNumber:M,ZodBigInt:D,ZodBoolean:re,ZodDate:V,ZodSymbol:ve,ZodUndefined:ae,ZodNull:se,ZodAny:H,ZodUnknown:L,ZodNever:R,ZodVoid:be,ZodArray:O,ZodObject:S,ZodUnion:ie,ZodDiscriminatedUnion:ke,ZodIntersection:oe,ZodTuple:N,ZodRecord:ce,ZodMap:Se,ZodSet:z,ZodFunction:F,ZodLazy:de,ZodLiteral:le,ZodEnum:U,ZodNativeEnum:ue,ZodPromise:K,ZodEffects:I,ZodTransformer:I,ZodOptional:Z,ZodNullable:$,ZodDefault:pe,ZodCatch:he,ZodNaN:xe,BRAND:tn,ZodBranded:Ie,ZodPipeline:fe,ZodReadonly:me,custom:Je,Schema:b,ZodSchema:b,late:nn,get ZodFirstPartyTypeKind(){return g},coerce:{string:t=>C.create({...t,coerce:!0}),number:t=>M.create({...t,coerce:!0}),boolean:t=>re.create({...t,coerce:!0}),bigint:t=>D.create({...t,coerce:!0}),date:t=>V.create({...t,coerce:!0})},any:un,array:mn,bigint:sn,boolean:et,date:on,discriminatedUnion:vn,effect:tt,enum:On,function:Tn,instanceof:rn,intersection:bn,lazy:En,literal:Cn,map:xn,nan:an,nativeEnum:In,never:hn,null:ln,nullable:Zn,number:Xe,object:_n,oboolean:()=>et().optional(),onumber:()=>Xe().optional(),optional:Nn,ostring:()=>Qe().optional(),pipeline:An,preprocess:Rn,promise:jn,record:Sn,set:wn,strictObject:gn,string:Qe,symbol:cn,transformer:tt,tuple:kn,undefined:dn,union:yn,unknown:pn,void:fn,NEVER:y,ZodIssueCode:d,quotelessJson:Dt,ZodError:E});Mt(r);const Pn=r.object({start:r.number(),limit:r.number(),length:r.number()}),je=r.object({created_at:r.string(),updated_at:r.string()}),nt=r.object({email:r.string().optional(),email_verified:r.boolean().optional(),name:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),phone_number:r.string().optional(),phone_verified:r.boolean().optional(),family_name:r.string().optional()}).catchall(r.any()),rt=r.object({connection:r.string(),user_id:r.string(),provider:r.string(),isSocial:r.boolean(),access_token:r.string().optional(),access_token_secret:r.string().optional(),refresh_token:r.string().optional(),profileData:nt.optional()}),Ne=r.object({email:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),family_name:r.string().optional(),nickname:r.string().optional(),name:r.string().optional(),picture:r.string().optional(),locale:r.string().optional(),linked_to:r.string().optional(),profileData:r.string().optional(),user_id:r.string().optional()}),at=Ne.extend({email_verified:r.boolean().default(!1),verify_email:r.boolean().optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string().optional(),provider:r.string().default("email"),connection:r.string().default("email")}),st=at.extend(je.shape).extend({user_id:r.string(),email:r.string(),is_social:r.boolean(),login_count:r.number(),identities:r.array(rt).optional()}),Mn=st,Dn=Ne.extend({email:r.string(),login_count:r.number(),multifactor:r.array(r.string()).optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string()}).catchall(r.any()),it=r.object({audience:r.string().optional(),recipient:r.string().optional(),createUpnClaim:r.boolean().optional(),mapUnknownClaimsAsIs:r.boolean().optional(),passthroughClaimsWithNoMapping:r.boolean().optional(),mapIdentities:r.boolean().optional(),signatureAlgorithm:r.string().optional(),digestAlgorithm:r.string().optional(),issuer:r.string().optional(),destination:r.string().optional(),lifetimeInSeconds:r.number().optional(),signResponse:r.boolean().optional(),nameIdentifierFormat:r.string().optional(),nameIdentifierProbes:r.array(r.string()).optional(),authnContextClassRef:r.string().optional(),mappings:r.record(r.string()).optional()}),ot=r.object({id:r.string(),name:r.string(),callbacks:r.array(r.string()).openapi({description:"Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."}),allowed_origins:r.array(r.string()).openapi({description:"Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."}),web_origins:r.array(r.string()).openapi({description:"Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."}),allowed_logout_urls:r.array(r.string()).openapi({description:"Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."}),addons:r.object({samlp:it.optional()}).optional().openapi({description:"Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."}),email_validation:r.enum(["enabled","disabled","enforced"]).default("enforced").openapi({description:"Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"}),client_secret:r.string().default(""),disable_sign_ups:r.boolean().default(!1).openapi({description:"Prevents users from signing up using the hosted login page. This is not available in auth0"})}),ct=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),...ot.shape});var Ze=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(Ze||{}),Re=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t.SAML_POST="saml_post",t))(Re||{}),Ae=(t=>(t.S265="S256",t.plain="plain",t))(Ae||{});const dt=r.object({client_id:r.string(),vendor_id:r.string().optional(),response_type:r.nativeEnum(Ze).optional(),response_mode:r.nativeEnum(Re).optional(),redirect_uri:r.string().optional(),audience:r.string().optional(),state:r.string().optional(),nonce:r.string().optional(),scope:r.string().optional(),code_challenge_method:r.nativeEnum(Ae).optional(),code_challenge:r.string().optional(),username:r.string().optional()}),Un=r.object({colors:r.object({primary:r.string(),page_background:r.object({type:r.string().optional(),start:r.string().optional(),end:r.string().optional(),angle_deg:r.number().optional()}).optional()}).optional(),logo_url:r.string().optional(),favicon_url:r.string().optional(),font:r.object({url:r.string()}).optional()}),lt=r.object({id:r.string().optional(),name:r.string(),client_id:r.string().optional(),client_secret:r.string().optional(),authorization_endpoint:r.string().optional(),response_type:r.custom().optional(),response_mode:r.custom().optional(),private_key:r.string().optional(),kid:r.string().optional(),team_id:r.string().optional(),token_endpoint:r.string().optional(),token_exchange_basic_auth:r.boolean().optional(),userinfo_endpoint:r.string().optional(),scope:r.string().optional()}),ut=r.object({id:r.string(),created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(lt.shape),pt=r.object({name:r.string(),audience:r.string(),sender_email:r.string().email(),sender_name:r.string(),support_url:r.string().url().optional(),logo:r.string().url().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),language:r.string().optional()}),ht=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t),id:r.string(),...pt.shape}),$n=r.object({logoUrl:r.string(),loginBackgroundImage:r.string().nullish(),style:r.object({primaryColor:r.string(),buttonTextColor:r.string(),primaryHoverColor:r.string()}),supportEmail:r.string().nullable(),supportUrl:r.string().nullable(),name:r.string(),showGreyishBackground:r.boolean().optional(),termsAndConditionsUrl:r.string().nullable(),companyName:r.string().optional(),checkoutHideSocial:r.boolean().optional(),siteUrl:r.string().nullable(),manageSubscriptionsUrl:r.string().optional()}),Vn=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.union([r.literal("mailgun"),r.literal("mailchannels")]).optional()});r.object({...ct.shape,domains:r.array(Vn),tenant:ht,connections:r.array(ut)});const ft=r.enum(["password_reset","email_verification","otp","authorization_code","oauth2_state","ticket"]),mt=r.object({code_id:r.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:r.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:r.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:ft,expires_at:r.string(),used_at:r.string().optional(),user_id:r.string().optional()}),Ln=r.object({...mt.shape,created_at:r.string()}),_t=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.enum(["mailgun","mailchannels"])}),zn=je.extend({..._t.shape,id:r.string()}),gt=r.object({trigger_id:r.enum(["pre-user-signup","post-user-registration","post-user-login"]),enabled:r.boolean().default(!1),url:r.string(),hook_id:r.string().optional(),synchronous:r.boolean().default(!1),priority:r.number().optional()}),Bn=gt.extend({...je.shape,hook_id:r.string()}),yt=r.object({alg:r.enum(["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512"]),e:r.string(),kid:r.string(),kty:r.enum(["RSA","EC","oct"]),n:r.string(),x5t:r.string().optional(),x5c:r.array(r.string()).optional(),use:r.enum(["sig","enc"]).optional()}),Wn=r.object({keys:r.array(yt)}),Gn=r.object({issuer:r.string(),authorization_endpoint:r.string(),token_endpoint:r.string(),device_authorization_endpoint:r.string(),userinfo_endpoint:r.string(),mfa_challenge_endpoint:r.string(),jwks_uri:r.string(),registration_endpoint:r.string(),revocation_endpoint:r.string(),scopes_supported:r.array(r.string()),response_types_supported:r.array(r.string()),code_challenge_methods_supported:r.array(r.string()),response_modes_supported:r.array(r.string()),subject_types_supported:r.array(r.string()),id_token_signing_alg_values_supported:r.array(r.string()),token_endpoint_auth_methods_supported:r.array(r.string()),claims_supported:r.array(r.string()),request_uri_parameter_supported:r.boolean(),request_parameter_supported:r.boolean(),token_endpoint_auth_signing_alg_values_supported:r.array(r.string())}),vt=r.object({auth0Client:r.string().optional(),authParams:dt,expires_at:r.string(),deleted_at:r.string().optional(),ip:r.string().optional()}).openapi({description:"This represents a login sesion"}),Hn=r.object({...vt.shape,login_id:r.string().openapi({description:"This is is used as the state in the universal login"}),created_at:r.string(),updated_at:r.string()});var bt=(t=>(t.FAILED_SILENT_AUTH="fsa",t.FAILED_SIGNUP="fs",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.FAILED_CHANGE_PASSWORD="fcp",t.FAILED_BY_CONNECTOR="fc",t.FAILED_LOGIN_INVALID_EMAIL_USERNAME="fu",t.FAILED_HOOK="fh",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_CHANGE_PASSWORD="scp",t.SUCCESS_CHANGE_PASSWORD_REQUEST="scpr",t.SUCCESS_CHANGE_USERNAME="scu",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.SUCCESS_LOGIN="s",t.SUCCESS_LOGOUT="slo",t.SUCCESS_SIGNUP="ss",t.SUCCESS_SILENT_AUTH="ssa",t.SUCCESS_VERIFICATION_EMAIL="sv",t.SUCCESS_VERIFICATION_EMAIL_REQUEST="svr",t.CODE_LINK_SENT="cls",t))(bt||{});const qn=r.enum(["cls","fsa","fs","f","fc","fcoa","fcp","fh","fp","fs","fu","s","sapi","scoa","scp","scpr","scu","seacft","serft","slo","ss","ssa","sv","svr"]),kt=r.object({name:r.string(),version:r.string(),env:r.object({node:r.string().optional()}).optional()}),Fn=r.object({type:qn,date:r.string(),description:r.string().optional(),log_id:r.string().optional(),_id:r.string().optional(),ip:r.string(),user_agent:r.string(),details:r.any().optional(),isMobile:r.boolean(),user_id:r.string().optional(),user_name:r.string().optional(),connection:r.string().optional(),connection_id:r.string().optional(),client_id:r.string().optional(),client_name:r.string().optional(),audience:r.string().optional(),scope:r.array(r.string()).optional(),strategy:r.string().optional(),strategy_type:r.string().optional(),hostname:r.string().optional(),auth0_client:kt.optional()}),St=r.object({user_id:r.string(),password:r.string(),algorithm:r.enum(["bcrypt","argon2id"]).default("argon2id")}),Kn=r.object({...St.shape,created_at:r.string(),updated_at:r.string()}),xt=r.object({session_id:r.string(),client_id:r.string(),expires_at:r.string(),used_at:r.string(),deleted_at:r.string().optional(),user_id:r.string()}),Yn=r.object({created_at:r.string(),...xt.shape}),Jn=r.object({kid:r.string().openapi({description:"The key id of the signing key"}),cert:r.string().openapi({description:"The public certificate of the signing key"}),fingerprint:r.string().openapi({description:"The cert fingerprint"}),thumbprint:r.string().openapi({description:"The cert thumbprint"}),pkcs7:r.string().optional().openapi({description:"The private key in pkcs7 format"}),current:r.boolean().optional().openapi({description:"True if the key is the current key"}),next:r.boolean().optional().openapi({description:"True if the key is the next key"}),previous:r.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:r.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:r.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:r.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:r.string().optional().openapi({description:"The date and time when the key was revoked"})});var Pe=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(Pe||{});const Me=r.nativeEnum(Pe),Qn=r.object({grant_type:Me.refine(t=>t==="authorization_code"),code:r.string(),client_secret:r.string(),client_id:r.string()}),Xn=r.object({grant_type:Me.refine(t=>t==="authorization_code"),code:r.string(),code_verifier:r.string(),client_id:r.string().optional(),redirect_uri:r.string()}),er=r.object({grant_type:Me.refine(t=>t==="client_credentials"),scope:r.string().optional(),client_secret:r.string(),client_id:r.string(),audience:r.string().optional()});r.object({access_token:r.string(),id_token:r.string().optional(),scope:r.string().optional(),state:r.string().optional(),refresh_token:r.string().optional(),token_type:r.string(),expires_in:r.number()}),r.object({code:r.string(),state:r.string().optional()});const wt=r.object({button_border_radius:r.number(),button_border_weight:r.number(),buttons_style:r.enum(["pill"]),input_border_radius:r.number(),input_border_weight:r.number(),inputs_style:r.enum(["pill"]),show_widget_shadow:r.boolean(),widget_border_weight:r.number(),widget_corner_radius:r.number()}),Tt=r.object({base_focus_color:r.string(),base_hover_color:r.string(),body_text:r.string(),captcha_widget_theme:r.enum(["auto"]),error:r.string(),header:r.string(),icons:r.string(),input_background:r.string(),input_border:r.string(),input_filled_text:r.string(),input_labels_placeholders:r.string(),links_focused_components:r.string(),primary_button:r.string(),primary_button_label:r.string(),secondary_button_border:r.string(),secondary_button_label:r.string(),success:r.string(),widget_background:r.string(),widget_border:r.string()}),B=r.object({bold:r.boolean(),size:r.number()}),Et=r.object({body_text:B,buttons_text:B,font_url:r.string(),input_labels:B,links:B,links_style:r.enum(["normal"]),reference_text_size:r.number(),subtitle:B,title:B}),Ct=r.object({background_color:r.string(),background_image_url:r.string(),page_layout:r.enum(["center"])}),Ot=r.object({header_text_alignment:r.enum(["center"]),logo_height:r.number(),logo_position:r.enum(["center"]),logo_url:r.string(),social_buttons_layout:r.enum(["bottom"])}),It=r.object({borders:wt,colors:Tt,displayName:r.string(),fonts:Et,page_background:Ct,widget:Ot}),tr=It.extend({themeId:r.string()});function nr(t){const[e,n]=t.split("|");if(!e||!n)throw new Error(`Invalid user_id: ${t}`);return{connection:e,id:n}}return m.Auth0Client=kt,m.AuthorizationResponseMode=Re,m.AuthorizationResponseType=Ze,m.CodeChallengeMethod=Ae,m.GrantType=Pe,m.LogTypes=bt,m.applicationInsertSchema=ot,m.applicationSchema=ct,m.auth0UserResponseSchema=Mn,m.authParamsSchema=dt,m.authorizationCodeGrantTypeParamsSchema=Qn,m.baseUserSchema=Ne,m.bordersSchema=wt,m.brandingSchema=Un,m.clientCredentialGrantTypeParamsSchema=er,m.codeInsertSchema=mt,m.codeSchema=Ln,m.codeTypeSchema=ft,m.colorsSchema=Tt,m.connectionInsertSchema=lt,m.connectionSchema=ut,m.domainInsertSchema=_t,m.domainSchema=zn,m.fontDetailsSchema=B,m.fontsSchema=Et,m.hookInsertSchema=gt,m.hookSchema=Bn,m.identitySchema=rt,m.jwksKeySchema=Wn,m.jwksSchema=yt,m.logSchema=Fn,m.loginInsertSchema=vt,m.loginSchema=Hn,m.openIDConfigurationSchema=Gn,m.pageBackgroundSchema=Ct,m.parseUserId=nr,m.passwordInsertSchema=St,m.passwordSchema=Kn,m.pkceAuthorizationCodeGrantTypeParamsSchema=Xn,m.profileDataSchema=nt,m.samlpAddon=it,m.sessionInsertSchema=xt,m.sessionSchema=Yn,m.signingKeySchema=Jn,m.tenantInsertSchema=pt,m.tenantSchema=ht,m.themeInsertSchema=It,m.themeSchema=tr,m.totalsSchema=Pn,m.userInsertSchema=at,m.userResponseSchema=Dn,m.userSchema=st,m.vendorSettingsSchema=$n,m.widgetSchema=Ot,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({});
|
|
@@ -366,12 +366,12 @@ class w {
|
|
|
366
366
|
}
|
|
367
367
|
const g = Object.freeze({
|
|
368
368
|
status: "aborted"
|
|
369
|
-
}),
|
|
369
|
+
}), G = (t) => ({ status: "dirty", value: t }), S = (t) => ({ status: "valid", value: t }), Ze = (t) => t.status === "aborted", Re = (t) => t.status === "dirty", ee = (t) => t.status === "valid", te = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
370
370
|
function ge(t, e, n, s) {
|
|
371
371
|
if (typeof e == "function" ? t !== e || !s : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
372
372
|
return e.get(t);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function He(t, e, n, s, a) {
|
|
375
375
|
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");
|
|
376
376
|
return e.set(t, n), n;
|
|
377
377
|
}
|
|
@@ -600,7 +600,7 @@ class v {
|
|
|
600
600
|
}
|
|
601
601
|
const ft = /^c[^\s-]{8,}$/i, mt = /^[0-9a-z]+$/, _t = /^[0-9A-HJKMNP-TV-Z]{26}$/, gt = /^[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, yt = /^[a-z0-9_-]{21}$/i, vt = /^[-+]?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)?)??$/, bt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, kt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
602
602
|
let Ie;
|
|
603
|
-
const xt = /^(?:(?: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])$/, wt = /^(([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})))$/, St = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
|
|
603
|
+
const xt = /^(?:(?: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])$/, wt = /^(([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})))$/, St = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ge = "((\\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])))", Tt = new RegExp(`^${Ge}$`);
|
|
604
604
|
function qe(t) {
|
|
605
605
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
606
606
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
@@ -609,7 +609,7 @@ function Et(t) {
|
|
|
609
609
|
return new RegExp(`^${qe(t)}$`);
|
|
610
610
|
}
|
|
611
611
|
function Fe(t) {
|
|
612
|
-
let e = `${
|
|
612
|
+
let e = `${Ge}T${qe(t)}`;
|
|
613
613
|
const n = [];
|
|
614
614
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
615
615
|
}
|
|
@@ -1553,12 +1553,12 @@ C.create = (t, e) => new C({
|
|
|
1553
1553
|
typeName: _.ZodArray,
|
|
1554
1554
|
...y(e)
|
|
1555
1555
|
});
|
|
1556
|
-
function
|
|
1556
|
+
function H(t) {
|
|
1557
1557
|
if (t instanceof k) {
|
|
1558
1558
|
const e = {};
|
|
1559
1559
|
for (const n in t.shape) {
|
|
1560
1560
|
const s = t.shape[n];
|
|
1561
|
-
e[n] = j.create(
|
|
1561
|
+
e[n] = j.create(H(s));
|
|
1562
1562
|
}
|
|
1563
1563
|
return new k({
|
|
1564
1564
|
...t._def,
|
|
@@ -1566,8 +1566,8 @@ function G(t) {
|
|
|
1566
1566
|
});
|
|
1567
1567
|
} else return t instanceof C ? new C({
|
|
1568
1568
|
...t._def,
|
|
1569
|
-
type:
|
|
1570
|
-
}) : t instanceof j ? j.create(
|
|
1569
|
+
type: H(t.element)
|
|
1570
|
+
}) : t instanceof j ? j.create(H(t.unwrap())) : t instanceof U ? U.create(H(t.unwrap())) : t instanceof N ? N.create(t.items.map((e) => H(e))) : t;
|
|
1571
1571
|
}
|
|
1572
1572
|
class k extends v {
|
|
1573
1573
|
constructor() {
|
|
@@ -1803,7 +1803,7 @@ class k extends v {
|
|
|
1803
1803
|
* @deprecated
|
|
1804
1804
|
*/
|
|
1805
1805
|
deepPartial() {
|
|
1806
|
-
return
|
|
1806
|
+
return H(this);
|
|
1807
1807
|
}
|
|
1808
1808
|
partial(e) {
|
|
1809
1809
|
const n = {};
|
|
@@ -2415,7 +2415,7 @@ class D extends v {
|
|
|
2415
2415
|
code: c.invalid_type
|
|
2416
2416
|
}), g;
|
|
2417
2417
|
}
|
|
2418
|
-
if (ge(this, Q) ||
|
|
2418
|
+
if (ge(this, Q) || He(this, Q, new Set(this._def.values)), !ge(this, Q).has(e.data)) {
|
|
2419
2419
|
const n = this._getOrReturnCtx(e), s = this._def.values;
|
|
2420
2420
|
return p(n, {
|
|
2421
2421
|
received: n.data,
|
|
@@ -2475,7 +2475,7 @@ class le extends v {
|
|
|
2475
2475
|
code: c.invalid_type
|
|
2476
2476
|
}), g;
|
|
2477
2477
|
}
|
|
2478
|
-
if (ge(this, X) ||
|
|
2478
|
+
if (ge(this, X) || He(this, X, new Set(b.getValidEnumValues(this._def.values))), !ge(this, X).has(e.data)) {
|
|
2479
2479
|
const a = b.objectValues(n);
|
|
2480
2480
|
return p(s, {
|
|
2481
2481
|
received: s.data,
|
|
@@ -2546,7 +2546,7 @@ class O extends v {
|
|
|
2546
2546
|
path: s.path,
|
|
2547
2547
|
parent: s
|
|
2548
2548
|
});
|
|
2549
|
-
return u.status === "aborted" ? g : u.status === "dirty" || n.value === "dirty" ?
|
|
2549
|
+
return u.status === "aborted" ? g : u.status === "dirty" || n.value === "dirty" ? G(u.value) : u;
|
|
2550
2550
|
});
|
|
2551
2551
|
{
|
|
2552
2552
|
if (n.value === "aborted")
|
|
@@ -2556,7 +2556,7 @@ class O extends v {
|
|
|
2556
2556
|
path: s.path,
|
|
2557
2557
|
parent: s
|
|
2558
2558
|
});
|
|
2559
|
-
return d.status === "aborted" ? g : d.status === "dirty" || n.value === "dirty" ?
|
|
2559
|
+
return d.status === "aborted" ? g : d.status === "dirty" || n.value === "dirty" ? G(d.value) : d;
|
|
2560
2560
|
}
|
|
2561
2561
|
}
|
|
2562
2562
|
if (a.type === "refinement") {
|
|
@@ -2738,7 +2738,7 @@ class fe extends v {
|
|
|
2738
2738
|
path: s.path,
|
|
2739
2739
|
parent: s
|
|
2740
2740
|
});
|
|
2741
|
-
return i.status === "aborted" ? g : i.status === "dirty" ? (n.dirty(),
|
|
2741
|
+
return i.status === "aborted" ? g : i.status === "dirty" ? (n.dirty(), G(i.value)) : this._def.out._parseAsync({
|
|
2742
2742
|
data: i.value,
|
|
2743
2743
|
path: s.path,
|
|
2744
2744
|
parent: s
|
|
@@ -2800,7 +2800,7 @@ var _;
|
|
|
2800
2800
|
})(_ || (_ = {}));
|
|
2801
2801
|
const Nt = (t, e = {
|
|
2802
2802
|
message: `Input not instance of ${t.name}`
|
|
2803
|
-
}) => Ke((n) => n instanceof t, e), Je = E.create, Qe = P.create, Zt = ke.create, Rt = M.create, Xe = ne.create, At = V.create, Pt = ye.create, Mt = re.create, Dt = se.create, Ut = Y.create, $t = $.create, Vt = R.create, Lt = ve.create, zt = C.create, Bt = k.create, Wt = k.strictCreate,
|
|
2803
|
+
}) => Ke((n) => n instanceof t, e), Je = E.create, Qe = P.create, Zt = ke.create, Rt = M.create, Xe = ne.create, At = V.create, Pt = ye.create, Mt = re.create, Dt = se.create, Ut = Y.create, $t = $.create, Vt = R.create, Lt = ve.create, zt = C.create, Bt = k.create, Wt = k.strictCreate, Ht = ae.create, Gt = xe.create, qt = ie.create, Ft = N.create, Yt = oe.create, Kt = be.create, Jt = L.create, Qt = q.create, Xt = de.create, en = ce.create, tn = D.create, nn = le.create, rn = K.create, Be = O.create, sn = j.create, an = U.create, on = O.createWithPreprocess, dn = fe.create, cn = () => Je().optional(), ln = () => Qe().optional(), un = () => Xe().optional(), pn = {
|
|
2804
2804
|
string: (t) => E.create({ ...t, coerce: !0 }),
|
|
2805
2805
|
number: (t) => P.create({ ...t, coerce: !0 }),
|
|
2806
2806
|
boolean: (t) => ne.create({
|
|
@@ -2820,7 +2820,7 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2820
2820
|
addIssueToContext: p,
|
|
2821
2821
|
ParseStatus: w,
|
|
2822
2822
|
INVALID: g,
|
|
2823
|
-
DIRTY:
|
|
2823
|
+
DIRTY: G,
|
|
2824
2824
|
OK: S,
|
|
2825
2825
|
isAborted: Ze,
|
|
2826
2826
|
isDirty: Re,
|
|
@@ -2887,7 +2887,7 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2887
2887
|
bigint: Rt,
|
|
2888
2888
|
boolean: Xe,
|
|
2889
2889
|
date: At,
|
|
2890
|
-
discriminatedUnion:
|
|
2890
|
+
discriminatedUnion: Gt,
|
|
2891
2891
|
effect: Be,
|
|
2892
2892
|
enum: tn,
|
|
2893
2893
|
function: Qt,
|
|
@@ -2918,7 +2918,7 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2918
2918
|
transformer: Be,
|
|
2919
2919
|
tuple: Ft,
|
|
2920
2920
|
undefined: Mt,
|
|
2921
|
-
union:
|
|
2921
|
+
union: Ht,
|
|
2922
2922
|
unknown: $t,
|
|
2923
2923
|
void: Lt,
|
|
2924
2924
|
NEVER: hn,
|
|
@@ -2979,7 +2979,7 @@ const Wn = r.object({
|
|
|
2979
2979
|
is_social: r.boolean(),
|
|
2980
2980
|
login_count: r.number(),
|
|
2981
2981
|
identities: r.array(mn).optional()
|
|
2982
|
-
}),
|
|
2982
|
+
}), Hn = gn, Gn = et.extend({
|
|
2983
2983
|
email: r.string(),
|
|
2984
2984
|
login_count: r.number(),
|
|
2985
2985
|
multifactor: r.array(r.string()).optional(),
|
|
@@ -3176,12 +3176,24 @@ const Cn = r.enum([
|
|
|
3176
3176
|
...Me.shape,
|
|
3177
3177
|
hook_id: r.string()
|
|
3178
3178
|
}), Nn = r.object({
|
|
3179
|
-
alg: r.
|
|
3179
|
+
alg: r.enum([
|
|
3180
|
+
"RS256",
|
|
3181
|
+
"RS384",
|
|
3182
|
+
"RS512",
|
|
3183
|
+
"ES256",
|
|
3184
|
+
"ES384",
|
|
3185
|
+
"ES512",
|
|
3186
|
+
"HS256",
|
|
3187
|
+
"HS384",
|
|
3188
|
+
"HS512"
|
|
3189
|
+
]),
|
|
3180
3190
|
e: r.string(),
|
|
3181
3191
|
kid: r.string(),
|
|
3182
|
-
kty: r.
|
|
3192
|
+
kty: r.enum(["RSA", "EC", "oct"]),
|
|
3183
3193
|
n: r.string(),
|
|
3184
|
-
|
|
3194
|
+
x5t: r.string().optional(),
|
|
3195
|
+
x5c: r.array(r.string()).optional(),
|
|
3196
|
+
use: r.enum(["sig", "enc"]).optional()
|
|
3185
3197
|
}), Qn = r.object({
|
|
3186
3198
|
keys: r.array(Nn)
|
|
3187
3199
|
}), Xn = r.object({
|
|
@@ -3457,7 +3469,7 @@ export {
|
|
|
3457
3469
|
Rn as LogTypes,
|
|
3458
3470
|
vn as applicationInsertSchema,
|
|
3459
3471
|
bn as applicationSchema,
|
|
3460
|
-
|
|
3472
|
+
Hn as auth0UserResponseSchema,
|
|
3461
3473
|
kn as authParamsSchema,
|
|
3462
3474
|
ar as authorizationCodeGrantTypeParamsSchema,
|
|
3463
3475
|
et as baseUserSchema,
|
|
@@ -3499,7 +3511,7 @@ export {
|
|
|
3499
3511
|
dr as themeSchema,
|
|
3500
3512
|
Wn as totalsSchema,
|
|
3501
3513
|
_n as userInsertSchema,
|
|
3502
|
-
|
|
3514
|
+
Gn as userResponseSchema,
|
|
3503
3515
|
gn as userSchema,
|
|
3504
3516
|
Fn as vendorSettingsSchema,
|
|
3505
3517
|
zn as widgetSchema
|