react-luminus-components 1.3.47 → 1.3.48

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.
@@ -77,6 +77,14 @@
77
77
  "_nivo-pie.es-CoN57YDH.js"
78
78
  ]
79
79
  },
80
+ "_useEmployeePhotoPath-BgHzjvUU.cjs": {
81
+ "file": "useEmployeePhotoPath-BgHzjvUU.cjs",
82
+ "name": "useEmployeePhotoPath"
83
+ },
84
+ "_useEmployeePhotoPath-DjxgOb6H.js": {
85
+ "file": "useEmployeePhotoPath-DjxgOb6H.js",
86
+ "name": "useEmployeePhotoPath"
87
+ },
80
88
  "_useLocalStorageState-CnG22J8a.js": {
81
89
  "file": "useLocalStorageState-CnG22J8a.js",
82
90
  "name": "useLocalStorageState",
@@ -105,14 +113,6 @@
105
113
  "_nivo-pie.es-CoN57YDH.js"
106
114
  ]
107
115
  },
108
- "_useSearchQueryState-CS609A_4.cjs": {
109
- "file": "useSearchQueryState-CS609A_4.cjs",
110
- "name": "useSearchQueryState"
111
- },
112
- "_useSearchQueryState-QkR88Mks.js": {
113
- "file": "useSearchQueryState-QkR88Mks.js",
114
- "name": "useSearchQueryState"
115
- },
116
116
  "src/contexts/index.ts": {
117
117
  "file": "contexts.cjs.js",
118
118
  "name": "contexts",
@@ -136,7 +136,7 @@
136
136
  "_useConfirm-CUsacgMv.cjs",
137
137
  "_useLocalStorageState-isx3MAJp.cjs",
138
138
  "_dateUtils-Bc-kGMdV.cjs",
139
- "_useSearchQueryState-CS609A_4.cjs",
139
+ "_useEmployeePhotoPath-BgHzjvUU.cjs",
140
140
  "_usePermissions-3oMWt-B1.cjs"
141
141
  ]
142
142
  },
@@ -161,7 +161,7 @@
161
161
  "_PrimaryButton-CPcXJhYt.cjs",
162
162
  "_dateUtils-Bc-kGMdV.cjs",
163
163
  "_SimpleTooltip-DYrAVkD0.cjs",
164
- "_useSearchQueryState-CS609A_4.cjs",
164
+ "_useEmployeePhotoPath-BgHzjvUU.cjs",
165
165
  "_useConfirm-CUsacgMv.cjs",
166
166
  "_searchUtils-BV44hoaC.cjs"
167
167
  ]
@@ -0,0 +1,8 @@
1
+ type Props = {
2
+ employeeId: number;
3
+ noPhotoImage: string;
4
+ alt?: string;
5
+ showLargeInLightBox?: boolean;
6
+ };
7
+ declare const EmployeeSmallPhoto: ({ employeeId, alt, noPhotoImage, showLargeInLightBox, }: Props) => import("react").JSX.Element;
8
+ export default EmployeeSmallPhoto;
@@ -35,3 +35,4 @@ export { default as SettingsFormPicker } from './SettingsFormPicker/SettingsForm
35
35
  export { default as DisabledRowLabelLink } from './DisabledRowLabelLink/DisabledRowLabelLink';
36
36
  export { default as LanguageSwitch } from './LanguageSwitch/LanguageSwitch';
37
37
  export { default as TypedFormGroup } from './TypedFormGroup/TypedFormGroup';
38
+ export { default as EmployeeSmallPhoto } from './EmployeeSmallPhoto/EmployeeSmallPhoto';
@@ -13,3 +13,4 @@ export { default as useFormControlType } from './useFormControlType/useFormContr
13
13
  export { default as useLocalStorageState } from './useLocalStorageState/useLocalStorageState';
14
14
  export { default as useSearchQuery } from './useSearchQuery/useSearchQuery';
15
15
  export { default as useSearchQueryState } from './useSearchQueryState/useSearchQueryState';
16
+ export { default as useEmployeePhotoPath } from './useEmployeePhotoPath/useEmployeePhotoPath';
@@ -0,0 +1,5 @@
1
+ declare const useEmployeePhotoPath: (employeeId: number) => {
2
+ photoPath: string;
3
+ photoPathSm: string;
4
+ };
5
+ export default useEmployeePhotoPath;
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./nivo-pie.es-BJ1l5OpS.cjs"),He=require("./useConfirm-CUsacgMv.cjs"),je=require("./useLocalStorageState-isx3MAJp.cjs"),Oe=require("react"),Qe=require("./dateUtils-Bc-kGMdV.cjs");require("@azure/msal-browser");require("@azure/msal-react");require("react-router-dom");require("react-hook-form");const pe=require("./useSearchQueryState-CS609A_4.cjs"),Ke=require("./usePermissions-3oMWt-B1.cjs");var x;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var Ne;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Ne||(Ne={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},d=x.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"]),Xe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class N extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return n(this),s}static assert(e){if(!(e instanceof N))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}N.create=r=>new N(r);const Q=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case d.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case d.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let ze=Q;function Fe(r){ze=r}function ve(){return ze}const ge=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const u=s.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},et=[];function l(r,e){const t=ve(),s=ge({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Q?void 0:Q].filter(n=>!!n)});r.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,t){const s=[];for(const n of t){if(n.status==="aborted")return p;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return S.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return p;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const p=Object.freeze({status:"aborted"}),J=r=>({status:"dirty",value:r}),Z=r=>({status:"valid",value:r}),Ee=r=>r.status==="aborted",Re=r=>r.status==="dirty",te=r=>r.status==="valid",re=r=>typeof Promise<"u"&&r instanceof Promise;function xe(r,e,t,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Ve(r,e,t,s,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));var F,ee;class A{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}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 Pe=(r,e)=>{if(te(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new N(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var u,c;const{message:y}=r;return i.code==="invalid_enum_value"?{message:y??o.defaultError}:typeof o.data>"u"?{message:(u=y??s)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=y??t)!==null&&c!==void 0?c:o.defaultError}},description:n}}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 z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:z(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:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(re(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Pe(n,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(re(n)?n:Promise.resolve(n));return Pe(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new I({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return j.create(this,this._def)}nullable(){return q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R.create(this,this._def)}promise(){return X.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({..._(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new fe({..._(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Ae({typeName:m.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new he({..._(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ye.create(this,e)}readonly(){return me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tt=/^c[^\s-]{8,}$/i,rt=/^[0-9a-z]+$/,st=/^[0-9A-HJKMNP-TV-Z]{26}$/,nt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,at=/^[a-z0-9_-]{21}$/i,it=/^[-+]?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)?)??$/,ot=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ce;const ct=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ut=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,lt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,De="((\\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])))",ft=new RegExp(`^${De}$`);function Le(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ht(r){return new RegExp(`^${Le(r)}$`)}function qe(r){let e=`${De}T${Le(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function mt(r,e){return!!((e==="v4"||!e)&&ct.test(r)||(e==="v6"||!e)&&ut.test(r))}class E extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.string,received:a.parsedType}),p}const s=new S;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(n,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ot.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ce||(Ce=new RegExp(dt,"u")),Ce.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")at.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"nanoid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")tt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")rt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")st.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:d.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:d.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?qe(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?ft.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?ht(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?it.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"duration",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?mt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?lt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64",code:d.invalid_string,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:d.invalid_string,...h.errToObj(s)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t,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:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...h.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,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}E.create=r=>{var e;return new E({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};function pt(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class V 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)!==f.number){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.number,received:a.parsedType}),p}let s;const n=new S;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?pt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.not_finite,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}V.create=r=>new V({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class D 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)!==f.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.bigint,received:a.parsedType}),p}let s;const n=new S;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_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:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}D.create=r=>{var e;return new D({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};class se extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.boolean,received:s.parsedType}),p}return Z(e.data)}}se.create=r=>new se({typeName:m.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class W extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.date,received:a.parsedType}),p}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),p}const s=new S;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):x.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}W.create=r=>new W({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:m.ZodDate,..._(r)});class ke extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.symbol,received:s.parsedType}),p}return Z(e.data)}}ke.create=r=>new ke({typeName:m.ZodSymbol,..._(r)});class ne extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.undefined,received:s.parsedType}),p}return Z(e.data)}}ne.create=r=>new ne({typeName:m.ZodUndefined,..._(r)});class ae extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.null,received:s.parsedType}),p}return Z(e.data)}}ae.create=r=>new ae({typeName:m.ZodNull,..._(r)});class K extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}K.create=r=>new K({typeName:m.ZodAny,..._(r)});class U extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}U.create=r=>new U({typeName:m.ZodUnknown,..._(r)});class $ extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),p}}$.create=r=>new $({typeName:m.ZodNever,..._(r)});class be extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.void,received:s.parsedType}),p}return Z(e.data)}}be.create=r=>new be({typeName:m.ZodVoid,..._(r)});class R extends v{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return l(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),p;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(l(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(l(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>S.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return S.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new R({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new R({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new R({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}R.create=(r,e)=>new R({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,..._(e)});function Y(r){if(r instanceof k){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=j.create(Y(s))}return new k({...r._def,shape:()=>e})}else return r instanceof R?new R({...r._def,type:Y(r.element)}):r instanceof j?j.create(Y(r.unwrap())):r instanceof q?q.create(Y(r.unwrap())):r instanceof M?M.create(r.items.map(e=>Y(e))):r}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(),t=x.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const c=this._getOrReturnCtx(e);return l(c,{code:d.invalid_type,expected:f.object,received:c.parsedType}),p}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof $&&this._def.unknownKeys==="strip"))for(const c in n.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const y=a[c],O=n.data[c];u.push({key:{status:"valid",value:c},value:y._parse(new A(n,O,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof $){const c=this._def.unknownKeys;if(c==="passthrough")for(const y of o)u.push({key:{status:"valid",value:y},value:{status:"valid",value:n.data[y]}});else if(c==="strict")o.length>0&&(l(n,{code:d.unrecognized_keys,keys:o}),s.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const y of o){const O=n.data[y];u.push({key:{status:"valid",value:y},value:c._parse(new A(n,O,n.path,y)),alwaysSet:y in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const c=[];for(const y of u){const O=await y.key,Ze=await y.value;c.push({key:O,value:Ze,alwaysSet:y.alwaysSet})}return c}).then(c=>S.mergeObjectSync(s,c)):S.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const u=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o: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:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof j;)a=a._def.innerType;t[s]=a}}),new k({...this._def,shape:()=>t})}keyof(){return Ue(x.objectKeys(this.shape))}}k.create=(r,e)=>new k({shape:()=>r,unknownKeys:"strip",catchall:$.create(),typeName:m.ZodObject,..._(e)});k.strictCreate=(r,e)=>new k({shape:()=>r,unknownKeys:"strict",catchall:$.create(),typeName:m.ZodObject,..._(e)});k.lazycreate=(r,e)=>new k({shape:r,unknownKeys:"strip",catchall:$.create(),typeName:m.ZodObject,..._(e)});class ie extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new N(o.ctx.common.issues));return l(t,{code:d.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const u of s){const c={...t,common:{...t.common,issues:[]},parent:null},y=u._parseSync({data:t.data,path:t.path,parent:c});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new N(u));return l(t,{code:d.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}}ie.create=(r,e)=>new ie({options:r,typeName:m.ZodUnion,..._(e)});const P=r=>r instanceof ce?P(r.schema):r instanceof I?P(r.innerType()):r instanceof ue?[r.value]:r instanceof L?r.options:r instanceof le?x.objectValues(r.enum):r instanceof fe?P(r._def.innerType):r instanceof ne?[void 0]:r instanceof ae?[null]:r instanceof j?[void 0,...P(r.unwrap())]:r instanceof q?[null,...P(r.unwrap())]:r instanceof Ae||r instanceof me?P(r.unwrap()):r instanceof he?P(r._def.innerType):[];class Se extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:d.invalid_type,expected:f.object,received:t.parsedType}),p;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=P(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new Se({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._(s)})}}function Ie(r,e){const t=z(r),s=z(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=x.objectKeys(e),a=x.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=Ie(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=Ie(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class oe extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Ee(a)||Ee(i))return p;const o=Ie(a.value,i.value);return o.valid?((Re(a)||Re(i))&&t.dirty(),{status:t.value,value:o.data}):(l(s,{code:d.invalid_intersection_types}),p)};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(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}oe.create=(r,e,t)=>new oe({left:r,right:e,typeName:m.ZodIntersection,..._(t)});class M extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return l(s,{code:d.invalid_type,expected:f.array,received:s.parsedType}),p;if(s.data.length<this._def.items.length)return l(s,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new A(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>S.mergeArray(t,i)):S.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:r,typeName:m.ZodTuple,rest:null,..._(e)})};class de extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return l(s,{code:d.invalid_type,expected:f.object,received:s.parsedType}),p;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new A(s,o,s.path,o)),value:i._parse(new A(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new de({keyType:e,valueType:t,typeName:m.ZodRecord,..._(s)}):new de({keyType:E.create(),valueType:e,typeName:m.ZodRecord,..._(t)})}}class we extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return l(s,{code:d.invalid_type,expected:f.map,received:s.parsedType}),p;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],c)=>({key:n._parse(new A(s,o,s.path,[c,"key"])),value:a._parse(new A(s,u,s.path,[c,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,y=await u.value;if(c.status==="aborted"||y.status==="aborted")return p;(c.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(c.value,y.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,y=u.value;if(c.status==="aborted"||y.status==="aborted")return p;(c.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(c.value,y.value)}return{status:t.value,value:o}}}}we.create=(r,e,t)=>new we({valueType:e,keyType:r,typeName:m.ZodMap,..._(t)});class G extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return l(s,{code:d.invalid_type,expected:f.set,received:s.parsedType}),p;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(l(s,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(l(s,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const c=new Set;for(const y of u){if(y.status==="aborted")return p;y.status==="dirty"&&t.dirty(),c.add(y.value)}return{status:t.value,value:c}}const o=[...s.data.values()].map((u,c)=>a._parse(new A(s,u,s.path,c)));return s.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new G({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new G({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}G.create=(r,e)=>new G({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,..._(e)});class H extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return l(t,{code:d.invalid_type,expected:f.function,received:t.parsedType}),p;function s(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),Q].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:u}})}function n(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),Q].filter(c=>!!c),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof X){const o=this;return Z(async function(...u){const c=new N([]),y=await o._def.args.parseAsync(u,a).catch(_e=>{throw c.addIssue(s(u,_e)),c}),O=await Reflect.apply(i,this,y);return await o._def.returns._def.type.parseAsync(O,a).catch(_e=>{throw c.addIssue(n(O,_e)),c})})}else{const o=this;return Z(function(...u){const c=o._def.args.safeParse(u,a);if(!c.success)throw new N([s(u,c.error)]);const y=Reflect.apply(i,this,c.data),O=o._def.returns.safeParse(y,a);if(!O.success)throw new N([n(y,O.error)]);return O.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new H({...this._def,args:M.create(e).rest(U.create())})}returns(e){return new H({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new H({args:e||M.create([]).rest(U.create()),returns:t||U.create(),typeName:m.ZodFunction,..._(s)})}}class ce extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ce.create=(r,e)=>new ce({getter:r,typeName:m.ZodLazy,..._(e)});class ue extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}ue.create=(r,e)=>new ue({value:r,typeName:m.ZodLiteral,..._(e)});function Ue(r,e){return new L({values:r,typeName:m.ZodEnum,..._(e)})}class L extends v{constructor(){super(...arguments),F.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{expected:x.joinValues(s),received:t.parsedType,code:d.invalid_type}),p}if(xe(this,F)||Ve(this,F,new Set(this._def.values)),!xe(this,F).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:s}),p}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return L.create(e,{...this._def,...t})}exclude(e,t=this._def){return L.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}F=new WeakMap;L.create=Ue;class le extends v{constructor(){super(...arguments),ee.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=x.objectValues(t);return l(s,{expected:x.joinValues(n),received:s.parsedType,code:d.invalid_type}),p}if(xe(this,ee)||Ve(this,ee,new Set(x.getValidEnumValues(this._def.values))),!xe(this,ee).has(e.data)){const n=x.objectValues(t);return l(s,{received:s.data,code:d.invalid_enum_value,options:n}),p}return Z(e.data)}get enum(){return this._def.values}}ee=new WeakMap;le.create=(r,e)=>new le({values:r,typeName:m.ZodNativeEnum,..._(e)});class X extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return l(t,{code:d.invalid_type,expected:f.promise,received:t.parsedType}),p;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return Z(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}X.create=(r,e)=>new X({type:r,typeName:m.ZodPromise,..._(e)});class I extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return p;const u=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return u.status==="aborted"?p:u.status==="dirty"||t.value==="dirty"?J(u.value):u});{if(t.value==="aborted")return p;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?p:o.status==="dirty"||t.value==="dirty"?J(o.value):o}}if(n.type==="refinement"){const i=o=>{const u=n.refinement(o,a);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 o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!te(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>te(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(n)}}I.create=(r,e,t)=>new I({schema:r,typeName:m.ZodEffects,effect:e,..._(t)});I.createWithPreprocess=(r,e,t)=>new I({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,..._(t)});class j extends v{_parse(e){return this._getType(e)===f.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(r,e)=>new j({innerType:r,typeName:m.ZodOptional,..._(e)});class q extends v{_parse(e){return this._getType(e)===f.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}q.create=(r,e)=>new q({innerType:r,typeName:m.ZodNullable,..._(e)});class fe extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}fe.create=(r,e)=>new fe({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class he extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return re(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}he.create=(r,e)=>new he({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Te extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.nan,received:s.parsedType}),p}return{status:"valid",value:e.data}}}Te.create=r=>new Te({typeName:m.ZodNaN,..._(r)});const yt=Symbol("zod_brand");class Ae extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ye extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),J(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ye({in:e,out:t,typeName:m.ZodPipeline})}}class me extends v{_parse(e){const t=this._def.innerType._parse(e),s=n=>(te(n)&&(n.value=Object.freeze(n.value)),n);return re(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}me.create=(r,e)=>new me({innerType:r,typeName:m.ZodReadonly,..._(e)});function Be(r,e={},t){return r?K.create().superRefine((s,n)=>{var a,i;if(!r(s)){const o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,c=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...c,fatal:u})}}):K.create()}const _t={object:k.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const vt=(r,e={message:`Input not instance of ${r.name}`})=>Be(t=>t instanceof r,e),We=E.create,Ge=V.create,gt=Te.create,xt=D.create,Ye=se.create,kt=W.create,bt=ke.create,wt=ne.create,Tt=ae.create,St=K.create,Zt=U.create,Ct=$.create,Ot=be.create,Nt=R.create,Et=k.create,Rt=k.strictCreate,It=ie.create,jt=Se.create,At=oe.create,Mt=M.create,Pt=de.create,$t=we.create,zt=G.create,Vt=H.create,Dt=ce.create,Lt=ue.create,qt=L.create,Ut=le.create,Bt=X.create,$e=I.create,Wt=j.create,Gt=q.create,Yt=I.createWithPreprocess,Jt=ye.create,Ht=()=>We().optional(),Qt=()=>Ge().optional(),Kt=()=>Ye().optional(),Xt={string:r=>E.create({...r,coerce:!0}),number:r=>V.create({...r,coerce:!0}),boolean:r=>se.create({...r,coerce:!0}),bigint:r=>D.create({...r,coerce:!0}),date:r=>W.create({...r,coerce:!0})},Ft=p;var C=Object.freeze({__proto__:null,defaultErrorMap:Q,setErrorMap:Fe,getErrorMap:ve,makeIssue:ge,EMPTY_PATH:et,addIssueToContext:l,ParseStatus:S,INVALID:p,DIRTY:J,OK:Z,isAborted:Ee,isDirty:Re,isValid:te,isAsync:re,get util(){return x},get objectUtil(){return Ne},ZodParsedType:f,getParsedType:z,ZodType:v,datetimeRegex:qe,ZodString:E,ZodNumber:V,ZodBigInt:D,ZodBoolean:se,ZodDate:W,ZodSymbol:ke,ZodUndefined:ne,ZodNull:ae,ZodAny:K,ZodUnknown:U,ZodNever:$,ZodVoid:be,ZodArray:R,ZodObject:k,ZodUnion:ie,ZodDiscriminatedUnion:Se,ZodIntersection:oe,ZodTuple:M,ZodRecord:de,ZodMap:we,ZodSet:G,ZodFunction:H,ZodLazy:ce,ZodLiteral:ue,ZodEnum:L,ZodNativeEnum:le,ZodPromise:X,ZodEffects:I,ZodTransformer:I,ZodOptional:j,ZodNullable:q,ZodDefault:fe,ZodCatch:he,ZodNaN:Te,BRAND:yt,ZodBranded:Ae,ZodPipeline:ye,ZodReadonly:me,custom:Be,Schema:v,ZodSchema:v,late:_t,get ZodFirstPartyTypeKind(){return m},coerce:Xt,any:St,array:Nt,bigint:xt,boolean:Ye,date:kt,discriminatedUnion:jt,effect:$e,enum:qt,function:Vt,instanceof:vt,intersection:At,lazy:Dt,literal:Lt,map:$t,nan:gt,nativeEnum:Ut,never:Ct,null:Tt,nullable:Gt,number:Ge,object:Et,oboolean:Kt,onumber:Qt,optional:Wt,ostring:Ht,pipeline:Jt,preprocess:Yt,promise:Bt,record:Pt,set:zt,strictObject:Rt,string:We,symbol:bt,transformer:$e,tuple:Mt,undefined:wt,union:It,unknown:Zt,void:Ot,NEVER:Ft,ZodIssueCode:d,quotelessJson:Xe,ZodError:N});const er=()=>{const{texts:{formValidation:r}}=Oe.useContext(B.LuminusComponentsContext),e=g=>(g!=null&&g.useCoerce?C.coerce:C).string({invalid_type_error:r.required,required_error:r.required}).transform(w=>w??null),t=g=>e(g).nullable().optional().transform(b=>b??null),s=g=>{const b=(g!=null&&g.useCoerce?C.coerce:C).number({invalid_type_error:r.required,required_error:r.required});return(g==null?void 0:g.min)!==void 0&&b.min(g.min),(g==null?void 0:g.max)!==void 0&&b.max(g.max),b.transform(w=>w??null)},n=g=>s(g).nullable().optional().transform(b=>b??null),a=g=>(g!=null&&g.useCoerce?C.coerce:C).boolean({invalid_type_error:r.required,required_error:r.required}).transform(b=>b??null),i=g=>(g!=null&&g.useCoerce?C.coerce:C).string({invalid_type_error:r.required,required_error:r.required}).refine(Qe.isISODate,{message:r.invalidDate}).transform(w=>w??null),o=g=>i(g).nullable().transform(b=>b??null),u=(g,b)=>C.enum(g,{invalid_type_error:r.required,required_error:r.required}).transform(Me=>Me??null);return{zString:t,zStringRequired:e,zNumber:n,zNumberRequired:s,zBool:a,zDate:o,zDateRequired:i,zEnum:(g,b)=>u(g).nullable().transform(w=>w??null),zEnumRequired:u,zObjectIdInt:g=>C.object({id:n({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdIntRequired:g=>C.object({id:s()}).transform(w=>w??null),zObjectIdStr:g=>C.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdStrRequired:g=>C.object({id:e()}).transform(w=>w??null),zFile:({required:g,multiple:b,maxFileSize:w})=>C.any().transform(T=>Array.from(T??[])).refine(T=>!g||(T==null?void 0:T.length)>0,"File is required.").refine(T=>b||(T==null?void 0:T.length)<=1,"Multiple files not allowed.").refine(T=>T.every(Je=>Je.size<=w),`Maximum file size is ${B.formatFileSize(w)}.`).transform(T=>(b?T:T==null?void 0:T[0])??null)}},tr=r=>{let e="pending",t;const s=r.then(n=>{e="success",t=n},n=>{e="error",t=n});return()=>{switch(e){case"pending":throw s;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function rr(r){const e=B.useAxios({silent:!0}),[t,s]=Oe.useState(null);return Oe.useEffect(()=>{(async()=>{const a=e.get(r).then(i=>i.data);s(tr(a))})()},[e,r]),t}exports.cancelToken=B.cancelToken;exports.useAuth=B.useAuth;exports.useAxios=B.useAxios;exports.useNotifications=B.useNotifications;exports.useConfirm=He.useConfirm;exports.useGetApiData=je.useGetApiData;exports.useLocalStorageState=je.useLocalStorageState;exports.usePrompt=je.usePrompt;exports.useClickOutside=pe.useClickOutside;exports.useFormControlType=pe.useFormControlType;exports.useKeyPress=pe.useKeyPress;exports.useSearchQuery=pe.useSearchQuery;exports.useSearchQueryState=pe.useSearchQueryState;exports.usePermissions=Ke.usePermissions;exports.useGetDataBound=rr;exports.useZodSchemaTypes=er;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./nivo-pie.es-BJ1l5OpS.cjs"),He=require("./useConfirm-CUsacgMv.cjs"),je=require("./useLocalStorageState-isx3MAJp.cjs"),Oe=require("react"),Qe=require("./dateUtils-Bc-kGMdV.cjs");require("@azure/msal-browser");require("@azure/msal-react");require("react-router-dom");require("react-hook-form");const F=require("./useEmployeePhotoPath-BgHzjvUU.cjs"),Ke=require("./usePermissions-3oMWt-B1.cjs");var x;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var Ne;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Ne||(Ne={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},d=x.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"]),Xe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class N extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return n(this),s}static assert(e){if(!(e instanceof N))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}N.create=r=>new N(r);const Q=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case d.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case d.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let ze=Q;function Fe(r){ze=r}function ve(){return ze}const ge=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const u=s.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},et=[];function l(r,e){const t=ve(),s=ge({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Q?void 0:Q].filter(n=>!!n)});r.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,t){const s=[];for(const n of t){if(n.status==="aborted")return p;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return S.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return p;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const p=Object.freeze({status:"aborted"}),J=r=>({status:"dirty",value:r}),Z=r=>({status:"valid",value:r}),Ee=r=>r.status==="aborted",Re=r=>r.status==="dirty",re=r=>r.status==="valid",se=r=>typeof Promise<"u"&&r instanceof Promise;function xe(r,e,t,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Ve(r,e,t,s,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));var ee,te;class A{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}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 Me=(r,e)=>{if(re(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new N(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var u,c;const{message:y}=r;return i.code==="invalid_enum_value"?{message:y??o.defaultError}:typeof o.data>"u"?{message:(u=y??s)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=y??t)!==null&&c!==void 0?c:o.defaultError}},description:n}}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 z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:z(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:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(se(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Me(n,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(se(n)?n:Promise.resolve(n));return Me(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new I({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return j.create(this,this._def)}nullable(){return q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R.create(this,this._def)}promise(){return X.create(this,this._def)}or(e){return oe.create([this,e],this._def)}and(e){return de.create(this,e,this._def)}transform(e){return new I({..._(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new he({..._(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Ae({typeName:m.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new me({..._(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ye.create(this,e)}readonly(){return pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tt=/^c[^\s-]{8,}$/i,rt=/^[0-9a-z]+$/,st=/^[0-9A-HJKMNP-TV-Z]{26}$/,nt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,at=/^[a-z0-9_-]{21}$/i,it=/^[-+]?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)?)??$/,ot=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ce;const ct=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ut=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,lt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,De="((\\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])))",ft=new RegExp(`^${De}$`);function Le(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ht(r){return new RegExp(`^${Le(r)}$`)}function qe(r){let e=`${De}T${Le(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function mt(r,e){return!!((e==="v4"||!e)&&ct.test(r)||(e==="v6"||!e)&&ut.test(r))}class E extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.string,received:a.parsedType}),p}const s=new S;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(n,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ot.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ce||(Ce=new RegExp(dt,"u")),Ce.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")at.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"nanoid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")tt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")rt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")st.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:d.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:d.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?qe(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?ft.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?ht(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?it.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"duration",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?mt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?lt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64",code:d.invalid_string,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:d.invalid_string,...h.errToObj(s)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t,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:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...h.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,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}E.create=r=>{var e;return new E({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};function pt(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class V 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)!==f.number){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.number,received:a.parsedType}),p}let s;const n=new S;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?pt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.not_finite,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}V.create=r=>new V({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class D 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)!==f.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.bigint,received:a.parsedType}),p}let s;const n=new S;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_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:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}D.create=r=>{var e;return new D({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};class ne extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.boolean,received:s.parsedType}),p}return Z(e.data)}}ne.create=r=>new ne({typeName:m.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class W extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.date,received:a.parsedType}),p}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),p}const s=new S;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):x.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}W.create=r=>new W({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:m.ZodDate,..._(r)});class ke extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.symbol,received:s.parsedType}),p}return Z(e.data)}}ke.create=r=>new ke({typeName:m.ZodSymbol,..._(r)});class ae extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.undefined,received:s.parsedType}),p}return Z(e.data)}}ae.create=r=>new ae({typeName:m.ZodUndefined,..._(r)});class ie extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.null,received:s.parsedType}),p}return Z(e.data)}}ie.create=r=>new ie({typeName:m.ZodNull,..._(r)});class K extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}K.create=r=>new K({typeName:m.ZodAny,..._(r)});class U extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}U.create=r=>new U({typeName:m.ZodUnknown,..._(r)});class $ extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),p}}$.create=r=>new $({typeName:m.ZodNever,..._(r)});class be extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.void,received:s.parsedType}),p}return Z(e.data)}}be.create=r=>new be({typeName:m.ZodVoid,..._(r)});class R extends v{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return l(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),p;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(l(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(l(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>S.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return S.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new R({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new R({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new R({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}R.create=(r,e)=>new R({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,..._(e)});function Y(r){if(r instanceof k){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=j.create(Y(s))}return new k({...r._def,shape:()=>e})}else return r instanceof R?new R({...r._def,type:Y(r.element)}):r instanceof j?j.create(Y(r.unwrap())):r instanceof q?q.create(Y(r.unwrap())):r instanceof P?P.create(r.items.map(e=>Y(e))):r}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(),t=x.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const c=this._getOrReturnCtx(e);return l(c,{code:d.invalid_type,expected:f.object,received:c.parsedType}),p}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof $&&this._def.unknownKeys==="strip"))for(const c in n.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const y=a[c],O=n.data[c];u.push({key:{status:"valid",value:c},value:y._parse(new A(n,O,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof $){const c=this._def.unknownKeys;if(c==="passthrough")for(const y of o)u.push({key:{status:"valid",value:y},value:{status:"valid",value:n.data[y]}});else if(c==="strict")o.length>0&&(l(n,{code:d.unrecognized_keys,keys:o}),s.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const y of o){const O=n.data[y];u.push({key:{status:"valid",value:y},value:c._parse(new A(n,O,n.path,y)),alwaysSet:y in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const c=[];for(const y of u){const O=await y.key,Ze=await y.value;c.push({key:O,value:Ze,alwaysSet:y.alwaysSet})}return c}).then(c=>S.mergeObjectSync(s,c)):S.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const u=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o: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:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof j;)a=a._def.innerType;t[s]=a}}),new k({...this._def,shape:()=>t})}keyof(){return Ue(x.objectKeys(this.shape))}}k.create=(r,e)=>new k({shape:()=>r,unknownKeys:"strip",catchall:$.create(),typeName:m.ZodObject,..._(e)});k.strictCreate=(r,e)=>new k({shape:()=>r,unknownKeys:"strict",catchall:$.create(),typeName:m.ZodObject,..._(e)});k.lazycreate=(r,e)=>new k({shape:r,unknownKeys:"strip",catchall:$.create(),typeName:m.ZodObject,..._(e)});class oe extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new N(o.ctx.common.issues));return l(t,{code:d.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const u of s){const c={...t,common:{...t.common,issues:[]},parent:null},y=u._parseSync({data:t.data,path:t.path,parent:c});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new N(u));return l(t,{code:d.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}}oe.create=(r,e)=>new oe({options:r,typeName:m.ZodUnion,..._(e)});const M=r=>r instanceof ue?M(r.schema):r instanceof I?M(r.innerType()):r instanceof le?[r.value]:r instanceof L?r.options:r instanceof fe?x.objectValues(r.enum):r instanceof he?M(r._def.innerType):r instanceof ae?[void 0]:r instanceof ie?[null]:r instanceof j?[void 0,...M(r.unwrap())]:r instanceof q?[null,...M(r.unwrap())]:r instanceof Ae||r instanceof pe?M(r.unwrap()):r instanceof me?M(r._def.innerType):[];class Se extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:d.invalid_type,expected:f.object,received:t.parsedType}),p;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=M(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new Se({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._(s)})}}function Ie(r,e){const t=z(r),s=z(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=x.objectKeys(e),a=x.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=Ie(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=Ie(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class de extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Ee(a)||Ee(i))return p;const o=Ie(a.value,i.value);return o.valid?((Re(a)||Re(i))&&t.dirty(),{status:t.value,value:o.data}):(l(s,{code:d.invalid_intersection_types}),p)};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(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}de.create=(r,e,t)=>new de({left:r,right:e,typeName:m.ZodIntersection,..._(t)});class P extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return l(s,{code:d.invalid_type,expected:f.array,received:s.parsedType}),p;if(s.data.length<this._def.items.length)return l(s,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new A(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>S.mergeArray(t,i)):S.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new P({...this._def,rest:e})}}P.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new P({items:r,typeName:m.ZodTuple,rest:null,..._(e)})};class ce extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return l(s,{code:d.invalid_type,expected:f.object,received:s.parsedType}),p;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new A(s,o,s.path,o)),value:i._parse(new A(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new ce({keyType:e,valueType:t,typeName:m.ZodRecord,..._(s)}):new ce({keyType:E.create(),valueType:e,typeName:m.ZodRecord,..._(t)})}}class we extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return l(s,{code:d.invalid_type,expected:f.map,received:s.parsedType}),p;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],c)=>({key:n._parse(new A(s,o,s.path,[c,"key"])),value:a._parse(new A(s,u,s.path,[c,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,y=await u.value;if(c.status==="aborted"||y.status==="aborted")return p;(c.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(c.value,y.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,y=u.value;if(c.status==="aborted"||y.status==="aborted")return p;(c.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(c.value,y.value)}return{status:t.value,value:o}}}}we.create=(r,e,t)=>new we({valueType:e,keyType:r,typeName:m.ZodMap,..._(t)});class G extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return l(s,{code:d.invalid_type,expected:f.set,received:s.parsedType}),p;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(l(s,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(l(s,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const c=new Set;for(const y of u){if(y.status==="aborted")return p;y.status==="dirty"&&t.dirty(),c.add(y.value)}return{status:t.value,value:c}}const o=[...s.data.values()].map((u,c)=>a._parse(new A(s,u,s.path,c)));return s.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new G({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new G({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}G.create=(r,e)=>new G({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,..._(e)});class H extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return l(t,{code:d.invalid_type,expected:f.function,received:t.parsedType}),p;function s(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),Q].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:u}})}function n(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),Q].filter(c=>!!c),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof X){const o=this;return Z(async function(...u){const c=new N([]),y=await o._def.args.parseAsync(u,a).catch(_e=>{throw c.addIssue(s(u,_e)),c}),O=await Reflect.apply(i,this,y);return await o._def.returns._def.type.parseAsync(O,a).catch(_e=>{throw c.addIssue(n(O,_e)),c})})}else{const o=this;return Z(function(...u){const c=o._def.args.safeParse(u,a);if(!c.success)throw new N([s(u,c.error)]);const y=Reflect.apply(i,this,c.data),O=o._def.returns.safeParse(y,a);if(!O.success)throw new N([n(y,O.error)]);return O.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new H({...this._def,args:P.create(e).rest(U.create())})}returns(e){return new H({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new H({args:e||P.create([]).rest(U.create()),returns:t||U.create(),typeName:m.ZodFunction,..._(s)})}}class ue extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ue.create=(r,e)=>new ue({getter:r,typeName:m.ZodLazy,..._(e)});class le extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}le.create=(r,e)=>new le({value:r,typeName:m.ZodLiteral,..._(e)});function Ue(r,e){return new L({values:r,typeName:m.ZodEnum,..._(e)})}class L extends v{constructor(){super(...arguments),ee.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{expected:x.joinValues(s),received:t.parsedType,code:d.invalid_type}),p}if(xe(this,ee)||Ve(this,ee,new Set(this._def.values)),!xe(this,ee).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:s}),p}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return L.create(e,{...this._def,...t})}exclude(e,t=this._def){return L.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}ee=new WeakMap;L.create=Ue;class fe extends v{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=x.objectValues(t);return l(s,{expected:x.joinValues(n),received:s.parsedType,code:d.invalid_type}),p}if(xe(this,te)||Ve(this,te,new Set(x.getValidEnumValues(this._def.values))),!xe(this,te).has(e.data)){const n=x.objectValues(t);return l(s,{received:s.data,code:d.invalid_enum_value,options:n}),p}return Z(e.data)}get enum(){return this._def.values}}te=new WeakMap;fe.create=(r,e)=>new fe({values:r,typeName:m.ZodNativeEnum,..._(e)});class X extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return l(t,{code:d.invalid_type,expected:f.promise,received:t.parsedType}),p;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return Z(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}X.create=(r,e)=>new X({type:r,typeName:m.ZodPromise,..._(e)});class I extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return p;const u=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return u.status==="aborted"?p:u.status==="dirty"||t.value==="dirty"?J(u.value):u});{if(t.value==="aborted")return p;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?p:o.status==="dirty"||t.value==="dirty"?J(o.value):o}}if(n.type==="refinement"){const i=o=>{const u=n.refinement(o,a);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 o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!re(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>re(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(n)}}I.create=(r,e,t)=>new I({schema:r,typeName:m.ZodEffects,effect:e,..._(t)});I.createWithPreprocess=(r,e,t)=>new I({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,..._(t)});class j extends v{_parse(e){return this._getType(e)===f.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(r,e)=>new j({innerType:r,typeName:m.ZodOptional,..._(e)});class q extends v{_parse(e){return this._getType(e)===f.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}q.create=(r,e)=>new q({innerType:r,typeName:m.ZodNullable,..._(e)});class he extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}he.create=(r,e)=>new he({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class me extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return se(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}me.create=(r,e)=>new me({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Te extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.nan,received:s.parsedType}),p}return{status:"valid",value:e.data}}}Te.create=r=>new Te({typeName:m.ZodNaN,..._(r)});const yt=Symbol("zod_brand");class Ae extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ye extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),J(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ye({in:e,out:t,typeName:m.ZodPipeline})}}class pe extends v{_parse(e){const t=this._def.innerType._parse(e),s=n=>(re(n)&&(n.value=Object.freeze(n.value)),n);return se(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}pe.create=(r,e)=>new pe({innerType:r,typeName:m.ZodReadonly,..._(e)});function Be(r,e={},t){return r?K.create().superRefine((s,n)=>{var a,i;if(!r(s)){const o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,c=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...c,fatal:u})}}):K.create()}const _t={object:k.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const vt=(r,e={message:`Input not instance of ${r.name}`})=>Be(t=>t instanceof r,e),We=E.create,Ge=V.create,gt=Te.create,xt=D.create,Ye=ne.create,kt=W.create,bt=ke.create,wt=ae.create,Tt=ie.create,St=K.create,Zt=U.create,Ct=$.create,Ot=be.create,Nt=R.create,Et=k.create,Rt=k.strictCreate,It=oe.create,jt=Se.create,At=de.create,Pt=P.create,Mt=ce.create,$t=we.create,zt=G.create,Vt=H.create,Dt=ue.create,Lt=le.create,qt=L.create,Ut=fe.create,Bt=X.create,$e=I.create,Wt=j.create,Gt=q.create,Yt=I.createWithPreprocess,Jt=ye.create,Ht=()=>We().optional(),Qt=()=>Ge().optional(),Kt=()=>Ye().optional(),Xt={string:r=>E.create({...r,coerce:!0}),number:r=>V.create({...r,coerce:!0}),boolean:r=>ne.create({...r,coerce:!0}),bigint:r=>D.create({...r,coerce:!0}),date:r=>W.create({...r,coerce:!0})},Ft=p;var C=Object.freeze({__proto__:null,defaultErrorMap:Q,setErrorMap:Fe,getErrorMap:ve,makeIssue:ge,EMPTY_PATH:et,addIssueToContext:l,ParseStatus:S,INVALID:p,DIRTY:J,OK:Z,isAborted:Ee,isDirty:Re,isValid:re,isAsync:se,get util(){return x},get objectUtil(){return Ne},ZodParsedType:f,getParsedType:z,ZodType:v,datetimeRegex:qe,ZodString:E,ZodNumber:V,ZodBigInt:D,ZodBoolean:ne,ZodDate:W,ZodSymbol:ke,ZodUndefined:ae,ZodNull:ie,ZodAny:K,ZodUnknown:U,ZodNever:$,ZodVoid:be,ZodArray:R,ZodObject:k,ZodUnion:oe,ZodDiscriminatedUnion:Se,ZodIntersection:de,ZodTuple:P,ZodRecord:ce,ZodMap:we,ZodSet:G,ZodFunction:H,ZodLazy:ue,ZodLiteral:le,ZodEnum:L,ZodNativeEnum:fe,ZodPromise:X,ZodEffects:I,ZodTransformer:I,ZodOptional:j,ZodNullable:q,ZodDefault:he,ZodCatch:me,ZodNaN:Te,BRAND:yt,ZodBranded:Ae,ZodPipeline:ye,ZodReadonly:pe,custom:Be,Schema:v,ZodSchema:v,late:_t,get ZodFirstPartyTypeKind(){return m},coerce:Xt,any:St,array:Nt,bigint:xt,boolean:Ye,date:kt,discriminatedUnion:jt,effect:$e,enum:qt,function:Vt,instanceof:vt,intersection:At,lazy:Dt,literal:Lt,map:$t,nan:gt,nativeEnum:Ut,never:Ct,null:Tt,nullable:Gt,number:Ge,object:Et,oboolean:Kt,onumber:Qt,optional:Wt,ostring:Ht,pipeline:Jt,preprocess:Yt,promise:Bt,record:Mt,set:zt,strictObject:Rt,string:We,symbol:bt,transformer:$e,tuple:Pt,undefined:wt,union:It,unknown:Zt,void:Ot,NEVER:Ft,ZodIssueCode:d,quotelessJson:Xe,ZodError:N});const er=()=>{const{texts:{formValidation:r}}=Oe.useContext(B.LuminusComponentsContext),e=g=>(g!=null&&g.useCoerce?C.coerce:C).string({invalid_type_error:r.required,required_error:r.required}).transform(w=>w??null),t=g=>e(g).nullable().optional().transform(b=>b??null),s=g=>{const b=(g!=null&&g.useCoerce?C.coerce:C).number({invalid_type_error:r.required,required_error:r.required});return(g==null?void 0:g.min)!==void 0&&b.min(g.min),(g==null?void 0:g.max)!==void 0&&b.max(g.max),b.transform(w=>w??null)},n=g=>s(g).nullable().optional().transform(b=>b??null),a=g=>(g!=null&&g.useCoerce?C.coerce:C).boolean({invalid_type_error:r.required,required_error:r.required}).transform(b=>b??null),i=g=>(g!=null&&g.useCoerce?C.coerce:C).string({invalid_type_error:r.required,required_error:r.required}).refine(Qe.isISODate,{message:r.invalidDate}).transform(w=>w??null),o=g=>i(g).nullable().transform(b=>b??null),u=(g,b)=>C.enum(g,{invalid_type_error:r.required,required_error:r.required}).transform(Pe=>Pe??null);return{zString:t,zStringRequired:e,zNumber:n,zNumberRequired:s,zBool:a,zDate:o,zDateRequired:i,zEnum:(g,b)=>u(g).nullable().transform(w=>w??null),zEnumRequired:u,zObjectIdInt:g=>C.object({id:n({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdIntRequired:g=>C.object({id:s()}).transform(w=>w??null),zObjectIdStr:g=>C.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdStrRequired:g=>C.object({id:e()}).transform(w=>w??null),zFile:({required:g,multiple:b,maxFileSize:w})=>C.any().transform(T=>Array.from(T??[])).refine(T=>!g||(T==null?void 0:T.length)>0,"File is required.").refine(T=>b||(T==null?void 0:T.length)<=1,"Multiple files not allowed.").refine(T=>T.every(Je=>Je.size<=w),`Maximum file size is ${B.formatFileSize(w)}.`).transform(T=>(b?T:T==null?void 0:T[0])??null)}},tr=r=>{let e="pending",t;const s=r.then(n=>{e="success",t=n},n=>{e="error",t=n});return()=>{switch(e){case"pending":throw s;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function rr(r){const e=B.useAxios({silent:!0}),[t,s]=Oe.useState(null);return Oe.useEffect(()=>{(async()=>{const a=e.get(r).then(i=>i.data);s(tr(a))})()},[e,r]),t}exports.cancelToken=B.cancelToken;exports.useAuth=B.useAuth;exports.useAxios=B.useAxios;exports.useNotifications=B.useNotifications;exports.useConfirm=He.useConfirm;exports.useGetApiData=je.useGetApiData;exports.useLocalStorageState=je.useLocalStorageState;exports.usePrompt=je.usePrompt;exports.useClickOutside=F.useClickOutside;exports.useEmployeePhotoPath=F.useEmployeePhotoPath;exports.useFormControlType=F.useFormControlType;exports.useKeyPress=F.useKeyPress;exports.useSearchQuery=F.useSearchQuery;exports.useSearchQueryState=F.useSearchQueryState;exports.usePermissions=Ke.usePermissions;exports.useGetDataBound=rr;exports.useZodSchemaTypes=er;
package/dist/hooks.es.js CHANGED
@@ -8,8 +8,8 @@ import "@azure/msal-browser";
8
8
  import "@azure/msal-react";
9
9
  import "react-router-dom";
10
10
  import "react-hook-form";
11
- import { a as wr, b as Tr, u as Zr, c as Sr, d as Cr } from "./useSearchQueryState-QkR88Mks.js";
12
- import { u as Nr } from "./usePermissions-Ca5nob2q.js";
11
+ import { a as wr, e as Tr, b as Zr, u as Sr, c as Cr, d as Or } from "./useEmployeePhotoPath-DjxgOb6H.js";
12
+ import { u as Er } from "./usePermissions-Ca5nob2q.js";
13
13
  var x;
14
14
  (function(r) {
15
15
  r.assertEqual = (s) => s;
@@ -75,7 +75,7 @@ const f = x.arrayToEnum([
75
75
  "never",
76
76
  "map",
77
77
  "set"
78
- ]), P = (r) => {
78
+ ]), z = (r) => {
79
79
  switch (typeof r) {
80
80
  case "undefined":
81
81
  return f.undefined;
@@ -373,13 +373,13 @@ class v {
373
373
  return this._def.description;
374
374
  }
375
375
  _getType(e) {
376
- return P(e.data);
376
+ return z(e.data);
377
377
  }
378
378
  _getOrReturnCtx(e, t) {
379
379
  return t || {
380
380
  common: e.parent.common,
381
381
  data: e.data,
382
- parsedType: P(e.data),
382
+ parsedType: z(e.data),
383
383
  schemaErrorMap: this._def.errorMap,
384
384
  path: e.path,
385
385
  parent: e.parent
@@ -391,7 +391,7 @@ class v {
391
391
  ctx: {
392
392
  common: e.parent.common,
393
393
  data: e.data,
394
- parsedType: P(e.data),
394
+ parsedType: z(e.data),
395
395
  schemaErrorMap: this._def.errorMap,
396
396
  path: e.path,
397
397
  parent: e.parent
@@ -426,7 +426,7 @@ class v {
426
426
  schemaErrorMap: this._def.errorMap,
427
427
  parent: null,
428
428
  data: e,
429
- parsedType: P(e)
429
+ parsedType: z(e)
430
430
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
431
431
  return Ie(s, a);
432
432
  }
@@ -447,7 +447,7 @@ class v {
447
447
  schemaErrorMap: this._def.errorMap,
448
448
  parent: null,
449
449
  data: e,
450
- parsedType: P(e)
450
+ parsedType: z(e)
451
451
  }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (te(s) ? s : Promise.resolve(s));
452
452
  return Ie(n, a);
453
453
  }
@@ -551,15 +551,15 @@ class v {
551
551
  const tt = /^c[^\s-]{8,}$/i, rt = /^[0-9a-z]+$/, nt = /^[0-9A-HJKMNP-TV-Z]{26}$/, st = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, at = /^[a-z0-9_-]{21}$/i, it = /^[-+]?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)?)??$/, ot = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, dt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
552
552
  let Ze;
553
553
  const ct = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ut = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, lt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, $e = "((\\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])))", ft = new RegExp(`^${$e}$`);
554
- function ze(r) {
554
+ function Pe(r) {
555
555
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
556
556
  return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
557
557
  }
558
558
  function ht(r) {
559
- return new RegExp(`^${ze(r)}$`);
559
+ return new RegExp(`^${Pe(r)}$`);
560
560
  }
561
- function Pe(r) {
562
- let e = `${$e}T${ze(r)}`;
561
+ function ze(r) {
562
+ let e = `${$e}T${Pe(r)}`;
563
563
  const t = [];
564
564
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
565
565
  }
@@ -682,7 +682,7 @@ class E extends v {
682
682
  code: d.invalid_string,
683
683
  validation: { endsWith: a.value },
684
684
  message: a.message
685
- }), n.dirty()) : a.kind === "datetime" ? Pe(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
685
+ }), n.dirty()) : a.kind === "datetime" ? ze(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
686
686
  code: d.invalid_string,
687
687
  validation: "datetime",
688
688
  message: a.message
@@ -1399,7 +1399,7 @@ U.create = (r) => new U({
1399
1399
  typeName: m.ZodUnknown,
1400
1400
  ..._(r)
1401
1401
  });
1402
- class z extends v {
1402
+ class P extends v {
1403
1403
  _parse(e) {
1404
1404
  const t = this._getOrReturnCtx(e);
1405
1405
  return l(t, {
@@ -1409,7 +1409,7 @@ class z extends v {
1409
1409
  }), p;
1410
1410
  }
1411
1411
  }
1412
- z.create = (r) => new z({
1412
+ P.create = (r) => new P({
1413
1413
  typeName: m.ZodNever,
1414
1414
  ..._(r)
1415
1415
  });
@@ -1539,7 +1539,7 @@ class k extends v {
1539
1539
  }), p;
1540
1540
  }
1541
1541
  const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1542
- if (!(this._def.catchall instanceof z && this._def.unknownKeys === "strip"))
1542
+ if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
1543
1543
  for (const c in s.data)
1544
1544
  i.includes(c) || o.push(c);
1545
1545
  const u = [];
@@ -1551,7 +1551,7 @@ class k extends v {
1551
1551
  alwaysSet: c in s.data
1552
1552
  });
1553
1553
  }
1554
- if (this._def.catchall instanceof z) {
1554
+ if (this._def.catchall instanceof P) {
1555
1555
  const c = this._def.unknownKeys;
1556
1556
  if (c === "passthrough")
1557
1557
  for (const y of o)
@@ -1788,21 +1788,21 @@ class k extends v {
1788
1788
  k.create = (r, e) => new k({
1789
1789
  shape: () => r,
1790
1790
  unknownKeys: "strip",
1791
- catchall: z.create(),
1791
+ catchall: P.create(),
1792
1792
  typeName: m.ZodObject,
1793
1793
  ..._(e)
1794
1794
  });
1795
1795
  k.strictCreate = (r, e) => new k({
1796
1796
  shape: () => r,
1797
1797
  unknownKeys: "strict",
1798
- catchall: z.create(),
1798
+ catchall: P.create(),
1799
1799
  typeName: m.ZodObject,
1800
1800
  ..._(e)
1801
1801
  });
1802
1802
  k.lazycreate = (r, e) => new k({
1803
1803
  shape: r,
1804
1804
  unknownKeys: "strip",
1805
- catchall: z.create(),
1805
+ catchall: P.create(),
1806
1806
  typeName: m.ZodObject,
1807
1807
  ..._(e)
1808
1808
  });
@@ -1943,7 +1943,7 @@ class we extends v {
1943
1943
  }
1944
1944
  }
1945
1945
  function Ne(r, e) {
1946
- const t = P(r), n = P(e);
1946
+ const t = z(r), n = z(e);
1947
1947
  if (r === e)
1948
1948
  return { valid: !0, data: r };
1949
1949
  if (t === f.object && n === f.object) {
@@ -2750,7 +2750,7 @@ var m;
2750
2750
  })(m || (m = {}));
2751
2751
  const vt = (r, e = {
2752
2752
  message: `Input not instance of ${r.name}`
2753
- }) => De((t) => t instanceof r, e), Le = E.create, qe = V.create, gt = be.create, xt = D.create, Ue = re.create, kt = B.create, bt = ge.create, wt = ne.create, Tt = se.create, Zt = Q.create, St = U.create, Ct = z.create, Ot = xe.create, Nt = R.create, Et = k.create, Rt = k.strictCreate, It = ae.create, jt = we.create, At = ie.create, Mt = M.create, $t = oe.create, zt = ke.create, Pt = W.create, Vt = J.create, Dt = de.create, Lt = ce.create, qt = L.create, Ut = ue.create, Bt = X.create, je = I.create, Wt = j.create, Yt = q.create, Ht = I.createWithPreprocess, Jt = me.create, Gt = () => Le().optional(), Qt = () => qe().optional(), Xt = () => Ue().optional(), Kt = {
2753
+ }) => De((t) => t instanceof r, e), Le = E.create, qe = V.create, gt = be.create, xt = D.create, Ue = re.create, kt = B.create, bt = ge.create, wt = ne.create, Tt = se.create, Zt = Q.create, St = U.create, Ct = P.create, Ot = xe.create, Nt = R.create, Et = k.create, Rt = k.strictCreate, It = ae.create, jt = we.create, At = ie.create, Mt = M.create, $t = oe.create, Pt = ke.create, zt = W.create, Vt = J.create, Dt = de.create, Lt = ce.create, qt = L.create, Ut = ue.create, Bt = X.create, je = I.create, Wt = j.create, Yt = q.create, Ht = I.createWithPreprocess, Jt = me.create, Gt = () => Le().optional(), Qt = () => qe().optional(), Xt = () => Ue().optional(), Kt = {
2754
2754
  string: (r) => E.create({ ...r, coerce: !0 }),
2755
2755
  number: (r) => V.create({ ...r, coerce: !0 }),
2756
2756
  boolean: (r) => re.create({
@@ -2783,9 +2783,9 @@ var C = /* @__PURE__ */ Object.freeze({
2783
2783
  return Se;
2784
2784
  },
2785
2785
  ZodParsedType: f,
2786
- getParsedType: P,
2786
+ getParsedType: z,
2787
2787
  ZodType: v,
2788
- datetimeRegex: Pe,
2788
+ datetimeRegex: ze,
2789
2789
  ZodString: E,
2790
2790
  ZodNumber: V,
2791
2791
  ZodBigInt: D,
@@ -2796,7 +2796,7 @@ var C = /* @__PURE__ */ Object.freeze({
2796
2796
  ZodNull: se,
2797
2797
  ZodAny: Q,
2798
2798
  ZodUnknown: U,
2799
- ZodNever: z,
2799
+ ZodNever: P,
2800
2800
  ZodVoid: xe,
2801
2801
  ZodArray: R,
2802
2802
  ZodObject: k,
@@ -2845,7 +2845,7 @@ var C = /* @__PURE__ */ Object.freeze({
2845
2845
  intersection: At,
2846
2846
  lazy: Dt,
2847
2847
  literal: Lt,
2848
- map: zt,
2848
+ map: Pt,
2849
2849
  nan: gt,
2850
2850
  nativeEnum: Ut,
2851
2851
  never: Ct,
@@ -2861,7 +2861,7 @@ var C = /* @__PURE__ */ Object.freeze({
2861
2861
  preprocess: Ht,
2862
2862
  promise: Bt,
2863
2863
  record: $t,
2864
- set: Pt,
2864
+ set: zt,
2865
2865
  strictObject: Rt,
2866
2866
  string: Le,
2867
2867
  symbol: bt,
@@ -2947,15 +2947,16 @@ export {
2947
2947
  He as useAxios,
2948
2948
  wr as useClickOutside,
2949
2949
  _r as useConfirm,
2950
- Tr as useFormControlType,
2950
+ Tr as useEmployeePhotoPath,
2951
+ Zr as useFormControlType,
2951
2952
  gr as useGetApiData,
2952
2953
  ur as useGetDataBound,
2953
- Zr as useKeyPress,
2954
+ Sr as useKeyPress,
2954
2955
  xr as useLocalStorageState,
2955
2956
  pr as useNotifications,
2956
- Nr as usePermissions,
2957
+ Er as usePermissions,
2957
2958
  kr as usePrompt,
2958
- Sr as useSearchQuery,
2959
- Cr as useSearchQueryState,
2959
+ Cr as useSearchQuery,
2960
+ Or as useSearchQueryState,
2960
2961
  cr as useZodSchemaTypes
2961
2962
  };