@kosdev-code/kos-ddk-model-components 0.1.0-dev.5099 → 0.1.0-dev.5105

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.
@@ -1 +1 @@
1
- {"version":3,"file":"use-plugin-extensions.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/plugin-extensions/use-plugin-extensions.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,kEAGpB,CAAC;sCAKU,MAAM;CAmB5B,CAAC"}
1
+ {"version":3,"file":"use-plugin-extensions.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/plugin-extensions/use-plugin-extensions.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,kEAGpB,CAAC;sCA2BU,MAAM;CA2B5B,CAAC"}
package/index.cjs CHANGED
@@ -161,7 +161,7 @@
161
161
  box-sizing: border-box;
162
162
  padding: ${t=>t.compact?"var(--ddk-component-input-enable-card-toggle-container-padding)":"0"};
163
163
  width: var(--ddk-component-input-enable-card-toggle-container-width);
164
- `,xs=({configProperties:t,disabled:e,enabledConfigProperty:n})=>{const{value:s}=u.useConfigProperty({configProperty:n}),o=s==="true",{componentModeOverride:a}=l.useComponentConfigurationContext(),c=t.length===1,i=c?Mo:gs;return r.jsxs(Ro,{disabled:!o||e,mode:a,children:[r.jsx(Fo,{children:t.map(d=>r.jsx(i,{disabled:!o||e,label:d.options?d.options.label:void 0,configProperty:d.configProperty,collapse:!c&&a==="standard",layout:d.options?d.options.layout:void 0,float:!0,hideUnits:d.options?d.options.hideUnits:void 0},d.configProperty.id))}),r.jsx(Bo,{compact:!c||a==="compact",children:r.jsx(Pe,{alwaysShowLabel:!0,collapse:!0,configProperty:n,disabled:e,stretch:a==="compact"})})]})},Vo=({configProperty:t,disabled:e,enabledConfigProperty:n,options:s})=>{const o=p.useMemo(()=>[{configProperty:t,options:s}],[t,s]);return r.jsx(xs,{configProperties:o,disabled:e,enabledConfigProperty:n})},vs=({configProperty:t,...e})=>{const{value:n}=u.useConfigProperty({configProperty:t}),s=o=>{o!==void 0&&(t==null||t.updateProperty(String(o)))};return r.jsx(l.SwitchCard,{...e,onChange:s,value:n})},ys=({description:t,float:e,label:n,modalTitle:s,onSave:o,time:a,...c})=>{const{regionModel:i}=u.useKosRegions(),{t:d}=u.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:f,hourOptions:h,minuteOptions:g,setTime:y,time:b}=u.useRegionTimeProps({initialDate:a}),v=b.getHours(),w=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v<12?v:v-12,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:v<12?"AM":"PM"}],[m,h,g,b,v]),P=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0}],[h,g,b,v]);return r.jsx(l.MultiPickerCard,{...c,cancelButtonLabel:d("discard-changes","Discard Changes")||void 0,closeButtonLabel:d("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?w:P,description:t,displayValue:f,float:e,icon:ye.TimeIcon,label:n,modalTitle:s,proceedButtonLabel:d("save","Save")||void 0,onSave:O=>{const E=i!=null&&i.is12HourTimeFormat?O.ampm==="AM"?O.hr:O.hr+12:O.hr,j=O.min,_=new Date(b);_.setHours(E),_.setMinutes(j),y(_),o==null||o({hours:E,minutes:j})}})},bs=({configProperty:t,...e})=>{var f;const{getStagedChange:n,updateStagedChange:s}=Rt(),{value:o}=u.useConfigProperty({configProperty:t}),a=((f=n==null?void 0:n(t.id))==null?void 0:f.value)??o,{hours:c,minutes:i}=D.toTimeComponents(Number(a)),d=new Date;d.setHours(c),d.setMinutes(i);const m=h=>{const g=D.toSeconds(h.hours,h.minutes);s?s(t.id,{configProperty:t,value:g}):t.updateProperty(g)};return r.jsx(ys,{...e,onSave:m,time:d})},$o=[0,6],Cs=({day:t=new Date().getDate(),month:e=new Date().getMonth(),onSave:n,year:s=new Date().getFullYear(),...o})=>{var y,b,v,w,P,O;const{t:a}=u.useKosTranslation("region"),{regionModel:c}=u.useKosRegions(),i=u.useDateProps({date:{year:s,month:e,day:t},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(c==null?void 0:c.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:$o,yearsRange:[s-10,s+10]}}),d=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.yearsOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:_.label}))},[(y=i==null?void 0:i.dateState)==null?void 0:y.yearsOptionsArray]),m=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.daysOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:_.label}))},[(b=i==null?void 0:i.dateState)==null?void 0:b.daysOptionsArray]),f=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.monthsOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:String(_.label)}))},[(v=i==null?void 0:i.dateState)==null?void 0:v.monthsOptionsArray]),h=p.useMemo(()=>{const E=[];return c==null||c.selectedDateOrder.split("").forEach(j=>{var _,$,z;j==="y"?E.push({id:"year",items:d,selectedItemId:(_=i==null?void 0:i.dateState)==null?void 0:_.year,loop:!1}):j==="m"?E.push({id:"month",items:f,selectedItemId:($=i==null?void 0:i.dateState)==null?void 0:$.month}):j==="d"&&E.push({id:"day",items:m,selectedItemId:(z=i==null?void 0:i.dateState)==null?void 0:z.day,loop:!1})}),E},[(w=i==null?void 0:i.dateState)==null?void 0:w.day,(P=i==null?void 0:i.dateState)==null?void 0:P.month,(O=i==null?void 0:i.dateState)==null?void 0:O.year,m,f,c==null?void 0:c.selectedDateOrder,d]),g=p.useCallback(async E=>{const _=new Date(E.year,E.month+1,0).getDate(),$=E.day>_?1:E.day;n({day:$,month:E.month,year:E.year})},[n]);return r.jsx(l.MultiPickerCard,{cancelButtonLabel:a("discard-changes","Discard Changes")||void 0,closeButtonLabel:a("close","Close")||void 0,data:h,displayValue:i.dateState.formattedDate,icon:ye.CalendarIcon,label:a("todays-date","Today's Date"),onSave:g,proceedButtonLabel:a("save","Save")||void 0,...o})},ws=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,o]=p.useState("idle"),[a,c]=p.useState(),i=p.useCallback(async()=>{o("test"),c(void 0);const m=await t.performElectricalTest();m.error?(c(m.error),o("failure")):m.result==="errEEPROM"?(c("errEEPROM"),o("failure")):o("success")},[t]),d=p.useMemo(()=>({idle:{information:r.jsx(l.LabelInformation,{children:n("perform-electrical-test")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")})},test:{information:r.jsx(l.LabelInformation,{children:n("testing")}),footer:r.jsx(l.Button,{disabled:!0,children:n("electrical-test")}),status:"loading"},success:{information:r.jsx(l.LabelInformation,{children:n("electrical-test-success-header")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"success"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("electrical-test-failure-header")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a}`)})]}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"information"}}),[a,n,i]);return r.jsx(l.WorkflowModal,{title:n(t.name),...d[s],onClose:()=>e()})}),Tt={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Ko=t=>{const[e,n]=p.useState(null),[s,o]=p.useState(Tt),a=t.map(c=>{const[i,,d]=c;return[i==null?void 0:i.future,i,d]}).flat();return p.useEffect(()=>{const c=t.find(i=>{const[d]=i;return!!(d!=null&&d.future)});c?(n(c[0]),o(c[2])):(n(null),o(Tt))},[...a,t]),[e,s]},Uo=t=>{switch(t){case"calibrate":return Gn;case"fixed-45":return Yn;case"flush":return Jn;case"high-flow-test":return Qn;case"hold-to-pour":return es;case"low-flow-test":return ts;case"manual-override":return ns;case"msv-reset":return ss;case"prime":return os;case"purge":return rs;default:return}},zo=t=>(e,n="intents")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),be=(t,e=Uo)=>{const{t:n}=u.useKosTranslation("troubles"),[s,o]=p.useState(null),[a,c]=p.useState(Tt),i=p.useCallback(async d=>{const m=e(d);if(m){const f=zo(n)(d);c(f);const h=new m(t);await h.performAction(),o(h)}},[e,t,n]);return[s,i,a]},Zo=t=>(u.KosLog.debug(`pumpActionFactory: actionId=${t}`),is),Ho=t=>(e,n="troubles")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),Wo=(t,e,n=Zo)=>{const{t:s}=u.useKosTranslation("troubles"),[o,a]=p.useState(null),[c]=p.useState(Ho(s)(e)),i=p.useCallback(async()=>{const d=n(e);if(d){const m=new d(t,e);await m.performAction(),a(m)}},[n,t,e]);return[o,i,c]};function Xo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ot();return r.jsx(o,{...s,children:r.jsx(t,{...e,agitationControl:n})})}}const Ft=()=>{const t=D.Animation.type;return u.useKosModel({modelId:t,modelType:D.Animation.type,options:{}})};function _s(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ft();return r.jsx(o,{...s,children:r.jsx(t,{...e,animation:n})})}}const Le=()=>{const t=D.Application.type;return u.useKosModel({modelId:t,modelType:D.Application.type,options:{}})};function qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Le();return r.jsx(o,{...s,children:r.jsx(t,{...e,application:n})})}}const ks=()=>{const t=D.CarbWater.type;return u.useKosModel({modelId:t,modelType:D.CarbWater.type,options:{}})};function Go(t){return e=>{const{model:n,status:s,KosModelLoader:o}=ks();return r.jsx(o,{...s,children:r.jsx(t,{...e,carbWater:n})})}}const Ss=()=>{const t=D.CopyLogs.type;return u.useKosModel({modelId:t,modelType:D.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function Yo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ss();return r.jsx(o,{...s,children:r.jsx(t,{...e,copyLogs:n})})}}const Mt=()=>{const t=D.DashboardOperations.type;return u.useKosModel({modelId:t,modelType:D.DashboardOperations.type,options:{}})};function Jo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dashboardOperations:n})})}}const Bt=()=>{const t=D.DispenserInfo.type;return u.useKosModel({modelId:t,modelType:D.DispenserInfo.type,options:{}})};function Ts(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Bt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dispenserInfo:n})})}}const js=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.Door.type,options:{}})};function Qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=js(e.id);return r.jsx(o,{...s,children:r.jsx(t,{...e,door:n})})}}var F;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const a={};for(const c of o)a[c]=c;return a},t.getValidEnumValues=o=>{const a=t.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),c={};for(const i of a)c[i]=o[i];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(a){return o[a]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const a=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&a.push(c);return a},t.find=(o,a)=>{for(const c of o)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function s(o,a=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(F||(F={}));var Cn;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Cn||(Cn={}));const k=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},x=F.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 q extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)s._errors.push(n(c));else{let i=s,d=0;for(;d<c.path.length;){const m=c.path[d];d===c.path.length-1?(i[m]=i[m]||{_errors:[]},i[m]._errors.push(n(c))):i[m]=i[m]||{_errors:[]},i=i[m],d++}}};return o(this),s}static assert(e){if(!(e instanceof q))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},s=[];for(const o of this.issues)if(o.path.length>0){const a=o.path[0];n[a]=n[a]||[],n[a].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}q.create=t=>new q(t);const jt=(t,e)=>{let n;switch(t.code){case x.invalid_type:t.received===k.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,F.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:n=`Unrecognized key(s) in object: ${F.joinValues(t.keys,", ")}`;break;case x.invalid_union:n="Invalid input";break;case x.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${F.joinValues(t.options)}`;break;case x.invalid_enum_value:n=`Invalid enum value. Expected ${F.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:n="Invalid function arguments";break;case x.invalid_return_type:n="Invalid function return type";break;case x.invalid_date:n="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:F.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case x.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case x.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case x.custom:n="Invalid input";break;case x.invalid_intersection_types:n="Intersection results could not be merged";break;case x.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:n="Number must be finite";break;default:n=e.defaultError,F.assertNever(t)}return{message:n}};let er=jt;function tr(){return er}const nr=t=>{const{data:e,path:n,errorMaps:s,issueData:o}=t,a=[...n,...o.path||[]],c={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let i="";const d=s.filter(m=>!!m).slice().reverse();for(const m of d)i=m(c,{data:e,defaultError:i}).message;return{...o,path:a,message:i}};function C(t,e){const n=tr(),s=nr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===jt?void 0:jt].filter(o=>!!o)});t.common.issues.push(s)}class U{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const s=[];for(const o of n){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),s.push(o.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const o of n){const a=await o.key,c=await o.value;s.push({key:a,value:c})}return U.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const o of n){const{key:a,value:c}=o;if(a.status==="aborted"||c.status==="aborted")return A;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(s[a.value]=c.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),Ie=t=>({status:"dirty",value:t}),Z=t=>({status:"valid",value:t}),wn=t=>t.status==="aborted",_n=t=>t.status==="dirty",fe=t=>t.status==="valid",Xe=t=>typeof Promise<"u"&&t instanceof Promise;var T;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(T||(T={}));class ne{constructor(e,n,s,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kn=(t,e)=>{if(fe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new q(t.common.issues);return this._error=n,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:s,description:o}=t;if(e&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(c,i)=>{const{message:d}=t;return c.code==="invalid_enum_value"?{message:d??i.defaultError}:typeof i.data>"u"?{message:d??s??i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:d??n??i.defaultError}},description:o}}class R{get description(){return this._def.description}_getType(e){return J(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new U,ctx:{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xe(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){const s={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parseSync({data:e,path:s.path,parent:s});return kn(s,o)}"~validate"(e){var s,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return fe(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(o=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>fe(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parse({data:e,path:s.path,parent:s}),a=await(Xe(o)?o:Promise.resolve(o));return kn(s,a)}refine(e,n){const s=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,a)=>{const c=e(o),i=()=>a.addIssue({code:x.custom,...s(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(d=>d?!0:(i(),!1)):c?!0:(i(),!1)})}refinement(e,n){return this._refinement((s,o)=>e(s)?!0:(o.addIssue(typeof n=="function"?n(s,o):n),!1))}_refinement(e){return new xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return te.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return Je.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ye.create(this,e,this._def)}transform(e){return new xe({...L(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Pt({...L(this._def),innerType:this,defaultValue:n,typeName:N.ZodDefault})}brand(){return new Sr({typeName:N.ZodBranded,type:this,...L(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new At({...L(this._def),innerType:this,catchValue:n,typeName:N.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Vt.create(this,e)}readonly(){return Nt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sr=/^c[^\s-]{8,}$/i,or=/^[0-9a-z]+$/,rr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ar=/^[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,ir=/^[a-z0-9_-]{21}$/i,cr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ur="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kt;const mr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Is="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vr=new RegExp(`^${Is}$`);function Es(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function yr(t){return new RegExp(`^${Es(t)}$`)}function br(t){let e=`${Is}T${Es(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Cr(t,e){return!!((e==="v4"||!e)&&mr.test(t)||(e==="v6"||!e)&&hr.test(t))}function wr(t,e){if(!cr.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(s));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function _r(t,e){return!!((e==="v4"||!e)&&pr.test(t)||(e==="v6"||!e)&&fr.test(t))}class Q extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.string,received:a.parsedType}),A}const s=new U;let o;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const c=e.data.length>a.value,i=e.data.length<a.value;(c||i)&&(o=this._getOrReturnCtx(e,o),c?C(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&C(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")dr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"email",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")kt||(kt=new RegExp(ur,"u")),kt.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"emoji",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")ar.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"uuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")ir.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"nanoid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")sr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")or.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cuid2",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")rr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"ulid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),C(o,{validation:"url",code:x.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"regex",code:x.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?br(a).test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?vr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?yr(a).test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?lr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"duration",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Cr(e.data,a.version)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"ip",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?wr(e.data,a.alg)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"jwt",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?_r(e.data,a.version)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cidr",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?gr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"base64",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?xr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"base64url",code:x.invalid_string,message:a.message}),s.dirty()):F.assertNever(a);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(o=>e.test(o),{validation:n,code:x.invalid_string,...T.errToObj(s)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...T.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...T.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...T.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...T.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...T.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...T.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...T.errToObj(n)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Q.create=t=>new Q({checks:[],typeName:N.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});function kr(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=n>s?n:s,a=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return a%c/10**o}class Ae extends R{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)!==k.number){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.number,received:a.parsedType}),A}let s;const o=new U;for(const a of this._def.checks)a.kind==="int"?F.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:x.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?kr(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_finite,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,T.toString(n))}gt(e,n){return this.setLimit("min",e,!1,T.toString(n))}lte(e,n){return this.setLimit("max",e,!0,T.toString(n))}lt(e,n){return this.setLimit("max",e,!1,T.toString(n))}setLimit(e,n,s,o){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:T.toString(o)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Ae.create=t=>new Ae({checks:[],typeName:N.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class Ne extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let s;const o=new U;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:k.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,T.toString(n))}gt(e,n){return this.setLimit("min",e,!1,T.toString(n))}lte(e,n){return this.setLimit("max",e,!0,T.toString(n))}lt(e,n){return this.setLimit("max",e,!1,T.toString(n))}setLimit(e,n,s,o){return new Ne({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:T.toString(o)}]})}_addCheck(e){return new Ne({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ne.create=t=>new Ne({checks:[],typeName:N.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});class Sn extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.boolean,received:s.parsedType}),A}return Z(e.data)}}Sn.create=t=>new Sn({typeName:N.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class qe extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.date,received:a.parsedType}),A}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_date}),A}const s=new U;let o;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):F.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qe({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}qe.create=t=>new qe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:N.ZodDate,...L(t)});class Tn extends R{_parse(e){if(this._getType(e)!==k.symbol){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.symbol,received:s.parsedType}),A}return Z(e.data)}}Tn.create=t=>new Tn({typeName:N.ZodSymbol,...L(t)});class jn extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.undefined,received:s.parsedType}),A}return Z(e.data)}}jn.create=t=>new jn({typeName:N.ZodUndefined,...L(t)});class In extends R{_parse(e){if(this._getType(e)!==k.null){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.null,received:s.parsedType}),A}return Z(e.data)}}In.create=t=>new In({typeName:N.ZodNull,...L(t)});class En extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}En.create=t=>new En({typeName:N.ZodAny,...L(t)});class Pn extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}Pn.create=t=>new Pn({typeName:N.ZodUnknown,...L(t)});class se extends R{_parse(e){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:k.never,received:n.parsedType}),A}}se.create=t=>new se({typeName:N.ZodNever,...L(t)});class An extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.void,received:s.parsedType}),A}return Z(e.data)}}An.create=t=>new An({typeName:N.ZodVoid,...L(t)});class W extends R{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),o=this._def;if(n.parsedType!==k.array)return C(n,{code:x.invalid_type,expected:k.array,received:n.parsedType}),A;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,i=n.data.length<o.exactLength.value;(c||i)&&(C(n,{code:c?x.too_big:x.too_small,minimum:i?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),s.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(C(n,{code:x.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),s.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(C(n,{code:x.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((c,i)=>o.type._parseAsync(new ne(n,c,n.path,i)))).then(c=>U.mergeArray(s,c));const a=[...n.data].map((c,i)=>o.type._parseSync(new ne(n,c,n.path,i)));return U.mergeArray(s,a)}get element(){return this._def.type}min(e,n){return new W({...this._def,minLength:{value:e,message:T.toString(n)}})}max(e,n){return new W({...this._def,maxLength:{value:e,message:T.toString(n)}})}length(e,n){return new W({...this._def,exactLength:{value:e,message:T.toString(n)}})}nonempty(e){return this.min(1,e)}}W.create=(t,e)=>new W({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...L(e)});function pe(t){if(t instanceof B){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=te.create(pe(s))}return new B({...t._def,shape:()=>e})}else return t instanceof W?new W({...t._def,type:pe(t.element)}):t instanceof te?te.create(pe(t.unwrap())):t instanceof ve?ve.create(pe(t.unwrap())):t instanceof ie?ie.create(t.items.map(e=>pe(e))):t}class B extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=F.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==k.object){const m=this._getOrReturnCtx(e);return C(m,{code:x.invalid_type,expected:k.object,received:m.parsedType}),A}const{status:s,ctx:o}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof se&&this._def.unknownKeys==="strip"))for(const m in o.data)c.includes(m)||i.push(m);const d=[];for(const m of c){const f=a[m],h=o.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new ne(o,h,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof se){const m=this._def.unknownKeys;if(m==="passthrough")for(const f of i)d.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(m==="strict")i.length>0&&(C(o,{code:x.unrecognized_keys,keys:i}),s.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const f of i){const h=o.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new ne(o,h,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const m=[];for(const f of d){const h=await f.key,g=await f.value;m.push({key:h,value:g,alwaysSet:f.alwaysSet})}return m}).then(m=>U.mergeObjectSync(s,m)):U.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new B({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var a,c;const o=((c=(a=this._def).errorMap)==null?void 0:c.call(a,n,s).message)??s.defaultError;return n.code==="unrecognized_keys"?{message:T.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new B({...this._def,unknownKeys:"strip"})}passthrough(){return new B({...this._def,unknownKeys:"passthrough"})}extend(e){return new B({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new B({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new B({...this._def,catchall:e})}pick(e){const n={};for(const s of F.objectKeys(e))e[s]&&this.shape[s]&&(n[s]=this.shape[s]);return new B({...this._def,shape:()=>n})}omit(e){const n={};for(const s of F.objectKeys(this.shape))e[s]||(n[s]=this.shape[s]);return new B({...this._def,shape:()=>n})}deepPartial(){return pe(this)}partial(e){const n={};for(const s of F.objectKeys(this.shape)){const o=this.shape[s];e&&!e[s]?n[s]=o:n[s]=o.optional()}return new B({...this._def,shape:()=>n})}required(e){const n={};for(const s of F.objectKeys(this.shape))if(e&&!e[s])n[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof te;)a=a._def.innerType;n[s]=a}return new B({...this._def,shape:()=>n})}keyof(){return Ps(F.objectKeys(this.shape))}}B.create=(t,e)=>new B({shape:()=>t,unknownKeys:"strip",catchall:se.create(),typeName:N.ZodObject,...L(e)});B.strictCreate=(t,e)=>new B({shape:()=>t,unknownKeys:"strict",catchall:se.create(),typeName:N.ZodObject,...L(e)});B.lazycreate=(t,e)=>new B({shape:t,unknownKeys:"strip",catchall:se.create(),typeName:N.ZodObject,...L(e)});class Ge extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function o(a){for(const i of a)if(i.result.status==="valid")return i.result;for(const i of a)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;const c=a.map(i=>new q(i.ctx.common.issues));return C(n,{code:x.invalid_union,unionErrors:c}),A}if(n.common.async)return Promise.all(s.map(async a=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let a;const c=[];for(const d of s){const m={...n,common:{...n.common,issues:[]},parent:null},f=d._parseSync({data:n.data,path:n.path,parent:m});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const i=c.map(d=>new q(d));return C(n,{code:x.invalid_union,unionErrors:i}),A}}get options(){return this._def.options}}Ge.create=(t,e)=>new Ge({options:t,typeName:N.ZodUnion,...L(e)});function It(t,e){const n=J(t),s=J(e);if(t===e)return{valid:!0,data:t};if(n===k.object&&s===k.object){const o=F.objectKeys(e),a=F.objectKeys(t).filter(i=>o.indexOf(i)!==-1),c={...t,...e};for(const i of a){const d=It(t[i],e[i]);if(!d.valid)return{valid:!1};c[i]=d.data}return{valid:!0,data:c}}else if(n===k.array&&s===k.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let a=0;a<t.length;a++){const c=t[a],i=e[a],d=It(c,i);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===k.date&&s===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ye extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=(a,c)=>{if(wn(a)||wn(c))return A;const i=It(a.value,c.value);return i.valid?((_n(a)||_n(c))&&n.dirty(),{status:n.value,value:i.data}):(C(s,{code:x.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Ye.create=(t,e,n)=>new Ye({left:t,right:e,typeName:N.ZodIntersection,...L(n)});class ie extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.array)return C(s,{code:x.invalid_type,expected:k.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return C(s,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(C(s,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...s.data].map((c,i)=>{const d=this._def.items[i]||this._def.rest;return d?d._parse(new ne(s,c,s.path,i)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>U.mergeArray(n,c)):U.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new ie({...this._def,rest:e})}}ie.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ie({items:t,typeName:N.ZodTuple,rest:null,...L(e)})};class Nn extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.map)return C(s,{code:x.invalid_type,expected:k.map,received:s.parsedType}),A;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([i,d],m)=>({key:o._parse(new ne(s,i,s.path,[m,"key"])),value:a._parse(new ne(s,d,s.path,[m,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const d of c){const m=await d.key,f=await d.value;if(m.status==="aborted"||f.status==="aborted")return A;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}})}else{const i=new Map;for(const d of c){const m=d.key,f=d.value;if(m.status==="aborted"||f.status==="aborted")return A;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}}}}Nn.create=(t,e,n)=>new Nn({valueType:e,keyType:t,typeName:N.ZodMap,...L(n)});class De extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.set)return C(s,{code:x.invalid_type,expected:k.set,received:s.parsedType}),A;const o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(C(s,{code:x.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&s.data.size>o.maxSize.value&&(C(s,{code:x.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const a=this._def.valueType;function c(d){const m=new Set;for(const f of d){if(f.status==="aborted")return A;f.status==="dirty"&&n.dirty(),m.add(f.value)}return{status:n.value,value:m}}const i=[...s.data.values()].map((d,m)=>a._parse(new ne(s,d,s.path,m)));return s.common.async?Promise.all(i).then(d=>c(d)):c(i)}min(e,n){return new De({...this._def,minSize:{value:e,message:T.toString(n)}})}max(e,n){return new De({...this._def,maxSize:{value:e,message:T.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}De.create=(t,e)=>new De({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...L(e)});class Dn extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Dn.create=(t,e)=>new Dn({getter:t,typeName:N.ZodLazy,...L(e)});class Et extends R{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return C(n,{received:n.data,code:x.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}Et.create=(t,e)=>new Et({value:t,typeName:N.ZodLiteral,...L(e)});function Ps(t,e){return new ge({values:t,typeName:N.ZodEnum,...L(e)})}class ge extends R{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return C(n,{expected:F.joinValues(s),received:n.parsedType,code:x.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return C(n,{received:n.data,code:x.invalid_enum_value,options:s}),A}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ge.create(e,{...this._def,...n})}exclude(e,n=this._def){return ge.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}ge.create=Ps;class On extends R{_parse(e){const n=F.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==k.string&&s.parsedType!==k.number){const o=F.objectValues(n);return C(s,{expected:F.joinValues(o),received:s.parsedType,code:x.invalid_type}),A}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=F.objectValues(n);return C(s,{received:s.data,code:x.invalid_enum_value,options:o}),A}return Z(e.data)}get enum(){return this._def.values}}On.create=(t,e)=>new On({values:t,typeName:N.ZodNativeEnum,...L(e)});class Je extends R{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==k.promise&&n.common.async===!1)return C(n,{code:x.invalid_type,expected:k.promise,received:n.parsedType}),A;const s=n.parsedType===k.promise?n.data:Promise.resolve(n.data);return Z(s.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Je.create=(t,e)=>new Je({type:t,typeName:N.ZodPromise,...L(e)});class xe extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=this._def.effect||null,a={addIssue:c=>{C(s,c),c.fatal?n.abort():n.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){const c=o.transform(s.data,a);if(s.common.async)return Promise.resolve(c).then(async i=>{if(n.value==="aborted")return A;const d=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return d.status==="aborted"?A:d.status==="dirty"||n.value==="dirty"?Ie(d.value):d});{if(n.value==="aborted")return A;const i=this._def.schema._parseSync({data:c,path:s.path,parent:s});return i.status==="aborted"?A:i.status==="dirty"||n.value==="dirty"?Ie(i.value):i}}if(o.type==="refinement"){const c=i=>{const d=o.refinement(i,a);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?A:(i.status==="dirty"&&n.dirty(),c(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?A:(i.status==="dirty"&&n.dirty(),c(i.value).then(()=>({status:n.value,value:i.value}))))}if(o.type==="transform")if(s.common.async===!1){const c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!fe(c))return A;const i=o.transform(c.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>fe(c)?Promise.resolve(o.transform(c.value,a)).then(i=>({status:n.value,value:i})):A);F.assertNever(o)}}xe.create=(t,e,n)=>new xe({schema:t,typeName:N.ZodEffects,effect:e,...L(n)});xe.createWithPreprocess=(t,e,n)=>new xe({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...L(n)});class te extends R{_parse(e){return this._getType(e)===k.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}te.create=(t,e)=>new te({innerType:t,typeName:N.ZodOptional,...L(e)});class ve extends R{_parse(e){return this._getType(e)===k.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(t,e)=>new ve({innerType:t,typeName:N.ZodNullable,...L(e)});class Pt extends R{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===k.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Pt.create=(t,e)=>new Pt({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class At extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Xe(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}At.create=(t,e)=>new At({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class Ln extends R{_parse(e){if(this._getType(e)!==k.nan){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.nan,received:s.parsedType}),A}return{status:"valid",value:e.data}}}Ln.create=t=>new Ln({typeName:N.ZodNaN,...L(t)});class Sr extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class Vt extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?A:a.status==="dirty"?(n.dirty(),Ie(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?A:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(e,n){return new Vt({in:e,out:n,typeName:N.ZodPipeline})}}class Nt extends R{_parse(e){const n=this._def.innerType._parse(e),s=o=>(fe(o)&&(o.value=Object.freeze(o.value)),o);return Xe(n)?n.then(o=>s(o)):s(n)}unwrap(){return this._def.innerType}}Nt.create=(t,e)=>new Nt({innerType:t,typeName:N.ZodReadonly,...L(e)});var N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));const X=Q.create;se.create;W.create;Ge.create;Ye.create;ie.create;const st=Et.create,Tr=ge.create;Je.create;te.create;ve.create;const Rn=I.createExtensionSchema({type:st("dashboard.summary").describe("Extension type, must be 'dashboard.summary'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this summary belongs to")},{rankable:!0}),ot=I.extensionPointId("ddk","dashboard","summary"),jr=I.defineExtensionPoint({id:ot,contributionKey:"dashboardSummary",displayName:"Dashboard Summary",description:"Extension point for dashboard summary plugin configurations with view support",hasView:!0,isRankable:!0,schema:Rn,metadata:{exportName:"DashboardSummaryExtension",category:"Dashboard",tags:["dashboard","summary","visualization"]},validate:(t,e)=>{I.validateWithSchema(Rn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Ir=ot,Er=`${ot}.def`,Pr=`${ot}.view`,Fn=I.createExtensionSchema({type:st("dashboard.detail").describe("Extension type, must be 'dashboard.detail'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this detail belongs to")},{rankable:!0}),rt=I.extensionPointId("ddk","dashboard","detail"),Ar=I.defineExtensionPoint({id:rt,contributionKey:"dashboardDetail",displayName:"Dashboard Detail",description:"Extension point for dashboard detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Fn,metadata:{exportName:"DashboardDetailExtension",category:"Dashboard",tags:["dashboard","detail","visualization"]},validate:(t,e)=>{I.validateWithSchema(Fn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Nr=rt,Dr=`${rt}.def`,Or=`${rt}.view`,Mn=I.createExtensionSchema({type:st("dashboard.detail.pump").describe("Extension type, must be 'dashboard.detail.pump'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to match this extension with specific dashboard pumps")},{rankable:!0}),at=I.extensionPointId("ddk","dashboard","pump-detail"),Oe=I.defineExtensionPoint({id:at,contributionKey:"dashboardPumpDetail",displayName:"Dashboard Pump Detail",description:"Extension point for dashboard pump detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Mn,metadata:{exportName:"DashboardPumpDetailExtension"},validate:(t,e)=>{I.validateWithSchema(Mn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Lr=at,Rr=`${at}.def`,Fr=`${at}.view`,Bn=I.createExtensionSchema({cuiDescriptor:X().min(1,"CUI descriptor is required").describe("Descriptor used to identify and categorize the CUI functionality"),modalMode:Tr(["fullscreen","maximized"]).optional().describe("Modal display mode for the CUI interface")}),it=I.extensionPointId("ddk","cui"),As=I.defineExtensionPoint({id:it,contributionKey:"cui",displayName:"CUI (Consumer User Interface)",description:"Extension point for CUI plugin configurations with view support",hasView:!0,isRankable:!1,schema:Bn,metadata:{exportName:"CuiExtension",category:"Interface",tags:["cui","user-interface","consumer"]},validate:(t,e)=>{I.validateWithSchema(Bn,t,e)&&I.validateDescriptorFormat("CUI descriptor",t.cuiDescriptor,e)},transform:I.createViewAwareTransform()}),Mr=it,Br=`${it}.def`,Vr=`${it}.view`,Vn=I.createExtensionSchema({navDescriptor:X().min(1,"Navigation descriptor is required").describe("Descriptor used to identify and map the navigation functionality")}),ct=I.extensionPointId("ddk","nav","view"),$r=I.defineExtensionPoint({id:ct,contributionKey:"navViews",displayName:"Navigation Views",description:"Extension point for navigation view plugin configurations with view support",hasView:!0,isRankable:!1,schema:Vn,metadata:{exportName:"NavViewExtension",category:"Navigation",tags:["navigation","nav","views","routing"]},validate:(t,e)=>{I.validateWithSchema(Vn,t,e)&&I.validateDescriptorFormat("Navigation descriptor",t.navDescriptor,e)},transform:I.createViewAwareTransform()}),Kr=ct,Ur=`${ct}.def`,zr=`${ct}.view`,$n=I.createExtensionSchema({setupDescriptor:X().min(1,"Setup descriptor is required").describe("Descriptor used to identify and categorize the setup step")},{rankable:!0}),lt=I.extensionPointId("ddk","setup"),$t=I.defineExtensionPoint({id:lt,contributionKey:"setupStep",displayName:"Setup Steps",description:"Extension point for setup step plugin configurations with view support",hasView:!0,isRankable:!0,schema:$n,metadata:{exportName:"SetupExtension",category:"Setup",tags:["setup","configuration","steps","wizard"]},validate:(t,e)=>{I.validateWithSchema($n,t,e)&&(I.validateDescriptorFormat("Setup descriptor",t.setupDescriptor,e),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Zr=lt,Hr=`${lt}.def`,Wr=`${lt}.view`,Kn=I.createExtensionSchema({type:st("trouble.action").describe("Extension type, must be 'trouble.action'"),troubleType:X().min(1,"Trouble type is required").describe("Specific trouble type from TroubleContainer that triggers this action (e.g., 'pump-motor-fault', 'sensor-calibration-error'). This must match the exact trouble type string emitted by the device/system."),stateKey:X().min(1,"State key is required").describe("Normalized state key for grouping related troubles under a common UI experience (e.g., 'pumpProblem', 'sensorIssue'). Multiple troubleTypes can share the same stateKey to show the same troubleshooting component. If not provided, defaults to troubleType for 1:1 mapping."),stateValue:X().min(1,"State value is required").describe("Value set in the reactive state when this trouble becomes active (e.g., 'pump-failure', 'needs-calibration'). Used by other components to detect trouble categories and trigger appropriate responses. If not provided, defaults to troubleType.")},{rankable:!0}),dt=I.extensionPointId("ddk","trouble","action"),Qe=I.defineExtensionPoint({id:dt,contributionKey:"troubleActions",displayName:"Trouble Actions",description:"Extension point for trouble action plugin configurations with view support",hasView:!0,isRankable:!0,schema:Kn,metadata:{exportName:"TroubleActionExtension",category:"Trouble Management",tags:["trouble","action","state","error-handling"]},validate:(t,e)=>{I.validateWithSchema(Kn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Xr=dt,qr=`${dt}.def`,Gr=`${dt}.view`,Un=I.createExtensionSchema({viewKey:X().min(1,"View key is required").describe("Key identifying the UI region where this component should be rendered (e.g., 'settings.config', 'dashboard.sidebar'). Multiple plugins can contribute to the same viewKey, and all will be rendered in the designated region.")},{rankable:!0}),ut=I.extensionPointId("ddk","view"),Yr=I.defineExtensionPoint({id:ut,contributionKey:"views",displayName:"Views",description:"Extension point for view plugin configurations with regional rendering support",hasView:!0,isRankable:!0,schema:Un,metadata:{exportName:"ViewExtension",category:"UI Layout",tags:["views","ui","rendering","layout","regions"]},validate:(t,e)=>{I.validateWithSchema(Un,t,e)&&(t.viewKey&&(t.viewKey.includes(".")||e.addInfo(`ViewKey '${t.viewKey}' might benefit from dot notation (e.g., 'settings.config', 'dashboard.sidebar') for better organization`),["view","content","main"].includes(t.viewKey)&&e.addWarning(`ViewKey '${t.viewKey}' is very generic - consider using more specific keys like 'settings.main' or 'dashboard.content'`)),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Jr=ut,Qr=`${ut}.def`,ea=`${ut}.view`,ta="ddk.ncui.utilities",zn={[$t.id]:"setupDescriptor",[As.id]:"cuiDescriptor",[ta]:"utilDescriptor"},Ns=({defaultNamespace:t,extensionPoint:e})=>{const{getExtensions:n}=ae.useKosPluginsContext(),s=n(e),o=s.map(d=>d.data.namespace)||[],{t:a}=u.useKosTranslation([t,...new Set(o)]),c=s.reduce((d,m)=>{const f=m,h=f.data;return d[h[zn[e]]]={extension:e,module:f.id,namespace:h.namespace,title:h.title},d},{}),i=s.reduce((d,m)=>{const h=m.data;return d[h[zn[e]]]=`${h.namespace}:${h.title}`,d},{});return{namespaces:o,t:a,labelMap:i,contributionMap:c}},Ce=(t,e)=>{const n=p.useMemo(()=>({agitate:cs,calibrate:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ms,{pump:m,onComplete:d})},calibrateSPM:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.SpmPump.type);return r.jsx(no,{pump:m,onComplete:d})},diagnostics:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ws,{pump:m,onComplete:d})},"replace-pump":({holder:c,pump:i,onComplete:d})=>r.jsx(Ys,{pump:i??c.pumps.data[0],onComplete:d}),"rfid-override":Js,"replace-line":({holder:c,onComplete:i})=>r.jsx(Gs,{holder:c,onComplete:i})}),[]),[s,o]=p.useState(void 0),a=s?n[s]:void 0;return{holderExperience:a?r.jsx(a,{holder:t,pump:e,onComplete:()=>{o(void 0)}}):void 0,setHolderExperience:o,currentExperienceId:s}},Kt=p.createContext(void 0),na=({children:t,value:e})=>r.jsx(Kt.Provider,{value:e,children:t}),sa=t=>({HolderContent:void 0}),Ut=(t,e=sa)=>{const n=p.useContext(Kt);return e=(n==null?void 0:n.actionFactory)||e,e(t)},zt=()=>{const t=D.IngredientSummary.type;return u.useKosModel({modelId:t,modelType:D.IngredientSummary.type,options:{}})};function oa(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,ingredientSummary:n})})}}const Zt=()=>{const t=D.MacroAssignment.type;return u.useKosModel({modelId:t,modelType:D.MacroAssignment.type,options:{}})};function Ds(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,macroAssignment:n})})}}const Ht=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.NetworkTest.type,options:{}})};function ra(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Ht(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,networkTest:s})})}}const Wt=()=>{const t=D.NetworkTestContainer.type;return u.useKosModel({modelId:t,modelType:D.NetworkTestContainer.type,options:{}})};function Os(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Wt();return r.jsx(o,{...s,children:r.jsx(t,{...e,networkTestContainer:n})})}}const Ls=()=>{const t=D.NutritiveSweetener.type;return u.useKosModel({modelId:t,modelType:D.NutritiveSweetener.type,options:{}})};function aa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ls();return r.jsx(o,{...s,children:r.jsx(t,{...e,nutritiveSweetener:n})})}}const Rs=()=>{const t=D.PlainWater.type;return u.useKosModel({modelId:t,modelType:D.PlainWater.type,options:{},destroyOnUnmount:!0})};function ia(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Rs();return r.jsx(o,{...s,children:r.jsx(t,{...e,plainWater:n})})}}const ca=t=>{switch(t.type){case"fcm":return K.FcmPump.type;case"lfcv":return K.LfcvPump.type;case"micro":return K.SpmPump.type;case"cgp":return K.CgpPump.type;default:return}},ee="pluginVisibility",We=new Map;u.registerExtensionPoint(ee,{register:(t,e)=>{var n;We.has(t)||We.set(t,[]),(n=We.get(t))==null||n.push(e)},execute:(t,e,n)=>{const s=We.get(t);if(!s)return!0;const o=s.map(a=>a(e,n));return o.length===0?!0:!o.includes(!1)}});class Fs{constructor(e,n){M(this,"core");M(this,"dispense");this.core=e,this.dispense=n}registerDashboardVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}registerNavVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}}class la{constructor(){M(this,"dispense");M(this,"core");M(this,"plugin");this.dispense=new Dt.DispenseExtensionManager,this.core=new u.CoreExtensionManager,this.plugin=new Fs(this.core,this.dispense)}}const Re=t=>t?Ms(t.type):{action:"",label:"",progress:"",summary:""},Ms=t=>{const e=`troubles:troubles.${t}`;return{action:`${e}.action`,label:`${e}.label`,progress:`${e}.progress`,summary:`${e}.summary`}},Fe=t=>{const{getExtensions:e}=ae.useKosPluginsContext();return{getExtensions:p.useCallback(s=>e(s).filter(c=>{const i=c.id;return u.ExtensionManager[ee].execute(ee,i,t)}),[e,t])}},mt=()=>{const t=D.Reboot.type;return u.useKosModel({modelId:t,modelType:D.Reboot.type,options:{}})};function da(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,reboot:n})})}}const pt=()=>{const t=D.Settings.type;return u.useKosModel({modelId:t,modelType:D.Settings.type,options:{}})};function Xt(t){return e=>{const{model:n,status:s,KosModelLoader:o}=pt();return r.jsx(o,{...s,children:r.jsx(t,{...e,settings:n})})}}const qt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.SetupStep.type,options:{}})};function ua(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=qt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,setupStep:s})})}}const Gt=()=>{const t=D.SetupStepContainer.type;return u.useKosModel({modelId:t,modelType:D.SetupStepContainer.type,options:{}})};function Bs(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Gt();return r.jsx(o,{...s,children:r.jsx(t,{...e,setupStepContainer:n})})}}const Vs=()=>{const t=D.Start.type;return u.useKosModel({modelId:t,modelType:D.Start.type,options:{}})};function ma(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Vs();return r.jsx(o,{...s,children:r.jsx(t,{...e,start:n})})}}const Yt=()=>{const t=D.TroubleActionManager.type,{getExtensions:e}=Fe(),n=e(Qe.id).map(o=>o.data);return u.useKosModel({modelId:t,modelType:D.TroubleActionManager.type,options:{definitions:n}})};function pa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Yt();return r.jsx(o,{...s,children:r.jsx(t,{...e,troubleAction:n})})}}const ht=t=>{const[e,n]=p.useState({});return p.useEffect(()=>{async function s(){if(t){const o=await u.troubleDataFactory(t);n(o)}}s()},[t]),e},ha=t=>!t||t==="white",fa=t=>t?void 0:"white",$s=t=>{if(!u.isTroubleAware(t))return{};const e=t,{visibleTroubles:n,initialized:s}=we(e),o=(n==null?void 0:n.length)??0,a=n==null?void 0:n[0],c=o>0,i=c?`${a==null?void 0:a.color}`:void 0,d=ha(i),m=c?fa(d):void 0;return{backgroundColor:i,fontColor:m,highestTrouble:a,initialized:s,troubleCount:o,hasTroubles:c}},ga=({troubleType:t,condition:e})=>{const{model:n}=u.useTroubleContainerModel(),[s,o]=p.useState(!1),[a,c]=p.useState([]);return p.useEffect(()=>u.kosAutoEffect(()=>{const d=(t?n==null?void 0:n.troubles.getIndexByKey("byType",t):n==null?void 0:n.troubles.data)||[],m=e?d.filter(e):d;o(m.length>0),c(m)}),[e,n,t]),[s,a.length>0?a[0]:void 0,a]},Jt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.Utilities.type,options:{}})};function xa(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Jt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,utilities:s})})}}const Qt=()=>{const t=D.UtilitiesContainer.type;return u.useKosModel({modelId:t,modelType:D.UtilitiesContainer.type,options:{}})};function va(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Qt();return r.jsx(o,{...s,children:r.jsx(t,{...e,utilitiesContainer:n})})}}const Ks=u.withDevice(u.kosComponent(({device:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),s=t.serialNumber==="unassigned"?void 0:t.serialNumber;return r.jsx(l.InfoCard,{label:e("dispenser-serial"),value:s})})),ya=Ts(u.kosComponent(({dispenserInfo:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile");return r.jsxs(r.Fragment,{children:[r.jsx(fs,{label:e("dispenser-name","Dispenser Name"),configProperty:t.name}),r.jsx(Ks,{})]})})),ba=Xt(u.kosComponent(({settings:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),n=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return r.jsxs(r.Fragment,{children:[r.jsx(tt,{closeButtonLabel:e("close","Close")||void 0,configProperty:t==null?void 0:t.name,isValid:n,label:e("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),r.jsx(bs,{label:e("activate-and-reboot-time"),configProperty:t.activateAndRebootTime})]})})),Us=S(l.LabelDate)`
164
+ `,xs=({configProperties:t,disabled:e,enabledConfigProperty:n})=>{const{value:s}=u.useConfigProperty({configProperty:n}),o=s==="true",{componentModeOverride:a}=l.useComponentConfigurationContext(),c=t.length===1,i=c?Mo:gs;return r.jsxs(Ro,{disabled:!o||e,mode:a,children:[r.jsx(Fo,{children:t.map(d=>r.jsx(i,{disabled:!o||e,label:d.options?d.options.label:void 0,configProperty:d.configProperty,collapse:!c&&a==="standard",layout:d.options?d.options.layout:void 0,float:!0,hideUnits:d.options?d.options.hideUnits:void 0},d.configProperty.id))}),r.jsx(Bo,{compact:!c||a==="compact",children:r.jsx(Pe,{alwaysShowLabel:!0,collapse:!0,configProperty:n,disabled:e,stretch:a==="compact"})})]})},Vo=({configProperty:t,disabled:e,enabledConfigProperty:n,options:s})=>{const o=p.useMemo(()=>[{configProperty:t,options:s}],[t,s]);return r.jsx(xs,{configProperties:o,disabled:e,enabledConfigProperty:n})},vs=({configProperty:t,...e})=>{const{value:n}=u.useConfigProperty({configProperty:t}),s=o=>{o!==void 0&&(t==null||t.updateProperty(String(o)))};return r.jsx(l.SwitchCard,{...e,onChange:s,value:n})},ys=({description:t,float:e,label:n,modalTitle:s,onSave:o,time:a,...c})=>{const{regionModel:i}=u.useKosRegions(),{t:d}=u.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:f,hourOptions:h,minuteOptions:g,setTime:y,time:b}=u.useRegionTimeProps({initialDate:a}),v=b.getHours(),w=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v<12?v:v-12,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:v<12?"AM":"PM"}],[m,h,g,b,v]),P=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0}],[h,g,b,v]);return r.jsx(l.MultiPickerCard,{...c,cancelButtonLabel:d("discard-changes","Discard Changes")||void 0,closeButtonLabel:d("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?w:P,description:t,displayValue:f,float:e,icon:ye.TimeIcon,label:n,modalTitle:s,proceedButtonLabel:d("save","Save")||void 0,onSave:O=>{const E=i!=null&&i.is12HourTimeFormat?O.ampm==="AM"?O.hr:O.hr+12:O.hr,j=O.min,_=new Date(b);_.setHours(E),_.setMinutes(j),y(_),o==null||o({hours:E,minutes:j})}})},bs=({configProperty:t,...e})=>{var f;const{getStagedChange:n,updateStagedChange:s}=Rt(),{value:o}=u.useConfigProperty({configProperty:t}),a=((f=n==null?void 0:n(t.id))==null?void 0:f.value)??o,{hours:c,minutes:i}=D.toTimeComponents(Number(a)),d=new Date;d.setHours(c),d.setMinutes(i);const m=h=>{const g=D.toSeconds(h.hours,h.minutes);s?s(t.id,{configProperty:t,value:g}):t.updateProperty(g)};return r.jsx(ys,{...e,onSave:m,time:d})},$o=[0,6],Cs=({day:t=new Date().getDate(),month:e=new Date().getMonth(),onSave:n,year:s=new Date().getFullYear(),...o})=>{var y,b,v,w,P,O;const{t:a}=u.useKosTranslation("region"),{regionModel:c}=u.useKosRegions(),i=u.useDateProps({date:{year:s,month:e,day:t},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(c==null?void 0:c.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:$o,yearsRange:[s-10,s+10]}}),d=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.yearsOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:_.label}))},[(y=i==null?void 0:i.dateState)==null?void 0:y.yearsOptionsArray]),m=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.daysOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:_.label}))},[(b=i==null?void 0:i.dateState)==null?void 0:b.daysOptionsArray]),f=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.monthsOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:String(_.label)}))},[(v=i==null?void 0:i.dateState)==null?void 0:v.monthsOptionsArray]),h=p.useMemo(()=>{const E=[];return c==null||c.selectedDateOrder.split("").forEach(j=>{var _,$,z;j==="y"?E.push({id:"year",items:d,selectedItemId:(_=i==null?void 0:i.dateState)==null?void 0:_.year,loop:!1}):j==="m"?E.push({id:"month",items:f,selectedItemId:($=i==null?void 0:i.dateState)==null?void 0:$.month}):j==="d"&&E.push({id:"day",items:m,selectedItemId:(z=i==null?void 0:i.dateState)==null?void 0:z.day,loop:!1})}),E},[(w=i==null?void 0:i.dateState)==null?void 0:w.day,(P=i==null?void 0:i.dateState)==null?void 0:P.month,(O=i==null?void 0:i.dateState)==null?void 0:O.year,m,f,c==null?void 0:c.selectedDateOrder,d]),g=p.useCallback(async E=>{const _=new Date(E.year,E.month+1,0).getDate(),$=E.day>_?1:E.day;n({day:$,month:E.month,year:E.year})},[n]);return r.jsx(l.MultiPickerCard,{cancelButtonLabel:a("discard-changes","Discard Changes")||void 0,closeButtonLabel:a("close","Close")||void 0,data:h,displayValue:i.dateState.formattedDate,icon:ye.CalendarIcon,label:a("todays-date","Today's Date"),onSave:g,proceedButtonLabel:a("save","Save")||void 0,...o})},ws=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,o]=p.useState("idle"),[a,c]=p.useState(),i=p.useCallback(async()=>{o("test"),c(void 0);const m=await t.performElectricalTest();m.error?(c(m.error),o("failure")):m.result==="errEEPROM"?(c("errEEPROM"),o("failure")):o("success")},[t]),d=p.useMemo(()=>({idle:{information:r.jsx(l.LabelInformation,{children:n("perform-electrical-test")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")})},test:{information:r.jsx(l.LabelInformation,{children:n("testing")}),footer:r.jsx(l.Button,{disabled:!0,children:n("electrical-test")}),status:"loading"},success:{information:r.jsx(l.LabelInformation,{children:n("electrical-test-success-header")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"success"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("electrical-test-failure-header")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a}`)})]}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"information"}}),[a,n,i]);return r.jsx(l.WorkflowModal,{title:n(t.name),...d[s],onClose:()=>e()})}),Tt={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Ko=t=>{const[e,n]=p.useState(null),[s,o]=p.useState(Tt),a=t.map(c=>{const[i,,d]=c;return[i==null?void 0:i.future,i,d]}).flat();return p.useEffect(()=>{const c=t.find(i=>{const[d]=i;return!!(d!=null&&d.future)});c?(n(c[0]),o(c[2])):(n(null),o(Tt))},[...a,t]),[e,s]},Uo=t=>{switch(t){case"calibrate":return Gn;case"fixed-45":return Yn;case"flush":return Jn;case"high-flow-test":return Qn;case"hold-to-pour":return es;case"low-flow-test":return ts;case"manual-override":return ns;case"msv-reset":return ss;case"prime":return os;case"purge":return rs;default:return}},zo=t=>(e,n="intents")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),be=(t,e=Uo)=>{const{t:n}=u.useKosTranslation("troubles"),[s,o]=p.useState(null),[a,c]=p.useState(Tt),i=p.useCallback(async d=>{const m=e(d);if(m){const f=zo(n)(d);c(f);const h=new m(t);await h.performAction(),o(h)}},[e,t,n]);return[s,i,a]},Zo=t=>(u.KosLog.debug(`pumpActionFactory: actionId=${t}`),is),Ho=t=>(e,n="troubles")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),Wo=(t,e,n=Zo)=>{const{t:s}=u.useKosTranslation("troubles"),[o,a]=p.useState(null),[c]=p.useState(Ho(s)(e)),i=p.useCallback(async()=>{const d=n(e);if(d){const m=new d(t,e);await m.performAction(),a(m)}},[n,t,e]);return[o,i,c]};function Xo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ot();return r.jsx(o,{...s,children:r.jsx(t,{...e,agitationControl:n})})}}const Ft=()=>{const t=D.Animation.type;return u.useKosModel({modelId:t,modelType:D.Animation.type,options:{}})};function _s(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ft();return r.jsx(o,{...s,children:r.jsx(t,{...e,animation:n})})}}const Le=()=>{const t=D.Application.type;return u.useKosModel({modelId:t,modelType:D.Application.type,options:{}})};function qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Le();return r.jsx(o,{...s,children:r.jsx(t,{...e,application:n})})}}const ks=()=>{const t=D.CarbWater.type;return u.useKosModel({modelId:t,modelType:D.CarbWater.type,options:{}})};function Go(t){return e=>{const{model:n,status:s,KosModelLoader:o}=ks();return r.jsx(o,{...s,children:r.jsx(t,{...e,carbWater:n})})}}const Ss=()=>{const t=D.CopyLogs.type;return u.useKosModel({modelId:t,modelType:D.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function Yo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ss();return r.jsx(o,{...s,children:r.jsx(t,{...e,copyLogs:n})})}}const Mt=()=>{const t=D.DashboardOperations.type;return u.useKosModel({modelId:t,modelType:D.DashboardOperations.type,options:{}})};function Jo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dashboardOperations:n})})}}const Bt=()=>{const t=D.DispenserInfo.type;return u.useKosModel({modelId:t,modelType:D.DispenserInfo.type,options:{}})};function Ts(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Bt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dispenserInfo:n})})}}const js=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.Door.type,options:{}})};function Qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=js(e.id);return r.jsx(o,{...s,children:r.jsx(t,{...e,door:n})})}}var F;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const a={};for(const c of o)a[c]=c;return a},t.getValidEnumValues=o=>{const a=t.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),c={};for(const i of a)c[i]=o[i];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(a){return o[a]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const a=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&a.push(c);return a},t.find=(o,a)=>{for(const c of o)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function s(o,a=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(F||(F={}));var Cn;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Cn||(Cn={}));const k=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},x=F.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 q extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)s._errors.push(n(c));else{let i=s,d=0;for(;d<c.path.length;){const m=c.path[d];d===c.path.length-1?(i[m]=i[m]||{_errors:[]},i[m]._errors.push(n(c))):i[m]=i[m]||{_errors:[]},i=i[m],d++}}};return o(this),s}static assert(e){if(!(e instanceof q))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},s=[];for(const o of this.issues)if(o.path.length>0){const a=o.path[0];n[a]=n[a]||[],n[a].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}q.create=t=>new q(t);const jt=(t,e)=>{let n;switch(t.code){case x.invalid_type:t.received===k.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,F.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:n=`Unrecognized key(s) in object: ${F.joinValues(t.keys,", ")}`;break;case x.invalid_union:n="Invalid input";break;case x.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${F.joinValues(t.options)}`;break;case x.invalid_enum_value:n=`Invalid enum value. Expected ${F.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:n="Invalid function arguments";break;case x.invalid_return_type:n="Invalid function return type";break;case x.invalid_date:n="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:F.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case x.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case x.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case x.custom:n="Invalid input";break;case x.invalid_intersection_types:n="Intersection results could not be merged";break;case x.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:n="Number must be finite";break;default:n=e.defaultError,F.assertNever(t)}return{message:n}};let er=jt;function tr(){return er}const nr=t=>{const{data:e,path:n,errorMaps:s,issueData:o}=t,a=[...n,...o.path||[]],c={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let i="";const d=s.filter(m=>!!m).slice().reverse();for(const m of d)i=m(c,{data:e,defaultError:i}).message;return{...o,path:a,message:i}};function C(t,e){const n=tr(),s=nr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===jt?void 0:jt].filter(o=>!!o)});t.common.issues.push(s)}class U{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const s=[];for(const o of n){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),s.push(o.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const o of n){const a=await o.key,c=await o.value;s.push({key:a,value:c})}return U.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const o of n){const{key:a,value:c}=o;if(a.status==="aborted"||c.status==="aborted")return A;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(s[a.value]=c.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),Ie=t=>({status:"dirty",value:t}),Z=t=>({status:"valid",value:t}),wn=t=>t.status==="aborted",_n=t=>t.status==="dirty",fe=t=>t.status==="valid",Xe=t=>typeof Promise<"u"&&t instanceof Promise;var T;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(T||(T={}));class ne{constructor(e,n,s,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kn=(t,e)=>{if(fe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new q(t.common.issues);return this._error=n,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:s,description:o}=t;if(e&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(c,i)=>{const{message:d}=t;return c.code==="invalid_enum_value"?{message:d??i.defaultError}:typeof i.data>"u"?{message:d??s??i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:d??n??i.defaultError}},description:o}}class R{get description(){return this._def.description}_getType(e){return J(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new U,ctx:{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xe(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){const s={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parseSync({data:e,path:s.path,parent:s});return kn(s,o)}"~validate"(e){var s,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return fe(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(o=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>fe(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parse({data:e,path:s.path,parent:s}),a=await(Xe(o)?o:Promise.resolve(o));return kn(s,a)}refine(e,n){const s=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,a)=>{const c=e(o),i=()=>a.addIssue({code:x.custom,...s(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(d=>d?!0:(i(),!1)):c?!0:(i(),!1)})}refinement(e,n){return this._refinement((s,o)=>e(s)?!0:(o.addIssue(typeof n=="function"?n(s,o):n),!1))}_refinement(e){return new xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return te.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return Je.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ye.create(this,e,this._def)}transform(e){return new xe({...L(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Pt({...L(this._def),innerType:this,defaultValue:n,typeName:N.ZodDefault})}brand(){return new Sr({typeName:N.ZodBranded,type:this,...L(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new At({...L(this._def),innerType:this,catchValue:n,typeName:N.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Vt.create(this,e)}readonly(){return Nt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sr=/^c[^\s-]{8,}$/i,or=/^[0-9a-z]+$/,rr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ar=/^[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,ir=/^[a-z0-9_-]{21}$/i,cr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ur="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kt;const mr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Is="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vr=new RegExp(`^${Is}$`);function Es(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function yr(t){return new RegExp(`^${Es(t)}$`)}function br(t){let e=`${Is}T${Es(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Cr(t,e){return!!((e==="v4"||!e)&&mr.test(t)||(e==="v6"||!e)&&hr.test(t))}function wr(t,e){if(!cr.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(s));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function _r(t,e){return!!((e==="v4"||!e)&&pr.test(t)||(e==="v6"||!e)&&fr.test(t))}class Q extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.string,received:a.parsedType}),A}const s=new U;let o;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const c=e.data.length>a.value,i=e.data.length<a.value;(c||i)&&(o=this._getOrReturnCtx(e,o),c?C(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&C(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")dr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"email",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")kt||(kt=new RegExp(ur,"u")),kt.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"emoji",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")ar.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"uuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")ir.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"nanoid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")sr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")or.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cuid2",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")rr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"ulid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),C(o,{validation:"url",code:x.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"regex",code:x.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?br(a).test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?vr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?yr(a).test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?lr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"duration",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Cr(e.data,a.version)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"ip",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?wr(e.data,a.alg)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"jwt",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?_r(e.data,a.version)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cidr",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?gr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"base64",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?xr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"base64url",code:x.invalid_string,message:a.message}),s.dirty()):F.assertNever(a);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(o=>e.test(o),{validation:n,code:x.invalid_string,...T.errToObj(s)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...T.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...T.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...T.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...T.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...T.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...T.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...T.errToObj(n)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Q.create=t=>new Q({checks:[],typeName:N.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});function kr(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=n>s?n:s,a=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return a%c/10**o}class Ae extends R{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)!==k.number){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.number,received:a.parsedType}),A}let s;const o=new U;for(const a of this._def.checks)a.kind==="int"?F.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:x.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?kr(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_finite,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,T.toString(n))}gt(e,n){return this.setLimit("min",e,!1,T.toString(n))}lte(e,n){return this.setLimit("max",e,!0,T.toString(n))}lt(e,n){return this.setLimit("max",e,!1,T.toString(n))}setLimit(e,n,s,o){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:T.toString(o)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Ae.create=t=>new Ae({checks:[],typeName:N.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class Ne extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let s;const o=new U;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:k.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,T.toString(n))}gt(e,n){return this.setLimit("min",e,!1,T.toString(n))}lte(e,n){return this.setLimit("max",e,!0,T.toString(n))}lt(e,n){return this.setLimit("max",e,!1,T.toString(n))}setLimit(e,n,s,o){return new Ne({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:T.toString(o)}]})}_addCheck(e){return new Ne({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ne.create=t=>new Ne({checks:[],typeName:N.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});class Sn extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.boolean,received:s.parsedType}),A}return Z(e.data)}}Sn.create=t=>new Sn({typeName:N.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class qe extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.date,received:a.parsedType}),A}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_date}),A}const s=new U;let o;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):F.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qe({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}qe.create=t=>new qe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:N.ZodDate,...L(t)});class Tn extends R{_parse(e){if(this._getType(e)!==k.symbol){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.symbol,received:s.parsedType}),A}return Z(e.data)}}Tn.create=t=>new Tn({typeName:N.ZodSymbol,...L(t)});class jn extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.undefined,received:s.parsedType}),A}return Z(e.data)}}jn.create=t=>new jn({typeName:N.ZodUndefined,...L(t)});class In extends R{_parse(e){if(this._getType(e)!==k.null){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.null,received:s.parsedType}),A}return Z(e.data)}}In.create=t=>new In({typeName:N.ZodNull,...L(t)});class En extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}En.create=t=>new En({typeName:N.ZodAny,...L(t)});class Pn extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}Pn.create=t=>new Pn({typeName:N.ZodUnknown,...L(t)});class se extends R{_parse(e){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:k.never,received:n.parsedType}),A}}se.create=t=>new se({typeName:N.ZodNever,...L(t)});class An extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.void,received:s.parsedType}),A}return Z(e.data)}}An.create=t=>new An({typeName:N.ZodVoid,...L(t)});class W extends R{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),o=this._def;if(n.parsedType!==k.array)return C(n,{code:x.invalid_type,expected:k.array,received:n.parsedType}),A;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,i=n.data.length<o.exactLength.value;(c||i)&&(C(n,{code:c?x.too_big:x.too_small,minimum:i?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),s.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(C(n,{code:x.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),s.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(C(n,{code:x.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((c,i)=>o.type._parseAsync(new ne(n,c,n.path,i)))).then(c=>U.mergeArray(s,c));const a=[...n.data].map((c,i)=>o.type._parseSync(new ne(n,c,n.path,i)));return U.mergeArray(s,a)}get element(){return this._def.type}min(e,n){return new W({...this._def,minLength:{value:e,message:T.toString(n)}})}max(e,n){return new W({...this._def,maxLength:{value:e,message:T.toString(n)}})}length(e,n){return new W({...this._def,exactLength:{value:e,message:T.toString(n)}})}nonempty(e){return this.min(1,e)}}W.create=(t,e)=>new W({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...L(e)});function pe(t){if(t instanceof B){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=te.create(pe(s))}return new B({...t._def,shape:()=>e})}else return t instanceof W?new W({...t._def,type:pe(t.element)}):t instanceof te?te.create(pe(t.unwrap())):t instanceof ve?ve.create(pe(t.unwrap())):t instanceof ie?ie.create(t.items.map(e=>pe(e))):t}class B extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=F.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==k.object){const m=this._getOrReturnCtx(e);return C(m,{code:x.invalid_type,expected:k.object,received:m.parsedType}),A}const{status:s,ctx:o}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof se&&this._def.unknownKeys==="strip"))for(const m in o.data)c.includes(m)||i.push(m);const d=[];for(const m of c){const f=a[m],h=o.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new ne(o,h,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof se){const m=this._def.unknownKeys;if(m==="passthrough")for(const f of i)d.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(m==="strict")i.length>0&&(C(o,{code:x.unrecognized_keys,keys:i}),s.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const f of i){const h=o.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new ne(o,h,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const m=[];for(const f of d){const h=await f.key,g=await f.value;m.push({key:h,value:g,alwaysSet:f.alwaysSet})}return m}).then(m=>U.mergeObjectSync(s,m)):U.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new B({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var a,c;const o=((c=(a=this._def).errorMap)==null?void 0:c.call(a,n,s).message)??s.defaultError;return n.code==="unrecognized_keys"?{message:T.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new B({...this._def,unknownKeys:"strip"})}passthrough(){return new B({...this._def,unknownKeys:"passthrough"})}extend(e){return new B({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new B({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new B({...this._def,catchall:e})}pick(e){const n={};for(const s of F.objectKeys(e))e[s]&&this.shape[s]&&(n[s]=this.shape[s]);return new B({...this._def,shape:()=>n})}omit(e){const n={};for(const s of F.objectKeys(this.shape))e[s]||(n[s]=this.shape[s]);return new B({...this._def,shape:()=>n})}deepPartial(){return pe(this)}partial(e){const n={};for(const s of F.objectKeys(this.shape)){const o=this.shape[s];e&&!e[s]?n[s]=o:n[s]=o.optional()}return new B({...this._def,shape:()=>n})}required(e){const n={};for(const s of F.objectKeys(this.shape))if(e&&!e[s])n[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof te;)a=a._def.innerType;n[s]=a}return new B({...this._def,shape:()=>n})}keyof(){return Ps(F.objectKeys(this.shape))}}B.create=(t,e)=>new B({shape:()=>t,unknownKeys:"strip",catchall:se.create(),typeName:N.ZodObject,...L(e)});B.strictCreate=(t,e)=>new B({shape:()=>t,unknownKeys:"strict",catchall:se.create(),typeName:N.ZodObject,...L(e)});B.lazycreate=(t,e)=>new B({shape:t,unknownKeys:"strip",catchall:se.create(),typeName:N.ZodObject,...L(e)});class Ge extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function o(a){for(const i of a)if(i.result.status==="valid")return i.result;for(const i of a)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;const c=a.map(i=>new q(i.ctx.common.issues));return C(n,{code:x.invalid_union,unionErrors:c}),A}if(n.common.async)return Promise.all(s.map(async a=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let a;const c=[];for(const d of s){const m={...n,common:{...n.common,issues:[]},parent:null},f=d._parseSync({data:n.data,path:n.path,parent:m});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const i=c.map(d=>new q(d));return C(n,{code:x.invalid_union,unionErrors:i}),A}}get options(){return this._def.options}}Ge.create=(t,e)=>new Ge({options:t,typeName:N.ZodUnion,...L(e)});function It(t,e){const n=J(t),s=J(e);if(t===e)return{valid:!0,data:t};if(n===k.object&&s===k.object){const o=F.objectKeys(e),a=F.objectKeys(t).filter(i=>o.indexOf(i)!==-1),c={...t,...e};for(const i of a){const d=It(t[i],e[i]);if(!d.valid)return{valid:!1};c[i]=d.data}return{valid:!0,data:c}}else if(n===k.array&&s===k.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let a=0;a<t.length;a++){const c=t[a],i=e[a],d=It(c,i);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===k.date&&s===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ye extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=(a,c)=>{if(wn(a)||wn(c))return A;const i=It(a.value,c.value);return i.valid?((_n(a)||_n(c))&&n.dirty(),{status:n.value,value:i.data}):(C(s,{code:x.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Ye.create=(t,e,n)=>new Ye({left:t,right:e,typeName:N.ZodIntersection,...L(n)});class ie extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.array)return C(s,{code:x.invalid_type,expected:k.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return C(s,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(C(s,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...s.data].map((c,i)=>{const d=this._def.items[i]||this._def.rest;return d?d._parse(new ne(s,c,s.path,i)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>U.mergeArray(n,c)):U.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new ie({...this._def,rest:e})}}ie.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ie({items:t,typeName:N.ZodTuple,rest:null,...L(e)})};class Nn extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.map)return C(s,{code:x.invalid_type,expected:k.map,received:s.parsedType}),A;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([i,d],m)=>({key:o._parse(new ne(s,i,s.path,[m,"key"])),value:a._parse(new ne(s,d,s.path,[m,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const d of c){const m=await d.key,f=await d.value;if(m.status==="aborted"||f.status==="aborted")return A;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}})}else{const i=new Map;for(const d of c){const m=d.key,f=d.value;if(m.status==="aborted"||f.status==="aborted")return A;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}}}}Nn.create=(t,e,n)=>new Nn({valueType:e,keyType:t,typeName:N.ZodMap,...L(n)});class De extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.set)return C(s,{code:x.invalid_type,expected:k.set,received:s.parsedType}),A;const o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(C(s,{code:x.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&s.data.size>o.maxSize.value&&(C(s,{code:x.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const a=this._def.valueType;function c(d){const m=new Set;for(const f of d){if(f.status==="aborted")return A;f.status==="dirty"&&n.dirty(),m.add(f.value)}return{status:n.value,value:m}}const i=[...s.data.values()].map((d,m)=>a._parse(new ne(s,d,s.path,m)));return s.common.async?Promise.all(i).then(d=>c(d)):c(i)}min(e,n){return new De({...this._def,minSize:{value:e,message:T.toString(n)}})}max(e,n){return new De({...this._def,maxSize:{value:e,message:T.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}De.create=(t,e)=>new De({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...L(e)});class Dn extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Dn.create=(t,e)=>new Dn({getter:t,typeName:N.ZodLazy,...L(e)});class Et extends R{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return C(n,{received:n.data,code:x.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}Et.create=(t,e)=>new Et({value:t,typeName:N.ZodLiteral,...L(e)});function Ps(t,e){return new ge({values:t,typeName:N.ZodEnum,...L(e)})}class ge extends R{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return C(n,{expected:F.joinValues(s),received:n.parsedType,code:x.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return C(n,{received:n.data,code:x.invalid_enum_value,options:s}),A}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ge.create(e,{...this._def,...n})}exclude(e,n=this._def){return ge.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}ge.create=Ps;class On extends R{_parse(e){const n=F.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==k.string&&s.parsedType!==k.number){const o=F.objectValues(n);return C(s,{expected:F.joinValues(o),received:s.parsedType,code:x.invalid_type}),A}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=F.objectValues(n);return C(s,{received:s.data,code:x.invalid_enum_value,options:o}),A}return Z(e.data)}get enum(){return this._def.values}}On.create=(t,e)=>new On({values:t,typeName:N.ZodNativeEnum,...L(e)});class Je extends R{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==k.promise&&n.common.async===!1)return C(n,{code:x.invalid_type,expected:k.promise,received:n.parsedType}),A;const s=n.parsedType===k.promise?n.data:Promise.resolve(n.data);return Z(s.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Je.create=(t,e)=>new Je({type:t,typeName:N.ZodPromise,...L(e)});class xe extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=this._def.effect||null,a={addIssue:c=>{C(s,c),c.fatal?n.abort():n.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){const c=o.transform(s.data,a);if(s.common.async)return Promise.resolve(c).then(async i=>{if(n.value==="aborted")return A;const d=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return d.status==="aborted"?A:d.status==="dirty"||n.value==="dirty"?Ie(d.value):d});{if(n.value==="aborted")return A;const i=this._def.schema._parseSync({data:c,path:s.path,parent:s});return i.status==="aborted"?A:i.status==="dirty"||n.value==="dirty"?Ie(i.value):i}}if(o.type==="refinement"){const c=i=>{const d=o.refinement(i,a);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?A:(i.status==="dirty"&&n.dirty(),c(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?A:(i.status==="dirty"&&n.dirty(),c(i.value).then(()=>({status:n.value,value:i.value}))))}if(o.type==="transform")if(s.common.async===!1){const c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!fe(c))return A;const i=o.transform(c.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>fe(c)?Promise.resolve(o.transform(c.value,a)).then(i=>({status:n.value,value:i})):A);F.assertNever(o)}}xe.create=(t,e,n)=>new xe({schema:t,typeName:N.ZodEffects,effect:e,...L(n)});xe.createWithPreprocess=(t,e,n)=>new xe({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...L(n)});class te extends R{_parse(e){return this._getType(e)===k.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}te.create=(t,e)=>new te({innerType:t,typeName:N.ZodOptional,...L(e)});class ve extends R{_parse(e){return this._getType(e)===k.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(t,e)=>new ve({innerType:t,typeName:N.ZodNullable,...L(e)});class Pt extends R{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===k.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Pt.create=(t,e)=>new Pt({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class At extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Xe(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}At.create=(t,e)=>new At({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class Ln extends R{_parse(e){if(this._getType(e)!==k.nan){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.nan,received:s.parsedType}),A}return{status:"valid",value:e.data}}}Ln.create=t=>new Ln({typeName:N.ZodNaN,...L(t)});class Sr extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class Vt extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?A:a.status==="dirty"?(n.dirty(),Ie(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?A:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(e,n){return new Vt({in:e,out:n,typeName:N.ZodPipeline})}}class Nt extends R{_parse(e){const n=this._def.innerType._parse(e),s=o=>(fe(o)&&(o.value=Object.freeze(o.value)),o);return Xe(n)?n.then(o=>s(o)):s(n)}unwrap(){return this._def.innerType}}Nt.create=(t,e)=>new Nt({innerType:t,typeName:N.ZodReadonly,...L(e)});var N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));const X=Q.create;se.create;W.create;Ge.create;Ye.create;ie.create;const st=Et.create,Tr=ge.create;Je.create;te.create;ve.create;const Rn=I.createExtensionSchema({type:st("dashboard.summary").describe("Extension type, must be 'dashboard.summary'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this summary belongs to")},{rankable:!0}),ot=I.extensionPointId("ddk","dashboard","summary"),jr=I.defineExtensionPoint({id:ot,contributionKey:"dashboardSummary",displayName:"Dashboard Summary",description:"Extension point for dashboard summary plugin configurations with view support",hasView:!0,isRankable:!0,schema:Rn,metadata:{exportName:"DashboardSummaryExtension",category:"Dashboard",tags:["dashboard","summary","visualization"]},validate:(t,e)=>{I.validateWithSchema(Rn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Ir=ot,Er=`${ot}.def`,Pr=`${ot}.view`,Fn=I.createExtensionSchema({type:st("dashboard.detail").describe("Extension type, must be 'dashboard.detail'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this detail belongs to")},{rankable:!0}),rt=I.extensionPointId("ddk","dashboard","detail"),Ar=I.defineExtensionPoint({id:rt,contributionKey:"dashboardDetail",displayName:"Dashboard Detail",description:"Extension point for dashboard detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Fn,metadata:{exportName:"DashboardDetailExtension",category:"Dashboard",tags:["dashboard","detail","visualization"]},validate:(t,e)=>{I.validateWithSchema(Fn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Nr=rt,Dr=`${rt}.def`,Or=`${rt}.view`,Mn=I.createExtensionSchema({type:st("dashboard.detail.pump").describe("Extension type, must be 'dashboard.detail.pump'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to match this extension with specific dashboard pumps")},{rankable:!0}),at=I.extensionPointId("ddk","dashboard","pump-detail"),Oe=I.defineExtensionPoint({id:at,contributionKey:"dashboardPumpDetail",displayName:"Dashboard Pump Detail",description:"Extension point for dashboard pump detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Mn,metadata:{exportName:"DashboardPumpDetailExtension"},validate:(t,e)=>{I.validateWithSchema(Mn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Lr=at,Rr=`${at}.def`,Fr=`${at}.view`,Bn=I.createExtensionSchema({cuiDescriptor:X().min(1,"CUI descriptor is required").describe("Descriptor used to identify and categorize the CUI functionality"),modalMode:Tr(["fullscreen","maximized"]).optional().describe("Modal display mode for the CUI interface")}),it=I.extensionPointId("ddk","cui"),As=I.defineExtensionPoint({id:it,contributionKey:"cui",displayName:"CUI (Consumer User Interface)",description:"Extension point for CUI plugin configurations with view support",hasView:!0,isRankable:!1,schema:Bn,metadata:{exportName:"CuiExtension",category:"Interface",tags:["cui","user-interface","consumer"]},validate:(t,e)=>{I.validateWithSchema(Bn,t,e)&&I.validateDescriptorFormat("CUI descriptor",t.cuiDescriptor,e)},transform:I.createViewAwareTransform()}),Mr=it,Br=`${it}.def`,Vr=`${it}.view`,Vn=I.createExtensionSchema({navDescriptor:X().min(1,"Navigation descriptor is required").describe("Descriptor used to identify and map the navigation functionality")}),ct=I.extensionPointId("ddk","nav","view"),$r=I.defineExtensionPoint({id:ct,contributionKey:"navViews",displayName:"Navigation Views",description:"Extension point for navigation view plugin configurations with view support",hasView:!0,isRankable:!1,schema:Vn,metadata:{exportName:"NavViewExtension",category:"Navigation",tags:["navigation","nav","views","routing"]},validate:(t,e)=>{I.validateWithSchema(Vn,t,e)&&I.validateDescriptorFormat("Navigation descriptor",t.navDescriptor,e)},transform:I.createViewAwareTransform()}),Kr=ct,Ur=`${ct}.def`,zr=`${ct}.view`,$n=I.createExtensionSchema({setupDescriptor:X().min(1,"Setup descriptor is required").describe("Descriptor used to identify and categorize the setup step")},{rankable:!0}),lt=I.extensionPointId("ddk","setup"),$t=I.defineExtensionPoint({id:lt,contributionKey:"setupStep",displayName:"Setup Steps",description:"Extension point for setup step plugin configurations with view support",hasView:!0,isRankable:!0,schema:$n,metadata:{exportName:"SetupExtension",category:"Setup",tags:["setup","configuration","steps","wizard"]},validate:(t,e)=>{I.validateWithSchema($n,t,e)&&(I.validateDescriptorFormat("Setup descriptor",t.setupDescriptor,e),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Zr=lt,Hr=`${lt}.def`,Wr=`${lt}.view`,Kn=I.createExtensionSchema({type:st("trouble.action").describe("Extension type, must be 'trouble.action'"),troubleType:X().min(1,"Trouble type is required").describe("Specific trouble type from TroubleContainer that triggers this action (e.g., 'pump-motor-fault', 'sensor-calibration-error'). This must match the exact trouble type string emitted by the device/system."),stateKey:X().min(1,"State key is required").describe("Normalized state key for grouping related troubles under a common UI experience (e.g., 'pumpProblem', 'sensorIssue'). Multiple troubleTypes can share the same stateKey to show the same troubleshooting component. If not provided, defaults to troubleType for 1:1 mapping."),stateValue:X().min(1,"State value is required").describe("Value set in the reactive state when this trouble becomes active (e.g., 'pump-failure', 'needs-calibration'). Used by other components to detect trouble categories and trigger appropriate responses. If not provided, defaults to troubleType.")},{rankable:!0}),dt=I.extensionPointId("ddk","trouble","action"),Qe=I.defineExtensionPoint({id:dt,contributionKey:"troubleActions",displayName:"Trouble Actions",description:"Extension point for trouble action plugin configurations with view support",hasView:!0,isRankable:!0,schema:Kn,metadata:{exportName:"TroubleActionExtension",category:"Trouble Management",tags:["trouble","action","state","error-handling"]},validate:(t,e)=>{I.validateWithSchema(Kn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Xr=dt,qr=`${dt}.def`,Gr=`${dt}.view`,Un=I.createExtensionSchema({viewKey:X().min(1,"View key is required").describe("Key identifying the UI region where this component should be rendered (e.g., 'settings.config', 'dashboard.sidebar'). Multiple plugins can contribute to the same viewKey, and all will be rendered in the designated region.")},{rankable:!0}),ut=I.extensionPointId("ddk","view"),Yr=I.defineExtensionPoint({id:ut,contributionKey:"views",displayName:"Views",description:"Extension point for view plugin configurations with regional rendering support",hasView:!0,isRankable:!0,schema:Un,metadata:{exportName:"ViewExtension",category:"UI Layout",tags:["views","ui","rendering","layout","regions"]},validate:(t,e)=>{I.validateWithSchema(Un,t,e)&&(t.viewKey&&(t.viewKey.includes(".")||e.addInfo(`ViewKey '${t.viewKey}' might benefit from dot notation (e.g., 'settings.config', 'dashboard.sidebar') for better organization`),["view","content","main"].includes(t.viewKey)&&e.addWarning(`ViewKey '${t.viewKey}' is very generic - consider using more specific keys like 'settings.main' or 'dashboard.content'`)),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Jr=ut,Qr=`${ut}.def`,ea=`${ut}.view`,ta="ddk.ncui.utilities",zn={[$t.id]:"setupDescriptor",[As.id]:"cuiDescriptor",[ta]:"utilDescriptor"},Ns=({defaultNamespace:t,extensionPoint:e})=>{const{getExtensions:n}=ae.useKosPluginsContext(),s=n(e),o=s.map(d=>d.data.namespace)||[],{t:a}=u.useKosTranslation([t,...new Set(o)]),c=s.reduce((d,m)=>{const f=m,h=f.data;return d[h[zn[e]]]={extension:e,module:f.id,namespace:h.namespace,title:h.title},d},{}),i=s.reduce((d,m)=>{const h=m.data;return d[h[zn[e]]]=`${h.namespace}:${h.title}`,d},{});return{namespaces:o,t:a,labelMap:i,contributionMap:c}},Ce=(t,e)=>{const n=p.useMemo(()=>({agitate:cs,calibrate:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ms,{pump:m,onComplete:d})},calibrateSPM:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.SpmPump.type);return r.jsx(no,{pump:m,onComplete:d})},diagnostics:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ws,{pump:m,onComplete:d})},"replace-pump":({holder:c,pump:i,onComplete:d})=>r.jsx(Ys,{pump:i??c.pumps.data[0],onComplete:d}),"rfid-override":Js,"replace-line":({holder:c,onComplete:i})=>r.jsx(Gs,{holder:c,onComplete:i})}),[]),[s,o]=p.useState(void 0),a=s?n[s]:void 0;return{holderExperience:a?r.jsx(a,{holder:t,pump:e,onComplete:()=>{o(void 0)}}):void 0,setHolderExperience:o,currentExperienceId:s}},Kt=p.createContext(void 0),na=({children:t,value:e})=>r.jsx(Kt.Provider,{value:e,children:t}),sa=t=>({HolderContent:void 0}),Ut=(t,e=sa)=>{const n=p.useContext(Kt);return e=(n==null?void 0:n.actionFactory)||e,e(t)},zt=()=>{const t=D.IngredientSummary.type;return u.useKosModel({modelId:t,modelType:D.IngredientSummary.type,options:{}})};function oa(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,ingredientSummary:n})})}}const Zt=()=>{const t=D.MacroAssignment.type;return u.useKosModel({modelId:t,modelType:D.MacroAssignment.type,options:{}})};function Ds(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,macroAssignment:n})})}}const Ht=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.NetworkTest.type,options:{}})};function ra(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Ht(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,networkTest:s})})}}const Wt=()=>{const t=D.NetworkTestContainer.type;return u.useKosModel({modelId:t,modelType:D.NetworkTestContainer.type,options:{}})};function Os(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Wt();return r.jsx(o,{...s,children:r.jsx(t,{...e,networkTestContainer:n})})}}const Ls=()=>{const t=D.NutritiveSweetener.type;return u.useKosModel({modelId:t,modelType:D.NutritiveSweetener.type,options:{}})};function aa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ls();return r.jsx(o,{...s,children:r.jsx(t,{...e,nutritiveSweetener:n})})}}const Rs=()=>{const t=D.PlainWater.type;return u.useKosModel({modelId:t,modelType:D.PlainWater.type,options:{},destroyOnUnmount:!0})};function ia(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Rs();return r.jsx(o,{...s,children:r.jsx(t,{...e,plainWater:n})})}}const ca=t=>{switch(t.type){case"fcm":return K.FcmPump.type;case"lfcv":return K.LfcvPump.type;case"micro":return K.SpmPump.type;case"cgp":return K.CgpPump.type;default:return}},ee="pluginVisibility",We=new Map;u.registerExtensionPoint(ee,{register:(t,e)=>{var n;We.has(t)||We.set(t,[]),(n=We.get(t))==null||n.push(e)},execute:(t,e,n)=>{const s=We.get(t);if(!s)return!0;const o=s.map(a=>a(e,n));return o.length===0?!0:!o.includes(!1)}});class Fs{constructor(e,n){M(this,"core");M(this,"dispense");this.core=e,this.dispense=n}registerDashboardVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}registerNavVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}}class la{constructor(){M(this,"dispense");M(this,"core");M(this,"plugin");this.dispense=new Dt.DispenseExtensionManager,this.core=new u.CoreExtensionManager,this.plugin=new Fs(this.core,this.dispense)}}const Re=t=>t?Ms(t.type):{action:"",label:"",progress:"",summary:""},Ms=t=>{const e=`troubles:troubles.${t}`;return{action:`${e}.action`,label:`${e}.label`,progress:`${e}.progress`,summary:`${e}.summary`}},Fe=t=>{const e=ae.useReactiveExtensionRegistry(),[,n]=p.useState({}),[s]=p.useState(new Set);return p.useEffect(()=>{const a=[];return s.forEach(c=>{const i=e.subscribe(c,()=>{n({})});a.push(i)}),()=>{a.forEach(c=>c())}},[e,s]),{getExtensions:p.useCallback(a=>(s.add(a),Object.values(e.getExtensions(a,!1)).filter(d=>{const m=d.id;return u.ExtensionManager[ee].execute(ee,m,t)})),[e,t,s])}},mt=()=>{const t=D.Reboot.type;return u.useKosModel({modelId:t,modelType:D.Reboot.type,options:{}})};function da(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,reboot:n})})}}const pt=()=>{const t=D.Settings.type;return u.useKosModel({modelId:t,modelType:D.Settings.type,options:{}})};function Xt(t){return e=>{const{model:n,status:s,KosModelLoader:o}=pt();return r.jsx(o,{...s,children:r.jsx(t,{...e,settings:n})})}}const qt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.SetupStep.type,options:{}})};function ua(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=qt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,setupStep:s})})}}const Gt=()=>{const t=D.SetupStepContainer.type;return u.useKosModel({modelId:t,modelType:D.SetupStepContainer.type,options:{}})};function Bs(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Gt();return r.jsx(o,{...s,children:r.jsx(t,{...e,setupStepContainer:n})})}}const Vs=()=>{const t=D.Start.type;return u.useKosModel({modelId:t,modelType:D.Start.type,options:{}})};function ma(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Vs();return r.jsx(o,{...s,children:r.jsx(t,{...e,start:n})})}}const Yt=()=>{const t=D.TroubleActionManager.type,{getExtensions:e}=Fe(),n=e(Qe.id).map(o=>o.data);return u.useKosModel({modelId:t,modelType:D.TroubleActionManager.type,options:{definitions:n}})};function pa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Yt();return r.jsx(o,{...s,children:r.jsx(t,{...e,troubleAction:n})})}}const ht=t=>{const[e,n]=p.useState({});return p.useEffect(()=>{async function s(){if(t){const o=await u.troubleDataFactory(t);n(o)}}s()},[t]),e},ha=t=>!t||t==="white",fa=t=>t?void 0:"white",$s=t=>{if(!u.isTroubleAware(t))return{};const e=t,{visibleTroubles:n,initialized:s}=we(e),o=(n==null?void 0:n.length)??0,a=n==null?void 0:n[0],c=o>0,i=c?`${a==null?void 0:a.color}`:void 0,d=ha(i),m=c?fa(d):void 0;return{backgroundColor:i,fontColor:m,highestTrouble:a,initialized:s,troubleCount:o,hasTroubles:c}},ga=({troubleType:t,condition:e})=>{const{model:n}=u.useTroubleContainerModel(),[s,o]=p.useState(!1),[a,c]=p.useState([]);return p.useEffect(()=>u.kosAutoEffect(()=>{const d=(t?n==null?void 0:n.troubles.getIndexByKey("byType",t):n==null?void 0:n.troubles.data)||[],m=e?d.filter(e):d;o(m.length>0),c(m)}),[e,n,t]),[s,a.length>0?a[0]:void 0,a]},Jt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.Utilities.type,options:{}})};function xa(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Jt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,utilities:s})})}}const Qt=()=>{const t=D.UtilitiesContainer.type;return u.useKosModel({modelId:t,modelType:D.UtilitiesContainer.type,options:{}})};function va(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Qt();return r.jsx(o,{...s,children:r.jsx(t,{...e,utilitiesContainer:n})})}}const Ks=u.withDevice(u.kosComponent(({device:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),s=t.serialNumber==="unassigned"?void 0:t.serialNumber;return r.jsx(l.InfoCard,{label:e("dispenser-serial"),value:s})})),ya=Ts(u.kosComponent(({dispenserInfo:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile");return r.jsxs(r.Fragment,{children:[r.jsx(fs,{label:e("dispenser-name","Dispenser Name"),configProperty:t.name}),r.jsx(Ks,{})]})})),ba=Xt(u.kosComponent(({settings:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),n=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return r.jsxs(r.Fragment,{children:[r.jsx(tt,{closeButtonLabel:e("close","Close")||void 0,configProperty:t==null?void 0:t.name,isValid:n,label:e("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),r.jsx(bs,{label:e("activate-and-reboot-time"),configProperty:t.activateAndRebootTime})]})})),Us=S(l.LabelDate)`
165
165
  color: var(--ddk-generic-color-grey-60);
166
166
  font-size: var(--ddk-component-enjoy-by-font-size-small);
167
167
  font-weight: var(--ddk-component-enjoy-by-font-weight-small);