react-luminus-components 1.2.100 → 1.2.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/.vite/manifest.json +71 -71
  2. package/dist/{NoInputContainer-BCTMX8k7.js → NoInputContainer-0WkO5fEr.js} +1 -1
  3. package/dist/{NoInputContainer-CUJPpofC.cjs → NoInputContainer-DUqvY4oq.cjs} +1 -1
  4. package/dist/{PrimaryButton-C6dn1vVP.cjs → PrimaryButton-Bb06P51e.cjs} +1 -1
  5. package/dist/{PrimaryButton-C4SO69fm.js → PrimaryButton-S3jW-L2o.js} +2 -2
  6. package/dist/{SimpleTooltip-CPdPmVvw.js → SimpleTooltip-4Vgxz25r.js} +1 -1
  7. package/dist/{SimpleTooltip-j5pL4_G0.cjs → SimpleTooltip-_uTrst6x.cjs} +1 -1
  8. package/dist/contexts.cjs.js +1 -1
  9. package/dist/contexts.es.js +4 -4
  10. package/dist/{dateUtils-Di8ZfN8h.js → dateUtils-7nL2BXlo.js} +1 -1
  11. package/dist/{dateUtils-BMkeH-PW.cjs → dateUtils-DUA3CKds.cjs} +1 -1
  12. package/dist/hooks.cjs.js +1 -1
  13. package/dist/hooks.es.js +6 -6
  14. package/dist/{latinize-3MO2uNV7.js → latinize-BQrinury.js} +18 -18
  15. package/dist/latinize-DaqzUOla.cjs +1 -0
  16. package/dist/layout.cjs.js +1 -1
  17. package/dist/layout.es.js +4 -4
  18. package/dist/main.cjs.js +1 -1
  19. package/dist/main.es.js +7 -7
  20. package/dist/{searchUtils-CN6rluQW.cjs → searchUtils-Do20vjZW.cjs} +1 -1
  21. package/dist/{searchUtils--egT-ac7.js → searchUtils-Du4JnXdQ.js} +1 -1
  22. package/dist/{useConfirm-B3Kocm0W.js → useConfirm-BC31WrP7.js} +1 -1
  23. package/dist/{useConfirm-CFmD7rmb.cjs → useConfirm-cC_0YY3s.cjs} +1 -1
  24. package/dist/{usePermissions-BEgNFMld.js → usePermissions-CA5c2TT2.js} +2 -2
  25. package/dist/{usePermissions-DSmIxVqo.cjs → usePermissions-DS4knuQ0.cjs} +1 -1
  26. package/dist/utils.cjs.js +1 -1
  27. package/dist/utils.es.js +3 -3
  28. package/package.json +1 -1
  29. package/dist/latinize-D-eMyP15.cjs +0 -1
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("./NoInputContainer-CUJPpofC.cjs"),Pe=require("./useConfirm-CFmD7rmb.cjs"),z=require("react"),He=require("./latinize-D-eMyP15.cjs"),Ke=require("./dateUtils-BMkeH-PW.cjs");require("react-hook-form");const Ie=require("./useFormControlType-Dqz8sV4J.cjs"),Xe=require("./usePermissions-DSmIxVqo.cjs");var x;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var Oe;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Oe||(Oe={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),D=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"]),Qe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class N extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};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},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,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 s(this),n}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={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}N.create=r=>new N(r);const X=(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=X;function Fe(r){ze=r}function ve(){return ze}const ge=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const u=n.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}},et=[];function l(r,e){const t=ve(),n=ge({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===X?void 0:X].filter(s=>!!s)});r.common.issues.push(n)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return C.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return y;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),H=r=>({status:"dirty",value:r}),S=r=>({status:"valid",value:r}),Ne=r=>r.status==="aborted",Ee=r=>r.status==="dirty",re=r=>r.status==="valid",ne=r=>typeof Promise<"u"&&r instanceof Promise;function xe(r,e,t,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function De(r,e,t,n,s){if(typeof e=="function"?r!==e||!s:!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,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const 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:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{var u,c;const{message:m}=r;return i.code==="invalid_enum_value"?{message:m??o.defaultError}:typeof o.data>"u"?{message:(u=m??n)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=m??t)!==null&&c!==void 0?c:o.defaultError}},description:s}}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 D(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:D(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:D(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ne(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:D(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Me(s,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={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:D(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(ne(s)?s:Promise.resolve(s));return Me(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:d.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new I({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return j.create(this,this._def)}nullable(){return B.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R.create(this,this._def)}promise(){return F.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:p.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:p.ZodDefault})}brand(){return new je({typeName:p.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new me({..._(this._def),innerType:this,catchValue:t,typeName:p.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]+$/,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})+$";let Se;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}=))?$/,Ve="((\\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(`^${Ve}$`);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=`${Ve}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}),y}const n=new C;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")ot.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Se||(Se=new RegExp(dt,"u")),Se.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")st.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")at.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")tt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")rt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")nt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:d.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:d.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.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)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?qe(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ft.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ht(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?it.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?mt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?lt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:d.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:d.invalid_string,...h.errToObj(n)})}_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,n;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:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!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:p.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,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}class L 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}),y}let n;const s=new C;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?pt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new L({...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 n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}L.create=r=>new L({checks:[],typeName:p.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class q 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}),y}let n;const s=new C;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new q({...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}}q.create=r=>{var e;return new q({checks:[],typeName:p.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 n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.boolean,received:n.parsedType}),y}return S(e.data)}}se.create=r=>new se({typeName:p.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class G 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}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),y}const n=new C;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new G({...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}}G.create=r=>new G({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:p.ZodDate,..._(r)});class ke extends v{_parse(e){if(this._getType(e)!==f.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.symbol,received:n.parsedType}),y}return S(e.data)}}ke.create=r=>new ke({typeName:p.ZodSymbol,..._(r)});class ae extends v{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.undefined,received:n.parsedType}),y}return S(e.data)}}ae.create=r=>new ae({typeName:p.ZodUndefined,..._(r)});class ie extends v{_parse(e){if(this._getType(e)!==f.null){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.null,received:n.parsedType}),y}return S(e.data)}}ie.create=r=>new ie({typeName:p.ZodNull,..._(r)});class Q extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}Q.create=r=>new Q({typeName:p.ZodAny,..._(r)});class W extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}W.create=r=>new W({typeName:p.ZodUnknown,..._(r)});class P extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),y}}P.create=r=>new P({typeName:p.ZodNever,..._(r)});class be extends v{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.void,received:n.parsedType}),y}return S(e.data)}}be.create=r=>new be({typeName:p.ZodVoid,..._(r)});class R extends v{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return l(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),y;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new A(t,i,t.path,o)))).then(i=>C.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new A(t,i,t.path,o)));return C.mergeArray(n,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:p.ZodArray,..._(e)});function J(r){if(r instanceof k){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=j.create(J(n))}return new k({...r._def,shape:()=>e})}else return r instanceof R?new R({...r._def,type:J(r.element)}):r instanceof j?j.create(J(r.unwrap())):r instanceof B?B.create(J(r.unwrap())):r instanceof M?M.create(r.items.map(e=>J(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}),y}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const m=a[c],Z=s.data[c];u.push({key:{status:"valid",value:c},value:m._parse(new A(s,Z,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof P){const c=this._def.unknownKeys;if(c==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(c==="strict")o.length>0&&(l(s,{code:d.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const m of o){const Z=s.data[m];u.push({key:{status:"valid",value:m},value:c._parse(new A(s,Z,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const m of u){const Z=await m.key,Ze=await m.value;c.push({key:Z,value:Ze,alwaysSet:m.alwaysSet})}return c}).then(c=>C.mergeObjectSync(n,c)):C.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,i,o;const u=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&i!==void 0?i:n.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:p.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(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new k({...this._def,shape:()=>t})}deepPartial(){return J(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof j;)a=a._def.innerType;t[n]=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:P.create(),typeName:p.ZodObject,..._(e)});k.strictCreate=(r,e)=>new k({shape:()=>r,unknownKeys:"strict",catchall:P.create(),typeName:p.ZodObject,..._(e)});k.lazycreate=(r,e)=>new k({shape:r,unknownKeys:"strip",catchall:P.create(),typeName:p.ZodObject,..._(e)});class oe extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(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}),y}if(t.common.async)return Promise.all(n.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(s);{let a;const i=[];for(const u of n){const c={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,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}),y}}get options(){return this._def.options}}oe.create=(r,e)=>new oe({options:r,typeName:p.ZodUnion,..._(e)});const $=r=>r instanceof ue?$(r.schema):r instanceof I?$(r.innerType()):r instanceof le?[r.value]:r instanceof U?r.options:r instanceof fe?x.objectValues(r.enum):r instanceof he?$(r._def.innerType):r instanceof ae?[void 0]:r instanceof ie?[null]:r instanceof j?[void 0,...$(r.unwrap())]:r instanceof B?[null,...$(r.unwrap())]:r instanceof je||r instanceof pe?$(r.unwrap()):r instanceof me?$(r._def.innerType):[];class Ce 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}),y;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);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:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const i=$(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(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new Ce({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,..._(n)})}}function Re(r,e){const t=D(r),n=D(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&n===f.object){const s=x.objectKeys(e),a=x.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=Re(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&n===f.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=Re(i,o);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===f.date&&n===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class de extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(Ne(a)||Ne(i))return y;const o=Re(a.value,i.value);return o.valid?((Ee(a)||Ee(i))&&t.dirty(),{status:t.value,value:o.data}):(l(n,{code:d.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}de.create=(r,e,t)=>new de({left:r,right:e,typeName:p.ZodIntersection,..._(t)});class M extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return l(n,{code:d.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return l(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new A(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>C.mergeArray(t,i)):C.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:p.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:n}=this._processInputParams(e);if(n.parsedType!==f.object)return l(n,{code:d.invalid_type,expected:f.object,received:n.parsedType}),y;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in n.data)s.push({key:a._parse(new A(n,o,n.path,o)),value:i._parse(new A(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?C.mergeObjectAsync(t,s):C.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof v?new ce({keyType:e,valueType:t,typeName:p.ZodRecord,..._(n)}):new ce({keyType:E.create(),valueType:e,typeName:p.ZodRecord,..._(t)})}}class we extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return l(n,{code:d.invalid_type,expected:f.map,received:n.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,u],c)=>({key:s._parse(new A(n,o,n.path,[c,"key"])),value:a._parse(new A(n,u,n.path,[c,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,m=await u.value;if(c.status==="aborted"||m.status==="aborted")return y;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,m=u.value;if(c.status==="aborted"||m.status==="aborted")return y;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}}}}we.create=(r,e,t)=>new we({valueType:e,keyType:r,typeName:p.ZodMap,..._(t)});class Y extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return l(n,{code:d.invalid_type,expected:f.set,received:n.parsedType}),y;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const c=new Set;for(const m of u){if(m.status==="aborted")return y;m.status==="dirty"&&t.dirty(),c.add(m.value)}return{status:t.value,value:c}}const o=[...n.data.values()].map((u,c)=>a._parse(new A(n,u,n.path,c)));return n.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new Y({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new Y({...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)}}Y.create=(r,e)=>new Y({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,..._(e)});class K 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}),y;function n(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),X].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:u}})}function s(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),X].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 F){const o=this;return S(async function(...u){const c=new N([]),m=await o._def.args.parseAsync(u,a).catch(_e=>{throw c.addIssue(n(u,_e)),c}),Z=await Reflect.apply(i,this,m);return await o._def.returns._def.type.parseAsync(Z,a).catch(_e=>{throw c.addIssue(s(Z,_e)),c})})}else{const o=this;return S(function(...u){const c=o._def.args.safeParse(u,a);if(!c.success)throw new N([n(u,c.error)]);const m=Reflect.apply(i,this,c.data),Z=o._def.returns.safeParse(m,a);if(!Z.success)throw new N([s(m,Z.error)]);return Z.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new K({...this._def,args:M.create(e).rest(W.create())})}returns(e){return new K({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new K({args:e||M.create([]).rest(W.create()),returns:t||W.create(),typeName:p.ZodFunction,..._(n)})}}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:p.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}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}le.create=(r,e)=>new le({value:r,typeName:p.ZodLiteral,..._(e)});function Ue(r,e){return new U({values:r,typeName:p.ZodEnum,..._(e)})}class U extends v{constructor(){super(...arguments),ee.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:x.joinValues(n),received:t.parsedType,code:d.invalid_type}),y}if(xe(this,ee)||De(this,ee,new Set(this._def.values)),!xe(this,ee).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:n}),y}return S(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 U.create(e,{...this._def,...t})}exclude(e,t=this._def){return U.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}ee=new WeakMap;U.create=Ue;class fe extends v{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const s=x.objectValues(t);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:d.invalid_type}),y}if(xe(this,te)||De(this,te,new Set(x.getValidEnumValues(this._def.values))),!xe(this,te).has(e.data)){const s=x.objectValues(t);return l(n,{received:n.data,code:d.invalid_enum_value,options:s}),y}return S(e.data)}get enum(){return this._def.values}}te=new WeakMap;fe.create=(r,e)=>new fe({values:r,typeName:p.ZodNativeEnum,..._(e)});class F 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}),y;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return S(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}F.create=(r,e)=>new F({type:r,typeName:p.ZodPromise,..._(e)});class I extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?H(u.value):u});{if(t.value==="aborted")return y;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?y:o.status==="dirty"||t.value==="dirty"?H(o.value):o}}if(s.type==="refinement"){const i=o=>{const u=s.refinement(o,a);if(n.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(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!re(i))return i;const o=s.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:n.data,path:n.path,parent:n}).then(i=>re(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(s)}}I.create=(r,e,t)=>new I({schema:r,typeName:p.ZodEffects,effect:e,..._(t)});I.createWithPreprocess=(r,e,t)=>new I({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,..._(t)});class j extends v{_parse(e){return this._getType(e)===f.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(r,e)=>new j({innerType:r,typeName:p.ZodOptional,..._(e)});class B extends v{_parse(e){return this._getType(e)===f.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}B.create=(r,e)=>new B({innerType:r,typeName:p.ZodNullable,..._(e)});class he extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}he.create=(r,e)=>new he({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class me extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ne(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new N(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new N(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}me.create=(r,e)=>new me({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Te extends v{_parse(e){if(this._getType(e)!==f.nan){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:e.data}}}Te.create=r=>new Te({typeName:p.ZodNaN,..._(r)});const yt=Symbol("zod_brand");class je extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ye extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),H(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new ye({in:e,out:t,typeName:p.ZodPipeline})}}class pe extends v{_parse(e){const t=this._def.innerType._parse(e),n=s=>(re(s)&&(s.value=Object.freeze(s.value)),s);return ne(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}pe.create=(r,e)=>new pe({innerType:r,typeName:p.ZodReadonly,..._(e)});function Be(r,e={},t){return r?Q.create().superRefine((n,s)=>{var a,i;if(!r(n)){const o=typeof e=="function"?e(n):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;s.addIssue({code:"custom",...c,fatal:u})}}):Q.create()}const _t={object:k.lazycreate};var p;(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"})(p||(p={}));const vt=(r,e={message:`Input not instance of ${r.name}`})=>Be(t=>t instanceof r,e),We=E.create,Ge=L.create,gt=Te.create,xt=q.create,Ye=se.create,kt=G.create,bt=ke.create,wt=ae.create,Tt=ie.create,Ct=Q.create,Zt=W.create,St=P.create,Ot=be.create,Nt=R.create,Et=k.create,Rt=k.strictCreate,It=oe.create,jt=Ce.create,At=de.create,Mt=M.create,$t=ce.create,Pt=we.create,zt=Y.create,Dt=K.create,Vt=ue.create,Lt=le.create,qt=U.create,Ut=fe.create,Bt=F.create,$e=I.create,Wt=j.create,Gt=B.create,Yt=I.createWithPreprocess,Jt=ye.create,Ht=()=>We().optional(),Kt=()=>Ge().optional(),Xt=()=>Ye().optional(),Qt={string:r=>E.create({...r,coerce:!0}),number:r=>L.create({...r,coerce:!0}),boolean:r=>se.create({...r,coerce:!0}),bigint:r=>q.create({...r,coerce:!0}),date:r=>G.create({...r,coerce:!0})},Ft=y;var O=Object.freeze({__proto__:null,defaultErrorMap:X,setErrorMap:Fe,getErrorMap:ve,makeIssue:ge,EMPTY_PATH:et,addIssueToContext:l,ParseStatus:C,INVALID:y,DIRTY:H,OK:S,isAborted:Ne,isDirty:Ee,isValid:re,isAsync:ne,get util(){return x},get objectUtil(){return Oe},ZodParsedType:f,getParsedType:D,ZodType:v,datetimeRegex:qe,ZodString:E,ZodNumber:L,ZodBigInt:q,ZodBoolean:se,ZodDate:G,ZodSymbol:ke,ZodUndefined:ae,ZodNull:ie,ZodAny:Q,ZodUnknown:W,ZodNever:P,ZodVoid:be,ZodArray:R,ZodObject:k,ZodUnion:oe,ZodDiscriminatedUnion:Ce,ZodIntersection:de,ZodTuple:M,ZodRecord:ce,ZodMap:we,ZodSet:Y,ZodFunction:K,ZodLazy:ue,ZodLiteral:le,ZodEnum:U,ZodNativeEnum:fe,ZodPromise:F,ZodEffects:I,ZodTransformer:I,ZodOptional:j,ZodNullable:B,ZodDefault:he,ZodCatch:me,ZodNaN:Te,BRAND:yt,ZodBranded:je,ZodPipeline:ye,ZodReadonly:pe,custom:Be,Schema:v,ZodSchema:v,late:_t,get ZodFirstPartyTypeKind(){return p},coerce:Qt,any:Ct,array:Nt,bigint:xt,boolean:Ye,date:kt,discriminatedUnion:jt,effect:$e,enum:qt,function:Dt,instanceof:vt,intersection:At,lazy:Vt,literal:Lt,map:Pt,nan:gt,nativeEnum:Ut,never:St,null:Tt,nullable:Gt,number:Ge,object:Et,oboolean:Xt,onumber:Kt,optional:Wt,ostring:Ht,pipeline:Jt,preprocess:Yt,promise:Bt,record:$t,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:Qe,ZodError:N});const er=()=>{const{formValidationTexts:r}=z.useContext(V.LuminusComponentsContext),e=g=>(g!=null&&g.useCoerce?O.coerce:O).string({invalid_type_error:r.required,required_error:r.required}).transform(w=>w??null),t=g=>e(g).nullable().optional().transform(b=>b??null),n=g=>{const b=(g!=null&&g.useCoerce?O.coerce:O).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)},s=g=>n(g).nullable().optional().transform(b=>b??null),a=g=>(g!=null&&g.useCoerce?O.coerce:O).boolean({invalid_type_error:r.required,required_error:r.required}).transform(b=>b??null),i=g=>(g!=null&&g.useCoerce?O.coerce:O).string({invalid_type_error:r.required,required_error:r.required}).refine(Ke.isISODate,{message:r.invalidDate}).transform(w=>w??null),o=g=>i(g).nullable().transform(b=>b??null),u=(g,b)=>O.enum(g,{invalid_type_error:r.required,required_error:r.required}).transform(Ae=>Ae??null);return{zString:t,zStringRequired:e,zNumber:s,zNumberRequired:n,zBool:a,zDate:o,zDateRequired:i,zEnum:(g,b)=>u(g).nullable().transform(w=>w??null),zEnumRequired:u,zObjectIdInt:g=>O.object({id:s({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdIntRequired:g=>O.object({id:n()}).transform(w=>w??null),zObjectIdStr:g=>O.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdStrRequired:g=>O.object({id:e()}).transform(w=>w??null),zFile:({required:g,multiple:b,maxFileSize:w})=>O.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 ${He.formatFileSize(w)}.`).transform(T=>(b?T:T==null?void 0:T[0])??null)}},tr=(r,e=!1)=>{const t=V.useAxios({silent:e}),{startLoading:n,stopLoading:s}=z.useContext(V.LoadingContext),a=z.useRef(0),[i,o]=z.useState(null),u=z.useCallback(async(c,m)=>{!e&&n(`loadData-${r}-${m}`),o(null);try{const Z=await t.get(r,{signal:c});o(Z.data)}finally{!e&&s(`loadData-${r}-${m}`)}},[t,n,s,r,e]);return z.useEffect(()=>{const c=new AbortController;return u(c.signal,++a.current),()=>{c.abort()}},[u]),{data:i,setData:o,reloadData:u}},rr=r=>{let e="pending",t;const n=r.then(s=>{e="success",t=s},s=>{e="error",t=s});return()=>{switch(e){case"pending":throw n;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function nr(r){const e=V.useAxios({silent:!0}),[t,n]=z.useState(null);return z.useEffect(()=>{(async()=>{const a=e.get(r).then(i=>i.data);n(rr(a))})()},[e,r]),t}exports.cancelToken=V.cancelToken;exports.useAuth=V.useAuth;exports.useAxios=V.useAxios;exports.useNotifications=V.useNotifications;exports.useConfirm=Pe.useConfirm;exports.usePrompt=Pe.usePrompt;exports.useClickOutside=Ie.useClickOutside;exports.useFormControlType=Ie.useFormControlType;exports.useKeyPress=Ie.useKeyPress;exports.usePermissions=Xe.usePermissions;exports.useGetApiData=tr;exports.useGetDataBound=nr;exports.useZodSchemaTypes=er;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("./NoInputContainer-DUqvY4oq.cjs"),Pe=require("./useConfirm-cC_0YY3s.cjs"),z=require("react"),He=require("./latinize-DaqzUOla.cjs"),Ke=require("./dateUtils-DUA3CKds.cjs");require("react-hook-form");const Ie=require("./useFormControlType-Dqz8sV4J.cjs"),Xe=require("./usePermissions-DS4knuQ0.cjs");var x;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var Oe;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Oe||(Oe={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),D=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"]),Qe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class N extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};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},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,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 s(this),n}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={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}N.create=r=>new N(r);const X=(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=X;function Fe(r){ze=r}function ve(){return ze}const ge=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const u=n.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}},et=[];function l(r,e){const t=ve(),n=ge({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===X?void 0:X].filter(s=>!!s)});r.common.issues.push(n)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return C.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return y;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),H=r=>({status:"dirty",value:r}),S=r=>({status:"valid",value:r}),Ne=r=>r.status==="aborted",Ee=r=>r.status==="dirty",re=r=>r.status==="valid",ne=r=>typeof Promise<"u"&&r instanceof Promise;function xe(r,e,t,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function De(r,e,t,n,s){if(typeof e=="function"?r!==e||!s:!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,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const 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:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{var u,c;const{message:m}=r;return i.code==="invalid_enum_value"?{message:m??o.defaultError}:typeof o.data>"u"?{message:(u=m??n)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=m??t)!==null&&c!==void 0?c:o.defaultError}},description:s}}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 D(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:D(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:D(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ne(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:D(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Me(s,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={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:D(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(ne(s)?s:Promise.resolve(s));return Me(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:d.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new I({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return j.create(this,this._def)}nullable(){return B.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R.create(this,this._def)}promise(){return F.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:p.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:p.ZodDefault})}brand(){return new je({typeName:p.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new me({..._(this._def),innerType:this,catchValue:t,typeName:p.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]+$/,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})+$";let Se;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}=))?$/,Ve="((\\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(`^${Ve}$`);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=`${Ve}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}),y}const n=new C;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")ot.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Se||(Se=new RegExp(dt,"u")),Se.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")st.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")at.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")tt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")rt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")nt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:d.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:d.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.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)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?qe(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ft.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ht(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?it.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?mt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?lt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:d.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:d.invalid_string,...h.errToObj(n)})}_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,n;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:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!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:p.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,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}class L 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}),y}let n;const s=new C;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?pt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new L({...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 n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}L.create=r=>new L({checks:[],typeName:p.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class q 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}),y}let n;const s=new C;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new q({...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}}q.create=r=>{var e;return new q({checks:[],typeName:p.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 n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.boolean,received:n.parsedType}),y}return S(e.data)}}se.create=r=>new se({typeName:p.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class G 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}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),y}const n=new C;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new G({...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}}G.create=r=>new G({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:p.ZodDate,..._(r)});class ke extends v{_parse(e){if(this._getType(e)!==f.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.symbol,received:n.parsedType}),y}return S(e.data)}}ke.create=r=>new ke({typeName:p.ZodSymbol,..._(r)});class ae extends v{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.undefined,received:n.parsedType}),y}return S(e.data)}}ae.create=r=>new ae({typeName:p.ZodUndefined,..._(r)});class ie extends v{_parse(e){if(this._getType(e)!==f.null){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.null,received:n.parsedType}),y}return S(e.data)}}ie.create=r=>new ie({typeName:p.ZodNull,..._(r)});class Q extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}Q.create=r=>new Q({typeName:p.ZodAny,..._(r)});class W extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}W.create=r=>new W({typeName:p.ZodUnknown,..._(r)});class P extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),y}}P.create=r=>new P({typeName:p.ZodNever,..._(r)});class be extends v{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.void,received:n.parsedType}),y}return S(e.data)}}be.create=r=>new be({typeName:p.ZodVoid,..._(r)});class R extends v{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return l(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),y;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new A(t,i,t.path,o)))).then(i=>C.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new A(t,i,t.path,o)));return C.mergeArray(n,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:p.ZodArray,..._(e)});function J(r){if(r instanceof k){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=j.create(J(n))}return new k({...r._def,shape:()=>e})}else return r instanceof R?new R({...r._def,type:J(r.element)}):r instanceof j?j.create(J(r.unwrap())):r instanceof B?B.create(J(r.unwrap())):r instanceof M?M.create(r.items.map(e=>J(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}),y}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const m=a[c],Z=s.data[c];u.push({key:{status:"valid",value:c},value:m._parse(new A(s,Z,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof P){const c=this._def.unknownKeys;if(c==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(c==="strict")o.length>0&&(l(s,{code:d.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const m of o){const Z=s.data[m];u.push({key:{status:"valid",value:m},value:c._parse(new A(s,Z,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const m of u){const Z=await m.key,Ze=await m.value;c.push({key:Z,value:Ze,alwaysSet:m.alwaysSet})}return c}).then(c=>C.mergeObjectSync(n,c)):C.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,i,o;const u=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&i!==void 0?i:n.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:p.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(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new k({...this._def,shape:()=>t})}deepPartial(){return J(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof j;)a=a._def.innerType;t[n]=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:P.create(),typeName:p.ZodObject,..._(e)});k.strictCreate=(r,e)=>new k({shape:()=>r,unknownKeys:"strict",catchall:P.create(),typeName:p.ZodObject,..._(e)});k.lazycreate=(r,e)=>new k({shape:r,unknownKeys:"strip",catchall:P.create(),typeName:p.ZodObject,..._(e)});class oe extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(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}),y}if(t.common.async)return Promise.all(n.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(s);{let a;const i=[];for(const u of n){const c={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,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}),y}}get options(){return this._def.options}}oe.create=(r,e)=>new oe({options:r,typeName:p.ZodUnion,..._(e)});const $=r=>r instanceof ue?$(r.schema):r instanceof I?$(r.innerType()):r instanceof le?[r.value]:r instanceof U?r.options:r instanceof fe?x.objectValues(r.enum):r instanceof he?$(r._def.innerType):r instanceof ae?[void 0]:r instanceof ie?[null]:r instanceof j?[void 0,...$(r.unwrap())]:r instanceof B?[null,...$(r.unwrap())]:r instanceof je||r instanceof pe?$(r.unwrap()):r instanceof me?$(r._def.innerType):[];class Ce 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}),y;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);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:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const i=$(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(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new Ce({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,..._(n)})}}function Re(r,e){const t=D(r),n=D(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&n===f.object){const s=x.objectKeys(e),a=x.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=Re(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&n===f.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=Re(i,o);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===f.date&&n===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class de extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(Ne(a)||Ne(i))return y;const o=Re(a.value,i.value);return o.valid?((Ee(a)||Ee(i))&&t.dirty(),{status:t.value,value:o.data}):(l(n,{code:d.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}de.create=(r,e,t)=>new de({left:r,right:e,typeName:p.ZodIntersection,..._(t)});class M extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return l(n,{code:d.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return l(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new A(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>C.mergeArray(t,i)):C.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:p.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:n}=this._processInputParams(e);if(n.parsedType!==f.object)return l(n,{code:d.invalid_type,expected:f.object,received:n.parsedType}),y;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in n.data)s.push({key:a._parse(new A(n,o,n.path,o)),value:i._parse(new A(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?C.mergeObjectAsync(t,s):C.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof v?new ce({keyType:e,valueType:t,typeName:p.ZodRecord,..._(n)}):new ce({keyType:E.create(),valueType:e,typeName:p.ZodRecord,..._(t)})}}class we extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return l(n,{code:d.invalid_type,expected:f.map,received:n.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,u],c)=>({key:s._parse(new A(n,o,n.path,[c,"key"])),value:a._parse(new A(n,u,n.path,[c,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,m=await u.value;if(c.status==="aborted"||m.status==="aborted")return y;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,m=u.value;if(c.status==="aborted"||m.status==="aborted")return y;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}}}}we.create=(r,e,t)=>new we({valueType:e,keyType:r,typeName:p.ZodMap,..._(t)});class Y extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return l(n,{code:d.invalid_type,expected:f.set,received:n.parsedType}),y;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const c=new Set;for(const m of u){if(m.status==="aborted")return y;m.status==="dirty"&&t.dirty(),c.add(m.value)}return{status:t.value,value:c}}const o=[...n.data.values()].map((u,c)=>a._parse(new A(n,u,n.path,c)));return n.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new Y({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new Y({...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)}}Y.create=(r,e)=>new Y({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,..._(e)});class K 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}),y;function n(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),X].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:u}})}function s(o,u){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),X].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 F){const o=this;return S(async function(...u){const c=new N([]),m=await o._def.args.parseAsync(u,a).catch(_e=>{throw c.addIssue(n(u,_e)),c}),Z=await Reflect.apply(i,this,m);return await o._def.returns._def.type.parseAsync(Z,a).catch(_e=>{throw c.addIssue(s(Z,_e)),c})})}else{const o=this;return S(function(...u){const c=o._def.args.safeParse(u,a);if(!c.success)throw new N([n(u,c.error)]);const m=Reflect.apply(i,this,c.data),Z=o._def.returns.safeParse(m,a);if(!Z.success)throw new N([s(m,Z.error)]);return Z.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new K({...this._def,args:M.create(e).rest(W.create())})}returns(e){return new K({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new K({args:e||M.create([]).rest(W.create()),returns:t||W.create(),typeName:p.ZodFunction,..._(n)})}}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:p.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}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}le.create=(r,e)=>new le({value:r,typeName:p.ZodLiteral,..._(e)});function Ue(r,e){return new U({values:r,typeName:p.ZodEnum,..._(e)})}class U extends v{constructor(){super(...arguments),ee.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:x.joinValues(n),received:t.parsedType,code:d.invalid_type}),y}if(xe(this,ee)||De(this,ee,new Set(this._def.values)),!xe(this,ee).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:n}),y}return S(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 U.create(e,{...this._def,...t})}exclude(e,t=this._def){return U.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}ee=new WeakMap;U.create=Ue;class fe extends v{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const s=x.objectValues(t);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:d.invalid_type}),y}if(xe(this,te)||De(this,te,new Set(x.getValidEnumValues(this._def.values))),!xe(this,te).has(e.data)){const s=x.objectValues(t);return l(n,{received:n.data,code:d.invalid_enum_value,options:s}),y}return S(e.data)}get enum(){return this._def.values}}te=new WeakMap;fe.create=(r,e)=>new fe({values:r,typeName:p.ZodNativeEnum,..._(e)});class F 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}),y;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return S(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}F.create=(r,e)=>new F({type:r,typeName:p.ZodPromise,..._(e)});class I extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?H(u.value):u});{if(t.value==="aborted")return y;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?y:o.status==="dirty"||t.value==="dirty"?H(o.value):o}}if(s.type==="refinement"){const i=o=>{const u=s.refinement(o,a);if(n.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(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!re(i))return i;const o=s.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:n.data,path:n.path,parent:n}).then(i=>re(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(s)}}I.create=(r,e,t)=>new I({schema:r,typeName:p.ZodEffects,effect:e,..._(t)});I.createWithPreprocess=(r,e,t)=>new I({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,..._(t)});class j extends v{_parse(e){return this._getType(e)===f.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(r,e)=>new j({innerType:r,typeName:p.ZodOptional,..._(e)});class B extends v{_parse(e){return this._getType(e)===f.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}B.create=(r,e)=>new B({innerType:r,typeName:p.ZodNullable,..._(e)});class he extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}he.create=(r,e)=>new he({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class me extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ne(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new N(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new N(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}me.create=(r,e)=>new me({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Te extends v{_parse(e){if(this._getType(e)!==f.nan){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:e.data}}}Te.create=r=>new Te({typeName:p.ZodNaN,..._(r)});const yt=Symbol("zod_brand");class je extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ye extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),H(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new ye({in:e,out:t,typeName:p.ZodPipeline})}}class pe extends v{_parse(e){const t=this._def.innerType._parse(e),n=s=>(re(s)&&(s.value=Object.freeze(s.value)),s);return ne(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}pe.create=(r,e)=>new pe({innerType:r,typeName:p.ZodReadonly,..._(e)});function Be(r,e={},t){return r?Q.create().superRefine((n,s)=>{var a,i;if(!r(n)){const o=typeof e=="function"?e(n):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;s.addIssue({code:"custom",...c,fatal:u})}}):Q.create()}const _t={object:k.lazycreate};var p;(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"})(p||(p={}));const vt=(r,e={message:`Input not instance of ${r.name}`})=>Be(t=>t instanceof r,e),We=E.create,Ge=L.create,gt=Te.create,xt=q.create,Ye=se.create,kt=G.create,bt=ke.create,wt=ae.create,Tt=ie.create,Ct=Q.create,Zt=W.create,St=P.create,Ot=be.create,Nt=R.create,Et=k.create,Rt=k.strictCreate,It=oe.create,jt=Ce.create,At=de.create,Mt=M.create,$t=ce.create,Pt=we.create,zt=Y.create,Dt=K.create,Vt=ue.create,Lt=le.create,qt=U.create,Ut=fe.create,Bt=F.create,$e=I.create,Wt=j.create,Gt=B.create,Yt=I.createWithPreprocess,Jt=ye.create,Ht=()=>We().optional(),Kt=()=>Ge().optional(),Xt=()=>Ye().optional(),Qt={string:r=>E.create({...r,coerce:!0}),number:r=>L.create({...r,coerce:!0}),boolean:r=>se.create({...r,coerce:!0}),bigint:r=>q.create({...r,coerce:!0}),date:r=>G.create({...r,coerce:!0})},Ft=y;var O=Object.freeze({__proto__:null,defaultErrorMap:X,setErrorMap:Fe,getErrorMap:ve,makeIssue:ge,EMPTY_PATH:et,addIssueToContext:l,ParseStatus:C,INVALID:y,DIRTY:H,OK:S,isAborted:Ne,isDirty:Ee,isValid:re,isAsync:ne,get util(){return x},get objectUtil(){return Oe},ZodParsedType:f,getParsedType:D,ZodType:v,datetimeRegex:qe,ZodString:E,ZodNumber:L,ZodBigInt:q,ZodBoolean:se,ZodDate:G,ZodSymbol:ke,ZodUndefined:ae,ZodNull:ie,ZodAny:Q,ZodUnknown:W,ZodNever:P,ZodVoid:be,ZodArray:R,ZodObject:k,ZodUnion:oe,ZodDiscriminatedUnion:Ce,ZodIntersection:de,ZodTuple:M,ZodRecord:ce,ZodMap:we,ZodSet:Y,ZodFunction:K,ZodLazy:ue,ZodLiteral:le,ZodEnum:U,ZodNativeEnum:fe,ZodPromise:F,ZodEffects:I,ZodTransformer:I,ZodOptional:j,ZodNullable:B,ZodDefault:he,ZodCatch:me,ZodNaN:Te,BRAND:yt,ZodBranded:je,ZodPipeline:ye,ZodReadonly:pe,custom:Be,Schema:v,ZodSchema:v,late:_t,get ZodFirstPartyTypeKind(){return p},coerce:Qt,any:Ct,array:Nt,bigint:xt,boolean:Ye,date:kt,discriminatedUnion:jt,effect:$e,enum:qt,function:Dt,instanceof:vt,intersection:At,lazy:Vt,literal:Lt,map:Pt,nan:gt,nativeEnum:Ut,never:St,null:Tt,nullable:Gt,number:Ge,object:Et,oboolean:Xt,onumber:Kt,optional:Wt,ostring:Ht,pipeline:Jt,preprocess:Yt,promise:Bt,record:$t,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:Qe,ZodError:N});const er=()=>{const{formValidationTexts:r}=z.useContext(V.LuminusComponentsContext),e=g=>(g!=null&&g.useCoerce?O.coerce:O).string({invalid_type_error:r.required,required_error:r.required}).transform(w=>w??null),t=g=>e(g).nullable().optional().transform(b=>b??null),n=g=>{const b=(g!=null&&g.useCoerce?O.coerce:O).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)},s=g=>n(g).nullable().optional().transform(b=>b??null),a=g=>(g!=null&&g.useCoerce?O.coerce:O).boolean({invalid_type_error:r.required,required_error:r.required}).transform(b=>b??null),i=g=>(g!=null&&g.useCoerce?O.coerce:O).string({invalid_type_error:r.required,required_error:r.required}).refine(Ke.isISODate,{message:r.invalidDate}).transform(w=>w??null),o=g=>i(g).nullable().transform(b=>b??null),u=(g,b)=>O.enum(g,{invalid_type_error:r.required,required_error:r.required}).transform(Ae=>Ae??null);return{zString:t,zStringRequired:e,zNumber:s,zNumberRequired:n,zBool:a,zDate:o,zDateRequired:i,zEnum:(g,b)=>u(g).nullable().transform(w=>w??null),zEnumRequired:u,zObjectIdInt:g=>O.object({id:s({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdIntRequired:g=>O.object({id:n()}).transform(w=>w??null),zObjectIdStr:g=>O.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdStrRequired:g=>O.object({id:e()}).transform(w=>w??null),zFile:({required:g,multiple:b,maxFileSize:w})=>O.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 ${He.formatFileSize(w)}.`).transform(T=>(b?T:T==null?void 0:T[0])??null)}},tr=(r,e=!1)=>{const t=V.useAxios({silent:e}),{startLoading:n,stopLoading:s}=z.useContext(V.LoadingContext),a=z.useRef(0),[i,o]=z.useState(null),u=z.useCallback(async(c,m)=>{!e&&n(`loadData-${r}-${m}`),o(null);try{const Z=await t.get(r,{signal:c});o(Z.data)}finally{!e&&s(`loadData-${r}-${m}`)}},[t,n,s,r,e]);return z.useEffect(()=>{const c=new AbortController;return u(c.signal,++a.current),()=>{c.abort()}},[u]),{data:i,setData:o,reloadData:u}},rr=r=>{let e="pending",t;const n=r.then(s=>{e="success",t=s},s=>{e="error",t=s});return()=>{switch(e){case"pending":throw n;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function nr(r){const e=V.useAxios({silent:!0}),[t,n]=z.useState(null);return z.useEffect(()=>{(async()=>{const a=e.get(r).then(i=>i.data);n(rr(a))})()},[e,r]),t}exports.cancelToken=V.cancelToken;exports.useAuth=V.useAuth;exports.useAxios=V.useAxios;exports.useNotifications=V.useNotifications;exports.useConfirm=Pe.useConfirm;exports.usePrompt=Pe.usePrompt;exports.useClickOutside=Ie.useClickOutside;exports.useFormControlType=Ie.useFormControlType;exports.useKeyPress=Ie.useKeyPress;exports.usePermissions=Xe.usePermissions;exports.useGetApiData=tr;exports.useGetDataBound=nr;exports.useZodSchemaTypes=er;
package/dist/hooks.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { Q as He, a4 as Ae, ao as Qe } from "./NoInputContainer-BCTMX8k7.js";
2
- import { aG as pr, a9 as yr, aF as _r } from "./NoInputContainer-BCTMX8k7.js";
3
- import { a as gr, u as xr } from "./useConfirm-B3Kocm0W.js";
1
+ import { Q as He, a4 as Ae, ao as Qe } from "./NoInputContainer-0WkO5fEr.js";
2
+ import { aG as pr, a9 as yr, aF as _r } from "./NoInputContainer-0WkO5fEr.js";
3
+ import { a as gr, u as xr } from "./useConfirm-BC31WrP7.js";
4
4
  import { useContext as $e, useRef as Xe, useState as Me, useCallback as Ke, useEffect as ze } from "react";
5
- import { f as Fe } from "./latinize-3MO2uNV7.js";
6
- import { i as et } from "./dateUtils-Di8ZfN8h.js";
5
+ import { f as Fe } from "./latinize-BQrinury.js";
6
+ import { i as et } from "./dateUtils-7nL2BXlo.js";
7
7
  import "react-hook-form";
8
8
  import { a as br, b as wr, u as Tr } from "./useFormControlType-BAFqxupC.js";
9
- import { u as Cr } from "./usePermissions-BEgNFMld.js";
9
+ import { u as Cr } from "./usePermissions-CA5c2TT2.js";
10
10
  var x;
11
11
  (function(r) {
12
12
  r.assertEqual = (s) => s;
@@ -1,33 +1,33 @@
1
1
  const c = 6048e5, O = 864e5, E = 6e4, A = 36e5, t = (e) => e == null ? !0 : !(typeof e == "object" || typeof e == "function"), i = (e) => {
2
- t(e) || Object.keys(e).forEach((o) => {
3
- const r = e[o];
4
- if (t(r))
2
+ t(e) || Object.keys(e).forEach((r) => {
3
+ const o = e[r];
4
+ if (t(o))
5
5
  return;
6
- const s = Object.keys(r);
7
- s.includes("id") && s.length === 1 && r.id === null ? e[o] = null : i(r);
6
+ const s = Object.keys(o);
7
+ s.includes("id") && s.length === 1 && o.id === null ? e[r] = null : i(o);
8
8
  });
9
9
  }, u = (e) => {
10
- var r;
11
- const o = (r = e.response) == null ? void 0 : r.data;
12
- return o && o.errorFields && o.errorFields.length > 0 ? o.errorFields.map((s) => ({
10
+ var o;
11
+ const r = (o = e.response) == null ? void 0 : o.data;
12
+ return r && r.errorFields && r.errorFields.length > 0 ? r.errorFields.map((s) => ({
13
13
  name: s.name.split(".").map((n) => `${n.charAt(0).toLowerCase()}${n.slice(1)}`).join("."),
14
14
  errors: s.errors
15
15
  })) : [];
16
- }, d = (e, o) => {
17
- u(o).forEach((s) => {
16
+ }, d = (e, r) => {
17
+ u(r).forEach((s) => {
18
18
  e.setError(s.name, { message: s.errors, type: "server" }, { shouldFocus: !0 }), t(e.getValues(s.name)) || e.setError(`${s.name}.id`, { message: s.errors, type: "server" }, { shouldFocus: !0 });
19
19
  });
20
20
  }, U = (e) => {
21
- var r;
22
- const o = (r = e.response) == null ? void 0 : r.data;
23
- return o.permissions && o.permissions.length > 0 ? o.permissions : null;
21
+ var o;
22
+ const r = (o = e.response) == null ? void 0 : o.data;
23
+ return r != null && r.permissions && r.permissions.length > 0 ? r.permissions : null;
24
24
  }, h = (e) => e.length < 300 ? e : e.substring(0, 300) + "...", m = (e) => e < 1024 ? `${e} bytes` : e >= 1024 && e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
25
- function I(e = " ", ...o) {
26
- return o.filter((r) => r != null && r.length > 0).join(e);
25
+ function I(e = " ", ...r) {
26
+ return r.filter((o) => o != null && o.length > 0).join(e);
27
27
  }
28
- function a(e, o = a.characters) {
29
- return e.replace(/[^A-Za-z0-9]/g, function(r) {
30
- return o[r] || r;
28
+ function a(e, r = a.characters) {
29
+ return e.replace(/[^A-Za-z0-9]/g, function(o) {
30
+ return r[o] || o;
31
31
  });
32
32
  }
33
33
  a.characters = {
@@ -0,0 +1 @@
1
+ "use strict";const n=e=>e==null?!0:!(typeof e=="object"||typeof e=="function"),a=e=>{n(e)||Object.keys(e).forEach(r=>{const o=e[r];if(n(o))return;const s=Object.keys(o);s.includes("id")&&s.length===1&&o.id===null?e[r]=null:a(o)})},u=e=>{var o;const r=(o=e.response)==null?void 0:o.data;return r&&r.errorFields&&r.errorFields.length>0?r.errorFields.map(s=>({name:s.name.split(".").map(t=>`${t.charAt(0).toLowerCase()}${t.slice(1)}`).join("."),errors:s.errors})):[]},l=(e,r)=>{u(r).forEach(s=>{e.setError(s.name,{message:s.errors,type:"server"},{shouldFocus:!0}),n(e.getValues(s.name))||e.setError(`${s.name}.id`,{message:s.errors,type:"server"},{shouldFocus:!0})})},c=e=>{var o;const r=(o=e.response)==null?void 0:o.data;return r!=null&&r.permissions&&r.permissions.length>0?r.permissions:null},O=e=>e.length<300?e:e.substring(0,300)+"...",E=e=>e<1024?`${e} bytes`:e>=1024&&e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`;function d(e=" ",...r){return r.filter(o=>o!=null&&o.length>0).join(e)}function i(e,r=i.characters){return e.replace(/[^A-Za-z0-9]/g,function(o){return r[o]||o})}i.characters={Á:"A",Ă:"A",Ắ:"A",Ặ:"A",Ằ:"A",Ẳ:"A",Ẵ:"A",Ǎ:"A",Â:"A",Ấ:"A",Ậ:"A",Ầ:"A",Ẩ:"A",Ẫ:"A",Ä:"A",Ǟ:"A",Ȧ:"A",Ǡ:"A",Ạ:"A",Ȁ:"A",À:"A",Ả:"A",Ȃ:"A",Ā:"A",Ą:"A",Å:"A",Ǻ:"A",Ḁ:"A","Ⱥ":"A",Ã:"A","Ꜳ":"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY",Ḃ:"B",Ḅ:"B",Ɓ:"B",Ḇ:"B","Ƀ":"B",Ƃ:"B",Ć:"C",Č:"C",Ç:"C",Ḉ:"C",Ĉ:"C",Ċ:"C",Ƈ:"C","Ȼ":"C",Ď:"D",Ḑ:"D",Ḓ:"D",Ḋ:"D",Ḍ:"D",Ɗ:"D",Ḏ:"D",Dz:"D",Dž:"D",Đ:"D",Ð:"D",Ƌ:"D",DZ:"DZ",DŽ:"DZ",É:"E",Ĕ:"E",Ě:"E",Ȩ:"E",Ḝ:"E",Ê:"E",Ế:"E",Ệ:"E",Ề:"E",Ể:"E",Ễ:"E",Ḙ:"E",Ë:"E",Ė:"E",Ẹ:"E",Ȅ:"E",È:"E",Ẻ:"E",Ȇ:"E",Ē:"E",Ḗ:"E",Ḕ:"E",Ę:"E","Ɇ":"E",Ẽ:"E",Ḛ:"E","Ꝫ":"ET",Ḟ:"F",Ƒ:"F",Ǵ:"G",Ğ:"G",Ǧ:"G",Ģ:"G",Ĝ:"G",Ġ:"G",Ɠ:"G",Ḡ:"G",Ǥ:"G",Ḫ:"H",Ȟ:"H",Ḩ:"H",Ĥ:"H","Ⱨ":"H",Ḧ:"H",Ḣ:"H",Ḥ:"H",Ħ:"H",Í:"I",Ĭ:"I",Ǐ:"I",Î:"I",Ï:"I",Ḯ:"I",İ:"I",Ị:"I",Ȉ:"I",Ì:"I",Ỉ:"I",Ȋ:"I",Ī:"I",Į:"I",Ɨ:"I",Ĩ:"I",Ḭ:"I",І:"I","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS",Ĵ:"J","Ɉ":"J",Ḱ:"K",Ǩ:"K",Ķ:"K","Ⱪ":"K","Ꝃ":"K",Ḳ:"K",Ƙ:"K",Ḵ:"K","Ꝁ":"K","Ꝅ":"K",Ĺ:"L","Ƚ":"L",Ľ:"L",Ļ:"L",Ḽ:"L",Ḷ:"L",Ḹ:"L","Ⱡ":"L","Ꝉ":"L",Ḻ:"L",Ŀ:"L","Ɫ":"L",Lj:"L",Ł:"L",LJ:"LJ",Ḿ:"M",Ṁ:"M",Ṃ:"M","Ɱ":"M",Ń:"N",Ň:"N",Ņ:"N",Ṋ:"N",Ṅ:"N",Ṇ:"N",Ǹ:"N",Ɲ:"N",Ṉ:"N","Ƞ":"N",Nj:"N",Ñ:"N",NJ:"NJ",Ó:"O",Ŏ:"O",Ǒ:"O",Ô:"O",Ố:"O",Ộ:"O",Ồ:"O",Ổ:"O",Ỗ:"O",Ö:"O",Ȫ:"O",Ȯ:"O",Ȱ:"O",Ọ:"O",Ő:"O",Ȍ:"O",Ò:"O",Ỏ:"O",Ơ:"O",Ớ:"O",Ợ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ȏ:"O","Ꝋ":"O","Ꝍ":"O",Ō:"O",Ṓ:"O",Ṑ:"O",Ɵ:"O",Ǫ:"O",Ǭ:"O",Ø:"O",Ǿ:"O",Õ:"O",Ṍ:"O",Ṏ:"O",Ȭ:"O",Ƣ:"OI","Ꝏ":"OO",Ɛ:"E",Ɔ:"O",Ȣ:"OU",Ṕ:"P",Ṗ:"P","Ꝓ":"P",Ƥ:"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q",Ŕ:"R",Ř:"R",Ŗ:"R",Ṙ:"R",Ṛ:"R",Ṝ:"R",Ȑ:"R",Ȓ:"R",Ṟ:"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C",Ǝ:"E",Ś:"S",Ṥ:"S",Š:"S",Ṧ:"S",Ş:"S",Ŝ:"S",Ș:"S",Ṡ:"S",Ṣ:"S",Ṩ:"S",ß:"ss",Ť:"T",Ţ:"T",Ṱ:"T",Ț:"T","Ⱦ":"T",Ṫ:"T",Ṭ:"T",Ƭ:"T",Ṯ:"T",Ʈ:"T",Ŧ:"T","Ɐ":"A","Ꞁ":"L",Ɯ:"M","Ʌ":"V","Ꜩ":"TZ",Ú:"U",Ŭ:"U",Ǔ:"U",Û:"U",Ṷ:"U",Ü:"U",Ǘ:"U",Ǚ:"U",Ǜ:"U",Ǖ:"U",Ṳ:"U",Ụ:"U",Ű:"U",Ȕ:"U",Ù:"U",Ủ:"U",Ư:"U",Ứ:"U",Ự:"U",Ừ:"U",Ử:"U",Ữ:"U",Ȗ:"U",Ū:"U",Ṻ:"U",Ų:"U",Ů:"U",Ũ:"U",Ṹ:"U",Ṵ:"U","Ꝟ":"V",Ṿ:"V",Ʋ:"V",Ṽ:"V","Ꝡ":"VY",Ẃ:"W",Ŵ:"W",Ẅ:"W",Ẇ:"W",Ẉ:"W",Ẁ:"W","Ⱳ":"W",Ẍ:"X",Ẋ:"X",Ý:"Y",Ŷ:"Y",Ÿ:"Y",Ẏ:"Y",Ỵ:"Y",Ỳ:"Y",Ƴ:"Y",Ỷ:"Y","Ỿ":"Y",Ȳ:"Y","Ɏ":"Y",Ỹ:"Y",Ї:"YI",Ź:"Z",Ž:"Z",Ẑ:"Z","Ⱬ":"Z",Ż:"Z",Ẓ:"Z",Ȥ:"Z",Ẕ:"Z",Ƶ:"Z",Þ:"TH",IJ:"IJ",Œ:"OE","ᴀ":"A","ᴁ":"AE",ʙ:"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F",ɢ:"G",ʛ:"G",ʜ:"H",ɪ:"I",ʁ:"R","ᴊ":"J","ᴋ":"K",ʟ:"L","ᴌ":"L","ᴍ":"M",ɴ:"N","ᴏ":"O",ɶ:"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P",ʀ:"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","ⱻ":"E","ᴚ":"R","ᴜ":"U","ᴠ":"V","ᴡ":"W",ʏ:"Y","ᴢ":"Z",á:"a",ă:"a",ắ:"a",ặ:"a",ằ:"a",ẳ:"a",ẵ:"a",ǎ:"a",â:"a",ấ:"a",ậ:"a",ầ:"a",ẩ:"a",ẫ:"a",ä:"a",ǟ:"a",ȧ:"a",ǡ:"a",ạ:"a",ȁ:"a",à:"a",ả:"a",ȃ:"a",ā:"a",ą:"a","ᶏ":"a",ẚ:"a",å:"a",ǻ:"a",ḁ:"a","ⱥ":"a",ã:"a","ꜳ":"aa",æ:"ae",ǽ:"ae",ǣ:"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay",ḃ:"b",ḅ:"b",ɓ:"b",ḇ:"b","ᵬ":"b","ᶀ":"b",ƀ:"b",ƃ:"b",ɵ:"o",ć:"c",č:"c",ç:"c",ḉ:"c",ĉ:"c",ɕ:"c",ċ:"c",ƈ:"c","ȼ":"c",ď:"d",ḑ:"d",ḓ:"d","ȡ":"d",ḋ:"d",ḍ:"d",ɗ:"d","ᶑ":"d",ḏ:"d","ᵭ":"d","ᶁ":"d",đ:"d",ɖ:"d",ƌ:"d",ð:"d",ı:"i","ȷ":"j",ɟ:"j",ʄ:"j",dz:"dz",dž:"dz",é:"e",ĕ:"e",ě:"e",ȩ:"e",ḝ:"e",ê:"e",ế:"e",ệ:"e",ề:"e",ể:"e",ễ:"e",ḙ:"e",ë:"e",ė:"e",ẹ:"e",ȅ:"e",è:"e",ẻ:"e",ȇ:"e",ē:"e",ḗ:"e",ḕ:"e","ⱸ":"e",ę:"e","ᶒ":"e","ɇ":"e",ẽ:"e",ḛ:"e","ꝫ":"et",ḟ:"f",ƒ:"f","ᵮ":"f","ᶂ":"f",ǵ:"g",ğ:"g",ǧ:"g",ģ:"g",ĝ:"g",ġ:"g",ɠ:"g",ḡ:"g","ᶃ":"g",ǥ:"g",ḫ:"h",ȟ:"h",ḩ:"h",ĥ:"h","ⱨ":"h",ḧ:"h",ḣ:"h",ḥ:"h",ɦ:"h",ẖ:"h",ħ:"h",ƕ:"hv",í:"i",ĭ:"i",ǐ:"i",î:"i",ï:"i",ḯ:"i",ị:"i",ȉ:"i",ì:"i",ỉ:"i",ȋ:"i",ī:"i",į:"i","ᶖ":"i",ɨ:"i",ĩ:"i",ḭ:"i",і:"i","ꝺ":"d","ꝼ":"f","ᵹ":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is",ǰ:"j",ĵ:"j",ʝ:"j","ɉ":"j",ḱ:"k",ǩ:"k",ķ:"k","ⱪ":"k","ꝃ":"k",ḳ:"k",ƙ:"k",ḵ:"k","ᶄ":"k","ꝁ":"k","ꝅ":"k",ĺ:"l",ƚ:"l",ɬ:"l",ľ:"l",ļ:"l",ḽ:"l","ȴ":"l",ḷ:"l",ḹ:"l","ⱡ":"l","ꝉ":"l",ḻ:"l",ŀ:"l",ɫ:"l","ᶅ":"l",ɭ:"l",ł:"l",lj:"lj",ſ:"s","ẜ":"s",ẛ:"s","ẝ":"s",ḿ:"m",ṁ:"m",ṃ:"m",ɱ:"m","ᵯ":"m","ᶆ":"m",ń:"n",ň:"n",ņ:"n",ṋ:"n","ȵ":"n",ṅ:"n",ṇ:"n",ǹ:"n",ɲ:"n",ṉ:"n",ƞ:"n","ᵰ":"n","ᶇ":"n",ɳ:"n",ñ:"n",nj:"nj",ó:"o",ŏ:"o",ǒ:"o",ô:"o",ố:"o",ộ:"o",ồ:"o",ổ:"o",ỗ:"o",ö:"o",ȫ:"o",ȯ:"o",ȱ:"o",ọ:"o",ő:"o",ȍ:"o",ò:"o",ỏ:"o",ơ:"o",ớ:"o",ợ:"o",ờ:"o",ở:"o",ỡ:"o",ȏ:"o","ꝋ":"o","ꝍ":"o","ⱺ":"o",ō:"o",ṓ:"o",ṑ:"o",ǫ:"o",ǭ:"o",ø:"o",ǿ:"o",õ:"o",ṍ:"o",ṏ:"o",ȭ:"o",ƣ:"oi","ꝏ":"oo",ɛ:"e","ᶓ":"e",ɔ:"o","ᶗ":"o",ȣ:"ou",ṕ:"p",ṗ:"p","ꝓ":"p",ƥ:"p","ᵱ":"p","ᶈ":"p","ꝕ":"p","ᵽ":"p","ꝑ":"p","ꝙ":"q",ʠ:"q","ɋ":"q","ꝗ":"q",ŕ:"r",ř:"r",ŗ:"r",ṙ:"r",ṛ:"r",ṝ:"r",ȑ:"r",ɾ:"r","ᵳ":"r",ȓ:"r",ṟ:"r",ɼ:"r","ᵲ":"r","ᶉ":"r","ɍ":"r",ɽ:"r","ↄ":"c","ꜿ":"c",ɘ:"e",ɿ:"r",ś:"s",ṥ:"s",š:"s",ṧ:"s",ş:"s",ŝ:"s",ș:"s",ṡ:"s",ṣ:"s",ṩ:"s",ʂ:"s","ᵴ":"s","ᶊ":"s","ȿ":"s",ɡ:"g","ᴑ":"o","ᴓ":"o","ᴝ":"u",ť:"t",ţ:"t",ṱ:"t",ț:"t","ȶ":"t",ẗ:"t","ⱦ":"t",ṫ:"t",ṭ:"t",ƭ:"t",ṯ:"t","ᵵ":"t",ƫ:"t",ʈ:"t",ŧ:"t","ᵺ":"th",ɐ:"a","ᴂ":"ae",ǝ:"e","ᵷ":"g",ɥ:"h","ʮ":"h","ʯ":"h","ᴉ":"i",ʞ:"k","ꞁ":"l",ɯ:"m",ɰ:"m","ᴔ":"oe",ɹ:"r",ɻ:"r",ɺ:"r","ⱹ":"r",ʇ:"t",ʌ:"v",ʍ:"w",ʎ:"y","ꜩ":"tz",ú:"u",ŭ:"u",ǔ:"u",û:"u",ṷ:"u",ü:"u",ǘ:"u",ǚ:"u",ǜ:"u",ǖ:"u",ṳ:"u",ụ:"u",ű:"u",ȕ:"u",ù:"u",ủ:"u",ư:"u",ứ:"u",ự:"u",ừ:"u",ử:"u",ữ:"u",ȗ:"u",ū:"u",ṻ:"u",ų:"u","ᶙ":"u",ů:"u",ũ:"u",ṹ:"u",ṵ:"u","ᵫ":"ue","ꝸ":"um","ⱴ":"v","ꝟ":"v",ṿ:"v",ʋ:"v","ᶌ":"v","ⱱ":"v",ṽ:"v","ꝡ":"vy",ẃ:"w",ŵ:"w",ẅ:"w",ẇ:"w",ẉ:"w",ẁ:"w","ⱳ":"w",ẘ:"w",ẍ:"x",ẋ:"x","ᶍ":"x",ý:"y",ŷ:"y",ÿ:"y",ẏ:"y",ỵ:"y",ỳ:"y",ƴ:"y",ỷ:"y","ỿ":"y",ȳ:"y",ẙ:"y","ɏ":"y",ỹ:"y",ї:"yi",ź:"z",ž:"z",ẑ:"z",ʑ:"z","ⱬ":"z",ż:"z",ẓ:"z",ȥ:"z",ẕ:"z","ᵶ":"z","ᶎ":"z",ʐ:"z",ƶ:"z","ɀ":"z",þ:"th",ff:"ff",ffi:"ffi",ffl:"ffl",fi:"fi",fl:"fl",ij:"ij",œ:"oe",st:"st","ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x",Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ґ:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"'",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ґ:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"'",Ф:"F",Ы:"I",В:"V",А:"a",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"'",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"'",б:"b",ю:"yu"};exports.extractErrorsFromResponse=u;exports.extractPermissionsFromResponse=c;exports.fixNameIdNulls=a;exports.formatFileSize=E;exports.hookFormSetServerErrors=l;exports.isPrimitive=n;exports.joinStrings=d;exports.latinize=i;exports.millisecondsInDay=864e5;exports.millisecondsInHour=36e5;exports.millisecondsInMinute=6e4;exports.millisecondsInWeek=6048e5;exports.truncateText=O;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./NoInputContainer-CUJPpofC.cjs"),u=require("react");require("react-hook-form");require("./latinize-D-eMyP15.cjs");const w=require("./usePermissions-DSmIxVqo.cjs"),C=require("./SimpleTooltip-j5pL4_G0.cjs"),M="_side-menu-item_6vbwa_1",B="_disabled_6vbwa_5",k="_nav-button_6vbwa_9",S="_child_6vbwa_17",P="_text_6vbwa_21",f="_icon_6vbwa_28",g="_collapse-icon_6vbwa_34",I="_collapsed_6vbwa_44",y="_expanded_6vbwa_51",T="_children-container_6vbwa_57",$="_visible_6vbwa_65",q="_children_6vbwa_57",o={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:M,disabled:B,"nav-button":"_nav-button_6vbwa_9",navButton:k,child:S,text:P,icon:f,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:g,collapsed:I,expanded:y,"children-container":"_children-container_6vbwa_57",childrenContainer:T,visible:$,children:q},H=({item:e,menuExpanded:t,children:i})=>e.tooltip&&!t?s.jsxRuntimeExports.jsx(C.SimpleTooltip,{text:e.tooltip,placement:"right",children:i}):i,N=({item:e,menuExpanded:t,collapsed:i,onCollapse:a,currentPath:l})=>{var v,_;const{LinkComponent:c}=u.useContext(s.LuminusComponentsContext),[p,x]=u.useState(!1),[d]=l.split("?"),h=e.linkTo===d||((v=e.children)==null?void 0:v.some(n=>n.linkTo===d));return s.jsxRuntimeExports.jsxs("li",{className:s.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.expanded]:t},{active:p||h},{open:i&&e.children},{[o.disabled]:e.disabled||e.notPermitted},{disabled:e.disabled||e.notPermitted}),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[s.jsxRuntimeExports.jsx(H,{item:e,menuExpanded:t,children:e.children?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs("button",{type:"button",className:s.classNames("nav-link",o.navButton),onClick:()=>a(),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:s.jsxRuntimeExports.jsx(s.MdOutlineKeyboardArrowRight,{})})]})}):s.jsxRuntimeExports.jsxs(c,{to:e.disabled||e.notPermitted?"/":e.linkTo??"/",className:s.classNames("nav-link",o.navButton),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title})]})}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("shadow rounded children",o.children),children:(_=e.children)==null?void 0:_.map(n=>s.jsxRuntimeExports.jsx(c,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:s.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},L="_side-menu_n1hvm_1",F="_sidebar-header_n1hvm_13",A="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",U="_divider_n1hvm_26",j={"side-menu":"_side-menu_n1hvm_1",sideMenu:L,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:F,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:A,expand:K,divider:U},z=({headerItem:e,mainItems:t,secondaryItems:i,expanded:a,setExpanded:l,currentPath:c})=>{const[p,x]=u.useState(-1),{checkUserHasPermissions:d}=w.usePermissions(),h=u.useMemo(()=>t.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[]),disabled:n.disabled||m.disabled}))}}),[t,d]),v=u.useMemo(()=>i.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[])}))}}),[i,d]),_=n=>{x(n===p?-1:n)};return u.useEffect(()=>{a||x(-1)},[a]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu shadow",j.sideMenu,{[j.expand]:a},{expand:a}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("sidebar-header",j.sidebarHeader),children:e}),s.jsxRuntimeExports.jsxs("ul",{className:j.sideMenuContent,children:[h.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title)),s.jsxRuntimeExports.jsx("hr",{className:s.classNames("divider",j.divider)}),v.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title))]})]})},D="_top-bar_1lk80_1",G="_top-bar-brand_1lk80_14",R={"top-bar":"_top-bar_1lk80_1",topBar:D,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:G},J=({appName:e,leftOffset:t,centerContent:i,rightContent:a})=>{const{LinkComponent:l}=u.useContext(s.LuminusComponentsContext);return s.jsxRuntimeExports.jsxs("nav",{className:s.classNames("luminus-top-bar shadow",R.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[s.jsxRuntimeExports.jsx(l,{to:"/",className:s.classNames("luminus-top-bar-brand",R.topBarBrand),children:e}),i&&s.jsxRuntimeExports.jsx("div",{children:i}),s.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:a??null})]})},O="_side-content-bar_17kwd_1",Q={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:O},b=({width:e,children:t})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("luminus-side-content-bar shadow",Q.sideContentBar),style:{width:`${e}px`},children:t}),E=({title:e})=>s.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof e=="string"?s.jsxRuntimeExports.jsx(s.Typography,{variant:"h3",children:e}):e}),V=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("container-fluid",l?"p-0":"p-3",c),children:[s.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${a}px`:void 0},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]}),X="_full-screen-container_1rm4r_1",Y={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:X},Z=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("overflow-hidden luminus-full-screen-container",l?"p-0":"p-3",c,Y.fullScreenContainer),style:{width:i?`calc(100% - ${a}px)`:"100%"},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]});exports.FullScreenContainer=Z;exports.MainContainer=V;exports.SideContentBar=b;exports.SideMenu=z;exports.TopBar=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./NoInputContainer-DUqvY4oq.cjs"),u=require("react");require("react-hook-form");require("./latinize-DaqzUOla.cjs");const w=require("./usePermissions-DS4knuQ0.cjs"),C=require("./SimpleTooltip-_uTrst6x.cjs"),M="_side-menu-item_6vbwa_1",B="_disabled_6vbwa_5",k="_nav-button_6vbwa_9",S="_child_6vbwa_17",P="_text_6vbwa_21",f="_icon_6vbwa_28",g="_collapse-icon_6vbwa_34",I="_collapsed_6vbwa_44",y="_expanded_6vbwa_51",T="_children-container_6vbwa_57",$="_visible_6vbwa_65",q="_children_6vbwa_57",o={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:M,disabled:B,"nav-button":"_nav-button_6vbwa_9",navButton:k,child:S,text:P,icon:f,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:g,collapsed:I,expanded:y,"children-container":"_children-container_6vbwa_57",childrenContainer:T,visible:$,children:q},H=({item:e,menuExpanded:t,children:i})=>e.tooltip&&!t?s.jsxRuntimeExports.jsx(C.SimpleTooltip,{text:e.tooltip,placement:"right",children:i}):i,N=({item:e,menuExpanded:t,collapsed:i,onCollapse:a,currentPath:l})=>{var v,_;const{LinkComponent:c}=u.useContext(s.LuminusComponentsContext),[p,x]=u.useState(!1),[d]=l.split("?"),h=e.linkTo===d||((v=e.children)==null?void 0:v.some(n=>n.linkTo===d));return s.jsxRuntimeExports.jsxs("li",{className:s.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.expanded]:t},{active:p||h},{open:i&&e.children},{[o.disabled]:e.disabled||e.notPermitted},{disabled:e.disabled||e.notPermitted}),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[s.jsxRuntimeExports.jsx(H,{item:e,menuExpanded:t,children:e.children?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs("button",{type:"button",className:s.classNames("nav-link",o.navButton),onClick:()=>a(),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:s.jsxRuntimeExports.jsx(s.MdOutlineKeyboardArrowRight,{})})]})}):s.jsxRuntimeExports.jsxs(c,{to:e.disabled||e.notPermitted?"/":e.linkTo??"/",className:s.classNames("nav-link",o.navButton),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title})]})}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("shadow rounded children",o.children),children:(_=e.children)==null?void 0:_.map(n=>s.jsxRuntimeExports.jsx(c,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:s.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},L="_side-menu_n1hvm_1",F="_sidebar-header_n1hvm_13",A="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",U="_divider_n1hvm_26",j={"side-menu":"_side-menu_n1hvm_1",sideMenu:L,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:F,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:A,expand:K,divider:U},z=({headerItem:e,mainItems:t,secondaryItems:i,expanded:a,setExpanded:l,currentPath:c})=>{const[p,x]=u.useState(-1),{checkUserHasPermissions:d}=w.usePermissions(),h=u.useMemo(()=>t.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[]),disabled:n.disabled||m.disabled}))}}),[t,d]),v=u.useMemo(()=>i.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[])}))}}),[i,d]),_=n=>{x(n===p?-1:n)};return u.useEffect(()=>{a||x(-1)},[a]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu shadow",j.sideMenu,{[j.expand]:a},{expand:a}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("sidebar-header",j.sidebarHeader),children:e}),s.jsxRuntimeExports.jsxs("ul",{className:j.sideMenuContent,children:[h.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title)),s.jsxRuntimeExports.jsx("hr",{className:s.classNames("divider",j.divider)}),v.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title))]})]})},D="_top-bar_1lk80_1",G="_top-bar-brand_1lk80_14",R={"top-bar":"_top-bar_1lk80_1",topBar:D,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:G},J=({appName:e,leftOffset:t,centerContent:i,rightContent:a})=>{const{LinkComponent:l}=u.useContext(s.LuminusComponentsContext);return s.jsxRuntimeExports.jsxs("nav",{className:s.classNames("luminus-top-bar shadow",R.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[s.jsxRuntimeExports.jsx(l,{to:"/",className:s.classNames("luminus-top-bar-brand",R.topBarBrand),children:e}),i&&s.jsxRuntimeExports.jsx("div",{children:i}),s.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:a??null})]})},O="_side-content-bar_17kwd_1",Q={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:O},b=({width:e,children:t})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("luminus-side-content-bar shadow",Q.sideContentBar),style:{width:`${e}px`},children:t}),E=({title:e})=>s.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof e=="string"?s.jsxRuntimeExports.jsx(s.Typography,{variant:"h3",children:e}):e}),V=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("container-fluid",l?"p-0":"p-3",c),children:[s.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${a}px`:void 0},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]}),X="_full-screen-container_1rm4r_1",Y={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:X},Z=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("overflow-hidden luminus-full-screen-container",l?"p-0":"p-3",c,Y.fullScreenContainer),style:{width:i?`calc(100% - ${a}px)`:"100%"},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]});exports.FullScreenContainer=Z;exports.MainContainer=V;exports.SideContentBar=b;exports.SideMenu=z;exports.TopBar=J;
package/dist/layout.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { Q as B, j as e, c as o, X as I, Y as P } from "./NoInputContainer-BCTMX8k7.js";
1
+ import { Q as B, j as e, c as o, X as I, Y as P } from "./NoInputContainer-0WkO5fEr.js";
2
2
  import { useContext as C, useState as M, useMemo as j, useEffect as g } from "react";
3
3
  import "react-hook-form";
4
- import "./latinize-3MO2uNV7.js";
5
- import { u as y } from "./usePermissions-BEgNFMld.js";
6
- import { S } from "./SimpleTooltip-CPdPmVvw.js";
4
+ import "./latinize-BQrinury.js";
5
+ import { u as y } from "./usePermissions-CA5c2TT2.js";
6
+ import { S } from "./SimpleTooltip-4Vgxz25r.js";
7
7
  const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6vbwa_9", L = "_child_6vbwa_17", E = "_text_6vbwa_21", F = "_icon_6vbwa_28", R = "_collapse-icon_6vbwa_34", A = "_collapsed_6vbwa_44", K = "_expanded_6vbwa_51", Q = "_children-container_6vbwa_57", U = "_visible_6vbwa_65", X = "_children_6vbwa_57", i = {
8
8
  "side-menu-item": "_side-menu-item_6vbwa_1",
9
9
  sideMenuItem: T,