@jsdev_ninja/core 0.8.53 → 0.8.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/core.cjs.js +1 -1
  2. package/dist/core.cjs.js.map +1 -1
  3. package/dist/core.es.js +735 -946
  4. package/dist/core.es.js.map +1 -1
  5. package/dist/core.umd.js +1 -1
  6. package/dist/core.umd.js.map +1 -1
  7. package/dist/entities/Atoms.d.ts +0 -1
  8. package/dist/entities/Atoms.d.ts.map +1 -1
  9. package/dist/entities/Atoms.js +0 -2
  10. package/dist/entities/Company.d.ts +0 -32
  11. package/dist/entities/Company.d.ts.map +1 -1
  12. package/dist/entities/Company.js +0 -6
  13. package/dist/entities/Store.d.ts +0 -36
  14. package/dist/entities/Store.d.ts.map +1 -1
  15. package/dist/entities/Store.js +0 -11
  16. package/dist/entities/index.d.ts +0 -1
  17. package/dist/entities/index.d.ts.map +1 -1
  18. package/dist/entities/index.js +0 -1
  19. package/dist/firebase-api/app.d.ts +2 -0
  20. package/dist/firebase-api/app.d.ts.map +1 -0
  21. package/dist/firebase-api/app.js +16 -0
  22. package/dist/firebase-api/index.d.ts +41 -7
  23. package/dist/firebase-api/index.d.ts.map +1 -1
  24. package/dist/firebase-api/index.js +14 -5
  25. package/dist/index.d.ts +0 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +0 -1
  28. package/dist/tsconfig.app.tsbuildinfo +1 -1
  29. package/lib/entities/Atoms.ts +0 -3
  30. package/lib/entities/Company.ts +0 -6
  31. package/lib/entities/Store.ts +0 -14
  32. package/lib/entities/index.ts +0 -1
  33. package/lib/firebase-api/app.ts +18 -0
  34. package/lib/firebase-api/index.ts +2 -2
  35. package/lib/index.tsx +0 -1
  36. package/package.json +1 -1
  37. package/src/main.tsx +1 -3
  38. package/tsconfig.app.json +2 -2
  39. package/dist/entities/Payment.d.ts +0 -368
  40. package/dist/entities/Payment.d.ts.map +0 -1
  41. package/dist/entities/Payment.js +0 -108
  42. package/dist/hypPaymentService/index.d.ts +0 -33
  43. package/dist/hypPaymentService/index.d.ts.map +0 -1
  44. package/dist/hypPaymentService/index.js +0 -100
  45. package/lib/entities/Payment.ts +0 -133
  46. package/lib/hypPaymentService/index.ts +0 -139
  47. package/src/App.css +0 -42
  48. package/src/App.tsx +0 -35
  49. package/src/assets/react.svg +0 -1
  50. package/src/index.css +0 -68
package/dist/core.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(k,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(k=typeof globalThis<"u"?globalThis:k||self,b(k.core={}))})(this,function(k){"use strict";var b;(function(n){n.assertEqual=s=>s;function e(s){}n.assertIs=e;function t(s){throw new Error}n.assertNever=t,n.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},n.getValidEnumValues=s=>{const a=n.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of a)o[c]=s[c];return n.objectValues(o)},n.objectValues=s=>n.objectKeys(s).map(function(a){return s[a]}),n.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},n.find=(s,a)=>{for(const o of s)if(a(o))return o},n.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}n.joinValues=r,n.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(b||(b={}));var Ae;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Ae||(Ae={}));const h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),M=n=>{switch(typeof n){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(n)?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(n)?h.array:n===null?h.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?h.promise:typeof Map<"u"&&n instanceof Map?h.map:typeof Set<"u"&&n instanceof Set?h.set:typeof Date<"u"&&n instanceof Date?h.date:h.object;default:return h.unknown}},d=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),et=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Z 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 t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let c=r,f=0;for(;f<o.path.length;){const u=o.path[f];f===o.path.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(o))):c[u]=c[u]||{_errors:[]},c=c[u],f++}}};return s(this),r}static assert(e){if(!(e instanceof Z))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Z.create=n=>new Z(n);const Y=(n,e)=>{let t;switch(n.code){case d.invalid_type:n.received===h.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,b.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(n.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(n.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${b.joinValues(n.options)}, received '${n.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:b.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case d.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case d.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,b.assertNever(n)}return{message:t}};let Le=Y;function tt(n){Le=n}function ye(){return Le}const ve=n=>{const{data:e,path:t,errorMaps:r,issueData:s}=n,a=[...t,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let c="";const f=r.filter(u=>!!u).slice().reverse();for(const u of f)c=u(o,{data:e,defaultError:c}).message;return{...s,path:a,message:c}},nt=[];function l(n,e){const t=ye(),r=ve({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Y?void 0:Y].filter(s=>!!s)});n.common.issues.push(r)}class w{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const s of t){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return w.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const s of t){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return y;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:e.value,value:r}}}const y=Object.freeze({status:"aborted"}),H=n=>({status:"dirty",value:n}),S=n=>({status:"valid",value:n}),Ne=n=>n.status==="aborted",je=n=>n.status==="dirty",F=n=>n.status==="valid",ee=n=>typeof Promise<"u"&&n instanceof Promise;function _e(n,e,t,r){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function Ve(n,e,t,r,s){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var m;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var te,ne;class O{constructor(e,t,r,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ze=(n,e)=>{if(F(e))return{success:!0,data:e.value};if(!n.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 Z(n.common.issues);return this._error=t,this._error}}};function v(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:s}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,c)=>{var f,u;const{message:p}=n;return o.code==="invalid_enum_value"?{message:p??c.defaultError}:typeof c.data>"u"?{message:(f=p??r)!==null&&f!==void 0?f:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(u=p??t)!==null&&u!==void 0?u:c.defaultError}},description:s}}class _{get description(){return this._def.description}_getType(e){return M(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:M(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:M(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ee(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 r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const s={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)},a=this._parseSync({data:e,path:s.path,parent:s});return ze(s,a)}"~validate"(e){var t,r;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:s});return F(a)?{value:a.value}:{issues:s.common.issues}}catch(a){!((r=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(a=>F(a)?{value:a.value}:{issues:s.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={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:M(e)},s=this._parse({data:e,path:r.path,parent:r}),a=await(ee(s)?s:Promise.resolve(s));return ze(r,a)}refine(e,t){const r=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const o=e(s),c=()=>a.addIssue({code:d.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(f=>f?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,t){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof t=="function"?t(r,s):t),!1))}_refinement(e){return new j({schema:this,typeName:g.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:t=>this["~validate"](t)}}optional(){return R.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return K.create(this,this._def)}or(e){return ie.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new j({...v(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new fe({...v(this._def),innerType:this,defaultValue:t,typeName:g.ZodDefault})}brand(){return new Re({typeName:g.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new he({...v(this._def),innerType:this,catchValue:t,typeName:g.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return me.create(this,e)}readonly(){return pe.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]+$/,at=/^[0-9A-HJKMNP-TV-Z]{26}$/i,it=/^[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,ot=/^[a-z0-9_-]{21}$/i,ct=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dt=/^[-+]?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)?)??$/,ut=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oe;const ft=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ht=/^(?:(?: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])$/,mt=/^(([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]))$/,pt=/^(([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])$/,gt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ue="((\\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])))",vt=new RegExp(`^${Ue}$`);function Fe(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function _t(n){return new RegExp(`^${Fe(n)}$`)}function Be(n){let e=`${Ue}T${Fe(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function bt(n,e){return!!((e==="v4"||!e)&&ft.test(n)||(e==="v6"||!e)&&mt.test(n))}function kt(n,e){if(!ct.test(n))return!1;try{const[t]=n.split("."),r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||!s.typ||!s.alg||e&&s.alg!==e)}catch{return!1}}function xt(n,e){return!!((e==="v4"||!e)&&ht.test(n)||(e==="v6"||!e)&&pt.test(n))}class A extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:h.string,received:a.parsedType}),y}const r=new w;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,c=e.data.length<a.value;(o||c)&&(s=this._getOrReturnCtx(e,s),o?l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")ut.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Oe||(Oe=new RegExp(lt,"u")),Oe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")it.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")ot.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")rt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")st.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")at.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:d.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:d.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Be(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?vt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?_t(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?dt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?bt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?kt(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"jwt",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?xt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cidr",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?gt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?yt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64url",code:d.invalid_string,message:a.message}),r.dirty()):b.assertNever(a);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(s=>e.test(s),{validation:t,code:d.invalid_string,...m.errToObj(r)})}_addCheck(e){return new A({...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){var t,r;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:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!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,t){return this._addCheck({kind:"regex",regex:e,...m.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...m.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errToObj(t)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...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 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}}A.create=n=>{var e;return new A({checks:[],typeName:g.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...v(n)})};function Tt(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=t>r?t:r,a=parseInt(n.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return a%o/Math.pow(10,s)}class L extends _{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 a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:h.number,received:a.parsedType}),y}let r;const s=new w;for(const a of this._def.checks)a.kind==="int"?b.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?Tt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.not_finite,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,r,s){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new L({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}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 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"&&b.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}L.create=n=>new L({checks:[],typeName:g.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...v(n)});class V extends _{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 s=new w;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:h.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,r,s){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new V({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:m.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}}V.create=n=>{var e;return new V({checks:[],typeName:g.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...v(n)})};class re extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:h.boolean,received:r.parsedType}),y}return S(e.data)}}re.create=n=>new re({typeName:g.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...v(n)});class B extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:h.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),y}const r=new w;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):b.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.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}}B.create=n=>new B({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:g.ZodDate,...v(n)});class be extends _{_parse(e){if(this._getType(e)!==h.symbol){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:h.symbol,received:r.parsedType}),y}return S(e.data)}}be.create=n=>new be({typeName:g.ZodSymbol,...v(n)});class se extends _{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:h.undefined,received:r.parsedType}),y}return S(e.data)}}se.create=n=>new se({typeName:g.ZodUndefined,...v(n)});class ae extends _{_parse(e){if(this._getType(e)!==h.null){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:h.null,received:r.parsedType}),y}return S(e.data)}}ae.create=n=>new ae({typeName:g.ZodNull,...v(n)});class J extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}J.create=n=>new J({typeName:g.ZodAny,...v(n)});class q extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}q.create=n=>new q({typeName:g.ZodUnknown,...v(n)});class $ extends _{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:h.never,received:t.parsedType}),y}}$.create=n=>new $({typeName:g.ZodNever,...v(n)});class ke extends _{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:h.void,received:r.parsedType}),y}return S(e.data)}}ke.create=n=>new ke({typeName:g.ZodVoid,...v(n)});class N extends _{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),s=this._def;if(t.parsedType!==h.array)return l(t,{code:d.invalid_type,expected:h.array,received:t.parsedType}),y;if(s.exactLength!==null){const o=t.data.length>s.exactLength.value,c=t.data.length<s.exactLength.value;(o||c)&&(l(t,{code:o?d.too_big:d.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,c)=>s.type._parseAsync(new O(t,o,t.path,c)))).then(o=>w.mergeArray(r,o));const a=[...t.data].map((o,c)=>s.type._parseSync(new O(t,o,t.path,c)));return w.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(n,e)=>new N({type:n,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...v(e)});function G(n){if(n instanceof T){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=R.create(G(r))}return new T({...n._def,shape:()=>e})}else return n instanceof N?new N({...n._def,type:G(n.element)}):n instanceof R?R.create(G(n.unwrap())):n instanceof U?U.create(G(n.unwrap())):n instanceof E?E.create(n.items.map(e=>G(e))):n}class T extends _{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=b.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const u=this._getOrReturnCtx(e);return l(u,{code:d.invalid_type,expected:h.object,received:u.parsedType}),y}const{status:r,ctx:s}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof $&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||c.push(u);const f=[];for(const u of o){const p=a[u],C=s.data[u];f.push({key:{status:"valid",value:u},value:p._parse(new O(s,C,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof $){const u=this._def.unknownKeys;if(u==="passthrough")for(const p of c)f.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(u==="strict")c.length>0&&(l(s,{code:d.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const p of c){const C=s.data[p];f.push({key:{status:"valid",value:p},value:u._parse(new O(s,C,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const p of f){const C=await p.key,Ze=await p.value;u.push({key:C,value:Ze,alwaysSet:p.alwaysSet})}return u}).then(u=>w.mergeObjectSync(r,u)):w.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new T({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var s,a,o,c;const f=(o=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(c=m.errToObj(e).message)!==null&&c!==void 0?c:f}:{message:f}}}:{}})}strip(){return new T({...this._def,unknownKeys:"strip"})}passthrough(){return new T({...this._def,unknownKeys:"passthrough"})}extend(e){return new T({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new T({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:g.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new T({...this._def,catchall:e})}pick(e){const t={};return b.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new T({...this._def,shape:()=>t})}omit(e){const t={};return b.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new T({...this._def,shape:()=>t})}deepPartial(){return G(this)}partial(e){const t={};return b.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];e&&!e[r]?t[r]=s:t[r]=s.optional()}),new T({...this._def,shape:()=>t})}required(e){const t={};return b.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof R;)a=a._def.innerType;t[r]=a}}),new T({...this._def,shape:()=>t})}keyof(){return qe(b.objectKeys(this.shape))}}T.create=(n,e)=>new T({shape:()=>n,unknownKeys:"strip",catchall:$.create(),typeName:g.ZodObject,...v(e)}),T.strictCreate=(n,e)=>new T({shape:()=>n,unknownKeys:"strict",catchall:$.create(),typeName:g.ZodObject,...v(e)}),T.lazycreate=(n,e)=>new T({shape:n,unknownKeys:"strip",catchall:$.create(),typeName:g.ZodObject,...v(e)});class ie extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function s(a){for(const c of a)if(c.result.status==="valid")return c.result;for(const c of a)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const o=a.map(c=>new Z(c.ctx.common.issues));return l(t,{code:d.invalid_union,unionErrors:o}),y}if(t.common.async)return Promise.all(r.map(async a=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const f of r){const u={...t,common:{...t.common,issues:[]},parent:null},p=f._parseSync({data:t.data,path:t.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const c=o.map(f=>new Z(f));return l(t,{code:d.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}ie.create=(n,e)=>new ie({options:n,typeName:g.ZodUnion,...v(e)});const D=n=>n instanceof de?D(n.schema):n instanceof j?D(n.innerType()):n instanceof ue?[n.value]:n instanceof z?n.options:n instanceof le?b.objectValues(n.enum):n instanceof fe?D(n._def.innerType):n instanceof se?[void 0]:n instanceof ae?[null]:n instanceof R?[void 0,...D(n.unwrap())]:n instanceof U?[null,...D(n.unwrap())]:n instanceof Re||n instanceof pe?D(n.unwrap()):n instanceof he?D(n._def.innerType):[];class xe extends _{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return l(t,{code:d.invalid_type,expected:h.object,received:t.parsedType}),y;const r=this.discriminator,s=t.data[r],a=this.optionsMap.get(s);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const s=new Map;for(const a of t){const o=D(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,a)}}return new xe({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(r)})}}function Ee(n,e){const t=M(n),r=M(e);if(n===e)return{valid:!0,data:n};if(t===h.object&&r===h.object){const s=b.objectKeys(e),a=b.objectKeys(n).filter(c=>s.indexOf(c)!==-1),o={...n,...e};for(const c of a){const f=Ee(n[c],e[c]);if(!f.valid)return{valid:!1};o[c]=f.data}return{valid:!0,data:o}}else if(t===h.array&&r===h.array){if(n.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<n.length;a++){const o=n[a],c=e[a],f=Ee(o,c);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return t===h.date&&r===h.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class oe extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=(a,o)=>{if(Ne(a)||Ne(o))return y;const c=Ee(a.value,o.value);return c.valid?((je(a)||je(o))&&t.dirty(),{status:t.value,value:c.data}):(l(r,{code:d.invalid_intersection_types}),y)};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(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}oe.create=(n,e,t)=>new oe({left:n,right:e,typeName:g.ZodIntersection,...v(t)});class E extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return l(r,{code:d.invalid_type,expected:h.array,received:r.parsedType}),y;if(r.data.length<this._def.items.length)return l(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&r.data.length>this._def.items.length&&(l(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((o,c)=>{const f=this._def.items[c]||this._def.rest;return f?f._parse(new O(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>w.mergeArray(t,o)):w.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new E({...this._def,rest:e})}}E.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new E({items:n,typeName:g.ZodTuple,rest:null,...v(e)})};class ce extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return l(r,{code:d.invalid_type,expected:h.object,received:r.parsedType}),y;const s=[],a=this._def.keyType,o=this._def.valueType;for(const c in r.data)s.push({key:a._parse(new O(r,c,r.path,c)),value:o._parse(new O(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?w.mergeObjectAsync(t,s):w.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof _?new ce({keyType:e,valueType:t,typeName:g.ZodRecord,...v(r)}):new ce({keyType:A.create(),valueType:e,typeName:g.ZodRecord,...v(t)})}}class Te extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return l(r,{code:d.invalid_type,expected:h.map,received:r.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([c,f],u)=>({key:s._parse(new O(r,c,r.path,[u,"key"])),value:a._parse(new O(r,f,r.path,[u,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const f of o){const u=await f.key,p=await f.value;if(u.status==="aborted"||p.status==="aborted")return y;(u.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(u.value,p.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const f of o){const u=f.key,p=f.value;if(u.status==="aborted"||p.status==="aborted")return y;(u.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(u.value,p.value)}return{status:t.value,value:c}}}}Te.create=(n,e,t)=>new Te({valueType:e,keyType:n,typeName:g.ZodMap,...v(t)});class W extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return l(r,{code:d.invalid_type,expected:h.set,received:r.parsedType}),y;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(l(r,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(l(r,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function o(f){const u=new Set;for(const p of f){if(p.status==="aborted")return y;p.status==="dirty"&&t.dirty(),u.add(p.value)}return{status:t.value,value:u}}const c=[...r.data.values()].map((f,u)=>a._parse(new O(r,f,r.path,u)));return r.common.async?Promise.all(c).then(f=>o(f)):o(c)}min(e,t){return new W({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new W({...this._def,maxSize:{value:e,message:m.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}W.create=(n,e)=>new W({valueType:n,minSize:null,maxSize:null,typeName:g.ZodSet,...v(e)});class Q extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return l(t,{code:d.invalid_type,expected:h.function,received:t.parsedType}),y;function r(c,f){return ve({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ye(),Y].filter(u=>!!u),issueData:{code:d.invalid_arguments,argumentsError:f}})}function s(c,f){return ve({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ye(),Y].filter(u=>!!u),issueData:{code:d.invalid_return_type,returnTypeError:f}})}const a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof K){const c=this;return S(async function(...f){const u=new Z([]),p=await c._def.args.parseAsync(f,a).catch(De=>{throw u.addIssue(r(f,De)),u}),C=await Reflect.apply(o,this,p);return await c._def.returns._def.type.parseAsync(C,a).catch(De=>{throw u.addIssue(s(C,De)),u})})}else{const c=this;return S(function(...f){const u=c._def.args.safeParse(f,a);if(!u.success)throw new Z([r(f,u.error)]);const p=Reflect.apply(o,this,u.data),C=c._def.returns.safeParse(p,a);if(!C.success)throw new Z([s(p,C.error)]);return C.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Q({...this._def,args:E.create(e).rest(q.create())})}returns(e){return new Q({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Q({args:e||E.create([]).rest(q.create()),returns:t||q.create(),typeName:g.ZodFunction,...v(r)})}}class de extends _{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})}}de.create=(n,e)=>new de({getter:n,typeName:g.ZodLazy,...v(e)});class ue extends _{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}ue.create=(n,e)=>new ue({value:n,typeName:g.ZodLiteral,...v(e)});function qe(n,e){return new z({values:n,typeName:g.ZodEnum,...v(e)})}class z extends _{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return l(t,{expected:b.joinValues(r),received:t.parsedType,code:d.invalid_type}),y}if(_e(this,te)||Ve(this,te,new Set(this._def.values)),!_e(this,te).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:r}),y}return S(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return z.create(e,{...this._def,...t})}exclude(e,t=this._def){return z.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}te=new WeakMap,z.create=qe;class le extends _{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const t=b.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){const s=b.objectValues(t);return l(r,{expected:b.joinValues(s),received:r.parsedType,code:d.invalid_type}),y}if(_e(this,ne)||Ve(this,ne,new Set(b.getValidEnumValues(this._def.values))),!_e(this,ne).has(e.data)){const s=b.objectValues(t);return l(r,{received:r.data,code:d.invalid_enum_value,options:s}),y}return S(e.data)}get enum(){return this._def.values}}ne=new WeakMap,le.create=(n,e)=>new le({values:n,typeName:g.ZodNativeEnum,...v(e)});class K extends _{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return l(t,{code:d.invalid_type,expected:h.promise,received:t.parsedType}),y;const r=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return S(r.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}K.create=(n,e)=>new K({type:n,typeName:g.ZodPromise,...v(e)});class j extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:o=>{l(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async c=>{if(t.value==="aborted")return y;const f=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return f.status==="aborted"?y:f.status==="dirty"||t.value==="dirty"?H(f.value):f});{if(t.value==="aborted")return y;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?y:c.status==="dirty"||t.value==="dirty"?H(c.value):c}}if(s.type==="refinement"){const o=c=>{const f=s.refinement(c,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?y:(c.status==="dirty"&&t.dirty(),o(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&t.dirty(),o(c.value).then(()=>({status:t.value,value:c.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!F(o))return o;const c=s.transform(o.value,a);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>F(o)?Promise.resolve(s.transform(o.value,a)).then(c=>({status:t.value,value:c})):o);b.assertNever(s)}}j.create=(n,e,t)=>new j({schema:n,typeName:g.ZodEffects,effect:e,...v(t)}),j.createWithPreprocess=(n,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:n},typeName:g.ZodEffects,...v(t)});class R extends _{_parse(e){return this._getType(e)===h.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}R.create=(n,e)=>new R({innerType:n,typeName:g.ZodOptional,...v(e)});class U extends _{_parse(e){return this._getType(e)===h.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(n,e)=>new U({innerType:n,typeName:g.ZodNullable,...v(e)});class fe extends _{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}fe.create=(n,e)=>new fe({innerType:n,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class he extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ee(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Z(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}he.create=(n,e)=>new he({innerType:n,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class we extends _{_parse(e){if(this._getType(e)!==h.nan){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:h.nan,received:r.parsedType}),y}return{status:"valid",value:e.data}}}we.create=n=>new we({typeName:g.ZodNaN,...v(n)});const wt=Symbol("zod_brand");class Re extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class me extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),H(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,t){return new me({in:e,out:t,typeName:g.ZodPipeline})}}class pe extends _{_parse(e){const t=this._def.innerType._parse(e),r=s=>(F(s)&&(s.value=Object.freeze(s.value)),s);return ee(t)?t.then(s=>r(s)):r(t)}unwrap(){return this._def.innerType}}pe.create=(n,e)=>new pe({innerType:n,typeName:g.ZodReadonly,...v(e)});function We(n,e){const t=typeof n=="function"?n(e):typeof n=="string"?{message:n}:n;return typeof t=="string"?{message:t}:t}function Ye(n,e={},t){return n?J.create().superRefine((r,s)=>{var a,o;const c=n(r);if(c instanceof Promise)return c.then(f=>{var u,p;if(!f){const C=We(e,r),Ze=(p=(u=C.fatal)!==null&&u!==void 0?u:t)!==null&&p!==void 0?p:!0;s.addIssue({code:"custom",...C,fatal:Ze})}});if(!c){const f=We(e,r),u=(o=(a=f.fatal)!==null&&a!==void 0?a:t)!==null&&o!==void 0?o:!0;s.addIssue({code:"custom",...f,fatal:u})}}):J.create()}const St={object:T.lazycreate};var g;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(g||(g={}));const Ct=(n,e={message:`Input not instance of ${n.name}`})=>Ye(t=>t instanceof n,e),He=A.create,Je=L.create,It=we.create,Zt=V.create,Ge=re.create,At=B.create,Nt=be.create,jt=se.create,Ot=ae.create,Et=J.create,Rt=q.create,Pt=$.create,Mt=ke.create,$t=N.create,Dt=T.create,Lt=T.strictCreate,Vt=ie.create,zt=xe.create,Ut=oe.create,Ft=E.create,Bt=ce.create,qt=Te.create,Wt=W.create,Yt=Q.create,Ht=de.create,Jt=ue.create,Gt=z.create,Qt=le.create,Kt=K.create,Qe=j.create,Xt=R.create,en=U.create,tn=j.createWithPreprocess,nn=me.create;var i=Object.freeze({__proto__:null,defaultErrorMap:Y,setErrorMap:tt,getErrorMap:ye,makeIssue:ve,EMPTY_PATH:nt,addIssueToContext:l,ParseStatus:w,INVALID:y,DIRTY:H,OK:S,isAborted:Ne,isDirty:je,isValid:F,isAsync:ee,get util(){return b},get objectUtil(){return Ae},ZodParsedType:h,getParsedType:M,ZodType:_,datetimeRegex:Be,ZodString:A,ZodNumber:L,ZodBigInt:V,ZodBoolean:re,ZodDate:B,ZodSymbol:be,ZodUndefined:se,ZodNull:ae,ZodAny:J,ZodUnknown:q,ZodNever:$,ZodVoid:ke,ZodArray:N,ZodObject:T,ZodUnion:ie,ZodDiscriminatedUnion:xe,ZodIntersection:oe,ZodTuple:E,ZodRecord:ce,ZodMap:Te,ZodSet:W,ZodFunction:Q,ZodLazy:de,ZodLiteral:ue,ZodEnum:z,ZodNativeEnum:le,ZodPromise:K,ZodEffects:j,ZodTransformer:j,ZodOptional:R,ZodNullable:U,ZodDefault:fe,ZodCatch:he,ZodNaN:we,BRAND:wt,ZodBranded:Re,ZodPipeline:me,ZodReadonly:pe,custom:Ye,Schema:_,ZodSchema:_,late:St,get ZodFirstPartyTypeKind(){return g},coerce:{string:n=>A.create({...n,coerce:!0}),number:n=>L.create({...n,coerce:!0}),boolean:n=>re.create({...n,coerce:!0}),bigint:n=>V.create({...n,coerce:!0}),date:n=>B.create({...n,coerce:!0})},any:Et,array:$t,bigint:Zt,boolean:Ge,date:At,discriminatedUnion:zt,effect:Qe,enum:Gt,function:Yt,instanceof:Ct,intersection:Ut,lazy:Ht,literal:Jt,map:qt,nan:It,nativeEnum:Qt,never:Pt,null:Ot,nullable:en,number:Je,object:Dt,oboolean:()=>Ge().optional(),onumber:()=>Je().optional(),optional:Xt,ostring:()=>He().optional(),pipeline:nn,preprocess:tn,promise:Kt,record:Bt,set:Wt,strictObject:Lt,string:He,symbol:Nt,transformer:Qe,tuple:Ft,undefined:jt,union:Vt,unknown:Rt,void:Mt,NEVER:y,ZodIssueCode:d,quotelessJson:et,ZodError:Z});const Ke=i.object({country:i.string(),city:i.string(),street:i.string(),streetNumber:i.string(),floor:i.string(),apartmentEnterNumber:i.string(),apartmentNumber:i.string()}),I=i.enum(["True","False"]),rn=i.string().min(1),sn=i.string().regex(/^\d+$/,"Must be a numeric string"),X=i.object({lang:i.enum(["he"]),value:i.string().min(1)}),an=i.array(X),Pe=i.object({id:i.string().min(1),companyId:i.string().min(1),storeId:i.string().min(1),parentId:i.string().nullish(),tag:i.string().min(1),locales:i.array(X),depth:i.number()}),Se=Pe.extend({children:i.lazy(()=>Se.array())}),on=Pe.extend({index:i.number(),depth:i.number(),collapsed:i.boolean().optional(),children:i.array(Se)}),Me=i.string(),ge=i.object({type:i.literal("Product"),storeId:Me,companyId:Me,id:i.string(),objectID:i.string(),sku:i.string().min(1),name:i.array(X),description:i.array(X),isPublished:i.boolean(),vat:i.boolean(),priceType:i.object({type:i.enum(["unit","kg","gram","liter","ml"]),value:i.number()}),price:i.number().positive(),purchasePrice:i.number().optional(),profitPercentage:i.number().optional(),currency:i.literal("ILS"),discount:i.object({type:i.enum(["number","percent","none"]),value:i.number()}),weight:i.object({value:i.number(),unit:i.enum(["kg","gram","none"])}),volume:i.object({value:i.number(),unit:i.enum(["liter","ml","none"])}),images:i.array(i.object({url:i.string().url(),id:i.string()})),manufacturer:Me,brand:i.string(),importer:i.string(),supplier:i.string(),ingredients:i.array(X),created_at:i.number(),updated_at:i.number(),categoryList:i.array(Se),categories:i.object({lvl0:i.array(i.string()),lvl1:i.array(i.string()),lvl2:i.array(i.string()),lvl3:i.array(i.string()),lvl4:i.array(i.string())}),categoryNames:i.array(i.string())}),cn=ge.omit({id:!0,categories:!0,images:!0}).extend({image:i.instanceof(File).optional()}),dn=ge.extend({image:i.instanceof(File).optional()}),un=i.object({type:i.literal("Cart"),id:i.string().uuid(),companyId:i.string().uuid(),storeId:i.string().uuid(),userId:i.string().uuid(),status:i.enum(["active","draft","completed"]),items:i.array(i.object({product:ge,amount:i.number().int().positive({message:"Quantity must be a positive integer."})}))}),ln=i.object({id:i.string(),name:i.string(),websiteDomains:i.array(i.string()),owner:i.object({name:i.string(),emails:i.object({mainEmail:i.string()})})}),fn=i.object({type:i.literal("FavoriteProduct"),id:i.string().uuid(),companyId:i.string().uuid(),storeId:i.string().uuid(),userId:i.string().uuid(),productId:i.string().uuid()}),Xe=i.object({type:i.literal("Profile"),id:i.string(),companyId:i.string(),storeId:i.string(),tenantId:i.string(),clientType:i.enum(["user","company"]),displayName:i.string().min(1),email:i.string().email(),phoneNumber:i.object({code:i.string(),number:i.string()}),address:Ke,isAnonymous:i.boolean(),createdDate:i.number(),lastActivityDate:i.number()});function hn(){return{type:"Profile",id:"",companyId:"",storeId:"",tenantId:"",clientType:"user",displayName:"",email:"",phoneNumber:{code:"+972",number:""},address:{country:"",city:"",street:"",streetNumber:"",floor:"",apartmentEnterNumber:"",apartmentNumber:""},createdDate:0,lastActivityDate:0,isAnonymous:!0}}const mn=i.object({type:i.literal("Order"),id:i.string(),companyId:i.string(),storeId:i.string(),userId:i.string(),status:i.enum(["pending","processing","in_delivery","delivered","canceled","completed","refunded"]),paymentStatus:i.enum(["pending","completed","failed","refunded"]),cart:i.object({id:i.string(),items:i.array(i.object({product:ge,amount:i.number()})),cartDiscount:i.number(),cartTotal:i.number(),cartVat:i.number()}),originalAmount:i.number().positive().optional(),actualAmount:i.number().positive().optional(),date:i.number(),deliveryDate:i.number().optional(),client:Xe}),x=i.string().min(1),P=i.string().regex(/^\d+$/,"Must be a numeric string"),Ce=i.object({Masof:x,PassP:x,KEY:x.optional(),Amount:x,Order:x.optional(),Tash:P,FixTash:I.optional(),UTF8:I,UTF8out:I,MoreData:I.optional(),J5:I.optional()}),pn=Ce.extend({action:i.literal("soft"),Info:x,CC:P,Tmonth:x,Tyear:x,AuthNum:x,cvv:i.string().optional(),UserId:x,"inputObj.originalUid":x,"inputObj.originalAmount":x,"inputObj.authorizationCodeManpik":i.literal("7"),ClientName:x,ClientLName:x,Token:i.literal("True")}),gn=i.object({action:i.literal("getToken"),allowFalse:i.literal("True"),Masof:x,PassP:x,TransId:P}),yn=i.object({Id:P,Token:P,Tokef:P,CCode:P}),vn=Ce.extend({Id:x,ACode:P,CCode:i.string(),Sign:i.string(),Fild1:i.string(),Fild2:i.string(),Fild3:i.string(),Bank:i.string().optional(),TransType:i.string().optional(),Payments:i.string().optional(),UserId:i.string().optional(),Brand:i.string().optional(),Issuer:i.string().optional(),L4digit:i.string().optional(),street:i.string().optional(),city:i.string().optional(),zip:i.string().optional(),cell:i.string().optional(),Coin:i.string().optional(),Tmonth:i.string().optional(),Tyear:i.string().optional(),Hesh:i.string().optional(),UID:i.string().optional(),spType:i.string().optional(),bincard:i.string().optional()}),_n=Ce.extend({Masof:x,PassP:x,KEY:x,action:i.literal("APISign"),What:i.literal("SIGN"),Info:x,Sign:I,UTF8:I,UTF8out:I,Tash:P,FixTash:I.optional(),sendemail:I.optional(),SendHesh:I.optional(),heshDesc:x,Pritim:I.optional(),UserId:P,ClientName:x,ClientLName:x.optional(),street:x.optional(),city:x.optional(),zip:x.optional(),phone:x.optional(),cell:x.optional(),email:x.optional()});i.object({id:i.string(),companyId:i.string(),name:i.string(),urls:i.array(i.string()),logoUrl:i.string(),tenantId:i.string(),hypData:i.object({masof:i.string().min(1),password:i.string().min(1),isJ5:I,KEY:i.string().min(1)})});const bn=i.object({storeEmail:i.string().email()}),Ie="https://pay.hyp.co.il/p/";function $e(n){return Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&")}function kn(n){if(!/^\d{4}$/.test(n))throw new Error("Invalid YYMM format. Expected 4-digit string (YYMM).");const e=n.slice(0,2),t=n.slice(2,4),r=new Date().getFullYear(),a=Math.floor(r/100)*100+parseInt(e,10),o=r%100,c=parseInt(e,10)>o?a-100:a;return{month:t,year:c.toString()}}function xn(n){return n.split("&").reduce((e,t)=>{const[r,s]=t.split("=");return r&&s&&(e[r]=decodeURIComponent(s)),e},{})}const Tn={async chargeJ5Transaction(n){try{const e=$e({action:"getToken",allowFalse:"True",Masof:n.masof,PassP:n.masofPassword,TransId:n.transactionId}),r=await(await fetch(`${Ie}?${e}`)).text(),s=xn(r),a=kn(s.Tokef);let o=Number(n.originalAmount)*100;const c=$e({action:"soft",MoreData:"True",UTF8:"True",UTF8out:"True","inputObj.originalUid":n.transactionUID,"inputObj.originalAmount":o.toString(),"inputObj.authorizationCodeManpik":"7",Amount:n.actualAmount.toString(),AuthNum:n.creditCardConfirmNumber,Info:"soft Info",Masof:n.masof,PassP:n.masofPassword,Tash:"1",Tmonth:a.month,Tyear:a.year,Order:n.orderId,CC:s.Token,UserId:"203269535",ClientName:n.clientName,ClientLName:n.clientLastName,Token:"True",FixTash:"True"}),u=await(await fetch(`${Ie}?${c}`)).text();return console.log("Amount",n.actualAmount.toString()),console.log("token",s.Token),console.log("AuthNum",n.creditCardConfirmNumber),console.log("originalUid",n.transactionUID),console.log("transactionData",u),{success:!0}}catch(e){return console.log(e),{success:!1,errMessage:e.message}}},async createPaymentLink(n){try{const e=$e(n),t=`${Ie}?${e}`;console.log("createPaymentLink url",t);const s=await(await fetch(t)).text();return{success:!0,paymentLink:`${Ie}?${s}`}}catch(e){return console.log(e),{success:!1,errMessage:e.message}}}},wn={firestore:{getPath:({companyId:n,storeId:e,collectionName:t})=>`${n}/${e}/${t}`}};k.AddressSchema=Ke,k.BaseCategorySchema=Pe,k.CartSchema=un,k.CategorySchema=Se,k.CompanySchema=ln,k.EditProductSchema=dn,k.FavoriteProductSchema=fn,k.FirebaseAPI=wn,k.HypPaymentLinkRequestSchema=_n,k.HypSoftTransactionRequestSchema=pn,k.HypTokenRequestSchema=gn,k.HypTokenResponseSchema=yn,k.LocaleSchema=X,k.LocaleValueSchema=an,k.NewProductSchema=cn,k.OrderSchema=mn,k.PayProtocolGeneralSchema=Ce,k.PayProtocolResponseSchema=vn,k.ProductSchema=ge,k.ProfileSchema=Xe,k.StorePrivateSchema=bn,k.TFlattenCategorySchema=on,k.createEmptyProfile=hn,k.hypBooleanSchema=I,k.hypPaymentService=Tn,k.notEmptyTextSchema=rn,k.numericTextSchema=sn,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
1
+ (function(x,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(x=typeof globalThis<"u"?globalThis:x||self,b(x.core={}))})(this,function(x){"use strict";var b;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(d=>typeof s[s[d]]!="number"),o={};for(const d of a)o[d]=s[d];return r.objectValues(o)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},r.find=(s,a)=>{for(const o of s)if(a(o))return o},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(b||(b={}));var Te;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Te||(Te={}));const h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),j=r=>{switch(typeof r){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(r)?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(r)?h.array:r===null?h.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?h.promise:typeof Map<"u"&&r instanceof Map?h.map:typeof Set<"u"&&r instanceof Set?h.set:typeof Date<"u"&&r instanceof Date?h.date:h.object;default:return h.unknown}},c=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ye=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class Z extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let d=n,f=0;for(;f<o.path.length;){const u=o.path[f];f===o.path.length-1?(d[u]=d[u]||{_errors:[]},d[u]._errors.push(t(o))):d[u]=d[u]||{_errors:[]},d=d[u],f++}}};return s(this),n}static assert(e){if(!(e instanceof Z))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Z.create=r=>new Z(r);const B=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===h.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,b.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${b.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}"`:b.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,b.assertNever(r)}return{message:t}};let je=B;function He(r){je=r}function me(){return je}const pe=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let d="";const f=n.filter(u=>!!u).slice().reverse();for(const u of f)d=u(o,{data:e,defaultError:d}).message;return{...s,path:a,message:d}},Ge=[];function l(r,e){const t=me(),n=pe({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===B?void 0:B].filter(s=>!!s)});r.common.issues.push(n)}class w{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return g;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,o=await s.value;n.push({key:a,value:o})}return w.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return g;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}}const g=Object.freeze({status:"aborted"}),W=r=>({status:"dirty",value:r}),T=r=>({status:"valid",value:r}),Se=r=>r.status==="aborted",Ze=r=>r.status==="dirty",L=r=>r.status==="valid",Q=r=>typeof Promise<"u"&&r instanceof Promise;function ye(r,e,t,n){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Re(r,e,t,n,s){if(typeof e=="function"?r!==e||!0:!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}typeof SuppressedError=="function"&&SuppressedError;var m;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var X,K;class I{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pe=(r,e)=>{if(L(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 Z(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,d)=>{var f,u;const{message:p}=r;return o.code==="invalid_enum_value"?{message:p??d.defaultError}:typeof d.data>"u"?{message:(f=p??n)!==null&&f!==void 0?f:d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:(u=p??t)!==null&&u!==void 0?u:d.defaultError}},description:s}}class _{get description(){return this._def.description}_getType(e){return j(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:j(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:j(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:j(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Pe(s,a)}"~validate"(e){var t,n;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:j(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:s});return L(a)?{value:a.value}:{issues:s.common.issues}}catch(a){!((n=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(a=>L(a)?{value:a.value}:{issues:s.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:j(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Q(s)?s:Promise.resolve(s));return Pe(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const o=e(s),d=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(f=>f?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new N({schema:this,typeName:y.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:t=>this["~validate"](t)}}optional(){return E.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return A.create(this)}promise(){return H.create(this,this._def)}or(e){return ne.create([this,e],this._def)}and(e){return se.create(this,e,this._def)}transform(e){return new N({...v(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ce({...v(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new Ne({typeName:y.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ue({...v(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return le.create(this,e)}readonly(){return fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Qe=/^c[^\s-]{8,}$/i,Xe=/^[0-9a-z]+$/,Ke=/^[0-9A-HJKMNP-TV-Z]{26}$/i,et=/^[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,tt=/^[a-z0-9_-]{21}$/i,rt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,nt=/^[-+]?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)?)??$/,st=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,at="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ce;const it=/^(?:(?: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])$/,ot=/^(?:(?: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])$/,dt=/^(([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]))$/,ct=/^(([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])$/,ut=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$e="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ft=new RegExp(`^${$e}$`);function Me(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ht(r){return new RegExp(`^${Me(r)}$`)}function Ve(r){let e=`${$e}T${Me(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function mt(r,e){return!!((e==="v4"||!e)&&it.test(r)||(e==="v6"||!e)&&dt.test(r))}function pt(r,e){if(!rt.test(r))return!1;try{const[t]=r.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||!s.typ||!s.alg||e&&s.alg!==e)}catch{return!1}}function yt(r,e){return!!((e==="v4"||!e)&&ot.test(r)||(e==="v6"||!e)&&ct.test(r))}class C extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.string,received:a.parsedType}),g}const n=new w;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,d=e.data.length<a.value;(o||d)&&(s=this._getOrReturnCtx(e,s),o?l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):d&&l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")st.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ce||(Ce=new RegExp(at,"u")),Ce.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")et.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")tt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Qe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Xe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Ke.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ve(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ft.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ht(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?nt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?mt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?pt(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"jwt",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?yt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cidr",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?ut.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?lt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64url",code:c.invalid_string,message:a.message}),n.dirty()):b.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,...m.errToObj(n)})}_addCheck(e){return new C({...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){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...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,t){return this._addCheck({kind:"regex",regex:e,...m.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...m.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errToObj(t)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new C({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get 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 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}}C.create=r=>{var e;return new C({checks:[],typeName:y.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};function gt(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return a%o/Math.pow(10,s)}class $ extends _{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 a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.number,received:a.parsedType}),g}let n;const s=new w;for(const a of this._def.checks)a.kind==="int"?b.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?gt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_finite,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,n,s){return new $({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new $({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}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 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"&&b.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}$.create=r=>new $({checks:[],typeName:y.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class M extends _{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 n;const s=new w;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:h.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,n,s){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message: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,t){return this._addCheck({kind:"multipleOf",value:e,message:m.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}}M.create=r=>{var e;return new M({checks:[],typeName:y.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};class ee extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.boolean,received:n.parsedType}),g}return T(e.data)}}ee.create=r=>new ee({typeName:y.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class z extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.date,received:a.parsedType}),g}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),g}const n=new w;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):b.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.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}}z.create=r=>new z({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:y.ZodDate,...v(r)});class ge extends _{_parse(e){if(this._getType(e)!==h.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.symbol,received:n.parsedType}),g}return T(e.data)}}ge.create=r=>new ge({typeName:y.ZodSymbol,...v(r)});class te extends _{_parse(e){if(this._getType(e)!==h.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.undefined,received:n.parsedType}),g}return T(e.data)}}te.create=r=>new te({typeName:y.ZodUndefined,...v(r)});class re extends _{_parse(e){if(this._getType(e)!==h.null){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.null,received:n.parsedType}),g}return T(e.data)}}re.create=r=>new re({typeName:y.ZodNull,...v(r)});class q extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}}q.create=r=>new q({typeName:y.ZodAny,...v(r)});class F extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}}F.create=r=>new F({typeName:y.ZodUnknown,...v(r)});class R extends _{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:h.never,received:t.parsedType}),g}}R.create=r=>new R({typeName:y.ZodNever,...v(r)});class ve extends _{_parse(e){if(this._getType(e)!==h.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.void,received:n.parsedType}),g}return T(e.data)}}ve.create=r=>new ve({typeName:y.ZodVoid,...v(r)});class A extends _{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==h.array)return l(t,{code:c.invalid_type,expected:h.array,received:t.parsedType}),g;if(s.exactLength!==null){const o=t.data.length>s.exactLength.value,d=t.data.length<s.exactLength.value;(o||d)&&(l(t,{code:o?c.too_big:c.too_small,minimum:d?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,d)=>s.type._parseAsync(new I(t,o,t.path,d)))).then(o=>w.mergeArray(n,o));const a=[...t.data].map((o,d)=>s.type._parseSync(new I(t,o,t.path,d)));return w.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}}A.create=(r,e)=>new A({type:r,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...v(e)});function J(r){if(r instanceof k){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=E.create(J(n))}return new k({...r._def,shape:()=>e})}else return r instanceof A?new A({...r._def,type:J(r.element)}):r instanceof E?E.create(J(r.unwrap())):r instanceof D?D.create(J(r.unwrap())):r instanceof O?O.create(r.items.map(e=>J(e))):r}class k extends _{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=b.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const u=this._getOrReturnCtx(e);return l(u,{code:c.invalid_type,expected:h.object,received:u.parsedType}),g}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||d.push(u);const f=[];for(const u of o){const p=a[u],S=s.data[u];f.push({key:{status:"valid",value:u},value:p._parse(new I(s,S,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof R){const u=this._def.unknownKeys;if(u==="passthrough")for(const p of d)f.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(u==="strict")d.length>0&&(l(s,{code:c.unrecognized_keys,keys:d}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const p of d){const S=s.data[p];f.push({key:{status:"valid",value:p},value:u._parse(new I(s,S,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const p of f){const S=await p.key,we=await p.value;u.push({key:S,value:we,alwaysSet:p.alwaysSet})}return u}).then(u=>w.mergeObjectSync(n,u)):w.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,o,d;const f=(o=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(d=m.errToObj(e).message)!==null&&d!==void 0?d:f}:{message:f}}}:{}})}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:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};return b.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return b.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new k({...this._def,shape:()=>t})}deepPartial(){return J(this)}partial(e){const t={};return b.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return b.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof E;)a=a._def.innerType;t[n]=a}}),new k({...this._def,shape:()=>t})}keyof(){return De(b.objectKeys(this.shape))}}k.create=(r,e)=>new k({shape:()=>r,unknownKeys:"strip",catchall:R.create(),typeName:y.ZodObject,...v(e)}),k.strictCreate=(r,e)=>new k({shape:()=>r,unknownKeys:"strict",catchall:R.create(),typeName:y.ZodObject,...v(e)}),k.lazycreate=(r,e)=>new k({shape:r,unknownKeys:"strip",catchall:R.create(),typeName:y.ZodObject,...v(e)});class ne extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const d of a)if(d.result.status==="valid")return d.result;for(const d of a)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const o=a.map(d=>new Z(d.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:o}),g}if(t.common.async)return Promise.all(n.map(async a=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const f of n){const u={...t,common:{...t.common,issues:[]},parent:null},p=f._parseSync({data:t.data,path:t.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const d=o.map(f=>new Z(f));return l(t,{code:c.invalid_union,unionErrors:d}),g}}get options(){return this._def.options}}ne.create=(r,e)=>new ne({options:r,typeName:y.ZodUnion,...v(e)});const P=r=>r instanceof ie?P(r.schema):r instanceof N?P(r.innerType()):r instanceof oe?[r.value]:r instanceof V?r.options:r instanceof de?b.objectValues(r.enum):r instanceof ce?P(r._def.innerType):r instanceof te?[void 0]:r instanceof re?[null]:r instanceof E?[void 0,...P(r.unwrap())]:r instanceof D?[null,...P(r.unwrap())]:r instanceof Ne||r instanceof fe?P(r.unwrap()):r instanceof ue?P(r._def.innerType):[];class _e extends _{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return l(t,{code:c.invalid_type,expected:h.object,received:t.parsedType}),g;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),g)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const o=P(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of o){if(s.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);s.set(d,a)}}return new _e({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(n)})}}function Ae(r,e){const t=j(r),n=j(e);if(r===e)return{valid:!0,data:r};if(t===h.object&&n===h.object){const s=b.objectKeys(e),a=b.objectKeys(r).filter(d=>s.indexOf(d)!==-1),o={...r,...e};for(const d of a){const f=Ae(r[d],e[d]);if(!f.valid)return{valid:!1};o[d]=f.data}return{valid:!0,data:o}}else if(t===h.array&&n===h.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const o=r[a],d=e[a],f=Ae(o,d);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return t===h.date&&n===h.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class se extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,o)=>{if(Se(a)||Se(o))return g;const d=Ae(a.value,o.value);return d.valid?((Ze(a)||Ze(o))&&t.dirty(),{status:t.value,value:d.data}):(l(n,{code:c.invalid_intersection_types}),g)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}se.create=(r,e,t)=>new se({left:r,right:e,typeName:y.ZodIntersection,...v(t)});class O extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.array)return l(n,{code:c.invalid_type,expected:h.array,received:n.parsedType}),g;if(n.data.length<this._def.items.length)return l(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((o,d)=>{const f=this._def.items[d]||this._def.rest;return f?f._parse(new I(n,o,n.path,d)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>w.mergeArray(t,o)):w.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new O({...this._def,rest:e})}}O.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new O({items:r,typeName:y.ZodTuple,rest:null,...v(e)})};class ae extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.object)return l(n,{code:c.invalid_type,expected:h.object,received:n.parsedType}),g;const s=[],a=this._def.keyType,o=this._def.valueType;for(const d in n.data)s.push({key:a._parse(new I(n,d,n.path,d)),value:o._parse(new I(n,n.data[d],n.path,d)),alwaysSet:d in n.data});return n.common.async?w.mergeObjectAsync(t,s):w.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof _?new ae({keyType:e,valueType:t,typeName:y.ZodRecord,...v(n)}):new ae({keyType:C.create(),valueType:e,typeName:y.ZodRecord,...v(t)})}}class be extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.map)return l(n,{code:c.invalid_type,expected:h.map,received:n.parsedType}),g;const s=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([d,f],u)=>({key:s._parse(new I(n,d,n.path,[u,"key"])),value:a._parse(new I(n,f,n.path,[u,"value"]))}));if(n.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const f of o){const u=await f.key,p=await f.value;if(u.status==="aborted"||p.status==="aborted")return g;(u.status==="dirty"||p.status==="dirty")&&t.dirty(),d.set(u.value,p.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const f of o){const u=f.key,p=f.value;if(u.status==="aborted"||p.status==="aborted")return g;(u.status==="dirty"||p.status==="dirty")&&t.dirty(),d.set(u.value,p.value)}return{status:t.value,value:d}}}}be.create=(r,e,t)=>new be({valueType:e,keyType:r,typeName:y.ZodMap,...v(t)});class U extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.set)return l(n,{code:c.invalid_type,expected:h.set,received:n.parsedType}),g;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function o(f){const u=new Set;for(const p of f){if(p.status==="aborted")return g;p.status==="dirty"&&t.dirty(),u.add(p.value)}return{status:t.value,value:u}}const d=[...n.data.values()].map((f,u)=>a._parse(new I(n,f,n.path,u)));return n.common.async?Promise.all(d).then(f=>o(f)):o(d)}min(e,t){return new U({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new U({...this._def,maxSize:{value:e,message:m.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}U.create=(r,e)=>new U({valueType:r,minSize:null,maxSize:null,typeName:y.ZodSet,...v(e)});class Y extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return l(t,{code:c.invalid_type,expected:h.function,received:t.parsedType}),g;function n(d,f){return pe({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,me(),B].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:f}})}function s(d,f){return pe({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,me(),B].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:f}})}const a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof H){const d=this;return T(async function(...f){const u=new Z([]),p=await d._def.args.parseAsync(f,a).catch(Ee=>{throw u.addIssue(n(f,Ee)),u}),S=await Reflect.apply(o,this,p);return await d._def.returns._def.type.parseAsync(S,a).catch(Ee=>{throw u.addIssue(s(S,Ee)),u})})}else{const d=this;return T(function(...f){const u=d._def.args.safeParse(f,a);if(!u.success)throw new Z([n(f,u.error)]);const p=Reflect.apply(o,this,u.data),S=d._def.returns.safeParse(p,a);if(!S.success)throw new Z([s(p,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Y({...this._def,args:O.create(e).rest(F.create())})}returns(e){return new Y({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Y({args:e||O.create([]).rest(F.create()),returns:t||F.create(),typeName:y.ZodFunction,...v(n)})}}class ie extends _{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})}}ie.create=(r,e)=>new ie({getter:r,typeName:y.ZodLazy,...v(e)});class oe extends _{_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}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}oe.create=(r,e)=>new oe({value:r,typeName:y.ZodLiteral,...v(e)});function De(r,e){return new V({values:r,typeName:y.ZodEnum,...v(e)})}class V extends _{constructor(){super(...arguments),X.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:b.joinValues(n),received:t.parsedType,code:c.invalid_type}),g}if(ye(this,X)||Re(this,X,new Set(this._def.values)),!ye(this,X).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:n}),g}return T(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 V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}X=new WeakMap,V.create=De;class de extends _{constructor(){super(...arguments),K.set(this,void 0)}_parse(e){const t=b.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==h.string&&n.parsedType!==h.number){const s=b.objectValues(t);return l(n,{expected:b.joinValues(s),received:n.parsedType,code:c.invalid_type}),g}if(ye(this,K)||Re(this,K,new Set(b.getValidEnumValues(this._def.values))),!ye(this,K).has(e.data)){const s=b.objectValues(t);return l(n,{received:n.data,code:c.invalid_enum_value,options:s}),g}return T(e.data)}get enum(){return this._def.values}}K=new WeakMap,de.create=(r,e)=>new de({values:r,typeName:y.ZodNativeEnum,...v(e)});class H extends _{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return l(t,{code:c.invalid_type,expected:h.promise,received:t.parsedType}),g;const n=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return T(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}H.create=(r,e)=>new H({type:r,typeName:y.ZodPromise,...v(e)});class N extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:o=>{l(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async d=>{if(t.value==="aborted")return g;const f=await this._def.schema._parseAsync({data:d,path:n.path,parent:n});return f.status==="aborted"?g:f.status==="dirty"||t.value==="dirty"?W(f.value):f});{if(t.value==="aborted")return g;const d=this._def.schema._parseSync({data:o,path:n.path,parent:n});return d.status==="aborted"?g:d.status==="dirty"||t.value==="dirty"?W(d.value):d}}if(s.type==="refinement"){const o=d=>{const f=s.refinement(d,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(n.common.async===!1){const d=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return d.status==="aborted"?g:(d.status==="dirty"&&t.dirty(),o(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(d=>d.status==="aborted"?g:(d.status==="dirty"&&t.dirty(),o(d.value).then(()=>({status:t.value,value:d.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!L(o))return o;const d=s.transform(o.value,a);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>L(o)?Promise.resolve(s.transform(o.value,a)).then(d=>({status:t.value,value:d})):o);b.assertNever(s)}}N.create=(r,e,t)=>new N({schema:r,typeName:y.ZodEffects,effect:e,...v(t)}),N.createWithPreprocess=(r,e,t)=>new N({schema:e,effect:{type:"preprocess",transform:r},typeName:y.ZodEffects,...v(t)});class E extends _{_parse(e){return this._getType(e)===h.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}E.create=(r,e)=>new E({innerType:r,typeName:y.ZodOptional,...v(e)});class D extends _{_parse(e){return this._getType(e)===h.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(r,e)=>new D({innerType:r,typeName:y.ZodNullable,...v(e)});class ce extends _{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===h.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ce.create=(r,e)=>new ce({innerType:r,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class ue extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Q(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ue.create=(r,e)=>new ue({innerType:r,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class xe extends _{_parse(e){if(this._getType(e)!==h.nan){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.nan,received:n.parsedType}),g}return{status:"valid",value:e.data}}}xe.create=r=>new xe({typeName:y.ZodNaN,...v(r)});const vt=Symbol("zod_brand");class Ne extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class le extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?g:a.status==="dirty"?(t.dirty(),W(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?g:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new le({in:e,out:t,typeName:y.ZodPipeline})}}class fe extends _{_parse(e){const t=this._def.innerType._parse(e),n=s=>(L(s)&&(s.value=Object.freeze(s.value)),s);return Q(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}fe.create=(r,e)=>new fe({innerType:r,typeName:y.ZodReadonly,...v(e)});function Le(r,e){const t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function ze(r,e={},t){return r?q.create().superRefine((n,s)=>{var a,o;const d=r(n);if(d instanceof Promise)return d.then(f=>{var u,p;if(!f){const S=Le(e,n),we=(p=(u=S.fatal)!==null&&u!==void 0?u:t)!==null&&p!==void 0?p:!0;s.addIssue({code:"custom",...S,fatal:we})}});if(!d){const f=Le(e,n),u=(o=(a=f.fatal)!==null&&a!==void 0?a:t)!==null&&o!==void 0?o:!0;s.addIssue({code:"custom",...f,fatal:u})}}):q.create()}const _t={object:k.lazycreate};var y;(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"})(y||(y={}));const bt=(r,e={message:`Input not instance of ${r.name}`})=>ze(t=>t instanceof r,e),Fe=C.create,Ue=$.create,xt=xe.create,kt=M.create,Be=ee.create,wt=z.create,Tt=ge.create,St=te.create,Zt=re.create,Ct=q.create,At=F.create,Nt=R.create,It=ve.create,Ot=A.create,Et=k.create,jt=k.strictCreate,Rt=ne.create,Pt=_e.create,$t=se.create,Mt=O.create,Vt=ae.create,Dt=be.create,Lt=U.create,zt=Y.create,Ft=ie.create,Ut=oe.create,Bt=V.create,Wt=de.create,qt=H.create,We=N.create,Jt=E.create,Yt=D.create,Ht=N.createWithPreprocess,Gt=le.create;var i=Object.freeze({__proto__:null,defaultErrorMap:B,setErrorMap:He,getErrorMap:me,makeIssue:pe,EMPTY_PATH:Ge,addIssueToContext:l,ParseStatus:w,INVALID:g,DIRTY:W,OK:T,isAborted:Se,isDirty:Ze,isValid:L,isAsync:Q,get util(){return b},get objectUtil(){return Te},ZodParsedType:h,getParsedType:j,ZodType:_,datetimeRegex:Ve,ZodString:C,ZodNumber:$,ZodBigInt:M,ZodBoolean:ee,ZodDate:z,ZodSymbol:ge,ZodUndefined:te,ZodNull:re,ZodAny:q,ZodUnknown:F,ZodNever:R,ZodVoid:ve,ZodArray:A,ZodObject:k,ZodUnion:ne,ZodDiscriminatedUnion:_e,ZodIntersection:se,ZodTuple:O,ZodRecord:ae,ZodMap:be,ZodSet:U,ZodFunction:Y,ZodLazy:ie,ZodLiteral:oe,ZodEnum:V,ZodNativeEnum:de,ZodPromise:H,ZodEffects:N,ZodTransformer:N,ZodOptional:E,ZodNullable:D,ZodDefault:ce,ZodCatch:ue,ZodNaN:xe,BRAND:vt,ZodBranded:Ne,ZodPipeline:le,ZodReadonly:fe,custom:ze,Schema:_,ZodSchema:_,late:_t,get ZodFirstPartyTypeKind(){return y},coerce:{string:r=>C.create({...r,coerce:!0}),number:r=>$.create({...r,coerce:!0}),boolean:r=>ee.create({...r,coerce:!0}),bigint:r=>M.create({...r,coerce:!0}),date:r=>z.create({...r,coerce:!0})},any:Ct,array:Ot,bigint:kt,boolean:Be,date:wt,discriminatedUnion:Pt,effect:We,enum:Bt,function:zt,instanceof:bt,intersection:$t,lazy:Ft,literal:Ut,map:Dt,nan:xt,nativeEnum:Wt,never:Nt,null:Zt,nullable:Yt,number:Ue,object:Et,oboolean:()=>Be().optional(),onumber:()=>Ue().optional(),optional:Jt,ostring:()=>Fe().optional(),pipeline:Gt,preprocess:Ht,promise:qt,record:Vt,set:Lt,strictObject:jt,string:Fe,symbol:Tt,transformer:We,tuple:Mt,undefined:St,union:Rt,unknown:At,void:It,NEVER:g,ZodIssueCode:c,quotelessJson:Ye,ZodError:Z});const qe=i.object({country:i.string(),city:i.string(),street:i.string(),streetNumber:i.string(),floor:i.string(),apartmentEnterNumber:i.string(),apartmentNumber:i.string()}),Qt=i.string().min(1),Xt=i.string().regex(/^\d+$/,"Must be a numeric string"),G=i.object({lang:i.enum(["he"]),value:i.string().min(1)}),Kt=i.array(G),Ie=i.object({id:i.string().min(1),companyId:i.string().min(1),storeId:i.string().min(1),parentId:i.string().nullish(),tag:i.string().min(1),locales:i.array(G),depth:i.number()}),ke=Ie.extend({children:i.lazy(()=>ke.array())}),er=Ie.extend({index:i.number(),depth:i.number(),collapsed:i.boolean().optional(),children:i.array(ke)}),Oe=i.string(),he=i.object({type:i.literal("Product"),storeId:Oe,companyId:Oe,id:i.string(),objectID:i.string(),sku:i.string().min(1),name:i.array(G),description:i.array(G),isPublished:i.boolean(),vat:i.boolean(),priceType:i.object({type:i.enum(["unit","kg","gram","liter","ml"]),value:i.number()}),price:i.number().positive(),purchasePrice:i.number().optional(),profitPercentage:i.number().optional(),currency:i.literal("ILS"),discount:i.object({type:i.enum(["number","percent","none"]),value:i.number()}),weight:i.object({value:i.number(),unit:i.enum(["kg","gram","none"])}),volume:i.object({value:i.number(),unit:i.enum(["liter","ml","none"])}),images:i.array(i.object({url:i.string().url(),id:i.string()})),manufacturer:Oe,brand:i.string(),importer:i.string(),supplier:i.string(),ingredients:i.array(G),created_at:i.number(),updated_at:i.number(),categoryList:i.array(ke),categories:i.object({lvl0:i.array(i.string()),lvl1:i.array(i.string()),lvl2:i.array(i.string()),lvl3:i.array(i.string()),lvl4:i.array(i.string())}),categoryNames:i.array(i.string())}),tr=he.omit({id:!0,categories:!0,images:!0}).extend({image:i.instanceof(File).optional()}),rr=he.extend({image:i.instanceof(File).optional()}),nr=i.object({type:i.literal("Cart"),id:i.string().uuid(),companyId:i.string().uuid(),storeId:i.string().uuid(),userId:i.string().uuid(),status:i.enum(["active","draft","completed"]),items:i.array(i.object({product:he,amount:i.number().int().positive({message:"Quantity must be a positive integer."})}))}),sr=i.object({id:i.string(),name:i.string(),websiteDomains:i.array(i.string())}),ar=i.object({type:i.literal("FavoriteProduct"),id:i.string().uuid(),companyId:i.string().uuid(),storeId:i.string().uuid(),userId:i.string().uuid(),productId:i.string().uuid()}),Je=i.object({type:i.literal("Profile"),id:i.string(),companyId:i.string(),storeId:i.string(),tenantId:i.string(),clientType:i.enum(["user","company"]),displayName:i.string().min(1),email:i.string().email(),phoneNumber:i.object({code:i.string(),number:i.string()}),address:qe,isAnonymous:i.boolean(),createdDate:i.number(),lastActivityDate:i.number()});function ir(){return{type:"Profile",id:"",companyId:"",storeId:"",tenantId:"",clientType:"user",displayName:"",email:"",phoneNumber:{code:"+972",number:""},address:{country:"",city:"",street:"",streetNumber:"",floor:"",apartmentEnterNumber:"",apartmentNumber:""},createdDate:0,lastActivityDate:0,isAnonymous:!0}}const or=i.object({type:i.literal("Order"),id:i.string(),companyId:i.string(),storeId:i.string(),userId:i.string(),status:i.enum(["pending","processing","in_delivery","delivered","canceled","completed","refunded"]),paymentStatus:i.enum(["pending","completed","failed","refunded"]),cart:i.object({id:i.string(),items:i.array(i.object({product:he,amount:i.number()})),cartDiscount:i.number(),cartTotal:i.number(),cartVat:i.number()}),originalAmount:i.number().positive().optional(),actualAmount:i.number().positive().optional(),date:i.number(),deliveryDate:i.number().optional(),client:Je});i.object({id:i.string(),companyId:i.string(),name:i.string(),urls:i.array(i.string()),logoUrl:i.string(),tenantId:i.string()});const dr={firestore:{systemCollections:{stores:"STORES",companies:"COMPANIES"},storeCollections:{products:"products",profiles:"profiles",cart:"cart",clients:"clients",orders:"orders",categories:"categories",favorites:"favorites",payments:"payments"},getPath:({companyId:r,storeId:e,collectionName:t,id:n})=>`${r}/${e}/${t}${n?`/${n}`:""}`,getDocPath:r=>`{companyId}/{storeId}/${r}/{id}`}};x.AddressSchema=qe,x.BaseCategorySchema=Ie,x.CartSchema=nr,x.CategorySchema=ke,x.CompanySchema=sr,x.EditProductSchema=rr,x.FavoriteProductSchema=ar,x.FirebaseAPI=dr,x.LocaleSchema=G,x.LocaleValueSchema=Kt,x.NewProductSchema=tr,x.OrderSchema=or,x.ProductSchema=he,x.ProfileSchema=Je,x.TFlattenCategorySchema=er,x.createEmptyProfile=ir,x.notEmptyTextSchema=Qt,x.numericTextSchema=Xt,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=core.umd.js.map