@techlabi/kycrazy-ui-kit 0.15.0 → 0.17.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,62 +1,147 @@
1
- (function(c,x){typeof exports=="object"&&typeof module<"u"?module.exports=x(require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","react-dom"],x):(c=typeof globalThis<"u"?globalThis:c||self,c.KycrazyUIKit=x(c.jsxRuntime,c.React,c.ReactDOM))})(this,function(c,x,re){"use strict";var Qs=c=>{throw TypeError(c)};var Sn=(c,x,re)=>x.has(c)||Qs("Cannot "+re);var v=(c,x,re)=>(Sn(c,x,"read from private field"),re?re.call(c):x.get(c)),B=(c,x,re)=>x.has(c)?Qs("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(c):x.set(c,re),I=(c,x,re,dt)=>(Sn(c,x,"write to private field"),dt?dt.call(c,re):x.set(c,re),re),Z=(c,x,re)=>(Sn(c,x,"access private method"),re);var Or=(c,x,re,dt)=>({set _(p){I(c,x,p,re)},get _(){return v(c,x,dt)}});var ht,Ye,kt,Ds,Ot,Re,Mt,Is,pt,Ls,Dt,It,me,mt,ne,Zt,gt,xe,He,Fs,Oe,_s,Me,le,yt,De,ct,$s,je,Ce,er,js,J,Xe,Je,Lt,Ft,Ze,_t,$t,zs,et,tt,de,ze,Be,Mr,Nn,Bs;function dt(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 p=dt(x),Dr=dt(re),Gs=1,Ys=1e6;let Ir=0;function Rs(){return Ir=(Ir+1)%Number.MAX_SAFE_INTEGER,Ir.toString()}const Lr=new Map,An=e=>{if(Lr.has(e))return;const t=setTimeout(()=>{Lr.delete(e),Wt({type:"REMOVE_TOAST",toastId:e})},Ys);Lr.set(e,t)},Xs=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Gs)};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?An(r):e.toasts.forEach(n=>{An(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)}}},nr=[];let or={toasts:[]};function Wt(e){or=Xs(or,e),nr.forEach(t=>{t(or)})}function Js({...e}){const t=Rs(),r=o=>Wt({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>Wt({type:"DISMISS_TOAST",toastId:t});return Wt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function Fr(){const[e,t]=p.useState(or);return p.useEffect(()=>(nr.push(t),()=>{const r=nr.indexOf(t);r>-1&&nr.splice(r,1)}),[e]),{...e,toast:Js,dismiss:r=>Wt({type:"DISMISS_TOAST",toastId:r})}}function te(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function kn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function On(...e){return t=>{let r=!1;const n=e.map(o=>{const s=kn(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():kn(e[o],null)}}}}function ye(...e){return p.useCallback(On(...e),e)}function sr(e,t=[]){let r=[];function n(s,i){const a=p.createContext(i),u=r.length;r=[...r,i];const l=h=>{var C;const{scope:y,children:d,...b}=h,m=((C=y==null?void 0:y[e])==null?void 0:C[u])||a,g=p.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:g,children:d})};l.displayName=s+"Provider";function f(h,y){var m;const d=((m=y==null?void 0:y[e])==null?void 0:m[u])||a,b=p.useContext(d);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=r.map(i=>p.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Zs(o,...t)]}function Zs(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:l})=>{const h=u(s)[`__scope${l}`];return{...a,...h}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function ir(e){const t=ti(e),r=p.forwardRef((n,o)=>{const{children:s,...i}=n,a=p.Children.toArray(s),u=a.find(ni);if(u){const l=u.props.children,f=a.map(h=>h===u?p.Children.count(l)>1?p.Children.only(null):p.isValidElement(l)?l.props.children:null:h);return c.jsx(t,{...i,ref:o,children:p.isValidElement(l)?p.cloneElement(l,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var ei=ir("Slot");function ti(e){const t=p.forwardRef((r,n)=>{const{children:o,...s}=r;if(p.isValidElement(o)){const i=si(o),a=oi(s,o.props);return o.type!==p.Fragment&&(a.ref=n?On(n,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mn=Symbol("radix.slottable");function ri(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Mn,t}function ni(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Mn}function oi(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function si(e){var n,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ii(e){const t=e+"CollectionProvider",[r,n]=sr(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:C}=m,E=x.useRef(null),T=x.useRef(new Map).current;return c.jsx(o,{scope:g,itemMap:T,collectionRef:E,children:C})};i.displayName=t;const a=e+"CollectionSlot",u=ir(a),l=x.forwardRef((m,g)=>{const{scope:C,children:E}=m,T=s(a,C),w=ye(g,T.collectionRef);return c.jsx(u,{ref:w,children:E})});l.displayName=a;const f=e+"CollectionItemSlot",h="data-radix-collection-item",y=ir(f),d=x.forwardRef((m,g)=>{const{scope:C,children:E,...T}=m,w=x.useRef(null),P=ye(g,w),S=s(f,C);return x.useEffect(()=>(S.itemMap.set(w,{ref:w,...T}),()=>void S.itemMap.delete(w))),c.jsx(y,{[h]:"",ref:P,children:E})});d.displayName=f;function b(m){const g=s(e+"CollectionConsumer",m);return x.useCallback(()=>{const E=g.collectionRef.current;if(!E)return[];const T=Array.from(E.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((S,N)=>T.indexOf(S.ref.current)-T.indexOf(N.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:l,ItemSlot:d},b,n]}var ai=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ae=ai.reduce((e,t)=>{const r=ir(`Primitive.${t}`),n=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Dn(e,t){e&&Dr.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function li(e,t=globalThis==null?void 0:globalThis.document){const r=Ve(e);p.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ci="DismissableLayer",_r="dismissableLayer.update",di="dismissableLayer.pointerDownOutside",ui="dismissableLayer.focusOutside",In,Ln=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$r=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,l=p.useContext(Ln),[f,h]=p.useState(null),y=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=p.useState({}),b=ye(t,N=>h(N)),m=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),C=m.indexOf(g),E=f?m.indexOf(f):-1,T=l.layersWithOutsidePointerEventsDisabled.size>0,w=E>=C,P=hi(N=>{const L=N.target,M=[...l.branches].some(_=>_.contains(L));!w||M||(o==null||o(N),i==null||i(N),N.defaultPrevented||a==null||a())},y),S=pi(N=>{const L=N.target;[...l.branches].some(_=>_.contains(L))||(s==null||s(N),i==null||i(N),N.defaultPrevented||a==null||a())},y);return li(N=>{E===l.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},y),p.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(In=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),_n(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=In)}},[f,y,r,l]),p.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),_n())},[f,l]),p.useEffect(()=>{const N=()=>d({});return document.addEventListener(_r,N),()=>document.removeEventListener(_r,N)},[]),c.jsx(ae.div,{...u,ref:b,style:{pointerEvents:T?w?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,S.onFocusCapture),onBlurCapture:te(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,P.onPointerDownCapture)})});$r.displayName=ci;var fi="DismissableLayerBranch",Fn=p.forwardRef((e,t)=>{const r=p.useContext(Ln),n=p.useRef(null),o=ye(t,n);return p.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),c.jsx(ae.div,{...e,ref:o})});Fn.displayName=fi;function hi(e,t=globalThis==null?void 0:globalThis.document){const r=Ve(e),n=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let u=function(){$n(di,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function pi(e,t=globalThis==null?void 0:globalThis.document){const r=Ve(e),n=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!n.current&&$n(ui,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function _n(){const e=new CustomEvent(_r);document.dispatchEvent(e)}function $n(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Dn(o,s):o.dispatchEvent(s)}var mi=$r,gi=Fn,Ue=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},yi="Portal",jn=p.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,s]=p.useState(!1);Ue(()=>s(!0),[]);const i=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?re.createPortal(c.jsx(ae.div,{...n,ref:t}),i):null});jn.displayName=yi;function vi(e,t){return p.useReducer((r,n)=>t[r][n]??r,e)}var jr=e=>{const{present:t,children:r}=e,n=bi(t),o=typeof r=="function"?r({present:n.isPresent}):p.Children.only(r),s=ye(n.ref,wi(o));return typeof r=="function"||n.isPresent?p.cloneElement(o,{ref:s}):null};jr.displayName="Presence";function bi(e){const[t,r]=p.useState(),n=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[a,u]=vi(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const l=ar(n.current);s.current=a==="mounted"?l:"none"},[a]),Ue(()=>{const l=n.current,f=o.current;if(f!==e){const y=s.current,d=ar(l);e?u("MOUNT"):d==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(f&&y!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Ue(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,h=d=>{const m=ar(n.current).includes(d.animationName);if(d.target===t&&m&&(u("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},y=d=>{d.target===t&&(s.current=ar(n.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(l=>{n.current=l?getComputedStyle(l):null,r(l)},[])}}function ar(e){return(e==null?void 0:e.animationName)||"none"}function wi(e){var n,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var xi=p[" useInsertionEffect ".trim().toString()]||Ue;function Ci({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Ei({defaultProp:t,onChange:r}),a=e!==void 0,u=a?e:o;{const f=p.useRef(e!==void 0);p.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${a?"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.`),f.current=a},[a,n])}const l=p.useCallback(f=>{var h;if(a){const y=Ti(f)?f(e):f;y!==e&&((h=i.current)==null||h.call(i,y))}else s(f)},[a,e,s,i]);return[u,l]}function Ei({defaultProp:e,onChange:t}){const[r,n]=p.useState(e),o=p.useRef(r),s=p.useRef(t);return xi(()=>{s.current=t},[t]),p.useEffect(()=>{var i;o.current!==r&&((i=s.current)==null||i.call(s,r),o.current=r)},[r,o]),[r,n,s]}function Ti(e){return typeof e=="function"}var Pi=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"}),Si="VisuallyHidden",lr=p.forwardRef((e,t)=>c.jsx(ae.span,{...e,ref:t,style:{...Pi,...e.style}}));lr.displayName=Si;var Ni=lr,zr="ToastProvider",[Br,Ai,ki]=ii("Toast"),[zn,Jd]=sr("Toast",[ki]),[Oi,cr]=zn(zr),Bn=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,u]=p.useState(null),[l,f]=p.useState(0),h=p.useRef(!1),y=p.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${zr}\`. Expected non-empty \`string\`.`),c.jsx(Br.Provider,{scope:t,children:c.jsx(Oi,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:s,toastCount:l,viewport:a,onViewportChange:u,onToastAdd:p.useCallback(()=>f(d=>d+1),[]),onToastRemove:p.useCallback(()=>f(d=>d-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:y,children:i})})};Bn.displayName=zr;var Hn="ToastViewport",Mi=["F8"],Hr="toast.viewportPause",Vr="toast.viewportResume",Vn=p.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=Mi,label:o="Notifications ({hotkey})",...s}=e,i=cr(Hn,r),a=Ai(r),u=p.useRef(null),l=p.useRef(null),f=p.useRef(null),h=p.useRef(null),y=ye(t,h,i.onViewportChange),d=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=i.toastCount>0;p.useEffect(()=>{const g=C=>{var T;n.length!==0&&n.every(w=>C[w]||C.code===w)&&((T=h.current)==null||T.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),p.useEffect(()=>{const g=u.current,C=h.current;if(b&&g&&C){const E=()=>{if(!i.isClosePausedRef.current){const S=new CustomEvent(Hr);C.dispatchEvent(S),i.isClosePausedRef.current=!0}},T=()=>{if(i.isClosePausedRef.current){const S=new CustomEvent(Vr);C.dispatchEvent(S),i.isClosePausedRef.current=!1}},w=S=>{!g.contains(S.relatedTarget)&&T()},P=()=>{g.contains(document.activeElement)||T()};return g.addEventListener("focusin",E),g.addEventListener("focusout",w),g.addEventListener("pointermove",E),g.addEventListener("pointerleave",P),window.addEventListener("blur",E),window.addEventListener("focus",T),()=>{g.removeEventListener("focusin",E),g.removeEventListener("focusout",w),g.removeEventListener("pointermove",E),g.removeEventListener("pointerleave",P),window.removeEventListener("blur",E),window.removeEventListener("focus",T)}}},[b,i.isClosePausedRef]);const m=p.useCallback(({tabbingDirection:g})=>{const E=a().map(T=>{const w=T.ref.current,P=[w,...Wi(w)];return g==="forwards"?P:P.reverse()});return(g==="forwards"?E.reverse():E).flat()},[a]);return p.useEffect(()=>{const g=h.current;if(g){const C=E=>{var P,S,N;const T=E.altKey||E.ctrlKey||E.metaKey;if(E.key==="Tab"&&!T){const L=document.activeElement,M=E.shiftKey;if(E.target===g&&M){(P=l.current)==null||P.focus();return}const O=m({tabbingDirection:M?"backwards":"forwards"}),W=O.findIndex(A=>A===L);qr(O.slice(W+1))?E.preventDefault():M?(S=l.current)==null||S.focus():(N=f.current)==null||N.focus()}};return g.addEventListener("keydown",C),()=>g.removeEventListener("keydown",C)}},[a,m]),c.jsxs(gi,{ref:u,role:"region","aria-label":o.replace("{hotkey}",d),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&c.jsx(Ur,{ref:l,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});qr(g)}}),c.jsx(Br.Slot,{scope:r,children:c.jsx(ae.ol,{tabIndex:-1,...s,ref:y})}),b&&c.jsx(Ur,{ref:f,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});qr(g)}})]})});Vn.displayName=Hn;var Un="ToastFocusProxy",Ur=p.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,s=cr(Un,r);return c.jsx(lr,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var l;const a=i.relatedTarget;!((l=s.viewport)!=null&&l.contains(a))&&n()}})});Ur.displayName=Un;var qt="Toast",Di="toast.swipeStart",Ii="toast.swipeMove",Li="toast.swipeCancel",Fi="toast.swipeEnd",Wn=p.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:o,onOpenChange:s,...i}=e,[a,u]=Ci({prop:n,defaultProp:o??!0,onChange:s,caller:qt});return c.jsx(jr,{present:r||a,children:c.jsx(ji,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Ve(e.onPause),onResume:Ve(e.onResume),onSwipeStart:te(e.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:te(e.onSwipeMove,l=>{const{x:f,y:h}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:te(e.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:te(e.onSwipeEnd,l=>{const{x:f,y:h}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),u(!1)})})})});Wn.displayName=qt;var[_i,$i]=zn(qt,{onClose(){}}),ji=p.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:u,onResume:l,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:y,onSwipeEnd:d,...b}=e,m=cr(qt,r),[g,C]=p.useState(null),E=ye(t,A=>C(A)),T=p.useRef(null),w=p.useRef(null),P=o||m.duration,S=p.useRef(0),N=p.useRef(P),L=p.useRef(0),{onToastAdd:M,onToastRemove:_}=m,H=Ve(()=>{var V;(g==null?void 0:g.contains(document.activeElement))&&((V=m.viewport)==null||V.focus()),i()}),O=p.useCallback(A=>{!A||A===1/0||(window.clearTimeout(L.current),S.current=new Date().getTime(),L.current=window.setTimeout(H,A))},[H]);p.useEffect(()=>{const A=m.viewport;if(A){const V=()=>{O(N.current),l==null||l()},j=()=>{const z=new Date().getTime()-S.current;N.current=N.current-z,window.clearTimeout(L.current),u==null||u()};return A.addEventListener(Hr,j),A.addEventListener(Vr,V),()=>{A.removeEventListener(Hr,j),A.removeEventListener(Vr,V)}}},[m.viewport,P,u,l,O]),p.useEffect(()=>{s&&!m.isClosePausedRef.current&&O(P)},[s,P,m.isClosePausedRef,O]),p.useEffect(()=>(M(),()=>_()),[M,_]);const W=p.useMemo(()=>g?Xn(g):null,[g]);return m.viewport?c.jsxs(c.Fragment,{children:[W&&c.jsx(zi,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:W}),c.jsx(_i,{scope:r,onClose:H,children:Dr.createPortal(c.jsx(Br.ItemSlot,{scope:r,children:c.jsx(mi,{asChild:!0,onEscapeKeyDown:te(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||H(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(ae.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...b,ref:E,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:te(e.onKeyDown,A=>{A.key==="Escape"&&(a==null||a(A.nativeEvent),A.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:te(e.onPointerDown,A=>{A.button===0&&(T.current={x:A.clientX,y:A.clientY})}),onPointerMove:te(e.onPointerMove,A=>{if(!T.current)return;const V=A.clientX-T.current.x,j=A.clientY-T.current.y,z=!!w.current,D=["left","right"].includes(m.swipeDirection),k=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,K=D?k(0,V):0,ee=D?0:k(0,j),U=A.pointerType==="touch"?10:2,q={x:K,y:ee},Q={originalEvent:A,delta:q};z?(w.current=q,dr(Ii,h,Q,{discrete:!1})):Jn(q,m.swipeDirection,U)?(w.current=q,dr(Di,f,Q,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(V)>U||Math.abs(j)>U)&&(T.current=null)}),onPointerUp:te(e.onPointerUp,A=>{const V=w.current,j=A.target;if(j.hasPointerCapture(A.pointerId)&&j.releasePointerCapture(A.pointerId),w.current=null,T.current=null,V){const z=A.currentTarget,D={originalEvent:A,delta:V};Jn(V,m.swipeDirection,m.swipeThreshold)?dr(Fi,d,D,{discrete:!0}):dr(Li,y,D,{discrete:!0}),z.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),zi=e=>{const{__scopeToast:t,children:r,...n}=e,o=cr(qt,t),[s,i]=p.useState(!1),[a,u]=p.useState(!1);return Vi(()=>i(!0)),p.useEffect(()=>{const l=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:c.jsx(jn,{asChild:!0,children:c.jsx(lr,{...n,children:s&&c.jsxs(c.Fragment,{children:[o.label," ",r]})})})},Bi="ToastTitle",qn=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(ae.div,{...n,ref:t})});qn.displayName=Bi;var Hi="ToastDescription",Kn=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(ae.div,{...n,ref:t})});Kn.displayName=Hi;var Qn="ToastAction",Gn=p.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?c.jsx(Rn,{altText:r,asChild:!0,children:c.jsx(Wr,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Qn}\`. Expected non-empty \`string\`.`),null)});Gn.displayName=Qn;var Yn="ToastClose",Wr=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,o=$i(Yn,r);return c.jsx(Rn,{asChild:!0,children:c.jsx(ae.button,{type:"button",...n,ref:t,onClick:te(e.onClick,o.onClose)})})});Wr.displayName=Yn;var Rn=p.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return c.jsx(ae.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function Xn(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Ui(n)){const o=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Xn(n))}}),t}function dr(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Dn(o,s):o.dispatchEvent(s)}var Jn=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),s=n>o;return t==="left"||t==="right"?s&&n>r:!s&&o>r};function Vi(e=()=>{}){const t=Ve(e);Ue(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Ui(e){return e.nodeType===e.ELEMENT_NODE}function Wi(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function qr(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var qi=Bn,Zn=Vn,eo=Wn,to=qn,ro=Kn,no=Gn,oo=Wr;function so(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=so(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function io(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=so(e))&&(n&&(n+=" "),n+=t);return n}const ao=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lo=io,Kr=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return lo(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const f=r==null?void 0:r[l],h=s==null?void 0:s[l];if(f===null)return null;const y=ao(f)||ao(h);return o[l][y]}),a=r&&Object.entries(r).reduce((l,f)=>{let[h,y]=f;return y===void 0||(l[h]=y),l},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((l,f)=>{let{class:h,className:y,...d}=f;return Object.entries(d).every(b=>{let[m,g]=b;return Array.isArray(g)?g.includes({...s,...a}[m]):{...s,...a}[m]===g})?[...l,h,y]:l},[]);return lo(e,i,u,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 Ah=l=>{throw TypeError(l)};var tl=(l,S,Ge)=>S.has(l)||Ah("Cannot "+Ge);var C=(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,Gr)=>(tl(l,S,"write to private field"),Gr?Gr.call(l,Ge):S.set(l,Ge),Ge),ce=(l,S,Ge)=>(tl(l,S,"access private method"),Ge);var Ro=(l,S,Ge,Gr)=>({set _(m){K(l,S,m,Ge)},get _(){return C(l,S,Gr)}});var un,Vr,Zn,wh,Kn,$r,Qn,xh,fn,Ch,Gn,Xn,Nt,hn,Xe,Us,pn,Lt,br,_h,Gt,Sh,Xt,at,mn,Jt,Qr,kh,ur,Vt,Hs,Nh,$e,Br,Wr,Jn,Rn,jr,es,ts,Eh,mt,ge,zs,it,vn,rs,fr,Ur,qs,ns,ss,gn,yn,Hr,os,Ne,Ys,rl,nl,sl,ol,al,il,ll,Dh,Ph,zr,qr,vt,hr,pr,ea,cl,Th;function Gr(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=Gr(S),is=Gr(Ge),Ih=1,Fh=1e6;let ta=0;function Lh(){return ta=(ta+1)%Number.MAX_SAFE_INTEGER,ta.toString()}const ra=new Map,dl=e=>{if(ra.has(e))return;const t=setTimeout(()=>{ra.delete(e),ls({type:"REMOVE_TOAST",toastId:e})},Fh);ra.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 Xr(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 xn(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=xn("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]=Xr(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=xn(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=xn(u),f=S.forwardRef((p,g)=>{const{scope:x,children:y,...w}=p,k=S.useRef(null),E=Ie(g,k),P=o(u,x);return S.useEffect(()=>(P.itemMap.set(k,{ref:k,...w}),()=>void P.itemMap.delete(k))),l.jsx(v,{[h]:"",ref:E,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((P,T)=>w.indexOf(P.ref.current)-w.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:d,ItemSlot:f},b,n]}var qh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=qh.reduce((e,t)=>{const r=xn(`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 Yh(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",na="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,T=>h(T)),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,E=Xh(T=>{const B=T.target,$=[...d.branches].some(z=>z.contains(B));!k||$||(s==null||s(T),a==null||a(T),T.defaultPrevented||i==null||i())},v),P=Jh(T=>{const B=T.target;[...d.branches].some(z=>z.contains(B))||(o==null||o(T),a==null||a(T),T.defaultPrevented||i==null||i())},v);return Yh(T=>{y===d.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&i&&(T.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 T=()=>f({});return document.addEventListener(na,T),()=>document.removeEventListener(na,T)},[]),l.jsx(we.div,{...c,ref:b,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,E.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(na);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 Cl=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:{...Cl,...e.style}}));Rs.displayName=lp;var cp=Rs,sa="ToastProvider",[oa,dp,up]=ml("Toast"),[_l,C_]=Xr("Toast",[up]),[fp,eo]=_l(sa),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 \`${sa}\`. Expected non-empty \`string\`.`),l.jsx(oa.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=sa;var kl="ToastViewport",hp=["F8"],aa="toast.viewportPause",ia="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 P=new CustomEvent(aa);x.dispatchEvent(P),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const P=new CustomEvent(ia);x.dispatchEvent(P),a.isClosePausedRef.current=!1}},k=P=>{!g.contains(P.relatedTarget)&&w()},E=()=>{g.contains(document.activeElement)||w()};return g.addEventListener("focusin",y),g.addEventListener("focusout",k),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",k),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",E),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,E=[k,...Np(k)];return g==="forwards"?E:E.reverse()});return(g==="forwards"?y.reverse():y).flat()},[i]);return m.useEffect(()=>{const g=h.current;if(g){const x=y=>{var E,P,T;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const B=document.activeElement,$=y.shiftKey;if(y.target===g&&$){(E=d.current)==null||E.focus();return}const A=p({tabbingDirection:$?"backwards":"forwards"}),j=A.findIndex(I=>I===B);da(A.slice(j+1))?y.preventDefault():$?(P=d.current)==null||P.focus():(T=u.current)==null||T.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(la,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});da(g)}}),l.jsx(oa.Slot,{scope:r,children:l.jsx(we.ol,{tabIndex:-1,...o,ref:v})}),b&&l.jsx(la,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});da(g)}})]})});Nl.displayName=kl;var El="ToastFocusProxy",la=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()}})});la.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]=_l(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),E=s||p.duration,P=m.useRef(0),T=m.useRef(E),B=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(B.current),P.current=new Date().getTime(),B.current=window.setTimeout(X,I))},[X]);m.useEffect(()=>{const I=p.viewport;if(I){const J=()=>{A(T.current),d==null||d()},q=()=>{const D=new Date().getTime()-P.current;T.current=T.current-D,window.clearTimeout(B.current),c==null||c()};return I.addEventListener(aa,q),I.addEventListener(ia,J),()=>{I.removeEventListener(aa,q),I.removeEventListener(ia,J)}}},[p.viewport,E,c,d,A]),m.useEffect(()=>{o&&!p.isClosePausedRef.current&&A(E)},[o,E,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(oa.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,q=I.clientY-w.current.y,D=!!k.current,M=["left","right"].includes(p.swipeDirection),V=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ae=M?V(0,J):0,Se=M?0:V(0,q),de=I.pointerType==="touch"?10:2,ue={x:ae,y:Se},he={originalEvent:I,delta:ue};D?(k.current=ue,to(mp,h,he,{discrete:!1})):Ll(ue,p.swipeDirection,de)?(k.current=ue,to(pp,u,he,{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)?to(gp,f,M,{discrete:!0}):to(vp,v,M,{discrete:!0}),D.addEventListener("click",V=>V.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]})})})},Cp="ToastTitle",Tl=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Tl.displayName=Cp;var _p="ToastDescription",Ol=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Ol.displayName=_p;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(ca,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ml}\`. Expected non-empty \`string\`.`),null)});Al.displayName=Ml;var Dl="ToastClose",ca=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)})})});ca.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 da(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=ca;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 ql=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yl=zl,ua=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Yl(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=ql(u)||ql(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 Yl(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 Ki=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),co=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
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();/**
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 Qi={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 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"};/**
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 Gi=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...a},u)=>x.createElement("svg",{ref:u,...Qi,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:co("lucide",o),...a},[...i.map(([l,f])=>x.createElement(l,f)),...Array.isArray(s)?s:[s]]));/**
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]]));/**
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 We=(e,t)=>{const r=x.forwardRef(({className:n,...o},s)=>x.createElement(Gi,{ref:s,iconNode:t,className:co(`lucide-${Ki(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
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};/**
22
22
  * @license lucide-react v0.462.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const uo=We("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
26
+ */const Kl=tt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
27
27
  * @license lucide-react v0.462.0 - ISC
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 Yi=We("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 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"}]]);/**
32
32
  * @license lucide-react v0.462.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */const Ri=We("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"}]]);/**
36
+ */const Ql=tt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
37
37
  * @license lucide-react v0.462.0 - ISC
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 fo=We("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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"}]]);/**
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 Xi=We("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"}]]);/**
46
+ */const Dp=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 Ji=We("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"}]]);/**
51
+ */const Gl=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 Zi=We("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"}]]);/**
56
+ */const Ip=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 ea=We("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qr="-",ta=e=>{const t=na(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split(Qr);return a[0]===""&&a.length!==1&&a.shift(),ho(a,t)||ra(i)},getConflictingClassGroupIds:(i,a)=>{const u=r[i]||[];return a&&n[i]?[...u,...n[i]]:u}}},ho=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?ho(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Qr);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},po=/^\[(.+)\]$/,ra=e=>{if(po.test(e)){const t=po.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},na=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return sa(Object.entries(e.classGroups),r).forEach(([s,i])=>{Gr(i,n,s,t)}),n},Gr=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:mo(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(oa(o)){Gr(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,i])=>{Gr(i,mo(t,s),r,n)})})},mo=(e,t)=>{let r=e;return t.split(Qr).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},oa=e=>e.isThemeGetter,sa=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[r,o]}):e,ia=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,i)=>{r.set(s,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let i=r.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return o(s,i),i},set(s,i){r.has(s)?r.set(s,i):o(s,i)}}},go="!",aa=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let l=0,f=0,h;for(let g=0;g<a.length;g++){let C=a[g];if(l===0){if(C===o&&(n||a.slice(g,g+s)===t)){u.push(a.slice(f,g)),f=g+s;continue}if(C==="/"){h=g;continue}}C==="["?l++:C==="]"&&l--}const y=u.length===0?a:a.substring(f),d=y.startsWith(go),b=d?y.substring(1):y,m=h&&h>f?h-f:void 0;return{modifiers:u,hasImportantModifier:d,baseClassName:b,maybePostfixModifierPosition:m}};return r?a=>r({className:a,parseClassName:i}):i},la=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},ca=e=>({cache:ia(e.cacheSize),parseClassName:aa(e),...ta(e)}),da=/\s+/,ua=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(da);let a="";for(let u=i.length-1;u>=0;u-=1){const l=i[u],{modifiers:f,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:d}=r(l);let b=!!d,m=n(b?y.substring(0,d):y);if(!m){if(!b){a=l+(a.length>0?" "+a:a);continue}if(m=n(y),!m){a=l+(a.length>0?" "+a:a);continue}b=!1}const g=la(f).join(":"),C=h?g+go:g,E=C+m;if(s.includes(E))continue;s.push(E);const T=o(m,b);for(let w=0;w<T.length;++w){const P=T[w];s.push(C+P)}a=l+(a.length>0?" "+a:a)}return a};function fa(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=yo(t))&&(n&&(n+=" "),n+=r);return n}const yo=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=yo(e[n]))&&(r&&(r+=" "),r+=t);return r};function ha(e,...t){let r,n,o,s=i;function i(u){const l=t.reduce((f,h)=>h(f),e());return r=ca(l),n=r.cache.get,o=r.cache.set,s=a,a(u)}function a(u){const l=n(u);if(l)return l;const f=ua(u,r);return o(u,f),f}return function(){return s(fa.apply(null,arguments))}}const Y=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},vo=/^\[(?:([a-z-]+):)?(.+)\]$/i,pa=/^\d+\/\d+$/,ma=new Set(["px","full","screen"]),ga=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ya=/\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$/,va=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ba=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wa=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ie=e=>xt(e)||ma.has(e)||pa.test(e),qe=e=>Ct(e,"length",Aa),xt=e=>!!e&&!Number.isNaN(Number(e)),Yr=e=>Ct(e,"number",xt),Kt=e=>!!e&&Number.isInteger(Number(e)),xa=e=>e.endsWith("%")&&xt(e.slice(0,-1)),$=e=>vo.test(e),Ke=e=>ga.test(e),Ca=new Set(["length","size","percentage"]),Ea=e=>Ct(e,Ca,bo),Ta=e=>Ct(e,"position",bo),Pa=new Set(["image","url"]),Sa=e=>Ct(e,Pa,Oa),Na=e=>Ct(e,"",ka),Qt=()=>!0,Ct=(e,t,r)=>{const n=vo.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Aa=e=>ya.test(e)&&!va.test(e),bo=()=>!1,ka=e=>ba.test(e),Oa=e=>wa.test(e),Ma=ha(()=>{const e=Y("colors"),t=Y("spacing"),r=Y("blur"),n=Y("brightness"),o=Y("borderColor"),s=Y("borderRadius"),i=Y("borderSpacing"),a=Y("borderWidth"),u=Y("contrast"),l=Y("grayscale"),f=Y("hueRotate"),h=Y("invert"),y=Y("gap"),d=Y("gradientColorStops"),b=Y("gradientColorStopPositions"),m=Y("inset"),g=Y("margin"),C=Y("opacity"),E=Y("padding"),T=Y("saturate"),w=Y("scale"),P=Y("sepia"),S=Y("skew"),N=Y("space"),L=Y("translate"),M=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",$,t],O=()=>[$,t],W=()=>["",Ie,qe],A=()=>["auto",xt,$],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",$],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[xt,$];return{cacheSize:500,separator:":",theme:{colors:[Qt],spacing:[Ie,qe],blur:["none","",Ke,$],brightness:ee(),borderColor:[e],borderRadius:["none","","full",Ke,$],borderSpacing:O(),borderWidth:W(),contrast:ee(),grayscale:k(),hueRotate:ee(),invert:k(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[xa,qe],inset:H(),margin:H(),opacity:ee(),padding:O(),saturate:ee(),scale:ee(),sepia:k(),skew:ee(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",$]}],container:["container"],columns:[{columns:[Ke]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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:[...V(),$]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kt,$]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Kt,$]}],"grid-cols":[{"grid-cols":[Qt]}],"col-start-end":[{col:["auto",{span:["full",Kt,$]},$]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Qt]}],"row-start-end":[{row:["auto",{span:[Kt,$]},$]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],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":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$,t]}],"min-w":[{"min-w":[$,t,"min","max","fit"]}],"max-w":[{"max-w":[$,t,"none","full","min","max","fit","prose",{screen:[Ke]},Ke]}],h:[{h:[$,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ke,qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yr]}],"font-family":[{font:[Qt]}],"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",$]}],"line-clamp":[{"line-clamp":["none",xt,Yr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ie,$]}],"list-image":[{"list-image":["none",$]}],"list-style-type":[{list:["none","disc","decimal",$]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ie,qe]}],"underline-offset":[{"underline-offset":["auto",Ie,$]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$]}],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",$]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Ta]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ea]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sa]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[Ie,$]}],"outline-w":[{outline:[Ie,qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[Ie,qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ke,Na]}],"shadow-color":[{shadow:[Qt]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ke,$]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[T]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$]}],duration:[{duration:ee()}],ease:[{ease:["linear","in","out","in-out",$]}],delay:[{delay:ee()}],animate:[{animate:["none","spin","ping","pulse","bounce",$]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Kt,$]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$]}],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",$]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",$]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ie,qe,Yr]}],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 se(...e){return Ma(io(e))}const Da=qi,wo=p.forwardRef(({className:e,...t},r)=>c.jsx(Zn,{ref:r,className:se("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}));wo.displayName=Zn.displayName;const Ia=Kr("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"}}),xo=p.forwardRef(({className:e,variant:t,...r},n)=>c.jsx(eo,{ref:n,className:se(Ia({variant:t}),e),...r}));xo.displayName=eo.displayName;const La=p.forwardRef(({className:e,...t},r)=>c.jsx(no,{ref:r,className:se("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}));La.displayName=no.displayName;const Co=p.forwardRef(({className:e,...t},r)=>c.jsx(oo,{ref:r,className:se("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:c.jsx(ea,{className:"h-4 w-4"})}));Co.displayName=oo.displayName;const Eo=p.forwardRef(({className:e,...t},r)=>c.jsx(to,{ref:r,className:se("text-sm font-semibold",e),...t}));Eo.displayName=to.displayName;const To=p.forwardRef(({className:e,...t},r)=>c.jsx(ro,{ref:r,className:se("text-sm opacity-90",e),...t}));To.displayName=ro.displayName;function Fa(){const{toasts:e}=Fr();return c.jsxs(Da,{children:[e.map(function({id:t,title:r,description:n,action:o,...s}){return c.jsxs(xo,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[r&&c.jsx(Eo,{children:r}),n&&c.jsx(To,{children:n})]}),o,c.jsx(Co,{})]},t)}),c.jsx(wo,{})]})}var Po=["light","dark"],_a="(prefers-color-scheme: dark)",$a=p.createContext(void 0),ja={setTheme:e=>{},themes:[]},za=()=>{var e;return(e=p.useContext($a))!=null?e:ja};p.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:o,defaultTheme:s,value:i,attrs:a,nonce:u})=>{let l=s==="system",f=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=o?Po.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",y=(b,m=!1,g=!0)=>{let C=i?i[b]:b,E=m?b+"|| ''":`'${C}'`,T="";return o&&g&&!m&&Po.includes(b)&&(T+=`d.style.colorScheme = '${b}';`),r==="class"?m||C?T+=`c.add(${E})`:T+="null":C&&(T+=`d[s](n,${E})`),T},d=e?`!function(){${f}${y(e)}}()`:n?`!function(){try{${f}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${_a}',m=window.matchMedia(t);if(m.media!==t||m.matches){${y("dark")}}else{${y("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${y(i?"x[e]":"e",!0)}}${l?"":"else{"+y(s,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${f}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${y(i?"x[e]":"e",!0)}}else{${y(s,!1,!1)};}${h}}catch(t){}}();`;return p.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:d}})});var Ba=e=>{switch(e){case"success":return Ua;case"info":return qa;case"warning":return Wa;case"error":return Ka;default:return null}},Ha=Array(12).fill(0),Va=({visible:e,className:t})=>x.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},x.createElement("div",{className:"sonner-spinner"},Ha.map((r,n)=>x.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Ua=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.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"})),Wa=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},x.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"})),qa=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.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"})),Ka=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.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"})),Qa=x.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"},x.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),x.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ga=()=>{let[e,t]=x.useState(document.hidden);return x.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Rr=1,Ya=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,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Rr++,s=this.toasts.find(a=>a.id===o),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:r}),{...a,...e,id:o,dismissible:i,title:r}):a):this.addToast({title:r,...n,dismissible:i,id:o}),o},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(),o=r!==void 0,s,i=n.then(async u=>{if(s=["resolve",u],x.isValidElement(u))o=!1,this.create({id:r,type:"default",message:u});else if(Xa(u)&&!u.ok){o=!1;let l=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:r,type:"error",message:l,description:f})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?await t.success(u):t.success,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:r,type:"success",message:l,description:f})}}).catch(async u=>{if(s=["reject",u],t.error!==void 0){o=!1;let l=typeof t.error=="function"?await t.error(u):t.error,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:r,type:"error",message:l,description:f})}}).finally(()=>{var u;o&&(this.dismiss(r),r=void 0),(u=t.finally)==null||u.call(t)}),a=()=>new Promise((u,l)=>i.then(()=>s[0]==="reject"?l(s[1]):u(s[1])).catch(l));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Rr++;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}},ce=new Ya,Ra=(e,t)=>{let r=(t==null?void 0:t.id)||Rr++;return ce.addToast({title:e,...t,id:r}),r},Xa=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Ja=Ra,Za=()=>ce.toasts,el=()=>ce.getActiveToasts();Object.assign(Ja,{success:ce.success,info:ce.info,warning:ce.warning,error:ce.error,custom:ce.custom,message:ce.message,promise:ce.promise,dismiss:ce.dismiss,loading:ce.loading},{getHistory:Za,getToasts:el});function tl(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))}tl(`: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%)}
62
- `);function ur(e){return e.label!==void 0}var rl=3,nl="32px",ol="16px",So=4e3,sl=356,il=14,al=20,ll=200;function ve(...e){return e.filter(Boolean).join(" ")}function cl(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var dl=e=>{var t,r,n,o,s,i,a,u,l,f,h;let{invert:y,toast:d,unstyled:b,interacting:m,setHeights:g,visibleToasts:C,heights:E,index:T,toasts:w,expanded:P,removeToast:S,defaultRichColors:N,closeButton:L,style:M,cancelButtonStyle:_,actionButtonStyle:H,className:O="",descriptionClassName:W="",duration:A,position:V,gap:j,loadingIcon:z,expandByDefault:D,classNames:k,icons:K,closeButtonAriaLabel:ee="Close toast",pauseWhenPageIsHidden:U}=e,[q,Q]=x.useState(null),[ie,rt]=x.useState(null),[R,jt]=x.useState(!1),[nt,vt]=x.useState(!1),[ot,zt]=x.useState(!1),[st,Nr]=x.useState(!1),[Cn,Ar]=x.useState(!1),[En,tr]=x.useState(0),[Bt,Hs]=x.useState(0),rr=x.useRef(d.duration||A||So),Vs=x.useRef(null),bt=x.useRef(null),Ud=T===0,Wd=T+1<=C,ge=d.type,Ht=d.dismissible!==!1,qd=d.className||"",Kd=d.descriptionClassName||"",kr=x.useMemo(()=>E.findIndex(F=>F.toastId===d.id)||0,[E,d.id]),Qd=x.useMemo(()=>{var F;return(F=d.closeButton)!=null?F:L},[d.closeButton,L]),Us=x.useMemo(()=>d.duration||A||So,[d.duration,A]),Tn=x.useRef(0),Vt=x.useRef(0),Ws=x.useRef(0),Ut=x.useRef(null),[Gd,Yd]=V.split("-"),qs=x.useMemo(()=>E.reduce((F,G,X)=>X>=kr?F:F+G.height,0),[E,kr]),Ks=Ga(),Rd=d.invert||y,Pn=ge==="loading";Vt.current=x.useMemo(()=>kr*j+qs,[kr,qs]),x.useEffect(()=>{rr.current=Us},[Us]),x.useEffect(()=>{jt(!0)},[]),x.useEffect(()=>{let F=bt.current;if(F){let G=F.getBoundingClientRect().height;return Hs(G),g(X=>[{toastId:d.id,height:G,position:d.position},...X]),()=>g(X=>X.filter(Ee=>Ee.toastId!==d.id))}},[g,d.id]),x.useLayoutEffect(()=>{if(!R)return;let F=bt.current,G=F.style.height;F.style.height="auto";let X=F.getBoundingClientRect().height;F.style.height=G,Hs(X),g(Ee=>Ee.find(Te=>Te.toastId===d.id)?Ee.map(Te=>Te.toastId===d.id?{...Te,height:X}:Te):[{toastId:d.id,height:X,position:d.position},...Ee])},[R,d.title,d.description,g,d.id]);let it=x.useCallback(()=>{vt(!0),tr(Vt.current),g(F=>F.filter(G=>G.toastId!==d.id)),setTimeout(()=>{S(d)},ll)},[d,S,g,Vt]);x.useEffect(()=>{if(d.promise&&ge==="loading"||d.duration===1/0||d.type==="loading")return;let F;return P||m||U&&Ks?(()=>{if(Ws.current<Tn.current){let G=new Date().getTime()-Tn.current;rr.current=rr.current-G}Ws.current=new Date().getTime()})():rr.current!==1/0&&(Tn.current=new Date().getTime(),F=setTimeout(()=>{var G;(G=d.onAutoClose)==null||G.call(d,d),it()},rr.current)),()=>clearTimeout(F)},[P,m,d,ge,U,Ks,it]),x.useEffect(()=>{d.delete&&it()},[it,d.delete]);function Xd(){var F,G,X;return K!=null&&K.loading?x.createElement("div",{className:ve(k==null?void 0:k.loader,(F=d==null?void 0:d.classNames)==null?void 0:F.loader,"sonner-loader"),"data-visible":ge==="loading"},K.loading):z?x.createElement("div",{className:ve(k==null?void 0:k.loader,(G=d==null?void 0:d.classNames)==null?void 0:G.loader,"sonner-loader"),"data-visible":ge==="loading"},z):x.createElement(Va,{className:ve(k==null?void 0:k.loader,(X=d==null?void 0:d.classNames)==null?void 0:X.loader),visible:ge==="loading"})}return x.createElement("li",{tabIndex:0,ref:bt,className:ve(O,qd,k==null?void 0:k.toast,(t=d==null?void 0:d.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[ge],(r=d==null?void 0:d.classNames)==null?void 0:r[ge]),"data-sonner-toast":"","data-rich-colors":(n=d.richColors)!=null?n:N,"data-styled":!(d.jsx||d.unstyled||b),"data-mounted":R,"data-promise":!!d.promise,"data-swiped":Cn,"data-removed":nt,"data-visible":Wd,"data-y-position":Gd,"data-x-position":Yd,"data-index":T,"data-front":Ud,"data-swiping":ot,"data-dismissible":Ht,"data-type":ge,"data-invert":Rd,"data-swipe-out":st,"data-swipe-direction":ie,"data-expanded":!!(P||D&&R),style:{"--index":T,"--toasts-before":T,"--z-index":w.length-T,"--offset":`${nt?En:Vt.current}px`,"--initial-height":D?"auto":`${Bt}px`,...M,...d.style},onDragEnd:()=>{zt(!1),Q(null),Ut.current=null},onPointerDown:F=>{Pn||!Ht||(Vs.current=new Date,tr(Vt.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(zt(!0),Ut.current={x:F.clientX,y:F.clientY}))},onPointerUp:()=>{var F,G,X,Ee;if(st||!Ht)return;Ut.current=null;let Te=Number(((F=bt.current)==null?void 0:F.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),at=Number(((G=bt.current)==null?void 0:G.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wt=new Date().getTime()-((X=Vs.current)==null?void 0:X.getTime()),Pe=q==="x"?Te:at,lt=Math.abs(Pe)/wt;if(Math.abs(Pe)>=al||lt>.11){tr(Vt.current),(Ee=d.onDismiss)==null||Ee.call(d,d),rt(q==="x"?Te>0?"right":"left":at>0?"down":"up"),it(),Nr(!0),Ar(!1);return}zt(!1),Q(null)},onPointerMove:F=>{var G,X,Ee,Te;if(!Ut.current||!Ht||((G=window.getSelection())==null?void 0:G.toString().length)>0)return;let at=F.clientY-Ut.current.y,wt=F.clientX-Ut.current.x,Pe=(X=e.swipeDirections)!=null?X:cl(V);!q&&(Math.abs(wt)>1||Math.abs(at)>1)&&Q(Math.abs(wt)>Math.abs(at)?"x":"y");let lt={x:0,y:0};q==="y"?(Pe.includes("top")||Pe.includes("bottom"))&&(Pe.includes("top")&&at<0||Pe.includes("bottom")&&at>0)&&(lt.y=at):q==="x"&&(Pe.includes("left")||Pe.includes("right"))&&(Pe.includes("left")&&wt<0||Pe.includes("right")&&wt>0)&&(lt.x=wt),(Math.abs(lt.x)>0||Math.abs(lt.y)>0)&&Ar(!0),(Ee=bt.current)==null||Ee.style.setProperty("--swipe-amount-x",`${lt.x}px`),(Te=bt.current)==null||Te.style.setProperty("--swipe-amount-y",`${lt.y}px`)}},Qd&&!d.jsx?x.createElement("button",{"aria-label":ee,"data-disabled":Pn,"data-close-button":!0,onClick:Pn||!Ht?()=>{}:()=>{var F;it(),(F=d.onDismiss)==null||F.call(d,d)},className:ve(k==null?void 0:k.closeButton,(o=d==null?void 0:d.classNames)==null?void 0:o.closeButton)},(s=K==null?void 0:K.close)!=null?s:Qa):null,d.jsx||x.isValidElement(d.title)?d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title:x.createElement(x.Fragment,null,ge||d.icon||d.promise?x.createElement("div",{"data-icon":"",className:ve(k==null?void 0:k.icon,(i=d==null?void 0:d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Xd():null,d.type!=="loading"?d.icon||(K==null?void 0:K[ge])||Ba(ge):null):null,x.createElement("div",{"data-content":"",className:ve(k==null?void 0:k.content,(a=d==null?void 0:d.classNames)==null?void 0:a.content)},x.createElement("div",{"data-title":"",className:ve(k==null?void 0:k.title,(u=d==null?void 0:d.classNames)==null?void 0:u.title)},typeof d.title=="function"?d.title():d.title),d.description?x.createElement("div",{"data-description":"",className:ve(W,Kd,k==null?void 0:k.description,(l=d==null?void 0:d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),x.isValidElement(d.cancel)?d.cancel:d.cancel&&ur(d.cancel)?x.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||_,onClick:F=>{var G,X;ur(d.cancel)&&Ht&&((X=(G=d.cancel).onClick)==null||X.call(G,F),it())},className:ve(k==null?void 0:k.cancelButton,(f=d==null?void 0:d.classNames)==null?void 0:f.cancelButton)},d.cancel.label):null,x.isValidElement(d.action)?d.action:d.action&&ur(d.action)?x.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||H,onClick:F=>{var G,X;ur(d.action)&&((X=(G=d.action).onClick)==null||X.call(G,F),!F.defaultPrevented&&it())},className:ve(k==null?void 0:k.actionButton,(h=d==null?void 0:d.classNames)==null?void 0:h.actionButton)},d.action.label):null))};function No(){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 ul(e,t){let r={};return[e,t].forEach((n,o)=>{let s=o===1,i=s?"--mobile-offset":"--offset",a=s?ol:nl;function u(l){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof l=="number"?`${l}px`:l})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(l=>{n[l]===void 0?r[`${i}-${l}`]=a:r[`${i}-${l}`]=typeof n[l]=="number"?`${n[l]}px`:n[l]}):u(a)}),r}var fl=x.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:u,mobileOffset:l,theme:f="light",richColors:h,duration:y,style:d,visibleToasts:b=rl,toastOptions:m,dir:g=No(),gap:C=il,loadingIcon:E,icons:T,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:P}=e,[S,N]=x.useState([]),L=x.useMemo(()=>Array.from(new Set([n].concat(S.filter(U=>U.position).map(U=>U.position)))),[S,n]),[M,_]=x.useState([]),[H,O]=x.useState(!1),[W,A]=x.useState(!1),[V,j]=x.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=x.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=x.useRef(null),K=x.useRef(!1),ee=x.useCallback(U=>{N(q=>{var Q;return(Q=q.find(ie=>ie.id===U.id))!=null&&Q.delete||ce.dismiss(U.id),q.filter(({id:ie})=>ie!==U.id)})},[]);return x.useEffect(()=>ce.subscribe(U=>{if(U.dismiss){N(q=>q.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{re.flushSync(()=>{N(q=>{let Q=q.findIndex(ie=>ie.id===U.id);return Q!==-1?[...q.slice(0,Q),{...q[Q],...U},...q.slice(Q+1)]:[U,...q]})})})}),[]),x.useEffect(()=>{if(f!=="system"){j(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:q})=>{j(q?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{j(Q?"dark":"light")}catch(ie){console.error(ie)}})}},[f]),x.useEffect(()=>{S.length<=1&&O(!1)},[S]),x.useEffect(()=>{let U=q=>{var Q,ie;o.every(rt=>q[rt]||q.code===rt)&&(O(!0),(Q=z.current)==null||Q.focus()),q.code==="Escape"&&(document.activeElement===z.current||(ie=z.current)!=null&&ie.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[o]),x.useEffect(()=>{if(z.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,K.current=!1)}},[z.current]),x.createElement("section",{ref:t,"aria-label":`${w} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((U,q)=>{var Q;let[ie,rt]=U.split("-");return S.length?x.createElement("ol",{key:U,dir:g==="auto"?No():g,tabIndex:-1,ref:z,className:a,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":ie,"data-lifted":H&&S.length>1&&!s,"data-x-position":rt,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${sl}px`,"--gap":`${C}px`,...d,...ul(u,l)},onBlur:R=>{K.current&&!R.currentTarget.contains(R.relatedTarget)&&(K.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||K.current||(K.current=!0,k.current=R.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{W||O(!1)},onDragEnd:()=>O(!1),onPointerDown:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},S.filter(R=>!R.position&&q===0||R.position===U).map((R,jt)=>{var nt,vt;return x.createElement(dl,{key:R.id,icons:T,index:jt,toast:R,defaultRichColors:h,duration:(nt=m==null?void 0:m.duration)!=null?nt:y,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:r,visibleToasts:b,closeButton:(vt=m==null?void 0:m.closeButton)!=null?vt:i,interacting:W,position:U,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:ee,toasts:S.filter(ot=>ot.position==R.position),heights:M.filter(ot=>ot.position==R.position),setHeights:_,expandByDefault:s,gap:C,loadingIcon:E,expanded:H,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const hl=({...e})=>{const{theme:t="system"}=za();return c.jsx(fl,{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})},pl=["top","right","bottom","left"],Qe=Math.min,ue=Math.max,fr=Math.round,hr=Math.floor,Se=e=>({x:e,y:e}),ml={left:"right",right:"left",bottom:"top",top:"bottom"},gl={start:"end",end:"start"};function Xr(e,t,r){return ue(e,Qe(t,r))}function Le(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function Et(e){return e.split("-")[1]}function Jr(e){return e==="x"?"y":"x"}function Zr(e){return e==="y"?"height":"width"}const yl=new Set(["top","bottom"]);function Ne(e){return yl.has(Fe(e))?"y":"x"}function en(e){return Jr(Ne(e))}function vl(e,t,r){r===void 0&&(r=!1);const n=Et(e),o=en(e),s=Zr(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=pr(i)),[i,pr(i)]}function bl(e){const t=pr(e);return[tn(e),t,tn(t)]}function tn(e){return e.replace(/start|end/g,t=>gl[t])}const Ao=["left","right"],ko=["right","left"],wl=["top","bottom"],xl=["bottom","top"];function Cl(e,t,r){switch(e){case"top":case"bottom":return r?t?ko:Ao:t?Ao:ko;case"left":case"right":return t?wl:xl;default:return[]}}function El(e,t,r,n){const o=Et(e);let s=Cl(Fe(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(tn)))),s}function pr(e){return e.replace(/left|right|bottom|top/g,t=>ml[t])}function Tl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Oo(e){return typeof e!="number"?Tl(e):{top:e,right:e,bottom:e,left:e}}function mr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Mo(e,t,r){let{reference:n,floating:o}=e;const s=Ne(t),i=en(t),a=Zr(i),u=Fe(t),l=s==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,y=n[a]/2-o[a]/2;let d;switch(u){case"top":d={x:f,y:n.y-o.height};break;case"bottom":d={x:f,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:h};break;case"left":d={x:n.x-o.width,y:h};break;default:d={x:n.x,y:n.y}}switch(Et(t)){case"start":d[i]-=y*(r&&l?-1:1);break;case"end":d[i]+=y*(r&&l?-1:1);break}return d}const Pl=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Mo(l,n,u),y=n,d={},b=0;for(let m=0;m<a.length;m++){const{name:g,fn:C}=a[m],{x:E,y:T,data:w,reset:P}=await C({x:f,y:h,initialPlacement:n,placement:y,strategy:o,middlewareData:d,rects:l,platform:i,elements:{reference:e,floating:t}});f=E??f,h=T??h,d={...d,[g]:{...d[g],...w}},P&&b<=50&&(b++,typeof P=="object"&&(P.placement&&(y=P.placement),P.rects&&(l=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:f,y:h}=Mo(l,y,u)),m=-1)}return{x:f,y:h,placement:y,strategy:o,middlewareData:d}};async function Gt(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:y=!1,padding:d=0}=Le(t,e),b=Oo(d),g=a[y?h==="floating"?"reference":"floating":h],C=mr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(g)))==null||r?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:u})),E=h==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},P=mr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:T,strategy:u}):E);return{top:(C.top-P.top+b.top)/w.y,bottom:(P.bottom-C.bottom+b.bottom)/w.y,left:(C.left-P.left+b.left)/w.x,right:(P.right-C.right+b.right)/w.x}}const Sl=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:l,padding:f=0}=Le(e,t)||{};if(l==null)return{};const h=Oo(f),y={x:r,y:n},d=en(o),b=Zr(d),m=await i.getDimensions(l),g=d==="y",C=g?"top":"left",E=g?"bottom":"right",T=g?"clientHeight":"clientWidth",w=s.reference[b]+s.reference[d]-y[d]-s.floating[b],P=y[d]-s.reference[d],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let N=S?S[T]:0;(!N||!await(i.isElement==null?void 0:i.isElement(S)))&&(N=a.floating[T]||s.floating[b]);const L=w/2-P/2,M=N/2-m[b]/2-1,_=Qe(h[C],M),H=Qe(h[E],M),O=_,W=N-m[b]-H,A=N/2-m[b]/2+L,V=Xr(O,A,W),j=!u.arrow&&Et(o)!=null&&A!==V&&s.reference[b]/2-(A<O?_:H)-m[b]/2<0,z=j?A<O?A-O:A-W:0;return{[d]:y[d]+z,data:{[d]:V,centerOffset:A-V-z,...j&&{alignmentOffset:z}},reset:j}}}),Nl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...g}=Le(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const C=Fe(o),E=Ne(a),T=Fe(a)===a,w=await(u.isRTL==null?void 0:u.isRTL(l.floating)),P=y||(T||!m?[pr(a)]:bl(a)),S=b!=="none";!y&&S&&P.push(...El(a,m,b,w));const N=[a,...P],L=await Gt(t,g),M=[];let _=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&M.push(L[C]),h){const A=vl(o,i,w);M.push(L[A[0]],L[A[1]])}if(_=[..._,{placement:o,overflows:M}],!M.every(A=>A<=0)){var H,O;const A=(((H=s.flip)==null?void 0:H.index)||0)+1,V=N[A];if(V&&(!(h==="alignment"?E!==Ne(V):!1)||_.every(D=>D.overflows[0]>0&&Ne(D.placement)===E)))return{data:{index:A,overflows:_},reset:{placement:V}};let j=(O=_.filter(z=>z.overflows[0]<=0).sort((z,D)=>z.overflows[1]-D.overflows[1])[0])==null?void 0:O.placement;if(!j)switch(d){case"bestFit":{var W;const z=(W=_.filter(D=>{if(S){const k=Ne(D.placement);return k===E||k==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(k=>k>0).reduce((k,K)=>k+K,0)]).sort((D,k)=>D[1]-k[1])[0])==null?void 0:W[0];z&&(j=z);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Do(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Io(e){return pl.some(t=>e[t]>=0)}const Al=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Le(e,t);switch(n){case"referenceHidden":{const s=await Gt(t,{...o,elementContext:"reference"}),i=Do(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Io(i)}}}case"escaped":{const s=await Gt(t,{...o,altBoundary:!0}),i=Do(s,r.floating);return{data:{escapedOffsets:i,escaped:Io(i)}}}default:return{}}}}},Lo=new Set(["left","top"]);async function kl(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Fe(r),a=Et(r),u=Ne(r)==="y",l=Lo.has(i)?-1:1,f=s&&u?-1:1,h=Le(t,e);let{mainAxis:y,crossAxis:d,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof b=="number"&&(d=a==="end"?b*-1:b),u?{x:d*f,y:y*l}:{x:y*l,y:d*f}}const Ol=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await kl(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},Ml=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:g=>{let{x:C,y:E}=g;return{x:C,y:E}}},...u}=Le(e,t),l={x:r,y:n},f=await Gt(t,u),h=Ne(Fe(o)),y=Jr(h);let d=l[y],b=l[h];if(s){const g=y==="y"?"top":"left",C=y==="y"?"bottom":"right",E=d+f[g],T=d-f[C];d=Xr(E,d,T)}if(i){const g=h==="y"?"top":"left",C=h==="y"?"bottom":"right",E=b+f[g],T=b-f[C];b=Xr(E,b,T)}const m=a.fn({...t,[y]:d,[h]:b});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[y]:s,[h]:i}}}}}},Dl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=Le(e,t),f={x:r,y:n},h=Ne(o),y=Jr(h);let d=f[y],b=f[h];const m=Le(a,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const T=y==="y"?"height":"width",w=s.reference[y]-s.floating[T]+g.mainAxis,P=s.reference[y]+s.reference[T]-g.mainAxis;d<w?d=w:d>P&&(d=P)}if(l){var C,E;const T=y==="y"?"width":"height",w=Lo.has(Fe(o)),P=s.reference[h]-s.floating[T]+(w&&((C=i.offset)==null?void 0:C[h])||0)+(w?0:g.crossAxis),S=s.reference[h]+s.reference[T]+(w?0:((E=i.offset)==null?void 0:E[h])||0)-(w?g.crossAxis:0);b<P?b=P:b>S&&(b=S)}return{[y]:d,[h]:b}}}},Il=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...l}=Le(e,t),f=await Gt(t,l),h=Fe(o),y=Et(o),d=Ne(o)==="y",{width:b,height:m}=s.floating;let g,C;h==="top"||h==="bottom"?(g=h,C=y===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(C=h,g=y==="end"?"top":"bottom");const E=m-f.top-f.bottom,T=b-f.left-f.right,w=Qe(m-f[g],E),P=Qe(b-f[C],T),S=!t.middlewareData.shift;let N=w,L=P;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(L=T),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=E),S&&!y){const _=ue(f.left,0),H=ue(f.right,0),O=ue(f.top,0),W=ue(f.bottom,0);d?L=b-2*(_!==0||H!==0?_+H:ue(f.left,f.right)):N=m-2*(O!==0||W!==0?O+W:ue(f.top,f.bottom))}await u({...t,availableWidth:L,availableHeight:N});const M=await i.getDimensions(a.floating);return b!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function gr(){return typeof window<"u"}function Tt(e){return Fo(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(Fo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fo(e){return gr()?e instanceof Node||e instanceof fe(e).Node:!1}function be(e){return gr()?e instanceof Element||e instanceof fe(e).Element:!1}function ke(e){return gr()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function _o(e){return!gr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}const Ll=new Set(["inline","contents"]);function Yt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=we(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Ll.has(o)}const Fl=new Set(["table","td","th"]);function _l(e){return Fl.has(Tt(e))}const $l=[":popover-open",":modal"];function yr(e){return $l.some(t=>{try{return e.matches(t)}catch{return!1}})}const jl=["transform","translate","scale","rotate","perspective"],zl=["transform","translate","scale","rotate","perspective","filter"],Bl=["paint","layout","strict","content"];function rn(e){const t=nn(),r=be(e)?we(e):e;return jl.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)||zl.some(n=>(r.willChange||"").includes(n))||Bl.some(n=>(r.contain||"").includes(n))}function Hl(e){let t=Ge(e);for(;ke(t)&&!Pt(t);){if(rn(t))return t;if(yr(t))return null;t=Ge(t)}return null}function nn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vl=new Set(["html","body","#document"]);function Pt(e){return Vl.has(Tt(e))}function we(e){return fe(e).getComputedStyle(e)}function vr(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_o(e)&&e.host||Ae(e);return _o(t)?t.host:t}function $o(e){const t=Ge(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Yt(t)?t:$o(t)}function Rt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=$o(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=fe(o);if(s){const a=on(i);return t.concat(i,i.visualViewport||[],Yt(o)?o:[],a&&r?Rt(a):[])}return t.concat(o,Rt(o,[],r))}function on(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jo(e){const t=we(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ke(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=fr(r)!==s||fr(n)!==i;return a&&(r=s,n=i),{width:r,height:n,$:a}}function sn(e){return be(e)?e:e.contextElement}function St(e){const t=sn(e);if(!ke(t))return Se(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=jo(t);let i=(s?fr(r.width):r.width)/n,a=(s?fr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Ul=Se(0);function zo(e){const t=fe(e);return!nn()||!t.visualViewport?Ul:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wl(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==fe(e)?!1:t}function ut(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=sn(e);let i=Se(1);t&&(n?be(n)&&(i=St(n)):i=St(e));const a=Wl(s,r,n)?zo(s):Se(0);let u=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const y=fe(s),d=n&&be(n)?fe(n):n;let b=y,m=on(b);for(;m&&n&&d!==b;){const g=St(m),C=m.getBoundingClientRect(),E=we(m),T=C.left+(m.clientLeft+parseFloat(E.paddingLeft))*g.x,w=C.top+(m.clientTop+parseFloat(E.paddingTop))*g.y;u*=g.x,l*=g.y,f*=g.x,h*=g.y,u+=T,l+=w,b=fe(m),m=on(b)}}return mr({width:f,height:h,x:u,y:l})}function an(e,t){const r=vr(e).scrollLeft;return t?t.left+r:ut(Ae(e)).left+r}function Bo(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:an(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function ql(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ae(n),a=t?yr(t.floating):!1;if(n===i||a&&s)return r;let u={scrollLeft:0,scrollTop:0},l=Se(1);const f=Se(0),h=ke(n);if((h||!h&&!s)&&((Tt(n)!=="body"||Yt(i))&&(u=vr(n)),ke(n))){const d=ut(n);l=St(n),f.x=d.x+n.clientLeft,f.y=d.y+n.clientTop}const y=i&&!h&&!s?Bo(i,u,!0):Se(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-u.scrollLeft*l.x+f.x+y.x,y:r.y*l.y-u.scrollTop*l.y+f.y+y.y}}function Kl(e){return Array.from(e.getClientRects())}function Ql(e){const t=Ae(e),r=vr(e),n=e.ownerDocument.body,o=ue(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ue(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+an(e);const a=-r.scrollTop;return we(n).direction==="rtl"&&(i+=ue(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Gl(e,t){const r=fe(e),n=Ae(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const l=nn();(!l||l&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}const Yl=new Set(["absolute","fixed"]);function Rl(e,t){const r=ut(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=ke(e)?St(e):Se(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,l=n*s.y;return{width:i,height:a,x:u,y:l}}function Ho(e,t,r){let n;if(t==="viewport")n=Gl(e,r);else if(t==="document")n=Ql(Ae(e));else if(be(t))n=Rl(t,r);else{const o=zo(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mr(n)}function Vo(e,t){const r=Ge(e);return r===t||!be(r)||Pt(r)?!1:we(r).position==="fixed"||Vo(r,t)}function Xl(e,t){const r=t.get(e);if(r)return r;let n=Rt(e,[],!1).filter(a=>be(a)&&Tt(a)!=="body"),o=null;const s=we(e).position==="fixed";let i=s?Ge(e):e;for(;be(i)&&!Pt(i);){const a=we(i),u=rn(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&Yl.has(o.position)||Yt(i)&&!u&&Vo(e,i))?n=n.filter(f=>f!==i):o=a,i=Ge(i)}return t.set(e,n),n}function Jl(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?yr(t)?[]:Xl(t,this._c):[].concat(r),n],a=i[0],u=i.reduce((l,f)=>{const h=Ho(t,f,o);return l.top=ue(h.top,l.top),l.right=Qe(h.right,l.right),l.bottom=Qe(h.bottom,l.bottom),l.left=ue(h.left,l.left),l},Ho(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Zl(e){const{width:t,height:r}=jo(e);return{width:t,height:r}}function ec(e,t,r){const n=ke(t),o=Ae(t),s=r==="fixed",i=ut(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=Se(0);function l(){u.x=an(o)}if(n||!n&&!s)if((Tt(t)!=="body"||Yt(o))&&(a=vr(t)),n){const d=ut(t,!0,s,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else o&&l();s&&!n&&o&&l();const f=o&&!n&&!s?Bo(o,a):Se(0),h=i.left+a.scrollLeft-u.x-f.x,y=i.top+a.scrollTop-u.y-f.y;return{x:h,y,width:i.width,height:i.height}}function ln(e){return we(e).position==="static"}function Uo(e,t){if(!ke(e)||we(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Wo(e,t){const r=fe(e);if(yr(e))return r;if(!ke(e)){let o=Ge(e);for(;o&&!Pt(o);){if(be(o)&&!ln(o))return o;o=Ge(o)}return r}let n=Uo(e,t);for(;n&&_l(n)&&ln(n);)n=Uo(n,t);return n&&Pt(n)&&ln(n)&&!rn(n)?r:n||Hl(e)||r}const tc=async function(e){const t=this.getOffsetParent||Wo,r=this.getDimensions,n=await r(e.floating);return{reference:ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rc(e){return we(e).direction==="rtl"}const nc={convertOffsetParentRelativeRectToViewportRelativeRect:ql,getDocumentElement:Ae,getClippingRect:Jl,getOffsetParent:Wo,getElementRects:tc,getClientRects:Kl,getDimensions:Zl,getScale:St,isElement:be,isRTL:rc};function qo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oc(e,t){let r=null,n;const o=Ae(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:f,top:h,width:y,height:d}=l;if(a||t(),!y||!d)return;const b=hr(h),m=hr(o.clientWidth-(f+y)),g=hr(o.clientHeight-(h+d)),C=hr(f),T={rootMargin:-b+"px "+-m+"px "+-g+"px "+-C+"px",threshold:ue(0,Qe(1,u))||1};let w=!0;function P(S){const N=S[0].intersectionRatio;if(N!==u){if(!w)return i();N?i(!1,N):n=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!qo(l,e.getBoundingClientRect())&&i(),w=!1}try{r=new IntersectionObserver(P,{...T,root:o.ownerDocument})}catch{r=new IntersectionObserver(P,T)}r.observe(e)}return i(!0),s}function sc(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,l=sn(e),f=o||s?[...l?Rt(l):[],...Rt(t)]:[];f.forEach(C=>{o&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});const h=l&&a?oc(l,r):null;let y=-1,d=null;i&&(d=new ResizeObserver(C=>{let[E]=C;E&&E.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=d)==null||T.observe(t)})),r()}),l&&!u&&d.observe(l),d.observe(t));let b,m=u?ut(e):null;u&&g();function g(){const C=ut(e);m&&!qo(m,C)&&r(),m=C,b=requestAnimationFrame(g)}return r(),()=>{var C;f.forEach(E=>{o&&E.removeEventListener("scroll",r),s&&E.removeEventListener("resize",r)}),h==null||h(),(C=d)==null||C.disconnect(),d=null,u&&cancelAnimationFrame(b)}}const ic=Ol,ac=Ml,lc=Nl,cc=Il,dc=Al,Ko=Sl,uc=Dl,fc=(e,t,r)=>{const n=new Map,o={platform:nc,...r},s={...o.platform,_c:n};return Pl(e,t,{...o,platform:s})};var hc=typeof document<"u",pc=function(){},br=hc?x.useLayoutEffect:pc;function wr(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,o;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(!wr(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!wr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Qo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Go(e,t){const r=Qo(e);return Math.round(t*r)/r}function cn(e){const t=p.useRef(e);return br(()=>{t.current=e}),t}function mc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:l}=e,[f,h]=p.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,d]=p.useState(n);wr(y,n)||d(n);const[b,m]=p.useState(null),[g,C]=p.useState(null),E=p.useCallback(D=>{D!==S.current&&(S.current=D,m(D))},[]),T=p.useCallback(D=>{D!==N.current&&(N.current=D,C(D))},[]),w=s||b,P=i||g,S=p.useRef(null),N=p.useRef(null),L=p.useRef(f),M=u!=null,_=cn(u),H=cn(o),O=cn(l),W=p.useCallback(()=>{if(!S.current||!N.current)return;const D={placement:t,strategy:r,middleware:y};H.current&&(D.platform=H.current),fc(S.current,N.current,D).then(k=>{const K={...k,isPositioned:O.current!==!1};A.current&&!wr(L.current,K)&&(L.current=K,Dr.flushSync(()=>{h(K)}))})},[y,t,r,H,O]);br(()=>{l===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(D=>({...D,isPositioned:!1})))},[l]);const A=p.useRef(!1);br(()=>(A.current=!0,()=>{A.current=!1}),[]),br(()=>{if(w&&(S.current=w),P&&(N.current=P),w&&P){if(_.current)return _.current(w,P,W);W()}},[w,P,W,_,M]);const V=p.useMemo(()=>({reference:S,floating:N,setReference:E,setFloating:T}),[E,T]),j=p.useMemo(()=>({reference:w,floating:P}),[w,P]),z=p.useMemo(()=>{const D={position:r,left:0,top:0};if(!j.floating)return D;const k=Go(j.floating,f.x),K=Go(j.floating,f.y);return a?{...D,transform:"translate("+k+"px, "+K+"px)",...Qo(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:K}},[r,a,j.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:W,refs:V,elements:j,floatingStyles:z}),[f,W,V,j,z])}const gc=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ko({element:n.current,padding:o}).fn(r):{}:n?Ko({element:n,padding:o}).fn(r):{}}}},yc=(e,t)=>({...ic(e),options:[e,t]}),vc=(e,t)=>({...ac(e),options:[e,t]}),bc=(e,t)=>({...uc(e),options:[e,t]}),wc=(e,t)=>({...lc(e),options:[e,t]}),xc=(e,t)=>({...cc(e),options:[e,t]}),Cc=(e,t)=>({...dc(e),options:[e,t]}),Ec=(e,t)=>({...gc(e),options:[e,t]});var Tc="Arrow",Yo=p.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return c.jsx(ae.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yo.displayName=Tc;var Pc=Yo;function Sc(e){const[t,r]=p.useState(void 0);return Ue(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,l=Array.isArray(u)?u[0]:u;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ro="Popper",[Xo,Jo]=sr(Ro),[eu,Zo]=Xo(Ro),es="PopperAnchor",ts=p.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Zo(es,r),i=p.useRef(null),a=ye(t,i);return p.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:c.jsx(ae.div,{...o,ref:a})});ts.displayName=es;var dn="PopperContent",[Nc,Ac]=Xo(dn),rs=p.forwardRef((e,t)=>{var R,jt,nt,vt,ot,zt;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:y=!1,updatePositionStrategy:d="optimized",onPlaced:b,...m}=e,g=Zo(dn,r),[C,E]=p.useState(null),T=ye(t,st=>E(st)),[w,P]=p.useState(null),S=Sc(w),N=(S==null?void 0:S.width)??0,L=(S==null?void 0:S.height)??0,M=n+(s!=="center"?"-"+s:""),_=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},H=Array.isArray(l)?l:[l],O=H.length>0,W={padding:_,boundary:H.filter(Oc),altBoundary:O},{refs:A,floatingStyles:V,placement:j,isPositioned:z,middlewareData:D}=mc({strategy:"fixed",placement:M,whileElementsMounted:(...st)=>sc(...st,{animationFrame:d==="always"}),elements:{reference:g.anchor},middleware:[yc({mainAxis:o+L,alignmentAxis:i}),u&&vc({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?bc():void 0,...W}),u&&wc({...W}),xc({...W,apply:({elements:st,rects:Nr,availableWidth:Cn,availableHeight:Ar})=>{const{width:En,height:tr}=Nr.reference,Bt=st.floating.style;Bt.setProperty("--radix-popper-available-width",`${Cn}px`),Bt.setProperty("--radix-popper-available-height",`${Ar}px`),Bt.setProperty("--radix-popper-anchor-width",`${En}px`),Bt.setProperty("--radix-popper-anchor-height",`${tr}px`)}}),w&&Ec({element:w,padding:a}),Mc({arrowWidth:N,arrowHeight:L}),y&&Cc({strategy:"referenceHidden",...W})]}),[k,K]=ss(j),ee=Ve(b);Ue(()=>{z&&(ee==null||ee())},[z,ee]);const U=(R=D.arrow)==null?void 0:R.x,q=(jt=D.arrow)==null?void 0:jt.y,Q=((nt=D.arrow)==null?void 0:nt.centerOffset)!==0,[ie,rt]=p.useState();return Ue(()=>{C&&rt(window.getComputedStyle(C).zIndex)},[C]),c.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:z?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(vt=D.transformOrigin)==null?void 0:vt.x,(ot=D.transformOrigin)==null?void 0:ot.y].join(" "),...((zt=D.hide)==null?void 0:zt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Nc,{scope:r,placedSide:k,onArrowChange:P,arrowX:U,arrowY:q,shouldHideArrow:Q,children:c.jsx(ae.div,{"data-side":k,"data-align":K,...m,ref:T,style:{...m.style,animation:z?void 0:"none"}})})})});rs.displayName=dn;var ns="PopperArrow",kc={top:"bottom",right:"left",bottom:"top",left:"right"},os=p.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Ac(ns,n),i=kc[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Pc,{...o,ref:r,style:{...o.style,display:"block"}})})});os.displayName=ns;function Oc(e){return e!==null}var Mc=e=>({name:"transformOrigin",options:e,fn(t){var g,C,E;const{placement:r,rects:n,middlewareData:o}=t,i=((g=o.arrow)==null?void 0:g.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[l,f]=ss(r),h={start:"0%",center:"50%",end:"100%"}[f],y=(((C=o.arrow)==null?void 0:C.x)??0)+a/2,d=(((E=o.arrow)==null?void 0:E.y)??0)+u/2;let b="",m="";return l==="bottom"?(b=i?h:`${y}px`,m=`${-u}px`):l==="top"?(b=i?h:`${y}px`,m=`${n.floating.height+u}px`):l==="right"?(b=`${-u}px`,m=i?h:`${d}px`):l==="left"&&(b=`${n.floating.width+u}px`,m=i?h:`${d}px`),{data:{x:b,y:m}}}});function ss(e){const[t,r="center"]=e.split("-");return[t,r]}var Dc=ts,Ic=rs,Lc=os,[xr,tu]=sr("Tooltip",[Jo]),un=Jo(),is="TooltipProvider",Fc=700,as="tooltip.open",[_c,ls]=xr(is),cs=e=>{const{__scopeTooltip:t,delayDuration:r=Fc,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,i=p.useRef(!0),a=p.useRef(!1),u=p.useRef(0);return p.useEffect(()=>{const l=u.current;return()=>window.clearTimeout(l)},[]),c.jsx(_c,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:p.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};cs.displayName=is;var ds="Tooltip",[ru,Cr]=xr(ds),fn="TooltipTrigger",$c=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Cr(fn,r),s=ls(fn,r),i=un(r),a=p.useRef(null),u=ye(t,a,o.onTriggerChange),l=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>l.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(Dc,{asChild:!0,...i,children:c.jsx(ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:te(e.onPointerMove,y=>{y.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});$c.displayName=fn;var jc="TooltipPortal",[nu,zc]=xr(jc,{forceMount:void 0}),Nt="TooltipContent",us=p.forwardRef((e,t)=>{const r=zc(Nt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,i=Cr(Nt,e.__scopeTooltip);return c.jsx(jr,{present:n||i.open,children:i.disableHoverableContent?c.jsx(fs,{side:o,...s,ref:t}):c.jsx(Bc,{side:o,...s,ref:t})})}),Bc=p.forwardRef((e,t)=>{const r=Cr(Nt,e.__scopeTooltip),n=ls(Nt,e.__scopeTooltip),o=p.useRef(null),s=ye(t,o),[i,a]=p.useState(null),{trigger:u,onClose:l}=r,f=o.current,{onPointerInTransitChange:h}=n,y=p.useCallback(()=>{a(null),h(!1)},[h]),d=p.useCallback((b,m)=>{const g=b.currentTarget,C={x:b.clientX,y:b.clientY},E=qc(C,g.getBoundingClientRect()),T=Kc(C,E),w=Qc(m.getBoundingClientRect()),P=Yc([...T,...w]);a(P),h(!0)},[h]);return p.useEffect(()=>()=>y(),[y]),p.useEffect(()=>{if(u&&f){const b=g=>d(g,f),m=g=>d(g,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",m),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",m)}}},[u,f,d,y]),p.useEffect(()=>{if(i){const b=m=>{const g=m.target,C={x:m.clientX,y:m.clientY},E=(u==null?void 0:u.contains(g))||(f==null?void 0:f.contains(g)),T=!Gc(C,i);E?y():T&&(y(),l())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,i,l,y]),c.jsx(fs,{...e,ref:s})}),[Hc,Vc]=xr(ds,{isInside:!1}),Uc=ri("TooltipContent"),fs=p.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Cr(Nt,r),l=un(r),{onClose:f}=u;return p.useEffect(()=>(document.addEventListener(as,f),()=>document.removeEventListener(as,f)),[f]),p.useEffect(()=>{if(u.trigger){const h=y=>{const d=y.target;d!=null&&d.contains(u.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,f]),c.jsx($r,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:c.jsxs(Ic,{"data-state":u.stateAttribute,...l,...a,ref:t,style:{...a.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:[c.jsx(Uc,{children:n}),c.jsx(Hc,{scope:r,isInside:!0,children:c.jsx(Ni,{id:u.contentId,role:"tooltip",children:o||n})})]})})});us.displayName=Nt;var hs="TooltipArrow",Wc=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=un(r);return Vc(hs,r).isInside?null:c.jsx(Lc,{...o,...n,ref:t})});Wc.displayName=hs;function qc(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Kc(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 Qc(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Gc(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],u=t[i],l=a.x,f=a.y,h=u.x,y=u.y;f>n!=y>n&&r<(h-l)*(n-f)/(y-f)+l&&(o=!o)}return o}function Yc(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),Rc(t)}function Rc(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}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 Xc=cs,ps=us;const Jc=Xc,Zc=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(ps,{ref:n,sideOffset:t,className:se("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}));Zc.displayName=ps.displayName;var Xt=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(){}},Er=typeof window>"u"||"Deno"in globalThis;function he(){}function ed(e,t){return typeof e=="function"?e(t):e}function td(e){return typeof e=="number"&&e>=0&&e!==1/0}function rd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hn(e,t){return typeof e=="function"?e(t):e}function nd(e,t){return typeof e=="function"?e(t):e}function ms(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(n){if(t.queryHash!==pn(i,t.options))return!1}else if(!Jt(t.queryKey,i))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function gs(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(ft(t.options.mutationKey)!==ft(s))return!1}else if(!Jt(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function pn(e,t){return((t==null?void 0:t.queryKeyHashFn)||ft)(e)}function ft(e){return JSON.stringify(e,(t,r)=>gn(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function Jt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Jt(e[r],t[r])):!1}function mn(e,t){if(e===t)return e;const r=ys(e)&&ys(t);if(r||gn(e)&&gn(t)){const n=r?e:Object.keys(e),o=n.length,s=r?t:Object.keys(t),i=s.length,a=r?[]:{},u=new Set(n);let l=0;for(let f=0;f<i;f++){const h=r?f:s[f];(!r&&u.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(a[h]=void 0,l++):(a[h]=mn(e[h],t[h]),a[h]===e[h]&&e[h]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function od(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 ys(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gn(e){if(!vs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!vs(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vs(e){return Object.prototype.toString.call(e)==="[object Object]"}function sd(e){return new Promise(t=>{setTimeout(t,e)})}function id(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 mn(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 mn(e,t)}return t}function ad(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function ld(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Tr=Symbol();function bs(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Tr&&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===Tr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function cd(e,t){return typeof e=="function"?e(...t):!!e}var dd=(Ds=class extends Xt{constructor(){super();B(this,ht);B(this,Ye);B(this,kt);I(this,kt,t=>{if(!Er&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){v(this,Ye)||this.setEventListener(v(this,kt))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Ye))==null||t.call(this),I(this,Ye,void 0))}setEventListener(t){var r;I(this,kt,t),(r=v(this,Ye))==null||r.call(this),I(this,Ye,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){v(this,ht)!==t&&(I(this,ht,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof v(this,ht)=="boolean"?v(this,ht):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ht=new WeakMap,Ye=new WeakMap,kt=new WeakMap,Ds),ws=new dd,ud=(Is=class extends Xt{constructor(){super();B(this,Ot,!0);B(this,Re);B(this,Mt);I(this,Mt,t=>{if(!Er&&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(){v(this,Re)||this.setEventListener(v(this,Mt))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Re))==null||t.call(this),I(this,Re,void 0))}setEventListener(t){var r;I(this,Mt,t),(r=v(this,Re))==null||r.call(this),I(this,Re,t(this.setOnline.bind(this)))}setOnline(t){v(this,Ot)!==t&&(I(this,Ot,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return v(this,Ot)}},Ot=new WeakMap,Re=new WeakMap,Mt=new WeakMap,Is),Pr=new ud;function fd(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}function hd(e){return Math.min(1e3*2**e,3e4)}function xs(e){return(e??"online")==="online"?Pr.isOnline():!0}var Cs=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Es(e){let t=!1,r=0,n;const o=fd(),s=()=>o.status!=="pending",i=m=>{var g;s()||(y(new Cs(m)),(g=e.abort)==null||g.call(e))},a=()=>{t=!0},u=()=>{t=!1},l=()=>ws.isFocused()&&(e.networkMode==="always"||Pr.isOnline())&&e.canRun(),f=()=>xs(e.networkMode)&&e.canRun(),h=m=>{s()||(n==null||n(),o.resolve(m))},y=m=>{s()||(n==null||n(),o.reject(m))},d=()=>new Promise(m=>{var g;n=C=>{(s()||l())&&m(C)},(g=e.onPause)==null||g.call(e)}).then(()=>{var m;n=void 0,s()||(m=e.onContinue)==null||m.call(e)}),b=()=>{if(s())return;let m;const g=r===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(C){m=Promise.reject(C)}Promise.resolve(m).then(h).catch(C=>{var S;if(s())return;const E=e.retry??(Er?0:3),T=e.retryDelay??hd,w=typeof T=="function"?T(r,C):T,P=E===!0||typeof E=="number"&&r<E||typeof E=="function"&&E(r,C);if(t||!P){y(C);return}r++,(S=e.onFail)==null||S.call(e,r,C),sd(w).then(()=>l()?void 0:d()).then(()=>{t?y(C):b()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:a,continueRetry:u,canStart:f,start:()=>(f()?b():d().then(b),o)}}var pd=e=>setTimeout(e,0);function md(){let e=[],t=0,r=a=>{a()},n=a=>{a()},o=pd;const s=a=>{t?e.push(a):o(()=>{r(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{n(()=>{a.forEach(u=>{r(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||i()}return u},batchCalls:a=>(...u)=>{s(()=>{a(...u)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{o=a}}}var oe=md(),Ts=(Ls=class{constructor(){B(this,pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),td(this.gcTime)&&I(this,pt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Er?1/0:5*60*1e3))}clearGcTimeout(){v(this,pt)&&(clearTimeout(v(this,pt)),I(this,pt,void 0))}},pt=new WeakMap,Ls),gd=(Fs=class extends Ts{constructor(t){super();B(this,xe);B(this,Dt);B(this,It);B(this,me);B(this,mt);B(this,ne);B(this,Zt);B(this,gt);I(this,gt,!1),I(this,Zt,t.defaultOptions),this.setOptions(t.options),this.observers=[],I(this,mt,t.client),I(this,me,v(this,mt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,I(this,Dt,vd(this.options)),this.state=t.state??v(this,Dt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=v(this,ne))==null?void 0:t.promise}setOptions(t){this.options={...v(this,Zt),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&v(this,me).remove(this)}setData(t,r){const n=id(this.state.data,t,this.options);return Z(this,xe,He).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Z(this,xe,He).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,o;const r=(n=v(this,ne))==null?void 0:n.promise;return(o=v(this,ne))==null||o.cancel(t),r?r.then(he).catch(he):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(v(this,Dt))}isActive(){return this.observers.some(t=>nd(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>hn(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=v(this,ne))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=v(this,ne))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),v(this,me).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(v(this,ne)&&(v(this,gt)?v(this,ne).cancel({revert:!0}):v(this,ne).cancelRetry()),this.scheduleGc()),v(this,me).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,xe,He).call(this,{type:"invalidate"})}async fetch(t,r){var u,l,f,h,y,d,b,m,g,C,E,T;if(this.state.fetchStatus!=="idle"&&((u=v(this,ne))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(v(this,ne))return v(this,ne).continueRetry(),v(this,ne).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(P=>P.options.queryFn);w&&this.setOptions(w.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,o=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(I(this,gt,!0),n.signal)})},s=()=>{const w=bs(this.options,r),S=(()=>{const N={client:v(this,mt),queryKey:this.queryKey,meta:this.meta};return o(N),N})();return I(this,gt,!1),this.options.persister?this.options.persister(w,S,this):w(S)},a=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:v(this,mt),state:this.state,fetchFn:s};return o(w),w})();(l=this.options.behavior)==null||l.onFetch(a,this),I(this,It,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Z(this,xe,He).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),I(this,ne,Es({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onFail:(w,P)=>{Z(this,xe,He).call(this,{type:"failed",failureCount:w,error:P})},onPause:()=>{Z(this,xe,He).call(this,{type:"pause"})},onContinue:()=>{Z(this,xe,He).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await v(this,ne).start();if(w===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(w),(d=(y=v(this,me).config).onSuccess)==null||d.call(y,w,this),(m=(b=v(this,me).config).onSettled)==null||m.call(b,w,this.state.error,this),w}catch(w){if(w instanceof Cs){if(w.silent)return v(this,ne).promise;if(w.revert){if(this.setState({...v(this,It),fetchStatus:"idle"}),this.state.data===void 0)throw w;return this.state.data}}throw Z(this,xe,He).call(this,{type:"error",error:w}),(C=(g=v(this,me).config).onError)==null||C.call(g,w,this),(T=(E=v(this,me).config).onSettled)==null||T.call(E,this.state.data,w,this),w}finally{this.scheduleGc()}}},Dt=new WeakMap,It=new WeakMap,me=new WeakMap,mt=new WeakMap,ne=new WeakMap,Zt=new WeakMap,gt=new WeakMap,xe=new WeakSet,He=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,...yd(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...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 I(this,It,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),oe.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),v(this,me).notify({query:this,type:"updated",action:t})})},Fs);function yd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xs(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vd(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 bd=(_s=class extends Xt{constructor(t={}){super();B(this,Oe);this.config=t,I(this,Oe,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??pn(o,r);let i=this.get(s);return i||(i=new gd({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){v(this,Oe).has(t.queryHash)||(v(this,Oe).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=v(this,Oe).get(t.queryHash);r&&(t.destroy(),r===t&&v(this,Oe).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){oe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return v(this,Oe).get(t)}getAll(){return[...v(this,Oe).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ms(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>ms(t,n)):r}notify(t){oe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){oe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){oe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Oe=new WeakMap,_s),wd=($s=class extends Ts{constructor(t){super();B(this,De);B(this,Me);B(this,le);B(this,yt);this.mutationId=t.mutationId,I(this,le,t.mutationCache),I(this,Me,[]),this.state=t.state||Ps(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){v(this,Me).includes(t)||(v(this,Me).push(t),this.clearGcTimeout(),v(this,le).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){I(this,Me,v(this,Me).filter(r=>r!==t)),this.scheduleGc(),v(this,le).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){v(this,Me).length||(this.state.status==="pending"?this.scheduleGc():v(this,le).remove(this))}continue(){var t;return((t=v(this,yt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,u,l,f,h,y,d,b,m,g,C,E,T,w,P,S,N,L;const r=()=>{Z(this,De,ct).call(this,{type:"continue"})};I(this,yt,Es({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,_)=>{Z(this,De,ct).call(this,{type:"failed",failureCount:M,error:_})},onPause:()=>{Z(this,De,ct).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>v(this,le).canRun(this)}));const n=this.state.status==="pending",o=!v(this,yt).canStart();try{if(n)r();else{Z(this,De,ct).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=v(this,le).config).onMutate)==null?void 0:i.call(s,t,this));const _=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,t));_!==this.state.context&&Z(this,De,ct).call(this,{type:"pending",context:_,variables:t,isPaused:o})}const M=await v(this,yt).start();return await((f=(l=v(this,le).config).onSuccess)==null?void 0:f.call(l,M,t,this.state.context,this)),await((y=(h=this.options).onSuccess)==null?void 0:y.call(h,M,t,this.state.context)),await((b=(d=v(this,le).config).onSettled)==null?void 0:b.call(d,M,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,M,null,t,this.state.context)),Z(this,De,ct).call(this,{type:"success",data:M}),M}catch(M){try{throw await((E=(C=v(this,le).config).onError)==null?void 0:E.call(C,M,t,this.state.context,this)),await((w=(T=this.options).onError)==null?void 0:w.call(T,M,t,this.state.context)),await((S=(P=v(this,le).config).onSettled)==null?void 0:S.call(P,void 0,M,this.state.variables,this.state.context,this)),await((L=(N=this.options).onSettled)==null?void 0:L.call(N,void 0,M,t,this.state.context)),M}finally{Z(this,De,ct).call(this,{type:"error",error:M})}}finally{v(this,le).runNext(this)}}},Me=new WeakMap,le=new WeakMap,yt=new WeakMap,De=new WeakSet,ct=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),oe.batch(()=>{v(this,Me).forEach(n=>{n.onMutationUpdate(t)}),v(this,le).notify({mutation:this,type:"updated",action:t})})},$s);function Ps(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xd=(js=class extends Xt{constructor(t={}){super();B(this,je);B(this,Ce);B(this,er);this.config=t,I(this,je,new Set),I(this,Ce,new Map),I(this,er,0)}build(t,r,n){const o=new wd({mutationCache:this,mutationId:++Or(this,er)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){v(this,je).add(t);const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r);n?n.push(t):v(this,Ce).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(v(this,je).delete(t)){const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&v(this,Ce).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Sr(t);if(typeof r=="string"){const o=(n=v(this,Ce).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){oe.batch(()=>{v(this,je).forEach(t=>{this.notify({type:"removed",mutation:t})}),v(this,je).clear(),v(this,Ce).clear()})}getAll(){return Array.from(v(this,je))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>gs(r,n))}findAll(t={}){return this.getAll().filter(r=>gs(t,r))}notify(t){oe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return oe.batch(()=>Promise.all(t.map(r=>r.continue().catch(he))))}},je=new WeakMap,Ce=new WeakMap,er=new WeakMap,js);function Sr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ss(e){return{onFetch:(t,r)=>{var f,h,y,d,b;const n=t.options,o=(y=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:y.direction,s=((d=t.state.data)==null?void 0:d.pages)||[],i=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const l=async()=>{let m=!1;const g=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},C=bs(t.options,t.fetchOptions),E=async(T,w,P)=>{if(m)return Promise.reject();if(w==null&&T.pages.length)return Promise.resolve(T);const N=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:w,direction:P?"backward":"forward",meta:t.options.meta};return g(H),H})(),L=await C(N),{maxPages:M}=t.options,_=P?ld:ad;return{pages:_(T.pages,L,M),pageParams:_(T.pageParams,w,M)}};if(o&&s.length){const T=o==="backward",w=T?Cd:Ns,P={pages:s,pageParams:i},S=w(n,P);a=await E(P,S,T)}else{const T=e??s.length;do{const w=u===0?i[0]??n.initialPageParam:Ns(n,a);if(u>0&&w==null)break;a=await E(a,w),u++}while(u<T)}return a};t.options.persister?t.fetchFn=()=>{var m,g;return(g=(m=t.options).persister)==null?void 0:g.call(m,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Ns(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 Cd(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 Ed=(zs=class{constructor(e={}){B(this,J);B(this,Xe);B(this,Je);B(this,Lt);B(this,Ft);B(this,Ze);B(this,_t);B(this,$t);I(this,J,e.queryCache||new bd),I(this,Xe,e.mutationCache||new xd),I(this,Je,e.defaultOptions||{}),I(this,Lt,new Map),I(this,Ft,new Map),I(this,Ze,0)}mount(){Or(this,Ze)._++,v(this,Ze)===1&&(I(this,_t,ws.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,J).onFocus())})),I(this,$t,Pr.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,J).onOnline())})))}unmount(){var e,t;Or(this,Ze)._--,v(this,Ze)===0&&((e=v(this,_t))==null||e.call(this),I(this,_t,void 0),(t=v(this,$t))==null||t.call(this),I(this,$t,void 0))}isFetching(e){return v(this,J).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return v(this,Xe).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=v(this,J).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=v(this,J).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(hn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return v(this,J).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=v(this,J).get(n.queryHash),s=o==null?void 0:o.state.data,i=ed(t,s);if(i!==void 0)return v(this,J).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return oe.batch(()=>v(this,J).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=v(this,J).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=v(this,J);oe.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=v(this,J);return oe.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=oe.batch(()=>v(this,J).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(he).catch(he)}invalidateQueries(e,t={}){return oe.batch(()=>(v(this,J).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=oe.batch(()=>v(this,J).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(he)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(he)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=v(this,J).build(this,t);return r.isStaleByTime(hn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(he).catch(he)}fetchInfiniteQuery(e){return e.behavior=Ss(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(he).catch(he)}ensureInfiniteQueryData(e){return e.behavior=Ss(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pr.isOnline()?v(this,Xe).resumePausedMutations():Promise.resolve()}getQueryCache(){return v(this,J)}getMutationCache(){return v(this,Xe)}getDefaultOptions(){return v(this,Je)}setDefaultOptions(e){I(this,Je,e)}setQueryDefaults(e,t){v(this,Lt).set(ft(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...v(this,Lt).values()],r={};return t.forEach(n=>{Jt(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){v(this,Ft).set(ft(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...v(this,Ft).values()],r={};return t.forEach(n=>{Jt(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...v(this,Je).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pn(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===Tr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...v(this,Je).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){v(this,J).clear(),v(this,Xe).clear()}},J=new WeakMap,Xe=new WeakMap,Je=new WeakMap,Lt=new WeakMap,Ft=new WeakMap,Ze=new WeakMap,_t=new WeakMap,$t=new WeakMap,zs),Td=(Bs=class extends Xt{constructor(t,r){super();B(this,Be);B(this,et);B(this,tt);B(this,de);B(this,ze);I(this,et,t),this.setOptions(r),this.bindMethods(),Z(this,Be,Mr).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=v(this,et).defaultMutationOptions(t),od(this.options,r)||v(this,et).getMutationCache().notify({type:"observerOptionsUpdated",mutation:v(this,de),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ft(r.mutationKey)!==ft(this.options.mutationKey)?this.reset():((n=v(this,de))==null?void 0:n.state.status)==="pending"&&v(this,de).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=v(this,de))==null||t.removeObserver(this)}onMutationUpdate(t){Z(this,Be,Mr).call(this),Z(this,Be,Nn).call(this,t)}getCurrentResult(){return v(this,tt)}reset(){var t;(t=v(this,de))==null||t.removeObserver(this),I(this,de,void 0),Z(this,Be,Mr).call(this),Z(this,Be,Nn).call(this)}mutate(t,r){var n;return I(this,ze,r),(n=v(this,de))==null||n.removeObserver(this),I(this,de,v(this,et).getMutationCache().build(v(this,et),this.options)),v(this,de).addObserver(this),v(this,de).execute(t)}},et=new WeakMap,tt=new WeakMap,de=new WeakMap,ze=new WeakMap,Be=new WeakSet,Mr=function(){var r;const t=((r=v(this,de))==null?void 0:r.state)??Ps();I(this,tt,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Nn=function(t){oe.batch(()=>{var r,n,o,s,i,a,u,l;if(v(this,ze)&&this.hasListeners()){const f=v(this,tt).variables,h=v(this,tt).context;(t==null?void 0:t.type)==="success"?((n=(r=v(this,ze)).onSuccess)==null||n.call(r,t.data,f,h),(s=(o=v(this,ze)).onSettled)==null||s.call(o,t.data,null,f,h)):(t==null?void 0:t.type)==="error"&&((a=(i=v(this,ze)).onError)==null||a.call(i,t.error,f,h),(l=(u=v(this,ze)).onSettled)==null||l.call(u,void 0,t.error,f,h))}this.listeners.forEach(f=>{f(v(this,tt))})})},Bs),As=p.createContext(void 0),Pd=e=>{const t=p.useContext(As);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sd=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(As.Provider,{value:e,children:t}));function Nd(e,t){const r=Pd(),[n]=p.useState(()=>new Td(r,e));p.useEffect(()=>{n.setOptions(e)},[n,e]);const o=p.useSyncExternalStore(p.useCallback(i=>n.subscribe(oe.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=p.useCallback((i,a)=>{n.mutate(i,a).catch(he)},[n]);if(o.error&&cd(n.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const Ad=Kr("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"}}),pe=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?ei:"button";return c.jsx(i,{className:se(Ad({variant:t,size:r,className:e})),ref:s,...o})});pe.displayName="Button";const _e=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));_e.displayName="Card";const yn=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("flex flex-col space-y-1.5 p-6",e),...t}));yn.displayName="CardHeader";const vn=p.forwardRef(({className:e,...t},r)=>c.jsx("h3",{ref:r,className:se("text-2xl font-semibold leading-none tracking-tight",e),...t}));vn.displayName="CardTitle";const kd=p.forwardRef(({className:e,...t},r)=>c.jsx("p",{ref:r,className:se("text-sm text-muted-foreground",e),...t}));kd.displayName="CardDescription";const $e=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("p-6 pt-0",e),...t}));$e.displayName="CardContent";const Od=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("flex items-center p-6 pt-0",e),...t}));Od.displayName="CardFooter";const Md=({onContinue:e})=>c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"pt-8 text-center",children:[c.jsx("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 rounded-3xl p-8 mb-8",children:c.jsx("div",{className:"relative mb-8",children:c.jsxs("div",{className:"relative mx-auto w-48 h-32",children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary to-primary/80 rounded-2xl transform rotate-3 shadow-lg",children:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center",children:c.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:c.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"})})})})}),c.jsx("div",{className:"absolute top-4 right-0 bg-card rounded-xl shadow-lg p-4 transform -rotate-3",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary/20 rounded-full"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"w-12 h-2 bg-primary rounded"}),c.jsx("div",{className:"w-8 h-2 bg-primary/60 rounded"})]})]})}),c.jsx("div",{className:"absolute -top-2 -right-2 w-10 h-10 bg-primary rounded-full flex items-center justify-center shadow-lg",children:c.jsx(fo,{className:"w-6 h-6 text-white"})})]})})}),c.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:"Verify your identity"}),c.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:"We need some information to help us confirm your identity."}),c.jsx(pe,{className:"w-full h-14 text-lg font-semibold",onClick:e,children:"Start"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-6",children:"Verifying usually takes a few seconds."})]})}),ks=p.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:se("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}));ks.displayName="Input";var Dd="Label",Os=p.forwardRef((e,t)=>c.jsx(ae.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Os.displayName=Dd;var Ms=Os;const Id=Kr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),At=p.forwardRef(({className:e,...t},r)=>c.jsx(Ms,{ref:r,className:se(Id(),e),...t}));At.displayName=Ms.displayName;const Ld=({fullName:e,onNameChange:t,onContinue:r,renderProgress:n})=>c.jsxs(_e,{className:"w-full max-w-md mx-auto",children:[c.jsxs(yn,{className:"text-center",children:[c.jsx(Ji,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),c.jsx(vn,{children:"Personal Information"}),c.jsx("p",{className:"text-muted-foreground",children:"Please enter your full legal name"})]}),c.jsxs($e,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(At,{htmlFor:"fullName",children:"Full Name"}),c.jsx(ks,{id:"fullName",placeholder:"Enter your full name",value:e,onChange:o=>t(o.target.value)})]}),c.jsx(pe,{className:"w-full",onClick:r,disabled:!e.trim(),children:"Continue"})]}),c.jsx("div",{className:"mt-6",children:n()})]})]}),bn=({title:e,subTitle:t,onBack:r})=>c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center mb-6",children:[c.jsx(pe,{variant:"ghost",size:"icon",className:"mr-2",onClick:r,children:c.jsx(uo,{className:"w-6 h-6"})}),c.jsx("h1",{className:"text-2xl font-semibold ml-4",children:e})]}),c.jsx("p",{className:"text-center text-muted-foreground mb-6",children:t})]}),Fd=({selectedDocumentType:e,onDocumentTypeChange:t,onContinue:r,onBack:n,renderProgress:o})=>{const s=[{id:"id-card",title:"ID Card",description:"Government-issued personal ID.",icon:Xi},{id:"drivers-license",title:"Drivers license",description:"Government-issued Drivers license",icon:Ri},{id:"passport",title:"Passport",description:"Your official travel document.",icon:Yi},{id:"voter-id",title:"Voter ID",description:"Government-issued Voter ID",icon:Zi}];return c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Upload ID",subTitle:"Choose the document type you would like to identify with",onBack:n}),c.jsx("div",{className:"space-y-3",children:s.map(i=>{const a=i.icon;return c.jsx("button",{className:`w-full p-4 rounded-lg border text-left transition-colors hover:bg-muted/50 ${e===i.id?"border-primary bg-primary/5":"border-border"}`,onClick:()=>t(i.id),children:c.jsxs("div",{className:"flex items-center space-x-4",children:[c.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:c.jsx(a,{className:"w-6 h-6 text-white"})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h3",{className:"font-semibold text-foreground",children:i.title}),c.jsx("p",{className:"text-sm text-muted-foreground",children:i.description})]})]})},i.id)})}),c.jsx(pe,{className:"w-full mt-6",onClick:r,disabled:!e,children:"Continue"}),c.jsx("div",{className:"mt-6",children:o()})]})})},_d=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"}}},wn=({acceptedFile:e,currentStep:t,setCurrentStep:r,setSelfiePhoto:n,setIdCardFront:o,setIdCardBack:s})=>{const[i,a]=x.useState(null),u=x.useRef(null),l=x.useRef(null),f=!!i,{toast:h}=Fr();x.useEffect(()=>{i&&u.current&&(u.current.srcObject=i)},[i]);const y=x.useCallback(async()=>{try{const w=await navigator.mediaDevices.getUserMedia({video:{facingMode:t==="selfie"?"user":"environment",width:{ideal:1280},height:{ideal:720}}});a(w)}catch{h({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},[t,h]);x.useEffect(()=>{!i&&!e&&y()},[t,y,i,e]);const d=x.useCallback(()=>{i&&(i.getTracks().forEach(w=>w.stop()),a(null))},[i]),b=x.useCallback(()=>{if(!u.current||!l.current)return;const w=u.current,P=l.current,S=P.getContext("2d");S&&(P.width=w.videoWidth,P.height=w.videoHeight,S.drawImage(w,0,0),P.toBlob(N=>{if(N){const L=new File([N],`${t}-${Date.now()}.jpg`,{type:"image/jpeg"});switch(t){case"selfie":n(L),d(),r("selfie-confirm");break;case"id-front":o(L),d(),r("id-front-confirm");break;case"id-back":s(L),d(),r("id-back-confirm");break}h({title:"Photo Captured",description:"Photo captured successfully"})}},"image/jpeg",.8))},[t,d,h]);x.useEffect(()=>()=>{d()},[d]);const m=_d(t),{title:g,description:C,frameType:E}=m,T=()=>{switch(d(),t){case"selfie":r("pre-selfie");break;case"id-front":r("document-selection");break;case"id-back":r("document-selection");break}};return c.jsx(_e,{className:"w-full max-w-md mx-auto border-gray-900 bg-gray-900",children:c.jsxs($e,{className:" text-white flex flex-col",children:[c.jsxs("div",{className:"flex items-center p-6",children:[c.jsx(pe,{variant:"ghost",size:"sm",onClick:T,className:"text-white hover:bg-gray-800",children:c.jsx(uo,{className:"h-6 w-6"})}),c.jsx("h1",{className:"text-xl font-semibold ml-4",children:g})]}),c.jsx("div",{className:"px-6 mb-8",children:c.jsx("p",{className:"text-gray-300 text-center",children:C})}),c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[c.jsx("div",{className:"relative mb-16",children:f?c.jsxs(c.Fragment,{children:[c.jsx("video",{ref:u,autoPlay:!0,playsInline:!0,className:`bg-gray-800 object-cover ${E==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`}),c.jsx("canvas",{ref:l,className:"hidden"})]}):c.jsx("div",{className:`bg-gray-700 flex items-center justify-center ${E==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`,children:c.jsx("p",{className:"text-gray-400",children:"Camera loading..."})})}),c.jsx(pe,{onClick:f?b:y,size:"lg",className:"w-16 h-16 rounded-full bg-white hover:bg-gray-100 border-4 border-gray-600 p-0",disabled:!f,children:c.jsx("div",{className:"w-8 h-8 rounded-full bg-white"})})]})]})})},$d=({onContinue:e,onBack:t})=>c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Selfie",subTitle:"Make sure your face is clear and is fully inside the frame.",onBack:t}),c.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:c.jsx("div",{className:"w-full h-full bg-background rounded-2xl overflow-hidden relative",children:c.jsx("div",{className:"flex items-center justify-center h-full bg-muted/30",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-2"}),c.jsx("div",{className:"w-28 h-32 bg-primary/30 rounded-2xl mx-auto"})]})})})}),c.jsx("div",{className:"mt-8",children:c.jsx(pe,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),xn=({photo:e,onRetake:t,onConfirm:r,onBack:n,renderProgress:o})=>{const s=x.useMemo(()=>URL.createObjectURL(e),[e]);return x.useEffect(()=>()=>{URL.revokeObjectURL(s)},[s]),c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Review picture",subTitle:"Make sure the information is seen clearly, with no blur or glare.",onBack:n}),c.jsx("div",{className:"mb-8",children:c.jsx("div",{className:"relative",children:c.jsx("img",{src:s,alt:"Captured photo",className:"w-full h-64 object-cover rounded-2xl bg-muted"})})}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(pe,{variant:"outline",onClick:t,className:"flex-1 text-md",children:"Take again"}),c.jsx(pe,{onClick:r,className:"flex-1 text-md",children:"Looks good"})]})]})})},jd=({fullName:e,onComplete:t,onStartOver:r})=>c.jsxs(_e,{className:"w-full max-w-md mx-auto",children:[c.jsxs(yn,{className:"text-center",children:[c.jsx(fo,{className:"w-12 h-12 mx-auto mb-4 text-green-500"}),c.jsx(vn,{children:"Review Information"}),c.jsx("p",{className:"text-muted-foreground",children:"Please review your information before submitting"})]}),c.jsx($e,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(At,{children:"Full Name"}),c.jsx("p",{className:"font-medium",children:e})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"Selfie"}),c.jsx("div",{className:"text-green-500",children:"✓"})]}),c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"ID Front"}),c.jsx("div",{className:"text-green-500",children:"✓"})]}),c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"ID Back"}),c.jsx("div",{className:"text-green-500",children:"✓"})]})]}),c.jsx(pe,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),c.jsx(pe,{variant:"outline",className:"w-full text-md",onClick:r,children:"Start Over"})]})})]}),zd=({onComplete:e})=>(x.useEffect(()=>{const t=setTimeout(()=>{e()},3e3);return()=>clearTimeout(t)},[e]),c.jsx(_e,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:c.jsxs($e,{className:"text-center space-y-8",children:[c.jsx("div",{children:c.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"We're verifying your documents"})}),c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin"})})]})})),Bd=({apiEndpoint:e,hideNameStep:t,hideDocumentSelectionStep:r})=>{const[n,o]=x.useState("landing"),[s,i]=x.useState(""),[a,u]=x.useState(""),[l,f]=x.useState(null),[h,y]=x.useState(null),[d,b]=x.useState(null),m=Nd({mutationFn:Hd}),{toast:g}=Fr(),C=x.useMemo(()=>[...t?[]:["name"],...r?[]:["document-selection"],"selfie","selfie-confirm","pre-selfie","id-front","id-front-confirm","id-back","id-back-confirm","verify"],[t,r]),E=()=>t?r?"id-front":"document-selection":"name",T=()=>{(t||!!s)&&l&&h&&d&&(m.mutate({endpoint:e,data:{fullName:s,selfiePhoto:l,idCardFront:h,idCardBack:d}}),g({title:"KYC Complete",description:"Identity verification completed successfully"}),i(""),f(null),y(null),b(null),o("landing"))},w=()=>c.jsx(c.Fragment,{children:n!=="landing"&&c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"flex space-x-2",children:C.map((S,N)=>c.jsx("div",{className:`w-3 h-3 rounded-full ${C.indexOf(n)>=N?"bg-primary":"bg-muted"}`},S))})})}),P=()=>{switch(n){case"landing":return c.jsx(Md,{onContinue:()=>o(E())});case"name":return c.jsx(Ld,{fullName:s,onNameChange:i,onContinue:()=>o(r?"id-front":"document-selection"),renderProgress:w});case"document-selection":return c.jsx(Fd,{selectedDocumentType:a,onDocumentTypeChange:u,onContinue:()=>o("id-front"),onBack:()=>o(t?"landing":"name"),renderProgress:w});case"id-front":return c.jsx(wn,{acceptedFile:h,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"id-back":return c.jsx(wn,{acceptedFile:d,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"pre-selfie":return c.jsx($d,{onContinue:()=>o("selfie"),onBack:()=>o("name")});case"selfie":return c.jsx(wn,{acceptedFile:l,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"selfie-confirm":return l?c.jsx(xn,{photo:l,onRetake:()=>{f(null),o("selfie")},onConfirm:()=>o("verify"),onBack:()=>o("selfie"),renderProgress:w}):null;case"id-front-confirm":return h?c.jsx(xn,{photo:h,onRetake:()=>{y(null),o("id-front")},onConfirm:()=>o("id-back"),onBack:()=>o("id-front"),renderProgress:w}):null;case"id-back-confirm":return d?c.jsx(xn,{photo:d,onRetake:()=>{b(null),o("id-back")},onConfirm:()=>o("pre-selfie"),onBack:()=>o("id-back"),renderProgress:w}):null;case"verify":return c.jsx(jd,{fullName:s,onComplete:()=>o("processing"),onStartOver:()=>o("landing")});case"processing":return c.jsx(zd,{onComplete:T});default:return null}};return c.jsx("div",{className:"w-[430px]",children:P()})};async function Hd({endpoint:e,data:t}){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw new Error("Network response was not ok");return r.json()}const Vd=new Ed;return()=>c.jsx(Sd,{client:Vd,children:c.jsxs(Jc,{children:[c.jsx(Fa,{}),c.jsx(hl,{}),c.jsx(Bd,{})]})})});
61
+ */const Fp=tt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
62
+ * @license lucide-react v0.462.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
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"}]]);/**
67
+ * @license lucide-react v0.462.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
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"}]]);/**
72
+ * @license lucide-react v0.462.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
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"}]]);/**
77
+ * @license lucide-react v0.462.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
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"}]]);/**
82
+ * @license lucide-react v0.462.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
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"}]]);/**
87
+ * @license lucide-react v0.462.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
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"}]]);/**
92
+ * @license lucide-react v0.462.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
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"}]]);/**
97
+ * @license lucide-react v0.462.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
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"}]]),fa="-",Up=e=>{const t=zp(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(fa);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(fa);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 Yp(Object.entries(e.classGroups),r).forEach(([o,a])=>{ha(a,n,o,t)}),n},ha=(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(qp(s)){ha(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{ha(a,tc(t,o),r,n)})})},tc=(e,t)=>{let r=e;return t.split(fa).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},qp=e=>e.isThemeGetter,Yp=(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 E=w[k];o.push(x+E)}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=>Cn(e)||rm.has(e)||tm.test(e),wr=e=>_n(e,"length",mm),Cn=e=>!!e&&!Number.isNaN(Number(e)),pa=e=>_n(e,"number",Cn),fs=e=>!!e&&Number.isInteger(Number(e)),lm=e=>e.endsWith("%")&&Cn(e.slice(0,-1)),le=e=>sc.test(e),xr=e=>nm.test(e),cm=new Set(["length","size","percentage"]),dm=e=>_n(e,cm,oc),um=e=>_n(e,"position",oc),fm=new Set(["image","url"]),hm=e=>_n(e,fm,gm),pm=e=>_n(e,"",vm),hs=()=>!0,_n=(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"),E=De("sepia"),P=De("skew"),T=De("space"),B=De("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",le,t],A=()=>[le,t],j=()=>["",nr,wr],I=()=>["auto",Cn,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"],V=()=>["","0",le],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Se=()=>[Cn,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:V(),hueRotate:Se(),invert:V(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[lm,wr],inset:X(),margin:X(),opacity:Se(),padding:A(),saturate:Se(),scale:Se(),sepia:V(),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:V()}],shrink:[{shrink:V()}],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",...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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"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",pa]}],"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",Cn,pa]}],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: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:[...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: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:[E]}],"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":[E]}],"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":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"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,pa]}],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 ve(...e){return ym(zl(e))}const bm=Ep,ac=m.forwardRef(({className:e,...t},r)=>l.jsx(Vl,{ref:r,className:ve("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=ua("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:ve(wm({variant:t}),e),...r}));ic.displayName=$l.displayName;const xm=m.forwardRef(({className:e,...t},r)=>l.jsx(jl,{ref:r,className:ve("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:ve("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:ve("text-sm font-semibold",e),...t}));cc.displayName=Bl.displayName;const dc=m.forwardRef(({className:e,...t},r)=>l.jsx(Wl,{ref:r,className:ve("text-sm opacity-90",e),...t}));dc.displayName=Wl.displayName;function Cm(){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"],_m="(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='${_m}',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},ma=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:ma++,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)||ma++;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)||ma++;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",qm="16px",fc=4e3,Ym=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:E,removeToast:P,defaultRichColors:T,closeButton:B,style:$,cancelButtonStyle:z,actionButtonStyle:X,className:A="",descriptionClassName:j="",duration:I,position:J,gap:q,loadingIcon:D,expandByDefault:M,classNames:V,icons:ae,closeButtonAriaLabel:Se="Close toast",pauseWhenPageIsHidden:de}=e,[ue,he]=S.useState(null),[Fe,rt]=S.useState(null),[Y,ke]=S.useState(!1),[Ae,ye]=S.useState(!1),[pe,be]=S.useState(!1),[Je,lt]=S.useState(!1),[Rt,er]=S.useState(!1),[mr,as]=S.useState(0),[vr,_]=S.useState(0),N=S.useRef(f.duration||I||fc),O=S.useRef(null),U=S.useRef(null),W=w===0,L=w+1<=x,Q=f.type,me=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:B},[f.closeButton,B]),Go=S.useMemo(()=>f.duration||I||fc,[f.duration,I]),bn=S.useRef(0),rr=S.useRef(0),Xo=S.useRef(0),yr=S.useRef(null),[Ri,Jo]=J.split("-"),Oh=S.useMemo(()=>y.reduce((oe,Oe,Le)=>Le>=gr?oe:oe+Oe.height,0),[y,gr]),Mh=Fm(),w_=f.invert||v,el=Q==="loading";rr.current=S.useMemo(()=>gr*q+Oh,[gr,Oh]),S.useEffect(()=>{N.current=Go},[Go]),S.useEffect(()=>{ke(!0)},[]),S.useEffect(()=>{let oe=U.current;if(oe){let Oe=oe.getBoundingClientRect().height;return _(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(!Y)return;let oe=U.current,Oe=oe.style.height;oe.style.height="auto";let Le=oe.getBoundingClientRect().height;oe.style.height=Oe,_(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])},[Y,f.title,f.description,g,f.id]);let Yr=S.useCallback(()=>{ye(!0),as(rr.current),g(oe=>oe.filter(Oe=>Oe.toastId!==f.id)),setTimeout(()=>{P(f)},Qm)},[f,P,g,rr]);S.useEffect(()=>{if(f.promise&&Q==="loading"||f.duration===1/0||f.type==="loading")return;let oe;return E||p||de&&Mh?(()=>{if(Xo.current<bn.current){let Oe=new Date().getTime()-bn.current;N.current=N.current-Oe}Xo.current=new Date().getTime()})():N.current!==1/0&&(bn.current=new Date().getTime(),oe=setTimeout(()=>{var Oe;(Oe=f.onAutoClose)==null||Oe.call(f,f),Yr()},N.current)),()=>clearTimeout(oe)},[E,p,f,Q,de,Mh,Yr]),S.useEffect(()=>{f.delete&&Yr()},[Yr,f.delete]);function x_(){var oe,Oe,Le;return ae!=null&&ae.loading?S.createElement("div",{className:Pt(V==null?void 0:V.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(V==null?void 0:V.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(V==null?void 0:V.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,V==null?void 0:V.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,V==null?void 0:V.default,V==null?void 0:V[Q],(r=f==null?void 0:f.classNames)==null?void 0:r[Q]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:T,"data-styled":!(f.jsx||f.unstyled||b),"data-mounted":Y,"data-promise":!!f.promise,"data-swiped":Rt,"data-removed":Ae,"data-visible":L,"data-y-position":Ri,"data-x-position":Jo,"data-index":w,"data-front":W,"data-swiping":pe,"data-dismissible":me,"data-type":Q,"data-invert":w_,"data-swipe-out":Je,"data-swipe-direction":Fe,"data-expanded":!!(E||M&&Y),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${Ae?mr:rr.current}px`,"--initial-height":M?"auto":`${vr}px`,...$,...f.style},onDragEnd:()=>{be(!1),he(null),yr.current=null},onPointerDown:oe=>{el||!me||(O.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||!me)return;yr.current=null;let Bt=Number(((oe=U.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Zr=Number(((Oe=U.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wn=new Date().getTime()-((Le=O.current)==null?void 0:Le.getTime()),Wt=ue==="x"?Bt:Zr,Kr=Math.abs(Wt)/wn;if(Math.abs(Wt)>=Km||Kr>.11){as(rr.current),($t=f.onDismiss)==null||$t.call(f,f),rt(ue==="x"?Bt>0?"right":"left":Zr>0?"down":"up"),Yr(),lt(!0),er(!1);return}be(!1),he(null)},onPointerMove:oe=>{var Oe,Le,$t,Bt;if(!yr.current||!me||((Oe=window.getSelection())==null?void 0:Oe.toString().length)>0)return;let Zr=oe.clientY-yr.current.y,wn=oe.clientX-yr.current.x,Wt=(Le=e.swipeDirections)!=null?Le:Gm(J);!ue&&(Math.abs(wn)>1||Math.abs(Zr)>1)&&he(Math.abs(wn)>Math.abs(Zr)?"x":"y");let Kr={x:0,y:0};ue==="y"?(Wt.includes("top")||Wt.includes("bottom"))&&(Wt.includes("top")&&Zr<0||Wt.includes("bottom")&&Zr>0)&&(Kr.y=Zr):ue==="x"&&(Wt.includes("left")||Wt.includes("right"))&&(Wt.includes("left")&&wn<0||Wt.includes("right")&&wn>0)&&(Kr.x=wn),(Math.abs(Kr.x)>0||Math.abs(Kr.y)>0)&&er(!0),($t=U.current)==null||$t.style.setProperty("--swipe-amount-x",`${Kr.x}px`),(Bt=U.current)==null||Bt.style.setProperty("--swipe-amount-y",`${Kr.y}px`)}},tr&&!f.jsx?S.createElement("button",{"aria-label":Se,"data-disabled":el,"data-close-button":!0,onClick:el||!me?()=>{}:()=>{var oe;Yr(),(oe=f.onDismiss)==null||oe.call(f,f)},className:Pt(V==null?void 0:V.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(V==null?void 0:V.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||x_():null,f.type!=="loading"?f.icon||(ae==null?void 0:ae[Q])||Em(Q):null):null,S.createElement("div",{"data-content":"",className:Pt(V==null?void 0:V.content,(i=f==null?void 0:f.classNames)==null?void 0:i.content)},S.createElement("div",{"data-title":"",className:Pt(V==null?void 0:V.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,V==null?void 0:V.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)&&me&&((Le=(Oe=f.cancel).onClick)==null||Le.call(Oe,oe),Yr())},className:Pt(V==null?void 0:V.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&&Yr())},className:Pt(V==null?void 0:V.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?qm: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:E}=e,[P,T]=S.useState([]),B=S.useMemo(()=>Array.from(new Set([n].concat(P.filter(de=>de.position).map(de=>de.position)))),[P,n]),[$,z]=S.useState([]),[X,A]=S.useState(!1),[j,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,""),V=S.useRef(null),ae=S.useRef(!1),Se=S.useCallback(de=>{T(ue=>{var he;return(he=ue.find(Fe=>Fe.id===de.id))!=null&&he.delete||ct.dismiss(de.id),ue.filter(({id:Fe})=>Fe!==de.id)})},[]);return S.useEffect(()=>ct.subscribe(de=>{if(de.dismiss){T(ue=>ue.map(he=>he.id===de.id?{...he,delete:!0}:he));return}setTimeout(()=>{Ge.flushSync(()=>{T(ue=>{let he=ue.findIndex(Fe=>Fe.id===de.id);return he!==-1?[...ue.slice(0,he),{...ue[he],...de},...ue.slice(he+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:he})=>{try{q(he?"dark":"light")}catch(Fe){console.error(Fe)}})}},[u]),S.useEffect(()=>{P.length<=1&&A(!1)},[P]),S.useEffect(()=>{let de=ue=>{var he,Fe;s.every(rt=>ue[rt]||ue.code===rt)&&(A(!0),(he=D.current)==null||he.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()=>{V.current&&(V.current.focus({preventScroll:!0}),V.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},B.map((de,ue)=>{var he;let[Fe,rt]=de.split("-");return P.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&&P.length>1&&!o,"data-x-position":rt,style:{"--front-toast-height":`${((he=$[0])==null?void 0:he.height)||0}px`,"--width":`${Ym}px`,"--gap":`${x}px`,...f,...Jm(c,d)},onBlur:Y=>{ae.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(ae.current=!1,V.current&&(V.current.focus({preventScroll:!0}),V.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,V.current=Y.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},P.filter(Y=>!Y.position&&ue===0||Y.position===de).map((Y,ke)=>{var Ae,ye;return S.createElement(Xm,{key:Y.id,icons:w,index:ke,toast:Y,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:P.filter(pe=>pe.position==Y.position),heights:$.filter(pe=>pe.position==Y.position),setHeights:z,expandByDefault:o,gap:x,loadingIcon:y,expanded:X,pauseWhenPageIsHidden:E,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"],Cr=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 va(e,t,r){return yt(e,Cr(t,r))}function sr(e,t){return typeof e=="function"?e(t):e}function or(e){return e.split("-")[0]}function Sn(e){return e.split("-")[1]}function ga(e){return e==="x"?"y":"x"}function ya(e){return e==="y"?"height":"width"}const av=new Set(["top","bottom"]);function Ut(e){return av.has(or(e))?"y":"x"}function ba(e){return ga(Ut(e))}function iv(e,t,r){r===void 0&&(r=!1);const n=Sn(e),s=ba(e),o=ya(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[wa(e),t,wa(t)]}function wa(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=Sn(e);let o=uv(or(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(wa)))),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=ba(t),i=ya(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(Sn(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:E}=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}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):E.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},E=io(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-E.top+b.top)/k.y,bottom:(E.bottom-x.bottom+b.bottom)/k.y,left:(x.left-E.left+b.left)/k.x,right:(E.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=ba(s),b=ya(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],E=v[f]-o.reference[f],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let T=P?P[w]:0;(!T||!await(a.isElement==null?void 0:a.isElement(P)))&&(T=i.floating[w]||o.floating[b]);const B=k/2-E/2,$=T/2-p[b]/2-1,z=Cr(h[x],$),X=Cr(h[y],$),A=z,j=T-p[b]-X,I=T/2-p[b]/2+B,J=va(A,I,j),q=!c.arrow&&Sn(s)!=null&&I!==J&&o.reference[b]/2-(I<A?z:X)-p[b]/2<0,D=q?I<A?I-A:I-j:0;return{[f]:v[f]+D,data:{[f]:J,centerOffset:I-J-D,...q&&{alignmentOffset:D}},reset:q}}}),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)),E=v||(w||!p?[ao(i)]:lv(i)),P=b!=="none";!v&&P&&E.push(...fv(i,p,b,k));const T=[i,...E],B=await ps(t,g),$=[];let z=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&$.push(B[x]),h){const I=iv(s,a,k);$.push(B[I[0]],B[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=T[I];if(J&&(!(h==="alignment"?y!==Ut(J):!1)||z.every(M=>M.overflows[0]>0&&Ut(M.placement)===y)))return{data:{index:I,overflows:z},reset:{placement:J}};let q=(A=z.filter(D=>D.overflows[0]<=0).sort((D,M)=>D.overflows[1]-M.overflows[1])[0])==null?void 0:A.placement;if(!q)switch(f){case"bestFit":{var j;const D=(j=z.filter(M=>{if(P){const V=Ut(M.placement);return V===y||V==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(V=>V>0).reduce((V,ae)=>V+ae,0)]).sort((M,V)=>M[1]-V[1])[0])==null?void 0:j[0];D&&(q=D);break}case"initialPlacement":q=i;break}if(s!==q)return{reset:{placement:q}}}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=Sn(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=ga(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=va(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=va(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=ga(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,E=o.reference[v]+o.reference[w]-g.mainAxis;f<k?f=k:f>E&&(f=E)}if(d){var x,y;const w=v==="y"?"width":"height",k=wc.has(or(s)),E=o.reference[h]-o.floating[w]+(k&&((x=a.offset)==null?void 0:x[h])||0)+(k?0:g.crossAxis),P=o.reference[h]+o.reference[w]+(k?0:((y=a.offset)==null?void 0:y[h])||0)-(k?g.crossAxis:0);b<E?b=E:b>P&&(b=P)}return{[v]:f,[h]:b}}}},Cv=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=Sn(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=Cr(p-u[g],y),E=Cr(b-u[x],w),P=!t.middlewareData.shift;let T=k,B=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(B=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=y),P&&!v){const z=yt(u.left,0),X=yt(u.right,0),A=yt(u.top,0),j=yt(u.bottom,0);f?B=b-2*(z!==0||X!==0?z+X:yt(u.left,u.right)):T=p-2*(A!==0||j!==0?A+j:yt(u.top,u.bottom))}await c({...t,availableWidth:B,availableHeight:T});const $=await a.getDimensions(i.floating);return b!==$.width||p!==$.height?{reset:{rects:!0}}:{}}}};function lo(){return typeof window<"u"}function kn(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 Cc(e){return!lo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const _v=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)&&!_v.has(s)}const Sv=new Set(["table","td","th"]);function kv(e){return Sv.has(kn(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 xa(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=_r(e);for(;zt(t)&&!Nn(t);){if(xa(t))return t;if(co(t))return null;t=_r(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 Nn(e){return Mv.has(kn(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 _r(e){if(kn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cc(e)&&e.host||Ht(e);return Cc(t)?t.host:t}function _c(e){const t=_r(e);return Nn(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&ms(t)?t:_c(t)}function vs(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=_c(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=bt(s);if(o){const i=_a(a);return t.concat(a,a.visualViewport||[],ms(s)?s:[],i&&r?vs(i):[])}return t.concat(s,vs(s,[],r))}function _a(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 Sa(e){return Tt(e)?e:e.contextElement}function En(e){const t=Sa(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 Jr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Sa(e);let a=jt(1);t&&(n?Tt(n)&&(a=En(n)):a=En(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=_a(b);for(;p&&n&&f!==b;){const g=En(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=_a(b)}}return io({width:u,height:h,x:c,y:d})}function ka(e,t){const r=uo(e).scrollLeft;return t?t.left+r:Jr(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:ka(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)&&((kn(n)!=="body"||ms(a))&&(c=uo(n)),zt(n))){const f=Jr(n);d=En(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+ka(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=Jr(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=zt(e)?En(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=_r(e);return r===t||!Tt(r)||Nn(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)&&kn(i)!=="body"),s=null;const o=Ot(e).position==="fixed";let a=o?_r(e):e;for(;Tt(a)&&!Nn(a);){const i=Ot(a),c=xa(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=_r(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=Cr(h.right,d.right),d.bottom=Cr(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=Jr(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const c=jt(0);function d(){c.x=ka(s)}if(n||!n&&!o)if((kn(t)!=="body"||ms(s))&&(i=uo(t)),n){const f=Jr(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 Na(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=_r(e);for(;s&&!Nn(s);){if(Tt(s)&&!Na(s))return s;s=_r(s)}return r}let n=Tc(e,t);for(;n&&kv(n)&&Na(n);)n=Tc(n,t);return n&&Nn(n)&&Na(n)&&!xa(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 qv(e){return Ot(e).direction==="rtl"}const Yv={convertOffsetParentRelativeRectToViewportRelativeRect:Iv,getDocumentElement:Ht,getClippingRect:jv,getOffsetParent:Oc,getElementRects:zv,getClientRects:Fv,getDimensions:Uv,getScale:En,isElement:Tt,isRTL:qv};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,Cr(1,c))||1};let k=!0;function E(P){const T=P[0].intersectionRatio;if(T!==c){if(!k)return a();T?a(!1,T):n=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Mc(d,e.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(E,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(E,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=Sa(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?Jr(e):null;c&&g();function g(){const x=Jr(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=Cv,Rv=gv,Ac=mv,eg=xv,tg=(e,t,r)=>{const n=new Map,s={platform:Yv,...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 Ea(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(M=>{M!==P.current&&(P.current=M,p(M))},[]),w=m.useCallback(M=>{M!==T.current&&(T.current=M,x(M))},[]),k=o||b,E=a||g,P=m.useRef(null),T=m.useRef(null),B=m.useRef(u),$=c!=null,z=Ea(c),X=Ea(s),A=Ea(d),j=m.useCallback(()=>{if(!P.current||!T.current)return;const M={placement:t,strategy:r,middleware:v};X.current&&(M.platform=X.current),tg(P.current,T.current,M).then(V=>{const ae={...V,isPositioned:A.current!==!1};I.current&&!ho(B.current,ae)&&(B.current=ae,is.flushSync(()=>{h(ae)}))})},[v,t,r,X,A]);fo(()=>{d===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,h(M=>({...M,isPositioned:!1})))},[d]);const I=m.useRef(!1);fo(()=>(I.current=!0,()=>{I.current=!1}),[]),fo(()=>{if(k&&(P.current=k),E&&(T.current=E),k&&E){if(z.current)return z.current(k,E,j);j()}},[k,E,j,z,$]);const J=m.useMemo(()=>({reference:P,floating:T,setReference:y,setFloating:w}),[y,w]),q=m.useMemo(()=>({reference:k,floating:E}),[k,E]),D=m.useMemo(()=>{const M={position:r,left:0,top:0};if(!q.floating)return M;const V=Ic(q.floating,u.x),ae=Ic(q.floating,u.y);return i?{...M,transform:"translate("+V+"px, "+ae+"px)",...Dc(q.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:V,top:ae}},[r,i,q.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:j,refs:J,elements:q,floatingStyles:D}),[u,j,J,q,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 Pa="Popper",[Lc,Pn]=Xr(Pa),[vg,Vc]=Lc(Pa),$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=Pa;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 Ta="PopperContent",[gg,yg]=Lc(Ta),jc=m.forwardRef((e,t)=>{var Y,ke,Ae,ye,pe,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(Ta,r),[x,y]=m.useState(null),w=Ie(t,Je=>y(Je)),[k,E]=m.useState(null),P=mg(k),T=(P==null?void 0:P.width)??0,B=(P==null?void 0:P.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:q,isPositioned:D,middlewareData:M}=sg({strategy:"fixed",placement:$,whileElementsMounted:(...Je)=>Kv(...Je,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[ag({mainAxis:s+B,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:T,arrowHeight:B}),v&&ug({strategy:"referenceHidden",...j})]}),[V,ae]=zc(q),Se=Et(b);Re(()=>{D&&(Se==null||Se())},[D,Se]);const de=(Y=M.arrow)==null?void 0:Y.x,ue=(ke=M.arrow)==null?void 0:ke.y,he=((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,(pe=M.transformOrigin)==null?void 0:pe.y].join(" "),...((be=M.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(gg,{scope:r,placedSide:V,onArrowChange:E,arrowX:de,arrowY:ue,shouldHideArrow:he,children:l.jsx(we.div,{"data-side":V,"data-align":ae,...p,ref:w,style:{...p.style,animation:D?void 0:"none"}})})})});jc.displayName=Ta;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 qc=$c,po=Wc,Oa=jc,Ma=Hc,[mo,S_]=Xr("Tooltip",[Pn]),Aa=Pn(),Yc="TooltipProvider",Cg=700,Zc="tooltip.open",[_g,Kc]=mo(Yc),Qc=e=>{const{__scopeTooltip:t,delayDuration:r=Cg,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(_g,{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=Yc;var Gc="Tooltip",[k_,vo]=mo(Gc),Da="TooltipTrigger",Sg=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=vo(Da,r),o=Kc(Da,r),a=Aa(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=Da;var kg="TooltipPortal",[N_,Ng]=mo(kg,{forceMount:void 0}),Tn="TooltipContent",Xc=m.forwardRef((e,t)=>{const r=Ng(Tn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=vo(Tn,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(Tn,e.__scopeTooltip),n=Kc(Tn,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()),E=Lg([...w,...k]);i(E),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(Tn,r),d=Aa(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(Oa,{"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=Tn;var Rc="TooltipArrow",Mg=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Aa(r);return Tg(Rc,r).isInside?null:l.jsx(Ma,{...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:ve("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 On=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(){}},Rr=typeof window>"u"||"Deno"in globalThis;function nt(){}function jg(e,t){return typeof e=="function"?e(t):e}function Ia(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!==Fa(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(en(t.options.mutationKey)!==en(o))return!1}else if(!gs(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Fa(e,t){return((t==null?void 0:t.queryKeyHashFn)||en)(e)}function en(e){return JSON.stringify(e,(t,r)=>Va(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 La(e,t){if(e===t)return e;const r=sd(e)&&sd(t);if(r||Va(e)&&Va(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]=La(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 Va(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 $a(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 La(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 La(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 qg=(wh=class extends On{constructor(){super();ee(this,un);ee(this,Vr);ee(this,Zn);K(this,Zn,t=>{if(!Rr&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){C(this,Vr)||this.setEventListener(C(this,Zn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Vr))==null||t.call(this),K(this,Vr,void 0))}setEventListener(t){var r;K(this,Zn,t),(r=C(this,Vr))==null||r.call(this),K(this,Vr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){C(this,un)!==t&&(K(this,un,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof C(this,un)=="boolean"?C(this,un):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},un=new WeakMap,Vr=new WeakMap,Zn=new WeakMap,wh),Ba=new qg,Yg=(xh=class extends On{constructor(){super();ee(this,Kn,!0);ee(this,$r);ee(this,Qn);K(this,Qn,t=>{if(!Rr&&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(){C(this,$r)||this.setEventListener(C(this,Qn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,$r))==null||t.call(this),K(this,$r,void 0))}setEventListener(t){var r;K(this,Qn,t),(r=C(this,$r))==null||r.call(this),K(this,$r,t(this.setOnline.bind(this)))}setOnline(t){C(this,Kn)!==t&&(K(this,Kn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return C(this,Kn)}},Kn=new WeakMap,$r=new WeakMap,Qn=new WeakMap,xh),bo=new Yg;function Wa(){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=Wa(),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=()=>Ba.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 P;if(o())return;const y=e.retry??(Rr?0:3),w=e.retryDelay??Zg,k=typeof w=="function"?w(r,x):w,E=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!E){v(x);return}r++,(P=e.onFail)==null||P.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=(Ch=class{constructor(){ee(this,fn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ia(this.gcTime)&&K(this,fn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rr?1/0:5*60*1e3))}clearGcTimeout(){C(this,fn)&&(clearTimeout(C(this,fn)),K(this,fn,void 0))}},fn=new WeakMap,Ch),Gg=(_h=class extends ud{constructor(t){super();ee(this,Lt);ee(this,Gn);ee(this,Xn);ee(this,Nt);ee(this,hn);ee(this,Xe);ee(this,Us);ee(this,pn);K(this,pn,!1),K(this,Us,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,hn,t.client),K(this,Nt,C(this,hn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,Gn,Xg(this.options)),this.state=t.state??C(this,Gn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,Xe))==null?void 0:t.promise}setOptions(t){this.options={...C(this,Us),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Nt).remove(this)}setData(t,r){const n=$a(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=C(this,Xe))==null?void 0:n.promise;return(s=C(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(C(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=C(this,Xe))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=C(this,Xe))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(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||(C(this,Xe)&&(C(this,pn)?C(this,Xe).cancel({revert:!0}):C(this,Xe).cancelRetry()),this.scheduleGc()),C(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=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(C(this,Xe))return C(this,Xe).continueRetry(),C(this,Xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(E=>E.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,pn,!0),n.signal)})},o=()=>{const k=ad(this.options,r),P=(()=>{const T={client:C(this,hn),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return K(this,pn,!1),this.options.persister?this.options.persister(k,P,this):k(P)},i=(()=>{const k={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:C(this,hn),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,E)=>{ce(this,Lt,br).call(this,{type:"failed",failureCount:k,error:E})},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 C(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=C(this,Nt).config).onSuccess)==null||f.call(v,k,this),(p=(b=C(this,Nt).config).onSettled)==null||p.call(b,k,this.state.error,this),k}catch(k){if(k instanceof cd){if(k.silent)return C(this,Xe).promise;if(k.revert){if(this.setState({...C(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=C(this,Nt).config).onError)==null||x.call(g,k,this),(w=(y=C(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,hn=new WeakMap,Xe=new WeakMap,Us=new WeakMap,pn=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()}),C(this,Nt).notify({query:this,type:"updated",action:t})})},_h);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 On{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??Fa(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){C(this,Gt).has(t.queryHash)||(C(this,Gt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=C(this,Gt).get(t.queryHash);r&&(t.destroy(),r===t&&C(this,Gt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Gt).get(t)}getAll(){return[...C(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,mn);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){C(this,Xt).includes(t)||(C(this,Xt).push(t),this.clearGcTimeout(),C(this,at).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,Xt,C(this,Xt).filter(r=>r!==t)),this.scheduleGc(),C(this,at).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Xt).length||(this.state.status==="pending"?this.scheduleGc():C(this,at).remove(this))}continue(){var t;return((t=C(this,mn))==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,E,P,T,B;const r=()=>{ce(this,Jt,Qr).call(this,{type:"continue"})};K(this,mn,dd({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:($,z)=>{ce(this,Jt,Qr).call(this,{type:"failed",failureCount:$,error:z})},onPause:()=>{ce(this,Jt,Qr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,at).canRun(this)}));const n=this.state.status==="pending",s=!C(this,mn).canStart();try{if(n)r();else{ce(this,Jt,Qr).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=C(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,Qr).call(this,{type:"pending",context:z,variables:t,isPaused:s})}const $=await C(this,mn).start();return await((u=(d=C(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=C(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,Qr).call(this,{type:"success",data:$}),$}catch($){try{throw await((y=(x=C(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((P=(E=C(this,at).config).onSettled)==null?void 0:P.call(E,void 0,$,this.state.variables,this.state.context,this)),await((B=(T=this.options).onSettled)==null?void 0:B.call(T,void 0,$,t,this.state.context)),$}finally{ce(this,Jt,Qr).call(this,{type:"error",error:$})}}finally{C(this,at).runNext(this)}}},Xt=new WeakMap,at=new WeakMap,mn=new WeakMap,Jt=new WeakSet,Qr=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(()=>{C(this,Xt).forEach(n=>{n.onMutationUpdate(t)}),C(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 On{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:++Ro(this,Hs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){C(this,ur).add(t);const r=wo(t);if(typeof r=="string"){const n=C(this,Vt).get(r);n?n.push(t):C(this,Vt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,ur).delete(t)){const r=wo(t);if(typeof r=="string"){const n=C(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&&C(this,Vt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=wo(t);if(typeof r=="string"){const n=C(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=C(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(()=>{C(this,ur).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,ur).clear(),C(this,Vt).clear()})}getAll(){return Array.from(C(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,E)=>{if(p)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const X={client:t.client,queryKey:t.queryKey,pageParam:k,direction:E?"backward":"forward",meta:t.options.meta};return g(X),X})(),B=await x(T),{maxPages:$}=t.options,z=E?zg:Hg;return{pages:z(w.pages,B,$),pageParams:z(w.pageParams,k,$)}};if(s&&o.length){const w=s==="backward",k=w?ty:md,E={pages:o,pageParams:a},P=k(n,E);i=await y(E,P,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,Br);ee(this,Wr);ee(this,Jn);ee(this,Rn);ee(this,jr);ee(this,es);ee(this,ts);K(this,$e,e.queryCache||new Jg),K(this,Br,e.mutationCache||new ey),K(this,Wr,e.defaultOptions||{}),K(this,Jn,new Map),K(this,Rn,new Map),K(this,jr,0)}mount(){Ro(this,jr)._++,C(this,jr)===1&&(K(this,es,Ba.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,$e).onFocus())})),K(this,ts,bo.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,$e).onOnline())})))}unmount(){var e,t;Ro(this,jr)._--,C(this,jr)===0&&((e=C(this,es))==null||e.call(this),K(this,es,void 0),(t=C(this,ts))==null||t.call(this),K(this,ts,void 0))}isFetching(e){return C(this,$e).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,Br).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=C(this,$e).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=C(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 C(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=C(this,$e).get(n.queryHash),o=s==null?void 0:s.state.data,a=jg(t,o);if(a!==void 0)return C(this,$e).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>C(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=C(this,$e).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=C(this,$e);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=C(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(()=>C(this,$e).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(nt).catch(nt)}invalidateQueries(e,t={}){return Ke.batch(()=>(C(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(()=>C(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=C(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()?C(this,Br).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,$e)}getMutationCache(){return C(this,Br)}getDefaultOptions(){return C(this,Wr)}setDefaultOptions(e){K(this,Wr,e)}setQueryDefaults(e,t){C(this,Jn).set(en(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Jn).values()],r={};return t.forEach(n=>{gs(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){C(this,Rn).set(en(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(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={...C(this,Wr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fa(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:{...C(this,Wr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,$e).clear(),C(this,Br).clear()}},$e=new WeakMap,Br=new WeakMap,Wr=new WeakMap,Jn=new WeakMap,Rn=new WeakMap,jr=new WeakMap,es=new WeakMap,ts=new WeakMap,Eh),ny=(Ph=class extends On{constructor(t,r){super();ee(this,Ne);ee(this,mt);ee(this,ge);ee(this,zs);ee(this,it);ee(this,vn);ee(this,rs);ee(this,fr);ee(this,Ur);ee(this,qs);ee(this,ns);ee(this,ss);ee(this,gn);ee(this,yn);ee(this,Hr);ee(this,os,new Set);this.options=r,K(this,mt,t),K(this,Ur,null),K(this,fr,Wa()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ge).addObserver(this),vd(C(this,ge),this.options)?ce(this,Ne,Ys).call(this):this.updateResult(),ce(this,Ne,ol).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ja(C(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ja(C(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Ne,al).call(this),ce(this,Ne,il).call(this),C(this,ge).removeObserver(this)}setOptions(t){const r=this.options,n=C(this,ge);if(this.options=C(this,mt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof St(this.options.enabled,C(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),C(this,ge).setOptions(this.options),r._defaulted&&!go(this.options,r)&&C(this,mt).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ge),observer:this});const s=this.hasListeners();s&&gd(C(this,ge),n,this.options,r)&&ce(this,Ne,Ys).call(this),this.updateResult(),s&&(C(this,ge)!==n||St(this.options.enabled,C(this,ge))!==St(r.enabled,C(this,ge))||Sr(this.options.staleTime,C(this,ge))!==Sr(r.staleTime,C(this,ge)))&&ce(this,Ne,rl).call(this);const o=ce(this,Ne,nl).call(this);s&&(C(this,ge)!==n||St(this.options.enabled,C(this,ge))!==St(r.enabled,C(this,ge))||o!==C(this,Hr))&&ce(this,Ne,sl).call(this,o)}getOptimisticResult(t){const r=C(this,mt).getQueryCache().build(C(this,mt),t),n=this.createResult(r,t);return oy(this,n)&&(K(this,it,n),K(this,rs,this.options),K(this,vn,C(this,ge).state)),n}getCurrentResult(){return C(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&&C(this,fr).status==="pending"&&C(this,fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,s))})}trackProp(t){C(this,os).add(t)}getCurrentQuery(){return C(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=C(this,mt).defaultQueryOptions(t),n=C(this,mt).getQueryCache().build(C(this,mt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,Ne,Ys).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,it)))}createResult(t,r){var $;const n=C(this,ge),s=this.options,o=C(this,it),a=C(this,vn),i=C(this,rs),d=t!==n?t.state:C(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(($=C(this,ss))==null?void 0:$.state.data,C(this,ss)):r.placeholderData,z!==void 0&&(g="success",f=$a(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===C(this,qs))f=C(this,ns);else try{K(this,qs,r.select),f=r.select(f),f=$a(o==null?void 0:o.data,f,r),K(this,ns,f),K(this,Ur,null)}catch(z){K(this,Ur,z)}C(this,Ur)&&(b=C(this,Ur),f=C(this,ns),p=Date.now(),g="error");const y=h.fetchStatus==="fetching",w=g==="pending",k=g==="error",E=w&&y,P=f!==void 0,B={status:g,fetchStatus:h.fetchStatus,isPending:w,isSuccess:g==="success",isError:k,isInitialLoading:E,isLoading:E,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&&!P,isPaused:h.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:k&&P,isStale:Ua(t,r),refetch:this.refetch,promise:C(this,fr),isEnabled:St(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=j=>{B.status==="error"?j.reject(B.error):B.data!==void 0&&j.resolve(B.data)},X=()=>{const j=K(this,fr,B.promise=Wa());z(j)},A=C(this,fr);switch(A.status){case"pending":t.queryHash===n.queryHash&&z(A);break;case"fulfilled":(B.status==="error"||B.data!==A.value)&&X();break;case"rejected":(B.status!=="error"||B.error!==A.reason)&&X();break}}return B}updateResult(){const t=C(this,it),r=this.createResult(C(this,ge),this.options);if(K(this,vn,C(this,ge).state),K(this,rs,this.options),C(this,vn).data!==void 0&&K(this,ss,C(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&&!C(this,os).size)return!0;const a=new Set(o??C(this,os));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,it)).some(i=>{const c=i;return C(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,vn=new WeakMap,rs=new WeakMap,fr=new WeakMap,Ur=new WeakMap,qs=new WeakMap,ns=new WeakMap,ss=new WeakMap,gn=new WeakMap,yn=new WeakMap,Hr=new WeakMap,os=new WeakMap,Ne=new WeakSet,Ys=function(t){ce(this,Ne,ll).call(this);let r=C(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,C(this,ge));if(Rr||C(this,it).isStale||!Ia(t))return;const n=td(C(this,it).dataUpdatedAt,t)+1;K(this,gn,setTimeout(()=>{C(this,it).isStale||this.updateResult()},n))},nl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ge)):this.options.refetchInterval)??!1},sl=function(t){ce(this,Ne,il).call(this),K(this,Hr,t),!(Rr||St(this.options.enabled,C(this,ge))===!1||!Ia(C(this,Hr))||C(this,Hr)===0)&&K(this,yn,setInterval(()=>{(this.options.refetchIntervalInBackground||Ba.isFocused())&&ce(this,Ne,Ys).call(this)},C(this,Hr)))},ol=function(){ce(this,Ne,rl).call(this),ce(this,Ne,sl).call(this,ce(this,Ne,nl).call(this))},al=function(){C(this,gn)&&(clearTimeout(C(this,gn)),K(this,gn,void 0))},il=function(){C(this,yn)&&(clearInterval(C(this,yn)),K(this,yn,void 0))},ll=function(){const t=C(this,mt).getQueryCache().build(C(this,mt),this.options);if(t===C(this,ge))return;const r=C(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(C(this,it))}),C(this,mt).getQueryCache().notify({query:C(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&&ja(e,t,t.refetchOnMount)}function ja(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&&Ua(e,t)}return!1}function gd(e,t,r,n){return(e!==t||St(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ua(e,r)}function Ua(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 On{constructor(r,n){super();ee(this,pr);ee(this,zr);ee(this,qr);ee(this,vt);ee(this,hr);K(this,zr,r),this.setOptions(n),this.bindMethods(),ce(this,pr,ea).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=C(this,zr).defaultMutationOptions(r),go(this.options,n)||C(this,zr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&en(n.mutationKey)!==en(this.options.mutationKey)?this.reset():((s=C(this,vt))==null?void 0:s.state.status)==="pending"&&C(this,vt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=C(this,vt))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,pr,ea).call(this),ce(this,pr,cl).call(this,r)}getCurrentResult(){return C(this,qr)}reset(){var r;(r=C(this,vt))==null||r.removeObserver(this),K(this,vt,void 0),ce(this,pr,ea).call(this),ce(this,pr,cl).call(this)}mutate(r,n){var s;return K(this,hr,n),(s=C(this,vt))==null||s.removeObserver(this),K(this,vt,C(this,zr).getMutationCache().build(C(this,zr),this.options)),C(this,vt).addObserver(this),C(this,vt).execute(r)}},zr=new WeakMap,qr=new WeakMap,vt=new WeakMap,hr=new WeakMap,pr=new WeakSet,ea=function(){var n;const r=((n=C(this,vt))==null?void 0:n.state)??hd();K(this,qr,{...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(C(this,hr)&&this.hasListeners()){const h=C(this,qr).variables,v=C(this,qr).context;(r==null?void 0:r.type)==="success"?((s=(n=C(this,hr)).onSuccess)==null||s.call(n,r.data,h,v),(a=(o=C(this,hr)).onSettled)==null||a.call(o,r.data,null,h,v)):(r==null?void 0:r.type)==="error"&&((c=(i=C(this,hr)).onError)==null||c.call(i,r.error,h,v),(u=(d=C(this,hr)).onSettled)==null||u.call(d,void 0,r.error,h,v))}this.listeners.forEach(h=>{h(C(this,qr))})})},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&&!Rr&&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 Cd(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 Ha=ua("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"}}),qe=m.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?hl:"button";return l.jsx(a,{className:ve(Ha({variant:t,size:r,className:e})),ref:o,...s})});qe.displayName="Button";const dt=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:ve("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:ve("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:ve("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:ve("text-sm text-muted-foreground",e),...t}));wy.displayName="CardDescription";const ut=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:ve("p-6 pt-0",e),...t}));ut.displayName="CardContent";const xy=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:ve("flex items-center p-6 pt-0",e),...t}));xy.displayName="CardFooter";const _d=({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(qe,{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:ve("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 Cy="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=Cy;var kd=Sd;const _y=ua("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),tn=m.forwardRef(({className:e,...t},r)=>l.jsx(kd,{ref:r,className:ve(_y(),e),...t}));tn.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(tn,{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(qe,{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(qe,{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(qe,{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"}}},qa=({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,E=d.current,P=E.getContext("2d");P&&(E.width=k.videoWidth,E.height=k.videoHeight,P.drawImage(k,0,0),E.toBlob(T=>{if(T){const B=new File([T],`${t}-${Date.now()}.jpg`,{type:"image/jpeg"});switch(t){case"selfie":n(B),f(),r("selfie-confirm");break;case"id-front":s(B),f(),r("id-front-confirm");break;case"id-back":o(B),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(qe,{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(qe,{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(qe,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),Ya=({photo:e,onRetake:t,onConfirm:r,onBack:n,renderProgress:s})=>{console.log("photo",e);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(qe,{variant:"outline",onClick:t,className:"flex-1 text-md",children:"Take again"}),l.jsx(qe,{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(tn,{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(tn,{className:"text-xs",children:"Selfie"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(tn,{className:"text-xs",children:"ID Front"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(tn,{className:"text-xs",children:"ID Back"}),l.jsx("div",{className:"text-green-500",children:"✓"})]})]}),l.jsx(qe,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),l.jsx(qe,{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})=>{const[r,n]=S.useState("landing"),[s,o]=S.useState(""),[a,i]=S.useState(""),[c,d]=S.useState(null),[u,h]=S.useState(null),[v,f]=S.useState(null),{data:b}=Ay(e,t),p=Cd({mutationFn:Oy}),{toast:g}=Qs(),x=S.useMemo(()=>[...b!=null&&b.hide_name_step?[]:["name"],...b!=null&&b.hide_document_selection_step?[]:["document-selection"],"selfie","selfie-confirm","pre-selfie","id-front","id-front-confirm","id-back","id-back-confirm","verify"],[b]),y=()=>b.hide_name_step?b.hide_document_selection_step?"id-front":"document-selection":"name",w=()=>{(b.hide_name_step||!!s)&&c&&u&&v&&(p.mutate({apiEndpoint:e,apiKey:t,data:{full_name:s,selfiePhotoFile:c,idPhotoFile:u,idPhotoBackFile:v}}),g({title:"KYC Complete",description:"Identity verification completed successfully"}),o(""),d(null),h(null),f(null),n("landing"))},k=()=>l.jsx(l.Fragment,{children:r!=="landing"&&l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"flex space-x-2",children:x.map((P,T)=>l.jsx("div",{className:`w-3 h-3 rounded-full ${x.indexOf(r)>=T?"bg-primary":"bg-muted"}`},P))})})}),E=()=>{switch(r){case"landing":return l.jsx(_d,{onContinue:()=>n(y())});case"name":return l.jsx(Sy,{fullName:s,onNameChange:o,onContinue:()=>n(b.hide_document_selection_step?"id-front":"document-selection"),renderProgress:k});case"document-selection":return l.jsx(ky,{selectedDocumentType:a,onDocumentTypeChange:i,onContinue:()=>n("id-front"),onBack:()=>n(b.hide_name_step?"landing":"name"),renderProgress:k});case"id-front":return l.jsx(qa,{acceptedFile:u,currentStep:r,setCurrentStep:n,setSelfiePhoto:d,setIdCardFront:h,setIdCardBack:f});case"id-back":return l.jsx(qa,{acceptedFile:v,currentStep:r,setCurrentStep:n,setSelfiePhoto:d,setIdCardFront:h,setIdCardBack:f});case"pre-selfie":return l.jsx(Ey,{onContinue:()=>n("selfie"),onBack:()=>n("name")});case"selfie":return l.jsx(qa,{acceptedFile:c,currentStep:r,setCurrentStep:n,setSelfiePhoto:d,setIdCardFront:h,setIdCardBack:f});case"selfie-confirm":return c?l.jsx(Ya,{photo:c,onRetake:()=>{d(null),n("selfie")},onConfirm:()=>n("verify"),onBack:()=>n("selfie"),renderProgress:k}):null;case"id-front-confirm":return u?l.jsx(Ya,{photo:u,onRetake:()=>{h(null),n("id-front")},onConfirm:()=>n("id-back"),onBack:()=>n("id-front"),renderProgress:k}):null;case"id-back-confirm":return v?l.jsx(Ya,{photo:v,onRetake:()=>{f(null),n("id-back")},onConfirm:()=>n("pre-selfie"),onBack:()=>n("id-back"),renderProgress:k}):null;case"verify":return l.jsx(Py,{fullName:s,onComplete:()=>n("processing"),onStartOver:()=>n("landing")});case"processing":return l.jsx(Nd,{onComplete:w});default:return null}};return l.jsx("div",{className:"w-[430px]",children:E()})};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.selfiePhotoFile,r.selfiePhotoFile.name),n.append("id_photo",r.idPhotoFile,r.idPhotoFile.name),n.append("id_photo_back",r.idPhotoBackFile,r.idPhotoBackFile.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",rn=e=>e instanceof Date,st=e=>e==null;const Ed=e=>typeof e=="object";var Be=e=>!st(e)&&!Array.isArray(e)&&Ed(e)&&!rn(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 xo=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=(xo(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=xo(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 _o=()=>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=_o(),{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 qt=e=>typeof e=="string",Md=(e,t,r,n,s)=>qt(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(rn(e)&&rn(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(rn(a)&&rn(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=_o(),{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=_o(),{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,E)=>{const P=H(s._fields,k);P&&P._f&&(P._f.mount=E)};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",So=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=>So(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 Ye(e,t){const r=Array.isArray(t)?t:xo(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))&&Ye(e,r.slice(0,-1)),e}var Fd=e=>{for(const t in e)if(At(e[t]))return!0;return!1};function ko(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])?[]:{},ko(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])?ko(e[s],[]):{...ko(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,ko(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&&qt(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}},No=e=>e instanceof RegExp,xs=e=>We(e)?e:No(e)?e.source:Be(e)?No(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 qd="AsyncFunction";var zy=e=>!!e&&!!e.validate&&!!(At(e.validate)&&e.validate.constructor.name===qd||Be(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===qd)),qy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Yd=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Cs=(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(Cs(i,t))break}else if(Be(i)&&Cs(i,t))break}}};function Zd(e,t,r){const n=H(e,r);if(n||xo(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 Yy=(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&&Ye(e,t),Gy=(e,t,r)=>{const n=bs(H(e,r));return Ee(n,"root",t[r]),Ee(e,r,n),e},Eo=e=>qt(e);function Kd(e,t,r="validate"){if(Eo(e)||Array.isArray(e)&&e.every(Eo)||xt(e)&&!e)return{type:r,message:Eo(e)?e:"",ref:t}}var Mn=e=>Be(e)&&!No(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())},E={},P=ei(a),T=ys(a),B=P||T,$=(g||Ra(a))&&We(a.value)&&We(y)||So(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,z=Ad.bind(null,p,n,E),X=(A,j,I,J=ar.maxLength,q=ar.minLength)=>{const D=A?j:I;E[p]={type:A?J:q,message:D,ref:a,...z(A?J:q,D)}};if(o?!Array.isArray(y)||!y.length:c&&(!B&&($||st(y))||xt(y)&&!y||T&&!Bd(i).isValid||P&&!Ud(i).isValid)){const{value:A,message:j}=Eo(c)?{value:!!c,message:c}:Mn(c);if(A&&(E[p]={type:ar.required,message:j,ref:w,...z(ar.required,j)},!n))return k(j),E}if(!$&&(!st(h)||!st(v))){let A,j;const I=Mn(v),J=Mn(h);if(!st(y)&&!isNaN(y)){const q=a.valueAsNumber||y&&+y;st(I.value)||(A=q>I.value),st(J.value)||(j=q<J.value)}else{const q=a.valueAsDate||new Date(y),D=ae=>new Date(new Date().toDateString()+" "+ae),M=a.type=="time",V=a.type=="week";qt(I.value)&&y&&(A=M?D(y)>D(I.value):V?y>I.value:q>new Date(I.value)),qt(J.value)&&y&&(j=M?D(y)<D(J.value):V?y<J.value:q<new Date(J.value))}if((A||j)&&(X(!!A,I.message,J.message,ar.max,ar.min),!n))return k(E[p].message),E}if((d||u)&&!$&&(qt(y)||o&&Array.isArray(y))){const A=Mn(d),j=Mn(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(E[p].message),E}if(f&&!$&&qt(y)){const{value:A,message:j}=Mn(f);if(No(A)&&!y.match(A)&&(E[p]={type:ar.pattern,message:j,ref:a,...z(ar.pattern,j)},!n))return k(j),E}if(b){if(At(b)){const A=await b(y,r),j=Kd(A,w);if(j&&(E[p]={...j,...z(ar.validate,j.message)},!n))return k(j.message),E}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&&(E[p]=A))}if(!ft(A)&&(E[p]={ref:w,...A},!n))return E}}return k(!0),E};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=_=>N=>{clearTimeout(d),d=setTimeout(_,N)},p=async _=>{if(!t.disabled&&(u.isValid||h.isValid||_)){const N=t.resolver?ft((await T()).errors):await $(n,!0);N!==r.isValid&&v.state.next({isValid:N})}},g=(_,N)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((_||Array.from(i.mount)).forEach(O=>{O&&(N?Ee(r.validatingFields,O,N):Ye(r.validatingFields,O))}),v.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},x=(_,N=[],O,U,W=!0,L=!0)=>{if(U&&O&&!t.disabled){if(a.action=!0,L&&Array.isArray(H(n,_))){const Q=O(H(n,_),U.argA,U.argB);W&&Ee(n,_,Q)}if(L&&Array.isArray(H(r.errors,_))){const Q=O(H(r.errors,_),U.argA,U.argB);W&&Ee(r.errors,_,Q),Qy(r.errors,_)}if((u.touchedFields||h.touchedFields)&&L&&Array.isArray(H(r.touchedFields,_))){const Q=O(H(r.touchedFields,_),U.argA,U.argB);W&&Ee(r.touchedFields,_,Q)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=ws(s,o)),v.state.next({name:_,isDirty:X(_,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ee(o,_,N)},y=(_,N)=>{Ee(r.errors,_,N),v.state.next({errors:r.errors})},w=_=>{r.errors=_,v.state.next({errors:r.errors,isValid:!1})},k=(_,N,O,U)=>{const W=H(n,_);if(W){const L=H(o,_,We(O)?H(s,_):O);We(L)||U&&U.defaultChecked||N?Ee(o,_,N?L:Hd(W._f)):I(_,L),a.mount&&p()}},E=(_,N,O,U,W)=>{let L=!1,Q=!1;const me={name:_};if(!t.disabled){if(!O||U){(u.isDirty||h.isDirty)&&(Q=r.isDirty,r.isDirty=me.isDirty=X(),L=Q!==me.isDirty);const Te=ir(H(s,_),N);Q=!!H(r.dirtyFields,_),Te?Ye(r.dirtyFields,_):Ee(r.dirtyFields,_,!0),me.dirtyFields=r.dirtyFields,L=L||(u.dirtyFields||h.dirtyFields)&&Q!==!Te}if(O){const Te=H(r.touchedFields,_);Te||(Ee(r.touchedFields,_,O),me.touchedFields=r.touchedFields,L=L||(u.touchedFields||h.touchedFields)&&Te!==O)}L&&W&&v.state.next(me)}return L?me:{}},P=(_,N,O,U)=>{const W=H(r.errors,_),L=(u.isValid||h.isValid)&&xt(N)&&r.isValid!==N;if(t.delayError&&O?(c=b(()=>y(_,O)),c(t.delayError)):(clearTimeout(d),c=null,O?Ee(r.errors,_,O):Ye(r.errors,_)),(O?!ir(W,O):W)||!ft(U)||L){const Q={...U,...L&&xt(N)?{isValid:N}:{},errors:r.errors,name:_};r={...r,...Q},v.state.next(Q)}},T=async _=>{g(_,!0);const N=await t.resolver(o,t.context,Hy(_||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(_),N},B=async _=>{const{errors:N}=await T(_);if(_)for(const O of _){const U=H(N,O);U?Ee(r.errors,O,U):Ye(r.errors,O)}else r.errors=N;return N},$=async(_,N,O={valid:!0})=>{for(const U in _){const W=_[U];if(W){const{_f:L,...Q}=W;if(L){const me=i.array.has(L.name),Te=W._f&&zy(W._f);Te&&u.validatingFields&&g([U],!0);const gt=await Qd(W,i.disabled,o,f,t.shouldUseNativeValidation&&!N,me);if(Te&&u.validatingFields&&g([U]),gt[L.name]&&(O.valid=!1,N))break;!N&&(H(gt,L.name)?me?Gy(r.errors,gt,L.name):Ee(r.errors,L.name,gt[L.name]):Ye(r.errors,L.name))}!ft(Q)&&await $(Q,N,O)}}return O.valid},z=()=>{for(const _ of i.unMount){const N=H(n,_);N&&(N._f.refs?N._f.refs.every(O=>!ti(O)):!ti(N._f.ref))&&Y(_)}i.unMount=new Set},X=(_,N)=>!t.disabled&&(_&&N&&Ee(o,_,N),!ir(ae(),s)),A=(_,N,O)=>Md(_,i,{...a.mount?o:We(N)?s:qt(_)?{[_]:N}:N},O,N),j=_=>Ka(H(a.mount?o:s,_,t.shouldUnregister?H(s,_,[]):[])),I=(_,N,O={})=>{const U=H(n,_);let W=N;if(U){const L=U._f;L&&(!L.disabled&&Ee(o,_,Wd(N,L)),W=So(L.ref)&&st(N)?"":N,Id(L.ref)?[...L.ref.options].forEach(Q=>Q.selected=W.includes(Q.value)):L.refs?ys(L.ref)?L.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(W)?Q.checked=!!W.find(me=>me===Q.value):Q.checked=W===Q.value||!!W)}):L.refs.forEach(Q=>Q.checked=Q.value===W):Ra(L.ref)?L.ref.value="":(L.ref.value=W,L.ref.type||v.state.next({name:_,values:Qe(o)})))}(O.shouldDirty||O.shouldTouch)&&E(_,W,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&V(_)},J=(_,N,O)=>{for(const U in N){if(!N.hasOwnProperty(U))return;const W=N[U],L=_+"."+U,Q=H(n,L);(i.array.has(_)||Be(W)||Q&&!Q._f)&&!rn(W)?J(L,W,O):I(L,W,O)}},q=(_,N,O={})=>{const U=H(n,_),W=i.array.has(_),L=Qe(N);Ee(o,_,L),W?(v.array.next({name:_,values:Qe(o)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&O.shouldDirty&&v.state.next({name:_,dirtyFields:ws(s,o),isDirty:X(_,L)})):U&&!U._f&&!st(L)?J(_,L,O):I(_,L,O),Yd(_,i)&&v.state.next({...r,name:_}),v.state.next({name:a.mount?_:void 0,values:Qe(o)})},D=async _=>{a.mount=!0;const N=_.target;let O=N.name,U=!0;const W=H(n,O),L=Te=>{U=Number.isNaN(Te)||rn(Te)&&isNaN(Te.getTime())||ir(Te,H(o,O,Te))},Q=zd(t.mode),me=zd(t.reValidateMode);if(W){let Te,gt;const gr=N.type?Hd(W._f):Pd(_),tr=_.type===Co.BLUR||_.type===Co.FOCUS_OUT,Go=!qy(W._f)&&!t.resolver&&!H(r.errors,O)&&!W._f.deps||Ky(tr,H(r.touchedFields,O),r.isSubmitted,me,Q),bn=Yd(O,i,tr);Ee(o,O,gr),tr?(W._f.onBlur&&W._f.onBlur(_),c&&c(0)):W._f.onChange&&W._f.onChange(_);const rr=E(O,gr,tr),Xo=!ft(rr)||bn;if(!tr&&v.state.next({name:O,type:_.type,values:Qe(o)}),Go)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?tr&&p():tr||p()),Xo&&v.state.next({name:O,...bn?{}:rr});if(!tr&&bn&&v.state.next({...r}),t.resolver){const{errors:yr}=await T([O]);if(L(gr),U){const Ri=Zd(r.errors,n,O),Jo=Zd(yr,n,Ri.name||O);Te=Jo.error,O=Jo.name,gt=ft(yr)}}else g([O],!0),Te=(await Qd(W,i.disabled,o,f,t.shouldUseNativeValidation))[O],g([O]),L(gr),U&&(Te?gt=!1:(u.isValid||h.isValid)&&(gt=await $(n,!0)));U&&(W._f.deps&&V(W._f.deps),P(O,gt,Te,rr))}},M=(_,N)=>{if(H(r.errors,N)&&_.focus)return _.focus(),1},V=async(_,N={})=>{let O,U;const W=bs(_);if(t.resolver){const L=await B(We(_)?_:W);O=ft(L),U=_?!W.some(Q=>H(L,Q)):O}else _?(U=(await Promise.all(W.map(async L=>{const Q=H(n,L);return await $(Q&&Q._f?{[L]:Q}:Q)}))).every(Boolean),!(!U&&!r.isValid)&&p()):U=O=await $(n);return v.state.next({...!qt(_)||(u.isValid||h.isValid)&&O!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:O}:{},errors:r.errors}),N.shouldFocus&&!U&&Cs(n,M,_?W:i.mount),U},ae=_=>{const N={...a.mount?o:s};return We(_)?N:qt(_)?H(N,_):_.map(O=>H(N,O))},Se=(_,N)=>({invalid:!!H((N||r).errors,_),isDirty:!!H((N||r).dirtyFields,_),error:H((N||r).errors,_),isValidating:!!H(r.validatingFields,_),isTouched:!!H((N||r).touchedFields,_)}),de=_=>{_&&bs(_).forEach(N=>Ye(r.errors,N)),v.state.next({errors:_?r.errors:{}})},ue=(_,N,O)=>{const U=(H(n,_,{_f:{}})._f||{}).ref,W=H(r.errors,_)||{},{ref:L,message:Q,type:me,...Te}=W;Ee(r.errors,_,{...Te,...N,ref:U}),v.state.next({name:_,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&U&&U.focus&&U.focus()},he=(_,N)=>At(_)?v.state.subscribe({next:O=>"values"in O&&_(A(void 0,N),O)}):A(_,N,!0),Fe=_=>v.state.subscribe({next:N=>{Zy(_.name,N.name,_.exact)&&Yy(N,_.formState||u,mr,_.reRenderRoot)&&_.callback({values:{...o},...r,...N,defaultValues:s})}}).unsubscribe,rt=_=>(a.mount=!0,h={...h,..._.formState},Fe({..._,formState:h})),Y=(_,N={})=>{for(const O of _?bs(_):i.mount)i.mount.delete(O),i.array.delete(O),N.keepValue||(Ye(n,O),Ye(o,O)),!N.keepError&&Ye(r.errors,O),!N.keepDirty&&Ye(r.dirtyFields,O),!N.keepTouched&&Ye(r.touchedFields,O),!N.keepIsValidating&&Ye(r.validatingFields,O),!t.shouldUnregister&&!N.keepDefaultValue&&Ye(s,O);v.state.next({values:Qe(o)}),v.state.next({...r,...N.keepDirty?{isDirty:X()}:{}}),!N.keepIsValid&&p()},ke=({disabled:_,name:N})=>{(xt(_)&&a.mount||_||i.disabled.has(N))&&(_?i.disabled.add(N):i.disabled.delete(N))},Ae=(_,N={})=>{let O=H(n,_);const U=xt(N.disabled)||xt(t.disabled);return Ee(n,_,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:_}},name:_,mount:!0,...N}}),i.mount.add(_),O?ke({disabled:xt(N.disabled)?N.disabled:t.disabled,name:_}):k(_,!0,N.value),{...U?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:xs(N.min),max:xs(N.max),minLength:xs(N.minLength),maxLength:xs(N.maxLength),pattern:xs(N.pattern)}:{},name:_,onChange:D,onBlur:D,ref:W=>{if(W){Ae(_,N),O=H(n,_);const L=We(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,Q=Wy(L),me=O._f.refs||[];if(Q?me.find(Te=>Te===L):L===O._f.ref)return;Ee(n,_,{_f:{...O._f,...Q?{refs:[...me.filter(ti),L,...Array.isArray(H(s,_))?[{}]:[]],ref:{type:L.type,name:_}}:{ref:L}}}),k(_,!1,void 0,L)}else O=H(n,_,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Td(i.array,_)&&a.action)&&i.unMount.add(_)}}},ye=()=>t.shouldFocusError&&Cs(n,M,i.mount),pe=_=>{xt(_)&&(v.state.next({disabled:_}),Cs(n,(N,O)=>{const U=H(n,O);U&&(N.disabled=U._f.disabled||_,Array.isArray(U._f.refs)&&U._f.refs.forEach(W=>{W.disabled=U._f.disabled||_}))},0,!1))},be=(_,N)=>async O=>{let U;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let W=Qe(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:Q}=await T();r.errors=L,W=Qe(Q)}else await $(n);if(i.disabled.size)for(const L of i.disabled)Ye(W,L);if(Ye(r.errors,"root"),ft(r.errors)){v.state.next({errors:{}});try{await _(W,O)}catch(L){U=L}}else N&&await N({...r.errors},O),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=(_,N={})=>{H(n,_)&&(We(N.defaultValue)?q(_,Qe(H(s,_))):(q(_,N.defaultValue),Ee(s,_,Qe(N.defaultValue))),N.keepTouched||Ye(r.touchedFields,_),N.keepDirty||(Ye(r.dirtyFields,_),r.isDirty=N.defaultValue?X(_,Qe(H(s,_))):X()),N.keepError||(Ye(r.errors,_),u.isValid&&p()),v.state.next({...r}))},lt=(_,N={})=>{const O=_?Qe(_):s,U=Qe(O),W=ft(_),L=W?s:U;if(N.keepDefaultValues||(s=O),!N.keepValues){if(N.keepDirtyValues){const Q=new Set([...i.mount,...Object.keys(ws(s,o))]);for(const me of Array.from(Q))H(r.dirtyFields,me)?Ee(L,me,H(o,me)):q(me,H(L,me))}else{if(Za&&We(_))for(const Q of i.mount){const me=H(n,Q);if(me&&me._f){const Te=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(So(Te)){const gt=Te.closest("form");if(gt){gt.reset();break}}}}if(N.keepFieldsRef)for(const Q of i.mount)q(Q,H(L,Q));else n={}}o=t.shouldUnregister?N.keepDefaultValues?Qe(s):{}:Qe(L),v.array.next({values:{...L}}),v.state.next({values:{...L}})}i={mount:N.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!N.keepIsValid||!!N.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:W?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!ir(_,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:W?{}:N.keepDirtyValues?N.keepDefaultValues&&o?ws(s,o):r.dirtyFields:N.keepDefaultValues&&_?ws(s,_):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Rt=(_,N)=>lt(At(_)?_(o):_,N),er=(_,N={})=>{const O=H(n,_),U=O&&O._f;if(U){const W=U.refs?U.refs[0]:U.ref;W.focus&&(W.focus(),N.shouldSelect&&At(W.select)&&W.select())}},mr=_=>{r={...r,..._}},vr={control:{register:Ae,unregister:Y,getFieldState:Se,handleSubmit:be,setError:ue,_subscribe:Fe,_runSchema:T,_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(_=>{Rt(_,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:z,_disableForm:pe,_subjects:v,_proxyFormState:u,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(_){a=_},get _defaultValues(){return s},get _names(){return i},set _names(_){i=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:rt,trigger:V,register:Ae,handleSubmit:be,watch:he,setValue:q,getValues:ae,reset:Rt,resetField:Je,clearErrors:de,unregister:Y,setError:ue,setFocus:er,getFieldState:Se};return{...vr,formControl:vr}}function _s(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)}}},_e;(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})(_e||(_e={}));var Jd;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Jd||(Jd={}));const G=_e.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}},F=_e.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,_e.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 F.invalid_type:e.received===G.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case F.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,_e.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:r=`Unrecognized key(s) in object: ${_e.joinValues(e.keys,", ")}`;break;case F.invalid_union:r="Invalid input";break;case F.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_e.joinValues(e.options)}`;break;case F.invalid_enum_value:r=`Invalid enum value. Expected ${_e.joinValues(e.options)}, received '${e.received}'`;break;case F.invalid_arguments:r="Invalid function arguments";break;case F.invalid_return_type:r="Invalid function return type";break;case F.invalid_date:r="Invalid date";break;case F.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}"`:_e.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case F.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 F.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 F.custom:r="Invalid input";break;case F.invalid_intersection_types:r="Intersection results could not be merged";break;case F.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case F.not_finite:r="Number must be finite";break;default:r=t.defaultError,_e.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 Ct{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 Ct.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",An=e=>e.status==="valid",Po=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(An(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 Ct,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(Po(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 An(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=>An(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(Po(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:F.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 Fn({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 Ln.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yt.create(this)}promise(){return Mo.create(this,this._def)}or(t){return To.create([this,t],this._def)}and(t){return Oo.create(this,t,this._def)}transform(t){return new Fn({...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 Cb(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 _b(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:F.invalid_type,expected:G.string,received:o.parsedType}),ne}const n=new Ct;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:F.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:F.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:F.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&Z(s,{code:F.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:F.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:F.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:F.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:F.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:F.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:F.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:F.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:F.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:F.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:F.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:F.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:F.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Cb(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:F.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?wb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:F.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:F.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:F.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?_b(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"ip",code:F.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:F.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:F.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?yb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64",code:F.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?bb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64url",code:F.invalid_string,message:o.message}),n.dirty()):_e.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:F.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:F.invalid_type,expected:G.number,received:o.parsedType}),ne}let n;const s=new Ct;for(const o of this._def.checks)o.kind==="int"?_e.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:F.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:F.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:F.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:F.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:F.not_finite,message:o.message}),s.dirty()):_e.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"&&_e.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 Ct;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:F.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:F.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:F.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):_e.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return Z(r,{code:F.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:F.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:F.invalid_type,expected:G.date,received:o.parsedType}),ne}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Z(o,{code:F.invalid_date}),ne}const n=new Ct;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:F.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:F.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):_e.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:F.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:F.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:F.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:F.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:F.invalid_type,expected:G.void,received:n.parsedType}),ne}return kt(t.data)}}cu.create=e=>new cu({typeName:se.ZodVoid,...fe(e)});class Yt extends xe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==G.array)return Z(r,{code:F.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?F.too_big:F.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:F.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:F.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=>Ct.mergeArray(n,a));const o=[...r.data].map((a,i)=>s.type._parseSync(new Pr(r,a,r.path,i)));return Ct.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Yt({...this._def,minLength:{value:t,message:R.toString(r)}})}max(t,r){return new Yt({...this._def,maxLength:{value:t,message:R.toString(r)}})}length(t,r){return new Yt({...this._def,exactLength:{value:t,message:R.toString(r)}})}nonempty(t){return this.min(1,t)}}Yt.create=(e,t)=>new Yt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...fe(t)});function Dn(e){if(e instanceof Ve){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Mr.create(Dn(n))}return new Ve({...e._def,shape:()=>t})}else return e instanceof Yt?new Yt({...e._def,type:Dn(e.element)}):e instanceof Mr?Mr.create(Dn(e.unwrap())):e instanceof Ln?Ln.create(Dn(e.unwrap())):e instanceof nn?nn.create(e.items.map(t=>Dn(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=_e.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:F.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:F.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=>Ct.mergeObjectSync(n,d)):Ct.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 _e.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 _e.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}deepPartial(){return Dn(this)}partial(t){const r={};for(const n of _e.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 _e.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(_e.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 To 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:F.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:F.invalid_union,unionErrors:i}),ne}}get options(){return this._def.options}}To.create=(e,t)=>new To({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=_e.objectKeys(t),o=_e.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 Oo 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:F.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}))}}Oo.create=(e,t,r)=>new Oo({left:e,right:t,typeName:se.ZodIntersection,...fe(r)});class nn extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==G.array)return Z(n,{code:F.invalid_type,expected:G.array,received:n.parsedType}),ne;if(n.data.length<this._def.items.length)return Z(n,{code:F.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:F.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=>Ct.mergeArray(r,a)):Ct.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new nn({...this._def,rest:t})}}nn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nn({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:F.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:F.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:F.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:F.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:F.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 In({values:e,typeName:se.ZodEnum,...fe(t)})}class In extends xe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{expected:_e.joinValues(n),received:r.parsedType,code:F.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:F.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 In.create(t,{...this._def,...r})}exclude(t,r=this._def){return In.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}In.create=fu;class hu extends xe{_parse(t){const r=_e.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==G.string&&n.parsedType!==G.number){const s=_e.objectValues(r);return Z(n,{expected:_e.joinValues(s),received:n.parsedType,code:F.invalid_type}),ne}if(this._cache||(this._cache=new Set(_e.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=_e.objectValues(r);return Z(n,{received:n.data,code:F.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 Mo 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:F.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})))}}Mo.create=(e,t)=>new Mo({type:e,typeName:se.ZodPromise,...fe(t)});class Fn 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(!An(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=>An(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:r.value,value:i})):ne);_e.assertNever(s)}}Fn.create=(e,t,r)=>new Fn({schema:e,typeName:se.ZodEffects,effect:t,...fe(r)}),Fn.createWithPreprocess=(e,t,r)=>new Fn({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 Ln extends xe{_parse(t){return this._getType(t)===G.null?kt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ln.create=(e,t)=>new Ln({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 Po(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:F.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=>(An(s)&&(s.value=Object.freeze(s.value)),s);return Po(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,Yt.create;const Ms=Ve.create;Ve.strictCreate,To.create,Oo.create,nn.create;const Tb=oi.create;In.create,Mo.create,Mr.create,Ln.create;const As=Fy,gu=m.createContext({}),Ze=({...e})=>l.jsx(gu.Provider,{value:{name:e.name},children:l.jsx(By,{...e})}),Ao=()=>{const e=m.useContext(gu),t=m.useContext(yu),{getFieldState:r,formState:n}=_o(),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:ve("space-y-2",e),...t})})});je.displayName="FormItem";const Ue=m.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Ao();return l.jsx(tn,{ref:r,className:ve(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}=Ao();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}=Ao();return l.jsx("p",{ref:r,id:n,className:ve("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}=Ao(),a=s?String(s==null?void 0:s.message):t;return a?l.jsx("p",{ref:n,id:o,className:ve("text-sm font-medium text-destructive",e),...r,children:a}):null});ze.displayName="FormMessage";const Mb=Ms({bankStatement:di(File).optional().refine(e=>e!==void 0,"Bank statement is required"),companyStructure:di(File).optional().refine(e=>e!==void 0,"Company structure document is required"),certificateOfRegistration: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=_s({resolver:Ss(Mb),defaultValues:{bankStatement:e.bankStatement||void 0,companyStructure:e.companyStructure||void 0,certificateOfRegistration:e.certificateOfRegistration||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(qe,{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:"bankStatement",label:"Bank Statement",description:"Upload your latest bank statement",inputRef:o}),l.jsx(h,{field:"companyStructure",label:"Company Structure",description:"Upload document showing directors & legal representatives",inputRef:a}),l.jsx(h,{field:"certificateOfRegistration",label:"Certificate of Registration",description:"Upload your company's certificate of registration",inputRef:i}),l.jsx(qe,{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",Cu={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 E of w)E.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,Cu);i.addEventListener(fi,d),i.dispatchEvent(x),x.defaultPrevented||(Lb(jb(_u(i)),{select:!0}),document.activeElement===p&&Ar(i))}return()=>{i.removeEventListener(fi,d),setTimeout(()=>{const x=new CustomEvent(hi,Cu);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=_u(e),r=Su(t,e),n=Su(t.reverse(),e);return[r,n]}function _u(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},Vn=new WeakMap,Do=new WeakMap,Io={},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})},qb=function(e,t,r,n){var s=zb(t,Array.isArray(e)?e:[e]);Io[r]||(Io[r]=new WeakMap);var o=Io[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=(Vn.get(v)||0)+1,g=(o.get(v)||0)+1;Vn.set(v,p),o.set(v,g),a.push(v),p===1&&b&&Do.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=Vn.get(h)-1,f=o.get(h)-1;Vn.set(h,v),o.set(h,f),v||(Do.has(h)||h.removeAttribute(n),Do.delete(h)),f||h.removeAttribute(r)}),mi--,mi||(Vn=new WeakMap,Vn=new WeakMap,Do=new WeakMap,Io={})}},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]"))),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 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 Yb(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 Fo="right-scroll-bar-position",Lo="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(){},Vo=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"]),E=v,P=Xb([r,t]),T=Zt(Zt({},k),s);return m.createElement(m.Fragment,null,u&&m.createElement(E,{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({},T),{ref:P})):m.createElement(y,Zt({},T,{className:c,ref:P}),i))});Vo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Vo.classNames={fullWidth:Lo,zeroRight:Fo};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(),$n="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,` {
104
+ overflow: hidden `).concat(n,`;
105
+ padding-right: `).concat(i,"px ").concat(n,`;
106
+ }
107
+ body[`).concat($n,`] {
108
+ overflow: hidden `).concat(n,`;
109
+ overscroll-behavior: contain;
110
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
111
+ padding-left: `.concat(s,`px;
112
+ padding-top: `).concat(o,`px;
113
+ padding-right: `).concat(a,`px;
114
+ margin-left:0;
115
+ margin-top:0;
116
+ margin-right: `).concat(i,"px ").concat(n,`;
117
+ `),r==="padding"&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),`
118
+ }
119
+
120
+ .`).concat(Fo,` {
121
+ right: `).concat(i,"px ").concat(n,`;
122
+ }
123
+
124
+ .`).concat(Lo,` {
125
+ margin-right: `).concat(i,"px ").concat(n,`;
126
+ }
127
+
128
+ .`).concat(Fo," .").concat(Fo,` {
129
+ right: 0 `).concat(n,`;
130
+ }
131
+
132
+ .`).concat(Lo," .").concat(Lo,` {
133
+ margin-right: 0 `).concat(n,`;
134
+ }
135
+
136
+ body[`).concat($n,`] {
137
+ `).concat(Kb,": ").concat(i,`px;
138
+ }
139
+ `)},Iu=function(){var e=parseInt(document.body.getAttribute($n)||"0",10);return isFinite(e)?e:0},hw=function(){m.useEffect(function(){return document.body.setAttribute($n,(Iu()+1).toString()),function(){var e=Iu()-1;e<=0?document.body.removeAttribute($n):document.body.setAttribute($n,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 $o=Object.defineProperty({},"passive",{get:function(){return bi=!0,!0}});window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{bi=!1}var Bn=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},Bo=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},Cw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_w=function(e){return`
140
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
141
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
142
+ `)},Sw=0,Wn=[];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=Yb([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=Bo(p),y=r.current,w="deltaX"in p?p.deltaX:y[0]-x[0],k="deltaY"in p?p.deltaY:y[1]-x[1],E,P=p.target,T=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in p&&T==="h"&&P.type==="range")return!1;var B=Lu(T,P);if(!B)return!0;if(B?E=T:(E=T==="v"?"h":"v",B=Lu(T,P)),!B)return!1;if(!n.current&&"changedTouches"in p&&(w||k)&&(n.current=E),!E)return!0;var $=n.current||E;return xw($,g,p,$==="h"?w:k,!0)},[]),c=m.useCallback(function(p){var g=p;if(!(!Wn.length||Wn[Wn.length-1]!==o)){var x="deltaY"in g?Bu(g):Bo(g),y=t.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&Cw(E.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(E){return E.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=Bo(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,Bo(p),p.target,i(p,e.lockRef.current))},[]);m.useEffect(function(){return Wn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Bn),document.addEventListener("touchmove",c,Bn),document.addEventListener("touchstart",u,Bn),function(){Wn=Wn.filter(function(p){return p!==o}),document.removeEventListener("wheel",c,Bn),document.removeEventListener("touchmove",c,Bn),document.removeEventListener("touchstart",u,Bn)}},[]);var f=e.removeScrollBar,b=e.inert;return m.createElement(m.Fragment,null,b?m.createElement(o,{styles:_w(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(Vo,Zt({},e,{ref:t,sideCar:Ew}))});wi.classNames=Vo.classNames;var Pw=[" ","Enter","ArrowUp","ArrowDown"],Tw=[" ","Enter"],sn="Select",[Wo,jo,Ow]=ml(sn),[jn,E_]=Xr(sn,[Ow,Pn]),Uo=Pn(),[Mw,Dr]=jn(sn),[Aw,Dw]=jn(sn),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=Uo(t),[g,x]=m.useState(null),[y,w]=m.useState(null),[k,E]=m.useState(!1),P=Ib(d),[T,B]=Js({prop:n,defaultProp:s??!1,onChange:o,caller:sn}),[$,z]=Js({prop:a,defaultProp:i,onChange:c,caller:sn}),X=m.useRef(null),A=g?b||!!g.closest("form"):!0,[j,I]=m.useState(new Set),J=Array.from(j).map(q=>q.props.value).join(";");return l.jsx(qc,{...p,children:l.jsxs(Mw,{required:f,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:E,contentId:no(),value:$,onValueChange:z,open:T,onOpenChange:B,dir:P,triggerPointerDownPosRef:X,disabled:v,children:[l.jsx(Wo.Provider,{scope:t,children:l.jsx(Aw,{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})}),A?l.jsxs(ff,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:h,value:$,onChange:q=>z(q.target.value),disabled:v,form:b,children:[$===void 0?l.jsx("option",{value:""}):null,Array.from(j)]},J):null]})})};ju.displayName=sn;var Uu="SelectTrigger",Hu=m.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Uo(r),a=Dr(Uu,r),i=a.disabled||n,c=Ie(t,a.onTriggerChange),d=jo(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",qu=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})});qu.displayName=zu;var Iw="SelectIcon",Yu=m.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return l.jsx(we.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});Yu.displayName=Iw;var Fw="SelectPortal",Zu=e=>l.jsx(Gs,{asChild:!0,...e});Zu.displayName=Fw;var on="SelectContent",Ku=m.forwardRef((e,t)=>{const r=Dr(on,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(Wo.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(Gu,{...e,ref:t})});Ku.displayName=on;var Dt=10,[Qu,Ir]=jn(on),Lw="SelectContentImpl",Vw=xn("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(on,r),[w,k]=m.useState(null),[E,P]=m.useState(null),T=Ie(t,Y=>k(Y)),[B,$]=m.useState(null),[z,X]=m.useState(null),A=jo(r),[j,I]=m.useState(!1),J=m.useRef(!1);m.useEffect(()=>{if(w)return Pu(w)},[w]),wu();const q=m.useCallback(Y=>{const[ke,...Ae]=A().map(be=>be.ref.current),[ye]=Ae.slice(-1),pe=document.activeElement;for(const be of Y)if(be===pe||(be==null||be.scrollIntoView({block:"nearest"}),be===ke&&E&&(E.scrollTop=0),be===ye&&E&&(E.scrollTop=E.scrollHeight),be==null||be.focus(),document.activeElement!==pe))return},[A,E]),D=m.useCallback(()=>q([B,w]),[q,B,w]);m.useEffect(()=>{j&&D()},[j,D]);const{onOpenChange:M,triggerPointerDownPosRef:V}=y;m.useEffect(()=>{if(w){let Y={x:0,y:0};const ke=ye=>{var pe,be;Y={x:Math.abs(Math.round(ye.pageX)-(((pe=V.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(ye.pageY)-(((be=V.current)==null?void 0:be.y)??0))}},Ae=ye=>{Y.x<=10&&Y.y<=10?ye.preventDefault():w.contains(ye.target)||M(!1),document.removeEventListener("pointermove",ke),V.current=null};return V.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,V]),m.useEffect(()=>{const Y=()=>M(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[M]);const[ae,Se]=pf(Y=>{const ke=A().filter(pe=>!pe.disabled),Ae=ke.find(pe=>pe.ref.current===document.activeElement),ye=mf(ke,Y,Ae);ye&&setTimeout(()=>ye.ref.current.focus())}),de=m.useCallback((Y,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&($(Y),ye&&(J.current=!0))},[y.value]),ue=m.useCallback(()=>w==null?void 0:w.focus(),[w]),he=m.useCallback((Y,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&X(Y)},[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:E,onViewportChange:P,itemRefCallback:de,selectedItem:B,onItemLeave:ue,itemTextRefCallback:he,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:Y=>{Y.preventDefault()},onUnmountAutoFocus:ie(s,Y=>{var ke;(ke=y.trigger)==null||ke.focus({preventScroll:!0}),Y.preventDefault()}),children:l.jsx(cs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(Fe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Y=>Y.preventDefault(),...x,...rt,onPlaced:()=>I(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ie(x.onKeyDown,Y=>{const ke=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!ke&&Y.key.length===1&&Se(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let ye=A().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const pe=Y.target,be=ye.indexOf(pe);ye=ye.slice(be+1)}setTimeout(()=>q(ye)),Y.preventDefault()}})})})})})})});Gu.displayName=Lw;var $w="SelectItemAlignedPosition",Xu=m.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Dr(on,r),a=Ir(on,r),[i,c]=m.useState(null),[d,u]=m.useState(null),h=Ie(t,T=>u(T)),v=jo(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 T=o.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),z=x.getBoundingClientRect();if(o.dir!=="rtl"){const pe=z.left-B.left,be=$.left-pe,Je=T.left-be,lt=T.width+Je,Rt=Math.max(lt,B.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 pe=B.right-z.right,be=window.innerWidth-$.right-pe,Je=window.innerWidth-T.right-be,lt=T.width+Je,Rt=Math.max(lt,B.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),q=parseInt(I.paddingTop,10),D=parseInt(I.borderBottomWidth,10),M=parseInt(I.paddingBottom,10),V=J+q+j+M+D,ae=Math.min(g.offsetHeight*5,V),Se=window.getComputedStyle(p),de=parseInt(Se.paddingTop,10),ue=parseInt(Se.paddingBottom,10),he=T.top+T.height/2-Dt,Fe=A-he,rt=g.offsetHeight/2,Y=g.offsetTop+rt,ke=J+q+Y,Ae=V-ke;if(ke<=he){const pe=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+(pe?ue:0)+be+D),lt=ke+Je;i.style.height=lt+"px"}else{const pe=X.length>0&&g===X[0].ref.current;i.style.top="0px";const Je=Math.max(he,J+p.offsetTop+(pe?de:0)+rt)+Ae;i.style.height=Je+"px",p.scrollTop=ke-he+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,E]=m.useState();Re(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const P=m.useCallback(T=>{T&&b.current===!0&&(w(),y==null||y(),b.current=!1)},[w,y]);return l.jsx(Ww,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:f,onScrollButtonChange:P,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=Uo(r);return l.jsx(Oa,{...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,Ci]=jn(on,{}),_i="SelectViewport",Ju=m.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Ir(_i,r),a=Ci(_i,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(Wo.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=_i;var Ru="SelectGroup",[jw,Uw]=jn(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 Ho="SelectItem",[zw,rf]=jn(Ho),nf=m.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,i=Dr(Ho,r),c=Ir(Ho,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(Wo.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=Ho;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=Ci(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=Ci(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=jo(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",uf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return l.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});uf.displayName=qw;var Ni="SelectArrow",Yw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Uo(r),o=Dr(Ni,r),a=Ir(Ni,r);return o.open&&a.position==="popper"?l.jsx(Ma,{...s,...n,ref:t}):null});Yw.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:{...Cl,...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=qu,Xw=Yu,Jw=Zu,gf=Ku,Rw=Ju,yf=tf,bf=nf,e0=sf,t0=af,wf=lf,xf=cf,Cf=uf;const Un=Qw,Hn=Gw,an=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(vf,{ref:n,className:ve("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"})})]}));an.displayName=vf.displayName;const _f=m.forwardRef(({className:e,...t},r)=>l.jsx(wf,{ref:r,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Lp,{className:"h-4 w-4"})}));_f.displayName=wf.displayName;const Sf=m.forwardRef(({className:e,...t},r)=>l.jsx(xf,{ref:r,className:ve("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 ln=m.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>l.jsx(Jw,{children:l.jsxs(gf,{ref:s,className:ve("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(_f,{}),l.jsx(Rw,{className:ve("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Sf,{})]})}));ln.displayName=gf.displayName;const r0=m.forwardRef(({className:e,...t},r)=>l.jsx(yf,{ref:r,className:ve("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:ve("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(Cf,{ref:r,className:ve("-mx-1 my-1 h-px bg-muted",e),...t}));n0.displayName=Cf.displayName;const s0=Ms({industry:et().min(1,"Industry is required"),businessModel:et().min(1,"Business model is required"),annualSalesVolume:et().min(1,"Annual sales volume is required"),websiteUrl:et().url("Please enter a valid URL").optional().or(Tb(""))}),o0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=_s({resolver:Ss(s0),defaultValues:{industry:e.industry,businessModel:e.businessModel,annualSalesVolume:e.annualSalesVolume,websiteUrl:e.websiteUrl}}),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(Un,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(an,{children:l.jsx(Hn,{placeholder:"Select industry"})})}),l.jsxs(ln,{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:"businessModel",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Business Model"}),l.jsxs(Un,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(an,{children:l.jsx(Hn,{placeholder:"Select business model"})})}),l.jsxs(ln,{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:"annualSalesVolume",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Annual Sales Volume (USD)"}),l.jsxs(Un,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(an,{children:l.jsx(Hn,{placeholder:"Select annual sales volume"})})}),l.jsxs(ln,{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:"websiteUrl",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(qe,{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"),postalCode:et().min(1,"Postal code is required"),city:et().min(1,"City is required"),addressCountry:et().min(1,"Country is required")}),i0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=_s({resolver:Ss(a0),defaultValues:{street:e.street,number:e.number,postalCode:e.postalCode,city:e.city,addressCountry:e.addressCountry}}),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:"postalCode",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:"addressCountry",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Country"}),l.jsxs(Un,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(an,{children:l.jsx(Hn,{placeholder:"Select country"})})}),l.jsxs(ln,{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(qe,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function Ce(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 _t(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ot(e,t){const r=Ce(e);return isNaN(t)?_t(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function It(e,t){const r=Ce(e);if(isNaN(t))return _t(e,NaN);if(!t)return r;const n=r.getDate(),s=_t(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=Ce(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 cn(e){return Kt(e,{weekStartsOn:1})}function kf(e){const t=Ce(e),r=t.getFullYear(),n=_t(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=cn(n),o=_t(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=cn(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function zn(e){const t=Ce(e);return t.setHours(0,0,0,0),t}function zo(e){const t=Ce(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-zo(r),o=+n-zo(n);return Math.round((s-o)/l0)}function d0(e){const t=kf(e),r=_t(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),cn(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=Ce(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=Ce(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=Ce(e);return!isNaN(Number(t))}function Fs(e,t){const r=Ce(e),n=Ce(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-zo(n),a=+s-zo(s);return Math.round((o-a)/Ei)}function Oi(e){const t=Ce(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function pt(e){const t=Ce(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Nf(e){const t=Ce(e),r=_t(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=Ce(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"})},C0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_0=(e,t,r,n)=>C0[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},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}},Y0={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:q0,defaultParseWidth:"any"})},Pf={code:"en-US",formatDistance:g0,formatLong:x0,formatRelative:_0,localize:O0,match:Y0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Z0(e){const t=Ce(e);return Qt(t,Nf(t))+1}function Tf(e){const t=Ce(e),r=+cn(t)-+d0(t);return Math.round(r/Ei)+1}function Of(e,t){var u,h,v,f;const r=Ce(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=_t(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const i=Kt(a,t),c=_t(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=_t(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),Kt(o,t)}function Mf(e,t){const r=Ce(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 Fr={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)}},qn={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 Fr.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 Fr.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"}):Fr.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=qn.noon:n===0?s=qn.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=qn.evening:n>=12?s=qn.afternoon:n>=4?s=qn.morning:s=qn.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 Fr.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Fr.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"}):Fr.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Fr.s(e,t)},S:function(e,t){return Fr.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 dn(n);case"XXXXX":case"XXX":default:return dn(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return If(n);case"xxxx":case"xx":return dn(n);case"xxxxx":case"xxx":default:return dn(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"+dn(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"+dn(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):dn(e,t)}function dn(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=Ce(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=Ce(e),r=t.getFullYear(),n=t.getMonth(),s=_t(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function dx(e){return Math.trunc(+Ce(e)/1e3)}function ux(e){const t=Ce(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=Ce(e),n=Ce(t);return r.getTime()>n.getTime()}function Vf(e,t){const r=Ce(e),n=Ce(t);return+r<+n}function Ii(e,t){const r=Ce(e),n=Ce(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function hx(e,t){const r=Ce(e),n=Ce(t);return r.getFullYear()===n.getFullYear()}function Fi(e,t){return ot(e,-t)}function Li(e,t){const r=Ce(e),n=r.getFullYear(),s=r.getDate(),o=_t(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=Ce(e);return isNaN(+r)?_t(e,NaN):(r.setFullYear(t),r)}var qo="Popover",[Bf,O_]=Xr(qo,[Pn]),$s=Pn(),[px,Lr]=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(qc,{...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=Lr(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=Lr(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=Lr(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 Yn="PopoverContent",qf=m.forwardRef((e,t)=>{const r=gx(Yn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=Lr(Yn,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})})});qf.displayName=Yn;var yx=xn("PopoverContent.RemoveScroll"),bx=m.forwardRef((e,t)=>{const r=Lr(Yn,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(Yf,{...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=Lr(Yn,e.__scopePopover),n=m.useRef(!1),s=m.useRef(!1);return l.jsx(Yf,{...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()}})}),Yf=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=Lr(Yn,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(Oa,{"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=Lr(Zf,r);return l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,()=>s.onOpenChange(!1))})});xx.displayName=Zf;var Cx="PopoverArrow",_x=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$s(r);return l.jsx(Ma,{...s,...n,ref:t})});_x.displayName=Cx;function Kf(e){return e?"open":"closed"}var Sx=Wf,kx=Hf,Nx=zf,Qf=qf;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:ve("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 Yo(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 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?zn(o):void 0,toDate:a?zn(a):void 0}}var Rf=S.createContext(void 0);function Yx(e){var t,r=e.initialProps,n=zx(),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;(Yo(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 eC(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 tC(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 rC(e){var t=Me(),r=Jx(),n=r[0],s=r[1],o=Rx(n,t),a=eC(n,t),i=tC(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 nC(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 sC(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 Zo=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 oC(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:sC,x=(r=h==null?void 0:h.IconLeft)!==null&&r!==void 0?r:nC;return l.jsxs("div",{className:a.nav,style:i.nav,children:[!e.hidePrevious&&l.jsx(Zo,{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(Zo,{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(oC,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:h,nextMonth:s,previousMonth:n,onPreviousClick:v,onNextClick:f})}function aC(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 iC(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 lC(e,t,r){for(var n=r?cn(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 cC(){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=lC(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 dC(){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:cC;return l.jsx("thead",{style:n.head,className:r.head,children:l.jsx(o,{})})}function uC(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 fC(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(hC,{initialProps:e.initialProps,children:e.children})}function hC(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 pC(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 mC(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(vC,{initialProps:e.initialProps,children:e.children})}function vC(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=pC(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 Ko(e){return Array.isArray(e)?Jf([],e):e!==void 0?[e]:[]}function gC(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],s=r[1];t[n]=Ko(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 yC=Ft.Selected,dr=Ft.Disabled,bC=Ft.Hidden,wC=Ft.Today,Hi=Ft.RangeEnd,zi=Ft.RangeMiddle,qi=Ft.RangeStart,xC=Ft.Outside;function CC(e,t,r){var n,s=(n={},n[yC]=Ko(e.selected),n[dr]=Ko(e.disabled),n[bC]=Ko(e.hidden),n[wC]=[e.today],n[Hi]=[],n[zi]=[],n[qi]=[],n[xC]=[],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[qi]=r.modifiers[qi],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=CC(t,r,n),o=gC(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 SC(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function kC(e){return!!(e&&typeof e=="object"&&"from"in e)}function NC(e){return!!(e&&typeof e=="object"&&"after"in e)}function EC(e){return!!(e&&typeof e=="object"&&"before"in e)}function PC(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function TC(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 OC(e){return Ti(e)}function MC(e){return Array.isArray(e)&&e.every(Ti)}function AC(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(OC(r))return ht(e,r);if(MC(r))return r.includes(e);if(kC(r))return TC(e,r);if(PC(r))return r.dayOfWeek.includes(e.getDay());if(SC(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 NC(r)?Qt(e,r.after)>0:EC(r)?Qt(r.before,e)>0:typeof r=="function"?r(e):!1})}function Yi(e,t,r){var n=Object.keys(t).reduce(function(o,a){var i=t[a];return AC(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 DC(e,t){for(var r=pt(e[0]),n=Oi(e[e.length-1]),s,o,a=r;a<=n;){var i=Yi(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 IC=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?cn(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=Yi(f,o);b=!p.disabled&&!p.hidden}return b?f:i.count>IC?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 FC(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=DC(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 LC(e,t){var r=ah(),n=Yi(e,r,t);return n}var Ki=S.createContext(void 0);function VC(e){if(!Yo(e.initialProps)){var t={selected:void 0};return l.jsx(Ki.Provider,{value:t,children:e.children})}return l.jsx($C,{initialProps:e.initialProps,children:e.children})}function $C(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 BC(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 M,V,ae,Se;Yo(r)?(M=n.onDayClick)===null||M===void 0||M.call(n,e,t,D):Bs(r)?(V=s.onDayClick)===null||V===void 0||V.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 M;v(e),(M=r.onDayFocus)===null||M===void 0||M.call(r,e,t,D)},E=function(D){var M;h(),(M=r.onDayBlur)===null||M===void 0||M.call(r,e,t,D)},P=function(D){var M;(M=r.onDayMouseEnter)===null||M===void 0||M.call(r,e,t,D)},T=function(D){var M;(M=r.onDayMouseLeave)===null||M===void 0||M.call(r,e,t,D)},B=function(D){var M;(M=r.onDayPointerEnter)===null||M===void 0||M.call(r,e,t,D)},$=function(D){var M;(M=r.onDayPointerLeave)===null||M===void 0||M.call(r,e,t,D)},z=function(D){var M;(M=r.onDayTouchCancel)===null||M===void 0||M.call(r,e,t,D)},X=function(D){var M;(M=r.onDayTouchEnd)===null||M===void 0||M.call(r,e,t,D)},A=function(D){var M;(M=r.onDayTouchMove)===null||M===void 0||M.call(r,e,t,D)},j=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:E,onKeyDown:J,onKeyUp:I,onMouseEnter:P,onMouseLeave:T,onPointerEnter:B,onPointerLeave:$,onTouchCancel:z,onTouchEnd:X,onTouchMove:A,onTouchStart:j};return q}function WC(){var e=Me(),t=ch(),r=Wi(),n=Ui(),s=Yo(e)?t.selected:Bs(e)?r.selected:Ws(e)?n.selected:void 0;return s}function jC(e){return Object.values(Ft).includes(e)}function UC(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(jC(n)){var o=e.classNames["day_".concat(n)];o&&r.push(o)}}),r}function HC(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 zC(e,t,r){var n,s,o,a=Me(),i=Zi(),c=LC(e,t),d=BC(e,c),u=WC(),h=!!(a.onDayClick||a.mode!=="default");S.useEffect(function(){var P;c.outside||i.focusedDay&&h&&ht(i.focusedDay,e)&&((P=r.current)===null||P===void 0||P.focus())},[i.focusedDay,e,r,h,c.outside]);var v=UC(a,c).join(" "),f=HC(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:uC,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),E={isButton:h,isHidden:b,activeModifiers:c,selectedDays:u,buttonProps:k,divProps:x};return E}function qC(e){var t=S.useRef(null),r=zC(e.date,e.displayMonth,t);return r.isHidden?l.jsx("div",{role:"gridcell"}):r.isButton?l.jsx(Zo,te({name:"day",ref:t},r.buttonProps)):l.jsx("div",te({},r.divProps))}function YC(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(Zo,{name:"week-number","aria-label":h,className:a.weeknumber,style:o.weeknumber,onClick:v,children:u})}function ZC(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:qC,d=(r=i==null?void 0:i.WeekNumber)!==null&&r!==void 0?r:YC,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?cn(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 KC(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 QC(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=KC(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:dC,g=(r=u==null?void 0:u.Row)!==null&&r!==void 0?r:ZC,x=(n=u==null?void 0:u.Footer)!==null&&n!==void 0?n:iC;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 GC(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var XC=GC()?S.useLayoutEffect:S.useEffect,Qi=!1,JC=0;function uh(){return"react-day-picker-".concat(++JC)}function RC(e){var t,r=e??(Qi?uh():null),n=S.useState(r),s=n[0],o=n[1];return XC(function(){s===null&&o(uh())},[]),S.useEffect(function(){Qi===!1&&(Qi=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function e_(e){var t,r,n=Me(),s=n.dir,o=n.classNames,a=n.styles,i=n.components,c=js().displayMonths,d=RC(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:aC;return l.jsxs("div",{className:h.join(" "),style:v,children:[l.jsx(g,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(QC,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function t_(e){var t=Me(),r=t.classNames,n=t.styles;return l.jsx("div",{className:r.months,style:n.months,children:e.children})}function r_(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:t_;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(e_,{displayIndex:p,displayMonth:b},p)})})}))}function n_(e){var t=e.children,r=Ex(e,["children"]);return l.jsx(Yx,{initialProps:r,children:l.jsx(rC,{children:l.jsx(VC,{initialProps:r,children:l.jsx(fC,{initialProps:r,children:l.jsx(mC,{initialProps:r,children:l.jsx(_C,{children:l.jsx(FC,{children:t})})})})})})})}function s_(e){return l.jsx(n_,te({},e,{children:l.jsx(r_,{initialProps:e})}))}function Gi({className:e,classNames:t,showOutsideDays:r=!0,...n}){return l.jsx(s_,{showOutsideDays:r,className:ve("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:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ve(Ha({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),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:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ve(Ha({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),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:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...s})=>l.jsx(Ip,{className:"h-4 w-4"}),IconRight:({...s})=>l.jsx(Fp,{className:"h-4 w-4"})},...n})}Gi.displayName="Calendar";const o_=Ms({registrationNumber:et().min(1,"Registration number is required"),country:et().min(1,"Country is required"),companyName:et().min(2,"Company name must be at least 2 characters"),taxIdentityNumber:et().min(1,"Tax identity number is required"),corporateType:et().min(1,"Corporate type is required"),dateOfEstablishment:vu({required_error:"Date of establishment is required"})}),a_=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=_s({resolver:Ss(o_),defaultValues:{registrationNumber:e.registrationNumber,country:e.country,companyName:e.companyName,taxIdentityNumber:e.taxIdentityNumber,corporateType:e.corporateType,dateOfEstablishment:e.dateOfEstablishment||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:"registrationNumber",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(Un,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(an,{children:l.jsx(Hn,{placeholder:"Select country"})})}),l.jsxs(ln,{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:"companyName",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:"taxIdentityNumber",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:"corporateType",render:({field:i})=>l.jsxs(je,{children:[l.jsx(Ue,{children:"Corporate Type"}),l.jsxs(Un,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(He,{children:l.jsx(an,{children:l.jsx(Hn,{placeholder:"Select corporate type"})})}),l.jsxs(ln,{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:"dateOfEstablishment",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(qe,{variant:"outline",className:ve("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,disabled:c=>c>new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(ze,{})]})}),l.jsx(qe,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},i_=Ms({fullName: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"}),phoneNumber:et().min(10,"Phone number must be at least 10 characters")}),l_=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=_s({resolver:Ss(i_),defaultValues:{fullName:e.fullName,title:e.title,birth:e.birth||void 0,phoneNumber:e.phoneNumber}}),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:"fullName",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(qe,{variant:"outline",className:ve("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,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:"phoneNumber",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(qe,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};var Xi="Progress",Ji=100,[c_,M_]=Xr(Xi),[d_,u_]=c_(Xi),fh=m.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=f_,...a}=e;(s||s===0)&&!vh(s)&&console.error(h_(`${s}`,"Progress"));const i=vh(s)?s:Ji;n!==null&&!gh(n,i)&&console.error(p_(`${n}`,"Progress"));const c=gh(n,i)?n:null,d=Qo(c)?o(c,i):void 0;return l.jsx(d_,{scope:r,value:c,max:i,children:l.jsx(we.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Qo(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=u_(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 f_(e,t){return`${Math.round(e/t*100)}%`}function mh(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Qo(e){return typeof e=="number"}function vh(e){return Qo(e)&&!isNaN(e)&&e>0}function gh(e,t){return Qo(e)&&!isNaN(e)&&e<=t&&e>=0}function h_(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 p_(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
143
+ - a positive number
144
+ - less than the value passed to \`max\` (or ${Ji} if no \`max\` prop is set)
145
+ - \`null\` or \`undefined\` if the progress is indeterminate.
146
+
147
+ Defaulting to \`null\`.`}var yh=fh,m_=ph;const bh=m.forwardRef(({className:e,value:t,...r},n)=>l.jsx(yh,{ref:n,className:ve("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:l.jsx(m_,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));bh.displayName=yh.displayName;const v_=({apiEndpoint:e,apiKey:t})=>{const[r,n]=S.useState("landing"),[s,o]=S.useState({fullName:"",title:"",birth:null,phoneNumber:""}),[a,i]=S.useState({registrationNumber:"",country:"",companyName:"",taxIdentityNumber:"",corporateType:"",dateOfEstablishment:null}),[c,d]=S.useState({street:"",number:"",postalCode:"",city:"",addressCountry:""}),[u,h]=S.useState({industry:"",businessModel:"",annualSalesVolume:"",websiteUrl:""}),[v,f]=S.useState({bankStatement:null,companyStructure:null,certificateOfRegistration:null}),b=["personal-details","business-information","business-address","company-activity","company-documents"],p=Cd({mutationFn:g_}),{toast:g}=Qs(),x=()=>r==="landing"||r==="processing"?-1:b.indexOf(r),y=()=>{const P=x();return P===-1?0:(P+1)/b.length*100},w=()=>{p.mutate({apiEndpoint:e,apiKey:t,data:{personal_details:s,business_information:a,business_address:c,company_activity:u,company_documents:v}}),g({title:"Business verification submitted!",description:"Your business verification request has been submitted successfully."}),o({fullName:"",title:"",birth:null,phoneNumber:""}),i({registrationNumber:"",country:"",companyName:"",taxIdentityNumber:"",corporateType:"",dateOfEstablishment:null}),d({street:"",number:"",postalCode:"",city:"",addressCountry:""}),h({industry:"",businessModel:"",annualSalesVolume:"",websiteUrl:""}),f({bankStatement:null,companyStructure:null,certificateOfRegistration:null}),n("landing")},k=()=>{const P=x();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 ",b.length]}),l.jsxs("span",{children:[Math.round(y()),"%"]})]}),l.jsx(bh,{value:y(),className:"h-2"})]})},E=()=>{switch(r){case"landing":return l.jsx(_d,{title:"Business Verification",subtitle:"Complete your business verification to access all features",onContinue:()=>n("personal-details")});case"personal-details":return l.jsx(l_,{data:s,onDataChange:P=>o(T=>({...T,...P})),onContinue:()=>n("business-information"),onBack:()=>n("landing"),renderProgress:k});case"business-information":return l.jsx(a_,{data:a,onDataChange:P=>i(T=>({...T,...P})),onContinue:()=>n("business-address"),onBack:()=>n("personal-details"),renderProgress:k});case"business-address":return l.jsx(i0,{data:c,onDataChange:P=>d(T=>({...T,...P})),onContinue:()=>n("company-activity"),onBack:()=>n("business-information"),renderProgress:k});case"company-activity":return l.jsx(o0,{data:u,onDataChange:P=>h(T=>({...T,...P})),onContinue:()=>n("company-documents"),onBack:()=>n("business-address"),renderProgress:k});case"company-documents":return l.jsx(Ab,{data:v,onDataChange:P=>f(T=>({...T,...P})),onContinue:()=>n("processing"),onBack:()=>n("company-activity"),renderProgress:k});case"processing":return l.jsx(Nd,{onComplete:w});default:return null}};return l.jsx("div",{className:"w-[430px]",children:E()})};async function g_({apiEndpoint:e,apiKey:t,data:r}){const{company_documents:n,...s}=r,o=new FormData;o.append("payload",y_(s)),o.append("bankStatement",n.bankStatement,n.bankStatement.name),o.append("companyStructure",n.companyStructure,n.companyStructure.name),o.append("certificateOfRegistration",n.certificateOfRegistration,n.certificateOfRegistration.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 y_(e){return JSON.stringify(e,(t,r)=>r instanceof Date?r.toISOString():r)}const b_=new ry;return e=>l.jsx(iy,{client:b_,children:l.jsxs(Bg,{children:[l.jsx(Cm,{}),l.jsx(ev,{}),e.isKYB?l.jsx(v_,{...e}):l.jsx(Ty,{...e})]})})});