@socotra/ec-react-components 2.2.4-alpha.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -72,5 +72,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
- */const Pb=Sb("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ob(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ob(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function FH(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ob(e))&&(n&&(n+=" "),n+=t);return n}const Nb=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Rb=FH,Db=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Rb(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(l=>{const c=r==null?void 0:r[l],d=o==null?void 0:o[l];if(c===null)return null;const p=Nb(c)||Nb(d);return a[l][p]}),i=r&&Object.entries(r).reduce((l,c)=>{let[d,p]=c;return p===void 0||(l[d]=p),l},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((l,c)=>{let{class:d,className:p,...v}=c;return Object.entries(v).every(y=>{let[C,g]=y;return Array.isArray(g)?g.includes({...o,...i}[C]):{...o,...i}[C]===g})?[...l,d,p]:l},[]);return Rb(e,s,u,r==null?void 0:r.class,r==null?void 0:r.className)},LH=Db("inline-flex max-w-full items-center rounded-sm border px-2.5 py-1 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-zinc-100 dark:bg-zinc-800 text-black dark:text-white font-bold",info:"border-transparent bg-blue-50 text-blue-900 font-bold",destructive:"border-transparent bg-red-50 text-red-700 font-bold",outline:"text-foreground font-bold",success:"border-transparent bg-green-50 text-green-700 font-bold",warning:"border-transparent bg-yellow-50 text-yellow-700 font-bold"}},defaultVariants:{variant:"default"}});function VH({className:e,variant:t,...r}){return ee.jsx("div",{className:lr("max-w-full break-words",LH({variant:t}),e),...r})}function GH(e){return ee.jsxs(pr.DropdownIndicator,{...e,children:[ee.jsx(Tb,{className:"size-4 opacity-50","aria-label":"expand dropdown"}),ee.jsx("span",{className:"sr-only",children:"expand dropdown"})]})}function WH(e){return ee.jsxs(pr.ClearIndicator,{...e,children:[ee.jsx(Pb,{className:"size-4 opacity-50","aria-label":"clear dropdown"}),ee.jsx("span",{className:"sr-only",children:"clear dropdown"})]})}function BH(e){const t=()=>`Delete ${e.selectProps.getOptionLabel(e.data)}`,r={...e,innerProps:{...e.innerProps,"aria-label":t()}};return ee.jsxs(pr.MultiValueRemove,{...r,children:[ee.jsx(Pb,{className:"ml-2 size-4 text-black dark:text-white"}),ee.jsx("span",{className:"sr-only",children:t()})]})}function ZH(e){return ee.jsx(pr.MultiValueContainer,{...e,children:ee.jsx(VH,{variant:"default",className:"max-w-full",children:e.children})})}function HH(e){const t=typeof e.children=="string"?"span":"div";return ee.jsx(pr.MultiValueLabel,{...e,children:ee.jsx(t,{children:e.children})})}function zH(e){return ee.jsx(pr.ValueContainer,{...e,children:e.children})}function XH(e){return ee.jsx(pr.MenuList,{...e,children:e.children})}function UH(e){return ee.jsx(pr.Option,{...e})}const Mb=I.forwardRef((e,t)=>ee.jsx(DH,{ref:t,unstyled:!0,components:{DropdownIndicator:GH,MultiValueRemove:BH,ClearIndicator:WH,MultiValueContainer:ZH,ValueContainer:zH,MenuList:XH,Option:UH,MultiValueLabel:HH},id:e.id,placeholder:e.placeholder??"",inputId:e.id,closeMenuOnSelect:!e.isMulti,classNames:{control:({isFocused:r,isDisabled:n})=>lr(["border-input bg-background ring-offset-background max-h-36 w-full overflow-y-auto rounded-md border px-3 text-sm",r?"ring-ring ring-2 ring-offset-2":"",n?"cursor-not-allowed opacity-50":"",e.invalid?"ring-destructive ring-2 ring-offset-2":""]),valueContainer:()=>"flex flex-row flex-wrap gap-2 py-2.5",menu:()=>"text-sm mt-2 p-1 relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",option:({isFocused:r,isSelected:n,isDisabled:a})=>lr("relative flex w-full cursor-default select-none items-center break-words rounded-sm px-4 py-1.5 outline-none",r?"bg-accent text-accent-foreground":"",n?"bg-primary text-white":"",a?"text-zinc-400":""),multiValueLabel:()=>"dark:text-white",placeholder:()=>e.invalid?"text-destructive":"text-muted-foreground",indicatorsContainer:()=>"align-start"},...e}));Mb.displayName="Autocomplete";const YH=e=>{const{data:t,className:r,id:n,enabled:a,schema:o,uischema:s,path:i,handleChange:u,options:l,t:c}=e,d=I.useMemo(()=>c("enum.none",ov["enum.none"],{schema:o,uischema:s,path:i}),[c,o,s,i]),p=I.useRef(null);return ee.jsx(Mb,{isClearable:!0,placeholder:d,ref:p,id:n,instanceId:n,options:l,name:"basePayment",value:l==null?void 0:l.find(v=>v.value===t),isDisabled:!a,isMulti:!1,className:r,onChange:v=>{u(i,v==null?void 0:v.value)},closeMenuOnSelect:!0})},JH=He(3,cs),qH=Gg(ec(iv(YH))),QH=({renderers:e,cells:t,uischemas:r,schema:n,label:a,path:o,visible:s,enabled:i,uischema:u,rootSchema:l})=>{const c=I.useMemo(()=>ug(r,n,u.scope,o,()=>$e(o)?Vn.uiSchema(n,"VerticalLayout",void 0,l):{...Vn.uiSchema(n,"Group",void 0,l),label:a},u,l),[r,n,o,a,u,l]);return s?ee.jsx(zn,{visible:s,enabled:i,schema:n,uischema:c,path:o,renderers:e,cells:t}):null},KH=He(2,Xh),ez=X4(QH);function tz(e){const t=e+"CollectionProvider",[r,n]=Is(t),[a,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:y,children:C}=v,g=I.useRef(null),f=I.useRef(new Map).current;return ee.jsx(a,{scope:y,itemMap:f,collectionRef:g,children:C})};s.displayName=t;const i=e+"CollectionSlot",u=I.forwardRef((v,y)=>{const{scope:C,children:g}=v,f=o(i,C),h=Xn(y,f.collectionRef);return ee.jsx(As,{ref:h,children:g})});u.displayName=i;const l=e+"CollectionItemSlot",c="data-radix-collection-item",d=I.forwardRef((v,y)=>{const{scope:C,children:g,...f}=v,h=I.useRef(null),S=Xn(y,h),T=o(l,C);return I.useEffect(()=>(T.itemMap.set(h,{ref:h,...f}),()=>void T.itemMap.delete(h))),ee.jsx(As,{[c]:"",ref:S,children:g})});d.displayName=l;function p(v){const y=o(e+"CollectionConsumer",v);return I.useCallback(()=>{const g=y.collectionRef.current;if(!g)return[];const f=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(y.itemMap.values()).sort((T,R)=>f.indexOf(T.ref.current)-f.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:d},p,n]}function rz(e,t){return q.useReducer((r,n)=>t[r][n]??r,e)}var kb=e=>{const{present:t,children:r}=e,n=nz(t),a=typeof r=="function"?r({present:n.isPresent}):q.Children.only(r),o=Xn(n.ref,az(a));return typeof r=="function"||n.isPresent?q.cloneElement(a,{ref:o}):null};kb.displayName="Presence";function nz(e){const[t,r]=q.useState(),n=q.useRef({}),a=q.useRef(e),o=q.useRef("none"),s=e?"mounted":"unmounted",[i,u]=rz(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return q.useEffect(()=>{const l=Ls(n.current);o.current=i==="mounted"?l:"none"},[i]),Fa(()=>{const l=n.current,c=a.current;if(c!==e){const p=o.current,v=Ls(l);e?u("MOUNT"):v==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&p!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Fa(()=>{if(t){const l=d=>{const v=Ls(n.current).includes(d.animationName);d.target===t&&v&&Py.flushSync(()=>u("ANIMATION_END"))},c=d=>{d.target===t&&(o.current=Ls(n.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:q.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Ls(e){return(e==null?void 0:e.animationName)||"none"}function az(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var oz=q.useId||(()=>{}),sz=0;function jb(e){const[t,r]=q.useState(oz());return Fa(()=>{r(n=>n??String(sz++))},[e]),t?`radix-${t}`:""}var Nc="Collapsible",[iz,Fb]=Is(Nc),[uz,Rc]=iz(Nc),Lb=q.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:o,onOpenChange:s,...i}=e,[u=!1,l]=$s({prop:n,defaultProp:a,onChange:s});return ee.jsx(uz,{scope:r,disabled:o,contentId:jb(),open:u,onOpenToggle:q.useCallback(()=>l(c=>!c),[l]),children:ee.jsx(rn.div,{"data-state":Mc(u),"data-disabled":o?"":void 0,...i,ref:t})})});Lb.displayName=Nc;var Vb="CollapsibleTrigger",Gb=q.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,a=Rc(Vb,r);return ee.jsx(rn.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":Mc(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:t,onClick:dc(e.onClick,a.onOpenToggle)})});Gb.displayName=Vb;var Dc="CollapsibleContent",Wb=q.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Rc(Dc,e.__scopeCollapsible);return ee.jsx(kb,{present:r||a.open,children:({present:o})=>ee.jsx(lz,{...n,ref:t,present:o})})});Wb.displayName=Dc;var lz=q.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:a,...o}=e,s=Rc(Dc,r),[i,u]=q.useState(n),l=q.useRef(null),c=Xn(t,l),d=q.useRef(0),p=d.current,v=q.useRef(0),y=v.current,C=s.open||i,g=q.useRef(C),f=q.useRef();return q.useEffect(()=>{const h=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(h)},[]),Fa(()=>{const h=l.current;if(h){f.current=f.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const S=h.getBoundingClientRect();d.current=S.height,v.current=S.width,g.current||(h.style.transitionDuration=f.current.transitionDuration,h.style.animationName=f.current.animationName),u(n)}},[s.open,n]),ee.jsx(rn.div,{"data-state":Mc(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!C,...o,ref:c,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:C&&a})});function Mc(e){return e?"open":"closed"}var cz=Lb,dz=Gb,fz=Wb,pz=q.createContext(void 0);function mz(e){const t=q.useContext(pz);return e||t||"ltr"}var mr="Accordion",hz=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[kc,gz,vz]=tz(mr),[Vs,sY]=Is(mr,[vz,Fb]),jc=Fb(),Bb=I.forwardRef((e,t)=>{const{type:r,...n}=e,a=n,o=n;return ee.jsx(kc.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?ee.jsx(_z,{...o,ref:t}):ee.jsx(Cz,{...a,ref:t})})});Bb.displayName=mr;var[Zb,bz]=Vs(mr),[Hb,yz]=Vs(mr,{collapsible:!1}),Cz=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},collapsible:o=!1,...s}=e,[i,u]=$s({prop:r,defaultProp:n,onChange:a});return ee.jsx(Zb,{scope:e.__scopeAccordion,value:i?[i]:[],onItemOpen:u,onItemClose:I.useCallback(()=>o&&u(""),[o,u]),children:ee.jsx(Hb,{scope:e.__scopeAccordion,collapsible:o,children:ee.jsx(zb,{...s,ref:t})})})}),_z=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=e,[s=[],i]=$s({prop:r,defaultProp:n,onChange:a}),u=I.useCallback(c=>i((d=[])=>[...d,c]),[i]),l=I.useCallback(c=>i((d=[])=>d.filter(p=>p!==c)),[i]);return ee.jsx(Zb,{scope:e.__scopeAccordion,value:s,onItemOpen:u,onItemClose:l,children:ee.jsx(Hb,{scope:e.__scopeAccordion,collapsible:!0,children:ee.jsx(zb,{...o,ref:t})})})}),[Iz,Gs]=Vs(mr),zb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:a,orientation:o="vertical",...s}=e,i=I.useRef(null),u=Xn(i,t),l=gz(r),d=mz(a)==="ltr",p=dc(e.onKeyDown,v=>{var V;if(!hz.includes(v.key))return;const y=v.target,C=l().filter(W=>{var X;return!((X=W.ref.current)!=null&&X.disabled)}),g=C.findIndex(W=>W.ref.current===y),f=C.length;if(g===-1)return;v.preventDefault();let h=g;const S=0,T=f-1,R=()=>{h=g+1,h>T&&(h=S)},k=()=>{h=g-1,h<S&&(h=T)};switch(v.key){case"Home":h=S;break;case"End":h=T;break;case"ArrowRight":o==="horizontal"&&(d?R():k());break;case"ArrowDown":o==="vertical"&&R();break;case"ArrowLeft":o==="horizontal"&&(d?k():R());break;case"ArrowUp":o==="vertical"&&k();break}const G=h%f;(V=C[G].ref.current)==null||V.focus()});return ee.jsx(Iz,{scope:r,disabled:n,direction:a,orientation:o,children:ee.jsx(kc.Slot,{scope:r,children:ee.jsx(rn.div,{...s,"data-orientation":o,ref:u,onKeyDown:n?void 0:p})})})}),Ws="AccordionItem",[$z,Fc]=Vs(Ws),Xb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...a}=e,o=Gs(Ws,r),s=bz(Ws,r),i=jc(r),u=jb(),l=n&&s.value.includes(n)||!1,c=o.disabled||e.disabled;return ee.jsx($z,{scope:r,open:l,disabled:c,triggerId:u,children:ee.jsx(cz,{"data-orientation":o.orientation,"data-state":Kb(l),...i,...a,ref:t,disabled:c,open:l,onOpenChange:d=>{d?s.onItemOpen(n):s.onItemClose(n)}})})});Xb.displayName=Ws;var Ub="AccordionHeader",Yb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Gs(mr,r),o=Fc(Ub,r);return ee.jsx(rn.h3,{"data-orientation":a.orientation,"data-state":Kb(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});Yb.displayName=Ub;var Lc="AccordionTrigger",Jb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Gs(mr,r),o=Fc(Lc,r),s=yz(Lc,r),i=jc(r);return ee.jsx(kc.ItemSlot,{scope:r,children:ee.jsx(dz,{"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":a.orientation,id:o.triggerId,...i,...n,ref:t})})});Jb.displayName=Lc;var qb="AccordionContent",Qb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Gs(mr,r),o=Fc(qb,r),s=jc(r);return ee.jsx(fz,{role:"region","aria-labelledby":o.triggerId,"data-orientation":a.orientation,...s,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Qb.displayName=qb;function Kb(e){return e?"open":"closed"}var Az=Bb,Ez=Xb,wz=Yb,ey=Jb,ty=Qb;const xz=Az,ry=q.forwardRef(({className:e,...t},r)=>ee.jsx(Ez,{ref:r,className:lr("border-b",e),...t}));ry.displayName="AccordionItem";const ny=q.forwardRef(({className:e,children:t,...r},n)=>ee.jsx(wz,{className:"flex",children:ee.jsxs(ey,{ref:n,className:lr("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,ee.jsx(Tb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));ny.displayName=ey.displayName;const ay=q.forwardRef(({className:e,children:t,...r},n)=>ee.jsx(ty,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:ee.jsx("div",{className:lr("pb-4 pt-0",e),children:t})}));ay.displayName=ty.displayName;const Sz=({className:e,children:t,visible:r})=>ee.jsx("div",{className:e,hidden:r==null?!1:!r,children:t}),Tz=(e,t,r,n,a)=>{const{renderers:o,cells:s}=Hn();return $e(e.elements)?[]:e.elements.map((i,u)=>ee.jsx("div",{className:r,children:ee.jsx(zn,{renderers:o,cells:s,uischema:i,schema:t,path:n,enabled:a})},`${n}-${u}`))},Pz=He(1,Ve("CollapsingVerticalLayout")),Oz=e=>{const{data:t,...r}=e;return ee.jsx(Nz,{...r})},Nz=I.memo(function({schema:t,uischema:r,path:n,visible:a,enabled:o,getStyle:s,getStyleAsClassName:i}){const u=r,l=u.elements?u.elements.length:0,c=i&&i("vertical.layout"),d=["vertical-layout-item"].concat(s?s("vertical.layout.item",l):[]).join(" ");return ee.jsx("fieldset",{className:"group-layout pb-4",children:ee.jsx(xz,{type:"single",collapsible:!0,children:ee.jsxs(ry,{value:"item-1",className:"[&>div]:data-[state=open]:overflow-visible",children:[ee.jsx(ny,{className:"text-muted-foreground text-sm font-normal",children:r.label}),ee.jsx(ay,{className:"p-1",children:ee.jsx(Sz,{className:c,uischema:r,schema:t,visible:a,enabled:o,path:n,getStyle:s,getStyleAsClassName:i,children:Tz(u,t,d,n,o)})})]})})})}),Rz=kt(ka(Oz,!1)),Vc=[...VB,{tester:KH,renderer:ez},{tester:Pz,renderer:Rz}],Gc=[...GB,{tester:JH,cell:qH},{tester:j3,cell:F3}];var Re;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const o={};for(const s of a)o[s]=s;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(i=>typeof a[a[i]]!="number"),s={};for(const i of o)s[i]=a[i];return e.objectValues(s)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&o.push(s);return o},e.find=(a,o)=>{for(const s of a)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,o=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(Re||(Re={}));var Wc;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Wc||(Wc={}));const ue=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Tr=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}},K=Re.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"]),Dz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ct extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},a=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let i=n,u=0;for(;u<s.path.length;){const l=s.path[u];u===s.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(r(s))):i[l]=i[l]||{_errors:[]},i=i[l],u++}}};return a(this),n}static assert(t){if(!(t instanceof Ct))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ct.create=e=>new Ct(e);const Jn=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Re.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Re.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Re.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case K.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Re.assertNever(e)}return{message:r}};let oy=Jn;function Mz(e){oy=e}function Bs(){return oy}const Zs=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,o=[...r,...a.path||[]],s={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let i="";const u=n.filter(l=>!!l).slice().reverse();for(const l of u)i=l(s,{data:t,defaultError:i}).message;return{...a,path:o,message:i}},kz=[];function oe(e,t){const r=Bs(),n=Zs({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Jn?void 0:Jn].filter(a=>!!a)});e.common.issues.push(n)}class st{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return Ie;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const o=await a.key,s=await a.value;n.push({key:o,value:s})}return st.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:o,value:s}=a;if(o.status==="aborted"||s.status==="aborted")return Ie;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(n[o.value]=s.value)}return{status:t.value,value:n}}}const Ie=Object.freeze({status:"aborted"}),qn=e=>({status:"dirty",value:e}),dt=e=>({status:"valid",value:e}),Bc=e=>e.status==="aborted",Zc=e=>e.status==="dirty",Ba=e=>e.status==="valid",Za=e=>typeof Promise<"u"&&e instanceof Promise;function Hs(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function sy(e,t,r,n,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));var Ha,za;class Xt{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const iy=(e,t)=>{if(Ba(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ct(e.common.issues);return this._error=r,this._error}}};function we(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(s,i)=>{var u,l;const{message:c}=e;return s.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:i.defaultError}:s.code!=="invalid_type"?{message:i.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:i.defaultError}},description:a}}class Pe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Tr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new st,ctx:{common:t.parent.common,data:t.data,parsedType:Tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Za(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const a={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tr(t)},o=this._parseSync({data:t,path:a.path,parent:a});return iy(a,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tr(t)},a=this._parse({data:t,path:n.path,parent:n}),o=await(Za(a)?a:Promise.resolve(a));return iy(n,o)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,o)=>{const s=t(a),i=()=>o.addIssue({code:K.custom,...n(a)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(i(),!1)):s?!0:(i(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Lt({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Yt.create(this,this._def)}nullable(){return Rr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ft.create(this,this._def)}promise(){return ta.create(this,this._def)}or(t){return Ja.create([this,t],this._def)}and(t){return qa.create(this,t,this._def)}transform(t){return new Lt({...we(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ro({...we(this._def),innerType:this,defaultValue:r,typeName:ye.ZodDefault})}brand(){return new Xc({typeName:ye.ZodBranded,type:this,...we(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new no({...we(this._def),innerType:this,catchValue:r,typeName:ye.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ao.create(this,t)}readonly(){return oo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jz=/^c[^\s-]{8,}$/i,Fz=/^[0-9a-z]+$/,Lz=/^[0-9A-HJKMNP-TV-Z]{26}$/,Vz=/^[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,Gz=/^[a-z0-9_-]{21}$/i,Wz=/^[-+]?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)?)??$/,Bz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Hc;const Hz=/^(?:(?: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])$/,zz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Xz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,uy="((\\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])))",Uz=new RegExp(`^${uy}$`);function ly(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Yz(e){return new RegExp(`^${ly(e)}$`)}function cy(e){let t=`${uy}T${ly(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Jz(e,t){return!!((t==="v4"||!t)&&Hz.test(e)||(t==="v6"||!t)&&zz.test(e))}class jt extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.string,received:o.parsedType}),Ie}const n=new st;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,i=t.data.length<o.value;(s||i)&&(a=this._getOrReturnCtx(t,a),s?oe(a,{code:K.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&oe(a,{code:K.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Bz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"email",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Hc||(Hc=new RegExp(Zz,"u")),Hc.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"emoji",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Vz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"uuid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Gz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"nanoid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")jz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"cuid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Fz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"cuid2",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Lz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"ulid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),oe(a,{validation:"url",code:K.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"regex",code:K.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?cy(o).test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Uz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Yz(o).test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Wz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"duration",code:K.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Jz(t.data,o.version)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"ip",code:K.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Xz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"base64",code:K.invalid_string,message:o.message}),n.dirty()):Re.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:K.invalid_string,...pe.errToObj(n)})}_addCheck(t){return new jt({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...pe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...pe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...pe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...pe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...pe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...pe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...pe.errToObj(r)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}jt.create=e=>{var t;return new jt({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};function qz(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,o=parseInt(e.toFixed(a).replace(".","")),s=parseInt(t.toFixed(a).replace(".",""));return o%s/Math.pow(10,a)}class Pr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ue.number){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.number,received:o.parsedType}),Ie}let n;const a=new st;for(const o of this._def.checks)o.kind==="int"?Re.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:K.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?qz(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:K.not_finite,message:o.message}),a.dirty()):Re.assertNever(o);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,pe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,pe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,pe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,pe.toString(r))}setLimit(t,r,n,a){return new Pr({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:pe.toString(a)}]})}_addCheck(t){return new Pr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Re.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Pr.create=e=>new Pr({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class Or extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ue.bigint){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.bigint,received:o.parsedType}),Ie}let n;const a=new st;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):Re.assertNever(o);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,pe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,pe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,pe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,pe.toString(r))}setLimit(t,r,n,a){return new Or({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:pe.toString(a)}]})}_addCheck(t){return new Or({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Or.create=e=>{var t;return new Or({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};class Xa extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.boolean,received:n.parsedType}),Ie}return dt(t.data)}}Xa.create=e=>new Xa({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class on extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.date,received:o.parsedType}),Ie}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_date}),Ie}const n=new st;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Re.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new on({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}on.create=e=>new on({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,...we(e)});class zs extends Pe{_parse(t){if(this._getType(t)!==ue.symbol){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.symbol,received:n.parsedType}),Ie}return dt(t.data)}}zs.create=e=>new zs({typeName:ye.ZodSymbol,...we(e)});class Ua extends Pe{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.undefined,received:n.parsedType}),Ie}return dt(t.data)}}Ua.create=e=>new Ua({typeName:ye.ZodUndefined,...we(e)});class Ya extends Pe{_parse(t){if(this._getType(t)!==ue.null){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.null,received:n.parsedType}),Ie}return dt(t.data)}}Ya.create=e=>new Ya({typeName:ye.ZodNull,...we(e)});class Qn extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return dt(t.data)}}Qn.create=e=>new Qn({typeName:ye.ZodAny,...we(e)});class sn extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return dt(t.data)}}sn.create=e=>new sn({typeName:ye.ZodUnknown,...we(e)});class hr extends Pe{_parse(t){const r=this._getOrReturnCtx(t);return oe(r,{code:K.invalid_type,expected:ue.never,received:r.parsedType}),Ie}}hr.create=e=>new hr({typeName:ye.ZodNever,...we(e)});class Xs extends Pe{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.void,received:n.parsedType}),Ie}return dt(t.data)}}Xs.create=e=>new Xs({typeName:ye.ZodVoid,...we(e)});class Ft extends Pe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==ue.array)return oe(r,{code:K.invalid_type,expected:ue.array,received:r.parsedType}),Ie;if(a.exactLength!==null){const s=r.data.length>a.exactLength.value,i=r.data.length<a.exactLength.value;(s||i)&&(oe(r,{code:s?K.too_big:K.too_small,minimum:i?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(oe(r,{code:K.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(oe(r,{code:K.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,i)=>a.type._parseAsync(new Xt(r,s,r.path,i)))).then(s=>st.mergeArray(n,s));const o=[...r.data].map((s,i)=>a.type._parseSync(new Xt(r,s,r.path,i)));return st.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Ft({...this._def,minLength:{value:t,message:pe.toString(r)}})}max(t,r){return new Ft({...this._def,maxLength:{value:t,message:pe.toString(r)}})}length(t,r){return new Ft({...this._def,exactLength:{value:t,message:pe.toString(r)}})}nonempty(t){return this.min(1,t)}}Ft.create=(e,t)=>new Ft({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...we(t)});function Kn(e){if(e instanceof Xe){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Yt.create(Kn(n))}return new Xe({...e._def,shape:()=>t})}else return e instanceof Ft?new Ft({...e._def,type:Kn(e.element)}):e instanceof Yt?Yt.create(Kn(e.unwrap())):e instanceof Rr?Rr.create(Kn(e.unwrap())):e instanceof Ut?Ut.create(e.items.map(t=>Kn(t))):e}class Xe extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Re.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ue.object){const l=this._getOrReturnCtx(t);return oe(l,{code:K.invalid_type,expected:ue.object,received:l.parsedType}),Ie}const{status:n,ctx:a}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof hr&&this._def.unknownKeys==="strip"))for(const l in a.data)s.includes(l)||i.push(l);const u=[];for(const l of s){const c=o[l],d=a.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Xt(a,d,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof hr){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of i)u.push({key:{status:"valid",value:c},value:{status:"valid",value:a.data[c]}});else if(l==="strict")i.length>0&&(oe(a,{code:K.unrecognized_keys,keys:i}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of i){const d=a.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Xt(a,d,a.path,c)),alwaysSet:c in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const d=await c.key,p=await c.value;l.push({key:d,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>st.mergeObjectSync(n,l)):st.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new Xe({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,o,s,i;const u=(s=(o=(a=this._def).errorMap)===null||o===void 0?void 0:o.call(a,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(i=pe.errToObj(t).message)!==null&&i!==void 0?i:u}:{message:u}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(t){return new Xe({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Xe({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Xe({...this._def,catchall:t})}pick(t){const r={};return Re.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Xe({...this._def,shape:()=>r})}omit(t){const r={};return Re.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Xe({...this._def,shape:()=>r})}deepPartial(){return Kn(this)}partial(t){const r={};return Re.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new Xe({...this._def,shape:()=>r})}required(t){const r={};return Re.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Yt;)o=o._def.innerType;r[n]=o}}),new Xe({...this._def,shape:()=>r})}keyof(){return dy(Re.objectKeys(this.shape))}}Xe.create=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strip",catchall:hr.create(),typeName:ye.ZodObject,...we(t)}),Xe.strictCreate=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strict",catchall:hr.create(),typeName:ye.ZodObject,...we(t)}),Xe.lazycreate=(e,t)=>new Xe({shape:e,unknownKeys:"strip",catchall:hr.create(),typeName:ye.ZodObject,...we(t)});class Ja extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(o){for(const i of o)if(i.result.status==="valid")return i.result;for(const i of o)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(i=>new Ct(i.ctx.common.issues));return oe(r,{code:K.invalid_union,unionErrors:s}),Ie}if(r.common.async)return Promise.all(n.map(async o=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(a);{let o;const s=[];for(const u of n){const l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(u=>new Ct(u));return oe(r,{code:K.invalid_union,unionErrors:i}),Ie}}get options(){return this._def.options}}Ja.create=(e,t)=>new Ja({options:e,typeName:ye.ZodUnion,...we(t)});const gr=e=>e instanceof Ka?gr(e.schema):e instanceof Lt?gr(e.innerType()):e instanceof eo?[e.value]:e instanceof Nr?e.options:e instanceof to?Re.objectValues(e.enum):e instanceof ro?gr(e._def.innerType):e instanceof Ua?[void 0]:e instanceof Ya?[null]:e instanceof Yt?[void 0,...gr(e.unwrap())]:e instanceof Rr?[null,...gr(e.unwrap())]:e instanceof Xc||e instanceof oo?gr(e.unwrap()):e instanceof no?gr(e._def.innerType):[];class Us extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.object)return oe(r,{code:K.invalid_type,expected:ue.object,received:r.parsedType}),Ie;const n=this.discriminator,a=r.data[n],o=this.optionsMap.get(a);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(oe(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ie)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const a=new Map;for(const o of r){const s=gr(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const i of s){if(a.has(i))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(i)}`);a.set(i,o)}}return new Us({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...we(n)})}}function zc(e,t){const r=Tr(e),n=Tr(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){const a=Re.objectKeys(t),o=Re.objectKeys(e).filter(i=>a.indexOf(i)!==-1),s={...e,...t};for(const i of o){const u=zc(e[i],t[i]);if(!u.valid)return{valid:!1};s[i]=u.data}return{valid:!0,data:s}}else if(r===ue.array&&n===ue.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o<e.length;o++){const s=e[o],i=t[o],u=zc(s,i);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return r===ue.date&&n===ue.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class qa extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=(o,s)=>{if(Bc(o)||Bc(s))return Ie;const i=zc(o.value,s.value);return i.valid?((Zc(o)||Zc(s))&&r.dirty(),{status:r.value,value:i.data}):(oe(n,{code:K.invalid_intersection_types}),Ie)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>a(o,s)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}qa.create=(e,t,r)=>new qa({left:e,right:t,typeName:ye.ZodIntersection,...we(r)});class Ut extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return oe(n,{code:K.invalid_type,expected:ue.array,received:n.parsedType}),Ie;if(n.data.length<this._def.items.length)return oe(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ie;!this._def.rest&&n.data.length>this._def.items.length&&(oe(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((s,i)=>{const u=this._def.items[i]||this._def.rest;return u?u._parse(new Xt(n,s,n.path,i)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>st.mergeArray(r,s)):st.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Ut({...this._def,rest:t})}}Ut.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ut({items:e,typeName:ye.ZodTuple,rest:null,...we(t)})};class Qa extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.object)return oe(n,{code:K.invalid_type,expected:ue.object,received:n.parsedType}),Ie;const a=[],o=this._def.keyType,s=this._def.valueType;for(const i in n.data)a.push({key:o._parse(new Xt(n,i,n.path,i)),value:s._parse(new Xt(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?st.mergeObjectAsync(r,a):st.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Pe?new Qa({keyType:t,valueType:r,typeName:ye.ZodRecord,...we(n)}):new Qa({keyType:jt.create(),valueType:t,typeName:ye.ZodRecord,...we(r)})}}class Ys extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.map)return oe(n,{code:K.invalid_type,expected:ue.map,received:n.parsedType}),Ie;const a=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,u],l)=>({key:a._parse(new Xt(n,i,n.path,[l,"key"])),value:o._parse(new Xt(n,u,n.path,[l,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const u of s){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return Ie;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),i.set(l.value,c.value)}return{status:r.value,value:i}})}else{const i=new Map;for(const u of s){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return Ie;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),i.set(l.value,c.value)}return{status:r.value,value:i}}}}Ys.create=(e,t,r)=>new Ys({valueType:t,keyType:e,typeName:ye.ZodMap,...we(r)});class un extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return oe(n,{code:K.invalid_type,expected:ue.set,received:n.parsedType}),Ie;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(oe(n,{code:K.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(oe(n,{code:K.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const o=this._def.valueType;function s(u){const l=new Set;for(const c of u){if(c.status==="aborted")return Ie;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}const i=[...n.data.values()].map((u,l)=>o._parse(new Xt(n,u,n.path,l)));return n.common.async?Promise.all(i).then(u=>s(u)):s(i)}min(t,r){return new un({...this._def,minSize:{value:t,message:pe.toString(r)}})}max(t,r){return new un({...this._def,maxSize:{value:t,message:pe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}un.create=(e,t)=>new un({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...we(t)});class ea extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.function)return oe(r,{code:K.invalid_type,expected:ue.function,received:r.parsedType}),Ie;function n(i,u){return Zs({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Jn].filter(l=>!!l),issueData:{code:K.invalid_arguments,argumentsError:u}})}function a(i,u){return Zs({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Jn].filter(l=>!!l),issueData:{code:K.invalid_return_type,returnTypeError:u}})}const o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof ta){const i=this;return dt(async function(...u){const l=new Ct([]),c=await i._def.args.parseAsync(u,o).catch(v=>{throw l.addIssue(n(u,v)),l}),d=await Reflect.apply(s,this,c);return await i._def.returns._def.type.parseAsync(d,o).catch(v=>{throw l.addIssue(a(d,v)),l})})}else{const i=this;return dt(function(...u){const l=i._def.args.safeParse(u,o);if(!l.success)throw new Ct([n(u,l.error)]);const c=Reflect.apply(s,this,l.data),d=i._def.returns.safeParse(c,o);if(!d.success)throw new Ct([a(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ea({...this._def,args:Ut.create(t).rest(sn.create())})}returns(t){return new ea({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ea({args:t||Ut.create([]).rest(sn.create()),returns:r||sn.create(),typeName:ye.ZodFunction,...we(n)})}}class Ka extends Pe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ka.create=(e,t)=>new Ka({getter:e,typeName:ye.ZodLazy,...we(t)});class eo extends Pe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),Ie}return{status:"valid",value:t.data}}get value(){return this._def.value}}eo.create=(e,t)=>new eo({value:e,typeName:ye.ZodLiteral,...we(t)});function dy(e,t){return new Nr({values:e,typeName:ye.ZodEnum,...we(t)})}class Nr extends Pe{constructor(){super(...arguments),Ha.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:Re.joinValues(n),received:r.parsedType,code:K.invalid_type}),Ie}if(Hs(this,Ha)||sy(this,Ha,new Set(this._def.values)),!Hs(this,Ha).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:K.invalid_enum_value,options:n}),Ie}return dt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Nr.create(t,{...this._def,...r})}exclude(t,r=this._def){return Nr.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ha=new WeakMap,Nr.create=dy;class to extends Pe{constructor(){super(...arguments),za.set(this,void 0)}_parse(t){const r=Re.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){const a=Re.objectValues(r);return oe(n,{expected:Re.joinValues(a),received:n.parsedType,code:K.invalid_type}),Ie}if(Hs(this,za)||sy(this,za,new Set(Re.getValidEnumValues(this._def.values))),!Hs(this,za).has(t.data)){const a=Re.objectValues(r);return oe(n,{received:n.data,code:K.invalid_enum_value,options:a}),Ie}return dt(t.data)}get enum(){return this._def.values}}za=new WeakMap,to.create=(e,t)=>new to({values:e,typeName:ye.ZodNativeEnum,...we(t)});class ta extends Pe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return oe(r,{code:K.invalid_type,expected:ue.promise,received:r.parsedType}),Ie;const n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return dt(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ta.create=(e,t)=>new ta({type:e,typeName:ye.ZodPromise,...we(t)});class Lt extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:s=>{oe(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const s=a.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async i=>{if(r.value==="aborted")return Ie;const u=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return u.status==="aborted"?Ie:u.status==="dirty"||r.value==="dirty"?qn(u.value):u});{if(r.value==="aborted")return Ie;const i=this._def.schema._parseSync({data:s,path:n.path,parent:n});return i.status==="aborted"?Ie:i.status==="dirty"||r.value==="dirty"?qn(i.value):i}}if(a.type==="refinement"){const s=i=>{const u=a.refinement(i,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ie:(i.status==="dirty"&&r.dirty(),s(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?Ie:(i.status==="dirty"&&r.dirty(),s(i.value).then(()=>({status:r.value,value:i.value}))))}if(a.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ba(s))return s;const i=a.transform(s.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Ba(s)?Promise.resolve(a.transform(s.value,o)).then(i=>({status:r.value,value:i})):s);Re.assertNever(a)}}Lt.create=(e,t,r)=>new Lt({schema:e,typeName:ye.ZodEffects,effect:t,...we(r)}),Lt.createWithPreprocess=(e,t,r)=>new Lt({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...we(r)});class Yt extends Pe{_parse(t){return this._getType(t)===ue.undefined?dt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yt.create=(e,t)=>new Yt({innerType:e,typeName:ye.ZodOptional,...we(t)});class Rr extends Pe{_parse(t){return this._getType(t)===ue.null?dt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rr.create=(e,t)=>new Rr({innerType:e,typeName:ye.ZodNullable,...we(t)});class ro extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ro.create=(e,t)=>new ro({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...we(t)});class no extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Za(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ct(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ct(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}no.create=(e,t)=>new no({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...we(t)});class Js extends Pe{_parse(t){if(this._getType(t)!==ue.nan){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.nan,received:n.parsedType}),Ie}return{status:"valid",value:t.data}}}Js.create=e=>new Js({typeName:ye.ZodNaN,...we(e)});const Qz=Symbol("zod_brand");class Xc extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ao extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ie:o.status==="dirty"?(r.dirty(),qn(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ie:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new ao({in:t,out:r,typeName:ye.ZodPipeline})}}class oo extends Pe{_parse(t){const r=this._def.innerType._parse(t),n=a=>(Ba(a)&&(a.value=Object.freeze(a.value)),a);return Za(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}oo.create=(e,t)=>new oo({innerType:e,typeName:ye.ZodReadonly,...we(t)});function fy(e,t={},r){return e?Qn.create().superRefine((n,a)=>{var o,s;if(!e(n)){const i=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,u=(s=(o=i.fatal)!==null&&o!==void 0?o:r)!==null&&s!==void 0?s:!0,l=typeof i=="string"?{message:i}:i;a.addIssue({code:"custom",...l,fatal:u})}}):Qn.create()}const Kz={object:Xe.lazycreate};var ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ye||(ye={}));const eX=(e,t={message:`Input not instance of ${e.name}`})=>fy(r=>r instanceof e,t),py=jt.create,my=Pr.create,tX=Js.create,rX=Or.create,hy=Xa.create,nX=on.create,aX=zs.create,oX=Ua.create,sX=Ya.create,iX=Qn.create,uX=sn.create,lX=hr.create,cX=Xs.create,dX=Ft.create,fX=Xe.create,pX=Xe.strictCreate,mX=Ja.create,hX=Us.create,gX=qa.create,vX=Ut.create,bX=Qa.create,yX=Ys.create,CX=un.create,_X=ea.create,IX=Ka.create,$X=eo.create,AX=Nr.create,EX=to.create,wX=ta.create,gy=Lt.create,xX=Yt.create,SX=Rr.create,TX=Lt.createWithPreprocess,PX=ao.create;var D=Object.freeze({__proto__:null,defaultErrorMap:Jn,setErrorMap:Mz,getErrorMap:Bs,makeIssue:Zs,EMPTY_PATH:kz,addIssueToContext:oe,ParseStatus:st,INVALID:Ie,DIRTY:qn,OK:dt,isAborted:Bc,isDirty:Zc,isValid:Ba,isAsync:Za,get util(){return Re},get objectUtil(){return Wc},ZodParsedType:ue,getParsedType:Tr,ZodType:Pe,datetimeRegex:cy,ZodString:jt,ZodNumber:Pr,ZodBigInt:Or,ZodBoolean:Xa,ZodDate:on,ZodSymbol:zs,ZodUndefined:Ua,ZodNull:Ya,ZodAny:Qn,ZodUnknown:sn,ZodNever:hr,ZodVoid:Xs,ZodArray:Ft,ZodObject:Xe,ZodUnion:Ja,ZodDiscriminatedUnion:Us,ZodIntersection:qa,ZodTuple:Ut,ZodRecord:Qa,ZodMap:Ys,ZodSet:un,ZodFunction:ea,ZodLazy:Ka,ZodLiteral:eo,ZodEnum:Nr,ZodNativeEnum:to,ZodPromise:ta,ZodEffects:Lt,ZodTransformer:Lt,ZodOptional:Yt,ZodNullable:Rr,ZodDefault:ro,ZodCatch:no,ZodNaN:Js,BRAND:Qz,ZodBranded:Xc,ZodPipeline:ao,ZodReadonly:oo,custom:fy,Schema:Pe,ZodSchema:Pe,late:Kz,get ZodFirstPartyTypeKind(){return ye},coerce:{string:e=>jt.create({...e,coerce:!0}),number:e=>Pr.create({...e,coerce:!0}),boolean:e=>Xa.create({...e,coerce:!0}),bigint:e=>Or.create({...e,coerce:!0}),date:e=>on.create({...e,coerce:!0})},any:iX,array:dX,bigint:rX,boolean:hy,date:nX,discriminatedUnion:hX,effect:gy,enum:AX,function:_X,instanceof:eX,intersection:gX,lazy:IX,literal:$X,map:yX,nan:tX,nativeEnum:EX,never:lX,null:sX,nullable:SX,number:my,object:fX,oboolean:()=>hy().optional(),onumber:()=>my().optional(),optional:xX,ostring:()=>py().optional(),pipeline:PX,preprocess:TX,promise:wX,record:bX,set:CX,strictObject:pX,string:py,symbol:aX,transformer:gy,tuple:vX,undefined:oX,union:mX,unknown:uX,void:cX,NEVER:Ie,ZodIssueCode:K,quotelessJson:Dz,ZodError:Ct});const so=D.object({displayName:D.string().optional(),defaultValue:D.string().optional(),type:D.string().optional(),minLength:D.number().optional(),maxLength:D.number().optional(),regex:D.string().optional(),min:D.string().optional(),multiline:D.boolean().optional(),max:D.string().optional(),options:D.array(D.string()).optional(),overrides:D.string().optional(),scope:D.string().optional(),inherited:D.boolean().optional(),precision:D.number().optional(),readOnly:D.boolean().optional()});D.record(so);const OX=D.object({displayName:D.string().optional(),abstract:D.boolean().optional(),extend:D.string().optional(),data:D.record(so).optional()}),NX=D.record(OX),RX=D.object({displayName:D.string().optional(),contents:D.array(D.string()).optional(),abstract:D.boolean().optional(),extend:D.string().optional(),data:D.record(so).optional()}),io=D.record(RX),DX=D.object({defaultTimeZone:D.string().optional(),defaultCurrency:D.string().optional(),defaultTermDuration:D.number().optional(),defaultDurationBasis:D.string().optional(),defaultInstallmentPlan:D.string().optional()}),MX=D.object({abstract:D.boolean().optional(),extend:D.string().optional(),displayName:D.string().optional(),coverageTerms:D.array(D.string()).optional(),eligibleAccountTypes:D.array(D.string()).optional(),contents:D.array(D.string()).optional(),documents:D.array(D.string()).optional(),plugins:D.any(),tables:D.any(),data:D.record(so).optional()}).merge(DX),kX=D.record(MX);D.object({dataTypes:io,accounts:NX,products:kX,policyLines:io.optional(),exposures:io.optional(),exposureGroups:io.optional(),coverages:io.optional(),defaultTimeZone:D.string().optional(),defaultCurrency:D.string().optional(),defaultTermDuration:D.number().optional(),defaultInstallmentPlan:D.string().optional(),defaultBillingPlan:D.string().optional(),defaultDurationBasis:D.string().optional(),defaultDelinquencyPlan:D.string().optional(),defaultAuxDataSettings:D.string().optional(),coverageTerms:D.any(),charges:D.any(),transactionTypes:D.any(),installmentPlans:D.any(),billingPlans:D.any(),payments:D.any(),disbursements:D.any(),tables:D.any(),constraintTables:D.any(),secrets:D.any(),documents:D.any(),auxDataSettings:D.any(),customEvents:D.any(),delinquencyPlans:D.any()});const jX=D.object({abstract:D.boolean().optional(),extend:D.string().optional(),displayName:D.string().optional(),data:D.record(so).optional()});D.record(jX);const uo=D.string().ulid(),FX=D.object({locator:uo,staticLocator:uo,rootLocator:uo.optional(),tenantLocator:uo.optional(),type:D.string(),data:D.record(D.any()).optional(),parentLocator:uo.optional(),coverageTerms:D.record(D.string()).optional()}),vy=FX.extend({elements:D.lazy(()=>vy.array().optional())}),qs=D.string(),LX=D.enum(["draft","validated","earlyUnderwritten","priced","underwritten","accepted","issued","underwrittenBlocked","declined","rejected","refused","discarded"]),VX=D.enum(["none","years","months","monthsE360","weeks","days","hours"]),GX=D.object({elementType:D.string().optional(),locator:qs.optional(),errors:D.array(D.string()).optional()}),WX=D.object({validationItems:D.array(GX).optional(),success:D.boolean().optional()});D.object({locator:qs.optional(),quoteState:LX.optional(),productName:D.string().optional(),accountLocator:qs.optional(),startTime:D.string().optional(),endTime:D.string().optional(),timezone:D.string().optional(),currency:D.string().optional(),underwritingStatus:D.string().optional(),expirationTime:D.string().optional(),element:vy.optional(),type:D.string().optional(),duration:D.number().optional(),durationBasis:VX.optional(),boundTime:D.string().optional(),issuedTime:D.string().optional(),policyLocator:qs.optional(),validationResult:WX.optional(),preferences:D.any().optional(),delinquencyPlanName:D.string().optional()});const by=D.object({locator:D.string().ulid(),removeCoverageTerms:D.record(D.unknown()).optional(),removeData:D.record(D.unknown()).optional(),setCoverageTerms:D.record(D.unknown()).optional(),setData:D.record(D.unknown()).optional()});D.object({productName:D.string().optional(),delinquencyPlanName:D.string().optional(),startTime:D.string().optional(),endTime:D.string().optional(),currency:D.string().optional(),expirationTime:D.string().optional(),setData:D.record(D.unknown()).optional(),elements:D.array(by).optional(),timezone:D.string().optional(),billingPlan:D.string().optional(),defaultTermDuration:D.string().optional(),installmentPlan:D.string().optional(),durationBasis:D.string().optional(),preferences:D.object({billingPreferences:D.object({billingPlanName:D.string().optional(),billingLevel:D.enum(["account","inherit","policy"]).optional()}).optional(),installmentPreferences:D.object({installmentPlanName:D.string().optional(),anchorMode:D.enum(["generateDay","termStartDay","dueDay"]).optional(),anchorTime:D.string().optional(),anchorType:D.enum(["none","dayOfMonth","anchorTime","dayOfWeek","weekOfMonth"]).optional(),cadence:D.enum(["none","fullPay","weekly","everyOtherWeek","monthly","quarterly","semiannually","annually","thirtyDays","everyNDays"]).optional(),dayOfMonth:D.number().optional(),dayOfWeek:D.enum(["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]).optional(),dueLeadDays:D.number().optional(),generateLeadDays:D.number().optional(),maxInstallmentsPerTerm:D.number().optional(),weekOfMonth:D.enum(["none","first","second","third","fourth","fifth"]),installmentPlanWeights:D.array(D.number()).optional()}).optional()}).optional()});const BX=D.enum(["draft","validated","discarded"]);D.object({locator:D.string().ulid(),type:D.string().optional(),state:BX.optional(),data:D.record(D.any()).optional(),delinquencyPlanName:D.string().optional(),validationResult:D.any().optional()});const ZX=D.object({type:D.string().optional(),autoValidate:D.boolean().optional(),data:D.record(D.any()).optional(),delinquencyPlanName:D.string().optional()}),Qs=e=>{const{data:t,scope:r,dataTypes:n,rootDisplayName:a,account:o,quote:s,element:i}=e,u=[];let l={};const c=Object.fromEntries(Object.entries(t??{}).filter(([,d])=>{var p;const v=(p=d.scope)==null?void 0:p.split(",").map(y=>y.trim());return!!(!v||r==="P"&&v!=null&&v.includes("P")||v!=null&&v.includes("Q")||r==="Q"&&v!=null&&v.includes("Q"))}).map(([d,p])=>{var v,y,C,g,f,h,S,T,R,k,G,V,W,X,Q,U,le;let Y=!1,H=!1,z=!1;const te=p.displayName??d,J=(v=p.type)==null?void 0:v.slice(-1),ae=p.maxLength,F=p.minLength,P=p.max,x=p.min,E=p.regex;let m=p.type??"",_;switch(J){case"*":H=!0,Y=!0,m=m==null?void 0:m.split("*")[0];break;case"?":m=m==null?void 0:m.split("?")[0],Y=!0;break;case"+":H=!0,m=m==null?void 0:m.split("+")[0];break;case"!":m=m==null?void 0:m.split("!")[0];break}switch(m){case"string":m="string";break;case"int":case"long":m="integer";break;case"decimal":m="number";break;case"dateTime":case"datetime":m="string",_="date-time";break;case"date":m="string",_="date";break;case"boolean":case"bool":m="boolean";break;default:z=!0;break}if(!Y&&!z&&!H&&u.push(d),z){const N=n==null?void 0:n[m];if(N){let M=H?[]:{};const Z=Qs({data:N.data??{},scope:r,dataTypes:n,rootDisplayName:N.displayName??d});return s&&(C=(y=s.element)==null?void 0:y.data)!=null&&C[d]&&(M=(f=(g=s.element)==null?void 0:g.data)==null?void 0:f[d]),i&&(h=i==null?void 0:i.data)!=null&&h[d]&&(M=(S=i==null?void 0:i.data)==null?void 0:S[d]),o&&(T=o==null?void 0:o.data)!=null&&T[d]&&(M=(R=o==null?void 0:o.data)==null?void 0:R[d]),l={...l,[`${m}`]:Z},H?[d,{title:N.displayName??d,type:"array",default:M,items:{$ref:`#/definitions/${m}`},...!Y&&{minItems:1}}]:[d,{title:N.displayName??d,default:M,$ref:`#/definitions/${m}`}]}}let A="";if(o){const N=(o==null?void 0:o.state)==="validated"?d.charAt(0).toLowerCase()+d.slice(1):d;A=(k=o==null?void 0:o.data)!=null&&k[N]?(G=o==null?void 0:o.data)==null?void 0:G[N]:m==="boolean"?!!p.defaultValue:p.defaultValue}return s&&(A=(W=(V=s.element)==null?void 0:V.data)!=null&&W[d]?(Q=(X=s.element)==null?void 0:X.data)==null?void 0:Q[d]:m==="boolean"?!!p.defaultValue:p.defaultValue),i&&(A=(U=i==null?void 0:i.data)!=null&&U[d]?(le=i==null?void 0:i.data)==null?void 0:le[d]:m==="boolean"?!!p.defaultValue:p.defaultValue),H?[d,{title:te,type:"array",default:A,items:{type:m,...ae&&{maxLength:ae},...F&&{minLength:F},...x&&{min:x},...P&&{max:P},..._&&{format:_},...E&&{pattern:p.regex}},...!Y&&{minItems:1}}]:[d,{title:te,type:m,...A&&{default:A},...F&&{minLength:F},...ae&&{maxLength:ae},...x&&{minimum:parseInt(x)},...P&&{maximum:parseInt(P)},..._&&{format:_},...p.options&&{enum:p.options},...E&&{pattern:p.regex}}]}));return{title:a,type:"object",definitions:l,required:u,properties:c}};var HX=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zX(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yy={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(HX,function(){var r=1e3,n=6e4,a=36e5,o="millisecond",s="second",i="minute",u="hour",l="day",c="week",d="month",p="quarter",v="year",y="date",C="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Y){var H=["th","st","nd","rd"],z=Y%100;return"["+Y+(H[(z-20)%10]||H[z]||H[0])+"]"}},S=function(Y,H,z){var te=String(Y);return!te||te.length>=H?Y:""+Array(H+1-te.length).join(z)+Y},T={s:S,z:function(Y){var H=-Y.utcOffset(),z=Math.abs(H),te=Math.floor(z/60),J=z%60;return(H<=0?"+":"-")+S(te,2,"0")+":"+S(J,2,"0")},m:function Y(H,z){if(H.date()<z.date())return-Y(z,H);var te=12*(z.year()-H.year())+(z.month()-H.month()),J=H.clone().add(te,d),ae=z-J<0,F=H.clone().add(te+(ae?-1:1),d);return+(-(te+(z-J)/(ae?J-F:F-J))||0)},a:function(Y){return Y<0?Math.ceil(Y)||0:Math.floor(Y)},p:function(Y){return{M:d,y:v,w:c,d:l,D:y,h:u,m:i,s,ms:o,Q:p}[Y]||String(Y||"").toLowerCase().replace(/s$/,"")},u:function(Y){return Y===void 0}},R="en",k={};k[R]=h;var G="$isDayjsObject",V=function(Y){return Y instanceof U||!(!Y||!Y[G])},W=function Y(H,z,te){var J;if(!H)return R;if(typeof H=="string"){var ae=H.toLowerCase();k[ae]&&(J=ae),z&&(k[ae]=z,J=ae);var F=H.split("-");if(!J&&F.length>1)return Y(F[0])}else{var P=H.name;k[P]=H,J=P}return!te&&J&&(R=J),J||!te&&R},X=function(Y,H){if(V(Y))return Y.clone();var z=typeof H=="object"?H:{};return z.date=Y,z.args=arguments,new U(z)},Q=T;Q.l=W,Q.i=V,Q.w=function(Y,H){return X(Y,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var U=function(){function Y(z){this.$L=W(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[G]=!0}var H=Y.prototype;return H.parse=function(z){this.$d=function(te){var J=te.date,ae=te.utc;if(J===null)return new Date(NaN);if(Q.u(J))return new Date;if(J instanceof Date)return new Date(J);if(typeof J=="string"&&!/Z$/i.test(J)){var F=J.match(g);if(F){var P=F[2]-1||0,x=(F[7]||"0").substring(0,3);return ae?new Date(Date.UTC(F[1],P,F[3]||1,F[4]||0,F[5]||0,F[6]||0,x)):new Date(F[1],P,F[3]||1,F[4]||0,F[5]||0,F[6]||0,x)}}return new Date(J)}(z),this.init()},H.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},H.$utils=function(){return Q},H.isValid=function(){return this.$d.toString()!==C},H.isSame=function(z,te){var J=X(z);return this.startOf(te)<=J&&J<=this.endOf(te)},H.isAfter=function(z,te){return X(z)<this.startOf(te)},H.isBefore=function(z,te){return this.endOf(te)<X(z)},H.$g=function(z,te,J){return Q.u(z)?this[te]:this.set(J,z)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function(z,te){var J=this,ae=!!Q.u(te)||te,F=Q.p(z),P=function(Z,re){var ge=Q.w(J.$u?Date.UTC(J.$y,re,Z):new Date(J.$y,re,Z),J);return ae?ge:ge.endOf(l)},x=function(Z,re){return Q.w(J.toDate()[Z].apply(J.toDate("s"),(ae?[0,0,0,0]:[23,59,59,999]).slice(re)),J)},E=this.$W,m=this.$M,_=this.$D,A="set"+(this.$u?"UTC":"");switch(F){case v:return ae?P(1,0):P(31,11);case d:return ae?P(1,m):P(0,m+1);case c:var N=this.$locale().weekStart||0,M=(E<N?E+7:E)-N;return P(ae?_-M:_+(6-M),m);case l:case y:return x(A+"Hours",0);case u:return x(A+"Minutes",1);case i:return x(A+"Seconds",2);case s:return x(A+"Milliseconds",3);default:return this.clone()}},H.endOf=function(z){return this.startOf(z,!1)},H.$set=function(z,te){var J,ae=Q.p(z),F="set"+(this.$u?"UTC":""),P=(J={},J[l]=F+"Date",J[y]=F+"Date",J[d]=F+"Month",J[v]=F+"FullYear",J[u]=F+"Hours",J[i]=F+"Minutes",J[s]=F+"Seconds",J[o]=F+"Milliseconds",J)[ae],x=ae===l?this.$D+(te-this.$W):te;if(ae===d||ae===v){var E=this.clone().set(y,1);E.$d[P](x),E.init(),this.$d=E.set(y,Math.min(this.$D,E.daysInMonth())).$d}else P&&this.$d[P](x);return this.init(),this},H.set=function(z,te){return this.clone().$set(z,te)},H.get=function(z){return this[Q.p(z)]()},H.add=function(z,te){var J,ae=this;z=Number(z);var F=Q.p(te),P=function(m){var _=X(ae);return Q.w(_.date(_.date()+Math.round(m*z)),ae)};if(F===d)return this.set(d,this.$M+z);if(F===v)return this.set(v,this.$y+z);if(F===l)return P(1);if(F===c)return P(7);var x=(J={},J[i]=n,J[u]=a,J[s]=r,J)[F]||1,E=this.$d.getTime()+z*x;return Q.w(E,this)},H.subtract=function(z,te){return this.add(-1*z,te)},H.format=function(z){var te=this,J=this.$locale();if(!this.isValid())return J.invalidDate||C;var ae=z||"YYYY-MM-DDTHH:mm:ssZ",F=Q.z(this),P=this.$H,x=this.$m,E=this.$M,m=J.weekdays,_=J.months,A=J.meridiem,N=function(re,ge,Ce,je){return re&&(re[ge]||re(te,ae))||Ce[ge].slice(0,je)},M=function(re){return Q.s(P%12||12,re,"0")},Z=A||function(re,ge,Ce){var je=re<12?"AM":"PM";return Ce?je.toLowerCase():je};return ae.replace(f,function(re,ge){return ge||function(Ce){switch(Ce){case"YY":return String(te.$y).slice(-2);case"YYYY":return Q.s(te.$y,4,"0");case"M":return E+1;case"MM":return Q.s(E+1,2,"0");case"MMM":return N(J.monthsShort,E,_,3);case"MMMM":return N(_,E);case"D":return te.$D;case"DD":return Q.s(te.$D,2,"0");case"d":return String(te.$W);case"dd":return N(J.weekdaysMin,te.$W,m,2);case"ddd":return N(J.weekdaysShort,te.$W,m,3);case"dddd":return m[te.$W];case"H":return String(P);case"HH":return Q.s(P,2,"0");case"h":return M(1);case"hh":return M(2);case"a":return Z(P,x,!0);case"A":return Z(P,x,!1);case"m":return String(x);case"mm":return Q.s(x,2,"0");case"s":return String(te.$s);case"ss":return Q.s(te.$s,2,"0");case"SSS":return Q.s(te.$ms,3,"0");case"Z":return F}return null}(re)||F.replace(":","")})},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function(z,te,J){var ae,F=this,P=Q.p(te),x=X(z),E=(x.utcOffset()-this.utcOffset())*n,m=this-x,_=function(){return Q.m(F,x)};switch(P){case v:ae=_()/12;break;case d:ae=_();break;case p:ae=_()/3;break;case c:ae=(m-E)/6048e5;break;case l:ae=(m-E)/864e5;break;case u:ae=m/a;break;case i:ae=m/n;break;case s:ae=m/r;break;default:ae=m}return J?ae:Q.a(ae)},H.daysInMonth=function(){return this.endOf(d).$D},H.$locale=function(){return k[this.$L]},H.locale=function(z,te){if(!z)return this.$L;var J=this.clone(),ae=W(z,te,!0);return ae&&(J.$L=ae),J},H.clone=function(){return Q.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},Y}(),le=U.prototype;return X.prototype=le,[["$ms",o],["$s",s],["$m",i],["$H",u],["$W",l],["$M",d],["$y",v],["$D",y]].forEach(function(Y){le[Y[1]]=function(H){return this.$g(H,Y[0],Y[1])}}),X.extend=function(Y,H){return Y.$i||(Y(H,U,X),Y.$i=!0),X},X.locale=W,X.isDayjs=V,X.unix=function(Y){return X(1e3*Y)},X.en=k[R],X.Ls=k,X.p={},X})})(yy);var XX=yy.exports;const ra=zX(XX),UX=({data:e})=>{const t={},r={...e};return r.default&&(r.default.startTime&&(t.startTime=ra(r.default.startTime).format()),r.default.endTime&&(t.endTime=ra(r.default.endTime).format()),r.default.expirationTime&&(t.expirationTime=ra(r.default.expirationTime).format())),r.advanced&&(r.advanced.currency&&(t.currency=r.advanced.currency),r.advanced.timezone&&(t.timezone=r.advanced.timezone),r.advanced.billingPlan&&(t.billingPlan=r.advanced.billingPlan),r.advanced.defaultTermDuration&&(t.defaultTermDuration=r.advanced.defaultTermDuration),r.advanced.installmentPlan&&(t.installmentPlan=r.advanced.installmentPlan),r.advanced.durationBasis&&(t.durationBasis=r.advanced.durationBasis),r.advanced.delinquencyPlanName&&(t.delinquencyPlanName=r.advanced.delinquencyPlanName)),delete r.default,delete r.advanced,t.setData=r,t};function na(e){return e==null?void 0:e.map(t=>(t.keyword==="pattern"&&(t.message=`Invalid format, must match pattern ${t.params.pattern}`),t.keyword==="format"&&(t.message="Invalid format"),t.keyword==="required"&&(t.message="Required"),t.keyword==="minItems"&&(t.message=`Must have at least ${t.params.limit} item${t.params.limit!==1?"s":""}`),t.keyword==="maxItems"&&(t.message=`Must have at most ${t.params.limit} item${t.params.limit!==1?"s":""}`),t.keyword==="type"&&(t.message="Invalid format"),t.keyword==="maxLength"&&(t.message=`Must be at most ${t.params.limit} character${t.params.limit!==1?"s":""}`),t.keyword==="minLength"&&(t.message=`Must be at least ${t.params.limit} character${t.params.limit!==1?"s":""}`),t.keyword==="minimum"&&(t.message=`Must be greater than or equal to ${t.params.limit}`),t.keyword==="maximum"&&(t.message=`Must be less than or equal to ${t.params.limit}`),t.keyword==="enum"&&(t.message="Invalid value"),t))}const Cy=e=>{var t,r,n,a,o,s;return{...((t=e==null?void 0:e.element)==null?void 0:t.data)&&{...(r=e==null?void 0:e.element)==null?void 0:r.data},default:{...(e==null?void 0:e.startTime)&&{startTime:ra(e.startTime).format("YYYY-MM-DD")},...(e==null?void 0:e.endTime)&&{endTime:ra(e.endTime).format("YYYY-MM-DD")},...(e==null?void 0:e.expirationTime)&&{expirationTime:ra(e.expirationTime).format("YYYY-MM-DD")}},advanced:{currency:(e==null?void 0:e.currency)??void 0,timezone:(e==null?void 0:e.timezone)??void 0,billingPlan:((a=(n=e==null?void 0:e.preferences)==null?void 0:n.billingPreferences)==null?void 0:a.billingPlanName)??void 0,installmentPlan:((s=(o=e==null?void 0:e.preferences)==null?void 0:o.installmentPreferences)==null?void 0:s.installmentPlanName)??void 0,durationBasis:(e==null?void 0:e.durationBasis)??void 0,delinquencyPlanName:(e==null?void 0:e.delinquencyPlanName)??void 0}}};var Uc={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Cl,n=xe,a=wn,o=It,s=En,i=St,u="errorMessage",l=new r.Name("emUsed"),c={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,v=/^""\s*\+\s*|\s*\+\s*""$/g;function y(g){return{keyword:u,schemaType:["string","object"],post:!0,code(f){const{gen:h,data:S,schema:T,schemaValue:R,it:k}=f;if(k.createErrors===!1)return;const G=T,V=n.strConcat(i.default.instancePath,k.errorPath);h.if(r._`${i.default.errors} > 0`,()=>{if(typeof G=="object"){const[E,m]=X(G);m&&Q(m),E&&U(E),le(W(G))}const x=typeof G=="string"?G:G._;x&&Y(x),g.keepErrors||H()});function W({properties:x,items:E}){const m={};if(x){m.props={};for(const _ in x)m.props[_]=[]}if(E){m.items={};for(let _=0;_<E.length;_++)m.items[_]=[]}return m}function X(x){let E,m;for(const _ in x){if(_==="properties"||_==="items")continue;const A=x[_];if(typeof A=="object"){E||(E={});const N=E[_]={};for(const M in A)N[M]=[]}else m||(m={}),m[_]=[]}return[E,m]}function Q(x){const E=h.const("emErrors",r.stringify(x)),m=h.const("templates",ae(x,T));h.forOf("err",i.default.vErrors,M=>h.if(z(M,E),()=>h.code(r._`${E}[${M}.keyword].push(${M})`).assign(r._`${M}.${l}`,!0)));const{singleError:_}=g;if(_){const M=h.let("message",r._`""`),Z=h.let("paramsErrors",r._`[]`);A(re=>{h.if(M,()=>h.code(r._`${M} += ${typeof _=="string"?_:";"}`)),h.code(r._`${M} += ${N(re)}`),h.assign(Z,r._`${Z}.concat(${E}[${re}])`)}),s.reportError(f,{message:M,params:r._`{errors: ${Z}}`})}else A(M=>s.reportError(f,{message:N(M),params:r._`{errors: ${E}[${M}]}`}));function A(M){h.forIn("key",E,Z=>h.if(r._`${E}[${Z}].length`,()=>M(Z)))}function N(M){return r._`${M} in ${m} ? ${m}[${M}]() : ${R}[${M}]`}}function U(x){const E=h.const("emErrors",r.stringify(x)),m=[];for(const Z in x)m.push([Z,ae(x[Z],T[Z])]);const _=h.const("templates",h.object(...m)),A=h.scopeValue("obj",{ref:c,code:r.stringify(c)}),N=h.let("emPropParams"),M=h.let("emParamsErrors");h.forOf("err",i.default.vErrors,Z=>h.if(z(Z,E),()=>{h.assign(N,r._`${A}[${Z}.keyword]`),h.assign(M,r._`${E}[${Z}.keyword][${Z}.params[${N}]]`),h.if(M,()=>h.code(r._`${M}.push(${Z})`).assign(r._`${Z}.${l}`,!0))})),h.forIn("key",E,Z=>h.forIn("keyProp",r._`${E}[${Z}]`,re=>{h.assign(M,r._`${E}[${Z}][${re}]`),h.if(r._`${M}.length`,()=>{const ge=h.const("tmpl",r._`${_}[${Z}] && ${_}[${Z}][${re}]`);s.reportError(f,{message:r._`${ge} ? ${ge}() : ${R}[${Z}][${re}]`,params:r._`{errors: ${M}}`})})}))}function le(x){const{props:E,items:m}=x;if(!E&&!m)return;const _=r._`typeof ${S} == "object"`,A=r._`Array.isArray(${S})`,N=h.let("emErrors");let M,Z;const re=h.let("templates");E&&m?(M=h.let("emChildKwd"),h.if(_),h.if(A,()=>{ge(m,T.items),h.assign(M,r.str`items`)},()=>{ge(E,T.properties),h.assign(M,r.str`properties`)}),Z=r._`[${M}]`):m?(h.if(A),ge(m,T.items),Z=r._`.items`):E&&(h.if(n.and(_,n.not(A))),ge(E,T.properties),Z=r._`.properties`),h.forOf("err",i.default.vErrors,Ce=>te(Ce,N,je=>h.code(r._`${N}[${je}].push(${Ce})`).assign(r._`${Ce}.${l}`,!0))),h.forIn("key",N,Ce=>h.if(r._`${N}[${Ce}].length`,()=>{s.reportError(f,{message:r._`${Ce} in ${re} ? ${re}[${Ce}]() : ${R}${Z}[${Ce}]`,params:r._`{errors: ${N}[${Ce}]}`}),h.assign(r._`${i.default.vErrors}[${i.default.errors}-1].instancePath`,r._`${V} + "/" + ${Ce}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),h.endIf();function ge(Ce,je){h.assign(N,r.stringify(Ce)),h.assign(re,ae(Ce,je))}}function Y(x){const E=h.const("emErrs",r._`[]`);h.forOf("err",i.default.vErrors,m=>h.if(J(m),()=>h.code(r._`${E}.push(${m})`).assign(r._`${m}.${l}`,!0))),h.if(r._`${E}.length`,()=>s.reportError(f,{message:F(x),params:r._`{errors: ${E}}`}))}function H(){const x=h.const("emErrs",r._`[]`);h.forOf("err",i.default.vErrors,E=>h.if(r._`!${E}.${l}`,()=>h.code(r._`${x}.push(${E})`))),h.assign(i.default.vErrors,x).assign(i.default.errors,r._`${x}.length`)}function z(x,E){return n.and(r._`${x}.keyword !== ${u}`,r._`!${x}.${l}`,r._`${x}.instancePath === ${V}`,r._`${x}.keyword in ${E}`,r._`${x}.schemaPath.indexOf(${k.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${x}.schemaPath.slice(${k.errSchemaPath.length}))`)}function te(x,E,m){h.if(n.and(r._`${x}.keyword !== ${u}`,r._`!${x}.${l}`,r._`${x}.instancePath.indexOf(${V}) === 0`),()=>{const _=h.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),A=h.const("emMatches",r._`${_}.exec(${x}.instancePath.slice(${V}.length))`),N=h.const("emChild",r._`${A} && ${A}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);h.if(r._`${N} !== undefined && ${N} in ${E}`,()=>m(N))})}function J(x){return n.and(r._`${x}.keyword !== ${u}`,r._`!${x}.${l}`,n.or(r._`${x}.instancePath === ${V}`,n.and(r._`${x}.instancePath.indexOf(${V}) === 0`,r._`${x}.instancePath[${V}.length] === "/"`)),r._`${x}.schemaPath.indexOf(${k.errSchemaPath}) === 0`,r._`${x}.schemaPath[${k.errSchemaPath}.length] === "/"`)}function ae(x,E){const m=[];for(const _ in x){const A=E[_];d.test(A)&&m.push([_,P(A)])}return h.object(...m)}function F(x){return d.test(x)?new a._Code(a.safeStringify(x).replace(p,(E,m)=>`" + JSON.stringify(${o.getData(m,k)}) + "`).replace(v,"")):r.stringify(x)}function P(x){return r._`function(){return ${F(x)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const C=(g,f={})=>{if(!g.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(g.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return g.addKeyword(y(f))};t.default=C,e.exports=C,e.exports.default=C})(Uc,Uc.exports);var YX=Uc.exports;const Yc=Me(YX);function JX(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function qX(...e){return t=>e.forEach(r=>JX(r,t))}const _y=I.forwardRef((e,t)=>{const{children:r,...n}=e,a=I.Children.toArray(r),o=a.find(KX);if(o){const s=o.props.children,i=a.map(u=>u===o?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:u);return I.createElement(Jc,be({},n,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,i):null)}return I.createElement(Jc,be({},n,{ref:t}),r)});_y.displayName="Slot";const Jc=I.forwardRef((e,t)=>{const{children:r,...n}=e;return I.isValidElement(r)?I.cloneElement(r,{...eU(n,r.props),ref:t?qX(t,r.ref):r.ref}):I.Children.count(r)>1?I.Children.only(null):null});Jc.displayName="SlotClone";const QX=({children:e})=>I.createElement(I.Fragment,null,e);function KX(e){return I.isValidElement(e)&&e.type===QX}function eU(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...i)=>{o(...i),a(...i)}:a&&(r[n]=a):n==="style"?r[n]={...a,...o}:n==="className"&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}const Iy=Db("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ks=q.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},o)=>{const s=n?_y:"button";return ee.jsx(s,{className:lr(Iy({variant:t,size:r,className:e})),ref:o,...a})});Ks.displayName="Button";const qc={styles:[...sv,{name:"vertical.layout",classNames:["grid grid-cols-1 @md:grid-cols-2 @4xl:grid-cols-3 gap-2"]},{name:"vertical.layout.item",classNames:["has-[.array-table-layout]:col-span-1 @md:has-[.array-table-layout]:col-span-2 @4xl:has-[.array-table-layout]:col-span-3","has-[.group-layout]:col-span-1 @md:has-[.group-layout]:col-span-2 @4xl:has-[.group-layout]:col-span-3","col-span-1 @md:col-span-1 @4xl:col-span-1","self-end"]},{name:"group.layout",classNames:["grid grid-cols-1 @md:grid-cols-2 @4xl:grid-cols-3 gap-2"]},{name:"group.label",classNames:["text-lg font-medium pb-4"]},{name:"control",classNames:["flex flex-col gap-2"]},{name:"control.input",classNames:["flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"]},{name:"control.checkbox",classNames:[]},{name:"control.label",classNames:["break-words text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"]},{name:"control.validation.error",classNames:["text-sm font-medium text-destructive"]},{name:"array.table.label",classNames:["text-lg font-medium "]},{name:"array.table",classNames:["border rounded-md p-2","[&>header]:flex [&>header]:flex-row [&>header]:justify-between [&>header]: [&>header]:px-4 [&>header]:pb-4"]},{name:"array.table.table",classNames:["w-full caption-bottom text-sm block overflow-x-auto","[&>thead]:[&_tr]:border-b","[&>thead>tr]:border-b [&>thead>tr]:transition-colors [&>thead>tr]:hover:bg-muted-50 [&>thead>tr]:data-[state=selected]:bg-muted-50","[&>thead>tr>th]:h-12 [&>thead>tr>th]:px-4 [&>thead>tr>th]:text-left [&>thead>tr>th]:align-middle [&>thead>tr>th]:font-medium [&>thead>tr>th]:has([role=checkbox]):pr-0","[&>tbody>tr:not(:last-child)]:border-b [&>tbody>tr]:transition-colors [&>tbody>tr]:hover:bg-muted-50 [&>tbody>tr]:data-[state=selected]:bg-muted-50","[&>tbody>tr>td]:p-4 [&>tbody>tr>td]:align-middle [&>tbody>tr>td]:[&:has([role=checkbox])]:pr-0 [&>tbody>tr>td]:min-w-48","[&>tbody>tr>td]:[:has(button)]:min-w-0 [&>tbody>tr>td>button]:bg-primary [&>tbody>tr>td>button]:text-primary-foreground [&>tbody>tr>td>button]:hover:bg-primary/90 [&>tbody>tr>td>button]:inline-flex [&>tbody>tr>td>button]:items-center [&>tbody>tr>td>button]:justify-center [&>tbody>tr>td>button]:whitespace-nowrap [&>tbody>tr>td>button]:rounded-md [&>tbody>tr>td>button]:text-sm [&>tbody>tr>td>button]:font-medium [&>tbody>tr>td>button]:ring-offset-background [&>tbody>tr>td>button]:transition-colors [&>tbody>tr>td>button]:focus-visible:outline-none [&>tbody>tr>td>button]:focus-visible:ring-2 [&>tbody>tr>td>button]:focus-visible:ring-ring [&>tbody>tr>td>button]:focus-visible:ring-offset-2 [&>tbody>tr>td>button]:disabled:pointer-events-none [&>tbody>tr>td>button]:disabled:opacity-50 [&>tbody>tr>td>button]:h-10 [&>tbody>tr>td>button]:px-4 [&>tbody>tr>td>button]:py-2"]},{name:"array.table.button",classNames:[Iy({variant:"default",size:"sm"})]}]},ln=new ns({allErrors:!0});Yc(ln),as(ln);const $y=({accountsModel:e,accountType:t,dataTypes:r,disabled:n,handleSubmit:a,isSubmitting:o,preventFormResetOnDisabled:s=!0,hideSubmitButton:i=!1,validateOnSubmit:u=!1,account:l,submitButtonText:c,id:d})=>{const[p,v]=I.useState(l?l.data:{}),[y,C]=I.useState(!1),[g,f]=I.useState();I.useEffect(()=>{n&&!s&&(f([]),v(l?l.data:{}))},[n,l,s]);const h=I.useMemo(()=>Qs({data:e[t].data??{},dataTypes:r,scope:"Q",rootDisplayName:e[t].displayName??t,account:l}),[e,r,l,t]),S=R=>{R.preventDefault();const k=ln.validate(h,p??{});if(u&&!k){const W=na(ln.errors);f(W),C(!0);return}else f([]);const G={data:p,type:t},V=ZX.parse(G);a(V)},T=I.useCallback((R,k,G)=>{const V=G(R,k);switch(k.type){case Gn:case Wn:{v(V.data);const W=ln.validate(h,V.data??{});if(!y)return R;if(W)f([]);else{const X=na(ln.errors);f(X)}return R}default:return V}},[y,h]);return ee.jsx(_s.Provider,{value:qc,children:ee.jsxs("form",{onSubmit:S,id:d,className:"@container flex w-full border-spacing-0 flex-col gap-2",children:[ee.jsx(tc,{ajv:ln,cells:Gc,renderers:Vc,data:p,readonly:n||o,additionalErrors:g,onChange:({data:R})=>{v(R)},middleware:T,schema:h,validationMode:"NoValidation"}),!i&&ee.jsx(Ks,{type:"submit",variant:"default",className:"mt-4 self-end",disabled:n||o,children:c??"Update"})]})})};$y.displayName="AccountForm";const tU={Advanced:{title:"",type:"object",definitions:{},required:[],properties:{currency:{type:"string",enum:["USD","EUR","JPY","GBP","AUD","CAD","CHF","CNY","SEK","NZD","Other"],title:"Currency"},timezone:{type:"string",enum:["America/Chicago","America/New_York","Asia/Tokyo","Europe/Berlin","Europe/Rome","Europe/Moscow"],title:"Timezone"},billingPlan:{type:"string",enum:["Standard"],title:"Billing Plan"},defaultTermDuration:{type:"string",enum:["0","6"],title:"Term Duration"},installmentPlan:{type:"string",enum:["Standard","Monthly10"],title:"Installment Plan"},durationBasis:{type:"string",enum:["years","months","weeks","days","hours"],title:"Duration Basis"},delinquencyPlanName:{type:"string",enum:["Standard"],title:"Delinquency Plan"}}}},rU={Default:{title:"",type:"object",definitions:{},required:[],properties:{startTime:{title:"Start Date",type:"string",format:"date"},endTime:{title:"End Date",type:"string",format:"date"},expirationTime:{title:"Expiration Time",type:"string",format:"date"}}}},cn=new ns({allErrors:!0});Yc(cn),as(cn);const Ay=({quote:e,productModel:t,dataTypes:r,disabled:n,handleSubmit:a,isSubmitting:o,preventFormResetOnDisabled:s=!0,validateOnSubmit:i=!1,hideSubmitButton:u=!1,submitButtonText:l,id:c})=>{const[d,p]=I.useState(Cy(e)),[v,y]=I.useState(!1),[C,g]=I.useState();I.useEffect(()=>{n&&!s&&(g([]),p(Cy(e)))},[n,e,s]);const f=I.useMemo(()=>Qs({data:t.data??{},dataTypes:r,scope:"Q",rootDisplayName:t.displayName??e.type??"Quote",quote:e==null?void 0:e.element}),[t,r,e]);f.definitions={...f.definitions,...rU,...tU},f.properties={...f.properties,default:{title:"Details",default:{},$ref:"#/definitions/Default"},advanced:{title:"See Advanced Details",default:{},$ref:"#/definitions/Advanced"}};const h=G=>{G.preventDefault();const V=cn.validate(f,d??{});if(i&&!V){const X=na(cn.errors);g(X),y(!0);return}else g([]);const W=UX({data:d});return a(W),d},S=I.useCallback((G,V,W)=>{const X=W(G,V);switch(V.type){case Gn:case Wn:{p(X.data);const Q=cn.validate(f,X.data??{});if(!v)return G;if(Q)g([]);else{const U=na(cn.errors);g(U)}return G}default:return X}},[v,f]),T=Wl(f),R=T.elements.find(G=>G.scope==="#/properties/default"),k=T.elements.find(G=>G.scope==="#/properties/advanced");if(T.elements=[...T.elements.filter(G=>G.scope!=="#/properties/default"&&G.scope!=="#/properties/advanced")],k){const G={type:"CollapsingVerticalLayout",label:"See Advanced Details",elements:[k]};T.elements.unshift(G)}return R&&T.elements.unshift(R),ee.jsx(_s.Provider,{value:qc,children:ee.jsxs("form",{onSubmit:h,id:c,className:"@container flex w-full flex-col gap-2",children:[ee.jsx(tc,{ajv:cn,uischema:T,cells:Gc,renderers:Vc,data:d,readonly:n||o,additionalErrors:C,middleware:S,schema:f,validationMode:"NoValidation"}),!u&&ee.jsx(Ks,{type:"submit",variant:"default",className:"mt-4 self-end",disabled:n||o,children:l??"Update"})]})})};Ay.displayName="QuoteForm";const dn=new ns({allErrors:!0});Yc(dn),as(dn);const Ey=({elementModel:e,dataTypes:t,disabled:r,handleSubmit:n,isSubmitting:a,preventFormResetOnDisabled:o=!0,hideSubmitButton:s=!1,element:i,validateOnSubmit:u=!1,submitButtonText:l,id:c})=>{const[d,p]=I.useState(i?i.data:{}),[v,y]=I.useState(!1),[C,g]=I.useState();I.useEffect(()=>{r&&!o&&(g([]),p(i?i.data:{}))},[r,i,o]);const f=I.useMemo(()=>Qs({data:e.data??{},dataTypes:t,scope:"Q",rootDisplayName:e.displayName??i.type??"Element",element:i}),[e,t,i]),h=T=>{T.preventDefault();const R=dn.validate(f,d??{});if(u&&!R){const V=na(dn.errors);g(V),y(!0);return}else g([]);const k={setData:d,locator:i.locator},G=by.parse(k);n(G)},S=I.useCallback((T,R,k)=>{const G=k(T,R);switch(R.type){case Gn:case Wn:{p(G.data);const V=dn.validate(f,G.data??{});if(!v)return T;if(V)g([]);else{const W=na(dn.errors);g(W)}return T}default:return G}},[v,f]);return ee.jsx(_s.Provider,{value:qc,children:ee.jsxs("form",{onSubmit:h,id:c,className:"@container flex w-full flex-col gap-2",children:[ee.jsx(tc,{ajv:dn,cells:Gc,renderers:Vc,data:d,readonly:r||a,additionalErrors:C,onChange:({data:T})=>{p(T)},middleware:S,schema:f,validationMode:"NoValidation"}),!s&&ee.jsx(Ks,{type:"submit",variant:"default",className:"mt-4 self-end",disabled:r||a,children:l??"Update"})]})})};Ey.displayName="ElementForm",xt.AccountForm=$y,xt.ElementForm=Ey,xt.QuoteForm=Ay,Object.defineProperty(xt,Symbol.toStringTag,{value:"Module"})});
75
+ */const Pb=Sb("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ob(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ob(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function FH(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ob(e))&&(n&&(n+=" "),n+=t);return n}const Nb=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Rb=FH,Db=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Rb(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(l=>{const c=r==null?void 0:r[l],d=o==null?void 0:o[l];if(c===null)return null;const p=Nb(c)||Nb(d);return a[l][p]}),i=r&&Object.entries(r).reduce((l,c)=>{let[d,p]=c;return p===void 0||(l[d]=p),l},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((l,c)=>{let{class:d,className:p,...v}=c;return Object.entries(v).every(y=>{let[C,g]=y;return Array.isArray(g)?g.includes({...o,...i}[C]):{...o,...i}[C]===g})?[...l,d,p]:l},[]);return Rb(e,s,u,r==null?void 0:r.class,r==null?void 0:r.className)},LH=Db("inline-flex max-w-full items-center rounded-sm border px-2.5 py-1 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-zinc-100 dark:bg-zinc-800 text-black dark:text-white font-bold",info:"border-transparent bg-blue-50 text-blue-900 font-bold",destructive:"border-transparent bg-red-50 text-red-700 font-bold",outline:"text-foreground font-bold",success:"border-transparent bg-green-50 text-green-700 font-bold",warning:"border-transparent bg-yellow-50 text-yellow-700 font-bold"}},defaultVariants:{variant:"default"}});function VH({className:e,variant:t,...r}){return ee.jsx("div",{className:lr("max-w-full break-words",LH({variant:t}),e),...r})}function GH(e){return ee.jsxs(pr.DropdownIndicator,{...e,children:[ee.jsx(Tb,{className:"size-4 opacity-50","aria-label":"expand dropdown"}),ee.jsx("span",{className:"sr-only",children:"expand dropdown"})]})}function WH(e){return ee.jsxs(pr.ClearIndicator,{...e,children:[ee.jsx(Pb,{className:"size-4 opacity-50","aria-label":"clear dropdown"}),ee.jsx("span",{className:"sr-only",children:"clear dropdown"})]})}function BH(e){const t=()=>`Delete ${e.selectProps.getOptionLabel(e.data)}`,r={...e,innerProps:{...e.innerProps,"aria-label":t()}};return ee.jsxs(pr.MultiValueRemove,{...r,children:[ee.jsx(Pb,{className:"ml-2 size-4 text-black dark:text-white"}),ee.jsx("span",{className:"sr-only",children:t()})]})}function ZH(e){return ee.jsx(pr.MultiValueContainer,{...e,children:ee.jsx(VH,{variant:"default",className:"max-w-full",children:e.children})})}function HH(e){const t=typeof e.children=="string"?"span":"div";return ee.jsx(pr.MultiValueLabel,{...e,children:ee.jsx(t,{children:e.children})})}function zH(e){return ee.jsx(pr.ValueContainer,{...e,children:e.children})}function XH(e){return ee.jsx(pr.MenuList,{...e,children:e.children})}function UH(e){return ee.jsx(pr.Option,{...e})}const Mb=I.forwardRef((e,t)=>ee.jsx(DH,{ref:t,unstyled:!0,components:{DropdownIndicator:GH,MultiValueRemove:BH,ClearIndicator:WH,MultiValueContainer:ZH,ValueContainer:zH,MenuList:XH,Option:UH,MultiValueLabel:HH},id:e.id,placeholder:e.placeholder??"",inputId:e.id,closeMenuOnSelect:!e.isMulti,classNames:{control:({isFocused:r,isDisabled:n})=>lr(["border-input bg-background ring-offset-background max-h-36 w-full overflow-y-auto rounded-md border px-3 text-sm",r?"ring-ring ring-2 ring-offset-2":"",n?"cursor-not-allowed opacity-50":"",e.invalid?"ring-destructive ring-2 ring-offset-2":""]),valueContainer:()=>"flex flex-row flex-wrap gap-2 py-2.5",menu:()=>"text-sm mt-2 p-1 relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",option:({isFocused:r,isSelected:n,isDisabled:a})=>lr("relative flex w-full cursor-default select-none items-center break-words rounded-sm px-4 py-1.5 outline-none",r?"bg-accent text-accent-foreground":"",n?"bg-primary text-white":"",a?"text-zinc-400":""),multiValueLabel:()=>"dark:text-white",placeholder:()=>e.invalid?"text-destructive":"text-muted-foreground",indicatorsContainer:()=>"align-start"},...e}));Mb.displayName="Autocomplete";const YH=e=>{const{data:t,className:r,id:n,enabled:a,schema:o,uischema:s,path:i,handleChange:u,options:l,t:c}=e,d=I.useMemo(()=>c("enum.none",ov["enum.none"],{schema:o,uischema:s,path:i}),[c,o,s,i]),p=I.useRef(null);return ee.jsx(Mb,{isClearable:!0,placeholder:d,ref:p,id:n,instanceId:n,options:l,name:"basePayment",value:l==null?void 0:l.find(v=>v.value===t),isDisabled:!a,isMulti:!1,className:r,onChange:v=>{u(i,v==null?void 0:v.value)},closeMenuOnSelect:!0})},JH=He(3,cs),qH=Gg(ec(iv(YH))),QH=({renderers:e,cells:t,uischemas:r,schema:n,label:a,path:o,visible:s,enabled:i,uischema:u,rootSchema:l})=>{const c=I.useMemo(()=>ug(r,n,u.scope,o,()=>$e(o)?Vn.uiSchema(n,"VerticalLayout",void 0,l):{...Vn.uiSchema(n,"Group",void 0,l),label:a},u,l),[r,n,o,a,u,l]);return s?ee.jsx(zn,{visible:s,enabled:i,schema:n,uischema:c,path:o,renderers:e,cells:t}):null},KH=He(2,Xh),ez=X4(QH);function tz(e){const t=e+"CollectionProvider",[r,n]=Is(t),[a,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:y,children:C}=v,g=I.useRef(null),f=I.useRef(new Map).current;return ee.jsx(a,{scope:y,itemMap:f,collectionRef:g,children:C})};s.displayName=t;const i=e+"CollectionSlot",u=I.forwardRef((v,y)=>{const{scope:C,children:g}=v,f=o(i,C),h=Xn(y,f.collectionRef);return ee.jsx(As,{ref:h,children:g})});u.displayName=i;const l=e+"CollectionItemSlot",c="data-radix-collection-item",d=I.forwardRef((v,y)=>{const{scope:C,children:g,...f}=v,h=I.useRef(null),S=Xn(y,h),T=o(l,C);return I.useEffect(()=>(T.itemMap.set(h,{ref:h,...f}),()=>void T.itemMap.delete(h))),ee.jsx(As,{[c]:"",ref:S,children:g})});d.displayName=l;function p(v){const y=o(e+"CollectionConsumer",v);return I.useCallback(()=>{const g=y.collectionRef.current;if(!g)return[];const f=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(y.itemMap.values()).sort((T,R)=>f.indexOf(T.ref.current)-f.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:d},p,n]}function rz(e,t){return q.useReducer((r,n)=>t[r][n]??r,e)}var kb=e=>{const{present:t,children:r}=e,n=nz(t),a=typeof r=="function"?r({present:n.isPresent}):q.Children.only(r),o=Xn(n.ref,az(a));return typeof r=="function"||n.isPresent?q.cloneElement(a,{ref:o}):null};kb.displayName="Presence";function nz(e){const[t,r]=q.useState(),n=q.useRef({}),a=q.useRef(e),o=q.useRef("none"),s=e?"mounted":"unmounted",[i,u]=rz(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return q.useEffect(()=>{const l=Ls(n.current);o.current=i==="mounted"?l:"none"},[i]),Fa(()=>{const l=n.current,c=a.current;if(c!==e){const p=o.current,v=Ls(l);e?u("MOUNT"):v==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&p!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Fa(()=>{if(t){const l=d=>{const v=Ls(n.current).includes(d.animationName);d.target===t&&v&&Py.flushSync(()=>u("ANIMATION_END"))},c=d=>{d.target===t&&(o.current=Ls(n.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:q.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Ls(e){return(e==null?void 0:e.animationName)||"none"}function az(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var oz=q.useId||(()=>{}),sz=0;function jb(e){const[t,r]=q.useState(oz());return Fa(()=>{r(n=>n??String(sz++))},[e]),t?`radix-${t}`:""}var Nc="Collapsible",[iz,Fb]=Is(Nc),[uz,Rc]=iz(Nc),Lb=q.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:o,onOpenChange:s,...i}=e,[u=!1,l]=$s({prop:n,defaultProp:a,onChange:s});return ee.jsx(uz,{scope:r,disabled:o,contentId:jb(),open:u,onOpenToggle:q.useCallback(()=>l(c=>!c),[l]),children:ee.jsx(rn.div,{"data-state":Mc(u),"data-disabled":o?"":void 0,...i,ref:t})})});Lb.displayName=Nc;var Vb="CollapsibleTrigger",Gb=q.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,a=Rc(Vb,r);return ee.jsx(rn.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":Mc(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:t,onClick:dc(e.onClick,a.onOpenToggle)})});Gb.displayName=Vb;var Dc="CollapsibleContent",Wb=q.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Rc(Dc,e.__scopeCollapsible);return ee.jsx(kb,{present:r||a.open,children:({present:o})=>ee.jsx(lz,{...n,ref:t,present:o})})});Wb.displayName=Dc;var lz=q.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:a,...o}=e,s=Rc(Dc,r),[i,u]=q.useState(n),l=q.useRef(null),c=Xn(t,l),d=q.useRef(0),p=d.current,v=q.useRef(0),y=v.current,C=s.open||i,g=q.useRef(C),f=q.useRef();return q.useEffect(()=>{const h=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(h)},[]),Fa(()=>{const h=l.current;if(h){f.current=f.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const S=h.getBoundingClientRect();d.current=S.height,v.current=S.width,g.current||(h.style.transitionDuration=f.current.transitionDuration,h.style.animationName=f.current.animationName),u(n)}},[s.open,n]),ee.jsx(rn.div,{"data-state":Mc(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!C,...o,ref:c,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:C&&a})});function Mc(e){return e?"open":"closed"}var cz=Lb,dz=Gb,fz=Wb,pz=q.createContext(void 0);function mz(e){const t=q.useContext(pz);return e||t||"ltr"}var mr="Accordion",hz=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[kc,gz,vz]=tz(mr),[Vs,sY]=Is(mr,[vz,Fb]),jc=Fb(),Bb=I.forwardRef((e,t)=>{const{type:r,...n}=e,a=n,o=n;return ee.jsx(kc.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?ee.jsx(_z,{...o,ref:t}):ee.jsx(Cz,{...a,ref:t})})});Bb.displayName=mr;var[Zb,bz]=Vs(mr),[Hb,yz]=Vs(mr,{collapsible:!1}),Cz=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},collapsible:o=!1,...s}=e,[i,u]=$s({prop:r,defaultProp:n,onChange:a});return ee.jsx(Zb,{scope:e.__scopeAccordion,value:i?[i]:[],onItemOpen:u,onItemClose:I.useCallback(()=>o&&u(""),[o,u]),children:ee.jsx(Hb,{scope:e.__scopeAccordion,collapsible:o,children:ee.jsx(zb,{...s,ref:t})})})}),_z=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=e,[s=[],i]=$s({prop:r,defaultProp:n,onChange:a}),u=I.useCallback(c=>i((d=[])=>[...d,c]),[i]),l=I.useCallback(c=>i((d=[])=>d.filter(p=>p!==c)),[i]);return ee.jsx(Zb,{scope:e.__scopeAccordion,value:s,onItemOpen:u,onItemClose:l,children:ee.jsx(Hb,{scope:e.__scopeAccordion,collapsible:!0,children:ee.jsx(zb,{...o,ref:t})})})}),[Iz,Gs]=Vs(mr),zb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:a,orientation:o="vertical",...s}=e,i=I.useRef(null),u=Xn(i,t),l=gz(r),d=mz(a)==="ltr",p=dc(e.onKeyDown,v=>{var V;if(!hz.includes(v.key))return;const y=v.target,C=l().filter(W=>{var X;return!((X=W.ref.current)!=null&&X.disabled)}),g=C.findIndex(W=>W.ref.current===y),f=C.length;if(g===-1)return;v.preventDefault();let h=g;const S=0,T=f-1,R=()=>{h=g+1,h>T&&(h=S)},k=()=>{h=g-1,h<S&&(h=T)};switch(v.key){case"Home":h=S;break;case"End":h=T;break;case"ArrowRight":o==="horizontal"&&(d?R():k());break;case"ArrowDown":o==="vertical"&&R();break;case"ArrowLeft":o==="horizontal"&&(d?k():R());break;case"ArrowUp":o==="vertical"&&k();break}const G=h%f;(V=C[G].ref.current)==null||V.focus()});return ee.jsx(Iz,{scope:r,disabled:n,direction:a,orientation:o,children:ee.jsx(kc.Slot,{scope:r,children:ee.jsx(rn.div,{...s,"data-orientation":o,ref:u,onKeyDown:n?void 0:p})})})}),Ws="AccordionItem",[$z,Fc]=Vs(Ws),Xb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...a}=e,o=Gs(Ws,r),s=bz(Ws,r),i=jc(r),u=jb(),l=n&&s.value.includes(n)||!1,c=o.disabled||e.disabled;return ee.jsx($z,{scope:r,open:l,disabled:c,triggerId:u,children:ee.jsx(cz,{"data-orientation":o.orientation,"data-state":Kb(l),...i,...a,ref:t,disabled:c,open:l,onOpenChange:d=>{d?s.onItemOpen(n):s.onItemClose(n)}})})});Xb.displayName=Ws;var Ub="AccordionHeader",Yb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Gs(mr,r),o=Fc(Ub,r);return ee.jsx(rn.h3,{"data-orientation":a.orientation,"data-state":Kb(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});Yb.displayName=Ub;var Lc="AccordionTrigger",Jb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Gs(mr,r),o=Fc(Lc,r),s=yz(Lc,r),i=jc(r);return ee.jsx(kc.ItemSlot,{scope:r,children:ee.jsx(dz,{"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":a.orientation,id:o.triggerId,...i,...n,ref:t})})});Jb.displayName=Lc;var qb="AccordionContent",Qb=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Gs(mr,r),o=Fc(qb,r),s=jc(r);return ee.jsx(fz,{role:"region","aria-labelledby":o.triggerId,"data-orientation":a.orientation,...s,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Qb.displayName=qb;function Kb(e){return e?"open":"closed"}var Az=Bb,Ez=Xb,wz=Yb,ey=Jb,ty=Qb;const xz=Az,ry=q.forwardRef(({className:e,...t},r)=>ee.jsx(Ez,{ref:r,className:lr("border-b",e),...t}));ry.displayName="AccordionItem";const ny=q.forwardRef(({className:e,children:t,...r},n)=>ee.jsx(wz,{className:"flex",children:ee.jsxs(ey,{ref:n,className:lr("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,ee.jsx(Tb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));ny.displayName=ey.displayName;const ay=q.forwardRef(({className:e,children:t,...r},n)=>ee.jsx(ty,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:ee.jsx("div",{className:lr("pb-4 pt-0",e),children:t})}));ay.displayName=ty.displayName;const Sz=({className:e,children:t,visible:r})=>ee.jsx("div",{className:e,hidden:r==null?!1:!r,children:t}),Tz=(e,t,r,n,a)=>{const{renderers:o,cells:s}=Hn();return $e(e.elements)?[]:e.elements.map((i,u)=>ee.jsx("div",{className:r,children:ee.jsx(zn,{renderers:o,cells:s,uischema:i,schema:t,path:n,enabled:a})},`${n}-${u}`))},Pz=He(1,Ve("CollapsingVerticalLayout")),Oz=e=>{const{data:t,...r}=e;return ee.jsx(Nz,{...r})},Nz=I.memo(function({schema:t,uischema:r,path:n,visible:a,enabled:o,getStyle:s,getStyleAsClassName:i}){const u=r,l=u.elements?u.elements.length:0,c=i&&i("vertical.layout"),d=["vertical-layout-item"].concat(s?s("vertical.layout.item",l):[]).join(" ");return ee.jsx("fieldset",{className:"group-layout pb-4",children:ee.jsx(xz,{type:"single",collapsible:!0,children:ee.jsxs(ry,{value:"item-1",className:"[&>div]:data-[state=open]:overflow-visible",children:[ee.jsx(ny,{className:"text-muted-foreground text-sm font-normal",children:r.label}),ee.jsx(ay,{className:"p-1",children:ee.jsx(Sz,{className:c,uischema:r,schema:t,visible:a,enabled:o,path:n,getStyle:s,getStyleAsClassName:i,children:Tz(u,t,d,n,o)})})]})})})}),Rz=kt(ka(Oz,!1)),Vc=[...VB,{tester:KH,renderer:ez},{tester:Pz,renderer:Rz}],Gc=[...GB,{tester:JH,cell:qH},{tester:j3,cell:F3}];var Re;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const o={};for(const s of a)o[s]=s;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(i=>typeof a[a[i]]!="number"),s={};for(const i of o)s[i]=a[i];return e.objectValues(s)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&o.push(s);return o},e.find=(a,o)=>{for(const s of a)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,o=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(Re||(Re={}));var Wc;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Wc||(Wc={}));const ue=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Tr=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}},K=Re.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"]),Dz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ct extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},a=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let i=n,u=0;for(;u<s.path.length;){const l=s.path[u];u===s.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(r(s))):i[l]=i[l]||{_errors:[]},i=i[l],u++}}};return a(this),n}static assert(t){if(!(t instanceof Ct))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ct.create=e=>new Ct(e);const Jn=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Re.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Re.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Re.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case K.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Re.assertNever(e)}return{message:r}};let oy=Jn;function Mz(e){oy=e}function Bs(){return oy}const Zs=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,o=[...r,...a.path||[]],s={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let i="";const u=n.filter(l=>!!l).slice().reverse();for(const l of u)i=l(s,{data:t,defaultError:i}).message;return{...a,path:o,message:i}},kz=[];function oe(e,t){const r=Bs(),n=Zs({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Jn?void 0:Jn].filter(a=>!!a)});e.common.issues.push(n)}class st{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return Ie;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const o=await a.key,s=await a.value;n.push({key:o,value:s})}return st.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:o,value:s}=a;if(o.status==="aborted"||s.status==="aborted")return Ie;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(n[o.value]=s.value)}return{status:t.value,value:n}}}const Ie=Object.freeze({status:"aborted"}),qn=e=>({status:"dirty",value:e}),dt=e=>({status:"valid",value:e}),Bc=e=>e.status==="aborted",Zc=e=>e.status==="dirty",Ba=e=>e.status==="valid",Za=e=>typeof Promise<"u"&&e instanceof Promise;function Hs(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function sy(e,t,r,n,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));var Ha,za;class Xt{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const iy=(e,t)=>{if(Ba(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ct(e.common.issues);return this._error=r,this._error}}};function we(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(s,i)=>{var u,l;const{message:c}=e;return s.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:i.defaultError}:s.code!=="invalid_type"?{message:i.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:i.defaultError}},description:a}}class Pe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Tr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new st,ctx:{common:t.parent.common,data:t.data,parsedType:Tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Za(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const a={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tr(t)},o=this._parseSync({data:t,path:a.path,parent:a});return iy(a,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tr(t)},a=this._parse({data:t,path:n.path,parent:n}),o=await(Za(a)?a:Promise.resolve(a));return iy(n,o)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,o)=>{const s=t(a),i=()=>o.addIssue({code:K.custom,...n(a)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(i(),!1)):s?!0:(i(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Lt({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Yt.create(this,this._def)}nullable(){return Rr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ft.create(this,this._def)}promise(){return ta.create(this,this._def)}or(t){return Ja.create([this,t],this._def)}and(t){return qa.create(this,t,this._def)}transform(t){return new Lt({...we(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ro({...we(this._def),innerType:this,defaultValue:r,typeName:ye.ZodDefault})}brand(){return new Xc({typeName:ye.ZodBranded,type:this,...we(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new no({...we(this._def),innerType:this,catchValue:r,typeName:ye.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ao.create(this,t)}readonly(){return oo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jz=/^c[^\s-]{8,}$/i,Fz=/^[0-9a-z]+$/,Lz=/^[0-9A-HJKMNP-TV-Z]{26}$/,Vz=/^[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,Gz=/^[a-z0-9_-]{21}$/i,Wz=/^[-+]?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)?)??$/,Bz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Hc;const Hz=/^(?:(?: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])$/,zz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Xz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,uy="((\\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])))",Uz=new RegExp(`^${uy}$`);function ly(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Yz(e){return new RegExp(`^${ly(e)}$`)}function cy(e){let t=`${uy}T${ly(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Jz(e,t){return!!((t==="v4"||!t)&&Hz.test(e)||(t==="v6"||!t)&&zz.test(e))}class jt extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.string,received:o.parsedType}),Ie}const n=new st;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,i=t.data.length<o.value;(s||i)&&(a=this._getOrReturnCtx(t,a),s?oe(a,{code:K.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&oe(a,{code:K.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Bz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"email",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Hc||(Hc=new RegExp(Zz,"u")),Hc.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"emoji",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Vz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"uuid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Gz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"nanoid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")jz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"cuid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Fz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"cuid2",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Lz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"ulid",code:K.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),oe(a,{validation:"url",code:K.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"regex",code:K.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?cy(o).test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Uz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Yz(o).test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{code:K.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Wz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"duration",code:K.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Jz(t.data,o.version)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"ip",code:K.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Xz.test(t.data)||(a=this._getOrReturnCtx(t,a),oe(a,{validation:"base64",code:K.invalid_string,message:o.message}),n.dirty()):Re.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:K.invalid_string,...pe.errToObj(n)})}_addCheck(t){return new jt({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...pe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...pe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...pe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...pe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...pe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...pe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...pe.errToObj(r)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}jt.create=e=>{var t;return new jt({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};function qz(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,o=parseInt(e.toFixed(a).replace(".","")),s=parseInt(t.toFixed(a).replace(".",""));return o%s/Math.pow(10,a)}class Pr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ue.number){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.number,received:o.parsedType}),Ie}let n;const a=new st;for(const o of this._def.checks)o.kind==="int"?Re.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:K.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?qz(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:K.not_finite,message:o.message}),a.dirty()):Re.assertNever(o);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,pe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,pe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,pe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,pe.toString(r))}setLimit(t,r,n,a){return new Pr({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:pe.toString(a)}]})}_addCheck(t){return new Pr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Re.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Pr.create=e=>new Pr({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class Or extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ue.bigint){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.bigint,received:o.parsedType}),Ie}let n;const a=new st;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:K.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):Re.assertNever(o);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,pe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,pe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,pe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,pe.toString(r))}setLimit(t,r,n,a){return new Or({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:pe.toString(a)}]})}_addCheck(t){return new Or({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Or.create=e=>{var t;return new Or({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};class Xa extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.boolean,received:n.parsedType}),Ie}return dt(t.data)}}Xa.create=e=>new Xa({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class on extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_type,expected:ue.date,received:o.parsedType}),Ie}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return oe(o,{code:K.invalid_date}),Ie}const n=new st;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),oe(a,{code:K.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Re.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new on({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}on.create=e=>new on({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,...we(e)});class zs extends Pe{_parse(t){if(this._getType(t)!==ue.symbol){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.symbol,received:n.parsedType}),Ie}return dt(t.data)}}zs.create=e=>new zs({typeName:ye.ZodSymbol,...we(e)});class Ua extends Pe{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.undefined,received:n.parsedType}),Ie}return dt(t.data)}}Ua.create=e=>new Ua({typeName:ye.ZodUndefined,...we(e)});class Ya extends Pe{_parse(t){if(this._getType(t)!==ue.null){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.null,received:n.parsedType}),Ie}return dt(t.data)}}Ya.create=e=>new Ya({typeName:ye.ZodNull,...we(e)});class Qn extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return dt(t.data)}}Qn.create=e=>new Qn({typeName:ye.ZodAny,...we(e)});class sn extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return dt(t.data)}}sn.create=e=>new sn({typeName:ye.ZodUnknown,...we(e)});class hr extends Pe{_parse(t){const r=this._getOrReturnCtx(t);return oe(r,{code:K.invalid_type,expected:ue.never,received:r.parsedType}),Ie}}hr.create=e=>new hr({typeName:ye.ZodNever,...we(e)});class Xs extends Pe{_parse(t){if(this._getType(t)!==ue.undefined){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.void,received:n.parsedType}),Ie}return dt(t.data)}}Xs.create=e=>new Xs({typeName:ye.ZodVoid,...we(e)});class Ft extends Pe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==ue.array)return oe(r,{code:K.invalid_type,expected:ue.array,received:r.parsedType}),Ie;if(a.exactLength!==null){const s=r.data.length>a.exactLength.value,i=r.data.length<a.exactLength.value;(s||i)&&(oe(r,{code:s?K.too_big:K.too_small,minimum:i?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(oe(r,{code:K.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(oe(r,{code:K.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,i)=>a.type._parseAsync(new Xt(r,s,r.path,i)))).then(s=>st.mergeArray(n,s));const o=[...r.data].map((s,i)=>a.type._parseSync(new Xt(r,s,r.path,i)));return st.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Ft({...this._def,minLength:{value:t,message:pe.toString(r)}})}max(t,r){return new Ft({...this._def,maxLength:{value:t,message:pe.toString(r)}})}length(t,r){return new Ft({...this._def,exactLength:{value:t,message:pe.toString(r)}})}nonempty(t){return this.min(1,t)}}Ft.create=(e,t)=>new Ft({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...we(t)});function Kn(e){if(e instanceof Xe){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Yt.create(Kn(n))}return new Xe({...e._def,shape:()=>t})}else return e instanceof Ft?new Ft({...e._def,type:Kn(e.element)}):e instanceof Yt?Yt.create(Kn(e.unwrap())):e instanceof Rr?Rr.create(Kn(e.unwrap())):e instanceof Ut?Ut.create(e.items.map(t=>Kn(t))):e}class Xe extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Re.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ue.object){const l=this._getOrReturnCtx(t);return oe(l,{code:K.invalid_type,expected:ue.object,received:l.parsedType}),Ie}const{status:n,ctx:a}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof hr&&this._def.unknownKeys==="strip"))for(const l in a.data)s.includes(l)||i.push(l);const u=[];for(const l of s){const c=o[l],d=a.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Xt(a,d,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof hr){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of i)u.push({key:{status:"valid",value:c},value:{status:"valid",value:a.data[c]}});else if(l==="strict")i.length>0&&(oe(a,{code:K.unrecognized_keys,keys:i}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of i){const d=a.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Xt(a,d,a.path,c)),alwaysSet:c in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const d=await c.key,p=await c.value;l.push({key:d,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>st.mergeObjectSync(n,l)):st.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new Xe({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,o,s,i;const u=(s=(o=(a=this._def).errorMap)===null||o===void 0?void 0:o.call(a,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(i=pe.errToObj(t).message)!==null&&i!==void 0?i:u}:{message:u}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(t){return new Xe({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Xe({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Xe({...this._def,catchall:t})}pick(t){const r={};return Re.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Xe({...this._def,shape:()=>r})}omit(t){const r={};return Re.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Xe({...this._def,shape:()=>r})}deepPartial(){return Kn(this)}partial(t){const r={};return Re.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new Xe({...this._def,shape:()=>r})}required(t){const r={};return Re.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Yt;)o=o._def.innerType;r[n]=o}}),new Xe({...this._def,shape:()=>r})}keyof(){return dy(Re.objectKeys(this.shape))}}Xe.create=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strip",catchall:hr.create(),typeName:ye.ZodObject,...we(t)}),Xe.strictCreate=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strict",catchall:hr.create(),typeName:ye.ZodObject,...we(t)}),Xe.lazycreate=(e,t)=>new Xe({shape:e,unknownKeys:"strip",catchall:hr.create(),typeName:ye.ZodObject,...we(t)});class Ja extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(o){for(const i of o)if(i.result.status==="valid")return i.result;for(const i of o)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(i=>new Ct(i.ctx.common.issues));return oe(r,{code:K.invalid_union,unionErrors:s}),Ie}if(r.common.async)return Promise.all(n.map(async o=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(a);{let o;const s=[];for(const u of n){const l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(u=>new Ct(u));return oe(r,{code:K.invalid_union,unionErrors:i}),Ie}}get options(){return this._def.options}}Ja.create=(e,t)=>new Ja({options:e,typeName:ye.ZodUnion,...we(t)});const gr=e=>e instanceof Ka?gr(e.schema):e instanceof Lt?gr(e.innerType()):e instanceof eo?[e.value]:e instanceof Nr?e.options:e instanceof to?Re.objectValues(e.enum):e instanceof ro?gr(e._def.innerType):e instanceof Ua?[void 0]:e instanceof Ya?[null]:e instanceof Yt?[void 0,...gr(e.unwrap())]:e instanceof Rr?[null,...gr(e.unwrap())]:e instanceof Xc||e instanceof oo?gr(e.unwrap()):e instanceof no?gr(e._def.innerType):[];class Us extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.object)return oe(r,{code:K.invalid_type,expected:ue.object,received:r.parsedType}),Ie;const n=this.discriminator,a=r.data[n],o=this.optionsMap.get(a);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(oe(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ie)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const a=new Map;for(const o of r){const s=gr(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const i of s){if(a.has(i))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(i)}`);a.set(i,o)}}return new Us({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...we(n)})}}function zc(e,t){const r=Tr(e),n=Tr(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){const a=Re.objectKeys(t),o=Re.objectKeys(e).filter(i=>a.indexOf(i)!==-1),s={...e,...t};for(const i of o){const u=zc(e[i],t[i]);if(!u.valid)return{valid:!1};s[i]=u.data}return{valid:!0,data:s}}else if(r===ue.array&&n===ue.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o<e.length;o++){const s=e[o],i=t[o],u=zc(s,i);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return r===ue.date&&n===ue.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class qa extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=(o,s)=>{if(Bc(o)||Bc(s))return Ie;const i=zc(o.value,s.value);return i.valid?((Zc(o)||Zc(s))&&r.dirty(),{status:r.value,value:i.data}):(oe(n,{code:K.invalid_intersection_types}),Ie)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>a(o,s)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}qa.create=(e,t,r)=>new qa({left:e,right:t,typeName:ye.ZodIntersection,...we(r)});class Ut extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return oe(n,{code:K.invalid_type,expected:ue.array,received:n.parsedType}),Ie;if(n.data.length<this._def.items.length)return oe(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ie;!this._def.rest&&n.data.length>this._def.items.length&&(oe(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((s,i)=>{const u=this._def.items[i]||this._def.rest;return u?u._parse(new Xt(n,s,n.path,i)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>st.mergeArray(r,s)):st.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Ut({...this._def,rest:t})}}Ut.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ut({items:e,typeName:ye.ZodTuple,rest:null,...we(t)})};class Qa extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.object)return oe(n,{code:K.invalid_type,expected:ue.object,received:n.parsedType}),Ie;const a=[],o=this._def.keyType,s=this._def.valueType;for(const i in n.data)a.push({key:o._parse(new Xt(n,i,n.path,i)),value:s._parse(new Xt(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?st.mergeObjectAsync(r,a):st.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Pe?new Qa({keyType:t,valueType:r,typeName:ye.ZodRecord,...we(n)}):new Qa({keyType:jt.create(),valueType:t,typeName:ye.ZodRecord,...we(r)})}}class Ys extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.map)return oe(n,{code:K.invalid_type,expected:ue.map,received:n.parsedType}),Ie;const a=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,u],l)=>({key:a._parse(new Xt(n,i,n.path,[l,"key"])),value:o._parse(new Xt(n,u,n.path,[l,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const u of s){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return Ie;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),i.set(l.value,c.value)}return{status:r.value,value:i}})}else{const i=new Map;for(const u of s){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return Ie;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),i.set(l.value,c.value)}return{status:r.value,value:i}}}}Ys.create=(e,t,r)=>new Ys({valueType:t,keyType:e,typeName:ye.ZodMap,...we(r)});class un extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return oe(n,{code:K.invalid_type,expected:ue.set,received:n.parsedType}),Ie;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(oe(n,{code:K.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(oe(n,{code:K.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const o=this._def.valueType;function s(u){const l=new Set;for(const c of u){if(c.status==="aborted")return Ie;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}const i=[...n.data.values()].map((u,l)=>o._parse(new Xt(n,u,n.path,l)));return n.common.async?Promise.all(i).then(u=>s(u)):s(i)}min(t,r){return new un({...this._def,minSize:{value:t,message:pe.toString(r)}})}max(t,r){return new un({...this._def,maxSize:{value:t,message:pe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}un.create=(e,t)=>new un({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...we(t)});class ea extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.function)return oe(r,{code:K.invalid_type,expected:ue.function,received:r.parsedType}),Ie;function n(i,u){return Zs({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Jn].filter(l=>!!l),issueData:{code:K.invalid_arguments,argumentsError:u}})}function a(i,u){return Zs({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Jn].filter(l=>!!l),issueData:{code:K.invalid_return_type,returnTypeError:u}})}const o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof ta){const i=this;return dt(async function(...u){const l=new Ct([]),c=await i._def.args.parseAsync(u,o).catch(v=>{throw l.addIssue(n(u,v)),l}),d=await Reflect.apply(s,this,c);return await i._def.returns._def.type.parseAsync(d,o).catch(v=>{throw l.addIssue(a(d,v)),l})})}else{const i=this;return dt(function(...u){const l=i._def.args.safeParse(u,o);if(!l.success)throw new Ct([n(u,l.error)]);const c=Reflect.apply(s,this,l.data),d=i._def.returns.safeParse(c,o);if(!d.success)throw new Ct([a(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ea({...this._def,args:Ut.create(t).rest(sn.create())})}returns(t){return new ea({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ea({args:t||Ut.create([]).rest(sn.create()),returns:r||sn.create(),typeName:ye.ZodFunction,...we(n)})}}class Ka extends Pe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ka.create=(e,t)=>new Ka({getter:e,typeName:ye.ZodLazy,...we(t)});class eo extends Pe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),Ie}return{status:"valid",value:t.data}}get value(){return this._def.value}}eo.create=(e,t)=>new eo({value:e,typeName:ye.ZodLiteral,...we(t)});function dy(e,t){return new Nr({values:e,typeName:ye.ZodEnum,...we(t)})}class Nr extends Pe{constructor(){super(...arguments),Ha.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:Re.joinValues(n),received:r.parsedType,code:K.invalid_type}),Ie}if(Hs(this,Ha)||sy(this,Ha,new Set(this._def.values)),!Hs(this,Ha).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:K.invalid_enum_value,options:n}),Ie}return dt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Nr.create(t,{...this._def,...r})}exclude(t,r=this._def){return Nr.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ha=new WeakMap,Nr.create=dy;class to extends Pe{constructor(){super(...arguments),za.set(this,void 0)}_parse(t){const r=Re.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){const a=Re.objectValues(r);return oe(n,{expected:Re.joinValues(a),received:n.parsedType,code:K.invalid_type}),Ie}if(Hs(this,za)||sy(this,za,new Set(Re.getValidEnumValues(this._def.values))),!Hs(this,za).has(t.data)){const a=Re.objectValues(r);return oe(n,{received:n.data,code:K.invalid_enum_value,options:a}),Ie}return dt(t.data)}get enum(){return this._def.values}}za=new WeakMap,to.create=(e,t)=>new to({values:e,typeName:ye.ZodNativeEnum,...we(t)});class ta extends Pe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return oe(r,{code:K.invalid_type,expected:ue.promise,received:r.parsedType}),Ie;const n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return dt(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ta.create=(e,t)=>new ta({type:e,typeName:ye.ZodPromise,...we(t)});class Lt extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:s=>{oe(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const s=a.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async i=>{if(r.value==="aborted")return Ie;const u=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return u.status==="aborted"?Ie:u.status==="dirty"||r.value==="dirty"?qn(u.value):u});{if(r.value==="aborted")return Ie;const i=this._def.schema._parseSync({data:s,path:n.path,parent:n});return i.status==="aborted"?Ie:i.status==="dirty"||r.value==="dirty"?qn(i.value):i}}if(a.type==="refinement"){const s=i=>{const u=a.refinement(i,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ie:(i.status==="dirty"&&r.dirty(),s(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?Ie:(i.status==="dirty"&&r.dirty(),s(i.value).then(()=>({status:r.value,value:i.value}))))}if(a.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ba(s))return s;const i=a.transform(s.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Ba(s)?Promise.resolve(a.transform(s.value,o)).then(i=>({status:r.value,value:i})):s);Re.assertNever(a)}}Lt.create=(e,t,r)=>new Lt({schema:e,typeName:ye.ZodEffects,effect:t,...we(r)}),Lt.createWithPreprocess=(e,t,r)=>new Lt({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...we(r)});class Yt extends Pe{_parse(t){return this._getType(t)===ue.undefined?dt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yt.create=(e,t)=>new Yt({innerType:e,typeName:ye.ZodOptional,...we(t)});class Rr extends Pe{_parse(t){return this._getType(t)===ue.null?dt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rr.create=(e,t)=>new Rr({innerType:e,typeName:ye.ZodNullable,...we(t)});class ro extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ro.create=(e,t)=>new ro({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...we(t)});class no extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Za(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ct(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ct(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}no.create=(e,t)=>new no({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...we(t)});class Js extends Pe{_parse(t){if(this._getType(t)!==ue.nan){const n=this._getOrReturnCtx(t);return oe(n,{code:K.invalid_type,expected:ue.nan,received:n.parsedType}),Ie}return{status:"valid",value:t.data}}}Js.create=e=>new Js({typeName:ye.ZodNaN,...we(e)});const Qz=Symbol("zod_brand");class Xc extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ao extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ie:o.status==="dirty"?(r.dirty(),qn(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ie:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new ao({in:t,out:r,typeName:ye.ZodPipeline})}}class oo extends Pe{_parse(t){const r=this._def.innerType._parse(t),n=a=>(Ba(a)&&(a.value=Object.freeze(a.value)),a);return Za(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}oo.create=(e,t)=>new oo({innerType:e,typeName:ye.ZodReadonly,...we(t)});function fy(e,t={},r){return e?Qn.create().superRefine((n,a)=>{var o,s;if(!e(n)){const i=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,u=(s=(o=i.fatal)!==null&&o!==void 0?o:r)!==null&&s!==void 0?s:!0,l=typeof i=="string"?{message:i}:i;a.addIssue({code:"custom",...l,fatal:u})}}):Qn.create()}const Kz={object:Xe.lazycreate};var ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ye||(ye={}));const eX=(e,t={message:`Input not instance of ${e.name}`})=>fy(r=>r instanceof e,t),py=jt.create,my=Pr.create,tX=Js.create,rX=Or.create,hy=Xa.create,nX=on.create,aX=zs.create,oX=Ua.create,sX=Ya.create,iX=Qn.create,uX=sn.create,lX=hr.create,cX=Xs.create,dX=Ft.create,fX=Xe.create,pX=Xe.strictCreate,mX=Ja.create,hX=Us.create,gX=qa.create,vX=Ut.create,bX=Qa.create,yX=Ys.create,CX=un.create,_X=ea.create,IX=Ka.create,$X=eo.create,AX=Nr.create,EX=to.create,wX=ta.create,gy=Lt.create,xX=Yt.create,SX=Rr.create,TX=Lt.createWithPreprocess,PX=ao.create;var D=Object.freeze({__proto__:null,defaultErrorMap:Jn,setErrorMap:Mz,getErrorMap:Bs,makeIssue:Zs,EMPTY_PATH:kz,addIssueToContext:oe,ParseStatus:st,INVALID:Ie,DIRTY:qn,OK:dt,isAborted:Bc,isDirty:Zc,isValid:Ba,isAsync:Za,get util(){return Re},get objectUtil(){return Wc},ZodParsedType:ue,getParsedType:Tr,ZodType:Pe,datetimeRegex:cy,ZodString:jt,ZodNumber:Pr,ZodBigInt:Or,ZodBoolean:Xa,ZodDate:on,ZodSymbol:zs,ZodUndefined:Ua,ZodNull:Ya,ZodAny:Qn,ZodUnknown:sn,ZodNever:hr,ZodVoid:Xs,ZodArray:Ft,ZodObject:Xe,ZodUnion:Ja,ZodDiscriminatedUnion:Us,ZodIntersection:qa,ZodTuple:Ut,ZodRecord:Qa,ZodMap:Ys,ZodSet:un,ZodFunction:ea,ZodLazy:Ka,ZodLiteral:eo,ZodEnum:Nr,ZodNativeEnum:to,ZodPromise:ta,ZodEffects:Lt,ZodTransformer:Lt,ZodOptional:Yt,ZodNullable:Rr,ZodDefault:ro,ZodCatch:no,ZodNaN:Js,BRAND:Qz,ZodBranded:Xc,ZodPipeline:ao,ZodReadonly:oo,custom:fy,Schema:Pe,ZodSchema:Pe,late:Kz,get ZodFirstPartyTypeKind(){return ye},coerce:{string:e=>jt.create({...e,coerce:!0}),number:e=>Pr.create({...e,coerce:!0}),boolean:e=>Xa.create({...e,coerce:!0}),bigint:e=>Or.create({...e,coerce:!0}),date:e=>on.create({...e,coerce:!0})},any:iX,array:dX,bigint:rX,boolean:hy,date:nX,discriminatedUnion:hX,effect:gy,enum:AX,function:_X,instanceof:eX,intersection:gX,lazy:IX,literal:$X,map:yX,nan:tX,nativeEnum:EX,never:lX,null:sX,nullable:SX,number:my,object:fX,oboolean:()=>hy().optional(),onumber:()=>my().optional(),optional:xX,ostring:()=>py().optional(),pipeline:PX,preprocess:TX,promise:wX,record:bX,set:CX,strictObject:pX,string:py,symbol:aX,transformer:gy,tuple:vX,undefined:oX,union:mX,unknown:uX,void:cX,NEVER:Ie,ZodIssueCode:K,quotelessJson:Dz,ZodError:Ct});const so=D.object({displayName:D.string().optional(),defaultValue:D.string().optional(),type:D.string().optional(),minLength:D.number().optional(),maxLength:D.number().optional(),regex:D.string().optional(),min:D.string().optional(),multiline:D.boolean().optional(),max:D.string().optional(),options:D.array(D.string()).optional(),overrides:D.string().optional(),scope:D.string().optional(),inherited:D.boolean().optional(),precision:D.number().optional(),readOnly:D.boolean().optional()});D.record(so);const OX=D.object({displayName:D.string().optional(),abstract:D.boolean().optional(),extend:D.string().optional(),data:D.record(so).optional()}),NX=D.record(OX),RX=D.object({displayName:D.string().optional(),contents:D.array(D.string()).optional(),abstract:D.boolean().optional(),extend:D.string().optional(),data:D.record(so).optional()}),io=D.record(RX),DX=D.object({defaultTimeZone:D.string().optional(),defaultCurrency:D.string().optional(),defaultTermDuration:D.number().optional(),defaultDurationBasis:D.string().optional(),defaultInstallmentPlan:D.string().optional()}),MX=D.object({abstract:D.boolean().optional(),extend:D.string().optional(),displayName:D.string().optional(),coverageTerms:D.array(D.string()).optional(),eligibleAccountTypes:D.array(D.string()).optional(),contents:D.array(D.string()).optional(),documents:D.array(D.string()).optional(),plugins:D.any(),tables:D.any(),data:D.record(so).optional()}).merge(DX),kX=D.record(MX);D.object({dataTypes:io,accounts:NX,products:kX,policyLines:io.optional(),exposures:io.optional(),exposureGroups:io.optional(),coverages:io.optional(),defaultTimeZone:D.string().optional(),defaultCurrency:D.string().optional(),defaultTermDuration:D.number().optional(),defaultInstallmentPlan:D.string().optional(),defaultBillingPlan:D.string().optional(),defaultDurationBasis:D.string().optional(),defaultDelinquencyPlan:D.string().optional(),defaultAuxDataSettings:D.string().optional(),coverageTerms:D.any(),charges:D.any(),transactionTypes:D.any(),installmentPlans:D.any(),billingPlans:D.any(),payments:D.any(),disbursements:D.any(),tables:D.any(),constraintTables:D.any(),secrets:D.any(),documents:D.any(),auxDataSettings:D.any(),customEvents:D.any(),delinquencyPlans:D.any()});const jX=D.object({abstract:D.boolean().optional(),extend:D.string().optional(),displayName:D.string().optional(),data:D.record(so).optional()});D.record(jX);const uo=D.string().ulid(),FX=D.object({locator:uo,staticLocator:uo,rootLocator:uo.optional(),tenantLocator:uo.optional(),type:D.string(),data:D.record(D.any()).optional(),parentLocator:uo.optional(),coverageTerms:D.record(D.string()).optional()}),vy=FX.extend({elements:D.lazy(()=>vy.array().optional())}),qs=D.string(),LX=D.enum(["draft","validated","earlyUnderwritten","priced","underwritten","accepted","issued","underwrittenBlocked","declined","rejected","refused","discarded"]),VX=D.enum(["none","years","months","monthsE360","weeks","days","hours"]),GX=D.object({elementType:D.string().optional(),locator:qs.optional(),errors:D.array(D.string()).optional()}),WX=D.object({validationItems:D.array(GX).optional(),success:D.boolean().optional()});D.object({locator:qs.optional(),quoteState:LX.optional(),productName:D.string().optional(),accountLocator:qs.optional(),startTime:D.string().optional(),endTime:D.string().optional(),timezone:D.string().optional(),currency:D.string().optional(),underwritingStatus:D.string().optional(),expirationTime:D.string().optional(),element:vy.optional(),type:D.string().optional(),duration:D.number().optional(),durationBasis:VX.optional(),boundTime:D.string().optional(),issuedTime:D.string().optional(),policyLocator:qs.optional(),validationResult:WX.optional(),preferences:D.any().optional(),delinquencyPlanName:D.string().optional()});const by=D.object({locator:D.string().ulid(),removeCoverageTerms:D.record(D.unknown()).optional(),removeData:D.record(D.unknown()).optional(),setCoverageTerms:D.record(D.unknown()).optional(),setData:D.record(D.unknown()).optional()});D.object({productName:D.string().optional(),delinquencyPlanName:D.string().optional(),startTime:D.string().optional(),endTime:D.string().optional(),currency:D.string().optional(),expirationTime:D.string().optional(),setData:D.record(D.unknown()).optional(),elements:D.array(by).optional(),timezone:D.string().optional(),billingPlan:D.string().optional(),defaultTermDuration:D.string().optional(),installmentPlan:D.string().optional(),durationBasis:D.string().optional(),preferences:D.object({billingPreferences:D.object({billingPlanName:D.string().optional(),billingLevel:D.enum(["account","inherit","policy"]).optional()}).optional(),installmentPreferences:D.object({installmentPlanName:D.string().optional(),anchorMode:D.enum(["generateDay","termStartDay","dueDay"]).optional(),anchorTime:D.string().optional(),anchorType:D.enum(["none","dayOfMonth","anchorTime","dayOfWeek","weekOfMonth"]).optional(),cadence:D.enum(["none","fullPay","weekly","everyOtherWeek","monthly","quarterly","semiannually","annually","thirtyDays","everyNDays"]).optional(),dayOfMonth:D.number().optional(),dayOfWeek:D.enum(["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]).optional(),dueLeadDays:D.number().optional(),generateLeadDays:D.number().optional(),maxInstallmentsPerTerm:D.number().optional(),weekOfMonth:D.enum(["none","first","second","third","fourth","fifth"]),installmentPlanWeights:D.array(D.number()).optional()}).optional()}).optional()});const BX=D.enum(["draft","validated","discarded"]);D.object({locator:D.string().ulid(),type:D.string().optional(),state:BX.optional(),data:D.record(D.any()).optional(),delinquencyPlanName:D.string().optional(),validationResult:D.any().optional()});const ZX=D.object({type:D.string().optional(),autoValidate:D.boolean().optional(),data:D.record(D.any()).optional(),delinquencyPlanName:D.string().optional()}),Qs=e=>{const{data:t,scope:r,dataTypes:n,rootDisplayName:a,account:o,quote:s,element:i}=e,u=[];let l={};const c=Object.fromEntries(Object.entries(t??{}).filter(([,d])=>{var p;const v=(p=d.scope)==null?void 0:p.split(",").map(y=>y.trim());return!!(!v||r==="P"&&v!=null&&v.includes("P")||v!=null&&v.includes("Q")||r==="Q"&&v!=null&&v.includes("Q"))}).map(([d,p])=>{var v,y,C,g,f,h,S,T,R,k,G,V,W,X,Q,U,le;let Y=!1,H=!1,z=!1;const te=p.displayName??d,J=(v=p.type)==null?void 0:v.slice(-1),ae=p.maxLength,F=p.minLength,P=p.max,x=p.min,E=p.regex;let m=p.type??"",_;switch(J){case"*":H=!0,Y=!0,m=m==null?void 0:m.split("*")[0];break;case"?":m=m==null?void 0:m.split("?")[0],Y=!0;break;case"+":H=!0,m=m==null?void 0:m.split("+")[0];break;case"!":m=m==null?void 0:m.split("!")[0];break}switch(m){case"string":m="string";break;case"int":case"long":m="integer";break;case"decimal":m="number";break;case"dateTime":case"datetime":m="string",_="date-time";break;case"date":m="string",_="date";break;case"boolean":case"bool":m="boolean";break;default:z=!0;break}if(!Y&&!z&&!H&&u.push(d),z){const N=n==null?void 0:n[m];if(N){let M=H?[]:{};const Z=Qs({data:N.data??{},scope:r,dataTypes:n,rootDisplayName:N.displayName??d});return s&&(C=(y=s.element)==null?void 0:y.data)!=null&&C[d]&&(M=(f=(g=s.element)==null?void 0:g.data)==null?void 0:f[d]),i&&(h=i==null?void 0:i.data)!=null&&h[d]&&(M=(S=i==null?void 0:i.data)==null?void 0:S[d]),o&&(T=o==null?void 0:o.data)!=null&&T[d]&&(M=(R=o==null?void 0:o.data)==null?void 0:R[d]),l={...l,[`${m}`]:Z},H?[d,{title:N.displayName??d,type:"array",default:M,items:{$ref:`#/definitions/${m}`},...!Y&&{minItems:1}}]:[d,{title:N.displayName??d,default:M,$ref:`#/definitions/${m}`}]}}let A="";if(o){const N=(o==null?void 0:o.state)==="validated"?d.charAt(0).toLowerCase()+d.slice(1):d;A=(k=o==null?void 0:o.data)!=null&&k[N]?(G=o==null?void 0:o.data)==null?void 0:G[N]:m==="boolean"?!!p.defaultValue:p.defaultValue}return s&&(A=(W=(V=s.element)==null?void 0:V.data)!=null&&W[d]?(Q=(X=s.element)==null?void 0:X.data)==null?void 0:Q[d]:m==="boolean"?!!p.defaultValue:p.defaultValue),i&&(A=(U=i==null?void 0:i.data)!=null&&U[d]?(le=i==null?void 0:i.data)==null?void 0:le[d]:m==="boolean"?!!p.defaultValue:p.defaultValue),H?[d,{title:te,type:"array",default:A,items:{type:m,...ae&&{maxLength:ae},...F&&{minLength:F},...x&&{min:x},...P&&{max:P},..._&&{format:_},...E&&{pattern:p.regex}},...!Y&&{minItems:1}}]:[d,{title:te,type:m,...A&&{default:A},...F&&{minLength:F},...ae&&{maxLength:ae},...x&&{minimum:parseInt(x)},...P&&{maximum:parseInt(P)},..._&&{format:_},...p.options&&{enum:p.options},...E&&{pattern:p.regex}}]}));return{title:a,type:"object",definitions:l,required:u,properties:c}};var HX=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zX(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yy={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(HX,function(){var r=1e3,n=6e4,a=36e5,o="millisecond",s="second",i="minute",u="hour",l="day",c="week",d="month",p="quarter",v="year",y="date",C="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Y){var H=["th","st","nd","rd"],z=Y%100;return"["+Y+(H[(z-20)%10]||H[z]||H[0])+"]"}},S=function(Y,H,z){var te=String(Y);return!te||te.length>=H?Y:""+Array(H+1-te.length).join(z)+Y},T={s:S,z:function(Y){var H=-Y.utcOffset(),z=Math.abs(H),te=Math.floor(z/60),J=z%60;return(H<=0?"+":"-")+S(te,2,"0")+":"+S(J,2,"0")},m:function Y(H,z){if(H.date()<z.date())return-Y(z,H);var te=12*(z.year()-H.year())+(z.month()-H.month()),J=H.clone().add(te,d),ae=z-J<0,F=H.clone().add(te+(ae?-1:1),d);return+(-(te+(z-J)/(ae?J-F:F-J))||0)},a:function(Y){return Y<0?Math.ceil(Y)||0:Math.floor(Y)},p:function(Y){return{M:d,y:v,w:c,d:l,D:y,h:u,m:i,s,ms:o,Q:p}[Y]||String(Y||"").toLowerCase().replace(/s$/,"")},u:function(Y){return Y===void 0}},R="en",k={};k[R]=h;var G="$isDayjsObject",V=function(Y){return Y instanceof U||!(!Y||!Y[G])},W=function Y(H,z,te){var J;if(!H)return R;if(typeof H=="string"){var ae=H.toLowerCase();k[ae]&&(J=ae),z&&(k[ae]=z,J=ae);var F=H.split("-");if(!J&&F.length>1)return Y(F[0])}else{var P=H.name;k[P]=H,J=P}return!te&&J&&(R=J),J||!te&&R},X=function(Y,H){if(V(Y))return Y.clone();var z=typeof H=="object"?H:{};return z.date=Y,z.args=arguments,new U(z)},Q=T;Q.l=W,Q.i=V,Q.w=function(Y,H){return X(Y,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var U=function(){function Y(z){this.$L=W(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[G]=!0}var H=Y.prototype;return H.parse=function(z){this.$d=function(te){var J=te.date,ae=te.utc;if(J===null)return new Date(NaN);if(Q.u(J))return new Date;if(J instanceof Date)return new Date(J);if(typeof J=="string"&&!/Z$/i.test(J)){var F=J.match(g);if(F){var P=F[2]-1||0,x=(F[7]||"0").substring(0,3);return ae?new Date(Date.UTC(F[1],P,F[3]||1,F[4]||0,F[5]||0,F[6]||0,x)):new Date(F[1],P,F[3]||1,F[4]||0,F[5]||0,F[6]||0,x)}}return new Date(J)}(z),this.init()},H.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},H.$utils=function(){return Q},H.isValid=function(){return this.$d.toString()!==C},H.isSame=function(z,te){var J=X(z);return this.startOf(te)<=J&&J<=this.endOf(te)},H.isAfter=function(z,te){return X(z)<this.startOf(te)},H.isBefore=function(z,te){return this.endOf(te)<X(z)},H.$g=function(z,te,J){return Q.u(z)?this[te]:this.set(J,z)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function(z,te){var J=this,ae=!!Q.u(te)||te,F=Q.p(z),P=function(Z,re){var ge=Q.w(J.$u?Date.UTC(J.$y,re,Z):new Date(J.$y,re,Z),J);return ae?ge:ge.endOf(l)},x=function(Z,re){return Q.w(J.toDate()[Z].apply(J.toDate("s"),(ae?[0,0,0,0]:[23,59,59,999]).slice(re)),J)},E=this.$W,m=this.$M,_=this.$D,A="set"+(this.$u?"UTC":"");switch(F){case v:return ae?P(1,0):P(31,11);case d:return ae?P(1,m):P(0,m+1);case c:var N=this.$locale().weekStart||0,M=(E<N?E+7:E)-N;return P(ae?_-M:_+(6-M),m);case l:case y:return x(A+"Hours",0);case u:return x(A+"Minutes",1);case i:return x(A+"Seconds",2);case s:return x(A+"Milliseconds",3);default:return this.clone()}},H.endOf=function(z){return this.startOf(z,!1)},H.$set=function(z,te){var J,ae=Q.p(z),F="set"+(this.$u?"UTC":""),P=(J={},J[l]=F+"Date",J[y]=F+"Date",J[d]=F+"Month",J[v]=F+"FullYear",J[u]=F+"Hours",J[i]=F+"Minutes",J[s]=F+"Seconds",J[o]=F+"Milliseconds",J)[ae],x=ae===l?this.$D+(te-this.$W):te;if(ae===d||ae===v){var E=this.clone().set(y,1);E.$d[P](x),E.init(),this.$d=E.set(y,Math.min(this.$D,E.daysInMonth())).$d}else P&&this.$d[P](x);return this.init(),this},H.set=function(z,te){return this.clone().$set(z,te)},H.get=function(z){return this[Q.p(z)]()},H.add=function(z,te){var J,ae=this;z=Number(z);var F=Q.p(te),P=function(m){var _=X(ae);return Q.w(_.date(_.date()+Math.round(m*z)),ae)};if(F===d)return this.set(d,this.$M+z);if(F===v)return this.set(v,this.$y+z);if(F===l)return P(1);if(F===c)return P(7);var x=(J={},J[i]=n,J[u]=a,J[s]=r,J)[F]||1,E=this.$d.getTime()+z*x;return Q.w(E,this)},H.subtract=function(z,te){return this.add(-1*z,te)},H.format=function(z){var te=this,J=this.$locale();if(!this.isValid())return J.invalidDate||C;var ae=z||"YYYY-MM-DDTHH:mm:ssZ",F=Q.z(this),P=this.$H,x=this.$m,E=this.$M,m=J.weekdays,_=J.months,A=J.meridiem,N=function(re,ge,Ce,je){return re&&(re[ge]||re(te,ae))||Ce[ge].slice(0,je)},M=function(re){return Q.s(P%12||12,re,"0")},Z=A||function(re,ge,Ce){var je=re<12?"AM":"PM";return Ce?je.toLowerCase():je};return ae.replace(f,function(re,ge){return ge||function(Ce){switch(Ce){case"YY":return String(te.$y).slice(-2);case"YYYY":return Q.s(te.$y,4,"0");case"M":return E+1;case"MM":return Q.s(E+1,2,"0");case"MMM":return N(J.monthsShort,E,_,3);case"MMMM":return N(_,E);case"D":return te.$D;case"DD":return Q.s(te.$D,2,"0");case"d":return String(te.$W);case"dd":return N(J.weekdaysMin,te.$W,m,2);case"ddd":return N(J.weekdaysShort,te.$W,m,3);case"dddd":return m[te.$W];case"H":return String(P);case"HH":return Q.s(P,2,"0");case"h":return M(1);case"hh":return M(2);case"a":return Z(P,x,!0);case"A":return Z(P,x,!1);case"m":return String(x);case"mm":return Q.s(x,2,"0");case"s":return String(te.$s);case"ss":return Q.s(te.$s,2,"0");case"SSS":return Q.s(te.$ms,3,"0");case"Z":return F}return null}(re)||F.replace(":","")})},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function(z,te,J){var ae,F=this,P=Q.p(te),x=X(z),E=(x.utcOffset()-this.utcOffset())*n,m=this-x,_=function(){return Q.m(F,x)};switch(P){case v:ae=_()/12;break;case d:ae=_();break;case p:ae=_()/3;break;case c:ae=(m-E)/6048e5;break;case l:ae=(m-E)/864e5;break;case u:ae=m/a;break;case i:ae=m/n;break;case s:ae=m/r;break;default:ae=m}return J?ae:Q.a(ae)},H.daysInMonth=function(){return this.endOf(d).$D},H.$locale=function(){return k[this.$L]},H.locale=function(z,te){if(!z)return this.$L;var J=this.clone(),ae=W(z,te,!0);return ae&&(J.$L=ae),J},H.clone=function(){return Q.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},Y}(),le=U.prototype;return X.prototype=le,[["$ms",o],["$s",s],["$m",i],["$H",u],["$W",l],["$M",d],["$y",v],["$D",y]].forEach(function(Y){le[Y[1]]=function(H){return this.$g(H,Y[0],Y[1])}}),X.extend=function(Y,H){return Y.$i||(Y(H,U,X),Y.$i=!0),X},X.locale=W,X.isDayjs=V,X.unix=function(Y){return X(1e3*Y)},X.en=k[R],X.Ls=k,X.p={},X})})(yy);var XX=yy.exports;const ra=zX(XX),UX=({data:e})=>{const t={},r={...e};return r.default&&(r.default.startTime&&(t.startTime=ra(r.default.startTime).format()),r.default.endTime&&(t.endTime=ra(r.default.endTime).format()),r.default.expirationTime&&(t.expirationTime=ra(r.default.expirationTime).format())),r.advanced&&(r.advanced.currency&&(t.currency=r.advanced.currency),r.advanced.timezone&&(t.timezone=r.advanced.timezone),r.advanced.billingPlan&&(t.billingPlan=r.advanced.billingPlan),r.advanced.defaultTermDuration&&(t.defaultTermDuration=r.advanced.defaultTermDuration),r.advanced.installmentPlan&&(t.installmentPlan=r.advanced.installmentPlan),r.advanced.durationBasis&&(t.durationBasis=r.advanced.durationBasis),r.advanced.delinquencyPlanName&&(t.delinquencyPlanName=r.advanced.delinquencyPlanName)),delete r.default,delete r.advanced,t.setData=r,t};function na(e){return e==null?void 0:e.map(t=>(t.keyword==="pattern"&&(t.message=`Invalid format, must match pattern ${t.params.pattern}`),t.keyword==="format"&&(t.message="Invalid format"),t.keyword==="required"&&(t.message="Required"),t.keyword==="minItems"&&(t.message=`Must have at least ${t.params.limit} item${t.params.limit!==1?"s":""}`),t.keyword==="maxItems"&&(t.message=`Must have at most ${t.params.limit} item${t.params.limit!==1?"s":""}`),t.keyword==="type"&&(t.message="Invalid format"),t.keyword==="maxLength"&&(t.message=`Must be at most ${t.params.limit} character${t.params.limit!==1?"s":""}`),t.keyword==="minLength"&&(t.message=`Must be at least ${t.params.limit} character${t.params.limit!==1?"s":""}`),t.keyword==="minimum"&&(t.message=`Must be greater than or equal to ${t.params.limit}`),t.keyword==="maximum"&&(t.message=`Must be less than or equal to ${t.params.limit}`),t.keyword==="enum"&&(t.message="Invalid value"),t))}const Cy=e=>{var t,r,n,a,o,s;return{...((t=e==null?void 0:e.element)==null?void 0:t.data)&&{...(r=e==null?void 0:e.element)==null?void 0:r.data},default:{...(e==null?void 0:e.startTime)&&{startTime:ra(e.startTime).format("YYYY-MM-DD")},...(e==null?void 0:e.endTime)&&{endTime:ra(e.endTime).format("YYYY-MM-DD")},...(e==null?void 0:e.expirationTime)&&{expirationTime:ra(e.expirationTime).format("YYYY-MM-DD")}},advanced:{currency:(e==null?void 0:e.currency)??void 0,timezone:(e==null?void 0:e.timezone)??void 0,billingPlan:((a=(n=e==null?void 0:e.preferences)==null?void 0:n.billingPreferences)==null?void 0:a.billingPlanName)??void 0,installmentPlan:((s=(o=e==null?void 0:e.preferences)==null?void 0:o.installmentPreferences)==null?void 0:s.installmentPlanName)??void 0,durationBasis:(e==null?void 0:e.durationBasis)??void 0,delinquencyPlanName:(e==null?void 0:e.delinquencyPlanName)??void 0}}};var Uc={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Cl,n=xe,a=wn,o=It,s=En,i=St,u="errorMessage",l=new r.Name("emUsed"),c={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,v=/^""\s*\+\s*|\s*\+\s*""$/g;function y(g){return{keyword:u,schemaType:["string","object"],post:!0,code(f){const{gen:h,data:S,schema:T,schemaValue:R,it:k}=f;if(k.createErrors===!1)return;const G=T,V=n.strConcat(i.default.instancePath,k.errorPath);h.if(r._`${i.default.errors} > 0`,()=>{if(typeof G=="object"){const[E,m]=X(G);m&&Q(m),E&&U(E),le(W(G))}const x=typeof G=="string"?G:G._;x&&Y(x),g.keepErrors||H()});function W({properties:x,items:E}){const m={};if(x){m.props={};for(const _ in x)m.props[_]=[]}if(E){m.items={};for(let _=0;_<E.length;_++)m.items[_]=[]}return m}function X(x){let E,m;for(const _ in x){if(_==="properties"||_==="items")continue;const A=x[_];if(typeof A=="object"){E||(E={});const N=E[_]={};for(const M in A)N[M]=[]}else m||(m={}),m[_]=[]}return[E,m]}function Q(x){const E=h.const("emErrors",r.stringify(x)),m=h.const("templates",ae(x,T));h.forOf("err",i.default.vErrors,M=>h.if(z(M,E),()=>h.code(r._`${E}[${M}.keyword].push(${M})`).assign(r._`${M}.${l}`,!0)));const{singleError:_}=g;if(_){const M=h.let("message",r._`""`),Z=h.let("paramsErrors",r._`[]`);A(re=>{h.if(M,()=>h.code(r._`${M} += ${typeof _=="string"?_:";"}`)),h.code(r._`${M} += ${N(re)}`),h.assign(Z,r._`${Z}.concat(${E}[${re}])`)}),s.reportError(f,{message:M,params:r._`{errors: ${Z}}`})}else A(M=>s.reportError(f,{message:N(M),params:r._`{errors: ${E}[${M}]}`}));function A(M){h.forIn("key",E,Z=>h.if(r._`${E}[${Z}].length`,()=>M(Z)))}function N(M){return r._`${M} in ${m} ? ${m}[${M}]() : ${R}[${M}]`}}function U(x){const E=h.const("emErrors",r.stringify(x)),m=[];for(const Z in x)m.push([Z,ae(x[Z],T[Z])]);const _=h.const("templates",h.object(...m)),A=h.scopeValue("obj",{ref:c,code:r.stringify(c)}),N=h.let("emPropParams"),M=h.let("emParamsErrors");h.forOf("err",i.default.vErrors,Z=>h.if(z(Z,E),()=>{h.assign(N,r._`${A}[${Z}.keyword]`),h.assign(M,r._`${E}[${Z}.keyword][${Z}.params[${N}]]`),h.if(M,()=>h.code(r._`${M}.push(${Z})`).assign(r._`${Z}.${l}`,!0))})),h.forIn("key",E,Z=>h.forIn("keyProp",r._`${E}[${Z}]`,re=>{h.assign(M,r._`${E}[${Z}][${re}]`),h.if(r._`${M}.length`,()=>{const ge=h.const("tmpl",r._`${_}[${Z}] && ${_}[${Z}][${re}]`);s.reportError(f,{message:r._`${ge} ? ${ge}() : ${R}[${Z}][${re}]`,params:r._`{errors: ${M}}`})})}))}function le(x){const{props:E,items:m}=x;if(!E&&!m)return;const _=r._`typeof ${S} == "object"`,A=r._`Array.isArray(${S})`,N=h.let("emErrors");let M,Z;const re=h.let("templates");E&&m?(M=h.let("emChildKwd"),h.if(_),h.if(A,()=>{ge(m,T.items),h.assign(M,r.str`items`)},()=>{ge(E,T.properties),h.assign(M,r.str`properties`)}),Z=r._`[${M}]`):m?(h.if(A),ge(m,T.items),Z=r._`.items`):E&&(h.if(n.and(_,n.not(A))),ge(E,T.properties),Z=r._`.properties`),h.forOf("err",i.default.vErrors,Ce=>te(Ce,N,je=>h.code(r._`${N}[${je}].push(${Ce})`).assign(r._`${Ce}.${l}`,!0))),h.forIn("key",N,Ce=>h.if(r._`${N}[${Ce}].length`,()=>{s.reportError(f,{message:r._`${Ce} in ${re} ? ${re}[${Ce}]() : ${R}${Z}[${Ce}]`,params:r._`{errors: ${N}[${Ce}]}`}),h.assign(r._`${i.default.vErrors}[${i.default.errors}-1].instancePath`,r._`${V} + "/" + ${Ce}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),h.endIf();function ge(Ce,je){h.assign(N,r.stringify(Ce)),h.assign(re,ae(Ce,je))}}function Y(x){const E=h.const("emErrs",r._`[]`);h.forOf("err",i.default.vErrors,m=>h.if(J(m),()=>h.code(r._`${E}.push(${m})`).assign(r._`${m}.${l}`,!0))),h.if(r._`${E}.length`,()=>s.reportError(f,{message:F(x),params:r._`{errors: ${E}}`}))}function H(){const x=h.const("emErrs",r._`[]`);h.forOf("err",i.default.vErrors,E=>h.if(r._`!${E}.${l}`,()=>h.code(r._`${x}.push(${E})`))),h.assign(i.default.vErrors,x).assign(i.default.errors,r._`${x}.length`)}function z(x,E){return n.and(r._`${x}.keyword !== ${u}`,r._`!${x}.${l}`,r._`${x}.instancePath === ${V}`,r._`${x}.keyword in ${E}`,r._`${x}.schemaPath.indexOf(${k.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${x}.schemaPath.slice(${k.errSchemaPath.length}))`)}function te(x,E,m){h.if(n.and(r._`${x}.keyword !== ${u}`,r._`!${x}.${l}`,r._`${x}.instancePath.indexOf(${V}) === 0`),()=>{const _=h.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),A=h.const("emMatches",r._`${_}.exec(${x}.instancePath.slice(${V}.length))`),N=h.const("emChild",r._`${A} && ${A}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);h.if(r._`${N} !== undefined && ${N} in ${E}`,()=>m(N))})}function J(x){return n.and(r._`${x}.keyword !== ${u}`,r._`!${x}.${l}`,n.or(r._`${x}.instancePath === ${V}`,n.and(r._`${x}.instancePath.indexOf(${V}) === 0`,r._`${x}.instancePath[${V}.length] === "/"`)),r._`${x}.schemaPath.indexOf(${k.errSchemaPath}) === 0`,r._`${x}.schemaPath[${k.errSchemaPath}.length] === "/"`)}function ae(x,E){const m=[];for(const _ in x){const A=E[_];d.test(A)&&m.push([_,P(A)])}return h.object(...m)}function F(x){return d.test(x)?new a._Code(a.safeStringify(x).replace(p,(E,m)=>`" + JSON.stringify(${o.getData(m,k)}) + "`).replace(v,"")):r.stringify(x)}function P(x){return r._`function(){return ${F(x)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const C=(g,f={})=>{if(!g.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(g.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return g.addKeyword(y(f))};t.default=C,e.exports=C,e.exports.default=C})(Uc,Uc.exports);var YX=Uc.exports;const Yc=Me(YX);function JX(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function qX(...e){return t=>e.forEach(r=>JX(r,t))}const _y=I.forwardRef((e,t)=>{const{children:r,...n}=e,a=I.Children.toArray(r),o=a.find(KX);if(o){const s=o.props.children,i=a.map(u=>u===o?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:u);return I.createElement(Jc,be({},n,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,i):null)}return I.createElement(Jc,be({},n,{ref:t}),r)});_y.displayName="Slot";const Jc=I.forwardRef((e,t)=>{const{children:r,...n}=e;return I.isValidElement(r)?I.cloneElement(r,{...eU(n,r.props),ref:t?qX(t,r.ref):r.ref}):I.Children.count(r)>1?I.Children.only(null):null});Jc.displayName="SlotClone";const QX=({children:e})=>I.createElement(I.Fragment,null,e);function KX(e){return I.isValidElement(e)&&e.type===QX}function eU(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...i)=>{o(...i),a(...i)}:a&&(r[n]=a):n==="style"?r[n]={...a,...o}:n==="className"&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}const Iy=Db("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ks=q.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},o)=>{const s=n?_y:"button";return ee.jsx(s,{className:lr(Iy({variant:t,size:r,className:e})),ref:o,...a})});Ks.displayName="Button";const qc={styles:[...sv,{name:"vertical.layout",classNames:["grid grid-cols-1 @md:grid-cols-2 @4xl:grid-cols-3 gap-2"]},{name:"vertical.layout.item",classNames:["has-[.array-table-layout]:col-span-1 @md:has-[.array-table-layout]:col-span-2 @4xl:has-[.array-table-layout]:col-span-3","has-[.group-layout]:col-span-1 @md:has-[.group-layout]:col-span-2 @4xl:has-[.group-layout]:col-span-3","col-span-1 @md:col-span-1 @4xl:col-span-1","self-end"]},{name:"group.layout",classNames:["grid grid-cols-1 @md:grid-cols-2 @4xl:grid-cols-3 gap-2"]},{name:"group.label",classNames:["text-lg font-medium pb-4"]},{name:"control",classNames:["flex flex-col gap-2"]},{name:"control.input",classNames:["flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"]},{name:"control.checkbox",classNames:[]},{name:"control.label",classNames:["break-words text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"]},{name:"control.validation.error",classNames:["text-sm font-medium text-destructive"]},{name:"array.table.label",classNames:["text-lg font-medium "]},{name:"array.table",classNames:["border rounded-md p-2","[&>header]:flex [&>header]:flex-row [&>header]:justify-between [&>header]: [&>header]:px-4 [&>header]:pb-4"]},{name:"array.table.table",classNames:["w-full caption-bottom text-sm block overflow-x-auto","[&>thead]:[&_tr]:border-b","[&>thead>tr]:border-b [&>thead>tr]:transition-colors [&>thead>tr]:hover:bg-muted-50 [&>thead>tr]:data-[state=selected]:bg-muted-50","[&>thead>tr>th]:h-12 [&>thead>tr>th]:px-4 [&>thead>tr>th]:text-left [&>thead>tr>th]:align-middle [&>thead>tr>th]:font-medium [&>thead>tr>th]:has([role=checkbox]):pr-0","[&>tbody>tr:not(:last-child)]:border-b [&>tbody>tr]:transition-colors [&>tbody>tr]:hover:bg-muted-50 [&>tbody>tr]:data-[state=selected]:bg-muted-50","[&>tbody>tr>td]:p-4 [&>tbody>tr>td]:align-middle [&>tbody>tr>td]:[&:has([role=checkbox])]:pr-0 [&>tbody>tr>td]:min-w-48","[&>tbody>tr>td]:[:has(button)]:min-w-0 [&>tbody>tr>td>button]:bg-primary [&>tbody>tr>td>button]:text-primary-foreground [&>tbody>tr>td>button]:hover:bg-primary/90 [&>tbody>tr>td>button]:inline-flex [&>tbody>tr>td>button]:items-center [&>tbody>tr>td>button]:justify-center [&>tbody>tr>td>button]:whitespace-nowrap [&>tbody>tr>td>button]:rounded-md [&>tbody>tr>td>button]:text-sm [&>tbody>tr>td>button]:font-medium [&>tbody>tr>td>button]:ring-offset-background [&>tbody>tr>td>button]:transition-colors [&>tbody>tr>td>button]:focus-visible:outline-none [&>tbody>tr>td>button]:focus-visible:ring-2 [&>tbody>tr>td>button]:focus-visible:ring-ring [&>tbody>tr>td>button]:focus-visible:ring-offset-2 [&>tbody>tr>td>button]:disabled:pointer-events-none [&>tbody>tr>td>button]:disabled:opacity-50 [&>tbody>tr>td>button]:h-10 [&>tbody>tr>td>button]:px-4 [&>tbody>tr>td>button]:py-2"]},{name:"array.table.button",classNames:[Iy({variant:"default",size:"sm"})]}]},ln=new ns({allErrors:!0});Yc(ln),as(ln);const $y=({accountsModel:e,accountType:t,dataTypes:r,disabled:n,handleSubmit:a,isSubmitting:o,preventFormResetOnDisabled:s=!0,hideSubmitButton:i=!1,validateOnSubmit:u=!1,account:l,submitButtonText:c,id:d})=>{const[p,v]=I.useState(l?l.data:{}),[y,C]=I.useState(!1),[g,f]=I.useState();I.useEffect(()=>{n&&!s&&(f([]),v(l?l.data:{}))},[n,l,s]);const h=I.useMemo(()=>Qs({data:e[t].data??{},dataTypes:r,scope:"Q",rootDisplayName:e[t].displayName??t,account:l}),[e,r,l,t]),S=R=>{R.preventDefault();const k=ln.validate(h,p??{});if(u&&!k){const W=na(ln.errors);f(W),C(!0);return}else f([]);const G={data:p,type:t},V=ZX.parse(G);a(V)},T=I.useCallback((R,k,G)=>{const V=G(R,k);switch(k.type){case Gn:case Wn:{v(V.data);const W=ln.validate(h,V.data??{});if(!y)return R;if(W)f([]);else{const X=na(ln.errors);f(X)}return R}default:return V}},[y,h]);return ee.jsx(_s.Provider,{value:qc,children:ee.jsxs("form",{onSubmit:S,id:d,className:"@container flex w-full border-spacing-0 flex-col gap-2",children:[ee.jsx(tc,{ajv:ln,cells:Gc,renderers:Vc,data:p,readonly:n||o,additionalErrors:g,onChange:({data:R})=>{v(R)},middleware:T,schema:h,validationMode:"NoValidation"}),!i&&ee.jsx(Ks,{type:"submit",variant:"default",className:"mt-4 self-end",disabled:n||o,children:c??"Submit"})]})})};$y.displayName="AccountForm";const tU={Advanced:{title:"",type:"object",definitions:{},required:[],properties:{currency:{type:"string",enum:["USD","EUR","JPY","GBP","AUD","CAD","CHF","CNY","SEK","NZD","Other"],title:"Currency"},timezone:{type:"string",enum:["America/Chicago","America/New_York","Asia/Tokyo","Europe/Berlin","Europe/Rome","Europe/Moscow"],title:"Timezone"},billingPlan:{type:"string",enum:["Standard"],title:"Billing Plan"},defaultTermDuration:{type:"string",enum:["0","6"],title:"Term Duration"},installmentPlan:{type:"string",enum:["Standard","Monthly10"],title:"Installment Plan"},durationBasis:{type:"string",enum:["years","months","weeks","days","hours"],title:"Duration Basis"},delinquencyPlanName:{type:"string",enum:["Standard"],title:"Delinquency Plan"}}}},rU={Default:{title:"",type:"object",definitions:{},required:[],properties:{startTime:{title:"Start Date",type:"string",format:"date"},endTime:{title:"End Date",type:"string",format:"date"},expirationTime:{title:"Expiration Time",type:"string",format:"date"}}}},cn=new ns({allErrors:!0});Yc(cn),as(cn);const Ay=({quote:e,productModel:t,dataTypes:r,disabled:n,handleSubmit:a,isSubmitting:o,preventFormResetOnDisabled:s=!0,validateOnSubmit:i=!1,hideSubmitButton:u=!1,submitButtonText:l,id:c})=>{const[d,p]=I.useState(Cy(e)),[v,y]=I.useState(!1),[C,g]=I.useState();I.useEffect(()=>{n&&!s&&(g([]),p(Cy(e)))},[n,e,s]);const f=I.useMemo(()=>Qs({data:t.data??{},dataTypes:r,scope:"Q",rootDisplayName:t.displayName??e.type??"Quote",quote:e==null?void 0:e.element}),[t,r,e]);f.definitions={...f.definitions,...rU,...tU},f.properties={...f.properties,default:{title:"Details",default:{},$ref:"#/definitions/Default"},advanced:{title:"See Advanced Details",default:{},$ref:"#/definitions/Advanced"}};const h=G=>{G.preventDefault();const V=cn.validate(f,d??{});if(i&&!V){const X=na(cn.errors);g(X),y(!0);return}else g([]);const W=UX({data:d});return a(W),d},S=I.useCallback((G,V,W)=>{const X=W(G,V);switch(V.type){case Gn:case Wn:{p(X.data);const Q=cn.validate(f,X.data??{});if(!v)return G;if(Q)g([]);else{const U=na(cn.errors);g(U)}return G}default:return X}},[v,f]),T=Wl(f),R=T.elements.find(G=>G.scope==="#/properties/default"),k=T.elements.find(G=>G.scope==="#/properties/advanced");if(T.elements=[...T.elements.filter(G=>G.scope!=="#/properties/default"&&G.scope!=="#/properties/advanced")],k){const G={type:"CollapsingVerticalLayout",label:"See Advanced Details",elements:[k]};T.elements.unshift(G)}return R&&T.elements.unshift(R),ee.jsx(_s.Provider,{value:qc,children:ee.jsxs("form",{onSubmit:h,id:c,className:"@container flex w-full flex-col gap-2",children:[ee.jsx(tc,{ajv:cn,uischema:T,cells:Gc,renderers:Vc,data:d,readonly:n||o,additionalErrors:C,middleware:S,schema:f,validationMode:"NoValidation"}),!u&&ee.jsx(Ks,{type:"submit",variant:"default",className:"mt-4 self-end",disabled:n||o,children:l??"Submit"})]})})};Ay.displayName="QuoteForm";const dn=new ns({allErrors:!0});Yc(dn),as(dn);const Ey=({elementModel:e,dataTypes:t,disabled:r,handleSubmit:n,isSubmitting:a,preventFormResetOnDisabled:o=!0,hideSubmitButton:s=!1,element:i,validateOnSubmit:u=!1,submitButtonText:l,id:c})=>{const[d,p]=I.useState(i?i.data:{}),[v,y]=I.useState(!1),[C,g]=I.useState();I.useEffect(()=>{r&&!o&&(g([]),p(i?i.data:{}))},[r,i,o]);const f=I.useMemo(()=>Qs({data:e.data??{},dataTypes:t,scope:"Q",rootDisplayName:e.displayName??i.type??"Element",element:i}),[e,t,i]),h=T=>{T.preventDefault();const R=dn.validate(f,d??{});if(u&&!R){const V=na(dn.errors);g(V),y(!0);return}else g([]);const k={setData:d,locator:i.locator},G=by.parse(k);n(G)},S=I.useCallback((T,R,k)=>{const G=k(T,R);switch(R.type){case Gn:case Wn:{p(G.data);const V=dn.validate(f,G.data??{});if(!v)return T;if(V)g([]);else{const W=na(dn.errors);g(W)}return T}default:return G}},[v,f]);return ee.jsx(_s.Provider,{value:qc,children:ee.jsxs("form",{onSubmit:h,id:c,className:"@container flex w-full flex-col gap-2",children:[ee.jsx(tc,{ajv:dn,cells:Gc,renderers:Vc,data:d,readonly:r||a,additionalErrors:C,onChange:({data:T})=>{p(T)},middleware:S,schema:f,validationMode:"NoValidation"}),!s&&ee.jsx(Ks,{type:"submit",variant:"default",className:"mt-4 self-end",disabled:r||a,children:l??"Submit"})]})})};Ey.displayName="ElementForm",xt.AccountForm=$y,xt.ElementForm=Ey,xt.QuoteForm=Ay,Object.defineProperty(xt,Symbol.toStringTag,{value:"Module"})});
76
76
  //# sourceMappingURL=index.umd.js.map