react-luminus-components 1.3.75 → 1.3.76
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.
- package/dist/.vite/manifest.json +6 -6
- package/dist/hooks/usePermissions/usePermissions.d.ts +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +1 -1
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +68 -64
- package/dist/usePermissions-CDkc5n4B.cjs +1 -0
- package/dist/usePermissions-D1kTfy1F.js +19 -0
- package/package.json +1 -1
- package/dist/usePermissions-CM6ojRwU.cjs +0 -1
- package/dist/usePermissions-Cbnc0Li2.js +0 -16
package/dist/.vite/manifest.json
CHANGED
|
@@ -105,15 +105,15 @@
|
|
|
105
105
|
"_nivo-pie.es-DbylxdLa.js"
|
|
106
106
|
]
|
|
107
107
|
},
|
|
108
|
-
"_usePermissions-
|
|
109
|
-
"file": "usePermissions-
|
|
108
|
+
"_usePermissions-CDkc5n4B.cjs": {
|
|
109
|
+
"file": "usePermissions-CDkc5n4B.cjs",
|
|
110
110
|
"name": "usePermissions",
|
|
111
111
|
"imports": [
|
|
112
112
|
"_nivo-pie.es-CYja6R0y.cjs"
|
|
113
113
|
]
|
|
114
114
|
},
|
|
115
|
-
"_usePermissions-
|
|
116
|
-
"file": "usePermissions-
|
|
115
|
+
"_usePermissions-D1kTfy1F.js": {
|
|
116
|
+
"file": "usePermissions-D1kTfy1F.js",
|
|
117
117
|
"name": "usePermissions",
|
|
118
118
|
"imports": [
|
|
119
119
|
"_nivo-pie.es-DbylxdLa.js"
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"_useLocalStorageState-C2fAE5hY.cjs",
|
|
144
144
|
"_dateUtils-UEaQDw00.cjs",
|
|
145
145
|
"_useClipboard-KQiedKAp.cjs",
|
|
146
|
-
"_usePermissions-
|
|
146
|
+
"_usePermissions-CDkc5n4B.cjs"
|
|
147
147
|
]
|
|
148
148
|
},
|
|
149
149
|
"src/layout/index.ts": {
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"isEntry": true,
|
|
154
154
|
"imports": [
|
|
155
155
|
"_nivo-pie.es-CYja6R0y.cjs",
|
|
156
|
-
"_usePermissions-
|
|
156
|
+
"_usePermissions-CDkc5n4B.cjs",
|
|
157
157
|
"_SimpleTooltip-Duct0nes.cjs"
|
|
158
158
|
]
|
|
159
159
|
},
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("./nivo-pie.es-CYja6R0y.cjs"),Qe=require("./useConfirm-SzzUX_WZ.cjs"),Ae=require("./useLocalStorageState-C2fAE5hY.cjs"),C=require("react");require("react-router-dom");require("@azure/msal-browser");require("@azure/msal-react");const Xe=require("./dateUtils-UEaQDw00.cjs");require("react-hook-form");const J=require("./useClipboard-KQiedKAp.cjs"),Ke=require("./usePermissions-CM6ojRwU.cjs");var x;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var 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"]),V=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}},c=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"]),Fe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class O extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){const d=i.path[u];u===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(i))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return n(this),s}static assert(e){if(!(e instanceof O))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}O.create=r=>new O(r);const K=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.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 c.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 c.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 c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let De=K;function et(r){De=r}function ke(){return De}const be=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const u=s.filter(d=>!!d).slice().reverse();for(const d of u)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},tt=[];function l(r,e){const t=ke(),s=be({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===K?void 0:K].filter(n=>!!n)});r.common.issues.push(s)}class S{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return y;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return S.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return y;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const y=Object.freeze({status:"aborted"}),Q=r=>({status:"dirty",value:r}),Z=r=>({status:"valid",value:r}),Re=r=>r.status==="aborted",Ie=r=>r.status==="dirty",ae=r=>r.status==="valid",ie=r=>typeof Promise<"u"&&r instanceof Promise;function we(r,e,t,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Ve(r,e,t,s,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));var se,ne;class M{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pe=(r,e)=>{if(ae(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 O(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var u,d;const{message:p}=r;return i.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(u=p??s)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(d=p??t)!==null&&d!==void 0?d:o.defaultError}},description:n}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ie(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Pe(n,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(ie(n)?n:Promise.resolve(n));return Pe(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new j({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return A.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return I.create(this,this._def)}promise(){return ee.create(this,this._def)}or(e){return ue.create([this,e],this._def)}and(e){return le.create(this,e,this._def)}transform(e){return new j({..._(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ye({..._(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Me({typeName:m.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new _e({..._(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ge.create(this,e)}readonly(){return ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rt=/^c[^\s-]{8,}$/i,st=/^[0-9a-z]+$/,nt=/^[0-9A-HJKMNP-TV-Z]{26}$/,at=/^[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,it=/^[a-z0-9_-]{21}$/i,ot=/^[-+]?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)?)??$/,ct=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ee;const ut=/^(?:(?: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])$/,lt=/^(([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})))$/,ft=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ze="((\\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])))",ht=new RegExp(`^${ze}$`);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 mt(r){return new RegExp(`^${Le(r)}$`)}function qe(r){let e=`${ze}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 pt(r,e){return!!((e==="v4"||!e)&&ut.test(r)||(e==="v6"||!e)&<.test(r))}class R 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:c.invalid_type,expected:f.string,received:a.parsedType}),y}const s=new S;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ct.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ee||(Ee=new RegExp(dt,"u")),Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")at.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")it.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")rt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")st.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?qe(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?ht.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?mt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?ot.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?pt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?ft.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...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}}R.create=r=>{var e;return new R({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};function yt(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class z 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:c.invalid_type,expected:f.number,received:a.parsedType}),y}let s;const n=new S;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?yt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_finite,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new z({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}z.create=r=>new z({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class L 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:c.invalid_type,expected:f.bigint,received:a.parsedType}),y}let s;const n=new S;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new L({...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}}L.create=r=>{var e;return new L({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};class oe extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),y}return Z(e.data)}}oe.create=r=>new oe({typeName:m.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:c.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),y}const s=new S;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):x.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new 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:m.ZodDate,..._(r)});class Te extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),y}return Z(e.data)}}Te.create=r=>new Te({typeName:m.ZodSymbol,..._(r)});class ce extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),y}return Z(e.data)}}ce.create=r=>new ce({typeName:m.ZodUndefined,..._(r)});class de extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),y}return Z(e.data)}}de.create=r=>new de({typeName:m.ZodNull,..._(r)});class F extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}F.create=r=>new F({typeName:m.ZodAny,..._(r)});class B extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}B.create=r=>new B({typeName:m.ZodUnknown,..._(r)});class D extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),y}}D.create=r=>new D({typeName:m.ZodNever,..._(r)});class Ce extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),y}return Z(e.data)}}Ce.create=r=>new Ce({typeName:m.ZodVoid,..._(r)});class I extends v{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return l(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),y;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(l(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(l(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(l(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new M(t,i,t.path,o)))).then(i=>S.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new M(t,i,t.path,o)));return S.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new I({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new I({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new I({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}I.create=(r,e)=>new I({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,..._(e)});function H(r){if(r instanceof k){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=A.create(H(s))}return new k({...r._def,shape:()=>e})}else return r instanceof I?new I({...r._def,type:H(r.element)}):r instanceof A?A.create(H(r.unwrap())):r instanceof U?U.create(H(r.unwrap())):r instanceof P?P.create(r.items.map(e=>H(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 d=this._getOrReturnCtx(e);return l(d,{code:c.invalid_type,expected:f.object,received:d.parsedType}),y}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof D&&this._def.unknownKeys==="strip"))for(const d in n.data)i.includes(d)||o.push(d);const u=[];for(const d of i){const p=a[d],N=n.data[d];u.push({key:{status:"valid",value:d},value:p._parse(new M(n,N,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof D){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of o)u.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")o.length>0&&(l(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of o){const N=n.data[p];u.push({key:{status:"valid",value:p},value:d._parse(new M(n,N,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of u){const N=await p.key,xe=await p.value;d.push({key:N,value:xe,alwaysSet:p.alwaysSet})}return d}).then(d=>S.mergeObjectSync(s,d)):S.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const u=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}deepPartial(){return H(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof A;)a=a._def.innerType;t[s]=a}}),new k({...this._def,shape:()=>t})}keyof(){return Ue(x.objectKeys(this.shape))}}k.create=(r,e)=>new k({shape:()=>r,unknownKeys:"strip",catchall:D.create(),typeName:m.ZodObject,..._(e)});k.strictCreate=(r,e)=>new k({shape:()=>r,unknownKeys:"strict",catchall:D.create(),typeName:m.ZodObject,..._(e)});k.lazycreate=(r,e)=>new k({shape:r,unknownKeys:"strip",catchall:D.create(),typeName:m.ZodObject,..._(e)});class ue extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new O(o.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:i}),y}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const u of s){const d={...t,common:{...t.common,issues:[]},parent:null},p=u._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new O(u));return l(t,{code:c.invalid_union,unionErrors:o}),y}}get options(){return this._def.options}}ue.create=(r,e)=>new ue({options:r,typeName:m.ZodUnion,..._(e)});const $=r=>r instanceof he?$(r.schema):r instanceof j?$(r.innerType()):r instanceof me?[r.value]:r instanceof q?r.options:r instanceof pe?x.objectValues(r.enum):r instanceof ye?$(r._def.innerType):r instanceof ce?[void 0]:r instanceof de?[null]:r instanceof A?[void 0,...$(r.unwrap())]:r instanceof U?[null,...$(r.unwrap())]:r instanceof Me||r instanceof ve?$(r.unwrap()):r instanceof _e?$(r._def.innerType):[];class Ne extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),y;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=$(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new Ne({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._(s)})}}function je(r,e){const t=V(r),s=V(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=x.objectKeys(e),a=x.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=je(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=je(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class le extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Re(a)||Re(i))return y;const o=je(a.value,i.value);return o.valid?((Ie(a)||Ie(i))&&t.dirty(),{status:t.value,value:o.data}):(l(s,{code:c.invalid_intersection_types}),y)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}le.create=(r,e,t)=>new le({left:r,right:e,typeName:m.ZodIntersection,..._(t)});class P extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return l(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),y;if(s.data.length<this._def.items.length)return l(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new M(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>S.mergeArray(t,i)):S.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new P({...this._def,rest:e})}}P.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new P({items:r,typeName:m.ZodTuple,rest:null,..._(e)})};class fe extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return l(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),y;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new M(s,o,s.path,o)),value:i._parse(new M(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new fe({keyType:e,valueType:t,typeName:m.ZodRecord,..._(s)}):new fe({keyType:R.create(),valueType:e,typeName:m.ZodRecord,..._(t)})}}class Se extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return l(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),y;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],d)=>({key:n._parse(new M(s,o,s.path,[d,"key"])),value:a._parse(new M(s,u,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const d=await u.key,p=await u.value;if(d.status==="aborted"||p.status==="aborted")return y;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const d=u.key,p=u.value;if(d.status==="aborted"||p.status==="aborted")return y;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}}}}Se.create=(r,e,t)=>new Se({valueType:e,keyType:r,typeName:m.ZodMap,..._(t)});class Y extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return l(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),y;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(l(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(l(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const d=new Set;for(const p of u){if(p.status==="aborted")return y;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}const o=[...s.data.values()].map((u,d)=>a._parse(new M(s,u,s.path,d)));return s.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:m.ZodSet,..._(e)});class X 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:c.invalid_type,expected:f.function,received:t.parsedType}),y;function s(o,u){return be({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ke(),K].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:u}})}function n(o,u){return be({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ke(),K].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:u}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ee){const o=this;return Z(async function(...u){const d=new O([]),p=await o._def.args.parseAsync(u,a).catch(te=>{throw d.addIssue(s(u,te)),d}),N=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(N,a).catch(te=>{throw d.addIssue(n(N,te)),d})})}else{const o=this;return Z(function(...u){const d=o._def.args.safeParse(u,a);if(!d.success)throw new O([s(u,d.error)]);const p=Reflect.apply(i,this,d.data),N=o._def.returns.safeParse(p,a);if(!N.success)throw new O([n(p,N.error)]);return N.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new X({...this._def,args:P.create(e).rest(B.create())})}returns(e){return new X({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new X({args:e||P.create([]).rest(B.create()),returns:t||B.create(),typeName:m.ZodFunction,..._(s)})}}class he 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})}}he.create=(r,e)=>new he({getter:r,typeName:m.ZodLazy,..._(e)});class me extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}me.create=(r,e)=>new me({value:r,typeName:m.ZodLiteral,..._(e)});function Ue(r,e){return new q({values:r,typeName:m.ZodEnum,..._(e)})}class q extends v{constructor(){super(...arguments),se.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{expected:x.joinValues(s),received:t.parsedType,code:c.invalid_type}),y}if(we(this,se)||Ve(this,se,new Set(this._def.values)),!we(this,se).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:s}),y}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return q.create(e,{...this._def,...t})}exclude(e,t=this._def){return q.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}se=new WeakMap;q.create=Ue;class pe extends v{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=x.objectValues(t);return l(s,{expected:x.joinValues(n),received:s.parsedType,code:c.invalid_type}),y}if(we(this,ne)||Ve(this,ne,new Set(x.getValidEnumValues(this._def.values))),!we(this,ne).has(e.data)){const n=x.objectValues(t);return l(s,{received:s.data,code:c.invalid_enum_value,options:n}),y}return Z(e.data)}get enum(){return this._def.values}}ne=new WeakMap;pe.create=(r,e)=>new pe({values:r,typeName:m.ZodNativeEnum,..._(e)});class ee 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:c.invalid_type,expected:f.promise,received:t.parsedType}),y;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return Z(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ee.create=(r,e)=>new ee({type:r,typeName:m.ZodPromise,..._(e)});class j extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?Q(u.value):u});{if(t.value==="aborted")return y;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?y:o.status==="dirty"||t.value==="dirty"?Q(o.value):o}}if(n.type==="refinement"){const i=o=>{const u=n.refinement(o,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ae(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>ae(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(n)}}j.create=(r,e,t)=>new j({schema:r,typeName:m.ZodEffects,effect:e,..._(t)});j.createWithPreprocess=(r,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,..._(t)});class A extends v{_parse(e){return this._getType(e)===f.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}A.create=(r,e)=>new A({innerType:r,typeName:m.ZodOptional,..._(e)});class U extends v{_parse(e){return this._getType(e)===f.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(r,e)=>new U({innerType:r,typeName:m.ZodNullable,..._(e)});class ye extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(r,e)=>new ye({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class _e extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ie(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new O(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new O(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}_e.create=(r,e)=>new _e({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Ze extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),y}return{status:"valid",value:e.data}}}Ze.create=r=>new Ze({typeName:m.ZodNaN,..._(r)});const _t=Symbol("zod_brand");class Me extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ge extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),Q(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?y:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ge({in:e,out:t,typeName:m.ZodPipeline})}}class ve extends v{_parse(e){const t=this._def.innerType._parse(e),s=n=>(ae(n)&&(n.value=Object.freeze(n.value)),n);return ie(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}ve.create=(r,e)=>new ve({innerType:r,typeName:m.ZodReadonly,..._(e)});function Be(r,e={},t){return r?F.create().superRefine((s,n)=>{var a,i;if(!r(s)){const o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,d=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...d,fatal:u})}}):F.create()}const vt={object:k.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const gt=(r,e={message:`Input not instance of ${r.name}`})=>Be(t=>t instanceof r,e),We=R.create,Ge=z.create,xt=Ze.create,kt=L.create,Ye=oe.create,bt=G.create,wt=Te.create,Tt=ce.create,Ct=de.create,St=F.create,Zt=B.create,Nt=D.create,Et=Ce.create,Ot=I.create,Rt=k.create,It=k.strictCreate,jt=ue.create,At=Ne.create,Mt=le.create,Pt=P.create,$t=fe.create,Dt=Se.create,Vt=Y.create,zt=X.create,Lt=he.create,qt=me.create,Ut=q.create,Bt=pe.create,Wt=ee.create,$e=j.create,Gt=A.create,Yt=U.create,Jt=j.createWithPreprocess,Ht=ge.create,Qt=()=>We().optional(),Xt=()=>Ge().optional(),Kt=()=>Ye().optional(),Ft={string:r=>R.create({...r,coerce:!0}),number:r=>z.create({...r,coerce:!0}),boolean:r=>oe.create({...r,coerce:!0}),bigint:r=>L.create({...r,coerce:!0}),date:r=>G.create({...r,coerce:!0})},er=y;var E=Object.freeze({__proto__:null,defaultErrorMap:K,setErrorMap:et,getErrorMap:ke,makeIssue:be,EMPTY_PATH:tt,addIssueToContext:l,ParseStatus:S,INVALID:y,DIRTY:Q,OK:Z,isAborted:Re,isDirty:Ie,isValid:ae,isAsync:ie,get util(){return x},get objectUtil(){return Oe},ZodParsedType:f,getParsedType:V,ZodType:v,datetimeRegex:qe,ZodString:R,ZodNumber:z,ZodBigInt:L,ZodBoolean:oe,ZodDate:G,ZodSymbol:Te,ZodUndefined:ce,ZodNull:de,ZodAny:F,ZodUnknown:B,ZodNever:D,ZodVoid:Ce,ZodArray:I,ZodObject:k,ZodUnion:ue,ZodDiscriminatedUnion:Ne,ZodIntersection:le,ZodTuple:P,ZodRecord:fe,ZodMap:Se,ZodSet:Y,ZodFunction:X,ZodLazy:he,ZodLiteral:me,ZodEnum:q,ZodNativeEnum:pe,ZodPromise:ee,ZodEffects:j,ZodTransformer:j,ZodOptional:A,ZodNullable:U,ZodDefault:ye,ZodCatch:_e,ZodNaN:Ze,BRAND:_t,ZodBranded:Me,ZodPipeline:ge,ZodReadonly:ve,custom:Be,Schema:v,ZodSchema:v,late:vt,get ZodFirstPartyTypeKind(){return m},coerce:Ft,any:St,array:Ot,bigint:kt,boolean:Ye,date:bt,discriminatedUnion:At,effect:$e,enum:Ut,function:zt,instanceof:gt,intersection:Mt,lazy:Lt,literal:qt,map:Dt,nan:xt,nativeEnum:Bt,never:Nt,null:Ct,nullable:Yt,number:Ge,object:Rt,oboolean:Kt,onumber:Xt,optional:Gt,ostring:Qt,pipeline:Ht,preprocess:Jt,promise:Wt,record:$t,set:Vt,strictObject:It,string:We,symbol:wt,transformer:$e,tuple:Pt,undefined:Tt,union:jt,unknown:Zt,void:Et,NEVER:er,ZodIssueCode:c,quotelessJson:Fe,ZodError:O});const tr=()=>{const{texts:{formValidation:r}}=C.useContext(W.LuminusComponentsContext),e=C.useCallback(g=>(g!=null&&g.useCoerce?E.coerce:E).string({invalid_type_error:r.required,required_error:r.required}).transform(w=>w??null),[r.required]),t=C.useCallback(g=>e(g).nullable().optional().transform(b=>b??null),[e]),s=C.useCallback(g=>{const b=(g==null?void 0:g.min)??Number.MIN_SAFE_INTEGER,w=(g==null?void 0:g.max)??Number.MAX_SAFE_INTEGER,re=(g!=null&&g.useCoerce?E.coerce:E).number({invalid_type_error:r.required,required_error:r.required}).min(b,r.lessThanMin(b)).max(w,r.moreThanMax(w));return re.transform(T=>T??null),re},[r]),n=C.useCallback(g=>s(g).nullable().optional().transform(b=>b??null),[s]),a=C.useCallback(g=>(g!=null&&g.useCoerce?E.coerce:E).boolean({invalid_type_error:r.required,required_error:r.required}).transform(b=>b??null),[r.required]),i=C.useCallback(g=>(g!=null&&g.useCoerce?E.coerce:E).string({invalid_type_error:r.required,required_error:r.required}).refine(Xe.isISODate,{message:r.invalidDate}).transform(w=>w??null),[r.invalidDate,r.required]),o=C.useCallback(g=>i(g).nullable().transform(b=>b??null),[i]),u=C.useCallback((g,b)=>E.enum(g,{invalid_type_error:r.required,required_error:r.required}).transform(re=>re??null),[r.required]),d=C.useCallback((g,b)=>u(g,b).nullable().transform(w=>w??null),[u]),p=C.useCallback(g=>E.object({id:n({useCoerce:!0})}).nullable().transform(w=>w??null),[n]),N=C.useCallback(g=>E.object({id:s()}).transform(w=>w??null),[s]),xe=C.useCallback(g=>E.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),[t]),te=C.useCallback(g=>E.object({id:e()}).transform(w=>w??null),[e]),Je=C.useCallback(({required:g,multiple:b,maxFileSize:w})=>E.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(He=>He.size<=w),`Maximum file size is ${W.formatFileSize(w)}.`).transform(T=>(b?T:T==null?void 0:T[0])??null),[]);return{zString:t,zStringRequired:e,zNumber:n,zNumberRequired:s,zBool:a,zDate:o,zDateRequired:i,zEnum:d,zEnumRequired:u,zObjectIdInt:p,zObjectIdIntRequired:N,zObjectIdStr:xe,zObjectIdStrRequired:te,zFile:Je}},rr=r=>{let e="pending",t;const s=r.then(n=>{e="success",t=n},n=>{e="error",t=n});return()=>{switch(e){case"pending":throw s;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function sr(r,e){const t=W.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[s,n]=C.useState(null);return C.useEffect(()=>{(async()=>{const i=t.get(r).then(o=>o.data);n(rr(i))})()},[t,r]),s}exports.cancelToken=W.cancelToken;exports.useAuth=W.useAuth;exports.useAxios=W.useAxios;exports.useNotifications=W.useNotifications;exports.useConfirm=Qe.useConfirm;exports.useGetApiData=Ae.useGetApiData;exports.useLocalStorageState=Ae.useLocalStorageState;exports.usePrompt=Ae.usePrompt;exports.useClickOutside=J.useClickOutside;exports.useClipboard=J.useClipboard;exports.useEmployeePhotoPath=J.useEmployeePhotoPath;exports.useFormControlType=J.useFormControlType;exports.useKeyPress=J.useKeyPress;exports.useSearchQuery=J.useSearchQuery;exports.useSearchQueryState=J.useSearchQueryState;exports.usePermissions=Ke.usePermissions;exports.useGetDataBound=sr;exports.useZodSchemaTypes=tr;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("./nivo-pie.es-CYja6R0y.cjs"),Qe=require("./useConfirm-SzzUX_WZ.cjs"),Ae=require("./useLocalStorageState-C2fAE5hY.cjs"),C=require("react");require("react-router-dom");require("@azure/msal-browser");require("@azure/msal-react");const Xe=require("./dateUtils-UEaQDw00.cjs");require("react-hook-form");const J=require("./useClipboard-KQiedKAp.cjs"),Ke=require("./usePermissions-CDkc5n4B.cjs");var x;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var 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"]),V=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}},c=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"]),Fe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class O extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){const d=i.path[u];u===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(i))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return n(this),s}static assert(e){if(!(e instanceof O))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}O.create=r=>new O(r);const K=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.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 c.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 c.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 c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let De=K;function et(r){De=r}function ke(){return De}const be=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const u=s.filter(d=>!!d).slice().reverse();for(const d of u)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},tt=[];function l(r,e){const t=ke(),s=be({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===K?void 0:K].filter(n=>!!n)});r.common.issues.push(s)}class S{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return y;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return S.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return y;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const y=Object.freeze({status:"aborted"}),Q=r=>({status:"dirty",value:r}),Z=r=>({status:"valid",value:r}),Re=r=>r.status==="aborted",Ie=r=>r.status==="dirty",ae=r=>r.status==="valid",ie=r=>typeof Promise<"u"&&r instanceof Promise;function we(r,e,t,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Ve(r,e,t,s,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));var se,ne;class M{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pe=(r,e)=>{if(ae(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 O(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var u,d;const{message:p}=r;return i.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(u=p??s)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(d=p??t)!==null&&d!==void 0?d:o.defaultError}},description:n}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ie(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Pe(n,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(ie(n)?n:Promise.resolve(n));return Pe(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new j({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return A.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return I.create(this,this._def)}promise(){return ee.create(this,this._def)}or(e){return ue.create([this,e],this._def)}and(e){return le.create(this,e,this._def)}transform(e){return new j({..._(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ye({..._(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Me({typeName:m.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new _e({..._(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ge.create(this,e)}readonly(){return ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rt=/^c[^\s-]{8,}$/i,st=/^[0-9a-z]+$/,nt=/^[0-9A-HJKMNP-TV-Z]{26}$/,at=/^[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,it=/^[a-z0-9_-]{21}$/i,ot=/^[-+]?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)?)??$/,ct=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ee;const ut=/^(?:(?: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])$/,lt=/^(([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})))$/,ft=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ze="((\\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])))",ht=new RegExp(`^${ze}$`);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 mt(r){return new RegExp(`^${Le(r)}$`)}function qe(r){let e=`${ze}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 pt(r,e){return!!((e==="v4"||!e)&&ut.test(r)||(e==="v6"||!e)&<.test(r))}class R 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:c.invalid_type,expected:f.string,received:a.parsedType}),y}const s=new S;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ct.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ee||(Ee=new RegExp(dt,"u")),Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")at.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")it.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")rt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")st.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?qe(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?ht.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?mt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?ot.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?pt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?ft.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...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}}R.create=r=>{var e;return new R({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};function yt(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class z 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:c.invalid_type,expected:f.number,received:a.parsedType}),y}let s;const n=new S;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?yt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_finite,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new z({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}z.create=r=>new z({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,..._(r)});class L 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:c.invalid_type,expected:f.bigint,received:a.parsedType}),y}let s;const n=new S;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new L({...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}}L.create=r=>{var e;return new L({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,..._(r)})};class oe extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),y}return Z(e.data)}}oe.create=r=>new oe({typeName:m.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:c.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),y}const s=new S;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):x.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new 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:m.ZodDate,..._(r)});class Te extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),y}return Z(e.data)}}Te.create=r=>new Te({typeName:m.ZodSymbol,..._(r)});class ce extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),y}return Z(e.data)}}ce.create=r=>new ce({typeName:m.ZodUndefined,..._(r)});class de extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),y}return Z(e.data)}}de.create=r=>new de({typeName:m.ZodNull,..._(r)});class F extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}F.create=r=>new F({typeName:m.ZodAny,..._(r)});class B extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}B.create=r=>new B({typeName:m.ZodUnknown,..._(r)});class D extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),y}}D.create=r=>new D({typeName:m.ZodNever,..._(r)});class Ce extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),y}return Z(e.data)}}Ce.create=r=>new Ce({typeName:m.ZodVoid,..._(r)});class I extends v{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return l(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),y;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(l(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(l(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(l(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new M(t,i,t.path,o)))).then(i=>S.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new M(t,i,t.path,o)));return S.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new I({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new I({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new I({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}I.create=(r,e)=>new I({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,..._(e)});function H(r){if(r instanceof k){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=A.create(H(s))}return new k({...r._def,shape:()=>e})}else return r instanceof I?new I({...r._def,type:H(r.element)}):r instanceof A?A.create(H(r.unwrap())):r instanceof U?U.create(H(r.unwrap())):r instanceof P?P.create(r.items.map(e=>H(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 d=this._getOrReturnCtx(e);return l(d,{code:c.invalid_type,expected:f.object,received:d.parsedType}),y}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof D&&this._def.unknownKeys==="strip"))for(const d in n.data)i.includes(d)||o.push(d);const u=[];for(const d of i){const p=a[d],N=n.data[d];u.push({key:{status:"valid",value:d},value:p._parse(new M(n,N,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof D){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of o)u.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")o.length>0&&(l(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of o){const N=n.data[p];u.push({key:{status:"valid",value:p},value:d._parse(new M(n,N,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of u){const N=await p.key,xe=await p.value;d.push({key:N,value:xe,alwaysSet:p.alwaysSet})}return d}).then(d=>S.mergeObjectSync(s,d)):S.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const u=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new k({...this._def,shape:()=>t})}deepPartial(){return H(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof A;)a=a._def.innerType;t[s]=a}}),new k({...this._def,shape:()=>t})}keyof(){return Ue(x.objectKeys(this.shape))}}k.create=(r,e)=>new k({shape:()=>r,unknownKeys:"strip",catchall:D.create(),typeName:m.ZodObject,..._(e)});k.strictCreate=(r,e)=>new k({shape:()=>r,unknownKeys:"strict",catchall:D.create(),typeName:m.ZodObject,..._(e)});k.lazycreate=(r,e)=>new k({shape:r,unknownKeys:"strip",catchall:D.create(),typeName:m.ZodObject,..._(e)});class ue extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new O(o.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:i}),y}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const u of s){const d={...t,common:{...t.common,issues:[]},parent:null},p=u._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new O(u));return l(t,{code:c.invalid_union,unionErrors:o}),y}}get options(){return this._def.options}}ue.create=(r,e)=>new ue({options:r,typeName:m.ZodUnion,..._(e)});const $=r=>r instanceof he?$(r.schema):r instanceof j?$(r.innerType()):r instanceof me?[r.value]:r instanceof q?r.options:r instanceof pe?x.objectValues(r.enum):r instanceof ye?$(r._def.innerType):r instanceof ce?[void 0]:r instanceof de?[null]:r instanceof A?[void 0,...$(r.unwrap())]:r instanceof U?[null,...$(r.unwrap())]:r instanceof Me||r instanceof ve?$(r.unwrap()):r instanceof _e?$(r._def.innerType):[];class Ne extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),y;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=$(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new Ne({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._(s)})}}function je(r,e){const t=V(r),s=V(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=x.objectKeys(e),a=x.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=je(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=je(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class le extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Re(a)||Re(i))return y;const o=je(a.value,i.value);return o.valid?((Ie(a)||Ie(i))&&t.dirty(),{status:t.value,value:o.data}):(l(s,{code:c.invalid_intersection_types}),y)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}le.create=(r,e,t)=>new le({left:r,right:e,typeName:m.ZodIntersection,..._(t)});class P extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return l(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),y;if(s.data.length<this._def.items.length)return l(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new M(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>S.mergeArray(t,i)):S.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new P({...this._def,rest:e})}}P.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new P({items:r,typeName:m.ZodTuple,rest:null,..._(e)})};class fe extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return l(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),y;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new M(s,o,s.path,o)),value:i._parse(new M(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new fe({keyType:e,valueType:t,typeName:m.ZodRecord,..._(s)}):new fe({keyType:R.create(),valueType:e,typeName:m.ZodRecord,..._(t)})}}class Se extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return l(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),y;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],d)=>({key:n._parse(new M(s,o,s.path,[d,"key"])),value:a._parse(new M(s,u,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const d=await u.key,p=await u.value;if(d.status==="aborted"||p.status==="aborted")return y;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const d=u.key,p=u.value;if(d.status==="aborted"||p.status==="aborted")return y;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}}}}Se.create=(r,e,t)=>new Se({valueType:e,keyType:r,typeName:m.ZodMap,..._(t)});class Y extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return l(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),y;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(l(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(l(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const d=new Set;for(const p of u){if(p.status==="aborted")return y;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}const o=[...s.data.values()].map((u,d)=>a._parse(new M(s,u,s.path,d)));return s.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:m.ZodSet,..._(e)});class X 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:c.invalid_type,expected:f.function,received:t.parsedType}),y;function s(o,u){return be({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ke(),K].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:u}})}function n(o,u){return be({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ke(),K].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:u}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ee){const o=this;return Z(async function(...u){const d=new O([]),p=await o._def.args.parseAsync(u,a).catch(te=>{throw d.addIssue(s(u,te)),d}),N=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(N,a).catch(te=>{throw d.addIssue(n(N,te)),d})})}else{const o=this;return Z(function(...u){const d=o._def.args.safeParse(u,a);if(!d.success)throw new O([s(u,d.error)]);const p=Reflect.apply(i,this,d.data),N=o._def.returns.safeParse(p,a);if(!N.success)throw new O([n(p,N.error)]);return N.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new X({...this._def,args:P.create(e).rest(B.create())})}returns(e){return new X({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new X({args:e||P.create([]).rest(B.create()),returns:t||B.create(),typeName:m.ZodFunction,..._(s)})}}class he 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})}}he.create=(r,e)=>new he({getter:r,typeName:m.ZodLazy,..._(e)});class me extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}me.create=(r,e)=>new me({value:r,typeName:m.ZodLiteral,..._(e)});function Ue(r,e){return new q({values:r,typeName:m.ZodEnum,..._(e)})}class q extends v{constructor(){super(...arguments),se.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{expected:x.joinValues(s),received:t.parsedType,code:c.invalid_type}),y}if(we(this,se)||Ve(this,se,new Set(this._def.values)),!we(this,se).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:s}),y}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return q.create(e,{...this._def,...t})}exclude(e,t=this._def){return q.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}se=new WeakMap;q.create=Ue;class pe extends v{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=x.objectValues(t);return l(s,{expected:x.joinValues(n),received:s.parsedType,code:c.invalid_type}),y}if(we(this,ne)||Ve(this,ne,new Set(x.getValidEnumValues(this._def.values))),!we(this,ne).has(e.data)){const n=x.objectValues(t);return l(s,{received:s.data,code:c.invalid_enum_value,options:n}),y}return Z(e.data)}get enum(){return this._def.values}}ne=new WeakMap;pe.create=(r,e)=>new pe({values:r,typeName:m.ZodNativeEnum,..._(e)});class ee 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:c.invalid_type,expected:f.promise,received:t.parsedType}),y;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return Z(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ee.create=(r,e)=>new ee({type:r,typeName:m.ZodPromise,..._(e)});class j extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?Q(u.value):u});{if(t.value==="aborted")return y;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?y:o.status==="dirty"||t.value==="dirty"?Q(o.value):o}}if(n.type==="refinement"){const i=o=>{const u=n.refinement(o,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ae(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>ae(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(n)}}j.create=(r,e,t)=>new j({schema:r,typeName:m.ZodEffects,effect:e,..._(t)});j.createWithPreprocess=(r,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,..._(t)});class A extends v{_parse(e){return this._getType(e)===f.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}A.create=(r,e)=>new A({innerType:r,typeName:m.ZodOptional,..._(e)});class U extends v{_parse(e){return this._getType(e)===f.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(r,e)=>new U({innerType:r,typeName:m.ZodNullable,..._(e)});class ye extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(r,e)=>new ye({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class _e extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ie(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new O(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new O(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}_e.create=(r,e)=>new _e({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Ze extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),y}return{status:"valid",value:e.data}}}Ze.create=r=>new Ze({typeName:m.ZodNaN,..._(r)});const _t=Symbol("zod_brand");class Me extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ge extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),Q(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?y:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ge({in:e,out:t,typeName:m.ZodPipeline})}}class ve extends v{_parse(e){const t=this._def.innerType._parse(e),s=n=>(ae(n)&&(n.value=Object.freeze(n.value)),n);return ie(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}ve.create=(r,e)=>new ve({innerType:r,typeName:m.ZodReadonly,..._(e)});function Be(r,e={},t){return r?F.create().superRefine((s,n)=>{var a,i;if(!r(s)){const o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,d=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...d,fatal:u})}}):F.create()}const vt={object:k.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const gt=(r,e={message:`Input not instance of ${r.name}`})=>Be(t=>t instanceof r,e),We=R.create,Ge=z.create,xt=Ze.create,kt=L.create,Ye=oe.create,bt=G.create,wt=Te.create,Tt=ce.create,Ct=de.create,St=F.create,Zt=B.create,Nt=D.create,Et=Ce.create,Ot=I.create,Rt=k.create,It=k.strictCreate,jt=ue.create,At=Ne.create,Mt=le.create,Pt=P.create,$t=fe.create,Dt=Se.create,Vt=Y.create,zt=X.create,Lt=he.create,qt=me.create,Ut=q.create,Bt=pe.create,Wt=ee.create,$e=j.create,Gt=A.create,Yt=U.create,Jt=j.createWithPreprocess,Ht=ge.create,Qt=()=>We().optional(),Xt=()=>Ge().optional(),Kt=()=>Ye().optional(),Ft={string:r=>R.create({...r,coerce:!0}),number:r=>z.create({...r,coerce:!0}),boolean:r=>oe.create({...r,coerce:!0}),bigint:r=>L.create({...r,coerce:!0}),date:r=>G.create({...r,coerce:!0})},er=y;var E=Object.freeze({__proto__:null,defaultErrorMap:K,setErrorMap:et,getErrorMap:ke,makeIssue:be,EMPTY_PATH:tt,addIssueToContext:l,ParseStatus:S,INVALID:y,DIRTY:Q,OK:Z,isAborted:Re,isDirty:Ie,isValid:ae,isAsync:ie,get util(){return x},get objectUtil(){return Oe},ZodParsedType:f,getParsedType:V,ZodType:v,datetimeRegex:qe,ZodString:R,ZodNumber:z,ZodBigInt:L,ZodBoolean:oe,ZodDate:G,ZodSymbol:Te,ZodUndefined:ce,ZodNull:de,ZodAny:F,ZodUnknown:B,ZodNever:D,ZodVoid:Ce,ZodArray:I,ZodObject:k,ZodUnion:ue,ZodDiscriminatedUnion:Ne,ZodIntersection:le,ZodTuple:P,ZodRecord:fe,ZodMap:Se,ZodSet:Y,ZodFunction:X,ZodLazy:he,ZodLiteral:me,ZodEnum:q,ZodNativeEnum:pe,ZodPromise:ee,ZodEffects:j,ZodTransformer:j,ZodOptional:A,ZodNullable:U,ZodDefault:ye,ZodCatch:_e,ZodNaN:Ze,BRAND:_t,ZodBranded:Me,ZodPipeline:ge,ZodReadonly:ve,custom:Be,Schema:v,ZodSchema:v,late:vt,get ZodFirstPartyTypeKind(){return m},coerce:Ft,any:St,array:Ot,bigint:kt,boolean:Ye,date:bt,discriminatedUnion:At,effect:$e,enum:Ut,function:zt,instanceof:gt,intersection:Mt,lazy:Lt,literal:qt,map:Dt,nan:xt,nativeEnum:Bt,never:Nt,null:Ct,nullable:Yt,number:Ge,object:Rt,oboolean:Kt,onumber:Xt,optional:Gt,ostring:Qt,pipeline:Ht,preprocess:Jt,promise:Wt,record:$t,set:Vt,strictObject:It,string:We,symbol:wt,transformer:$e,tuple:Pt,undefined:Tt,union:jt,unknown:Zt,void:Et,NEVER:er,ZodIssueCode:c,quotelessJson:Fe,ZodError:O});const tr=()=>{const{texts:{formValidation:r}}=C.useContext(W.LuminusComponentsContext),e=C.useCallback(g=>(g!=null&&g.useCoerce?E.coerce:E).string({invalid_type_error:r.required,required_error:r.required}).transform(w=>w??null),[r.required]),t=C.useCallback(g=>e(g).nullable().optional().transform(b=>b??null),[e]),s=C.useCallback(g=>{const b=(g==null?void 0:g.min)??Number.MIN_SAFE_INTEGER,w=(g==null?void 0:g.max)??Number.MAX_SAFE_INTEGER,re=(g!=null&&g.useCoerce?E.coerce:E).number({invalid_type_error:r.required,required_error:r.required}).min(b,r.lessThanMin(b)).max(w,r.moreThanMax(w));return re.transform(T=>T??null),re},[r]),n=C.useCallback(g=>s(g).nullable().optional().transform(b=>b??null),[s]),a=C.useCallback(g=>(g!=null&&g.useCoerce?E.coerce:E).boolean({invalid_type_error:r.required,required_error:r.required}).transform(b=>b??null),[r.required]),i=C.useCallback(g=>(g!=null&&g.useCoerce?E.coerce:E).string({invalid_type_error:r.required,required_error:r.required}).refine(Xe.isISODate,{message:r.invalidDate}).transform(w=>w??null),[r.invalidDate,r.required]),o=C.useCallback(g=>i(g).nullable().transform(b=>b??null),[i]),u=C.useCallback((g,b)=>E.enum(g,{invalid_type_error:r.required,required_error:r.required}).transform(re=>re??null),[r.required]),d=C.useCallback((g,b)=>u(g,b).nullable().transform(w=>w??null),[u]),p=C.useCallback(g=>E.object({id:n({useCoerce:!0})}).nullable().transform(w=>w??null),[n]),N=C.useCallback(g=>E.object({id:s()}).transform(w=>w??null),[s]),xe=C.useCallback(g=>E.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),[t]),te=C.useCallback(g=>E.object({id:e()}).transform(w=>w??null),[e]),Je=C.useCallback(({required:g,multiple:b,maxFileSize:w})=>E.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(He=>He.size<=w),`Maximum file size is ${W.formatFileSize(w)}.`).transform(T=>(b?T:T==null?void 0:T[0])??null),[]);return{zString:t,zStringRequired:e,zNumber:n,zNumberRequired:s,zBool:a,zDate:o,zDateRequired:i,zEnum:d,zEnumRequired:u,zObjectIdInt:p,zObjectIdIntRequired:N,zObjectIdStr:xe,zObjectIdStrRequired:te,zFile:Je}},rr=r=>{let e="pending",t;const s=r.then(n=>{e="success",t=n},n=>{e="error",t=n});return()=>{switch(e){case"pending":throw s;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function sr(r,e){const t=W.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[s,n]=C.useState(null);return C.useEffect(()=>{(async()=>{const i=t.get(r).then(o=>o.data);n(rr(i))})()},[t,r]),s}exports.cancelToken=W.cancelToken;exports.useAuth=W.useAuth;exports.useAxios=W.useAxios;exports.useNotifications=W.useNotifications;exports.useConfirm=Qe.useConfirm;exports.useGetApiData=Ae.useGetApiData;exports.useLocalStorageState=Ae.useLocalStorageState;exports.usePrompt=Ae.usePrompt;exports.useClickOutside=J.useClickOutside;exports.useClipboard=J.useClipboard;exports.useEmployeePhotoPath=J.useEmployeePhotoPath;exports.useFormControlType=J.useFormControlType;exports.useKeyPress=J.useKeyPress;exports.useSearchQuery=J.useSearchQuery;exports.useSearchQueryState=J.useSearchQueryState;exports.usePermissions=Ke.usePermissions;exports.useGetDataBound=sr;exports.useZodSchemaTypes=tr;
|
package/dist/hooks.es.js
CHANGED
|
@@ -9,7 +9,7 @@ import "@azure/msal-react";
|
|
|
9
9
|
import { i as Fe } from "./dateUtils-DBObp1Kn.js";
|
|
10
10
|
import "react-hook-form";
|
|
11
11
|
import { b as Tr, u as Zr, f as Sr, c as Cr, a as Nr, d as Er, e as Or } from "./useClipboard-Ci3XItTi.js";
|
|
12
|
-
import { u as Ir } from "./usePermissions-
|
|
12
|
+
import { u as Ir } from "./usePermissions-D1kTfy1F.js";
|
|
13
13
|
var x;
|
|
14
14
|
(function(r) {
|
|
15
15
|
r.assertEqual = (n) => n;
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-pie.es-CYja6R0y.cjs"),j=require("react"),h=require("react-router-dom");require("react-hook-form");require("@azure/msal-browser");require("@azure/msal-react");const M=require("./usePermissions-CDkc5n4B.cjs"),B=require("./SimpleTooltip-Duct0nes.cjs"),k="_side-menu-item_6vbwa_1",y="_disabled_6vbwa_5",C="_nav-button_6vbwa_9",P="_child_6vbwa_17",S="_text_6vbwa_21",f="_icon_6vbwa_28",g="_collapse-icon_6vbwa_34",I="_collapsed_6vbwa_44",T="_expanded_6vbwa_51",$="_children-container_6vbwa_57",q="_visible_6vbwa_65",H="_children_6vbwa_57",r={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:k,disabled:y,"nav-button":"_nav-button_6vbwa_9",navButton:C,child:P,text:S,icon:f,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:g,collapsed:I,expanded:T,"children-container":"_children-container_6vbwa_57",childrenContainer:$,visible:q,children:H},L=({item:s,menuExpanded:t,children:i})=>s.tooltip&&!t?e.jsxRuntimeExports.jsx(B.SimpleTooltip,{text:s.tooltip,placement:"right",children:i}):i,R=({item:s,menuExpanded:t,collapsed:i,onCollapse:o,currentPath:l})=>{var v,b,p,a;const[c,u]=j.useState(!1),[x]=l.split("?"),d=s.linkTo===x||((v=s.children)==null?void 0:v.some(n=>n.linkTo===x));return e.jsxRuntimeExports.jsxs("li",{className:e.classNames("luminus-side-menu-item",r.sideMenuItem,{[r.expanded]:t},{active:c||d},{open:i&&s.children},{[r.disabled]:s.disabled||s.notPermitted||((b=s.children)==null?void 0:b.every(n=>n.notPermitted||n.disabled))},{disabled:s.disabled||s.notPermitted||((p=s.children)==null?void 0:p.every(n=>n.notPermitted||n.disabled))}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[e.jsxRuntimeExports.jsx(L,{item:s,menuExpanded:t,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",r.navButton),onClick:()=>o(),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",r.icon),children:s.icon}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",r.text,"text-nowrap"),children:s.title}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",r.collapseIcon,{[r.collapsed]:i}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(h.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",r.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",r.icon),children:s.icon}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",r.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",r.childrenContainer,{[r.visible]:i}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",r.children),children:(a=s.children)==null?void 0:a.map(n=>e.jsxRuntimeExports.jsx(h.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link child rounded",r.navButton,r.child,{[r.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",r.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},F="_side-menu_n1hvm_1",A="_sidebar-header_n1hvm_13",D="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",U="_divider_n1hvm_26",_={"side-menu":"_side-menu_n1hvm_1",sideMenu:F,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:A,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:D,expand:K,divider:U},z=({headerItem:s,mainItems:t,secondaryItems:i,expanded:o,setExpanded:l,currentPath:c})=>{const[u,x]=j.useState(-1),{checkUserHasPermissions:d}=M.usePermissions(),v=j.useMemo(()=>t.map(a=>{var n;return{...a,notPermitted:!d(a.permissions??[],"any"),children:(n=a.children)==null?void 0:n.map(m=>({...m,notPermitted:!d(m.permissions??[],"any"),disabled:a.disabled||m.disabled}))}}),[t,d]),b=j.useMemo(()=>i.map(a=>{var n;return{...a,notPermitted:!d(a.permissions??[],"any"),children:(n=a.children)==null?void 0:n.map(m=>({...m,notPermitted:!d(m.permissions??[],"any")}))}}),[i,d]),p=a=>{x(a===u?-1:a)};return j.useEffect(()=>{o||x(-1)},[o]),e.jsxRuntimeExports.jsxs("section",{className:e.classNames("luminus-side-menu shadow",_.sideMenu,{[_.expand]:o},{expand:o}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",_.sidebarHeader),children:s}),e.jsxRuntimeExports.jsxs("ul",{className:_.sideMenuContent,children:[v.map((a,n)=>e.jsxRuntimeExports.jsx(R,{item:a,menuExpanded:o,collapsed:n===u,onCollapse:()=>p(n),currentPath:c},a.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",_.divider)}),b.map((a,n)=>e.jsxRuntimeExports.jsx(R,{item:a,menuExpanded:o,collapsed:n===u,onCollapse:()=>p(n),currentPath:c},a.title))]})]})},G="_top-bar_1lk80_1",J="_top-bar-brand_1lk80_14",E={"top-bar":"_top-bar_1lk80_1",topBar:G,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:J},O=({appName:s,leftOffset:t,centerContent:i,rightContent:o})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow",E.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[e.jsxRuntimeExports.jsx(h.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",E.topBarBrand),children:s}),i&&e.jsxRuntimeExports.jsx("div",{children:i}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:o??null})]}),Q="_side-content-bar_17kwd_1",V={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:Q},N=({width:s,children:t})=>e.jsxRuntimeExports.jsx("section",{className:e.classNames("luminus-side-content-bar shadow",V.sideContentBar),style:{width:`${s}px`},children:t}),w=({title:s})=>e.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof s=="string"?e.jsxRuntimeExports.jsx(e.Typography,{variant:"h3",children:s}):s}),X=({title:s,children:t,sideContent:i,sideContentWidth:o=250,noPadding:l,className:c})=>e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",l?"p-0":"p-3",c),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${o}px`:void 0},children:[s?e.jsxRuntimeExports.jsx(w,{title:s}):null,t]}),i&&e.jsxRuntimeExports.jsx(N,{width:o,children:i})]}),Y="_full-screen-container_1rm4r_1",Z={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:Y},W=({title:s,children:t,sideContent:i,sideContentWidth:o=250,noPadding:l,className:c})=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:e.classNames("overflow-hidden luminus-full-screen-container",l?"p-0":"p-3",c,Z.fullScreenContainer),style:{width:i?`calc(100% - ${o}px)`:"100%"},children:[s?e.jsxRuntimeExports.jsx(w,{title:s}):null,t]}),i&&e.jsxRuntimeExports.jsx(N,{width:o,children:i})]});exports.FullScreenContainer=W;exports.MainContainer=X;exports.SideContentBar=N;exports.SideMenu=z;exports.TopBar=O;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as e, c as
|
|
1
|
+
import { j as e, c as o, Z as y, S as C } from "./nivo-pie.es-DbylxdLa.js";
|
|
2
2
|
import { useState as M, useMemo as w, useEffect as P } from "react";
|
|
3
3
|
import { Link as j } from "react-router-dom";
|
|
4
4
|
import "react-hook-form";
|
|
5
5
|
import "@azure/msal-browser";
|
|
6
6
|
import "@azure/msal-react";
|
|
7
|
-
import { u as
|
|
8
|
-
import { S as
|
|
9
|
-
const S = "_side-menu-item_6vbwa_1", T = "_disabled_6vbwa_5", $ = "_nav-button_6vbwa_9", H = "_child_6vbwa_17", E = "_text_6vbwa_21", F = "_icon_6vbwa_28", L = "_collapse-icon_6vbwa_34", R = "_collapsed_6vbwa_44", A = "_expanded_6vbwa_51", K = "_children-container_6vbwa_57", U = "_visible_6vbwa_65", Z = "_children_6vbwa_57",
|
|
7
|
+
import { u as I } from "./usePermissions-D1kTfy1F.js";
|
|
8
|
+
import { S as g } from "./SimpleTooltip-DIbveCyg.js";
|
|
9
|
+
const S = "_side-menu-item_6vbwa_1", T = "_disabled_6vbwa_5", $ = "_nav-button_6vbwa_9", H = "_child_6vbwa_17", E = "_text_6vbwa_21", F = "_icon_6vbwa_28", L = "_collapse-icon_6vbwa_34", R = "_collapsed_6vbwa_44", A = "_expanded_6vbwa_51", K = "_children-container_6vbwa_57", U = "_visible_6vbwa_65", Z = "_children_6vbwa_57", r = {
|
|
10
10
|
"side-menu-item": "_side-menu-item_6vbwa_1",
|
|
11
11
|
sideMenuItem: S,
|
|
12
12
|
disabled: T,
|
|
@@ -23,25 +23,29 @@ const S = "_side-menu-item_6vbwa_1", T = "_disabled_6vbwa_5", $ = "_nav-button_6
|
|
|
23
23
|
childrenContainer: K,
|
|
24
24
|
visible: U,
|
|
25
25
|
children: Z
|
|
26
|
-
}, q = ({ item: n, menuExpanded:
|
|
27
|
-
var b, x;
|
|
28
|
-
const [
|
|
29
|
-
return /* @__PURE__ */ e.jsxs("li", { className:
|
|
30
|
-
[
|
|
31
|
-
}, { active:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
40
|
-
|
|
26
|
+
}, q = ({ item: n, menuExpanded: a, children: t }) => n.tooltip && !a ? /* @__PURE__ */ e.jsx(g, { text: n.tooltip, placement: "right", children: t }) : t, N = ({ item: n, menuExpanded: a, collapsed: t, onCollapse: d, currentPath: l }) => {
|
|
27
|
+
var b, x, v, i;
|
|
28
|
+
const [c, u] = M(!1), [m] = l.split("?"), _ = n.linkTo === m || ((b = n.children) == null ? void 0 : b.some((s) => s.linkTo === m));
|
|
29
|
+
return /* @__PURE__ */ e.jsxs("li", { className: o("luminus-side-menu-item", r.sideMenuItem, {
|
|
30
|
+
[r.expanded]: a
|
|
31
|
+
}, { active: c || _ }, { open: t && n.children }, {
|
|
32
|
+
[r.disabled]: n.disabled || n.notPermitted || ((x = n.children) == null ? void 0 : x.every((s) => s.notPermitted || s.disabled))
|
|
33
|
+
}, {
|
|
34
|
+
disabled: n.disabled || n.notPermitted || ((v = n.children) == null ? void 0 : v.every((s) => s.notPermitted || s.disabled))
|
|
35
|
+
}), onMouseEnter: () => u(!0), onMouseLeave: () => u(!1), children: [
|
|
36
|
+
/* @__PURE__ */ e.jsx(q, { item: n, menuExpanded: a, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: o("nav-link", r.navButton), onClick: () => d(), children: [
|
|
37
|
+
/* @__PURE__ */ e.jsx("div", { className: o("icon", r.icon), children: n.icon }),
|
|
38
|
+
a && /* @__PURE__ */ e.jsx("div", { className: o("text", r.text, "text-nowrap"), children: n.title }),
|
|
39
|
+
a && /* @__PURE__ */ e.jsx("div", { className: o("collapse-icon", r.collapseIcon, {
|
|
40
|
+
[r.collapsed]: t
|
|
41
|
+
}), children: /* @__PURE__ */ e.jsx(y, {}) })
|
|
42
|
+
] }) }) : /* @__PURE__ */ e.jsxs(j, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: o("nav-link", r.navButton), children: [
|
|
43
|
+
/* @__PURE__ */ e.jsx("div", { className: o("icon", r.icon), children: n.icon }),
|
|
44
|
+
a && /* @__PURE__ */ e.jsx("div", { className: o("text", r.text, "text-nowrap"), children: n.title })
|
|
41
45
|
] }) }),
|
|
42
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
43
|
-
[
|
|
44
|
-
}), children: /* @__PURE__ */ e.jsx("div", { className:
|
|
46
|
+
/* @__PURE__ */ e.jsx("div", { className: o("children-container", r.childrenContainer, {
|
|
47
|
+
[r.visible]: t
|
|
48
|
+
}), children: /* @__PURE__ */ e.jsx("div", { className: o("shadow rounded children", r.children), children: (i = n.children) == null ? void 0 : i.map((s) => /* @__PURE__ */ e.jsx(j, { to: s.disabled || s.notPermitted ? "/" : s.linkTo ?? "/", className: o("nav-link child rounded", r.navButton, r.child, { [r.disabled]: s.disabled || s.notPermitted }, { disabled: s.disabled || s.notPermitted }), children: /* @__PURE__ */ e.jsx("div", { className: o("text", r.text, "text-nowrap"), children: s.title }) }, s.linkTo)) }) })
|
|
45
49
|
] });
|
|
46
50
|
}, z = "_side-menu_n1hvm_1", D = "_sidebar-header_n1hvm_13", G = "_side-menu-content_n1hvm_18", J = "_expand_n1hvm_22", Q = "_divider_n1hvm_26", h = {
|
|
47
51
|
"side-menu": "_side-menu_n1hvm_1",
|
|
@@ -52,41 +56,41 @@ const S = "_side-menu-item_6vbwa_1", T = "_disabled_6vbwa_5", $ = "_nav-button_6
|
|
|
52
56
|
sideMenuContent: G,
|
|
53
57
|
expand: J,
|
|
54
58
|
divider: Q
|
|
55
|
-
},
|
|
56
|
-
const [
|
|
57
|
-
var
|
|
59
|
+
}, le = ({ headerItem: n, mainItems: a, secondaryItems: t, expanded: d, setExpanded: l, currentPath: c }) => {
|
|
60
|
+
const [u, m] = M(-1), { checkUserHasPermissions: _ } = I(), b = w(() => a.map((i) => {
|
|
61
|
+
var s;
|
|
58
62
|
return {
|
|
59
|
-
...
|
|
60
|
-
notPermitted: !
|
|
61
|
-
children: (
|
|
62
|
-
...
|
|
63
|
-
notPermitted: !
|
|
64
|
-
disabled:
|
|
63
|
+
...i,
|
|
64
|
+
notPermitted: !_(i.permissions ?? [], "any"),
|
|
65
|
+
children: (s = i.children) == null ? void 0 : s.map((p) => ({
|
|
66
|
+
...p,
|
|
67
|
+
notPermitted: !_(p.permissions ?? [], "any"),
|
|
68
|
+
disabled: i.disabled || p.disabled
|
|
65
69
|
}))
|
|
66
70
|
};
|
|
67
|
-
}), [
|
|
68
|
-
var
|
|
71
|
+
}), [a, _]), x = w(() => t.map((i) => {
|
|
72
|
+
var s;
|
|
69
73
|
return {
|
|
70
|
-
...
|
|
71
|
-
notPermitted: !
|
|
72
|
-
children: (
|
|
73
|
-
...
|
|
74
|
-
notPermitted: !
|
|
74
|
+
...i,
|
|
75
|
+
notPermitted: !_(i.permissions ?? [], "any"),
|
|
76
|
+
children: (s = i.children) == null ? void 0 : s.map((p) => ({
|
|
77
|
+
...p,
|
|
78
|
+
notPermitted: !_(p.permissions ?? [], "any")
|
|
75
79
|
}))
|
|
76
80
|
};
|
|
77
|
-
}), [
|
|
78
|
-
|
|
81
|
+
}), [t, _]), v = (i) => {
|
|
82
|
+
m(i === u ? -1 : i);
|
|
79
83
|
};
|
|
80
84
|
return P(() => {
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
[h.expand]:
|
|
84
|
-
}, { expand:
|
|
85
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
85
|
+
d || m(-1);
|
|
86
|
+
}, [d]), /* @__PURE__ */ e.jsxs("section", { className: o("luminus-side-menu shadow", h.sideMenu, {
|
|
87
|
+
[h.expand]: d
|
|
88
|
+
}, { expand: d }), onMouseEnter: () => l(!0), onMouseLeave: () => l(!1), children: [
|
|
89
|
+
/* @__PURE__ */ e.jsx("div", { className: o("sidebar-header", h.sidebarHeader), children: n }),
|
|
86
90
|
/* @__PURE__ */ e.jsxs("ul", { className: h.sideMenuContent, children: [
|
|
87
|
-
b.map((
|
|
88
|
-
/* @__PURE__ */ e.jsx("hr", { className:
|
|
89
|
-
x.map((
|
|
91
|
+
b.map((i, s) => /* @__PURE__ */ e.jsx(N, { item: i, menuExpanded: d, collapsed: s === u, onCollapse: () => v(s), currentPath: c }, i.title)),
|
|
92
|
+
/* @__PURE__ */ e.jsx("hr", { className: o("divider", h.divider) }),
|
|
93
|
+
x.map((i, s) => /* @__PURE__ */ e.jsx(N, { item: i, menuExpanded: d, collapsed: s === u, onCollapse: () => v(s), currentPath: c }, i.title))
|
|
90
94
|
] })
|
|
91
95
|
] });
|
|
92
96
|
}, V = "_top-bar_1lk80_1", X = "_top-bar-brand_1lk80_14", B = {
|
|
@@ -94,38 +98,38 @@ const S = "_side-menu-item_6vbwa_1", T = "_disabled_6vbwa_5", $ = "_nav-button_6
|
|
|
94
98
|
topBar: V,
|
|
95
99
|
"top-bar-brand": "_top-bar-brand_1lk80_14",
|
|
96
100
|
topBarBrand: X
|
|
97
|
-
}, ce = ({ appName: n, leftOffset:
|
|
98
|
-
width:
|
|
99
|
-
left:
|
|
101
|
+
}, ce = ({ appName: n, leftOffset: a, centerContent: t, rightContent: d }) => /* @__PURE__ */ e.jsxs("nav", { className: o("luminus-top-bar shadow", B.topBar), style: {
|
|
102
|
+
width: a ? `calc(100% - ${a}px)` : void 0,
|
|
103
|
+
left: a ? `${a}px` : void 0
|
|
100
104
|
}, children: [
|
|
101
|
-
/* @__PURE__ */ e.jsx(j, { to: "/", className:
|
|
102
|
-
|
|
103
|
-
/* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center gap-2", children:
|
|
105
|
+
/* @__PURE__ */ e.jsx(j, { to: "/", className: o("luminus-top-bar-brand", B.topBarBrand), children: n }),
|
|
106
|
+
t && /* @__PURE__ */ e.jsx("div", { children: t }),
|
|
107
|
+
/* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center gap-2", children: d ?? null })
|
|
104
108
|
] }), Y = "_side-content-bar_17kwd_1", O = {
|
|
105
109
|
"side-content-bar": "_side-content-bar_17kwd_1",
|
|
106
110
|
sideContentBar: Y
|
|
107
|
-
}, f = ({ width: n, children:
|
|
111
|
+
}, f = ({ width: n, children: a }) => /* @__PURE__ */ e.jsx("section", { className: o("luminus-side-content-bar shadow", O.sideContentBar), style: {
|
|
108
112
|
width: `${n}px`
|
|
109
|
-
}, children:
|
|
110
|
-
/* @__PURE__ */ e.jsxs("div", { style: { paddingRight:
|
|
113
|
+
}, children: a }), k = ({ title: n }) => /* @__PURE__ */ e.jsx("div", { className: "mb-3", children: typeof n == "string" ? /* @__PURE__ */ e.jsx(C, { variant: "h3", children: n }) : n }), _e = ({ title: n, children: a, sideContent: t, sideContentWidth: d = 250, noPadding: l, className: c }) => /* @__PURE__ */ e.jsxs("div", { className: o("container-fluid", l ? "p-0" : "p-3", c), children: [
|
|
114
|
+
/* @__PURE__ */ e.jsxs("div", { style: { paddingRight: t ? `${d}px` : void 0 }, children: [
|
|
111
115
|
n ? /* @__PURE__ */ e.jsx(k, { title: n }) : null,
|
|
112
|
-
|
|
116
|
+
a
|
|
113
117
|
] }),
|
|
114
|
-
|
|
118
|
+
t && /* @__PURE__ */ e.jsx(f, { width: d, children: t })
|
|
115
119
|
] }), W = "_full-screen-container_1rm4r_1", ee = {
|
|
116
120
|
"full-screen-container": "_full-screen-container_1rm4r_1",
|
|
117
121
|
fullScreenContainer: W
|
|
118
|
-
}, ue = ({ title: n, children:
|
|
119
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
122
|
+
}, ue = ({ title: n, children: a, sideContent: t, sideContentWidth: d = 250, noPadding: l, className: c }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
123
|
+
/* @__PURE__ */ e.jsxs("div", { className: o("overflow-hidden luminus-full-screen-container", l ? "p-0" : "p-3", c, ee.fullScreenContainer), style: { width: t ? `calc(100% - ${d}px)` : "100%" }, children: [
|
|
120
124
|
n ? /* @__PURE__ */ e.jsx(k, { title: n }) : null,
|
|
121
|
-
|
|
125
|
+
a
|
|
122
126
|
] }),
|
|
123
|
-
|
|
127
|
+
t && /* @__PURE__ */ e.jsx(f, { width: d, children: t })
|
|
124
128
|
] });
|
|
125
129
|
export {
|
|
126
130
|
ue as FullScreenContainer,
|
|
127
131
|
_e as MainContainer,
|
|
128
132
|
f as SideContentBar,
|
|
129
|
-
|
|
133
|
+
le as SideMenu,
|
|
130
134
|
ce as TopBar
|
|
131
135
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./nivo-pie.es-CYja6R0y.cjs"),n=require("react");require("react-router-dom");require("@azure/msal-browser");require("@azure/msal-react");require("react-hook-form");const c=()=>{const{user:e}=n.useContext(u.UserContext);return{checkUserHasPermissions:n.useCallback((r,t="all")=>r.length===0?!0:t==="any"?r.some(i=>{var s;return(s=e==null?void 0:e.permissions)==null?void 0:s.includes(i)}):r.every(i=>{var s;return(s=e==null?void 0:e.permissions)==null?void 0:s.includes(i)}),[e])}};exports.usePermissions=c;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ac as i } from "./nivo-pie.es-DbylxdLa.js";
|
|
2
|
+
import { useContext as n, useCallback as m } from "react";
|
|
3
|
+
import "react-router-dom";
|
|
4
|
+
import "@azure/msal-browser";
|
|
5
|
+
import "@azure/msal-react";
|
|
6
|
+
import "react-hook-form";
|
|
7
|
+
const k = () => {
|
|
8
|
+
const { user: e } = n(i);
|
|
9
|
+
return { checkUserHasPermissions: m((s, o = "all") => s.length === 0 ? !0 : o === "any" ? s.some((t) => {
|
|
10
|
+
var r;
|
|
11
|
+
return (r = e == null ? void 0 : e.permissions) == null ? void 0 : r.includes(t);
|
|
12
|
+
}) : s.every((t) => {
|
|
13
|
+
var r;
|
|
14
|
+
return (r = e == null ? void 0 : e.permissions) == null ? void 0 : r.includes(t);
|
|
15
|
+
}), [e]) };
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
k as u
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("react"),t=require("./nivo-pie.es-CYja6R0y.cjs");require("react-router-dom");require("@azure/msal-browser");require("@azure/msal-react");require("react-hook-form");const c=()=>{const{user:e}=r.useContext(t.UserContext);return{checkUserHasPermissions:r.useCallback(i=>i.every(n=>{var s;return(s=e==null?void 0:e.permissions)==null?void 0:s.includes(n)}),[e])}};exports.usePermissions=c;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useContext as t, useCallback as i } from "react";
|
|
2
|
-
import { ac as m } from "./nivo-pie.es-DbylxdLa.js";
|
|
3
|
-
import "react-router-dom";
|
|
4
|
-
import "@azure/msal-browser";
|
|
5
|
-
import "@azure/msal-react";
|
|
6
|
-
import "react-hook-form";
|
|
7
|
-
const x = () => {
|
|
8
|
-
const { user: s } = t(m);
|
|
9
|
-
return { checkUserHasPermissions: i((e) => e.every((o) => {
|
|
10
|
-
var r;
|
|
11
|
-
return (r = s == null ? void 0 : s.permissions) == null ? void 0 : r.includes(o);
|
|
12
|
-
}), [s]) };
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
x as u
|
|
16
|
-
};
|