@kenyaemr/esm-bed-management-app 1.0.1-pre.4 → 1.0.1-pre.7

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.
@@ -51,7 +51,7 @@
51
51
  "auxiliaryFiles": [
52
52
  "esm-kenyaemr-bed-management-app.js.map"
53
53
  ],
54
- "hash": "f0a535b71388620c",
54
+ "hash": "aecac8425b8f6517",
55
55
  "childrenByOrder": {}
56
56
  },
57
57
  {
@@ -59,10 +59,10 @@
59
59
  "initial": true,
60
60
  "entry": true,
61
61
  "recorded": false,
62
- "size": 165136,
62
+ "size": 165395,
63
63
  "sizes": {
64
64
  "consume-shared": 126,
65
- "javascript": 144652,
65
+ "javascript": 144911,
66
66
  "share-init": 210,
67
67
  "runtime": 20148
68
68
  },
@@ -79,7 +79,7 @@
79
79
  "auxiliaryFiles": [
80
80
  "main.js.map"
81
81
  ],
82
- "hash": "1655df4fb065b203",
82
+ "hash": "3f473d0cc4e3ae9c",
83
83
  "childrenByOrder": {}
84
84
  },
85
85
  {
@@ -141,10 +141,10 @@
141
141
  "initial": false,
142
142
  "entry": false,
143
143
  "recorded": false,
144
- "size": 4917,
144
+ "size": 5176,
145
145
  "sizes": {
146
146
  "consume-shared": 84,
147
- "javascript": 4833
147
+ "javascript": 5092
148
148
  },
149
149
  "names": [],
150
150
  "idHints": [],
@@ -157,7 +157,7 @@
157
157
  "auxiliaryFiles": [
158
158
  "283.js.map"
159
159
  ],
160
- "hash": "dfe4f60a5931fc34",
160
+ "hash": "d9bca4859bd756d0",
161
161
  "childrenByOrder": {}
162
162
  },
163
163
  {
@@ -264,9 +264,9 @@
264
264
  "entry": false,
265
265
  "recorded": false,
266
266
  "reason": "split chunk (cache group: default)",
267
- "size": 28212,
267
+ "size": 37654,
268
268
  "sizes": {
269
- "javascript": 28128,
269
+ "javascript": 37570,
270
270
  "consume-shared": 84
271
271
  },
272
272
  "names": [],
@@ -281,7 +281,7 @@
281
281
  "auxiliaryFiles": [
282
282
  "404.js.map"
283
283
  ],
284
- "hash": "53dd9162188c9b09",
284
+ "hash": "3a3189d45b50b80f",
285
285
  "childrenByOrder": {}
286
286
  },
287
287
  {
@@ -461,9 +461,9 @@
461
461
  "initial": false,
462
462
  "entry": false,
463
463
  "recorded": false,
464
- "size": 985,
464
+ "size": 141893,
465
465
  "sizes": {
466
- "javascript": 985
466
+ "javascript": 141893
467
467
  },
468
468
  "names": [],
469
469
  "idHints": [],
@@ -472,12 +472,12 @@
472
472
  "main"
473
473
  ],
474
474
  "files": [
475
- "884.js"
475
+ "850.js"
476
476
  ],
477
477
  "auxiliaryFiles": [
478
- "884.js.map"
478
+ "850.js.map"
479
479
  ],
480
- "hash": "6556c8b57e389aef",
480
+ "hash": "3e00995b94e3859a",
481
481
  "childrenByOrder": {}
482
482
  },
483
483
  {
@@ -485,9 +485,9 @@
485
485
  "initial": false,
486
486
  "entry": false,
487
487
  "recorded": false,
488
- "size": 123329,
488
+ "size": 985,
489
489
  "sizes": {
490
- "javascript": 123329
490
+ "javascript": 985
491
491
  },
492
492
  "names": [],
493
493
  "idHints": [],
@@ -496,12 +496,12 @@
496
496
  "main"
497
497
  ],
498
498
  "files": [
499
- "933.js"
499
+ "884.js"
500
500
  ],
501
501
  "auxiliaryFiles": [
502
- "933.js.map"
502
+ "884.js.map"
503
503
  ],
504
- "hash": "142fac495a783a7e",
504
+ "hash": "6556c8b57e389aef",
505
505
  "childrenByOrder": {}
506
506
  },
507
507
  {
@@ -509,9 +509,9 @@
509
509
  "initial": false,
510
510
  "entry": false,
511
511
  "recorded": false,
512
- "size": 91721,
512
+ "size": 123329,
513
513
  "sizes": {
514
- "javascript": 91721
514
+ "javascript": 123329
515
515
  },
516
516
  "names": [],
517
517
  "idHints": [],
@@ -520,12 +520,12 @@
520
520
  "main"
521
521
  ],
522
522
  "files": [
523
- "959.js"
523
+ "933.js"
524
524
  ],
525
525
  "auxiliaryFiles": [
526
- "959.js.map"
526
+ "933.js.map"
527
527
  ],
528
- "hash": "f8da59c0acba1477",
528
+ "hash": "864664a6eb4827cd",
529
529
  "childrenByOrder": {}
530
530
  }
531
531
  ]
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- (()=>{var e,t,a={1283:(e,t,a)=>{"use strict";var n=a(1132),r=a(1604),s=(n.Type.UUID,n.Type.UUID,r.O7,a(1672)),i=a.n(s),o=a(935),d=a(1914);function c(e){var t=e.config,a=t.name,r=t.title,c=(0,d.useLocation)(),u=(0,s.useMemo)((function(){return decodeURIComponent((0,o.Z)(c.pathname.split("/")))}),[c.pathname]);return/^[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}$/.test(u)&&(u="summary"),i().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"bed-management").concat(a&&"bed-management"!==a?"/".concat(a):""),className:"cds--side-nav__link ".concat(a===u&&"active-left-nav-link")},r)}var u=function(e){return function(){return i().createElement(d.BrowserRouter,null,i().createElement(c,{config:e}))}};function l(e){var t=e.config,a=t.name,r=t.title,c=(0,d.useLocation)(),u=(0,s.useMemo)((function(){return decodeURIComponent((0,o.Z)(c.pathname.split("/")))}),[c.pathname]);return/^[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}$/.test(u)&&(u="summary"),i().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"home").concat(a?"/".concat(a):""),className:"cds--side-nav__link ".concat(a===u&&"active-left-nav-link")},r)}var p,h={featureName:"bed-management",moduleName:"@kenyaemr/esm-bed-management-app"};a(3979),(0,n.getAsyncLifecycle)((function(){return Promise.all([a.e(330),a.e(455),a.e(187),a.e(397),a.e(404),a.e(959)]).then(a.bind(a,7959))}),h),(0,n.getAsyncLifecycle)((function(){return Promise.all([a.e(330),a.e(455),a.e(207),a.e(397),a.e(404),a.e(933)]).then(a.bind(a,3933))}),h),(0,n.getAsyncLifecycle)((function(){return Promise.all([a.e(330),a.e(397),a.e(884)]).then(a.bind(a,3884))}),h),(0,n.getSyncLifecycle)(u({name:"bed-management",title:"Summary"}),h),(0,n.getSyncLifecycle)(u({name:"administration",title:"Ward Allocation"}),h),(0,n.getSyncLifecycle)((p={name:"bed-admission",title:"In Patient"},function(){return i().createElement(d.BrowserRouter,null,i().createElement(l,{config:p}))}),h)},3979:(e,t,a)=>{var n={"./en.json":[3574,574]};function r(e){if(!a.o(n,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],r=t[0];return a.e(t[1]).then((()=>a(r)))}r.keys=()=>Object.keys(n),r.id=3979,e.exports=r},935:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},1604:(e,t,a)=>{"use strict";var n,r;a.d(t,{O7:()=>Ce,z:()=>dt}),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of a)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(n={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(r={}));const s=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=n.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class d extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},a={_errors:[]},n=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(n);else if("invalid_return_type"===r.code)n(r.returnTypeError);else if("invalid_arguments"===r.code)n(r.argumentsError);else if(0===r.path.length)a._errors.push(t(r));else{let e=a,n=0;for(;n<r.path.length;){const a=r.path[n];n===r.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(r))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}d.create=e=>new d(e);const c=(e,t)=>{let a;switch(e.code){case o.invalid_type:a=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,n.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:a=`Unrecognized key(s) in object: ${n.joinValues(e.keys,", ")}`;break;case o.invalid_union:a="Invalid input";break;case o.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${n.joinValues(e.options)}`;break;case o.invalid_enum_value:a=`Invalid enum value. Expected ${n.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:a="Invalid function arguments";break;case o.invalid_return_type:a="Invalid function return type";break;case o.invalid_date:a="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:n.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:a="Invalid input";break;case o.invalid_intersection_types:a="Intersection results could not be merged";break;case o.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:a="Number must be finite";break;default:a=t.defaultError,n.assertNever(e)}return{message:a}};let u=c;function l(){return u}const p=e=>{const{data:t,path:a,errorMaps:n,issueData:r}=e,s=[...a,...r.path||[]],i={...r,path:s};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:r.message||o}};function h(e,t){const a=p({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,l(),c].filter((e=>!!e))});e.common.issues.push(a)}class m{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if("aborted"===n.status)return f;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t)a.push({key:await e.key,value:await e.value});return m.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:r}=n;if("aborted"===t.status)return f;if("aborted"===r.status)return f;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!n.alwaysSet||(a[t.value]=r.value)}return{status:e.value,value:a}}}const f=Object.freeze({status:"aborted"}),y=e=>({status:"dirty",value:e}),v=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,g=e=>"dirty"===e.status,b=e=>"valid"===e.status,x=e=>"undefined"!=typeof Promise&&e instanceof Promise;var k;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(k||(k={}));class w{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Z=(e,t)=>{if(b(t))return{success:!0,data:t.value};if(!e.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 d(e.common.issues);return this._error=t,this._error}}};function T(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:r}=e;if(t&&(a||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=a?a:t.defaultError},description:r}}class O{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new m,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(x(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const n={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},r=this._parseSync({data:e,path:n.path,parent:n});return Z(n,r)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(x(n)?n:Promise.resolve(n));return Z(a,r)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const r=e(t),s=()=>n.addIssue({code:o.custom,...a(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(s(),!1))):!!r||(s(),!1)}))}refinement(e,t){return this._refinement(((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1)))}_refinement(e){return new he({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return me.create(this,this._def)}nullable(){return fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return J.create(this,this._def)}promise(){return pe.create(this,this._def)}or(e){return H.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new he({...T(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ye({...T(this._def),innerType:this,defaultValue:t,typeName:Te.ZodDefault})}brand(){return new be({typeName:Te.ZodBranded,type:this,...T(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ve({...T(this._def),innerType:this,catchValue:t,typeName:Te.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return ke.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S=/^c[^\s-]{8,}$/i,N=/^[a-z][a-z0-9]*$/,E=/[0-9A-HJKMNP-TV-Z]{26}/,C=/^[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,j=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,P=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,I=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,A=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class R extends O{constructor(){super(...arguments),this._regex=(e,t,a)=>this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...k.errToObj(a)}),this.nonempty=e=>this.min(1,k.errToObj(e)),this.trim=()=>new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),f}const t=new m;let a;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const n=e.data.length>s.value,r=e.data.length<s.value;(n||r)&&(a=this._getOrReturnCtx(e,a),n?h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)j.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)P.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)C.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)S.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)N.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)E.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),h(a,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?((d=s).precision?d.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${d.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${d.precision}}Z$`):0===d.precision?d.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):d.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"ip"===s.kind?(r=e.data,("v4"!==(i=s.version)&&i||!I.test(r))&&("v6"!==i&&i||!A.test(r))&&(a=this._getOrReturnCtx(e,a),h(a,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):n.assertNever(s);var r,i,d;return{status:t.value,value:e.data}}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...k.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...k.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function $(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=a>n?a:n;return parseInt(e.toFixed(r).replace(".",""))%parseInt(t.toFixed(r).replace(".",""))/Math.pow(10,r)}R.create=e=>{var t;return new R({checks:[],typeName:Te.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class L extends O{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)!==s.number){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),f}let t;const a=new m;for(const r of this._def.checks)"int"===r.kind?n.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.invalid_type,expected:"integer",received:"float",message:r.message}),a.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty()):"multipleOf"===r.kind?0!==$(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_finite,message:r.message}),a.dirty()):n.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,a,n){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:k.toString(n)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&n.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}L.create=e=>new L({checks:[],typeName:Te.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class M extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.bigint){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),f}let t;const a=new m;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):n.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,a,n){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:k.toString(n)}]})}_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:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}M.create=e=>{var t;return new M({checks:[],typeName:Te.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class D extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),f}return v(e.data)}}D.create=e=>new D({typeName:Te.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class U extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),f}if(isNaN(e.data.getTime()))return h(this._getOrReturnCtx(e),{code:o.invalid_date}),f;const t=new m;let a;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):n.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}U.create=e=>new U({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Te.ZodDate,...T(e)});class z extends O{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),f}return v(e.data)}}z.create=e=>new z({typeName:Te.ZodSymbol,...T(e)});class V extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),f}return v(e.data)}}V.create=e=>new V({typeName:Te.ZodUndefined,...T(e)});class F extends O{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),f}return v(e.data)}}F.create=e=>new F({typeName:Te.ZodNull,...T(e)});class B extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return v(e.data)}}B.create=e=>new B({typeName:Te.ZodAny,...T(e)});class K extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return v(e.data)}}K.create=e=>new K({typeName:Te.ZodUnknown,...T(e)});class W extends O{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),f}}W.create=e=>new W({typeName:Te.ZodNever,...T(e)});class q extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),f}return v(e.data)}}q.create=e=>new q({typeName:Te.ZodVoid,...T(e)});class J extends O{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.array)return h(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),f;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,r=t.data.length<n.exactLength.value;(e||r)&&(h(t,{code:e?o.too_big:o.too_small,minimum:r?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(h(t,{code:o.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(h(t,{code:o.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>n.type._parseAsync(new w(t,e,t.path,a))))).then((e=>m.mergeArray(a,e)));const r=[...t.data].map(((e,a)=>n.type._parseSync(new w(t,e,t.path,a))));return m.mergeArray(a,r)}get element(){return this._def.type}min(e,t){return new J({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new J({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new J({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}}function Y(e){if(e instanceof G){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=me.create(Y(n))}return new G({...e._def,shape:()=>t})}return e instanceof J?new J({...e._def,type:Y(e.element)}):e instanceof me?me.create(Y(e.unwrap())):e instanceof fe?fe.create(Y(e.unwrap())):e instanceof ae?ae.create(e.items.map((e=>Y(e)))):e}J.create=(e,t)=>new J({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...T(t)});class G extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=n.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof W&&"strip"===this._def.unknownKeys))for(const e in a.data)r.includes(e)||i.push(e);const d=[];for(const e of r){const t=n[e],r=a.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new w(a,r,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof W){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)d.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)i.length>0&&(h(a,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=a.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new w(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const a=await t.key;e.push({key:a,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>m.mergeObjectSync(t,e))):m.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new G({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var n,r,s,i;const o=null!==(s=null===(r=(n=this._def).errorMap)||void 0===r?void 0:r.call(n,t,a).message)&&void 0!==s?s:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=k.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new G({...this._def,unknownKeys:"strip"})}passthrough(){return new G({...this._def,unknownKeys:"passthrough"})}extend(e){return new G({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new G({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Te.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new G({...this._def,catchall:e})}pick(e){const t={};return n.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new G({...this._def,shape:()=>t})}omit(e){const t={};return n.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new G({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return n.objectKeys(this.shape).forEach((a=>{const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()})),new G({...this._def,shape:()=>t})}required(e){const t={};return n.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof me;)e=e._def.innerType;t[a]=e}})),new G({...this._def,shape:()=>t})}keyof(){return ce(n.objectKeys(this.shape))}}G.create=(e,t)=>new G({shape:()=>e,unknownKeys:"strip",catchall:W.create(),typeName:Te.ZodObject,...T(t)}),G.strictCreate=(e,t)=>new G({shape:()=>e,unknownKeys:"strict",catchall:W.create(),typeName:Te.ZodObject,...T(t)}),G.lazycreate=(e,t)=>new G({shape:e,unknownKeys:"strip",catchall:W.create(),typeName:Te.ZodObject,...T(t)});class H extends O{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new d(e.ctx.common.issues)));return h(t,{code:o.invalid_union,unionErrors:a}),f}));{let e;const n=[];for(const r of a){const a={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:a});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=n.map((e=>new d(e)));return h(t,{code:o.invalid_union,unionErrors:r}),f}}get options(){return this._def.options}}H.create=(e,t)=>new H({options:e,typeName:Te.ZodUnion,...T(t)});const X=e=>e instanceof oe?X(e.schema):e instanceof he?X(e.innerType()):e instanceof de?[e.value]:e instanceof ue?e.options:e instanceof le?Object.keys(e.enum):e instanceof ye?X(e._def.innerType):e instanceof V?[void 0]:e instanceof F?[null]:null;class Q extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f;const a=this.discriminator,n=t.data[a],r=this.optionsMap.get(n);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const n=new Map;for(const a of t){const t=X(a.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,a)}}return new Q({typeName:Te.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...T(a)})}}function ee(e,t){const a=i(e),r=i(t);if(e===t)return{valid:!0,data:e};if(a===s.object&&r===s.object){const a=n.objectKeys(t),r=n.objectKeys(e).filter((e=>-1!==a.indexOf(e))),s={...e,...t};for(const a of r){const n=ee(e[a],t[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(a===s.array&&r===s.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const r=ee(e[n],t[n]);if(!r.valid)return{valid:!1};a.push(r.data)}return{valid:!0,data:a}}return a===s.date&&r===s.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class te extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(_(e)||_(n))return f;const r=ee(e.value,n.value);return r.valid?((g(e)||g(n))&&t.dirty(),{status:t.value,value:r.data}):(h(a,{code:o.invalid_intersection_types}),f)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}te.create=(e,t,a)=>new te({left:e,right:t,typeName:Te.ZodIntersection,...T(a)});class ae extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.array)return h(a,{code:o.invalid_type,expected:s.array,received:a.parsedType}),f;if(a.data.length<this._def.items.length)return h(a,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new w(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(n).then((e=>m.mergeArray(t,e))):m.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ae({...this._def,rest:e})}}ae.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ae({items:e,typeName:Te.ZodTuple,rest:null,...T(t)})};class ne extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.object)return h(a,{code:o.invalid_type,expected:s.object,received:a.parsedType}),f;const n=[],r=this._def.keyType,i=this._def.valueType;for(const e in a.data)n.push({key:r._parse(new w(a,e,a.path,e)),value:i._parse(new w(a,a.data[e],a.path,e))});return a.common.async?m.mergeObjectAsync(t,n):m.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,a){return new ne(t instanceof O?{keyType:e,valueType:t,typeName:Te.ZodRecord,...T(a)}:{keyType:R.create(),valueType:e,typeName:Te.ZodRecord,...T(t)})}}class re extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.map)return h(a,{code:o.invalid_type,expected:s.map,received:a.parsedType}),f;const n=this._def.keyType,r=this._def.valueType,i=[...a.data.entries()].map((([e,t],s)=>({key:n._parse(new w(a,e,a.path,[s,"key"])),value:r._parse(new w(a,t,a.path,[s,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of i){const n=await a.key,r=await a.value;if("aborted"===n.status||"aborted"===r.status)return f;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of i){const n=a.key,r=a.value;if("aborted"===n.status||"aborted"===r.status)return f;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}}}re.create=(e,t,a)=>new re({valueType:t,keyType:e,typeName:Te.ZodMap,...T(a)});class se extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.set)return h(a,{code:o.invalid_type,expected:s.set,received:a.parsedType}),f;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(h(a,{code:o.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(h(a,{code:o.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const a=new Set;for(const n of e){if("aborted"===n.status)return f;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const d=[...a.data.values()].map(((e,t)=>r._parse(new w(a,e,a.path,t))));return a.common.async?Promise.all(d).then((e=>i(e))):i(d)}min(e,t){return new se({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new se({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}se.create=(e,t)=>new se({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,...T(t)});class ie extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return h(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),f;function a(e,a){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_arguments,argumentsError:a}})}function n(e,a){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_return_type,returnTypeError:a}})}const r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof pe){const e=this;return v((async function(...t){const s=new d([]),o=await e._def.args.parseAsync(t,r).catch((e=>{throw s.addIssue(a(t,e)),s})),c=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(c,r).catch((e=>{throw s.addIssue(n(c,e)),s}))}))}{const e=this;return v((function(...t){const s=e._def.args.safeParse(t,r);if(!s.success)throw new d([a(t,s.error)]);const o=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(o,r);if(!c.success)throw new d([n(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ie({...this._def,args:ae.create(e).rest(K.create())})}returns(e){return new ie({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ie({args:e||ae.create([]).rest(K.create()),returns:t||K.create(),typeName:Te.ZodFunction,...T(a)})}}class oe extends O{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})}}oe.create=(e,t)=>new oe({getter:e,typeName:Te.ZodLazy,...T(t)});class de extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ce(e,t){return new ue({values:e,typeName:Te.ZodEnum,...T(t)})}de.create=(e,t)=>new de({value:e,typeName:Te.ZodLiteral,...T(t)});class ue extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{expected:n.joinValues(a),received:t.parsedType,code:o.invalid_type}),f}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{received:t.data,code:o.invalid_enum_value,options:a}),f}return v(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){return ue.create(e)}exclude(e){return ue.create(this.options.filter((t=>!e.includes(t))))}}ue.create=ce;class le extends O{_parse(e){const t=n.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==s.string&&a.parsedType!==s.number){const e=n.objectValues(t);return h(a,{expected:n.joinValues(e),received:a.parsedType,code:o.invalid_type}),f}if(-1===t.indexOf(e.data)){const e=n.objectValues(t);return h(a,{received:a.data,code:o.invalid_enum_value,options:e}),f}return v(e.data)}get enum(){return this._def.values}}le.create=(e,t)=>new le({values:e,typeName:Te.ZodNativeEnum,...T(t)});class pe extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return h(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),f;const a=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return v(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}pe.create=(e,t)=>new pe({type:e,typeName:Te.ZodPromise,...T(t)});class he extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{h(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(a.data,s);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:a.path,parent:a}))):this._def.schema._parseSync({data:e,path:a.path,parent:a})}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?f:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?f:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===r.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!b(e))return e;const n=r.transform(e.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>b(e)?Promise.resolve(r.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}n.assertNever(r)}}he.create=(e,t,a)=>new he({schema:e,typeName:Te.ZodEffects,effect:t,...T(a)}),he.createWithPreprocess=(e,t,a)=>new he({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,...T(a)});class me extends O{_parse(e){return this._getType(e)===s.undefined?v(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(e,t)=>new me({innerType:e,typeName:Te.ZodOptional,...T(t)});class fe extends O{_parse(e){return this._getType(e)===s.null?v(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(e,t)=>new fe({innerType:e,typeName:Te.ZodNullable,...T(t)});class ye extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===s.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Te.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});class ve extends O{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return x(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new d(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Te.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});class _e extends O{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),f}return{status:"valid",value:e.data}}}_e.create=e=>new _e({typeName:Te.ZodNaN,...T(e)});const ge=Symbol("zod_brand");class be extends O{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class xe extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),y(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})();{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new xe({in:e,out:t,typeName:Te.ZodPipeline})}}class ke extends O{_parse(e){const t=this._def.innerType._parse(e);return b(t)&&(t.value=Object.freeze(t.value)),t}}ke.create=(e,t)=>new ke({innerType:e,typeName:Te.ZodReadonly,...T(t)});const we=(e,t={},a)=>e?B.create().superRefine(((n,r)=>{var s,i;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:a)||void 0===i||i,d="string"==typeof e?{message:e}:e;r.addIssue({code:"custom",...d,fatal:o})}})):B.create(),Ze={object:G.lazycreate};var Te;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Te||(Te={}));const Oe=R.create,Se=L.create,Ne=_e.create,Ee=M.create,Ce=D.create,je=U.create,Pe=z.create,Ie=V.create,Ae=F.create,Re=B.create,$e=K.create,Le=W.create,Me=q.create,De=J.create,Ue=G.create,ze=G.strictCreate,Ve=H.create,Fe=Q.create,Be=te.create,Ke=ae.create,We=ne.create,qe=re.create,Je=se.create,Ye=ie.create,Ge=oe.create,He=de.create,Xe=ue.create,Qe=le.create,et=pe.create,tt=he.create,at=me.create,nt=fe.create,rt=he.createWithPreprocess,st=xe.create,it={string:e=>R.create({...e,coerce:!0}),number:e=>L.create({...e,coerce:!0}),boolean:e=>D.create({...e,coerce:!0}),bigint:e=>M.create({...e,coerce:!0}),date:e=>U.create({...e,coerce:!0})},ot=f;var dt=Object.freeze({__proto__:null,defaultErrorMap:c,setErrorMap:function(e){u=e},getErrorMap:l,makeIssue:p,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:m,INVALID:f,DIRTY:y,OK:v,isAborted:_,isDirty:g,isValid:b,isAsync:x,get util(){return n},get objectUtil(){return r},ZodParsedType:s,getParsedType:i,ZodType:O,ZodString:R,ZodNumber:L,ZodBigInt:M,ZodBoolean:D,ZodDate:U,ZodSymbol:z,ZodUndefined:V,ZodNull:F,ZodAny:B,ZodUnknown:K,ZodNever:W,ZodVoid:q,ZodArray:J,ZodObject:G,ZodUnion:H,ZodDiscriminatedUnion:Q,ZodIntersection:te,ZodTuple:ae,ZodRecord:ne,ZodMap:re,ZodSet:se,ZodFunction:ie,ZodLazy:oe,ZodLiteral:de,ZodEnum:ue,ZodNativeEnum:le,ZodPromise:pe,ZodEffects:he,ZodTransformer:he,ZodOptional:me,ZodNullable:fe,ZodDefault:ye,ZodCatch:ve,ZodNaN:_e,BRAND:ge,ZodBranded:be,ZodPipeline:xe,ZodReadonly:ke,custom:we,Schema:O,ZodSchema:O,late:Ze,get ZodFirstPartyTypeKind(){return Te},coerce:it,any:Re,array:De,bigint:Ee,boolean:Ce,date:je,discriminatedUnion:Fe,effect:tt,enum:Xe,function:Ye,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>we((t=>t instanceof e),t),intersection:Be,lazy:Ge,literal:He,map:qe,nan:Ne,nativeEnum:Qe,never:Le,null:Ae,nullable:nt,number:Se,object:Ue,oboolean:()=>Ce().optional(),onumber:()=>Se().optional(),optional:at,ostring:()=>Oe().optional(),pipeline:st,preprocess:rt,promise:et,record:We,set:Je,strictObject:ze,string:Oe,symbol:Pe,transformer:tt,tuple:Ke,undefined:Ie,union:Ve,unknown:$e,void:Me,NEVER:ot,ZodIssueCode:o,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:d})}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.m=a,r.c=n,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,a)=>(r.f[a](e,t),t)),[])),r.u=e=>e+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@kenyaemr/esm-bed-management-app:",r.l=(a,n,s,i)=>{if(e[a])e[a].push(n);else{var o,d;if(void 0!==s)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var l=c[u];if(l.getAttribute("src")==a||l.getAttribute("data-webpack")==t+s){o=l;break}}o||(d=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,r.nc&&o.setAttribute("nonce",r.nc),o.setAttribute("data-webpack",t+s),o.src=a),e[a]=[n];var p=(t,n)=>{o.onerror=o.onload=null,clearTimeout(h);var r=e[a];if(delete e[a],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach((e=>e(n))),t)return t(n)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),d&&document.head.appendChild(o)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{r.S={};var e={},t={};r.I=(a,n)=>{n||(n=[]);var s=t[a];if(s||(s=t[a]={}),!(n.indexOf(s)>=0)){if(n.push(s),e[a])return e[a];r.o(r.S,a)||(r.S[a]={});var i=r.S[a],o="@kenyaemr/esm-bed-management-app",d=(e,t,a,n)=>{var r=i[e]=i[e]||{},s=r[t];(!s||!s.loaded&&(!n!=!s.eager?n:o>s.from))&&(r[t]={get:a,from:o,eager:!!n})},c=[];return"default"===a&&(d("@openmrs/esm-framework","5.1.1-pre.986",(()=>Promise.all([r.e(800),r.e(672)]).then((()=>()=>r(4800))))),d("react-i18next","11.18.6",(()=>Promise.all([r.e(672),r.e(629)]).then((()=>()=>r(707))))),d("react-router-dom","6.15.0",(()=>Promise.all([r.e(26),r.e(672)]).then((()=>()=>r(8026))))),d("react","18.2.0",(()=>r.e(294).then((()=>()=>r(7294))))),d("rxjs","6.6.7",(()=>r.e(558).then((()=>()=>r(8558)))))),e[a]=c.length?Promise.all(c).then((()=>e[a]=1)):1}}})(),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var a=t.getElementsByTagName("script");if(a.length)for(var n=a.length-1;n>-1&&!e;)e=a[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),a=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=a[1]?t(a[1]):[];return a[2]&&(n.length++,n.push.apply(n,t(a[2]))),a[3]&&(n.push([]),n.push.apply(n,t(a[3]))),n},t=e=>{var a=e[0],n="";if(1===e.length)return"*";if(a+.5){n+=0==a?">=":-1==a?"<":1==a?"^":2==a?"~":a>0?"=":"!=";for(var r=1,s=1;s<e.length;s++)r--,n+="u"==(typeof(o=e[s]))[0]?"-":(r>0?".":"")+(r=2,o);return n}var i=[];for(s=1;s<e.length;s++){var o=e[s];i.push(0===o?"not("+d()+")":1===o?"("+d()+" || "+d()+")":2===o?i.pop()+" "+i.pop():t(o))}return d();function d(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(t,n)=>{if(0 in t){n=e(n);var r=t[0],s=r<0;s&&(r=-r-1);for(var i=0,o=1,d=!0;;o++,i++){var c,u,l=o<t.length?(typeof t[o])[0]:"";if(i>=n.length||"o"==(u=(typeof(c=n[i]))[0]))return!d||("u"==l?o>r&&!s:""==l!=s);if("u"==u){if(!d||"u"!=l)return!1}else if(d)if(l==u)if(o<=r){if(c!=t[o])return!1}else{if(s?c>t[o]:c<t[o])return!1;c!=t[o]&&(d=!1)}else if("s"!=l&&"n"!=l){if(s||o<=r)return!1;d=!1,o--}else{if(o<=r||u<l!=s)return!1;d=!1}else"s"!=l&&"n"!=l&&(d=!1,o--)}}var p=[],h=p.pop.bind(p);for(i=1;i<t.length;i++){var m=t[i];p.push(1==m?h()|h():2==m?h()&h():m?a(m,n):!h())}return!!h()},n=(t,a)=>{var n=t[a];return Object.keys(n).reduce(((t,a)=>!t||!n[t].loaded&&((t,a)=>{t=e(t),a=e(a);for(var n=0;;){if(n>=t.length)return n<a.length&&"u"!=(typeof a[n])[0];var r=t[n],s=(typeof r)[0];if(n>=a.length)return"u"==s;var i=a[n],o=(typeof i)[0];if(s!=o)return"o"==s&&"n"==o||"s"==o||"u"==s;if("o"!=s&&"u"!=s&&r!=i)return r<i;n++}})(t,a)?a:t),0)},s=(e,r,s,d)=>{var c=n(e,s);return a(d,c)||i(((e,a,n,r)=>"Unsatisfied version "+n+" from "+(n&&e[a][n].from)+" of shared singleton module "+a+" (required "+t(r)+")")(e,s,c,d)),o(e[s][c])},i=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},o=e=>(e.loaded=1,e.get()),d=e=>function(t,a,n,s){var i=r.I(t);return i&&i.then?i.then(e.bind(e,t,r.S[t],a,n,s)):e(t,r.S[t],a,n,s)},c=d(((e,t,a,s)=>t&&r.o(t,a)?((e,t,a,r)=>{var s=n(e,a);return o(e[a][s])})(t,0,a):s())),u=d(((e,t,a,n,i)=>t&&r.o(t,a)?s(t,0,a,n):i())),l={},p={3397:()=>u("default","react-i18next",[1,11],(()=>r.e(707).then((()=>()=>r(707))))),2437:()=>c("default","@openmrs/esm-framework/src/internal",(()=>r.e(800).then((()=>()=>r(4800))))),5222:()=>u("default","rxjs",[1,6],(()=>r.e(558).then((()=>()=>r(8558))))),1672:()=>u("default","react",[1,18],(()=>r.e(294).then((()=>()=>r(7294))))),1132:()=>u("default","@openmrs/esm-framework",[0],(()=>r.e(800).then((()=>()=>r(4800))))),1914:()=>u("default","react-router-dom",[1,6],(()=>r.e(26).then((()=>()=>r(8026)))))};[1132,1672,1914].forEach((e=>{r.m[e]=t=>{l[e]=0,delete r.c[e];var a=p[e]();if("function"!=typeof a)throw new Error("Shared module is not available for eager consumption: "+e);t.exports=a()}}));var h={397:[3397],404:[2437,5222],672:[1672]};r.f.consumes=(e,t)=>{r.o(h,e)&&h[e].forEach((e=>{if(r.o(l,e))return t.push(l[e]);var a=t=>{l[e]=0,r.m[e]=a=>{delete r.c[e],a.exports=t()}},n=t=>{delete l[e],r.m[e]=a=>{throw delete r.c[e],t}};try{var s=p[e]();s.then?t.push(l[e]=s.then(a).catch(n)):a(s)}catch(e){n(e)}}))}})(),(()=>{var e={179:0,672:0,283:0,352:0};r.f.j=(t,a)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)a.push(n[2]);else if(/^(397|672)$/.test(t))e[t]=0;else{var s=new Promise(((a,r)=>n=e[t]=[a,r]));a.push(n[2]=s);var i=r.p+r.u(t),o=new Error;r.l(i,(a=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.src;o.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",o.name="ChunkLoadError",o.type=s,o.request=i,n[1](o)}}),"chunk-"+t,t)}};var t=(t,a)=>{var n,s,[i,o,d]=a,c=0;if(i.some((t=>0!==e[t]))){for(n in o)r.o(o,n)&&(r.m[n]=o[n]);d&&d(r)}for(t&&t(a);c<i.length;c++)s=i[c],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},a=globalThis.webpackChunk_kenyaemr_esm_bed_management_app=globalThis.webpackChunk_kenyaemr_esm_bed_management_app||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),r.nc=void 0,r(1283)})();
1
+ (()=>{var e,t,a={1283:(e,t,a)=>{"use strict";var n=a(1132),r=a(1604),s=(n.Type.UUID,n.Type.UUID,r.O7,a(1672)),i=a.n(s),o=a(935),d=a(1914);function c(e){var t=e.config,a=t.name,r=t.title,c=(0,d.useLocation)(),u=(0,s.useMemo)((function(){return decodeURIComponent((0,o.Z)(c.pathname.split("/")))}),[c.pathname]);return/^[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}$/.test(u)&&(u="summary"),i().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"bed-management").concat(a&&"bed-management"!==a?"/".concat(a):""),className:"cds--side-nav__link ".concat(a===u&&"active-left-nav-link")},r)}var u=function(e){return function(){return i().createElement(d.BrowserRouter,null,i().createElement(c,{config:e}))}};function l(e){var t=e.config,a=t.name,r=t.title,c=(0,d.useLocation)(),u=(0,s.useMemo)((function(){return decodeURIComponent((0,o.Z)(c.pathname.split("/")))}),[c.pathname]);return/^[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}$/.test(u)&&(u="summary"),i().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"home").concat(a?"/".concat(a):""),className:"cds--side-nav__link ".concat(a===u&&"active-left-nav-link")},r)}var p,h={featureName:"bed-management",moduleName:"@kenyaemr/esm-bed-management-app"};a(3979),(0,n.getAsyncLifecycle)((function(){return Promise.all([a.e(330),a.e(455),a.e(187),a.e(397),a.e(404),a.e(850)]).then(a.bind(a,1850))}),h),(0,n.getAsyncLifecycle)((function(){return Promise.all([a.e(330),a.e(455),a.e(207),a.e(397),a.e(404),a.e(933)]).then(a.bind(a,3933))}),h),(0,n.getAsyncLifecycle)((function(){return Promise.all([a.e(330),a.e(397),a.e(884)]).then(a.bind(a,3884))}),h),(0,n.getSyncLifecycle)(u({name:"bed-management",title:"Summary"}),h),(0,n.getSyncLifecycle)(u({name:"administration",title:"Ward Allocation"}),h),(0,n.getSyncLifecycle)(u({name:"bed-type",title:"Bed Type"}),h),(0,n.getSyncLifecycle)(u({name:"bed-tag",title:"Bed Tag"}),h),(0,n.getSyncLifecycle)((p={name:"bed-admission",title:"In Patient"},function(){return i().createElement(d.BrowserRouter,null,i().createElement(l,{config:p}))}),h)},3979:(e,t,a)=>{var n={"./en.json":[3574,574]};function r(e){if(!a.o(n,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],r=t[0];return a.e(t[1]).then((()=>a(r)))}r.keys=()=>Object.keys(n),r.id=3979,e.exports=r},935:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},1604:(e,t,a)=>{"use strict";var n,r;a.d(t,{O7:()=>Ce,z:()=>dt}),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of a)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(n={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(r={}));const s=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=n.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class d extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},a={_errors:[]},n=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(n);else if("invalid_return_type"===r.code)n(r.returnTypeError);else if("invalid_arguments"===r.code)n(r.argumentsError);else if(0===r.path.length)a._errors.push(t(r));else{let e=a,n=0;for(;n<r.path.length;){const a=r.path[n];n===r.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(r))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}d.create=e=>new d(e);const c=(e,t)=>{let a;switch(e.code){case o.invalid_type:a=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,n.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:a=`Unrecognized key(s) in object: ${n.joinValues(e.keys,", ")}`;break;case o.invalid_union:a="Invalid input";break;case o.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${n.joinValues(e.options)}`;break;case o.invalid_enum_value:a=`Invalid enum value. Expected ${n.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:a="Invalid function arguments";break;case o.invalid_return_type:a="Invalid function return type";break;case o.invalid_date:a="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:n.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:a="Invalid input";break;case o.invalid_intersection_types:a="Intersection results could not be merged";break;case o.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:a="Number must be finite";break;default:a=t.defaultError,n.assertNever(e)}return{message:a}};let u=c;function l(){return u}const p=e=>{const{data:t,path:a,errorMaps:n,issueData:r}=e,s=[...a,...r.path||[]],i={...r,path:s};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:r.message||o}};function h(e,t){const a=p({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,l(),c].filter((e=>!!e))});e.common.issues.push(a)}class m{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if("aborted"===n.status)return f;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t)a.push({key:await e.key,value:await e.value});return m.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:r}=n;if("aborted"===t.status)return f;if("aborted"===r.status)return f;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!n.alwaysSet||(a[t.value]=r.value)}return{status:e.value,value:a}}}const f=Object.freeze({status:"aborted"}),y=e=>({status:"dirty",value:e}),v=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,g=e=>"dirty"===e.status,b=e=>"valid"===e.status,x=e=>"undefined"!=typeof Promise&&e instanceof Promise;var k;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(k||(k={}));class w{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Z=(e,t)=>{if(b(t))return{success:!0,data:t.value};if(!e.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 d(e.common.issues);return this._error=t,this._error}}};function T(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:r}=e;if(t&&(a||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=a?a:t.defaultError},description:r}}class O{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new m,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(x(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const n={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},r=this._parseSync({data:e,path:n.path,parent:n});return Z(n,r)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(x(n)?n:Promise.resolve(n));return Z(a,r)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const r=e(t),s=()=>n.addIssue({code:o.custom,...a(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(s(),!1))):!!r||(s(),!1)}))}refinement(e,t){return this._refinement(((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1)))}_refinement(e){return new he({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return me.create(this,this._def)}nullable(){return fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return J.create(this,this._def)}promise(){return pe.create(this,this._def)}or(e){return H.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new he({...T(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ye({...T(this._def),innerType:this,defaultValue:t,typeName:Te.ZodDefault})}brand(){return new be({typeName:Te.ZodBranded,type:this,...T(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ve({...T(this._def),innerType:this,catchValue:t,typeName:Te.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return ke.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S=/^c[^\s-]{8,}$/i,N=/^[a-z][a-z0-9]*$/,E=/[0-9A-HJKMNP-TV-Z]{26}/,C=/^[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,j=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,P=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,I=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,A=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class R extends O{constructor(){super(...arguments),this._regex=(e,t,a)=>this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...k.errToObj(a)}),this.nonempty=e=>this.min(1,k.errToObj(e)),this.trim=()=>new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),f}const t=new m;let a;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const n=e.data.length>s.value,r=e.data.length<s.value;(n||r)&&(a=this._getOrReturnCtx(e,a),n?h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)j.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)P.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)C.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)S.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)N.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)E.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),h(a,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?((d=s).precision?d.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${d.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${d.precision}}Z$`):0===d.precision?d.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):d.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"ip"===s.kind?(r=e.data,("v4"!==(i=s.version)&&i||!I.test(r))&&("v6"!==i&&i||!A.test(r))&&(a=this._getOrReturnCtx(e,a),h(a,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):n.assertNever(s);var r,i,d;return{status:t.value,value:e.data}}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...k.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...k.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function L(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=a>n?a:n;return parseInt(e.toFixed(r).replace(".",""))%parseInt(t.toFixed(r).replace(".",""))/Math.pow(10,r)}R.create=e=>{var t;return new R({checks:[],typeName:Te.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class $ extends O{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)!==s.number){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),f}let t;const a=new m;for(const r of this._def.checks)"int"===r.kind?n.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.invalid_type,expected:"integer",received:"float",message:r.message}),a.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty()):"multipleOf"===r.kind?0!==L(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_finite,message:r.message}),a.dirty()):n.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,a,n){return new $({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:k.toString(n)}]})}_addCheck(e){return new $({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&n.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}$.create=e=>new $({checks:[],typeName:Te.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class M extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.bigint){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),f}let t;const a=new m;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):n.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,a,n){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:k.toString(n)}]})}_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:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}M.create=e=>{var t;return new M({checks:[],typeName:Te.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class D extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),f}return v(e.data)}}D.create=e=>new D({typeName:Te.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class U extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),f}if(isNaN(e.data.getTime()))return h(this._getOrReturnCtx(e),{code:o.invalid_date}),f;const t=new m;let a;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):n.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}U.create=e=>new U({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Te.ZodDate,...T(e)});class z extends O{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),f}return v(e.data)}}z.create=e=>new z({typeName:Te.ZodSymbol,...T(e)});class V extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),f}return v(e.data)}}V.create=e=>new V({typeName:Te.ZodUndefined,...T(e)});class F extends O{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),f}return v(e.data)}}F.create=e=>new F({typeName:Te.ZodNull,...T(e)});class B extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return v(e.data)}}B.create=e=>new B({typeName:Te.ZodAny,...T(e)});class K extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return v(e.data)}}K.create=e=>new K({typeName:Te.ZodUnknown,...T(e)});class W extends O{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),f}}W.create=e=>new W({typeName:Te.ZodNever,...T(e)});class q extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),f}return v(e.data)}}q.create=e=>new q({typeName:Te.ZodVoid,...T(e)});class J extends O{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.array)return h(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),f;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,r=t.data.length<n.exactLength.value;(e||r)&&(h(t,{code:e?o.too_big:o.too_small,minimum:r?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(h(t,{code:o.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(h(t,{code:o.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>n.type._parseAsync(new w(t,e,t.path,a))))).then((e=>m.mergeArray(a,e)));const r=[...t.data].map(((e,a)=>n.type._parseSync(new w(t,e,t.path,a))));return m.mergeArray(a,r)}get element(){return this._def.type}min(e,t){return new J({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new J({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new J({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}}function Y(e){if(e instanceof G){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=me.create(Y(n))}return new G({...e._def,shape:()=>t})}return e instanceof J?new J({...e._def,type:Y(e.element)}):e instanceof me?me.create(Y(e.unwrap())):e instanceof fe?fe.create(Y(e.unwrap())):e instanceof ae?ae.create(e.items.map((e=>Y(e)))):e}J.create=(e,t)=>new J({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...T(t)});class G extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=n.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof W&&"strip"===this._def.unknownKeys))for(const e in a.data)r.includes(e)||i.push(e);const d=[];for(const e of r){const t=n[e],r=a.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new w(a,r,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof W){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)d.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)i.length>0&&(h(a,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=a.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new w(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const a=await t.key;e.push({key:a,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>m.mergeObjectSync(t,e))):m.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new G({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var n,r,s,i;const o=null!==(s=null===(r=(n=this._def).errorMap)||void 0===r?void 0:r.call(n,t,a).message)&&void 0!==s?s:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=k.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new G({...this._def,unknownKeys:"strip"})}passthrough(){return new G({...this._def,unknownKeys:"passthrough"})}extend(e){return new G({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new G({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Te.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new G({...this._def,catchall:e})}pick(e){const t={};return n.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new G({...this._def,shape:()=>t})}omit(e){const t={};return n.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new G({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return n.objectKeys(this.shape).forEach((a=>{const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()})),new G({...this._def,shape:()=>t})}required(e){const t={};return n.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof me;)e=e._def.innerType;t[a]=e}})),new G({...this._def,shape:()=>t})}keyof(){return ce(n.objectKeys(this.shape))}}G.create=(e,t)=>new G({shape:()=>e,unknownKeys:"strip",catchall:W.create(),typeName:Te.ZodObject,...T(t)}),G.strictCreate=(e,t)=>new G({shape:()=>e,unknownKeys:"strict",catchall:W.create(),typeName:Te.ZodObject,...T(t)}),G.lazycreate=(e,t)=>new G({shape:e,unknownKeys:"strip",catchall:W.create(),typeName:Te.ZodObject,...T(t)});class H extends O{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new d(e.ctx.common.issues)));return h(t,{code:o.invalid_union,unionErrors:a}),f}));{let e;const n=[];for(const r of a){const a={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:a});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=n.map((e=>new d(e)));return h(t,{code:o.invalid_union,unionErrors:r}),f}}get options(){return this._def.options}}H.create=(e,t)=>new H({options:e,typeName:Te.ZodUnion,...T(t)});const X=e=>e instanceof oe?X(e.schema):e instanceof he?X(e.innerType()):e instanceof de?[e.value]:e instanceof ue?e.options:e instanceof le?Object.keys(e.enum):e instanceof ye?X(e._def.innerType):e instanceof V?[void 0]:e instanceof F?[null]:null;class Q extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f;const a=this.discriminator,n=t.data[a],r=this.optionsMap.get(n);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const n=new Map;for(const a of t){const t=X(a.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,a)}}return new Q({typeName:Te.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...T(a)})}}function ee(e,t){const a=i(e),r=i(t);if(e===t)return{valid:!0,data:e};if(a===s.object&&r===s.object){const a=n.objectKeys(t),r=n.objectKeys(e).filter((e=>-1!==a.indexOf(e))),s={...e,...t};for(const a of r){const n=ee(e[a],t[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(a===s.array&&r===s.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const r=ee(e[n],t[n]);if(!r.valid)return{valid:!1};a.push(r.data)}return{valid:!0,data:a}}return a===s.date&&r===s.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class te extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(_(e)||_(n))return f;const r=ee(e.value,n.value);return r.valid?((g(e)||g(n))&&t.dirty(),{status:t.value,value:r.data}):(h(a,{code:o.invalid_intersection_types}),f)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}te.create=(e,t,a)=>new te({left:e,right:t,typeName:Te.ZodIntersection,...T(a)});class ae extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.array)return h(a,{code:o.invalid_type,expected:s.array,received:a.parsedType}),f;if(a.data.length<this._def.items.length)return h(a,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new w(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(n).then((e=>m.mergeArray(t,e))):m.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ae({...this._def,rest:e})}}ae.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ae({items:e,typeName:Te.ZodTuple,rest:null,...T(t)})};class ne extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.object)return h(a,{code:o.invalid_type,expected:s.object,received:a.parsedType}),f;const n=[],r=this._def.keyType,i=this._def.valueType;for(const e in a.data)n.push({key:r._parse(new w(a,e,a.path,e)),value:i._parse(new w(a,a.data[e],a.path,e))});return a.common.async?m.mergeObjectAsync(t,n):m.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,a){return new ne(t instanceof O?{keyType:e,valueType:t,typeName:Te.ZodRecord,...T(a)}:{keyType:R.create(),valueType:e,typeName:Te.ZodRecord,...T(t)})}}class re extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.map)return h(a,{code:o.invalid_type,expected:s.map,received:a.parsedType}),f;const n=this._def.keyType,r=this._def.valueType,i=[...a.data.entries()].map((([e,t],s)=>({key:n._parse(new w(a,e,a.path,[s,"key"])),value:r._parse(new w(a,t,a.path,[s,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of i){const n=await a.key,r=await a.value;if("aborted"===n.status||"aborted"===r.status)return f;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of i){const n=a.key,r=a.value;if("aborted"===n.status||"aborted"===r.status)return f;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}}}re.create=(e,t,a)=>new re({valueType:t,keyType:e,typeName:Te.ZodMap,...T(a)});class se extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==s.set)return h(a,{code:o.invalid_type,expected:s.set,received:a.parsedType}),f;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(h(a,{code:o.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(h(a,{code:o.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const a=new Set;for(const n of e){if("aborted"===n.status)return f;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const d=[...a.data.values()].map(((e,t)=>r._parse(new w(a,e,a.path,t))));return a.common.async?Promise.all(d).then((e=>i(e))):i(d)}min(e,t){return new se({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new se({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}se.create=(e,t)=>new se({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,...T(t)});class ie extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return h(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),f;function a(e,a){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_arguments,argumentsError:a}})}function n(e,a){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_return_type,returnTypeError:a}})}const r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof pe){const e=this;return v((async function(...t){const s=new d([]),o=await e._def.args.parseAsync(t,r).catch((e=>{throw s.addIssue(a(t,e)),s})),c=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(c,r).catch((e=>{throw s.addIssue(n(c,e)),s}))}))}{const e=this;return v((function(...t){const s=e._def.args.safeParse(t,r);if(!s.success)throw new d([a(t,s.error)]);const o=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(o,r);if(!c.success)throw new d([n(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ie({...this._def,args:ae.create(e).rest(K.create())})}returns(e){return new ie({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ie({args:e||ae.create([]).rest(K.create()),returns:t||K.create(),typeName:Te.ZodFunction,...T(a)})}}class oe extends O{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})}}oe.create=(e,t)=>new oe({getter:e,typeName:Te.ZodLazy,...T(t)});class de extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ce(e,t){return new ue({values:e,typeName:Te.ZodEnum,...T(t)})}de.create=(e,t)=>new de({value:e,typeName:Te.ZodLiteral,...T(t)});class ue extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{expected:n.joinValues(a),received:t.parsedType,code:o.invalid_type}),f}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{received:t.data,code:o.invalid_enum_value,options:a}),f}return v(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){return ue.create(e)}exclude(e){return ue.create(this.options.filter((t=>!e.includes(t))))}}ue.create=ce;class le extends O{_parse(e){const t=n.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==s.string&&a.parsedType!==s.number){const e=n.objectValues(t);return h(a,{expected:n.joinValues(e),received:a.parsedType,code:o.invalid_type}),f}if(-1===t.indexOf(e.data)){const e=n.objectValues(t);return h(a,{received:a.data,code:o.invalid_enum_value,options:e}),f}return v(e.data)}get enum(){return this._def.values}}le.create=(e,t)=>new le({values:e,typeName:Te.ZodNativeEnum,...T(t)});class pe extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return h(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),f;const a=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return v(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}pe.create=(e,t)=>new pe({type:e,typeName:Te.ZodPromise,...T(t)});class he extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{h(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(a.data,s);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:a.path,parent:a}))):this._def.schema._parseSync({data:e,path:a.path,parent:a})}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?f:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?f:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===r.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!b(e))return e;const n=r.transform(e.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>b(e)?Promise.resolve(r.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}n.assertNever(r)}}he.create=(e,t,a)=>new he({schema:e,typeName:Te.ZodEffects,effect:t,...T(a)}),he.createWithPreprocess=(e,t,a)=>new he({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,...T(a)});class me extends O{_parse(e){return this._getType(e)===s.undefined?v(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(e,t)=>new me({innerType:e,typeName:Te.ZodOptional,...T(t)});class fe extends O{_parse(e){return this._getType(e)===s.null?v(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(e,t)=>new fe({innerType:e,typeName:Te.ZodNullable,...T(t)});class ye extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===s.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Te.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});class ve extends O{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return x(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new d(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Te.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});class _e extends O{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),f}return{status:"valid",value:e.data}}}_e.create=e=>new _e({typeName:Te.ZodNaN,...T(e)});const ge=Symbol("zod_brand");class be extends O{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class xe extends O{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),y(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})();{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new xe({in:e,out:t,typeName:Te.ZodPipeline})}}class ke extends O{_parse(e){const t=this._def.innerType._parse(e);return b(t)&&(t.value=Object.freeze(t.value)),t}}ke.create=(e,t)=>new ke({innerType:e,typeName:Te.ZodReadonly,...T(t)});const we=(e,t={},a)=>e?B.create().superRefine(((n,r)=>{var s,i;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:a)||void 0===i||i,d="string"==typeof e?{message:e}:e;r.addIssue({code:"custom",...d,fatal:o})}})):B.create(),Ze={object:G.lazycreate};var Te;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Te||(Te={}));const Oe=R.create,Se=$.create,Ne=_e.create,Ee=M.create,Ce=D.create,je=U.create,Pe=z.create,Ie=V.create,Ae=F.create,Re=B.create,Le=K.create,$e=W.create,Me=q.create,De=J.create,Ue=G.create,ze=G.strictCreate,Ve=H.create,Fe=Q.create,Be=te.create,Ke=ae.create,We=ne.create,qe=re.create,Je=se.create,Ye=ie.create,Ge=oe.create,He=de.create,Xe=ue.create,Qe=le.create,et=pe.create,tt=he.create,at=me.create,nt=fe.create,rt=he.createWithPreprocess,st=xe.create,it={string:e=>R.create({...e,coerce:!0}),number:e=>$.create({...e,coerce:!0}),boolean:e=>D.create({...e,coerce:!0}),bigint:e=>M.create({...e,coerce:!0}),date:e=>U.create({...e,coerce:!0})},ot=f;var dt=Object.freeze({__proto__:null,defaultErrorMap:c,setErrorMap:function(e){u=e},getErrorMap:l,makeIssue:p,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:m,INVALID:f,DIRTY:y,OK:v,isAborted:_,isDirty:g,isValid:b,isAsync:x,get util(){return n},get objectUtil(){return r},ZodParsedType:s,getParsedType:i,ZodType:O,ZodString:R,ZodNumber:$,ZodBigInt:M,ZodBoolean:D,ZodDate:U,ZodSymbol:z,ZodUndefined:V,ZodNull:F,ZodAny:B,ZodUnknown:K,ZodNever:W,ZodVoid:q,ZodArray:J,ZodObject:G,ZodUnion:H,ZodDiscriminatedUnion:Q,ZodIntersection:te,ZodTuple:ae,ZodRecord:ne,ZodMap:re,ZodSet:se,ZodFunction:ie,ZodLazy:oe,ZodLiteral:de,ZodEnum:ue,ZodNativeEnum:le,ZodPromise:pe,ZodEffects:he,ZodTransformer:he,ZodOptional:me,ZodNullable:fe,ZodDefault:ye,ZodCatch:ve,ZodNaN:_e,BRAND:ge,ZodBranded:be,ZodPipeline:xe,ZodReadonly:ke,custom:we,Schema:O,ZodSchema:O,late:Ze,get ZodFirstPartyTypeKind(){return Te},coerce:it,any:Re,array:De,bigint:Ee,boolean:Ce,date:je,discriminatedUnion:Fe,effect:tt,enum:Xe,function:Ye,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>we((t=>t instanceof e),t),intersection:Be,lazy:Ge,literal:He,map:qe,nan:Ne,nativeEnum:Qe,never:$e,null:Ae,nullable:nt,number:Se,object:Ue,oboolean:()=>Ce().optional(),onumber:()=>Se().optional(),optional:at,ostring:()=>Oe().optional(),pipeline:st,preprocess:rt,promise:et,record:We,set:Je,strictObject:ze,string:Oe,symbol:Pe,transformer:tt,tuple:Ke,undefined:Ie,union:Ve,unknown:Le,void:Me,NEVER:ot,ZodIssueCode:o,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:d})}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.m=a,r.c=n,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,a)=>(r.f[a](e,t),t)),[])),r.u=e=>e+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@kenyaemr/esm-bed-management-app:",r.l=(a,n,s,i)=>{if(e[a])e[a].push(n);else{var o,d;if(void 0!==s)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var l=c[u];if(l.getAttribute("src")==a||l.getAttribute("data-webpack")==t+s){o=l;break}}o||(d=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,r.nc&&o.setAttribute("nonce",r.nc),o.setAttribute("data-webpack",t+s),o.src=a),e[a]=[n];var p=(t,n)=>{o.onerror=o.onload=null,clearTimeout(h);var r=e[a];if(delete e[a],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach((e=>e(n))),t)return t(n)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),d&&document.head.appendChild(o)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{r.S={};var e={},t={};r.I=(a,n)=>{n||(n=[]);var s=t[a];if(s||(s=t[a]={}),!(n.indexOf(s)>=0)){if(n.push(s),e[a])return e[a];r.o(r.S,a)||(r.S[a]={});var i=r.S[a],o="@kenyaemr/esm-bed-management-app",d=(e,t,a,n)=>{var r=i[e]=i[e]||{},s=r[t];(!s||!s.loaded&&(!n!=!s.eager?n:o>s.from))&&(r[t]={get:a,from:o,eager:!!n})},c=[];return"default"===a&&(d("@openmrs/esm-framework","5.1.1-pre.986",(()=>Promise.all([r.e(800),r.e(672)]).then((()=>()=>r(4800))))),d("react-i18next","11.18.6",(()=>Promise.all([r.e(672),r.e(629)]).then((()=>()=>r(707))))),d("react-router-dom","6.15.0",(()=>Promise.all([r.e(26),r.e(672)]).then((()=>()=>r(8026))))),d("react","18.2.0",(()=>r.e(294).then((()=>()=>r(7294))))),d("rxjs","6.6.7",(()=>r.e(558).then((()=>()=>r(8558)))))),e[a]=c.length?Promise.all(c).then((()=>e[a]=1)):1}}})(),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var a=t.getElementsByTagName("script");if(a.length)for(var n=a.length-1;n>-1&&!e;)e=a[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),a=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=a[1]?t(a[1]):[];return a[2]&&(n.length++,n.push.apply(n,t(a[2]))),a[3]&&(n.push([]),n.push.apply(n,t(a[3]))),n},t=e=>{var a=e[0],n="";if(1===e.length)return"*";if(a+.5){n+=0==a?">=":-1==a?"<":1==a?"^":2==a?"~":a>0?"=":"!=";for(var r=1,s=1;s<e.length;s++)r--,n+="u"==(typeof(o=e[s]))[0]?"-":(r>0?".":"")+(r=2,o);return n}var i=[];for(s=1;s<e.length;s++){var o=e[s];i.push(0===o?"not("+d()+")":1===o?"("+d()+" || "+d()+")":2===o?i.pop()+" "+i.pop():t(o))}return d();function d(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(t,n)=>{if(0 in t){n=e(n);var r=t[0],s=r<0;s&&(r=-r-1);for(var i=0,o=1,d=!0;;o++,i++){var c,u,l=o<t.length?(typeof t[o])[0]:"";if(i>=n.length||"o"==(u=(typeof(c=n[i]))[0]))return!d||("u"==l?o>r&&!s:""==l!=s);if("u"==u){if(!d||"u"!=l)return!1}else if(d)if(l==u)if(o<=r){if(c!=t[o])return!1}else{if(s?c>t[o]:c<t[o])return!1;c!=t[o]&&(d=!1)}else if("s"!=l&&"n"!=l){if(s||o<=r)return!1;d=!1,o--}else{if(o<=r||u<l!=s)return!1;d=!1}else"s"!=l&&"n"!=l&&(d=!1,o--)}}var p=[],h=p.pop.bind(p);for(i=1;i<t.length;i++){var m=t[i];p.push(1==m?h()|h():2==m?h()&h():m?a(m,n):!h())}return!!h()},n=(t,a)=>{var n=t[a];return Object.keys(n).reduce(((t,a)=>!t||!n[t].loaded&&((t,a)=>{t=e(t),a=e(a);for(var n=0;;){if(n>=t.length)return n<a.length&&"u"!=(typeof a[n])[0];var r=t[n],s=(typeof r)[0];if(n>=a.length)return"u"==s;var i=a[n],o=(typeof i)[0];if(s!=o)return"o"==s&&"n"==o||"s"==o||"u"==s;if("o"!=s&&"u"!=s&&r!=i)return r<i;n++}})(t,a)?a:t),0)},s=(e,r,s,d)=>{var c=n(e,s);return a(d,c)||i(((e,a,n,r)=>"Unsatisfied version "+n+" from "+(n&&e[a][n].from)+" of shared singleton module "+a+" (required "+t(r)+")")(e,s,c,d)),o(e[s][c])},i=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},o=e=>(e.loaded=1,e.get()),d=e=>function(t,a,n,s){var i=r.I(t);return i&&i.then?i.then(e.bind(e,t,r.S[t],a,n,s)):e(t,r.S[t],a,n,s)},c=d(((e,t,a,s)=>t&&r.o(t,a)?((e,t,a,r)=>{var s=n(e,a);return o(e[a][s])})(t,0,a):s())),u=d(((e,t,a,n,i)=>t&&r.o(t,a)?s(t,0,a,n):i())),l={},p={3397:()=>u("default","react-i18next",[1,11],(()=>r.e(707).then((()=>()=>r(707))))),2437:()=>c("default","@openmrs/esm-framework/src/internal",(()=>r.e(800).then((()=>()=>r(4800))))),5222:()=>u("default","rxjs",[1,6],(()=>r.e(558).then((()=>()=>r(8558))))),1672:()=>u("default","react",[1,18],(()=>r.e(294).then((()=>()=>r(7294))))),1132:()=>u("default","@openmrs/esm-framework",[0],(()=>r.e(800).then((()=>()=>r(4800))))),1914:()=>u("default","react-router-dom",[1,6],(()=>r.e(26).then((()=>()=>r(8026)))))};[1132,1672,1914].forEach((e=>{r.m[e]=t=>{l[e]=0,delete r.c[e];var a=p[e]();if("function"!=typeof a)throw new Error("Shared module is not available for eager consumption: "+e);t.exports=a()}}));var h={397:[3397],404:[2437,5222],672:[1672]};r.f.consumes=(e,t)=>{r.o(h,e)&&h[e].forEach((e=>{if(r.o(l,e))return t.push(l[e]);var a=t=>{l[e]=0,r.m[e]=a=>{delete r.c[e],a.exports=t()}},n=t=>{delete l[e],r.m[e]=a=>{throw delete r.c[e],t}};try{var s=p[e]();s.then?t.push(l[e]=s.then(a).catch(n)):a(s)}catch(e){n(e)}}))}})(),(()=>{var e={179:0,672:0,283:0,352:0};r.f.j=(t,a)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)a.push(n[2]);else if(/^(397|672)$/.test(t))e[t]=0;else{var s=new Promise(((a,r)=>n=e[t]=[a,r]));a.push(n[2]=s);var i=r.p+r.u(t),o=new Error;r.l(i,(a=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.src;o.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",o.name="ChunkLoadError",o.type=s,o.request=i,n[1](o)}}),"chunk-"+t,t)}};var t=(t,a)=>{var n,s,[i,o,d]=a,c=0;if(i.some((t=>0!==e[t]))){for(n in o)r.o(o,n)&&(r.m[n]=o[n]);d&&d(r)}for(t&&t(a);c<i.length;c++)s=i[c],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},a=globalThis.webpackChunk_kenyaemr_esm_bed_management_app=globalThis.webpackChunk_kenyaemr_esm_bed_management_app||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),r.nc=void 0,r(1283)})();