UNPKG

dgz-ui-shared

Version:

Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library

7 lines (4 loc) 78.5 kB
"use strict";const I=require("./jsx-runtime-DUiatUiq.cjs"),p=require("react"),yt=require("./useTranslation-CZf20ucv.cjs"),N=require("./index-DqTIeHVj-C_gsDkBV.cjs"),B=require("./index-BTN0oPfn-BJQJPuOc.cjs"),re=require("./utils-D0f6bOsw-BmDOeWKv.cjs"),vt=require("./check-DE-1lGDl-C_ZPlJ0c.cjs"),Qe=require("./MyInput-3qarivly.cjs"),G=require("./index.esm-CpcLzfLZ.cjs");function es(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const $=es(p);var _t="AlertDialog",[ts,Ar]=N.j(_t,[B.De]),Y=B.De(),xt=t=>{const{__scopeAlertDialog:e,...s}=t,r=Y(e);return N.ae.jsx(B.ve,{...r,...s,modal:!0})};xt.displayName=_t;var ss="AlertDialogTrigger",bt=$.forwardRef((t,e)=>{const{__scopeAlertDialog:s,...r}=t,a=Y(s);return N.ae.jsx(B.xe,{...a,...r,ref:e})});bt.displayName=ss;var rs="AlertDialogPortal",kt=t=>{const{__scopeAlertDialog:e,...s}=t,r=Y(e);return N.ae.jsx(B.Ce,{...r,...s})};kt.displayName=rs;var as="AlertDialogOverlay",wt=$.forwardRef((t,e)=>{const{__scopeAlertDialog:s,...r}=t,a=Y(s);return N.ae.jsx(B.Re,{...a,...r,ref:e})});wt.displayName=as;var ce="AlertDialogContent",[ns,is]=ts(ce),os=N._("AlertDialogContent"),Tt=$.forwardRef((t,e)=>{const{__scopeAlertDialog:s,children:r,...a}=t,n=Y(s),i=$.useRef(null),o=N.x(e,i),l=$.useRef(null);return N.ae.jsx(B.me,{contentName:ce,titleName:Et,docsSlug:"alert-dialog",children:N.ae.jsx(ns,{scope:s,cancelRef:l,children:N.ae.jsxs(B._e,{role:"alertdialog",...n,...a,ref:o,onOpenAutoFocus:N.y$1(a.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=l.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[N.ae.jsx(os,{children:r}),N.ae.jsx(cs,{contentRef:i})]})})})});Tt.displayName=ce;var Et="AlertDialogTitle",Ct=$.forwardRef((t,e)=>{const{__scopeAlertDialog:s,...r}=t,a=Y(s);return N.ae.jsx(B.he,{...a,...r,ref:e})});Ct.displayName=Et;var Nt="AlertDialogDescription",jt=$.forwardRef((t,e)=>{const{__scopeAlertDialog:s,...r}=t,a=Y(s);return N.ae.jsx(B.Ee,{...a,...r,ref:e})});jt.displayName=Nt;var ls="AlertDialogAction",At=$.forwardRef((t,e)=>{const{__scopeAlertDialog:s,...r}=t,a=Y(s);return N.ae.jsx(B.Pe,{...a,...r,ref:e})});At.displayName=ls;var Rt="AlertDialogCancel",Ot=$.forwardRef((t,e)=>{const{__scopeAlertDialog:s,...r}=t,{cancelRef:a}=is(Rt,s),n=Y(s),i=N.x(e,a);return N.ae.jsx(B.Pe,{...n,...r,ref:i})});Ot.displayName=Rt;var cs=({contentRef:t})=>{const e=`\`${ce}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${ce}\` by passing a \`${Nt}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ce}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return $.useEffect(()=>{var s;document.getElementById((s=t.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},ds=xt,us=bt,fs=kt,It=wt,St=Tt,Zt=At,Lt=Ot,Dt=Ct,$t=jt;const Pt=ds,Mt=us,hs=fs,Vt=$.forwardRef(({className:t,...e},s)=>N.ae.jsx(It,{className:re.mo("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:s}));Vt.displayName=It.displayName;const Be=$.forwardRef(({className:t,...e},s)=>N.ae.jsxs(hs,{children:[N.ae.jsx(Vt,{}),N.ae.jsx(St,{ref:s,className:re.mo("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Be.displayName=St.displayName;const Fe=({className:t,...e})=>N.ae.jsx("div",{className:re.mo("flex flex-col space-y-2 text-center sm:text-left",t),...e});Fe.displayName="AlertDialogHeader";const Ue=({className:t,...e})=>N.ae.jsx("div",{className:re.mo("flex sm:justify-end gap-2",t),...e});Ue.displayName="AlertDialogFooter";const qe=$.forwardRef(({className:t,...e},s)=>N.ae.jsx(Dt,{ref:s,className:re.mo("text-lg font-semibold",t),...e}));qe.displayName=Dt.displayName;const zt=$.forwardRef(({className:t,...e},s)=>N.ae.jsx($t,{ref:s,className:re.mo("text-sm text-muted-foreground",t),...e}));zt.displayName=$t.displayName;const We=$.forwardRef(({className:t,...e},s)=>N.ae.jsx(Zt,{ref:s,className:re.mo(vt.g(),t),...e}));We.displayName=Zt.displayName;const He=$.forwardRef(({className:t,...e},s)=>N.ae.jsx(Lt,{ref:s,className:re.mo(vt.g({variant:"tertiary"}),"mt-2 sm:mt-0",t),...e}));He.displayName=Lt.displayName;const ms=({title:t,description:e,children:s,onConfirm:r,...a})=>{const{t:n}=yt.useTranslation();return I.jsxRuntimeExports.jsxs(Pt,{...a,children:[s&&I.jsxRuntimeExports.jsx(Mt,{children:s}),I.jsxRuntimeExports.jsxs(Be,{children:[I.jsxRuntimeExports.jsxs(Fe,{children:[I.jsxRuntimeExports.jsx(qe,{children:t||n("Are you absolutely sure?")}),I.jsxRuntimeExports.jsx(zt,{children:e||n("This action cannot be undone. This will permanently delete your data from our servers.")})]}),I.jsxRuntimeExports.jsxs(Ue,{children:[I.jsxRuntimeExports.jsx(He,{children:n("Cancel")}),I.jsxRuntimeExports.jsx(We,{onClick:r,children:n("Confirm")})]})]})]})},Ge=(t,e,s)=>{if(t&&"reportValidity"in t){const r=G.get(s,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},Bt=(t,e)=>{for(const s in e.fields){const r=e.fields[s];r&&r.ref&&"reportValidity"in r.ref?Ge(r.ref,s,t):r&&r.refs&&r.refs.forEach(a=>Ge(a,s,t))}},ps=(t,e)=>{e.shouldUseNativeValidation&&Bt(t,e);const s={};for(const r in t){const a=G.get(e.fields,r),n=Object.assign(t[r]||{},{ref:a&&a.ref});if(gs(e.names||Object.keys(t),r)){const i=Object.assign({},G.get(s,r));G.set(i,"root",n),G.set(s,r,i)}else G.set(s,r,n)}return s},gs=(t,e)=>{const s=Ke(e);return t.some(r=>Ke(r).match(`^${s}\\.\\d+`))};function Ke(t){return t.replace(/\]|\[/g,"")}function ys(t,e){for(var s={};t.length;){var r=t[0],a=r.code,n=r.message,i=r.path.join(".");if(!s[i])if("unionErrors"in r){var o=r.unionErrors[0].errors[0];s[i]={message:o.message,type:o.code}}else s[i]={message:n,type:a};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(A){return t.push(A)})}),e){var l=s[i].types,c=l&&l[r.code];s[i]=G.appendErrors(i,e,s,a,c?[].concat(c,r.message):r.message)}t.shift()}return s}function vs(t,e,s){return s===void 0&&(s={}),function(r,a,n){try{return Promise.resolve(function(i,o){try{var l=Promise.resolve(t[s.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(c){return n.shouldUseNativeValidation&&Bt({},n),{errors:{},values:s.raw?Object.assign({},r):c}})}catch(c){return o(c)}return l&&l.then?l.then(void 0,o):l}(0,function(i){if(function(o){return Array.isArray(o==null?void 0:o.errors)}(i))return{values:{},errors:ps(ys(i.errors,!n.shouldUseNativeValidation&&n.criteriaMode==="all"),n)};throw i}))}catch(i){return Promise.reject(i)}}}var w;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function s(a){throw new Error}t.assertNever=s,t.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},t.getValidEnumValues=a=>{const n=t.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of n)i[o]=a[o];return t.objectValues(i)},t.objectValues=a=>t.objectKeys(a).map(function(n){return a[n]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},t.find=(a,n)=>{for(const i of a)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(w||(w={}));var et;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(et||(et={}));const h=w.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Q=t=>{switch(typeof t){case"undefined":return h.undefined;case"string":return h.string;case"number":return Number.isNaN(t)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(t)?h.array:t===null?h.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?h.promise:typeof Map<"u"&&t instanceof Map?h.map:typeof Set<"u"&&t instanceof Set?h.set:typeof Date<"u"&&t instanceof Date?h.date:h.object;default:return h.unknown}},d=w.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"]);class H extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){const s=e||function(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(s(i));else{let o=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(s(i))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return a(this),r}static assert(e){if(!(e instanceof H))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,w.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},r=[];for(const a of this.issues)a.path.length>0?(s[a.path[0]]=s[a.path[0]]||[],s[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:s}}get formErrors(){return this.flatten()}}H.create=t=>new H(t);const Se=(t,e)=>{let s;switch(t.code){case d.invalid_type:t.received===h.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,w.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:s=`Unrecognized key(s) in object: ${w.joinValues(t.keys,", ")}`;break;case d.invalid_union:s="Invalid input";break;case d.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${w.joinValues(t.options)}`;break;case d.invalid_enum_value:s=`Invalid enum value. Expected ${w.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:s="Invalid function arguments";break;case d.invalid_return_type:s="Invalid function return type";break;case d.invalid_date:s="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:w.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case d.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case d.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case d.custom:s="Invalid input";break;case d.invalid_intersection_types:s="Intersection results could not be merged";break;case d.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:s="Number must be finite";break;default:s=e.defaultError,w.assertNever(t)}return{message:s}};let _s=Se;function xs(){return _s}const bs=t=>{const{data:e,path:s,errorMaps:r,issueData:a}=t,n=[...s,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(i,{data:e,defaultError:o}).message;return{...a,path:n,message:o}};function u(t,e){const s=xs(),r=bs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===Se?void 0:Se].filter(a=>!!a)});t.common.issues.push(r)}class z{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const r=[];for(const a of s){if(a.status==="aborted")return v;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,s){const r=[];for(const a of s){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return z.mergeObjectSync(e,r)}static mergeObjectSync(e,s){const r={};for(const a of s){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return v;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const v=Object.freeze({status:"aborted"}),me=t=>({status:"dirty",value:t}),F=t=>({status:"valid",value:t}),tt=t=>t.status==="aborted",st=t=>t.status==="dirty",de=t=>t.status==="valid",we=t=>typeof Promise<"u"&&t instanceof Promise;var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));class te{constructor(e,s,r,a){this._cachedPath=[],this.parent=e,this.data=s,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const rt=(t,e)=>{if(de(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new H(t.common.issues);return this._error=s,this._error}}};function x(t){if(!t)return{};const{errorMap:e,invalid_type_error:s,required_error:r,description:a}=t;if(e&&(s||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:l}=t;return i.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:l??s??o.defaultError}},description:a}}class k{get description(){return this._def.description}_getType(e){return Q(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Q(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new z,ctx:{common:e.parent.common,data:e.data,parsedType:Q(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if(we(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const r=this.safeParse(e,s);if(r.success)return r.data;throw r.error}safeParse(e,s){const r={common:{issues:[],async:(s==null?void 0:s.async)??!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Q(e)},a=this._parseSync({data:e,path:r.path,parent:r});return rt(r,a)}"~validate"(e){var r,a;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Q(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:s});return de(n)?{value:n.value}:{issues:s.common.issues}}catch(n){(a=(r=n==null?void 0:n.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(n=>de(n)?{value:n.value}:{issues:s.common.issues})}async parseAsync(e,s){const r=await this.safeParseAsync(e,s);if(r.success)return r.data;throw r.error}async safeParseAsync(e,s){const r={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Q(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(we(a)?a:Promise.resolve(a));return rt(r,n)}refine(e,s){const r=a=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(a):s;return this._refinement((a,n)=>{const i=e(a),o=()=>n.addIssue({code:d.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,s){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof s=="function"?s(r,a):s),!1))}_refinement(e){return new fe({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return ee.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return q.create(this)}promise(){return Ne.create(this,this._def)}or(e){return Ee.create([this,e],this._def)}and(e){return Ce.create(this,e,this._def)}transform(e){return new fe({...x(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new Le({...x(this._def),innerType:this,defaultValue:s,typeName:_.ZodDefault})}brand(){return new Us({typeName:_.ZodBranded,type:this,...x(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new De({...x(this._def),innerType:this,catchValue:s,typeName:_.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return Xe.create(this,e)}readonly(){return $e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ks=/^c[^\s-]{8,}$/i,ws=/^[0-9a-z]+$/,Ts=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Es=/^[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,Cs=/^[a-z0-9_-]{21}$/i,Ns=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,js=/^[-+]?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)?)??$/,As=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ie;const Os=/^(?:(?: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])$/,Is=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Ss=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Zs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ls=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ds=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ft="((\\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])))",$s=new RegExp(`^${Ft}$`);function Ut(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function Ps(t){return new RegExp(`^${Ut(t)}$`)}function Ms(t){let e=`${Ft}T${Ut(t)}`;const s=[];return s.push(t.local?"Z?":"Z"),t.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function Vs(t,e){return!!((e==="v4"||!e)&&Os.test(t)||(e==="v6"||!e)&&Ss.test(t))}function zs(t,e){if(!Ns.test(t))return!1;try{const[s]=t.split("."),r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Bs(t,e){return!!((e==="v4"||!e)&&Is.test(t)||(e==="v6"||!e)&&Zs.test(t))}class K extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const n=this._getOrReturnCtx(e);return u(n,{code:d.invalid_type,expected:h.string,received:n.parsedType}),v}const r=new z;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),u(a,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),u(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,o=e.data.length<n.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?u(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&u(a,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")As.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"email",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")Ie||(Ie=new RegExp(Rs,"u")),Ie.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"emoji",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")Es.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"uuid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")Cs.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"nanoid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")ks.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"cuid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")ws.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"cuid2",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")Ts.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"ulid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),u(a,{validation:"url",code:d.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"regex",code:d.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),u(a,{code:d.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),u(a,{code:d.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),u(a,{code:d.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?Ms(n).test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{code:d.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?$s.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{code:d.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?Ps(n).test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{code:d.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?js.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"duration",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?Vs(e.data,n.version)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"ip",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="jwt"?zs(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"jwt",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="cidr"?Bs(e.data,n.version)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"cidr",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?Ls.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"base64",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="base64url"?Ds.test(e.data)||(a=this._getOrReturnCtx(e,a),u(a,{validation:"base64url",code:d.invalid_string,message:n.message}),r.dirty()):w.assertNever(n);return{status:r.value,value:e.data}}_regex(e,s,r){return this.refinement(a=>e.test(a),{validation:s,code:d.invalid_string,...m.errToObj(r)})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.errToObj(e)})}datetime(e){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:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...m.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,...m.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...m.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s==null?void 0:s.position,...m.errToObj(s==null?void 0:s.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...m.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...m.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...m.errToObj(s)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new K({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new K({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new K({...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 isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}K.create=t=>new K({checks:[],typeName:_.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...x(t)});function Fs(t,e){const s=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=s>r?s:r,n=Number.parseInt(t.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class pe extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==h.number){const n=this._getOrReturnCtx(e);return u(n,{code:d.invalid_type,expected:h.number,received:n.parsedType}),v}let r;const a=new z;for(const n of this._def.checks)n.kind==="int"?w.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),u(r,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?Fs(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_finite,message:n.message}),a.dirty()):w.assertNever(n);return{status:a.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,m.toString(s))}gt(e,s){return this.setLimit("min",e,!1,m.toString(s))}lte(e,s){return this.setLimit("max",e,!0,m.toString(s))}lt(e,s){return this.setLimit("max",e,!1,m.toString(s))}setLimit(e,s,r,a){return new pe({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:m.toString(a)}]})}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&w.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(s===null||r.value>s)&&(s=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(s)&&Number.isFinite(e)}}pe.create=t=>new pe({checks:[],typeName:_.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...x(t)});class ge extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==h.bigint)return this._getInvalidInput(e);let r;const a=new z;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):w.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.bigint,received:s.parsedType}),v}gte(e,s){return this.setLimit("min",e,!0,m.toString(s))}gt(e,s){return this.setLimit("min",e,!1,m.toString(s))}lte(e,s){return this.setLimit("max",e,!0,m.toString(s))}lt(e,s){return this.setLimit("max",e,!1,m.toString(s))}setLimit(e,s,r,a){return new ge({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:m.toString(a)}]})}_addCheck(e){return new ge({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}ge.create=t=>new ge({checks:[],typeName:_.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...x(t)});class at extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.boolean,received:r.parsedType}),v}return F(e.data)}}at.create=t=>new at({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...x(t)});class Te extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const n=this._getOrReturnCtx(e);return u(n,{code:d.invalid_type,expected:h.date,received:n.parsedType}),v}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return u(n,{code:d.invalid_date}),v}const r=new z;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),u(a,{code:d.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),u(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):w.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Te({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}Te.create=t=>new Te({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...x(t)});class nt extends k{_parse(e){if(this._getType(e)!==h.symbol){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.symbol,received:r.parsedType}),v}return F(e.data)}}nt.create=t=>new nt({typeName:_.ZodSymbol,...x(t)});class it extends k{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.undefined,received:r.parsedType}),v}return F(e.data)}}it.create=t=>new it({typeName:_.ZodUndefined,...x(t)});class ot extends k{_parse(e){if(this._getType(e)!==h.null){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.null,received:r.parsedType}),v}return F(e.data)}}ot.create=t=>new ot({typeName:_.ZodNull,...x(t)});class lt extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return F(e.data)}}lt.create=t=>new lt({typeName:_.ZodAny,...x(t)});class ct extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return F(e.data)}}ct.create=t=>new ct({typeName:_.ZodUnknown,...x(t)});class se extends k{_parse(e){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.never,received:s.parsedType}),v}}se.create=t=>new se({typeName:_.ZodNever,...x(t)});class dt extends k{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.void,received:r.parsedType}),v}return F(e.data)}}dt.create=t=>new dt({typeName:_.ZodVoid,...x(t)});class q extends k{_parse(e){const{ctx:s,status:r}=this._processInputParams(e),a=this._def;if(s.parsedType!==h.array)return u(s,{code:d.invalid_type,expected:h.array,received:s.parsedType}),v;if(a.exactLength!==null){const i=s.data.length>a.exactLength.value,o=s.data.length<a.exactLength.value;(i||o)&&(u(s,{code:i?d.too_big:d.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&s.data.length<a.minLength.value&&(u(s,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&s.data.length>a.maxLength.value&&(u(s,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map((i,o)=>a.type._parseAsync(new te(s,i,s.path,o)))).then(i=>z.mergeArray(r,i));const n=[...s.data].map((i,o)=>a.type._parseSync(new te(s,i,s.path,o)));return z.mergeArray(r,n)}get element(){return this._def.type}min(e,s){return new q({...this._def,minLength:{value:e,message:m.toString(s)}})}max(e,s){return new q({...this._def,maxLength:{value:e,message:m.toString(s)}})}length(e,s){return new q({...this._def,exactLength:{value:e,message:m.toString(s)}})}nonempty(e){return this.min(1,e)}}q.create=(t,e)=>new q({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...x(e)});function le(t){if(t instanceof S){const e={};for(const s in t.shape){const r=t.shape[s];e[s]=ee.create(le(r))}return new S({...t._def,shape:()=>e})}else return t instanceof q?new q({...t._def,type:le(t.element)}):t instanceof ee?ee.create(le(t.unwrap())):t instanceof he?he.create(le(t.unwrap())):t instanceof ie?ie.create(t.items.map(e=>le(e))):t}class S extends k{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(),s=w.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==h.object){const c=this._getOrReturnCtx(e);return u(c,{code:d.invalid_type,expected:h.object,received:c.parsedType}),v}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof se&&this._def.unknownKeys==="strip"))for(const c in a.data)i.includes(c)||o.push(c);const l=[];for(const c of i){const f=n[c],A=a.data[c];l.push({key:{status:"valid",value:c},value:f._parse(new te(a,A,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof se){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of o)l.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(c==="strict")o.length>0&&(u(a,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of o){const A=a.data[f];l.push({key:{status:"valid",value:f},value:c._parse(new te(a,A,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of l){const A=await f.key,L=await f.value;c.push({key:A,value:L,alwaysSet:f.alwaysSet})}return c}).then(c=>z.mergeObjectSync(r,c)):z.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new S({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,r)=>{var n,i;const a=((i=(n=this._def).errorMap)==null?void 0:i.call(n,s,r).message)??r.defaultError;return s.code==="unrecognized_keys"?{message:m.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(e){return new S({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new S({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new S({...this._def,catchall:e})}pick(e){const s={};for(const r of w.objectKeys(e))e[r]&&this.shape[r]&&(s[r]=this.shape[r]);return new S({...this._def,shape:()=>s})}omit(e){const s={};for(const r of w.objectKeys(this.shape))e[r]||(s[r]=this.shape[r]);return new S({...this._def,shape:()=>s})}deepPartial(){return le(this)}partial(e){const s={};for(const r of w.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?s[r]=a:s[r]=a.optional()}return new S({...this._def,shape:()=>s})}required(e){const s={};for(const r of w.objectKeys(this.shape))if(e&&!e[r])s[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof ee;)n=n._def.innerType;s[r]=n}return new S({...this._def,shape:()=>s})}keyof(){return qt(w.objectKeys(this.shape))}}S.create=(t,e)=>new S({shape:()=>t,unknownKeys:"strip",catchall:se.create(),typeName:_.ZodObject,...x(e)});S.strictCreate=(t,e)=>new S({shape:()=>t,unknownKeys:"strict",catchall:se.create(),typeName:_.ZodObject,...x(e)});S.lazycreate=(t,e)=>new S({shape:t,unknownKeys:"strip",catchall:se.create(),typeName:_.ZodObject,...x(e)});class Ee extends k{_parse(e){const{ctx:s}=this._processInputParams(e),r=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return s.common.issues.push(...o.ctx.common.issues),o.result;const i=n.map(o=>new H(o.ctx.common.issues));return u(s,{code:d.invalid_union,unionErrors:i}),v}if(s.common.async)return Promise.all(r.map(async n=>{const i={...s,common:{...s.common,issues:[]},parent:null};return{result:await n._parseAsync({data:s.data,path:s.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const l of r){const c={...s,common:{...s.common,issues:[]},parent:null},f=l._parseSync({data:s.data,path:s.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!n&&(n={result:f,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(n)return s.common.issues.push(...n.ctx.common.issues),n.result;const o=i.map(l=>new H(l));return u(s,{code:d.invalid_union,unionErrors:o}),v}}get options(){return this._def.options}}Ee.create=(t,e)=>new Ee({options:t,typeName:_.ZodUnion,...x(e)});function Ze(t,e){const s=Q(t),r=Q(e);if(t===e)return{valid:!0,data:t};if(s===h.object&&r===h.object){const a=w.objectKeys(e),n=w.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i={...t,...e};for(const o of n){const l=Ze(t[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(s===h.array&&r===h.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let n=0;n<t.length;n++){const i=t[n],o=e[n],l=Ze(i,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return s===h.date&&r===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ce extends k{_parse(e){const{status:s,ctx:r}=this._processInputParams(e),a=(n,i)=>{if(tt(n)||tt(i))return v;const o=Ze(n.value,i.value);return o.valid?((st(n)||st(i))&&s.dirty(),{status:s.value,value:o.data}):(u(r,{code:d.invalid_intersection_types}),v)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ce.create=(t,e,s)=>new Ce({left:t,right:e,typeName:_.ZodIntersection,...x(s)});class ie extends k{_parse(e){const{status:s,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return u(r,{code:d.invalid_type,expected:h.array,received:r.parsedType}),v;if(r.data.length<this._def.items.length)return u(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;!this._def.rest&&r.data.length>this._def.items.length&&(u(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const n=[...r.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new te(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>z.mergeArray(s,i)):z.mergeArray(s,n)}