@techlabi/kycrazy-ui-kit 0.20.0 → 0.22.0

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
@@ -1,24 +1,24 @@
1
- (function(l,S){typeof exports=="object"&&typeof module<"u"?module.exports=S(require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","react-dom"],S):(l=typeof globalThis<"u"?globalThis:l||self,l.KycrazyUIKit=S(l.jsxRuntime,l.React,l.ReactDOM))})(this,function(l,S,Ge){"use strict";var Ah=l=>{throw TypeError(l)};var tl=(l,S,Ge)=>S.has(l)||Ah("Cannot "+Ge);var _=(l,S,Ge)=>(tl(l,S,"read from private field"),Ge?Ge.call(l):S.get(l)),ee=(l,S,Ge)=>S.has(l)?Ah("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(l):S.set(l,Ge),K=(l,S,Ge,Jr)=>(tl(l,S,"write to private field"),Jr?Jr.call(l,Ge):S.set(l,Ge),Ge),ce=(l,S,Ge)=>(tl(l,S,"access private method"),Ge);var ea=(l,S,Ge,Jr)=>({set _(m){K(l,S,m,Ge)},get _(){return _(l,S,Jr)}});var hn,Br,Zn,wh,Kn,Wr,Qn,xh,pn,_h,Gn,Xn,Nt,mn,Xe,Us,vn,Lt,br,Ch,Gt,Sh,Xt,at,gn,Jt,Xr,kh,ur,Vt,Hs,Nh,$e,jr,Ur,Jn,Rn,Hr,es,ts,Eh,mt,ge,zs,it,yn,rs,fr,zr,Ys,ns,ss,bn,wn,Yr,os,Ne,qs,rl,nl,sl,ol,al,il,ll,Dh,Ph,qr,Zr,vt,hr,pr,ta,cl,Th;function Jr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=Jr(S),is=Jr(Ge),Ih=1,Fh=1e6;let ra=0;function Lh(){return ra=(ra+1)%Number.MAX_SAFE_INTEGER,ra.toString()}const na=new Map,dl=e=>{if(na.has(e))return;const t=setTimeout(()=>{na.delete(e),ls({type:"REMOVE_TOAST",toastId:e})},Fh);na.set(e,t)},Vh=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Ih)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?dl(r):e.toasts.forEach(n=>{dl(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Zs=[];let Ks={toasts:[]};function ls(e){Ks=Vh(Ks,e),Zs.forEach(t=>{t(Ks)})}function $h({...e}){const t=Lh(),r=s=>ls({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>ls({type:"DISMISS_TOAST",toastId:t});return ls({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Qs(){const[e,t]=m.useState(Ks);return m.useEffect(()=>(Zs.push(t),()=>{const r=Zs.indexOf(t);r>-1&&Zs.splice(r,1)}),[e]),{...e,toast:$h,dismiss:r=>ls({type:"DISMISS_TOAST",toastId:r})}}function ie(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function ul(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fl(...e){return t=>{let r=!1;const n=e.map(s=>{const o=ul(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ul(e[s],null)}}}}function Ie(...e){return m.useCallback(fl(...e),e)}function Rr(e,t=[]){let r=[];function n(o,a){const i=m.createContext(a),c=r.length;r=[...r,a];const d=h=>{var x;const{scope:v,children:f,...b}=h,p=((x=v==null?void 0:v[e])==null?void 0:x[c])||i,g=m.useMemo(()=>b,Object.values(b));return l.jsx(p.Provider,{value:g,children:f})};d.displayName=o+"Provider";function u(h,v){var p;const f=((p=v==null?void 0:v[e])==null?void 0:p[c])||i,b=m.useContext(f);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[d,u]}const s=()=>{const o=r.map(a=>m.createContext(a));return function(i){const c=(i==null?void 0:i[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return s.scopeName=e,[n,Bh(s,...t)]}function Bh(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=n.reduce((i,{useScope:c,scopeName:d})=>{const h=c(o)[`__scope${d}`];return{...i,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Cn(e){const t=Wh(e),r=m.forwardRef((n,s)=>{const{children:o,...a}=n,i=m.Children.toArray(o),c=i.find(Uh);if(c){const d=c.props.children,u=i.map(h=>h===c?m.Children.count(d)>1?m.Children.only(null):m.isValidElement(d)?d.props.children:null:h);return l.jsx(t,{...a,ref:s,children:m.isValidElement(d)?m.cloneElement(d,void 0,u):null})}return l.jsx(t,{...a,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var hl=Cn("Slot");function Wh(e){const t=m.forwardRef((r,n)=>{const{children:s,...o}=r;if(m.isValidElement(s)){const a=zh(s),i=Hh(o,s.props);return s.type!==m.Fragment&&(i.ref=n?fl(n,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pl=Symbol("radix.slottable");function jh(e){const t=({children:r})=>l.jsx(l.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=pl,t}function Uh(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pl}function Hh(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const c=o(...i);return s(...i),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function zh(e){var n,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ml(e){const t=e+"CollectionProvider",[r,n]=Rr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:g,children:x}=p,y=S.useRef(null),w=S.useRef(new Map).current;return l.jsx(s,{scope:g,itemMap:w,collectionRef:y,children:x})};a.displayName=t;const i=e+"CollectionSlot",c=Cn(i),d=S.forwardRef((p,g)=>{const{scope:x,children:y}=p,w=o(i,x),k=Ie(g,w.collectionRef);return l.jsx(c,{ref:k,children:y})});d.displayName=i;const u=e+"CollectionItemSlot",h="data-radix-collection-item",v=Cn(u),f=S.forwardRef((p,g)=>{const{scope:x,children:y,...w}=p,k=S.useRef(null),N=Ie(g,k),M=o(u,x);return S.useEffect(()=>(M.itemMap.set(k,{ref:k,...w}),()=>void M.itemMap.delete(k))),l.jsx(v,{[h]:"",ref:N,children:y})});f.displayName=u;function b(p){const g=o(e+"CollectionConsumer",p);return S.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((M,P)=>w.indexOf(M.ref.current)-w.indexOf(P.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:d,ItemSlot:f},b,n]}var Yh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=Yh.reduce((e,t)=>{const r=Cn(`Primitive.${t}`),n=m.forwardRef((s,o)=>{const{asChild:a,...i}=s,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vl(e,t){e&&is.flushSync(()=>e.dispatchEvent(t))}function Et(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function qh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e);m.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Zh="DismissableLayer",sa="dismissableLayer.update",Kh="dismissableLayer.pointerDownOutside",Qh="dismissableLayer.focusOutside",gl,yl=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cs=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:i,...c}=e,d=m.useContext(yl),[u,h]=m.useState(null),v=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=m.useState({}),b=Ie(t,P=>h(P)),p=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(g),y=u?p.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=y>=x,N=Xh(P=>{const F=P.target,$=[...d.branches].some(z=>z.contains(F));!k||$||(s==null||s(P),a==null||a(P),P.defaultPrevented||i==null||i())},v),M=Jh(P=>{const F=P.target;[...d.branches].some(z=>z.contains(F))||(o==null||o(P),a==null||a(P),P.defaultPrevented||i==null||i())},v);return qh(P=>{y===d.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&i&&(P.preventDefault(),i()))},v),m.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(gl=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),wl(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=gl)}},[u,v,r,d]),m.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),wl())},[u,d]),m.useEffect(()=>{const P=()=>f({});return document.addEventListener(sa,P),()=>document.removeEventListener(sa,P)},[]),l.jsx(we.div,{...c,ref:b,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,N.onPointerDownCapture)})});cs.displayName=Zh;var Gh="DismissableLayerBranch",bl=m.forwardRef((e,t)=>{const r=m.useContext(yl),n=m.useRef(null),s=Ie(t,n);return m.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(we.div,{...e,ref:s})});bl.displayName=Gh;function Xh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=i=>{if(i.target&&!n.current){let c=function(){xl(Kh,r,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Jh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!n.current&&xl(Qh,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function wl(){const e=new CustomEvent(sa);document.dispatchEvent(e)}function xl(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vl(s,o):s.dispatchEvent(o)}var Rh=cs,ep=bl,Re=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},tp="Portal",Gs=m.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[s,o]=m.useState(!1);Re(()=>o(!0),[]);const a=r||s&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?Ge.createPortal(l.jsx(we.div,{...n,ref:t}),a):null});Gs.displayName=tp;function rp(e,t){return m.useReducer((r,n)=>t[r][n]??r,e)}var ds=e=>{const{present:t,children:r}=e,n=np(t),s=typeof r=="function"?r({present:n.isPresent}):m.Children.only(r),o=Ie(n.ref,sp(s));return typeof r=="function"||n.isPresent?m.cloneElement(s,{ref:o}):null};ds.displayName="Presence";function np(e){const[t,r]=m.useState(),n=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),a=e?"mounted":"unmounted",[i,c]=rp(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=Xs(n.current);o.current=i==="mounted"?d:"none"},[i]),Re(()=>{const d=n.current,u=s.current;if(u!==e){const v=o.current,f=Xs(d);e?c("MOUNT"):f==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&v!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Re(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=f=>{const p=Xs(n.current).includes(f.animationName);if(f.target===t&&p&&(c("ANIMATION_END"),!s.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},v=f=>{f.target===t&&(o.current=Xs(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:m.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Xs(e){return(e==null?void 0:e.animationName)||"none"}function sp(e){var n,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var op=m[" useInsertionEffect ".trim().toString()]||Re;function Js({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,a]=ap({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:s;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const h=u.current;h!==i&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,n])}const d=m.useCallback(u=>{var h;if(i){const v=ip(u)?u(e):u;v!==e&&((h=a.current)==null||h.call(a,v))}else o(u)},[i,e,o,a]);return[c,d]}function ap({defaultProp:e,onChange:t}){const[r,n]=m.useState(e),s=m.useRef(r),o=m.useRef(t);return op(()=>{o.current=t},[t]),m.useEffect(()=>{var a;s.current!==r&&((a=o.current)==null||a.call(o,r),s.current=r)},[r,s]),[r,n,o]}function ip(e){return typeof e=="function"}var _l=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),lp="VisuallyHidden",Rs=m.forwardRef((e,t)=>l.jsx(we.span,{...e,ref:t,style:{..._l,...e.style}}));Rs.displayName=lp;var cp=Rs,oa="ToastProvider",[aa,dp,up]=ml("Toast"),[Cl,_C]=Rr("Toast",[up]),[fp,eo]=Cl(oa),Sl=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[i,c]=m.useState(null),[d,u]=m.useState(0),h=m.useRef(!1),v=m.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${oa}\`. Expected non-empty \`string\`.`),l.jsx(aa.Provider,{scope:t,children:l.jsx(fp,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:d,viewport:i,onViewportChange:c,onToastAdd:m.useCallback(()=>u(f=>f+1),[]),onToastRemove:m.useCallback(()=>u(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:a})})};Sl.displayName=oa;var kl="ToastViewport",hp=["F8"],ia="toast.viewportPause",la="toast.viewportResume",Nl=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=hp,label:s="Notifications ({hotkey})",...o}=e,a=eo(kl,r),i=dp(r),c=m.useRef(null),d=m.useRef(null),u=m.useRef(null),h=m.useRef(null),v=Ie(t,h,a.onViewportChange),f=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;m.useEffect(()=>{const g=x=>{var w;n.length!==0&&n.every(k=>x[k]||x.code===k)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),m.useEffect(()=>{const g=c.current,x=h.current;if(b&&g&&x){const y=()=>{if(!a.isClosePausedRef.current){const M=new CustomEvent(ia);x.dispatchEvent(M),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const M=new CustomEvent(la);x.dispatchEvent(M),a.isClosePausedRef.current=!1}},k=M=>{!g.contains(M.relatedTarget)&&w()},N=()=>{g.contains(document.activeElement)||w()};return g.addEventListener("focusin",y),g.addEventListener("focusout",k),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",N),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",k),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",N),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[b,a.isClosePausedRef]);const p=m.useCallback(({tabbingDirection:g})=>{const y=i().map(w=>{const k=w.ref.current,N=[k,...Np(k)];return g==="forwards"?N:N.reverse()});return(g==="forwards"?y.reverse():y).flat()},[i]);return m.useEffect(()=>{const g=h.current;if(g){const x=y=>{var N,M,P;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const F=document.activeElement,$=y.shiftKey;if(y.target===g&&$){(N=d.current)==null||N.focus();return}const A=p({tabbingDirection:$?"backwards":"forwards"}),j=A.findIndex(I=>I===F);ua(A.slice(j+1))?y.preventDefault():$?(M=d.current)==null||M.focus():(P=u.current)==null||P.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[i,p]),l.jsxs(ep,{ref:c,role:"region","aria-label":s.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&l.jsx(ca,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});ua(g)}}),l.jsx(aa.Slot,{scope:r,children:l.jsx(we.ol,{tabIndex:-1,...o,ref:v})}),b&&l.jsx(ca,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});ua(g)}})]})});Nl.displayName=kl;var El="ToastFocusProxy",ca=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=eo(El,r);return l.jsx(Rs,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const i=a.relatedTarget;!((d=o.viewport)!=null&&d.contains(i))&&n()}})});ca.displayName=El;var us="Toast",pp="toast.swipeStart",mp="toast.swipeMove",vp="toast.swipeCancel",gp="toast.swipeEnd",Pl=m.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...a}=e,[i,c]=Js({prop:n,defaultProp:s??!0,onChange:o,caller:us});return l.jsx(ds,{present:r||i,children:l.jsx(wp,{open:i,...a,ref:t,onClose:()=>c(!1),onPause:Et(e.onPause),onResume:Et(e.onResume),onSwipeStart:ie(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ie(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});Pl.displayName=us;var[yp,bp]=Cl(us,{onClose(){}}),wp=m.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:i,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:f,...b}=e,p=eo(us,r),[g,x]=m.useState(null),y=Ie(t,I=>x(I)),w=m.useRef(null),k=m.useRef(null),N=s||p.duration,M=m.useRef(0),P=m.useRef(N),F=m.useRef(0),{onToastAdd:$,onToastRemove:z}=p,X=Et(()=>{var J;(g==null?void 0:g.contains(document.activeElement))&&((J=p.viewport)==null||J.focus()),a()}),A=m.useCallback(I=>{!I||I===1/0||(window.clearTimeout(F.current),M.current=new Date().getTime(),F.current=window.setTimeout(X,I))},[X]);m.useEffect(()=>{const I=p.viewport;if(I){const J=()=>{A(P.current),d==null||d()},Y=()=>{const D=new Date().getTime()-M.current;P.current=P.current-D,window.clearTimeout(F.current),c==null||c()};return I.addEventListener(ia,Y),I.addEventListener(la,J),()=>{I.removeEventListener(ia,Y),I.removeEventListener(la,J)}}},[p.viewport,N,c,d,A]),m.useEffect(()=>{o&&!p.isClosePausedRef.current&&A(N)},[o,N,p.isClosePausedRef,A]),m.useEffect(()=>($(),()=>z()),[$,z]);const j=m.useMemo(()=>g?Fl(g):null,[g]);return p.viewport?l.jsxs(l.Fragment,{children:[j&&l.jsx(xp,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:j}),l.jsx(yp,{scope:r,onClose:X,children:is.createPortal(l.jsx(aa.ItemSlot,{scope:r,children:l.jsx(Rh,{asChild:!0,onEscapeKeyDown:ie(i,()=>{p.isFocusedToastEscapeKeyDownRef.current||X(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,I=>{I.key==="Escape"&&(i==null||i(I.nativeEvent),I.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,X()))}),onPointerDown:ie(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:ie(e.onPointerMove,I=>{if(!w.current)return;const J=I.clientX-w.current.x,Y=I.clientY-w.current.y,D=!!k.current,O=["left","right"].includes(p.swipeDirection),B=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ae=O?B(0,J):0,Se=O?0:B(0,Y),de=I.pointerType==="touch"?10:2,ue={x:ae,y:Se},pe={originalEvent:I,delta:ue};D?(k.current=ue,to(mp,h,pe,{discrete:!1})):Ll(ue,p.swipeDirection,de)?(k.current=ue,to(pp,u,pe,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(J)>de||Math.abs(Y)>de)&&(w.current=null)}),onPointerUp:ie(e.onPointerUp,I=>{const J=k.current,Y=I.target;if(Y.hasPointerCapture(I.pointerId)&&Y.releasePointerCapture(I.pointerId),k.current=null,w.current=null,J){const D=I.currentTarget,O={originalEvent:I,delta:J};Ll(J,p.swipeDirection,p.swipeThreshold)?to(gp,f,O,{discrete:!0}):to(vp,v,O,{discrete:!0}),D.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),xp=e=>{const{__scopeToast:t,children:r,...n}=e,s=eo(us,t),[o,a]=m.useState(!1),[i,c]=m.useState(!1);return Sp(()=>a(!0)),m.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),i?null:l.jsx(Gs,{asChild:!0,children:l.jsx(Rs,{...n,children:o&&l.jsxs(l.Fragment,{children:[s.label," ",r]})})})},_p="ToastTitle",Tl=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Tl.displayName=_p;var Cp="ToastDescription",Ol=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Ol.displayName=Cp;var Ml="ToastAction",Al=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?l.jsx(Il,{altText:r,asChild:!0,children:l.jsx(da,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ml}\`. Expected non-empty \`string\`.`),null)});Al.displayName=Ml;var Dl="ToastClose",da=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=bp(Dl,r);return l.jsx(Il,{asChild:!0,children:l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,s.onClose)})})});da.displayName=Dl;var Il=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return l.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function Fl(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),kp(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Fl(n))}}),t}function to(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vl(s,o):s.dispatchEvent(o)}var Ll=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Sp(e=()=>{}){const t=Et(e);Re(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function kp(e){return e.nodeType===e.ELEMENT_NODE}function Np(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ua(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Ep=Sl,Vl=Nl,$l=Pl,Bl=Tl,Wl=Ol,jl=Al,Ul=da;function Hl(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Hl(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function zl(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Hl(e))&&(n&&(n+=" "),n+=t);return n}const Yl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ql=zl,fa=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ql(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],h=o==null?void 0:o[d];if(u===null)return null;const v=Yl(u)||Yl(h);return s[d][v]}),i=r&&Object.entries(r).reduce((d,u)=>{let[h,v]=u;return v===void 0||(d[h]=v),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:h,className:v,...f}=u;return Object.entries(f).every(b=>{let[p,g]=b;return Array.isArray(g)?g.includes({...o,...i}[p]):{...o,...i}[p]===g})?[...d,h,v]:d},[]);return ql(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
1
+ (function(l,S){typeof exports=="object"&&typeof module<"u"?module.exports=S(require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","react-dom"],S):(l=typeof globalThis<"u"?globalThis:l||self,l.KycrazyUIKit=S(l.jsxRuntime,l.React,l.ReactDOM))})(this,function(l,S,Ge){"use strict";var Fh=l=>{throw TypeError(l)};var tl=(l,S,Ge)=>S.has(l)||Fh("Cannot "+Ge);var _=(l,S,Ge)=>(tl(l,S,"read from private field"),Ge?Ge.call(l):S.get(l)),ee=(l,S,Ge)=>S.has(l)?Fh("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(l):S.set(l,Ge),Q=(l,S,Ge,Jr)=>(tl(l,S,"write to private field"),Jr?Jr.call(l,Ge):S.set(l,Ge),Ge),ce=(l,S,Ge)=>(tl(l,S,"access private method"),Ge);var ra=(l,S,Ge,Jr)=>({set _(m){Q(l,S,m,Ge)},get _(){return _(l,S,Jr)}});var hn,Br,Qn,Ch,Gn,Wr,Xn,Sh,pn,kh,Jn,Rn,Nt,mn,Xe,zs,vn,Lt,br,Nh,Gt,Eh,Xt,lt,gn,Jt,Xr,Ph,ur,Vt,Ys,Th,$e,jr,Ur,es,ts,Hr,rs,ns,Oh,mt,ge,qs,ct,yn,ss,fr,zr,Zs,os,as,bn,wn,Yr,is,Ne,Ks,rl,nl,sl,ol,al,il,ll,Lh,Mh,qr,Zr,vt,hr,pr,na,cl,Ah;function Jr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=Jr(S),cs=Jr(Ge),Vh=1,$h=1e6;let sa=0;function Bh(){return sa=(sa+1)%Number.MAX_SAFE_INTEGER,sa.toString()}const oa=new Map,dl=e=>{if(oa.has(e))return;const t=setTimeout(()=>{oa.delete(e),ds({type:"REMOVE_TOAST",toastId:e})},$h);oa.set(e,t)},Wh=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Vh)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?dl(r):e.toasts.forEach(n=>{dl(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Qs=[];let Gs={toasts:[]};function ds(e){Gs=Wh(Gs,e),Qs.forEach(t=>{t(Gs)})}function jh({...e}){const t=Bh(),r=s=>ds({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>ds({type:"DISMISS_TOAST",toastId:t});return ds({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Xs(){const[e,t]=m.useState(Gs);return m.useEffect(()=>(Qs.push(t),()=>{const r=Qs.indexOf(t);r>-1&&Qs.splice(r,1)}),[e]),{...e,toast:jh,dismiss:r=>ds({type:"DISMISS_TOAST",toastId:r})}}function ie(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function ul(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fl(...e){return t=>{let r=!1;const n=e.map(s=>{const o=ul(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ul(e[s],null)}}}}function Ie(...e){return m.useCallback(fl(...e),e)}function Rr(e,t=[]){let r=[];function n(o,a){const i=m.createContext(a),c=r.length;r=[...r,a];const d=h=>{var x;const{scope:v,children:f,...b}=h,p=((x=v==null?void 0:v[e])==null?void 0:x[c])||i,g=m.useMemo(()=>b,Object.values(b));return l.jsx(p.Provider,{value:g,children:f})};d.displayName=o+"Provider";function u(h,v){var p;const f=((p=v==null?void 0:v[e])==null?void 0:p[c])||i,b=m.useContext(f);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[d,u]}const s=()=>{const o=r.map(a=>m.createContext(a));return function(i){const c=(i==null?void 0:i[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return s.scopeName=e,[n,Uh(s,...t)]}function Uh(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=n.reduce((i,{useScope:c,scopeName:d})=>{const h=c(o)[`__scope${d}`];return{...i,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Cn(e){const t=Hh(e),r=m.forwardRef((n,s)=>{const{children:o,...a}=n,i=m.Children.toArray(o),c=i.find(Yh);if(c){const d=c.props.children,u=i.map(h=>h===c?m.Children.count(d)>1?m.Children.only(null):m.isValidElement(d)?d.props.children:null:h);return l.jsx(t,{...a,ref:s,children:m.isValidElement(d)?m.cloneElement(d,void 0,u):null})}return l.jsx(t,{...a,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var hl=Cn("Slot");function Hh(e){const t=m.forwardRef((r,n)=>{const{children:s,...o}=r;if(m.isValidElement(s)){const a=Zh(s),i=qh(o,s.props);return s.type!==m.Fragment&&(i.ref=n?fl(n,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pl=Symbol("radix.slottable");function zh(e){const t=({children:r})=>l.jsx(l.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=pl,t}function Yh(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pl}function qh(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const c=o(...i);return s(...i),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function Zh(e){var n,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ml(e){const t=e+"CollectionProvider",[r,n]=Rr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:g,children:x}=p,y=S.useRef(null),w=S.useRef(new Map).current;return l.jsx(s,{scope:g,itemMap:w,collectionRef:y,children:x})};a.displayName=t;const i=e+"CollectionSlot",c=Cn(i),d=S.forwardRef((p,g)=>{const{scope:x,children:y}=p,w=o(i,x),k=Ie(g,w.collectionRef);return l.jsx(c,{ref:k,children:y})});d.displayName=i;const u=e+"CollectionItemSlot",h="data-radix-collection-item",v=Cn(u),f=S.forwardRef((p,g)=>{const{scope:x,children:y,...w}=p,k=S.useRef(null),N=Ie(g,k),O=o(u,x);return S.useEffect(()=>(O.itemMap.set(k,{ref:k,...w}),()=>void O.itemMap.delete(k))),l.jsx(v,{[h]:"",ref:N,children:y})});f.displayName=u;function b(p){const g=o(e+"CollectionConsumer",p);return S.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((O,A)=>w.indexOf(O.ref.current)-w.indexOf(A.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:d,ItemSlot:f},b,n]}var Kh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=Kh.reduce((e,t)=>{const r=Cn(`Primitive.${t}`),n=m.forwardRef((s,o)=>{const{asChild:a,...i}=s,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vl(e,t){e&&cs.flushSync(()=>e.dispatchEvent(t))}function Et(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Qh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e);m.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Gh="DismissableLayer",aa="dismissableLayer.update",Xh="dismissableLayer.pointerDownOutside",Jh="dismissableLayer.focusOutside",gl,yl=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),us=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:i,...c}=e,d=m.useContext(yl),[u,h]=m.useState(null),v=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=m.useState({}),b=Ie(t,A=>h(A)),p=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(g),y=u?p.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=y>=x,N=ep(A=>{const V=A.target,L=[...d.branches].some(U=>U.contains(V));!k||L||(s==null||s(A),a==null||a(A),A.defaultPrevented||i==null||i())},v),O=tp(A=>{const V=A.target;[...d.branches].some(U=>U.contains(V))||(o==null||o(A),a==null||a(A),A.defaultPrevented||i==null||i())},v);return Qh(A=>{y===d.layers.size-1&&(n==null||n(A),!A.defaultPrevented&&i&&(A.preventDefault(),i()))},v),m.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(gl=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),wl(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=gl)}},[u,v,r,d]),m.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),wl())},[u,d]),m.useEffect(()=>{const A=()=>f({});return document.addEventListener(aa,A),()=>document.removeEventListener(aa,A)},[]),l.jsx(we.div,{...c,ref:b,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,O.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,N.onPointerDownCapture)})});us.displayName=Gh;var Rh="DismissableLayerBranch",bl=m.forwardRef((e,t)=>{const r=m.useContext(yl),n=m.useRef(null),s=Ie(t,n);return m.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(we.div,{...e,ref:s})});bl.displayName=Rh;function ep(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=i=>{if(i.target&&!n.current){let c=function(){xl(Xh,r,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function tp(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!n.current&&xl(Jh,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function wl(){const e=new CustomEvent(aa);document.dispatchEvent(e)}function xl(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vl(s,o):s.dispatchEvent(o)}var rp=us,np=bl,Re=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},sp="Portal",Js=m.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[s,o]=m.useState(!1);Re(()=>o(!0),[]);const a=r||s&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?Ge.createPortal(l.jsx(we.div,{...n,ref:t}),a):null});Js.displayName=sp;function op(e,t){return m.useReducer((r,n)=>t[r][n]??r,e)}var fs=e=>{const{present:t,children:r}=e,n=ap(t),s=typeof r=="function"?r({present:n.isPresent}):m.Children.only(r),o=Ie(n.ref,ip(s));return typeof r=="function"||n.isPresent?m.cloneElement(s,{ref:o}):null};fs.displayName="Presence";function ap(e){const[t,r]=m.useState(),n=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),a=e?"mounted":"unmounted",[i,c]=op(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=Rs(n.current);o.current=i==="mounted"?d:"none"},[i]),Re(()=>{const d=n.current,u=s.current;if(u!==e){const v=o.current,f=Rs(d);e?c("MOUNT"):f==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&v!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Re(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=f=>{const p=Rs(n.current).includes(f.animationName);if(f.target===t&&p&&(c("ANIMATION_END"),!s.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},v=f=>{f.target===t&&(o.current=Rs(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:m.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Rs(e){return(e==null?void 0:e.animationName)||"none"}function ip(e){var n,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lp=m[" useInsertionEffect ".trim().toString()]||Re;function eo({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,a]=cp({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:s;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const h=u.current;h!==i&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,n])}const d=m.useCallback(u=>{var h;if(i){const v=dp(u)?u(e):u;v!==e&&((h=a.current)==null||h.call(a,v))}else o(u)},[i,e,o,a]);return[c,d]}function cp({defaultProp:e,onChange:t}){const[r,n]=m.useState(e),s=m.useRef(r),o=m.useRef(t);return lp(()=>{o.current=t},[t]),m.useEffect(()=>{var a;s.current!==r&&((a=o.current)==null||a.call(o,r),s.current=r)},[r,s]),[r,n,o]}function dp(e){return typeof e=="function"}var _l=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),up="VisuallyHidden",to=m.forwardRef((e,t)=>l.jsx(we.span,{...e,ref:t,style:{..._l,...e.style}}));to.displayName=up;var fp=to,ia="ToastProvider",[la,hp,pp]=ml("Toast"),[Cl,CC]=Rr("Toast",[pp]),[mp,ro]=Cl(ia),Sl=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[i,c]=m.useState(null),[d,u]=m.useState(0),h=m.useRef(!1),v=m.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${ia}\`. Expected non-empty \`string\`.`),l.jsx(la.Provider,{scope:t,children:l.jsx(mp,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:d,viewport:i,onViewportChange:c,onToastAdd:m.useCallback(()=>u(f=>f+1),[]),onToastRemove:m.useCallback(()=>u(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:a})})};Sl.displayName=ia;var kl="ToastViewport",vp=["F8"],ca="toast.viewportPause",da="toast.viewportResume",Nl=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=vp,label:s="Notifications ({hotkey})",...o}=e,a=ro(kl,r),i=hp(r),c=m.useRef(null),d=m.useRef(null),u=m.useRef(null),h=m.useRef(null),v=Ie(t,h,a.onViewportChange),f=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;m.useEffect(()=>{const g=x=>{var w;n.length!==0&&n.every(k=>x[k]||x.code===k)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),m.useEffect(()=>{const g=c.current,x=h.current;if(b&&g&&x){const y=()=>{if(!a.isClosePausedRef.current){const O=new CustomEvent(ca);x.dispatchEvent(O),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const O=new CustomEvent(da);x.dispatchEvent(O),a.isClosePausedRef.current=!1}},k=O=>{!g.contains(O.relatedTarget)&&w()},N=()=>{g.contains(document.activeElement)||w()};return g.addEventListener("focusin",y),g.addEventListener("focusout",k),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",N),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",k),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",N),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[b,a.isClosePausedRef]);const p=m.useCallback(({tabbingDirection:g})=>{const y=i().map(w=>{const k=w.ref.current,N=[k,...Tp(k)];return g==="forwards"?N:N.reverse()});return(g==="forwards"?y.reverse():y).flat()},[i]);return m.useEffect(()=>{const g=h.current;if(g){const x=y=>{var N,O,A;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const V=document.activeElement,L=y.shiftKey;if(y.target===g&&L){(N=d.current)==null||N.focus();return}const P=p({tabbingDirection:L?"backwards":"forwards"}),H=P.findIndex(I=>I===V);ha(P.slice(H+1))?y.preventDefault():L?(O=d.current)==null||O.focus():(A=u.current)==null||A.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[i,p]),l.jsxs(np,{ref:c,role:"region","aria-label":s.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&l.jsx(ua,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});ha(g)}}),l.jsx(la.Slot,{scope:r,children:l.jsx(we.ol,{tabIndex:-1,...o,ref:v})}),b&&l.jsx(ua,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});ha(g)}})]})});Nl.displayName=kl;var El="ToastFocusProxy",ua=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=ro(El,r);return l.jsx(to,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const i=a.relatedTarget;!((d=o.viewport)!=null&&d.contains(i))&&n()}})});ua.displayName=El;var hs="Toast",gp="toast.swipeStart",yp="toast.swipeMove",bp="toast.swipeCancel",wp="toast.swipeEnd",Pl=m.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...a}=e,[i,c]=eo({prop:n,defaultProp:s??!0,onChange:o,caller:hs});return l.jsx(fs,{present:r||i,children:l.jsx(Cp,{open:i,...a,ref:t,onClose:()=>c(!1),onPause:Et(e.onPause),onResume:Et(e.onResume),onSwipeStart:ie(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ie(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});Pl.displayName=hs;var[xp,_p]=Cl(hs,{onClose(){}}),Cp=m.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:i,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:f,...b}=e,p=ro(hs,r),[g,x]=m.useState(null),y=Ie(t,I=>x(I)),w=m.useRef(null),k=m.useRef(null),N=s||p.duration,O=m.useRef(0),A=m.useRef(N),V=m.useRef(0),{onToastAdd:L,onToastRemove:U}=p,F=Et(()=>{var J;(g==null?void 0:g.contains(document.activeElement))&&((J=p.viewport)==null||J.focus()),a()}),P=m.useCallback(I=>{!I||I===1/0||(window.clearTimeout(V.current),O.current=new Date().getTime(),V.current=window.setTimeout(F,I))},[F]);m.useEffect(()=>{const I=p.viewport;if(I){const J=()=>{P(A.current),d==null||d()},q=()=>{const D=new Date().getTime()-O.current;A.current=A.current-D,window.clearTimeout(V.current),c==null||c()};return I.addEventListener(ca,q),I.addEventListener(da,J),()=>{I.removeEventListener(ca,q),I.removeEventListener(da,J)}}},[p.viewport,N,c,d,P]),m.useEffect(()=>{o&&!p.isClosePausedRef.current&&P(N)},[o,N,p.isClosePausedRef,P]),m.useEffect(()=>(L(),()=>U()),[L,U]);const H=m.useMemo(()=>g?Fl(g):null,[g]);return p.viewport?l.jsxs(l.Fragment,{children:[H&&l.jsx(Sp,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:H}),l.jsx(xp,{scope:r,onClose:F,children:cs.createPortal(l.jsx(la.ItemSlot,{scope:r,children:l.jsx(rp,{asChild:!0,onEscapeKeyDown:ie(i,()=>{p.isFocusedToastEscapeKeyDownRef.current||F(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,I=>{I.key==="Escape"&&(i==null||i(I.nativeEvent),I.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:ie(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:ie(e.onPointerMove,I=>{if(!w.current)return;const J=I.clientX-w.current.x,q=I.clientY-w.current.y,D=!!k.current,M=["left","right"].includes(p.swipeDirection),W=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ae=M?W(0,J):0,Se=M?0:W(0,q),de=I.pointerType==="touch"?10:2,ue={x:ae,y:Se},pe={originalEvent:I,delta:ue};D?(k.current=ue,no(yp,h,pe,{discrete:!1})):Ll(ue,p.swipeDirection,de)?(k.current=ue,no(gp,u,pe,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(J)>de||Math.abs(q)>de)&&(w.current=null)}),onPointerUp:ie(e.onPointerUp,I=>{const J=k.current,q=I.target;if(q.hasPointerCapture(I.pointerId)&&q.releasePointerCapture(I.pointerId),k.current=null,w.current=null,J){const D=I.currentTarget,M={originalEvent:I,delta:J};Ll(J,p.swipeDirection,p.swipeThreshold)?no(wp,f,M,{discrete:!0}):no(bp,v,M,{discrete:!0}),D.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Sp=e=>{const{__scopeToast:t,children:r,...n}=e,s=ro(hs,t),[o,a]=m.useState(!1),[i,c]=m.useState(!1);return Ep(()=>a(!0)),m.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),i?null:l.jsx(Js,{asChild:!0,children:l.jsx(to,{...n,children:o&&l.jsxs(l.Fragment,{children:[s.label," ",r]})})})},kp="ToastTitle",Tl=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Tl.displayName=kp;var Np="ToastDescription",Ol=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Ol.displayName=Np;var Ml="ToastAction",Al=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?l.jsx(Il,{altText:r,asChild:!0,children:l.jsx(fa,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ml}\`. Expected non-empty \`string\`.`),null)});Al.displayName=Ml;var Dl="ToastClose",fa=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=_p(Dl,r);return l.jsx(Il,{asChild:!0,children:l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,s.onClose)})})});fa.displayName=Dl;var Il=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return l.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function Fl(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Pp(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Fl(n))}}),t}function no(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vl(s,o):s.dispatchEvent(o)}var Ll=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Ep(e=()=>{}){const t=Et(e);Re(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Pp(e){return e.nodeType===e.ELEMENT_NODE}function Tp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ha(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Op=Sl,Vl=Nl,$l=Pl,Bl=Tl,Wl=Ol,jl=Al,Ul=fa;function Hl(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Hl(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function zl(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Hl(e))&&(n&&(n+=" "),n+=t);return n}const Yl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ql=zl,pa=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ql(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],h=o==null?void 0:o[d];if(u===null)return null;const v=Yl(u)||Yl(h);return s[d][v]}),i=r&&Object.entries(r).reduce((d,u)=>{let[h,v]=u;return v===void 0||(d[h]=v),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:h,className:v,...f}=u;return Object.entries(f).every(b=>{let[p,g]=b;return Array.isArray(g)?g.includes({...o,...i}[p]):{...o,...i}[p]===g})?[...d,h,v]:d},[]);return ql(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
2
2
  * @license lucide-react v0.462.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Pp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zl=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
6
+ */const Mp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zl=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
7
7
  * @license lucide-react v0.462.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */var Tp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
11
+ */var Ap={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
12
  * @license lucide-react v0.462.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Op=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...i},c)=>S.createElement("svg",{ref:c,...Tp,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Zl("lucide",s),...i},[...a.map(([d,u])=>S.createElement(d,u)),...Array.isArray(o)?o:[o]]));/**
16
+ */const Dp=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...i},c)=>S.createElement("svg",{ref:c,...Ap,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Zl("lucide",s),...i},[...a.map(([d,u])=>S.createElement(d,u)),...Array.isArray(o)?o:[o]]));/**
17
17
  * @license lucide-react v0.462.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const tt=(e,t)=>{const r=S.forwardRef(({className:n,...s},o)=>S.createElement(Op,{ref:o,iconNode:t,className:Zl(`lucide-${Pp(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
21
+ */const tt=(e,t)=>{const r=S.forwardRef(({className:n,...s},o)=>S.createElement(Dp,{ref:o,iconNode:t,className:Zl(`lucide-${Mp(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
22
22
  * @license lucide-react v0.462.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
@@ -28,7 +28,7 @@
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
- */const Mp=tt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
31
+ */const Ip=tt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
32
32
  * @license lucide-react v0.462.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
@@ -38,73 +38,73 @@
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
- */const Ap=tt("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
41
+ */const Fp=tt("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
42
42
  * @license lucide-react v0.462.0 - ISC
43
43
  *
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
- */const Dp=tt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
46
+ */const Gl=tt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
47
47
  * @license lucide-react v0.462.0 - ISC
48
48
  *
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
- */const Gl=tt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
51
+ */const Xl=tt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
52
52
  * @license lucide-react v0.462.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const Ip=tt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
56
+ */const Lp=tt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
57
57
  * @license lucide-react v0.462.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const Fp=tt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
61
+ */const Vp=tt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
62
62
  * @license lucide-react v0.462.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const Lp=tt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
66
+ */const $p=tt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
67
67
  * @license lucide-react v0.462.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
- */const Xl=tt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
71
+ */const Jl=tt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
72
72
  * @license lucide-react v0.462.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
- */const Vp=tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
76
+ */const Bp=tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
77
77
  * @license lucide-react v0.462.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
- */const $p=tt("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
81
+ */const Wp=tt("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
82
82
  * @license lucide-react v0.462.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */const Bp=tt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
86
+ */const jp=tt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
87
87
  * @license lucide-react v0.462.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const Wp=tt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
91
+ */const Up=tt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
92
92
  * @license lucide-react v0.462.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const jp=tt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
96
+ */const Hp=tt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
97
97
  * @license lucide-react v0.462.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const Jl=tt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ha="-",Up=e=>{const t=zp(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(ha);return i[0]===""&&i.length!==1&&i.shift(),Rl(i,t)||Hp(a)},getConflictingClassGroupIds:(a,i)=>{const c=r[a]||[];return i&&n[a]?[...c,...n[a]]:c}}},Rl=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?Rl(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(ha);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},ec=/^\[(.+)\]$/,Hp=e=>{if(ec.test(e)){const t=ec.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},zp=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return qp(Object.entries(e.classGroups),r).forEach(([o,a])=>{pa(a,n,o,t)}),n},pa=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:tc(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(Yp(s)){pa(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{pa(a,tc(t,o),r,n)})})},tc=(e,t)=>{let r=e;return t.split(ha).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Yp=e=>e.isThemeGetter,qp=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,Zp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},rc="!",Kp=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const c=[];let d=0,u=0,h;for(let g=0;g<i.length;g++){let x=i[g];if(d===0){if(x===s&&(n||i.slice(g,g+o)===t)){c.push(i.slice(u,g)),u=g+o;continue}if(x==="/"){h=g;continue}}x==="["?d++:x==="]"&&d--}const v=c.length===0?i:i.substring(u),f=v.startsWith(rc),b=f?v.substring(1):v,p=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:b,maybePostfixModifierPosition:p}};return r?i=>r({className:i,parseClassName:a}):a},Qp=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Gp=e=>({cache:Zp(e.cacheSize),parseClassName:Kp(e),...Up(e)}),Xp=/\s+/,Jp=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(Xp);let i="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:f}=r(d);let b=!!f,p=n(b?v.substring(0,f):v);if(!p){if(!b){i=d+(i.length>0?" "+i:i);continue}if(p=n(v),!p){i=d+(i.length>0?" "+i:i);continue}b=!1}const g=Qp(u).join(":"),x=h?g+rc:g,y=x+p;if(o.includes(y))continue;o.push(y);const w=s(p,b);for(let k=0;k<w.length;++k){const N=w[k];o.push(x+N)}i=d+(i.length>0?" "+i:i)}return i};function Rp(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=nc(t))&&(n&&(n+=" "),n+=r);return n}const nc=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=nc(e[n]))&&(r&&(r+=" "),r+=t);return r};function em(e,...t){let r,n,s,o=a;function a(c){const d=t.reduce((u,h)=>h(u),e());return r=Gp(d),n=r.cache.get,s=r.cache.set,o=i,i(c)}function i(c){const d=n(c);if(d)return d;const u=Jp(c,r);return s(c,u),u}return function(){return o(Rp.apply(null,arguments))}}const De=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},sc=/^\[(?:([a-z-]+):)?(.+)\]$/i,tm=/^\d+\/\d+$/,rm=new Set(["px","full","screen"]),nm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,om=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,am=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,im=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>Sn(e)||rm.has(e)||tm.test(e),wr=e=>kn(e,"length",mm),Sn=e=>!!e&&!Number.isNaN(Number(e)),ma=e=>kn(e,"number",Sn),fs=e=>!!e&&Number.isInteger(Number(e)),lm=e=>e.endsWith("%")&&Sn(e.slice(0,-1)),le=e=>sc.test(e),xr=e=>nm.test(e),cm=new Set(["length","size","percentage"]),dm=e=>kn(e,cm,oc),um=e=>kn(e,"position",oc),fm=new Set(["image","url"]),hm=e=>kn(e,fm,gm),pm=e=>kn(e,"",vm),hs=()=>!0,kn=(e,t,r)=>{const n=sc.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},mm=e=>sm.test(e)&&!om.test(e),oc=()=>!1,vm=e=>am.test(e),gm=e=>im.test(e),ym=em(()=>{const e=De("colors"),t=De("spacing"),r=De("blur"),n=De("brightness"),s=De("borderColor"),o=De("borderRadius"),a=De("borderSpacing"),i=De("borderWidth"),c=De("contrast"),d=De("grayscale"),u=De("hueRotate"),h=De("invert"),v=De("gap"),f=De("gradientColorStops"),b=De("gradientColorStopPositions"),p=De("inset"),g=De("margin"),x=De("opacity"),y=De("padding"),w=De("saturate"),k=De("scale"),N=De("sepia"),M=De("skew"),P=De("space"),F=De("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",le,t],A=()=>[le,t],j=()=>["",nr,wr],I=()=>["auto",Sn,le],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",le],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Se=()=>[Sn,le];return{cacheSize:500,separator:":",theme:{colors:[hs],spacing:[nr,wr],blur:["none","",xr,le],brightness:Se(),borderColor:[e],borderRadius:["none","","full",xr,le],borderSpacing:A(),borderWidth:j(),contrast:Se(),grayscale:B(),hueRotate:Se(),invert:B(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[lm,wr],inset:X(),margin:X(),opacity:Se(),padding:A(),saturate:Se(),scale:Se(),sepia:B(),skew:Se(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[xr]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),le]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fs,le]}],basis:[{basis:X()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",fs,le]}],"grid-cols":[{"grid-cols":[hs]}],"col-start-end":[{col:["auto",{span:["full",fs,le]},le]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[hs]}],"row-start-end":[{row:["auto",{span:[fs,le]},le]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[xr]},xr]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xr,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ma]}],"font-family":[{font:[hs]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",le]}],"line-clamp":[{"line-clamp":["none",Sn,ma]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,wr]}],"underline-offset":[{"underline-offset":["auto",nr,le]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),um]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",dm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:Y()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[nr,le]}],"outline-w":[{outline:[nr,wr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[nr,wr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xr,pm]}],"shadow-color":[{shadow:[hs]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",xr,le]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",le]}],duration:[{duration:Se()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:Se()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[fs,le]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,wr,ma]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function he(...e){return ym(zl(e))}const bm=Ep,ac=m.forwardRef(({className:e,...t},r)=>l.jsx(Vl,{ref:r,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ac.displayName=Vl.displayName;const wm=fa("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ic=m.forwardRef(({className:e,variant:t,...r},n)=>l.jsx($l,{ref:n,className:he(wm({variant:t}),e),...r}));ic.displayName=$l.displayName;const xm=m.forwardRef(({className:e,...t},r)=>l.jsx(jl,{ref:r,className:he("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));xm.displayName=jl.displayName;const lc=m.forwardRef(({className:e,...t},r)=>l.jsx(Ul,{ref:r,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(Jl,{className:"h-4 w-4"})}));lc.displayName=Ul.displayName;const cc=m.forwardRef(({className:e,...t},r)=>l.jsx(Bl,{ref:r,className:he("text-sm font-semibold",e),...t}));cc.displayName=Bl.displayName;const dc=m.forwardRef(({className:e,...t},r)=>l.jsx(Wl,{ref:r,className:he("text-sm opacity-90",e),...t}));dc.displayName=Wl.displayName;function _m(){const{toasts:e}=Qs();return l.jsxs(bm,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return l.jsxs(ic,{...o,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(cc,{children:r}),n&&l.jsx(dc,{children:n})]}),s,l.jsx(lc,{})]},t)}),l.jsx(ac,{})]})}var uc=["light","dark"],Cm="(prefers-color-scheme: dark)",Sm=m.createContext(void 0),km={setTheme:e=>{},themes:[]},Nm=()=>{var e;return(e=m.useContext(Sm))!=null?e:km};m.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:a,attrs:i,nonce:c})=>{let d=o==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${i.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?uc.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",v=(b,p=!1,g=!0)=>{let x=a?a[b]:b,y=p?b+"|| ''":`'${x}'`,w="";return s&&g&&!p&&uc.includes(b)&&(w+=`d.style.colorScheme = '${b}';`),r==="class"?p||x?w+=`c.add(${y})`:w+="null":x&&(w+=`d[s](n,${y})`),w},f=e?`!function(){${u}${v(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${Cm}',m=window.matchMedia(t);if(m.media!==t||m.matches){${v("dark")}}else{${v("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}${d?"":"else{"+v(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}else{${v(o,!1,!1)};}${h}}catch(t){}}();`;return m.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var Em=e=>{switch(e){case"success":return Om;case"info":return Am;case"warning":return Mm;case"error":return Dm;default:return null}},Pm=Array(12).fill(0),Tm=({visible:e,className:t})=>S.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},S.createElement("div",{className:"sonner-spinner"},Pm.map((r,n)=>S.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Om=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Mm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Am=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Dm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Im=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),S.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Fm=()=>{let[e,t]=S.useState(document.hidden);return S.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},va=1,Lm=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:va++,o=this.toasts.find(i=>i.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(i=>i.id===s?(this.publish({...i,...e,id:s,title:r}),{...i,...e,id:s,dismissible:a,title:r}):i):this.addToast({title:r,...n,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,a=n.then(async c=>{if(o=["resolve",c],S.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if($m(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),i=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:i}:Object.assign(r,{unwrap:i})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||va++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ct=new Lm,Vm=(e,t)=>{let r=(t==null?void 0:t.id)||va++;return ct.addToast({title:e,...t,id:r}),r},$m=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Bm=Vm,Wm=()=>ct.toasts,jm=()=>ct.getActiveToasts();Object.assign(Bm,{success:ct.success,info:ct.info,warning:ct.warning,error:ct.error,custom:ct.custom,message:ct.message,promise:ct.promise,dismiss:ct.dismiss,loading:ct.loading},{getHistory:Wm,getToasts:jm});function Um(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Um(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
102
- `);function ro(e){return e.label!==void 0}var Hm=3,zm="32px",Ym="16px",fc=4e3,qm=356,Zm=14,Km=20,Qm=200;function Pt(...e){return e.filter(Boolean).join(" ")}function Gm(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var Xm=e=>{var t,r,n,s,o,a,i,c,d,u,h;let{invert:v,toast:f,unstyled:b,interacting:p,setHeights:g,visibleToasts:x,heights:y,index:w,toasts:k,expanded:N,removeToast:M,defaultRichColors:P,closeButton:F,style:$,cancelButtonStyle:z,actionButtonStyle:X,className:A="",descriptionClassName:j="",duration:I,position:J,gap:Y,loadingIcon:D,expandByDefault:O,classNames:B,icons:ae,closeButtonAriaLabel:Se="Close toast",pauseWhenPageIsHidden:de}=e,[ue,pe]=S.useState(null),[Fe,rt]=S.useState(null),[q,ke]=S.useState(!1),[Ae,ye]=S.useState(!1),[me,be]=S.useState(!1),[Je,lt]=S.useState(!1),[Rt,er]=S.useState(!1),[mr,as]=S.useState(0),[vr,C]=S.useState(0),E=S.useRef(f.duration||I||fc),T=S.useRef(null),U=S.useRef(null),W=w===0,V=w+1<=x,Q=f.type,ve=f.dismissible!==!1,Te=f.className||"",gt=f.descriptionClassName||"",gr=S.useMemo(()=>y.findIndex(oe=>oe.toastId===f.id)||0,[y,f.id]),tr=S.useMemo(()=>{var oe;return(oe=f.closeButton)!=null?oe:F},[f.closeButton,F]),Xo=S.useMemo(()=>f.duration||I||fc,[f.duration,I]),xn=S.useRef(0),rr=S.useRef(0),Jo=S.useRef(0),yr=S.useRef(null),[Ri,Ro]=J.split("-"),Oh=S.useMemo(()=>y.reduce((oe,Oe,Le)=>Le>=gr?oe:oe+Oe.height,0),[y,gr]),Mh=Fm(),wC=f.invert||v,el=Q==="loading";rr.current=S.useMemo(()=>gr*Y+Oh,[gr,Oh]),S.useEffect(()=>{E.current=Xo},[Xo]),S.useEffect(()=>{ke(!0)},[]),S.useEffect(()=>{let oe=U.current;if(oe){let Oe=oe.getBoundingClientRect().height;return C(Oe),g(Le=>[{toastId:f.id,height:Oe,position:f.position},...Le]),()=>g(Le=>Le.filter($t=>$t.toastId!==f.id))}},[g,f.id]),S.useLayoutEffect(()=>{if(!q)return;let oe=U.current,Oe=oe.style.height;oe.style.height="auto";let Le=oe.getBoundingClientRect().height;oe.style.height=Oe,C(Le),g($t=>$t.find(Bt=>Bt.toastId===f.id)?$t.map(Bt=>Bt.toastId===f.id?{...Bt,height:Le}:Bt):[{toastId:f.id,height:Le,position:f.position},...$t])},[q,f.title,f.description,g,f.id]);let Kr=S.useCallback(()=>{ye(!0),as(rr.current),g(oe=>oe.filter(Oe=>Oe.toastId!==f.id)),setTimeout(()=>{M(f)},Qm)},[f,M,g,rr]);S.useEffect(()=>{if(f.promise&&Q==="loading"||f.duration===1/0||f.type==="loading")return;let oe;return N||p||de&&Mh?(()=>{if(Jo.current<xn.current){let Oe=new Date().getTime()-xn.current;E.current=E.current-Oe}Jo.current=new Date().getTime()})():E.current!==1/0&&(xn.current=new Date().getTime(),oe=setTimeout(()=>{var Oe;(Oe=f.onAutoClose)==null||Oe.call(f,f),Kr()},E.current)),()=>clearTimeout(oe)},[N,p,f,Q,de,Mh,Kr]),S.useEffect(()=>{f.delete&&Kr()},[Kr,f.delete]);function xC(){var oe,Oe,Le;return ae!=null&&ae.loading?S.createElement("div",{className:Pt(B==null?void 0:B.loader,(oe=f==null?void 0:f.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":Q==="loading"},ae.loading):D?S.createElement("div",{className:Pt(B==null?void 0:B.loader,(Oe=f==null?void 0:f.classNames)==null?void 0:Oe.loader,"sonner-loader"),"data-visible":Q==="loading"},D):S.createElement(Tm,{className:Pt(B==null?void 0:B.loader,(Le=f==null?void 0:f.classNames)==null?void 0:Le.loader),visible:Q==="loading"})}return S.createElement("li",{tabIndex:0,ref:U,className:Pt(A,Te,B==null?void 0:B.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,B==null?void 0:B.default,B==null?void 0:B[Q],(r=f==null?void 0:f.classNames)==null?void 0:r[Q]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:P,"data-styled":!(f.jsx||f.unstyled||b),"data-mounted":q,"data-promise":!!f.promise,"data-swiped":Rt,"data-removed":Ae,"data-visible":V,"data-y-position":Ri,"data-x-position":Ro,"data-index":w,"data-front":W,"data-swiping":me,"data-dismissible":ve,"data-type":Q,"data-invert":wC,"data-swipe-out":Je,"data-swipe-direction":Fe,"data-expanded":!!(N||O&&q),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${Ae?mr:rr.current}px`,"--initial-height":O?"auto":`${vr}px`,...$,...f.style},onDragEnd:()=>{be(!1),pe(null),yr.current=null},onPointerDown:oe=>{el||!ve||(T.current=new Date,as(rr.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(be(!0),yr.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Oe,Le,$t;if(Je||!ve)return;yr.current=null;let Bt=Number(((oe=U.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qr=Number(((Oe=U.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_n=new Date().getTime()-((Le=T.current)==null?void 0:Le.getTime()),Wt=ue==="x"?Bt:Qr,Gr=Math.abs(Wt)/_n;if(Math.abs(Wt)>=Km||Gr>.11){as(rr.current),($t=f.onDismiss)==null||$t.call(f,f),rt(ue==="x"?Bt>0?"right":"left":Qr>0?"down":"up"),Kr(),lt(!0),er(!1);return}be(!1),pe(null)},onPointerMove:oe=>{var Oe,Le,$t,Bt;if(!yr.current||!ve||((Oe=window.getSelection())==null?void 0:Oe.toString().length)>0)return;let Qr=oe.clientY-yr.current.y,_n=oe.clientX-yr.current.x,Wt=(Le=e.swipeDirections)!=null?Le:Gm(J);!ue&&(Math.abs(_n)>1||Math.abs(Qr)>1)&&pe(Math.abs(_n)>Math.abs(Qr)?"x":"y");let Gr={x:0,y:0};ue==="y"?(Wt.includes("top")||Wt.includes("bottom"))&&(Wt.includes("top")&&Qr<0||Wt.includes("bottom")&&Qr>0)&&(Gr.y=Qr):ue==="x"&&(Wt.includes("left")||Wt.includes("right"))&&(Wt.includes("left")&&_n<0||Wt.includes("right")&&_n>0)&&(Gr.x=_n),(Math.abs(Gr.x)>0||Math.abs(Gr.y)>0)&&er(!0),($t=U.current)==null||$t.style.setProperty("--swipe-amount-x",`${Gr.x}px`),(Bt=U.current)==null||Bt.style.setProperty("--swipe-amount-y",`${Gr.y}px`)}},tr&&!f.jsx?S.createElement("button",{"aria-label":Se,"data-disabled":el,"data-close-button":!0,onClick:el||!ve?()=>{}:()=>{var oe;Kr(),(oe=f.onDismiss)==null||oe.call(f,f)},className:Pt(B==null?void 0:B.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},(o=ae==null?void 0:ae.close)!=null?o:Im):null,f.jsx||S.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:S.createElement(S.Fragment,null,Q||f.icon||f.promise?S.createElement("div",{"data-icon":"",className:Pt(B==null?void 0:B.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||xC():null,f.type!=="loading"?f.icon||(ae==null?void 0:ae[Q])||Em(Q):null):null,S.createElement("div",{"data-content":"",className:Pt(B==null?void 0:B.content,(i=f==null?void 0:f.classNames)==null?void 0:i.content)},S.createElement("div",{"data-title":"",className:Pt(B==null?void 0:B.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?S.createElement("div",{"data-description":"",className:Pt(j,gt,B==null?void 0:B.description,(d=f==null?void 0:f.classNames)==null?void 0:d.description)},typeof f.description=="function"?f.description():f.description):null),S.isValidElement(f.cancel)?f.cancel:f.cancel&&ro(f.cancel)?S.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||z,onClick:oe=>{var Oe,Le;ro(f.cancel)&&ve&&((Le=(Oe=f.cancel).onClick)==null||Le.call(Oe,oe),Kr())},className:Pt(B==null?void 0:B.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,S.isValidElement(f.action)?f.action:f.action&&ro(f.action)?S.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||X,onClick:oe=>{var Oe,Le;ro(f.action)&&((Le=(Oe=f.action).onClick)==null||Le.call(Oe,oe),!oe.defaultPrevented&&Kr())},className:Pt(B==null?void 0:B.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function hc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Jm(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",i=o?Ym:zm;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${a}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${a}-${d}`]=i:r[`${a}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(i)}),r}var Rm=S.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:i,offset:c,mobileOffset:d,theme:u="light",richColors:h,duration:v,style:f,visibleToasts:b=Hm,toastOptions:p,dir:g=hc(),gap:x=Zm,loadingIcon:y,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:N}=e,[M,P]=S.useState([]),F=S.useMemo(()=>Array.from(new Set([n].concat(M.filter(de=>de.position).map(de=>de.position)))),[M,n]),[$,z]=S.useState([]),[X,A]=S.useState(!1),[j,I]=S.useState(!1),[J,Y]=S.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=S.useRef(null),O=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=S.useRef(null),ae=S.useRef(!1),Se=S.useCallback(de=>{P(ue=>{var pe;return(pe=ue.find(Fe=>Fe.id===de.id))!=null&&pe.delete||ct.dismiss(de.id),ue.filter(({id:Fe})=>Fe!==de.id)})},[]);return S.useEffect(()=>ct.subscribe(de=>{if(de.dismiss){P(ue=>ue.map(pe=>pe.id===de.id?{...pe,delete:!0}:pe));return}setTimeout(()=>{Ge.flushSync(()=>{P(ue=>{let pe=ue.findIndex(Fe=>Fe.id===de.id);return pe!==-1?[...ue.slice(0,pe),{...ue[pe],...de},...ue.slice(pe+1)]:[de,...ue]})})})}),[]),S.useEffect(()=>{if(u!=="system"){Y(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let de=window.matchMedia("(prefers-color-scheme: dark)");try{de.addEventListener("change",({matches:ue})=>{Y(ue?"dark":"light")})}catch{de.addListener(({matches:pe})=>{try{Y(pe?"dark":"light")}catch(Fe){console.error(Fe)}})}},[u]),S.useEffect(()=>{M.length<=1&&A(!1)},[M]),S.useEffect(()=>{let de=ue=>{var pe,Fe;s.every(rt=>ue[rt]||ue.code===rt)&&(A(!0),(pe=D.current)==null||pe.focus()),ue.code==="Escape"&&(document.activeElement===D.current||(Fe=D.current)!=null&&Fe.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",de),()=>document.removeEventListener("keydown",de)},[s]),S.useEffect(()=>{if(D.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,ae.current=!1)}},[D.current]),S.createElement("section",{ref:t,"aria-label":`${k} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((de,ue)=>{var pe;let[Fe,rt]=de.split("-");return M.length?S.createElement("ol",{key:de,dir:g==="auto"?hc():g,tabIndex:-1,ref:D,className:i,"data-sonner-toaster":!0,"data-theme":J,"data-y-position":Fe,"data-lifted":X&&M.length>1&&!o,"data-x-position":rt,style:{"--front-toast-height":`${((pe=$[0])==null?void 0:pe.height)||0}px`,"--width":`${qm}px`,"--gap":`${x}px`,...f,...Jm(c,d)},onBlur:q=>{ae.current&&!q.currentTarget.contains(q.relatedTarget)&&(ae.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,B.current=q.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},M.filter(q=>!q.position&&ue===0||q.position===de).map((q,ke)=>{var Ae,ye;return S.createElement(Xm,{key:q.id,icons:w,index:ke,toast:q,defaultRichColors:h,duration:(Ae=p==null?void 0:p.duration)!=null?Ae:v,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:b,closeButton:(ye=p==null?void 0:p.closeButton)!=null?ye:a,interacting:j,position:de,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:Se,toasts:M.filter(me=>me.position==q.position),heights:$.filter(me=>me.position==q.position),setHeights:z,expandByDefault:o,gap:x,loadingIcon:y,expanded:X,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const ev=({...e})=>{const{theme:t="system"}=Nm();return l.jsx(Rm,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var tv=m[" useId ".trim().toString()]||(()=>{}),rv=0;function no(e){const[t,r]=m.useState(tv());return Re(()=>{r(n=>n??String(rv++))},[e]),t?`radix-${t}`:""}const nv=["top","right","bottom","left"],_r=Math.min,yt=Math.max,so=Math.round,oo=Math.floor,jt=e=>({x:e,y:e}),sv={left:"right",right:"left",bottom:"top",top:"bottom"},ov={start:"end",end:"start"};function ga(e,t,r){return yt(e,_r(t,r))}function sr(e,t){return typeof e=="function"?e(t):e}function or(e){return e.split("-")[0]}function Nn(e){return e.split("-")[1]}function ya(e){return e==="x"?"y":"x"}function ba(e){return e==="y"?"height":"width"}const av=new Set(["top","bottom"]);function Ut(e){return av.has(or(e))?"y":"x"}function wa(e){return ya(Ut(e))}function iv(e,t,r){r===void 0&&(r=!1);const n=Nn(e),s=wa(e),o=ba(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=ao(a)),[a,ao(a)]}function lv(e){const t=ao(e);return[xa(e),t,xa(t)]}function xa(e){return e.replace(/start|end/g,t=>ov[t])}const pc=["left","right"],mc=["right","left"],cv=["top","bottom"],dv=["bottom","top"];function uv(e,t,r){switch(e){case"top":case"bottom":return r?t?mc:pc:t?pc:mc;case"left":case"right":return t?cv:dv;default:return[]}}function fv(e,t,r,n){const s=Nn(e);let o=uv(or(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(xa)))),o}function ao(e){return e.replace(/left|right|bottom|top/g,t=>sv[t])}function hv(e){return{top:0,right:0,bottom:0,left:0,...e}}function vc(e){return typeof e!="number"?hv(e):{top:e,right:e,bottom:e,left:e}}function io(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function gc(e,t,r){let{reference:n,floating:s}=e;const o=Ut(t),a=wa(t),i=ba(a),c=or(t),d=o==="y",u=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,v=n[i]/2-s[i]/2;let f;switch(c){case"top":f={x:u,y:n.y-s.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:h};break;case"left":f={x:n.x-s.width,y:h};break;default:f={x:n.x,y:n.y}}switch(Nn(t)){case"start":f[a]-=v*(r&&d?-1:1);break;case"end":f[a]+=v*(r&&d?-1:1);break}return f}const pv=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,i=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:h}=gc(d,n,c),v=n,f={},b=0;for(let p=0;p<i.length;p++){const{name:g,fn:x}=i[p],{x:y,y:w,data:k,reset:N}=await x({x:u,y:h,initialPlacement:n,placement:v,strategy:s,middlewareData:f,rects:d,platform:a,elements:{reference:e,floating:t}});u=y??u,h=w??h,f={...f,[g]:{...f[g],...k}},N&&b<=50&&(b++,typeof N=="object"&&(N.placement&&(v=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:h}=gc(d,v,c)),p=-1)}return{x:u,y:h,placement:v,strategy:s,middlewareData:f}};async function ps(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:v=!1,padding:f=0}=sr(t,e),b=vc(f),g=i[v?h==="floating"?"reference":"floating":h],x=io(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(g)))==null||r?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:d,rootBoundary:u,strategy:c})),y=h==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),k=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},N=io(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-N.top+b.top)/k.y,bottom:(N.bottom-x.bottom+b.bottom)/k.y,left:(x.left-N.left+b.left)/k.x,right:(N.right-x.right+b.right)/k.x}}const mv=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:u=0}=sr(e,t)||{};if(d==null)return{};const h=vc(u),v={x:r,y:n},f=wa(s),b=ba(f),p=await a.getDimensions(d),g=f==="y",x=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",k=o.reference[b]+o.reference[f]-v[f]-o.floating[b],N=v[f]-o.reference[f],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let P=M?M[w]:0;(!P||!await(a.isElement==null?void 0:a.isElement(M)))&&(P=i.floating[w]||o.floating[b]);const F=k/2-N/2,$=P/2-p[b]/2-1,z=_r(h[x],$),X=_r(h[y],$),A=z,j=P-p[b]-X,I=P/2-p[b]/2+F,J=ga(A,I,j),Y=!c.arrow&&Nn(s)!=null&&I!==J&&o.reference[b]/2-(I<A?z:X)-p[b]/2<0,D=Y?I<A?I-A:I-j:0;return{[f]:v[f]+D,data:{[f]:J,centerOffset:I-J-D,...Y&&{alignmentOffset:D}},reset:Y}}}),vv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...g}=sr(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const x=or(s),y=Ut(i),w=or(i)===i,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=v||(w||!p?[ao(i)]:lv(i)),M=b!=="none";!v&&M&&N.push(...fv(i,p,b,k));const P=[i,...N],F=await ps(t,g),$=[];let z=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&$.push(F[x]),h){const I=iv(s,a,k);$.push(F[I[0]],F[I[1]])}if(z=[...z,{placement:s,overflows:$}],!$.every(I=>I<=0)){var X,A;const I=(((X=o.flip)==null?void 0:X.index)||0)+1,J=P[I];if(J&&(!(h==="alignment"?y!==Ut(J):!1)||z.every(O=>O.overflows[0]>0&&Ut(O.placement)===y)))return{data:{index:I,overflows:z},reset:{placement:J}};let Y=(A=z.filter(D=>D.overflows[0]<=0).sort((D,O)=>D.overflows[1]-O.overflows[1])[0])==null?void 0:A.placement;if(!Y)switch(f){case"bestFit":{var j;const D=(j=z.filter(O=>{if(M){const B=Ut(O.placement);return B===y||B==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(B=>B>0).reduce((B,ae)=>B+ae,0)]).sort((O,B)=>O[1]-B[1])[0])==null?void 0:j[0];D&&(Y=D);break}case"initialPlacement":Y=i;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function yc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bc(e){return nv.some(t=>e[t]>=0)}const gv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=sr(e,t);switch(n){case"referenceHidden":{const o=await ps(t,{...s,elementContext:"reference"}),a=yc(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bc(a)}}}case"escaped":{const o=await ps(t,{...s,altBoundary:!0}),a=yc(o,r.floating);return{data:{escapedOffsets:a,escaped:bc(a)}}}default:return{}}}}},wc=new Set(["left","top"]);async function yv(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=or(r),i=Nn(r),c=Ut(r)==="y",d=wc.has(a)?-1:1,u=o&&c?-1:1,h=sr(t,e);let{mainAxis:v,crossAxis:f,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof b=="number"&&(f=i==="end"?b*-1:b),c?{x:f*u,y:v*d}:{x:v*d,y:f*u}}const bv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:i}=t,c=await yv(t,e);return a===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},wv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:i={fn:g=>{let{x,y}=g;return{x,y}}},...c}=sr(e,t),d={x:r,y:n},u=await ps(t,c),h=Ut(or(s)),v=ya(h);let f=d[v],b=d[h];if(o){const g=v==="y"?"top":"left",x=v==="y"?"bottom":"right",y=f+u[g],w=f-u[x];f=ga(y,f,w)}if(a){const g=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=b+u[g],w=b-u[x];b=ga(y,b,w)}const p=i.fn({...t,[v]:f,[h]:b});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:o,[h]:a}}}}}},xv=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:d=!0}=sr(e,t),u={x:r,y:n},h=Ut(s),v=ya(h);let f=u[v],b=u[h];const p=sr(i,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=v==="y"?"height":"width",k=o.reference[v]-o.floating[w]+g.mainAxis,N=o.reference[v]+o.reference[w]-g.mainAxis;f<k?f=k:f>N&&(f=N)}if(d){var x,y;const w=v==="y"?"width":"height",k=wc.has(or(s)),N=o.reference[h]-o.floating[w]+(k&&((x=a.offset)==null?void 0:x[h])||0)+(k?0:g.crossAxis),M=o.reference[h]+o.reference[w]+(k?0:((y=a.offset)==null?void 0:y[h])||0)-(k?g.crossAxis:0);b<N?b=N:b>M&&(b=M)}return{[v]:f,[h]:b}}}},_v=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:i}=t,{apply:c=()=>{},...d}=sr(e,t),u=await ps(t,d),h=or(s),v=Nn(s),f=Ut(s)==="y",{width:b,height:p}=o.floating;let g,x;h==="top"||h==="bottom"?(g=h,x=v===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(x=h,g=v==="end"?"top":"bottom");const y=p-u.top-u.bottom,w=b-u.left-u.right,k=_r(p-u[g],y),N=_r(b-u[x],w),M=!t.middlewareData.shift;let P=k,F=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(F=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=y),M&&!v){const z=yt(u.left,0),X=yt(u.right,0),A=yt(u.top,0),j=yt(u.bottom,0);f?F=b-2*(z!==0||X!==0?z+X:yt(u.left,u.right)):P=p-2*(A!==0||j!==0?A+j:yt(u.top,u.bottom))}await c({...t,availableWidth:F,availableHeight:P});const $=await a.getDimensions(i.floating);return b!==$.width||p!==$.height?{reset:{rects:!0}}:{}}}};function lo(){return typeof window<"u"}function En(e){return xc(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(xc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xc(e){return lo()?e instanceof Node||e instanceof bt(e).Node:!1}function Tt(e){return lo()?e instanceof Element||e instanceof bt(e).Element:!1}function zt(e){return lo()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function _c(e){return!lo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const Cv=new Set(["inline","contents"]);function ms(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Cv.has(s)}const Sv=new Set(["table","td","th"]);function kv(e){return Sv.has(En(e))}const Nv=[":popover-open",":modal"];function co(e){return Nv.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ev=["transform","translate","scale","rotate","perspective"],Pv=["transform","translate","scale","rotate","perspective","filter"],Tv=["paint","layout","strict","content"];function _a(e){const t=Ca(),r=Tt(e)?Ot(e):e;return Ev.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Pv.some(n=>(r.willChange||"").includes(n))||Tv.some(n=>(r.contain||"").includes(n))}function Ov(e){let t=Cr(e);for(;zt(t)&&!Pn(t);){if(_a(t))return t;if(co(t))return null;t=Cr(t)}return null}function Ca(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Mv=new Set(["html","body","#document"]);function Pn(e){return Mv.has(En(e))}function Ot(e){return bt(e).getComputedStyle(e)}function uo(e){return Tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cr(e){if(En(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_c(e)&&e.host||Ht(e);return _c(t)?t.host:t}function Cc(e){const t=Cr(e);return Pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&ms(t)?t:Cc(t)}function vs(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Cc(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=bt(s);if(o){const i=Sa(a);return t.concat(a,a.visualViewport||[],ms(s)?s:[],i&&r?vs(i):[])}return t.concat(s,vs(s,[],r))}function Sa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sc(e){const t=Ot(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=zt(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,i=so(r)!==o||so(n)!==a;return i&&(r=o,n=a),{width:r,height:n,$:i}}function ka(e){return Tt(e)?e:e.contextElement}function Tn(e){const t=ka(e);if(!zt(t))return jt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Sc(t);let a=(o?so(r.width):r.width)/n,i=(o?so(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Av=jt(0);function kc(e){const t=bt(e);return!Ca()||!t.visualViewport?Av:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dv(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==bt(e)?!1:t}function en(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=ka(e);let a=jt(1);t&&(n?Tt(n)&&(a=Tn(n)):a=Tn(e));const i=Dv(o,r,n)?kc(o):jt(0);let c=(s.left+i.x)/a.x,d=(s.top+i.y)/a.y,u=s.width/a.x,h=s.height/a.y;if(o){const v=bt(o),f=n&&Tt(n)?bt(n):n;let b=v,p=Sa(b);for(;p&&n&&f!==b;){const g=Tn(p),x=p.getBoundingClientRect(),y=Ot(p),w=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,k=x.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,h*=g.y,c+=w,d+=k,b=bt(p),p=Sa(b)}}return io({width:u,height:h,x:c,y:d})}function Na(e,t){const r=uo(e).scrollLeft;return t?t.left+r:en(Ht(e)).left+r}function Nc(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:Na(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function Iv(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=Ht(n),i=t?co(t.floating):!1;if(n===a||i&&o)return r;let c={scrollLeft:0,scrollTop:0},d=jt(1);const u=jt(0),h=zt(n);if((h||!h&&!o)&&((En(n)!=="body"||ms(a))&&(c=uo(n)),zt(n))){const f=en(n);d=Tn(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const v=a&&!h&&!o?Nc(a,c,!0):jt(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+v.x,y:r.y*d.y-c.scrollTop*d.y+u.y+v.y}}function Fv(e){return Array.from(e.getClientRects())}function Lv(e){const t=Ht(e),r=uo(e),n=e.ownerDocument.body,s=yt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=yt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Na(e);const i=-r.scrollTop;return Ot(n).direction==="rtl"&&(a+=yt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:i}}function Vv(e,t){const r=bt(e),n=Ht(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,i=0,c=0;if(s){o=s.width,a=s.height;const d=Ca();(!d||d&&t==="fixed")&&(i=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:i,y:c}}const $v=new Set(["absolute","fixed"]);function Bv(e,t){const r=en(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=zt(e)?Tn(e):jt(1),a=e.clientWidth*o.x,i=e.clientHeight*o.y,c=s*o.x,d=n*o.y;return{width:a,height:i,x:c,y:d}}function Ec(e,t,r){let n;if(t==="viewport")n=Vv(e,r);else if(t==="document")n=Lv(Ht(e));else if(Tt(t))n=Bv(t,r);else{const s=kc(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return io(n)}function Pc(e,t){const r=Cr(e);return r===t||!Tt(r)||Pn(r)?!1:Ot(r).position==="fixed"||Pc(r,t)}function Wv(e,t){const r=t.get(e);if(r)return r;let n=vs(e,[],!1).filter(i=>Tt(i)&&En(i)!=="body"),s=null;const o=Ot(e).position==="fixed";let a=o?Cr(e):e;for(;Tt(a)&&!Pn(a);){const i=Ot(a),c=_a(a);!c&&i.position==="fixed"&&(s=null),(o?!c&&!s:!c&&i.position==="static"&&!!s&&$v.has(s.position)||ms(a)&&!c&&Pc(e,a))?n=n.filter(u=>u!==a):s=i,a=Cr(a)}return t.set(e,n),n}function jv(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?co(t)?[]:Wv(t,this._c):[].concat(r),n],i=a[0],c=a.reduce((d,u)=>{const h=Ec(t,u,s);return d.top=yt(h.top,d.top),d.right=_r(h.right,d.right),d.bottom=_r(h.bottom,d.bottom),d.left=yt(h.left,d.left),d},Ec(t,i,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uv(e){const{width:t,height:r}=Sc(e);return{width:t,height:r}}function Hv(e,t,r){const n=zt(t),s=Ht(t),o=r==="fixed",a=en(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const c=jt(0);function d(){c.x=Na(s)}if(n||!n&&!o)if((En(t)!=="body"||ms(s))&&(i=uo(t)),n){const f=en(t,!0,o,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&d();o&&!n&&s&&d();const u=s&&!n&&!o?Nc(s,i):jt(0),h=a.left+i.scrollLeft-c.x-u.x,v=a.top+i.scrollTop-c.y-u.y;return{x:h,y:v,width:a.width,height:a.height}}function Ea(e){return Ot(e).position==="static"}function Tc(e,t){if(!zt(e)||Ot(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ht(e)===r&&(r=r.ownerDocument.body),r}function Oc(e,t){const r=bt(e);if(co(e))return r;if(!zt(e)){let s=Cr(e);for(;s&&!Pn(s);){if(Tt(s)&&!Ea(s))return s;s=Cr(s)}return r}let n=Tc(e,t);for(;n&&kv(n)&&Ea(n);)n=Tc(n,t);return n&&Pn(n)&&Ea(n)&&!_a(n)?r:n||Ov(e)||r}const zv=async function(e){const t=this.getOffsetParent||Oc,r=this.getDimensions,n=await r(e.floating);return{reference:Hv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Yv(e){return Ot(e).direction==="rtl"}const qv={convertOffsetParentRelativeRectToViewportRelativeRect:Iv,getDocumentElement:Ht,getClippingRect:jv,getOffsetParent:Oc,getElementRects:zv,getClientRects:Fv,getDimensions:Uv,getScale:Tn,isElement:Tt,isRTL:Yv};function Mc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zv(e,t){let r=null,n;const s=Ht(e);function o(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),o();const d=e.getBoundingClientRect(),{left:u,top:h,width:v,height:f}=d;if(i||t(),!v||!f)return;const b=oo(h),p=oo(s.clientWidth-(u+v)),g=oo(s.clientHeight-(h+f)),x=oo(u),w={rootMargin:-b+"px "+-p+"px "+-g+"px "+-x+"px",threshold:yt(0,_r(1,c))||1};let k=!0;function N(M){const P=M[0].intersectionRatio;if(P!==c){if(!k)return a();P?a(!1,P):n=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!Mc(d,e.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(N,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(N,w)}r.observe(e)}return a(!0),o}function Kv(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=ka(e),u=s||o?[...d?vs(d):[],...vs(t)]:[];u.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),o&&x.addEventListener("resize",r)});const h=d&&i?Zv(d,r):null;let v=-1,f=null;a&&(f=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),r()}),d&&!c&&f.observe(d),f.observe(t));let b,p=c?en(e):null;c&&g();function g(){const x=en(e);p&&!Mc(p,x)&&r(),p=x,b=requestAnimationFrame(g)}return r(),()=>{var x;u.forEach(y=>{s&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),h==null||h(),(x=f)==null||x.disconnect(),f=null,c&&cancelAnimationFrame(b)}}const Qv=bv,Gv=wv,Xv=vv,Jv=_v,Rv=gv,Ac=mv,eg=xv,tg=(e,t,r)=>{const n=new Map,s={platform:qv,...r},o={...s.platform,_c:n};return pv(e,t,{...s,platform:o})};var rg=typeof document<"u",ng=function(){},fo=rg?S.useLayoutEffect:ng;function ho(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!ho(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!ho(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Dc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ic(e,t){const r=Dc(e);return Math.round(t*r)/r}function Pa(e){const t=m.useRef(e);return fo(()=>{t.current=e}),t}function sg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[u,h]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,f]=m.useState(n);ho(v,n)||f(n);const[b,p]=m.useState(null),[g,x]=m.useState(null),y=m.useCallback(O=>{O!==M.current&&(M.current=O,p(O))},[]),w=m.useCallback(O=>{O!==P.current&&(P.current=O,x(O))},[]),k=o||b,N=a||g,M=m.useRef(null),P=m.useRef(null),F=m.useRef(u),$=c!=null,z=Pa(c),X=Pa(s),A=Pa(d),j=m.useCallback(()=>{if(!M.current||!P.current)return;const O={placement:t,strategy:r,middleware:v};X.current&&(O.platform=X.current),tg(M.current,P.current,O).then(B=>{const ae={...B,isPositioned:A.current!==!1};I.current&&!ho(F.current,ae)&&(F.current=ae,is.flushSync(()=>{h(ae)}))})},[v,t,r,X,A]);fo(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,h(O=>({...O,isPositioned:!1})))},[d]);const I=m.useRef(!1);fo(()=>(I.current=!0,()=>{I.current=!1}),[]),fo(()=>{if(k&&(M.current=k),N&&(P.current=N),k&&N){if(z.current)return z.current(k,N,j);j()}},[k,N,j,z,$]);const J=m.useMemo(()=>({reference:M,floating:P,setReference:y,setFloating:w}),[y,w]),Y=m.useMemo(()=>({reference:k,floating:N}),[k,N]),D=m.useMemo(()=>{const O={position:r,left:0,top:0};if(!Y.floating)return O;const B=Ic(Y.floating,u.x),ae=Ic(Y.floating,u.y);return i?{...O,transform:"translate("+B+"px, "+ae+"px)",...Dc(Y.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:B,top:ae}},[r,i,Y.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:j,refs:J,elements:Y,floatingStyles:D}),[u,j,J,Y,D])}const og=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ac({element:n.current,padding:s}).fn(r):{}:n?Ac({element:n,padding:s}).fn(r):{}}}},ag=(e,t)=>({...Qv(e),options:[e,t]}),ig=(e,t)=>({...Gv(e),options:[e,t]}),lg=(e,t)=>({...eg(e),options:[e,t]}),cg=(e,t)=>({...Xv(e),options:[e,t]}),dg=(e,t)=>({...Jv(e),options:[e,t]}),ug=(e,t)=>({...Rv(e),options:[e,t]}),fg=(e,t)=>({...og(e),options:[e,t]});var hg="Arrow",Fc=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return l.jsx(we.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Fc.displayName=hg;var pg=Fc;function mg(e){const[t,r]=m.useState(void 0);return Re(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,i;if("borderBoxSize"in o){const c=o.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ta="Popper",[Lc,On]=Rr(Ta),[vg,Vc]=Lc(Ta),$c=e=>{const{__scopePopper:t,children:r}=e,[n,s]=m.useState(null);return l.jsx(vg,{scope:t,anchor:n,onAnchorChange:s,children:r})};$c.displayName=Ta;var Bc="PopperAnchor",Wc=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=Vc(Bc,r),a=m.useRef(null),i=Ie(t,a);return m.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:l.jsx(we.div,{...s,ref:i})});Wc.displayName=Bc;var Oa="PopperContent",[gg,yg]=Lc(Oa),jc=m.forwardRef((e,t)=>{var q,ke,Ae,ye,me,be;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:f="optimized",onPlaced:b,...p}=e,g=Vc(Oa,r),[x,y]=m.useState(null),w=Ie(t,Je=>y(Je)),[k,N]=m.useState(null),M=mg(k),P=(M==null?void 0:M.width)??0,F=(M==null?void 0:M.height)??0,$=n+(o!=="center"?"-"+o:""),z=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},X=Array.isArray(d)?d:[d],A=X.length>0,j={padding:z,boundary:X.filter(wg),altBoundary:A},{refs:I,floatingStyles:J,placement:Y,isPositioned:D,middlewareData:O}=sg({strategy:"fixed",placement:$,whileElementsMounted:(...Je)=>Kv(...Je,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[ag({mainAxis:s+F,alignmentAxis:a}),c&&ig({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?lg():void 0,...j}),c&&cg({...j}),dg({...j,apply:({elements:Je,rects:lt,availableWidth:Rt,availableHeight:er})=>{const{width:mr,height:as}=lt.reference,vr=Je.floating.style;vr.setProperty("--radix-popper-available-width",`${Rt}px`),vr.setProperty("--radix-popper-available-height",`${er}px`),vr.setProperty("--radix-popper-anchor-width",`${mr}px`),vr.setProperty("--radix-popper-anchor-height",`${as}px`)}}),k&&fg({element:k,padding:i}),xg({arrowWidth:P,arrowHeight:F}),v&&ug({strategy:"referenceHidden",...j})]}),[B,ae]=zc(Y),Se=Et(b);Re(()=>{D&&(Se==null||Se())},[D,Se]);const de=(q=O.arrow)==null?void 0:q.x,ue=(ke=O.arrow)==null?void 0:ke.y,pe=((Ae=O.arrow)==null?void 0:Ae.centerOffset)!==0,[Fe,rt]=m.useState();return Re(()=>{x&&rt(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:D?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Fe,"--radix-popper-transform-origin":[(ye=O.transformOrigin)==null?void 0:ye.x,(me=O.transformOrigin)==null?void 0:me.y].join(" "),...((be=O.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(gg,{scope:r,placedSide:B,onArrowChange:N,arrowX:de,arrowY:ue,shouldHideArrow:pe,children:l.jsx(we.div,{"data-side":B,"data-align":ae,...p,ref:w,style:{...p.style,animation:D?void 0:"none"}})})})});jc.displayName=Oa;var Uc="PopperArrow",bg={top:"bottom",right:"left",bottom:"top",left:"right"},Hc=m.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=yg(Uc,n),a=bg[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(pg,{...s,ref:r,style:{...s.style,display:"block"}})})});Hc.displayName=Uc;function wg(e){return e!==null}var xg=e=>({name:"transformOrigin",options:e,fn(t){var g,x,y;const{placement:r,rects:n,middlewareData:s}=t,a=((g=s.arrow)==null?void 0:g.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=zc(r),h={start:"0%",center:"50%",end:"100%"}[u],v=(((x=s.arrow)==null?void 0:x.x)??0)+i/2,f=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let b="",p="";return d==="bottom"?(b=a?h:`${v}px`,p=`${-c}px`):d==="top"?(b=a?h:`${v}px`,p=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,p=a?h:`${f}px`):d==="left"&&(b=`${n.floating.width+c}px`,p=a?h:`${f}px`),{data:{x:b,y:p}}}});function zc(e){const[t,r="center"]=e.split("-");return[t,r]}var Yc=$c,po=Wc,Ma=jc,Aa=Hc,[mo,SC]=Rr("Tooltip",[On]),Da=On(),qc="TooltipProvider",_g=700,Zc="tooltip.open",[Cg,Kc]=mo(qc),Qc=e=>{const{__scopeTooltip:t,delayDuration:r=_g,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=m.useRef(!0),i=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),l.jsx(Cg,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:m.useCallback(d=>{i.current=d},[]),disableHoverableContent:s,children:o})};Qc.displayName=qc;var Gc="Tooltip",[kC,vo]=mo(Gc),Ia="TooltipTrigger",Sg=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=vo(Ia,r),o=Kc(Ia,r),a=Da(r),i=m.useRef(null),c=Ie(t,i,s.onTriggerChange),d=m.useRef(!1),u=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(po,{asChild:!0,...a,children:l.jsx(we.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ie(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ie(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:ie(e.onBlur,s.onClose),onClick:ie(e.onClick,s.onClose)})})});Sg.displayName=Ia;var kg="TooltipPortal",[NC,Ng]=mo(kg,{forceMount:void 0}),Mn="TooltipContent",Xc=m.forwardRef((e,t)=>{const r=Ng(Mn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=vo(Mn,e.__scopeTooltip);return l.jsx(ds,{present:n||a.open,children:a.disableHoverableContent?l.jsx(Jc,{side:s,...o,ref:t}):l.jsx(Eg,{side:s,...o,ref:t})})}),Eg=m.forwardRef((e,t)=>{const r=vo(Mn,e.__scopeTooltip),n=Kc(Mn,e.__scopeTooltip),s=m.useRef(null),o=Ie(t,s),[a,i]=m.useState(null),{trigger:c,onClose:d}=r,u=s.current,{onPointerInTransitChange:h}=n,v=m.useCallback(()=>{i(null),h(!1)},[h]),f=m.useCallback((b,p)=>{const g=b.currentTarget,x={x:b.clientX,y:b.clientY},y=Ag(x,g.getBoundingClientRect()),w=Dg(x,y),k=Ig(p.getBoundingClientRect()),N=Lg([...w,...k]);i(N),h(!0)},[h]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(c&&u){const b=g=>f(g,u),p=g=>f(g,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",p)}}},[c,u,f,v]),m.useEffect(()=>{if(a){const b=p=>{const g=p.target,x={x:p.clientX,y:p.clientY},y=(c==null?void 0:c.contains(g))||(u==null?void 0:u.contains(g)),w=!Fg(x,a);y?v():w&&(v(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,a,d,v]),l.jsx(Jc,{...e,ref:o})}),[Pg,Tg]=mo(Gc,{isInside:!1}),Og=jh("TooltipContent"),Jc=m.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...i}=e,c=vo(Mn,r),d=Da(r),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener(Zc,u),()=>document.removeEventListener(Zc,u)),[u]),m.useEffect(()=>{if(c.trigger){const h=v=>{const f=v.target;f!=null&&f.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),l.jsx(cs,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:l.jsxs(Ma,{"data-state":c.stateAttribute,...d,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Og,{children:n}),l.jsx(Pg,{scope:r,isInside:!0,children:l.jsx(cp,{id:c.contentId,role:"tooltip",children:s||n})})]})})});Xc.displayName=Mn;var Rc="TooltipArrow",Mg=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Da(r);return Tg(Rc,r).isInside?null:l.jsx(Aa,{...s,...n,ref:t})});Mg.displayName=Rc;function Ag(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Dg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Ig(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function Fg(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const i=t[o],c=t[a],d=i.x,u=i.y,h=c.x,v=c.y;u>n!=v>n&&r<(h-d)*(n-u)/(v-u)+d&&(s=!s)}return s}function Lg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Vg(t)}function Vg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var $g=Qc,ed=Xc;const Bg=$g,Wg=m.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(ed,{ref:n,sideOffset:t,className:he("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Wg.displayName=ed.displayName;var An=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tn=typeof window>"u"||"Deno"in globalThis;function nt(){}function jg(e,t){return typeof e=="function"?e(t):e}function Fa(e){return typeof e=="number"&&e>=0&&e!==1/0}function td(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Sr(e,t){return typeof e=="function"?e(t):e}function St(e,t){return typeof e=="function"?e(t):e}function rd(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==La(a,t.options))return!1}else if(!gs(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||o&&!o(t))}function nd(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(rn(t.options.mutationKey)!==rn(o))return!1}else if(!gs(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function La(e,t){return((t==null?void 0:t.queryKeyHashFn)||rn)(e)}function rn(e){return JSON.stringify(e,(t,r)=>$a(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function gs(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>gs(e[r],t[r])):!1}function Va(e,t){if(e===t)return e;const r=sd(e)&&sd(t);if(r||$a(e)&&$a(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),a=o.length,i=r?[]:{},c=new Set(n);let d=0;for(let u=0;u<a;u++){const h=r?u:o[u];(!r&&c.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(i[h]=void 0,d++):(i[h]=Va(e[h],t[h]),i[h]===e[h]&&e[h]!==void 0&&d++)}return s===a&&d===s?e:i}return t}function go(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function sd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $a(e){if(!od(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!od(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function od(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ug(e){return new Promise(t=>{setTimeout(t,e)})}function Ba(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Va(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Va(e,t)}return t}function Hg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function zg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var yo=Symbol();function ad(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===yo&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function id(e,t){return typeof e=="function"?e(...t):!!e}var Yg=(wh=class extends An{constructor(){super();ee(this,hn);ee(this,Br);ee(this,Zn);K(this,Zn,t=>{if(!tn&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){_(this,Br)||this.setEventListener(_(this,Zn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Br))==null||t.call(this),K(this,Br,void 0))}setEventListener(t){var r;K(this,Zn,t),(r=_(this,Br))==null||r.call(this),K(this,Br,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){_(this,hn)!==t&&(K(this,hn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof _(this,hn)=="boolean"?_(this,hn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hn=new WeakMap,Br=new WeakMap,Zn=new WeakMap,wh),Wa=new Yg,qg=(xh=class extends An{constructor(){super();ee(this,Kn,!0);ee(this,Wr);ee(this,Qn);K(this,Qn,t=>{if(!tn&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){_(this,Wr)||this.setEventListener(_(this,Qn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Wr))==null||t.call(this),K(this,Wr,void 0))}setEventListener(t){var r;K(this,Qn,t),(r=_(this,Wr))==null||r.call(this),K(this,Wr,t(this.setOnline.bind(this)))}setOnline(t){_(this,Kn)!==t&&(K(this,Kn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return _(this,Kn)}},Kn=new WeakMap,Wr=new WeakMap,Qn=new WeakMap,xh),bo=new qg;function ja(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function Zg(e){return Math.min(1e3*2**e,3e4)}function ld(e){return(e??"online")==="online"?bo.isOnline():!0}var cd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dd(e){let t=!1,r=0,n;const s=ja(),o=()=>s.status!=="pending",a=p=>{var g;o()||(v(new cd(p)),(g=e.abort)==null||g.call(e))},i=()=>{t=!0},c=()=>{t=!1},d=()=>Wa.isFocused()&&(e.networkMode==="always"||bo.isOnline())&&e.canRun(),u=()=>ld(e.networkMode)&&e.canRun(),h=p=>{o()||(n==null||n(),s.resolve(p))},v=p=>{o()||(n==null||n(),s.reject(p))},f=()=>new Promise(p=>{var g;n=x=>{(o()||d())&&p(x)},(g=e.onPause)==null||g.call(e)}).then(()=>{var p;n=void 0,o()||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(o())return;let p;const g=r===0?e.initialPromise:void 0;try{p=g??e.fn()}catch(x){p=Promise.reject(x)}Promise.resolve(p).then(h).catch(x=>{var M;if(o())return;const y=e.retry??(tn?0:3),w=e.retryDelay??Zg,k=typeof w=="function"?w(r,x):w,N=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!N){v(x);return}r++,(M=e.onFail)==null||M.call(e,r,x),Ug(k).then(()=>d()?void 0:f()).then(()=>{t?v(x):b()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():f().then(b),s)}}var Kg=e=>setTimeout(e,0);function Qg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Kg;const o=i=>{t?e.push(i):s(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Ke=Qg(),ud=(_h=class{constructor(){ee(this,pn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fa(this.gcTime)&&K(this,pn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tn?1/0:5*60*1e3))}clearGcTimeout(){_(this,pn)&&(clearTimeout(_(this,pn)),K(this,pn,void 0))}},pn=new WeakMap,_h),Gg=(Ch=class extends ud{constructor(t){super();ee(this,Lt);ee(this,Gn);ee(this,Xn);ee(this,Nt);ee(this,mn);ee(this,Xe);ee(this,Us);ee(this,vn);K(this,vn,!1),K(this,Us,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,mn,t.client),K(this,Nt,_(this,mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,Gn,Xg(this.options)),this.state=t.state??_(this,Gn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,Xe))==null?void 0:t.promise}setOptions(t){this.options={..._(this,Us),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Nt).remove(this)}setData(t,r){const n=Ba(this.state.data,t,this.options);return ce(this,Lt,br).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ce(this,Lt,br).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=_(this,Xe))==null?void 0:n.promise;return(s=_(this,Xe))==null||s.cancel(t),r?r.then(nt).catch(nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Gn))}isActive(){return this.observers.some(t=>St(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Sr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!td(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Xe))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Xe))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Nt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(_(this,Xe)&&(_(this,vn)?_(this,Xe).cancel({revert:!0}):_(this,Xe).cancelRetry()),this.scheduleGc()),_(this,Nt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Lt,br).call(this,{type:"invalidate"})}async fetch(t,r){var c,d,u,h,v,f,b,p,g,x,y,w;if(this.state.fetchStatus!=="idle"&&((c=_(this,Xe))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(_(this,Xe))return _(this,Xe).continueRetry(),_(this,Xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(N=>N.options.queryFn);k&&this.setOptions(k.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(K(this,vn,!0),n.signal)})},o=()=>{const k=ad(this.options,r),M=(()=>{const P={client:_(this,mn),queryKey:this.queryKey,meta:this.meta};return s(P),P})();return K(this,vn,!1),this.options.persister?this.options.persister(k,M,this):k(M)},i=(()=>{const k={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:_(this,mn),state:this.state,fetchFn:o};return s(k),k})();(d=this.options.behavior)==null||d.onFetch(i,this),K(this,Xn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ce(this,Lt,br).call(this,{type:"fetch",meta:(h=i.fetchOptions)==null?void 0:h.meta}),K(this,Xe,dd({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onFail:(k,N)=>{ce(this,Lt,br).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{ce(this,Lt,br).call(this,{type:"pause"})},onContinue:()=>{ce(this,Lt,br).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const k=await _(this,Xe).start();if(k===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(k),(f=(v=_(this,Nt).config).onSuccess)==null||f.call(v,k,this),(p=(b=_(this,Nt).config).onSettled)==null||p.call(b,k,this.state.error,this),k}catch(k){if(k instanceof cd){if(k.silent)return _(this,Xe).promise;if(k.revert){if(this.setState({..._(this,Xn),fetchStatus:"idle"}),this.state.data===void 0)throw k;return this.state.data}}throw ce(this,Lt,br).call(this,{type:"error",error:k}),(x=(g=_(this,Nt).config).onError)==null||x.call(g,k,this),(w=(y=_(this,Nt).config).onSettled)==null||w.call(y,this.state.data,k,this),k}finally{this.scheduleGc()}}},Gn=new WeakMap,Xn=new WeakMap,Nt=new WeakMap,mn=new WeakMap,Xe=new WeakMap,Us=new WeakMap,vn=new WeakMap,Lt=new WeakSet,br=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...fd(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return K(this,Xn,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),_(this,Nt).notify({query:this,type:"updated",action:t})})},Ch);function fd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ld(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xg(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Jg=(Sh=class extends An{constructor(t={}){super();ee(this,Gt);this.config=t,K(this,Gt,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??La(s,r);let a=this.get(o);return a||(a=new Gg({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){_(this,Gt).has(t.queryHash)||(_(this,Gt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=_(this,Gt).get(t.queryHash);r&&(t.destroy(),r===t&&_(this,Gt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Gt).get(t)}getAll(){return[..._(this,Gt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>rd(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>rd(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gt=new WeakMap,Sh),Rg=(kh=class extends ud{constructor(t){super();ee(this,Jt);ee(this,Xt);ee(this,at);ee(this,gn);this.mutationId=t.mutationId,K(this,at,t.mutationCache),K(this,Xt,[]),this.state=t.state||hd(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Xt).includes(t)||(_(this,Xt).push(t),this.clearGcTimeout(),_(this,at).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,Xt,_(this,Xt).filter(r=>r!==t)),this.scheduleGc(),_(this,at).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Xt).length||(this.state.status==="pending"?this.scheduleGc():_(this,at).remove(this))}continue(){var t;return((t=_(this,gn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,i,c,d,u,h,v,f,b,p,g,x,y,w,k,N,M,P,F;const r=()=>{ce(this,Jt,Xr).call(this,{type:"continue"})};K(this,gn,dd({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:($,z)=>{ce(this,Jt,Xr).call(this,{type:"failed",failureCount:$,error:z})},onPause:()=>{ce(this,Jt,Xr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,at).canRun(this)}));const n=this.state.status==="pending",s=!_(this,gn).canStart();try{if(n)r();else{ce(this,Jt,Xr).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=_(this,at).config).onMutate)==null?void 0:a.call(o,t,this));const z=await((c=(i=this.options).onMutate)==null?void 0:c.call(i,t));z!==this.state.context&&ce(this,Jt,Xr).call(this,{type:"pending",context:z,variables:t,isPaused:s})}const $=await _(this,gn).start();return await((u=(d=_(this,at).config).onSuccess)==null?void 0:u.call(d,$,t,this.state.context,this)),await((v=(h=this.options).onSuccess)==null?void 0:v.call(h,$,t,this.state.context)),await((b=(f=_(this,at).config).onSettled)==null?void 0:b.call(f,$,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,$,null,t,this.state.context)),ce(this,Jt,Xr).call(this,{type:"success",data:$}),$}catch($){try{throw await((y=(x=_(this,at).config).onError)==null?void 0:y.call(x,$,t,this.state.context,this)),await((k=(w=this.options).onError)==null?void 0:k.call(w,$,t,this.state.context)),await((M=(N=_(this,at).config).onSettled)==null?void 0:M.call(N,void 0,$,this.state.variables,this.state.context,this)),await((F=(P=this.options).onSettled)==null?void 0:F.call(P,void 0,$,t,this.state.context)),$}finally{ce(this,Jt,Xr).call(this,{type:"error",error:$})}}finally{_(this,at).runNext(this)}}},Xt=new WeakMap,at=new WeakMap,gn=new WeakMap,Jt=new WeakSet,Xr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{_(this,Xt).forEach(n=>{n.onMutationUpdate(t)}),_(this,at).notify({mutation:this,type:"updated",action:t})})},kh);function hd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ey=(Nh=class extends An{constructor(t={}){super();ee(this,ur);ee(this,Vt);ee(this,Hs);this.config=t,K(this,ur,new Set),K(this,Vt,new Map),K(this,Hs,0)}build(t,r,n){const s=new Rg({mutationCache:this,mutationId:++ea(this,Hs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){_(this,ur).add(t);const r=wo(t);if(typeof r=="string"){const n=_(this,Vt).get(r);n?n.push(t):_(this,Vt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,ur).delete(t)){const r=wo(t);if(typeof r=="string"){const n=_(this,Vt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&_(this,Vt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=wo(t);if(typeof r=="string"){const n=_(this,Vt).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=wo(t);if(typeof r=="string"){const s=(n=_(this,Vt).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ke.batch(()=>{_(this,ur).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,ur).clear(),_(this,Vt).clear()})}getAll(){return Array.from(_(this,ur))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>nd(r,n))}findAll(t={}){return this.getAll().filter(r=>nd(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ke.batch(()=>Promise.all(t.map(r=>r.continue().catch(nt))))}},ur=new WeakMap,Vt=new WeakMap,Hs=new WeakMap,Nh);function wo(e){var t;return(t=e.options.scope)==null?void 0:t.id}function pd(e){return{onFetch:(t,r)=>{var u,h,v,f,b;const n=t.options,s=(v=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:v.direction,o=((f=t.state.data)==null?void 0:f.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let p=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},x=ad(t.options,t.fetchOptions),y=async(w,k,N)=>{if(p)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const X={client:t.client,queryKey:t.queryKey,pageParam:k,direction:N?"backward":"forward",meta:t.options.meta};return g(X),X})(),F=await x(P),{maxPages:$}=t.options,z=N?zg:Hg;return{pages:z(w.pages,F,$),pageParams:z(w.pageParams,k,$)}};if(s&&o.length){const w=s==="backward",k=w?ty:md,N={pages:o,pageParams:a},M=k(n,N);i=await y(N,M,w)}else{const w=e??o.length;do{const k=c===0?a[0]??n.initialPageParam:md(n,i);if(c>0&&k==null)break;i=await y(i,k),c++}while(c<w)}return i};t.options.persister?t.fetchFn=()=>{var p,g;return(g=(p=t.options).persister)==null?void 0:g.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function md(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ty(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ry=(Eh=class{constructor(e={}){ee(this,$e);ee(this,jr);ee(this,Ur);ee(this,Jn);ee(this,Rn);ee(this,Hr);ee(this,es);ee(this,ts);K(this,$e,e.queryCache||new Jg),K(this,jr,e.mutationCache||new ey),K(this,Ur,e.defaultOptions||{}),K(this,Jn,new Map),K(this,Rn,new Map),K(this,Hr,0)}mount(){ea(this,Hr)._++,_(this,Hr)===1&&(K(this,es,Wa.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,$e).onFocus())})),K(this,ts,bo.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,$e).onOnline())})))}unmount(){var e,t;ea(this,Hr)._--,_(this,Hr)===0&&((e=_(this,es))==null||e.call(this),K(this,es,void 0),(t=_(this,ts))==null||t.call(this),K(this,ts,void 0))}isFetching(e){return _(this,$e).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,jr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,$e).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=_(this,$e).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Sr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return _(this,$e).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=_(this,$e).get(n.queryHash),o=s==null?void 0:s.state.data,a=jg(t,o);if(a!==void 0)return _(this,$e).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>_(this,$e).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,$e).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=_(this,$e);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=_(this,$e);return Ke.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ke.batch(()=>_(this,$e).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(nt).catch(nt)}invalidateQueries(e,t={}){return Ke.batch(()=>(_(this,$e).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ke.batch(()=>_(this,$e).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(nt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(nt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=_(this,$e).build(this,t);return r.isStaleByTime(Sr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nt).catch(nt)}fetchInfiniteQuery(e){return e.behavior=pd(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nt).catch(nt)}ensureInfiniteQueryData(e){return e.behavior=pd(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bo.isOnline()?_(this,jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,$e)}getMutationCache(){return _(this,jr)}getDefaultOptions(){return _(this,Ur)}setDefaultOptions(e){K(this,Ur,e)}setQueryDefaults(e,t){_(this,Jn).set(rn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Jn).values()],r={};return t.forEach(n=>{gs(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){_(this,Rn).set(rn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Rn).values()],r={};return t.forEach(n=>{gs(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Ur).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=La(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===yo&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Ur).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,$e).clear(),_(this,jr).clear()}},$e=new WeakMap,jr=new WeakMap,Ur=new WeakMap,Jn=new WeakMap,Rn=new WeakMap,Hr=new WeakMap,es=new WeakMap,ts=new WeakMap,Eh),ny=(Ph=class extends An{constructor(t,r){super();ee(this,Ne);ee(this,mt);ee(this,ge);ee(this,zs);ee(this,it);ee(this,yn);ee(this,rs);ee(this,fr);ee(this,zr);ee(this,Ys);ee(this,ns);ee(this,ss);ee(this,bn);ee(this,wn);ee(this,Yr);ee(this,os,new Set);this.options=r,K(this,mt,t),K(this,zr,null),K(this,fr,ja()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,ge).addObserver(this),vd(_(this,ge),this.options)?ce(this,Ne,qs).call(this):this.updateResult(),ce(this,Ne,ol).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ua(_(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ua(_(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Ne,al).call(this),ce(this,Ne,il).call(this),_(this,ge).removeObserver(this)}setOptions(t){const r=this.options,n=_(this,ge);if(this.options=_(this,mt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof St(this.options.enabled,_(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,Ne,ll).call(this),_(this,ge).setOptions(this.options),r._defaulted&&!go(this.options,r)&&_(this,mt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,ge),observer:this});const s=this.hasListeners();s&&gd(_(this,ge),n,this.options,r)&&ce(this,Ne,qs).call(this),this.updateResult(),s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||Sr(this.options.staleTime,_(this,ge))!==Sr(r.staleTime,_(this,ge)))&&ce(this,Ne,rl).call(this);const o=ce(this,Ne,nl).call(this);s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||o!==_(this,Yr))&&ce(this,Ne,sl).call(this,o)}getOptimisticResult(t){const r=_(this,mt).getQueryCache().build(_(this,mt),t),n=this.createResult(r,t);return oy(this,n)&&(K(this,it,n),K(this,rs,this.options),K(this,yn,_(this,ge).state)),n}getCurrentResult(){return _(this,it)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&!this.options.experimental_prefetchInRender&&_(this,fr).status==="pending"&&_(this,fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,s))})}trackProp(t){_(this,os).add(t)}getCurrentQuery(){return _(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=_(this,mt).defaultQueryOptions(t),n=_(this,mt).getQueryCache().build(_(this,mt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,Ne,qs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,it)))}createResult(t,r){var $;const n=_(this,ge),s=this.options,o=_(this,it),a=_(this,yn),i=_(this,rs),d=t!==n?t.state:_(this,zs),{state:u}=t;let h={...u},v=!1,f;if(r._optimisticResults){const z=this.hasListeners(),X=!z&&vd(t,r),A=z&&gd(t,n,r,s);(X||A)&&(h={...h,...fd(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:g}=h;f=h.data;let x=!1;if(r.placeholderData!==void 0&&f===void 0&&g==="pending"){let z;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(z=o.data,x=!0):z=typeof r.placeholderData=="function"?r.placeholderData(($=_(this,ss))==null?void 0:$.state.data,_(this,ss)):r.placeholderData,z!==void 0&&(g="success",f=Ba(o==null?void 0:o.data,z,r),v=!0)}if(r.select&&f!==void 0&&!x)if(o&&f===(a==null?void 0:a.data)&&r.select===_(this,Ys))f=_(this,ns);else try{K(this,Ys,r.select),f=r.select(f),f=Ba(o==null?void 0:o.data,f,r),K(this,ns,f),K(this,zr,null)}catch(z){K(this,zr,z)}_(this,zr)&&(b=_(this,zr),f=_(this,ns),p=Date.now(),g="error");const y=h.fetchStatus==="fetching",w=g==="pending",k=g==="error",N=w&&y,M=f!==void 0,F={status:g,fetchStatus:h.fetchStatus,isPending:w,isSuccess:g==="success",isError:k,isInitialLoading:N,isLoading:N,data:f,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:k&&!M,isPaused:h.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:k&&M,isStale:Ha(t,r),refetch:this.refetch,promise:_(this,fr),isEnabled:St(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=j=>{F.status==="error"?j.reject(F.error):F.data!==void 0&&j.resolve(F.data)},X=()=>{const j=K(this,fr,F.promise=ja());z(j)},A=_(this,fr);switch(A.status){case"pending":t.queryHash===n.queryHash&&z(A);break;case"fulfilled":(F.status==="error"||F.data!==A.value)&&X();break;case"rejected":(F.status!=="error"||F.error!==A.reason)&&X();break}}return F}updateResult(){const t=_(this,it),r=this.createResult(_(this,ge),this.options);if(K(this,yn,_(this,ge).state),K(this,rs,this.options),_(this,yn).data!==void 0&&K(this,ss,_(this,ge)),go(r,t))return;K(this,it,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!_(this,os).size)return!0;const a=new Set(o??_(this,os));return this.options.throwOnError&&a.add("error"),Object.keys(_(this,it)).some(i=>{const c=i;return _(this,it)[c]!==t[c]&&a.has(c)})};ce(this,Ne,Dh).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,Ne,ol).call(this)}},mt=new WeakMap,ge=new WeakMap,zs=new WeakMap,it=new WeakMap,yn=new WeakMap,rs=new WeakMap,fr=new WeakMap,zr=new WeakMap,Ys=new WeakMap,ns=new WeakMap,ss=new WeakMap,bn=new WeakMap,wn=new WeakMap,Yr=new WeakMap,os=new WeakMap,Ne=new WeakSet,qs=function(t){ce(this,Ne,ll).call(this);let r=_(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(nt)),r},rl=function(){ce(this,Ne,al).call(this);const t=Sr(this.options.staleTime,_(this,ge));if(tn||_(this,it).isStale||!Fa(t))return;const n=td(_(this,it).dataUpdatedAt,t)+1;K(this,bn,setTimeout(()=>{_(this,it).isStale||this.updateResult()},n))},nl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,ge)):this.options.refetchInterval)??!1},sl=function(t){ce(this,Ne,il).call(this),K(this,Yr,t),!(tn||St(this.options.enabled,_(this,ge))===!1||!Fa(_(this,Yr))||_(this,Yr)===0)&&K(this,wn,setInterval(()=>{(this.options.refetchIntervalInBackground||Wa.isFocused())&&ce(this,Ne,qs).call(this)},_(this,Yr)))},ol=function(){ce(this,Ne,rl).call(this),ce(this,Ne,sl).call(this,ce(this,Ne,nl).call(this))},al=function(){_(this,bn)&&(clearTimeout(_(this,bn)),K(this,bn,void 0))},il=function(){_(this,wn)&&(clearInterval(_(this,wn)),K(this,wn,void 0))},ll=function(){const t=_(this,mt).getQueryCache().build(_(this,mt),this.options);if(t===_(this,ge))return;const r=_(this,ge);K(this,ge,t),K(this,zs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Dh=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(_(this,it))}),_(this,mt).getQueryCache().notify({query:_(this,ge),type:"observerResultsUpdated"})})},Ph);function sy(e,t){return St(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vd(e,t){return sy(e,t)||e.state.data!==void 0&&Ua(e,t,t.refetchOnMount)}function Ua(e,t,r){if(St(t.enabled,e)!==!1&&Sr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ha(e,t)}return!1}function gd(e,t,r,n){return(e!==t||St(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ha(e,r)}function Ha(e,t){return St(t.enabled,e)!==!1&&e.isStaleByTime(Sr(t.staleTime,e))}function oy(e,t){return!go(e.getCurrentResult(),t)}var ay=(Th=class extends An{constructor(r,n){super();ee(this,pr);ee(this,qr);ee(this,Zr);ee(this,vt);ee(this,hr);K(this,qr,r),this.setOptions(n),this.bindMethods(),ce(this,pr,ta).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=_(this,qr).defaultMutationOptions(r),go(this.options,n)||_(this,qr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rn(n.mutationKey)!==rn(this.options.mutationKey)?this.reset():((s=_(this,vt))==null?void 0:s.state.status)==="pending"&&_(this,vt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=_(this,vt))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,pr,ta).call(this),ce(this,pr,cl).call(this,r)}getCurrentResult(){return _(this,Zr)}reset(){var r;(r=_(this,vt))==null||r.removeObserver(this),K(this,vt,void 0),ce(this,pr,ta).call(this),ce(this,pr,cl).call(this)}mutate(r,n){var s;return K(this,hr,n),(s=_(this,vt))==null||s.removeObserver(this),K(this,vt,_(this,qr).getMutationCache().build(_(this,qr),this.options)),_(this,vt).addObserver(this),_(this,vt).execute(r)}},qr=new WeakMap,Zr=new WeakMap,vt=new WeakMap,hr=new WeakMap,pr=new WeakSet,ta=function(){var n;const r=((n=_(this,vt))==null?void 0:n.state)??hd();K(this,Zr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},cl=function(r){Ke.batch(()=>{var n,s,o,a,i,c,d,u;if(_(this,hr)&&this.hasListeners()){const h=_(this,Zr).variables,v=_(this,Zr).context;(r==null?void 0:r.type)==="success"?((s=(n=_(this,hr)).onSuccess)==null||s.call(n,r.data,h,v),(a=(o=_(this,hr)).onSettled)==null||a.call(o,r.data,null,h,v)):(r==null?void 0:r.type)==="error"&&((c=(i=_(this,hr)).onError)==null||c.call(i,r.error,h,v),(u=(d=_(this,hr)).onSettled)==null||u.call(d,void 0,r.error,h,v))}this.listeners.forEach(h=>{h(_(this,Zr))})})},Th),yd=m.createContext(void 0),bd=e=>{const t=m.useContext(yd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},iy=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(yd.Provider,{value:e,children:t})),wd=m.createContext(!1),ly=()=>m.useContext(wd);wd.Provider;function cy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dy=m.createContext(cy()),uy=()=>m.useContext(dy),fy=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},hy=e=>{m.useEffect(()=>{e.clearReset()},[e])},py=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||id(r,[e.error,n])),my=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},vy=(e,t)=>e.isLoading&&e.isFetching&&!t,gy=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,xd=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function yy(e,t,r){var h,v,f,b,p;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=ly(),s=uy(),o=bd(),a=o.defaultQueryOptions(e);(v=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||v.call(h,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=n?"isRestoring":"optimistic",my(a),fy(a,s),hy(s);const i=!o.getQueryCache().get(a.queryHash),[c]=m.useState(()=>new t(o,a)),d=c.getOptimisticResult(a),u=!n&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(g=>{const x=u?c.subscribe(Ke.batchCalls(g)):nt;return c.updateResult(),x},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(a)},[a,c]),gy(a,d))throw xd(a,c,s);if(py({result:d,errorResetBoundary:s,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;if((b=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||b.call(f,a,d),a.experimental_prefetchInRender&&!tn&&vy(d,n)){const g=i?xd(a,c,s):(p=o.getQueryCache().get(a.queryHash))==null?void 0:p.promise;g==null||g.catch(nt).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?d:c.trackResult(d)}function by(e,t){return yy(e,ny)}function _d(e,t){const r=bd(),[n]=m.useState(()=>new ay(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const s=m.useSyncExternalStore(m.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=m.useCallback((a,i)=>{n.mutate(a,i).catch(nt)},[n]);if(s.error&&id(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const xo=fa("inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{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"}}),Ye=m.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?hl:"button";return l.jsx(a,{className:he(xo({variant:t,size:r,className:e})),ref:o,...s})});Ye.displayName="Button";const dt=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));dt.displayName="Card";const kr=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex flex-col space-y-1.5 p-6",e),...t}));kr.displayName="CardHeader";const za=m.forwardRef(({className:e,...t},r)=>l.jsx("h3",{ref:r,className:he("text-2xl font-semibold leading-none tracking-tight",e),...t}));za.displayName="CardTitle";const wy=m.forwardRef(({className:e,...t},r)=>l.jsx("p",{ref:r,className:he("text-sm text-muted-foreground",e),...t}));wy.displayName="CardDescription";const ut=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("p-6 pt-0",e),...t}));ut.displayName="CardContent";const xy=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex items-center p-6 pt-0",e),...t}));xy.displayName="CardFooter";const Cd=({title:e="Verify your identity",subtitle:t="We need some information to help us confirm your identity.",onContinue:r})=>l.jsx(dt,{className:"w-full max-w-md mx-auto",children:l.jsxs(ut,{className:"pt-8 text-center",children:[l.jsx("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 rounded-3xl p-8 mb-8",children:l.jsx("div",{className:"relative mb-8",children:l.jsxs("div",{className:"relative mx-auto w-48 h-32",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary to-primary/80 rounded-2xl transform rotate-3 shadow-lg",children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center",children:l.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:l.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})})}),l.jsx("div",{className:"absolute top-4 right-0 bg-card rounded-xl shadow-lg p-4 transform -rotate-3",children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("div",{className:"w-8 h-8 bg-primary/20 rounded-full"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"w-12 h-2 bg-primary rounded"}),l.jsx("div",{className:"w-8 h-2 bg-primary/60 rounded"})]})]})}),l.jsx("div",{className:"absolute -top-2 -right-2 w-10 h-10 bg-primary rounded-full flex items-center justify-center shadow-lg",children:l.jsx(Xl,{className:"w-6 h-6 text-white"})})]})})}),l.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:e}),l.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:t}),l.jsx(Ye,{className:"w-full h-14 text-lg font-semibold",onClick:r,children:"Start"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-6",children:"Verifying usually takes a few seconds."})]})}),wt=m.forwardRef(({className:e,type:t,...r},n)=>l.jsx("input",{type:t,className:he("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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 md:text-sm",e),ref:n,...r}));wt.displayName="Input";var _y="Label",Sd=m.forwardRef((e,t)=>l.jsx(we.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Sd.displayName=_y;var kd=Sd;const Cy=fa("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),nn=m.forwardRef(({className:e,...t},r)=>l.jsx(kd,{ref:r,className:he(Cy(),e),...t}));nn.displayName=kd.displayName;const Sy=({fullName:e,onNameChange:t,onContinue:r,renderProgress:n})=>l.jsxs(dt,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(Wp,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),l.jsx(za,{children:"Personal Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please enter your full legal name"})]}),l.jsxs(ut,{children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{htmlFor:"fullName",children:"Full Name"}),l.jsx(wt,{id:"fullName",placeholder:"Enter your full name",value:e,onChange:s=>t(s.target.value)})]}),l.jsx(Ye,{className:"w-full",onClick:r,disabled:!e.trim(),children:"Continue"})]}),l.jsx("div",{className:"mt-6",children:n()})]})]}),Nr=({title:e,subTitle:t,onBack:r})=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center mb-6",children:[l.jsx(Ye,{variant:"ghost",size:"icon",className:"mr-2",onClick:r,children:l.jsx(Kl,{className:"w-6 h-6"})}),l.jsx("h1",{className:"text-2xl font-semibold ml-4",children:e})]}),l.jsx("p",{className:"text-center text-muted-foreground mb-6",children:t})]}),ky=({selectedDocumentType:e,onDocumentTypeChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=[{id:"id-card",title:"ID Card",description:"Government-issued personal ID.",icon:$p},{id:"drivers-license",title:"Drivers license",description:"Government-issued Drivers license",icon:Ap},{id:"passport",title:"Passport",description:"Your official travel document.",icon:Mp},{id:"voter-id",title:"Voter ID",description:"Government-issued Voter ID",icon:jp}];return l.jsx(dt,{className:"w-full max-w-md mx-auto",children:l.jsxs(ut,{className:"p-6",children:[l.jsx(Nr,{title:"Upload ID",subTitle:"Choose the document type you would like to identify with",onBack:n}),l.jsx("div",{className:"space-y-3",children:o.map(a=>{const i=a.icon;return l.jsx("button",{className:`w-full p-4 rounded-lg border text-left transition-colors hover:bg-muted/50 ${e===a.id?"border-primary bg-primary/5":"border-border"}`,onClick:()=>t(a.id),children:l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:l.jsx(i,{className:"w-6 h-6 text-white"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})]})]})},a.id)})}),l.jsx(Ye,{className:"w-full mt-6",onClick:r,disabled:!e,children:"Continue"}),l.jsx("div",{className:"mt-6",children:s()})]})})},Ny=e=>{switch(e){case"selfie":return{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular"};case"id-front":return{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};case"id-back":return{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};default:return{title:"Take Photo",description:"Position your document inside the frame and take a picture.",frameType:"rectangular"}}},Ya=({acceptedFile:e,currentStep:t,setCurrentStep:r,setSelfiePhoto:n,setIdCardFront:s,setIdCardBack:o})=>{const[a,i]=S.useState(null),c=S.useRef(null),d=S.useRef(null),u=!!a,{toast:h}=Qs();S.useEffect(()=>{a&&c.current&&(c.current.srcObject=a)},[a]);const v=S.useCallback(async()=>{try{const k=await navigator.mediaDevices.getUserMedia({video:{facingMode:t==="selfie"?"user":"environment",width:{ideal:1280},height:{ideal:720}}});i(k)}catch{h({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},[t,h]);S.useEffect(()=>{!a&&!e&&v()},[t,v,a,e]);const f=S.useCallback(()=>{a&&(a.getTracks().forEach(k=>k.stop()),i(null))},[a]),b=S.useCallback(()=>{if(!c.current||!d.current)return;const k=c.current,N=d.current,M=N.getContext("2d");M&&(N.width=k.videoWidth,N.height=k.videoHeight,M.drawImage(k,0,0),N.toBlob(P=>{if(P){const F=new File([P],`${t}-${Date.now()}.jpg`,{type:"image/jpeg"});switch(t){case"selfie":n(F),f(),r("selfie-confirm");break;case"id-front":s(F),f(),r("id-front-confirm");break;case"id-back":o(F),f(),r("id-back-confirm");break}h({title:"Photo Captured",description:"Photo captured successfully"})}},"image/jpeg",.8))},[t,f,h]);S.useEffect(()=>()=>{f()},[f]);const p=Ny(t),{title:g,description:x,frameType:y}=p,w=()=>{switch(f(),t){case"selfie":r("pre-selfie");break;case"id-front":r("document-selection");break;case"id-back":r("document-selection");break}};return l.jsx(dt,{className:"w-full max-w-md mx-auto border-gray-900 bg-gray-900",children:l.jsxs(ut,{className:" text-white flex flex-col",children:[l.jsxs("div",{className:"flex items-center p-6",children:[l.jsx(Ye,{variant:"ghost",size:"sm",onClick:w,className:"text-white hover:bg-gray-800",children:l.jsx(Kl,{className:"h-6 w-6"})}),l.jsx("h1",{className:"text-xl font-semibold ml-4",children:g})]}),l.jsx("div",{className:"px-6 mb-8",children:l.jsx("p",{className:"text-gray-300 text-center",children:x})}),l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[l.jsx("div",{className:"relative mb-16",children:u?l.jsxs(l.Fragment,{children:[l.jsx("video",{ref:c,autoPlay:!0,playsInline:!0,className:`bg-gray-800 object-cover ${y==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`}),l.jsx("canvas",{ref:d,className:"hidden"})]}):l.jsx("div",{className:`bg-gray-700 flex items-center justify-center ${y==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`,children:l.jsx("p",{className:"text-gray-400",children:"Camera loading..."})})}),l.jsx(Ye,{onClick:u?b:v,size:"lg",className:"w-16 h-16 rounded-full bg-white hover:bg-gray-100 border-4 border-gray-600 p-0",disabled:!u,children:l.jsx("div",{className:"w-8 h-8 rounded-full bg-white"})})]})]})})},Ey=({onContinue:e,onBack:t})=>l.jsx(dt,{className:"w-full max-w-md mx-auto",children:l.jsxs(ut,{className:"p-6",children:[l.jsx(Nr,{title:"Selfie",subTitle:"Make sure your face is clear and is fully inside the frame.",onBack:t}),l.jsx("div",{className:"m-auto w-44 h-80 bg-gradient-to-br from-primary/20 to-primary/40 rounded-3xl p-4 shadow-2xl",children:l.jsx("div",{className:"w-full h-full bg-background rounded-2xl overflow-hidden relative",children:l.jsx("div",{className:"flex items-center justify-center h-full bg-muted/30",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-2"}),l.jsx("div",{className:"w-28 h-32 bg-primary/30 rounded-2xl mx-auto"})]})})})}),l.jsx("div",{className:"mt-8",children:l.jsx(Ye,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),qa=({photo:e,onRetake:t,onConfirm:r,onBack:n,renderProgress:s})=>{const o=S.useMemo(()=>URL.createObjectURL(e),[e]);return console.log("photoUrl",o),S.useEffect(()=>()=>{console.log("REVOKEEEEEE",o)},[o]),l.jsx(dt,{className:"w-full max-w-md mx-auto",children:l.jsxs(ut,{className:"p-6",children:[l.jsx(Nr,{title:"Review picture",subTitle:"Make sure the information is seen clearly, with no blur or glare.",onBack:n}),l.jsx("div",{className:"mb-8",children:l.jsx("div",{className:"relative",children:l.jsx("img",{src:o,alt:"Captured photo",className:"w-full h-64 object-cover rounded-2xl bg-muted"})})}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx(Ye,{variant:"outline",onClick:t,className:"flex-1 text-md",children:"Take again"}),l.jsx(Ye,{onClick:r,className:"flex-1 text-md",children:"Looks good"})]})]})})},Py=({fullName:e,onComplete:t,onStartOver:r})=>l.jsxs(dt,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(Xl,{className:"w-12 h-12 mx-auto mb-4 text-green-500"}),l.jsx(za,{children:"Review Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please review your information before submitting"})]}),l.jsx(ut,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{children:"Full Name"}),l.jsx("p",{className:"font-medium",children:e})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"Selfie"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Front"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Back"}),l.jsx("div",{className:"text-green-500",children:"✓"})]})]}),l.jsx(Ye,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),l.jsx(Ye,{variant:"outline",className:"w-full text-md",onClick:r,children:"Start Over"})]})})]}),Nd=({onComplete:e})=>(S.useEffect(()=>{const t=setTimeout(()=>{e()},3e3);return()=>clearTimeout(t)},[e]),l.jsx(dt,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:l.jsxs(ut,{className:"text-center space-y-8",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"We're verifying your documents"})}),l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin"})})]})})),Ty=({apiEndpoint:e,apiKey:t,onComplete:r})=>{const[n,s]=S.useState("landing"),[o,a]=S.useState(""),[i,c]=S.useState(""),[d,u]=S.useState(null),[h,v]=S.useState(null),[f,b]=S.useState(null),{data:p}=Ay(e,t),g=_d({mutationFn:Oy}),{toast:x}=Qs(),y=S.useMemo(()=>[...p!=null&&p.hide_name_step?[]:["name"],...p!=null&&p.hide_document_selection_step?[]:["document-selection"],"selfie","selfie-confirm","pre-selfie","id-front","id-front-confirm","id-back","id-back-confirm","verify"],[p]),w=()=>p.hide_name_step?p.hide_document_selection_step?"id-front":"document-selection":"name",k=async()=>{if((p.hide_name_step||!!o)&&d&&h&&f){const F={full_name:o,selfiePhoto:d,idCardFront:h,idCardBack:f},$=await g.mutateAsync({apiEndpoint:e,apiKey:t,data:F});r($.data.token,F),x({title:"KYC Complete",description:"Identity verification completed successfully"}),a(""),u(null),v(null),b(null),s("landing")}},N=()=>l.jsx(l.Fragment,{children:n!=="landing"&&l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"flex space-x-2",children:y.map((P,F)=>l.jsx("div",{className:`w-3 h-3 rounded-full ${y.indexOf(n)>=F?"bg-primary":"bg-muted"}`},P))})})}),M=()=>{switch(n){case"landing":return l.jsx(Cd,{onContinue:()=>s(w())});case"name":return l.jsx(Sy,{fullName:o,onNameChange:a,onContinue:()=>s(p.hide_document_selection_step?"id-front":"document-selection"),renderProgress:N});case"document-selection":return l.jsx(ky,{selectedDocumentType:i,onDocumentTypeChange:c,onContinue:()=>s("id-front"),onBack:()=>s(p.hide_name_step?"landing":"name"),renderProgress:N});case"id-front":return l.jsx(Ya,{acceptedFile:h,currentStep:n,setCurrentStep:s,setSelfiePhoto:u,setIdCardFront:v,setIdCardBack:b});case"id-back":return l.jsx(Ya,{acceptedFile:f,currentStep:n,setCurrentStep:s,setSelfiePhoto:u,setIdCardFront:v,setIdCardBack:b});case"pre-selfie":return l.jsx(Ey,{onContinue:()=>s("selfie"),onBack:()=>s("name")});case"selfie":return l.jsx(Ya,{acceptedFile:d,currentStep:n,setCurrentStep:s,setSelfiePhoto:u,setIdCardFront:v,setIdCardBack:b});case"selfie-confirm":return d?l.jsx(qa,{photo:d,onRetake:()=>{u(null),s("selfie")},onConfirm:()=>s("verify"),onBack:()=>s("selfie"),renderProgress:N}):null;case"id-front-confirm":return h?l.jsx(qa,{photo:h,onRetake:()=>{v(null),s("id-front")},onConfirm:()=>s("id-back"),onBack:()=>s("id-front"),renderProgress:N}):null;case"id-back-confirm":return f?l.jsx(qa,{photo:f,onRetake:()=>{b(null),s("id-back")},onConfirm:()=>s("pre-selfie"),onBack:()=>s("id-back"),renderProgress:N}):null;case"verify":return l.jsx(Py,{fullName:o,onComplete:()=>s("processing"),onStartOver:()=>s("landing")});case"processing":return l.jsx(Nd,{onComplete:k});default:return null}};return l.jsx("div",{className:"w-[430px]",children:M()})};async function Oy({apiEndpoint:e,apiKey:t,data:r}){const n=new FormData;n.append("full_name",r.full_name),n.append("selfie_photo",r.selfiePhoto,r.selfiePhoto.name),n.append("id_photo",r.idCardFront,r.idCardFront.name),n.append("id_photo_back",r.idCardBack,r.idCardBack.name);const s=await fetch(`${e}/api/kyc`,{method:"POST",headers:{"X-API-Key":t},body:n});if(!s.ok)throw new Error("Network response was not ok");return s.json()}const My=async(e,t)=>{const r=await fetch(`${e}/api/settings`,{method:"GET",headers:{"X-API-Key":t,"Content-Type":"application/json"}});if(!r.ok)throw new Error("Network response was not ok");return(await r.json()).data},Ay=(e,t)=>by({queryKey:["settings",e,t],queryFn:()=>My(e,t),enabled:!!e&&!!t});var ys=e=>e.type==="checkbox",sn=e=>e instanceof Date,st=e=>e==null;const Ed=e=>typeof e=="object";var Be=e=>!st(e)&&!Array.isArray(e)&&Ed(e)&&!sn(e),Pd=e=>Be(e)&&e.target?ys(e.target)?e.target.checked:e.target.value:e,Dy=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Td=(e,t)=>e.has(Dy(t)),Iy=e=>{const t=e.constructor&&e.constructor.prototype;return Be(t)&&t.hasOwnProperty("isPrototypeOf")},Za=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qe(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Za&&(e instanceof Blob||n))&&(r||Be(e)))if(t=r?[]:{},!r&&!Iy(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Qe(e[s]));else return e;return t}var _o=e=>/^\w*$/.test(e),We=e=>e===void 0,Ka=e=>Array.isArray(e)?e.filter(Boolean):[],Qa=e=>Ka(e.replace(/["|']|\]/g,"").split(/\.|\[/)),H=(e,t,r)=>{if(!t||!Be(e))return r;const n=(_o(t)?[t]:Qa(t)).reduce((s,o)=>st(s)?s:s[o],e);return We(n)||n===e?We(e[t])?r:e[t]:n},xt=e=>typeof e=="boolean",Ee=(e,t,r)=>{let n=-1;const s=_o(t)?[t]:Qa(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let c=r;if(n!==a){const d=e[i];c=Be(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=c,e=e[i]}};const Co={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Mt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ar={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ga=S.createContext(null);Ga.displayName="HookFormContext";const So=()=>S.useContext(Ga),Fy=e=>{const{children:t,...r}=e;return S.createElement(Ga.Provider,{value:r},t)};var Od=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Mt.all&&(t._proxyFormState[a]=!n||Mt.all),r&&(r[a]=!0),e[a]}});return s};const Xa=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Ly(e){const t=So(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[a,i]=S.useState(r._formState),c=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Xa(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:d=>{!n&&i({...r._formState,...d})}}),[s,n,o]),S.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>Od(a,r,c.current,!1),[a,r])}var Yt=e=>typeof e=="string",Md=(e,t,r,n,s)=>Yt(e)?(n&&t.watch.add(e),H(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),H(r,o))):(n&&(t.watchAll=!0),r),Ja=e=>st(e)||!Ed(e);function ir(e,t,r=new WeakSet){if(Ja(e)||Ja(t))return e===t;if(sn(e)&&sn(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const a=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const i=t[o];if(sn(a)&&sn(i)||Be(a)&&Be(i)||Array.isArray(a)&&Array.isArray(i)?!ir(a,i,r):a!==i)return!1}}return!0}function Vy(e){const t=So(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:a,compute:i}=e||{},c=S.useRef(s),d=S.useRef(i),u=S.useRef(void 0);d.current=i;const h=S.useMemo(()=>r._getWatch(n,c.current),[r,n]),[v,f]=S.useState(d.current?d.current(h):h);return Xa(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:b=>{if(!o){const p=Md(n,r._names,b.values||r._formValues,!1,c.current);if(d.current){const g=d.current(p);ir(g,u.current)||(f(g),u.current=g)}else f(p)}}}),[r,o,n,a]),S.useEffect(()=>r._removeUnmounted()),v}function $y(e){const t=So(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o,defaultValue:a}=e,i=Td(s._names.array,r),c=S.useMemo(()=>H(s._formValues,r,H(s._defaultValues,r,a)),[s,r,a]),d=Vy({control:s,name:r,defaultValue:c,exact:!0}),u=Ly({control:s,name:r,exact:!0}),h=S.useRef(e),v=S.useRef(s.register(r,{...e.rules,value:d,...xt(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const f=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!H(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!H(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!H(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!H(u.validatingFields,r)},error:{enumerable:!0,get:()=>H(u.errors,r)}}),[u,r]),b=S.useCallback(y=>v.current.onChange({target:{value:Pd(y),name:r},type:Co.CHANGE}),[r]),p=S.useCallback(()=>v.current.onBlur({target:{value:H(s._formValues,r),name:r},type:Co.BLUR}),[r,s._formValues]),g=S.useCallback(y=>{const w=H(s._fields,r);w&&y&&(w._f.ref={focus:()=>y.focus&&y.focus(),select:()=>y.select&&y.select(),setCustomValidity:k=>y.setCustomValidity(k),reportValidity:()=>y.reportValidity()})},[s._fields,r]),x=S.useMemo(()=>({name:r,value:d,...xt(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:b,onBlur:p,ref:g}),[r,n,u.disabled,b,p,g,d]);return S.useEffect(()=>{const y=s._options.shouldUnregister||o;s.register(r,{...h.current.rules,...xt(h.current.disabled)?{disabled:h.current.disabled}:{}});const w=(k,N)=>{const M=H(s._fields,k);M&&M._f&&(M._f.mount=N)};if(w(r,!0),y){const k=Qe(H(s._options.defaultValues,r));Ee(s._defaultValues,r,k),We(H(s._formValues,r))&&Ee(s._formValues,r,k)}return!i&&s.register(r),()=>{(i?y&&!s._state.action:y)?s.unregister(r):w(r,!1)}},[r,s,i,o]),S.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),S.useMemo(()=>({field:x,formState:u,fieldState:f}),[x,u,f])}const By=e=>e.render($y(e));var Ad=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},bs=e=>Array.isArray(e)?e:[e],Dd=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},ft=e=>Be(e)&&!Object.keys(e).length,Ra=e=>e.type==="file",At=e=>typeof e=="function",ko=e=>{if(!Za)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Id=e=>e.type==="select-multiple",ei=e=>e.type==="radio",Wy=e=>ei(e)||ys(e),ti=e=>ko(e)&&e.isConnected;function jy(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=We(e)?n++:e[t[n++]];return e}function Uy(e){for(const t in e)if(e.hasOwnProperty(t)&&!We(e[t]))return!1;return!0}function qe(e,t){const r=Array.isArray(t)?t:_o(t)?[t]:Qa(t),n=r.length===1?e:jy(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Be(n)&&ft(n)||Array.isArray(n)&&Uy(n))&&qe(e,r.slice(0,-1)),e}var Fd=e=>{for(const t in e)if(At(e[t]))return!0;return!1};function No(e,t={}){const r=Array.isArray(e);if(Be(e)||r)for(const n in e)Array.isArray(e[n])||Be(e[n])&&!Fd(e[n])?(t[n]=Array.isArray(e[n])?[]:{},No(e[n],t[n])):st(e[n])||(t[n]=!0);return t}function Ld(e,t,r){const n=Array.isArray(e);if(Be(e)||n)for(const s in e)Array.isArray(e[s])||Be(e[s])&&!Fd(e[s])?We(t)||Ja(r[s])?r[s]=Array.isArray(e[s])?No(e[s],[]):{...No(e[s])}:Ld(e[s],st(t)?{}:t[s],r[s]):r[s]=!ir(e[s],t[s]);return r}var ws=(e,t)=>Ld(e,t,No(t));const Vd={value:!1,isValid:!1},$d={value:!0,isValid:!0};var Bd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!We(e[0].attributes.value)?We(e[0].value)||e[0].value===""?$d:{value:e[0].value,isValid:!0}:$d:Vd}return Vd},Wd=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>We(e)?e:t?e===""?NaN:e&&+e:r&&Yt(e)?new Date(e):n?n(e):e;const jd={isValid:!1,value:null};var Ud=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,jd):jd;function Hd(e){const t=e.ref;return Ra(t)?t.files:ei(t)?Ud(e.refs).value:Id(t)?[...t.selectedOptions].map(({value:r})=>r):ys(t)?Bd(e.refs).value:Wd(We(t.value)?e.ref.value:t.value,e)}var Hy=(e,t,r,n)=>{const s={};for(const o of e){const a=H(t,o);a&&Ee(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Eo=e=>e instanceof RegExp,xs=e=>We(e)?e:Eo(e)?e.source:Be(e)?Eo(e.value)?e.value.source:e.value:e,zd=e=>({isOnSubmit:!e||e===Mt.onSubmit,isOnBlur:e===Mt.onBlur,isOnChange:e===Mt.onChange,isOnAll:e===Mt.all,isOnTouch:e===Mt.onTouched});const Yd="AsyncFunction";var zy=e=>!!e&&!!e.validate&&!!(At(e.validate)&&e.validate.constructor.name===Yd||Be(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Yd)),Yy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),qd=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const _s=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=H(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(_s(i,t))break}else if(Be(i)&&_s(i,t))break}}};function Zd(e,t,r){const n=H(e,r);if(n||_o(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=H(t,o),i=H(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var qy=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ft(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||Mt.all))},Zy=(e,t,r)=>!e||!t||e===t||bs(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Ky=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Qy=(e,t)=>!Ka(H(e,t)).length&&qe(e,t),Gy=(e,t,r)=>{const n=bs(H(e,r));return Ee(n,"root",t[r]),Ee(e,r,n),e},Po=e=>Yt(e);function Kd(e,t,r="validate"){if(Po(e)||Array.isArray(e)&&e.every(Po)||xt(e)&&!e)return{type:r,message:Po(e)?e:"",ref:t}}var Dn=e=>Be(e)&&!Eo(e)?e:{value:e,message:""},Qd=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:h,max:v,pattern:f,validate:b,name:p,valueAsNumber:g,mount:x}=e._f,y=H(r,p);if(!x||t.has(p))return{};const w=i?i[0]:a,k=A=>{s&&w.reportValidity&&(w.setCustomValidity(xt(A)?"":A||""),w.reportValidity())},N={},M=ei(a),P=ys(a),F=M||P,$=(g||Ra(a))&&We(a.value)&&We(y)||ko(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,z=Ad.bind(null,p,n,N),X=(A,j,I,J=ar.maxLength,Y=ar.minLength)=>{const D=A?j:I;N[p]={type:A?J:Y,message:D,ref:a,...z(A?J:Y,D)}};if(o?!Array.isArray(y)||!y.length:c&&(!F&&($||st(y))||xt(y)&&!y||P&&!Bd(i).isValid||M&&!Ud(i).isValid)){const{value:A,message:j}=Po(c)?{value:!!c,message:c}:Dn(c);if(A&&(N[p]={type:ar.required,message:j,ref:w,...z(ar.required,j)},!n))return k(j),N}if(!$&&(!st(h)||!st(v))){let A,j;const I=Dn(v),J=Dn(h);if(!st(y)&&!isNaN(y)){const Y=a.valueAsNumber||y&&+y;st(I.value)||(A=Y>I.value),st(J.value)||(j=Y<J.value)}else{const Y=a.valueAsDate||new Date(y),D=ae=>new Date(new Date().toDateString()+" "+ae),O=a.type=="time",B=a.type=="week";Yt(I.value)&&y&&(A=O?D(y)>D(I.value):B?y>I.value:Y>new Date(I.value)),Yt(J.value)&&y&&(j=O?D(y)<D(J.value):B?y<J.value:Y<new Date(J.value))}if((A||j)&&(X(!!A,I.message,J.message,ar.max,ar.min),!n))return k(N[p].message),N}if((d||u)&&!$&&(Yt(y)||o&&Array.isArray(y))){const A=Dn(d),j=Dn(u),I=!st(A.value)&&y.length>+A.value,J=!st(j.value)&&y.length<+j.value;if((I||J)&&(X(I,A.message,j.message),!n))return k(N[p].message),N}if(f&&!$&&Yt(y)){const{value:A,message:j}=Dn(f);if(Eo(A)&&!y.match(A)&&(N[p]={type:ar.pattern,message:j,ref:a,...z(ar.pattern,j)},!n))return k(j),N}if(b){if(At(b)){const A=await b(y,r),j=Kd(A,w);if(j&&(N[p]={...j,...z(ar.validate,j.message)},!n))return k(j.message),N}else if(Be(b)){let A={};for(const j in b){if(!ft(A)&&!n)break;const I=Kd(await b[j](y,r),w,j);I&&(A={...I,...z(j,I.message)},k(I.message),n&&(N[p]=A))}if(!ft(A)&&(N[p]={ref:w,...A},!n))return N}}return k(!0),N};const Xy={mode:Mt.onSubmit,reValidateMode:Mt.onChange,shouldFocusError:!0};function Jy(e={}){let t={...Xy,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:At(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Be(t.defaultValues)||Be(t.values)?Qe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Qe(s),a={action:!1,mount:!1,watch:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...u};const v={array:Dd(),state:Dd()},f=t.criteriaMode===Mt.all,b=C=>E=>{clearTimeout(d),d=setTimeout(C,E)},p=async C=>{if(!t.disabled&&(u.isValid||h.isValid||C)){const E=t.resolver?ft((await P()).errors):await $(n,!0);E!==r.isValid&&v.state.next({isValid:E})}},g=(C,E)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((C||Array.from(i.mount)).forEach(T=>{T&&(E?Ee(r.validatingFields,T,E):qe(r.validatingFields,T))}),v.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},x=(C,E=[],T,U,W=!0,V=!0)=>{if(U&&T&&!t.disabled){if(a.action=!0,V&&Array.isArray(H(n,C))){const Q=T(H(n,C),U.argA,U.argB);W&&Ee(n,C,Q)}if(V&&Array.isArray(H(r.errors,C))){const Q=T(H(r.errors,C),U.argA,U.argB);W&&Ee(r.errors,C,Q),Qy(r.errors,C)}if((u.touchedFields||h.touchedFields)&&V&&Array.isArray(H(r.touchedFields,C))){const Q=T(H(r.touchedFields,C),U.argA,U.argB);W&&Ee(r.touchedFields,C,Q)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=ws(s,o)),v.state.next({name:C,isDirty:X(C,E),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ee(o,C,E)},y=(C,E)=>{Ee(r.errors,C,E),v.state.next({errors:r.errors})},w=C=>{r.errors=C,v.state.next({errors:r.errors,isValid:!1})},k=(C,E,T,U)=>{const W=H(n,C);if(W){const V=H(o,C,We(T)?H(s,C):T);We(V)||U&&U.defaultChecked||E?Ee(o,C,E?V:Hd(W._f)):I(C,V),a.mount&&p()}},N=(C,E,T,U,W)=>{let V=!1,Q=!1;const ve={name:C};if(!t.disabled){if(!T||U){(u.isDirty||h.isDirty)&&(Q=r.isDirty,r.isDirty=ve.isDirty=X(),V=Q!==ve.isDirty);const Te=ir(H(s,C),E);Q=!!H(r.dirtyFields,C),Te?qe(r.dirtyFields,C):Ee(r.dirtyFields,C,!0),ve.dirtyFields=r.dirtyFields,V=V||(u.dirtyFields||h.dirtyFields)&&Q!==!Te}if(T){const Te=H(r.touchedFields,C);Te||(Ee(r.touchedFields,C,T),ve.touchedFields=r.touchedFields,V=V||(u.touchedFields||h.touchedFields)&&Te!==T)}V&&W&&v.state.next(ve)}return V?ve:{}},M=(C,E,T,U)=>{const W=H(r.errors,C),V=(u.isValid||h.isValid)&&xt(E)&&r.isValid!==E;if(t.delayError&&T?(c=b(()=>y(C,T)),c(t.delayError)):(clearTimeout(d),c=null,T?Ee(r.errors,C,T):qe(r.errors,C)),(T?!ir(W,T):W)||!ft(U)||V){const Q={...U,...V&&xt(E)?{isValid:E}:{},errors:r.errors,name:C};r={...r,...Q},v.state.next(Q)}},P=async C=>{g(C,!0);const E=await t.resolver(o,t.context,Hy(C||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(C),E},F=async C=>{const{errors:E}=await P(C);if(C)for(const T of C){const U=H(E,T);U?Ee(r.errors,T,U):qe(r.errors,T)}else r.errors=E;return E},$=async(C,E,T={valid:!0})=>{for(const U in C){const W=C[U];if(W){const{_f:V,...Q}=W;if(V){const ve=i.array.has(V.name),Te=W._f&&zy(W._f);Te&&u.validatingFields&&g([U],!0);const gt=await Qd(W,i.disabled,o,f,t.shouldUseNativeValidation&&!E,ve);if(Te&&u.validatingFields&&g([U]),gt[V.name]&&(T.valid=!1,E))break;!E&&(H(gt,V.name)?ve?Gy(r.errors,gt,V.name):Ee(r.errors,V.name,gt[V.name]):qe(r.errors,V.name))}!ft(Q)&&await $(Q,E,T)}}return T.valid},z=()=>{for(const C of i.unMount){const E=H(n,C);E&&(E._f.refs?E._f.refs.every(T=>!ti(T)):!ti(E._f.ref))&&q(C)}i.unMount=new Set},X=(C,E)=>!t.disabled&&(C&&E&&Ee(o,C,E),!ir(ae(),s)),A=(C,E,T)=>Md(C,i,{...a.mount?o:We(E)?s:Yt(C)?{[C]:E}:E},T,E),j=C=>Ka(H(a.mount?o:s,C,t.shouldUnregister?H(s,C,[]):[])),I=(C,E,T={})=>{const U=H(n,C);let W=E;if(U){const V=U._f;V&&(!V.disabled&&Ee(o,C,Wd(E,V)),W=ko(V.ref)&&st(E)?"":E,Id(V.ref)?[...V.ref.options].forEach(Q=>Q.selected=W.includes(Q.value)):V.refs?ys(V.ref)?V.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(W)?Q.checked=!!W.find(ve=>ve===Q.value):Q.checked=W===Q.value||!!W)}):V.refs.forEach(Q=>Q.checked=Q.value===W):Ra(V.ref)?V.ref.value="":(V.ref.value=W,V.ref.type||v.state.next({name:C,values:Qe(o)})))}(T.shouldDirty||T.shouldTouch)&&N(C,W,T.shouldTouch,T.shouldDirty,!0),T.shouldValidate&&B(C)},J=(C,E,T)=>{for(const U in E){if(!E.hasOwnProperty(U))return;const W=E[U],V=C+"."+U,Q=H(n,V);(i.array.has(C)||Be(W)||Q&&!Q._f)&&!sn(W)?J(V,W,T):I(V,W,T)}},Y=(C,E,T={})=>{const U=H(n,C),W=i.array.has(C),V=Qe(E);Ee(o,C,V),W?(v.array.next({name:C,values:Qe(o)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&T.shouldDirty&&v.state.next({name:C,dirtyFields:ws(s,o),isDirty:X(C,V)})):U&&!U._f&&!st(V)?J(C,V,T):I(C,V,T),qd(C,i)&&v.state.next({...r,name:C}),v.state.next({name:a.mount?C:void 0,values:Qe(o)})},D=async C=>{a.mount=!0;const E=C.target;let T=E.name,U=!0;const W=H(n,T),V=Te=>{U=Number.isNaN(Te)||sn(Te)&&isNaN(Te.getTime())||ir(Te,H(o,T,Te))},Q=zd(t.mode),ve=zd(t.reValidateMode);if(W){let Te,gt;const gr=E.type?Hd(W._f):Pd(C),tr=C.type===Co.BLUR||C.type===Co.FOCUS_OUT,Xo=!Yy(W._f)&&!t.resolver&&!H(r.errors,T)&&!W._f.deps||Ky(tr,H(r.touchedFields,T),r.isSubmitted,ve,Q),xn=qd(T,i,tr);Ee(o,T,gr),tr?(W._f.onBlur&&W._f.onBlur(C),c&&c(0)):W._f.onChange&&W._f.onChange(C);const rr=N(T,gr,tr),Jo=!ft(rr)||xn;if(!tr&&v.state.next({name:T,type:C.type,values:Qe(o)}),Xo)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?tr&&p():tr||p()),Jo&&v.state.next({name:T,...xn?{}:rr});if(!tr&&xn&&v.state.next({...r}),t.resolver){const{errors:yr}=await P([T]);if(V(gr),U){const Ri=Zd(r.errors,n,T),Ro=Zd(yr,n,Ri.name||T);Te=Ro.error,T=Ro.name,gt=ft(yr)}}else g([T],!0),Te=(await Qd(W,i.disabled,o,f,t.shouldUseNativeValidation))[T],g([T]),V(gr),U&&(Te?gt=!1:(u.isValid||h.isValid)&&(gt=await $(n,!0)));U&&(W._f.deps&&B(W._f.deps),M(T,gt,Te,rr))}},O=(C,E)=>{if(H(r.errors,E)&&C.focus)return C.focus(),1},B=async(C,E={})=>{let T,U;const W=bs(C);if(t.resolver){const V=await F(We(C)?C:W);T=ft(V),U=C?!W.some(Q=>H(V,Q)):T}else C?(U=(await Promise.all(W.map(async V=>{const Q=H(n,V);return await $(Q&&Q._f?{[V]:Q}:Q)}))).every(Boolean),!(!U&&!r.isValid)&&p()):U=T=await $(n);return v.state.next({...!Yt(C)||(u.isValid||h.isValid)&&T!==r.isValid?{}:{name:C},...t.resolver||!C?{isValid:T}:{},errors:r.errors}),E.shouldFocus&&!U&&_s(n,O,C?W:i.mount),U},ae=C=>{const E={...a.mount?o:s};return We(C)?E:Yt(C)?H(E,C):C.map(T=>H(E,T))},Se=(C,E)=>({invalid:!!H((E||r).errors,C),isDirty:!!H((E||r).dirtyFields,C),error:H((E||r).errors,C),isValidating:!!H(r.validatingFields,C),isTouched:!!H((E||r).touchedFields,C)}),de=C=>{C&&bs(C).forEach(E=>qe(r.errors,E)),v.state.next({errors:C?r.errors:{}})},ue=(C,E,T)=>{const U=(H(n,C,{_f:{}})._f||{}).ref,W=H(r.errors,C)||{},{ref:V,message:Q,type:ve,...Te}=W;Ee(r.errors,C,{...Te,...E,ref:U}),v.state.next({name:C,errors:r.errors,isValid:!1}),T&&T.shouldFocus&&U&&U.focus&&U.focus()},pe=(C,E)=>At(C)?v.state.subscribe({next:T=>"values"in T&&C(A(void 0,E),T)}):A(C,E,!0),Fe=C=>v.state.subscribe({next:E=>{Zy(C.name,E.name,C.exact)&&qy(E,C.formState||u,mr,C.reRenderRoot)&&C.callback({values:{...o},...r,...E,defaultValues:s})}}).unsubscribe,rt=C=>(a.mount=!0,h={...h,...C.formState},Fe({...C,formState:h})),q=(C,E={})=>{for(const T of C?bs(C):i.mount)i.mount.delete(T),i.array.delete(T),E.keepValue||(qe(n,T),qe(o,T)),!E.keepError&&qe(r.errors,T),!E.keepDirty&&qe(r.dirtyFields,T),!E.keepTouched&&qe(r.touchedFields,T),!E.keepIsValidating&&qe(r.validatingFields,T),!t.shouldUnregister&&!E.keepDefaultValue&&qe(s,T);v.state.next({values:Qe(o)}),v.state.next({...r,...E.keepDirty?{isDirty:X()}:{}}),!E.keepIsValid&&p()},ke=({disabled:C,name:E})=>{(xt(C)&&a.mount||C||i.disabled.has(E))&&(C?i.disabled.add(E):i.disabled.delete(E))},Ae=(C,E={})=>{let T=H(n,C);const U=xt(E.disabled)||xt(t.disabled);return Ee(n,C,{...T||{},_f:{...T&&T._f?T._f:{ref:{name:C}},name:C,mount:!0,...E}}),i.mount.add(C),T?ke({disabled:xt(E.disabled)?E.disabled:t.disabled,name:C}):k(C,!0,E.value),{...U?{disabled:E.disabled||t.disabled}:{},...t.progressive?{required:!!E.required,min:xs(E.min),max:xs(E.max),minLength:xs(E.minLength),maxLength:xs(E.maxLength),pattern:xs(E.pattern)}:{},name:C,onChange:D,onBlur:D,ref:W=>{if(W){Ae(C,E),T=H(n,C);const V=We(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,Q=Wy(V),ve=T._f.refs||[];if(Q?ve.find(Te=>Te===V):V===T._f.ref)return;Ee(n,C,{_f:{...T._f,...Q?{refs:[...ve.filter(ti),V,...Array.isArray(H(s,C))?[{}]:[]],ref:{type:V.type,name:C}}:{ref:V}}}),k(C,!1,void 0,V)}else T=H(n,C,{}),T._f&&(T._f.mount=!1),(t.shouldUnregister||E.shouldUnregister)&&!(Td(i.array,C)&&a.action)&&i.unMount.add(C)}}},ye=()=>t.shouldFocusError&&_s(n,O,i.mount),me=C=>{xt(C)&&(v.state.next({disabled:C}),_s(n,(E,T)=>{const U=H(n,T);U&&(E.disabled=U._f.disabled||C,Array.isArray(U._f.refs)&&U._f.refs.forEach(W=>{W.disabled=U._f.disabled||C}))},0,!1))},be=(C,E)=>async T=>{let U;T&&(T.preventDefault&&T.preventDefault(),T.persist&&T.persist());let W=Qe(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:V,values:Q}=await P();r.errors=V,W=Qe(Q)}else await $(n);if(i.disabled.size)for(const V of i.disabled)qe(W,V);if(qe(r.errors,"root"),ft(r.errors)){v.state.next({errors:{}});try{await C(W,T)}catch(V){U=V}}else E&&await E({...r.errors},T),ye(),setTimeout(ye);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ft(r.errors)&&!U,submitCount:r.submitCount+1,errors:r.errors}),U)throw U},Je=(C,E={})=>{H(n,C)&&(We(E.defaultValue)?Y(C,Qe(H(s,C))):(Y(C,E.defaultValue),Ee(s,C,Qe(E.defaultValue))),E.keepTouched||qe(r.touchedFields,C),E.keepDirty||(qe(r.dirtyFields,C),r.isDirty=E.defaultValue?X(C,Qe(H(s,C))):X()),E.keepError||(qe(r.errors,C),u.isValid&&p()),v.state.next({...r}))},lt=(C,E={})=>{const T=C?Qe(C):s,U=Qe(T),W=ft(C),V=W?s:U;if(E.keepDefaultValues||(s=T),!E.keepValues){if(E.keepDirtyValues){const Q=new Set([...i.mount,...Object.keys(ws(s,o))]);for(const ve of Array.from(Q))H(r.dirtyFields,ve)?Ee(V,ve,H(o,ve)):Y(ve,H(V,ve))}else{if(Za&&We(C))for(const Q of i.mount){const ve=H(n,Q);if(ve&&ve._f){const Te=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(ko(Te)){const gt=Te.closest("form");if(gt){gt.reset();break}}}}if(E.keepFieldsRef)for(const Q of i.mount)Y(Q,H(V,Q));else n={}}o=t.shouldUnregister?E.keepDefaultValues?Qe(s):{}:Qe(V),v.array.next({values:{...V}}),v.state.next({values:{...V}})}i={mount:E.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!E.keepIsValid||!!E.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:E.keepSubmitCount?r.submitCount:0,isDirty:W?!1:E.keepDirty?r.isDirty:!!(E.keepDefaultValues&&!ir(C,s)),isSubmitted:E.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:W?{}:E.keepDirtyValues?E.keepDefaultValues&&o?ws(s,o):r.dirtyFields:E.keepDefaultValues&&C?ws(s,C):E.keepDirty?r.dirtyFields:{},touchedFields:E.keepTouched?r.touchedFields:{},errors:E.keepErrors?r.errors:{},isSubmitSuccessful:E.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Rt=(C,E)=>lt(At(C)?C(o):C,E),er=(C,E={})=>{const T=H(n,C),U=T&&T._f;if(U){const W=U.refs?U.refs[0]:U.ref;W.focus&&(W.focus(),E.shouldSelect&&At(W.select)&&W.select())}},mr=C=>{r={...r,...C}},vr={control:{register:Ae,unregister:q,getFieldState:Se,handleSubmit:be,setError:ue,_subscribe:Fe,_runSchema:P,_focusError:ye,_getWatch:A,_getDirty:X,_setValid:p,_setFieldArray:x,_setDisabledField:ke,_setErrors:w,_getFieldArray:j,_reset:lt,_resetDefaultValues:()=>At(t.defaultValues)&&t.defaultValues().then(C=>{Rt(C,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:z,_disableForm:me,_subjects:v,_proxyFormState:u,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(C){a=C},get _defaultValues(){return s},get _names(){return i},set _names(C){i=C},get _formState(){return r},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:rt,trigger:B,register:Ae,handleSubmit:be,watch:pe,setValue:Y,getValues:ae,reset:Rt,resetField:Je,clearErrors:de,unregister:q,setError:ue,setFocus:er,getFieldState:Se};return{...vr,formControl:vr}}function Cs(e={}){const t=S.useRef(void 0),r=S.useRef(void 0),[n,s]=S.useState({isDirty:!1,isValidating:!1,isLoading:At(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:At(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!At(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...i}=Jy(e);t.current={...i,formState:n}}const o=t.current.control;return o._options=e,Xa(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(i=>({...i,isReady:!0})),o._formState.isReady=!0,a},[o]),S.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),S.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),S.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),S.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),S.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==n.isDirty&&o._subjects.state.next({isDirty:a})}},[o,n.isDirty]),S.useEffect(()=>{e.values&&!ir(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),S.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Od(n,o),t.current}const Gd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=H(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Xd=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Gd(n.ref,r,e):n.refs&&n.refs.forEach(s=>Gd(s,r,e))}},Ry=(e,t)=>{t.shouldUseNativeValidation&&Xd(e,t);const r={};for(const n in e){const s=H(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(eb(t.names||Object.keys(e),n)){const a=Object.assign({},H(r,n));Ee(a,"root",o),Ee(r,n,a)}else Ee(r,n,o)}return r},eb=(e,t)=>e.some(r=>r.startsWith(t+"."));var tb=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[a]={message:i.message,type:i.code}}else r[a]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(h){return e.push(h)})}),t){var c=r[a].types,d=c&&c[n.code];r[a]=Ad(a,t,r,s,d?[].concat(d,n.message):n.message)}e.shift()}return r},Ss=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(a,i){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return o.shouldUseNativeValidation&&Xd({},o),{errors:{},values:r.raw?n:d}})}catch(d){return i(d)}return c&&c.then?c.then(void 0,i):c}(0,function(a){if(function(i){return Array.isArray(i==null?void 0:i.errors)}(a))return{values:{},errors:Ry(tb(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},Ce;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(const i of o)a[i]=s[i];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ce||(Ce={}));var Jd;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Jd||(Jd={}));const G=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=e=>{switch(typeof e){case"undefined":return G.undefined;case"string":return G.string;case"number":return Number.isNaN(e)?G.nan:G.number;case"boolean":return G.boolean;case"function":return G.function;case"bigint":return G.bigint;case"symbol":return G.symbol;case"object":return Array.isArray(e)?G.array:e===null?G.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?G.promise:typeof Map<"u"&&e instanceof Map?G.map:typeof Set<"u"&&e instanceof Set?G.set:typeof Date<"u"&&e instanceof Date?G.date:G.object;default:return G.unknown}},L=Ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class lr extends Error{get errors(){return this.issues}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}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let i=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(r(a))):i[d]=i[d]||{_errors:[]},i=i[d],c++}}};return s(this),n}static assert(t){if(!(t instanceof lr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}lr.create=e=>new lr(e);const ri=(e,t)=>{let r;switch(e.code){case L.invalid_type:e.received===G.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case L.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case L.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.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}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case L.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==="bigint"?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 L.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 L.custom:r="Invalid input";break;case L.invalid_intersection_types:r="Intersection results could not be merged";break;case L.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case L.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}};let rb=ri;function nb(){return rb}const sb=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)i=d(a,{data:t,defaultError:i}).message;return{...s,path:o,message:i}};function Z(e,t){const r=nb(),n=sb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ri?void 0:ri].filter(s=>!!s)});e.common.issues.push(n)}class _t{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 s of r){if(s.status==="aborted")return ne;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,a=await s.value;n.push({key:o,value:a})}return _t.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return ne;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}}const ne=Object.freeze({status:"aborted"}),ks=e=>({status:"dirty",value:e}),kt=e=>({status:"valid",value:e}),Rd=e=>e.status==="aborted",eu=e=>e.status==="dirty",In=e=>e.status==="valid",To=e=>typeof Promise<"u"&&e instanceof Promise;var R;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(R||(R={}));class Pr{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const tu=(e,t)=>{if(In(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 lr(e.common.issues);return this._error=r,this._error}}};function fe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=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:s}:{errorMap:(a,i)=>{const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??n??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??r??i.defaultError}},description:s}}class xe{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _t,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(To(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){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},s=this._parseSync({data:t,path:n.path,parent:n});return tu(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:r});return In(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(s=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>In(o)?{value:o.value}:{issues:r.common.issues})}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:Er(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(To(s)?s:Promise.resolve(s));return tu(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const a=t(s),i=()=>o.addIssue({code:L.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(i(),!1)):a?!0:(i(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new Vn({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}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),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Mr.create(this,this._def)}nullable(){return $n.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qt.create(this)}promise(){return Ao.create(this,this._def)}or(t){return Oo.create([this,t],this._def)}and(t){return Mo.create(this,t,this._def)}transform(t){return new Vn({...fe(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ai({...fe(this._def),innerType:this,defaultValue:r,typeName:se.ZodDefault})}brand(){return new Eb({typeName:se.ZodBranded,type:this,...fe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ii({...fe(this._def),innerType:this,catchValue:r,typeName:se.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return li.create(this,t)}readonly(){return ci.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ob=/^c[^\s-]{8,}$/i,ab=/^[0-9a-z]+$/,ib=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lb=/^[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,cb=/^[a-z0-9_-]{21}$/i,db=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ub=/^[-+]?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)?)??$/,fb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ni;const pb=/^(?:(?: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])$/,mb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,gb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ru="((\\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])))",wb=new RegExp(`^${ru}$`);function nu(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function xb(e){return new RegExp(`^${nu(e)}$`)}function _b(e){let t=`${ru}T${nu(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 Cb(e,t){return!!((t==="v4"||!t)&&pb.test(e)||(t==="v6"||!t)&&vb.test(e))}function Sb(e,t){if(!db.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function kb(e,t){return!!((t==="v4"||!t)&&mb.test(e)||(t==="v6"||!t)&&gb.test(e))}class Tr extends xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==G.string){const o=this._getOrReturnCtx(t);return Z(o,{code:L.invalid_type,expected:G.string,received:o.parsedType}),ne}const n=new _t;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:L.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&&(s=this._getOrReturnCtx(t,s),Z(s,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,i=t.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(t,s),a?Z(s,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&Z(s,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")fb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"email",code:L.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ni||(ni=new RegExp(hb,"u")),ni.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"emoji",code:L.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")lb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"uuid",code:L.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")cb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"nanoid",code:L.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ob.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cuid",code:L.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ab.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cuid2",code:L.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")ib.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"ulid",code:L.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Z(s,{validation:"url",code:L.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"regex",code:L.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)||(s=this._getOrReturnCtx(t,s),Z(s,{code:L.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)||(s=this._getOrReturnCtx(t,s),Z(s,{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),Z(s,{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?_b(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:L.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?wb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:L.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?xb(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:L.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?ub.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"duration",code:L.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Cb(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"ip",code:L.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Sb(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"jwt",code:L.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?kb(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cidr",code:L.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?yb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64",code:L.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?bb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64url",code:L.invalid_string,message:o.message}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:L.invalid_string,...R.errToObj(n)})}_addCheck(t){return new Tr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.errToObj(t)})}datetime(t){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:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...R.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,...R.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...R.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...R.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...R.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...R.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...R.errToObj(r)})}nonempty(t){return this.min(1,R.errToObj(t))}trim(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Tr({...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 isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}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}}Tr.create=e=>new Tr({checks:[],typeName:se.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});function Nb(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}class Ns extends xe{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)!==G.number){const o=this._getOrReturnCtx(t);return Z(o,{code:L.invalid_type,expected:G.number,received:o.parsedType}),ne}let n;const s=new _t;for(const o of this._def.checks)o.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:L.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Nb(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),Z(n,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:L.not_finite,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Ns({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Ns({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.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"&&Ce.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)}}Ns.create=e=>new Ns({checks:[],typeName:se.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Es extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==G.bigint)return this._getInvalidInput(t);let n;const s=new _t;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),Z(n,{code:L.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return Z(r,{code:L.invalid_type,expected:G.bigint,received:r.parsedType}),ne}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Es({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Es({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.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}}Es.create=e=>new Es({checks:[],typeName:se.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});class su extends xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==G.boolean){const n=this._getOrReturnCtx(t);return Z(n,{code:L.invalid_type,expected:G.boolean,received:n.parsedType}),ne}return kt(t.data)}}su.create=e=>new su({typeName:se.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Ps extends xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==G.date){const o=this._getOrReturnCtx(t);return Z(o,{code:L.invalid_type,expected:G.date,received:o.parsedType}),ne}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Z(o,{code:L.invalid_date}),ne}const n=new _t;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:L.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:L.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ps({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:R.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:R.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}}Ps.create=e=>new Ps({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:se.ZodDate,...fe(e)});class ou extends xe{_parse(t){if(this._getType(t)!==G.symbol){const n=this._getOrReturnCtx(t);return Z(n,{code:L.invalid_type,expected:G.symbol,received:n.parsedType}),ne}return kt(t.data)}}ou.create=e=>new ou({typeName:se.ZodSymbol,...fe(e)});class au extends xe{_parse(t){if(this._getType(t)!==G.undefined){const n=this._getOrReturnCtx(t);return Z(n,{code:L.invalid_type,expected:G.undefined,received:n.parsedType}),ne}return kt(t.data)}}au.create=e=>new au({typeName:se.ZodUndefined,...fe(e)});class iu extends xe{_parse(t){if(this._getType(t)!==G.null){const n=this._getOrReturnCtx(t);return Z(n,{code:L.invalid_type,expected:G.null,received:n.parsedType}),ne}return kt(t.data)}}iu.create=e=>new iu({typeName:se.ZodNull,...fe(e)});class Ts extends xe{constructor(){super(...arguments),this._any=!0}_parse(t){return kt(t.data)}}Ts.create=e=>new Ts({typeName:se.ZodAny,...fe(e)});class lu extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kt(t.data)}}lu.create=e=>new lu({typeName:se.ZodUnknown,...fe(e)});class Or extends xe{_parse(t){const r=this._getOrReturnCtx(t);return Z(r,{code:L.invalid_type,expected:G.never,received:r.parsedType}),ne}}Or.create=e=>new Or({typeName:se.ZodNever,...fe(e)});class cu extends xe{_parse(t){if(this._getType(t)!==G.undefined){const n=this._getOrReturnCtx(t);return Z(n,{code:L.invalid_type,expected:G.void,received:n.parsedType}),ne}return kt(t.data)}}cu.create=e=>new cu({typeName:se.ZodVoid,...fe(e)});class qt extends xe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==G.array)return Z(r,{code:L.invalid_type,expected:G.array,received:r.parsedType}),ne;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,i=r.data.length<s.exactLength.value;(a||i)&&(Z(r,{code:a?L.too_big:L.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(Z(r,{code:L.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(Z(r,{code:L.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,i)=>s.type._parseAsync(new Pr(r,a,r.path,i)))).then(a=>_t.mergeArray(n,a));const o=[...r.data].map((a,i)=>s.type._parseSync(new Pr(r,a,r.path,i)));return _t.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new qt({...this._def,minLength:{value:t,message:R.toString(r)}})}max(t,r){return new qt({...this._def,maxLength:{value:t,message:R.toString(r)}})}length(t,r){return new qt({...this._def,exactLength:{value:t,message:R.toString(r)}})}nonempty(t){return this.min(1,t)}}qt.create=(e,t)=>new qt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...fe(t)});function Fn(e){if(e instanceof Ve){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Mr.create(Fn(n))}return new Ve({...e._def,shape:()=>t})}else return e instanceof qt?new qt({...e._def,type:Fn(e.element)}):e instanceof Mr?Mr.create(Fn(e.unwrap())):e instanceof $n?$n.create(Fn(e.unwrap())):e instanceof on?on.create(e.items.map(t=>Fn(t))):e}class Ve extends xe{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=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==G.object){const d=this._getOrReturnCtx(t);return Z(d,{code:L.invalid_type,expected:G.object,received:d.parsedType}),ne}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof Or&&this._def.unknownKeys==="strip"))for(const d in s.data)a.includes(d)||i.push(d);const c=[];for(const d of a){const u=o[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Pr(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Or){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of i)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(d==="strict")i.length>0&&(Z(s,{code:L.unrecognized_keys,keys:i}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of i){const h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Pr(s,h,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const h=await u.key,v=await u.value;d.push({key:h,value:v,alwaysSet:u.alwaysSet})}return d}).then(d=>_t.mergeObjectSync(n,d)):_t.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new Ve({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,a;const s=((a=(o=this._def).errorMap)==null?void 0:a.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:R.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Ve({...this._def,unknownKeys:"strip"})}passthrough(){return new Ve({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ve({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ve({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:se.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Ve({...this._def,catchall:t})}pick(t){const r={};for(const n of Ce.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}deepPartial(){return Fn(this)}partial(t){const r={};for(const n of Ce.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new Ve({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Mr;)o=o._def.innerType;r[n]=o}return new Ve({...this._def,shape:()=>r})}keyof(){return fu(Ce.objectKeys(this.shape))}}Ve.create=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.strictCreate=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strict",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.lazycreate=(e,t)=>new Ve({shape:e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)});class Oo extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(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 a=o.map(i=>new lr(i.ctx.common.issues));return Z(r,{code:L.invalid_union,unionErrors:a}),ne}if(r.common.async)return Promise.all(n.map(async o=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of n){const d={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(c=>new lr(c));return Z(r,{code:L.invalid_union,unionErrors:i}),ne}}get options(){return this._def.options}}Oo.create=(e,t)=>new Oo({options:e,typeName:se.ZodUnion,...fe(t)});function si(e,t){const r=Er(e),n=Er(t);if(e===t)return{valid:!0,data:e};if(r===G.object&&n===G.object){const s=Ce.objectKeys(t),o=Ce.objectKeys(e).filter(i=>s.indexOf(i)!==-1),a={...e,...t};for(const i of o){const c=si(e[i],t[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===G.array&&n===G.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const a=e[o],i=t[o],c=si(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===G.date&&n===G.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Mo extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(o,a)=>{if(Rd(o)||Rd(a))return ne;const i=si(o.value,a.value);return i.valid?((eu(o)||eu(a))&&r.dirty(),{status:r.value,value:i.data}):(Z(n,{code:L.invalid_intersection_types}),ne)};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,a])=>s(o,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Mo.create=(e,t,r)=>new Mo({left:e,right:t,typeName:se.ZodIntersection,...fe(r)});class on extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==G.array)return Z(n,{code:L.invalid_type,expected:G.array,received:n.parsedType}),ne;if(n.data.length<this._def.items.length)return Z(n,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ne;!this._def.rest&&n.data.length>this._def.items.length&&(Z(n,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((a,i)=>{const c=this._def.items[i]||this._def.rest;return c?c._parse(new Pr(n,a,n.path,i)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>_t.mergeArray(r,a)):_t.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new on({...this._def,rest:t})}}on.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new on({items:e,typeName:se.ZodTuple,rest:null,...fe(t)})};class du extends xe{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!==G.map)return Z(n,{code:L.invalid_type,expected:G.map,received:n.parsedType}),ne;const s=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([i,c],d)=>({key:s._parse(new Pr(n,i,n.path,[d,"key"])),value:o._parse(new Pr(n,c,n.path,[d,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const c of a){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}})}else{const i=new Map;for(const c of a){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}}}}du.create=(e,t,r)=>new du({valueType:t,keyType:e,typeName:se.ZodMap,...fe(r)});class Os extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==G.set)return Z(n,{code:L.invalid_type,expected:G.set,received:n.parsedType}),ne;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(Z(n,{code:L.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(Z(n,{code:L.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function a(c){const d=new Set;for(const u of c){if(u.status==="aborted")return ne;u.status==="dirty"&&r.dirty(),d.add(u.value)}return{status:r.value,value:d}}const i=[...n.data.values()].map((c,d)=>o._parse(new Pr(n,c,n.path,d)));return n.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(t,r){return new Os({...this._def,minSize:{value:t,message:R.toString(r)}})}max(t,r){return new Os({...this._def,maxSize:{value:t,message:R.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Os.create=(e,t)=>new Os({valueType:e,minSize:null,maxSize:null,typeName:se.ZodSet,...fe(t)});class uu extends xe{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})}}uu.create=(e,t)=>new uu({getter:e,typeName:se.ZodLazy,...fe(t)});class oi extends xe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return Z(r,{received:r.data,code:L.invalid_literal,expected:this._def.value}),ne}return{status:"valid",value:t.data}}get value(){return this._def.value}}oi.create=(e,t)=>new oi({value:e,typeName:se.ZodLiteral,...fe(t)});function fu(e,t){return new Ln({values:e,typeName:se.ZodEnum,...fe(t)})}class Ln extends xe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{expected:Ce.joinValues(n),received:r.parsedType,code:L.invalid_type}),ne}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{received:r.data,code:L.invalid_enum_value,options:n}),ne}return kt(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 Ln.create(t,{...this._def,...r})}exclude(t,r=this._def){return Ln.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ln.create=fu;class hu extends xe{_parse(t){const r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==G.string&&n.parsedType!==G.number){const s=Ce.objectValues(r);return Z(n,{expected:Ce.joinValues(s),received:n.parsedType,code:L.invalid_type}),ne}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ce.objectValues(r);return Z(n,{received:n.data,code:L.invalid_enum_value,options:s}),ne}return kt(t.data)}get enum(){return this._def.values}}hu.create=(e,t)=>new hu({values:e,typeName:se.ZodNativeEnum,...fe(t)});class Ao extends xe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==G.promise&&r.common.async===!1)return Z(r,{code:L.invalid_type,expected:G.promise,received:r.parsedType}),ne;const n=r.parsedType===G.promise?r.data:Promise.resolve(r.data);return kt(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Ao.create=(e,t)=>new Ao({type:e,typeName:se.ZodPromise,...fe(t)});class Vn extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{Z(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async i=>{if(r.value==="aborted")return ne;const c=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return c.status==="aborted"?ne:c.status==="dirty"||r.value==="dirty"?ks(c.value):c});{if(r.value==="aborted")return ne;const i=this._def.schema._parseSync({data:a,path:n.path,parent:n});return i.status==="aborted"?ne:i.status==="dirty"||r.value==="dirty"?ks(i.value):i}}if(s.type==="refinement"){const a=i=>{const c=s.refinement(i,o);if(n.common.async)return Promise.resolve(c);if(c 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"?ne:(i.status==="dirty"&&r.dirty(),a(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"?ne:(i.status==="dirty"&&r.dirty(),a(i.value).then(()=>({status:r.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!In(a))return ne;const i=s.transform(a.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(a=>In(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:r.value,value:i})):ne);Ce.assertNever(s)}}Vn.create=(e,t,r)=>new Vn({schema:e,typeName:se.ZodEffects,effect:t,...fe(r)}),Vn.createWithPreprocess=(e,t,r)=>new Vn({schema:t,effect:{type:"preprocess",transform:e},typeName:se.ZodEffects,...fe(r)});class Mr extends xe{_parse(t){return this._getType(t)===G.undefined?kt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:se.ZodOptional,...fe(t)});class $n extends xe{_parse(t){return this._getType(t)===G.null?kt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$n.create=(e,t)=>new $n({innerType:e,typeName:se.ZodNullable,...fe(t)});class ai extends xe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===G.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ai.create=(e,t)=>new ai({innerType:e,typeName:se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...fe(t)});class ii extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return To(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ii.create=(e,t)=>new ii({innerType:e,typeName:se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...fe(t)});class pu extends xe{_parse(t){if(this._getType(t)!==G.nan){const n=this._getOrReturnCtx(t);return Z(n,{code:L.invalid_type,expected:G.nan,received:n.parsedType}),ne}return{status:"valid",value:t.data}}}pu.create=e=>new pu({typeName:se.ZodNaN,...fe(e)});class Eb extends xe{_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 li extends xe{_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"?ne:o.status==="dirty"?(r.dirty(),ks(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ne:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new li({in:t,out:r,typeName:se.ZodPipeline})}}class ci extends xe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(In(s)&&(s.value=Object.freeze(s.value)),s);return To(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}ci.create=(e,t)=>new ci({innerType:e,typeName:se.ZodReadonly,...fe(t)});function mu(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Pb(e,t={},r){return e?Ts.create().superRefine((n,s)=>{const o=e(n);if(o instanceof Promise)return o.then(a=>{if(!a){const i=mu(t,n),c=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:c})}});if(!o){const a=mu(t,n),i=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:i})}}):Ts.create()}Ve.lazycreate;var se;(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"})(se||(se={}));const di=(e,t={message:`Input not instance of ${e.name}`})=>Pb(r=>r instanceof e,t),et=Tr.create,vu=Ps.create;Ts.create,Or.create,qt.create;const Ms=Ve.create;Ve.strictCreate,Oo.create,Mo.create,on.create;const Tb=oi.create;Ln.create,Ao.create,Mr.create,$n.create;const As=Fy,gu=m.createContext({}),Ze=({...e})=>l.jsx(gu.Provider,{value:{name:e.name},children:l.jsx(By,{...e})}),Do=()=>{const e=m.useContext(gu),t=m.useContext(yu),{getFieldState:r,formState:n}=So(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},yu=m.createContext({}),je=m.forwardRef(({className:e,...t},r)=>{const n=m.useId();return l.jsx(yu.Provider,{value:{id:n},children:l.jsx("div",{ref:r,className:he("space-y-2",e),...t})})});je.displayName="FormItem";const Ue=m.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Do();return l.jsx(nn,{ref:r,className:he(n&&"text-destructive",e),htmlFor:s,...t})});Ue.displayName="FormLabel";const He=m.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Do();return l.jsx(hl,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});He.displayName="FormControl";const Ob=m.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Do();return l.jsx("p",{ref:r,id:n,className:he("text-sm text-muted-foreground",e),...t})});Ob.displayName="FormDescription";const ze=m.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Do(),a=s?String(s==null?void 0:s.message):t;return a?l.jsx("p",{ref:n,id:o,className:he("text-sm font-medium text-destructive",e),...r,children:a}):null});ze.displayName="FormMessage";const Mb=Ms({bank_statement:di(File).optional().refine(e=>e!==void 0,"Bank statement is required"),company_structure:di(File).optional().refine(e=>e!==void 0,"Company structure document is required"),certificate_of_registration:di(File).optional().refine(e=>e!==void 0,"Certificate of registration is required")}),Ab=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=S.useRef(null),a=S.useRef(null),i=S.useRef(null),c=Cs({resolver:Ss(Mb),defaultValues:{bank_statement:e.bank_statement||void 0,company_structure:e.company_structure||void 0,certificate_of_registration:e.certificate_of_registration||void 0}}),d=v=>{t(v),r()},u=(v,f)=>{c.setValue(v,f),t({[v]:f})},h=({field:v,label:f,description:b,inputRef:p})=>{const g=c.watch(v);return l.jsx(Ze,{control:c.control,name:v,render:()=>l.jsxs(je,{children:[l.jsx(Ue,{children:f}),l.jsx(He,{children:l.jsxs("div",{className:"border-2 border-dashed border-muted-foreground/25 rounded-lg p-6",children:[l.jsx("input",{ref:p,type:"file",accept:".pdf,.jpg,.jpeg,.png,.doc,.docx",className:"hidden",onChange:x=>{var w;const y=((w=x.target.files)==null?void 0:w[0])||null;u(v,y)}}),g?l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Vp,{className:"w-5 h-5 text-primary"}),l.jsx("span",{className:"text-sm font-medium",children:g.name})]}),l.jsx(Ye,{type:"button",variant:"ghost",size:"sm",onClick:()=>{u(v,null),p.current&&(p.current.value="")},children:l.jsx(Jl,{className:"w-4 h-4"})})]}):l.jsxs("div",{className:"text-center cursor-pointer",onClick:()=>{var x;return(x=p.current)==null?void 0:x.click()},children:[l.jsx(Bp,{className:"w-8 h-8 mx-auto mb-2 text-muted-foreground"}),l.jsx("p",{className:"font-medium",children:f}),l.jsx("p",{className:"text-sm text-muted-foreground",children:b}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Supported: PDF, JPG, PNG, DOC, DOCX"})]})]})}),l.jsx(ze,{})]})})};return l.jsxs(dt,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Documents",subTitle:"Please upload the required company documents",onBack:n})}),l.jsxs(ut,{children:[l.jsx(As,{...c,children:l.jsxs("form",{onSubmit:c.handleSubmit(d),className:"space-y-6",children:[l.jsx(h,{field:"bank_statement",label:"Bank Statement",description:"Upload your latest bank statement",inputRef:o}),l.jsx(h,{field:"company_structure",label:"Company Structure",description:"Upload document showing directors & legal representatives",inputRef:a}),l.jsx(h,{field:"certificate_of_registration",label:"Certificate of Registration",description:"Upload your company's certificate of registration",inputRef:i}),l.jsx(Ye,{type:"submit",className:"w-full",children:"Complete Verification"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function bu(e,[t,r]){return Math.min(r,Math.max(t,e))}var Db=m.createContext(void 0);function Ib(e){const t=m.useContext(Db);return e||t||"ltr"}var ui=0;function wu(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xu()),document.body.insertAdjacentElement("beforeend",e[1]??xu()),ui++,()=>{ui===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ui--}},[])}function xu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fi="focusScope.autoFocusOnMount",hi="focusScope.autoFocusOnUnmount",_u={bubbles:!1,cancelable:!0},Fb="FocusScope",pi=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,c]=m.useState(null),d=Et(s),u=Et(o),h=m.useRef(null),v=Ie(t,p=>c(p)),f=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let p=function(w){if(f.paused||!i)return;const k=w.target;i.contains(k)?h.current=k:Ar(h.current,{select:!0})},g=function(w){if(f.paused||!i)return;const k=w.relatedTarget;k!==null&&(i.contains(k)||Ar(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const N of w)N.removedNodes.length>0&&Ar(i)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(x);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[n,i,f.paused]),m.useEffect(()=>{if(i){ku.add(f);const p=document.activeElement;if(!i.contains(p)){const x=new CustomEvent(fi,_u);i.addEventListener(fi,d),i.dispatchEvent(x),x.defaultPrevented||(Lb(jb(Cu(i)),{select:!0}),document.activeElement===p&&Ar(i))}return()=>{i.removeEventListener(fi,d),setTimeout(()=>{const x=new CustomEvent(hi,_u);i.addEventListener(hi,u),i.dispatchEvent(x),x.defaultPrevented||Ar(p??document.body,{select:!0}),i.removeEventListener(hi,u),ku.remove(f)},0)}}},[i,d,u,f]);const b=m.useCallback(p=>{if(!r&&!n||f.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(g&&x){const y=p.currentTarget,[w,k]=Vb(y);w&&k?!p.shiftKey&&x===k?(p.preventDefault(),r&&Ar(w,{select:!0})):p.shiftKey&&x===w&&(p.preventDefault(),r&&Ar(k,{select:!0})):x===y&&p.preventDefault()}},[r,n,f.paused]);return l.jsx(we.div,{tabIndex:-1,...a,ref:v,onKeyDown:b})});pi.displayName=Fb;function Lb(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ar(n,{select:t}),document.activeElement!==r)return}function Vb(e){const t=Cu(e),r=Su(t,e),n=Su(t.reverse(),e);return[r,n]}function Cu(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Su(e,t){for(const r of e)if(!$b(r,{upTo:t}))return r}function $b(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bb(e){return e instanceof HTMLInputElement&&"select"in e}function Ar(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Bb(e)&&t&&e.select()}}var ku=Wb();function Wb(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Nu(e,t),e.unshift(t)},remove(t){var r;e=Nu(e,t),(r=e[0])==null||r.resume()}}}function Nu(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function jb(e){return e.filter(t=>t.tagName!=="A")}function Ub(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Hb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Bn=new WeakMap,Io=new WeakMap,Fo={},mi=0,Eu=function(e){return e&&(e.host||Eu(e.parentNode))},zb=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Eu(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Yb=function(e,t,r,n){var s=zb(t,Array.isArray(e)?e:[e]);Fo[r]||(Fo[r]=new WeakMap);var o=Fo[r],a=[],i=new Set,c=new Set(s),d=function(h){!h||i.has(h)||(i.add(h),d(h.parentNode))};s.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(v){if(i.has(v))u(v);else try{var f=v.getAttribute(n),b=f!==null&&f!=="false",p=(Bn.get(v)||0)+1,g=(o.get(v)||0)+1;Bn.set(v,p),o.set(v,g),a.push(v),p===1&&b&&Io.set(v,!0),g===1&&v.setAttribute(r,"true"),b||v.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return u(t),i.clear(),mi++,function(){a.forEach(function(h){var v=Bn.get(h)-1,f=o.get(h)-1;Bn.set(h,v),o.set(h,f),v||(Io.has(h)||h.removeAttribute(n),Io.delete(h)),f||h.removeAttribute(r)}),mi--,mi||(Bn=new WeakMap,Bn=new WeakMap,Io=new WeakMap,Fo={})}},Pu=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=Hb(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),Yb(n,s,r,"aria-hidden")):function(){return null}},Zt=function(){return Zt=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Zt.apply(this,arguments)};function Tu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function qb(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Lo="right-scroll-bar-position",Vo="width-before-scroll-bar",Zb="with-scroll-bars-hidden",Kb="--removed-body-scroll-bar-size";function vi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qb(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Gb=typeof window<"u"?m.useLayoutEffect:m.useEffect,Ou=new WeakMap;function Xb(e,t){var r=Qb(null,function(n){return e.forEach(function(s){return vi(s,n)})});return Gb(function(){var n=Ou.get(r);if(n){var s=new Set(n),o=new Set(e),a=r.current;s.forEach(function(i){o.has(i)||vi(i,null)}),o.forEach(function(i){s.has(i)||vi(i,a)})}Ou.set(r,e)},[e]),r}function Jb(e){return e}function Rb(e,t){t===void 0&&(t=Jb);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var a=t(o,n);return r.push(a),function(){r=r.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(n=!0;r.length;){var a=r;r=[],a.forEach(o)}r={push:function(i){return o(i)},filter:function(){return r}}},assignMedium:function(o){n=!0;var a=[];if(r.length){var i=r;r=[],i.forEach(o),a=r}var c=function(){var u=a;a=[],u.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),r}}}};return s}function ew(e){e===void 0&&(e={});var t=Rb(null);return t.options=Zt({async:!0,ssr:!1},e),t}var Mu=function(e){var t=e.sideCar,r=Tu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return m.createElement(n,Zt({},r))};Mu.isSideCarExport=!0;function tw(e,t){return e.useMedium(t),Mu}var Au=ew(),gi=function(){},$o=m.forwardRef(function(e,t){var r=m.useRef(null),n=m.useState({onScrollCapture:gi,onWheelCapture:gi,onTouchMoveCapture:gi}),s=n[0],o=n[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,v=e.sideCar,f=e.noRelative,b=e.noIsolation,p=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,k=Tu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,M=Xb([r,t]),P=Zt(Zt({},k),s);return m.createElement(m.Fragment,null,u&&m.createElement(N,{sideCar:Au,removeScrollBar:d,shards:h,noRelative:f,noIsolation:b,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:r,gapMode:w}),a?m.cloneElement(m.Children.only(i),Zt(Zt({},P),{ref:M})):m.createElement(y,Zt({},P,{className:c,ref:M}),i))});$o.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$o.classNames={fullWidth:Vo,zeroRight:Lo};var rw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rw();return t&&e.setAttribute("nonce",t),e}function sw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ow(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aw=function(){var e=0,t=null;return{add:function(r){e==0&&(t=nw())&&(sw(t,r),ow(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iw=function(){var e=aw();return function(t,r){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Du=function(){var e=iw(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},lw={left:0,top:0,right:0,gap:0},yi=function(e){return parseInt(e||"",10)||0},cw=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[yi(r),yi(n),yi(s)]},dw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lw;var t=cw(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},uw=Du(),Wn="data-scroll-locked",fw=function(e,t,r,n){var s=e.left,o=e.top,a=e.right,i=e.gap;return r===void 0&&(r="margin"),`
103
- .`.concat(Zb,` {
101
+ */const Rl=tt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ma="-",zp=e=>{const t=qp(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(ma);return i[0]===""&&i.length!==1&&i.shift(),ec(i,t)||Yp(a)},getConflictingClassGroupIds:(a,i)=>{const c=r[a]||[];return i&&n[a]?[...c,...n[a]]:c}}},ec=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?ec(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(ma);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},tc=/^\[(.+)\]$/,Yp=e=>{if(tc.test(e)){const t=tc.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},qp=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Kp(Object.entries(e.classGroups),r).forEach(([o,a])=>{va(a,n,o,t)}),n},va=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:rc(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(Zp(s)){va(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{va(a,rc(t,o),r,n)})})},rc=(e,t)=>{let r=e;return t.split(ma).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Zp=e=>e.isThemeGetter,Kp=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,Qp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},nc="!",Gp=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const c=[];let d=0,u=0,h;for(let g=0;g<i.length;g++){let x=i[g];if(d===0){if(x===s&&(n||i.slice(g,g+o)===t)){c.push(i.slice(u,g)),u=g+o;continue}if(x==="/"){h=g;continue}}x==="["?d++:x==="]"&&d--}const v=c.length===0?i:i.substring(u),f=v.startsWith(nc),b=f?v.substring(1):v,p=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:b,maybePostfixModifierPosition:p}};return r?i=>r({className:i,parseClassName:a}):a},Xp=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Jp=e=>({cache:Qp(e.cacheSize),parseClassName:Gp(e),...zp(e)}),Rp=/\s+/,em=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(Rp);let i="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:f}=r(d);let b=!!f,p=n(b?v.substring(0,f):v);if(!p){if(!b){i=d+(i.length>0?" "+i:i);continue}if(p=n(v),!p){i=d+(i.length>0?" "+i:i);continue}b=!1}const g=Xp(u).join(":"),x=h?g+nc:g,y=x+p;if(o.includes(y))continue;o.push(y);const w=s(p,b);for(let k=0;k<w.length;++k){const N=w[k];o.push(x+N)}i=d+(i.length>0?" "+i:i)}return i};function tm(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=sc(t))&&(n&&(n+=" "),n+=r);return n}const sc=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=sc(e[n]))&&(r&&(r+=" "),r+=t);return r};function rm(e,...t){let r,n,s,o=a;function a(c){const d=t.reduce((u,h)=>h(u),e());return r=Jp(d),n=r.cache.get,s=r.cache.set,o=i,i(c)}function i(c){const d=n(c);if(d)return d;const u=em(c,r);return s(c,u),u}return function(){return o(tm.apply(null,arguments))}}const De=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},oc=/^\[(?:([a-z-]+):)?(.+)\]$/i,nm=/^\d+\/\d+$/,sm=new Set(["px","full","screen"]),om=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,am=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,im=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>Sn(e)||sm.has(e)||nm.test(e),wr=e=>kn(e,"length",gm),Sn=e=>!!e&&!Number.isNaN(Number(e)),ga=e=>kn(e,"number",Sn),ps=e=>!!e&&Number.isInteger(Number(e)),dm=e=>e.endsWith("%")&&Sn(e.slice(0,-1)),le=e=>oc.test(e),xr=e=>om.test(e),um=new Set(["length","size","percentage"]),fm=e=>kn(e,um,ac),hm=e=>kn(e,"position",ac),pm=new Set(["image","url"]),mm=e=>kn(e,pm,bm),vm=e=>kn(e,"",ym),ms=()=>!0,kn=(e,t,r)=>{const n=oc.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},gm=e=>am.test(e)&&!im.test(e),ac=()=>!1,ym=e=>lm.test(e),bm=e=>cm.test(e),wm=rm(()=>{const e=De("colors"),t=De("spacing"),r=De("blur"),n=De("brightness"),s=De("borderColor"),o=De("borderRadius"),a=De("borderSpacing"),i=De("borderWidth"),c=De("contrast"),d=De("grayscale"),u=De("hueRotate"),h=De("invert"),v=De("gap"),f=De("gradientColorStops"),b=De("gradientColorStopPositions"),p=De("inset"),g=De("margin"),x=De("opacity"),y=De("padding"),w=De("saturate"),k=De("scale"),N=De("sepia"),O=De("skew"),A=De("space"),V=De("translate"),L=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",le,t],P=()=>[le,t],H=()=>["",nr,wr],I=()=>["auto",Sn,le],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",le],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Se=()=>[Sn,le];return{cacheSize:500,separator:":",theme:{colors:[ms],spacing:[nr,wr],blur:["none","",xr,le],brightness:Se(),borderColor:[e],borderRadius:["none","","full",xr,le],borderSpacing:P(),borderWidth:H(),contrast:Se(),grayscale:W(),hueRotate:Se(),invert:W(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[dm,wr],inset:F(),margin:F(),opacity:Se(),padding:P(),saturate:Se(),scale:Se(),sepia:W(),skew:Se(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[xr]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),le]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ps,le]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",ps,le]}],"grid-cols":[{"grid-cols":[ms]}],"col-start-end":[{col:["auto",{span:["full",ps,le]},le]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[ms]}],"row-start-end":[{row:["auto",{span:[ps,le]},le]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[xr]},xr]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xr,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ga]}],"font-family":[{font:[ms]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",le]}],"line-clamp":[{"line-clamp":["none",Sn,ga]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,wr]}],"underline-offset":[{"underline-offset":["auto",nr,le]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),hm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:q()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[nr,le]}],"outline-w":[{outline:[nr,wr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[nr,wr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xr,vm]}],"shadow-color":[{shadow:[ms]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",xr,le]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",le]}],duration:[{duration:Se()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:Se()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[ps,le]}],"translate-x":[{"translate-x":[V]}],"translate-y":[{"translate-y":[V]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,wr,ga]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function he(...e){return wm(zl(e))}const xm=Op,ic=m.forwardRef(({className:e,...t},r)=>l.jsx(Vl,{ref:r,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ic.displayName=Vl.displayName;const _m=pa("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),lc=m.forwardRef(({className:e,variant:t,...r},n)=>l.jsx($l,{ref:n,className:he(_m({variant:t}),e),...r}));lc.displayName=$l.displayName;const Cm=m.forwardRef(({className:e,...t},r)=>l.jsx(jl,{ref:r,className:he("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Cm.displayName=jl.displayName;const cc=m.forwardRef(({className:e,...t},r)=>l.jsx(Ul,{ref:r,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(Rl,{className:"h-4 w-4"})}));cc.displayName=Ul.displayName;const dc=m.forwardRef(({className:e,...t},r)=>l.jsx(Bl,{ref:r,className:he("text-sm font-semibold",e),...t}));dc.displayName=Bl.displayName;const uc=m.forwardRef(({className:e,...t},r)=>l.jsx(Wl,{ref:r,className:he("text-sm opacity-90",e),...t}));uc.displayName=Wl.displayName;function Sm(){const{toasts:e}=Xs();return l.jsxs(xm,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return l.jsxs(lc,{...o,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(dc,{children:r}),n&&l.jsx(uc,{children:n})]}),s,l.jsx(cc,{})]},t)}),l.jsx(ic,{})]})}var fc=["light","dark"],km="(prefers-color-scheme: dark)",Nm=m.createContext(void 0),Em={setTheme:e=>{},themes:[]},Pm=()=>{var e;return(e=m.useContext(Nm))!=null?e:Em};m.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:a,attrs:i,nonce:c})=>{let d=o==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${i.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?fc.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",v=(b,p=!1,g=!0)=>{let x=a?a[b]:b,y=p?b+"|| ''":`'${x}'`,w="";return s&&g&&!p&&fc.includes(b)&&(w+=`d.style.colorScheme = '${b}';`),r==="class"?p||x?w+=`c.add(${y})`:w+="null":x&&(w+=`d[s](n,${y})`),w},f=e?`!function(){${u}${v(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${km}',m=window.matchMedia(t);if(m.media!==t||m.matches){${v("dark")}}else{${v("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}${d?"":"else{"+v(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}else{${v(o,!1,!1)};}${h}}catch(t){}}();`;return m.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var Tm=e=>{switch(e){case"success":return Am;case"info":return Im;case"warning":return Dm;case"error":return Fm;default:return null}},Om=Array(12).fill(0),Mm=({visible:e,className:t})=>S.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},S.createElement("div",{className:"sonner-spinner"},Om.map((r,n)=>S.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Am=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Dm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Im=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Fm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Lm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),S.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Vm=()=>{let[e,t]=S.useState(document.hidden);return S.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},ya=1,$m=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:ya++,o=this.toasts.find(i=>i.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(i=>i.id===s?(this.publish({...i,...e,id:s,title:r}),{...i,...e,id:s,dismissible:a,title:r}):i):this.addToast({title:r,...n,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,a=n.then(async c=>{if(o=["resolve",c],S.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(Wm(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),i=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:i}:Object.assign(r,{unwrap:i})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||ya++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ut=new $m,Bm=(e,t)=>{let r=(t==null?void 0:t.id)||ya++;return ut.addToast({title:e,...t,id:r}),r},Wm=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jm=Bm,Um=()=>ut.toasts,Hm=()=>ut.getActiveToasts();Object.assign(jm,{success:ut.success,info:ut.info,warning:ut.warning,error:ut.error,custom:ut.custom,message:ut.message,promise:ut.promise,dismiss:ut.dismiss,loading:ut.loading},{getHistory:Um,getToasts:Hm});function zm(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}zm(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
102
+ `);function so(e){return e.label!==void 0}var Ym=3,qm="32px",Zm="16px",hc=4e3,Km=356,Qm=14,Gm=20,Xm=200;function Pt(...e){return e.filter(Boolean).join(" ")}function Jm(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var Rm=e=>{var t,r,n,s,o,a,i,c,d,u,h;let{invert:v,toast:f,unstyled:b,interacting:p,setHeights:g,visibleToasts:x,heights:y,index:w,toasts:k,expanded:N,removeToast:O,defaultRichColors:A,closeButton:V,style:L,cancelButtonStyle:U,actionButtonStyle:F,className:P="",descriptionClassName:H="",duration:I,position:J,gap:q,loadingIcon:D,expandByDefault:M,classNames:W,icons:ae,closeButtonAriaLabel:Se="Close toast",pauseWhenPageIsHidden:de}=e,[ue,pe]=S.useState(null),[Fe,rt]=S.useState(null),[Z,ke]=S.useState(!1),[Ae,ye]=S.useState(!1),[me,be]=S.useState(!1),[Je,dt]=S.useState(!1),[Rt,er]=S.useState(!1),[mr,ls]=S.useState(0),[vr,C]=S.useState(0),E=S.useRef(f.duration||I||hc),T=S.useRef(null),z=S.useRef(null),j=w===0,B=w+1<=x,G=f.type,ve=f.dismissible!==!1,Te=f.className||"",gt=f.descriptionClassName||"",gr=S.useMemo(()=>y.findIndex(oe=>oe.toastId===f.id)||0,[y,f.id]),tr=S.useMemo(()=>{var oe;return(oe=f.closeButton)!=null?oe:V},[f.closeButton,V]),Ro=S.useMemo(()=>f.duration||I||hc,[f.duration,I]),xn=S.useRef(0),rr=S.useRef(0),ea=S.useRef(0),yr=S.useRef(null),[Ri,ta]=J.split("-"),Dh=S.useMemo(()=>y.reduce((oe,Oe,Le)=>Le>=gr?oe:oe+Oe.height,0),[y,gr]),Ih=Vm(),xC=f.invert||v,el=G==="loading";rr.current=S.useMemo(()=>gr*q+Dh,[gr,Dh]),S.useEffect(()=>{E.current=Ro},[Ro]),S.useEffect(()=>{ke(!0)},[]),S.useEffect(()=>{let oe=z.current;if(oe){let Oe=oe.getBoundingClientRect().height;return C(Oe),g(Le=>[{toastId:f.id,height:Oe,position:f.position},...Le]),()=>g(Le=>Le.filter($t=>$t.toastId!==f.id))}},[g,f.id]),S.useLayoutEffect(()=>{if(!Z)return;let oe=z.current,Oe=oe.style.height;oe.style.height="auto";let Le=oe.getBoundingClientRect().height;oe.style.height=Oe,C(Le),g($t=>$t.find(Bt=>Bt.toastId===f.id)?$t.map(Bt=>Bt.toastId===f.id?{...Bt,height:Le}:Bt):[{toastId:f.id,height:Le,position:f.position},...$t])},[Z,f.title,f.description,g,f.id]);let Kr=S.useCallback(()=>{ye(!0),ls(rr.current),g(oe=>oe.filter(Oe=>Oe.toastId!==f.id)),setTimeout(()=>{O(f)},Xm)},[f,O,g,rr]);S.useEffect(()=>{if(f.promise&&G==="loading"||f.duration===1/0||f.type==="loading")return;let oe;return N||p||de&&Ih?(()=>{if(ea.current<xn.current){let Oe=new Date().getTime()-xn.current;E.current=E.current-Oe}ea.current=new Date().getTime()})():E.current!==1/0&&(xn.current=new Date().getTime(),oe=setTimeout(()=>{var Oe;(Oe=f.onAutoClose)==null||Oe.call(f,f),Kr()},E.current)),()=>clearTimeout(oe)},[N,p,f,G,de,Ih,Kr]),S.useEffect(()=>{f.delete&&Kr()},[Kr,f.delete]);function _C(){var oe,Oe,Le;return ae!=null&&ae.loading?S.createElement("div",{className:Pt(W==null?void 0:W.loader,(oe=f==null?void 0:f.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":G==="loading"},ae.loading):D?S.createElement("div",{className:Pt(W==null?void 0:W.loader,(Oe=f==null?void 0:f.classNames)==null?void 0:Oe.loader,"sonner-loader"),"data-visible":G==="loading"},D):S.createElement(Mm,{className:Pt(W==null?void 0:W.loader,(Le=f==null?void 0:f.classNames)==null?void 0:Le.loader),visible:G==="loading"})}return S.createElement("li",{tabIndex:0,ref:z,className:Pt(P,Te,W==null?void 0:W.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,W==null?void 0:W.default,W==null?void 0:W[G],(r=f==null?void 0:f.classNames)==null?void 0:r[G]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:A,"data-styled":!(f.jsx||f.unstyled||b),"data-mounted":Z,"data-promise":!!f.promise,"data-swiped":Rt,"data-removed":Ae,"data-visible":B,"data-y-position":Ri,"data-x-position":ta,"data-index":w,"data-front":j,"data-swiping":me,"data-dismissible":ve,"data-type":G,"data-invert":xC,"data-swipe-out":Je,"data-swipe-direction":Fe,"data-expanded":!!(N||M&&Z),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${Ae?mr:rr.current}px`,"--initial-height":M?"auto":`${vr}px`,...L,...f.style},onDragEnd:()=>{be(!1),pe(null),yr.current=null},onPointerDown:oe=>{el||!ve||(T.current=new Date,ls(rr.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(be(!0),yr.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Oe,Le,$t;if(Je||!ve)return;yr.current=null;let Bt=Number(((oe=z.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qr=Number(((Oe=z.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_n=new Date().getTime()-((Le=T.current)==null?void 0:Le.getTime()),Wt=ue==="x"?Bt:Qr,Gr=Math.abs(Wt)/_n;if(Math.abs(Wt)>=Gm||Gr>.11){ls(rr.current),($t=f.onDismiss)==null||$t.call(f,f),rt(ue==="x"?Bt>0?"right":"left":Qr>0?"down":"up"),Kr(),dt(!0),er(!1);return}be(!1),pe(null)},onPointerMove:oe=>{var Oe,Le,$t,Bt;if(!yr.current||!ve||((Oe=window.getSelection())==null?void 0:Oe.toString().length)>0)return;let Qr=oe.clientY-yr.current.y,_n=oe.clientX-yr.current.x,Wt=(Le=e.swipeDirections)!=null?Le:Jm(J);!ue&&(Math.abs(_n)>1||Math.abs(Qr)>1)&&pe(Math.abs(_n)>Math.abs(Qr)?"x":"y");let Gr={x:0,y:0};ue==="y"?(Wt.includes("top")||Wt.includes("bottom"))&&(Wt.includes("top")&&Qr<0||Wt.includes("bottom")&&Qr>0)&&(Gr.y=Qr):ue==="x"&&(Wt.includes("left")||Wt.includes("right"))&&(Wt.includes("left")&&_n<0||Wt.includes("right")&&_n>0)&&(Gr.x=_n),(Math.abs(Gr.x)>0||Math.abs(Gr.y)>0)&&er(!0),($t=z.current)==null||$t.style.setProperty("--swipe-amount-x",`${Gr.x}px`),(Bt=z.current)==null||Bt.style.setProperty("--swipe-amount-y",`${Gr.y}px`)}},tr&&!f.jsx?S.createElement("button",{"aria-label":Se,"data-disabled":el,"data-close-button":!0,onClick:el||!ve?()=>{}:()=>{var oe;Kr(),(oe=f.onDismiss)==null||oe.call(f,f)},className:Pt(W==null?void 0:W.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},(o=ae==null?void 0:ae.close)!=null?o:Lm):null,f.jsx||S.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:S.createElement(S.Fragment,null,G||f.icon||f.promise?S.createElement("div",{"data-icon":"",className:Pt(W==null?void 0:W.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||_C():null,f.type!=="loading"?f.icon||(ae==null?void 0:ae[G])||Tm(G):null):null,S.createElement("div",{"data-content":"",className:Pt(W==null?void 0:W.content,(i=f==null?void 0:f.classNames)==null?void 0:i.content)},S.createElement("div",{"data-title":"",className:Pt(W==null?void 0:W.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?S.createElement("div",{"data-description":"",className:Pt(H,gt,W==null?void 0:W.description,(d=f==null?void 0:f.classNames)==null?void 0:d.description)},typeof f.description=="function"?f.description():f.description):null),S.isValidElement(f.cancel)?f.cancel:f.cancel&&so(f.cancel)?S.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||U,onClick:oe=>{var Oe,Le;so(f.cancel)&&ve&&((Le=(Oe=f.cancel).onClick)==null||Le.call(Oe,oe),Kr())},className:Pt(W==null?void 0:W.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,S.isValidElement(f.action)?f.action:f.action&&so(f.action)?S.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||F,onClick:oe=>{var Oe,Le;so(f.action)&&((Le=(Oe=f.action).onClick)==null||Le.call(Oe,oe),!oe.defaultPrevented&&Kr())},className:Pt(W==null?void 0:W.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function pc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ev(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",i=o?Zm:qm;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${a}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${a}-${d}`]=i:r[`${a}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(i)}),r}var tv=S.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:i,offset:c,mobileOffset:d,theme:u="light",richColors:h,duration:v,style:f,visibleToasts:b=Ym,toastOptions:p,dir:g=pc(),gap:x=Qm,loadingIcon:y,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:N}=e,[O,A]=S.useState([]),V=S.useMemo(()=>Array.from(new Set([n].concat(O.filter(de=>de.position).map(de=>de.position)))),[O,n]),[L,U]=S.useState([]),[F,P]=S.useState(!1),[H,I]=S.useState(!1),[J,q]=S.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=S.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=S.useRef(null),ae=S.useRef(!1),Se=S.useCallback(de=>{A(ue=>{var pe;return(pe=ue.find(Fe=>Fe.id===de.id))!=null&&pe.delete||ut.dismiss(de.id),ue.filter(({id:Fe})=>Fe!==de.id)})},[]);return S.useEffect(()=>ut.subscribe(de=>{if(de.dismiss){A(ue=>ue.map(pe=>pe.id===de.id?{...pe,delete:!0}:pe));return}setTimeout(()=>{Ge.flushSync(()=>{A(ue=>{let pe=ue.findIndex(Fe=>Fe.id===de.id);return pe!==-1?[...ue.slice(0,pe),{...ue[pe],...de},...ue.slice(pe+1)]:[de,...ue]})})})}),[]),S.useEffect(()=>{if(u!=="system"){q(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let de=window.matchMedia("(prefers-color-scheme: dark)");try{de.addEventListener("change",({matches:ue})=>{q(ue?"dark":"light")})}catch{de.addListener(({matches:pe})=>{try{q(pe?"dark":"light")}catch(Fe){console.error(Fe)}})}},[u]),S.useEffect(()=>{O.length<=1&&P(!1)},[O]),S.useEffect(()=>{let de=ue=>{var pe,Fe;s.every(rt=>ue[rt]||ue.code===rt)&&(P(!0),(pe=D.current)==null||pe.focus()),ue.code==="Escape"&&(document.activeElement===D.current||(Fe=D.current)!=null&&Fe.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",de),()=>document.removeEventListener("keydown",de)},[s]),S.useEffect(()=>{if(D.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,ae.current=!1)}},[D.current]),S.createElement("section",{ref:t,"aria-label":`${k} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},V.map((de,ue)=>{var pe;let[Fe,rt]=de.split("-");return O.length?S.createElement("ol",{key:de,dir:g==="auto"?pc():g,tabIndex:-1,ref:D,className:i,"data-sonner-toaster":!0,"data-theme":J,"data-y-position":Fe,"data-lifted":F&&O.length>1&&!o,"data-x-position":rt,style:{"--front-toast-height":`${((pe=L[0])==null?void 0:pe.height)||0}px`,"--width":`${Km}px`,"--gap":`${x}px`,...f,...ev(c,d)},onBlur:Z=>{ae.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(ae.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,W.current=Z.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{H||P(!1)},onDragEnd:()=>P(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},O.filter(Z=>!Z.position&&ue===0||Z.position===de).map((Z,ke)=>{var Ae,ye;return S.createElement(Rm,{key:Z.id,icons:w,index:ke,toast:Z,defaultRichColors:h,duration:(Ae=p==null?void 0:p.duration)!=null?Ae:v,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:b,closeButton:(ye=p==null?void 0:p.closeButton)!=null?ye:a,interacting:H,position:de,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:Se,toasts:O.filter(me=>me.position==Z.position),heights:L.filter(me=>me.position==Z.position),setHeights:U,expandByDefault:o,gap:x,loadingIcon:y,expanded:F,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const rv=({...e})=>{const{theme:t="system"}=Pm();return l.jsx(tv,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var nv=m[" useId ".trim().toString()]||(()=>{}),sv=0;function oo(e){const[t,r]=m.useState(nv());return Re(()=>{r(n=>n??String(sv++))},[e]),t?`radix-${t}`:""}const ov=["top","right","bottom","left"],_r=Math.min,yt=Math.max,ao=Math.round,io=Math.floor,jt=e=>({x:e,y:e}),av={left:"right",right:"left",bottom:"top",top:"bottom"},iv={start:"end",end:"start"};function ba(e,t,r){return yt(e,_r(t,r))}function sr(e,t){return typeof e=="function"?e(t):e}function or(e){return e.split("-")[0]}function Nn(e){return e.split("-")[1]}function wa(e){return e==="x"?"y":"x"}function xa(e){return e==="y"?"height":"width"}const lv=new Set(["top","bottom"]);function Ut(e){return lv.has(or(e))?"y":"x"}function _a(e){return wa(Ut(e))}function cv(e,t,r){r===void 0&&(r=!1);const n=Nn(e),s=_a(e),o=xa(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=lo(a)),[a,lo(a)]}function dv(e){const t=lo(e);return[Ca(e),t,Ca(t)]}function Ca(e){return e.replace(/start|end/g,t=>iv[t])}const mc=["left","right"],vc=["right","left"],uv=["top","bottom"],fv=["bottom","top"];function hv(e,t,r){switch(e){case"top":case"bottom":return r?t?vc:mc:t?mc:vc;case"left":case"right":return t?uv:fv;default:return[]}}function pv(e,t,r,n){const s=Nn(e);let o=hv(or(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Ca)))),o}function lo(e){return e.replace(/left|right|bottom|top/g,t=>av[t])}function mv(e){return{top:0,right:0,bottom:0,left:0,...e}}function gc(e){return typeof e!="number"?mv(e):{top:e,right:e,bottom:e,left:e}}function co(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function yc(e,t,r){let{reference:n,floating:s}=e;const o=Ut(t),a=_a(t),i=xa(a),c=or(t),d=o==="y",u=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,v=n[i]/2-s[i]/2;let f;switch(c){case"top":f={x:u,y:n.y-s.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:h};break;case"left":f={x:n.x-s.width,y:h};break;default:f={x:n.x,y:n.y}}switch(Nn(t)){case"start":f[a]-=v*(r&&d?-1:1);break;case"end":f[a]+=v*(r&&d?-1:1);break}return f}const vv=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,i=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:h}=yc(d,n,c),v=n,f={},b=0;for(let p=0;p<i.length;p++){const{name:g,fn:x}=i[p],{x:y,y:w,data:k,reset:N}=await x({x:u,y:h,initialPlacement:n,placement:v,strategy:s,middlewareData:f,rects:d,platform:a,elements:{reference:e,floating:t}});u=y??u,h=w??h,f={...f,[g]:{...f[g],...k}},N&&b<=50&&(b++,typeof N=="object"&&(N.placement&&(v=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:h}=yc(d,v,c)),p=-1)}return{x:u,y:h,placement:v,strategy:s,middlewareData:f}};async function vs(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:v=!1,padding:f=0}=sr(t,e),b=gc(f),g=i[v?h==="floating"?"reference":"floating":h],x=co(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(g)))==null||r?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:d,rootBoundary:u,strategy:c})),y=h==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),k=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},N=co(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-N.top+b.top)/k.y,bottom:(N.bottom-x.bottom+b.bottom)/k.y,left:(x.left-N.left+b.left)/k.x,right:(N.right-x.right+b.right)/k.x}}const gv=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:u=0}=sr(e,t)||{};if(d==null)return{};const h=gc(u),v={x:r,y:n},f=_a(s),b=xa(f),p=await a.getDimensions(d),g=f==="y",x=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",k=o.reference[b]+o.reference[f]-v[f]-o.floating[b],N=v[f]-o.reference[f],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let A=O?O[w]:0;(!A||!await(a.isElement==null?void 0:a.isElement(O)))&&(A=i.floating[w]||o.floating[b]);const V=k/2-N/2,L=A/2-p[b]/2-1,U=_r(h[x],L),F=_r(h[y],L),P=U,H=A-p[b]-F,I=A/2-p[b]/2+V,J=ba(P,I,H),q=!c.arrow&&Nn(s)!=null&&I!==J&&o.reference[b]/2-(I<P?U:F)-p[b]/2<0,D=q?I<P?I-P:I-H:0;return{[f]:v[f]+D,data:{[f]:J,centerOffset:I-J-D,...q&&{alignmentOffset:D}},reset:q}}}),yv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...g}=sr(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const x=or(s),y=Ut(i),w=or(i)===i,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=v||(w||!p?[lo(i)]:dv(i)),O=b!=="none";!v&&O&&N.push(...pv(i,p,b,k));const A=[i,...N],V=await vs(t,g),L=[];let U=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&L.push(V[x]),h){const I=cv(s,a,k);L.push(V[I[0]],V[I[1]])}if(U=[...U,{placement:s,overflows:L}],!L.every(I=>I<=0)){var F,P;const I=(((F=o.flip)==null?void 0:F.index)||0)+1,J=A[I];if(J&&(!(h==="alignment"?y!==Ut(J):!1)||U.every(M=>M.overflows[0]>0&&Ut(M.placement)===y)))return{data:{index:I,overflows:U},reset:{placement:J}};let q=(P=U.filter(D=>D.overflows[0]<=0).sort((D,M)=>D.overflows[1]-M.overflows[1])[0])==null?void 0:P.placement;if(!q)switch(f){case"bestFit":{var H;const D=(H=U.filter(M=>{if(O){const W=Ut(M.placement);return W===y||W==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(W=>W>0).reduce((W,ae)=>W+ae,0)]).sort((M,W)=>M[1]-W[1])[0])==null?void 0:H[0];D&&(q=D);break}case"initialPlacement":q=i;break}if(s!==q)return{reset:{placement:q}}}return{}}}};function bc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wc(e){return ov.some(t=>e[t]>=0)}const bv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=sr(e,t);switch(n){case"referenceHidden":{const o=await vs(t,{...s,elementContext:"reference"}),a=bc(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:wc(a)}}}case"escaped":{const o=await vs(t,{...s,altBoundary:!0}),a=bc(o,r.floating);return{data:{escapedOffsets:a,escaped:wc(a)}}}default:return{}}}}},xc=new Set(["left","top"]);async function wv(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=or(r),i=Nn(r),c=Ut(r)==="y",d=xc.has(a)?-1:1,u=o&&c?-1:1,h=sr(t,e);let{mainAxis:v,crossAxis:f,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof b=="number"&&(f=i==="end"?b*-1:b),c?{x:f*u,y:v*d}:{x:v*d,y:f*u}}const xv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:i}=t,c=await wv(t,e);return a===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},_v=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:i={fn:g=>{let{x,y}=g;return{x,y}}},...c}=sr(e,t),d={x:r,y:n},u=await vs(t,c),h=Ut(or(s)),v=wa(h);let f=d[v],b=d[h];if(o){const g=v==="y"?"top":"left",x=v==="y"?"bottom":"right",y=f+u[g],w=f-u[x];f=ba(y,f,w)}if(a){const g=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=b+u[g],w=b-u[x];b=ba(y,b,w)}const p=i.fn({...t,[v]:f,[h]:b});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:o,[h]:a}}}}}},Cv=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:d=!0}=sr(e,t),u={x:r,y:n},h=Ut(s),v=wa(h);let f=u[v],b=u[h];const p=sr(i,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=v==="y"?"height":"width",k=o.reference[v]-o.floating[w]+g.mainAxis,N=o.reference[v]+o.reference[w]-g.mainAxis;f<k?f=k:f>N&&(f=N)}if(d){var x,y;const w=v==="y"?"width":"height",k=xc.has(or(s)),N=o.reference[h]-o.floating[w]+(k&&((x=a.offset)==null?void 0:x[h])||0)+(k?0:g.crossAxis),O=o.reference[h]+o.reference[w]+(k?0:((y=a.offset)==null?void 0:y[h])||0)-(k?g.crossAxis:0);b<N?b=N:b>O&&(b=O)}return{[v]:f,[h]:b}}}},Sv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:i}=t,{apply:c=()=>{},...d}=sr(e,t),u=await vs(t,d),h=or(s),v=Nn(s),f=Ut(s)==="y",{width:b,height:p}=o.floating;let g,x;h==="top"||h==="bottom"?(g=h,x=v===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(x=h,g=v==="end"?"top":"bottom");const y=p-u.top-u.bottom,w=b-u.left-u.right,k=_r(p-u[g],y),N=_r(b-u[x],w),O=!t.middlewareData.shift;let A=k,V=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(V=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=y),O&&!v){const U=yt(u.left,0),F=yt(u.right,0),P=yt(u.top,0),H=yt(u.bottom,0);f?V=b-2*(U!==0||F!==0?U+F:yt(u.left,u.right)):A=p-2*(P!==0||H!==0?P+H:yt(u.top,u.bottom))}await c({...t,availableWidth:V,availableHeight:A});const L=await a.getDimensions(i.floating);return b!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function En(e){return _c(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(_c(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _c(e){return uo()?e instanceof Node||e instanceof bt(e).Node:!1}function Tt(e){return uo()?e instanceof Element||e instanceof bt(e).Element:!1}function zt(e){return uo()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function Cc(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const kv=new Set(["inline","contents"]);function gs(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!kv.has(s)}const Nv=new Set(["table","td","th"]);function Ev(e){return Nv.has(En(e))}const Pv=[":popover-open",":modal"];function fo(e){return Pv.some(t=>{try{return e.matches(t)}catch{return!1}})}const Tv=["transform","translate","scale","rotate","perspective"],Ov=["transform","translate","scale","rotate","perspective","filter"],Mv=["paint","layout","strict","content"];function Sa(e){const t=ka(),r=Tt(e)?Ot(e):e;return Tv.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Ov.some(n=>(r.willChange||"").includes(n))||Mv.some(n=>(r.contain||"").includes(n))}function Av(e){let t=Cr(e);for(;zt(t)&&!Pn(t);){if(Sa(t))return t;if(fo(t))return null;t=Cr(t)}return null}function ka(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dv=new Set(["html","body","#document"]);function Pn(e){return Dv.has(En(e))}function Ot(e){return bt(e).getComputedStyle(e)}function ho(e){return Tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cr(e){if(En(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cc(e)&&e.host||Ht(e);return Cc(t)?t.host:t}function Sc(e){const t=Cr(e);return Pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&gs(t)?t:Sc(t)}function ys(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Sc(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=bt(s);if(o){const i=Na(a);return t.concat(a,a.visualViewport||[],gs(s)?s:[],i&&r?ys(i):[])}return t.concat(s,ys(s,[],r))}function Na(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kc(e){const t=Ot(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=zt(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,i=ao(r)!==o||ao(n)!==a;return i&&(r=o,n=a),{width:r,height:n,$:i}}function Ea(e){return Tt(e)?e:e.contextElement}function Tn(e){const t=Ea(e);if(!zt(t))return jt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=kc(t);let a=(o?ao(r.width):r.width)/n,i=(o?ao(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Iv=jt(0);function Nc(e){const t=bt(e);return!ka()||!t.visualViewport?Iv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fv(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==bt(e)?!1:t}function en(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Ea(e);let a=jt(1);t&&(n?Tt(n)&&(a=Tn(n)):a=Tn(e));const i=Fv(o,r,n)?Nc(o):jt(0);let c=(s.left+i.x)/a.x,d=(s.top+i.y)/a.y,u=s.width/a.x,h=s.height/a.y;if(o){const v=bt(o),f=n&&Tt(n)?bt(n):n;let b=v,p=Na(b);for(;p&&n&&f!==b;){const g=Tn(p),x=p.getBoundingClientRect(),y=Ot(p),w=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,k=x.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,h*=g.y,c+=w,d+=k,b=bt(p),p=Na(b)}}return co({width:u,height:h,x:c,y:d})}function Pa(e,t){const r=ho(e).scrollLeft;return t?t.left+r:en(Ht(e)).left+r}function Ec(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:Pa(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function Lv(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=Ht(n),i=t?fo(t.floating):!1;if(n===a||i&&o)return r;let c={scrollLeft:0,scrollTop:0},d=jt(1);const u=jt(0),h=zt(n);if((h||!h&&!o)&&((En(n)!=="body"||gs(a))&&(c=ho(n)),zt(n))){const f=en(n);d=Tn(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const v=a&&!h&&!o?Ec(a,c,!0):jt(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+v.x,y:r.y*d.y-c.scrollTop*d.y+u.y+v.y}}function Vv(e){return Array.from(e.getClientRects())}function $v(e){const t=Ht(e),r=ho(e),n=e.ownerDocument.body,s=yt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=yt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Pa(e);const i=-r.scrollTop;return Ot(n).direction==="rtl"&&(a+=yt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:i}}function Bv(e,t){const r=bt(e),n=Ht(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,i=0,c=0;if(s){o=s.width,a=s.height;const d=ka();(!d||d&&t==="fixed")&&(i=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:i,y:c}}const Wv=new Set(["absolute","fixed"]);function jv(e,t){const r=en(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=zt(e)?Tn(e):jt(1),a=e.clientWidth*o.x,i=e.clientHeight*o.y,c=s*o.x,d=n*o.y;return{width:a,height:i,x:c,y:d}}function Pc(e,t,r){let n;if(t==="viewport")n=Bv(e,r);else if(t==="document")n=$v(Ht(e));else if(Tt(t))n=jv(t,r);else{const s=Nc(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return co(n)}function Tc(e,t){const r=Cr(e);return r===t||!Tt(r)||Pn(r)?!1:Ot(r).position==="fixed"||Tc(r,t)}function Uv(e,t){const r=t.get(e);if(r)return r;let n=ys(e,[],!1).filter(i=>Tt(i)&&En(i)!=="body"),s=null;const o=Ot(e).position==="fixed";let a=o?Cr(e):e;for(;Tt(a)&&!Pn(a);){const i=Ot(a),c=Sa(a);!c&&i.position==="fixed"&&(s=null),(o?!c&&!s:!c&&i.position==="static"&&!!s&&Wv.has(s.position)||gs(a)&&!c&&Tc(e,a))?n=n.filter(u=>u!==a):s=i,a=Cr(a)}return t.set(e,n),n}function Hv(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?fo(t)?[]:Uv(t,this._c):[].concat(r),n],i=a[0],c=a.reduce((d,u)=>{const h=Pc(t,u,s);return d.top=yt(h.top,d.top),d.right=_r(h.right,d.right),d.bottom=_r(h.bottom,d.bottom),d.left=yt(h.left,d.left),d},Pc(t,i,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function zv(e){const{width:t,height:r}=kc(e);return{width:t,height:r}}function Yv(e,t,r){const n=zt(t),s=Ht(t),o=r==="fixed",a=en(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const c=jt(0);function d(){c.x=Pa(s)}if(n||!n&&!o)if((En(t)!=="body"||gs(s))&&(i=ho(t)),n){const f=en(t,!0,o,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&d();o&&!n&&s&&d();const u=s&&!n&&!o?Ec(s,i):jt(0),h=a.left+i.scrollLeft-c.x-u.x,v=a.top+i.scrollTop-c.y-u.y;return{x:h,y:v,width:a.width,height:a.height}}function Ta(e){return Ot(e).position==="static"}function Oc(e,t){if(!zt(e)||Ot(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ht(e)===r&&(r=r.ownerDocument.body),r}function Mc(e,t){const r=bt(e);if(fo(e))return r;if(!zt(e)){let s=Cr(e);for(;s&&!Pn(s);){if(Tt(s)&&!Ta(s))return s;s=Cr(s)}return r}let n=Oc(e,t);for(;n&&Ev(n)&&Ta(n);)n=Oc(n,t);return n&&Pn(n)&&Ta(n)&&!Sa(n)?r:n||Av(e)||r}const qv=async function(e){const t=this.getOffsetParent||Mc,r=this.getDimensions,n=await r(e.floating);return{reference:Yv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Zv(e){return Ot(e).direction==="rtl"}const Kv={convertOffsetParentRelativeRectToViewportRelativeRect:Lv,getDocumentElement:Ht,getClippingRect:Hv,getOffsetParent:Mc,getElementRects:qv,getClientRects:Vv,getDimensions:zv,getScale:Tn,isElement:Tt,isRTL:Zv};function Ac(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qv(e,t){let r=null,n;const s=Ht(e);function o(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),o();const d=e.getBoundingClientRect(),{left:u,top:h,width:v,height:f}=d;if(i||t(),!v||!f)return;const b=io(h),p=io(s.clientWidth-(u+v)),g=io(s.clientHeight-(h+f)),x=io(u),w={rootMargin:-b+"px "+-p+"px "+-g+"px "+-x+"px",threshold:yt(0,_r(1,c))||1};let k=!0;function N(O){const A=O[0].intersectionRatio;if(A!==c){if(!k)return a();A?a(!1,A):n=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!Ac(d,e.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(N,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(N,w)}r.observe(e)}return a(!0),o}function Gv(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=Ea(e),u=s||o?[...d?ys(d):[],...ys(t)]:[];u.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),o&&x.addEventListener("resize",r)});const h=d&&i?Qv(d,r):null;let v=-1,f=null;a&&(f=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),r()}),d&&!c&&f.observe(d),f.observe(t));let b,p=c?en(e):null;c&&g();function g(){const x=en(e);p&&!Ac(p,x)&&r(),p=x,b=requestAnimationFrame(g)}return r(),()=>{var x;u.forEach(y=>{s&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),h==null||h(),(x=f)==null||x.disconnect(),f=null,c&&cancelAnimationFrame(b)}}const Xv=xv,Jv=_v,Rv=yv,eg=Sv,tg=bv,Dc=gv,rg=Cv,ng=(e,t,r)=>{const n=new Map,s={platform:Kv,...r},o={...s.platform,_c:n};return vv(e,t,{...s,platform:o})};var sg=typeof document<"u",og=function(){},po=sg?S.useLayoutEffect:og;function mo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!mo(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!mo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ic(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fc(e,t){const r=Ic(e);return Math.round(t*r)/r}function Oa(e){const t=m.useRef(e);return po(()=>{t.current=e}),t}function ag(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[u,h]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,f]=m.useState(n);mo(v,n)||f(n);const[b,p]=m.useState(null),[g,x]=m.useState(null),y=m.useCallback(M=>{M!==O.current&&(O.current=M,p(M))},[]),w=m.useCallback(M=>{M!==A.current&&(A.current=M,x(M))},[]),k=o||b,N=a||g,O=m.useRef(null),A=m.useRef(null),V=m.useRef(u),L=c!=null,U=Oa(c),F=Oa(s),P=Oa(d),H=m.useCallback(()=>{if(!O.current||!A.current)return;const M={placement:t,strategy:r,middleware:v};F.current&&(M.platform=F.current),ng(O.current,A.current,M).then(W=>{const ae={...W,isPositioned:P.current!==!1};I.current&&!mo(V.current,ae)&&(V.current=ae,cs.flushSync(()=>{h(ae)}))})},[v,t,r,F,P]);po(()=>{d===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,h(M=>({...M,isPositioned:!1})))},[d]);const I=m.useRef(!1);po(()=>(I.current=!0,()=>{I.current=!1}),[]),po(()=>{if(k&&(O.current=k),N&&(A.current=N),k&&N){if(U.current)return U.current(k,N,H);H()}},[k,N,H,U,L]);const J=m.useMemo(()=>({reference:O,floating:A,setReference:y,setFloating:w}),[y,w]),q=m.useMemo(()=>({reference:k,floating:N}),[k,N]),D=m.useMemo(()=>{const M={position:r,left:0,top:0};if(!q.floating)return M;const W=Fc(q.floating,u.x),ae=Fc(q.floating,u.y);return i?{...M,transform:"translate("+W+"px, "+ae+"px)",...Ic(q.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:ae}},[r,i,q.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:H,refs:J,elements:q,floatingStyles:D}),[u,H,J,q,D])}const ig=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Dc({element:n.current,padding:s}).fn(r):{}:n?Dc({element:n,padding:s}).fn(r):{}}}},lg=(e,t)=>({...Xv(e),options:[e,t]}),cg=(e,t)=>({...Jv(e),options:[e,t]}),dg=(e,t)=>({...rg(e),options:[e,t]}),ug=(e,t)=>({...Rv(e),options:[e,t]}),fg=(e,t)=>({...eg(e),options:[e,t]}),hg=(e,t)=>({...tg(e),options:[e,t]}),pg=(e,t)=>({...ig(e),options:[e,t]});var mg="Arrow",Lc=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return l.jsx(we.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Lc.displayName=mg;var vg=Lc;function gg(e){const[t,r]=m.useState(void 0);return Re(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,i;if("borderBoxSize"in o){const c=o.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ma="Popper",[Vc,On]=Rr(Ma),[yg,$c]=Vc(Ma),Bc=e=>{const{__scopePopper:t,children:r}=e,[n,s]=m.useState(null);return l.jsx(yg,{scope:t,anchor:n,onAnchorChange:s,children:r})};Bc.displayName=Ma;var Wc="PopperAnchor",jc=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=$c(Wc,r),a=m.useRef(null),i=Ie(t,a);return m.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:l.jsx(we.div,{...s,ref:i})});jc.displayName=Wc;var Aa="PopperContent",[bg,wg]=Vc(Aa),Uc=m.forwardRef((e,t)=>{var Z,ke,Ae,ye,me,be;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:f="optimized",onPlaced:b,...p}=e,g=$c(Aa,r),[x,y]=m.useState(null),w=Ie(t,Je=>y(Je)),[k,N]=m.useState(null),O=gg(k),A=(O==null?void 0:O.width)??0,V=(O==null?void 0:O.height)??0,L=n+(o!=="center"?"-"+o:""),U=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},F=Array.isArray(d)?d:[d],P=F.length>0,H={padding:U,boundary:F.filter(_g),altBoundary:P},{refs:I,floatingStyles:J,placement:q,isPositioned:D,middlewareData:M}=ag({strategy:"fixed",placement:L,whileElementsMounted:(...Je)=>Gv(...Je,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[lg({mainAxis:s+V,alignmentAxis:a}),c&&cg({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?dg():void 0,...H}),c&&ug({...H}),fg({...H,apply:({elements:Je,rects:dt,availableWidth:Rt,availableHeight:er})=>{const{width:mr,height:ls}=dt.reference,vr=Je.floating.style;vr.setProperty("--radix-popper-available-width",`${Rt}px`),vr.setProperty("--radix-popper-available-height",`${er}px`),vr.setProperty("--radix-popper-anchor-width",`${mr}px`),vr.setProperty("--radix-popper-anchor-height",`${ls}px`)}}),k&&pg({element:k,padding:i}),Cg({arrowWidth:A,arrowHeight:V}),v&&hg({strategy:"referenceHidden",...H})]}),[W,ae]=Yc(q),Se=Et(b);Re(()=>{D&&(Se==null||Se())},[D,Se]);const de=(Z=M.arrow)==null?void 0:Z.x,ue=(ke=M.arrow)==null?void 0:ke.y,pe=((Ae=M.arrow)==null?void 0:Ae.centerOffset)!==0,[Fe,rt]=m.useState();return Re(()=>{x&&rt(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:D?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Fe,"--radix-popper-transform-origin":[(ye=M.transformOrigin)==null?void 0:ye.x,(me=M.transformOrigin)==null?void 0:me.y].join(" "),...((be=M.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(bg,{scope:r,placedSide:W,onArrowChange:N,arrowX:de,arrowY:ue,shouldHideArrow:pe,children:l.jsx(we.div,{"data-side":W,"data-align":ae,...p,ref:w,style:{...p.style,animation:D?void 0:"none"}})})})});Uc.displayName=Aa;var Hc="PopperArrow",xg={top:"bottom",right:"left",bottom:"top",left:"right"},zc=m.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=wg(Hc,n),a=xg[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(vg,{...s,ref:r,style:{...s.style,display:"block"}})})});zc.displayName=Hc;function _g(e){return e!==null}var Cg=e=>({name:"transformOrigin",options:e,fn(t){var g,x,y;const{placement:r,rects:n,middlewareData:s}=t,a=((g=s.arrow)==null?void 0:g.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=Yc(r),h={start:"0%",center:"50%",end:"100%"}[u],v=(((x=s.arrow)==null?void 0:x.x)??0)+i/2,f=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let b="",p="";return d==="bottom"?(b=a?h:`${v}px`,p=`${-c}px`):d==="top"?(b=a?h:`${v}px`,p=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,p=a?h:`${f}px`):d==="left"&&(b=`${n.floating.width+c}px`,p=a?h:`${f}px`),{data:{x:b,y:p}}}});function Yc(e){const[t,r="center"]=e.split("-");return[t,r]}var qc=Bc,vo=jc,Da=Uc,Ia=zc,[go,kC]=Rr("Tooltip",[On]),Fa=On(),Zc="TooltipProvider",Sg=700,Kc="tooltip.open",[kg,Qc]=go(Zc),Gc=e=>{const{__scopeTooltip:t,delayDuration:r=Sg,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=m.useRef(!0),i=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),l.jsx(kg,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:m.useCallback(d=>{i.current=d},[]),disableHoverableContent:s,children:o})};Gc.displayName=Zc;var Xc="Tooltip",[NC,yo]=go(Xc),La="TooltipTrigger",Ng=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=yo(La,r),o=Qc(La,r),a=Fa(r),i=m.useRef(null),c=Ie(t,i,s.onTriggerChange),d=m.useRef(!1),u=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(vo,{asChild:!0,...a,children:l.jsx(we.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ie(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ie(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:ie(e.onBlur,s.onClose),onClick:ie(e.onClick,s.onClose)})})});Ng.displayName=La;var Eg="TooltipPortal",[EC,Pg]=go(Eg,{forceMount:void 0}),Mn="TooltipContent",Jc=m.forwardRef((e,t)=>{const r=Pg(Mn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=yo(Mn,e.__scopeTooltip);return l.jsx(fs,{present:n||a.open,children:a.disableHoverableContent?l.jsx(Rc,{side:s,...o,ref:t}):l.jsx(Tg,{side:s,...o,ref:t})})}),Tg=m.forwardRef((e,t)=>{const r=yo(Mn,e.__scopeTooltip),n=Qc(Mn,e.__scopeTooltip),s=m.useRef(null),o=Ie(t,s),[a,i]=m.useState(null),{trigger:c,onClose:d}=r,u=s.current,{onPointerInTransitChange:h}=n,v=m.useCallback(()=>{i(null),h(!1)},[h]),f=m.useCallback((b,p)=>{const g=b.currentTarget,x={x:b.clientX,y:b.clientY},y=Ig(x,g.getBoundingClientRect()),w=Fg(x,y),k=Lg(p.getBoundingClientRect()),N=$g([...w,...k]);i(N),h(!0)},[h]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(c&&u){const b=g=>f(g,u),p=g=>f(g,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",p)}}},[c,u,f,v]),m.useEffect(()=>{if(a){const b=p=>{const g=p.target,x={x:p.clientX,y:p.clientY},y=(c==null?void 0:c.contains(g))||(u==null?void 0:u.contains(g)),w=!Vg(x,a);y?v():w&&(v(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,a,d,v]),l.jsx(Rc,{...e,ref:o})}),[Og,Mg]=go(Xc,{isInside:!1}),Ag=zh("TooltipContent"),Rc=m.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...i}=e,c=yo(Mn,r),d=Fa(r),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener(Kc,u),()=>document.removeEventListener(Kc,u)),[u]),m.useEffect(()=>{if(c.trigger){const h=v=>{const f=v.target;f!=null&&f.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),l.jsx(us,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:l.jsxs(Da,{"data-state":c.stateAttribute,...d,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Ag,{children:n}),l.jsx(Og,{scope:r,isInside:!0,children:l.jsx(fp,{id:c.contentId,role:"tooltip",children:s||n})})]})})});Jc.displayName=Mn;var ed="TooltipArrow",Dg=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Fa(r);return Mg(ed,r).isInside?null:l.jsx(Ia,{...s,...n,ref:t})});Dg.displayName=ed;function Ig(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Fg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Lg(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function Vg(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const i=t[o],c=t[a],d=i.x,u=i.y,h=c.x,v=c.y;u>n!=v>n&&r<(h-d)*(n-u)/(v-u)+d&&(s=!s)}return s}function $g(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Bg(t)}function Bg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Wg=Gc,td=Jc;const jg=Wg,Ug=m.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(td,{ref:n,sideOffset:t,className:he("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Ug.displayName=td.displayName;var An=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tn=typeof window>"u"||"Deno"in globalThis;function nt(){}function Hg(e,t){return typeof e=="function"?e(t):e}function Va(e){return typeof e=="number"&&e>=0&&e!==1/0}function rd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Sr(e,t){return typeof e=="function"?e(t):e}function St(e,t){return typeof e=="function"?e(t):e}function nd(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==$a(a,t.options))return!1}else if(!bs(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||o&&!o(t))}function sd(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(rn(t.options.mutationKey)!==rn(o))return!1}else if(!bs(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function $a(e,t){return((t==null?void 0:t.queryKeyHashFn)||rn)(e)}function rn(e){return JSON.stringify(e,(t,r)=>Wa(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function bs(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>bs(e[r],t[r])):!1}function Ba(e,t){if(e===t)return e;const r=od(e)&&od(t);if(r||Wa(e)&&Wa(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),a=o.length,i=r?[]:{},c=new Set(n);let d=0;for(let u=0;u<a;u++){const h=r?u:o[u];(!r&&c.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(i[h]=void 0,d++):(i[h]=Ba(e[h],t[h]),i[h]===e[h]&&e[h]!==void 0&&d++)}return s===a&&d===s?e:i}return t}function bo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function od(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wa(e){if(!ad(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!ad(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ad(e){return Object.prototype.toString.call(e)==="[object Object]"}function zg(e){return new Promise(t=>{setTimeout(t,e)})}function ja(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Ba(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Ba(e,t)}return t}function Yg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function qg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var wo=Symbol();function id(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===wo&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===wo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ld(e,t){return typeof e=="function"?e(...t):!!e}var Zg=(Ch=class extends An{constructor(){super();ee(this,hn);ee(this,Br);ee(this,Qn);Q(this,Qn,t=>{if(!tn&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){_(this,Br)||this.setEventListener(_(this,Qn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Br))==null||t.call(this),Q(this,Br,void 0))}setEventListener(t){var r;Q(this,Qn,t),(r=_(this,Br))==null||r.call(this),Q(this,Br,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){_(this,hn)!==t&&(Q(this,hn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof _(this,hn)=="boolean"?_(this,hn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hn=new WeakMap,Br=new WeakMap,Qn=new WeakMap,Ch),Ua=new Zg,Kg=(Sh=class extends An{constructor(){super();ee(this,Gn,!0);ee(this,Wr);ee(this,Xn);Q(this,Xn,t=>{if(!tn&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){_(this,Wr)||this.setEventListener(_(this,Xn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Wr))==null||t.call(this),Q(this,Wr,void 0))}setEventListener(t){var r;Q(this,Xn,t),(r=_(this,Wr))==null||r.call(this),Q(this,Wr,t(this.setOnline.bind(this)))}setOnline(t){_(this,Gn)!==t&&(Q(this,Gn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return _(this,Gn)}},Gn=new WeakMap,Wr=new WeakMap,Xn=new WeakMap,Sh),xo=new Kg;function Ha(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function Qg(e){return Math.min(1e3*2**e,3e4)}function cd(e){return(e??"online")==="online"?xo.isOnline():!0}var dd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ud(e){let t=!1,r=0,n;const s=Ha(),o=()=>s.status!=="pending",a=p=>{var g;o()||(v(new dd(p)),(g=e.abort)==null||g.call(e))},i=()=>{t=!0},c=()=>{t=!1},d=()=>Ua.isFocused()&&(e.networkMode==="always"||xo.isOnline())&&e.canRun(),u=()=>cd(e.networkMode)&&e.canRun(),h=p=>{o()||(n==null||n(),s.resolve(p))},v=p=>{o()||(n==null||n(),s.reject(p))},f=()=>new Promise(p=>{var g;n=x=>{(o()||d())&&p(x)},(g=e.onPause)==null||g.call(e)}).then(()=>{var p;n=void 0,o()||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(o())return;let p;const g=r===0?e.initialPromise:void 0;try{p=g??e.fn()}catch(x){p=Promise.reject(x)}Promise.resolve(p).then(h).catch(x=>{var O;if(o())return;const y=e.retry??(tn?0:3),w=e.retryDelay??Qg,k=typeof w=="function"?w(r,x):w,N=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!N){v(x);return}r++,(O=e.onFail)==null||O.call(e,r,x),zg(k).then(()=>d()?void 0:f()).then(()=>{t?v(x):b()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():f().then(b),s)}}var Gg=e=>setTimeout(e,0);function Xg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Gg;const o=i=>{t?e.push(i):s(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Ke=Xg(),fd=(kh=class{constructor(){ee(this,pn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Va(this.gcTime)&&Q(this,pn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tn?1/0:5*60*1e3))}clearGcTimeout(){_(this,pn)&&(clearTimeout(_(this,pn)),Q(this,pn,void 0))}},pn=new WeakMap,kh),Jg=(Nh=class extends fd{constructor(t){super();ee(this,Lt);ee(this,Jn);ee(this,Rn);ee(this,Nt);ee(this,mn);ee(this,Xe);ee(this,zs);ee(this,vn);Q(this,vn,!1),Q(this,zs,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,mn,t.client),Q(this,Nt,_(this,mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,Jn,Rg(this.options)),this.state=t.state??_(this,Jn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,Xe))==null?void 0:t.promise}setOptions(t){this.options={..._(this,zs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Nt).remove(this)}setData(t,r){const n=ja(this.state.data,t,this.options);return ce(this,Lt,br).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ce(this,Lt,br).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=_(this,Xe))==null?void 0:n.promise;return(s=_(this,Xe))==null||s.cancel(t),r?r.then(nt).catch(nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Jn))}isActive(){return this.observers.some(t=>St(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Sr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!rd(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Xe))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Xe))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Nt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(_(this,Xe)&&(_(this,vn)?_(this,Xe).cancel({revert:!0}):_(this,Xe).cancelRetry()),this.scheduleGc()),_(this,Nt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Lt,br).call(this,{type:"invalidate"})}async fetch(t,r){var c,d,u,h,v,f,b,p,g,x,y,w;if(this.state.fetchStatus!=="idle"&&((c=_(this,Xe))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(_(this,Xe))return _(this,Xe).continueRetry(),_(this,Xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(N=>N.options.queryFn);k&&this.setOptions(k.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Q(this,vn,!0),n.signal)})},o=()=>{const k=id(this.options,r),O=(()=>{const A={client:_(this,mn),queryKey:this.queryKey,meta:this.meta};return s(A),A})();return Q(this,vn,!1),this.options.persister?this.options.persister(k,O,this):k(O)},i=(()=>{const k={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:_(this,mn),state:this.state,fetchFn:o};return s(k),k})();(d=this.options.behavior)==null||d.onFetch(i,this),Q(this,Rn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ce(this,Lt,br).call(this,{type:"fetch",meta:(h=i.fetchOptions)==null?void 0:h.meta}),Q(this,Xe,ud({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onFail:(k,N)=>{ce(this,Lt,br).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{ce(this,Lt,br).call(this,{type:"pause"})},onContinue:()=>{ce(this,Lt,br).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const k=await _(this,Xe).start();if(k===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(k),(f=(v=_(this,Nt).config).onSuccess)==null||f.call(v,k,this),(p=(b=_(this,Nt).config).onSettled)==null||p.call(b,k,this.state.error,this),k}catch(k){if(k instanceof dd){if(k.silent)return _(this,Xe).promise;if(k.revert){if(this.setState({..._(this,Rn),fetchStatus:"idle"}),this.state.data===void 0)throw k;return this.state.data}}throw ce(this,Lt,br).call(this,{type:"error",error:k}),(x=(g=_(this,Nt).config).onError)==null||x.call(g,k,this),(w=(y=_(this,Nt).config).onSettled)==null||w.call(y,this.state.data,k,this),k}finally{this.scheduleGc()}}},Jn=new WeakMap,Rn=new WeakMap,Nt=new WeakMap,mn=new WeakMap,Xe=new WeakMap,zs=new WeakMap,vn=new WeakMap,Lt=new WeakSet,br=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hd(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Q(this,Rn,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),_(this,Nt).notify({query:this,type:"updated",action:t})})},Nh);function hd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rg(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ey=(Eh=class extends An{constructor(t={}){super();ee(this,Gt);this.config=t,Q(this,Gt,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??$a(s,r);let a=this.get(o);return a||(a=new Jg({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){_(this,Gt).has(t.queryHash)||(_(this,Gt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=_(this,Gt).get(t.queryHash);r&&(t.destroy(),r===t&&_(this,Gt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Gt).get(t)}getAll(){return[..._(this,Gt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>nd(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>nd(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gt=new WeakMap,Eh),ty=(Ph=class extends fd{constructor(t){super();ee(this,Jt);ee(this,Xt);ee(this,lt);ee(this,gn);this.mutationId=t.mutationId,Q(this,lt,t.mutationCache),Q(this,Xt,[]),this.state=t.state||pd(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Xt).includes(t)||(_(this,Xt).push(t),this.clearGcTimeout(),_(this,lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Xt,_(this,Xt).filter(r=>r!==t)),this.scheduleGc(),_(this,lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Xt).length||(this.state.status==="pending"?this.scheduleGc():_(this,lt).remove(this))}continue(){var t;return((t=_(this,gn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,i,c,d,u,h,v,f,b,p,g,x,y,w,k,N,O,A,V;const r=()=>{ce(this,Jt,Xr).call(this,{type:"continue"})};Q(this,gn,ud({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,U)=>{ce(this,Jt,Xr).call(this,{type:"failed",failureCount:L,error:U})},onPause:()=>{ce(this,Jt,Xr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,lt).canRun(this)}));const n=this.state.status==="pending",s=!_(this,gn).canStart();try{if(n)r();else{ce(this,Jt,Xr).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=_(this,lt).config).onMutate)==null?void 0:a.call(o,t,this));const U=await((c=(i=this.options).onMutate)==null?void 0:c.call(i,t));U!==this.state.context&&ce(this,Jt,Xr).call(this,{type:"pending",context:U,variables:t,isPaused:s})}const L=await _(this,gn).start();return await((u=(d=_(this,lt).config).onSuccess)==null?void 0:u.call(d,L,t,this.state.context,this)),await((v=(h=this.options).onSuccess)==null?void 0:v.call(h,L,t,this.state.context)),await((b=(f=_(this,lt).config).onSettled)==null?void 0:b.call(f,L,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,L,null,t,this.state.context)),ce(this,Jt,Xr).call(this,{type:"success",data:L}),L}catch(L){try{throw await((y=(x=_(this,lt).config).onError)==null?void 0:y.call(x,L,t,this.state.context,this)),await((k=(w=this.options).onError)==null?void 0:k.call(w,L,t,this.state.context)),await((O=(N=_(this,lt).config).onSettled)==null?void 0:O.call(N,void 0,L,this.state.variables,this.state.context,this)),await((V=(A=this.options).onSettled)==null?void 0:V.call(A,void 0,L,t,this.state.context)),L}finally{ce(this,Jt,Xr).call(this,{type:"error",error:L})}}finally{_(this,lt).runNext(this)}}},Xt=new WeakMap,lt=new WeakMap,gn=new WeakMap,Jt=new WeakSet,Xr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{_(this,Xt).forEach(n=>{n.onMutationUpdate(t)}),_(this,lt).notify({mutation:this,type:"updated",action:t})})},Ph);function pd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ry=(Th=class extends An{constructor(t={}){super();ee(this,ur);ee(this,Vt);ee(this,Ys);this.config=t,Q(this,ur,new Set),Q(this,Vt,new Map),Q(this,Ys,0)}build(t,r,n){const s=new ty({mutationCache:this,mutationId:++ra(this,Ys)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){_(this,ur).add(t);const r=_o(t);if(typeof r=="string"){const n=_(this,Vt).get(r);n?n.push(t):_(this,Vt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,ur).delete(t)){const r=_o(t);if(typeof r=="string"){const n=_(this,Vt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&_(this,Vt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=_o(t);if(typeof r=="string"){const n=_(this,Vt).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=_o(t);if(typeof r=="string"){const s=(n=_(this,Vt).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ke.batch(()=>{_(this,ur).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,ur).clear(),_(this,Vt).clear()})}getAll(){return Array.from(_(this,ur))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>sd(r,n))}findAll(t={}){return this.getAll().filter(r=>sd(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ke.batch(()=>Promise.all(t.map(r=>r.continue().catch(nt))))}},ur=new WeakMap,Vt=new WeakMap,Ys=new WeakMap,Th);function _o(e){var t;return(t=e.options.scope)==null?void 0:t.id}function md(e){return{onFetch:(t,r)=>{var u,h,v,f,b;const n=t.options,s=(v=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:v.direction,o=((f=t.state.data)==null?void 0:f.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let p=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},x=id(t.options,t.fetchOptions),y=async(w,k,N)=>{if(p)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:k,direction:N?"backward":"forward",meta:t.options.meta};return g(F),F})(),V=await x(A),{maxPages:L}=t.options,U=N?qg:Yg;return{pages:U(w.pages,V,L),pageParams:U(w.pageParams,k,L)}};if(s&&o.length){const w=s==="backward",k=w?ny:vd,N={pages:o,pageParams:a},O=k(n,N);i=await y(N,O,w)}else{const w=e??o.length;do{const k=c===0?a[0]??n.initialPageParam:vd(n,i);if(c>0&&k==null)break;i=await y(i,k),c++}while(c<w)}return i};t.options.persister?t.fetchFn=()=>{var p,g;return(g=(p=t.options).persister)==null?void 0:g.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function vd(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ny(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var sy=(Oh=class{constructor(e={}){ee(this,$e);ee(this,jr);ee(this,Ur);ee(this,es);ee(this,ts);ee(this,Hr);ee(this,rs);ee(this,ns);Q(this,$e,e.queryCache||new ey),Q(this,jr,e.mutationCache||new ry),Q(this,Ur,e.defaultOptions||{}),Q(this,es,new Map),Q(this,ts,new Map),Q(this,Hr,0)}mount(){ra(this,Hr)._++,_(this,Hr)===1&&(Q(this,rs,Ua.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,$e).onFocus())})),Q(this,ns,xo.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,$e).onOnline())})))}unmount(){var e,t;ra(this,Hr)._--,_(this,Hr)===0&&((e=_(this,rs))==null||e.call(this),Q(this,rs,void 0),(t=_(this,ns))==null||t.call(this),Q(this,ns,void 0))}isFetching(e){return _(this,$e).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,jr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,$e).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=_(this,$e).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Sr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return _(this,$e).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=_(this,$e).get(n.queryHash),o=s==null?void 0:s.state.data,a=Hg(t,o);if(a!==void 0)return _(this,$e).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>_(this,$e).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,$e).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=_(this,$e);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=_(this,$e);return Ke.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ke.batch(()=>_(this,$e).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(nt).catch(nt)}invalidateQueries(e,t={}){return Ke.batch(()=>(_(this,$e).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ke.batch(()=>_(this,$e).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(nt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(nt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=_(this,$e).build(this,t);return r.isStaleByTime(Sr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nt).catch(nt)}fetchInfiniteQuery(e){return e.behavior=md(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nt).catch(nt)}ensureInfiniteQueryData(e){return e.behavior=md(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xo.isOnline()?_(this,jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,$e)}getMutationCache(){return _(this,jr)}getDefaultOptions(){return _(this,Ur)}setDefaultOptions(e){Q(this,Ur,e)}setQueryDefaults(e,t){_(this,es).set(rn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,es).values()],r={};return t.forEach(n=>{bs(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){_(this,ts).set(rn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,ts).values()],r={};return t.forEach(n=>{bs(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Ur).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=$a(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===wo&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Ur).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,$e).clear(),_(this,jr).clear()}},$e=new WeakMap,jr=new WeakMap,Ur=new WeakMap,es=new WeakMap,ts=new WeakMap,Hr=new WeakMap,rs=new WeakMap,ns=new WeakMap,Oh),oy=(Mh=class extends An{constructor(t,r){super();ee(this,Ne);ee(this,mt);ee(this,ge);ee(this,qs);ee(this,ct);ee(this,yn);ee(this,ss);ee(this,fr);ee(this,zr);ee(this,Zs);ee(this,os);ee(this,as);ee(this,bn);ee(this,wn);ee(this,Yr);ee(this,is,new Set);this.options=r,Q(this,mt,t),Q(this,zr,null),Q(this,fr,Ha()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,ge).addObserver(this),gd(_(this,ge),this.options)?ce(this,Ne,Ks).call(this):this.updateResult(),ce(this,Ne,ol).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return za(_(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return za(_(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Ne,al).call(this),ce(this,Ne,il).call(this),_(this,ge).removeObserver(this)}setOptions(t){const r=this.options,n=_(this,ge);if(this.options=_(this,mt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof St(this.options.enabled,_(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,Ne,ll).call(this),_(this,ge).setOptions(this.options),r._defaulted&&!bo(this.options,r)&&_(this,mt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,ge),observer:this});const s=this.hasListeners();s&&yd(_(this,ge),n,this.options,r)&&ce(this,Ne,Ks).call(this),this.updateResult(),s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||Sr(this.options.staleTime,_(this,ge))!==Sr(r.staleTime,_(this,ge)))&&ce(this,Ne,rl).call(this);const o=ce(this,Ne,nl).call(this);s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||o!==_(this,Yr))&&ce(this,Ne,sl).call(this,o)}getOptimisticResult(t){const r=_(this,mt).getQueryCache().build(_(this,mt),t),n=this.createResult(r,t);return iy(this,n)&&(Q(this,ct,n),Q(this,ss,this.options),Q(this,yn,_(this,ge).state)),n}getCurrentResult(){return _(this,ct)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&!this.options.experimental_prefetchInRender&&_(this,fr).status==="pending"&&_(this,fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,s))})}trackProp(t){_(this,is).add(t)}getCurrentQuery(){return _(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=_(this,mt).defaultQueryOptions(t),n=_(this,mt).getQueryCache().build(_(this,mt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,Ne,Ks).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,ct)))}createResult(t,r){var L;const n=_(this,ge),s=this.options,o=_(this,ct),a=_(this,yn),i=_(this,ss),d=t!==n?t.state:_(this,qs),{state:u}=t;let h={...u},v=!1,f;if(r._optimisticResults){const U=this.hasListeners(),F=!U&&gd(t,r),P=U&&yd(t,n,r,s);(F||P)&&(h={...h,...hd(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:g}=h;f=h.data;let x=!1;if(r.placeholderData!==void 0&&f===void 0&&g==="pending"){let U;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(U=o.data,x=!0):U=typeof r.placeholderData=="function"?r.placeholderData((L=_(this,as))==null?void 0:L.state.data,_(this,as)):r.placeholderData,U!==void 0&&(g="success",f=ja(o==null?void 0:o.data,U,r),v=!0)}if(r.select&&f!==void 0&&!x)if(o&&f===(a==null?void 0:a.data)&&r.select===_(this,Zs))f=_(this,os);else try{Q(this,Zs,r.select),f=r.select(f),f=ja(o==null?void 0:o.data,f,r),Q(this,os,f),Q(this,zr,null)}catch(U){Q(this,zr,U)}_(this,zr)&&(b=_(this,zr),f=_(this,os),p=Date.now(),g="error");const y=h.fetchStatus==="fetching",w=g==="pending",k=g==="error",N=w&&y,O=f!==void 0,V={status:g,fetchStatus:h.fetchStatus,isPending:w,isSuccess:g==="success",isError:k,isInitialLoading:N,isLoading:N,data:f,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:k&&!O,isPaused:h.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:k&&O,isStale:Ya(t,r),refetch:this.refetch,promise:_(this,fr),isEnabled:St(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const U=H=>{V.status==="error"?H.reject(V.error):V.data!==void 0&&H.resolve(V.data)},F=()=>{const H=Q(this,fr,V.promise=Ha());U(H)},P=_(this,fr);switch(P.status){case"pending":t.queryHash===n.queryHash&&U(P);break;case"fulfilled":(V.status==="error"||V.data!==P.value)&&F();break;case"rejected":(V.status!=="error"||V.error!==P.reason)&&F();break}}return V}updateResult(){const t=_(this,ct),r=this.createResult(_(this,ge),this.options);if(Q(this,yn,_(this,ge).state),Q(this,ss,this.options),_(this,yn).data!==void 0&&Q(this,as,_(this,ge)),bo(r,t))return;Q(this,ct,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!_(this,is).size)return!0;const a=new Set(o??_(this,is));return this.options.throwOnError&&a.add("error"),Object.keys(_(this,ct)).some(i=>{const c=i;return _(this,ct)[c]!==t[c]&&a.has(c)})};ce(this,Ne,Lh).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,Ne,ol).call(this)}},mt=new WeakMap,ge=new WeakMap,qs=new WeakMap,ct=new WeakMap,yn=new WeakMap,ss=new WeakMap,fr=new WeakMap,zr=new WeakMap,Zs=new WeakMap,os=new WeakMap,as=new WeakMap,bn=new WeakMap,wn=new WeakMap,Yr=new WeakMap,is=new WeakMap,Ne=new WeakSet,Ks=function(t){ce(this,Ne,ll).call(this);let r=_(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(nt)),r},rl=function(){ce(this,Ne,al).call(this);const t=Sr(this.options.staleTime,_(this,ge));if(tn||_(this,ct).isStale||!Va(t))return;const n=rd(_(this,ct).dataUpdatedAt,t)+1;Q(this,bn,setTimeout(()=>{_(this,ct).isStale||this.updateResult()},n))},nl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,ge)):this.options.refetchInterval)??!1},sl=function(t){ce(this,Ne,il).call(this),Q(this,Yr,t),!(tn||St(this.options.enabled,_(this,ge))===!1||!Va(_(this,Yr))||_(this,Yr)===0)&&Q(this,wn,setInterval(()=>{(this.options.refetchIntervalInBackground||Ua.isFocused())&&ce(this,Ne,Ks).call(this)},_(this,Yr)))},ol=function(){ce(this,Ne,rl).call(this),ce(this,Ne,sl).call(this,ce(this,Ne,nl).call(this))},al=function(){_(this,bn)&&(clearTimeout(_(this,bn)),Q(this,bn,void 0))},il=function(){_(this,wn)&&(clearInterval(_(this,wn)),Q(this,wn,void 0))},ll=function(){const t=_(this,mt).getQueryCache().build(_(this,mt),this.options);if(t===_(this,ge))return;const r=_(this,ge);Q(this,ge,t),Q(this,qs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Lh=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(_(this,ct))}),_(this,mt).getQueryCache().notify({query:_(this,ge),type:"observerResultsUpdated"})})},Mh);function ay(e,t){return St(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gd(e,t){return ay(e,t)||e.state.data!==void 0&&za(e,t,t.refetchOnMount)}function za(e,t,r){if(St(t.enabled,e)!==!1&&Sr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ya(e,t)}return!1}function yd(e,t,r,n){return(e!==t||St(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ya(e,r)}function Ya(e,t){return St(t.enabled,e)!==!1&&e.isStaleByTime(Sr(t.staleTime,e))}function iy(e,t){return!bo(e.getCurrentResult(),t)}var ly=(Ah=class extends An{constructor(r,n){super();ee(this,pr);ee(this,qr);ee(this,Zr);ee(this,vt);ee(this,hr);Q(this,qr,r),this.setOptions(n),this.bindMethods(),ce(this,pr,na).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=_(this,qr).defaultMutationOptions(r),bo(this.options,n)||_(this,qr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rn(n.mutationKey)!==rn(this.options.mutationKey)?this.reset():((s=_(this,vt))==null?void 0:s.state.status)==="pending"&&_(this,vt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=_(this,vt))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,pr,na).call(this),ce(this,pr,cl).call(this,r)}getCurrentResult(){return _(this,Zr)}reset(){var r;(r=_(this,vt))==null||r.removeObserver(this),Q(this,vt,void 0),ce(this,pr,na).call(this),ce(this,pr,cl).call(this)}mutate(r,n){var s;return Q(this,hr,n),(s=_(this,vt))==null||s.removeObserver(this),Q(this,vt,_(this,qr).getMutationCache().build(_(this,qr),this.options)),_(this,vt).addObserver(this),_(this,vt).execute(r)}},qr=new WeakMap,Zr=new WeakMap,vt=new WeakMap,hr=new WeakMap,pr=new WeakSet,na=function(){var n;const r=((n=_(this,vt))==null?void 0:n.state)??pd();Q(this,Zr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},cl=function(r){Ke.batch(()=>{var n,s,o,a,i,c,d,u;if(_(this,hr)&&this.hasListeners()){const h=_(this,Zr).variables,v=_(this,Zr).context;(r==null?void 0:r.type)==="success"?((s=(n=_(this,hr)).onSuccess)==null||s.call(n,r.data,h,v),(a=(o=_(this,hr)).onSettled)==null||a.call(o,r.data,null,h,v)):(r==null?void 0:r.type)==="error"&&((c=(i=_(this,hr)).onError)==null||c.call(i,r.error,h,v),(u=(d=_(this,hr)).onSettled)==null||u.call(d,void 0,r.error,h,v))}this.listeners.forEach(h=>{h(_(this,Zr))})})},Ah),bd=m.createContext(void 0),wd=e=>{const t=m.useContext(bd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},cy=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(bd.Provider,{value:e,children:t})),xd=m.createContext(!1),dy=()=>m.useContext(xd);xd.Provider;function uy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fy=m.createContext(uy()),hy=()=>m.useContext(fy),py=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},my=e=>{m.useEffect(()=>{e.clearReset()},[e])},vy=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||ld(r,[e.error,n])),gy=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},yy=(e,t)=>e.isLoading&&e.isFetching&&!t,by=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,_d=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function wy(e,t,r){var h,v,f,b,p;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=dy(),s=hy(),o=wd(),a=o.defaultQueryOptions(e);(v=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||v.call(h,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=n?"isRestoring":"optimistic",gy(a),py(a,s),my(s);const i=!o.getQueryCache().get(a.queryHash),[c]=m.useState(()=>new t(o,a)),d=c.getOptimisticResult(a),u=!n&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(g=>{const x=u?c.subscribe(Ke.batchCalls(g)):nt;return c.updateResult(),x},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(a)},[a,c]),by(a,d))throw _d(a,c,s);if(vy({result:d,errorResetBoundary:s,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;if((b=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||b.call(f,a,d),a.experimental_prefetchInRender&&!tn&&yy(d,n)){const g=i?_d(a,c,s):(p=o.getQueryCache().get(a.queryHash))==null?void 0:p.promise;g==null||g.catch(nt).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?d:c.trackResult(d)}function xy(e,t){return wy(e,oy)}function Cd(e,t){const r=wd(),[n]=m.useState(()=>new ly(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const s=m.useSyncExternalStore(m.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=m.useCallback((a,i)=>{n.mutate(a,i).catch(nt)},[n]);if(s.error&&ld(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const Co=pa("inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{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"}}),Be=m.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?hl:"button";return l.jsx(a,{className:he(Co({variant:t,size:r,className:e})),ref:o,...s})});Be.displayName="Button";const st=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));st.displayName="Card";const kr=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex flex-col space-y-1.5 p-6",e),...t}));kr.displayName="CardHeader";const qa=m.forwardRef(({className:e,...t},r)=>l.jsx("h3",{ref:r,className:he("text-2xl font-semibold leading-none tracking-tight",e),...t}));qa.displayName="CardTitle";const _y=m.forwardRef(({className:e,...t},r)=>l.jsx("p",{ref:r,className:he("text-sm text-muted-foreground",e),...t}));_y.displayName="CardDescription";const ot=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("p-6 pt-0",e),...t}));ot.displayName="CardContent";const Cy=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex items-center p-6 pt-0",e),...t}));Cy.displayName="CardFooter";const Sd=({title:e="Verify your identity",subtitle:t="We need some information to help us confirm your identity.",onContinue:r})=>l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"pt-8 text-center",children:[l.jsx("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 rounded-3xl p-8 mb-8",children:l.jsx("div",{className:"relative mb-8",children:l.jsxs("div",{className:"relative mx-auto w-48 h-32",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary to-primary/80 rounded-2xl transform rotate-3 shadow-lg",children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center",children:l.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:l.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})})}),l.jsx("div",{className:"absolute top-4 right-0 bg-card rounded-xl shadow-lg p-4 transform -rotate-3",children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("div",{className:"w-8 h-8 bg-primary/20 rounded-full"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"w-12 h-2 bg-primary rounded"}),l.jsx("div",{className:"w-8 h-2 bg-primary/60 rounded"})]})]})}),l.jsx("div",{className:"absolute -top-2 -right-2 w-10 h-10 bg-primary rounded-full flex items-center justify-center shadow-lg",children:l.jsx(Jl,{className:"w-6 h-6 text-white"})})]})})}),l.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:e}),l.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:t}),l.jsx(Be,{className:"w-full h-14 text-lg font-semibold",onClick:r,children:"Start"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-6",children:"Verifying usually takes a few seconds."})]})}),wt=m.forwardRef(({className:e,type:t,...r},n)=>l.jsx("input",{type:t,className:he("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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 md:text-sm",e),ref:n,...r}));wt.displayName="Input";var Sy="Label",kd=m.forwardRef((e,t)=>l.jsx(we.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));kd.displayName=Sy;var Nd=kd;const ky=pa("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),nn=m.forwardRef(({className:e,...t},r)=>l.jsx(Nd,{ref:r,className:he(ky(),e),...t}));nn.displayName=Nd.displayName;const Ny=({fullName:e,onNameChange:t,onContinue:r,renderProgress:n})=>l.jsxs(st,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(Up,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),l.jsx(qa,{children:"Personal Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please enter your full legal name"})]}),l.jsxs(ot,{children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{htmlFor:"fullName",children:"Full Name"}),l.jsx(wt,{id:"fullName",placeholder:"Enter your full name",value:e,onChange:s=>t(s.target.value)})]}),l.jsx(Be,{className:"w-full",onClick:r,disabled:!e.trim(),children:"Continue"})]}),l.jsx("div",{className:"mt-6",children:n()})]})]}),Nr=({title:e,subTitle:t,onBack:r})=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center mb-6",children:[l.jsx(Be,{variant:"ghost",size:"icon",className:"mr-2",onClick:r,children:l.jsx(Kl,{className:"w-6 h-6"})}),l.jsx("h1",{className:"text-2xl font-semibold ml-4",children:e})]}),l.jsx("p",{className:"text-center text-muted-foreground mb-6",children:t})]}),Ey=({selectedDocumentType:e,onDocumentTypeChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=[{id:"id-card",title:"ID Card",description:"Government-issued personal ID.",icon:Wp},{id:"drivers-license",title:"Drivers license",description:"Government-issued Drivers license",icon:Fp},{id:"passport",title:"Passport",description:"Your official travel document.",icon:Ip},{id:"voter-id",title:"Voter ID",description:"Government-issued Voter ID",icon:Hp}];return l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Upload ID",subTitle:"Choose the document type you would like to identify with",onBack:n}),l.jsx("div",{className:"space-y-3",children:o.map(a=>{const i=a.icon;return l.jsx("button",{className:`w-full p-4 rounded-lg border text-left transition-colors hover:bg-muted/50 ${e===a.id?"border-primary bg-primary/5":"border-border"}`,onClick:()=>t(a.id),children:l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:l.jsx(i,{className:"w-6 h-6 text-white"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})]})]})},a.id)})}),l.jsx(Be,{className:"w-full mt-6",onClick:r,disabled:!e,children:"Continue"}),l.jsx("div",{className:"mt-6",children:s()})]})})},Py=e=>{switch(e){case"selfie":return{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular"};case"id-front":return{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};case"id-back":return{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};default:return{title:"Take Photo",description:"Position your document inside the frame and take a picture.",frameType:"rectangular"}}},Dn=({acceptedFile:e,currentStep:t,setCurrentStep:r,setSelfiePhoto:n,setIdCardFront:s,setIdCardBack:o})=>{const[a,i]=S.useState(null),c=S.useRef(null),d=S.useRef(null),u=!!a,{toast:h}=Xs();S.useEffect(()=>{a&&c.current&&(c.current.srcObject=a)},[a]);const v=S.useCallback(async()=>{try{const k=await navigator.mediaDevices.getUserMedia({video:{facingMode:t==="selfie"?"user":"environment",width:{ideal:1280},height:{ideal:720}}});i(k)}catch{h({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},[t,h]);S.useEffect(()=>{!a&&!e&&v()},[t,v,a,e]);const f=S.useCallback(()=>{a&&(a.getTracks().forEach(k=>k.stop()),i(null))},[a]),b=S.useCallback(()=>{if(!c.current||!d.current)return;const k=c.current,N=d.current,O=N.getContext("2d");O&&(N.width=k.videoWidth,N.height=k.videoHeight,O.drawImage(k,0,0),N.toBlob(A=>{if(A){const V=new File([A],`${t}-${Date.now()}.jpg`,{type:"image/jpeg"});switch(t){case"selfie":n(V),f(),r("selfie-confirm");break;case"id-front":s(V),f(),r("id-front-confirm");break;case"id-back":o(V),f(),r("id-back-confirm");break}h({title:"Photo Captured",description:"Photo captured successfully"})}},"image/jpeg",.8))},[t,f,h]);S.useEffect(()=>()=>{f()},[f]);const p=Py(t),{title:g,description:x,frameType:y}=p,w=()=>{switch(f(),t){case"selfie":r("pre-selfie");break;case"id-front":r("document-selection");break;case"id-back":r("document-selection");break}};return l.jsx(st,{className:"w-full max-w-md mx-auto border-gray-900 bg-gray-900",children:l.jsxs(ot,{className:" text-white flex flex-col",children:[l.jsxs("div",{className:"flex items-center p-6",children:[l.jsx(Be,{variant:"ghost",size:"sm",onClick:w,className:"text-white hover:bg-gray-800",children:l.jsx(Kl,{className:"h-6 w-6"})}),l.jsx("h1",{className:"text-xl font-semibold ml-4",children:g})]}),l.jsx("div",{className:"px-6 mb-8",children:l.jsx("p",{className:"text-gray-300 text-center",children:x})}),l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[l.jsx("div",{className:"relative mb-16",children:u?l.jsxs(l.Fragment,{children:[l.jsx("video",{ref:c,autoPlay:!0,playsInline:!0,className:`bg-gray-800 object-cover ${y==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`}),l.jsx("canvas",{ref:d,className:"hidden"})]}):l.jsx("div",{className:`bg-gray-700 flex items-center justify-center ${y==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`,children:l.jsx("p",{className:"text-gray-400",children:"Camera loading..."})})}),l.jsx(Be,{onClick:u?b:v,size:"lg",className:"w-16 h-16 rounded-full bg-white hover:bg-gray-100 border-4 border-gray-600 p-0",disabled:!u,children:l.jsx("div",{className:"w-8 h-8 rounded-full bg-white"})})]})]})})},Ed=({onContinue:e,onBack:t})=>l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Selfie",subTitle:"Make sure your face is clear and is fully inside the frame.",onBack:t}),l.jsx("div",{className:"m-auto w-44 h-80 bg-gradient-to-br from-primary/20 to-primary/40 rounded-3xl p-4 shadow-2xl",children:l.jsx("div",{className:"w-full h-full bg-background rounded-2xl overflow-hidden relative",children:l.jsx("div",{className:"flex items-center justify-center h-full bg-muted/30",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-2"}),l.jsx("div",{className:"w-28 h-32 bg-primary/30 rounded-2xl mx-auto"})]})})})}),l.jsx("div",{className:"mt-8",children:l.jsx(Be,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),In=({photo:e,onRetake:t,onConfirm:r,onBack:n,renderProgress:s})=>{const o=S.useMemo(()=>URL.createObjectURL(e),[e]);return console.log("photoUrl",o),S.useEffect(()=>()=>{console.log("REVOKEEEEEE",o)},[o]),l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Review picture",subTitle:"Make sure the information is seen clearly, with no blur or glare.",onBack:n}),l.jsx("div",{className:"mb-8",children:l.jsx("div",{className:"relative",children:l.jsx("img",{src:o,alt:"Captured photo",className:"w-full h-64 object-cover rounded-2xl bg-muted"})})}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx(Be,{variant:"outline",onClick:t,className:"flex-1 text-md",children:"Take again"}),l.jsx(Be,{onClick:r,className:"flex-1 text-md",children:"Looks good"})]})]})})},Ty=({fullName:e,onComplete:t,onStartOver:r})=>l.jsxs(st,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(Jl,{className:"w-12 h-12 mx-auto mb-4 text-green-500"}),l.jsx(qa,{children:"Review Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please review your information before submitting"})]}),l.jsx(ot,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{children:"Full Name"}),l.jsx("p",{className:"font-medium",children:e})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"Selfie"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Front"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Back"}),l.jsx("div",{className:"text-green-500",children:"✓"})]})]}),l.jsx(Be,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),l.jsx(Be,{variant:"outline",className:"w-full text-md",onClick:r,children:"Start Over"})]})})]}),Pd=({onComplete:e})=>(S.useEffect(()=>{const t=setTimeout(()=>{e()},3e3);return()=>clearTimeout(t)},[e]),l.jsx(st,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:l.jsxs(ot,{className:"text-center space-y-8",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"We're verifying your documents"})}),l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin"})})]})})),Td=({onDoneClick:e})=>l.jsx(st,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:l.jsx(ot,{className:"text-center space-y-8",children:l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"Your documents have been submitted successfully"}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Gl,{size:60,className:"text-primary"})}),l.jsx("p",{className:"text-foreground mt-2",children:"Our compliance team will review your information, and we'll notify you once verification is complete."}),l.jsx("p",{className:"text-foreground mt-2",children:"Thank you for your patience."}),l.jsx(Be,{className:"text-md mt-8",onClick:e,children:"Explore App"})]})})}),Oy=({apiEndpoint:e,apiKey:t,onComplete:r,onDoneClick:n})=>{const[s,o]=S.useState("landing"),[a,i]=S.useState(""),[c,d]=S.useState(""),[u,h]=S.useState(null),[v,f]=S.useState(null),[b,p]=S.useState(null),{data:g}=Dy(e,t),x=Cd({mutationFn:My}),{toast:y}=Xs(),w=S.useMemo(()=>[...g!=null&&g.hide_name_step?[]:["name"],...g!=null&&g.hide_document_selection_step?[]:["document-selection"],"selfie","selfie-confirm","pre-selfie","id-front","id-front-confirm","id-back","id-back-confirm","verify"],[g]),k=()=>g.hide_name_step?g.hide_document_selection_step?"id-front":"document-selection":"name",N=async()=>{if((g.hide_name_step||!!a)&&u&&v&&b){const L={full_name:a,selfie_photo:u,id_photo:v,id_photo_back:b},U=await x.mutateAsync({apiEndpoint:e,apiKey:t,data:L});r(U.data.token,L),y({title:"KYC Complete",description:"Identity verification completed successfully"}),i(""),h(null),f(null),p(null),o("done")}},O=()=>l.jsx(l.Fragment,{children:s!=="landing"&&l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"flex space-x-2",children:w.map((V,L)=>l.jsx("div",{className:`w-3 h-3 rounded-full ${w.indexOf(s)>=L?"bg-primary":"bg-muted"}`},V))})})}),A=()=>{switch(s){case"landing":return l.jsx(Sd,{onContinue:()=>o(k())});case"name":return l.jsx(Ny,{fullName:a,onNameChange:i,onContinue:()=>o(g.hide_document_selection_step?"id-front":"document-selection"),renderProgress:O});case"document-selection":return l.jsx(Ey,{selectedDocumentType:c,onDocumentTypeChange:d,onContinue:()=>o("id-front"),onBack:()=>o(g.hide_name_step?"landing":"name"),renderProgress:O});case"id-front":return l.jsx(Dn,{acceptedFile:v,currentStep:s,setCurrentStep:V=>{o(V)},setSelfiePhoto:h,setIdCardFront:f,setIdCardBack:p});case"id-back":return l.jsx(Dn,{acceptedFile:b,currentStep:s,setCurrentStep:V=>{o(V)},setSelfiePhoto:h,setIdCardFront:f,setIdCardBack:p});case"pre-selfie":return l.jsx(Ed,{onContinue:()=>o("selfie"),onBack:()=>o("name")});case"selfie":return l.jsx(Dn,{acceptedFile:u,currentStep:s,setCurrentStep:V=>{o(V)},setSelfiePhoto:h,setIdCardFront:f,setIdCardBack:p});case"selfie-confirm":return u?l.jsx(In,{photo:u,onRetake:()=>{h(null),o("selfie")},onConfirm:()=>o("verify"),onBack:()=>o("selfie"),renderProgress:O}):null;case"id-front-confirm":return v?l.jsx(In,{photo:v,onRetake:()=>{f(null),o("id-front")},onConfirm:()=>o("id-back"),onBack:()=>o("id-front"),renderProgress:O}):null;case"id-back-confirm":return b?l.jsx(In,{photo:b,onRetake:()=>{p(null),o("id-back")},onConfirm:()=>o("pre-selfie"),onBack:()=>o("id-back"),renderProgress:O}):null;case"verify":return l.jsx(Ty,{fullName:a,onComplete:()=>o("processing"),onStartOver:()=>o("landing")});case"processing":return l.jsx(Pd,{onComplete:N});case"done":return l.jsx(Td,{onDoneClick:n});default:return null}};return l.jsx("div",{className:"w-[430px]",children:A()})};async function My({apiEndpoint:e,apiKey:t,data:r}){const n=new FormData;n.append("full_name",r.full_name),n.append("selfie_photo",r.selfie_photo,r.selfie_photo.name),n.append("id_photo",r.id_photo,r.id_photo.name),n.append("id_photo_back",r.id_photo_back,r.id_photo_back.name);const s=await fetch(`${e}/api/kyc`,{method:"POST",headers:{"X-API-Key":t},body:n});if(!s.ok)throw new Error("Network response was not ok");return s.json()}const Ay=async(e,t)=>{const r=await fetch(`${e}/api/settings`,{method:"GET",headers:{"X-API-Key":t,"Content-Type":"application/json"}});if(!r.ok)throw new Error("Network response was not ok");return(await r.json()).data},Dy=(e,t)=>xy({queryKey:["settings",e,t],queryFn:()=>Ay(e,t),enabled:!!e&&!!t});var ws=e=>e.type==="checkbox",sn=e=>e instanceof Date,at=e=>e==null;const Od=e=>typeof e=="object";var We=e=>!at(e)&&!Array.isArray(e)&&Od(e)&&!sn(e),Md=e=>We(e)&&e.target?ws(e.target)?e.target.checked:e.target.value:e,Iy=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Ad=(e,t)=>e.has(Iy(t)),Fy=e=>{const t=e.constructor&&e.constructor.prototype;return We(t)&&t.hasOwnProperty("isPrototypeOf")},Za=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qe(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Za&&(e instanceof Blob||n))&&(r||We(e)))if(t=r?[]:{},!r&&!Fy(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Qe(e[s]));else return e;return t}var So=e=>/^\w*$/.test(e),je=e=>e===void 0,Ka=e=>Array.isArray(e)?e.filter(Boolean):[],Qa=e=>Ka(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Y=(e,t,r)=>{if(!t||!We(e))return r;const n=(So(t)?[t]:Qa(t)).reduce((s,o)=>at(s)?s:s[o],e);return je(n)||n===e?je(e[t])?r:e[t]:n},xt=e=>typeof e=="boolean",Ee=(e,t,r)=>{let n=-1;const s=So(t)?[t]:Qa(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let c=r;if(n!==a){const d=e[i];c=We(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=c,e=e[i]}};const ko={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Mt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ar={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ga=S.createContext(null);Ga.displayName="HookFormContext";const No=()=>S.useContext(Ga),Ly=e=>{const{children:t,...r}=e;return S.createElement(Ga.Provider,{value:r},t)};var Dd=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Mt.all&&(t._proxyFormState[a]=!n||Mt.all),r&&(r[a]=!0),e[a]}});return s};const Xa=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Vy(e){const t=No(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[a,i]=S.useState(r._formState),c=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Xa(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:d=>{!n&&i({...r._formState,...d})}}),[s,n,o]),S.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>Dd(a,r,c.current,!1),[a,r])}var Yt=e=>typeof e=="string",Id=(e,t,r,n,s)=>Yt(e)?(n&&t.watch.add(e),Y(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),Y(r,o))):(n&&(t.watchAll=!0),r),Ja=e=>at(e)||!Od(e);function ir(e,t,r=new WeakSet){if(Ja(e)||Ja(t))return e===t;if(sn(e)&&sn(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const a=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const i=t[o];if(sn(a)&&sn(i)||We(a)&&We(i)||Array.isArray(a)&&Array.isArray(i)?!ir(a,i,r):a!==i)return!1}}return!0}function $y(e){const t=No(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:a,compute:i}=e||{},c=S.useRef(s),d=S.useRef(i),u=S.useRef(void 0);d.current=i;const h=S.useMemo(()=>r._getWatch(n,c.current),[r,n]),[v,f]=S.useState(d.current?d.current(h):h);return Xa(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:b=>{if(!o){const p=Id(n,r._names,b.values||r._formValues,!1,c.current);if(d.current){const g=d.current(p);ir(g,u.current)||(f(g),u.current=g)}else f(p)}}}),[r,o,n,a]),S.useEffect(()=>r._removeUnmounted()),v}function By(e){const t=No(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o,defaultValue:a}=e,i=Ad(s._names.array,r),c=S.useMemo(()=>Y(s._formValues,r,Y(s._defaultValues,r,a)),[s,r,a]),d=$y({control:s,name:r,defaultValue:c,exact:!0}),u=Vy({control:s,name:r,exact:!0}),h=S.useRef(e),v=S.useRef(s.register(r,{...e.rules,value:d,...xt(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const f=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Y(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!Y(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Y(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Y(u.validatingFields,r)},error:{enumerable:!0,get:()=>Y(u.errors,r)}}),[u,r]),b=S.useCallback(y=>v.current.onChange({target:{value:Md(y),name:r},type:ko.CHANGE}),[r]),p=S.useCallback(()=>v.current.onBlur({target:{value:Y(s._formValues,r),name:r},type:ko.BLUR}),[r,s._formValues]),g=S.useCallback(y=>{const w=Y(s._fields,r);w&&y&&(w._f.ref={focus:()=>y.focus&&y.focus(),select:()=>y.select&&y.select(),setCustomValidity:k=>y.setCustomValidity(k),reportValidity:()=>y.reportValidity()})},[s._fields,r]),x=S.useMemo(()=>({name:r,value:d,...xt(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:b,onBlur:p,ref:g}),[r,n,u.disabled,b,p,g,d]);return S.useEffect(()=>{const y=s._options.shouldUnregister||o;s.register(r,{...h.current.rules,...xt(h.current.disabled)?{disabled:h.current.disabled}:{}});const w=(k,N)=>{const O=Y(s._fields,k);O&&O._f&&(O._f.mount=N)};if(w(r,!0),y){const k=Qe(Y(s._options.defaultValues,r));Ee(s._defaultValues,r,k),je(Y(s._formValues,r))&&Ee(s._formValues,r,k)}return!i&&s.register(r),()=>{(i?y&&!s._state.action:y)?s.unregister(r):w(r,!1)}},[r,s,i,o]),S.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),S.useMemo(()=>({field:x,formState:u,fieldState:f}),[x,u,f])}const Wy=e=>e.render(By(e));var Fd=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},xs=e=>Array.isArray(e)?e:[e],Ld=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},ft=e=>We(e)&&!Object.keys(e).length,Ra=e=>e.type==="file",At=e=>typeof e=="function",Eo=e=>{if(!Za)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Vd=e=>e.type==="select-multiple",ei=e=>e.type==="radio",jy=e=>ei(e)||ws(e),ti=e=>Eo(e)&&e.isConnected;function Uy(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=je(e)?n++:e[t[n++]];return e}function Hy(e){for(const t in e)if(e.hasOwnProperty(t)&&!je(e[t]))return!1;return!0}function qe(e,t){const r=Array.isArray(t)?t:So(t)?[t]:Qa(t),n=r.length===1?e:Uy(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(We(n)&&ft(n)||Array.isArray(n)&&Hy(n))&&qe(e,r.slice(0,-1)),e}var $d=e=>{for(const t in e)if(At(e[t]))return!0;return!1};function Po(e,t={}){const r=Array.isArray(e);if(We(e)||r)for(const n in e)Array.isArray(e[n])||We(e[n])&&!$d(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Po(e[n],t[n])):at(e[n])||(t[n]=!0);return t}function Bd(e,t,r){const n=Array.isArray(e);if(We(e)||n)for(const s in e)Array.isArray(e[s])||We(e[s])&&!$d(e[s])?je(t)||Ja(r[s])?r[s]=Array.isArray(e[s])?Po(e[s],[]):{...Po(e[s])}:Bd(e[s],at(t)?{}:t[s],r[s]):r[s]=!ir(e[s],t[s]);return r}var _s=(e,t)=>Bd(e,t,Po(t));const Wd={value:!1,isValid:!1},jd={value:!0,isValid:!0};var Ud=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!je(e[0].attributes.value)?je(e[0].value)||e[0].value===""?jd:{value:e[0].value,isValid:!0}:jd:Wd}return Wd},Hd=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>je(e)?e:t?e===""?NaN:e&&+e:r&&Yt(e)?new Date(e):n?n(e):e;const zd={isValid:!1,value:null};var Yd=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,zd):zd;function qd(e){const t=e.ref;return Ra(t)?t.files:ei(t)?Yd(e.refs).value:Vd(t)?[...t.selectedOptions].map(({value:r})=>r):ws(t)?Ud(e.refs).value:Hd(je(t.value)?e.ref.value:t.value,e)}var zy=(e,t,r,n)=>{const s={};for(const o of e){const a=Y(t,o);a&&Ee(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},To=e=>e instanceof RegExp,Cs=e=>je(e)?e:To(e)?e.source:We(e)?To(e.value)?e.value.source:e.value:e,Zd=e=>({isOnSubmit:!e||e===Mt.onSubmit,isOnBlur:e===Mt.onBlur,isOnChange:e===Mt.onChange,isOnAll:e===Mt.all,isOnTouch:e===Mt.onTouched});const Kd="AsyncFunction";var Yy=e=>!!e&&!!e.validate&&!!(At(e.validate)&&e.validate.constructor.name===Kd||We(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Kd)),qy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Qd=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ss=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=Y(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Ss(i,t))break}else if(We(i)&&Ss(i,t))break}}};function Gd(e,t,r){const n=Y(e,r);if(n||So(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=Y(t,o),i=Y(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var Zy=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ft(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||Mt.all))},Ky=(e,t,r)=>!e||!t||e===t||xs(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Qy=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Gy=(e,t)=>!Ka(Y(e,t)).length&&qe(e,t),Xy=(e,t,r)=>{const n=xs(Y(e,r));return Ee(n,"root",t[r]),Ee(e,r,n),e},Oo=e=>Yt(e);function Xd(e,t,r="validate"){if(Oo(e)||Array.isArray(e)&&e.every(Oo)||xt(e)&&!e)return{type:r,message:Oo(e)?e:"",ref:t}}var Fn=e=>We(e)&&!To(e)?e:{value:e,message:""},Jd=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:h,max:v,pattern:f,validate:b,name:p,valueAsNumber:g,mount:x}=e._f,y=Y(r,p);if(!x||t.has(p))return{};const w=i?i[0]:a,k=P=>{s&&w.reportValidity&&(w.setCustomValidity(xt(P)?"":P||""),w.reportValidity())},N={},O=ei(a),A=ws(a),V=O||A,L=(g||Ra(a))&&je(a.value)&&je(y)||Eo(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,U=Fd.bind(null,p,n,N),F=(P,H,I,J=ar.maxLength,q=ar.minLength)=>{const D=P?H:I;N[p]={type:P?J:q,message:D,ref:a,...U(P?J:q,D)}};if(o?!Array.isArray(y)||!y.length:c&&(!V&&(L||at(y))||xt(y)&&!y||A&&!Ud(i).isValid||O&&!Yd(i).isValid)){const{value:P,message:H}=Oo(c)?{value:!!c,message:c}:Fn(c);if(P&&(N[p]={type:ar.required,message:H,ref:w,...U(ar.required,H)},!n))return k(H),N}if(!L&&(!at(h)||!at(v))){let P,H;const I=Fn(v),J=Fn(h);if(!at(y)&&!isNaN(y)){const q=a.valueAsNumber||y&&+y;at(I.value)||(P=q>I.value),at(J.value)||(H=q<J.value)}else{const q=a.valueAsDate||new Date(y),D=ae=>new Date(new Date().toDateString()+" "+ae),M=a.type=="time",W=a.type=="week";Yt(I.value)&&y&&(P=M?D(y)>D(I.value):W?y>I.value:q>new Date(I.value)),Yt(J.value)&&y&&(H=M?D(y)<D(J.value):W?y<J.value:q<new Date(J.value))}if((P||H)&&(F(!!P,I.message,J.message,ar.max,ar.min),!n))return k(N[p].message),N}if((d||u)&&!L&&(Yt(y)||o&&Array.isArray(y))){const P=Fn(d),H=Fn(u),I=!at(P.value)&&y.length>+P.value,J=!at(H.value)&&y.length<+H.value;if((I||J)&&(F(I,P.message,H.message),!n))return k(N[p].message),N}if(f&&!L&&Yt(y)){const{value:P,message:H}=Fn(f);if(To(P)&&!y.match(P)&&(N[p]={type:ar.pattern,message:H,ref:a,...U(ar.pattern,H)},!n))return k(H),N}if(b){if(At(b)){const P=await b(y,r),H=Xd(P,w);if(H&&(N[p]={...H,...U(ar.validate,H.message)},!n))return k(H.message),N}else if(We(b)){let P={};for(const H in b){if(!ft(P)&&!n)break;const I=Xd(await b[H](y,r),w,H);I&&(P={...I,...U(H,I.message)},k(I.message),n&&(N[p]=P))}if(!ft(P)&&(N[p]={ref:w,...P},!n))return N}}return k(!0),N};const Jy={mode:Mt.onSubmit,reValidateMode:Mt.onChange,shouldFocusError:!0};function Ry(e={}){let t={...Jy,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:At(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=We(t.defaultValues)||We(t.values)?Qe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Qe(s),a={action:!1,mount:!1,watch:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...u};const v={array:Ld(),state:Ld()},f=t.criteriaMode===Mt.all,b=C=>E=>{clearTimeout(d),d=setTimeout(C,E)},p=async C=>{if(!t.disabled&&(u.isValid||h.isValid||C)){const E=t.resolver?ft((await A()).errors):await L(n,!0);E!==r.isValid&&v.state.next({isValid:E})}},g=(C,E)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((C||Array.from(i.mount)).forEach(T=>{T&&(E?Ee(r.validatingFields,T,E):qe(r.validatingFields,T))}),v.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},x=(C,E=[],T,z,j=!0,B=!0)=>{if(z&&T&&!t.disabled){if(a.action=!0,B&&Array.isArray(Y(n,C))){const G=T(Y(n,C),z.argA,z.argB);j&&Ee(n,C,G)}if(B&&Array.isArray(Y(r.errors,C))){const G=T(Y(r.errors,C),z.argA,z.argB);j&&Ee(r.errors,C,G),Gy(r.errors,C)}if((u.touchedFields||h.touchedFields)&&B&&Array.isArray(Y(r.touchedFields,C))){const G=T(Y(r.touchedFields,C),z.argA,z.argB);j&&Ee(r.touchedFields,C,G)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=_s(s,o)),v.state.next({name:C,isDirty:F(C,E),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ee(o,C,E)},y=(C,E)=>{Ee(r.errors,C,E),v.state.next({errors:r.errors})},w=C=>{r.errors=C,v.state.next({errors:r.errors,isValid:!1})},k=(C,E,T,z)=>{const j=Y(n,C);if(j){const B=Y(o,C,je(T)?Y(s,C):T);je(B)||z&&z.defaultChecked||E?Ee(o,C,E?B:qd(j._f)):I(C,B),a.mount&&p()}},N=(C,E,T,z,j)=>{let B=!1,G=!1;const ve={name:C};if(!t.disabled){if(!T||z){(u.isDirty||h.isDirty)&&(G=r.isDirty,r.isDirty=ve.isDirty=F(),B=G!==ve.isDirty);const Te=ir(Y(s,C),E);G=!!Y(r.dirtyFields,C),Te?qe(r.dirtyFields,C):Ee(r.dirtyFields,C,!0),ve.dirtyFields=r.dirtyFields,B=B||(u.dirtyFields||h.dirtyFields)&&G!==!Te}if(T){const Te=Y(r.touchedFields,C);Te||(Ee(r.touchedFields,C,T),ve.touchedFields=r.touchedFields,B=B||(u.touchedFields||h.touchedFields)&&Te!==T)}B&&j&&v.state.next(ve)}return B?ve:{}},O=(C,E,T,z)=>{const j=Y(r.errors,C),B=(u.isValid||h.isValid)&&xt(E)&&r.isValid!==E;if(t.delayError&&T?(c=b(()=>y(C,T)),c(t.delayError)):(clearTimeout(d),c=null,T?Ee(r.errors,C,T):qe(r.errors,C)),(T?!ir(j,T):j)||!ft(z)||B){const G={...z,...B&&xt(E)?{isValid:E}:{},errors:r.errors,name:C};r={...r,...G},v.state.next(G)}},A=async C=>{g(C,!0);const E=await t.resolver(o,t.context,zy(C||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(C),E},V=async C=>{const{errors:E}=await A(C);if(C)for(const T of C){const z=Y(E,T);z?Ee(r.errors,T,z):qe(r.errors,T)}else r.errors=E;return E},L=async(C,E,T={valid:!0})=>{for(const z in C){const j=C[z];if(j){const{_f:B,...G}=j;if(B){const ve=i.array.has(B.name),Te=j._f&&Yy(j._f);Te&&u.validatingFields&&g([z],!0);const gt=await Jd(j,i.disabled,o,f,t.shouldUseNativeValidation&&!E,ve);if(Te&&u.validatingFields&&g([z]),gt[B.name]&&(T.valid=!1,E))break;!E&&(Y(gt,B.name)?ve?Xy(r.errors,gt,B.name):Ee(r.errors,B.name,gt[B.name]):qe(r.errors,B.name))}!ft(G)&&await L(G,E,T)}}return T.valid},U=()=>{for(const C of i.unMount){const E=Y(n,C);E&&(E._f.refs?E._f.refs.every(T=>!ti(T)):!ti(E._f.ref))&&Z(C)}i.unMount=new Set},F=(C,E)=>!t.disabled&&(C&&E&&Ee(o,C,E),!ir(ae(),s)),P=(C,E,T)=>Id(C,i,{...a.mount?o:je(E)?s:Yt(C)?{[C]:E}:E},T,E),H=C=>Ka(Y(a.mount?o:s,C,t.shouldUnregister?Y(s,C,[]):[])),I=(C,E,T={})=>{const z=Y(n,C);let j=E;if(z){const B=z._f;B&&(!B.disabled&&Ee(o,C,Hd(E,B)),j=Eo(B.ref)&&at(E)?"":E,Vd(B.ref)?[...B.ref.options].forEach(G=>G.selected=j.includes(G.value)):B.refs?ws(B.ref)?B.refs.forEach(G=>{(!G.defaultChecked||!G.disabled)&&(Array.isArray(j)?G.checked=!!j.find(ve=>ve===G.value):G.checked=j===G.value||!!j)}):B.refs.forEach(G=>G.checked=G.value===j):Ra(B.ref)?B.ref.value="":(B.ref.value=j,B.ref.type||v.state.next({name:C,values:Qe(o)})))}(T.shouldDirty||T.shouldTouch)&&N(C,j,T.shouldTouch,T.shouldDirty,!0),T.shouldValidate&&W(C)},J=(C,E,T)=>{for(const z in E){if(!E.hasOwnProperty(z))return;const j=E[z],B=C+"."+z,G=Y(n,B);(i.array.has(C)||We(j)||G&&!G._f)&&!sn(j)?J(B,j,T):I(B,j,T)}},q=(C,E,T={})=>{const z=Y(n,C),j=i.array.has(C),B=Qe(E);Ee(o,C,B),j?(v.array.next({name:C,values:Qe(o)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&T.shouldDirty&&v.state.next({name:C,dirtyFields:_s(s,o),isDirty:F(C,B)})):z&&!z._f&&!at(B)?J(C,B,T):I(C,B,T),Qd(C,i)&&v.state.next({...r,name:C}),v.state.next({name:a.mount?C:void 0,values:Qe(o)})},D=async C=>{a.mount=!0;const E=C.target;let T=E.name,z=!0;const j=Y(n,T),B=Te=>{z=Number.isNaN(Te)||sn(Te)&&isNaN(Te.getTime())||ir(Te,Y(o,T,Te))},G=Zd(t.mode),ve=Zd(t.reValidateMode);if(j){let Te,gt;const gr=E.type?qd(j._f):Md(C),tr=C.type===ko.BLUR||C.type===ko.FOCUS_OUT,Ro=!qy(j._f)&&!t.resolver&&!Y(r.errors,T)&&!j._f.deps||Qy(tr,Y(r.touchedFields,T),r.isSubmitted,ve,G),xn=Qd(T,i,tr);Ee(o,T,gr),tr?(j._f.onBlur&&j._f.onBlur(C),c&&c(0)):j._f.onChange&&j._f.onChange(C);const rr=N(T,gr,tr),ea=!ft(rr)||xn;if(!tr&&v.state.next({name:T,type:C.type,values:Qe(o)}),Ro)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?tr&&p():tr||p()),ea&&v.state.next({name:T,...xn?{}:rr});if(!tr&&xn&&v.state.next({...r}),t.resolver){const{errors:yr}=await A([T]);if(B(gr),z){const Ri=Gd(r.errors,n,T),ta=Gd(yr,n,Ri.name||T);Te=ta.error,T=ta.name,gt=ft(yr)}}else g([T],!0),Te=(await Jd(j,i.disabled,o,f,t.shouldUseNativeValidation))[T],g([T]),B(gr),z&&(Te?gt=!1:(u.isValid||h.isValid)&&(gt=await L(n,!0)));z&&(j._f.deps&&W(j._f.deps),O(T,gt,Te,rr))}},M=(C,E)=>{if(Y(r.errors,E)&&C.focus)return C.focus(),1},W=async(C,E={})=>{let T,z;const j=xs(C);if(t.resolver){const B=await V(je(C)?C:j);T=ft(B),z=C?!j.some(G=>Y(B,G)):T}else C?(z=(await Promise.all(j.map(async B=>{const G=Y(n,B);return await L(G&&G._f?{[B]:G}:G)}))).every(Boolean),!(!z&&!r.isValid)&&p()):z=T=await L(n);return v.state.next({...!Yt(C)||(u.isValid||h.isValid)&&T!==r.isValid?{}:{name:C},...t.resolver||!C?{isValid:T}:{},errors:r.errors}),E.shouldFocus&&!z&&Ss(n,M,C?j:i.mount),z},ae=C=>{const E={...a.mount?o:s};return je(C)?E:Yt(C)?Y(E,C):C.map(T=>Y(E,T))},Se=(C,E)=>({invalid:!!Y((E||r).errors,C),isDirty:!!Y((E||r).dirtyFields,C),error:Y((E||r).errors,C),isValidating:!!Y(r.validatingFields,C),isTouched:!!Y((E||r).touchedFields,C)}),de=C=>{C&&xs(C).forEach(E=>qe(r.errors,E)),v.state.next({errors:C?r.errors:{}})},ue=(C,E,T)=>{const z=(Y(n,C,{_f:{}})._f||{}).ref,j=Y(r.errors,C)||{},{ref:B,message:G,type:ve,...Te}=j;Ee(r.errors,C,{...Te,...E,ref:z}),v.state.next({name:C,errors:r.errors,isValid:!1}),T&&T.shouldFocus&&z&&z.focus&&z.focus()},pe=(C,E)=>At(C)?v.state.subscribe({next:T=>"values"in T&&C(P(void 0,E),T)}):P(C,E,!0),Fe=C=>v.state.subscribe({next:E=>{Ky(C.name,E.name,C.exact)&&Zy(E,C.formState||u,mr,C.reRenderRoot)&&C.callback({values:{...o},...r,...E,defaultValues:s})}}).unsubscribe,rt=C=>(a.mount=!0,h={...h,...C.formState},Fe({...C,formState:h})),Z=(C,E={})=>{for(const T of C?xs(C):i.mount)i.mount.delete(T),i.array.delete(T),E.keepValue||(qe(n,T),qe(o,T)),!E.keepError&&qe(r.errors,T),!E.keepDirty&&qe(r.dirtyFields,T),!E.keepTouched&&qe(r.touchedFields,T),!E.keepIsValidating&&qe(r.validatingFields,T),!t.shouldUnregister&&!E.keepDefaultValue&&qe(s,T);v.state.next({values:Qe(o)}),v.state.next({...r,...E.keepDirty?{isDirty:F()}:{}}),!E.keepIsValid&&p()},ke=({disabled:C,name:E})=>{(xt(C)&&a.mount||C||i.disabled.has(E))&&(C?i.disabled.add(E):i.disabled.delete(E))},Ae=(C,E={})=>{let T=Y(n,C);const z=xt(E.disabled)||xt(t.disabled);return Ee(n,C,{...T||{},_f:{...T&&T._f?T._f:{ref:{name:C}},name:C,mount:!0,...E}}),i.mount.add(C),T?ke({disabled:xt(E.disabled)?E.disabled:t.disabled,name:C}):k(C,!0,E.value),{...z?{disabled:E.disabled||t.disabled}:{},...t.progressive?{required:!!E.required,min:Cs(E.min),max:Cs(E.max),minLength:Cs(E.minLength),maxLength:Cs(E.maxLength),pattern:Cs(E.pattern)}:{},name:C,onChange:D,onBlur:D,ref:j=>{if(j){Ae(C,E),T=Y(n,C);const B=je(j.value)&&j.querySelectorAll&&j.querySelectorAll("input,select,textarea")[0]||j,G=jy(B),ve=T._f.refs||[];if(G?ve.find(Te=>Te===B):B===T._f.ref)return;Ee(n,C,{_f:{...T._f,...G?{refs:[...ve.filter(ti),B,...Array.isArray(Y(s,C))?[{}]:[]],ref:{type:B.type,name:C}}:{ref:B}}}),k(C,!1,void 0,B)}else T=Y(n,C,{}),T._f&&(T._f.mount=!1),(t.shouldUnregister||E.shouldUnregister)&&!(Ad(i.array,C)&&a.action)&&i.unMount.add(C)}}},ye=()=>t.shouldFocusError&&Ss(n,M,i.mount),me=C=>{xt(C)&&(v.state.next({disabled:C}),Ss(n,(E,T)=>{const z=Y(n,T);z&&(E.disabled=z._f.disabled||C,Array.isArray(z._f.refs)&&z._f.refs.forEach(j=>{j.disabled=z._f.disabled||C}))},0,!1))},be=(C,E)=>async T=>{let z;T&&(T.preventDefault&&T.preventDefault(),T.persist&&T.persist());let j=Qe(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:B,values:G}=await A();r.errors=B,j=Qe(G)}else await L(n);if(i.disabled.size)for(const B of i.disabled)qe(j,B);if(qe(r.errors,"root"),ft(r.errors)){v.state.next({errors:{}});try{await C(j,T)}catch(B){z=B}}else E&&await E({...r.errors},T),ye(),setTimeout(ye);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ft(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},Je=(C,E={})=>{Y(n,C)&&(je(E.defaultValue)?q(C,Qe(Y(s,C))):(q(C,E.defaultValue),Ee(s,C,Qe(E.defaultValue))),E.keepTouched||qe(r.touchedFields,C),E.keepDirty||(qe(r.dirtyFields,C),r.isDirty=E.defaultValue?F(C,Qe(Y(s,C))):F()),E.keepError||(qe(r.errors,C),u.isValid&&p()),v.state.next({...r}))},dt=(C,E={})=>{const T=C?Qe(C):s,z=Qe(T),j=ft(C),B=j?s:z;if(E.keepDefaultValues||(s=T),!E.keepValues){if(E.keepDirtyValues){const G=new Set([...i.mount,...Object.keys(_s(s,o))]);for(const ve of Array.from(G))Y(r.dirtyFields,ve)?Ee(B,ve,Y(o,ve)):q(ve,Y(B,ve))}else{if(Za&&je(C))for(const G of i.mount){const ve=Y(n,G);if(ve&&ve._f){const Te=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(Eo(Te)){const gt=Te.closest("form");if(gt){gt.reset();break}}}}if(E.keepFieldsRef)for(const G of i.mount)q(G,Y(B,G));else n={}}o=t.shouldUnregister?E.keepDefaultValues?Qe(s):{}:Qe(B),v.array.next({values:{...B}}),v.state.next({values:{...B}})}i={mount:E.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!E.keepIsValid||!!E.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:E.keepSubmitCount?r.submitCount:0,isDirty:j?!1:E.keepDirty?r.isDirty:!!(E.keepDefaultValues&&!ir(C,s)),isSubmitted:E.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:j?{}:E.keepDirtyValues?E.keepDefaultValues&&o?_s(s,o):r.dirtyFields:E.keepDefaultValues&&C?_s(s,C):E.keepDirty?r.dirtyFields:{},touchedFields:E.keepTouched?r.touchedFields:{},errors:E.keepErrors?r.errors:{},isSubmitSuccessful:E.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Rt=(C,E)=>dt(At(C)?C(o):C,E),er=(C,E={})=>{const T=Y(n,C),z=T&&T._f;if(z){const j=z.refs?z.refs[0]:z.ref;j.focus&&(j.focus(),E.shouldSelect&&At(j.select)&&j.select())}},mr=C=>{r={...r,...C}},vr={control:{register:Ae,unregister:Z,getFieldState:Se,handleSubmit:be,setError:ue,_subscribe:Fe,_runSchema:A,_focusError:ye,_getWatch:P,_getDirty:F,_setValid:p,_setFieldArray:x,_setDisabledField:ke,_setErrors:w,_getFieldArray:H,_reset:dt,_resetDefaultValues:()=>At(t.defaultValues)&&t.defaultValues().then(C=>{Rt(C,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:U,_disableForm:me,_subjects:v,_proxyFormState:u,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(C){a=C},get _defaultValues(){return s},get _names(){return i},set _names(C){i=C},get _formState(){return r},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:rt,trigger:W,register:Ae,handleSubmit:be,watch:pe,setValue:q,getValues:ae,reset:Rt,resetField:Je,clearErrors:de,unregister:Z,setError:ue,setFocus:er,getFieldState:Se};return{...vr,formControl:vr}}function ks(e={}){const t=S.useRef(void 0),r=S.useRef(void 0),[n,s]=S.useState({isDirty:!1,isValidating:!1,isLoading:At(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:At(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!At(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...i}=Ry(e);t.current={...i,formState:n}}const o=t.current.control;return o._options=e,Xa(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(i=>({...i,isReady:!0})),o._formState.isReady=!0,a},[o]),S.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),S.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),S.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),S.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),S.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==n.isDirty&&o._subjects.state.next({isDirty:a})}},[o,n.isDirty]),S.useEffect(()=>{e.values&&!ir(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),S.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Dd(n,o),t.current}const Rd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Y(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},eu=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Rd(n.ref,r,e):n.refs&&n.refs.forEach(s=>Rd(s,r,e))}},eb=(e,t)=>{t.shouldUseNativeValidation&&eu(e,t);const r={};for(const n in e){const s=Y(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(tb(t.names||Object.keys(e),n)){const a=Object.assign({},Y(r,n));Ee(a,"root",o),Ee(r,n,a)}else Ee(r,n,o)}return r},tb=(e,t)=>e.some(r=>r.startsWith(t+"."));var rb=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[a]={message:i.message,type:i.code}}else r[a]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(h){return e.push(h)})}),t){var c=r[a].types,d=c&&c[n.code];r[a]=Fd(a,t,r,s,d?[].concat(d,n.message):n.message)}e.shift()}return r},Ns=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(a,i){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return o.shouldUseNativeValidation&&eu({},o),{errors:{},values:r.raw?n:d}})}catch(d){return i(d)}return c&&c.then?c.then(void 0,i):c}(0,function(a){if(function(i){return Array.isArray(i==null?void 0:i.errors)}(a))return{values:{},errors:eb(rb(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},Ce;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(const i of o)a[i]=s[i];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ce||(Ce={}));var tu;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(tu||(tu={}));const X=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=e=>{switch(typeof e){case"undefined":return X.undefined;case"string":return X.string;case"number":return Number.isNaN(e)?X.nan:X.number;case"boolean":return X.boolean;case"function":return X.function;case"bigint":return X.bigint;case"symbol":return X.symbol;case"object":return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?X.promise:typeof Map<"u"&&e instanceof Map?X.map:typeof Set<"u"&&e instanceof Set?X.set:typeof Date<"u"&&e instanceof Date?X.date:X.object;default:return X.unknown}},$=Ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class lr extends Error{get errors(){return this.issues}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}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let i=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(r(a))):i[d]=i[d]||{_errors:[]},i=i[d],c++}}};return s(this),n}static assert(t){if(!(t instanceof lr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}lr.create=e=>new lr(e);const ri=(e,t)=>{let r;switch(e.code){case $.invalid_type:e.received===X.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case $.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case $.invalid_union:r="Invalid input";break;case $.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case $.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case $.invalid_arguments:r="Invalid function arguments";break;case $.invalid_return_type:r="Invalid function return type";break;case $.invalid_date:r="Invalid date";break;case $.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}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case $.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==="bigint"?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 $.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 $.custom:r="Invalid input";break;case $.invalid_intersection_types:r="Intersection results could not be merged";break;case $.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case $.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}};let nb=ri;function sb(){return nb}const ob=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)i=d(a,{data:t,defaultError:i}).message;return{...s,path:o,message:i}};function K(e,t){const r=sb(),n=ob({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ri?void 0:ri].filter(s=>!!s)});e.common.issues.push(n)}class _t{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 s of r){if(s.status==="aborted")return ne;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,a=await s.value;n.push({key:o,value:a})}return _t.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return ne;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}}const ne=Object.freeze({status:"aborted"}),Es=e=>({status:"dirty",value:e}),kt=e=>({status:"valid",value:e}),ru=e=>e.status==="aborted",nu=e=>e.status==="dirty",Ln=e=>e.status==="valid",Mo=e=>typeof Promise<"u"&&e instanceof Promise;var R;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(R||(R={}));class Pr{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const su=(e,t)=>{if(Ln(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 lr(e.common.issues);return this._error=r,this._error}}};function fe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=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:s}:{errorMap:(a,i)=>{const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??n??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??r??i.defaultError}},description:s}}class xe{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _t,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Mo(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){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},s=this._parseSync({data:t,path:n.path,parent:n});return su(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:r});return Ln(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(s=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>Ln(o)?{value:o.value}:{issues:r.common.issues})}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:Er(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Mo(s)?s:Promise.resolve(s));return su(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const a=t(s),i=()=>o.addIssue({code:$.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(i(),!1)):a?!0:(i(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new Bn({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}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),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Mr.create(this,this._def)}nullable(){return Wn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qt.create(this)}promise(){return Io.create(this,this._def)}or(t){return Ao.create([this,t],this._def)}and(t){return Do.create(this,t,this._def)}transform(t){return new Bn({...fe(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ai({...fe(this._def),innerType:this,defaultValue:r,typeName:se.ZodDefault})}brand(){return new Pb({typeName:se.ZodBranded,type:this,...fe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ii({...fe(this._def),innerType:this,catchValue:r,typeName:se.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return li.create(this,t)}readonly(){return ci.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ab=/^c[^\s-]{8,}$/i,ib=/^[0-9a-z]+$/,lb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cb=/^[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,db=/^[a-z0-9_-]{21}$/i,ub=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fb=/^[-+]?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)?)??$/,hb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ni;const mb=/^(?:(?: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])$/,vb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ou="((\\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])))",xb=new RegExp(`^${ou}$`);function au(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function _b(e){return new RegExp(`^${au(e)}$`)}function Cb(e){let t=`${ou}T${au(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 Sb(e,t){return!!((t==="v4"||!t)&&mb.test(e)||(t==="v6"||!t)&&gb.test(e))}function kb(e,t){if(!ub.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Nb(e,t){return!!((t==="v4"||!t)&&vb.test(e)||(t==="v6"||!t)&&yb.test(e))}class Tr extends xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==X.string){const o=this._getOrReturnCtx(t);return K(o,{code:$.invalid_type,expected:X.string,received:o.parsedType}),ne}const n=new _t;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),K(s,{code:$.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&&(s=this._getOrReturnCtx(t,s),K(s,{code:$.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,i=t.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(t,s),a?K(s,{code:$.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&K(s,{code:$.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")hb.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"email",code:$.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ni||(ni=new RegExp(pb,"u")),ni.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"emoji",code:$.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")cb.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"uuid",code:$.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")db.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"nanoid",code:$.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ab.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"cuid",code:$.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ib.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"cuid2",code:$.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")lb.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"ulid",code:$.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),K(s,{validation:"url",code:$.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"regex",code:$.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)||(s=this._getOrReturnCtx(t,s),K(s,{code:$.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)||(s=this._getOrReturnCtx(t,s),K(s,{code:$.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),K(s,{code:$.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Cb(o).test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{code:$.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?xb.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{code:$.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?_b(o).test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{code:$.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?fb.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"duration",code:$.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Sb(t.data,o.version)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"ip",code:$.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?kb(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"jwt",code:$.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Nb(t.data,o.version)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"cidr",code:$.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?bb.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"base64",code:$.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?wb.test(t.data)||(s=this._getOrReturnCtx(t,s),K(s,{validation:"base64url",code:$.invalid_string,message:o.message}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:$.invalid_string,...R.errToObj(n)})}_addCheck(t){return new Tr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.errToObj(t)})}datetime(t){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:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...R.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,...R.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...R.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...R.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...R.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...R.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...R.errToObj(r)})}nonempty(t){return this.min(1,R.errToObj(t))}trim(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Tr({...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 isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}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}}Tr.create=e=>new Tr({checks:[],typeName:se.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});function Eb(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}class Ps extends xe{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)!==X.number){const o=this._getOrReturnCtx(t);return K(o,{code:$.invalid_type,expected:X.number,received:o.parsedType}),ne}let n;const s=new _t;for(const o of this._def.checks)o.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{code:$.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),K(n,{code:$.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),K(n,{code:$.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Eb(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),K(n,{code:$.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{code:$.not_finite,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Ps({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Ps({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.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"&&Ce.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)}}Ps.create=e=>new Ps({checks:[],typeName:se.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Ts extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==X.bigint)return this._getInvalidInput(t);let n;const s=new _t;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),K(n,{code:$.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),K(n,{code:$.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),K(n,{code:$.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return K(r,{code:$.invalid_type,expected:X.bigint,received:r.parsedType}),ne}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Ts({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Ts({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.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}}Ts.create=e=>new Ts({checks:[],typeName:se.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});class iu extends xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==X.boolean){const n=this._getOrReturnCtx(t);return K(n,{code:$.invalid_type,expected:X.boolean,received:n.parsedType}),ne}return kt(t.data)}}iu.create=e=>new iu({typeName:se.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Os extends xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==X.date){const o=this._getOrReturnCtx(t);return K(o,{code:$.invalid_type,expected:X.date,received:o.parsedType}),ne}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return K(o,{code:$.invalid_date}),ne}const n=new _t;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),K(s,{code:$.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),K(s,{code:$.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Os({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:R.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:R.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}}Os.create=e=>new Os({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:se.ZodDate,...fe(e)});class lu extends xe{_parse(t){if(this._getType(t)!==X.symbol){const n=this._getOrReturnCtx(t);return K(n,{code:$.invalid_type,expected:X.symbol,received:n.parsedType}),ne}return kt(t.data)}}lu.create=e=>new lu({typeName:se.ZodSymbol,...fe(e)});class cu extends xe{_parse(t){if(this._getType(t)!==X.undefined){const n=this._getOrReturnCtx(t);return K(n,{code:$.invalid_type,expected:X.undefined,received:n.parsedType}),ne}return kt(t.data)}}cu.create=e=>new cu({typeName:se.ZodUndefined,...fe(e)});class du extends xe{_parse(t){if(this._getType(t)!==X.null){const n=this._getOrReturnCtx(t);return K(n,{code:$.invalid_type,expected:X.null,received:n.parsedType}),ne}return kt(t.data)}}du.create=e=>new du({typeName:se.ZodNull,...fe(e)});class Ms extends xe{constructor(){super(...arguments),this._any=!0}_parse(t){return kt(t.data)}}Ms.create=e=>new Ms({typeName:se.ZodAny,...fe(e)});class uu extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kt(t.data)}}uu.create=e=>new uu({typeName:se.ZodUnknown,...fe(e)});class Or extends xe{_parse(t){const r=this._getOrReturnCtx(t);return K(r,{code:$.invalid_type,expected:X.never,received:r.parsedType}),ne}}Or.create=e=>new Or({typeName:se.ZodNever,...fe(e)});class fu extends xe{_parse(t){if(this._getType(t)!==X.undefined){const n=this._getOrReturnCtx(t);return K(n,{code:$.invalid_type,expected:X.void,received:n.parsedType}),ne}return kt(t.data)}}fu.create=e=>new fu({typeName:se.ZodVoid,...fe(e)});class qt extends xe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==X.array)return K(r,{code:$.invalid_type,expected:X.array,received:r.parsedType}),ne;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,i=r.data.length<s.exactLength.value;(a||i)&&(K(r,{code:a?$.too_big:$.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(K(r,{code:$.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(K(r,{code:$.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,i)=>s.type._parseAsync(new Pr(r,a,r.path,i)))).then(a=>_t.mergeArray(n,a));const o=[...r.data].map((a,i)=>s.type._parseSync(new Pr(r,a,r.path,i)));return _t.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new qt({...this._def,minLength:{value:t,message:R.toString(r)}})}max(t,r){return new qt({...this._def,maxLength:{value:t,message:R.toString(r)}})}length(t,r){return new qt({...this._def,exactLength:{value:t,message:R.toString(r)}})}nonempty(t){return this.min(1,t)}}qt.create=(e,t)=>new qt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...fe(t)});function Vn(e){if(e instanceof Ve){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Mr.create(Vn(n))}return new Ve({...e._def,shape:()=>t})}else return e instanceof qt?new qt({...e._def,type:Vn(e.element)}):e instanceof Mr?Mr.create(Vn(e.unwrap())):e instanceof Wn?Wn.create(Vn(e.unwrap())):e instanceof on?on.create(e.items.map(t=>Vn(t))):e}class Ve extends xe{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=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==X.object){const d=this._getOrReturnCtx(t);return K(d,{code:$.invalid_type,expected:X.object,received:d.parsedType}),ne}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof Or&&this._def.unknownKeys==="strip"))for(const d in s.data)a.includes(d)||i.push(d);const c=[];for(const d of a){const u=o[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Pr(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Or){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of i)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(d==="strict")i.length>0&&(K(s,{code:$.unrecognized_keys,keys:i}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of i){const h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Pr(s,h,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const h=await u.key,v=await u.value;d.push({key:h,value:v,alwaysSet:u.alwaysSet})}return d}).then(d=>_t.mergeObjectSync(n,d)):_t.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new Ve({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,a;const s=((a=(o=this._def).errorMap)==null?void 0:a.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:R.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Ve({...this._def,unknownKeys:"strip"})}passthrough(){return new Ve({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ve({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ve({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:se.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Ve({...this._def,catchall:t})}pick(t){const r={};for(const n of Ce.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}deepPartial(){return Vn(this)}partial(t){const r={};for(const n of Ce.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new Ve({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Mr;)o=o._def.innerType;r[n]=o}return new Ve({...this._def,shape:()=>r})}keyof(){return mu(Ce.objectKeys(this.shape))}}Ve.create=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.strictCreate=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strict",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.lazycreate=(e,t)=>new Ve({shape:e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)});class Ao extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(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 a=o.map(i=>new lr(i.ctx.common.issues));return K(r,{code:$.invalid_union,unionErrors:a}),ne}if(r.common.async)return Promise.all(n.map(async o=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of n){const d={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(c=>new lr(c));return K(r,{code:$.invalid_union,unionErrors:i}),ne}}get options(){return this._def.options}}Ao.create=(e,t)=>new Ao({options:e,typeName:se.ZodUnion,...fe(t)});function si(e,t){const r=Er(e),n=Er(t);if(e===t)return{valid:!0,data:e};if(r===X.object&&n===X.object){const s=Ce.objectKeys(t),o=Ce.objectKeys(e).filter(i=>s.indexOf(i)!==-1),a={...e,...t};for(const i of o){const c=si(e[i],t[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===X.array&&n===X.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const a=e[o],i=t[o],c=si(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===X.date&&n===X.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Do extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(o,a)=>{if(ru(o)||ru(a))return ne;const i=si(o.value,a.value);return i.valid?((nu(o)||nu(a))&&r.dirty(),{status:r.value,value:i.data}):(K(n,{code:$.invalid_intersection_types}),ne)};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,a])=>s(o,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Do.create=(e,t,r)=>new Do({left:e,right:t,typeName:se.ZodIntersection,...fe(r)});class on extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.array)return K(n,{code:$.invalid_type,expected:X.array,received:n.parsedType}),ne;if(n.data.length<this._def.items.length)return K(n,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ne;!this._def.rest&&n.data.length>this._def.items.length&&(K(n,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((a,i)=>{const c=this._def.items[i]||this._def.rest;return c?c._parse(new Pr(n,a,n.path,i)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>_t.mergeArray(r,a)):_t.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new on({...this._def,rest:t})}}on.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new on({items:e,typeName:se.ZodTuple,rest:null,...fe(t)})};class hu extends xe{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!==X.map)return K(n,{code:$.invalid_type,expected:X.map,received:n.parsedType}),ne;const s=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([i,c],d)=>({key:s._parse(new Pr(n,i,n.path,[d,"key"])),value:o._parse(new Pr(n,c,n.path,[d,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const c of a){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}})}else{const i=new Map;for(const c of a){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}}}}hu.create=(e,t,r)=>new hu({valueType:t,keyType:e,typeName:se.ZodMap,...fe(r)});class As extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.set)return K(n,{code:$.invalid_type,expected:X.set,received:n.parsedType}),ne;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(K(n,{code:$.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(K(n,{code:$.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function a(c){const d=new Set;for(const u of c){if(u.status==="aborted")return ne;u.status==="dirty"&&r.dirty(),d.add(u.value)}return{status:r.value,value:d}}const i=[...n.data.values()].map((c,d)=>o._parse(new Pr(n,c,n.path,d)));return n.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(t,r){return new As({...this._def,minSize:{value:t,message:R.toString(r)}})}max(t,r){return new As({...this._def,maxSize:{value:t,message:R.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}As.create=(e,t)=>new As({valueType:e,minSize:null,maxSize:null,typeName:se.ZodSet,...fe(t)});class pu extends xe{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})}}pu.create=(e,t)=>new pu({getter:e,typeName:se.ZodLazy,...fe(t)});class oi extends xe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return K(r,{received:r.data,code:$.invalid_literal,expected:this._def.value}),ne}return{status:"valid",value:t.data}}get value(){return this._def.value}}oi.create=(e,t)=>new oi({value:e,typeName:se.ZodLiteral,...fe(t)});function mu(e,t){return new $n({values:e,typeName:se.ZodEnum,...fe(t)})}class $n extends xe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return K(r,{expected:Ce.joinValues(n),received:r.parsedType,code:$.invalid_type}),ne}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return K(r,{received:r.data,code:$.invalid_enum_value,options:n}),ne}return kt(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 $n.create(t,{...this._def,...r})}exclude(t,r=this._def){return $n.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}$n.create=mu;class vu extends xe{_parse(t){const r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==X.string&&n.parsedType!==X.number){const s=Ce.objectValues(r);return K(n,{expected:Ce.joinValues(s),received:n.parsedType,code:$.invalid_type}),ne}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ce.objectValues(r);return K(n,{received:n.data,code:$.invalid_enum_value,options:s}),ne}return kt(t.data)}get enum(){return this._def.values}}vu.create=(e,t)=>new vu({values:e,typeName:se.ZodNativeEnum,...fe(t)});class Io extends xe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==X.promise&&r.common.async===!1)return K(r,{code:$.invalid_type,expected:X.promise,received:r.parsedType}),ne;const n=r.parsedType===X.promise?r.data:Promise.resolve(r.data);return kt(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Io.create=(e,t)=>new Io({type:e,typeName:se.ZodPromise,...fe(t)});class Bn extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{K(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async i=>{if(r.value==="aborted")return ne;const c=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return c.status==="aborted"?ne:c.status==="dirty"||r.value==="dirty"?Es(c.value):c});{if(r.value==="aborted")return ne;const i=this._def.schema._parseSync({data:a,path:n.path,parent:n});return i.status==="aborted"?ne:i.status==="dirty"||r.value==="dirty"?Es(i.value):i}}if(s.type==="refinement"){const a=i=>{const c=s.refinement(i,o);if(n.common.async)return Promise.resolve(c);if(c 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"?ne:(i.status==="dirty"&&r.dirty(),a(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"?ne:(i.status==="dirty"&&r.dirty(),a(i.value).then(()=>({status:r.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ln(a))return ne;const i=s.transform(a.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(a=>Ln(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:r.value,value:i})):ne);Ce.assertNever(s)}}Bn.create=(e,t,r)=>new Bn({schema:e,typeName:se.ZodEffects,effect:t,...fe(r)}),Bn.createWithPreprocess=(e,t,r)=>new Bn({schema:t,effect:{type:"preprocess",transform:e},typeName:se.ZodEffects,...fe(r)});class Mr extends xe{_parse(t){return this._getType(t)===X.undefined?kt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:se.ZodOptional,...fe(t)});class Wn extends xe{_parse(t){return this._getType(t)===X.null?kt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Wn.create=(e,t)=>new Wn({innerType:e,typeName:se.ZodNullable,...fe(t)});class ai extends xe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===X.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ai.create=(e,t)=>new ai({innerType:e,typeName:se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...fe(t)});class ii extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Mo(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ii.create=(e,t)=>new ii({innerType:e,typeName:se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...fe(t)});class gu extends xe{_parse(t){if(this._getType(t)!==X.nan){const n=this._getOrReturnCtx(t);return K(n,{code:$.invalid_type,expected:X.nan,received:n.parsedType}),ne}return{status:"valid",value:t.data}}}gu.create=e=>new gu({typeName:se.ZodNaN,...fe(e)});class Pb extends xe{_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 li extends xe{_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"?ne:o.status==="dirty"?(r.dirty(),Es(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ne:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new li({in:t,out:r,typeName:se.ZodPipeline})}}class ci extends xe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Ln(s)&&(s.value=Object.freeze(s.value)),s);return Mo(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}ci.create=(e,t)=>new ci({innerType:e,typeName:se.ZodReadonly,...fe(t)});function yu(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Tb(e,t={},r){return e?Ms.create().superRefine((n,s)=>{const o=e(n);if(o instanceof Promise)return o.then(a=>{if(!a){const i=yu(t,n),c=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:c})}});if(!o){const a=yu(t,n),i=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:i})}}):Ms.create()}Ve.lazycreate;var se;(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"})(se||(se={}));const di=(e,t={message:`Input not instance of ${e.name}`})=>Tb(r=>r instanceof e,t),et=Tr.create,bu=Os.create;Ms.create,Or.create,qt.create;const Ds=Ve.create;Ve.strictCreate,Ao.create,Do.create,on.create;const Ob=oi.create;$n.create,Io.create,Mr.create,Wn.create;const Is=Ly,wu=m.createContext({}),Ze=({...e})=>l.jsx(wu.Provider,{value:{name:e.name},children:l.jsx(Wy,{...e})}),Fo=()=>{const e=m.useContext(wu),t=m.useContext(xu),{getFieldState:r,formState:n}=No(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},xu=m.createContext({}),Ue=m.forwardRef(({className:e,...t},r)=>{const n=m.useId();return l.jsx(xu.Provider,{value:{id:n},children:l.jsx("div",{ref:r,className:he("space-y-2",e),...t})})});Ue.displayName="FormItem";const He=m.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Fo();return l.jsx(nn,{ref:r,className:he(n&&"text-destructive",e),htmlFor:s,...t})});He.displayName="FormLabel";const ze=m.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Fo();return l.jsx(hl,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});ze.displayName="FormControl";const Mb=m.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Fo();return l.jsx("p",{ref:r,id:n,className:he("text-sm text-muted-foreground",e),...t})});Mb.displayName="FormDescription";const Ye=m.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Fo(),a=s?String(s==null?void 0:s.message):t;return a?l.jsx("p",{ref:n,id:o,className:he("text-sm font-medium text-destructive",e),...r,children:a}):null});Ye.displayName="FormMessage";const Ab=Ds({bank_statement:di(File).optional().refine(e=>e!==void 0,"Bank statement is required"),company_structure:di(File).optional().refine(e=>e!==void 0,"Company structure document is required"),certificate_of_registration:di(File).optional().refine(e=>e!==void 0,"Certificate of registration is required")}),Db=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=S.useRef(null),a=S.useRef(null),i=S.useRef(null),c=ks({resolver:Ns(Ab),defaultValues:{bank_statement:e.bank_statement||void 0,company_structure:e.company_structure||void 0,certificate_of_registration:e.certificate_of_registration||void 0}}),d=v=>{t(v),r()},u=(v,f)=>{c.setValue(v,f),t({[v]:f})},h=({field:v,label:f,description:b,inputRef:p})=>{const g=c.watch(v);return l.jsx(Ze,{control:c.control,name:v,render:()=>l.jsxs(Ue,{children:[l.jsx(He,{children:f}),l.jsx(ze,{children:l.jsxs("div",{className:"border-2 border-dashed border-muted-foreground/25 rounded-lg p-6",children:[l.jsx("input",{ref:p,type:"file",accept:".pdf,.jpg,.jpeg,.png,.doc,.docx",className:"hidden",onChange:x=>{var w;const y=((w=x.target.files)==null?void 0:w[0])||null;u(v,y)}}),g?l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Bp,{className:"w-5 h-5 text-primary"}),l.jsx("span",{className:"text-sm font-medium",children:g.name})]}),l.jsx(Be,{type:"button",variant:"ghost",size:"sm",onClick:()=>{u(v,null),p.current&&(p.current.value="")},children:l.jsx(Rl,{className:"w-4 h-4"})})]}):l.jsxs("div",{className:"text-center cursor-pointer",onClick:()=>{var x;return(x=p.current)==null?void 0:x.click()},children:[l.jsx(jp,{className:"w-8 h-8 mx-auto mb-2 text-muted-foreground"}),l.jsx("p",{className:"font-medium",children:f}),l.jsx("p",{className:"text-sm text-muted-foreground",children:b}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Supported: PDF, JPG, PNG, DOC, DOCX"})]})]})}),l.jsx(Ye,{})]})})};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Documents",subTitle:"Please upload the required company documents",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Is,{...c,children:l.jsxs("form",{onSubmit:c.handleSubmit(d),className:"space-y-6",children:[l.jsx(h,{field:"bank_statement",label:"Bank Statement",description:"Upload your latest bank statement",inputRef:o}),l.jsx(h,{field:"company_structure",label:"Company Structure",description:"Upload document showing directors & legal representatives",inputRef:a}),l.jsx(h,{field:"certificate_of_registration",label:"Certificate of Registration",description:"Upload your company's certificate of registration",inputRef:i}),l.jsx(Be,{type:"submit",className:"w-full",children:"Complete Verification"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function _u(e,[t,r]){return Math.min(r,Math.max(t,e))}var Ib=m.createContext(void 0);function Fb(e){const t=m.useContext(Ib);return e||t||"ltr"}var ui=0;function Cu(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Su()),document.body.insertAdjacentElement("beforeend",e[1]??Su()),ui++,()=>{ui===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ui--}},[])}function Su(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fi="focusScope.autoFocusOnMount",hi="focusScope.autoFocusOnUnmount",ku={bubbles:!1,cancelable:!0},Lb="FocusScope",pi=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,c]=m.useState(null),d=Et(s),u=Et(o),h=m.useRef(null),v=Ie(t,p=>c(p)),f=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let p=function(w){if(f.paused||!i)return;const k=w.target;i.contains(k)?h.current=k:Ar(h.current,{select:!0})},g=function(w){if(f.paused||!i)return;const k=w.relatedTarget;k!==null&&(i.contains(k)||Ar(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const N of w)N.removedNodes.length>0&&Ar(i)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(x);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[n,i,f.paused]),m.useEffect(()=>{if(i){Pu.add(f);const p=document.activeElement;if(!i.contains(p)){const x=new CustomEvent(fi,ku);i.addEventListener(fi,d),i.dispatchEvent(x),x.defaultPrevented||(Vb(Ub(Nu(i)),{select:!0}),document.activeElement===p&&Ar(i))}return()=>{i.removeEventListener(fi,d),setTimeout(()=>{const x=new CustomEvent(hi,ku);i.addEventListener(hi,u),i.dispatchEvent(x),x.defaultPrevented||Ar(p??document.body,{select:!0}),i.removeEventListener(hi,u),Pu.remove(f)},0)}}},[i,d,u,f]);const b=m.useCallback(p=>{if(!r&&!n||f.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(g&&x){const y=p.currentTarget,[w,k]=$b(y);w&&k?!p.shiftKey&&x===k?(p.preventDefault(),r&&Ar(w,{select:!0})):p.shiftKey&&x===w&&(p.preventDefault(),r&&Ar(k,{select:!0})):x===y&&p.preventDefault()}},[r,n,f.paused]);return l.jsx(we.div,{tabIndex:-1,...a,ref:v,onKeyDown:b})});pi.displayName=Lb;function Vb(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ar(n,{select:t}),document.activeElement!==r)return}function $b(e){const t=Nu(e),r=Eu(t,e),n=Eu(t.reverse(),e);return[r,n]}function Nu(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Eu(e,t){for(const r of e)if(!Bb(r,{upTo:t}))return r}function Bb(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Wb(e){return e instanceof HTMLInputElement&&"select"in e}function Ar(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Wb(e)&&t&&e.select()}}var Pu=jb();function jb(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Tu(e,t),e.unshift(t)},remove(t){var r;e=Tu(e,t),(r=e[0])==null||r.resume()}}}function Tu(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Ub(e){return e.filter(t=>t.tagName!=="A")}function Hb(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var zb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jn=new WeakMap,Lo=new WeakMap,Vo={},mi=0,Ou=function(e){return e&&(e.host||Ou(e.parentNode))},Yb=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ou(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},qb=function(e,t,r,n){var s=Yb(t,Array.isArray(e)?e:[e]);Vo[r]||(Vo[r]=new WeakMap);var o=Vo[r],a=[],i=new Set,c=new Set(s),d=function(h){!h||i.has(h)||(i.add(h),d(h.parentNode))};s.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(v){if(i.has(v))u(v);else try{var f=v.getAttribute(n),b=f!==null&&f!=="false",p=(jn.get(v)||0)+1,g=(o.get(v)||0)+1;jn.set(v,p),o.set(v,g),a.push(v),p===1&&b&&Lo.set(v,!0),g===1&&v.setAttribute(r,"true"),b||v.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return u(t),i.clear(),mi++,function(){a.forEach(function(h){var v=jn.get(h)-1,f=o.get(h)-1;jn.set(h,v),o.set(h,f),v||(Lo.has(h)||h.removeAttribute(n),Lo.delete(h)),f||h.removeAttribute(r)}),mi--,mi||(jn=new WeakMap,jn=new WeakMap,Lo=new WeakMap,Vo={})}},Mu=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=zb(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),qb(n,s,r,"aria-hidden")):function(){return null}},Zt=function(){return Zt=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Zt.apply(this,arguments)};function Au(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Zb(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var $o="right-scroll-bar-position",Bo="width-before-scroll-bar",Kb="with-scroll-bars-hidden",Qb="--removed-body-scroll-bar-size";function vi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Gb(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Xb=typeof window<"u"?m.useLayoutEffect:m.useEffect,Du=new WeakMap;function Jb(e,t){var r=Gb(null,function(n){return e.forEach(function(s){return vi(s,n)})});return Xb(function(){var n=Du.get(r);if(n){var s=new Set(n),o=new Set(e),a=r.current;s.forEach(function(i){o.has(i)||vi(i,null)}),o.forEach(function(i){s.has(i)||vi(i,a)})}Du.set(r,e)},[e]),r}function Rb(e){return e}function ew(e,t){t===void 0&&(t=Rb);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var a=t(o,n);return r.push(a),function(){r=r.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(n=!0;r.length;){var a=r;r=[],a.forEach(o)}r={push:function(i){return o(i)},filter:function(){return r}}},assignMedium:function(o){n=!0;var a=[];if(r.length){var i=r;r=[],i.forEach(o),a=r}var c=function(){var u=a;a=[],u.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),r}}}};return s}function tw(e){e===void 0&&(e={});var t=ew(null);return t.options=Zt({async:!0,ssr:!1},e),t}var Iu=function(e){var t=e.sideCar,r=Au(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return m.createElement(n,Zt({},r))};Iu.isSideCarExport=!0;function rw(e,t){return e.useMedium(t),Iu}var Fu=tw(),gi=function(){},Wo=m.forwardRef(function(e,t){var r=m.useRef(null),n=m.useState({onScrollCapture:gi,onWheelCapture:gi,onTouchMoveCapture:gi}),s=n[0],o=n[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,v=e.sideCar,f=e.noRelative,b=e.noIsolation,p=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,k=Au(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,O=Jb([r,t]),A=Zt(Zt({},k),s);return m.createElement(m.Fragment,null,u&&m.createElement(N,{sideCar:Fu,removeScrollBar:d,shards:h,noRelative:f,noIsolation:b,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:r,gapMode:w}),a?m.cloneElement(m.Children.only(i),Zt(Zt({},A),{ref:O})):m.createElement(y,Zt({},A,{className:c,ref:O}),i))});Wo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Wo.classNames={fullWidth:Bo,zeroRight:$o};var nw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nw();return t&&e.setAttribute("nonce",t),e}function ow(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function aw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var iw=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sw())&&(ow(t,r),aw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lw=function(){var e=iw();return function(t,r){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Lu=function(){var e=lw(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},cw={left:0,top:0,right:0,gap:0},yi=function(e){return parseInt(e||"",10)||0},dw=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[yi(r),yi(n),yi(s)]},uw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cw;var t=dw(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},fw=Lu(),Un="data-scroll-locked",hw=function(e,t,r,n){var s=e.left,o=e.top,a=e.right,i=e.gap;return r===void 0&&(r="margin"),`
103
+ .`.concat(Kb,` {
104
104
  overflow: hidden `).concat(n,`;
105
105
  padding-right: `).concat(i,"px ").concat(n,`;
106
106
  }
107
- body[`).concat(Wn,`] {
107
+ body[`).concat(Un,`] {
108
108
  overflow: hidden `).concat(n,`;
109
109
  overscroll-behavior: contain;
110
110
  `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
@@ -117,31 +117,31 @@
117
117
  `),r==="padding"&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),`
118
118
  }
119
119
 
120
- .`).concat(Lo,` {
120
+ .`).concat($o,` {
121
121
  right: `).concat(i,"px ").concat(n,`;
122
122
  }
123
123
 
124
- .`).concat(Vo,` {
124
+ .`).concat(Bo,` {
125
125
  margin-right: `).concat(i,"px ").concat(n,`;
126
126
  }
127
127
 
128
- .`).concat(Lo," .").concat(Lo,` {
128
+ .`).concat($o," .").concat($o,` {
129
129
  right: 0 `).concat(n,`;
130
130
  }
131
131
 
132
- .`).concat(Vo," .").concat(Vo,` {
132
+ .`).concat(Bo," .").concat(Bo,` {
133
133
  margin-right: 0 `).concat(n,`;
134
134
  }
135
135
 
136
- body[`).concat(Wn,`] {
137
- `).concat(Kb,": ").concat(i,`px;
136
+ body[`).concat(Un,`] {
137
+ `).concat(Qb,": ").concat(i,`px;
138
138
  }
139
- `)},Iu=function(){var e=parseInt(document.body.getAttribute(Wn)||"0",10);return isFinite(e)?e:0},hw=function(){m.useEffect(function(){return document.body.setAttribute(Wn,(Iu()+1).toString()),function(){var e=Iu()-1;e<=0?document.body.removeAttribute(Wn):document.body.setAttribute(Wn,e.toString())}},[])},pw=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;hw();var o=m.useMemo(function(){return dw(s)},[s]);return m.createElement(uw,{styles:fw(o,!t,s,r?"":"!important")})},bi=!1;if(typeof window<"u")try{var Bo=Object.defineProperty({},"passive",{get:function(){return bi=!0,!0}});window.addEventListener("test",Bo,Bo),window.removeEventListener("test",Bo,Bo)}catch{bi=!1}var jn=bi?{passive:!1}:!1,mw=function(e){return e.tagName==="TEXTAREA"},Fu=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!mw(e)&&r[t]==="visible")},vw=function(e){return Fu(e,"overflowY")},gw=function(e){return Fu(e,"overflowX")},Lu=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Vu(e,n);if(s){var o=$u(e,n),a=o[1],i=o[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},yw=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},bw=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Vu=function(e,t){return e==="v"?vw(t):gw(t)},$u=function(e,t){return e==="v"?yw(t):bw(t)},ww=function(e,t){return e==="h"&&t==="rtl"?-1:1},xw=function(e,t,r,n,s){var o=ww(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,c=t.contains(i),d=!1,u=a>0,h=0,v=0;do{if(!i)break;var f=$u(e,i),b=f[0],p=f[1],g=f[2],x=p-g-o*b;(b||x)&&Vu(e,i)&&(h+=x,v+=b);var y=i.parentNode;i=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(u&&(Math.abs(h)<1||!s)||!u&&(Math.abs(v)<1||!s))&&(d=!0),d},Wo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bu=function(e){return[e.deltaX,e.deltaY]},Wu=function(e){return e&&"current"in e?e.current:e},_w=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cw=function(e){return`
139
+ `)},Vu=function(){var e=parseInt(document.body.getAttribute(Un)||"0",10);return isFinite(e)?e:0},pw=function(){m.useEffect(function(){return document.body.setAttribute(Un,(Vu()+1).toString()),function(){var e=Vu()-1;e<=0?document.body.removeAttribute(Un):document.body.setAttribute(Un,e.toString())}},[])},mw=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;pw();var o=m.useMemo(function(){return uw(s)},[s]);return m.createElement(fw,{styles:hw(o,!t,s,r?"":"!important")})},bi=!1;if(typeof window<"u")try{var jo=Object.defineProperty({},"passive",{get:function(){return bi=!0,!0}});window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{bi=!1}var Hn=bi?{passive:!1}:!1,vw=function(e){return e.tagName==="TEXTAREA"},$u=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!vw(e)&&r[t]==="visible")},gw=function(e){return $u(e,"overflowY")},yw=function(e){return $u(e,"overflowX")},Bu=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Wu(e,n);if(s){var o=ju(e,n),a=o[1],i=o[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},bw=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},ww=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Wu=function(e,t){return e==="v"?gw(t):yw(t)},ju=function(e,t){return e==="v"?bw(t):ww(t)},xw=function(e,t){return e==="h"&&t==="rtl"?-1:1},_w=function(e,t,r,n,s){var o=xw(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,c=t.contains(i),d=!1,u=a>0,h=0,v=0;do{if(!i)break;var f=ju(e,i),b=f[0],p=f[1],g=f[2],x=p-g-o*b;(b||x)&&Wu(e,i)&&(h+=x,v+=b);var y=i.parentNode;i=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(u&&(Math.abs(h)<1||!s)||!u&&(Math.abs(v)<1||!s))&&(d=!0),d},Uo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Uu=function(e){return[e.deltaX,e.deltaY]},Hu=function(e){return e&&"current"in e?e.current:e},Cw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sw=function(e){return`
140
140
  .block-interactivity-`.concat(e,` {pointer-events: none;}
141
141
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
142
- `)},Sw=0,Un=[];function kw(e){var t=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),s=m.useState(Sw++)[0],o=m.useState(Du)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=qb([e.lockRef.current],(e.shards||[]).map(Wu),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=m.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var x=Wo(p),y=r.current,w="deltaX"in p?p.deltaX:y[0]-x[0],k="deltaY"in p?p.deltaY:y[1]-x[1],N,M=p.target,P=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in p&&P==="h"&&M.type==="range")return!1;var F=Lu(P,M);if(!F)return!0;if(F?N=P:(N=P==="v"?"h":"v",F=Lu(P,M)),!F)return!1;if(!n.current&&"changedTouches"in p&&(w||k)&&(n.current=N),!N)return!0;var $=n.current||N;return xw($,g,p,$==="h"?w:k,!0)},[]),c=m.useCallback(function(p){var g=p;if(!(!Un.length||Un[Un.length-1]!==o)){var x="deltaY"in g?Bu(g):Wo(g),y=t.current.filter(function(N){return N.name===g.type&&(N.target===g.target||g.target===N.shadowParent)&&_w(N.delta,x)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(Wu).filter(Boolean).filter(function(N){return N.contains(g.target)}),k=w.length>0?i(g,w[0]):!a.current.noIsolation;k&&g.cancelable&&g.preventDefault()}}},[]),d=m.useCallback(function(p,g,x,y){var w={name:p,delta:g,target:x,should:y,shadowParent:Nw(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(k){return k!==w})},1)},[]),u=m.useCallback(function(p){r.current=Wo(p),n.current=void 0},[]),h=m.useCallback(function(p){d(p.type,Bu(p),p.target,i(p,e.lockRef.current))},[]),v=m.useCallback(function(p){d(p.type,Wo(p),p.target,i(p,e.lockRef.current))},[]);m.useEffect(function(){return Un.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",c,jn),document.addEventListener("touchmove",c,jn),document.addEventListener("touchstart",u,jn),function(){Un=Un.filter(function(p){return p!==o}),document.removeEventListener("wheel",c,jn),document.removeEventListener("touchmove",c,jn),document.removeEventListener("touchstart",u,jn)}},[]);var f=e.removeScrollBar,b=e.inert;return m.createElement(m.Fragment,null,b?m.createElement(o,{styles:Cw(s)}):null,f?m.createElement(pw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ew=tw(Au,kw);var wi=m.forwardRef(function(e,t){return m.createElement($o,Zt({},e,{ref:t,sideCar:Ew}))});wi.classNames=$o.classNames;var Pw=[" ","Enter","ArrowUp","ArrowDown"],Tw=[" ","Enter"],an="Select",[jo,Uo,Ow]=ml(an),[Hn,EC]=Rr(an,[Ow,On]),Ho=On(),[Mw,Dr]=Hn(an),[Aw,Dw]=Hn(an),ju=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:a,defaultValue:i,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:v,required:f,form:b}=e,p=Ho(t),[g,x]=m.useState(null),[y,w]=m.useState(null),[k,N]=m.useState(!1),M=Ib(d),[P,F]=Js({prop:n,defaultProp:s??!1,onChange:o,caller:an}),[$,z]=Js({prop:a,defaultProp:i,onChange:c,caller:an}),X=m.useRef(null),A=g?b||!!g.closest("form"):!0,[j,I]=m.useState(new Set),J=Array.from(j).map(Y=>Y.props.value).join(";");return l.jsx(Yc,{...p,children:l.jsxs(Mw,{required:f,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:N,contentId:no(),value:$,onValueChange:z,open:P,onOpenChange:F,dir:M,triggerPointerDownPosRef:X,disabled:v,children:[l.jsx(jo.Provider,{scope:t,children:l.jsx(Aw,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(Y=>{I(D=>new Set(D).add(Y))},[]),onNativeOptionRemove:m.useCallback(Y=>{I(D=>{const O=new Set(D);return O.delete(Y),O})},[]),children:r})}),A?l.jsxs(ff,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:h,value:$,onChange:Y=>z(Y.target.value),disabled:v,form:b,children:[$===void 0?l.jsx("option",{value:""}):null,Array.from(j)]},J):null]})})};ju.displayName=an;var Uu="SelectTrigger",Hu=m.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Ho(r),a=Dr(Uu,r),i=a.disabled||n,c=Ie(t,a.onTriggerChange),d=Uo(r),u=m.useRef("touch"),[h,v,f]=pf(p=>{const g=d().filter(w=>!w.disabled),x=g.find(w=>w.value===a.value),y=mf(g,p,x);y!==void 0&&a.onValueChange(y.value)}),b=p=>{i||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(po,{asChild:!0,...o,children:l.jsx(we.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":hf(a.value)?"":void 0,...s,ref:c,onClick:ie(s.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&b(p)}),onPointerDown:ie(s.onPointerDown,p=>{u.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:ie(s.onKeyDown,p=>{const g=h.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&v(p.key),!(g&&p.key===" ")&&Pw.includes(p.key)&&(b(),p.preventDefault())})})})});Hu.displayName=Uu;var zu="SelectValue",Yu=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:a="",...i}=e,c=Dr(zu,r),{onValueNodeHasChildrenChange:d}=c,u=o!==void 0,h=Ie(t,c.onValueNodeChange);return Re(()=>{d(u)},[d,u]),l.jsx(we.span,{...i,ref:h,style:{pointerEvents:"none"},children:hf(c.value)?l.jsx(l.Fragment,{children:a}):o})});Yu.displayName=zu;var Iw="SelectIcon",qu=m.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return l.jsx(we.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});qu.displayName=Iw;var Fw="SelectPortal",Zu=e=>l.jsx(Gs,{asChild:!0,...e});Zu.displayName=Fw;var ln="SelectContent",Ku=m.forwardRef((e,t)=>{const r=Dr(ln,e.__scopeSelect),[n,s]=m.useState();if(Re(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?is.createPortal(l.jsx(Qu,{scope:e.__scopeSelect,children:l.jsx(jo.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(Gu,{...e,ref:t})});Ku.displayName=ln;var Dt=10,[Qu,Ir]=Hn(ln),Lw="SelectContentImpl",Vw=Cn("SelectContent.RemoveScroll"),Gu=m.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g,...x}=e,y=Dr(ln,r),[w,k]=m.useState(null),[N,M]=m.useState(null),P=Ie(t,q=>k(q)),[F,$]=m.useState(null),[z,X]=m.useState(null),A=Uo(r),[j,I]=m.useState(!1),J=m.useRef(!1);m.useEffect(()=>{if(w)return Pu(w)},[w]),wu();const Y=m.useCallback(q=>{const[ke,...Ae]=A().map(be=>be.ref.current),[ye]=Ae.slice(-1),me=document.activeElement;for(const be of q)if(be===me||(be==null||be.scrollIntoView({block:"nearest"}),be===ke&&N&&(N.scrollTop=0),be===ye&&N&&(N.scrollTop=N.scrollHeight),be==null||be.focus(),document.activeElement!==me))return},[A,N]),D=m.useCallback(()=>Y([F,w]),[Y,F,w]);m.useEffect(()=>{j&&D()},[j,D]);const{onOpenChange:O,triggerPointerDownPosRef:B}=y;m.useEffect(()=>{if(w){let q={x:0,y:0};const ke=ye=>{var me,be;q={x:Math.abs(Math.round(ye.pageX)-(((me=B.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(ye.pageY)-(((be=B.current)==null?void 0:be.y)??0))}},Ae=ye=>{q.x<=10&&q.y<=10?ye.preventDefault():w.contains(ye.target)||O(!1),document.removeEventListener("pointermove",ke),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",ke),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ke),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,O,B]),m.useEffect(()=>{const q=()=>O(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[O]);const[ae,Se]=pf(q=>{const ke=A().filter(me=>!me.disabled),Ae=ke.find(me=>me.ref.current===document.activeElement),ye=mf(ke,q,Ae);ye&&setTimeout(()=>ye.ref.current.focus())}),de=m.useCallback((q,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&($(q),ye&&(J.current=!0))},[y.value]),ue=m.useCallback(()=>w==null?void 0:w.focus(),[w]),pe=m.useCallback((q,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&X(q)},[y.value]),Fe=n==="popper"?xi:Xu,rt=Fe===xi?{side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(Qu,{scope:r,content:w,viewport:N,onViewportChange:M,itemRefCallback:de,selectedItem:F,onItemLeave:ue,itemTextRefCallback:pe,focusSelectedItem:D,selectedItemText:z,position:n,isPositioned:j,searchRef:ae,children:l.jsx(wi,{as:Vw,allowPinchZoom:!0,children:l.jsx(pi,{asChild:!0,trapped:y.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:ie(s,q=>{var ke;(ke=y.trigger)==null||ke.focus({preventScroll:!0}),q.preventDefault()}),children:l.jsx(cs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(Fe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:q=>q.preventDefault(),...x,...rt,onPlaced:()=>I(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ie(x.onKeyDown,q=>{const ke=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ke&&q.key.length===1&&Se(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let ye=A().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(q.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const me=q.target,be=ye.indexOf(me);ye=ye.slice(be+1)}setTimeout(()=>Y(ye)),q.preventDefault()}})})})})})})});Gu.displayName=Lw;var $w="SelectItemAlignedPosition",Xu=m.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Dr(ln,r),a=Ir(ln,r),[i,c]=m.useState(null),[d,u]=m.useState(null),h=Ie(t,P=>u(P)),v=Uo(r),f=m.useRef(!1),b=m.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=a,w=m.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&d&&p&&g&&x){const P=o.trigger.getBoundingClientRect(),F=d.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),z=x.getBoundingClientRect();if(o.dir!=="rtl"){const me=z.left-F.left,be=$.left-me,Je=P.left-be,lt=P.width+Je,Rt=Math.max(lt,F.width),er=window.innerWidth-Dt,mr=bu(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=lt+"px",i.style.left=mr+"px"}else{const me=F.right-z.right,be=window.innerWidth-$.right-me,Je=window.innerWidth-P.right-be,lt=P.width+Je,Rt=Math.max(lt,F.width),er=window.innerWidth-Dt,mr=bu(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=lt+"px",i.style.right=mr+"px"}const X=v(),A=window.innerHeight-Dt*2,j=p.scrollHeight,I=window.getComputedStyle(d),J=parseInt(I.borderTopWidth,10),Y=parseInt(I.paddingTop,10),D=parseInt(I.borderBottomWidth,10),O=parseInt(I.paddingBottom,10),B=J+Y+j+O+D,ae=Math.min(g.offsetHeight*5,B),Se=window.getComputedStyle(p),de=parseInt(Se.paddingTop,10),ue=parseInt(Se.paddingBottom,10),pe=P.top+P.height/2-Dt,Fe=A-pe,rt=g.offsetHeight/2,q=g.offsetTop+rt,ke=J+Y+q,Ae=B-ke;if(ke<=pe){const me=X.length>0&&g===X[X.length-1].ref.current;i.style.bottom="0px";const be=d.clientHeight-p.offsetTop-p.offsetHeight,Je=Math.max(Fe,rt+(me?ue:0)+be+D),lt=ke+Je;i.style.height=lt+"px"}else{const me=X.length>0&&g===X[0].ref.current;i.style.top="0px";const Je=Math.max(pe,J+p.offsetTop+(me?de:0)+rt)+Ae;i.style.height=Je+"px",p.scrollTop=ke-pe+p.offsetTop}i.style.margin=`${Dt}px 0`,i.style.minHeight=ae+"px",i.style.maxHeight=A+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[v,o.trigger,o.valueNode,i,d,p,g,x,o.dir,n]);Re(()=>w(),[w]);const[k,N]=m.useState();Re(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const M=m.useCallback(P=>{P&&b.current===!0&&(w(),y==null||y(),b.current=!1)},[w,y]);return l.jsx(Ww,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:f,onScrollButtonChange:M,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:l.jsx(we.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Xu.displayName=$w;var Bw="SelectPopperPosition",xi=m.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Dt,...o}=e,a=Ho(r);return l.jsx(Ma,{...a,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xi.displayName=Bw;var[Ww,_i]=Hn(ln,{}),Ci="SelectViewport",Ju=m.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Ir(Ci,r),a=_i(Ci,r),i=Ie(t,o.onViewportChange),c=m.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),l.jsx(jo.Slot,{scope:r,children:l.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ie(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=a;if(v!=null&&v.current&&h){const f=Math.abs(c.current-u.scrollTop);if(f>0){const b=window.innerHeight-Dt*2,p=parseFloat(h.style.minHeight),g=parseFloat(h.style.height),x=Math.max(p,g);if(x<b){const y=x+f,w=Math.min(b,y),k=y-w;h.style.height=w+"px",h.style.bottom==="0px"&&(u.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Ju.displayName=Ci;var Ru="SelectGroup",[jw,Uw]=Hn(Ru),Hw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=no();return l.jsx(jw,{scope:r,id:s,children:l.jsx(we.div,{role:"group","aria-labelledby":s,...n,ref:t})})});Hw.displayName=Ru;var ef="SelectLabel",tf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Uw(ef,r);return l.jsx(we.div,{id:s.id,...n,ref:t})});tf.displayName=ef;var zo="SelectItem",[zw,rf]=Hn(zo),nf=m.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,i=Dr(zo,r),c=Ir(zo,r),d=i.value===n,[u,h]=m.useState(o??""),[v,f]=m.useState(!1),b=Ie(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,n,s)}),p=no(),g=m.useRef("touch"),x=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(zw,{scope:r,value:n,disabled:s,textId:p,isSelected:d,onItemTextChange:m.useCallback(y=>{h(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:l.jsx(jo.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:l.jsx(we.div,{role:"option","aria-labelledby":p,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:b,onFocus:ie(a.onFocus,()=>f(!0)),onBlur:ie(a.onBlur,()=>f(!1)),onClick:ie(a.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:ie(a.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:ie(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:ie(a.onPointerMove,y=>{var w;g.current=y.pointerType,s?(w=c.onItemLeave)==null||w.call(c):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(a.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ie(a.onKeyDown,y=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&y.key===" "||(Tw.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});nf.displayName=zo;var Ds="SelectItemText",sf=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,a=Dr(Ds,r),i=Ir(Ds,r),c=rf(Ds,r),d=Dw(Ds,r),[u,h]=m.useState(null),v=Ie(t,x=>h(x),c.onItemTextChange,x=>{var y;return(y=i.itemTextRefCallback)==null?void 0:y.call(i,x,c.value,c.disabled)}),f=u==null?void 0:u.textContent,b=m.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=d;return Re(()=>(p(b),()=>g(b)),[p,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(we.span,{id:c.textId,...o,ref:v}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?is.createPortal(o.children,a.valueNode):null]})});sf.displayName=Ds;var of="SelectItemIndicator",af=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return rf(of,r).isSelected?l.jsx(we.span,{"aria-hidden":!0,...n,ref:t}):null});af.displayName=of;var Si="SelectScrollUpButton",lf=m.forwardRef((e,t)=>{const r=Ir(Si,e.__scopeSelect),n=_i(Si,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return Re(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollTop>0;o(d)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(df,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});lf.displayName=Si;var ki="SelectScrollDownButton",cf=m.forwardRef((e,t)=>{const r=Ir(ki,e.__scopeSelect),n=_i(ki,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return Re(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;o(u)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(df,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});cf.displayName=ki;var df=m.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Ir("SelectScrollButton",r),a=m.useRef(null),i=Uo(r),c=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Re(()=>{var u;const d=i().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[i]),l.jsx(we.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ie(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:ie(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:ie(s.onPointerLeave,()=>{c()})})}),Yw="SelectSeparator",uf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return l.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});uf.displayName=Yw;var Ni="SelectArrow",qw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Ho(r),o=Dr(Ni,r),a=Ir(Ni,r);return o.open&&a.position==="popper"?l.jsx(Aa,{...s,...n,ref:t}):null});qw.displayName=Ni;var Zw="SelectBubbleInput",ff=m.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=m.useRef(null),o=Ie(n,s),a=Ub(t);return m.useEffect(()=>{const i=s.current;if(!i)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const h=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(h)}},[a,t]),l.jsx(we.select,{...r,style:{..._l,...r.style},ref:o,defaultValue:t})});ff.displayName=Zw;function hf(e){return e===""||e===void 0}function pf(e){const t=Et(e),r=m.useRef(""),n=m.useRef(0),s=m.useCallback(a=>{const i=r.current+a;t(i),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(i)},[t]),o=m.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function mf(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Kw(e,Math.max(o,0));s.length===1&&(a=a.filter(d=>d!==r));const c=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function Kw(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Qw=ju,vf=Hu,Gw=Yu,Xw=qu,Jw=Zu,gf=Ku,Rw=Ju,yf=tf,bf=nf,e0=sf,t0=af,wf=lf,xf=cf,_f=uf;const cn=Qw,dn=Gw,Fr=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(vf,{ref:n,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,l.jsx(Xw,{asChild:!0,children:l.jsx(Gl,{className:"h-4 w-4 opacity-50"})})]}));Fr.displayName=vf.displayName;const Cf=m.forwardRef(({className:e,...t},r)=>l.jsx(wf,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Lp,{className:"h-4 w-4"})}));Cf.displayName=wf.displayName;const Sf=m.forwardRef(({className:e,...t},r)=>l.jsx(xf,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Gl,{className:"h-4 w-4"})}));Sf.displayName=xf.displayName;const Lr=m.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>l.jsx(Jw,{children:l.jsxs(gf,{ref:s,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[l.jsx(Cf,{}),l.jsx(Rw,{className:he("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Sf,{})]})}));Lr.displayName=gf.displayName;const r0=m.forwardRef(({className:e,...t},r)=>l.jsx(yf,{ref:r,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));r0.displayName=yf.displayName;const re=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(bf,{ref:n,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(t0,{children:l.jsx(Dp,{className:"h-4 w-4"})})}),l.jsx(e0,{children:t})]}));re.displayName=bf.displayName;const n0=m.forwardRef(({className:e,...t},r)=>l.jsx(_f,{ref:r,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));n0.displayName=_f.displayName;const s0=Ms({industry:et().min(1,"Industry is required"),business_model:et().min(1,"Business model is required"),annual_sales_volume:et().min(1,"Annual sales volume is required"),website_url:et().url("Please enter a valid URL").optional().or(Tb(""))}),o0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Cs({resolver:Ss(s0),defaultValues:{industry:e.industry,business_model:e.business_model,annual_sales_volume:e.annual_sales_volume,website_url:e.website_url}}),a=i=>{t(i),r()};return l.jsxs(dt,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Activity",subTitle:"Tell us about your business operations",onBack:n})}),l.jsxs(ut,{children:[l.jsx(As,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(Ze,{control:o.control,name:"industry",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Industry"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select industry"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"technology",children:"Technology"}),l.jsx(re,{value:"finance",children:"Finance"}),l.jsx(re,{value:"healthcare",children:"Healthcare"}),l.jsx(re,{value:"retail",children:"Retail"}),l.jsx(re,{value:"manufacturing",children:"Manufacturing"}),l.jsx(re,{value:"education",children:"Education"}),l.jsx(re,{value:"hospitality",children:"Hospitality"}),l.jsx(re,{value:"real-estate",children:"Real Estate"}),l.jsx(re,{value:"consulting",children:"Consulting"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"business_model",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Business Model"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select business model"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"b2b",children:"B2B (Business to Business)"}),l.jsx(re,{value:"b2c",children:"B2C (Business to Consumer)"}),l.jsx(re,{value:"b2b2c",children:"B2B2C (Business to Business to Consumer)"}),l.jsx(re,{value:"marketplace",children:"Marketplace"}),l.jsx(re,{value:"saas",children:"SaaS (Software as a Service)"}),l.jsx(re,{value:"subscription",children:"Subscription"}),l.jsx(re,{value:"freemium",children:"Freemium"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"annual_sales_volume",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Annual Sales Volume (USD)"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select annual sales volume"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"0-50k",children:"$0 - $50,000"}),l.jsx(re,{value:"50k-100k",children:"$50,000 - $100,000"}),l.jsx(re,{value:"100k-500k",children:"$100,000 - $500,000"}),l.jsx(re,{value:"500k-1m",children:"$500,000 - $1,000,000"}),l.jsx(re,{value:"1m-5m",children:"$1,000,000 - $5,000,000"}),l.jsx(re,{value:"5m-10m",children:"$5,000,000 - $10,000,000"}),l.jsx(re,{value:"10m+",children:"$10,000,000+"})]})]}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"website_url",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Website URL (Optional)"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"https://www.yourcompany.com",...i})}),l.jsx(ze,{})]})}),l.jsx(Ye,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},a0=Ms({street:et().min(1,"Street is required"),number:et().min(1,"Number is required"),postal_code:et().min(1,"Postal code is required"),city:et().min(1,"City is required"),address_country:et().min(1,"Country is required")}),i0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Cs({resolver:Ss(a0),defaultValues:{street:e.street,number:e.number,postal_code:e.postal_code,city:e.city,address_country:e.address_country}}),a=i=>{t(i),r()};return l.jsxs(dt,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Address",subTitle:"Please provide your business address",onBack:n})}),l.jsxs(ut,{children:[l.jsx(As,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(Ze,{control:o.control,name:"street",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Street"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter street name",...i})}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"number",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Number"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter street number",...i})}),l.jsx(ze,{})]})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(Ze,{control:o.control,name:"postal_code",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Postal Code"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter postal code",...i})}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"city",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"City"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter city",...i})}),l.jsx(ze,{})]})})]}),l.jsx(Ze,{control:o.control,name:"address_country",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(ze,{})]})}),l.jsx(Ye,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function _e(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ct(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ot(e,t){const r=_e(e);return isNaN(t)?Ct(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function It(e,t){const r=_e(e);if(isNaN(t))return Ct(e,NaN);if(!t)return r;const n=r.getDate(),s=Ct(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return n>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const Ei=6048e5,l0=864e5;let c0={};function Is(){return c0}function Kt(e,t){var i,c,d,u;const r=Is(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?7:0)+o-n;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function un(e){return Kt(e,{weekStartsOn:1})}function kf(e){const t=_e(e),r=t.getFullYear(),n=Ct(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=un(n),o=Ct(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=un(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function zn(e){const t=_e(e);return t.setHours(0,0,0,0),t}function Yo(e){const t=_e(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Qt(e,t){const r=zn(e),n=zn(t),s=+r-Yo(r),o=+n-Yo(n);return Math.round((s-o)/l0)}function d0(e){const t=kf(e),r=Ct(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),un(r)}function Pi(e,t){const r=t*7;return ot(e,r)}function u0(e,t){return It(e,t*12)}function f0(e){let t;return e.forEach(function(r){const n=_e(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function h0(e){let t;return e.forEach(r=>{const n=_e(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function ht(e,t){const r=zn(e),n=zn(t);return+r==+n}function Ti(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function p0(e){if(!Ti(e)&&typeof e!="number")return!1;const t=_e(e);return!isNaN(Number(t))}function Fs(e,t){const r=_e(e),n=_e(t),s=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return s*12+o}function m0(e,t,r){const n=Kt(e,r),s=Kt(t,r),o=+n-Yo(n),a=+s-Yo(s);return Math.round((o-a)/Ei)}function Oi(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function pt(e){const t=_e(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Nf(e){const t=_e(e),r=Ct(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Mi(e,t){var i,c,d,u;const r=Is(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?-7:0)+6-(o-n);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Ef(e){return Mi(e,{weekStartsOn:1})}const v0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},g0=(e,t,r)=>{let n;const s=v0[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Ai(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const y0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},b0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},w0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},x0={date:Ai({formats:y0,defaultWidth:"full"}),time:Ai({formats:b0,defaultWidth:"full"}),dateTime:Ai({formats:w0,defaultWidth:"full"})},_0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},C0=(e,t,r,n)=>_0[e];function Ls(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=r!=null&&r.width?String(r.width):a;s=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const S0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},k0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},N0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},E0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},P0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},T0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},O0={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Ls({values:S0,defaultWidth:"wide"}),quarter:Ls({values:k0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ls({values:N0,defaultWidth:"wide"}),day:Ls({values:E0,defaultWidth:"wide"}),dayPeriod:Ls({values:P0,defaultWidth:"wide",formattingValues:T0,defaultFormattingWidth:"wide"})};function Vs(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?A0(i,h=>h.test(a)):M0(i,h=>h.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(a.length);return{value:d,rest:u}}}function M0(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function A0(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function D0(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;const i=t.slice(s.length);return{value:a,rest:i}}}const I0=/^(\d+)(th|st|nd|rd)?/i,F0=/\d+/i,L0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},V0={any:[/^b/i,/^(a|c)/i]},$0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},B0={any:[/1/i,/2/i,/3/i,/4/i]},W0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},j0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},U0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},H0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},z0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Y0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},q0={ordinalNumber:D0({matchPattern:I0,parsePattern:F0,valueCallback:e=>parseInt(e,10)}),era:Vs({matchPatterns:L0,defaultMatchWidth:"wide",parsePatterns:V0,defaultParseWidth:"any"}),quarter:Vs({matchPatterns:$0,defaultMatchWidth:"wide",parsePatterns:B0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Vs({matchPatterns:W0,defaultMatchWidth:"wide",parsePatterns:j0,defaultParseWidth:"any"}),day:Vs({matchPatterns:U0,defaultMatchWidth:"wide",parsePatterns:H0,defaultParseWidth:"any"}),dayPeriod:Vs({matchPatterns:z0,defaultMatchWidth:"any",parsePatterns:Y0,defaultParseWidth:"any"})},Pf={code:"en-US",formatDistance:g0,formatLong:x0,formatRelative:C0,localize:O0,match:q0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Z0(e){const t=_e(e);return Qt(t,Nf(t))+1}function Tf(e){const t=_e(e),r=+un(t)-+d0(t);return Math.round(r/Ei)+1}function Of(e,t){var u,h,v,f;const r=_e(e),n=r.getFullYear(),s=Is(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((f=(v=s.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=Ct(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const i=Kt(a,t),c=Ct(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=Kt(c,t);return r.getTime()>=i.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function K0(e,t){var i,c,d,u;const r=Is(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Of(e,t),o=Ct(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),Kt(o,t)}function Mf(e,t){const r=_e(e),n=+Kt(r,t)-+K0(r,t);return Math.round(n/Ei)+1}function Pe(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Vr={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Pe(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Pe(r+1,2)},d(e,t){return Pe(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Pe(e.getHours()%12||12,t.length)},H(e,t){return Pe(e.getHours(),t.length)},m(e,t){return Pe(e.getMinutes(),t.length)},s(e,t){return Pe(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Pe(s,t.length)}},Yn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Af={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Vr.y(e,t)},Y:function(e,t,r,n){const s=Of(e,n),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return Pe(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):Pe(o,t.length)},R:function(e,t){const r=kf(e);return Pe(r,t.length)},u:function(e,t){const r=e.getFullYear();return Pe(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Pe(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Pe(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Vr.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Pe(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=Mf(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Pe(s,t.length)},I:function(e,t,r){const n=Tf(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Pe(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Vr.d(e,t)},D:function(e,t,r){const n=Z0(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Pe(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Pe(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Pe(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Pe(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=Yn.noon:n===0?s=Yn.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=Yn.evening:n>=12?s=Yn.afternoon:n>=4?s=Yn.morning:s=Yn.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Vr.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Vr.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vr.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Vr.s(e,t)},S:function(e,t){return Vr.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return If(n);case"XXXX":case"XX":return fn(n);case"XXXXX":case"XXX":default:return fn(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return If(n);case"xxxx":case"xx":return fn(n);case"xxxxx":case"xxx":default:return fn(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Df(n,":");case"OOOO":default:return"GMT"+fn(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Df(n,":");case"zzzz":default:return"GMT"+fn(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Pe(n,t.length)},T:function(e,t,r){const n=e.getTime();return Pe(n,t.length)}};function Df(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),o=n%60;return o===0?r+String(s):r+String(s)+t+Pe(o,2)}function If(e,t){return e%60===0?(e>0?"-":"+")+Pe(Math.abs(e)/60,2):fn(e,t)}function fn(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Pe(Math.trunc(n/60),2),o=Pe(n%60,2);return r+s+t+o}const Ff=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Lf=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Q0={p:Lf,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return Ff(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ff(n,t)).replace("{{time}}",Lf(s,t))}},G0=/^D+$/,X0=/^Y+$/,J0=["D","DD","YY","YYYY"];function R0(e){return G0.test(e)}function ex(e){return X0.test(e)}function tx(e,t,r){const n=rx(e,t,r);if(console.warn(n),J0.includes(e))throw new RangeError(n)}function rx(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,ax=/''/g,ix=/[a-zA-Z]/;function cr(e,t,r){var u,h,v,f,b,p,g,x;const n=Is(),s=(r==null?void 0:r.locale)??n.locale??Pf,o=(r==null?void 0:r.firstWeekContainsDate)??((h=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(v=n.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=(r==null?void 0:r.weekStartsOn)??((p=(b=r==null?void 0:r.locale)==null?void 0:b.options)==null?void 0:p.weekStartsOn)??n.weekStartsOn??((x=(g=n.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,i=_e(e);if(!p0(i))throw new RangeError("Invalid time value");let c=t.match(sx).map(y=>{const w=y[0];if(w==="p"||w==="P"){const k=Q0[w];return k(y,s.formatLong)}return y}).join("").match(nx).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:lx(y)};if(Af[w])return{isToken:!0,value:y};if(w.match(ix))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(i,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&ex(w)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&R0(w))&&tx(w,t,String(e));const k=Af[w[0]];return k(i,w,s.localize,d)}).join("")}function lx(e){const t=e.match(ox);return t?t[1].replace(ax,"'"):e}function cx(e){const t=_e(e),r=t.getFullYear(),n=t.getMonth(),s=Ct(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function dx(e){return Math.trunc(+_e(e)/1e3)}function ux(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function fx(e,t){return m0(ux(e),pt(e),t)+1}function Di(e,t){const r=_e(e),n=_e(t);return r.getTime()>n.getTime()}function Vf(e,t){const r=_e(e),n=_e(t);return+r<+n}function Ii(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function hx(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()}function Fi(e,t){return ot(e,-t)}function Li(e,t){const r=_e(e),n=r.getFullYear(),s=r.getDate(),o=Ct(e,0);o.setFullYear(n,t,15),o.setHours(0,0,0,0);const a=cx(o);return r.setMonth(t,Math.min(s,a)),r}function $f(e,t){const r=_e(e);return isNaN(+r)?Ct(e,NaN):(r.setFullYear(t),r)}var qo="Popover",[Bf,OC]=Rr(qo,[On]),$s=On(),[px,$r]=Bf(qo),Wf=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=$s(t),c=m.useRef(null),[d,u]=m.useState(!1),[h,v]=Js({prop:n,defaultProp:s??!1,onChange:o,caller:qo});return l.jsx(Yc,{...i,children:l.jsx(px,{scope:t,contentId:no(),triggerRef:c,open:h,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(f=>!f),[v]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:a,children:r})})};Wf.displayName=qo;var jf="PopoverAnchor",mx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(jf,r),o=$s(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return m.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(po,{...o,...n,ref:t})});mx.displayName=jf;var Uf="PopoverTrigger",Hf=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Uf,r),o=$s(r),a=Ie(t,s.triggerRef),i=l.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Kf(s.open),...n,ref:a,onClick:ie(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:l.jsx(po,{asChild:!0,...o,children:i})});Hf.displayName=Uf;var Vi="PopoverPortal",[vx,gx]=Bf(Vi,{forceMount:void 0}),zf=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=$r(Vi,t);return l.jsx(vx,{scope:t,forceMount:r,children:l.jsx(ds,{present:r||o.open,children:l.jsx(Gs,{asChild:!0,container:s,children:n})})})};zf.displayName=Vi;var qn="PopoverContent",Yf=m.forwardRef((e,t)=>{const r=gx(qn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=$r(qn,e.__scopePopover);return l.jsx(ds,{present:n||o.open,children:o.modal?l.jsx(bx,{...s,ref:t}):l.jsx(wx,{...s,ref:t})})});Yf.displayName=qn;var yx=Cn("PopoverContent.RemoveScroll"),bx=m.forwardRef((e,t)=>{const r=$r(qn,e.__scopePopover),n=m.useRef(null),s=Ie(t,n),o=m.useRef(!1);return m.useEffect(()=>{const a=n.current;if(a)return Pu(a)},[]),l.jsx(wi,{as:yx,allowPinchZoom:!0,children:l.jsx(qf,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),o.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ie(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),wx=m.forwardRef((e,t)=>{const r=$r(qn,e.__scopePopover),n=m.useRef(!1),s=m.useRef(!1);return l.jsx(qf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),qf=m.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...h}=e,v=$r(qn,r),f=$s(r);return wu(),l.jsx(pi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(cs,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(Ma,{"data-state":Kf(v.open),role:"dialog",id:v.contentId,...f,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Zf="PopoverClose",xx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Zf,r);return l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,()=>s.onOpenChange(!1))})});xx.displayName=Zf;var _x="PopoverArrow",Cx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$s(r);return l.jsx(Aa,{...s,...n,ref:t})});Cx.displayName=_x;function Kf(e){return e?"open":"closed"}var Sx=Wf,kx=Hf,Nx=zf,Qf=Yf;const Gf=Sx,Xf=kx,$i=m.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>l.jsx(Nx,{children:l.jsx(Qf,{ref:s,align:t,sideOffset:r,className:he("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));$i.displayName=Qf.displayName;var te=function(){return te=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},te.apply(this,arguments)};function Ex(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Jf(e,t,r){for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Bs(e){return e.mode==="multiple"}function Ws(e){return e.mode==="range"}function Zo(e){return e.mode==="single"}var Px={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Tx(e,t){return cr(e,"LLLL y",t)}function Ox(e,t){return cr(e,"d",t)}function Mx(e,t){return cr(e,"LLLL",t)}function Ax(e){return"".concat(e)}function Dx(e,t){return cr(e,"cccccc",t)}function Ix(e,t){return cr(e,"yyyy",t)}var Fx=Object.freeze({__proto__:null,formatCaption:Tx,formatDay:Ox,formatMonthCaption:Mx,formatWeekNumber:Ax,formatWeekdayName:Dx,formatYearCaption:Ix}),Lx=function(e,t,r){return cr(e,"do MMMM (EEEE)",r)},Vx=function(){return"Month: "},$x=function(){return"Go to next month"},Bx=function(){return"Go to previous month"},Wx=function(e,t){return cr(e,"cccc",t)},jx=function(e){return"Week n. ".concat(e)},Ux=function(){return"Year: "},Hx=Object.freeze({__proto__:null,labelDay:Lx,labelMonthDropdown:Vx,labelNext:$x,labelPrevious:Bx,labelWeekNumber:jx,labelWeekday:Wx,labelYearDropdown:Ux});function zx(){var e="buttons",t=Px,r=Pf,n={},s={},o=1,a={},i=new Date;return{captionLayout:e,classNames:t,formatters:Fx,labels:Hx,locale:r,modifiersClassNames:n,modifiers:s,numberOfMonths:o,styles:a,today:i,mode:"default"}}function Yx(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,s=e.toMonth,o=e.fromDate,a=e.toDate;return n?o=pt(n):t&&(o=new Date(t,0,1)),s?a=Oi(s):r&&(a=new Date(r,11,31)),{fromDate:o?zn(o):void 0,toDate:a?zn(a):void 0}}var Rf=S.createContext(void 0);function qx(e){var t,r=e.initialProps,n=zx(),s=Yx(r),o=s.fromDate,a=s.toDate,i=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;i!=="buttons"&&(!o||!a)&&(i="buttons");var c;(Zo(r)||Bs(r)||Ws(r))&&(c=r.onSelect);var d=te(te(te({},n),r),{captionLayout:i,classNames:te(te({},n.classNames),r.classNames),components:te({},r.components),formatters:te(te({},n.formatters),r.formatters),fromDate:o,labels:te(te({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:te(te({},n.modifiers),r.modifiers),modifiersClassNames:te(te({},n.modifiersClassNames),r.modifiersClassNames),onSelect:c,styles:te(te({},n.styles),r.styles),toDate:a});return l.jsx(Rf.Provider,{value:d,children:e.children})}function Me(){var e=S.useContext(Rf);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function eh(e){var t=Me(),r=t.locale,n=t.classNames,s=t.styles,o=t.formatters.formatCaption;return l.jsx("div",{className:n.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:r})})}function Zx(e){return l.jsx("svg",te({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:l.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function th(e){var t,r,n=e.onChange,s=e.value,o=e.children,a=e.caption,i=e.className,c=e.style,d=Me(),u=(r=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:Zx;return l.jsxs("div",{className:i,style:c,children:[l.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),l.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:s,onChange:n,children:o}),l.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[a,l.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function Kx(e){var t,r=Me(),n=r.fromDate,s=r.toDate,o=r.styles,a=r.locale,i=r.formatters.formatMonthCaption,c=r.classNames,d=r.components,u=r.labels.labelMonthDropdown;if(!n)return l.jsx(l.Fragment,{});if(!s)return l.jsx(l.Fragment,{});var h=[];if(hx(n,s))for(var v=pt(n),f=n.getMonth();f<=s.getMonth();f++)h.push(Li(v,f));else for(var v=pt(new Date),f=0;f<=11;f++)h.push(Li(v,f));var b=function(g){var x=Number(g.target.value),y=Li(pt(e.displayMonth),x);e.onChange(y)},p=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:th;return l.jsx(p,{name:"months","aria-label":u(),className:c.dropdown_month,style:o.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:i(e.displayMonth,{locale:a}),children:h.map(function(g){return l.jsx("option",{value:g.getMonth(),children:i(g,{locale:a})},g.getMonth())})})}function Qx(e){var t,r=e.displayMonth,n=Me(),s=n.fromDate,o=n.toDate,a=n.locale,i=n.styles,c=n.classNames,d=n.components,u=n.formatters.formatYearCaption,h=n.labels.labelYearDropdown,v=[];if(!s)return l.jsx(l.Fragment,{});if(!o)return l.jsx(l.Fragment,{});for(var f=s.getFullYear(),b=o.getFullYear(),p=f;p<=b;p++)v.push($f(Nf(new Date),p));var g=function(y){var w=$f(pt(r),Number(y.target.value));e.onChange(w)},x=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:th;return l.jsx(x,{name:"years","aria-label":h(),className:c.dropdown_year,style:i.dropdown_year,onChange:g,value:r.getFullYear(),caption:u(r,{locale:a}),children:v.map(function(y){return l.jsx("option",{value:y.getFullYear(),children:u(y,{locale:a})},y.getFullYear())})})}function Gx(e,t){var r=S.useState(e),n=r[0],s=r[1],o=t===void 0?n:t;return[o,s]}function Xx(e){var t=e.month,r=e.defaultMonth,n=e.today,s=t||r||n||new Date,o=e.toDate,a=e.fromDate,i=e.numberOfMonths,c=i===void 0?1:i;if(o&&Fs(o,s)<0){var d=-1*(c-1);s=It(o,d)}return a&&Fs(s,a)<0&&(s=a),pt(s)}function Jx(){var e=Me(),t=Xx(e),r=Gx(t,e.month),n=r[0],s=r[1],o=function(a){var i;if(!e.disableNavigation){var c=pt(a);s(c),(i=e.onMonthChange)===null||i===void 0||i.call(e,c)}};return[n,o]}function Rx(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,s=pt(e),o=pt(It(s,n)),a=Fs(o,s),i=[],c=0;c<a;c++){var d=It(s,c);i.push(d)}return r&&(i=i.reverse()),i}function e_(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=pt(e);if(!r)return It(i,a);var c=Fs(r,e);if(!(c<o))return It(i,a)}}function t_(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=pt(e);if(!r)return It(i,-a);var c=Fs(i,r);if(!(c<=0))return It(i,-a)}}var rh=S.createContext(void 0);function r_(e){var t=Me(),r=Jx(),n=r[0],s=r[1],o=Rx(n,t),a=e_(n,t),i=t_(n,t),c=function(h){return o.some(function(v){return Ii(h,v)})},d=function(h,v){c(h)||(v&&Vf(h,v)?s(It(h,1+t.numberOfMonths*-1)):s(h))},u={currentMonth:n,displayMonths:o,goToMonth:s,goToDate:d,previousMonth:i,nextMonth:a,isDateDisplayed:c};return l.jsx(rh.Provider,{value:u,children:e.children})}function js(){var e=S.useContext(rh);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function nh(e){var t,r=Me(),n=r.classNames,s=r.styles,o=r.components,a=js().goToMonth,i=function(u){a(It(u,e.displayIndex?-e.displayIndex:0))},c=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:eh,d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth});return l.jsxs("div",{className:n.caption_dropdowns,style:s.caption_dropdowns,children:[l.jsx("div",{className:n.vhidden,children:d}),l.jsx(Kx,{onChange:i,displayMonth:e.displayMonth}),l.jsx(Qx,{onChange:i,displayMonth:e.displayMonth})]})}function n_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function s_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Ko=S.forwardRef(function(e,t){var r=Me(),n=r.classNames,s=r.styles,o=[n.button_reset,n.button];e.className&&o.push(e.className);var a=o.join(" "),i=te(te({},s.button_reset),s.button);return e.style&&Object.assign(i,e.style),l.jsx("button",te({},e,{ref:t,type:"button",className:a,style:i}))});function o_(e){var t,r,n=Me(),s=n.dir,o=n.locale,a=n.classNames,i=n.styles,c=n.labels,d=c.labelPrevious,u=c.labelNext,h=n.components;if(!e.nextMonth&&!e.previousMonth)return l.jsx(l.Fragment,{});var v=d(e.previousMonth,{locale:o}),f=[a.nav_button,a.nav_button_previous].join(" "),b=u(e.nextMonth,{locale:o}),p=[a.nav_button,a.nav_button_next].join(" "),g=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:s_,x=(r=h==null?void 0:h.IconLeft)!==null&&r!==void 0?r:n_;return l.jsxs("div",{className:a.nav,style:i.nav,children:[!e.hidePrevious&&l.jsx(Ko,{name:"previous-month","aria-label":v,className:f,style:i.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?l.jsx(g,{className:a.nav_icon,style:i.nav_icon}):l.jsx(x,{className:a.nav_icon,style:i.nav_icon})}),!e.hideNext&&l.jsx(Ko,{name:"next-month","aria-label":b,className:p,style:i.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?l.jsx(x,{className:a.nav_icon,style:i.nav_icon}):l.jsx(g,{className:a.nav_icon,style:i.nav_icon})})]})}function sh(e){var t=Me().numberOfMonths,r=js(),n=r.previousMonth,s=r.nextMonth,o=r.goToMonth,a=r.displayMonths,i=a.findIndex(function(b){return Ii(e.displayMonth,b)}),c=i===0,d=i===a.length-1,u=t>1&&(c||!d),h=t>1&&(d||!c),v=function(){n&&o(n)},f=function(){s&&o(s)};return l.jsx(o_,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:h,nextMonth:s,previousMonth:n,onPreviousClick:v,onNextClick:f})}function a_(e){var t,r=Me(),n=r.classNames,s=r.disableNavigation,o=r.styles,a=r.captionLayout,i=r.components,c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:eh,d;return s?d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?d=l.jsx(nh,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?d=l.jsxs(l.Fragment,{children:[l.jsx(nh,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),l.jsx(sh,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=l.jsxs(l.Fragment,{children:[l.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(sh,{displayMonth:e.displayMonth,id:e.id})]}),l.jsx("div",{className:n.caption,style:o.caption,children:d})}function i_(e){var t=Me(),r=t.footer,n=t.styles,s=t.classNames.tfoot;return r?l.jsx("tfoot",{className:s,style:n.tfoot,children:l.jsx("tr",{children:l.jsx("td",{colSpan:8,children:r})})}):l.jsx(l.Fragment,{})}function l_(e,t,r){for(var n=r?un(new Date):Kt(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=ot(n,o);s.push(a)}return s}function c_(){var e=Me(),t=e.classNames,r=e.styles,n=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,i=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=l_(s,o,a);return l.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&l.jsx("td",{style:r.head_cell,className:t.head_cell}),d.map(function(u,h){return l.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(u,{locale:s}),children:i(u,{locale:s})},h)})]})}function d_(){var e,t=Me(),r=t.classNames,n=t.styles,s=t.components,o=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:c_;return l.jsx("thead",{style:n.head,className:r.head,children:l.jsx(o,{})})}function u_(e){var t=Me(),r=t.locale,n=t.formatters.formatDay;return l.jsx(l.Fragment,{children:n(e.date,{locale:r})})}var Bi=S.createContext(void 0);function f_(e){if(!Bs(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return l.jsx(Bi.Provider,{value:t,children:e.children})}return l.jsx(h_,{initialProps:e.initialProps,children:e.children})}function h_(e){var t=e.initialProps,r=e.children,n=t.selected,s=t.min,o=t.max,a=function(d,u,h){var v,f;(v=t.onDayClick)===null||v===void 0||v.call(t,d,u,h);var b=!!(u.selected&&s&&(n==null?void 0:n.length)===s);if(!b){var p=!!(!u.selected&&o&&(n==null?void 0:n.length)===o);if(!p){var g=n?Jf([],n):[];if(u.selected){var x=g.findIndex(function(y){return ht(d,y)});g.splice(x,1)}else g.push(d);(f=t.onSelect)===null||f===void 0||f.call(t,g,d,u,h)}}},i={disabled:[]};n&&i.disabled.push(function(d){var u=o&&n.length>o-1,h=n.some(function(v){return ht(v,d)});return!!(u&&!h)});var c={selected:n,onDayClick:a,modifiers:i};return l.jsx(Bi.Provider,{value:c,children:r})}function Wi(){var e=S.useContext(Bi);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function p_(e,t){var r=t||{},n=r.from,s=r.to;return n&&s?ht(s,e)&&ht(n,e)?void 0:ht(s,e)?{from:s,to:void 0}:ht(n,e)?void 0:Di(n,e)?{from:e,to:s}:{from:n,to:e}:s?Di(e,s)?{from:s,to:e}:{from:e,to:s}:n?Vf(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var ji=S.createContext(void 0);function m_(e){if(!Ws(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return l.jsx(ji.Provider,{value:t,children:e.children})}return l.jsx(v_,{initialProps:e.initialProps,children:e.children})}function v_(e){var t=e.initialProps,r=e.children,n=t.selected,s=n||{},o=s.from,a=s.to,i=t.min,c=t.max,d=function(f,b,p){var g,x;(g=t.onDayClick)===null||g===void 0||g.call(t,f,b,p);var y=p_(f,n);(x=t.onSelect)===null||x===void 0||x.call(t,y,f,b,p)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],a?(u.range_end=[a],ht(o,a)||(u.range_middle=[{after:o,before:a}])):u.range_end=[o]):a&&(u.range_start=[a],u.range_end=[a]),i&&(o&&!a&&u.disabled.push({after:Fi(o,i-1),before:ot(o,i-1)}),o&&a&&u.disabled.push({after:o,before:ot(o,i-1)}),!o&&a&&u.disabled.push({after:Fi(a,i-1),before:ot(a,i-1)})),c){if(o&&!a&&(u.disabled.push({before:ot(o,-c+1)}),u.disabled.push({after:ot(o,c-1)})),o&&a){var h=Qt(a,o)+1,v=c-h;u.disabled.push({before:Fi(o,v)}),u.disabled.push({after:ot(a,v)})}!o&&a&&(u.disabled.push({before:ot(a,-c+1)}),u.disabled.push({after:ot(a,c-1)}))}return l.jsx(ji.Provider,{value:{selected:n,onDayClick:d,modifiers:u},children:r})}function Ui(){var e=S.useContext(ji);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Qo(e){return Array.isArray(e)?Jf([],e):e!==void 0?[e]:[]}function g_(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],s=r[1];t[n]=Qo(s)}),t}var Ft;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ft||(Ft={}));var y_=Ft.Selected,dr=Ft.Disabled,b_=Ft.Hidden,w_=Ft.Today,Hi=Ft.RangeEnd,zi=Ft.RangeMiddle,Yi=Ft.RangeStart,x_=Ft.Outside;function __(e,t,r){var n,s=(n={},n[y_]=Qo(e.selected),n[dr]=Qo(e.disabled),n[b_]=Qo(e.hidden),n[w_]=[e.today],n[Hi]=[],n[zi]=[],n[Yi]=[],n[x_]=[],n);return e.fromDate&&s[dr].push({before:e.fromDate}),e.toDate&&s[dr].push({after:e.toDate}),Bs(e)?s[dr]=s[dr].concat(t.modifiers[dr]):Ws(e)&&(s[dr]=s[dr].concat(r.modifiers[dr]),s[Yi]=r.modifiers[Yi],s[zi]=r.modifiers[zi],s[Hi]=r.modifiers[Hi]),s}var oh=S.createContext(void 0);function C_(e){var t=Me(),r=Wi(),n=Ui(),s=__(t,r,n),o=g_(t.modifiers),a=te(te({},s),o);return l.jsx(oh.Provider,{value:a,children:e.children})}function ah(){var e=S.useContext(oh);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function S_(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function k_(e){return!!(e&&typeof e=="object"&&"from"in e)}function N_(e){return!!(e&&typeof e=="object"&&"after"in e)}function E_(e){return!!(e&&typeof e=="object"&&"before"in e)}function P_(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function T_(e,t){var r,n=t.from,s=t.to;if(n&&s){var o=Qt(s,n)<0;o&&(r=[s,n],n=r[0],s=r[1]);var a=Qt(e,n)>=0&&Qt(s,e)>=0;return a}return s?ht(s,e):n?ht(n,e):!1}function O_(e){return Ti(e)}function M_(e){return Array.isArray(e)&&e.every(Ti)}function A_(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(O_(r))return ht(e,r);if(M_(r))return r.includes(e);if(k_(r))return T_(e,r);if(P_(r))return r.dayOfWeek.includes(e.getDay());if(S_(r)){var n=Qt(r.before,e),s=Qt(r.after,e),o=n>0,a=s<0,i=Di(r.before,r.after);return i?a&&o:o||a}return N_(r)?Qt(e,r.after)>0:E_(r)?Qt(r.before,e)>0:typeof r=="function"?r(e):!1})}function qi(e,t,r){var n=Object.keys(t).reduce(function(o,a){var i=t[a];return A_(e,i)&&o.push(a),o},[]),s={};return n.forEach(function(o){return s[o]=!0}),r&&!Ii(e,r)&&(s.outside=!0),s}function D_(e,t){for(var r=pt(e[0]),n=Oi(e[e.length-1]),s,o,a=r;a<=n;){var i=qi(a,t),c=!i.disabled&&!i.hidden;if(!c){a=ot(a,1);continue}if(i.selected)return a;i.today&&!o&&(o=a),s||(s=a),a=ot(a,1)}return o||s}var I_=365;function ih(e,t){var r=t.moveBy,n=t.direction,s=t.context,o=t.modifiers,a=t.retry,i=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,d=s.fromDate,u=s.toDate,h=s.locale,v={day:ot,week:Pi,month:It,year:u0,startOfWeek:function(g){return s.ISOWeek?un(g):Kt(g,{locale:h,weekStartsOn:c})},endOfWeek:function(g){return s.ISOWeek?Ef(g):Mi(g,{locale:h,weekStartsOn:c})}},f=v[r](e,n==="after"?1:-1);n==="before"&&d?f=f0([d,f]):n==="after"&&u&&(f=h0([u,f]));var b=!0;if(o){var p=qi(f,o);b=!p.disabled&&!p.hidden}return b?f:i.count>I_?i.lastFocused:ih(f,{moveBy:r,direction:n,context:s,modifiers:o,retry:te(te({},i),{count:i.count+1})})}var lh=S.createContext(void 0);function F_(e){var t=js(),r=ah(),n=S.useState(),s=n[0],o=n[1],a=S.useState(),i=a[0],c=a[1],d=D_(t.displayMonths,r),u=s??(i&&t.isDateDisplayed(i))?i:d,h=function(){c(s),o(void 0)},v=function(g){o(g)},f=Me(),b=function(g,x){if(s){var y=ih(s,{moveBy:g,direction:x,context:f,modifiers:r});ht(s,y)||(t.goToDate(y,s),v(y))}},p={focusedDay:s,focusTarget:u,blur:h,focus:v,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return l.jsx(lh.Provider,{value:p,children:e.children})}function Zi(){var e=S.useContext(lh);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function L_(e,t){var r=ah(),n=qi(e,r,t);return n}var Ki=S.createContext(void 0);function V_(e){if(!Zo(e.initialProps)){var t={selected:void 0};return l.jsx(Ki.Provider,{value:t,children:e.children})}return l.jsx($_,{initialProps:e.initialProps,children:e.children})}function $_(e){var t=e.initialProps,r=e.children,n=function(o,a,i){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,i),a.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,o,a,i);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,a,i)},s={selected:t.selected,onDayClick:n};return l.jsx(Ki.Provider,{value:s,children:r})}function ch(){var e=S.useContext(Ki);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function B_(e,t){var r=Me(),n=ch(),s=Wi(),o=Ui(),a=Zi(),i=a.focusDayAfter,c=a.focusDayBefore,d=a.focusWeekAfter,u=a.focusWeekBefore,h=a.blur,v=a.focus,f=a.focusMonthBefore,b=a.focusMonthAfter,p=a.focusYearBefore,g=a.focusYearAfter,x=a.focusStartOfWeek,y=a.focusEndOfWeek,w=function(D){var O,B,ae,Se;Zo(r)?(O=n.onDayClick)===null||O===void 0||O.call(n,e,t,D):Bs(r)?(B=s.onDayClick)===null||B===void 0||B.call(s,e,t,D):Ws(r)?(ae=o.onDayClick)===null||ae===void 0||ae.call(o,e,t,D):(Se=r.onDayClick)===null||Se===void 0||Se.call(r,e,t,D)},k=function(D){var O;v(e),(O=r.onDayFocus)===null||O===void 0||O.call(r,e,t,D)},N=function(D){var O;h(),(O=r.onDayBlur)===null||O===void 0||O.call(r,e,t,D)},M=function(D){var O;(O=r.onDayMouseEnter)===null||O===void 0||O.call(r,e,t,D)},P=function(D){var O;(O=r.onDayMouseLeave)===null||O===void 0||O.call(r,e,t,D)},F=function(D){var O;(O=r.onDayPointerEnter)===null||O===void 0||O.call(r,e,t,D)},$=function(D){var O;(O=r.onDayPointerLeave)===null||O===void 0||O.call(r,e,t,D)},z=function(D){var O;(O=r.onDayTouchCancel)===null||O===void 0||O.call(r,e,t,D)},X=function(D){var O;(O=r.onDayTouchEnd)===null||O===void 0||O.call(r,e,t,D)},A=function(D){var O;(O=r.onDayTouchMove)===null||O===void 0||O.call(r,e,t,D)},j=function(D){var O;(O=r.onDayTouchStart)===null||O===void 0||O.call(r,e,t,D)},I=function(D){var O;(O=r.onDayKeyUp)===null||O===void 0||O.call(r,e,t,D)},J=function(D){var O;switch(D.key){case"ArrowLeft":D.preventDefault(),D.stopPropagation(),r.dir==="rtl"?i():c();break;case"ArrowRight":D.preventDefault(),D.stopPropagation(),r.dir==="rtl"?c():i();break;case"ArrowDown":D.preventDefault(),D.stopPropagation(),d();break;case"ArrowUp":D.preventDefault(),D.stopPropagation(),u();break;case"PageUp":D.preventDefault(),D.stopPropagation(),D.shiftKey?p():f();break;case"PageDown":D.preventDefault(),D.stopPropagation(),D.shiftKey?g():b();break;case"Home":D.preventDefault(),D.stopPropagation(),x();break;case"End":D.preventDefault(),D.stopPropagation(),y();break}(O=r.onDayKeyDown)===null||O===void 0||O.call(r,e,t,D)},Y={onClick:w,onFocus:k,onBlur:N,onKeyDown:J,onKeyUp:I,onMouseEnter:M,onMouseLeave:P,onPointerEnter:F,onPointerLeave:$,onTouchCancel:z,onTouchEnd:X,onTouchMove:A,onTouchStart:j};return Y}function W_(){var e=Me(),t=ch(),r=Wi(),n=Ui(),s=Zo(e)?t.selected:Bs(e)?r.selected:Ws(e)?n.selected:void 0;return s}function j_(e){return Object.values(Ft).includes(e)}function U_(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var s=e.modifiersClassNames[n];if(s)r.push(s);else if(j_(n)){var o=e.classNames["day_".concat(n)];o&&r.push(o)}}),r}function H_(e,t){var r=te({},e.styles.day);return Object.keys(t).forEach(function(n){var s;r=te(te({},r),(s=e.modifiersStyles)===null||s===void 0?void 0:s[n])}),r}function z_(e,t,r){var n,s,o,a=Me(),i=Zi(),c=L_(e,t),d=B_(e,c),u=W_(),h=!!(a.onDayClick||a.mode!=="default");S.useEffect(function(){var M;c.outside||i.focusedDay&&h&&ht(i.focusedDay,e)&&((M=r.current)===null||M===void 0||M.focus())},[i.focusedDay,e,r,h,c.outside]);var v=U_(a,c).join(" "),f=H_(a,c),b=!!(c.outside&&!a.showOutsideDays||c.hidden),p=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:u_,g=l.jsx(p,{date:e,displayMonth:t,activeModifiers:c}),x={style:f,className:v,children:g,role:"gridcell"},y=i.focusTarget&&ht(i.focusTarget,e)&&!c.outside,w=i.focusedDay&&ht(i.focusedDay,e),k=te(te(te({},x),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=w||y?0:-1,n)),d),N={isButton:h,isHidden:b,activeModifiers:c,selectedDays:u,buttonProps:k,divProps:x};return N}function Y_(e){var t=S.useRef(null),r=z_(e.date,e.displayMonth,t);return r.isHidden?l.jsx("div",{role:"gridcell"}):r.isButton?l.jsx(Ko,te({name:"day",ref:t},r.buttonProps)):l.jsx("div",te({},r.divProps))}function q_(e){var t=e.number,r=e.dates,n=Me(),s=n.onWeekNumberClick,o=n.styles,a=n.classNames,i=n.locale,c=n.labels.labelWeekNumber,d=n.formatters.formatWeekNumber,u=d(Number(t),{locale:i});if(!s)return l.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:u});var h=c(Number(t),{locale:i}),v=function(f){s(t,r,f)};return l.jsx(Ko,{name:"week-number","aria-label":h,className:a.weeknumber,style:o.weeknumber,onClick:v,children:u})}function Z_(e){var t,r,n=Me(),s=n.styles,o=n.classNames,a=n.showWeekNumber,i=n.components,c=(t=i==null?void 0:i.Day)!==null&&t!==void 0?t:Y_,d=(r=i==null?void 0:i.WeekNumber)!==null&&r!==void 0?r:q_,u;return a&&(u=l.jsx("td",{className:o.cell,style:s.cell,children:l.jsx(d,{number:e.weekNumber,dates:e.dates})})),l.jsxs("tr",{className:o.row,style:s.row,children:[u,e.dates.map(function(h){return l.jsx("td",{className:o.cell,style:s.cell,role:"presentation",children:l.jsx(c,{displayMonth:e.displayMonth,date:h})},dx(h))})]})}function dh(e,t,r){for(var n=r!=null&&r.ISOWeek?Ef(t):Mi(t,r),s=r!=null&&r.ISOWeek?un(e):Kt(e,r),o=Qt(n,s),a=[],i=0;i<=o;i++)a.push(ot(s,i));var c=a.reduce(function(d,u){var h=r!=null&&r.ISOWeek?Tf(u):Mf(u,r),v=d.find(function(f){return f.weekNumber===h});return v?(v.dates.push(u),d):(d.push({weekNumber:h,dates:[u]}),d)},[]);return c}function K_(e,t){var r=dh(pt(e),Oi(e),t);if(t!=null&&t.useFixedWeeks){var n=fx(e,t);if(n<6){var s=r[r.length-1],o=s.dates[s.dates.length-1],a=Pi(o,6-n),i=dh(Pi(o,1),a,t);r.push.apply(r,i)}}return r}function Q_(e){var t,r,n,s=Me(),o=s.locale,a=s.classNames,i=s.styles,c=s.hideHead,d=s.fixedWeeks,u=s.components,h=s.weekStartsOn,v=s.firstWeekContainsDate,f=s.ISOWeek,b=K_(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:f,locale:o,weekStartsOn:h,firstWeekContainsDate:v}),p=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:d_,g=(r=u==null?void 0:u.Row)!==null&&r!==void 0?r:Z_,x=(n=u==null?void 0:u.Footer)!==null&&n!==void 0?n:i_;return l.jsxs("table",{id:e.id,className:a.table,style:i.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&l.jsx(p,{}),l.jsx("tbody",{className:a.tbody,style:i.tbody,children:b.map(function(y){return l.jsx(g,{displayMonth:e.displayMonth,dates:y.dates,weekNumber:y.weekNumber},y.weekNumber)})}),l.jsx(x,{displayMonth:e.displayMonth})]})}function G_(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var X_=G_()?S.useLayoutEffect:S.useEffect,Qi=!1,J_=0;function uh(){return"react-day-picker-".concat(++J_)}function R_(e){var t,r=e??(Qi?uh():null),n=S.useState(r),s=n[0],o=n[1];return X_(function(){s===null&&o(uh())},[]),S.useEffect(function(){Qi===!1&&(Qi=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function eC(e){var t,r,n=Me(),s=n.dir,o=n.classNames,a=n.styles,i=n.components,c=js().displayMonths,d=R_(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),u=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,h=[o.month],v=a.month,f=e.displayIndex===0,b=e.displayIndex===c.length-1,p=!f&&!b;s==="rtl"&&(t=[f,b],b=t[0],f=t[1]),f&&(h.push(o.caption_start),v=te(te({},v),a.caption_start)),b&&(h.push(o.caption_end),v=te(te({},v),a.caption_end)),p&&(h.push(o.caption_between),v=te(te({},v),a.caption_between));var g=(r=i==null?void 0:i.Caption)!==null&&r!==void 0?r:a_;return l.jsxs("div",{className:h.join(" "),style:v,children:[l.jsx(g,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(Q_,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function tC(e){var t=Me(),r=t.classNames,n=t.styles;return l.jsx("div",{className:r.months,style:n.months,children:e.children})}function rC(e){var t,r,n=e.initialProps,s=Me(),o=Zi(),a=js(),i=S.useState(!1),c=i[0],d=i[1];S.useEffect(function(){s.initialFocus&&o.focusTarget&&(c||(o.focus(o.focusTarget),d(!0)))},[s.initialFocus,c,o.focus,o.focusTarget,o]);var u=[s.classNames.root,s.className];s.numberOfMonths>1&&u.push(s.classNames.multiple_months),s.showWeekNumber&&u.push(s.classNames.with_weeknumber);var h=te(te({},s.styles.root),s.style),v=Object.keys(n).filter(function(b){return b.startsWith("data-")}).reduce(function(b,p){var g;return te(te({},b),(g={},g[p]=n[p],g))},{}),f=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:tC;return l.jsx("div",te({className:u.join(" "),style:h,dir:s.dir,id:s.id,nonce:n.nonce,title:n.title,lang:n.lang},v,{children:l.jsx(f,{children:a.displayMonths.map(function(b,p){return l.jsx(eC,{displayIndex:p,displayMonth:b},p)})})}))}function nC(e){var t=e.children,r=Ex(e,["children"]);return l.jsx(qx,{initialProps:r,children:l.jsx(r_,{children:l.jsx(V_,{initialProps:r,children:l.jsx(f_,{initialProps:r,children:l.jsx(m_,{initialProps:r,children:l.jsx(C_,{children:l.jsx(F_,{children:t})})})})})})})}function sC(e){return l.jsx(nC,te({},e,{children:l.jsx(rC,{initialProps:e})}))}function Gi({className:e,classNames:t,showOutsideDays:r=!0,...n}){const s=(o,a)=>{const i={target:{value:String(o)}};a(i)};return l.jsx(sC,{showOutsideDays:r,className:he("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption_start:"is-start",caption_between:"is-between",caption_end:"is-end",caption:"flex justify-center pt-1 relative items-center gap-1",caption_label:"flex h-7 text-sm font-medium justify-center items-center grow [.is-multiple_&]:flex",caption_dropdowns:"flex justify-center gap-1 grow dropdowns pl-8 pr-9",multiple_months:"is-multiple",vhidden:"hidden [.is-between_&]:flex [.is-end_&]:flex [.is-start.is-end_&]:hidden",nav:"flex items-center [&:has([name='previous-month'])]:order-first [&:has([name='next-month'])]:order-last gap-1",nav_button:he(xo({variant:"outline"}),"h-7 w-7 bg-transparent p-0 text-muted-foreground"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:he("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:he(xo({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"text-muted-foreground opacity-50",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible"},components:{IconLeft:({...o})=>l.jsx(Ip,{className:"h-4 w-4"}),IconRight:({...o})=>l.jsx(Fp,{className:"h-4 w-4"}),Dropdown:({...o})=>l.jsxs(cn,{...o,onValueChange:a=>{o.onChange&&s(a,o.onChange)},value:o.value,children:[l.jsx(Fr,{className:he(xo({variant:"ghost"}),"pl-2 pr-1 py-2 h-7 w-fit font-medium [.is-between_&]:hidden [.is-end_&]:hidden [.is-start.is-end_&]:flex"),children:l.jsx(dn,{placeholder:o==null?void 0:o.caption,children:o==null?void 0:o.caption})}),l.jsx(Lr,{className:"max-h-[var(--radix-popper-available-height);] overflow-y-auto scrolling-auto min-w-[var(--radix-popper-anchor-width)]",children:o.children&&m.Children.map(o.children,a=>{var i,c;return l.jsx(re,{value:(i=a==null?void 0:a.props)==null?void 0:i.value,className:"min-w-[var(--radix-popper-anchor-width)]",children:(c=a==null?void 0:a.props)==null?void 0:c.children})})})]})},...n})}Gi.displayName="Calendar";const oC=Ms({registration_number:et().min(1,"Registration number is required"),country:et().min(1,"Country is required"),company_name:et().min(2,"Company name must be at least 2 characters"),tax_identity_number:et().min(1,"Tax identity number is required"),corporate_type:et().min(1,"Corporate type is required"),date_of_establishment:vu({required_error:"Date of establishment is required"})}),aC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Cs({resolver:Ss(oC),defaultValues:{registration_number:e.registration_number,country:e.country,company_name:e.company_name,tax_identity_number:e.tax_identity_number,corporate_type:e.corporate_type,date_of_establishment:e.date_of_establishment||void 0}}),a=i=>{t(i),r()};return l.jsxs(dt,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Information",subTitle:"Please provide your business details",onBack:n})}),l.jsxs(ut,{children:[l.jsx(As,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(Ze,{control:o.control,name:"registration_number",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Registration Number"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter registration number",...i})}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"country",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"company_name",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Company Name"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter company name",...i})}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"tax_identity_number",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Tax Identity Number"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter tax identity number",...i})}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"corporate_type",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Corporate Type"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select corporate type"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"llc",children:"LLC"}),l.jsx(re,{value:"corporation",children:"Corporation"}),l.jsx(re,{value:"partnership",children:"Partnership"}),l.jsx(re,{value:"sole-proprietorship",children:"Sole Proprietorship"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"date_of_establishment",render:({field:i})=>l.jsxs(je,{className:"flex flex-col",children:[l.jsx(Ue,{children:"Date of Establishment"}),l.jsxs(Gf,{children:[l.jsx(Xf,{asChild:!0,children:l.jsx(He,{children:l.jsxs(Ye,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Ql,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx($i,{className:"w-auto p-0",align:"start",children:l.jsx(Gi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(ze,{})]})}),l.jsx(Ye,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},iC=Ms({full_name:et().min(2,"Full name must be at least 2 characters"),title:et().min(1,"Title is required"),birth:vu({required_error:"Birth date is required"}),phone_number:et().min(10,"Phone number must be at least 10 characters")}),lC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Cs({resolver:Ss(iC),defaultValues:{full_name:e.full_name,title:e.title,birth:e.birth||void 0,phone_number:e.phone_number}}),a=i=>{t(i),r()};return l.jsxs(dt,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Personal Details",subTitle:"Please provide your personal information",onBack:n})}),l.jsxs(ut,{children:[l.jsx(As,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(Ze,{control:o.control,name:"full_name",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Full Name"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter your full name",...i})}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"title",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Title"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"e.g., CEO, Director, Manager",...i})}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"birth",render:({field:i})=>l.jsxs(je,{className:"flex flex-col",children:[l.jsx(Ue,{children:"Date of Birth"}),l.jsxs(Gf,{children:[l.jsx(Xf,{asChild:!0,children:l.jsx(He,{children:l.jsxs(Ye,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Ql,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx($i,{className:"w-auto p-0",align:"start",children:l.jsx(Gi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date||c<new Date("1900-01-01"),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(ze,{})]})}),l.jsx(Ze,{control:o.control,name:"phone_number",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Phone Number"}),l.jsx(He,{children:l.jsx(wt,{placeholder:"Enter your phone number",...i})}),l.jsx(ze,{})]})}),l.jsx(Ye,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};var Xi="Progress",Ji=100,[cC,MC]=Rr(Xi),[dC,uC]=cC(Xi),fh=m.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=fC,...a}=e;(s||s===0)&&!vh(s)&&console.error(hC(`${s}`,"Progress"));const i=vh(s)?s:Ji;n!==null&&!gh(n,i)&&console.error(pC(`${n}`,"Progress"));const c=gh(n,i)?n:null,d=Go(c)?o(c,i):void 0;return l.jsx(dC,{scope:r,value:c,max:i,children:l.jsx(we.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Go(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":mh(c,i),"data-value":c??void 0,"data-max":i,...a,ref:t})})});fh.displayName=Xi;var hh="ProgressIndicator",ph=m.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=uC(hh,r);return l.jsx(we.div,{"data-state":mh(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});ph.displayName=hh;function fC(e,t){return`${Math.round(e/t*100)}%`}function mh(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Go(e){return typeof e=="number"}function vh(e){return Go(e)&&!isNaN(e)&&e>0}function gh(e,t){return Go(e)&&!isNaN(e)&&e<=t&&e>=0}function hC(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ji}\`.`}function pC(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
142
+ `)},kw=0,zn=[];function Nw(e){var t=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),s=m.useState(kw++)[0],o=m.useState(Lu)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=Zb([e.lockRef.current],(e.shards||[]).map(Hu),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=m.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var x=Uo(p),y=r.current,w="deltaX"in p?p.deltaX:y[0]-x[0],k="deltaY"in p?p.deltaY:y[1]-x[1],N,O=p.target,A=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in p&&A==="h"&&O.type==="range")return!1;var V=Bu(A,O);if(!V)return!0;if(V?N=A:(N=A==="v"?"h":"v",V=Bu(A,O)),!V)return!1;if(!n.current&&"changedTouches"in p&&(w||k)&&(n.current=N),!N)return!0;var L=n.current||N;return _w(L,g,p,L==="h"?w:k,!0)},[]),c=m.useCallback(function(p){var g=p;if(!(!zn.length||zn[zn.length-1]!==o)){var x="deltaY"in g?Uu(g):Uo(g),y=t.current.filter(function(N){return N.name===g.type&&(N.target===g.target||g.target===N.shadowParent)&&Cw(N.delta,x)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(Hu).filter(Boolean).filter(function(N){return N.contains(g.target)}),k=w.length>0?i(g,w[0]):!a.current.noIsolation;k&&g.cancelable&&g.preventDefault()}}},[]),d=m.useCallback(function(p,g,x,y){var w={name:p,delta:g,target:x,should:y,shadowParent:Ew(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(k){return k!==w})},1)},[]),u=m.useCallback(function(p){r.current=Uo(p),n.current=void 0},[]),h=m.useCallback(function(p){d(p.type,Uu(p),p.target,i(p,e.lockRef.current))},[]),v=m.useCallback(function(p){d(p.type,Uo(p),p.target,i(p,e.lockRef.current))},[]);m.useEffect(function(){return zn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Hn),document.addEventListener("touchmove",c,Hn),document.addEventListener("touchstart",u,Hn),function(){zn=zn.filter(function(p){return p!==o}),document.removeEventListener("wheel",c,Hn),document.removeEventListener("touchmove",c,Hn),document.removeEventListener("touchstart",u,Hn)}},[]);var f=e.removeScrollBar,b=e.inert;return m.createElement(m.Fragment,null,b?m.createElement(o,{styles:Sw(s)}):null,f?m.createElement(mw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ew(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pw=rw(Fu,Nw);var wi=m.forwardRef(function(e,t){return m.createElement(Wo,Zt({},e,{ref:t,sideCar:Pw}))});wi.classNames=Wo.classNames;var Tw=[" ","Enter","ArrowUp","ArrowDown"],Ow=[" ","Enter"],an="Select",[Ho,zo,Mw]=ml(an),[Yn,PC]=Rr(an,[Mw,On]),Yo=On(),[Aw,Dr]=Yn(an),[Dw,Iw]=Yn(an),zu=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:a,defaultValue:i,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:v,required:f,form:b}=e,p=Yo(t),[g,x]=m.useState(null),[y,w]=m.useState(null),[k,N]=m.useState(!1),O=Fb(d),[A,V]=eo({prop:n,defaultProp:s??!1,onChange:o,caller:an}),[L,U]=eo({prop:a,defaultProp:i,onChange:c,caller:an}),F=m.useRef(null),P=g?b||!!g.closest("form"):!0,[H,I]=m.useState(new Set),J=Array.from(H).map(q=>q.props.value).join(";");return l.jsx(qc,{...p,children:l.jsxs(Aw,{required:f,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:N,contentId:oo(),value:L,onValueChange:U,open:A,onOpenChange:V,dir:O,triggerPointerDownPosRef:F,disabled:v,children:[l.jsx(Ho.Provider,{scope:t,children:l.jsx(Dw,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(q=>{I(D=>new Set(D).add(q))},[]),onNativeOptionRemove:m.useCallback(q=>{I(D=>{const M=new Set(D);return M.delete(q),M})},[]),children:r})}),P?l.jsxs(mf,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:h,value:L,onChange:q=>U(q.target.value),disabled:v,form:b,children:[L===void 0?l.jsx("option",{value:""}):null,Array.from(H)]},J):null]})})};zu.displayName=an;var Yu="SelectTrigger",qu=m.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Yo(r),a=Dr(Yu,r),i=a.disabled||n,c=Ie(t,a.onTriggerChange),d=zo(r),u=m.useRef("touch"),[h,v,f]=gf(p=>{const g=d().filter(w=>!w.disabled),x=g.find(w=>w.value===a.value),y=yf(g,p,x);y!==void 0&&a.onValueChange(y.value)}),b=p=>{i||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(vo,{asChild:!0,...o,children:l.jsx(we.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":vf(a.value)?"":void 0,...s,ref:c,onClick:ie(s.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&b(p)}),onPointerDown:ie(s.onPointerDown,p=>{u.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:ie(s.onKeyDown,p=>{const g=h.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&v(p.key),!(g&&p.key===" ")&&Tw.includes(p.key)&&(b(),p.preventDefault())})})})});qu.displayName=Yu;var Zu="SelectValue",Ku=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:a="",...i}=e,c=Dr(Zu,r),{onValueNodeHasChildrenChange:d}=c,u=o!==void 0,h=Ie(t,c.onValueNodeChange);return Re(()=>{d(u)},[d,u]),l.jsx(we.span,{...i,ref:h,style:{pointerEvents:"none"},children:vf(c.value)?l.jsx(l.Fragment,{children:a}):o})});Ku.displayName=Zu;var Fw="SelectIcon",Qu=m.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return l.jsx(we.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});Qu.displayName=Fw;var Lw="SelectPortal",Gu=e=>l.jsx(Js,{asChild:!0,...e});Gu.displayName=Lw;var ln="SelectContent",Xu=m.forwardRef((e,t)=>{const r=Dr(ln,e.__scopeSelect),[n,s]=m.useState();if(Re(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?cs.createPortal(l.jsx(Ju,{scope:e.__scopeSelect,children:l.jsx(Ho.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(Ru,{...e,ref:t})});Xu.displayName=ln;var Dt=10,[Ju,Ir]=Yn(ln),Vw="SelectContentImpl",$w=Cn("SelectContent.RemoveScroll"),Ru=m.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g,...x}=e,y=Dr(ln,r),[w,k]=m.useState(null),[N,O]=m.useState(null),A=Ie(t,Z=>k(Z)),[V,L]=m.useState(null),[U,F]=m.useState(null),P=zo(r),[H,I]=m.useState(!1),J=m.useRef(!1);m.useEffect(()=>{if(w)return Mu(w)},[w]),Cu();const q=m.useCallback(Z=>{const[ke,...Ae]=P().map(be=>be.ref.current),[ye]=Ae.slice(-1),me=document.activeElement;for(const be of Z)if(be===me||(be==null||be.scrollIntoView({block:"nearest"}),be===ke&&N&&(N.scrollTop=0),be===ye&&N&&(N.scrollTop=N.scrollHeight),be==null||be.focus(),document.activeElement!==me))return},[P,N]),D=m.useCallback(()=>q([V,w]),[q,V,w]);m.useEffect(()=>{H&&D()},[H,D]);const{onOpenChange:M,triggerPointerDownPosRef:W}=y;m.useEffect(()=>{if(w){let Z={x:0,y:0};const ke=ye=>{var me,be;Z={x:Math.abs(Math.round(ye.pageX)-(((me=W.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(ye.pageY)-(((be=W.current)==null?void 0:be.y)??0))}},Ae=ye=>{Z.x<=10&&Z.y<=10?ye.preventDefault():w.contains(ye.target)||M(!1),document.removeEventListener("pointermove",ke),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ke),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ke),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,M,W]),m.useEffect(()=>{const Z=()=>M(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[M]);const[ae,Se]=gf(Z=>{const ke=P().filter(me=>!me.disabled),Ae=ke.find(me=>me.ref.current===document.activeElement),ye=yf(ke,Z,Ae);ye&&setTimeout(()=>ye.ref.current.focus())}),de=m.useCallback((Z,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&(L(Z),ye&&(J.current=!0))},[y.value]),ue=m.useCallback(()=>w==null?void 0:w.focus(),[w]),pe=m.useCallback((Z,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&F(Z)},[y.value]),Fe=n==="popper"?xi:ef,rt=Fe===xi?{side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(Ju,{scope:r,content:w,viewport:N,onViewportChange:O,itemRefCallback:de,selectedItem:V,onItemLeave:ue,itemTextRefCallback:pe,focusSelectedItem:D,selectedItemText:U,position:n,isPositioned:H,searchRef:ae,children:l.jsx(wi,{as:$w,allowPinchZoom:!0,children:l.jsx(pi,{asChild:!0,trapped:y.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:ie(s,Z=>{var ke;(ke=y.trigger)==null||ke.focus({preventScroll:!0}),Z.preventDefault()}),children:l.jsx(us,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(Fe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Z=>Z.preventDefault(),...x,...rt,onPlaced:()=>I(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ie(x.onKeyDown,Z=>{const ke=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!ke&&Z.key.length===1&&Se(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let ye=P().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const me=Z.target,be=ye.indexOf(me);ye=ye.slice(be+1)}setTimeout(()=>q(ye)),Z.preventDefault()}})})})})})})});Ru.displayName=Vw;var Bw="SelectItemAlignedPosition",ef=m.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Dr(ln,r),a=Ir(ln,r),[i,c]=m.useState(null),[d,u]=m.useState(null),h=Ie(t,A=>u(A)),v=zo(r),f=m.useRef(!1),b=m.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=a,w=m.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&d&&p&&g&&x){const A=o.trigger.getBoundingClientRect(),V=d.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),U=x.getBoundingClientRect();if(o.dir!=="rtl"){const me=U.left-V.left,be=L.left-me,Je=A.left-be,dt=A.width+Je,Rt=Math.max(dt,V.width),er=window.innerWidth-Dt,mr=_u(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=dt+"px",i.style.left=mr+"px"}else{const me=V.right-U.right,be=window.innerWidth-L.right-me,Je=window.innerWidth-A.right-be,dt=A.width+Je,Rt=Math.max(dt,V.width),er=window.innerWidth-Dt,mr=_u(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=dt+"px",i.style.right=mr+"px"}const F=v(),P=window.innerHeight-Dt*2,H=p.scrollHeight,I=window.getComputedStyle(d),J=parseInt(I.borderTopWidth,10),q=parseInt(I.paddingTop,10),D=parseInt(I.borderBottomWidth,10),M=parseInt(I.paddingBottom,10),W=J+q+H+M+D,ae=Math.min(g.offsetHeight*5,W),Se=window.getComputedStyle(p),de=parseInt(Se.paddingTop,10),ue=parseInt(Se.paddingBottom,10),pe=A.top+A.height/2-Dt,Fe=P-pe,rt=g.offsetHeight/2,Z=g.offsetTop+rt,ke=J+q+Z,Ae=W-ke;if(ke<=pe){const me=F.length>0&&g===F[F.length-1].ref.current;i.style.bottom="0px";const be=d.clientHeight-p.offsetTop-p.offsetHeight,Je=Math.max(Fe,rt+(me?ue:0)+be+D),dt=ke+Je;i.style.height=dt+"px"}else{const me=F.length>0&&g===F[0].ref.current;i.style.top="0px";const Je=Math.max(pe,J+p.offsetTop+(me?de:0)+rt)+Ae;i.style.height=Je+"px",p.scrollTop=ke-pe+p.offsetTop}i.style.margin=`${Dt}px 0`,i.style.minHeight=ae+"px",i.style.maxHeight=P+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[v,o.trigger,o.valueNode,i,d,p,g,x,o.dir,n]);Re(()=>w(),[w]);const[k,N]=m.useState();Re(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const O=m.useCallback(A=>{A&&b.current===!0&&(w(),y==null||y(),b.current=!1)},[w,y]);return l.jsx(jw,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:f,onScrollButtonChange:O,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:l.jsx(we.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});ef.displayName=Bw;var Ww="SelectPopperPosition",xi=m.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Dt,...o}=e,a=Yo(r);return l.jsx(Da,{...a,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xi.displayName=Ww;var[jw,_i]=Yn(ln,{}),Ci="SelectViewport",tf=m.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Ir(Ci,r),a=_i(Ci,r),i=Ie(t,o.onViewportChange),c=m.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),l.jsx(Ho.Slot,{scope:r,children:l.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ie(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=a;if(v!=null&&v.current&&h){const f=Math.abs(c.current-u.scrollTop);if(f>0){const b=window.innerHeight-Dt*2,p=parseFloat(h.style.minHeight),g=parseFloat(h.style.height),x=Math.max(p,g);if(x<b){const y=x+f,w=Math.min(b,y),k=y-w;h.style.height=w+"px",h.style.bottom==="0px"&&(u.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});tf.displayName=Ci;var rf="SelectGroup",[Uw,Hw]=Yn(rf),zw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=oo();return l.jsx(Uw,{scope:r,id:s,children:l.jsx(we.div,{role:"group","aria-labelledby":s,...n,ref:t})})});zw.displayName=rf;var nf="SelectLabel",sf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Hw(nf,r);return l.jsx(we.div,{id:s.id,...n,ref:t})});sf.displayName=nf;var qo="SelectItem",[Yw,of]=Yn(qo),af=m.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,i=Dr(qo,r),c=Ir(qo,r),d=i.value===n,[u,h]=m.useState(o??""),[v,f]=m.useState(!1),b=Ie(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,n,s)}),p=oo(),g=m.useRef("touch"),x=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(Yw,{scope:r,value:n,disabled:s,textId:p,isSelected:d,onItemTextChange:m.useCallback(y=>{h(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:l.jsx(Ho.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:l.jsx(we.div,{role:"option","aria-labelledby":p,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:b,onFocus:ie(a.onFocus,()=>f(!0)),onBlur:ie(a.onBlur,()=>f(!1)),onClick:ie(a.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:ie(a.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:ie(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:ie(a.onPointerMove,y=>{var w;g.current=y.pointerType,s?(w=c.onItemLeave)==null||w.call(c):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(a.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ie(a.onKeyDown,y=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&y.key===" "||(Ow.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});af.displayName=qo;var Fs="SelectItemText",lf=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,a=Dr(Fs,r),i=Ir(Fs,r),c=of(Fs,r),d=Iw(Fs,r),[u,h]=m.useState(null),v=Ie(t,x=>h(x),c.onItemTextChange,x=>{var y;return(y=i.itemTextRefCallback)==null?void 0:y.call(i,x,c.value,c.disabled)}),f=u==null?void 0:u.textContent,b=m.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=d;return Re(()=>(p(b),()=>g(b)),[p,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(we.span,{id:c.textId,...o,ref:v}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?cs.createPortal(o.children,a.valueNode):null]})});lf.displayName=Fs;var cf="SelectItemIndicator",df=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return of(cf,r).isSelected?l.jsx(we.span,{"aria-hidden":!0,...n,ref:t}):null});df.displayName=cf;var Si="SelectScrollUpButton",uf=m.forwardRef((e,t)=>{const r=Ir(Si,e.__scopeSelect),n=_i(Si,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return Re(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollTop>0;o(d)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(hf,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});uf.displayName=Si;var ki="SelectScrollDownButton",ff=m.forwardRef((e,t)=>{const r=Ir(ki,e.__scopeSelect),n=_i(ki,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return Re(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;o(u)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(hf,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});ff.displayName=ki;var hf=m.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Ir("SelectScrollButton",r),a=m.useRef(null),i=zo(r),c=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Re(()=>{var u;const d=i().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[i]),l.jsx(we.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ie(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:ie(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:ie(s.onPointerLeave,()=>{c()})})}),qw="SelectSeparator",pf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return l.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});pf.displayName=qw;var Ni="SelectArrow",Zw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Yo(r),o=Dr(Ni,r),a=Ir(Ni,r);return o.open&&a.position==="popper"?l.jsx(Ia,{...s,...n,ref:t}):null});Zw.displayName=Ni;var Kw="SelectBubbleInput",mf=m.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=m.useRef(null),o=Ie(n,s),a=Hb(t);return m.useEffect(()=>{const i=s.current;if(!i)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const h=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(h)}},[a,t]),l.jsx(we.select,{...r,style:{..._l,...r.style},ref:o,defaultValue:t})});mf.displayName=Kw;function vf(e){return e===""||e===void 0}function gf(e){const t=Et(e),r=m.useRef(""),n=m.useRef(0),s=m.useCallback(a=>{const i=r.current+a;t(i),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(i)},[t]),o=m.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function yf(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Qw(e,Math.max(o,0));s.length===1&&(a=a.filter(d=>d!==r));const c=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function Qw(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Gw=zu,bf=qu,Xw=Ku,Jw=Qu,Rw=Gu,wf=Xu,e0=tf,xf=sf,_f=af,t0=lf,r0=df,Cf=uf,Sf=ff,kf=pf;const cn=Gw,dn=Xw,Fr=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(bf,{ref:n,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,l.jsx(Jw,{asChild:!0,children:l.jsx(Xl,{className:"h-4 w-4 opacity-50"})})]}));Fr.displayName=bf.displayName;const Nf=m.forwardRef(({className:e,...t},r)=>l.jsx(Cf,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx($p,{className:"h-4 w-4"})}));Nf.displayName=Cf.displayName;const Ef=m.forwardRef(({className:e,...t},r)=>l.jsx(Sf,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Xl,{className:"h-4 w-4"})}));Ef.displayName=Sf.displayName;const Lr=m.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>l.jsx(Rw,{children:l.jsxs(wf,{ref:s,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[l.jsx(Nf,{}),l.jsx(e0,{className:he("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Ef,{})]})}));Lr.displayName=wf.displayName;const n0=m.forwardRef(({className:e,...t},r)=>l.jsx(xf,{ref:r,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));n0.displayName=xf.displayName;const re=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(_f,{ref:n,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(r0,{children:l.jsx(Gl,{className:"h-4 w-4"})})}),l.jsx(t0,{children:t})]}));re.displayName=_f.displayName;const s0=m.forwardRef(({className:e,...t},r)=>l.jsx(kf,{ref:r,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));s0.displayName=kf.displayName;const o0=Ds({industry:et().min(1,"Industry is required"),business_model:et().min(1,"Business model is required"),annual_sales_volume:et().min(1,"Annual sales volume is required"),website_url:et().url("Please enter a valid URL").optional().or(Ob(""))}),a0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=ks({resolver:Ns(o0),defaultValues:{industry:e.industry,business_model:e.business_model,annual_sales_volume:e.annual_sales_volume,website_url:e.website_url}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Activity",subTitle:"Tell us about your business operations",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Is,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(Ze,{control:o.control,name:"industry",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Industry"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(ze,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select industry"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"technology",children:"Technology"}),l.jsx(re,{value:"finance",children:"Finance"}),l.jsx(re,{value:"healthcare",children:"Healthcare"}),l.jsx(re,{value:"retail",children:"Retail"}),l.jsx(re,{value:"manufacturing",children:"Manufacturing"}),l.jsx(re,{value:"education",children:"Education"}),l.jsx(re,{value:"hospitality",children:"Hospitality"}),l.jsx(re,{value:"real-estate",children:"Real Estate"}),l.jsx(re,{value:"consulting",children:"Consulting"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"business_model",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Business Model"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(ze,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select business model"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"b2b",children:"B2B (Business to Business)"}),l.jsx(re,{value:"b2c",children:"B2C (Business to Consumer)"}),l.jsx(re,{value:"b2b2c",children:"B2B2C (Business to Business to Consumer)"}),l.jsx(re,{value:"marketplace",children:"Marketplace"}),l.jsx(re,{value:"saas",children:"SaaS (Software as a Service)"}),l.jsx(re,{value:"subscription",children:"Subscription"}),l.jsx(re,{value:"freemium",children:"Freemium"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"annual_sales_volume",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Annual Sales Volume (USD)"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(ze,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select annual sales volume"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"0-50k",children:"$0 - $50,000"}),l.jsx(re,{value:"50k-100k",children:"$50,000 - $100,000"}),l.jsx(re,{value:"100k-500k",children:"$100,000 - $500,000"}),l.jsx(re,{value:"500k-1m",children:"$500,000 - $1,000,000"}),l.jsx(re,{value:"1m-5m",children:"$1,000,000 - $5,000,000"}),l.jsx(re,{value:"5m-10m",children:"$5,000,000 - $10,000,000"}),l.jsx(re,{value:"10m+",children:"$10,000,000+"})]})]}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"website_url",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Website URL (Optional)"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"https://www.yourcompany.com",...i})}),l.jsx(Ye,{})]})}),l.jsx(Be,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},i0=Ds({street:et().min(1,"Street is required"),number:et().min(1,"Number is required"),postal_code:et().min(1,"Postal code is required"),city:et().min(1,"City is required"),address_country:et().min(1,"Country is required")}),l0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=ks({resolver:Ns(i0),defaultValues:{street:e.street,number:e.number,postal_code:e.postal_code,city:e.city,address_country:e.address_country}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Address",subTitle:"Please provide your business address",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Is,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(Ze,{control:o.control,name:"street",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Street"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter street name",...i})}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"number",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Number"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter street number",...i})}),l.jsx(Ye,{})]})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(Ze,{control:o.control,name:"postal_code",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Postal Code"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter postal code",...i})}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"city",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"City"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter city",...i})}),l.jsx(Ye,{})]})})]}),l.jsx(Ze,{control:o.control,name:"address_country",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(ze,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(Ye,{})]})}),l.jsx(Be,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function _e(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ct(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function it(e,t){const r=_e(e);return isNaN(t)?Ct(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function It(e,t){const r=_e(e);if(isNaN(t))return Ct(e,NaN);if(!t)return r;const n=r.getDate(),s=Ct(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return n>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const Ei=6048e5,c0=864e5;let d0={};function Ls(){return d0}function Kt(e,t){var i,c,d,u;const r=Ls(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?7:0)+o-n;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function un(e){return Kt(e,{weekStartsOn:1})}function Pf(e){const t=_e(e),r=t.getFullYear(),n=Ct(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=un(n),o=Ct(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=un(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function qn(e){const t=_e(e);return t.setHours(0,0,0,0),t}function Zo(e){const t=_e(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Qt(e,t){const r=qn(e),n=qn(t),s=+r-Zo(r),o=+n-Zo(n);return Math.round((s-o)/c0)}function u0(e){const t=Pf(e),r=Ct(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),un(r)}function Pi(e,t){const r=t*7;return it(e,r)}function f0(e,t){return It(e,t*12)}function h0(e){let t;return e.forEach(function(r){const n=_e(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function p0(e){let t;return e.forEach(r=>{const n=_e(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function ht(e,t){const r=qn(e),n=qn(t);return+r==+n}function Ti(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function m0(e){if(!Ti(e)&&typeof e!="number")return!1;const t=_e(e);return!isNaN(Number(t))}function Vs(e,t){const r=_e(e),n=_e(t),s=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return s*12+o}function v0(e,t,r){const n=Kt(e,r),s=Kt(t,r),o=+n-Zo(n),a=+s-Zo(s);return Math.round((o-a)/Ei)}function Oi(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function pt(e){const t=_e(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Tf(e){const t=_e(e),r=Ct(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Mi(e,t){var i,c,d,u;const r=Ls(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?-7:0)+6-(o-n);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Of(e){return Mi(e,{weekStartsOn:1})}const g0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},y0=(e,t,r)=>{let n;const s=g0[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Ai(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const b0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},w0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},x0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_0={date:Ai({formats:b0,defaultWidth:"full"}),time:Ai({formats:w0,defaultWidth:"full"}),dateTime:Ai({formats:x0,defaultWidth:"full"})},C0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},S0=(e,t,r,n)=>C0[e];function $s(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=r!=null&&r.width?String(r.width):a;s=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const k0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},N0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},E0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},P0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},T0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},O0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},M0={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:$s({values:k0,defaultWidth:"wide"}),quarter:$s({values:N0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:$s({values:E0,defaultWidth:"wide"}),day:$s({values:P0,defaultWidth:"wide"}),dayPeriod:$s({values:T0,defaultWidth:"wide",formattingValues:O0,defaultFormattingWidth:"wide"})};function Bs(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?D0(i,h=>h.test(a)):A0(i,h=>h.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(a.length);return{value:d,rest:u}}}function A0(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function D0(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function I0(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;const i=t.slice(s.length);return{value:a,rest:i}}}const F0=/^(\d+)(th|st|nd|rd)?/i,L0=/\d+/i,V0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},$0={any:[/^b/i,/^(a|c)/i]},B0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},W0={any:[/1/i,/2/i,/3/i,/4/i]},j0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},U0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},H0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},z0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Y0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},q0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Z0={ordinalNumber:I0({matchPattern:F0,parsePattern:L0,valueCallback:e=>parseInt(e,10)}),era:Bs({matchPatterns:V0,defaultMatchWidth:"wide",parsePatterns:$0,defaultParseWidth:"any"}),quarter:Bs({matchPatterns:B0,defaultMatchWidth:"wide",parsePatterns:W0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Bs({matchPatterns:j0,defaultMatchWidth:"wide",parsePatterns:U0,defaultParseWidth:"any"}),day:Bs({matchPatterns:H0,defaultMatchWidth:"wide",parsePatterns:z0,defaultParseWidth:"any"}),dayPeriod:Bs({matchPatterns:Y0,defaultMatchWidth:"any",parsePatterns:q0,defaultParseWidth:"any"})},Mf={code:"en-US",formatDistance:y0,formatLong:_0,formatRelative:S0,localize:M0,match:Z0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function K0(e){const t=_e(e);return Qt(t,Tf(t))+1}function Af(e){const t=_e(e),r=+un(t)-+u0(t);return Math.round(r/Ei)+1}function Df(e,t){var u,h,v,f;const r=_e(e),n=r.getFullYear(),s=Ls(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((f=(v=s.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=Ct(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const i=Kt(a,t),c=Ct(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=Kt(c,t);return r.getTime()>=i.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Q0(e,t){var i,c,d,u;const r=Ls(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Df(e,t),o=Ct(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),Kt(o,t)}function If(e,t){const r=_e(e),n=+Kt(r,t)-+Q0(r,t);return Math.round(n/Ei)+1}function Pe(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Vr={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Pe(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Pe(r+1,2)},d(e,t){return Pe(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Pe(e.getHours()%12||12,t.length)},H(e,t){return Pe(e.getHours(),t.length)},m(e,t){return Pe(e.getMinutes(),t.length)},s(e,t){return Pe(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Pe(s,t.length)}},Zn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ff={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Vr.y(e,t)},Y:function(e,t,r,n){const s=Df(e,n),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return Pe(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):Pe(o,t.length)},R:function(e,t){const r=Pf(e);return Pe(r,t.length)},u:function(e,t){const r=e.getFullYear();return Pe(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Pe(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Pe(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Vr.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Pe(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=If(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Pe(s,t.length)},I:function(e,t,r){const n=Af(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Pe(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Vr.d(e,t)},D:function(e,t,r){const n=K0(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Pe(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Pe(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Pe(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Pe(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=Zn.noon:n===0?s=Zn.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=Zn.evening:n>=12?s=Zn.afternoon:n>=4?s=Zn.morning:s=Zn.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Vr.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Vr.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vr.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Vr.s(e,t)},S:function(e,t){return Vr.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Vf(n);case"XXXX":case"XX":return fn(n);case"XXXXX":case"XXX":default:return fn(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Vf(n);case"xxxx":case"xx":return fn(n);case"xxxxx":case"xxx":default:return fn(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Lf(n,":");case"OOOO":default:return"GMT"+fn(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Lf(n,":");case"zzzz":default:return"GMT"+fn(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Pe(n,t.length)},T:function(e,t,r){const n=e.getTime();return Pe(n,t.length)}};function Lf(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),o=n%60;return o===0?r+String(s):r+String(s)+t+Pe(o,2)}function Vf(e,t){return e%60===0?(e>0?"-":"+")+Pe(Math.abs(e)/60,2):fn(e,t)}function fn(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Pe(Math.trunc(n/60),2),o=Pe(n%60,2);return r+s+t+o}const $f=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Bf=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},G0={p:Bf,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return $f(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",$f(n,t)).replace("{{time}}",Bf(s,t))}},X0=/^D+$/,J0=/^Y+$/,R0=["D","DD","YY","YYYY"];function ex(e){return X0.test(e)}function tx(e){return J0.test(e)}function rx(e,t,r){const n=nx(e,t,r);if(console.warn(n),R0.includes(e))throw new RangeError(n)}function nx(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ox=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ax=/^'([^]*?)'?$/,ix=/''/g,lx=/[a-zA-Z]/;function cr(e,t,r){var u,h,v,f,b,p,g,x;const n=Ls(),s=(r==null?void 0:r.locale)??n.locale??Mf,o=(r==null?void 0:r.firstWeekContainsDate)??((h=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(v=n.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=(r==null?void 0:r.weekStartsOn)??((p=(b=r==null?void 0:r.locale)==null?void 0:b.options)==null?void 0:p.weekStartsOn)??n.weekStartsOn??((x=(g=n.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,i=_e(e);if(!m0(i))throw new RangeError("Invalid time value");let c=t.match(ox).map(y=>{const w=y[0];if(w==="p"||w==="P"){const k=G0[w];return k(y,s.formatLong)}return y}).join("").match(sx).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:cx(y)};if(Ff[w])return{isToken:!0,value:y};if(w.match(lx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(i,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&tx(w)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&ex(w))&&rx(w,t,String(e));const k=Ff[w[0]];return k(i,w,s.localize,d)}).join("")}function cx(e){const t=e.match(ax);return t?t[1].replace(ix,"'"):e}function dx(e){const t=_e(e),r=t.getFullYear(),n=t.getMonth(),s=Ct(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function ux(e){return Math.trunc(+_e(e)/1e3)}function fx(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function hx(e,t){return v0(fx(e),pt(e),t)+1}function Di(e,t){const r=_e(e),n=_e(t);return r.getTime()>n.getTime()}function Wf(e,t){const r=_e(e),n=_e(t);return+r<+n}function Ii(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function px(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()}function Fi(e,t){return it(e,-t)}function Li(e,t){const r=_e(e),n=r.getFullYear(),s=r.getDate(),o=Ct(e,0);o.setFullYear(n,t,15),o.setHours(0,0,0,0);const a=dx(o);return r.setMonth(t,Math.min(s,a)),r}function jf(e,t){const r=_e(e);return isNaN(+r)?Ct(e,NaN):(r.setFullYear(t),r)}var Ko="Popover",[Uf,MC]=Rr(Ko,[On]),Ws=On(),[mx,$r]=Uf(Ko),Hf=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=Ws(t),c=m.useRef(null),[d,u]=m.useState(!1),[h,v]=eo({prop:n,defaultProp:s??!1,onChange:o,caller:Ko});return l.jsx(qc,{...i,children:l.jsx(mx,{scope:t,contentId:oo(),triggerRef:c,open:h,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(f=>!f),[v]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:a,children:r})})};Hf.displayName=Ko;var zf="PopoverAnchor",vx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(zf,r),o=Ws(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return m.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(vo,{...o,...n,ref:t})});vx.displayName=zf;var Yf="PopoverTrigger",qf=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Yf,r),o=Ws(r),a=Ie(t,s.triggerRef),i=l.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Xf(s.open),...n,ref:a,onClick:ie(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:l.jsx(vo,{asChild:!0,...o,children:i})});qf.displayName=Yf;var Vi="PopoverPortal",[gx,yx]=Uf(Vi,{forceMount:void 0}),Zf=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=$r(Vi,t);return l.jsx(gx,{scope:t,forceMount:r,children:l.jsx(fs,{present:r||o.open,children:l.jsx(Js,{asChild:!0,container:s,children:n})})})};Zf.displayName=Vi;var Kn="PopoverContent",Kf=m.forwardRef((e,t)=>{const r=yx(Kn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=$r(Kn,e.__scopePopover);return l.jsx(fs,{present:n||o.open,children:o.modal?l.jsx(wx,{...s,ref:t}):l.jsx(xx,{...s,ref:t})})});Kf.displayName=Kn;var bx=Cn("PopoverContent.RemoveScroll"),wx=m.forwardRef((e,t)=>{const r=$r(Kn,e.__scopePopover),n=m.useRef(null),s=Ie(t,n),o=m.useRef(!1);return m.useEffect(()=>{const a=n.current;if(a)return Mu(a)},[]),l.jsx(wi,{as:bx,allowPinchZoom:!0,children:l.jsx(Qf,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),o.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ie(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),xx=m.forwardRef((e,t)=>{const r=$r(Kn,e.__scopePopover),n=m.useRef(!1),s=m.useRef(!1);return l.jsx(Qf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Qf=m.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...h}=e,v=$r(Kn,r),f=Ws(r);return Cu(),l.jsx(pi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(us,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(Da,{"data-state":Xf(v.open),role:"dialog",id:v.contentId,...f,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Gf="PopoverClose",_x=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Gf,r);return l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,()=>s.onOpenChange(!1))})});_x.displayName=Gf;var Cx="PopoverArrow",Sx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Ws(r);return l.jsx(Ia,{...s,...n,ref:t})});Sx.displayName=Cx;function Xf(e){return e?"open":"closed"}var kx=Hf,Nx=qf,Ex=Zf,Jf=Kf;const Rf=kx,eh=Nx,$i=m.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>l.jsx(Ex,{children:l.jsx(Jf,{ref:s,align:t,sideOffset:r,className:he("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));$i.displayName=Jf.displayName;var te=function(){return te=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},te.apply(this,arguments)};function Px(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function th(e,t,r){for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function js(e){return e.mode==="multiple"}function Us(e){return e.mode==="range"}function Qo(e){return e.mode==="single"}var Tx={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Ox(e,t){return cr(e,"LLLL y",t)}function Mx(e,t){return cr(e,"d",t)}function Ax(e,t){return cr(e,"LLLL",t)}function Dx(e){return"".concat(e)}function Ix(e,t){return cr(e,"cccccc",t)}function Fx(e,t){return cr(e,"yyyy",t)}var Lx=Object.freeze({__proto__:null,formatCaption:Ox,formatDay:Mx,formatMonthCaption:Ax,formatWeekNumber:Dx,formatWeekdayName:Ix,formatYearCaption:Fx}),Vx=function(e,t,r){return cr(e,"do MMMM (EEEE)",r)},$x=function(){return"Month: "},Bx=function(){return"Go to next month"},Wx=function(){return"Go to previous month"},jx=function(e,t){return cr(e,"cccc",t)},Ux=function(e){return"Week n. ".concat(e)},Hx=function(){return"Year: "},zx=Object.freeze({__proto__:null,labelDay:Vx,labelMonthDropdown:$x,labelNext:Bx,labelPrevious:Wx,labelWeekNumber:Ux,labelWeekday:jx,labelYearDropdown:Hx});function Yx(){var e="buttons",t=Tx,r=Mf,n={},s={},o=1,a={},i=new Date;return{captionLayout:e,classNames:t,formatters:Lx,labels:zx,locale:r,modifiersClassNames:n,modifiers:s,numberOfMonths:o,styles:a,today:i,mode:"default"}}function qx(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,s=e.toMonth,o=e.fromDate,a=e.toDate;return n?o=pt(n):t&&(o=new Date(t,0,1)),s?a=Oi(s):r&&(a=new Date(r,11,31)),{fromDate:o?qn(o):void 0,toDate:a?qn(a):void 0}}var rh=S.createContext(void 0);function Zx(e){var t,r=e.initialProps,n=Yx(),s=qx(r),o=s.fromDate,a=s.toDate,i=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;i!=="buttons"&&(!o||!a)&&(i="buttons");var c;(Qo(r)||js(r)||Us(r))&&(c=r.onSelect);var d=te(te(te({},n),r),{captionLayout:i,classNames:te(te({},n.classNames),r.classNames),components:te({},r.components),formatters:te(te({},n.formatters),r.formatters),fromDate:o,labels:te(te({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:te(te({},n.modifiers),r.modifiers),modifiersClassNames:te(te({},n.modifiersClassNames),r.modifiersClassNames),onSelect:c,styles:te(te({},n.styles),r.styles),toDate:a});return l.jsx(rh.Provider,{value:d,children:e.children})}function Me(){var e=S.useContext(rh);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function nh(e){var t=Me(),r=t.locale,n=t.classNames,s=t.styles,o=t.formatters.formatCaption;return l.jsx("div",{className:n.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:r})})}function Kx(e){return l.jsx("svg",te({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:l.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function sh(e){var t,r,n=e.onChange,s=e.value,o=e.children,a=e.caption,i=e.className,c=e.style,d=Me(),u=(r=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:Kx;return l.jsxs("div",{className:i,style:c,children:[l.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),l.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:s,onChange:n,children:o}),l.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[a,l.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function Qx(e){var t,r=Me(),n=r.fromDate,s=r.toDate,o=r.styles,a=r.locale,i=r.formatters.formatMonthCaption,c=r.classNames,d=r.components,u=r.labels.labelMonthDropdown;if(!n)return l.jsx(l.Fragment,{});if(!s)return l.jsx(l.Fragment,{});var h=[];if(px(n,s))for(var v=pt(n),f=n.getMonth();f<=s.getMonth();f++)h.push(Li(v,f));else for(var v=pt(new Date),f=0;f<=11;f++)h.push(Li(v,f));var b=function(g){var x=Number(g.target.value),y=Li(pt(e.displayMonth),x);e.onChange(y)},p=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:sh;return l.jsx(p,{name:"months","aria-label":u(),className:c.dropdown_month,style:o.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:i(e.displayMonth,{locale:a}),children:h.map(function(g){return l.jsx("option",{value:g.getMonth(),children:i(g,{locale:a})},g.getMonth())})})}function Gx(e){var t,r=e.displayMonth,n=Me(),s=n.fromDate,o=n.toDate,a=n.locale,i=n.styles,c=n.classNames,d=n.components,u=n.formatters.formatYearCaption,h=n.labels.labelYearDropdown,v=[];if(!s)return l.jsx(l.Fragment,{});if(!o)return l.jsx(l.Fragment,{});for(var f=s.getFullYear(),b=o.getFullYear(),p=f;p<=b;p++)v.push(jf(Tf(new Date),p));var g=function(y){var w=jf(pt(r),Number(y.target.value));e.onChange(w)},x=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:sh;return l.jsx(x,{name:"years","aria-label":h(),className:c.dropdown_year,style:i.dropdown_year,onChange:g,value:r.getFullYear(),caption:u(r,{locale:a}),children:v.map(function(y){return l.jsx("option",{value:y.getFullYear(),children:u(y,{locale:a})},y.getFullYear())})})}function Xx(e,t){var r=S.useState(e),n=r[0],s=r[1],o=t===void 0?n:t;return[o,s]}function Jx(e){var t=e.month,r=e.defaultMonth,n=e.today,s=t||r||n||new Date,o=e.toDate,a=e.fromDate,i=e.numberOfMonths,c=i===void 0?1:i;if(o&&Vs(o,s)<0){var d=-1*(c-1);s=It(o,d)}return a&&Vs(s,a)<0&&(s=a),pt(s)}function Rx(){var e=Me(),t=Jx(e),r=Xx(t,e.month),n=r[0],s=r[1],o=function(a){var i;if(!e.disableNavigation){var c=pt(a);s(c),(i=e.onMonthChange)===null||i===void 0||i.call(e,c)}};return[n,o]}function e_(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,s=pt(e),o=pt(It(s,n)),a=Vs(o,s),i=[],c=0;c<a;c++){var d=It(s,c);i.push(d)}return r&&(i=i.reverse()),i}function t_(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=pt(e);if(!r)return It(i,a);var c=Vs(r,e);if(!(c<o))return It(i,a)}}function r_(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=pt(e);if(!r)return It(i,-a);var c=Vs(i,r);if(!(c<=0))return It(i,-a)}}var oh=S.createContext(void 0);function n_(e){var t=Me(),r=Rx(),n=r[0],s=r[1],o=e_(n,t),a=t_(n,t),i=r_(n,t),c=function(h){return o.some(function(v){return Ii(h,v)})},d=function(h,v){c(h)||(v&&Wf(h,v)?s(It(h,1+t.numberOfMonths*-1)):s(h))},u={currentMonth:n,displayMonths:o,goToMonth:s,goToDate:d,previousMonth:i,nextMonth:a,isDateDisplayed:c};return l.jsx(oh.Provider,{value:u,children:e.children})}function Hs(){var e=S.useContext(oh);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function ah(e){var t,r=Me(),n=r.classNames,s=r.styles,o=r.components,a=Hs().goToMonth,i=function(u){a(It(u,e.displayIndex?-e.displayIndex:0))},c=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:nh,d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth});return l.jsxs("div",{className:n.caption_dropdowns,style:s.caption_dropdowns,children:[l.jsx("div",{className:n.vhidden,children:d}),l.jsx(Qx,{onChange:i,displayMonth:e.displayMonth}),l.jsx(Gx,{onChange:i,displayMonth:e.displayMonth})]})}function s_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function o_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Go=S.forwardRef(function(e,t){var r=Me(),n=r.classNames,s=r.styles,o=[n.button_reset,n.button];e.className&&o.push(e.className);var a=o.join(" "),i=te(te({},s.button_reset),s.button);return e.style&&Object.assign(i,e.style),l.jsx("button",te({},e,{ref:t,type:"button",className:a,style:i}))});function a_(e){var t,r,n=Me(),s=n.dir,o=n.locale,a=n.classNames,i=n.styles,c=n.labels,d=c.labelPrevious,u=c.labelNext,h=n.components;if(!e.nextMonth&&!e.previousMonth)return l.jsx(l.Fragment,{});var v=d(e.previousMonth,{locale:o}),f=[a.nav_button,a.nav_button_previous].join(" "),b=u(e.nextMonth,{locale:o}),p=[a.nav_button,a.nav_button_next].join(" "),g=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:o_,x=(r=h==null?void 0:h.IconLeft)!==null&&r!==void 0?r:s_;return l.jsxs("div",{className:a.nav,style:i.nav,children:[!e.hidePrevious&&l.jsx(Go,{name:"previous-month","aria-label":v,className:f,style:i.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?l.jsx(g,{className:a.nav_icon,style:i.nav_icon}):l.jsx(x,{className:a.nav_icon,style:i.nav_icon})}),!e.hideNext&&l.jsx(Go,{name:"next-month","aria-label":b,className:p,style:i.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?l.jsx(x,{className:a.nav_icon,style:i.nav_icon}):l.jsx(g,{className:a.nav_icon,style:i.nav_icon})})]})}function ih(e){var t=Me().numberOfMonths,r=Hs(),n=r.previousMonth,s=r.nextMonth,o=r.goToMonth,a=r.displayMonths,i=a.findIndex(function(b){return Ii(e.displayMonth,b)}),c=i===0,d=i===a.length-1,u=t>1&&(c||!d),h=t>1&&(d||!c),v=function(){n&&o(n)},f=function(){s&&o(s)};return l.jsx(a_,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:h,nextMonth:s,previousMonth:n,onPreviousClick:v,onNextClick:f})}function i_(e){var t,r=Me(),n=r.classNames,s=r.disableNavigation,o=r.styles,a=r.captionLayout,i=r.components,c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:nh,d;return s?d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?d=l.jsx(ah,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?d=l.jsxs(l.Fragment,{children:[l.jsx(ah,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),l.jsx(ih,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=l.jsxs(l.Fragment,{children:[l.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(ih,{displayMonth:e.displayMonth,id:e.id})]}),l.jsx("div",{className:n.caption,style:o.caption,children:d})}function l_(e){var t=Me(),r=t.footer,n=t.styles,s=t.classNames.tfoot;return r?l.jsx("tfoot",{className:s,style:n.tfoot,children:l.jsx("tr",{children:l.jsx("td",{colSpan:8,children:r})})}):l.jsx(l.Fragment,{})}function c_(e,t,r){for(var n=r?un(new Date):Kt(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=it(n,o);s.push(a)}return s}function d_(){var e=Me(),t=e.classNames,r=e.styles,n=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,i=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=c_(s,o,a);return l.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&l.jsx("td",{style:r.head_cell,className:t.head_cell}),d.map(function(u,h){return l.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(u,{locale:s}),children:i(u,{locale:s})},h)})]})}function u_(){var e,t=Me(),r=t.classNames,n=t.styles,s=t.components,o=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:d_;return l.jsx("thead",{style:n.head,className:r.head,children:l.jsx(o,{})})}function f_(e){var t=Me(),r=t.locale,n=t.formatters.formatDay;return l.jsx(l.Fragment,{children:n(e.date,{locale:r})})}var Bi=S.createContext(void 0);function h_(e){if(!js(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return l.jsx(Bi.Provider,{value:t,children:e.children})}return l.jsx(p_,{initialProps:e.initialProps,children:e.children})}function p_(e){var t=e.initialProps,r=e.children,n=t.selected,s=t.min,o=t.max,a=function(d,u,h){var v,f;(v=t.onDayClick)===null||v===void 0||v.call(t,d,u,h);var b=!!(u.selected&&s&&(n==null?void 0:n.length)===s);if(!b){var p=!!(!u.selected&&o&&(n==null?void 0:n.length)===o);if(!p){var g=n?th([],n):[];if(u.selected){var x=g.findIndex(function(y){return ht(d,y)});g.splice(x,1)}else g.push(d);(f=t.onSelect)===null||f===void 0||f.call(t,g,d,u,h)}}},i={disabled:[]};n&&i.disabled.push(function(d){var u=o&&n.length>o-1,h=n.some(function(v){return ht(v,d)});return!!(u&&!h)});var c={selected:n,onDayClick:a,modifiers:i};return l.jsx(Bi.Provider,{value:c,children:r})}function Wi(){var e=S.useContext(Bi);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function m_(e,t){var r=t||{},n=r.from,s=r.to;return n&&s?ht(s,e)&&ht(n,e)?void 0:ht(s,e)?{from:s,to:void 0}:ht(n,e)?void 0:Di(n,e)?{from:e,to:s}:{from:n,to:e}:s?Di(e,s)?{from:s,to:e}:{from:e,to:s}:n?Wf(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var ji=S.createContext(void 0);function v_(e){if(!Us(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return l.jsx(ji.Provider,{value:t,children:e.children})}return l.jsx(g_,{initialProps:e.initialProps,children:e.children})}function g_(e){var t=e.initialProps,r=e.children,n=t.selected,s=n||{},o=s.from,a=s.to,i=t.min,c=t.max,d=function(f,b,p){var g,x;(g=t.onDayClick)===null||g===void 0||g.call(t,f,b,p);var y=m_(f,n);(x=t.onSelect)===null||x===void 0||x.call(t,y,f,b,p)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],a?(u.range_end=[a],ht(o,a)||(u.range_middle=[{after:o,before:a}])):u.range_end=[o]):a&&(u.range_start=[a],u.range_end=[a]),i&&(o&&!a&&u.disabled.push({after:Fi(o,i-1),before:it(o,i-1)}),o&&a&&u.disabled.push({after:o,before:it(o,i-1)}),!o&&a&&u.disabled.push({after:Fi(a,i-1),before:it(a,i-1)})),c){if(o&&!a&&(u.disabled.push({before:it(o,-c+1)}),u.disabled.push({after:it(o,c-1)})),o&&a){var h=Qt(a,o)+1,v=c-h;u.disabled.push({before:Fi(o,v)}),u.disabled.push({after:it(a,v)})}!o&&a&&(u.disabled.push({before:it(a,-c+1)}),u.disabled.push({after:it(a,c-1)}))}return l.jsx(ji.Provider,{value:{selected:n,onDayClick:d,modifiers:u},children:r})}function Ui(){var e=S.useContext(ji);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Xo(e){return Array.isArray(e)?th([],e):e!==void 0?[e]:[]}function y_(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],s=r[1];t[n]=Xo(s)}),t}var Ft;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ft||(Ft={}));var b_=Ft.Selected,dr=Ft.Disabled,w_=Ft.Hidden,x_=Ft.Today,Hi=Ft.RangeEnd,zi=Ft.RangeMiddle,Yi=Ft.RangeStart,__=Ft.Outside;function C_(e,t,r){var n,s=(n={},n[b_]=Xo(e.selected),n[dr]=Xo(e.disabled),n[w_]=Xo(e.hidden),n[x_]=[e.today],n[Hi]=[],n[zi]=[],n[Yi]=[],n[__]=[],n);return e.fromDate&&s[dr].push({before:e.fromDate}),e.toDate&&s[dr].push({after:e.toDate}),js(e)?s[dr]=s[dr].concat(t.modifiers[dr]):Us(e)&&(s[dr]=s[dr].concat(r.modifiers[dr]),s[Yi]=r.modifiers[Yi],s[zi]=r.modifiers[zi],s[Hi]=r.modifiers[Hi]),s}var lh=S.createContext(void 0);function S_(e){var t=Me(),r=Wi(),n=Ui(),s=C_(t,r,n),o=y_(t.modifiers),a=te(te({},s),o);return l.jsx(lh.Provider,{value:a,children:e.children})}function ch(){var e=S.useContext(lh);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function k_(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function N_(e){return!!(e&&typeof e=="object"&&"from"in e)}function E_(e){return!!(e&&typeof e=="object"&&"after"in e)}function P_(e){return!!(e&&typeof e=="object"&&"before"in e)}function T_(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function O_(e,t){var r,n=t.from,s=t.to;if(n&&s){var o=Qt(s,n)<0;o&&(r=[s,n],n=r[0],s=r[1]);var a=Qt(e,n)>=0&&Qt(s,e)>=0;return a}return s?ht(s,e):n?ht(n,e):!1}function M_(e){return Ti(e)}function A_(e){return Array.isArray(e)&&e.every(Ti)}function D_(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(M_(r))return ht(e,r);if(A_(r))return r.includes(e);if(N_(r))return O_(e,r);if(T_(r))return r.dayOfWeek.includes(e.getDay());if(k_(r)){var n=Qt(r.before,e),s=Qt(r.after,e),o=n>0,a=s<0,i=Di(r.before,r.after);return i?a&&o:o||a}return E_(r)?Qt(e,r.after)>0:P_(r)?Qt(r.before,e)>0:typeof r=="function"?r(e):!1})}function qi(e,t,r){var n=Object.keys(t).reduce(function(o,a){var i=t[a];return D_(e,i)&&o.push(a),o},[]),s={};return n.forEach(function(o){return s[o]=!0}),r&&!Ii(e,r)&&(s.outside=!0),s}function I_(e,t){for(var r=pt(e[0]),n=Oi(e[e.length-1]),s,o,a=r;a<=n;){var i=qi(a,t),c=!i.disabled&&!i.hidden;if(!c){a=it(a,1);continue}if(i.selected)return a;i.today&&!o&&(o=a),s||(s=a),a=it(a,1)}return o||s}var F_=365;function dh(e,t){var r=t.moveBy,n=t.direction,s=t.context,o=t.modifiers,a=t.retry,i=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,d=s.fromDate,u=s.toDate,h=s.locale,v={day:it,week:Pi,month:It,year:f0,startOfWeek:function(g){return s.ISOWeek?un(g):Kt(g,{locale:h,weekStartsOn:c})},endOfWeek:function(g){return s.ISOWeek?Of(g):Mi(g,{locale:h,weekStartsOn:c})}},f=v[r](e,n==="after"?1:-1);n==="before"&&d?f=h0([d,f]):n==="after"&&u&&(f=p0([u,f]));var b=!0;if(o){var p=qi(f,o);b=!p.disabled&&!p.hidden}return b?f:i.count>F_?i.lastFocused:dh(f,{moveBy:r,direction:n,context:s,modifiers:o,retry:te(te({},i),{count:i.count+1})})}var uh=S.createContext(void 0);function L_(e){var t=Hs(),r=ch(),n=S.useState(),s=n[0],o=n[1],a=S.useState(),i=a[0],c=a[1],d=I_(t.displayMonths,r),u=s??(i&&t.isDateDisplayed(i))?i:d,h=function(){c(s),o(void 0)},v=function(g){o(g)},f=Me(),b=function(g,x){if(s){var y=dh(s,{moveBy:g,direction:x,context:f,modifiers:r});ht(s,y)||(t.goToDate(y,s),v(y))}},p={focusedDay:s,focusTarget:u,blur:h,focus:v,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return l.jsx(uh.Provider,{value:p,children:e.children})}function Zi(){var e=S.useContext(uh);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function V_(e,t){var r=ch(),n=qi(e,r,t);return n}var Ki=S.createContext(void 0);function $_(e){if(!Qo(e.initialProps)){var t={selected:void 0};return l.jsx(Ki.Provider,{value:t,children:e.children})}return l.jsx(B_,{initialProps:e.initialProps,children:e.children})}function B_(e){var t=e.initialProps,r=e.children,n=function(o,a,i){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,i),a.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,o,a,i);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,a,i)},s={selected:t.selected,onDayClick:n};return l.jsx(Ki.Provider,{value:s,children:r})}function fh(){var e=S.useContext(Ki);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function W_(e,t){var r=Me(),n=fh(),s=Wi(),o=Ui(),a=Zi(),i=a.focusDayAfter,c=a.focusDayBefore,d=a.focusWeekAfter,u=a.focusWeekBefore,h=a.blur,v=a.focus,f=a.focusMonthBefore,b=a.focusMonthAfter,p=a.focusYearBefore,g=a.focusYearAfter,x=a.focusStartOfWeek,y=a.focusEndOfWeek,w=function(D){var M,W,ae,Se;Qo(r)?(M=n.onDayClick)===null||M===void 0||M.call(n,e,t,D):js(r)?(W=s.onDayClick)===null||W===void 0||W.call(s,e,t,D):Us(r)?(ae=o.onDayClick)===null||ae===void 0||ae.call(o,e,t,D):(Se=r.onDayClick)===null||Se===void 0||Se.call(r,e,t,D)},k=function(D){var M;v(e),(M=r.onDayFocus)===null||M===void 0||M.call(r,e,t,D)},N=function(D){var M;h(),(M=r.onDayBlur)===null||M===void 0||M.call(r,e,t,D)},O=function(D){var M;(M=r.onDayMouseEnter)===null||M===void 0||M.call(r,e,t,D)},A=function(D){var M;(M=r.onDayMouseLeave)===null||M===void 0||M.call(r,e,t,D)},V=function(D){var M;(M=r.onDayPointerEnter)===null||M===void 0||M.call(r,e,t,D)},L=function(D){var M;(M=r.onDayPointerLeave)===null||M===void 0||M.call(r,e,t,D)},U=function(D){var M;(M=r.onDayTouchCancel)===null||M===void 0||M.call(r,e,t,D)},F=function(D){var M;(M=r.onDayTouchEnd)===null||M===void 0||M.call(r,e,t,D)},P=function(D){var M;(M=r.onDayTouchMove)===null||M===void 0||M.call(r,e,t,D)},H=function(D){var M;(M=r.onDayTouchStart)===null||M===void 0||M.call(r,e,t,D)},I=function(D){var M;(M=r.onDayKeyUp)===null||M===void 0||M.call(r,e,t,D)},J=function(D){var M;switch(D.key){case"ArrowLeft":D.preventDefault(),D.stopPropagation(),r.dir==="rtl"?i():c();break;case"ArrowRight":D.preventDefault(),D.stopPropagation(),r.dir==="rtl"?c():i();break;case"ArrowDown":D.preventDefault(),D.stopPropagation(),d();break;case"ArrowUp":D.preventDefault(),D.stopPropagation(),u();break;case"PageUp":D.preventDefault(),D.stopPropagation(),D.shiftKey?p():f();break;case"PageDown":D.preventDefault(),D.stopPropagation(),D.shiftKey?g():b();break;case"Home":D.preventDefault(),D.stopPropagation(),x();break;case"End":D.preventDefault(),D.stopPropagation(),y();break}(M=r.onDayKeyDown)===null||M===void 0||M.call(r,e,t,D)},q={onClick:w,onFocus:k,onBlur:N,onKeyDown:J,onKeyUp:I,onMouseEnter:O,onMouseLeave:A,onPointerEnter:V,onPointerLeave:L,onTouchCancel:U,onTouchEnd:F,onTouchMove:P,onTouchStart:H};return q}function j_(){var e=Me(),t=fh(),r=Wi(),n=Ui(),s=Qo(e)?t.selected:js(e)?r.selected:Us(e)?n.selected:void 0;return s}function U_(e){return Object.values(Ft).includes(e)}function H_(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var s=e.modifiersClassNames[n];if(s)r.push(s);else if(U_(n)){var o=e.classNames["day_".concat(n)];o&&r.push(o)}}),r}function z_(e,t){var r=te({},e.styles.day);return Object.keys(t).forEach(function(n){var s;r=te(te({},r),(s=e.modifiersStyles)===null||s===void 0?void 0:s[n])}),r}function Y_(e,t,r){var n,s,o,a=Me(),i=Zi(),c=V_(e,t),d=W_(e,c),u=j_(),h=!!(a.onDayClick||a.mode!=="default");S.useEffect(function(){var O;c.outside||i.focusedDay&&h&&ht(i.focusedDay,e)&&((O=r.current)===null||O===void 0||O.focus())},[i.focusedDay,e,r,h,c.outside]);var v=H_(a,c).join(" "),f=z_(a,c),b=!!(c.outside&&!a.showOutsideDays||c.hidden),p=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:f_,g=l.jsx(p,{date:e,displayMonth:t,activeModifiers:c}),x={style:f,className:v,children:g,role:"gridcell"},y=i.focusTarget&&ht(i.focusTarget,e)&&!c.outside,w=i.focusedDay&&ht(i.focusedDay,e),k=te(te(te({},x),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=w||y?0:-1,n)),d),N={isButton:h,isHidden:b,activeModifiers:c,selectedDays:u,buttonProps:k,divProps:x};return N}function q_(e){var t=S.useRef(null),r=Y_(e.date,e.displayMonth,t);return r.isHidden?l.jsx("div",{role:"gridcell"}):r.isButton?l.jsx(Go,te({name:"day",ref:t},r.buttonProps)):l.jsx("div",te({},r.divProps))}function Z_(e){var t=e.number,r=e.dates,n=Me(),s=n.onWeekNumberClick,o=n.styles,a=n.classNames,i=n.locale,c=n.labels.labelWeekNumber,d=n.formatters.formatWeekNumber,u=d(Number(t),{locale:i});if(!s)return l.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:u});var h=c(Number(t),{locale:i}),v=function(f){s(t,r,f)};return l.jsx(Go,{name:"week-number","aria-label":h,className:a.weeknumber,style:o.weeknumber,onClick:v,children:u})}function K_(e){var t,r,n=Me(),s=n.styles,o=n.classNames,a=n.showWeekNumber,i=n.components,c=(t=i==null?void 0:i.Day)!==null&&t!==void 0?t:q_,d=(r=i==null?void 0:i.WeekNumber)!==null&&r!==void 0?r:Z_,u;return a&&(u=l.jsx("td",{className:o.cell,style:s.cell,children:l.jsx(d,{number:e.weekNumber,dates:e.dates})})),l.jsxs("tr",{className:o.row,style:s.row,children:[u,e.dates.map(function(h){return l.jsx("td",{className:o.cell,style:s.cell,role:"presentation",children:l.jsx(c,{displayMonth:e.displayMonth,date:h})},ux(h))})]})}function hh(e,t,r){for(var n=r!=null&&r.ISOWeek?Of(t):Mi(t,r),s=r!=null&&r.ISOWeek?un(e):Kt(e,r),o=Qt(n,s),a=[],i=0;i<=o;i++)a.push(it(s,i));var c=a.reduce(function(d,u){var h=r!=null&&r.ISOWeek?Af(u):If(u,r),v=d.find(function(f){return f.weekNumber===h});return v?(v.dates.push(u),d):(d.push({weekNumber:h,dates:[u]}),d)},[]);return c}function Q_(e,t){var r=hh(pt(e),Oi(e),t);if(t!=null&&t.useFixedWeeks){var n=hx(e,t);if(n<6){var s=r[r.length-1],o=s.dates[s.dates.length-1],a=Pi(o,6-n),i=hh(Pi(o,1),a,t);r.push.apply(r,i)}}return r}function G_(e){var t,r,n,s=Me(),o=s.locale,a=s.classNames,i=s.styles,c=s.hideHead,d=s.fixedWeeks,u=s.components,h=s.weekStartsOn,v=s.firstWeekContainsDate,f=s.ISOWeek,b=Q_(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:f,locale:o,weekStartsOn:h,firstWeekContainsDate:v}),p=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:u_,g=(r=u==null?void 0:u.Row)!==null&&r!==void 0?r:K_,x=(n=u==null?void 0:u.Footer)!==null&&n!==void 0?n:l_;return l.jsxs("table",{id:e.id,className:a.table,style:i.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&l.jsx(p,{}),l.jsx("tbody",{className:a.tbody,style:i.tbody,children:b.map(function(y){return l.jsx(g,{displayMonth:e.displayMonth,dates:y.dates,weekNumber:y.weekNumber},y.weekNumber)})}),l.jsx(x,{displayMonth:e.displayMonth})]})}function X_(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var J_=X_()?S.useLayoutEffect:S.useEffect,Qi=!1,R_=0;function ph(){return"react-day-picker-".concat(++R_)}function eC(e){var t,r=e??(Qi?ph():null),n=S.useState(r),s=n[0],o=n[1];return J_(function(){s===null&&o(ph())},[]),S.useEffect(function(){Qi===!1&&(Qi=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function tC(e){var t,r,n=Me(),s=n.dir,o=n.classNames,a=n.styles,i=n.components,c=Hs().displayMonths,d=eC(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),u=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,h=[o.month],v=a.month,f=e.displayIndex===0,b=e.displayIndex===c.length-1,p=!f&&!b;s==="rtl"&&(t=[f,b],b=t[0],f=t[1]),f&&(h.push(o.caption_start),v=te(te({},v),a.caption_start)),b&&(h.push(o.caption_end),v=te(te({},v),a.caption_end)),p&&(h.push(o.caption_between),v=te(te({},v),a.caption_between));var g=(r=i==null?void 0:i.Caption)!==null&&r!==void 0?r:i_;return l.jsxs("div",{className:h.join(" "),style:v,children:[l.jsx(g,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(G_,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function rC(e){var t=Me(),r=t.classNames,n=t.styles;return l.jsx("div",{className:r.months,style:n.months,children:e.children})}function nC(e){var t,r,n=e.initialProps,s=Me(),o=Zi(),a=Hs(),i=S.useState(!1),c=i[0],d=i[1];S.useEffect(function(){s.initialFocus&&o.focusTarget&&(c||(o.focus(o.focusTarget),d(!0)))},[s.initialFocus,c,o.focus,o.focusTarget,o]);var u=[s.classNames.root,s.className];s.numberOfMonths>1&&u.push(s.classNames.multiple_months),s.showWeekNumber&&u.push(s.classNames.with_weeknumber);var h=te(te({},s.styles.root),s.style),v=Object.keys(n).filter(function(b){return b.startsWith("data-")}).reduce(function(b,p){var g;return te(te({},b),(g={},g[p]=n[p],g))},{}),f=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:rC;return l.jsx("div",te({className:u.join(" "),style:h,dir:s.dir,id:s.id,nonce:n.nonce,title:n.title,lang:n.lang},v,{children:l.jsx(f,{children:a.displayMonths.map(function(b,p){return l.jsx(tC,{displayIndex:p,displayMonth:b},p)})})}))}function sC(e){var t=e.children,r=Px(e,["children"]);return l.jsx(Zx,{initialProps:r,children:l.jsx(n_,{children:l.jsx($_,{initialProps:r,children:l.jsx(h_,{initialProps:r,children:l.jsx(v_,{initialProps:r,children:l.jsx(S_,{children:l.jsx(L_,{children:t})})})})})})})}function oC(e){return l.jsx(sC,te({},e,{children:l.jsx(nC,{initialProps:e})}))}function Gi({className:e,classNames:t,showOutsideDays:r=!0,...n}){const s=(o,a)=>{const i={target:{value:String(o)}};a(i)};return l.jsx(oC,{showOutsideDays:r,className:he("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption_start:"is-start",caption_between:"is-between",caption_end:"is-end",caption:"flex justify-center pt-1 relative items-center gap-1",caption_label:"flex h-7 text-sm font-medium justify-center items-center grow [.is-multiple_&]:flex",caption_dropdowns:"flex justify-center gap-1 grow dropdowns pl-8 pr-9",multiple_months:"is-multiple",vhidden:"hidden [.is-between_&]:flex [.is-end_&]:flex [.is-start.is-end_&]:hidden",nav:"flex items-center [&:has([name='previous-month'])]:order-first [&:has([name='next-month'])]:order-last gap-1",nav_button:he(Co({variant:"outline"}),"h-7 w-7 bg-transparent p-0 text-muted-foreground"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:he("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:he(Co({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"text-muted-foreground opacity-50",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible"},components:{IconLeft:({...o})=>l.jsx(Lp,{className:"h-4 w-4"}),IconRight:({...o})=>l.jsx(Vp,{className:"h-4 w-4"}),Dropdown:({...o})=>l.jsxs(cn,{...o,onValueChange:a=>{o.onChange&&s(a,o.onChange)},value:o.value,children:[l.jsx(Fr,{className:he(Co({variant:"ghost"}),"pl-2 pr-1 py-2 h-7 w-fit font-medium [.is-between_&]:hidden [.is-end_&]:hidden [.is-start.is-end_&]:flex"),children:l.jsx(dn,{placeholder:o==null?void 0:o.caption,children:o==null?void 0:o.caption})}),l.jsx(Lr,{className:"max-h-[var(--radix-popper-available-height);] overflow-y-auto scrolling-auto min-w-[var(--radix-popper-anchor-width)]",children:o.children&&m.Children.map(o.children,a=>{var i,c;return l.jsx(re,{value:(i=a==null?void 0:a.props)==null?void 0:i.value,className:"min-w-[var(--radix-popper-anchor-width)]",children:(c=a==null?void 0:a.props)==null?void 0:c.children})})})]})},...n})}Gi.displayName="Calendar";const aC=Ds({registration_number:et().min(1,"Registration number is required"),country:et().min(1,"Country is required"),company_name:et().min(2,"Company name must be at least 2 characters"),tax_identity_number:et().min(1,"Tax identity number is required"),corporate_type:et().min(1,"Corporate type is required"),date_of_establishment:bu({required_error:"Date of establishment is required"})}),iC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=ks({resolver:Ns(aC),defaultValues:{registration_number:e.registration_number,country:e.country,company_name:e.company_name,tax_identity_number:e.tax_identity_number,corporate_type:e.corporate_type,date_of_establishment:e.date_of_establishment||void 0}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Information",subTitle:"Please provide your business details",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Is,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(Ze,{control:o.control,name:"registration_number",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Registration Number"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter registration number",...i})}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"country",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(ze,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"company_name",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Company Name"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter company name",...i})}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"tax_identity_number",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Tax Identity Number"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter tax identity number",...i})}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"corporate_type",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Corporate Type"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(ze,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select corporate type"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"llc",children:"LLC"}),l.jsx(re,{value:"corporation",children:"Corporation"}),l.jsx(re,{value:"partnership",children:"Partnership"}),l.jsx(re,{value:"sole-proprietorship",children:"Sole Proprietorship"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"date_of_establishment",render:({field:i})=>l.jsxs(Ue,{className:"flex flex-col",children:[l.jsx(He,{children:"Date of Establishment"}),l.jsxs(Rf,{children:[l.jsx(eh,{asChild:!0,children:l.jsx(ze,{children:l.jsxs(Be,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Ql,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx($i,{className:"w-auto p-0",align:"start",children:l.jsx(Gi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(Ye,{})]})}),l.jsx(Be,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},lC=Ds({full_name:et().min(2,"Full name must be at least 2 characters"),title:et().min(1,"Title is required"),birth:bu({required_error:"Birth date is required"}),phone_number:et().min(10,"Phone number must be at least 10 characters")}),cC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=ks({resolver:Ns(lC),defaultValues:{full_name:e.full_name,title:e.title,birth:e.birth||void 0,phone_number:e.phone_number}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Personal Details",subTitle:"Please provide your personal information",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Is,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(Ze,{control:o.control,name:"full_name",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Full Name"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter your full name",...i})}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"title",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Title"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"e.g., CEO, Director, Manager",...i})}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"birth",render:({field:i})=>l.jsxs(Ue,{className:"flex flex-col",children:[l.jsx(He,{children:"Date of Birth"}),l.jsxs(Rf,{children:[l.jsx(eh,{asChild:!0,children:l.jsx(ze,{children:l.jsxs(Be,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Ql,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx($i,{className:"w-auto p-0",align:"start",children:l.jsx(Gi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date||c<new Date("1900-01-01"),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(Ye,{})]})}),l.jsx(Ze,{control:o.control,name:"phone_number",render:({field:i})=>l.jsxs(Ue,{children:[l.jsx(He,{children:"Phone Number"}),l.jsx(ze,{children:l.jsx(wt,{placeholder:"Enter your phone number",...i})}),l.jsx(Ye,{})]})}),l.jsx(Be,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};var Xi="Progress",Ji=100,[dC,AC]=Rr(Xi),[uC,fC]=dC(Xi),mh=m.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=hC,...a}=e;(s||s===0)&&!bh(s)&&console.error(pC(`${s}`,"Progress"));const i=bh(s)?s:Ji;n!==null&&!wh(n,i)&&console.error(mC(`${n}`,"Progress"));const c=wh(n,i)?n:null,d=Jo(c)?o(c,i):void 0;return l.jsx(uC,{scope:r,value:c,max:i,children:l.jsx(we.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Jo(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":yh(c,i),"data-value":c??void 0,"data-max":i,...a,ref:t})})});mh.displayName=Xi;var vh="ProgressIndicator",gh=m.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=fC(vh,r);return l.jsx(we.div,{"data-state":yh(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});gh.displayName=vh;function hC(e,t){return`${Math.round(e/t*100)}%`}function yh(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Jo(e){return typeof e=="number"}function bh(e){return Jo(e)&&!isNaN(e)&&e>0}function wh(e,t){return Jo(e)&&!isNaN(e)&&e<=t&&e>=0}function pC(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ji}\`.`}function mC(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
143
143
  - a positive number
144
144
  - less than the value passed to \`max\` (or ${Ji} if no \`max\` prop is set)
145
145
  - \`null\` or \`undefined\` if the progress is indeterminate.
146
146
 
147
- Defaulting to \`null\`.`}var yh=fh,mC=ph;const bh=m.forwardRef(({className:e,value:t,...r},n)=>l.jsx(yh,{ref:n,className:he("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:l.jsx(mC,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));bh.displayName=yh.displayName;const vC=({apiEndpoint:e,apiKey:t,onComplete:r})=>{const[n,s]=S.useState("landing"),[o,a]=S.useState({full_name:"",title:"",birth:null,phone_number:""}),[i,c]=S.useState({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),[d,u]=S.useState({street:"",number:"",postal_code:"",city:"",address_country:""}),[h,v]=S.useState({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),[f,b]=S.useState({bank_statement:null,company_structure:null,certificate_of_registration:null}),p=["personal-details","business-information","business-address","company-activity","company-documents"],g=_d({mutationFn:gC}),{toast:x}=Qs(),y=()=>n==="landing"||n==="processing"?-1:p.indexOf(n),w=()=>{const P=y();return P===-1?0:(P+1)/p.length*100},k=async()=>{const P={personal_details:o,business_information:i,business_address:d,company_activity:h,company_documents:f},F=await g.mutateAsync({apiEndpoint:e,apiKey:t,data:P});r(F.data.token,P),x({title:"Business verification submitted!",description:"Your business verification request has been submitted successfully."}),a({full_name:"",title:"",birth:null,phone_number:""}),c({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),u({street:"",number:"",postal_code:"",city:"",address_country:""}),v({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),b({bank_statement:null,company_structure:null,certificate_of_registration:null}),s("landing")},N=()=>{const P=y();return P===-1?null:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[l.jsxs("span",{children:["Step ",P+1," of ",p.length]}),l.jsxs("span",{children:[Math.round(w()),"%"]})]}),l.jsx(bh,{value:w(),className:"h-2"})]})},M=()=>{switch(n){case"landing":return l.jsx(Cd,{title:"Business Verification",subtitle:"Complete your business verification to access all features",onContinue:()=>s("personal-details")});case"personal-details":return l.jsx(lC,{data:o,onDataChange:P=>a(F=>({...F,...P})),onContinue:()=>s("business-information"),onBack:()=>s("landing"),renderProgress:N});case"business-information":return l.jsx(aC,{data:i,onDataChange:P=>c(F=>({...F,...P})),onContinue:()=>s("business-address"),onBack:()=>s("personal-details"),renderProgress:N});case"business-address":return l.jsx(i0,{data:d,onDataChange:P=>u(F=>({...F,...P})),onContinue:()=>s("company-activity"),onBack:()=>s("business-information"),renderProgress:N});case"company-activity":return l.jsx(o0,{data:h,onDataChange:P=>v(F=>({...F,...P})),onContinue:()=>s("company-documents"),onBack:()=>s("business-address"),renderProgress:N});case"company-documents":return l.jsx(Ab,{data:f,onDataChange:P=>b(F=>({...F,...P})),onContinue:()=>s("processing"),onBack:()=>s("company-activity"),renderProgress:N});case"processing":return l.jsx(Nd,{onComplete:k});default:return null}};return l.jsx("div",{className:"w-[430px]",children:M()})};async function gC({apiEndpoint:e,apiKey:t,data:r}){const{company_documents:n,...s}=r,o=new FormData;o.append("payload",yC(s)),o.append("bank_statement",n.bank_statement,n.bank_statement.name),o.append("company_structure",n.company_structure,n.company_structure.name),o.append("certificate_of_registration",n.certificate_of_registration,n.certificate_of_registration.name);const a=await fetch(`${e}/api/kyb`,{method:"POST",headers:{"X-API-Key":t},body:o});if(!a.ok)throw new Error("Network response was not ok");return a.json()}function yC(e){return JSON.stringify(e,(t,r)=>r instanceof Date?r.toISOString():r)}const bC=new ry;return e=>l.jsx(iy,{client:bC,children:l.jsxs(Bg,{children:[l.jsx(_m,{}),l.jsx(ev,{}),e.isKYB?l.jsx(vC,{...e}):l.jsx(Ty,{...e})]})})});
147
+ Defaulting to \`null\`.`}var xh=mh,vC=gh;const _h=m.forwardRef(({className:e,value:t,...r},n)=>l.jsx(xh,{ref:n,className:he("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:l.jsx(vC,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));_h.displayName=xh.displayName;const gC=({apiEndpoint:e,apiKey:t,onComplete:r,onDoneClick:n})=>{const[s,o]=S.useState("landing"),[a,i]=S.useState({full_name:"",title:"",birth:null,phone_number:"",selfie_photo:null,id_photo:null,id_photo_back:null}),[c,d]=S.useState({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),[u,h]=S.useState({street:"",number:"",postal_code:"",city:"",address_country:""}),[v,f]=S.useState({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),[b,p]=S.useState({bank_statement:null,company_structure:null,certificate_of_registration:null}),g=["personal-details","id-front","id-front-confirm","id-back","id-back-confirm","selfie","selfie-confirm","pre-selfie","business-information","business-address","company-activity","company-documents"],x=Cd({mutationFn:yC}),{toast:y}=Xs(),w=()=>s==="landing"||s==="processing"?-1:g.indexOf(s),k=()=>{const F=w();return F===-1?0:(F+1)/g.length*100},N=F=>{i(P=>({...P,selfie_photo:F}))},O=F=>{i(P=>({...P,id_photo:F}))},A=F=>{i(P=>({...P,id_photo_back:F}))},V=async()=>{const F={personal_details:a,business_information:c,business_address:u,company_activity:v,company_documents:b},P=await x.mutateAsync({apiEndpoint:e,apiKey:t,data:F});r(P.data.token,F),y({title:"Business verification submitted!",description:"Your business verification request has been submitted successfully."}),i({full_name:"",title:"",birth:null,phone_number:"",selfie_photo:null,id_photo:null,id_photo_back:null}),d({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),h({street:"",number:"",postal_code:"",city:"",address_country:""}),f({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),p({bank_statement:null,company_structure:null,certificate_of_registration:null}),o("done")},L=()=>{const F=w();return F===-1?null:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[l.jsxs("span",{children:["Step ",F+1," of ",g.length]}),l.jsxs("span",{children:[Math.round(k()),"%"]})]}),l.jsx(_h,{value:k(),className:"h-2"})]})},U=()=>{switch(s){case"landing":return l.jsx(Sd,{title:"Business Verification",subtitle:"Complete your business verification to access all features",onContinue:()=>o("personal-details")});case"personal-details":return l.jsx(cC,{data:a,onDataChange:F=>i(P=>({...P,...F})),onContinue:()=>o("id-front"),onBack:()=>o("landing"),renderProgress:L});case"id-front":return l.jsx(Dn,{acceptedFile:a.id_photo,currentStep:s,setCurrentStep:F=>{o(F)},setSelfiePhoto:N,setIdCardFront:O,setIdCardBack:A});case"id-front-confirm":return a.id_photo?l.jsx(In,{photo:a.id_photo,onRetake:()=>{i(F=>({...F,id_photo:null})),o("id-front")},onConfirm:()=>o("id-back"),onBack:()=>o("id-front"),renderProgress:L}):null;case"id-back":return l.jsx(Dn,{acceptedFile:a.id_photo_back,currentStep:s,setCurrentStep:F=>{console.log("id-back setCurrentStep",F),o(F)},setSelfiePhoto:N,setIdCardFront:O,setIdCardBack:A});case"id-back-confirm":return a.id_photo_back?l.jsx(In,{photo:a.id_photo_back,onRetake:()=>{i(F=>({...F,id_photo_back:null})),o("id-back")},onConfirm:()=>o("pre-selfie"),onBack:()=>o("id-back"),renderProgress:L}):null;case"pre-selfie":return l.jsx(Ed,{onContinue:()=>o("selfie"),onBack:()=>o("id-back")});case"selfie":return l.jsx(Dn,{acceptedFile:a.selfie_photo,currentStep:s,setCurrentStep:F=>{o(F)},setSelfiePhoto:N,setIdCardFront:O,setIdCardBack:A});case"selfie-confirm":return a.selfie_photo?l.jsx(In,{photo:a.selfie_photo,onRetake:()=>{i(F=>({...F,selfie_photo:null})),o("selfie")},onConfirm:()=>o("business-information"),onBack:()=>o("selfie"),renderProgress:L}):null;case"business-information":return l.jsx(iC,{data:c,onDataChange:F=>d(P=>({...P,...F})),onContinue:()=>o("business-address"),onBack:()=>o("personal-details"),renderProgress:L});case"business-address":return l.jsx(l0,{data:u,onDataChange:F=>h(P=>({...P,...F})),onContinue:()=>o("company-activity"),onBack:()=>o("business-information"),renderProgress:L});case"company-activity":return l.jsx(a0,{data:v,onDataChange:F=>f(P=>({...P,...F})),onContinue:()=>o("company-documents"),onBack:()=>o("business-address"),renderProgress:L});case"company-documents":return l.jsx(Db,{data:b,onDataChange:F=>p(P=>({...P,...F})),onContinue:()=>o("processing"),onBack:()=>o("company-activity"),renderProgress:L});case"processing":return l.jsx(Pd,{onComplete:V});case"done":return l.jsx(Td,{onDoneClick:n});default:return null}};return l.jsx("div",{className:"w-[430px]",children:U()})};async function yC({apiEndpoint:e,apiKey:t,data:r}){const{company_documents:n,personal_details:s,...o}=r,a={...s};delete a.selfie_photo,delete a.id_photo,delete a.id_photo_back;const i=new FormData;i.append("payload",bC({...o,personal_details:a})),i.append("bank_statement",n.bank_statement,n.bank_statement.name),i.append("company_structure",n.company_structure,n.company_structure.name),i.append("certificate_of_registration",n.certificate_of_registration,n.certificate_of_registration.name),i.append("selfie_photo",s.selfie_photo,s.selfie_photo.name),i.append("id_photo",s.id_photo,s.id_photo.name),i.append("id_photo_back",s.id_photo_back,s.id_photo_back.name);const c=await fetch(`${e}/api/kyb`,{method:"POST",headers:{"X-API-Key":t},body:i});if(!c.ok)throw new Error("Network response was not ok");return c.json()}function bC(e){return JSON.stringify(e,(t,r)=>r instanceof Date?r.toISOString():r)}const wC=new sy;return e=>l.jsx(cy,{client:wC,children:l.jsxs(jg,{children:[l.jsx(Sm,{}),l.jsx(rv,{}),e.isKYB?l.jsx(gC,{...e}):l.jsx(Oy,{...e})]})})});