@reeverdev/ui 0.2.234 → 0.2.235
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import*as Z from'react';import {createContext,useState,useEffect,useContext,useC
|
|
|
40
40
|
scrollbar-width: none;
|
|
41
41
|
}
|
|
42
42
|
`:""}
|
|
43
|
-
`;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:x}}),jsx("div",{ref:c,id:g,onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),style:{...s,...(()=>{if(!r)return {};let C=ny[o],R=t==="vertical"||t==="both",T=t==="horizontal"||t==="both",P=[R&&f.top&&`linear-gradient(to bottom, transparent, black ${C})`,R&&f.bottom&&`linear-gradient(to top, transparent, black ${C})`,T&&f.left&&`linear-gradient(to right, transparent, black ${C})`,T&&f.right&&`linear-gradient(to left, transparent, black ${C})`].filter(Boolean);return P.length===0?{}:{maskImage:P.join(", "),WebkitMaskImage:P.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:u(t==="vertical"&&"h-full w-full overflow-y-auto overflow-x-hidden",t==="horizontal"&&"w-full overflow-x-auto overflow-y-hidden",t==="both"&&"h-full w-full overflow-auto",e),...i,children:a})]})});Oe.displayName="ScrollArea";var Vd=cva("flex w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-9 py-1.5 text-xs",md:"min-h-10 py-2",lg:"min-h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),Ua=Z.forwardRef(({options:e,multiple:t=false,value:n,defaultValue:r,onValueChange:o,placeholder:a="Select...",searchable:s=false,searchPlaceholder:i="Search...",emptyText:l="No results found.",disabled:c=false,clearable:d=false,maxDisplayItems:m=3,maxDropdownHeight:f=240,size:p,radius:g,className:h,...v},b)=>{let[y,x]=Z.useState(false),[w,C]=Z.useState(""),[R,T]=Z.useState(r||""),[P,S]=Z.useState(r||[]),[k,E]=Z.useState({top:0,left:0,width:0}),M=Z.useRef(null),N=Z.useRef(null),H=Z.useRef(null),D=Z.useRef(null),L=n!==void 0?n:R,I=n!==void 0?n:P,A=n!==void 0,K=$=>{d&&L===$?(A||T(""),o?.("")):(A||T($),o?.($)),x(false),C("");},V=$=>{let X=I.includes($)?I.filter(te=>te!==$):[...I,$];A||S(X),o?.(X);},F=($,X)=>{X.stopPropagation();let te=I.filter(Y=>Y!==$);A||S(te),o?.(te);},z=$=>{$.stopPropagation(),t?(A||S([]),o?.([])):(A||T(""),o?.(""));},G=e.find($=>$.value===L),j=e.filter($=>I.includes($.value)),O=j.slice(0,m),B=j.length-m,_=s?e.filter($=>$.label.toLowerCase().includes(w.toLowerCase())):e;Z.useEffect(()=>{if(y&&N.current){let $=N.current.getBoundingClientRect();E({top:$.bottom+4,left:$.left,width:$.width}),s&&setTimeout(()=>D.current?.focus(),0);}y||C("");},[y,s]),Z.useEffect(()=>{let $=X=>{let te=X.target,Y=M.current&&!M.current.contains(te),ve=H.current&&!H.current.contains(te);Y&&ve&&(x(false),C(""));};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]),Z.useEffect(()=>{if(!y)return;let $=X=>{H.current?.contains(X.target)||(x(false),C(""));};return window.addEventListener("scroll",$,true),()=>window.removeEventListener("scroll",$,true)},[y]);let U=t?I.length>0:!!L;return jsxs("div",{ref:M,className:u("relative",h),...v,children:[jsxs("div",{ref:$=>{N.current=$,typeof b=="function"?b($):b&&(b.current=$);},role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!y),className:u(Vd({size:p,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:u(!G&&"text-muted-foreground"),children:G?G.label:a}),t&&jsx(Fragment,{children:j.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[O.map($=>jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground",children:[$.label,jsx("span",{role:"button",tabIndex:0,onClick:X=>F($.value,X),onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&F($.value,X);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},$.value)),B>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",B," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&U&&jsx("span",{role:"button",tabIndex:0,onClick:z,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&z($);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]})]}),y&&!c&&typeof document<"u"&&Wa.createPortal(jsxs("div",{ref:H,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:k.top,left:k.left,minWidth:k.width},children:[s&&jsxs("div",{className:"flex items-center border-b border-zinc-300 dark:border-zinc-700 px-3",children:[jsx(Search,{className:"h-4 w-4 opacity-50 mr-2"}),jsx("input",{ref:D,type:"text",value:w,onChange:$=>C($.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(Oe,{style:{maxHeight:f},onWheel:$=>$.stopPropagation(),children:jsx("div",{className:"p-1",children:_.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):_.map($=>{let X=t?I.includes($.value):L===$.value;return jsxs("div",{role:"option","aria-selected":X,onClick:()=>{$.disabled||(t?V($.value):K($.value));},className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800",$.disabled&&"pointer-events-none opacity-50"),children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:X&&jsx(Check,{className:"h-4 w-4"})}),$.label]},$.value)})})})]}),document.body)]})});Ua.displayName="Select";var Ad=Z.createContext(null),Wo=()=>{let e=Z.useContext(Ad);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},ki=Z.createContext({radius:"md"}),Pi=Z.createContext(null),Qt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),[s,i]=Z.useState(-1),l=t!==void 0,c=l?t:o,d=Z.useRef(null),m=Z.useRef(null),f=Z.useId(),p=Z.useRef(new Map),g=Z.useCallback(b=>{l||a(b),r?.(b),b||i(-1);},[l,r]),h=Z.useCallback((b,y)=>{p.current.set(b,y);},[]),v=Z.useCallback(b=>{p.current.delete(b);},[]);return jsx(Ad.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:m,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:v},children:e})};Qt.displayName="Dropdown";var Jt=Z.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Wo();return jsx("div",{ref:m=>{i.current=m,typeof o=="function"?o(m):o&&(o.current=m);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:m=>{t?.(m),s(!a);},onKeyDown:m=>{n?.(m),(m.key==="ArrowDown"||m.key==="ArrowUp")&&(m.preventDefault(),s(true)),(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),s(!a));},className:"inline-flex",...r,children:e})});Jt.displayName="DropdownTrigger";var dy={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},en=Z.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="start",alignOffset:o=0,collisionPadding:a=8,onInteractOutside:s,onEscapeKeyDown:i,loop:l=true,radius:c="md",children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentRef:v,contentId:b,activeIndex:y,setActiveIndex:x,items:w}=Wo(),[C,R]=Z.useState({top:0,left:0}),[T,P]=Z.useState(t),[S,k]=Z.useState(false),E=Z.useRef(0);if(Z.useEffect(()=>{k(true);},[]),Z.useEffect(()=>{p&&(E.current=w.current.size);},[p,w]),Z.useEffect(()=>{if(!p||!h.current||!v.current)return;let N=()=>{if(!h.current||!v.current)return;let H=h.current.getBoundingClientRect(),D=v.current.getBoundingClientRect(),L=window.innerWidth,I=window.innerHeight,A=0,K=0,V=t;switch(t){case "top":A=H.top-D.height-n,A<a&&(A=H.bottom+n,V="bottom");break;case "bottom":A=H.bottom+n,A+D.height>I-a&&(A=H.top-D.height-n,V="top");break;case "left":K=H.left-D.width-n,K<a&&(K=H.right+n,V="right");break;case "right":K=H.right+n,K+D.width>L-a&&(K=H.left-D.width-n,V="left");break}if(V==="top"||V==="bottom"){switch(r){case "start":K=H.left+o;break;case "center":K=H.left+H.width/2-D.width/2;break;case "end":K=H.right-D.width-o;break}K<a?K=a:K+D.width>L-a&&(K=L-D.width-a);}else {switch(r){case "start":A=H.top+o;break;case "center":A=H.top+H.height/2-D.height/2;break;case "end":A=H.bottom-D.height-o;break}A<a?A=a:A+D.height>I-a&&(A=I-D.height-a);}R({top:A,left:K}),P(V);};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,true),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,true);}},[p,t,n,r,o,a,h]),Z.useEffect(()=>{if(!p)return;let N=H=>{let D=H.target;v.current&&!v.current.contains(D)&&h.current&&!h.current.contains(D)&&(s?.(),g(false));};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[p,g,s,h,v]),Z.useEffect(()=>{if(!p)return;let N=H=>{let D=Array.from(w.current.entries()).sort(([I],[A])=>I-A).map(([,I])=>I),L=D.length;if(L!==0)switch(H.key){case "Escape":H.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":H.preventDefault(),y===-1||y>=L-1?x(l?0:Math.min(y+1,L-1)):x(y+1);break;case "ArrowUp":H.preventDefault(),y<=0?x(l?L-1:0):x(y-1);break;case "Home":H.preventDefault(),x(0);break;case "End":H.preventDefault(),x(L-1);break;case "Enter":case " ":H.preventDefault(),y>=0&&y<L&&D[y]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[p,g,i,y,x,w,l,h]),Z.useEffect(()=>{p&&y>=0&&Array.from(w.current.entries()).sort(([H],[D])=>H-D).map(([,H])=>H)[y]?.focus();},[p,y,w]),!S||!p)return null;let M={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[T];return Wa.createPortal(jsx("div",{ref:N=>{v.current=N,typeof f=="function"?f(N):f&&(f.current=N);},id:b,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":T,"data-dropdown-content":"",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",dy[c],M,e),style:{top:C.top,left:C.left},...m,children:jsx(ki.Provider,{value:{radius:c},children:d})}),document.body)});en.displayName="DropdownContent";var zd=0,Od={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Ht=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:m,activeIndex:f,setActiveIndex:p,registerItem:g,unregisterItem:h}=Wo(),{radius:v}=Z.useContext(ki),[b]=Z.useState(()=>zd++),y=Z.useRef(null);Z.useEffect(()=>(!n&&y.current&&g(b,y.current),()=>{h(b);}),[n,b,g,h]);let x=R=>{if(n){R.preventDefault();return}o?.(R),r?.(),m(false);},w=R=>{a?.(R),n||p(b);};return jsxs("div",{ref:R=>{y.current=R,typeof d=="function"?d(R):d&&(d.current=R);},role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-highlighted":f===b?"":void 0,className:u("relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Od[v],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Ht.displayName="DropdownItem";var Ei=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Ei.displayName="DropdownSection";var Bd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Bd.displayName="DropdownSeparator";var Fd=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest opacity-60",e),...t});Fd.displayName="DropdownShortcut";var Kd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Kd.displayName="DropdownGroup";var $d=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),{contentRef:s}=Wo(),i=t!==void 0,l=i?t:o,c=Z.useRef(null),d=Z.useCallback(m=>{i||a(m),r?.(m);},[i,r]);return jsx(Pi.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};$d.displayName="DropdownSub";var Gd=Z.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=Z.useContext(Pi),{setActiveIndex:d,registerItem:m,unregisterItem:f}=Wo(),{radius:p}=Z.useContext(ki),[g]=Z.useState(()=>zd++),h=Z.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:v,onOpenChange:b,triggerRef:y}=c;Z.useEffect(()=>(!n&&h.current&&m(g,h.current),()=>{f(g);}),[n,g,m,f]);let x=R=>{o?.(R),n||(d(g),b(true));},w=R=>{a?.(R);},C=R=>{s?.(R),(R.key==="ArrowRight"||R.key==="Enter"||R.key===" ")&&(R.preventDefault(),b(true));};return jsxs("div",{ref:R=>{h.current=R,y.current=R,typeof l=="function"?l(R):l&&(l.current=R);},role:"menuitem","aria-haspopup":"menu","aria-expanded":v,tabIndex:n?-1:0,"aria-disabled":n,"data-state":v?"open":"closed","data-disabled":n?"":void 0,className:u("flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[state=open]:bg-accent","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Od[p],t&&"pl-8",!n&&"cursor-pointer",e),onMouseEnter:x,onMouseLeave:w,onKeyDown:C,...i,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Gd.displayName="DropdownSubTrigger";var Ud=Z.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=Z.useContext(Pi);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:m,parentMenuRef:f}=l,[p,g]=Z.useState({top:0,left:0}),[h,v]=Z.useState(false),b=Z.useRef(null),y=Z.useRef(null);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{if(!c||!m.current||!b.current)return;(()=>{if(!m.current||!b.current)return;let R=m.current.getBoundingClientRect(),T=b.current.getBoundingClientRect(),P=window.innerWidth,S=window.innerHeight,k=R.top+n,E=R.right+t;E+T.width>P-r&&(E=R.left-T.width-t),k+T.height>S-r&&(k=S-T.height-r),k<r&&(k=r),g({top:k,left:E});})();},[c,t,n,r,m]);let x=C=>{o?.(C),y.current&&(clearTimeout(y.current),y.current=null),d(true);},w=C=>{a?.(C);let R=C.relatedTarget;m.current?.contains(R)||f?.current?.contains(R)||(y.current=setTimeout(()=>{d(false);},100));};return Z.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),!h||!c?null:Wa.createPortal(jsx("div",{ref:C=>{b.current=C,typeof i=="function"?i(C):i&&(i.current=C);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:p.top,left:p.left},onMouseEnter:x,onMouseLeave:w,...s}),document.body)});Ud.displayName="DropdownSubContent";var uy=Ei;var Wd=Z.createContext(null),Si=()=>{let e=Z.useContext(Wd);if(!e)throw new Error("Popover components must be used within a Popover");return e},ht=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useId(),d=Z.useCallback(m=>{s||a(m),r?.(m);},[s,r]);return jsx(Wd.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};ht.displayName="Popover";var or=Z.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Si(),c=f=>{t?.(f),s(!a);},d=f=>{i.current=f,typeof o=="function"?o(f):o&&(o.current=f);},m={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...r};return n&&Z.isValidElement(e)?Z.cloneElement(e,{...m,ref:d,onClick:f=>{e.props.onClick?.(f),c(f);}}):jsx("button",{ref:d,type:"button",...m,children:e})});or.displayName="PopoverTrigger";var Nn=Z.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=Si();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});Nn.displayName="PopoverAnchor";var xt=Z.forwardRef(({className:e,style:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:a=0,onInteractOutside:s,onEscapeKeyDown:i,onOpenAutoFocus:l,onCloseAutoFocus:c,children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentId:v}=Si(),[b,y]=Z.useState({top:0,left:0}),[x,w]=Z.useState(false),[C,R]=Z.useState(null);if(Z.useEffect(()=>{w(true);},[]),Z.useEffect(()=>{if(!p||!h.current||!C)return;let P=()=>{if(!h.current||!C)return;let S=h.current.getBoundingClientRect(),k=C.getBoundingClientRect(),E=0,M=0;switch(n){case "top":E=S.top-k.height-r;break;case "bottom":E=S.bottom+r;break;case "left":M=S.left-k.width-r;break;case "right":M=S.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":M=S.left+a;break;case "center":M=S.left+S.width/2-k.width/2;break;case "end":M=S.right-k.width-a;break}else switch(o){case "start":E=S.top+a;break;case "center":E=S.top+S.height/2-k.height/2;break;case "end":E=S.bottom-k.height-a;break}y({top:E,left:M});};return P(),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[p,n,r,o,a,h,C]),Z.useEffect(()=>{if(!p)return;let P=S=>{let k=S.target;C&&C.contains(k)||h.current&&h.current.contains(k)||k.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",P),()=>document.removeEventListener("mouseup",P)},[p,g,s,h,C]),Z.useEffect(()=>{if(!p)return;let P=S=>{S.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[p,g,i]),!x||!p)return null;let T={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[n];return Wa.createPortal(jsx("div",{ref:P=>{R(S=>S!==P?P:S),typeof f=="function"?f(P):f&&(f.current=P);},id:v,role:"dialog","data-state":p?"open":"closed","data-side":n,className:u("fixed z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",T,e),style:{...t,top:b.top,left:b.left},...m,children:d}),document.body)});xt.displayName="PopoverContent";var Yd=Z.createContext(null),Di=()=>{let e=Z.useContext(Yd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},Xd=Z.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,m]=Z.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||m(h),r?.(h);};return jsx(Yd.Provider,{value:{value:p,onValueChange:g,variant:o,radius:a,orientation:s},children:jsx("div",{ref:c,"data-orientation":s,className:u(s==="vertical"&&"flex gap-4",e),...l,children:i})})});Xd.displayName="Tabs";var Li={none:{list:"rounded-none",trigger:"rounded-none",indicator:"rounded-none"},sm:{list:"rounded-md",trigger:"rounded-sm",indicator:"rounded-sm"},md:{list:"rounded-lg",trigger:"rounded-md",indicator:"rounded-md"},lg:{list:"rounded-xl",trigger:"rounded-lg",indicator:"rounded-lg"},full:{list:"rounded-full",trigger:"rounded-full",indicator:"rounded-full"}},qd=Z.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=Di(),l=Z.useRef(null),[c,d]=Z.useState({opacity:0});Z.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let b=g.querySelector('[data-state="active"]');if(b){let y=g.getBoundingClientRect(),x=b.getBoundingClientRect(),w=s==="vertical";o==="underline"?d(w?{width:2,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:2,transform:`translateX(${x.left-y.left}px)`,opacity:1}):o==="solid"&&d(w?{width:x.width,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:x.height,transform:`translateX(${x.left-y.left}px)`,opacity:1});}};h();let v=new ResizeObserver(h);return v.observe(g),()=>{v.disconnect();}},[o,s,i]);let m={solid:"bg-muted p-1",underline:"border-b border-border bg-transparent p-0 !rounded-none",bordered:"bg-transparent p-0 gap-1 !rounded-none"},f=s==="vertical",p=()=>o==="solid"?f?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?f?"top-0 left-0 bg-primary !rounded-full":"bottom-0 left-0 bg-primary !rounded-full":"";return jsxs("div",{ref:g=>{l.current=g,typeof r=="function"?r(g):r&&(r.current=g);},role:"tablist","aria-orientation":s,className:u("relative inline-flex h-9 items-center justify-center text-muted-foreground",f&&"flex-col h-auto w-auto",Li[a].list,m[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:u("absolute transition-all duration-200 ease-out",Li[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});qd.displayName="TabsList";var Zd=Z.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=Di(),d=s===t,m={solid:"data-[state=active]:text-foreground",underline:"!rounded-none border-b-2 border-transparent pb-2 data-[state=active]:text-foreground",bordered:"border border-transparent data-[state=active]:border-current data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"};return jsx("button",{type:"button",role:"tab",ref:a,"aria-selected":d,"data-state":d?"active":"inactive",disabled:n,className:u("relative z-10 inline-flex items-center justify-center whitespace-nowrap px-3 py-1 text-sm font-medium ring-offset-background transition-all cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",Li[c].trigger,m[l],e),onClick:f=>{r?.(f),i(t);},...o})});Zd.displayName="TabsTrigger";var Qd=Z.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=Di(),s=a===t;return s?jsx("div",{ref:o,role:"tabpanel","data-state":s?"active":"inactive",className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r,children:n}):null});Qd.displayName="TabsContent";var Jd=[{label:"At least 8 characters",test:e=>e.length>=8},{label:"Contains uppercase",test:e=>/[A-Z]/.test(e)},{label:"Contains lowercase",test:e=>/[a-z]/.test(e)},{label:"Contains number",test:e=>/[0-9]/.test(e)},{label:"Contains special character",test:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)}];function py(e,t=Jd){return e?t.filter(r=>r.test(e)).length/t.length:0}function fy(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function gy(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var Xo=0,Hi=null;function ln(){Xo===0&&(Hi=document.body.style.overflow,document.body.style.overflow="hidden"),Xo++;}function cn(){Xo--,Xo<=0&&(Xo=0,document.body.style.overflow=Hi??"",Hi=null);}var tu=Z.createContext(null),_a=()=>{let e=Z.useContext(tu);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},nu=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=Z.useState(t),s=e!==void 0,i=s?e:o,l=Z.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(tu.Provider,{value:{open:i,onOpenChange:l},children:r})};nu.displayName="Sheet";var ru=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});ru.displayName="SheetTrigger";var ou=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});ou.displayName="SheetClose";var Vi=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};Vi.displayName="SheetPortal";var au=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=_a();return r?jsx("div",{ref:n,className:u("fixed inset-0 z-50 bg-black/80",r?"animate-in fade-in-0":"animate-out fade-out-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});au.displayName="SheetOverlay";var su=cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition-transform duration-300 ease-in-out",{variants:{side:{top:"inset-x-0 top-0 border-b",bottom:"inset-x-0 bottom-0 border-t",left:"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"}},defaultVariants:{side:"right"}}),hy=(e,t)=>({top:t?"animate-in slide-in-from-top":"animate-out slide-out-to-top",bottom:t?"animate-in slide-in-from-bottom":"animate-out slide-out-to-bottom",left:t?"animate-in slide-in-from-left":"animate-out slide-out-to-left",right:t?"animate-in slide-in-from-right":"animate-out slide-out-to-right"})[e],iu=Z.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=_a(),[d,m]=Z.useState(false),[,f]=Z.useState(false);return Z.useEffect(()=>{if(l)m(true),f(true),ln();else {f(true);let p=setTimeout(()=>{m(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{cn();}},[l]),Z.useEffect(()=>{let p=g=>{g.key==="Escape"&&l&&(o?.(),c(false));};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,c,o]),!d&&!l?null:jsxs(Vi,{children:[jsx("div",{className:u("fixed inset-0 z-50 bg-black/80 transition-opacity duration-300",l?"opacity-100":"opacity-0"),onClick:()=>{a?.(),c(false);},"aria-hidden":"true"}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true",className:u(su({side:e}),hy(e,l),t),...s,children:[!r&&jsxs("button",{type:"button",onClick:()=>c(false),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]}),n]})]})});iu.displayName="SheetContent";var lu=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-2 text-center sm:text-left",e),...t});lu.displayName="SheetHeader";var cu=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});cu.displayName="SheetFooter";var du=Z.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:u("text-lg font-semibold text-foreground",e),...t}));du.displayName="SheetTitle";var uu=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));uu.displayName="SheetDescription";var Ry=({theme:e="system",...t})=>jsx(Toaster,{theme:e,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"}},...t});var mu=Z.createContext(null),Ya=()=>{let e=Z.useContext(mu);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Ai=Z.createContext(null),pu=({children:e,onOpenChange:t})=>{let[n,r]=Z.useState(false),[o,a]=Z.useState({x:0,y:0}),s=Z.useId(),i=Z.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(mu.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};pu.displayName="ContextMenu";var fu=Z.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Ya(),s=i=>{i.preventDefault(),a({x:i.clientX,y:i.clientY}),o(true);};return jsx("div",{ref:r,onContextMenu:i=>{t?.(i),s(i);},...n,children:e})});fu.displayName="ContextMenuTrigger";var gu=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));gu.displayName="ContextMenuGroup";var bu=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};bu.displayName="ContextMenuPortal";var vu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Ai.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};vu.displayName="ContextMenuSub";var hu=Z.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Ya(),[d,m]=Z.useState(false),[f,p]=Z.useState(l),g=Z.useRef(null);return Z.useEffect(()=>{m(true);},[]),Z.useEffect(()=>{if(!s||!g.current){p(l);return}let v=g.current.getBoundingClientRect(),{x:b,y}=l;b+v.width>window.innerWidth&&(b=window.innerWidth-v.width-8),y+v.height>window.innerHeight&&(y=window.innerHeight-v.height-8),p({x:b,y});},[s,l]),Z.useEffect(()=>{if(!s)return;let h=v=>{let b=v.target;g.current&&!g.current.contains(b)&&(t?.(),i(false));};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,i,t]),Z.useEffect(()=>{if(!s)return;let h=v=>{v.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s,i,n]),!d||!s?null:Wa.createPortal(jsx("div",{ref:h=>{g.current=h,typeof a=="function"?a(h):a&&(a.current=h);},id:c,role:"menu","aria-orientation":"vertical","data-state":s?"open":"closed",className:u("fixed z-50 max-h-[calc(100vh-2rem)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-md","animate-in fade-in-0 zoom-in-95",e),style:{top:f.y,left:f.x},...o,children:r}),document.body)});hu.displayName="ContextMenuContent";var xu=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=Z.useContext(Ai);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,m=p=>{r?.(p),c(true);},f=p=>{o?.(p),c(false);};return jsxs("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p);},role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"data-state":l?"open":"closed",className:u("flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800",t&&"pl-8",e),onMouseEnter:m,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});xu.displayName="ContextMenuSubTrigger";var yu=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=Z.useContext(Ai);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,m]=Z.useState({top:0,left:0}),[f,p]=Z.useState(false),g=Z.useRef(null);Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let y=c.current.getBoundingClientRect(),x=g.current.getBoundingClientRect(),w=y.top,C=y.right+t;C+x.width>window.innerWidth&&(C=y.left-x.width-t),m({top:w,left:C});})();},[i,t,c]);let h=b=>{n?.(b),l(true);},v=b=>{r?.(b),l(false);};return !f||!i?null:Wa.createPortal(jsx("div",{ref:b=>{g.current=b,typeof a=="function"?a(b):a&&(a.current=b);},role:"menu","data-state":i?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:d.top,left:d.left},onMouseEnter:h,onMouseLeave:v,...o}),document.body)});yu.displayName="ContextMenuSubContent";var Ru=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Ya(),l=c=>{if(n){c.preventDefault();return}o?.(c),r?.(),i(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",t&&"pl-8",e),onClick:l,...a})});Ru.displayName="ContextMenuItem";var wu=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Ya(),c=d=>{if(o){d.preventDefault();return}a?.(d),r?.(!n),l(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:c,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});wu.displayName="ContextMenuCheckboxItem";var Cu=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Cu.displayName="ContextMenuSection";var Tu=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-border",e),...t}));Tu.displayName="ContextMenuSeparator";var Mu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Mu.displayName="ContextMenuShortcut";var Pu=Z.createContext(null),Ny=()=>{let e=Z.useContext(Pu);if(!e)throw new Error("Radio components must be used within a RadioGroup");return e},Eu=Z.createContext(null),qa=()=>{let e=Z.useContext(Eu);if(!e)throw new Error("Radio.* components must be used within a Radio");return e},qo={sm:{control:"h-3.5 w-3.5",indicator:"h-1.5 w-1.5",label:"text-sm",description:"text-xs",gap:"gap-2"},md:{control:"h-4 w-4",indicator:"h-2 w-2",label:"text-sm",description:"text-xs",gap:"gap-2.5"},lg:{control:"h-5 w-5",indicator:"h-2.5 w-2.5",label:"text-base",description:"text-sm",gap:"gap-3"}},Xa={default:{border:"border-input",borderChecked:"border-foreground",indicator:"bg-foreground",ring:"ring-foreground/20"},secondary:{border:"border-input",borderChecked:"border-secondary",indicator:"bg-secondary",ring:"ring-secondary/20"},success:{border:"border-input",borderChecked:"border-green-500",indicator:"bg-green-500",ring:"ring-green-500/20"},warning:{border:"border-input",borderChecked:"border-yellow-500",indicator:"bg-yellow-500",ring:"ring-yellow-500/20"},danger:{border:"border-input",borderChecked:"border-red-500",indicator:"bg-red-500",ring:"ring-red-500/20"}},Su=Z.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",size:l="md",color:c="default",children:d,...m},f)=>{let[p,g]=Z.useState(n),h=t!==void 0,v=h?t:p,b=Z.useId(),y=x=>{h||g(x),r?.(x);};return jsx("div",{ref:f,role:"radiogroup","aria-required":s,"aria-orientation":i,className:u(i==="vertical"?"flex flex-col gap-2":"flex flex-row flex-wrap gap-4",e),...m,children:jsx(Pu.Provider,{value:{name:o||b,value:v,onValueChange:y,disabled:a,required:s,size:l,color:c},children:d})})});Su.displayName="RadioGroup";var Lu=Z.forwardRef(({className:e,value:t,disabled:n,children:r,...o},a)=>{let s=Ny(),[i,l]=Z.useState(false),c=s.value===t,d=n||s.disabled,m=()=>{d||s.onValueChange(t);},f=qo[s.size||"md"];return jsx(Eu.Provider,{value:{value:t,isChecked:c,isDisabled:d||false,isFocused:i,setIsFocused:l,onSelect:m,size:s.size||"md",color:s.color||"default"},children:jsxs("label",{ref:a,className:u("flex items-start cursor-pointer select-none",f.gap,d&&"cursor-not-allowed opacity-50",e),...o,children:[r,jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:s.name,value:t,checked:c,required:s.required,disabled:d,onChange:()=>{},className:"sr-only"})]})})});Lu.displayName="Radio";var Du=Z.forwardRef(({className:e,children:t},n)=>{let{isChecked:r,isDisabled:o,isFocused:a,setIsFocused:s,onSelect:i,size:l,color:c}=qa(),d=qo[l],m=!(c in Xa),f=m?null:Xa[c],p=m?{borderColor:r?c:void 0,boxShadow:a?`0 0 0 2px ${c}33`:void 0}:void 0;return jsx(motion.button,{ref:n,type:"button",role:"radio","aria-checked":r,disabled:o,onClick:i,onFocus:()=>s(true),onBlur:()=>s(false),style:p,className:u("relative flex items-center justify-center rounded-full border-2 transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",d.control,f&&(r?f.borderChecked:f.border),f&&a&&f.ring,!m&&!r&&"border-input",o?"cursor-not-allowed":"cursor-pointer",e),whileTap:o?void 0:{scale:.95},animate:r?{scale:[1,1.1,1]}:void 0,transition:{duration:.2},children:t||jsx(zi,{})})});Du.displayName="RadioControl";var zi=Z.forwardRef(({className:e,forceMount:t},n)=>{let{isChecked:r,size:o,color:a}=qa(),s=qo[o],i=!(a in Xa),l=i?null:Xa[a],c=i?{backgroundColor:a}:void 0;return jsx(AnimatePresence,{children:(t||r)&&jsx(motion.span,{ref:n,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:500,damping:30},style:c,className:u("rounded-full",s.indicator,l?.indicator,e)})})});zi.displayName="RadioIndicator";var Hu=Z.forwardRef(({className:e,children:t,...n},r)=>{let{size:o,isDisabled:a}=qa(),s=qo[o];return jsx("span",{ref:r,className:u("font-medium leading-none",s.label,a&&"text-muted-foreground",e),...n,children:t})});Hu.displayName="RadioLabel";var Iu=Z.forwardRef(({className:e,children:t,...n},r)=>{let{size:o}=qa(),a=qo[o];return jsx("span",{ref:r,className:u("text-muted-foreground leading-snug",a.description,e),...n,children:t})});Iu.displayName="RadioDescription";var Vu=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("flex flex-col gap-0.5",e),...n,children:t}));Vu.displayName="RadioContent";var Qa=cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{solid:"bg-transparent hover:bg-muted data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",bordered:"border border-current bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",ghost:"bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",soft:"bg-transparent hover:bg-primary/10 data-[state=on]:bg-primary/15 data-[state=on]:text-primary",surface:"bg-muted/50 hover:bg-muted data-[state=on]:bg-muted data-[state=on]:text-foreground"},size:{sm:"h-9 px-2.5 min-w-9",md:"h-10 px-3 min-w-10",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"solid",size:"md"}}),Au=Z.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,m]=Z.useState(o),f=r!==void 0,p=f?r:d,g=()=>{if(s)return;let v=!p;f||m(v),a?.(v);},h=v=>{v.key==="Enter"&&v.preventDefault(),i?.(v);};return jsx("button",{type:"button","aria-pressed":p,"data-state":p?"on":"off",disabled:s,ref:c,className:u(Qa({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});Au.displayName="Toggle";var zu=Z.createContext(null),Sy=()=>{let e=Z.useContext(zu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},Ou=Z.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[m,f]=Z.useState(()=>r==="single"?a?[a]:[]:a||[]),p=o!==void 0,g=p?r==="single"?o?[o]:[]:o:m,h=v=>{if(r==="single"){let b=g.includes(v)?[]:[v];p||f(b),s?.(b[0]||"");}else {let b=g.includes(v)?g.filter(y=>y!==v):[...g,v];p||f(b),s?.(b);}};return jsx("div",{ref:d,role:"group",className:u("flex items-center justify-center gap-1",e),...c,children:jsx(zu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});Ou.displayName="ToggleGroup";var Bu=Z.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=Sy(),c=l.value.includes(o),d=a||l.disabled;return jsx("button",{type:"button",role:"radio","aria-checked":c,"aria-pressed":c,"data-state":c?"on":"off",disabled:d,ref:i,className:u(Qa({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});Bu.displayName="ToggleGroupItem";var tn=Z.forwardRef(({className:e,value:t,defaultValue:n=[0],onValueChange:r,onValueCommit:o,min:a=0,max:s=100,step:i=1,disabled:l=false,orientation:c="horizontal",trackColor:d="primary",name:m,...f},p)=>{let[g,h]=Z.useState(n),v=t!==void 0,b=v?t:g,y=Z.useRef(null),[x,w]=Z.useState(false),[C,R]=Z.useState(null),T=(V,F)=>{if(!y.current)return b[0];let z=y.current.getBoundingClientRect(),G;c==="horizontal"?G=(V-z.left)/z.width:G=1-(F-z.top)/z.height,G=Math.max(0,Math.min(1,G));let j=a+G*(s-a),O=Math.round(j/i)*i;return Math.max(a,Math.min(s,O))},P=(V,F)=>{let z=[...b];z[F]=V,F>0&&V<b[F-1]&&(z[F]=b[F-1]),F<b.length-1&&V>b[F+1]&&(z[F]=b[F+1]),v||h(z),r?.(z);},S=(V,F)=>{l||(V.preventDefault(),w(true),R(F),V.target.setPointerCapture(V.pointerId));},k=V=>{if(!x||C===null||l)return;let F=T(V.clientX,V.clientY);P(F,C);},E=()=>{x&&(w(false),R(null),o?.(b));},M=V=>{if(l)return;let F=T(V.clientX,V.clientY),z=0,G=Math.abs(b[0]-F);for(let j=1;j<b.length;j++){let O=Math.abs(b[j]-F);O<G&&(G=O,z=j);}P(F,z),o?.([...b.slice(0,z),F,...b.slice(z+1)]);},N=(V,F)=>{if(l)return;let z=b[F];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),z=Math.min(s,b[F]+i);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),z=Math.max(a,b[F]-i);break;case "Home":V.preventDefault(),z=a;break;case "End":V.preventDefault(),z=s;break;default:return}P(z,F),o?.([...b.slice(0,F),z,...b.slice(F+1)]);},H=V=>(V-a)/(s-a)*100,D={primary:{track:"bg-primary",thumb:"border-primary"},success:{track:"bg-green-500",thumb:"border-green-500"},warning:{track:"bg-yellow-500",thumb:"border-yellow-500"},danger:{track:"bg-red-500",thumb:"border-red-500"}},L=!(d in D),I=L?null:D[d],A=L?{backgroundColor:d}:void 0,K=L?{borderColor:d}:void 0;return jsxs("div",{ref:p,className:u("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none",e),...f,children:[jsx("div",{ref:y,className:u("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:M,children:jsx("div",{className:u("absolute",I?.track),style:c==="horizontal"?{left:b.length>1?`${H(b[0])}%`:0,right:`${100-H(b[b.length-1])}%`,top:0,bottom:0,...A}:{bottom:b.length>1?`${H(b[0])}%`:0,top:`${100-H(b[b.length-1])}%`,left:0,right:0,...A}})}),b.map((V,F)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":V,"aria-orientation":c,"aria-disabled":l,className:u("absolute block h-5 w-5 rounded-full border-2 bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",I?.thumb,x&&C===F&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${H(V)}% - 10px)`,top:"50%",transform:"translateY(-50%)",...K}:{bottom:`calc(${H(V)}% - 10px)`,left:"50%",transform:"translateX(-50%)",...K},onPointerDown:z=>S(z,F),onPointerMove:k,onPointerUp:E,onPointerCancel:E,onKeyDown:z=>N(z,F)},F)),m&&b.map((V,F)=>jsx("input",{type:"hidden",name:b.length>1?`${m}[${F}]`:m,value:V},F))]})});tn.displayName="Slider";var Fu=Z.createContext(null),Ku=()=>{let e=Z.useContext(Fu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},Bi=Z.createContext(null),$u=()=>{let e=Z.useContext(Bi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Gu=Z.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,m]=Z.useState(()=>t==="single"?r?[r]:[]:r||[]),f=Z.useRef(new Map),p=Z.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,v=w=>{if(t==="single"){let R=h.includes(w)&&a?[]:[w];g||m(R),o?.(R[0]||"");}else {let C=h.includes(w)?h.filter(R=>R!==w):[...h,w];g||m(C),o?.(C);}},b=Z.useCallback((w,C)=>{f.current.set(w,C),p.current.includes(w)||p.current.push(w);},[]),y=Z.useCallback(w=>{f.current.delete(w),p.current=p.current.filter(C=>C!==w);},[]),x=Z.useCallback(w=>{let C=p.current;if(C.length===0)return;let R=document.activeElement,T;f.current.forEach((M,N)=>{M===R&&(T=N);});let P=T?C.indexOf(T):-1,S;switch(w){case "first":S=0;break;case "last":S=C.length-1;break;case "next":S=P===-1?0:(P+1)%C.length;break;case "prev":S=P===-1?C.length-1:(P-1+C.length)%C.length;break}let k=C[S];f.current.get(k)?.focus();},[]);return jsx(Fu.Provider,{value:{type:t,value:h,onValueChange:v,collapsible:a,disabled:s,registerTrigger:b,unregisterTrigger:y,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:u("w-full",e),...l,children:i})})});Gu.displayName="Accordion";var Uu=Z.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=Ku(),d=c.value.includes(t),m=n||c.disabled||false,f=Z.useId(),p=Z.useId();return r!==void 0?jsx(Bi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:[jsx(ju,{children:jsxs("div",{className:"flex items-center gap-3",children:[a,jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-medium",children:r}),o&&jsx("span",{className:"text-xs text-muted-foreground",children:o})]})]})}),jsx(_u,{children:s})]})}):jsx(Bi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:s})})});Uu.displayName="AccordionItem";var ju=Z.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=Ku(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:m}=$u(),f=Z.useRef(null);Z.useEffect(()=>{let g=f.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let p=g=>{switch(r?.(g),g.key){case "ArrowDown":g.preventDefault(),s.focusTrigger("next");break;case "ArrowUp":g.preventDefault(),s.focusTrigger("prev");break;case "Home":g.preventDefault(),s.focusTrigger("first");break;case "End":g.preventDefault(),s.focusTrigger("last");break}};return jsx("h3",{className:"flex",children:jsxs("button",{type:"button",ref:g=>{f.current=g,typeof a=="function"?a(g):a&&(a.current=g);},id:m,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:u("flex flex-1 items-center justify-between py-4 font-medium transition-all text-left cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),onClick:g=>{n?.(g),s.onValueChange(i);},onKeyDown:p,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});ju.displayName="AccordionTrigger";var _u=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=$u();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),style:n,...r,children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:"pb-4 pt-0 text-sm",children:t})})})});_u.displayName="AccordionContent";var Yu=Z.createContext(null),Xu=()=>{let e=Z.useContext(Yu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},qu=Z.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=Z.useState(n),m=t!==void 0,f=m?t:c,p=Z.useId(),g=Z.useId(),h=v=>{o||(m||d(v),r?.(v));};return jsx(Yu.Provider,{value:{open:f,onOpenChange:h,disabled:o,contentId:p,triggerId:g},children:jsxs("div",{ref:l,"data-state":f?"open":"closed","data-disabled":o?"":void 0,className:u("space-y-2",e),...i,children:[a&&jsxs("div",{className:"flex items-center justify-between space-x-4 px-4",children:[jsx("h4",{className:"text-sm font-semibold",children:a}),jsx(Fi,{})]}),s]})})});qu.displayName="Collapsible";var Fi=Z.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=Xu();return jsx(pe,{ref:o,id:c,"aria-controls":l,"aria-expanded":a,disabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,variant:"light",size:"sm",isIconOnly:true,className:e,onClick:d=>{n?.(d),s(!a);},...r,children:t??jsx(ChevronsUpDown,{className:u("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});Fi.displayName="CollapsibleTrigger";var Zu=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=Xu(),c=Z.useRef(null),[d,m]=Z.useState(0),[f,p]=Z.useState(false),[g,h]=Z.useState(a);Z.useEffect(()=>{a?(h(true),m(0),p(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&m(c.current.scrollHeight);});})):(p(true),c.current?(m(c.current.scrollHeight),requestAnimationFrame(()=>{m(0);})):m(0));},[a]);let v=()=>{p(false),a||h(false);};return g?jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("overflow-hidden",e),style:{...n,height:f?d:a?"auto":0,transition:f?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:v,...r,children:jsx("div",{ref:c,className:"space-y-2",children:t})}):null});Zu.displayName="CollapsibleContent";var Vy=cva("relative w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1.5",md:"h-2.5",lg:"h-4"}},defaultVariants:{size:"md"}}),Qu={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},ns=Z.forwardRef(({className:e,value:t=0,max:n=100,label:r,showPercentage:o=false,formatPercentage:a=d=>`${Math.round(d)}%`,size:s,color:i="primary",...l},c)=>{let d=Math.min(Math.max(t/n*100,0),100),m=r||o,f=Qu[i]||"",p=!Qu[i];return jsxs("div",{ref:c,className:"w-full",children:[m&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r&&jsx("span",{className:"text-muted-foreground",children:r}),o&&jsx("span",{className:u("text-muted-foreground",!r&&"ml-auto"),children:a(d)})]}),jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":n,"aria-label":typeof r=="string"?r:void 0,className:u(Vy({size:s}),e),...l,children:jsx("div",{className:u("h-full w-full flex-1 transition-all rounded-full",f),style:{transform:`translateX(-${100-d}%)`,...p?{backgroundColor:i}:{}}})})]})});ns.displayName="Progress";var nm=Z.createContext(null),rm=()=>{let e=Z.useContext(nm);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},om=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=Z.useState(n),c=t!==void 0,d=c?t:i,m=Z.useRef(null),f=Z.useId(),p=Z.useRef(null),g=Z.useRef(null),h=Z.useCallback(v=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),v?p.current=setTimeout(()=>{c||l(true),r?.(true);},o):g.current=setTimeout(()=>{c||l(false),r?.(false);},a);},[c,r,o,a]);return Z.useEffect(()=>{if(!s||!d)return;let v=()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),c||l(false),r?.(false);};return window.addEventListener("scroll",v,true),()=>window.removeEventListener("scroll",v,true)},[s,d,c,r]),Z.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(nm.Provider,{value:{open:d,onOpenChange:h,triggerRef:m,contentId:f},children:e})};om.displayName="HoverCard";var am=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=rm();return jsx("a",{ref:p=>{l.current=p,typeof s=="function"?s(p):s&&(s.current=p);},onMouseEnter:p=>{t?.(p),i(true);},onMouseLeave:p=>{n?.(p),i(false);},onFocus:p=>{r?.(p),i(true);},onBlur:p=>{o?.(p),i(false);},...a,children:e})});am.displayName="HoverCardTrigger";var sm=Z.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="center",alignOffset:o=0,onMouseEnter:a,onMouseLeave:s,children:i,...l},c)=>{let{open:d,onOpenChange:m,triggerRef:f,contentId:p}=rm(),[g,h]=Z.useState({top:0,left:0}),[v,b]=Z.useState(false),y=Z.useRef(null);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!d||!f.current||!y.current)return;(()=>{if(!f.current||!y.current)return;let T=f.current.getBoundingClientRect(),P=y.current.getBoundingClientRect(),S=0,k=0;switch(t){case "top":S=T.top-P.height-n;break;case "bottom":S=T.bottom+n;break;case "left":k=T.left-P.width-n;break;case "right":k=T.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":k=T.left+o;break;case "center":k=T.left+T.width/2-P.width/2;break;case "end":k=T.right-P.width-o;break}else switch(r){case "start":S=T.top+o;break;case "center":S=T.top+T.height/2-P.height/2;break;case "end":S=T.bottom-P.height-o;break}h({top:S,left:k});})();},[d,t,n,r,o,f]);let x=R=>{a?.(R),m(true);},w=R=>{s?.(R),m(false);};if(!v||!d)return null;let C={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Wa.createPortal(jsx("div",{ref:R=>{y.current=R,typeof c=="function"?c(R):c&&(c.current=R);},id:p,"data-state":d?"open":"closed","data-side":t,className:u("fixed z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",C,e),style:{top:g.top,left:g.left},onMouseEnter:x,onMouseLeave:w,...l,children:i}),document.body)});sm.displayName="HoverCardContent";var im=Z.createContext({size:"md",variant:"default",radius:"md"}),os=()=>Z.useContext(im);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var Oy=cva("flex flex-wrap items-center break-words",{variants:{size:{sm:"gap-1 text-xs",md:"gap-1.5 text-sm sm:gap-2",lg:"gap-2 text-base sm:gap-3"},variant:{default:"text-muted-foreground",bordered:"text-muted-foreground px-3 py-1.5 border",filled:"text-muted-foreground bg-muted px-3 py-1.5"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),By=cva("",{variants:{size:{sm:"[&>svg]:h-3 [&>svg]:w-3",md:"[&>svg]:h-3.5 [&>svg]:w-3.5",lg:"[&>svg]:h-4 [&>svg]:w-4"}},defaultVariants:{size:"md"}}),Fy=cva("flex items-center justify-center",{variants:{size:{sm:"h-6 w-6 [&>svg]:h-3 [&>svg]:w-3",md:"h-8 w-8 [&>svg]:h-4 [&>svg]:w-4",lg:"h-10 w-10 [&>svg]:h-5 [&>svg]:w-5"}},defaultVariants:{size:"md"}}),lm=Z.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(im.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));lm.displayName="Breadcrumb";var cm=Z.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=os();return jsx("ol",{ref:n,className:u(Oy({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});cm.displayName="BreadcrumbList";var dm=Z.forwardRef(({className:e,...t},n)=>{let{size:r}=os();return jsx("li",{ref:n,className:u("inline-flex items-center",r==="sm"&&"gap-1",r==="md"&&"gap-1.5",r==="lg"&&"gap-2",e),...t})});dm.displayName="BreadcrumbItem";var um=Z.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:u("transition-colors hover:text-foreground cursor-pointer",e),...t}));um.displayName="BreadcrumbLink";var mm=Z.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:u("font-medium text-foreground",e),...t}));mm.displayName="BreadcrumbPage";var pm=({children:e,className:t,...n})=>{let{size:r}=os();return jsx("li",{role:"presentation","aria-hidden":"true",className:u(By({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};pm.displayName="BreadcrumbSeparator";var fm=({className:e,...t})=>{let{size:n}=os();return jsxs("span",{role:"presentation","aria-hidden":"true",className:u(Fy({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};fm.displayName="BreadcrumbEllipsis";var vm=Z.forwardRef(({ratio:e=1,className:t,style:n,children:r,...o},a)=>jsx("div",{ref:a,className:u("relative w-full",t),style:{...n,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:r})}));vm.displayName="AspectRatio";var ym=Z.createContext(null),$i=()=>{let e=Z.useContext(ym);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Rm=Z.createContext(null),wm=()=>{let e=Z.useContext(Rm);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Cm=Z.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=Z.useState(null);return jsx(ym.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:u("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[n,jsx(Gi,{})]})})});Cm.displayName="NavigationMenu";var Tm=Z.forwardRef(({className:e,...t},n)=>{let{orientation:r}=$i();return jsx("ul",{ref:n,className:u("group flex flex-1 list-none items-center justify-center gap-1",r==="vertical"&&"flex-col items-start",e),...t})});Tm.displayName="NavigationMenuList";var Mm=Z.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=$i(),s=Z.useId(),i=Z.useRef(null),l=o===s,c=Z.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Rm.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:u("relative",e),...n,children:t})})});Mm.displayName="NavigationMenuItem";var Nm=cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50"),km=Z.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=wm(),c=m=>{n?.(m),l(true);},d=m=>{r?.(m),l(!i);};return jsxs("button",{ref:m=>{s.current=m,typeof a=="function"?a(m):a&&(a.current=m);},type:"button","data-state":i?"open":"closed",className:u(Nm(),"group",e),onMouseEnter:c,onClick:d,"aria-expanded":i,...o,children:[t,jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})});km.displayName="NavigationMenuTrigger";var Pm=Z.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=wm(),l=Z.useRef(null),[c,d]=Z.useState({top:0,left:0});Z.useEffect(()=>{if(!a||!i.current)return;let p=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return p(),window.addEventListener("resize",p),window.addEventListener("scroll",p,true),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,true);}},[a,i]);let m=p=>{t?.(p),s(true);},f=p=>{n?.(p),s(false);};return a?Wa.createPortal(jsx("div",{ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p);},"data-state":a?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-4 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:c.top,left:c.left},onMouseEnter:m,onMouseLeave:f,...r}),document.body):null});Pm.displayName="NavigationMenuContent";var Em=cva("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"),Sm=Z.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:u(Em(),t&&"bg-accent text-accent-foreground",e),...n}));Sm.displayName="NavigationMenuLink";var Gi=Z.forwardRef((e,t)=>null);Gi.displayName="NavigationMenuViewport";var Lm=Z.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=$i();return r?jsx("div",{ref:n,className:u("top-full z-[1] flex h-2.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}):null});Lm.displayName="NavigationMenuIndicator";var Vm=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Pt=Z.forwardRef(({className:e,size:t,...n},r)=>{let a={sm:14,md:16,lg:20}[t??"md"];return jsx("button",{ref:r,type:"button",className:u(Vm({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});Pt.displayName="CloseButton";var as=Z.createContext(null);function Zy(){let e=Z.useContext(as);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Gn(){return Z.useContext(as)}var Qy="16rem",Jy="18rem",eR="3rem",tR="b",nR={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},rR={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Ui=Z.forwardRef(({defaultOpen:e=false,open:t,onOpenChange:n,placement:r="left",size:o="md",backdrop:a="opaque",isDismissable:s=true,hideCloseButton:i=false,collapsible:l="offcanvas",mode:c,className:d,style:m,children:f,...p},g)=>{let h=c??"overlay",v=h==="overlay",[b,y]=Z.useState(false),[x,w]=Z.useState(false),[C,R]=Z.useState(e),T=t??C,P=Z.useCallback(M=>{let N=typeof M=="function"?M(T):M;n?n(N):R(N);},[n,T]);Z.useEffect(()=>{let M=()=>{y(window.innerWidth<768);};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);let S=Z.useCallback(()=>v?P(M=>!M):b?w(M=>!M):P(M=>!M),[b,P,w,v]);Z.useEffect(()=>{if(v)return;let M=N=>{N.key===tR&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),S());};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[S,v]);let k=T?"expanded":"collapsed",E=Z.useMemo(()=>({placement:r,state:k,open:T,setOpen:P,isMobile:b,openMobile:x,setOpenMobile:w,toggleDrawer:S,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,k,T,P,b,x,w,S,l,h,o,a,s,i]);return v?jsx(as.Provider,{value:E,children:jsx(Drawer.Root,{open:T,onOpenChange:P,direction:r,dismissible:s,children:f})}):jsx(as.Provider,{value:E,children:jsx(rr,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":Qy,"--drawer-width-icon":eR,...m},className:u("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Ui.displayName="Drawer";var zm=Z.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Gn();if(!s)return jsx("div",{ref:a,className:u("flex h-full flex-col bg-background text-foreground",n),...o,children:r});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:m,setOpenMobile:f}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:r});if(l==="none")return jsx("div",{ref:a,className:u("flex h-full w-[--drawer-width] flex-col bg-background text-foreground border-r",i==="right"&&"border-l border-r-0",n),...o,children:r});if(c&&!t)return jsx(oR,{open:m,onOpenChange:f,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",v=l==="icon";return jsx("div",{ref:a,className:u("group peer text-foreground relative"),"data-state":d,"data-collapsible":g?l:"","data-variant":e,"data-placement":i,"data-embedded":"true",children:jsx("div",{className:u("flex h-full flex-col overflow-hidden transition-[width,opacity] duration-200 ease-out",h?g?"w-0 opacity-0":"w-[--drawer-width] opacity-100":v&&g?"w-[--drawer-width-icon]":"w-[--drawer-width]",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background transition-opacity duration-200",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border",e==="default"&&i==="left"&&"border-r",e==="default"&&i==="right"&&"border-l"),children:r})})})}return jsxs("div",{ref:a,className:"group peer hidden md:block text-foreground","data-state":d,"data-collapsible":d==="collapsed"?l:"","data-variant":e,"data-placement":i,children:[jsx("div",{className:u("duration-200 relative h-svh w-[--drawer-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0",i==="right"&&"group-data-[placement=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--drawer-width-icon]")}),jsx("div",{className:u("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--drawer-width] transition-[left,right,width] ease-linear md:flex",i==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--drawer-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--drawer-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--drawer-width-icon] group-data-[placement=left]:border-r group-data-[placement=right]:border-l",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border"),children:r})})]})});zm.displayName="DrawerSidebar";var oR=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return ln(),()=>cn()},[t]),!o||!t?null:Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>n(false)}),jsx("div",{className:u("fixed z-50 bg-background p-0 text-foreground shadow-lg","animate-in",r==="left"&&"inset-y-0 left-0 h-full w-[--drawer-width] slide-in-from-left",r==="right"&&"inset-y-0 right-0 h-full w-[--drawer-width] slide-in-from-right"),style:{"--drawer-width":Jy},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Om=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Gn();if(o?.mode==="overlay")return jsx(Drawer.Trigger,{ref:r,className:e,onClick:t,...n});let a=o?.toggleDrawer;return jsxs("button",{ref:r,type:"button","data-drawer":"trigger",className:u("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...n,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Drawer"})]})});Om.displayName="DrawerTrigger";var Bm=Z.forwardRef(({className:e,children:t,...n},r)=>{let o=Gn(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque";if(a){let c=s==="top"||s==="bottom",d=s==="left"||s==="right",m=d?nR[i]:rR[i],f={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},p={top:"inset-x-0 top-0 rounded-b-[10px]",bottom:"inset-x-0 bottom-0 rounded-t-[10px]",left:"inset-y-0 left-0 rounded-r-[10px]",right:"inset-y-0 right-0 rounded-l-[10px]"};return jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:u("fixed inset-0 z-50",f[l])}),jsxs(Drawer.Content,{ref:r,className:u("fixed z-50 flex flex-col border bg-background",p[s],e),style:{...d?{width:m,height:"100%"}:{},...c?{maxHeight:m}:{},...n.style},...n,children:[c&&jsx("div",{className:u("mx-auto h-2 w-[100px] rounded-full bg-muted",s==="top"?"mb-4 mt-auto":"mt-4")}),t]})]})}return jsx("div",{ref:r,className:u("flex flex-col h-full",e),...n,children:t})});Bm.displayName="DrawerContent";var Fm=Z.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Gn(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:u("flex flex-col gap-2 p-4 relative",e),...r,children:[n,i&&jsx(Pt,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});Fm.displayName="DrawerHeader";var Km=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"body",className:u("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));Km.displayName="DrawerBody";var $m=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"footer",className:u("flex flex-col gap-2 p-4 mt-auto",e),...t}));$m.displayName="DrawerFooter";var Gm=Z.forwardRef(({className:e,...t},n)=>Gn()?.mode==="overlay"?jsx(Drawer.Title,{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));Gm.displayName="DrawerTitle";var Um=Z.forwardRef(({className:e,...t},n)=>Gn()?.mode==="overlay"?jsx(Drawer.Description,{ref:n,className:u("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));Um.displayName="DrawerDescription";var jm=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Gn();return jsx(Pt,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});jm.displayName="DrawerClose";var _m=Z.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Gn();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",m=d?PanelLeftOpen:PanelRightOpen,f=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:u("flex items-center gap-2 w-full px-2 py-2 rounded-md text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","transition-colors cursor-pointer","group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),onClick:p=>{t?.(p),s();},...r,children:[c?jsx(m,{className:"h-4 w-4 shrink-0"}):jsx(f,{className:"h-4 w-4 shrink-0"}),n&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});_m.displayName="DrawerToggle";var Wm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:u("mx-4 h-px bg-border",e),...t}));Wm.displayName="DrawerSeparator";var Ym=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-drawer":"menu",className:u("flex w-full min-w-0 flex-col gap-1",e),...t}));Ym.displayName="DrawerMenu";var Xm=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:u("group/menu-item relative",e),...t}));Xm.displayName="DrawerMenuItem";var qm=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-ring transition-[width,height,padding] hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",bordered:"bg-background shadow-[0_0_0_1px_currentColor] hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent/50 hover:text-accent-foreground"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),Zm=Z.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Gn(),c=l?.isMobile??false,d=l?.state??"expanded",m=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":n,"data-active":e,className:u(qm({variant:t,size:n}),o),...s,children:a});return r?jsxs(Cn,{children:[jsx(Tn,{children:m}),jsx(Mn,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):m});Zm.displayName="DrawerMenuButton";var Qm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group",className:u("relative flex w-full min-w-0 flex-col p-2",e),...t}));Qm.displayName="DrawerGroup";var Jm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group-label",className:u("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none transition-[margin,opacity] ease-linear","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));Jm.displayName="DrawerGroupLabel";var ep=Z.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,className:u("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ep.displayName="DrawerInset";var aR=Ui;var np=Z.forwardRef(({className:e,...t},n)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:n,className:u("w-full caption-bottom text-sm",e),...t})}));np.displayName="Table";var rp=Z.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:u("[&_tr]:border-b",e),...t}));rp.displayName="TableHeader";var op=Z.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:u("[&_tr:last-child]:border-0",e),...t}));op.displayName="TableBody";var ap=Z.forwardRef(({className:e,...t},n)=>jsx("tfoot",{ref:n,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ap.displayName="TableFooter";var sp=Z.forwardRef(({className:e,...t},n)=>jsx("tr",{ref:n,className:u("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));sp.displayName="TableRow";var ip=Z.forwardRef(({className:e,...t},n)=>jsx("th",{ref:n,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ip.displayName="TableHead";var lp=Z.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));lp.displayName="TableCell";var cp=Z.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:u("mt-4 text-sm text-muted-foreground",e),...t}));cp.displayName="TableCaption";function uR({className:e,data:t,columns:n,selectable:r=false,selectedKeys:o,onSelectionChange:a,getRowKey:s=(w,C)=>String(C),sortable:i=false,sortState:l,onSortChange:c,paginated:d=false,pageSizeOptions:m=[10,20,50],paginationState:f,onPaginationChange:p,emptyContent:g="No data",loading:h=false,striped:v=false,hoverable:b=true,...y},x){let[w,C]=Z.useState(new Set),[R,T]=Z.useState({columnId:null,direction:null}),[P,S]=Z.useState({pageIndex:0,pageSize:m[0]||10}),k=o??w,E=l??R,M=f??P,N=O=>{a?a(O):C(O);},H=O=>{c?c(O):T(O);},D=O=>{p?p(O):S(O);},L=Z.useMemo(()=>{if(!E.columnId||!E.direction)return t;let O=n.find(B=>B.id===E.columnId);return O?[...t].sort((B,_)=>{let U=O.accessor(B),$=O.accessor(_);if(U===$)return 0;if(U==null)return 1;if($==null)return -1;let X=String(U).localeCompare(String($),void 0,{numeric:true});return E.direction==="asc"?X:-X}):t},[t,E,n]),I=Z.useMemo(()=>{if(!d)return L;let O=M.pageIndex*M.pageSize;return L.slice(O,O+M.pageSize)},[L,d,M]),A=Math.ceil(L.length/M.pageSize),K=O=>{if(O===true){let B=new Set(I.map((_,U)=>s(_,U)));N(B);}else N(new Set);},V=(O,B)=>{let _=new Set(k);B?_.add(O):_.delete(O),N(_);},F=I.length>0&&I.every((O,B)=>k.has(s(O,B))),z=I.some((O,B)=>k.has(s(O,B))),G=O=>{if(!n.find(U=>U.id===O)?.sortable&&!i)return;let _="asc";E.columnId===O&&(E.direction==="asc"?_="desc":E.direction==="desc"&&(_=null)),H({columnId:_?O:null,direction:_});},j=O=>E.columnId!==O?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):E.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,className:u("w-full",e),...y,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[r&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(_o,{checked:F?true:z?"indeterminate":false,onCheckedChange:K,"aria-label":"Select all"})}),n.map(O=>{let B=O.sortable??i;return jsx("th",{className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground",B&&"cursor-pointer select-none hover:text-foreground"),style:{width:O.width},onClick:()=>B&&G(O.id),children:jsxs("div",{className:"flex items-center gap-2",children:[O.header,B&&j(O.id)]})},O.id)})]})}),jsx("tbody",{className:"[&_tr:last-child]:border-0",children:h?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:"Loading..."})}):I.length===0?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):I.map((O,B)=>{let _=s(O,B),U=k.has(_);return jsxs("tr",{className:u("border-b transition-colors",b&&"hover:bg-muted/50",v&&B%2===1&&"bg-muted/30",U&&"bg-muted"),"data-state":U?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(_o,{checked:U,onCheckedChange:$=>V(_,!!$),"aria-label":`Select row ${B+1}`})}),n.map($=>jsx("td",{className:"p-4 align-middle",children:$.cell?$.cell(O,B):$.accessor(O)},$.id))]},_)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:M.pageSize,onChange:O=>D({pageIndex:0,pageSize:Number(O.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:m.map(O=>jsx("option",{value:O,children:O},O))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",M.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(pe,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex-1}),disabled:M.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(pe,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex+1}),disabled:M.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var mR=Z.forwardRef(uR);var ji=["January","February","March","April","May","June","July","August","September","October","November","December"];function xR({currentMonth:e,onMonthChange:t,startYear:n,endYear:r}){let o=getMonth(e),a=getYear(e),s=c=>{let d=setMonth(e,c);t(d);},i=c=>{let d=setYear(e,c);t(d);},l=Z.useMemo(()=>{let c=[];for(let d=r;d>=n;d--)c.push(d);return c},[n,r]);return jsxs("div",{className:"flex items-center gap-1",children:[jsxs(Qt,{children:[jsx(Jt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[85px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{className:"truncate",children:ji[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(en,{className:"min-w-[120px] p-0",children:jsx(Oe,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:ji.map((c,d)=>jsx(Ht,{onSelect:()=>s(d),className:u("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(Qt,{children:[jsx(Jt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[60px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{children:a}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(en,{className:"min-w-[80px] p-0",children:jsx(Oe,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Ht,{onSelect:()=>i(c),className:u("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function yR(e,t,n){return function({calendarMonth:o}){let{goToMonth:a,nextMonth:s,previousMonth:i}=useDayPicker();if(e)return jsxs("div",{className:"flex items-center justify-between gap-1 mb-2",children:[jsx(xR,{currentMonth:o.date,onMonthChange:a,startYear:t,endYear:n}),jsxs("div",{className:"flex items-center",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-6 w-6 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-3.5 w-3.5"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-6 w-6 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-3.5 w-3.5"})})]})]});let l=ji[o.date.getMonth()],c=o.date.getFullYear();return jsxs("div",{className:"flex items-center justify-between gap-2 h-10 mb-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-medium w-[90px]",children:l}),jsx("span",{className:"text-sm font-medium w-[50px]",children:c})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})}}function lo({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=Z.useMemo(()=>yR(r,o,a),[r,o,a]);return jsx(DayPicker,{showOutsideDays:n,className:u("p-4",e),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-2",month_caption:"sr-only",nav:"hidden",month_grid:"w-full border-collapse",weekdays:"flex",weekday:"text-muted-foreground w-8 font-normal text-xs text-center",week:"flex w-full mt-0.5",day:u("relative h-8 w-8 p-0 text-center text-sm","flex items-center justify-center","focus-within:relative focus-within:z-20","[&:has([aria-selected]:not(.outside-day))]:bg-accent","first:[&:has([aria-selected]:not(.outside-day))]:rounded-l-md","last:[&:has([aria-selected]:not(.outside-day))]:rounded-r-md"),day_button:u("size-8 p-0 font-normal rounded-md text-sm","inline-flex items-center justify-center","hover:bg-primary/10","focus:outline-none","transition-colors cursor-pointer"),range_start:"rounded-l-md",range_end:"rounded-r-md",selected:u("bg-primary text-primary-foreground rounded-md","hover:bg-primary/90 hover:!text-primary-foreground","focus:bg-primary focus:text-primary-foreground","[&.outside-day]:!bg-transparent [&.outside-day]:!text-muted-foreground/50"),today:"bg-accent text-accent-foreground rounded-md",outside:"outside-day text-muted-foreground/50 !bg-transparent",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none bg-muted text-foreground",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0}},components:{...s,MonthCaption:l},...i})}lo.displayName="Calendar";var pp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:u("mx-auto flex w-full justify-center",e),...t});pp.displayName="Pagination";var fp=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:u("flex flex-row items-center gap-1",e),...t}));fp.displayName="PaginationContent";var gp=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:u("",e),...t}));gp.displayName="PaginationItem";var TR={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},ss=({className:e,isActive:t,size:n="md",radius:r="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:u(ro({variant:t?"solid":"light",size:n,radius:r}),o&&TR[n],e),...a});ss.displayName="PaginationLink";var bp=({className:e,...t})=>jsxs(ss,{"aria-label":"Go to previous page",isIconOnly:false,className:u("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});bp.displayName="PaginationPrevious";var vp=({className:e,...t})=>jsxs(ss,{"aria-label":"Go to next page",isIconOnly:false,className:u("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});vp.displayName="PaginationNext";var MR={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},hp=({className:e,size:t="md",...n})=>jsxs("span",{"aria-hidden":true,className:u("flex items-center justify-center",MR[t],e),...n,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});hp.displayName="PaginationEllipsis";var Zo=Z.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,className:u("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));Zo.displayName="VisuallyHidden";var yp={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},kR={auto:"top-[50%] translate-y-[-50%]",center:"top-[50%] translate-y-[-50%]",top:"top-4 translate-y-0",bottom:"top-auto bottom-4 translate-y-0","top-center":"top-[20%] translate-y-0","bottom-center":"top-auto bottom-[20%] translate-y-0"},Rp=cva("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),Xi=cva("fixed left-[50%] z-50 grid translate-x-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 sm:rounded-lg",{variants:{size:{xs:"w-full max-w-xs",sm:"w-full max-w-sm",md:"w-full max-w-md",lg:"w-full max-w-lg",xl:"w-full max-w-xl","2xl":"w-full max-w-2xl","3xl":"w-full max-w-3xl","4xl":"w-full max-w-4xl","5xl":"w-full max-w-5xl",full:"w-[calc(100vw-2rem)] h-[calc(100vh-2rem)] max-w-none"}},defaultVariants:{size:"md"}}),ls=Z.createContext(null),Ar=()=>{let e=Z.useContext(ls);if(!e)throw new Error("Modal components must be used within a Modal");return e},Cp=Z.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:m,className:f},p)=>{let[g,h]=Z.useState(false),v=e!==void 0,b=v?e:g,[y,x]=Z.useState(false),w=Z.useRef(null),C=Z.useId(),R=Z.useId();Z.useEffect(()=>{x(true);},[]);let T=Z.useCallback(E=>{v||h(E),t?.(E);},[v,t]);Z.useEffect(()=>{if(b)return ln(),()=>cn()},[b]),Z.useEffect(()=>{if(!b||i)return;let E=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[b,i,T]);let P=E=>{s&&E.target===E.currentTarget&&T(false);},S=n?Z.isValidElement(n)?Z.cloneElement(n,{onClick:E=>{n.props.onClick?.(E),T(true);}}):jsx("button",{type:"button",onClick:()=>T(true),children:n}):null,k=()=>!y||!b?null:d==="outside"?Wa.createPortal(jsx("div",{"data-state":b?"open":"closed",className:u(Rp(),yp[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:P,children:jsxs("div",{ref:E=>{w.current=E,typeof p=="function"?p(E):p&&(p.current=E);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"open":"closed",className:u("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",m==="xs"&&"w-full max-w-xs",m==="sm"&&"w-full max-w-sm",m==="md"&&"w-full max-w-md",m==="lg"&&"w-full max-w-lg",m==="xl"&&"w-full max-w-xl",m==="2xl"&&"w-full max-w-2xl",m==="3xl"&&"w-full max-w-3xl",m==="4xl"&&"w-full max-w-4xl",m==="5xl"&&"w-full max-w-5xl",m==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!m&&"w-full max-w-md",f),children:[jsx(Zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Pt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})}),document.body):Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":b?"open":"closed",className:u(Rp(),yp[l]),onClick:P,"aria-hidden":"true"}),jsxs("div",{ref:E=>{w.current=E,typeof p=="function"?p(E):p&&(p.current=E);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"open":"closed",className:u(Xi({size:m}),kR[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(Zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Pt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})]}),document.body);return jsxs(ls.Provider,{value:{open:b,onOpenChange:T,scrollBehavior:d,titleId:C,descriptionId:R},children:[S,k()]})});Cp.displayName="Modal";var cs=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=Z.useState(n),i=t!==void 0,l=i?t:a,c=Z.useId(),d=Z.useId(),m=Z.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(ls.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};cs.displayName="ModalRoot";var Tp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ar();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Tp.displayName="ModalTrigger";var qi=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};qi.displayName="ModalPortal";var Zi=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Ar();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Zi.displayName="ModalOverlay";var Mp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ar();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Mp.displayName="ModalClose";var ds=Z.forwardRef(({className:e,children:t,size:n,showCloseButton:r=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:m}=Ar(),[f,p]=Z.useState(false);return Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(l)return ln(),()=>cn()},[l]),Z.useEffect(()=>{if(!l)return;let g=h=>{h.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l,c,o]),!f||!l?null:jsxs(qi,{children:[jsx(Zi,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Xi({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(Pt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});ds.displayName="ModalContent";var Np=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Np.displayName="ModalHeader";var kp=({className:e,children:t})=>(Z.useContext(ls)?.scrollBehavior??"inside")==="inside"?jsx(Oe,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});kp.displayName="ModalBody";var Pp=({className:e,children:t,...n})=>{let{onOpenChange:r}=Ar();return jsx("div",{className:u("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n,children:Z.Children.map(t,o=>Z.isValidElement(o)?Z.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};Pp.displayName="ModalFooter";var Ep=Z.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Ar();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});Ep.displayName="ModalTitle";var Sp=Z.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Ar();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});Sp.displayName="ModalDescription";var Qi=Z.forwardRef(({className:e,...t},n)=>jsx(Command,{ref:n,className:u("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Qi.displayName=Command.displayName;var SR=({children:e,...t})=>jsx(cs,{...t,children:jsx(ds,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Qi,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Lp=Z.forwardRef(({className:e,...t},n)=>jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(Command.Input,{ref:n,className:u("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Lp.displayName=Command.Input.displayName;var Dp=Z.forwardRef(({className:e,children:t,...n},r)=>jsx(Oe,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:u("overflow-hidden",e),...n,children:t})}));Dp.displayName=Command.List.displayName;var Hp=Z.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Hp.displayName=Command.Empty.displayName;var Ip=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Group,{ref:n,className:u("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ip.displayName=Command.Group.displayName;var Vp=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:u("-mx-1 h-px bg-border",e),...t}));Vp.displayName=Command.Separator.displayName;var Ap=Z.forwardRef(({className:e,children:t,startContent:n,endContent:r,...o},a)=>jsxs(Command.Item,{ref:a,className:u("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...o,children:[n,t&&jsx("span",{className:"flex-1",children:t}),r]}));Ap.displayName=Command.Item.displayName;var zp=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});zp.displayName="CommandShortcut";var HR={sm:{input:"h-9 px-2 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5"},md:{input:"h-10 px-3 text-sm",button:"h-10 w-10",icon:"h-4 w-4"},lg:{input:"h-11 px-4 text-base",button:"h-11 w-11",icon:"h-5 w-5"}},IR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Bp=Z.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,size:s="md",radius:i="md",...l},c)=>{let[d,m]=Z.useState(false),[f,p]=Z.useState(false),g=HR[s],h=IR[i];return jsxs("div",{className:"relative",children:[jsx("input",{type:d?"text":"password",className:u("flex w-full border border-input bg-background py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",g.input,h,t&&"pr-10",e),ref:c,disabled:n,style:{...a,borderColor:f?"var(--color-foreground)":void 0},onFocus:v=>{p(true),r?.(v);},onBlur:v=>{p(false),o?.(v);},...l}),t&&jsx("button",{type:"button",className:u("absolute right-0 top-0 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",g.button),onClick:()=>m(!d),disabled:n,tabIndex:-1,"aria-label":d?"Hide password":"Show password",children:d?jsx(EyeOff,{className:g.icon}):jsx(Eye,{className:g.icon})})]})});Bp.displayName="PasswordInput";var OR={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},BR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Fp=Z.forwardRef(({className:e,showButtons:t=true,step:n=1,min:r,max:o,value:a,defaultValue:s,onChange:i,disabled:l,size:c="md",radius:d="md",...m},f)=>{let[p,g]=Z.useState(s),[h,v]=Z.useState(false),b=a!==void 0,y=b?a:p,x=OR[c],w=BR[d],C=M=>{M!==void 0&&(r!==void 0&&M<r&&(M=r),o!==void 0&&M>o&&(M=o)),b||g(M),i?.(M);},R=()=>{C((y??0)+n);},T=()=>{C((y??0)-n);},P=M=>{let N=M.target.value;if(N==="")C(void 0);else {let H=parseFloat(N);isNaN(H)||C(H);}},S=M=>{M.key==="ArrowUp"?(M.preventDefault(),R()):M.key==="ArrowDown"&&(M.preventDefault(),T());},k=r===void 0||(y??0)>r,E=o===void 0||(y??0)<o;return t?jsxs("div",{className:u("relative flex items-center border border-input transition-colors",x.wrapper,w,l&&"opacity-50",e),style:{borderColor:h?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",x.button),onClick:T,disabled:l||!k,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:x.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("min-w-0 flex-1 bg-transparent text-center focus:outline-none disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input),ref:f,value:y??"",onChange:P,onKeyDown:S,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...m}),jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",x.button),onClick:R,disabled:l||!E,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input,w,e),style:{borderColor:h?"var(--color-foreground)":void 0},ref:f,value:y??"",onChange:P,onKeyDown:S,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...m})});Fp.displayName="NumberInput";var Up=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),Kp=cva("border-2 border-background ring-0 cursor-pointer transition-transform duration-200 hover:-translate-y-1",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{size:"md"}}),jp=Z.forwardRef(({className:e,items:t,max:n=5,size:r,showTooltips:o=false,...a},s)=>{let i=t.slice(0,n),l=t.length-n,c=(m,f)=>{let p=jsxs(Dr,{className:u(Kp({size:r})),children:[m.src&&jsx(io,{src:m.src,alt:m.alt||""}),jsx(Hr,{className:"text-xs",children:m.fallback||m.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&m.alt?jsxs(Cn,{children:[jsx(Tn,{children:p}),jsx(Mn,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:m.alt})]},f):p},d=jsxs("div",{ref:s,className:u(Up({size:r,className:e})),...a,children:[i.map((m,f)=>c(m,f)),l>0&&jsx(Dr,{className:u(Kp({size:r})),children:jsxs(Hr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(rr,{delayDuration:300,children:d}):d});jp.displayName="AvatarGroup";var _p=cva("flex gap-0.5",{variants:{size:{sm:"[&_svg]:h-4 [&_svg]:w-4",md:"[&_svg]:h-5 [&_svg]:w-5",lg:"[&_svg]:h-6 [&_svg]:w-6"}},defaultVariants:{size:"md"}}),Wp=Z.forwardRef(({className:e,value:t,defaultValue:n=0,onValueChange:r,max:o=5,size:a,icon:s="star",allowHalf:i=false,readOnly:l=false,disabled:c=false,filledColor:d,emptyColor:m,...f},p)=>{let[g,h]=Z.useState(n),[v,b]=Z.useState(null),y=t!==void 0,x=y?t:g,w=v!==null?v:x,C=N=>{l||c||(y||h(N),r?.(N));},R=(N,H=false)=>{let D=i&&H?N+.5:N+1;C(D);},T=(N,H)=>{if(l||c)return;let D=N.currentTarget.getBoundingClientRect(),L=i&&N.clientX<D.left+D.width/2;b(L?H+.5:H+1);},P=()=>{b(null);},S=s==="heart"?Heart:Star,k=N=>w>=N+1?"full":w>=N+.5?"half":"empty",E=d?{color:d,fill:d}:{},M=m?{color:m}:{};return jsx("div",{ref:p,className:u(_p({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:P,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(N,H)=>{let D=k(H);return jsxs("button",{type:"button",className:u("relative focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",!l&&!c&&"cursor-pointer hover:scale-110 transition-transform"),onClick:L=>{let I=L.currentTarget.getBoundingClientRect(),A=i&&L.clientX<I.left+I.width/2;R(H,A);},onMouseMove:L=>T(L,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":x===H+1,children:[jsx(S,{className:u("text-muted-foreground/30",D!=="empty"&&"absolute inset-0"),style:D==="empty"?M:void 0}),D!=="empty"&&jsx(S,{className:u("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",D==="half"&&"clip-path-half"),style:{...E,clipPath:D==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});Wp.displayName="Rating";var Xp=cva("inline-flex items-center justify-center gap-1.5 text-sm font-medium 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 cursor-default",{variants:{variant:{solid:"border-transparent text-primary-foreground",bordered:"border bg-transparent",ghost:"border-transparent bg-transparent",soft:"border-transparent",surface:"border-transparent bg-muted text-muted-foreground"},color:{primary:"",secondary:"",success:"",warning:"",danger:""},size:{sm:"h-6 px-2 text-xs",md:"h-7 px-2.5 text-sm",lg:"h-8 px-3 text-sm"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},clickable:{true:"cursor-pointer",false:""}},compoundVariants:[{variant:"solid",color:"primary",className:"bg-primary hover:bg-primary/90"},{variant:"solid",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-600"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:hover:bg-amber-600"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-600"},{variant:"bordered",color:"primary",className:"text-primary !border-primary hover:bg-primary/10"},{variant:"bordered",color:"secondary",className:"text-secondary-foreground !border-secondary hover:bg-secondary/10"},{variant:"bordered",color:"success",className:"text-green-600 !border-green-600 hover:bg-green-600/10 dark:text-green-500 dark:!border-green-500"},{variant:"bordered",color:"warning",className:"text-amber-600 !border-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:!border-amber-500"},{variant:"bordered",color:"danger",className:"text-red-600 !border-red-600 hover:bg-red-600/10 dark:text-red-500 dark:!border-red-500"},{variant:"ghost",color:"primary",className:"text-primary hover:bg-primary/10"},{variant:"ghost",color:"secondary",className:"text-secondary-foreground hover:bg-secondary"},{variant:"ghost",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"ghost",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"ghost",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/10"},{variant:"soft",color:"primary",className:"bg-primary/15 text-primary hover:bg-primary/20"},{variant:"soft",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"soft",color:"success",className:"bg-green-600/15 text-green-600 hover:bg-green-600/20 dark:bg-green-500/15 dark:text-green-500 dark:hover:bg-green-500/20"},{variant:"soft",color:"warning",className:"bg-amber-600/15 text-amber-600 hover:bg-amber-600/20 dark:bg-amber-500/15 dark:text-amber-500 dark:hover:bg-amber-500/20"},{variant:"soft",color:"danger",className:"bg-red-600/15 text-red-600 hover:bg-red-600/20 dark:bg-red-500/15 dark:text-red-500 dark:hover:bg-red-500/20"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),_R={sm:"sm",md:"sm",lg:"sm"},qp=Z.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,children:m,onClick:f,...p},g)=>{let h=a||!!f,v=b=>{b.stopPropagation(),c?.();};return jsxs("div",{ref:g,role:h?"button":void 0,tabIndex:h&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:f,onKeyDown:h&&!d?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f?.(b));}:void 0,className:u(Xp({variant:t,color:n,size:r,radius:o,clickable:h}),d&&"opacity-50 cursor-not-allowed",e),...p,children:[s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:m}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Pt,{size:_R[r??"md"],onClick:v,disabled:d,className:"ml-0.5 h-4 w-4"})]})});qp.displayName="Chip";var Zp=createContext({direction:"horizontal"}),ew=({className:e,direction:t="horizontal",children:n,...r})=>jsx(Zp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:u("flex h-full w-full data-[orientation=vertical]:flex-col",e),...r,children:n})}),tw=Panel,nw=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(Zp),o=r==="vertical";return jsx(Separator,{className:u("relative flex shrink-0 items-center justify-center bg-border outline-none",o?"h-px w-full after:absolute after:inset-x-0 after:top-1/2 after:h-1 after:-translate-y-1/2":"w-px after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",t),...n,children:e&&jsx("div",{className:u("z-10 flex items-center justify-center rounded-sm border bg-border",o?"h-3 w-4 rotate-90":"h-4 w-3"),children:jsx(GripVertical,{className:"h-2.5 w-2.5"})})})};var tf=cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-24 w-24"},color:{default:"",primary:"",success:"",warning:"",danger:""}},defaultVariants:{size:"md",color:"default"}}),ow={sm:{size:32,strokeWidth:3,fontSize:"text-[10px]"},md:{size:48,strokeWidth:4,fontSize:"text-xs"},lg:{size:64,strokeWidth:5,fontSize:"text-sm"},xl:{size:96,strokeWidth:6,fontSize:"text-base"}},Qp={default:"var(--color-foreground, #18181b)",primary:"var(--color-primary, #18181b)",success:"var(--color-success, #16a34a)",warning:"var(--color-warning, #d97706)",danger:"var(--color-danger, #dc2626)"},nf=Z.forwardRef(({className:e,size:t="md",color:n="default",value:r,max:o=100,showValue:a=false,formatValue:s=d=>`${Math.round(d)}%`,trackClassName:i,...l},c)=>{let d=Math.min(100,Math.max(0,r/o*100)),m=ow[t],f=(m.size-m.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:u(tf({size:t,color:n}),e),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":o,...l,children:[jsxs("svg",{width:m.size,height:m.size,viewBox:`0 0 ${m.size} ${m.size}`,fill:"none",children:[jsx("circle",{className:u("stroke-muted",i),cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none"}),jsx("circle",{cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none",strokeLinecap:"round",stroke:Qp[n]||Qp.default,strokeDasharray:`${p} ${p}`,strokeDashoffset:g,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&jsx("span",{className:u("absolute font-medium text-foreground",m.fontSize),children:s(d)})]})});nf.displayName="CircularProgress";var rf=Z.createContext(null),iw=()=>{let e=Z.useContext(rf);if(!e)throw new Error("OTP components must be used within InputOTP");return e},of=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),af=Z.forwardRef(({className:e,containerClassName:t,maxLength:n,value:r,defaultValue:o="",onChange:a,onComplete:s,pattern:i,disabled:l=false,size:c,radius:d="md",children:m,...f},p)=>{let[g,h]=Z.useState(o),[v,b]=Z.useState(0),[y,x]=Z.useState(false),w=Z.useRef(null),C=r!==void 0?r:g;Z.useImperativeHandle(p,()=>w.current),Z.useEffect(()=>{b(Math.min(C.length,n-1));},[C,n]),Z.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let R=M=>{let N=M.target.value;if(i&&N){let H=new RegExp(i.replace("^","").replace("$","").replace("+",""));N=N.split("").filter(D=>H.test(D)).join("");}N=N.slice(0,n),r===void 0&&h(N),a?.(N);},T=M=>{M.key==="ArrowLeft"?b(N=>Math.max(0,N-1)):M.key==="ArrowRight"&&b(N=>Math.min(C.length,n-1,N+1));},P=()=>{w.current?.focus();},S=()=>{x(true),b(Math.min(C.length,n-1));},k=()=>{x(false);},E={value:C,activeIndex:y?v:-1,maxLength:n,disabled:l,radius:d};return jsx(rf.Provider,{value:E,children:jsxs("div",{className:u(of({size:c}),t),onClick:P,"data-otp-container":true,children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:C,onChange:R,onKeyDown:T,onFocus:S,onBlur:k,disabled:l,maxLength:n,className:u("absolute opacity-0 pointer-events-none w-0 h-0",e),...f}),m]})})});af.displayName="InputOTP";var sf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center",e),...t}));sf.displayName="InputOTPGroup";var lw={none:"first:rounded-l-none",sm:"first:rounded-l-md",md:"first:rounded-l-lg",lg:"first:rounded-l-xl",full:"first:rounded-l-full"},cw={none:"last:rounded-r-none",sm:"last:rounded-r-md",md:"last:rounded-r-lg",lg:"last:rounded-r-xl",full:"last:rounded-r-full"},lf=Z.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=iw(),l=o[e]||"",c=a===e,d=c&&o.length===e;return jsxs("div",{ref:r,"data-otp-slot":true,"data-active":c,"data-filled":!!l,className:u("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:border-l",lw[i],cw[i],c&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...n,children:[l,d&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});lf.displayName="InputOTPSlot";var cf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));cf.displayName="InputOTPSeparator";var mf=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900",bordered:"border border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent text-zinc-800 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800",flat:"bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-white",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"flat",size:"md"}}),pf=Z.forwardRef(({className:e,variant:t,size:n,value:r=[],onChange:o,placeholder:a="Add tag...",maxTags:s,minTagLength:i=1,maxTagLength:l=50,triggerKeys:c=["Enter",",","Tab"],allowDuplicates:d=false,disabled:m,readOnly:f,renderTag:p,...g},h)=>{let[v,b]=Z.useState(""),y=Z.useRef(null);Z.useImperativeHandle(h,()=>y.current);let x=k=>{let E=k.trim();if(E.length<i||E.length>l||s&&r.length>=s||!d&&r.some(N=>N.text.toLowerCase()===E.toLowerCase()))return;let M={id:crypto.randomUUID(),text:E};o?.([...r,M]),b("");},w=k=>{m||f||o?.(r.filter(E=>E.id!==k));},C=k=>{if(c.includes(k.key)){if(k.key==="Tab"&&!v)return;k.preventDefault(),x(v);}k.key==="Backspace"&&!v&&r.length>0&&w(r[r.length-1].id);},R=k=>{let E=k.target.value;if(E.includes(",")){E.split(",").forEach(N=>{N.trim()&&x(N);});return}b(E);},T=k=>{k.preventDefault(),k.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(N=>{x(N);});},P=()=>{y.current?.focus();},S=s?r.length>=s:false;return jsxs("div",{className:u("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",m&&"cursor-not-allowed opacity-50",e),onClick:P,children:[r.map(k=>p?p(k,()=>w(k.id)):jsxs("span",{className:u(mf({variant:t,size:n})),children:[k.text,!m&&!f&&jsx("button",{type:"button",onClick:E=>{E.stopPropagation(),w(k.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${k.text}`,children:jsx(X,{className:"h-3 w-3"})})]},k.id)),!S&&!f&&jsx("input",{ref:y,type:"text",value:v,onChange:R,onKeyDown:C,onPaste:T,placeholder:r.length===0?a:"",disabled:m,className:u("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});pf.displayName="TagInput";var gf=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-2 py-6",md:"gap-3 py-10",lg:"gap-4 py-16"}},defaultVariants:{size:"md"}}),bf=Z.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u(gf({size:t,className:e})),...i,children:[n&&jsx("div",{className:"text-muted-foreground [&>svg]:h-10 [&>svg]:w-10",children:n}),r&&jsx("h3",{className:"text-lg font-semibold text-foreground",children:r}),o&&jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:o}),a&&jsx("div",{className:"mt-2",children:a}),s]}));bf.displayName="EmptyState";var hf=cva("border p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-zinc-800 text-white border-zinc-800 dark:bg-zinc-200 dark:text-zinc-900 dark:border-zinc-200",bordered:"border border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent border-transparent shadow-none",flat:"bg-zinc-100 border-transparent dark:bg-zinc-800",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),xf=Z.forwardRef(({className:e,variant:t,radius:n,label:r,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let m=s==="up"?TrendingUp:s==="down"?TrendingDown:Minus,f=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:u(hf({variant:t,radius:n,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:u("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:r}),a&&jsx("div",{className:u("[&>svg]:h-4 [&>svg]:w-4",t==="solid"?"opacity-80":"text-muted-foreground"),children:a})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:o}),s&&i&&jsxs("span",{className:u("flex items-center gap-0.5 text-sm",f),children:[jsx(m,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:u("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});xf.displayName="StatCard";var ra=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2",cards:"gap-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),rl=({checked:e,disabled:t,onClick:n})=>jsx("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t,onClick:r=>{r.stopPropagation(),t||n(r);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e&&"bg-primary text-primary-foreground",t&&"cursor-not-allowed opacity-50"),children:e&&jsx("span",{className:"flex items-center justify-center text-current",children:jsx(Check,{className:"h-3 w-3"})})});function Sw({item:e,index:t,renderItem:n,showHandle:r,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:m}){let{attributes:f,listeners:p,setNodeRef:g,transform:h,transition:v,isDragging:b}=useSortable({id:e.id}),y={transform:CSS.Transform.toString(h),transition:v};return jsxs("div",{ref:g,...f,style:y,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?x=>d?.(e,x):void 0,className:u("flex items-center gap-3 transition-all",c&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",c&&i&&"border-primary bg-accent",!c&&a&&!s&&"cursor-pointer hover:bg-muted/50",!c&&s&&"cursor-pointer hover:bg-muted/50",!c&&i&&a&&!s&&"bg-primary/10",b&&"opacity-50 z-10",(a||s)&&"cursor-pointer"),children:[r&&o!==false&&jsx("div",{className:"shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",...p,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(rl,{checked:l,onClick:x=>m?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function Lw({className:e,variant:t,size:n,items:r,renderItem:o,draggable:a=false,onReorder:s,showHandle:i=true,dragIcon:l,selectable:c=false,multiple:d=false,selectedKeys:m,defaultSelectedKeys:f=[],onSelect:p,checkable:g=false,checkedKeys:h,defaultCheckedKeys:v=[],onCheck:b,emptyContent:y,children:x,...w},C){let[R,T]=Z.useState(false),[P,S]=Z.useState(null);Z.useEffect(()=>{T(true);},[]);let[k,E]=Z.useState(new Set(f)),M=m!==void 0,N=M?new Set(m):k,[H,D]=Z.useState(new Set(v)),L=h!==void 0,I=L?new Set(h):H,A=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),K=Z.useCallback((B,_)=>{if(!r)return;let U=new Set(N),$=!U.has(B.id);d?$?U.add(B.id):U.delete(B.id):(U.clear(),$&&U.add(B.id)),M||E(U);let X=r.filter(te=>U.has(te.id));p?.(Array.from(U),{selected:$,selectedItems:X,item:B,event:_});},[r,N,d,M,p]),V=Z.useCallback((B,_)=>{if(!r)return;let U=new Set(I),$=!U.has(B.id);$?U.add(B.id):U.delete(B.id),L||D(U);let X=r.filter(te=>U.has(te.id));b?.(Array.from(U),{checked:$,checkedItems:X,item:B,event:_});},[r,I,L,b]),F=B=>{if(!r)return;let _=r.find(U=>U.id===B.active.id);_&&S(_);},z=B=>{let{active:_,over:U}=B;if(S(null),!r||!U||_.id===U.id)return;let $=r.findIndex(te=>te.id===_.id),X=r.findIndex(te=>te.id===U.id);if($!==-1&&X!==-1){let te=[...r],[Y]=te.splice($,1);te.splice(X,0,Y),s?.(te);}},j=(a||c||g)&&r&&o,O=t==="cards";return r&&r.length===0&&y?jsx("div",{ref:C,className:u("flex items-center justify-center p-8 text-muted-foreground",e),...w,children:y}):j?a?R?jsxs(DndContext,{sensors:A,collisionDetection:closestCenter,onDragStart:F,onDragEnd:z,children:[jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map(B=>B.id),strategy:verticalListSortingStrategy,children:r.map((B,_)=>jsx(Sw,{item:B,index:_,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:N.has(B.id),isChecked:I.has(B.id),isCards:O,onSelect:K,onCheck:V},B.id))})}),jsx(DragOverlay,{children:P&&o&&jsxs("div",{className:"flex items-center gap-3 bg-background border shadow-lg rounded-md p-3 opacity-90",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:o(P,r?.indexOf(P)??0)})]})})]}):jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:r.map((B,_)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(rl,{checked:I.has(B.id),onClick:U=>V(B,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(B,_)})]},B.id))}):jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:r.map((B,_)=>{let U=N.has(B.id),$=I.has(B.id);return jsxs("div",{role:"listitem","aria-selected":c?U:void 0,onClick:c&&!g?X=>K(B,X):void 0,className:u("flex items-center gap-3 transition-all",O&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",O&&U&&"border-primary bg-accent",!O&&c&&!g&&"cursor-pointer hover:bg-muted/50",!O&&g&&"cursor-pointer hover:bg-muted/50",!O&&U&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(rl,{checked:$,onClick:X=>V(B,X)}),jsx("div",{className:"flex-1 min-w-0",children:o(B,_)})]},B.id)})}):jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:x})}var Dw=Z.forwardRef(Lw),wf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Cf=Z.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:u(wf({interactive:t,className:e})),...a,children:[n&&jsx("div",{className:"shrink-0 text-muted-foreground",children:n}),jsx("div",{className:"flex-1 min-w-0",children:o}),r&&jsx("div",{className:"shrink-0 whitespace-nowrap",children:r})]}));Cf.displayName="ListItem";var Tf=Z.forwardRef(({className:e,primary:t,secondary:n,children:r,...o},a)=>jsxs("div",{ref:a,className:u("min-w-0",e),...o,children:[t&&jsx("p",{className:"text-sm font-medium leading-none truncate",children:t}),n&&jsx("p",{className:"mt-1 text-sm text-muted-foreground truncate",children:n}),r]}));Tf.displayName="ListItemText";var kf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Pf=Z.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:u(kf({position:t,className:e})),...n}));Pf.displayName="Timeline";var Ef=cva("relative flex gap-4 pb-8 last:pb-0",{variants:{variant:{default:"",success:"[&_[data-timeline-dot]]:bg-green-500 [&_[data-timeline-dot]]:border-green-500",warning:"[&_[data-timeline-dot]]:bg-yellow-500 [&_[data-timeline-dot]]:border-yellow-500",error:"[&_[data-timeline-dot]]:bg-red-500 [&_[data-timeline-dot]]:border-red-500",info:"[&_[data-timeline-dot]]:bg-blue-500 [&_[data-timeline-dot]]:border-blue-500"}},defaultVariants:{variant:"default"}}),Sf=Z.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(Ef({variant:t,className:e})),...s,children:[!n&&jsxs("div",{className:"flex flex-col items-center",children:[jsx("div",{"data-timeline-dot":true,className:"flex h-3 w-3 items-center justify-center rounded-full border-2 border-primary bg-primary",children:o}),!r&&jsx("div",{className:"w-0.5 flex-1 bg-border"})]}),a]}));Sf.displayName="TimelineItem";var Lf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 pt-0.5",e),...t}));Lf.displayName="TimelineContent";var Df=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Df.displayName="TimelineOpposite";var If=cva("inline-flex items-center rounded-lg bg-muted p-1 text-muted-foreground",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},fullWidth:{true:"w-full",false:""}},defaultVariants:{size:"md",fullWidth:false}}),Vf=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 text-xs px-2.5",md:"h-8 text-sm px-3",lg:"h-10 text-base px-4"},selected:{true:"bg-background text-foreground shadow-sm",false:""}},defaultVariants:{size:"md",selected:false}}),Af=Z.createContext({}),zf=Z.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,m]=Z.useState(a),f=o!==void 0?o:d,p=Z.useCallback(g=>{o===void 0&&m(g),s?.(g);},[o,s]);return jsx(Af.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:u(If({size:t,fullWidth:n,className:e})),...l,children:r})})});zf.displayName="SegmentedControl";var Of=Z.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=Z.useContext(Af),i=s.value===n,l=r||s.disabled;return jsx("button",{ref:a,type:"button",role:"radio","aria-checked":i,"data-state":i?"on":"off",disabled:l,onClick:()=>{l||s.onValueChange?.(n);},className:u(Vf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});Of.displayName="SegmentedControlItem";var Bf=cva("relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",{variants:{variant:{default:"border-input bg-background hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-danger bg-danger/5"},size:{sm:"p-4 min-h-[120px]",md:"p-6 min-h-[160px]",lg:"p-8 min-h-[200px]"}},defaultVariants:{variant:"default",size:"md"}}),Ff=e=>{let t=e.type;return t.startsWith("image/")?Image$1:t.startsWith("video/")?FileVideo:t.startsWith("audio/")?FileAudio:t.includes("pdf")||t.includes("document")?FileText:t.includes("zip")||t.includes("rar")||t.includes("archive")?FileArchive:File},bs=e=>{if(e===0)return "0 Bytes";let t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},Kf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${bs(t)}`}),n&&n.length>0&&(n.some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.endsWith("/*")){let s=a.slice(0,-2);return e.type.startsWith(s)}return e.type===a})||r.push({code:"file-invalid-type",message:`File type not accepted. Accepted: ${n.join(", ")}`})),r},$f=Z.forwardRef(({className:e,variant:t,size:n,onFilesChange:r,onFilesRejected:o,onFileRemove:a,files:s=[],showFileList:i=true,children:l,maxSize:c=10*1024*1024,accept:d,multiple:m=true,disabled:f,...p},g)=>{let[h,v]=Z.useState(false),[b,y]=Z.useState(false),[x,w]=Z.useState([]),C=Z.useRef(null),R=Z.useCallback(L=>{if(!L||L.length===0)return;let I=Array.from(L),A=[],K=[];(m?I:[I[0]]).forEach(F=>{let z=Kf(F,c,d);z.length>0?K.push({file:F,errors:z}):A.push(F);}),w(K),A.length>0&&r?.(A),K.length>0&&o?.(K);},[c,d,m,r,o]),T=Z.useCallback(L=>{if(L.preventDefault(),L.stopPropagation(),!f&&(v(true),L.dataTransfer.items)){let A=Array.from(L.dataTransfer.items).some(K=>{if(K.kind!=="file")return true;if(d&&d.length>0){let V=K.type;return !d.some(F=>F.endsWith("/*")?V.startsWith(F.slice(0,-2)):V===F)}return false});y(A);}},[f,d]),P=Z.useCallback(L=>{L.preventDefault(),L.stopPropagation(),!f&&(L.dataTransfer.dropEffect="copy");},[f]),S=Z.useCallback(L=>{L.preventDefault(),L.stopPropagation();let I=L.currentTarget.getBoundingClientRect(),A=L.clientX,K=L.clientY;(A<I.left||A>I.right||K<I.top||K>I.bottom)&&(v(false),y(false));},[]),k=Z.useCallback(L=>{L.preventDefault(),L.stopPropagation(),v(false),y(false),!f&&R(L.dataTransfer.files);},[f,R]),E=Z.useCallback(()=>{f||C.current?.click();},[f]),M=Z.useCallback(L=>{R(L.target.files),L.target.value="";},[R]),N=Z.useCallback(L=>{f||(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),C.current?.click());},[f]),H=b?"error":h?"active":t,D=d?.join(",");return jsxs("div",{ref:g,className:u("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:T,onDragOver:P,onDragLeave:S,onDrop:k,onClick:E,onKeyDown:N,className:u(Bf({variant:H,size:n}),f&&"opacity-50 cursor-not-allowed",!f&&"cursor-pointer focus:outline-none"),"aria-disabled":f,children:[jsx("input",{ref:C,type:"file",accept:D,multiple:m,disabled:f,onChange:M,className:"sr-only",tabIndex:-1}),l||jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[jsx("div",{className:"rounded-full bg-muted p-3",children:jsx(Upload,{className:"h-6 w-6 text-muted-foreground"})}),jsxs("div",{className:"space-y-1",children:[jsx("p",{className:"text-sm font-medium",children:h?"Drop files here":"Drop files or click to upload"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[c&&`Max ${bs(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),x.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:x.map(({file:L,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:L.name}),":"," ",I.map(A=>A.message).join(", ")]},L.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(L=>{let I=Ff(L.file);return jsxs("div",{className:u("flex items-center gap-3 rounded-lg border p-3",L.error&&"border-danger bg-danger/5"),children:[jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:jsx(I,{className:"h-5 w-5 text-muted-foreground"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"truncate text-sm font-medium",children:L.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[bs(L.file.size),L.error&&jsx("span",{className:"ml-2 text-danger",children:L.error})]}),L.progress!==void 0&&L.progress<100&&jsx(ns,{value:L.progress,className:"mt-2 h-1"})]}),jsxs(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:A=>{A.stopPropagation(),a?.(L.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},L.id)})})]})});$f.displayName="FileUpload";var $w=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,Uf=cva("relative rounded-md border border-input shadow-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},shape:{square:"rounded-md",circle:"rounded-full"},interactive:{true:"cursor-pointer hover:scale-110 active:scale-105",false:"cursor-default"}},defaultVariants:{size:"md",shape:"square",interactive:false}}),sa=Z.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...m},f)=>jsx("button",{ref:f,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:u(Uf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?$w:void 0,backgroundSize:n?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...m,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));sa.displayName="ColorSwatch";var jf=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),_f=Z.forwardRef(({value:e,defaultValue:t,onChange:n,layout:r,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",disabled:l,selectedRingColor:c,className:d,style:m,...f},p)=>{let[g,h]=Z.useState(t),v=e??g,b=Z.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),y=x=>x.toLowerCase();return jsx("div",{ref:p,role:"listbox","aria-label":"Color options",className:u(jf({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...m},...f,children:a.map(x=>{let w=v?y(v)===y(x):false;return jsx(sa,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:b,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});_f.displayName="ColorSwatchPicker";var jw=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Wf={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Yf=Z.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=jw,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,m]=Z.useState(e??t),f=Z.useId();Z.useEffect(()=>{e!==void 0&&m(e);},[e]);let p=v=>{m(v),n?.(v);},g=v=>{m(v),n?.(v);},h=v=>{let b=v.target.value.toUpperCase();m(b),n?.(b);};return l==="simple"?jsxs("label",{className:u("relative rounded-md border border-input shadow-sm transition-colors cursor-pointer hover:border-foreground focus-within:border-foreground overflow-hidden",r&&"opacity-50 cursor-not-allowed",Wf[s],i),children:[jsx("input",{type:"color",value:d,onChange:h,disabled:r,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",id:f}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(ht,{children:[jsx(or,{ref:c,disabled:r,className:u("rounded-md border border-input shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",Wf[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(xt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:p,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(Lr,{htmlFor:"color-input",className:"text-xs",children:"Hex Color"}),jsxs("div",{className:"flex gap-2",children:[jsx("div",{className:"h-9 w-9 shrink-0 rounded-md border",style:{backgroundColor:d}}),jsx(HexColorInput,{id:"color-input",color:d,onChange:p,prefixed:true,className:"flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-2 font-mono text-sm uppercase focus:outline-none focus:border-foreground disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Lr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(v=>jsx(sa,{color:v,size:"sm",isSelected:d.toLowerCase()===v.toLowerCase(),onSelect:g},v))})]})]})})]})});Yf.displayName="ColorPicker";var Xf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),al=e=>String(e).padStart(2,"0"),qw=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},Zw=(e,t)=>`${al(e)}:${al(t)}`,qf=Z.forwardRef(({className:e,size:t,value:n,onChange:r,use24Hour:o=true,minuteStep:a=1,showPicker:s=true,minTime:i,maxTime:l,disabled:c,...d},m)=>{let[f,p]=Z.useState(n??""),[g,h]=Z.useState(false);Z.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:v,minutes:b}=qw(f||"00:00"),y=S=>{let k=S.target.value;p(k),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(k)&&r?.(k);},x=(S,k)=>{let E=Math.max(0,Math.min(23,S)),M=Math.max(0,Math.min(59,k)),N=Zw(E,M);p(N),r?.(N);},w=()=>x(v+1,b),C=()=>x(v-1,b),R=()=>x(v,b+a),T=()=>x(v,b-a),P=({value:S,onIncrement:k,onDecrement:E})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:k,disabled:c,children:jsx(ChevronUp,{className:"h-4 w-4"})}),jsx("div",{className:"flex h-10 w-12 items-center justify-center rounded-md bg-muted text-lg font-semibold",children:al(S)}),jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:E,disabled:c,children:jsx(ChevronDown,{className:"h-4 w-4"})})]});return jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:m,type:"time",value:f,onChange:y,disabled:c,className:u(Xf({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(ht,{open:g,onOpenChange:h,children:[jsxs(or,{type:"button",className:"absolute right-1 h-7 w-7 p-0 inline-flex items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(xt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(P,{value:v,onIncrement:w,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(P,{value:b,onIncrement:R,onDecrement:T,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(pe,{variant:"bordered",size:"sm",onClick:()=>{let S=new Date;x(S.getHours(),S.getMinutes());},children:"Now"}),jsx(pe,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});qf.displayName="TimeInput";var Zf=cva("flex h-10 w-full border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),Jw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},eC=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}},sl=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},Qf=(e,t,n)=>{if(!e)return;let r=e.replace(new RegExp(`\\${t}`,"g"),"");r=r.replace(n,"."),r=r.replace(/[^0-9.-]/g,"");let o=parseFloat(r);return isNaN(o)?void 0:o},Jf=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r,onChange:o,currency:a="USD",locale:s="en-US",decimals:i=2,min:l,max:c,showCurrency:d=true,currencyPosition:m="prefix",currencySymbol:f,thousandSeparator:p=",",decimalSeparator:g=".",radius:h="md",disabled:v,placeholder:b,...y},x)=>{let[w,C]=Z.useState(r),[R,T]=Z.useState(""),[P,S]=Z.useState(false),k=n!==void 0?n:w,E=f??eC(a,s);Z.useEffect(()=>{!P&&k!==void 0&&T(sl(k,i,p,g));},[k,i,p,g,P]);let M=I=>{let A=I.target.value;if(!A){T(""),n===void 0&&C(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${p}${g}.-]*$`).test(A))return;T(A);let V=Qf(A,p,g);if(V!==void 0){let F=V;l!==void 0&&V<l&&(F=l),c!==void 0&&V>c&&(F=c),n===void 0&&C(F),o?.(F);}},N=()=>{S(true),k!==void 0&&T(k.toString().replace(".",g));},H=()=>{S(false),T(k!==void 0?sl(k,i,p,g):"");},D=d&&m==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:E}),L=d&&m==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:E});return jsxs("div",{className:"relative flex items-center",children:[D&&jsx("div",{className:"absolute left-3 pointer-events-none",children:D}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:R,onChange:M,onFocus:N,onBlur:H,disabled:v,placeholder:b??`0${g}${"0".repeat(i)}`,className:u(Zf({size:t}),Jw[h],D&&"pl-8",L&&"pr-8","text-right",e),style:{borderColor:P?"var(--color-foreground)":void 0},...y}),L&&jsx("div",{className:"absolute right-3 pointer-events-none",children:L})]})});Jf.displayName="CurrencyInput";var eg=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),il={creditCard:{mask:"#### #### #### ####"},creditCardAmex:{mask:"#### ###### #####"},cvv:{mask:"###"},expiry:{mask:"##/##"},date:{mask:"##/##/####"},dateISO:{mask:"####-##-##"},time:{mask:"##:##"},ip:{mask:"###.###.###.###"},mac:{mask:"AA:AA:AA:AA:AA:AA"},id11:{mask:"###########"},id9:{mask:"#########"},id10:{mask:"##########"},postal5:{mask:"#####"},postal9:{mask:"#####-####"}},rC=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},ur=e=>["#","A","*"].includes(e),hs=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(ur(s)){if(o<e.length){let i=e[o];rC(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},ll=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];ur(o)&&(n+=e[r]);}return n},tg=(e,t)=>e.split("").map(n=>ur(n)?t:n).join(""),oC=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)ur(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,ur(t[i])&&s++;for(;a<t.length&&!ur(t[a]);)a++;return Math.min(a,e.length)},ng=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,mask:a,maskPlaceholder:s="_",showMaskPlaceholder:i=false,includeMaskChars:l=false,disabled:c,placeholder:d,...m},f)=>{let p=typeof a=="string"&&a in il?il[a].mask:a,[g,h]=Z.useState(r),[v,b]=Z.useState(""),[y,x]=Z.useState(false),w=Z.useRef(null),C=n!==void 0?n:g;Z.useImperativeHandle(f,()=>w.current),Z.useEffect(()=>{let S=hs(C,p,true);b(S);},[C,p]);let R=S=>{let k=S.target.value,E=S.target.selectionStart??0,M=k.replace(/[^\w]/g,""),N=hs(M,p,true),H=ll(N,p);b(N),n===void 0&&h(l?N:H),o?.(H,N),requestAnimationFrame(()=>{if(w.current){let D=oC(N,p,E);w.current.setSelectionRange(D,D);}});},T=S=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(S.key)||S.ctrlKey||S.metaKey)return;let k=w.current;if(!k)return;let E=k.selectionStart??0;if(S.key==="Backspace"&&E>0){let M=E-1;for(;M>0&&!ur(p[M]);)M--;let N=ll(v,p),H=0;for(let I=0;I<M&&I<p.length;I++)ur(p[I])&&H++;let D=N.slice(0,Math.max(0,H-1))+N.slice(H),L=hs(D,p,true);b(L),n===void 0&&h(l?L:D),o?.(D,L),S.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(M,M);});}},P=i?tg(p,s):d;return jsx("input",{ref:w,type:"text",value:v,onChange:R,onKeyDown:T,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:P,className:u(eg({size:t}),e),style:{borderColor:y?"var(--color-foreground)":void 0},...m})});ng.displayName="MaskedInput";var cC=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),og=[{code:"AR",name:"Argentina",dialCode:"+54",flag:"\u{1F1E6}\u{1F1F7}",format:"## ####-####"},{code:"AU",name:"Australia",dialCode:"+61",flag:"\u{1F1E6}\u{1F1FA}",format:"### ### ###"},{code:"AT",name:"Austria",dialCode:"+43",flag:"\u{1F1E6}\u{1F1F9}",format:"### #######"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"\u{1F1E7}\u{1F1EA}",format:"### ## ## ##"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"\u{1F1E7}\u{1F1F7}",format:"(##) #####-####"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"\u{1F1E7}\u{1F1EC}",format:"### ### ###"},{code:"CA",name:"Canada",dialCode:"+1",flag:"\u{1F1E8}\u{1F1E6}",format:"(###) ###-####"},{code:"CN",name:"China",dialCode:"+86",flag:"\u{1F1E8}\u{1F1F3}",format:"### #### ####"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"\u{1F1ED}\u{1F1F7}",format:"## ### ####"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"\u{1F1E8}\u{1F1FF}",format:"### ### ###"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"\u{1F1E9}\u{1F1F0}",format:"## ## ## ##"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"\u{1F1EA}\u{1F1EC}",format:"### ### ####"},{code:"FI",name:"Finland",dialCode:"+358",flag:"\u{1F1EB}\u{1F1EE}",format:"## ### ####"},{code:"FR",name:"France",dialCode:"+33",flag:"\u{1F1EB}\u{1F1F7}",format:"# ## ## ## ##"},{code:"DE",name:"Germany",dialCode:"+49",flag:"\u{1F1E9}\u{1F1EA}",format:"#### #######"},{code:"GR",name:"Greece",dialCode:"+30",flag:"\u{1F1EC}\u{1F1F7}",format:"### ### ####"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"\u{1F1ED}\u{1F1F0}",format:"#### ####"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"\u{1F1ED}\u{1F1FA}",format:"## ### ####"},{code:"IN",name:"India",dialCode:"+91",flag:"\u{1F1EE}\u{1F1F3}",format:"##### #####"},{code:"IL",name:"Israel",dialCode:"+972",flag:"\u{1F1EE}\u{1F1F1}",format:"##-###-####"},{code:"IT",name:"Italy",dialCode:"+39",flag:"\u{1F1EE}\u{1F1F9}",format:"### ### ####"},{code:"JP",name:"Japan",dialCode:"+81",flag:"\u{1F1EF}\u{1F1F5}",format:"##-####-####"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"\u{1F1F2}\u{1F1FD}",format:"### ### ####"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"\u{1F1F3}\u{1F1F1}",format:"## ########"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"\u{1F1F3}\u{1F1FF}",format:"## ### ####"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"\u{1F1F3}\u{1F1EC}",format:"### ### ####"},{code:"NO",name:"Norway",dialCode:"+47",flag:"\u{1F1F3}\u{1F1F4}",format:"### ## ###"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"\u{1F1F5}\u{1F1F0}",format:"### #######"},{code:"PL",name:"Poland",dialCode:"+48",flag:"\u{1F1F5}\u{1F1F1}",format:"### ### ###"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"\u{1F1F5}\u{1F1F9}",format:"### ### ###"},{code:"RO",name:"Romania",dialCode:"+40",flag:"\u{1F1F7}\u{1F1F4}",format:"### ### ###"},{code:"RU",name:"Russia",dialCode:"+7",flag:"\u{1F1F7}\u{1F1FA}",format:"(###) ###-##-##"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"\u{1F1F8}\u{1F1E6}",format:"## ### ####"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"\u{1F1F7}\u{1F1F8}",format:"## ### ####"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"\u{1F1F8}\u{1F1EC}",format:"#### ####"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"\u{1F1F8}\u{1F1F0}",format:"### ### ###"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"\u{1F1F8}\u{1F1EE}",format:"## ### ###"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"\u{1F1FF}\u{1F1E6}",format:"## ### ####"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"\u{1F1F0}\u{1F1F7}",format:"##-####-####"},{code:"ES",name:"Spain",dialCode:"+34",flag:"\u{1F1EA}\u{1F1F8}",format:"### ### ###"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"\u{1F1F8}\u{1F1EA}",format:"##-### ## ##"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"\u{1F1E8}\u{1F1ED}",format:"## ### ## ##"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"\u{1F1F9}\u{1F1FC}",format:"### ### ###"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"\u{1F1F9}\u{1F1F7}",format:"(###) ### ## ##"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"\u{1F1FA}\u{1F1E6}",format:"## ### ## ##"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"\u{1F1E6}\u{1F1EA}",format:"## ### ####"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"\u{1F1EC}\u{1F1E7}",format:"#### ### ####"},{code:"US",name:"United States",dialCode:"+1",flag:"\u{1F1FA}\u{1F1F8}",format:"(###) ###-####"}],xs=(e,t)=>{let n=e.replace(/\D/g,""),r="",o=0;for(let a=0;a<t.length&&o<n.length;a++)t[a]==="#"?(r+=n[o],o++):r+=t[a];return r},dC=e=>e.replace(/#/g,"_"),ag=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=og,showCountrySelect:c=true,showDialCode:d=false,disabled:m,placeholder:f,radius:p="md",...g},h)=>{let[v,b]=Z.useState(r),[y,x]=Z.useState(a??s),[w,C]=Z.useState(false),[R,T]=Z.useState(false),[P,S]=Z.useState(false),[k,E]=Z.useState({top:0,left:0,width:0}),M=Z.useRef(null),N=Z.useRef(null),H=n!==void 0?n:v,D=a??y,L=l.find(G=>G.code===D)??l[0],I=xs(H,L.format);Z.useEffect(()=>{S(true);},[]),Z.useEffect(()=>{if(R&&M.current){let G=M.current.getBoundingClientRect();E({top:G.bottom+4,left:G.left,width:Math.max(G.width,280)});}},[R]),Z.useEffect(()=>{if(!R)return;let G=j=>{M.current&&!M.current.contains(j.target)&&N.current&&!N.current.contains(j.target)&&T(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[R]),Z.useEffect(()=>{if(!R)return;let G=j=>{j.key==="Escape"&&T(false);};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[R]),Z.useEffect(()=>{if(!R)return;let G=j=>{N.current?.contains(j.target)||T(false);};return window.addEventListener("scroll",G,true),()=>window.removeEventListener("scroll",G,true)},[R]);let A=G=>{let O=G.target.value.replace(/\D/g,"");n===void 0&&b(O);let B=xs(O,L.format),_=`${L.dialCode} ${B}`;o?.(O,_,L);},K=G=>{let j=l.find(_=>_.code===G);if(!j)return;a===void 0&&x(G),i?.(j);let O=xs(H,j.format),B=`${j.dialCode} ${O}`;o?.(H,B,j),T(false);},V=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",F=w||R;return jsxs("div",{className:u("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[p],m&&"cursor-not-allowed opacity-50"),style:{borderColor:F?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:M,type:"button",disabled:m,onClick:()=>T(!R),className:u("flex items-center justify-between bg-transparent px-3 py-2 text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50","w-[100px] shrink-0 border-r",V),style:{borderColor:F?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:L.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:L.dialCode})]}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",R&&"rotate-180")})]}),P&&R&&Wa.createPortal(jsx("div",{ref:N,className:"fixed z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:k.top,left:k.left,minWidth:k.width},children:jsx(Oe,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(G=>jsxs("div",{role:"option","aria-selected":G.code===D,onClick:()=>K(G.code),className:"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:G.code===D&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:G.flag}),jsx("span",{className:"flex-1",children:G.name}),jsx("span",{className:"text-xs text-muted-foreground",children:G.dialCode})]})]},G.code))})})}),document.body)]}),jsxs("div",{className:"relative flex-1",children:[d&&!c&&jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:L.dialCode}),jsx("input",{ref:h,type:"tel",inputMode:"tel",value:I,onChange:A,onFocus:()=>C(true),onBlur:()=>C(false),disabled:m,placeholder:f??dC(L.format),className:u("flex h-10 w-full bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t==="sm"&&"h-8 px-2 text-xs",t==="lg"&&"h-12 px-4 text-base",d&&!c&&"pl-12",e),...g})]})]})});ag.displayName="PhoneInput";var ig=cva("flex items-center justify-between w-full px-4 py-3 border-b bg-background",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-background border-border",ghost:"bg-transparent border-transparent",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-border"},size:{sm:"h-12 px-3 py-2",md:"h-14 px-4 py-3",lg:"h-16 px-6 py-4"},sticky:{true:"sticky top-0 z-50",false:""}},defaultVariants:{variant:"bordered",size:"md",sticky:false}}),lg=Z.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=Z.useState(false),m={sm:"hidden sm:flex",md:"hidden md:flex",lg:"hidden lg:flex"}[s],f={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:u(ig({variant:t,size:n,sticky:r,className:e})),...i,children:[jsxs("div",{className:"flex items-center justify-between w-full",children:[o&&jsx("div",{className:"flex-shrink-0",children:o}),jsx("div",{className:u("items-center gap-4 flex-1 justify-end",m),children:a}),jsx("button",{type:"button",className:u("p-2 rounded-md hover:bg-accent hover:text-accent-foreground transition-colors",f),onClick:()=>d(!c),"aria-label":c?"Close menu":"Open menu","aria-expanded":c,children:c?jsx(X,{className:"h-5 w-5"}):jsx(Menu,{className:"h-5 w-5"})})]}),c&&jsx("div",{className:u("absolute top-full left-0 right-0 flex flex-col gap-2 p-4 bg-background border-b border-border shadow-lg",f),children:a})]})});lg.displayName="Navbar";var cg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center gap-2 font-semibold text-lg",e),...t}));cg.displayName="NavbarBrand";var dg=Z.forwardRef(({className:e,justify:t="start",...n},r)=>{let o={start:"justify-start",center:"justify-center",end:"justify-end"}[t];return jsx("div",{ref:r,className:u("flex items-center gap-4",o,e),...n})});dg.displayName="NavbarContent";var ug=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:u("flex items-center",t&&"text-primary font-medium",e),...n}));ug.displayName="NavbarItem";var mg=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("a",{ref:r,className:u("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...n}));mg.displayName="NavbarLink";var bC={none:"",hover:"hover:underline",always:"underline"},pg={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},gg=Z.forwardRef(({className:e,color:t="primary",underline:n="hover",isExternal:r,showExternalIcon:o=true,isDisabled:a,children:s,style:i,...l},c)=>{let d=r?{target:"_blank",rel:"noopener noreferrer"}:{},m=t in pg,f=m?i:{color:t,...i};return jsxs("a",{ref:c,className:u("inline-flex items-center gap-1 underline-offset-4 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",m&&pg[t],bC[n],a&&"pointer-events-none opacity-50",e),style:f,"aria-disabled":a,...d,...l,children:[s,r&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});gg.displayName="Link";var bg=cva("fixed z-50 transition-all duration-300",{variants:{position:{"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","bottom-center":"bottom-6 left-1/2 -translate-x-1/2"}},defaultVariants:{position:"bottom-right"}}),vg=Z.forwardRef(({className:e,position:t,threshold:n=400,icon:r,behavior:o="smooth",variant:a="solid",color:s="default",size:i="md",radius:l="full",target:c,onVisibilityChange:d,onClick:m,...f},p)=>{let[g,h]=Z.useState(false);Z.useEffect(()=>{let y=c?.current||window,x=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return y.addEventListener("scroll",x,{passive:true}),x(),()=>{y.removeEventListener("scroll",x);}},[n,c,g,d]);let v=y=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),m?.(y);},b=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:u(bg({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(pe,{ref:p,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:v,"aria-label":"Back to top",className:"shadow-lg",...f,children:r||jsx(ArrowUp,{className:b})})})});vg.displayName="BackTop";var TC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),MC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),hg=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),ws=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),xg=Z.createContext(null),pr=()=>{let e=Z.useContext(xg);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},yg=Z.createContext(null),la=()=>{let e=Z.useContext(yg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},dl=Z.createContext(null),Rg=Z.createContext(null),wg=Z.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=Z.useState(null);return jsx(xg.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:n},children:jsx("div",{ref:o,role:"menubar",className:u("flex h-10 items-center space-x-1 border bg-background p-1",TC({radius:n}),e),...r,children:t})})});wg.displayName="Menubar";var Cg=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=pr(),r=Z.useId(),o=Z.useRef(null),a=t===r,s=Z.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(yg.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};Cg.displayName="MenubarMenu";var Tg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Tg.displayName="MenubarGroup";var Mg=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};Mg.displayName="MenubarPortal";var Ng=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(dl.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Ng.displayName="MenubarSub";var kg=Z.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Rg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));kg.displayName="MenubarRadioGroup";var Pg=Z.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=pr(),{menuId:l,triggerRef:c,open:d,onOpenChange:m}=la(),f=g=>{t?.(g),m(!d);},p=g=>{n?.(g),a&&a!==l&&(s(l),document.activeElement instanceof HTMLElement&&document.activeElement.blur());};return jsx("button",{ref:g=>{c.current=g,typeof o=="function"?o(g):o&&(o.current=g);},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"data-state":d?"open":"closed",className:u("flex cursor-default select-none items-center px-3 py-1.5 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",MC({radius:i}),e),onClick:f,onMouseEnter:p,...r})});Pg.displayName="MenubarTrigger";var Eg=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=pr(),l=Z.useContext(dl);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:m}=l,f=g=>{r?.(g),d(true);},p=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{m.current=g,typeof s=="function"?s(g):s&&(s.current=g);},role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"data-state":c?"open":"closed",className:u("flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",ws({radius:i}),t&&"pl-8",e),onMouseEnter:f,onMouseLeave:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Eg.displayName="MenubarSubTrigger";var Sg=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=pr(),i=Z.useContext(dl);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!d.current||!h.current)return;(()=>{if(!d.current||!h.current)return;let x=d.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),C=x.top,R=x.right+t;R+w.width>window.innerWidth&&(R=x.left-w.width-t),f({top:C,left:R});})();},[l,t,d]);let v=y=>{n?.(y),c(true);},b=y=>{r?.(y),c(false);};return !p||!l?null:Wa.createPortal(jsx("div",{ref:y=>{h.current=y,typeof a=="function"?a(y):a&&(a.current=y);},role:"menu","data-state":l?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",hg({radius:s}),e),style:{top:m.top,left:m.left},onMouseEnter:v,onMouseLeave:b,...o}),document.body)});Sg.displayName="MenubarSubContent";var Lg=Z.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=pr(),{triggerRef:l,open:c,onOpenChange:d}=la(),[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);return Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!c||!l.current||!h.current)return;let v=()=>{if(!l.current||!h.current)return;let b=l.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=b.bottom+r,w=b.left+n;t==="center"?w=b.left+b.width/2-y.width/2:t==="end"&&(w=b.right-y.width-n),f({top:x,left:w});};return v(),window.addEventListener("resize",v),window.addEventListener("scroll",v,true),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,true);}},[c,t,n,r,l]),Z.useEffect(()=>{if(!c)return;let v=b=>{let y=b.target;h.current&&!h.current.contains(y)&&l.current&&!l.current.contains(y)&&d(false);};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c,d,l]),Z.useEffect(()=>{if(!c)return;let v=b=>{b.key==="Escape"&&d(false);};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c,d]),!p||!c?null:Wa.createPortal(jsx("div",{ref:v=>{h.current=v,typeof s=="function"?s(v):s&&(s.current=v);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[12rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",hg({radius:i}),e),style:{top:m.top,left:m.left},...a,children:o}),document.body)});Lg.displayName="MenubarContent";var Dg=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=pr(),{onOpenChange:l}=la(),c=d=>{if(n){d.preventDefault();return}o?.(d),r?.(),l(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",ws({radius:i}),t&&"pl-8",!n&&"cursor-pointer",e),onClick:c,...a})});Dg.displayName="MenubarItem";var Hg=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=pr(),{onOpenChange:c}=la(),d=m=>{if(o){m.preventDefault();return}a?.(m),r?.(!n),c(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",ws({radius:l}),!o&&"cursor-pointer",e),onClick:d,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});Hg.displayName="MenubarCheckboxItem";var Ig=Z.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=pr(),{onOpenChange:l}=la(),c=Z.useContext(Rg),d=c?.value===n,m=f=>{if(r){f.preventDefault();return}o?.(f),c?.onValueChange(n),l(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":d,tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-state":d?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",ws({radius:i}),!r&&"cursor-pointer",e),onClick:m,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d&&jsx(Circle,{className:"h-2 w-2 fill-current"})}),t]})});Ig.displayName="MenubarRadioItem";var ul=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));ul.displayName="MenubarSection";var NC=ul,Vg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Vg.displayName="MenubarSeparator";var Ag=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Ag.displayName="MenubarShortcut";var zg=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center",vertical:"flex-col"},size:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"horizontal",size:"md"}}),Og=Z.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=Z.Children.toArray(o);return jsx("div",{ref:s,className:u(zg({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>Z.isValidElement(l)?Z.cloneElement(l,{...l.props,stepNumber:c+1,status:l.props.status||(c<r?"completed":c===r?"current":"upcoming"),isLast:c===i.length-1,orientation:t,size:n}):l)})});Og.displayName="Steps";var Bg=cva("flex items-center",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col items-start"},size:{sm:"gap-2",md:"gap-3",lg:"gap-4"}},defaultVariants:{orientation:"horizontal",size:"md"}}),PC=cva("flex items-center justify-center rounded-full font-medium transition-colors",{variants:{status:{completed:"bg-primary text-primary-foreground",current:"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2 ring-offset-background",upcoming:"bg-muted text-muted-foreground border-2 border-muted-foreground/30"},size:{sm:"h-6 w-6 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"}},defaultVariants:{status:"upcoming",size:"md"}}),EC=cva("bg-muted transition-colors",{variants:{orientation:{horizontal:"h-0.5 flex-1 min-w-8",vertical:"w-0.5 min-h-8 ml-4"},status:{completed:"bg-primary",current:"bg-muted",upcoming:"bg-muted"}},defaultVariants:{orientation:"horizontal",status:"upcoming"}}),Fg=Z.forwardRef(({className:e,orientation:t="horizontal",size:n="md",title:r,description:o,icon:a,status:s="upcoming",stepNumber:i,isLast:l,...c},d)=>jsxs("div",{ref:d,className:u(Bg({orientation:t,size:n,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:u("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:u(PC({status:s,size:n})),children:s==="completed"?jsx(Check,{className:n==="sm"?"h-3 w-3":n==="lg"?"h-5 w-5":"h-4 w-4"}):a||i}),(r||o)&&jsxs("div",{className:"flex flex-col",children:[r&&jsx("span",{className:u("font-medium",n==="sm"&&"text-sm",n==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:r}),o&&jsx("span",{className:u("text-muted-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm",n==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:u(EC({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));Fg.displayName="Step";var $g=cva("flex flex-col select-none",{variants:{variant:{default:"",bordered:"rounded-lg border",filled:"bg-muted/30 rounded-lg p-2"},size:{sm:"[--tree-indent:16px] [--tree-item-height:28px] text-xs",md:"[--tree-indent:20px] [--tree-item-height:32px] text-sm",lg:"[--tree-indent:24px] [--tree-item-height:40px] text-base"}},defaultVariants:{variant:"default",size:"md"}}),Gg=cva("flex items-center py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm min-h-[var(--tree-item-height)]",md:"py-1.5 px-2 text-sm min-h-[var(--tree-item-height)]",lg:"py-2 px-3 text-base min-h-[var(--tree-item-height)]"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),Ug=Z.createContext(null),zC=()=>{let e=Z.useContext(Ug);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},OC=({checked:e,indeterminate:t,disabled:n,onClick:r})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:n,onClick:o=>{o.stopPropagation(),n||r(o);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",n&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),jg=({node:e,level:t,isLast:n=false,parentIsLastPath:r=[]})=>{let{expandedKeys:o,toggleExpand:a,selectedKeys:s,handleSelect:i,selectable:l,checkedKeys:c,halfCheckedKeys:d,handleCheck:m,checkable:f,draggable:p,draggedNode:g,setDraggedNode:h,dragOverKey:v,dragOverPosition:b,setDragOver:y,handleDrop:x,allowDrop:w,onDragStart:C,onDragOver:R,onDragEnter:T,onDragLeave:P,onDragEnd:S,showLine:k,showIcon:E,showHandle:M,dragIcon:N,icon:H,leafIcon:D,folderIcon:L,folderOpenIcon:I,blockNode:A,disabled:K,size:V,getAllKeys:F}=zC(),z=e.children&&e.children.length>0,G=e.isLeaf??!z,j=o.has(e.key),O=s.has(e.key),B=c.has(e.key),_=d.has(e.key),U=g?.key===e.key,$=v===e.key,X=!!(K||e.disabled),te=l&&e.selectable!==false,Y=f&&e.checkable!==false,ve=Z.useMemo(()=>X?false:typeof p=="boolean"?p:typeof p=="function"?p(e):p&&typeof p=="object"?p.nodeDraggable?p.nodeDraggable(e):true:false,[p,e,X]),Q=Z.useMemo(()=>N!==void 0?N:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[N,p]),oe=Z.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:j,isLeaf:G}):H:G?D:j?I:L,[e.icon,H,j,G,D,L,I]),Te=q=>{if(!ve)return;q.stopPropagation(),q.dataTransfer.effectAllowed="move";let J=q.currentTarget,ee=J.cloneNode(true),Ae=document.documentElement.classList.contains("dark"),Le=Ae?"#0a0a0a":"#ffffff",wn=Ae?"#27272a":"#e4e4e7";ee.style.cssText=`
|
|
43
|
+
`;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:x}}),jsx("div",{ref:c,id:g,onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),style:{...s,...(()=>{if(!r)return {};let C=ny[o],R=t==="vertical"||t==="both",T=t==="horizontal"||t==="both",P=[R&&f.top&&`linear-gradient(to bottom, transparent, black ${C})`,R&&f.bottom&&`linear-gradient(to top, transparent, black ${C})`,T&&f.left&&`linear-gradient(to right, transparent, black ${C})`,T&&f.right&&`linear-gradient(to left, transparent, black ${C})`].filter(Boolean);return P.length===0?{}:{maskImage:P.join(", "),WebkitMaskImage:P.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:u(t==="vertical"&&"h-full w-full overflow-y-auto overflow-x-hidden",t==="horizontal"&&"w-full overflow-x-auto overflow-y-hidden",t==="both"&&"h-full w-full overflow-auto",e),...i,children:a})]})});Oe.displayName="ScrollArea";var Vd=cva("flex w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-9 py-1.5 text-xs",md:"min-h-10 py-2",lg:"min-h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),Ua=Z.forwardRef(({options:e,multiple:t=false,value:n,defaultValue:r,onValueChange:o,placeholder:a="Select...",searchable:s=false,searchPlaceholder:i="Search...",emptyText:l="No results found.",disabled:c=false,clearable:d=false,maxDisplayItems:m=3,maxDropdownHeight:f=240,size:p,radius:g,className:h,...v},b)=>{let[y,x]=Z.useState(false),[w,C]=Z.useState(""),[R,T]=Z.useState(r||""),[P,S]=Z.useState(r||[]),[k,E]=Z.useState({top:0,left:0,width:0}),M=Z.useRef(null),N=Z.useRef(null),H=Z.useRef(null),D=Z.useRef(null),L=n!==void 0?n:R,I=n!==void 0?n:P,A=n!==void 0,K=$=>{d&&L===$?(A||T(""),o?.("")):(A||T($),o?.($)),x(false),C("");},V=$=>{let X=I.includes($)?I.filter(te=>te!==$):[...I,$];A||S(X),o?.(X);},F=($,X)=>{X.stopPropagation();let te=I.filter(Y=>Y!==$);A||S(te),o?.(te);},z=$=>{$.stopPropagation(),t?(A||S([]),o?.([])):(A||T(""),o?.(""));},G=e.find($=>$.value===L),j=e.filter($=>I.includes($.value)),O=j.slice(0,m),B=j.length-m,_=s?e.filter($=>$.label.toLowerCase().includes(w.toLowerCase())):e;Z.useEffect(()=>{if(y&&N.current){let $=N.current.getBoundingClientRect();E({top:$.bottom+4,left:$.left,width:$.width}),s&&setTimeout(()=>D.current?.focus(),0);}y||C("");},[y,s]),Z.useEffect(()=>{let $=X=>{let te=X.target,Y=M.current&&!M.current.contains(te),ve=H.current&&!H.current.contains(te);Y&&ve&&(x(false),C(""));};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]),Z.useEffect(()=>{if(!y)return;let $=X=>{H.current?.contains(X.target)||(x(false),C(""));};return window.addEventListener("scroll",$,true),()=>window.removeEventListener("scroll",$,true)},[y]);let U=t?I.length>0:!!L;return jsxs("div",{ref:M,className:u("relative",h),...v,children:[jsxs("div",{ref:$=>{N.current=$,typeof b=="function"?b($):b&&(b.current=$);},role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!y),className:u(Vd({size:p,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:u(!G&&"text-muted-foreground"),children:G?G.label:a}),t&&jsx(Fragment,{children:j.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[O.map($=>jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground",children:[$.label,jsx("span",{role:"button",tabIndex:0,onClick:X=>F($.value,X),onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&F($.value,X);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},$.value)),B>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",B," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&U&&jsx("span",{role:"button",tabIndex:0,onClick:z,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&z($);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]})]}),y&&!c&&typeof document<"u"&&Wa.createPortal(jsxs("div",{ref:H,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:k.top,left:k.left,minWidth:k.width},children:[s&&jsxs("div",{className:"flex items-center border-b border-zinc-300 dark:border-zinc-700 px-3",children:[jsx(Search,{className:"h-4 w-4 opacity-50 mr-2"}),jsx("input",{ref:D,type:"text",value:w,onChange:$=>C($.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(Oe,{style:{maxHeight:f},onWheel:$=>$.stopPropagation(),children:jsx("div",{className:"p-1",children:_.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):_.map($=>{let X=t?I.includes($.value):L===$.value;return jsxs("div",{role:"option","aria-selected":X,onClick:()=>{$.disabled||(t?V($.value):K($.value));},className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800",$.disabled&&"pointer-events-none opacity-50"),children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:X&&jsx(Check,{className:"h-4 w-4"})}),$.label]},$.value)})})})]}),document.body)]})});Ua.displayName="Select";var Ad=Z.createContext(null),Wo=()=>{let e=Z.useContext(Ad);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},ki=Z.createContext({radius:"md"}),Pi=Z.createContext(null),Qt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),[s,i]=Z.useState(-1),l=t!==void 0,c=l?t:o,d=Z.useRef(null),m=Z.useRef(null),f=Z.useId(),p=Z.useRef(new Map),g=Z.useCallback(b=>{l||a(b),r?.(b),b||i(-1);},[l,r]),h=Z.useCallback((b,y)=>{p.current.set(b,y);},[]),v=Z.useCallback(b=>{p.current.delete(b);},[]);return jsx(Ad.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:m,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:v},children:e})};Qt.displayName="Dropdown";var Jt=Z.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Wo();return jsx("div",{ref:m=>{i.current=m,typeof o=="function"?o(m):o&&(o.current=m);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:m=>{t?.(m),s(!a);},onKeyDown:m=>{n?.(m),(m.key==="ArrowDown"||m.key==="ArrowUp")&&(m.preventDefault(),s(true)),(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),s(!a));},className:"inline-flex",...r,children:e})});Jt.displayName="DropdownTrigger";var dy={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},en=Z.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="start",alignOffset:o=0,collisionPadding:a=8,onInteractOutside:s,onEscapeKeyDown:i,loop:l=true,radius:c="md",children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentRef:v,contentId:b,activeIndex:y,setActiveIndex:x,items:w}=Wo(),[C,R]=Z.useState({top:0,left:0}),[T,P]=Z.useState(t),[S,k]=Z.useState(false),E=Z.useRef(0);if(Z.useEffect(()=>{k(true);},[]),Z.useEffect(()=>{p&&(E.current=w.current.size);},[p,w]),Z.useEffect(()=>{if(!p||!h.current||!v.current)return;let N=()=>{if(!h.current||!v.current)return;let H=h.current.getBoundingClientRect(),D=v.current.getBoundingClientRect(),L=window.innerWidth,I=window.innerHeight,A=0,K=0,V=t;switch(t){case "top":A=H.top-D.height-n,A<a&&(A=H.bottom+n,V="bottom");break;case "bottom":A=H.bottom+n,A+D.height>I-a&&(A=H.top-D.height-n,V="top");break;case "left":K=H.left-D.width-n,K<a&&(K=H.right+n,V="right");break;case "right":K=H.right+n,K+D.width>L-a&&(K=H.left-D.width-n,V="left");break}if(V==="top"||V==="bottom"){switch(r){case "start":K=H.left+o;break;case "center":K=H.left+H.width/2-D.width/2;break;case "end":K=H.right-D.width-o;break}K<a?K=a:K+D.width>L-a&&(K=L-D.width-a);}else {switch(r){case "start":A=H.top+o;break;case "center":A=H.top+H.height/2-D.height/2;break;case "end":A=H.bottom-D.height-o;break}A<a?A=a:A+D.height>I-a&&(A=I-D.height-a);}R({top:A,left:K}),P(V);};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,true),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,true);}},[p,t,n,r,o,a,h]),Z.useEffect(()=>{if(!p)return;let N=H=>{let D=H.target;v.current&&!v.current.contains(D)&&h.current&&!h.current.contains(D)&&(s?.(),g(false));};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[p,g,s,h,v]),Z.useEffect(()=>{if(!p)return;let N=H=>{let D=Array.from(w.current.entries()).sort(([I],[A])=>I-A).map(([,I])=>I),L=D.length;if(L!==0)switch(H.key){case "Escape":H.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":H.preventDefault(),y===-1||y>=L-1?x(l?0:Math.min(y+1,L-1)):x(y+1);break;case "ArrowUp":H.preventDefault(),y<=0?x(l?L-1:0):x(y-1);break;case "Home":H.preventDefault(),x(0);break;case "End":H.preventDefault(),x(L-1);break;case "Enter":case " ":H.preventDefault(),y>=0&&y<L&&D[y]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[p,g,i,y,x,w,l,h]),Z.useEffect(()=>{p&&y>=0&&Array.from(w.current.entries()).sort(([H],[D])=>H-D).map(([,H])=>H)[y]?.focus();},[p,y,w]),!S||!p)return null;let M={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[T];return Wa.createPortal(jsx("div",{ref:N=>{v.current=N,typeof f=="function"?f(N):f&&(f.current=N);},id:b,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":T,"data-dropdown-content":"",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",dy[c],M,e),style:{top:C.top,left:C.left},...m,children:jsx(ki.Provider,{value:{radius:c},children:d})}),document.body)});en.displayName="DropdownContent";var zd=0,Od={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Ht=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:m,activeIndex:f,setActiveIndex:p,registerItem:g,unregisterItem:h}=Wo(),{radius:v}=Z.useContext(ki),[b]=Z.useState(()=>zd++),y=Z.useRef(null);Z.useEffect(()=>(!n&&y.current&&g(b,y.current),()=>{h(b);}),[n,b,g,h]);let x=R=>{if(n){R.preventDefault();return}o?.(R),r?.(),m(false);},w=R=>{a?.(R),n||p(b);};return jsxs("div",{ref:R=>{y.current=R,typeof d=="function"?d(R):d&&(d.current=R);},role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-highlighted":f===b?"":void 0,className:u("relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Od[v],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Ht.displayName="DropdownItem";var Ei=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Ei.displayName="DropdownSection";var Bd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Bd.displayName="DropdownSeparator";var Fd=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest opacity-60",e),...t});Fd.displayName="DropdownShortcut";var Kd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Kd.displayName="DropdownGroup";var $d=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),{contentRef:s}=Wo(),i=t!==void 0,l=i?t:o,c=Z.useRef(null),d=Z.useCallback(m=>{i||a(m),r?.(m);},[i,r]);return jsx(Pi.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};$d.displayName="DropdownSub";var Gd=Z.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=Z.useContext(Pi),{setActiveIndex:d,registerItem:m,unregisterItem:f}=Wo(),{radius:p}=Z.useContext(ki),[g]=Z.useState(()=>zd++),h=Z.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:v,onOpenChange:b,triggerRef:y}=c;Z.useEffect(()=>(!n&&h.current&&m(g,h.current),()=>{f(g);}),[n,g,m,f]);let x=R=>{o?.(R),n||(d(g),b(true));},w=R=>{a?.(R);},C=R=>{s?.(R),(R.key==="ArrowRight"||R.key==="Enter"||R.key===" ")&&(R.preventDefault(),b(true));};return jsxs("div",{ref:R=>{h.current=R,y.current=R,typeof l=="function"?l(R):l&&(l.current=R);},role:"menuitem","aria-haspopup":"menu","aria-expanded":v,tabIndex:n?-1:0,"aria-disabled":n,"data-state":v?"open":"closed","data-disabled":n?"":void 0,className:u("flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[state=open]:bg-accent","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Od[p],t&&"pl-8",!n&&"cursor-pointer",e),onMouseEnter:x,onMouseLeave:w,onKeyDown:C,...i,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Gd.displayName="DropdownSubTrigger";var Ud=Z.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=Z.useContext(Pi);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:m,parentMenuRef:f}=l,[p,g]=Z.useState({top:0,left:0}),[h,v]=Z.useState(false),b=Z.useRef(null),y=Z.useRef(null);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{if(!c||!m.current||!b.current)return;(()=>{if(!m.current||!b.current)return;let R=m.current.getBoundingClientRect(),T=b.current.getBoundingClientRect(),P=window.innerWidth,S=window.innerHeight,k=R.top+n,E=R.right+t;E+T.width>P-r&&(E=R.left-T.width-t),k+T.height>S-r&&(k=S-T.height-r),k<r&&(k=r),g({top:k,left:E});})();},[c,t,n,r,m]);let x=C=>{o?.(C),y.current&&(clearTimeout(y.current),y.current=null),d(true);},w=C=>{a?.(C);let R=C.relatedTarget;m.current?.contains(R)||f?.current?.contains(R)||(y.current=setTimeout(()=>{d(false);},100));};return Z.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),!h||!c?null:Wa.createPortal(jsx("div",{ref:C=>{b.current=C,typeof i=="function"?i(C):i&&(i.current=C);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:p.top,left:p.left},onMouseEnter:x,onMouseLeave:w,...s}),document.body)});Ud.displayName="DropdownSubContent";var uy=Ei;var Wd=Z.createContext(null),Si=()=>{let e=Z.useContext(Wd);if(!e)throw new Error("Popover components must be used within a Popover");return e},ht=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useId(),d=Z.useCallback(m=>{s||a(m),r?.(m);},[s,r]);return jsx(Wd.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};ht.displayName="Popover";var or=Z.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Si(),c=f=>{t?.(f),s(!a);},d=f=>{i.current=f,typeof o=="function"?o(f):o&&(o.current=f);},m={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...r};return n&&Z.isValidElement(e)?Z.cloneElement(e,{...m,ref:d,onClick:f=>{e.props.onClick?.(f),c(f);}}):jsx("button",{ref:d,type:"button",...m,children:e})});or.displayName="PopoverTrigger";var Nn=Z.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=Si();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});Nn.displayName="PopoverAnchor";var xt=Z.forwardRef(({className:e,style:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:a=0,onInteractOutside:s,onEscapeKeyDown:i,onOpenAutoFocus:l,onCloseAutoFocus:c,children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentId:v}=Si(),[b,y]=Z.useState({top:0,left:0}),[x,w]=Z.useState(false),[C,R]=Z.useState(null);if(Z.useEffect(()=>{w(true);},[]),Z.useEffect(()=>{if(!p||!h.current||!C)return;let P=()=>{if(!h.current||!C)return;let S=h.current.getBoundingClientRect(),k=C.getBoundingClientRect(),E=0,M=0;switch(n){case "top":E=S.top-k.height-r;break;case "bottom":E=S.bottom+r;break;case "left":M=S.left-k.width-r;break;case "right":M=S.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":M=S.left+a;break;case "center":M=S.left+S.width/2-k.width/2;break;case "end":M=S.right-k.width-a;break}else switch(o){case "start":E=S.top+a;break;case "center":E=S.top+S.height/2-k.height/2;break;case "end":E=S.bottom-k.height-a;break}y({top:E,left:M});};return P(),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[p,n,r,o,a,h,C]),Z.useEffect(()=>{if(!p)return;let P=S=>{let k=S.target;C&&C.contains(k)||h.current&&h.current.contains(k)||k.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",P),()=>document.removeEventListener("mouseup",P)},[p,g,s,h,C]),Z.useEffect(()=>{if(!p)return;let P=S=>{S.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[p,g,i]),!x||!p)return null;let T={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[n];return Wa.createPortal(jsx("div",{ref:P=>{R(S=>S!==P?P:S),typeof f=="function"?f(P):f&&(f.current=P);},id:v,role:"dialog","data-state":p?"open":"closed","data-side":n,className:u("fixed z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",T,e),style:{...t,top:b.top,left:b.left},...m,children:d}),document.body)});xt.displayName="PopoverContent";var Yd=Z.createContext(null),Di=()=>{let e=Z.useContext(Yd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},Xd=Z.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,m]=Z.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||m(h),r?.(h);};return jsx(Yd.Provider,{value:{value:p,onValueChange:g,variant:o,radius:a,orientation:s},children:jsx("div",{ref:c,"data-orientation":s,className:u(s==="vertical"&&"flex gap-4",e),...l,children:i})})});Xd.displayName="Tabs";var Li={none:{list:"rounded-none",trigger:"rounded-none",indicator:"rounded-none"},sm:{list:"rounded-md",trigger:"rounded-sm",indicator:"rounded-sm"},md:{list:"rounded-lg",trigger:"rounded-md",indicator:"rounded-md"},lg:{list:"rounded-xl",trigger:"rounded-lg",indicator:"rounded-lg"},full:{list:"rounded-full",trigger:"rounded-full",indicator:"rounded-full"}},qd=Z.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=Di(),l=Z.useRef(null),[c,d]=Z.useState({opacity:0});Z.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let b=g.querySelector('[data-state="active"]');if(b){let y=g.getBoundingClientRect(),x=b.getBoundingClientRect(),w=s==="vertical";o==="underline"?d(w?{width:2,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:2,transform:`translateX(${x.left-y.left}px)`,opacity:1}):o==="solid"&&d(w?{width:x.width,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:x.height,transform:`translateX(${x.left-y.left}px)`,opacity:1});}};h();let v=new ResizeObserver(h);return v.observe(g),()=>{v.disconnect();}},[o,s,i]);let m={solid:"bg-muted p-1",underline:"border-b border-border bg-transparent p-0 !rounded-none",bordered:"bg-transparent p-0 gap-1 !rounded-none"},f=s==="vertical",p=()=>o==="solid"?f?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?f?"top-0 left-0 bg-primary !rounded-full":"bottom-0 left-0 bg-primary !rounded-full":"";return jsxs("div",{ref:g=>{l.current=g,typeof r=="function"?r(g):r&&(r.current=g);},role:"tablist","aria-orientation":s,className:u("relative inline-flex h-9 items-center justify-center text-muted-foreground",f&&"flex-col h-auto w-auto",Li[a].list,m[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:u("absolute transition-all duration-200 ease-out",Li[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});qd.displayName="TabsList";var Zd=Z.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=Di(),d=s===t,m={solid:"data-[state=active]:text-foreground",underline:"!rounded-none border-b-2 border-transparent pb-2 data-[state=active]:text-foreground",bordered:"border border-transparent data-[state=active]:border-current data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"};return jsx("button",{type:"button",role:"tab",ref:a,"aria-selected":d,"data-state":d?"active":"inactive",disabled:n,className:u("relative z-10 inline-flex items-center justify-center whitespace-nowrap px-3 py-1 text-sm font-medium ring-offset-background transition-all cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",Li[c].trigger,m[l],e),onClick:f=>{r?.(f),i(t);},...o})});Zd.displayName="TabsTrigger";var Qd=Z.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=Di(),s=a===t;return s?jsx("div",{ref:o,role:"tabpanel","data-state":s?"active":"inactive",className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r,children:n}):null});Qd.displayName="TabsContent";var Jd=[{label:"At least 8 characters",test:e=>e.length>=8},{label:"Contains uppercase",test:e=>/[A-Z]/.test(e)},{label:"Contains lowercase",test:e=>/[a-z]/.test(e)},{label:"Contains number",test:e=>/[0-9]/.test(e)},{label:"Contains special character",test:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)}];function py(e,t=Jd){return e?t.filter(r=>r.test(e)).length/t.length:0}function fy(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function gy(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var Xo=0,Hi=null;function ln(){Xo===0&&(Hi=document.body.style.overflow,document.body.style.overflow="hidden"),Xo++;}function cn(){Xo--,Xo<=0&&(Xo=0,document.body.style.overflow=Hi??"",Hi=null);}var tu=Z.createContext(null),_a=()=>{let e=Z.useContext(tu);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},nu=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=Z.useState(t),s=e!==void 0,i=s?e:o,l=Z.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(tu.Provider,{value:{open:i,onOpenChange:l},children:r})};nu.displayName="Sheet";var ru=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});ru.displayName="SheetTrigger";var ou=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});ou.displayName="SheetClose";var Vi=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};Vi.displayName="SheetPortal";var au=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=_a();return r?jsx("div",{ref:n,className:u("fixed inset-0 z-50 bg-black/80",r?"animate-in fade-in-0":"animate-out fade-out-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});au.displayName="SheetOverlay";var su=cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition-transform duration-300 ease-in-out",{variants:{side:{top:"inset-x-0 top-0 border-b",bottom:"inset-x-0 bottom-0 border-t",left:"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"}},defaultVariants:{side:"right"}}),hy=(e,t)=>({top:t?"animate-in slide-in-from-top":"animate-out slide-out-to-top",bottom:t?"animate-in slide-in-from-bottom":"animate-out slide-out-to-bottom",left:t?"animate-in slide-in-from-left":"animate-out slide-out-to-left",right:t?"animate-in slide-in-from-right":"animate-out slide-out-to-right"})[e],iu=Z.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=_a(),[d,m]=Z.useState(false),[,f]=Z.useState(false);return Z.useEffect(()=>{if(l)m(true),f(true),ln();else {f(true);let p=setTimeout(()=>{m(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{cn();}},[l]),Z.useEffect(()=>{let p=g=>{g.key==="Escape"&&l&&(o?.(),c(false));};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,c,o]),!d&&!l?null:jsxs(Vi,{children:[jsx("div",{className:u("fixed inset-0 z-50 bg-black/80 transition-opacity duration-300",l?"opacity-100":"opacity-0"),onClick:()=>{a?.(),c(false);},"aria-hidden":"true"}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true",className:u(su({side:e}),hy(e,l),t),...s,children:[!r&&jsxs("button",{type:"button",onClick:()=>c(false),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]}),n]})]})});iu.displayName="SheetContent";var lu=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-2 text-center sm:text-left",e),...t});lu.displayName="SheetHeader";var cu=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});cu.displayName="SheetFooter";var du=Z.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:u("text-lg font-semibold text-foreground",e),...t}));du.displayName="SheetTitle";var uu=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));uu.displayName="SheetDescription";var Ry=({theme:e="system",...t})=>jsx(Toaster,{theme:e,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"}},...t});var mu=Z.createContext(null),Ya=()=>{let e=Z.useContext(mu);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Ai=Z.createContext(null),pu=({children:e,onOpenChange:t})=>{let[n,r]=Z.useState(false),[o,a]=Z.useState({x:0,y:0}),s=Z.useId(),i=Z.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(mu.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};pu.displayName="ContextMenu";var fu=Z.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Ya(),s=i=>{i.preventDefault(),a({x:i.clientX,y:i.clientY}),o(true);};return jsx("div",{ref:r,onContextMenu:i=>{t?.(i),s(i);},...n,children:e})});fu.displayName="ContextMenuTrigger";var gu=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));gu.displayName="ContextMenuGroup";var bu=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};bu.displayName="ContextMenuPortal";var vu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Ai.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};vu.displayName="ContextMenuSub";var hu=Z.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Ya(),[d,m]=Z.useState(false),[f,p]=Z.useState(l),g=Z.useRef(null);return Z.useEffect(()=>{m(true);},[]),Z.useEffect(()=>{if(!s||!g.current){p(l);return}let v=g.current.getBoundingClientRect(),{x:b,y}=l;b+v.width>window.innerWidth&&(b=window.innerWidth-v.width-8),y+v.height>window.innerHeight&&(y=window.innerHeight-v.height-8),p({x:b,y});},[s,l]),Z.useEffect(()=>{if(!s)return;let h=v=>{let b=v.target;g.current&&!g.current.contains(b)&&(t?.(),i(false));};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,i,t]),Z.useEffect(()=>{if(!s)return;let h=v=>{v.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s,i,n]),!d||!s?null:Wa.createPortal(jsx("div",{ref:h=>{g.current=h,typeof a=="function"?a(h):a&&(a.current=h);},id:c,role:"menu","aria-orientation":"vertical","data-state":s?"open":"closed",className:u("fixed z-50 max-h-[calc(100vh-2rem)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-md","animate-in fade-in-0 zoom-in-95",e),style:{top:f.y,left:f.x},...o,children:r}),document.body)});hu.displayName="ContextMenuContent";var xu=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=Z.useContext(Ai);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,m=p=>{r?.(p),c(true);},f=p=>{o?.(p),c(false);};return jsxs("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p);},role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"data-state":l?"open":"closed",className:u("flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800",t&&"pl-8",e),onMouseEnter:m,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});xu.displayName="ContextMenuSubTrigger";var yu=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=Z.useContext(Ai);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,m]=Z.useState({top:0,left:0}),[f,p]=Z.useState(false),g=Z.useRef(null);Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let y=c.current.getBoundingClientRect(),x=g.current.getBoundingClientRect(),w=y.top,C=y.right+t;C+x.width>window.innerWidth&&(C=y.left-x.width-t),m({top:w,left:C});})();},[i,t,c]);let h=b=>{n?.(b),l(true);},v=b=>{r?.(b),l(false);};return !f||!i?null:Wa.createPortal(jsx("div",{ref:b=>{g.current=b,typeof a=="function"?a(b):a&&(a.current=b);},role:"menu","data-state":i?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:d.top,left:d.left},onMouseEnter:h,onMouseLeave:v,...o}),document.body)});yu.displayName="ContextMenuSubContent";var Ru=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Ya(),l=c=>{if(n){c.preventDefault();return}o?.(c),r?.(),i(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",t&&"pl-8",e),onClick:l,...a})});Ru.displayName="ContextMenuItem";var wu=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Ya(),c=d=>{if(o){d.preventDefault();return}a?.(d),r?.(!n),l(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:c,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});wu.displayName="ContextMenuCheckboxItem";var Cu=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Cu.displayName="ContextMenuSection";var Tu=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-border",e),...t}));Tu.displayName="ContextMenuSeparator";var Mu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Mu.displayName="ContextMenuShortcut";var Pu=Z.createContext(null),Ny=()=>{let e=Z.useContext(Pu);if(!e)throw new Error("Radio components must be used within a RadioGroup");return e},Eu=Z.createContext(null),qa=()=>{let e=Z.useContext(Eu);if(!e)throw new Error("Radio.* components must be used within a Radio");return e},qo={sm:{control:"h-3.5 w-3.5",indicator:"h-1.5 w-1.5",label:"text-sm",description:"text-xs",gap:"gap-2"},md:{control:"h-4 w-4",indicator:"h-2 w-2",label:"text-sm",description:"text-xs",gap:"gap-2.5"},lg:{control:"h-5 w-5",indicator:"h-2.5 w-2.5",label:"text-base",description:"text-sm",gap:"gap-3"}},Xa={default:{border:"border-input",borderChecked:"border-foreground",indicator:"bg-foreground",ring:"ring-foreground/20"},secondary:{border:"border-input",borderChecked:"border-secondary",indicator:"bg-secondary",ring:"ring-secondary/20"},success:{border:"border-input",borderChecked:"border-green-500",indicator:"bg-green-500",ring:"ring-green-500/20"},warning:{border:"border-input",borderChecked:"border-yellow-500",indicator:"bg-yellow-500",ring:"ring-yellow-500/20"},danger:{border:"border-input",borderChecked:"border-red-500",indicator:"bg-red-500",ring:"ring-red-500/20"}},Su=Z.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",size:l="md",color:c="default",children:d,...m},f)=>{let[p,g]=Z.useState(n),h=t!==void 0,v=h?t:p,b=Z.useId(),y=x=>{h||g(x),r?.(x);};return jsx("div",{ref:f,role:"radiogroup","aria-required":s,"aria-orientation":i,className:u(i==="vertical"?"flex flex-col gap-2":"flex flex-row flex-wrap gap-4",e),...m,children:jsx(Pu.Provider,{value:{name:o||b,value:v,onValueChange:y,disabled:a,required:s,size:l,color:c},children:d})})});Su.displayName="RadioGroup";var Lu=Z.forwardRef(({className:e,value:t,disabled:n,children:r,...o},a)=>{let s=Ny(),[i,l]=Z.useState(false),c=s.value===t,d=n||s.disabled,m=()=>{d||s.onValueChange(t);},f=qo[s.size||"md"];return jsx(Eu.Provider,{value:{value:t,isChecked:c,isDisabled:d||false,isFocused:i,setIsFocused:l,onSelect:m,size:s.size||"md",color:s.color||"default"},children:jsxs("label",{ref:a,className:u("flex items-start cursor-pointer select-none",f.gap,d&&"cursor-not-allowed opacity-50",e),...o,children:[r,jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:s.name,value:t,checked:c,required:s.required,disabled:d,onChange:()=>{},className:"sr-only"})]})})});Lu.displayName="Radio";var Du=Z.forwardRef(({className:e,children:t},n)=>{let{isChecked:r,isDisabled:o,isFocused:a,setIsFocused:s,onSelect:i,size:l,color:c}=qa(),d=qo[l],m=!(c in Xa),f=m?null:Xa[c],p=m?{borderColor:r?c:void 0,boxShadow:a?`0 0 0 2px ${c}33`:void 0}:void 0;return jsx(motion.button,{ref:n,type:"button",role:"radio","aria-checked":r,disabled:o,onClick:i,onFocus:()=>s(true),onBlur:()=>s(false),style:p,className:u("relative flex items-center justify-center rounded-full border-2 transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",d.control,f&&(r?f.borderChecked:f.border),f&&a&&f.ring,!m&&!r&&"border-input",o?"cursor-not-allowed":"cursor-pointer",e),whileTap:o?void 0:{scale:.95},animate:r?{scale:[1,1.1,1]}:void 0,transition:{duration:.2},children:t||jsx(zi,{})})});Du.displayName="RadioControl";var zi=Z.forwardRef(({className:e,forceMount:t},n)=>{let{isChecked:r,size:o,color:a}=qa(),s=qo[o],i=!(a in Xa),l=i?null:Xa[a],c=i?{backgroundColor:a}:void 0;return jsx(AnimatePresence,{children:(t||r)&&jsx(motion.span,{ref:n,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:500,damping:30},style:c,className:u("rounded-full",s.indicator,l?.indicator,e)})})});zi.displayName="RadioIndicator";var Hu=Z.forwardRef(({className:e,children:t,...n},r)=>{let{size:o,isDisabled:a}=qa(),s=qo[o];return jsx("span",{ref:r,className:u("font-medium leading-none",s.label,a&&"text-muted-foreground",e),...n,children:t})});Hu.displayName="RadioLabel";var Iu=Z.forwardRef(({className:e,children:t,...n},r)=>{let{size:o}=qa(),a=qo[o];return jsx("span",{ref:r,className:u("text-muted-foreground leading-snug",a.description,e),...n,children:t})});Iu.displayName="RadioDescription";var Vu=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("flex flex-col gap-0.5",e),...n,children:t}));Vu.displayName="RadioContent";var Qa=cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{solid:"bg-transparent hover:bg-muted data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",bordered:"border border-current bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",ghost:"bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",soft:"bg-transparent hover:bg-primary/10 data-[state=on]:bg-primary/15 data-[state=on]:text-primary",surface:"bg-muted/50 hover:bg-muted data-[state=on]:bg-muted data-[state=on]:text-foreground"},size:{sm:"h-9 px-2.5 min-w-9",md:"h-10 px-3 min-w-10",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"solid",size:"md"}}),Au=Z.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,m]=Z.useState(o),f=r!==void 0,p=f?r:d,g=()=>{if(s)return;let v=!p;f||m(v),a?.(v);},h=v=>{v.key==="Enter"&&v.preventDefault(),i?.(v);};return jsx("button",{type:"button","aria-pressed":p,"data-state":p?"on":"off",disabled:s,ref:c,className:u(Qa({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});Au.displayName="Toggle";var zu=Z.createContext(null),Sy=()=>{let e=Z.useContext(zu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},Ou=Z.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[m,f]=Z.useState(()=>r==="single"?a?[a]:[]:a||[]),p=o!==void 0,g=p?r==="single"?o?[o]:[]:o:m,h=v=>{if(r==="single"){let b=g.includes(v)?[]:[v];p||f(b),s?.(b[0]||"");}else {let b=g.includes(v)?g.filter(y=>y!==v):[...g,v];p||f(b),s?.(b);}};return jsx("div",{ref:d,role:"group",className:u("flex items-center justify-center gap-1",e),...c,children:jsx(zu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});Ou.displayName="ToggleGroup";var Bu=Z.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=Sy(),c=l.value.includes(o),d=a||l.disabled;return jsx("button",{type:"button",role:"radio","aria-checked":c,"aria-pressed":c,"data-state":c?"on":"off",disabled:d,ref:i,className:u(Qa({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});Bu.displayName="ToggleGroupItem";var tn=Z.forwardRef(({className:e,value:t,defaultValue:n=[0],onValueChange:r,onValueCommit:o,min:a=0,max:s=100,step:i=1,disabled:l=false,orientation:c="horizontal",trackColor:d="primary",name:m,...f},p)=>{let[g,h]=Z.useState(n),v=t!==void 0,b=v?t:g,y=Z.useRef(null),[x,w]=Z.useState(false),[C,R]=Z.useState(null),T=(V,F)=>{if(!y.current)return b[0];let z=y.current.getBoundingClientRect(),G;c==="horizontal"?G=(V-z.left)/z.width:G=1-(F-z.top)/z.height,G=Math.max(0,Math.min(1,G));let j=a+G*(s-a),O=Math.round(j/i)*i;return Math.max(a,Math.min(s,O))},P=(V,F)=>{let z=[...b];z[F]=V,F>0&&V<b[F-1]&&(z[F]=b[F-1]),F<b.length-1&&V>b[F+1]&&(z[F]=b[F+1]),v||h(z),r?.(z);},S=(V,F)=>{l||(V.preventDefault(),w(true),R(F),V.target.setPointerCapture(V.pointerId));},k=V=>{if(!x||C===null||l)return;let F=T(V.clientX,V.clientY);P(F,C);},E=()=>{x&&(w(false),R(null),o?.(b));},M=V=>{if(l)return;let F=T(V.clientX,V.clientY),z=0,G=Math.abs(b[0]-F);for(let j=1;j<b.length;j++){let O=Math.abs(b[j]-F);O<G&&(G=O,z=j);}P(F,z),o?.([...b.slice(0,z),F,...b.slice(z+1)]);},N=(V,F)=>{if(l)return;let z=b[F];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),z=Math.min(s,b[F]+i);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),z=Math.max(a,b[F]-i);break;case "Home":V.preventDefault(),z=a;break;case "End":V.preventDefault(),z=s;break;default:return}P(z,F),o?.([...b.slice(0,F),z,...b.slice(F+1)]);},H=V=>(V-a)/(s-a)*100,D={primary:{track:"bg-primary",thumb:"border-primary"},success:{track:"bg-green-500",thumb:"border-green-500"},warning:{track:"bg-yellow-500",thumb:"border-yellow-500"},danger:{track:"bg-red-500",thumb:"border-red-500"}},L=!(d in D),I=L?null:D[d],A=L?{backgroundColor:d}:void 0,K=L?{borderColor:d}:void 0;return jsxs("div",{ref:p,className:u("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none",e),...f,children:[jsx("div",{ref:y,className:u("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:M,children:jsx("div",{className:u("absolute",I?.track),style:c==="horizontal"?{left:b.length>1?`${H(b[0])}%`:0,right:`${100-H(b[b.length-1])}%`,top:0,bottom:0,...A}:{bottom:b.length>1?`${H(b[0])}%`:0,top:`${100-H(b[b.length-1])}%`,left:0,right:0,...A}})}),b.map((V,F)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":V,"aria-orientation":c,"aria-disabled":l,className:u("absolute block h-5 w-5 rounded-full border-2 bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",I?.thumb,x&&C===F&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${H(V)}% - 10px)`,top:"50%",transform:"translateY(-50%)",...K}:{bottom:`calc(${H(V)}% - 10px)`,left:"50%",transform:"translateX(-50%)",...K},onPointerDown:z=>S(z,F),onPointerMove:k,onPointerUp:E,onPointerCancel:E,onKeyDown:z=>N(z,F)},F)),m&&b.map((V,F)=>jsx("input",{type:"hidden",name:b.length>1?`${m}[${F}]`:m,value:V},F))]})});tn.displayName="Slider";var Fu=Z.createContext(null),Ku=()=>{let e=Z.useContext(Fu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},Bi=Z.createContext(null),$u=()=>{let e=Z.useContext(Bi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Gu=Z.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,m]=Z.useState(()=>t==="single"?r?[r]:[]:r||[]),f=Z.useRef(new Map),p=Z.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,v=w=>{if(t==="single"){let R=h.includes(w)&&a?[]:[w];g||m(R),o?.(R[0]||"");}else {let C=h.includes(w)?h.filter(R=>R!==w):[...h,w];g||m(C),o?.(C);}},b=Z.useCallback((w,C)=>{f.current.set(w,C),p.current.includes(w)||p.current.push(w);},[]),y=Z.useCallback(w=>{f.current.delete(w),p.current=p.current.filter(C=>C!==w);},[]),x=Z.useCallback(w=>{let C=p.current;if(C.length===0)return;let R=document.activeElement,T;f.current.forEach((M,N)=>{M===R&&(T=N);});let P=T?C.indexOf(T):-1,S;switch(w){case "first":S=0;break;case "last":S=C.length-1;break;case "next":S=P===-1?0:(P+1)%C.length;break;case "prev":S=P===-1?C.length-1:(P-1+C.length)%C.length;break}let k=C[S];f.current.get(k)?.focus();},[]);return jsx(Fu.Provider,{value:{type:t,value:h,onValueChange:v,collapsible:a,disabled:s,registerTrigger:b,unregisterTrigger:y,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:u("w-full",e),...l,children:i})})});Gu.displayName="Accordion";var Uu=Z.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=Ku(),d=c.value.includes(t),m=n||c.disabled||false,f=Z.useId(),p=Z.useId();return r!==void 0?jsx(Bi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:[jsx(ju,{children:jsxs("div",{className:"flex items-center gap-3",children:[a,jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-medium",children:r}),o&&jsx("span",{className:"text-xs text-muted-foreground",children:o})]})]})}),jsx(_u,{children:s})]})}):jsx(Bi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:s})})});Uu.displayName="AccordionItem";var ju=Z.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=Ku(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:m}=$u(),f=Z.useRef(null);Z.useEffect(()=>{let g=f.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let p=g=>{switch(r?.(g),g.key){case "ArrowDown":g.preventDefault(),s.focusTrigger("next");break;case "ArrowUp":g.preventDefault(),s.focusTrigger("prev");break;case "Home":g.preventDefault(),s.focusTrigger("first");break;case "End":g.preventDefault(),s.focusTrigger("last");break}};return jsx("h3",{className:"flex",children:jsxs("button",{type:"button",ref:g=>{f.current=g,typeof a=="function"?a(g):a&&(a.current=g);},id:m,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:u("flex flex-1 items-center justify-between py-4 font-medium transition-all text-left cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),onClick:g=>{n?.(g),s.onValueChange(i);},onKeyDown:p,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});ju.displayName="AccordionTrigger";var _u=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=$u();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),style:n,...r,children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:"pb-4 pt-0 text-sm",children:t})})})});_u.displayName="AccordionContent";var Yu=Z.createContext(null),Xu=()=>{let e=Z.useContext(Yu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},qu=Z.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=Z.useState(n),m=t!==void 0,f=m?t:c,p=Z.useId(),g=Z.useId(),h=v=>{o||(m||d(v),r?.(v));};return jsx(Yu.Provider,{value:{open:f,onOpenChange:h,disabled:o,contentId:p,triggerId:g},children:jsxs("div",{ref:l,"data-state":f?"open":"closed","data-disabled":o?"":void 0,className:u("space-y-2",e),...i,children:[a&&jsxs("div",{className:"flex items-center justify-between space-x-4 px-4",children:[jsx("h4",{className:"text-sm font-semibold",children:a}),jsx(Fi,{})]}),s]})})});qu.displayName="Collapsible";var Fi=Z.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=Xu();return jsx(pe,{ref:o,id:c,"aria-controls":l,"aria-expanded":a,disabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,variant:"light",size:"sm",isIconOnly:true,className:e,onClick:d=>{n?.(d),s(!a);},...r,children:t??jsx(ChevronsUpDown,{className:u("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});Fi.displayName="CollapsibleTrigger";var Zu=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=Xu(),c=Z.useRef(null),[d,m]=Z.useState(0),[f,p]=Z.useState(false),[g,h]=Z.useState(a);Z.useEffect(()=>{a?(h(true),m(0),p(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&m(c.current.scrollHeight);});})):(p(true),c.current?(m(c.current.scrollHeight),requestAnimationFrame(()=>{m(0);})):m(0));},[a]);let v=()=>{p(false),a||h(false);};return g?jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("overflow-hidden",e),style:{...n,height:f?d:a?"auto":0,transition:f?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:v,...r,children:jsx("div",{ref:c,className:"space-y-2",children:t})}):null});Zu.displayName="CollapsibleContent";var Vy=cva("relative w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1.5",md:"h-2.5",lg:"h-4"}},defaultVariants:{size:"md"}}),Qu={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},ns=Z.forwardRef(({className:e,value:t=0,max:n=100,label:r,showPercentage:o=false,formatPercentage:a=d=>`${Math.round(d)}%`,size:s,color:i="primary",...l},c)=>{let d=Math.min(Math.max(t/n*100,0),100),m=r||o,f=Qu[i]||"",p=!Qu[i];return jsxs("div",{ref:c,className:"w-full",children:[m&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r&&jsx("span",{className:"text-muted-foreground",children:r}),o&&jsx("span",{className:u("text-muted-foreground",!r&&"ml-auto"),children:a(d)})]}),jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":n,"aria-label":typeof r=="string"?r:void 0,className:u(Vy({size:s}),e),...l,children:jsx("div",{className:u("h-full w-full flex-1 transition-all rounded-full",f),style:{transform:`translateX(-${100-d}%)`,...p?{backgroundColor:i}:{}}})})]})});ns.displayName="Progress";var nm=Z.createContext(null),rm=()=>{let e=Z.useContext(nm);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},om=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=Z.useState(n),c=t!==void 0,d=c?t:i,m=Z.useRef(null),f=Z.useId(),p=Z.useRef(null),g=Z.useRef(null),h=Z.useCallback(v=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),v?p.current=setTimeout(()=>{c||l(true),r?.(true);},o):g.current=setTimeout(()=>{c||l(false),r?.(false);},a);},[c,r,o,a]);return Z.useEffect(()=>{if(!s||!d)return;let v=()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),c||l(false),r?.(false);};return window.addEventListener("scroll",v,true),()=>window.removeEventListener("scroll",v,true)},[s,d,c,r]),Z.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(nm.Provider,{value:{open:d,onOpenChange:h,triggerRef:m,contentId:f},children:e})};om.displayName="HoverCard";var am=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=rm();return jsx("a",{ref:p=>{l.current=p,typeof s=="function"?s(p):s&&(s.current=p);},onMouseEnter:p=>{t?.(p),i(true);},onMouseLeave:p=>{n?.(p),i(false);},onFocus:p=>{r?.(p),i(true);},onBlur:p=>{o?.(p),i(false);},...a,children:e})});am.displayName="HoverCardTrigger";var sm=Z.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="center",alignOffset:o=0,onMouseEnter:a,onMouseLeave:s,children:i,...l},c)=>{let{open:d,onOpenChange:m,triggerRef:f,contentId:p}=rm(),[g,h]=Z.useState({top:0,left:0}),[v,b]=Z.useState(false),y=Z.useRef(null);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!d||!f.current||!y.current)return;(()=>{if(!f.current||!y.current)return;let T=f.current.getBoundingClientRect(),P=y.current.getBoundingClientRect(),S=0,k=0;switch(t){case "top":S=T.top-P.height-n;break;case "bottom":S=T.bottom+n;break;case "left":k=T.left-P.width-n;break;case "right":k=T.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":k=T.left+o;break;case "center":k=T.left+T.width/2-P.width/2;break;case "end":k=T.right-P.width-o;break}else switch(r){case "start":S=T.top+o;break;case "center":S=T.top+T.height/2-P.height/2;break;case "end":S=T.bottom-P.height-o;break}h({top:S,left:k});})();},[d,t,n,r,o,f]);let x=R=>{a?.(R),m(true);},w=R=>{s?.(R),m(false);};if(!v||!d)return null;let C={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Wa.createPortal(jsx("div",{ref:R=>{y.current=R,typeof c=="function"?c(R):c&&(c.current=R);},id:p,"data-state":d?"open":"closed","data-side":t,className:u("fixed z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",C,e),style:{top:g.top,left:g.left},onMouseEnter:x,onMouseLeave:w,...l,children:i}),document.body)});sm.displayName="HoverCardContent";var im=Z.createContext({size:"md",variant:"default",radius:"md"}),os=()=>Z.useContext(im);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var Oy=cva("flex flex-wrap items-center break-words",{variants:{size:{sm:"gap-1 text-xs",md:"gap-1.5 text-sm sm:gap-2",lg:"gap-2 text-base sm:gap-3"},variant:{default:"text-muted-foreground",bordered:"text-muted-foreground px-3 py-1.5 border",filled:"text-muted-foreground bg-muted px-3 py-1.5"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),By=cva("",{variants:{size:{sm:"[&>svg]:h-3 [&>svg]:w-3",md:"[&>svg]:h-3.5 [&>svg]:w-3.5",lg:"[&>svg]:h-4 [&>svg]:w-4"}},defaultVariants:{size:"md"}}),Fy=cva("flex items-center justify-center",{variants:{size:{sm:"h-6 w-6 [&>svg]:h-3 [&>svg]:w-3",md:"h-8 w-8 [&>svg]:h-4 [&>svg]:w-4",lg:"h-10 w-10 [&>svg]:h-5 [&>svg]:w-5"}},defaultVariants:{size:"md"}}),lm=Z.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(im.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));lm.displayName="Breadcrumb";var cm=Z.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=os();return jsx("ol",{ref:n,className:u(Oy({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});cm.displayName="BreadcrumbList";var dm=Z.forwardRef(({className:e,...t},n)=>{let{size:r}=os();return jsx("li",{ref:n,className:u("inline-flex items-center",r==="sm"&&"gap-1",r==="md"&&"gap-1.5",r==="lg"&&"gap-2",e),...t})});dm.displayName="BreadcrumbItem";var um=Z.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:u("transition-colors hover:text-foreground cursor-pointer",e),...t}));um.displayName="BreadcrumbLink";var mm=Z.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:u("font-medium text-foreground",e),...t}));mm.displayName="BreadcrumbPage";var pm=({children:e,className:t,...n})=>{let{size:r}=os();return jsx("li",{role:"presentation","aria-hidden":"true",className:u(By({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};pm.displayName="BreadcrumbSeparator";var fm=({className:e,...t})=>{let{size:n}=os();return jsxs("span",{role:"presentation","aria-hidden":"true",className:u(Fy({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};fm.displayName="BreadcrumbEllipsis";var vm=Z.forwardRef(({ratio:e=1,className:t,style:n,children:r,...o},a)=>jsx("div",{ref:a,className:u("relative w-full",t),style:{...n,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:r})}));vm.displayName="AspectRatio";var ym=Z.createContext(null),$i=()=>{let e=Z.useContext(ym);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Rm=Z.createContext(null),wm=()=>{let e=Z.useContext(Rm);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Cm=Z.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=Z.useState(null);return jsx(ym.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:u("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[n,jsx(Gi,{})]})})});Cm.displayName="NavigationMenu";var Tm=Z.forwardRef(({className:e,...t},n)=>{let{orientation:r}=$i();return jsx("ul",{ref:n,className:u("group flex flex-1 list-none items-center justify-center gap-1",r==="vertical"&&"flex-col items-start",e),...t})});Tm.displayName="NavigationMenuList";var Mm=Z.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=$i(),s=Z.useId(),i=Z.useRef(null),l=o===s,c=Z.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Rm.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:u("relative",e),...n,children:t})})});Mm.displayName="NavigationMenuItem";var Nm=cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50"),km=Z.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=wm(),c=m=>{n?.(m),l(true);},d=m=>{r?.(m),l(!i);};return jsxs("button",{ref:m=>{s.current=m,typeof a=="function"?a(m):a&&(a.current=m);},type:"button","data-state":i?"open":"closed",className:u(Nm(),"group",e),onMouseEnter:c,onClick:d,"aria-expanded":i,...o,children:[t,jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})});km.displayName="NavigationMenuTrigger";var Pm=Z.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=wm(),l=Z.useRef(null),[c,d]=Z.useState({top:0,left:0});Z.useEffect(()=>{if(!a||!i.current)return;let p=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return p(),window.addEventListener("resize",p),window.addEventListener("scroll",p,true),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,true);}},[a,i]);let m=p=>{t?.(p),s(true);},f=p=>{n?.(p),s(false);};return a?Wa.createPortal(jsx("div",{ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p);},"data-state":a?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-4 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:c.top,left:c.left},onMouseEnter:m,onMouseLeave:f,...r}),document.body):null});Pm.displayName="NavigationMenuContent";var Em=cva("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"),Sm=Z.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:u(Em(),t&&"bg-accent text-accent-foreground",e),...n}));Sm.displayName="NavigationMenuLink";var Gi=Z.forwardRef((e,t)=>null);Gi.displayName="NavigationMenuViewport";var Lm=Z.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=$i();return r?jsx("div",{ref:n,className:u("top-full z-[1] flex h-2.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}):null});Lm.displayName="NavigationMenuIndicator";var Vm=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Pt=Z.forwardRef(({className:e,size:t,...n},r)=>{let a={sm:14,md:16,lg:20}[t??"md"];return jsx("button",{ref:r,type:"button",className:u(Vm({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});Pt.displayName="CloseButton";var as=Z.createContext(null);function Zy(){let e=Z.useContext(as);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Gn(){return Z.useContext(as)}var Qy="16rem",Jy="18rem",eR="3rem",tR="b",nR={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},rR={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Ui=Z.forwardRef(({defaultOpen:e=false,open:t,onOpenChange:n,placement:r="left",size:o="md",backdrop:a="opaque",isDismissable:s=true,hideCloseButton:i=false,collapsible:l="offcanvas",mode:c,className:d,style:m,children:f,...p},g)=>{let h=c??"overlay",v=h==="overlay",[b,y]=Z.useState(false),[x,w]=Z.useState(false),[C,R]=Z.useState(e),T=t??C,P=Z.useCallback(M=>{let N=typeof M=="function"?M(T):M;n?n(N):R(N);},[n,T]);Z.useEffect(()=>{let M=()=>{y(window.innerWidth<768);};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);let S=Z.useCallback(()=>v?P(M=>!M):b?w(M=>!M):P(M=>!M),[b,P,w,v]);Z.useEffect(()=>{if(v)return;let M=N=>{N.key===tR&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),S());};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[S,v]);let k=T?"expanded":"collapsed",E=Z.useMemo(()=>({placement:r,state:k,open:T,setOpen:P,isMobile:b,openMobile:x,setOpenMobile:w,toggleDrawer:S,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,k,T,P,b,x,w,S,l,h,o,a,s,i]);return v?jsx(as.Provider,{value:E,children:jsx(Drawer.Root,{open:T,onOpenChange:P,direction:r,dismissible:s,children:f})}):jsx(as.Provider,{value:E,children:jsx(rr,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":Qy,"--drawer-width-icon":eR,...m},className:u("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Ui.displayName="Drawer";var zm=Z.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Gn();if(!s)return jsx("div",{ref:a,className:u("flex h-full flex-col bg-background text-foreground",n),...o,children:r});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:m,setOpenMobile:f}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:r});if(l==="none")return jsx("div",{ref:a,className:u("flex h-full w-[--drawer-width] flex-col bg-background text-foreground border-r",i==="right"&&"border-l border-r-0",n),...o,children:r});if(c&&!t)return jsx(oR,{open:m,onOpenChange:f,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",v=l==="icon";return jsx("div",{ref:a,className:u("group peer text-foreground relative"),"data-state":d,"data-collapsible":g?l:"","data-variant":e,"data-placement":i,"data-embedded":"true",children:jsx("div",{className:u("flex h-full flex-col overflow-hidden transition-[width,opacity] duration-200 ease-out",h?g?"w-0 opacity-0":"w-[--drawer-width] opacity-100":v&&g?"w-[--drawer-width-icon]":"w-[--drawer-width]",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background transition-opacity duration-200",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border",e==="default"&&i==="left"&&"border-r",e==="default"&&i==="right"&&"border-l"),children:r})})})}return jsxs("div",{ref:a,className:"group peer hidden md:block text-foreground","data-state":d,"data-collapsible":d==="collapsed"?l:"","data-variant":e,"data-placement":i,children:[jsx("div",{className:u("duration-200 relative h-svh w-[--drawer-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0",i==="right"&&"group-data-[placement=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--drawer-width-icon]")}),jsx("div",{className:u("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--drawer-width] transition-[left,right,width] ease-linear md:flex",i==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--drawer-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--drawer-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--drawer-width-icon] group-data-[placement=left]:border-r group-data-[placement=right]:border-l",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border"),children:r})})]})});zm.displayName="DrawerSidebar";var oR=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return ln(),()=>cn()},[t]),!o||!t?null:Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>n(false)}),jsx("div",{className:u("fixed z-50 bg-background p-0 text-foreground shadow-lg","animate-in",r==="left"&&"inset-y-0 left-0 h-full w-[--drawer-width] slide-in-from-left",r==="right"&&"inset-y-0 right-0 h-full w-[--drawer-width] slide-in-from-right"),style:{"--drawer-width":Jy},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Om=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Gn();if(o?.mode==="overlay")return jsx(Drawer.Trigger,{ref:r,className:e,onClick:t,...n});let a=o?.toggleDrawer;return jsxs("button",{ref:r,type:"button","data-drawer":"trigger",className:u("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...n,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Drawer"})]})});Om.displayName="DrawerTrigger";var Bm=Z.forwardRef(({className:e,children:t,...n},r)=>{let o=Gn(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque";if(a){let c=s==="top"||s==="bottom",d=s==="left"||s==="right",m=d?nR[i]:rR[i],f={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},p={top:"inset-x-0 top-0 rounded-b-[10px]",bottom:"inset-x-0 bottom-0 rounded-t-[10px]",left:"inset-y-0 left-0 rounded-r-[10px]",right:"inset-y-0 right-0 rounded-l-[10px]"};return jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:u("fixed inset-0 z-50",f[l])}),jsxs(Drawer.Content,{ref:r,className:u("fixed z-50 flex flex-col border bg-background",p[s],e),style:{...d?{width:m,height:"100%"}:{},...c?{maxHeight:m}:{},...n.style},...n,children:[c&&jsx("div",{className:u("mx-auto h-2 w-[100px] rounded-full bg-muted",s==="top"?"mb-4 mt-auto":"mt-4")}),t]})]})}return jsx("div",{ref:r,className:u("flex flex-col h-full",e),...n,children:t})});Bm.displayName="DrawerContent";var Fm=Z.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Gn(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:u("flex flex-col gap-2 p-4 relative",e),...r,children:[n,i&&jsx(Pt,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});Fm.displayName="DrawerHeader";var Km=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"body",className:u("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));Km.displayName="DrawerBody";var $m=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"footer",className:u("flex flex-col gap-2 p-4 mt-auto",e),...t}));$m.displayName="DrawerFooter";var Gm=Z.forwardRef(({className:e,...t},n)=>Gn()?.mode==="overlay"?jsx(Drawer.Title,{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));Gm.displayName="DrawerTitle";var Um=Z.forwardRef(({className:e,...t},n)=>Gn()?.mode==="overlay"?jsx(Drawer.Description,{ref:n,className:u("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));Um.displayName="DrawerDescription";var jm=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Gn();return jsx(Pt,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});jm.displayName="DrawerClose";var _m=Z.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Gn();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",m=d?PanelLeftOpen:PanelRightOpen,f=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:u("flex items-center gap-2 w-full px-2 py-2 rounded-md text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","transition-colors cursor-pointer","group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),onClick:p=>{t?.(p),s();},...r,children:[c?jsx(m,{className:"h-4 w-4 shrink-0"}):jsx(f,{className:"h-4 w-4 shrink-0"}),n&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});_m.displayName="DrawerToggle";var Wm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:u("mx-4 h-px bg-border",e),...t}));Wm.displayName="DrawerSeparator";var Ym=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-drawer":"menu",className:u("flex w-full min-w-0 flex-col gap-1",e),...t}));Ym.displayName="DrawerMenu";var Xm=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:u("group/menu-item relative",e),...t}));Xm.displayName="DrawerMenuItem";var qm=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-ring transition-[width,height,padding] hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",bordered:"bg-background shadow-[0_0_0_1px_currentColor] hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent/50 hover:text-accent-foreground"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),Zm=Z.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Gn(),c=l?.isMobile??false,d=l?.state??"expanded",m=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":n,"data-active":e,className:u(qm({variant:t,size:n}),o),...s,children:a});return r?jsxs(Cn,{children:[jsx(Tn,{children:m}),jsx(Mn,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):m});Zm.displayName="DrawerMenuButton";var Qm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group",className:u("relative flex w-full min-w-0 flex-col p-2",e),...t}));Qm.displayName="DrawerGroup";var Jm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group-label",className:u("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none transition-[margin,opacity] ease-linear","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));Jm.displayName="DrawerGroupLabel";var ep=Z.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,className:u("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ep.displayName="DrawerInset";var aR=Ui;var np=Z.forwardRef(({className:e,...t},n)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:n,className:u("w-full caption-bottom text-sm",e),...t})}));np.displayName="Table";var rp=Z.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:u("[&_tr]:border-b",e),...t}));rp.displayName="TableHeader";var op=Z.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:u("[&_tr:last-child]:border-0",e),...t}));op.displayName="TableBody";var ap=Z.forwardRef(({className:e,...t},n)=>jsx("tfoot",{ref:n,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ap.displayName="TableFooter";var sp=Z.forwardRef(({className:e,...t},n)=>jsx("tr",{ref:n,className:u("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));sp.displayName="TableRow";var ip=Z.forwardRef(({className:e,...t},n)=>jsx("th",{ref:n,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ip.displayName="TableHead";var lp=Z.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));lp.displayName="TableCell";var cp=Z.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:u("mt-4 text-sm text-muted-foreground",e),...t}));cp.displayName="TableCaption";function uR({className:e,data:t,columns:n,selectable:r=false,selectedKeys:o,onSelectionChange:a,getRowKey:s=(w,C)=>String(C),sortable:i=false,sortState:l,onSortChange:c,paginated:d=false,pageSizeOptions:m=[10,20,50],paginationState:f,onPaginationChange:p,emptyContent:g="No data",loading:h=false,striped:v=false,hoverable:b=true,...y},x){let[w,C]=Z.useState(new Set),[R,T]=Z.useState({columnId:null,direction:null}),[P,S]=Z.useState({pageIndex:0,pageSize:m[0]||10}),k=o??w,E=l??R,M=f??P,N=O=>{a?a(O):C(O);},H=O=>{c?c(O):T(O);},D=O=>{p?p(O):S(O);},L=Z.useMemo(()=>{if(!E.columnId||!E.direction)return t;let O=n.find(B=>B.id===E.columnId);return O?[...t].sort((B,_)=>{let U=O.accessor(B),$=O.accessor(_);if(U===$)return 0;if(U==null)return 1;if($==null)return -1;let X=String(U).localeCompare(String($),void 0,{numeric:true});return E.direction==="asc"?X:-X}):t},[t,E,n]),I=Z.useMemo(()=>{if(!d)return L;let O=M.pageIndex*M.pageSize;return L.slice(O,O+M.pageSize)},[L,d,M]),A=Math.ceil(L.length/M.pageSize),K=O=>{if(O===true){let B=new Set(I.map((_,U)=>s(_,U)));N(B);}else N(new Set);},V=(O,B)=>{let _=new Set(k);B?_.add(O):_.delete(O),N(_);},F=I.length>0&&I.every((O,B)=>k.has(s(O,B))),z=I.some((O,B)=>k.has(s(O,B))),G=O=>{if(!n.find(U=>U.id===O)?.sortable&&!i)return;let _="asc";E.columnId===O&&(E.direction==="asc"?_="desc":E.direction==="desc"&&(_=null)),H({columnId:_?O:null,direction:_});},j=O=>E.columnId!==O?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):E.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,className:u("w-full",e),...y,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[r&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(_o,{checked:F?true:z?"indeterminate":false,onCheckedChange:K,"aria-label":"Select all"})}),n.map(O=>{let B=O.sortable??i;return jsx("th",{className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground",B&&"cursor-pointer select-none hover:text-foreground"),style:{width:O.width},onClick:()=>B&&G(O.id),children:jsxs("div",{className:"flex items-center gap-2",children:[O.header,B&&j(O.id)]})},O.id)})]})}),jsx("tbody",{className:"[&_tr:last-child]:border-0",children:h?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:"Loading..."})}):I.length===0?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):I.map((O,B)=>{let _=s(O,B),U=k.has(_);return jsxs("tr",{className:u("border-b transition-colors",b&&"hover:bg-muted/50",v&&B%2===1&&"bg-muted/30",U&&"bg-muted"),"data-state":U?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(_o,{checked:U,onCheckedChange:$=>V(_,!!$),"aria-label":`Select row ${B+1}`})}),n.map($=>jsx("td",{className:"p-4 align-middle",children:$.cell?$.cell(O,B):$.accessor(O)},$.id))]},_)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:M.pageSize,onChange:O=>D({pageIndex:0,pageSize:Number(O.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:m.map(O=>jsx("option",{value:O,children:O},O))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",M.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(pe,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex-1}),disabled:M.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(pe,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex+1}),disabled:M.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var mR=Z.forwardRef(uR);var ji=["January","February","March","April","May","June","July","August","September","October","November","December"];function xR({currentMonth:e,onMonthChange:t,startYear:n,endYear:r}){let o=getMonth(e),a=getYear(e),s=c=>{let d=setMonth(e,c);t(d);},i=c=>{let d=setYear(e,c);t(d);},l=Z.useMemo(()=>{let c=[];for(let d=r;d>=n;d--)c.push(d);return c},[n,r]);return jsxs("div",{className:"flex items-center gap-1",children:[jsxs(Qt,{children:[jsx(Jt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[85px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{className:"truncate",children:ji[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(en,{className:"min-w-[120px] p-0",children:jsx(Oe,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:ji.map((c,d)=>jsx(Ht,{onSelect:()=>s(d),className:u("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(Qt,{children:[jsx(Jt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[60px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{children:a}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(en,{className:"min-w-[80px] p-0",children:jsx(Oe,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Ht,{onSelect:()=>i(c),className:u("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function yR(e,t,n){return function({calendarMonth:o}){let{goToMonth:a,nextMonth:s,previousMonth:i}=useDayPicker();if(e)return jsxs("div",{className:"flex items-center justify-between gap-1 mb-2",children:[jsx(xR,{currentMonth:o.date,onMonthChange:a,startYear:t,endYear:n}),jsxs("div",{className:"flex items-center",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-6 w-6 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-3.5 w-3.5"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-6 w-6 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-3.5 w-3.5"})})]})]});let l=ji[o.date.getMonth()],c=o.date.getFullYear();return jsxs("div",{className:"flex items-center justify-between gap-2 h-10 mb-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-medium w-[90px]",children:l}),jsx("span",{className:"text-sm font-medium w-[50px]",children:c})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})}}function lo({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=Z.useMemo(()=>yR(r,o,a),[r,o,a]);return jsx(DayPicker,{showOutsideDays:n,className:u("p-4",e),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-2",month_caption:"sr-only",nav:"hidden",month_grid:"w-full border-collapse",weekdays:"flex",weekday:"text-muted-foreground w-8 font-normal text-xs text-center",week:"flex w-full mt-0.5",day:u("relative h-8 w-8 p-0 text-center text-sm","flex items-center justify-center","focus-within:relative focus-within:z-20","[&:has([aria-selected]:not(.outside-day))]:bg-accent","first:[&:has([aria-selected]:not(.outside-day))]:rounded-l-md","last:[&:has([aria-selected]:not(.outside-day))]:rounded-r-md"),day_button:u("size-8 p-0 font-normal rounded-md text-sm","inline-flex items-center justify-center","hover:bg-primary/10","focus:outline-none","transition-colors cursor-pointer"),range_start:"rounded-l-md",range_end:"rounded-r-md",selected:u("bg-primary text-primary-foreground rounded-md","hover:bg-primary/90 hover:!text-primary-foreground","focus:bg-primary focus:text-primary-foreground","[&.outside-day]:!bg-transparent [&.outside-day]:!text-muted-foreground/50"),today:"bg-accent text-accent-foreground rounded-md",outside:"outside-day text-muted-foreground/50 !bg-transparent",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none bg-muted text-foreground",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0}},components:{...s,MonthCaption:l},...i})}lo.displayName="Calendar";var pp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:u("mx-auto flex w-full justify-center",e),...t});pp.displayName="Pagination";var fp=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:u("flex flex-row items-center gap-1",e),...t}));fp.displayName="PaginationContent";var gp=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:u("",e),...t}));gp.displayName="PaginationItem";var TR={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},ss=({className:e,isActive:t,size:n="md",radius:r="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:u(ro({variant:t?"solid":"light",size:n,radius:r}),o&&TR[n],e),...a});ss.displayName="PaginationLink";var bp=({className:e,...t})=>jsxs(ss,{"aria-label":"Go to previous page",isIconOnly:false,className:u("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});bp.displayName="PaginationPrevious";var vp=({className:e,...t})=>jsxs(ss,{"aria-label":"Go to next page",isIconOnly:false,className:u("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});vp.displayName="PaginationNext";var MR={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},hp=({className:e,size:t="md",...n})=>jsxs("span",{"aria-hidden":true,className:u("flex items-center justify-center",MR[t],e),...n,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});hp.displayName="PaginationEllipsis";var Zo=Z.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,className:u("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));Zo.displayName="VisuallyHidden";var yp={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},kR={auto:"top-[50%] translate-y-[-50%]",center:"top-[50%] translate-y-[-50%]",top:"top-4 translate-y-0",bottom:"top-auto bottom-4 translate-y-0","top-center":"top-[20%] translate-y-0","bottom-center":"top-auto bottom-[20%] translate-y-0"},Rp=cva("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),Xi=cva("fixed left-[50%] z-50 grid translate-x-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 sm:rounded-lg",{variants:{size:{xs:"w-full max-w-xs",sm:"w-full max-w-sm",md:"w-full max-w-md",lg:"w-full max-w-lg",xl:"w-full max-w-xl","2xl":"w-full max-w-2xl","3xl":"w-full max-w-3xl","4xl":"w-full max-w-4xl","5xl":"w-full max-w-5xl",full:"w-[calc(100vw-2rem)] h-[calc(100vh-2rem)] max-w-none"}},defaultVariants:{size:"md"}}),ls=Z.createContext(null),Ar=()=>{let e=Z.useContext(ls);if(!e)throw new Error("Modal components must be used within a Modal");return e},Cp=Z.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:m,className:f},p)=>{let[g,h]=Z.useState(false),v=e!==void 0,b=v?e:g,[y,x]=Z.useState(false),w=Z.useRef(null),C=Z.useId(),R=Z.useId();Z.useEffect(()=>{x(true);},[]);let T=Z.useCallback(E=>{v||h(E),t?.(E);},[v,t]);Z.useEffect(()=>{if(b)return ln(),()=>cn()},[b]),Z.useEffect(()=>{if(!b||i)return;let E=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[b,i,T]);let P=E=>{s&&E.target===E.currentTarget&&T(false);},S=n?Z.isValidElement(n)?Z.cloneElement(n,{onClick:E=>{n.props.onClick?.(E),T(true);}}):jsx("button",{type:"button",onClick:()=>T(true),children:n}):null,k=()=>!y||!b?null:d==="outside"?Wa.createPortal(jsx("div",{"data-state":b?"open":"closed",className:u(Rp(),yp[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:P,children:jsxs("div",{ref:E=>{w.current=E,typeof p=="function"?p(E):p&&(p.current=E);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"open":"closed",className:u("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",m==="xs"&&"w-full max-w-xs",m==="sm"&&"w-full max-w-sm",m==="md"&&"w-full max-w-md",m==="lg"&&"w-full max-w-lg",m==="xl"&&"w-full max-w-xl",m==="2xl"&&"w-full max-w-2xl",m==="3xl"&&"w-full max-w-3xl",m==="4xl"&&"w-full max-w-4xl",m==="5xl"&&"w-full max-w-5xl",m==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!m&&"w-full max-w-md",f),children:[jsx(Zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Pt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})}),document.body):Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":b?"open":"closed",className:u(Rp(),yp[l]),onClick:P,"aria-hidden":"true"}),jsxs("div",{ref:E=>{w.current=E,typeof p=="function"?p(E):p&&(p.current=E);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"open":"closed",className:u(Xi({size:m}),kR[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(Zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Pt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})]}),document.body);return jsxs(ls.Provider,{value:{open:b,onOpenChange:T,scrollBehavior:d,titleId:C,descriptionId:R},children:[S,k()]})});Cp.displayName="Modal";var cs=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=Z.useState(n),i=t!==void 0,l=i?t:a,c=Z.useId(),d=Z.useId(),m=Z.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(ls.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};cs.displayName="ModalRoot";var Tp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ar();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Tp.displayName="ModalTrigger";var qi=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};qi.displayName="ModalPortal";var Zi=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Ar();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Zi.displayName="ModalOverlay";var Mp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ar();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Mp.displayName="ModalClose";var ds=Z.forwardRef(({className:e,children:t,size:n,showCloseButton:r=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:m}=Ar(),[f,p]=Z.useState(false);return Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(l)return ln(),()=>cn()},[l]),Z.useEffect(()=>{if(!l)return;let g=h=>{h.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l,c,o]),!f||!l?null:jsxs(qi,{children:[jsx(Zi,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Xi({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(Pt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});ds.displayName="ModalContent";var Np=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Np.displayName="ModalHeader";var kp=({className:e,children:t})=>(Z.useContext(ls)?.scrollBehavior??"inside")==="inside"?jsx(Oe,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});kp.displayName="ModalBody";var Pp=({className:e,children:t,...n})=>{let{onOpenChange:r}=Ar();return jsx("div",{className:u("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n,children:Z.Children.map(t,o=>Z.isValidElement(o)?Z.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};Pp.displayName="ModalFooter";var Ep=Z.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Ar();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});Ep.displayName="ModalTitle";var Sp=Z.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Ar();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});Sp.displayName="ModalDescription";var Qi=Z.forwardRef(({className:e,...t},n)=>jsx(Command,{ref:n,className:u("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Qi.displayName=Command.displayName;var SR=({children:e,...t})=>jsx(cs,{...t,children:jsx(ds,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Qi,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Lp=Z.forwardRef(({className:e,...t},n)=>jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(Command.Input,{ref:n,className:u("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Lp.displayName=Command.Input.displayName;var Dp=Z.forwardRef(({className:e,children:t,...n},r)=>jsx(Oe,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:u("overflow-hidden",e),...n,children:t})}));Dp.displayName=Command.List.displayName;var Hp=Z.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Hp.displayName=Command.Empty.displayName;var Ip=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Group,{ref:n,className:u("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ip.displayName=Command.Group.displayName;var Vp=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:u("-mx-1 h-px bg-border",e),...t}));Vp.displayName=Command.Separator.displayName;var Ap=Z.forwardRef(({className:e,children:t,startContent:n,endContent:r,...o},a)=>jsxs(Command.Item,{ref:a,className:u("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...o,children:[n,t&&jsx("span",{className:"flex-1",children:t}),r]}));Ap.displayName=Command.Item.displayName;var zp=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});zp.displayName="CommandShortcut";var HR={sm:{input:"h-9 px-2 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5"},md:{input:"h-10 px-3 text-sm",button:"h-10 w-10",icon:"h-4 w-4"},lg:{input:"h-11 px-4 text-base",button:"h-11 w-11",icon:"h-5 w-5"}},IR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Bp=Z.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,size:s="md",radius:i="md",...l},c)=>{let[d,m]=Z.useState(false),[f,p]=Z.useState(false),g=HR[s],h=IR[i];return jsxs("div",{className:"relative",children:[jsx("input",{type:d?"text":"password",className:u("flex w-full border border-input bg-background py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",g.input,h,t&&"pr-10",e),ref:c,disabled:n,style:{...a,borderColor:f?"var(--color-foreground)":void 0},onFocus:v=>{p(true),r?.(v);},onBlur:v=>{p(false),o?.(v);},...l}),t&&jsx("button",{type:"button",className:u("absolute right-0 top-0 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",g.button),onClick:()=>m(!d),disabled:n,tabIndex:-1,"aria-label":d?"Hide password":"Show password",children:d?jsx(EyeOff,{className:g.icon}):jsx(Eye,{className:g.icon})})]})});Bp.displayName="PasswordInput";var OR={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},BR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Fp=Z.forwardRef(({className:e,showButtons:t=true,step:n=1,min:r,max:o,value:a,defaultValue:s,onChange:i,disabled:l,size:c="md",radius:d="md",...m},f)=>{let[p,g]=Z.useState(s),[h,v]=Z.useState(false),b=a!==void 0,y=b?a:p,x=OR[c],w=BR[d],C=M=>{M!==void 0&&(r!==void 0&&M<r&&(M=r),o!==void 0&&M>o&&(M=o)),b||g(M),i?.(M);},R=()=>{C((y??0)+n);},T=()=>{C((y??0)-n);},P=M=>{let N=M.target.value;if(N==="")C(void 0);else {let H=parseFloat(N);isNaN(H)||C(H);}},S=M=>{M.key==="ArrowUp"?(M.preventDefault(),R()):M.key==="ArrowDown"&&(M.preventDefault(),T());},k=r===void 0||(y??0)>r,E=o===void 0||(y??0)<o;return t?jsxs("div",{className:u("relative flex items-center border border-input transition-colors",x.wrapper,w,l&&"opacity-50",e),style:{borderColor:h?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",x.button),onClick:T,disabled:l||!k,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:x.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("min-w-0 flex-1 bg-transparent text-center focus:outline-none disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input),ref:f,value:y??"",onChange:P,onKeyDown:S,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...m}),jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",x.button),onClick:R,disabled:l||!E,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input,w,e),style:{borderColor:h?"var(--color-foreground)":void 0},ref:f,value:y??"",onChange:P,onKeyDown:S,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...m})});Fp.displayName="NumberInput";var Up=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),Kp=cva("border-2 border-background ring-0 cursor-pointer transition-transform duration-200 hover:-translate-y-1",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{size:"md"}}),jp=Z.forwardRef(({className:e,items:t,max:n=5,size:r,showTooltips:o=false,...a},s)=>{let i=t.slice(0,n),l=t.length-n,c=(m,f)=>{let p=jsxs(Dr,{className:u(Kp({size:r})),children:[m.src&&jsx(io,{src:m.src,alt:m.alt||""}),jsx(Hr,{className:"text-xs",children:m.fallback||m.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&m.alt?jsxs(Cn,{children:[jsx(Tn,{children:p}),jsx(Mn,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:m.alt})]},f):p},d=jsxs("div",{ref:s,className:u(Up({size:r,className:e})),...a,children:[i.map((m,f)=>c(m,f)),l>0&&jsx(Dr,{className:u(Kp({size:r})),children:jsxs(Hr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(rr,{delayDuration:300,children:d}):d});jp.displayName="AvatarGroup";var _p=cva("flex gap-0.5",{variants:{size:{sm:"[&_svg]:h-4 [&_svg]:w-4",md:"[&_svg]:h-5 [&_svg]:w-5",lg:"[&_svg]:h-6 [&_svg]:w-6"}},defaultVariants:{size:"md"}}),Wp=Z.forwardRef(({className:e,value:t,defaultValue:n=0,onValueChange:r,max:o=5,size:a,icon:s="star",allowHalf:i=false,readOnly:l=false,disabled:c=false,filledColor:d,emptyColor:m,...f},p)=>{let[g,h]=Z.useState(n),[v,b]=Z.useState(null),y=t!==void 0,x=y?t:g,w=v!==null?v:x,C=N=>{l||c||(y||h(N),r?.(N));},R=(N,H=false)=>{let D=i&&H?N+.5:N+1;C(D);},T=(N,H)=>{if(l||c)return;let D=N.currentTarget.getBoundingClientRect(),L=i&&N.clientX<D.left+D.width/2;b(L?H+.5:H+1);},P=()=>{b(null);},S=s==="heart"?Heart:Star,k=N=>w>=N+1?"full":w>=N+.5?"half":"empty",E=d?{color:d,fill:d}:{},M=m?{color:m}:{};return jsx("div",{ref:p,className:u(_p({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:P,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(N,H)=>{let D=k(H);return jsxs("button",{type:"button",className:u("relative focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",!l&&!c&&"cursor-pointer hover:scale-110 transition-transform"),onClick:L=>{let I=L.currentTarget.getBoundingClientRect(),A=i&&L.clientX<I.left+I.width/2;R(H,A);},onMouseMove:L=>T(L,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":x===H+1,children:[jsx(S,{className:u("text-muted-foreground/30",D!=="empty"&&"absolute inset-0"),style:D==="empty"?M:void 0}),D!=="empty"&&jsx(S,{className:u("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",D==="half"&&"clip-path-half"),style:{...E,clipPath:D==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});Wp.displayName="Rating";var Xp=cva("inline-flex items-center justify-center gap-1.5 text-sm font-medium 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 cursor-default",{variants:{variant:{solid:"border-transparent text-primary-foreground",bordered:"border bg-transparent",ghost:"border-transparent bg-transparent",soft:"border-transparent",surface:"border-transparent bg-muted text-muted-foreground"},color:{primary:"",secondary:"",success:"",warning:"",danger:""},size:{sm:"h-6 px-2 text-xs",md:"h-7 px-2.5 text-sm",lg:"h-8 px-3 text-sm"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},clickable:{true:"cursor-pointer",false:""}},compoundVariants:[{variant:"solid",color:"primary",className:"bg-primary hover:bg-primary/90"},{variant:"solid",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-600"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:hover:bg-amber-600"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-600"},{variant:"bordered",color:"primary",className:"text-primary !border-primary hover:bg-primary/10"},{variant:"bordered",color:"secondary",className:"text-secondary-foreground !border-secondary hover:bg-secondary/10"},{variant:"bordered",color:"success",className:"text-green-600 !border-green-600 hover:bg-green-600/10 dark:text-green-500 dark:!border-green-500"},{variant:"bordered",color:"warning",className:"text-amber-600 !border-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:!border-amber-500"},{variant:"bordered",color:"danger",className:"text-red-600 !border-red-600 hover:bg-red-600/10 dark:text-red-500 dark:!border-red-500"},{variant:"ghost",color:"primary",className:"text-primary hover:bg-primary/10"},{variant:"ghost",color:"secondary",className:"text-secondary-foreground hover:bg-secondary"},{variant:"ghost",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"ghost",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"ghost",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/10"},{variant:"soft",color:"primary",className:"bg-primary/15 text-primary hover:bg-primary/20"},{variant:"soft",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"soft",color:"success",className:"bg-green-600/15 text-green-600 hover:bg-green-600/20 dark:bg-green-500/15 dark:text-green-500 dark:hover:bg-green-500/20"},{variant:"soft",color:"warning",className:"bg-amber-600/15 text-amber-600 hover:bg-amber-600/20 dark:bg-amber-500/15 dark:text-amber-500 dark:hover:bg-amber-500/20"},{variant:"soft",color:"danger",className:"bg-red-600/15 text-red-600 hover:bg-red-600/20 dark:bg-red-500/15 dark:text-red-500 dark:hover:bg-red-500/20"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),_R={sm:"sm",md:"sm",lg:"sm"},qp=Z.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,children:m,onClick:f,...p},g)=>{let h=a||!!f,v=b=>{b.stopPropagation(),c?.();};return jsxs("div",{ref:g,role:h?"button":void 0,tabIndex:h&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:f,onKeyDown:h&&!d?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f?.(b));}:void 0,className:u(Xp({variant:t,color:n,size:r,radius:o,clickable:h}),d&&"opacity-50 cursor-not-allowed",e),...p,children:[s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:m}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Pt,{size:_R[r??"md"],onClick:v,disabled:d,className:"ml-0.5 h-4 w-4"})]})});qp.displayName="Chip";var Zp=createContext({direction:"horizontal"}),ew=({className:e,direction:t="horizontal",children:n,...r})=>jsx(Zp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:u("flex h-full w-full data-[orientation=vertical]:flex-col",e),...r,children:n})}),tw=Panel,nw=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(Zp),o=r==="vertical";return jsx(Separator,{className:u("relative flex shrink-0 items-center justify-center bg-border outline-none",o?"h-px w-full after:absolute after:inset-x-0 after:top-1/2 after:h-1 after:-translate-y-1/2":"w-px after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",t),...n,children:e&&jsx("div",{className:u("z-10 flex items-center justify-center rounded-sm border bg-border",o?"h-3 w-4 rotate-90":"h-4 w-3"),children:jsx(GripVertical,{className:"h-2.5 w-2.5"})})})};var tf=cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-24 w-24"},color:{default:"",primary:"",success:"",warning:"",danger:""}},defaultVariants:{size:"md",color:"default"}}),ow={sm:{size:32,strokeWidth:3,fontSize:"text-[10px]"},md:{size:48,strokeWidth:4,fontSize:"text-xs"},lg:{size:64,strokeWidth:5,fontSize:"text-sm"},xl:{size:96,strokeWidth:6,fontSize:"text-base"}},Qp={default:"var(--color-foreground, #18181b)",primary:"var(--color-primary, #18181b)",success:"var(--color-success, #16a34a)",warning:"var(--color-warning, #d97706)",danger:"var(--color-danger, #dc2626)"},nf=Z.forwardRef(({className:e,size:t="md",color:n="default",value:r,max:o=100,showValue:a=false,formatValue:s=d=>`${Math.round(d)}%`,trackClassName:i,...l},c)=>{let d=Math.min(100,Math.max(0,r/o*100)),m=ow[t],f=(m.size-m.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:u(tf({size:t,color:n}),e),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":o,...l,children:[jsxs("svg",{width:m.size,height:m.size,viewBox:`0 0 ${m.size} ${m.size}`,fill:"none",children:[jsx("circle",{className:u("stroke-muted",i),cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none"}),jsx("circle",{cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none",strokeLinecap:"round",stroke:Qp[n]||Qp.default,strokeDasharray:`${p} ${p}`,strokeDashoffset:g,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&jsx("span",{className:u("absolute font-medium text-foreground",m.fontSize),children:s(d)})]})});nf.displayName="CircularProgress";var rf=Z.createContext(null),iw=()=>{let e=Z.useContext(rf);if(!e)throw new Error("OTP components must be used within InputOTP");return e},of=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),af=Z.forwardRef(({className:e,containerClassName:t,maxLength:n,value:r,defaultValue:o="",onChange:a,onComplete:s,pattern:i,disabled:l=false,size:c,radius:d="md",children:m,...f},p)=>{let[g,h]=Z.useState(o),[v,b]=Z.useState(0),[y,x]=Z.useState(false),w=Z.useRef(null),C=r!==void 0?r:g;Z.useImperativeHandle(p,()=>w.current),Z.useEffect(()=>{b(Math.min(C.length,n-1));},[C,n]),Z.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let R=M=>{let N=M.target.value;if(i&&N){let H=new RegExp(i.replace("^","").replace("$","").replace("+",""));N=N.split("").filter(D=>H.test(D)).join("");}N=N.slice(0,n),r===void 0&&h(N),a?.(N);},T=M=>{M.key==="ArrowLeft"?b(N=>Math.max(0,N-1)):M.key==="ArrowRight"&&b(N=>Math.min(C.length,n-1,N+1));},P=()=>{w.current?.focus();},S=()=>{x(true),b(Math.min(C.length,n-1));},k=()=>{x(false);},E={value:C,activeIndex:y?v:-1,maxLength:n,disabled:l,radius:d};return jsx(rf.Provider,{value:E,children:jsxs("div",{className:u(of({size:c}),t),onClick:P,"data-otp-container":true,children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:C,onChange:R,onKeyDown:T,onFocus:S,onBlur:k,disabled:l,maxLength:n,className:u("absolute opacity-0 pointer-events-none w-0 h-0",e),...f}),m]})})});af.displayName="InputOTP";var sf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center",e),...t}));sf.displayName="InputOTPGroup";var lw={none:"first:rounded-l-none",sm:"first:rounded-l-md",md:"first:rounded-l-lg",lg:"first:rounded-l-xl",full:"first:rounded-l-full"},cw={none:"last:rounded-r-none",sm:"last:rounded-r-md",md:"last:rounded-r-lg",lg:"last:rounded-r-xl",full:"last:rounded-r-full"},lf=Z.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=iw(),l=o[e]||"",c=a===e,d=c&&o.length===e;return jsxs("div",{ref:r,"data-otp-slot":true,"data-active":c,"data-filled":!!l,className:u("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:border-l",lw[i],cw[i],c&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...n,children:[l,d&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});lf.displayName="InputOTPSlot";var cf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));cf.displayName="InputOTPSeparator";var mf=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900",bordered:"border border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent text-zinc-800 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800",flat:"bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-white",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"flat",size:"md"}}),pf=Z.forwardRef(({className:e,variant:t,size:n,value:r=[],onChange:o,placeholder:a="Add tag...",maxTags:s,minTagLength:i=1,maxTagLength:l=50,triggerKeys:c=["Enter",",","Tab"],allowDuplicates:d=false,disabled:m,readOnly:f,renderTag:p,...g},h)=>{let[v,b]=Z.useState(""),y=Z.useRef(null);Z.useImperativeHandle(h,()=>y.current);let x=k=>{let E=k.trim();if(E.length<i||E.length>l||s&&r.length>=s||!d&&r.some(N=>N.text.toLowerCase()===E.toLowerCase()))return;let M={id:crypto.randomUUID(),text:E};o?.([...r,M]),b("");},w=k=>{m||f||o?.(r.filter(E=>E.id!==k));},C=k=>{if(c.includes(k.key)){if(k.key==="Tab"&&!v)return;k.preventDefault(),x(v);}k.key==="Backspace"&&!v&&r.length>0&&w(r[r.length-1].id);},R=k=>{let E=k.target.value;if(E.includes(",")){E.split(",").forEach(N=>{N.trim()&&x(N);});return}b(E);},T=k=>{k.preventDefault(),k.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(N=>{x(N);});},P=()=>{y.current?.focus();},S=s?r.length>=s:false;return jsxs("div",{className:u("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",m&&"cursor-not-allowed opacity-50",e),onClick:P,children:[r.map(k=>p?p(k,()=>w(k.id)):jsxs("span",{className:u(mf({variant:t,size:n})),children:[k.text,!m&&!f&&jsx("button",{type:"button",onClick:E=>{E.stopPropagation(),w(k.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${k.text}`,children:jsx(X,{className:"h-3 w-3"})})]},k.id)),!S&&!f&&jsx("input",{ref:y,type:"text",value:v,onChange:R,onKeyDown:C,onPaste:T,placeholder:r.length===0?a:"",disabled:m,className:u("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});pf.displayName="TagInput";var gf=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-2 py-6",md:"gap-3 py-10",lg:"gap-4 py-16"}},defaultVariants:{size:"md"}}),bf=Z.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u(gf({size:t,className:e})),...i,children:[n&&jsx("div",{className:"text-muted-foreground [&>svg]:h-10 [&>svg]:w-10",children:n}),r&&jsx("h3",{className:"text-lg font-semibold text-foreground",children:r}),o&&jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:o}),a&&jsx("div",{className:"mt-2",children:a}),s]}));bf.displayName="EmptyState";var hf=cva("border p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-zinc-800 text-white border-zinc-800 dark:bg-zinc-200 dark:text-zinc-900 dark:border-zinc-200",bordered:"border border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent border-transparent shadow-none",flat:"bg-zinc-100 border-transparent dark:bg-zinc-800",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),xf=Z.forwardRef(({className:e,variant:t,radius:n,label:r,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let m=s==="up"?TrendingUp:s==="down"?TrendingDown:Minus,f=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:u(hf({variant:t,radius:n,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:u("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:r}),a&&jsx("div",{className:u("[&>svg]:h-4 [&>svg]:w-4",t==="solid"?"opacity-80":"text-muted-foreground"),children:a})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:o}),s&&i&&jsxs("span",{className:u("flex items-center gap-0.5 text-sm",f),children:[jsx(m,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:u("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});xf.displayName="StatCard";var ra=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2",cards:"gap-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),rl=({checked:e,disabled:t,onClick:n})=>jsx("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t,onClick:r=>{r.stopPropagation(),t||n(r);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e&&"bg-primary text-primary-foreground",t&&"cursor-not-allowed opacity-50"),children:e&&jsx("span",{className:"flex items-center justify-center text-current",children:jsx(Check,{className:"h-3 w-3"})})});function Sw({item:e,index:t,renderItem:n,showHandle:r,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:m}){let{attributes:f,listeners:p,setNodeRef:g,transform:h,transition:v,isDragging:b}=useSortable({id:e.id}),y={transform:CSS.Transform.toString(h),transition:v};return jsxs("div",{ref:g,...f,style:y,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?x=>d?.(e,x):void 0,className:u("flex items-center gap-3 transition-all",c&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",c&&i&&"border-primary bg-accent",!c&&a&&!s&&"cursor-pointer hover:bg-muted/50",!c&&s&&"cursor-pointer hover:bg-muted/50",!c&&i&&a&&!s&&"bg-primary/10",b&&"opacity-50 z-10",(a||s)&&"cursor-pointer"),children:[r&&o!==false&&jsx("div",{className:"shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",...p,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(rl,{checked:l,onClick:x=>m?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function Lw({className:e,variant:t,size:n,items:r,renderItem:o,draggable:a=false,onReorder:s,showHandle:i=true,dragIcon:l,selectable:c=false,multiple:d=false,selectedKeys:m,defaultSelectedKeys:f=[],onSelect:p,checkable:g=false,checkedKeys:h,defaultCheckedKeys:v=[],onCheck:b,emptyContent:y,children:x,...w},C){let[R,T]=Z.useState(false),[P,S]=Z.useState(null);Z.useEffect(()=>{T(true);},[]);let[k,E]=Z.useState(new Set(f)),M=m!==void 0,N=M?new Set(m):k,[H,D]=Z.useState(new Set(v)),L=h!==void 0,I=L?new Set(h):H,A=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),K=Z.useCallback((B,_)=>{if(!r)return;let U=new Set(N),$=!U.has(B.id);d?$?U.add(B.id):U.delete(B.id):(U.clear(),$&&U.add(B.id)),M||E(U);let X=r.filter(te=>U.has(te.id));p?.(Array.from(U),{selected:$,selectedItems:X,item:B,event:_});},[r,N,d,M,p]),V=Z.useCallback((B,_)=>{if(!r)return;let U=new Set(I),$=!U.has(B.id);$?U.add(B.id):U.delete(B.id),L||D(U);let X=r.filter(te=>U.has(te.id));b?.(Array.from(U),{checked:$,checkedItems:X,item:B,event:_});},[r,I,L,b]),F=B=>{if(!r)return;let _=r.find(U=>U.id===B.active.id);_&&S(_);},z=B=>{let{active:_,over:U}=B;if(S(null),!r||!U||_.id===U.id)return;let $=r.findIndex(te=>te.id===_.id),X=r.findIndex(te=>te.id===U.id);if($!==-1&&X!==-1){let te=[...r],[Y]=te.splice($,1);te.splice(X,0,Y),s?.(te);}},j=(a||c||g)&&r&&o,O=t==="cards";return r&&r.length===0&&y?jsx("div",{ref:C,className:u("flex items-center justify-center p-8 text-muted-foreground",e),...w,children:y}):j?a?R?jsxs(DndContext,{sensors:A,collisionDetection:closestCenter,onDragStart:F,onDragEnd:z,children:[jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map(B=>B.id),strategy:verticalListSortingStrategy,children:r.map((B,_)=>jsx(Sw,{item:B,index:_,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:N.has(B.id),isChecked:I.has(B.id),isCards:O,onSelect:K,onCheck:V},B.id))})}),jsx(DragOverlay,{children:P&&o&&jsxs("div",{className:"flex items-center gap-3 bg-background border shadow-lg rounded-md p-3 opacity-90",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:o(P,r?.indexOf(P)??0)})]})})]}):jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:r.map((B,_)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(rl,{checked:I.has(B.id),onClick:U=>V(B,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(B,_)})]},B.id))}):jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:r.map((B,_)=>{let U=N.has(B.id),$=I.has(B.id);return jsxs("div",{role:"listitem","aria-selected":c?U:void 0,onClick:c&&!g?X=>K(B,X):void 0,className:u("flex items-center gap-3 transition-all",O&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",O&&U&&"border-primary bg-accent",!O&&c&&!g&&"cursor-pointer hover:bg-muted/50",!O&&g&&"cursor-pointer hover:bg-muted/50",!O&&U&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(rl,{checked:$,onClick:X=>V(B,X)}),jsx("div",{className:"flex-1 min-w-0",children:o(B,_)})]},B.id)})}):jsx("div",{ref:C,role:"list",className:u(ra({variant:t,size:n,className:e})),...w,children:x})}var Dw=Z.forwardRef(Lw),wf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Cf=Z.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:u(wf({interactive:t,className:e})),...a,children:[n&&jsx("div",{className:"shrink-0 text-muted-foreground",children:n}),jsx("div",{className:"flex-1 min-w-0",children:o}),r&&jsx("div",{className:"shrink-0 whitespace-nowrap",children:r})]}));Cf.displayName="ListItem";var Tf=Z.forwardRef(({className:e,primary:t,secondary:n,children:r,...o},a)=>jsxs("div",{ref:a,className:u("min-w-0",e),...o,children:[t&&jsx("p",{className:"text-sm font-medium leading-none truncate",children:t}),n&&jsx("p",{className:"mt-1 text-sm text-muted-foreground truncate",children:n}),r]}));Tf.displayName="ListItemText";var kf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Pf=Z.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:u(kf({position:t,className:e})),...n}));Pf.displayName="Timeline";var Ef=cva("relative flex gap-4 pb-8 last:pb-0",{variants:{variant:{default:"",success:"[&_[data-timeline-dot]]:bg-green-500 [&_[data-timeline-dot]]:border-green-500",warning:"[&_[data-timeline-dot]]:bg-yellow-500 [&_[data-timeline-dot]]:border-yellow-500",error:"[&_[data-timeline-dot]]:bg-red-500 [&_[data-timeline-dot]]:border-red-500",info:"[&_[data-timeline-dot]]:bg-blue-500 [&_[data-timeline-dot]]:border-blue-500"}},defaultVariants:{variant:"default"}}),Sf=Z.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(Ef({variant:t,className:e})),...s,children:[!n&&jsxs("div",{className:"flex flex-col items-center",children:[jsx("div",{"data-timeline-dot":true,className:"flex h-3 w-3 items-center justify-center rounded-full border-2 border-primary bg-primary",children:o}),!r&&jsx("div",{className:"w-0.5 flex-1 bg-border"})]}),a]}));Sf.displayName="TimelineItem";var Lf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 pt-0.5",e),...t}));Lf.displayName="TimelineContent";var Df=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Df.displayName="TimelineOpposite";var If=cva("inline-flex items-center rounded-lg bg-muted p-1 text-muted-foreground",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},fullWidth:{true:"w-full",false:""}},defaultVariants:{size:"md",fullWidth:false}}),Vf=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 text-xs px-2.5",md:"h-8 text-sm px-3",lg:"h-10 text-base px-4"},selected:{true:"bg-background text-foreground shadow-sm",false:""}},defaultVariants:{size:"md",selected:false}}),Af=Z.createContext({}),zf=Z.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,m]=Z.useState(a),f=o!==void 0?o:d,p=Z.useCallback(g=>{o===void 0&&m(g),s?.(g);},[o,s]);return jsx(Af.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:u(If({size:t,fullWidth:n,className:e})),...l,children:r})})});zf.displayName="SegmentedControl";var Of=Z.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=Z.useContext(Af),i=s.value===n,l=r||s.disabled;return jsx("button",{ref:a,type:"button",role:"radio","aria-checked":i,"data-state":i?"on":"off",disabled:l,onClick:()=>{l||s.onValueChange?.(n);},className:u(Vf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});Of.displayName="SegmentedControlItem";var Bf=cva("relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",{variants:{variant:{default:"border-input bg-background hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-danger bg-danger/5"},size:{sm:"p-4 min-h-[120px]",md:"p-6 min-h-[160px]",lg:"p-8 min-h-[200px]"}},defaultVariants:{variant:"default",size:"md"}}),Ff=e=>{let t=e.type;return t.startsWith("image/")?Image$1:t.startsWith("video/")?FileVideo:t.startsWith("audio/")?FileAudio:t.includes("pdf")||t.includes("document")?FileText:t.includes("zip")||t.includes("rar")||t.includes("archive")?FileArchive:File},bs=e=>{if(e===0)return "0 Bytes";let t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},Kf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${bs(t)}`}),n&&n.length>0&&(n.some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.endsWith("/*")){let s=a.slice(0,-2);return e.type.startsWith(s)}return e.type===a})||r.push({code:"file-invalid-type",message:`File type not accepted. Accepted: ${n.join(", ")}`})),r},$f=Z.forwardRef(({className:e,variant:t,size:n,onFilesChange:r,onFilesRejected:o,onFileRemove:a,files:s=[],showFileList:i=true,children:l,maxSize:c=10*1024*1024,accept:d,multiple:m=true,disabled:f,...p},g)=>{let[h,v]=Z.useState(false),[b,y]=Z.useState(false),[x,w]=Z.useState([]),C=Z.useRef(null),R=Z.useCallback(L=>{if(!L||L.length===0)return;let I=Array.from(L),A=[],K=[];(m?I:[I[0]]).forEach(F=>{let z=Kf(F,c,d);z.length>0?K.push({file:F,errors:z}):A.push(F);}),w(K),A.length>0&&r?.(A),K.length>0&&o?.(K);},[c,d,m,r,o]),T=Z.useCallback(L=>{if(L.preventDefault(),L.stopPropagation(),!f&&(v(true),L.dataTransfer.items)){let A=Array.from(L.dataTransfer.items).some(K=>{if(K.kind!=="file")return true;if(d&&d.length>0){let V=K.type;return !d.some(F=>F.endsWith("/*")?V.startsWith(F.slice(0,-2)):V===F)}return false});y(A);}},[f,d]),P=Z.useCallback(L=>{L.preventDefault(),L.stopPropagation(),!f&&(L.dataTransfer.dropEffect="copy");},[f]),S=Z.useCallback(L=>{L.preventDefault(),L.stopPropagation();let I=L.currentTarget.getBoundingClientRect(),A=L.clientX,K=L.clientY;(A<I.left||A>I.right||K<I.top||K>I.bottom)&&(v(false),y(false));},[]),k=Z.useCallback(L=>{L.preventDefault(),L.stopPropagation(),v(false),y(false),!f&&R(L.dataTransfer.files);},[f,R]),E=Z.useCallback(()=>{f||C.current?.click();},[f]),M=Z.useCallback(L=>{R(L.target.files),L.target.value="";},[R]),N=Z.useCallback(L=>{f||(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),C.current?.click());},[f]),H=b?"error":h?"active":t,D=d?.join(",");return jsxs("div",{ref:g,className:u("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:T,onDragOver:P,onDragLeave:S,onDrop:k,onClick:E,onKeyDown:N,className:u(Bf({variant:H,size:n}),f&&"opacity-50 cursor-not-allowed",!f&&"cursor-pointer focus:outline-none"),"aria-disabled":f,children:[jsx("input",{ref:C,type:"file",accept:D,multiple:m,disabled:f,onChange:M,className:"sr-only",tabIndex:-1}),l||jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[jsx("div",{className:"rounded-full bg-muted p-3",children:jsx(Upload,{className:"h-6 w-6 text-muted-foreground"})}),jsxs("div",{className:"space-y-1",children:[jsx("p",{className:"text-sm font-medium",children:h?"Drop files here":"Drop files or click to upload"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[c&&`Max ${bs(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),x.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:x.map(({file:L,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:L.name}),":"," ",I.map(A=>A.message).join(", ")]},L.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(L=>{let I=Ff(L.file);return jsxs("div",{className:u("flex items-center gap-3 rounded-lg border p-3",L.error&&"border-danger bg-danger/5"),children:[jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:jsx(I,{className:"h-5 w-5 text-muted-foreground"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"truncate text-sm font-medium",children:L.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[bs(L.file.size),L.error&&jsx("span",{className:"ml-2 text-danger",children:L.error})]}),L.progress!==void 0&&L.progress<100&&jsx(ns,{value:L.progress,className:"mt-2 h-1"})]}),jsxs(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:A=>{A.stopPropagation(),a?.(L.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},L.id)})})]})});$f.displayName="FileUpload";var $w=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,Uf=cva("relative rounded-md border border-input shadow-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},shape:{square:"rounded-md",circle:"rounded-full"},interactive:{true:"cursor-pointer hover:scale-110 active:scale-105",false:"cursor-default"}},defaultVariants:{size:"md",shape:"square",interactive:false}}),sa=Z.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...m},f)=>jsx("button",{ref:f,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:u(Uf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?$w:void 0,backgroundSize:n?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...m,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));sa.displayName="ColorSwatch";var jf=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),_f=Z.forwardRef(({value:e,defaultValue:t,onChange:n,layout:r,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",disabled:l,selectedRingColor:c,className:d,style:m,...f},p)=>{let[g,h]=Z.useState(t),v=e??g,b=Z.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),y=x=>x.toLowerCase();return jsx("div",{ref:p,role:"listbox","aria-label":"Color options",className:u(jf({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...m},...f,children:a.map(x=>{let w=v?y(v)===y(x):false;return jsx(sa,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:b,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});_f.displayName="ColorSwatchPicker";var jw=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Wf={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Yf=Z.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=jw,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,m]=Z.useState(e??t),f=Z.useId();Z.useEffect(()=>{e!==void 0&&m(e);},[e]);let p=v=>{m(v),n?.(v);},g=v=>{m(v),n?.(v);},h=v=>{let b=v.target.value.toUpperCase();m(b),n?.(b);};return l==="simple"?jsxs("label",{className:u("relative rounded-md border border-input shadow-sm transition-colors cursor-pointer hover:border-foreground focus-within:border-foreground overflow-hidden",r&&"opacity-50 cursor-not-allowed",Wf[s],i),children:[jsx("input",{type:"color",value:d,onChange:h,disabled:r,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",id:f}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(ht,{children:[jsx(or,{ref:c,disabled:r,className:u("rounded-md border border-input shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",Wf[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(xt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:p,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(Lr,{htmlFor:"color-input",className:"text-xs",children:"Hex Color"}),jsxs("div",{className:"flex gap-2",children:[jsx("div",{className:"h-9 w-9 shrink-0 rounded-md border",style:{backgroundColor:d}}),jsx(HexColorInput,{id:"color-input",color:d,onChange:p,prefixed:true,className:"flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-2 font-mono text-sm uppercase focus:outline-none focus:border-foreground disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Lr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(v=>jsx(sa,{color:v,size:"sm",isSelected:d.toLowerCase()===v.toLowerCase(),onSelect:g},v))})]})]})})]})});Yf.displayName="ColorPicker";var Xf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),al=e=>String(e).padStart(2,"0"),qw=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},Zw=(e,t)=>`${al(e)}:${al(t)}`,qf=Z.forwardRef(({className:e,size:t,value:n,onChange:r,use24Hour:o=true,minuteStep:a=1,showPicker:s=true,minTime:i,maxTime:l,disabled:c,...d},m)=>{let[f,p]=Z.useState(n??""),[g,h]=Z.useState(false);Z.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:v,minutes:b}=qw(f||"00:00"),y=S=>{let k=S.target.value;p(k),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(k)&&r?.(k);},x=(S,k)=>{let E=Math.max(0,Math.min(23,S)),M=Math.max(0,Math.min(59,k)),N=Zw(E,M);p(N),r?.(N);},w=()=>x(v+1,b),C=()=>x(v-1,b),R=()=>x(v,b+a),T=()=>x(v,b-a),P=({value:S,onIncrement:k,onDecrement:E})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:k,disabled:c,children:jsx(ChevronUp,{className:"h-4 w-4"})}),jsx("div",{className:"flex h-10 w-12 items-center justify-center rounded-md bg-muted text-lg font-semibold",children:al(S)}),jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:E,disabled:c,children:jsx(ChevronDown,{className:"h-4 w-4"})})]});return jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:m,type:"time",value:f,onChange:y,disabled:c,className:u(Xf({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(ht,{open:g,onOpenChange:h,children:[jsxs(or,{type:"button",className:"absolute right-1 h-7 w-7 p-0 inline-flex items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(xt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(P,{value:v,onIncrement:w,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(P,{value:b,onIncrement:R,onDecrement:T,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(pe,{variant:"bordered",size:"sm",onClick:()=>{let S=new Date;x(S.getHours(),S.getMinutes());},children:"Now"}),jsx(pe,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});qf.displayName="TimeInput";var Zf=cva("flex h-10 w-full border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),Jw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},eC=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}},sl=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},Qf=(e,t,n)=>{if(!e)return;let r=e.replace(new RegExp(`\\${t}`,"g"),"");r=r.replace(n,"."),r=r.replace(/[^0-9.-]/g,"");let o=parseFloat(r);return isNaN(o)?void 0:o},Jf=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r,onChange:o,currency:a="USD",locale:s="en-US",decimals:i=2,min:l,max:c,showCurrency:d=true,currencyPosition:m="prefix",currencySymbol:f,thousandSeparator:p=",",decimalSeparator:g=".",radius:h="md",disabled:v,placeholder:b,...y},x)=>{let[w,C]=Z.useState(r),[R,T]=Z.useState(""),[P,S]=Z.useState(false),k=n!==void 0?n:w,E=f??eC(a,s);Z.useEffect(()=>{!P&&k!==void 0&&T(sl(k,i,p,g));},[k,i,p,g,P]);let M=I=>{let A=I.target.value;if(!A){T(""),n===void 0&&C(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${p}${g}.-]*$`).test(A))return;T(A);let V=Qf(A,p,g);if(V!==void 0){let F=V;l!==void 0&&V<l&&(F=l),c!==void 0&&V>c&&(F=c),n===void 0&&C(F),o?.(F);}},N=()=>{S(true),k!==void 0&&T(k.toString().replace(".",g));},H=()=>{S(false),T(k!==void 0?sl(k,i,p,g):"");},D=d&&m==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:E}),L=d&&m==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:E});return jsxs("div",{className:"relative flex items-center",children:[D&&jsx("div",{className:"absolute left-3 pointer-events-none",children:D}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:R,onChange:M,onFocus:N,onBlur:H,disabled:v,placeholder:b??`0${g}${"0".repeat(i)}`,className:u(Zf({size:t}),Jw[h],D&&"pl-8",L&&"pr-8","text-right",e),style:{borderColor:P?"var(--color-foreground)":void 0},...y}),L&&jsx("div",{className:"absolute right-3 pointer-events-none",children:L})]})});Jf.displayName="CurrencyInput";var eg=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),il={creditCard:{mask:"#### #### #### ####"},creditCardAmex:{mask:"#### ###### #####"},cvv:{mask:"###"},expiry:{mask:"##/##"},date:{mask:"##/##/####"},dateISO:{mask:"####-##-##"},time:{mask:"##:##"},ip:{mask:"###.###.###.###"},mac:{mask:"AA:AA:AA:AA:AA:AA"},id11:{mask:"###########"},id9:{mask:"#########"},id10:{mask:"##########"},postal5:{mask:"#####"},postal9:{mask:"#####-####"}},rC=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},ur=e=>["#","A","*"].includes(e),hs=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(ur(s)){if(o<e.length){let i=e[o];rC(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},ll=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];ur(o)&&(n+=e[r]);}return n},tg=(e,t)=>e.split("").map(n=>ur(n)?t:n).join(""),oC=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)ur(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,ur(t[i])&&s++;for(;a<t.length&&!ur(t[a]);)a++;return Math.min(a,e.length)},ng=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,mask:a,maskPlaceholder:s="_",showMaskPlaceholder:i=false,includeMaskChars:l=false,disabled:c,placeholder:d,...m},f)=>{let p=typeof a=="string"&&a in il?il[a].mask:a,[g,h]=Z.useState(r),[v,b]=Z.useState(""),[y,x]=Z.useState(false),w=Z.useRef(null),C=n!==void 0?n:g;Z.useImperativeHandle(f,()=>w.current),Z.useEffect(()=>{let S=hs(C,p,true);b(S);},[C,p]);let R=S=>{let k=S.target.value,E=S.target.selectionStart??0,M=k.replace(/[^\w]/g,""),N=hs(M,p,true),H=ll(N,p);b(N),n===void 0&&h(l?N:H),o?.(H,N),requestAnimationFrame(()=>{if(w.current){let D=oC(N,p,E);w.current.setSelectionRange(D,D);}});},T=S=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(S.key)||S.ctrlKey||S.metaKey)return;let k=w.current;if(!k)return;let E=k.selectionStart??0;if(S.key==="Backspace"&&E>0){let M=E-1;for(;M>0&&!ur(p[M]);)M--;let N=ll(v,p),H=0;for(let I=0;I<M&&I<p.length;I++)ur(p[I])&&H++;let D=N.slice(0,Math.max(0,H-1))+N.slice(H),L=hs(D,p,true);b(L),n===void 0&&h(l?L:D),o?.(D,L),S.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(M,M);});}},P=i?tg(p,s):d;return jsx("input",{ref:w,type:"text",value:v,onChange:R,onKeyDown:T,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:P,className:u(eg({size:t}),e),style:{borderColor:y?"var(--color-foreground)":void 0},...m})});ng.displayName="MaskedInput";var cC=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),og=[{code:"AR",name:"Argentina",dialCode:"+54",flag:"\u{1F1E6}\u{1F1F7}",format:"## ####-####"},{code:"AU",name:"Australia",dialCode:"+61",flag:"\u{1F1E6}\u{1F1FA}",format:"### ### ###"},{code:"AT",name:"Austria",dialCode:"+43",flag:"\u{1F1E6}\u{1F1F9}",format:"### #######"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"\u{1F1E7}\u{1F1EA}",format:"### ## ## ##"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"\u{1F1E7}\u{1F1F7}",format:"(##) #####-####"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"\u{1F1E7}\u{1F1EC}",format:"### ### ###"},{code:"CA",name:"Canada",dialCode:"+1",flag:"\u{1F1E8}\u{1F1E6}",format:"(###) ###-####"},{code:"CN",name:"China",dialCode:"+86",flag:"\u{1F1E8}\u{1F1F3}",format:"### #### ####"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"\u{1F1ED}\u{1F1F7}",format:"## ### ####"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"\u{1F1E8}\u{1F1FF}",format:"### ### ###"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"\u{1F1E9}\u{1F1F0}",format:"## ## ## ##"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"\u{1F1EA}\u{1F1EC}",format:"### ### ####"},{code:"FI",name:"Finland",dialCode:"+358",flag:"\u{1F1EB}\u{1F1EE}",format:"## ### ####"},{code:"FR",name:"France",dialCode:"+33",flag:"\u{1F1EB}\u{1F1F7}",format:"# ## ## ## ##"},{code:"DE",name:"Germany",dialCode:"+49",flag:"\u{1F1E9}\u{1F1EA}",format:"#### #######"},{code:"GR",name:"Greece",dialCode:"+30",flag:"\u{1F1EC}\u{1F1F7}",format:"### ### ####"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"\u{1F1ED}\u{1F1F0}",format:"#### ####"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"\u{1F1ED}\u{1F1FA}",format:"## ### ####"},{code:"IN",name:"India",dialCode:"+91",flag:"\u{1F1EE}\u{1F1F3}",format:"##### #####"},{code:"IL",name:"Israel",dialCode:"+972",flag:"\u{1F1EE}\u{1F1F1}",format:"##-###-####"},{code:"IT",name:"Italy",dialCode:"+39",flag:"\u{1F1EE}\u{1F1F9}",format:"### ### ####"},{code:"JP",name:"Japan",dialCode:"+81",flag:"\u{1F1EF}\u{1F1F5}",format:"##-####-####"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"\u{1F1F2}\u{1F1FD}",format:"### ### ####"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"\u{1F1F3}\u{1F1F1}",format:"## ########"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"\u{1F1F3}\u{1F1FF}",format:"## ### ####"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"\u{1F1F3}\u{1F1EC}",format:"### ### ####"},{code:"NO",name:"Norway",dialCode:"+47",flag:"\u{1F1F3}\u{1F1F4}",format:"### ## ###"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"\u{1F1F5}\u{1F1F0}",format:"### #######"},{code:"PL",name:"Poland",dialCode:"+48",flag:"\u{1F1F5}\u{1F1F1}",format:"### ### ###"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"\u{1F1F5}\u{1F1F9}",format:"### ### ###"},{code:"RO",name:"Romania",dialCode:"+40",flag:"\u{1F1F7}\u{1F1F4}",format:"### ### ###"},{code:"RU",name:"Russia",dialCode:"+7",flag:"\u{1F1F7}\u{1F1FA}",format:"(###) ###-##-##"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"\u{1F1F8}\u{1F1E6}",format:"## ### ####"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"\u{1F1F7}\u{1F1F8}",format:"## ### ####"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"\u{1F1F8}\u{1F1EC}",format:"#### ####"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"\u{1F1F8}\u{1F1F0}",format:"### ### ###"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"\u{1F1F8}\u{1F1EE}",format:"## ### ###"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"\u{1F1FF}\u{1F1E6}",format:"## ### ####"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"\u{1F1F0}\u{1F1F7}",format:"##-####-####"},{code:"ES",name:"Spain",dialCode:"+34",flag:"\u{1F1EA}\u{1F1F8}",format:"### ### ###"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"\u{1F1F8}\u{1F1EA}",format:"##-### ## ##"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"\u{1F1E8}\u{1F1ED}",format:"## ### ## ##"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"\u{1F1F9}\u{1F1FC}",format:"### ### ###"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"\u{1F1F9}\u{1F1F7}",format:"(###) ### ## ##"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"\u{1F1FA}\u{1F1E6}",format:"## ### ## ##"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"\u{1F1E6}\u{1F1EA}",format:"## ### ####"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"\u{1F1EC}\u{1F1E7}",format:"#### ### ####"},{code:"US",name:"United States",dialCode:"+1",flag:"\u{1F1FA}\u{1F1F8}",format:"(###) ###-####"}],xs=(e,t)=>{let n=e.replace(/\D/g,""),r="",o=0;for(let a=0;a<t.length&&o<n.length;a++)t[a]==="#"?(r+=n[o],o++):r+=t[a];return r},dC=e=>e.replace(/#/g,"_"),ag=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=og,showCountrySelect:c=true,showDialCode:d=false,disabled:m,placeholder:f,radius:p="md",...g},h)=>{let[v,b]=Z.useState(r),[y,x]=Z.useState(a??s),[w,C]=Z.useState(false),[R,T]=Z.useState(false),[P,S]=Z.useState(false),[k,E]=Z.useState({top:0,left:0,width:0}),M=Z.useRef(null),N=Z.useRef(null),H=n!==void 0?n:v,D=a??y,L=l.find(G=>G.code===D)??l[0],I=xs(H,L.format);Z.useEffect(()=>{S(true);},[]),Z.useEffect(()=>{if(R&&M.current){let G=M.current.getBoundingClientRect();E({top:G.bottom+4,left:G.left,width:Math.max(G.width,280)});}},[R]),Z.useEffect(()=>{if(!R)return;let G=j=>{M.current&&!M.current.contains(j.target)&&N.current&&!N.current.contains(j.target)&&T(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[R]),Z.useEffect(()=>{if(!R)return;let G=j=>{j.key==="Escape"&&T(false);};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[R]),Z.useEffect(()=>{if(!R)return;let G=j=>{N.current?.contains(j.target)||T(false);};return window.addEventListener("scroll",G,true),()=>window.removeEventListener("scroll",G,true)},[R]);let A=G=>{let O=G.target.value.replace(/\D/g,"");n===void 0&&b(O);let B=xs(O,L.format),_=`${L.dialCode} ${B}`;o?.(O,_,L);},K=G=>{let j=l.find(_=>_.code===G);if(!j)return;a===void 0&&x(G),i?.(j);let O=xs(H,j.format),B=`${j.dialCode} ${O}`;o?.(H,B,j),T(false);},V=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",F=w||R;return jsxs("div",{className:u("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[p],m&&"cursor-not-allowed opacity-50"),style:{borderColor:F?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:M,type:"button",disabled:m,onClick:()=>T(!R),className:u("flex items-center justify-between bg-transparent px-3 py-2 text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50","w-[100px] shrink-0 border-r",V),style:{borderColor:F?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:L.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:L.dialCode})]}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",R&&"rotate-180")})]}),P&&R&&Wa.createPortal(jsx("div",{ref:N,className:"fixed z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:k.top,left:k.left,minWidth:k.width},children:jsx(Oe,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(G=>jsxs("div",{role:"option","aria-selected":G.code===D,onClick:()=>K(G.code),className:"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:G.code===D&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:G.flag}),jsx("span",{className:"flex-1",children:G.name}),jsx("span",{className:"text-xs text-muted-foreground",children:G.dialCode})]})]},G.code))})})}),document.body)]}),jsxs("div",{className:"relative flex-1",children:[d&&!c&&jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:L.dialCode}),jsx("input",{ref:h,type:"tel",inputMode:"tel",value:I,onChange:A,onFocus:()=>C(true),onBlur:()=>C(false),disabled:m,placeholder:f??dC(L.format),className:u("flex h-10 w-full bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t==="sm"&&"h-8 px-2 text-xs",t==="lg"&&"h-12 px-4 text-base",d&&!c&&"pl-12",e),...g})]})]})});ag.displayName="PhoneInput";var ig=cva("flex items-center justify-between w-full px-4 py-3 border-b bg-background",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-background border-border",ghost:"bg-transparent border-transparent",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-border"},size:{sm:"h-12 px-3 py-2",md:"h-14 px-4 py-3",lg:"h-16 px-6 py-4"},sticky:{true:"sticky top-0 z-50",false:""}},defaultVariants:{variant:"bordered",size:"md",sticky:false}}),lg=Z.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=Z.useState(false),m={sm:"hidden sm:flex",md:"hidden md:flex",lg:"hidden lg:flex"}[s],f={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:u(ig({variant:t,size:n,sticky:r,className:e})),...i,children:[jsxs("div",{className:"flex items-center justify-between w-full",children:[o&&jsx("div",{className:"flex-shrink-0",children:o}),jsx("div",{className:u("items-center gap-4 flex-1 justify-end",m),children:a}),jsx("button",{type:"button",className:u("p-2 rounded-md hover:bg-accent hover:text-accent-foreground transition-colors",f),onClick:()=>d(!c),"aria-label":c?"Close menu":"Open menu","aria-expanded":c,children:c?jsx(X,{className:"h-5 w-5"}):jsx(Menu,{className:"h-5 w-5"})})]}),c&&jsx("div",{className:u("absolute top-full left-0 right-0 flex flex-col gap-2 p-4 bg-background border-b border-border shadow-lg",f),children:a})]})});lg.displayName="Navbar";var cg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center gap-2 font-semibold text-lg",e),...t}));cg.displayName="NavbarBrand";var dg=Z.forwardRef(({className:e,justify:t="start",...n},r)=>{let o={start:"justify-start",center:"justify-center",end:"justify-end"}[t];return jsx("div",{ref:r,className:u("flex items-center gap-4",o,e),...n})});dg.displayName="NavbarContent";var ug=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:u("flex items-center",t&&"text-primary font-medium",e),...n}));ug.displayName="NavbarItem";var mg=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("a",{ref:r,className:u("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...n}));mg.displayName="NavbarLink";var bC={none:"",hover:"hover:underline",always:"underline"},pg={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},gg=Z.forwardRef(({className:e,color:t="primary",underline:n="hover",isExternal:r,showExternalIcon:o=true,isDisabled:a,children:s,style:i,...l},c)=>{let d=r?{target:"_blank",rel:"noopener noreferrer"}:{},m=t in pg,f=m?i:{color:t,...i};return jsxs("a",{ref:c,className:u("inline-flex items-center gap-1 underline-offset-4 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",m&&pg[t],bC[n],a&&"pointer-events-none opacity-50",e),style:f,"aria-disabled":a,...d,...l,children:[s,r&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});gg.displayName="Link";var bg=cva("fixed z-50 transition-all duration-300",{variants:{position:{"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","bottom-center":"bottom-6 left-1/2 -translate-x-1/2"}},defaultVariants:{position:"bottom-right"}}),vg=Z.forwardRef(({className:e,position:t,threshold:n=400,icon:r,behavior:o="smooth",variant:a="solid",color:s="default",size:i="md",radius:l="full",target:c,onVisibilityChange:d,onClick:m,...f},p)=>{let[g,h]=Z.useState(false);Z.useEffect(()=>{let y=c?.current||window,x=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return y.addEventListener("scroll",x,{passive:true}),x(),()=>{y.removeEventListener("scroll",x);}},[n,c,g,d]);let v=y=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),m?.(y);},b=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:u(bg({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(pe,{ref:p,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:v,"aria-label":"Back to top",className:"shadow-lg",...f,children:r||jsx(ArrowUp,{className:b})})})});vg.displayName="BackTop";var TC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),MC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),hg=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),ws=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),xg=Z.createContext(null),pr=()=>{let e=Z.useContext(xg);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},yg=Z.createContext(null),la=()=>{let e=Z.useContext(yg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},dl=Z.createContext(null),Rg=Z.createContext(null),wg=Z.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=Z.useState(null);return jsx(xg.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:n},children:jsx("div",{ref:o,role:"menubar",className:u("flex h-10 items-center space-x-1 border bg-background p-1",TC({radius:n}),e),...r,children:t})})});wg.displayName="Menubar";var Cg=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=pr(),r=Z.useId(),o=Z.useRef(null),a=t===r,s=Z.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(yg.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};Cg.displayName="MenubarMenu";var Tg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Tg.displayName="MenubarGroup";var Mg=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Wa.createPortal(e,t||document.body):null};Mg.displayName="MenubarPortal";var Ng=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(dl.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Ng.displayName="MenubarSub";var kg=Z.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Rg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));kg.displayName="MenubarRadioGroup";var Pg=Z.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=pr(),{menuId:l,triggerRef:c,open:d,onOpenChange:m}=la(),f=g=>{t?.(g),m(!d);},p=g=>{n?.(g),a&&a!==l&&(s(l),document.activeElement instanceof HTMLElement&&document.activeElement.blur());};return jsx("button",{ref:g=>{c.current=g,typeof o=="function"?o(g):o&&(o.current=g);},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"data-state":d?"open":"closed",className:u("flex cursor-default select-none items-center px-3 py-1.5 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",MC({radius:i}),e),onClick:f,onMouseEnter:p,...r})});Pg.displayName="MenubarTrigger";var Eg=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=pr(),l=Z.useContext(dl);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:m}=l,f=g=>{r?.(g),d(true);},p=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{m.current=g,typeof s=="function"?s(g):s&&(s.current=g);},role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"data-state":c?"open":"closed",className:u("flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",ws({radius:i}),t&&"pl-8",e),onMouseEnter:f,onMouseLeave:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Eg.displayName="MenubarSubTrigger";var Sg=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=pr(),i=Z.useContext(dl);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!d.current||!h.current)return;(()=>{if(!d.current||!h.current)return;let x=d.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),C=x.top,R=x.right+t;R+w.width>window.innerWidth&&(R=x.left-w.width-t),f({top:C,left:R});})();},[l,t,d]);let v=y=>{n?.(y),c(true);},b=y=>{r?.(y),c(false);};return !p||!l?null:Wa.createPortal(jsx("div",{ref:y=>{h.current=y,typeof a=="function"?a(y):a&&(a.current=y);},role:"menu","data-state":l?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",hg({radius:s}),e),style:{top:m.top,left:m.left},onMouseEnter:v,onMouseLeave:b,...o}),document.body)});Sg.displayName="MenubarSubContent";var Lg=Z.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=pr(),{triggerRef:l,open:c,onOpenChange:d}=la(),[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);return Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!c||!l.current||!h.current)return;let v=()=>{if(!l.current||!h.current)return;let b=l.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=b.bottom+r,w=b.left+n;t==="center"?w=b.left+b.width/2-y.width/2:t==="end"&&(w=b.right-y.width-n),f({top:x,left:w});};return v(),window.addEventListener("resize",v),window.addEventListener("scroll",v,true),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,true);}},[c,t,n,r,l]),Z.useEffect(()=>{if(!c)return;let v=b=>{let y=b.target;h.current&&!h.current.contains(y)&&l.current&&!l.current.contains(y)&&d(false);};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c,d,l]),Z.useEffect(()=>{if(!c)return;let v=b=>{b.key==="Escape"&&d(false);};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c,d]),!p||!c?null:Wa.createPortal(jsx("div",{ref:v=>{h.current=v,typeof s=="function"?s(v):s&&(s.current=v);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[12rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",hg({radius:i}),e),style:{top:m.top,left:m.left},...a,children:o}),document.body)});Lg.displayName="MenubarContent";var Dg=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=pr(),{onOpenChange:l}=la(),c=d=>{if(n){d.preventDefault();return}o?.(d),r?.(),l(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",ws({radius:i}),t&&"pl-8",!n&&"cursor-pointer",e),onClick:c,...a})});Dg.displayName="MenubarItem";var Hg=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=pr(),{onOpenChange:c}=la(),d=m=>{if(o){m.preventDefault();return}a?.(m),r?.(!n),c(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",ws({radius:l}),!o&&"cursor-pointer",e),onClick:d,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});Hg.displayName="MenubarCheckboxItem";var Ig=Z.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=pr(),{onOpenChange:l}=la(),c=Z.useContext(Rg),d=c?.value===n,m=f=>{if(r){f.preventDefault();return}o?.(f),c?.onValueChange(n),l(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":d,tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-state":d?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",ws({radius:i}),!r&&"cursor-pointer",e),onClick:m,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d&&jsx(Circle,{className:"h-2 w-2 fill-current"})}),t]})});Ig.displayName="MenubarRadioItem";var ul=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));ul.displayName="MenubarSection";var NC=ul,Vg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Vg.displayName="MenubarSeparator";var Ag=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Ag.displayName="MenubarShortcut";var zg=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center",vertical:"flex-col"},size:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"horizontal",size:"md"}}),Og=Z.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=Z.Children.toArray(o);return jsx("div",{ref:s,className:u(zg({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>Z.isValidElement(l)?Z.cloneElement(l,{...l.props,stepNumber:c+1,status:l.props.status||(c<r?"completed":c===r?"current":"upcoming"),isLast:c===i.length-1,orientation:t,size:n}):l)})});Og.displayName="Steps";var Bg=cva("flex items-center",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col items-start"},size:{sm:"gap-2",md:"gap-3",lg:"gap-4"}},defaultVariants:{orientation:"horizontal",size:"md"}}),PC=cva("flex items-center justify-center rounded-full font-medium transition-colors",{variants:{status:{completed:"bg-primary text-primary-foreground",current:"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2 ring-offset-background",upcoming:"bg-muted text-muted-foreground border-2 border-muted-foreground/30"},size:{sm:"h-6 w-6 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"}},defaultVariants:{status:"upcoming",size:"md"}}),EC=cva("bg-muted transition-colors",{variants:{orientation:{horizontal:"h-0.5 flex-1 min-w-8",vertical:"w-0.5 min-h-8 ml-4"},status:{completed:"bg-primary",current:"bg-muted",upcoming:"bg-muted"}},defaultVariants:{orientation:"horizontal",status:"upcoming"}}),Fg=Z.forwardRef(({className:e,orientation:t="horizontal",size:n="md",title:r,description:o,icon:a,status:s="upcoming",stepNumber:i,isLast:l,...c},d)=>jsxs("div",{ref:d,className:u(Bg({orientation:t,size:n,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:u("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:u(PC({status:s,size:n})),children:s==="completed"?jsx(Check,{className:n==="sm"?"h-3 w-3":n==="lg"?"h-5 w-5":"h-4 w-4"}):a||i}),(r||o)&&jsxs("div",{className:"flex flex-col",children:[r&&jsx("span",{className:u("font-medium",n==="sm"&&"text-sm",n==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:r}),o&&jsx("span",{className:u("text-muted-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm",n==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:u(EC({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));Fg.displayName="Step";var $g=cva("flex flex-col select-none",{variants:{variant:{default:"",bordered:"rounded-lg border",filled:"bg-muted/30 rounded-lg p-2"},size:{sm:"[--tree-indent:16px] [--tree-item-height:28px] text-xs",md:"[--tree-indent:20px] [--tree-item-height:32px] text-sm",lg:"[--tree-indent:24px] [--tree-item-height:40px] text-base"}},defaultVariants:{variant:"default",size:"md"}}),Gg=cva("flex items-center py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm min-h-[var(--tree-item-height)]",md:"py-1.5 px-2 text-sm min-h-[var(--tree-item-height)]",lg:"py-2 px-3 text-base min-h-[var(--tree-item-height)]"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),Ug=Z.createContext(null),zC=()=>{let e=Z.useContext(Ug);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},OC=({checked:e,indeterminate:t,disabled:n,onClick:r})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:n,onClick:o=>{o.stopPropagation(),n||r(o);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",n&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),jg=({node:e,level:t,isLast:n=false,parentIsLastPath:r=[]})=>{let{expandedKeys:o,toggleExpand:a,selectedKeys:s,handleSelect:i,selectable:l,checkedKeys:c,halfCheckedKeys:d,handleCheck:m,checkable:f,draggable:p,draggedNode:g,setDraggedNode:h,dragOverKey:v,dragOverPosition:b,setDragOver:y,handleDrop:x,allowDrop:w,onDragStart:C,onDragOver:R,onDragEnter:T,onDragLeave:P,onDragEnd:S,showLine:k,showIcon:E,showHandle:M,dragIcon:N,icon:H,leafIcon:D,folderIcon:L,folderOpenIcon:I,blockNode:A,disabled:K,size:V,getAllKeys:F}=zC(),z=e.children&&e.children.length>0,G=e.isLeaf??!z,j=o.has(e.key),O=s.has(e.key),B=c.has(e.key),_=d.has(e.key),U=g?.key===e.key,$=v===e.key,X=!!(K||e.disabled),te=l&&e.selectable!==false,Y=f&&e.checkable!==false,ve=Z.useMemo(()=>X?false:typeof p=="boolean"?p:typeof p=="function"?p(e):p&&typeof p=="object"?p.nodeDraggable?p.nodeDraggable(e):true:false,[p,e,X]),Q=Z.useMemo(()=>N!==void 0?N:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[N,p]),oe=Z.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:j,isLeaf:G}):H:G?D:j?I:L,[e.icon,H,j,G,D,L,I]),Te=q=>{if(!ve)return;q.stopPropagation(),q.dataTransfer.effectAllowed="move";let J=q.currentTarget,ee=J.cloneNode(true),Ae=document.documentElement.classList.contains("dark"),Le=Ae?"#0a0a0a":"#ffffff",wn=Ae?"#27272a":"#e4e4e7";ee.style.cssText=`
|
|
44
44
|
position: fixed;
|
|
45
45
|
top: -9999px;
|
|
46
46
|
left: -9999px;
|