@craftzbay/ui 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const aa=require("clsx"),oa=require("tailwind-merge"),l=require("react"),p=require("lucide-react"),e=require("react/jsx-runtime"),ia=require("@radix-ui/react-accordion"),Se=require("class-variance-authority"),la=require("@radix-ui/react-avatar"),cr=require("@radix-ui/react-slot"),ca=require("@radix-ui/react-checkbox"),da=require("@radix-ui/react-popover"),de=require("cmdk"),ua=require("@radix-ui/react-dialog"),fa=require("@radix-ui/react-context-menu"),ma=require("@radix-ui/react-dropdown-menu"),gn=require("react-day-picker"),xa=require("@radix-ui/react-label"),pn=require("react-hook-form"),ga=require("@radix-ui/react-select"),pa=require("@radix-ui/react-progress"),ha=require("@radix-ui/react-radio-group"),ba=require("@radix-ui/react-scroll-area"),va=require("@radix-ui/react-separator"),wa=require("@radix-ui/react-slider"),ja=require("@radix-ui/react-switch"),ya=require("@radix-ui/react-tabs"),Na=require("@radix-ui/react-toast"),Ca=require("@radix-ui/react-tooltip");function ae(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>n[r]})}}return t.default=n,Object.freeze(t)}const Sa=ae(l),vt=ae(ia),sn=ae(la),Kn=ae(ca),Z=ae(da),H=ae(ua),fe=ae(fa),me=ae(ma),ka=ae(xa),ue=ae(ga),Yn=ae(pa),dn=ae(ha),gt=ae(ba),Ta=ae(va),Mt=ae(wa),Qn=ae(ja),$t=ae(ya),nt=ae(Na),wt=ae(Ca);function x(...n){return oa.twMerge(aa.clsx(n))}let Jn=0;function Da(n="ds"){return Jn+=1,`${n}-${Jn}`}function dr(n){const[t,r]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return l.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(n),a=o=>r(o.matches);return r(s.matches),s.addEventListener("change",a),()=>s.removeEventListener("change",a)},[n]),t}function Ra(){return dr("(prefers-reduced-motion: reduce)")}const Qe={toasts:[],listeners:new Set,emit(){for(const n of this.listeners)n(this.toasts)},push(n){const t=n.id??`t_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,r={open:!0,duration:5e3,variant:"default",...n,id:t};return this.toasts=[r,...this.toasts].slice(0,3),this.emit(),t},dismiss(n){this.toasts=this.toasts.map(t=>t.id===n?{...t,open:!1}:t),this.emit()},remove(n){this.toasts=this.toasts.filter(t=>t.id!==n),this.emit()}};function Ia(){const[n,t]=l.useState(()=>[...Qe.toasts]);l.useEffect(()=>{const o=i=>t([...i]);return Qe.listeners.add(o),()=>{Qe.listeners.delete(o)}},[]);const r=l.useCallback(o=>Qe.push(o),[]),s=l.useCallback(o=>Qe.dismiss(o),[]),a=l.useCallback(o=>Qe.remove(o),[]);return{toasts:n,push:r,dismiss:s,remove:a}}const Ma=n=>Qe.push(n),Pa=Object.freeze(Object.defineProperty({__proto__:null,AlertCircle:p.AlertCircle,AlertTriangle:p.AlertTriangle,ArrowDown:p.ArrowDown,ArrowLeft:p.ArrowLeft,ArrowRight:p.ArrowRight,ArrowUp:p.ArrowUp,ArrowUpDown:p.ArrowUpDown,Bell:p.Bell,Calendar:p.Calendar,Check:p.Check,CheckCircle2:p.CheckCircle2,ChevronDown:p.ChevronDown,ChevronLeft:p.ChevronLeft,ChevronRight:p.ChevronRight,ChevronUp:p.ChevronUp,ChevronsLeft:p.ChevronsLeft,ChevronsRight:p.ChevronsRight,ChevronsUpDown:p.ChevronsUpDown,Circle:p.Circle,Copy:p.Copy,CornerDownLeft:p.CornerDownLeft,CreditCard:p.CreditCard,Download:p.Download,Edit2:p.Edit2,Ellipsis:p.Ellipsis,ExternalLink:p.ExternalLink,Eye:p.Eye,EyeOff:p.EyeOff,Filter:p.Filter,Folder:p.Folder,GripVertical:p.GripVertical,HelpCircle:p.HelpCircle,Home:p.Home,Info:p.Info,Link2:p.Link2,Loader2:p.Loader2,Lock:p.Lock,Mail:p.Mail,Menu:p.Menu,Minus:p.Minus,Moon:p.Moon,MoreHorizontal:p.MoreHorizontal,Plus:p.Plus,Search:p.Search,Settings:p.Settings,Sun:p.Sun,Trash2:p.Trash2,Upload:p.Upload,User:p.User,Users:p.Users,X:p.X,XCircle:p.XCircle},Symbol.toStringTag,{value:"Module"})),za=vt.Root,ur=l.forwardRef(function({className:t,...r},s){return e.jsx(vt.Item,{ref:s,className:x("border-b border-border",t),...r})});ur.displayName="AccordionItem";const fr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsx(vt.Header,{className:"flex",children:e.jsxs(vt.Trigger,{ref:a,className:x("flex flex-1 items-center justify-between gap-2 py-4 text-left text-sm font-medium text-foreground","outline-none transition-colors duration-[var(--duration-fast)]","hover:text-accent","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","[&[data-state=open]>svg]:rotate-180",t),...s,children:[r,e.jsx(p.ChevronDown,{className:"size-4 shrink-0 text-foreground-subtle transition-transform duration-[var(--duration-base)]","aria-hidden":!0})]})})});fr.displayName="AccordionTrigger";const mr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsx(vt.Content,{ref:a,className:x("overflow-hidden text-sm text-foreground-muted","data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"),...s,children:e.jsx("div",{className:x("pb-4 pt-0",t),children:r})})});mr.displayName="AccordionContent";const Ea=Se.cva(["relative flex w-full gap-3 rounded-lg border p-4","text-sm"],{variants:{variant:{default:"border-border bg-background-subtle text-foreground",info:"border-info-border-soft bg-info-soft text-info-text",success:"border-success-border-soft bg-success-soft text-success-text",warning:"border-warning-border-soft bg-warning-soft text-warning-text",danger:"border-danger-border-soft bg-danger-soft text-danger-text"}},defaultVariants:{variant:"default"}}),Aa={default:null,info:e.jsx(p.Info,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0}),success:e.jsx(p.CheckCircle2,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0}),warning:e.jsx(p.AlertTriangle,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0}),danger:e.jsx(p.XCircle,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0})},Ct=l.forwardRef(function({className:t,variant:r="default",title:s,dismissible:a,onDismiss:o,icon:i,children:d,...u},c){const[g,m]=l.useState(!0);if(!g)return null;const f=()=>{m(!1),o==null||o()},b=i===!1?null:i??Aa[r??"default"];return e.jsxs("div",{ref:c,role:"alert",className:x(Ea({variant:r}),t),...u,children:[b,e.jsxs("div",{className:"flex-1 min-w-0",children:[s&&e.jsx("h5",{className:"font-medium leading-tight mb-1",children:s}),e.jsx("div",{className:"text-sm leading-relaxed [&_p]:leading-relaxed",children:d})]}),a&&e.jsx("button",{type:"button","aria-label":"Dismiss",onClick:f,className:x("inline-flex size-6 shrink-0 items-center justify-center rounded-md","hover:bg-current/10 outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"),children:e.jsx(p.X,{className:"size-3.5","aria-hidden":!0})})]})});Ct.displayName="Alert";const xr={xs:"size-5 text-[10px]",sm:"size-6 text-xs",md:"size-8 text-xs",lg:"size-10 text-sm",xl:"size-12 text-base"},La=Se.cva(["relative inline-flex shrink-0 overflow-hidden rounded-full","bg-background-muted text-foreground-muted"],{variants:{size:xr},defaultVariants:{size:"md"}}),Oa={online:"bg-success",busy:"bg-danger",away:"bg-warning",offline:"bg-foreground-subtle"},Re=l.forwardRef(function({className:t,size:r,src:s,alt:a,fallback:o,status:i,...d},u){return e.jsxs(sn.Root,{ref:u,className:x(La({size:r}),t),...d,children:[s&&e.jsx(sn.Image,{src:s,alt:a??"",className:"aspect-square size-full object-cover"}),e.jsx(sn.Fallback,{delayMs:s?200:0,className:"flex size-full items-center justify-center bg-background-muted font-medium uppercase",children:o??"?"}),i&&e.jsx("span",{"aria-label":`Status: ${i}`,className:x("absolute bottom-0 right-0 block size-1/4 rounded-full ring-2 ring-background",Oa[i])})]})});Re.displayName="Avatar";const gr=l.forwardRef(function({max:t=4,size:r="md",className:s,children:a,...o},i){const d=Array.isArray(a)?a:[a],u=d.slice(0,t),c=d.length-u.length;return e.jsxs("div",{ref:i,className:x("flex items-center -space-x-2",s),...o,children:[u.map((g,m)=>e.jsx("div",{className:"ring-2 ring-background rounded-full",children:g},m)),c>0&&e.jsxs("div",{className:x("inline-flex items-center justify-center rounded-full bg-background-muted text-foreground-muted ring-2 ring-background",xr[r],"font-medium"),"aria-label":`${c} more`,children:["+",c]})]})});gr.displayName="AvatarGroup";const Fa=Se.cva(["inline-flex items-center gap-1 rounded-full px-2 py-0.5","text-xs font-medium whitespace-nowrap"],{variants:{variant:{subtle:"",outline:"border bg-transparent"},tone:{neutral:"",accent:"",success:"",warning:"",danger:"",info:""}},compoundVariants:[{variant:"subtle",tone:"neutral",class:"bg-background-muted text-foreground-muted"},{variant:"subtle",tone:"accent",class:"bg-accent-soft text-on-accent-soft"},{variant:"subtle",tone:"success",class:"bg-success-soft text-success-text"},{variant:"subtle",tone:"warning",class:"bg-warning-soft text-warning-text"},{variant:"subtle",tone:"danger",class:"bg-danger-soft text-danger-text"},{variant:"subtle",tone:"info",class:"bg-info-soft text-info-text"},{variant:"outline",tone:"neutral",class:"border-border text-foreground-muted"},{variant:"outline",tone:"accent",class:"border-accent text-accent"},{variant:"outline",tone:"success",class:"border-success-border-soft text-success-text"},{variant:"outline",tone:"warning",class:"border-warning-border-soft text-warning-text"},{variant:"outline",tone:"danger",class:"border-danger-border-soft text-danger-text"},{variant:"outline",tone:"info",class:"border-info-border-soft text-info-text"}],defaultVariants:{variant:"subtle",tone:"neutral"}}),_a={neutral:"bg-foreground-subtle",accent:"bg-accent",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"},Ee=l.forwardRef(function({className:t,variant:r,tone:s="neutral",dot:a,children:o,...i},d){return e.jsxs("span",{ref:d,className:x(Fa({variant:r,tone:s}),t),...i,children:[a&&e.jsx("span",{"aria-hidden":!0,className:x("inline-block size-1.5 rounded-full",_a[s??"neutral"])}),o]})});Ee.displayName="Badge";const hn=l.forwardRef(function({items:t,maxItems:r=4,renderLink:s,className:a,...o},i){const u=t.length>r?[t[0],{collapsed:!0},...t.slice(-2)]:t;return e.jsx("nav",{ref:i,"aria-label":"Breadcrumb",className:x("text-sm",a),...o,children:e.jsx("ol",{className:"flex flex-wrap items-center gap-1.5 text-foreground-subtle",children:u.map((c,g)=>{const m=g===u.length-1;if("collapsed"in c)return e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx(p.MoreHorizontal,{className:"size-4","aria-hidden":!0}),e.jsx(p.ChevronRight,{className:"size-3.5","aria-hidden":!0})]},`ellipsis-${g}`);const f=c,b=m?e.jsx("span",{"aria-current":"page",className:"font-medium text-foreground",children:f.label}):f.href?s?s(f.href,f.label):e.jsx("a",{href:f.href,className:"hover:text-foreground transition-colors duration-[var(--duration-fast)] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",children:f.label}):e.jsx("span",{children:f.label});return e.jsxs("li",{className:"flex items-center gap-1.5",children:[b,!m&&e.jsx(p.ChevronRight,{className:"size-3.5","aria-hidden":!0})]},g)})})})});hn.displayName="Breadcrumbs";const $a=Se.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-md text-sm font-medium","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{variant:{primary:["bg-accent text-on-accent","hover:bg-accent-700","active:bg-accent-800"],secondary:["bg-background-muted text-foreground border border-border","hover:bg-neutral-200 dark:hover:bg-neutral-800","active:bg-neutral-300 dark:active:bg-neutral-700"],outline:["border border-border bg-transparent text-foreground","hover:bg-background-muted","active:bg-background-subtle"],ghost:["bg-transparent text-foreground","hover:bg-background-muted","active:bg-background-subtle"],destructive:["bg-danger text-on-danger","hover:bg-danger-700","active:bg-danger-800"],link:["bg-transparent text-accent underline-offset-4 px-0","hover:underline","active:text-accent-700"]},size:{sm:"h-8 px-3 text-xs [&_svg]:size-4",md:"h-9 px-3.5 text-sm [&_svg]:size-4",lg:"h-10 px-4 text-sm [&_svg]:size-5",icon:"h-9 w-9 [&_svg]:size-4"}},compoundVariants:[{variant:"link",size:"sm",class:"h-auto px-0"},{variant:"link",size:"md",class:"h-auto px-0"},{variant:"link",size:"lg",class:"h-auto px-0"}],defaultVariants:{variant:"primary",size:"md"}}),q=l.forwardRef(function({className:t,variant:r,size:s,asChild:a=!1,loading:o=!1,leadingIcon:i,trailingIcon:d,disabled:u,children:c,type:g="button",...m},f){const b=a?cr.Slot:"button",h=u||o;return e.jsxs(b,{ref:f,type:a?void 0:g,"aria-busy":o||void 0,disabled:a?void 0:h,"data-loading":o||void 0,className:x($a({variant:r,size:s}),t),...m,children:[o?e.jsx(p.Loader2,{className:"animate-spin","aria-hidden":"true"}):i,c,!o&&d]})});q.displayName="Button";const Ba=Se.cva(["rounded-lg border bg-card text-card-foreground","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]"],{variants:{variant:{default:"border-border",interactive:"border-border hover:border-border-strong hover:bg-background-subtle cursor-pointer"},padding:{none:"",sm:"p-4",md:"p-5",lg:"p-6"}},defaultVariants:{variant:"default",padding:"md"}}),xe=l.forwardRef(function({className:t,variant:r,padding:s,...a},o){return e.jsx("div",{ref:o,className:x(Ba({variant:r,padding:s}),t),...a})});xe.displayName="Card";const he=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{ref:s,className:x("flex flex-col gap-1 pb-4",t),...r})});he.displayName="CardHeader";const Ce=l.forwardRef(function({className:t,...r},s){return e.jsx("h3",{ref:s,className:x("text-base font-semibold text-foreground leading-tight",t),...r})});Ce.displayName="CardTitle";const ze=l.forwardRef(function({className:t,...r},s){return e.jsx("p",{ref:s,className:x("text-sm text-foreground-muted",t),...r})});ze.displayName="CardDescription";const be=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{ref:s,className:x("text-sm text-foreground",t),...r})});be.displayName="CardContent";const pr=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{ref:s,className:x("flex items-center gap-2 pt-4",t),...r})});pr.displayName="CardFooter";const pt=l.forwardRef(function({className:t,label:r,description:s,error:a,hideLabel:o,id:i,disabled:d,...u},c){const g=l.useId(),m=i??g,f=s?`${m}-desc`:void 0,b=a?`${m}-error`:void 0;return e.jsxs("div",{className:x("flex flex-col gap-1",t),children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(Kn.Root,{ref:c,id:m,disabled:d,"aria-describedby":b??f,"aria-invalid":!!a||void 0,className:x("peer mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm border","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","data-[state=checked]:bg-accent data-[state=checked]:border-accent data-[state=checked]:text-on-accent","data-[state=indeterminate]:bg-accent data-[state=indeterminate]:border-accent data-[state=indeterminate]:text-on-accent","disabled:cursor-not-allowed disabled:opacity-50",a?"border-danger":"border-border-strong"),...u,children:e.jsx(Kn.Indicator,{className:"flex items-center justify-center",children:u.checked==="indeterminate"?e.jsx(p.Minus,{className:"size-3","aria-hidden":!0,strokeWidth:3}):e.jsx(p.Check,{className:"size-3","aria-hidden":!0,strokeWidth:3})})}),r&&e.jsxs("div",{className:x("flex flex-col gap-0.5",o&&"sr-only"),children:[e.jsx("label",{htmlFor:m,className:x("text-sm text-foreground select-none",d&&"opacity-50 cursor-not-allowed"),children:r}),s&&e.jsx("p",{id:f,className:"text-xs text-foreground-subtle",children:s})]})]}),a&&e.jsx("p",{id:b,role:"alert",className:"text-xs text-danger-text",children:a})]})});pt.displayName="Checkbox";const hr=l.forwardRef(function({value:t,onChange:r,options:s,loadOptions:a,label:o,helperText:i,error:d,placeholder:u="Select…",searchPlaceholder:c="Search…",emptyText:g="No results.",clearable:m=!0,disabled:f,size:b="md",className:h},v){const j=l.useId(),w=`${j}-helper`,N=`${j}-error`,[S,y]=l.useState(!1),[k,D]=l.useState(""),[C,T]=l.useState([]),[R,L]=l.useState(!1),E=a?C:s??[];l.useEffect(()=>{if(!a||!S)return;let O=!1;return L(!0),a(k).then(K=>{O||T(K)}).finally(()=>{O||L(!1)}),()=>{O=!0}},[k,S,a]);const F=l.useMemo(()=>E.find(O=>O.value===t)??null,[E,t]),I=b==="sm"?"h-8":b==="lg"?"h-10":"h-9",P=b==="sm"?"px-2.5":b==="lg"?"px-3.5":"px-3",_=l.useCallback(O=>{O.stopPropagation(),r(null)},[r]),W=!!d;return e.jsxs("div",{ref:v,className:x("flex flex-col gap-1.5",h),children:[o&&e.jsx("label",{htmlFor:j,className:"text-sm font-medium text-foreground",children:o}),e.jsxs(Z.Root,{open:S,onOpenChange:y,children:[e.jsx(Z.Trigger,{asChild:!0,children:e.jsxs("button",{id:j,type:"button",role:"combobox","aria-expanded":S,"aria-invalid":W||void 0,"aria-describedby":W?N:i?w:void 0,disabled:f,className:x("inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:opacity-50 disabled:cursor-not-allowed",I,P,W?"border-danger focus-visible:border-danger focus-visible:ring-danger":"border-border focus-visible:border-accent focus-visible:ring-ring"),children:[e.jsx("span",{className:x("truncate",!F&&"text-foreground-subtle"),children:F?F.label:u}),e.jsxs("span",{className:"ml-2 flex items-center gap-1 shrink-0",children:[m&&F&&!f&&e.jsx("span",{role:"button",tabIndex:-1,onClick:_,"aria-label":"Clear selection",className:"text-foreground-subtle hover:text-foreground",children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})}),e.jsx(p.ChevronsUpDown,{className:"size-4 text-foreground-subtle","aria-hidden":!0})]})]})}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:x("z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:e.jsxs(de.Command,{shouldFilter:!a,className:"flex h-full w-full flex-col",children:[e.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[e.jsx(de.Command.Input,{value:k,onValueChange:D,placeholder:c,className:"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-foreground-subtle"}),R&&e.jsx(p.Loader2,{className:"size-4 animate-spin text-foreground-subtle","aria-hidden":!0})]}),e.jsxs(de.Command.List,{className:"max-h-64 overflow-y-auto p-1",children:[E.map(O=>{const K=O.value===t;return e.jsxs(de.Command.Item,{value:O.value,disabled:O.disabled,onSelect:ee=>{r(ee),y(!1)},className:x("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground","data-[selected=true]:bg-background-muted","data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none"),children:[e.jsx("span",{className:"flex-1",children:O.label}),O.description&&e.jsx("span",{className:"text-xs text-foreground-subtle",children:O.description}),K&&e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})]},O.value)}),!R&&E.length===0&&e.jsx(de.Command.Empty,{className:"px-2 py-6 text-center text-sm text-foreground-subtle",children:g})]})]})})})]}),d?e.jsx("p",{id:N,role:"alert",className:"text-xs text-danger-text",children:d}):i?e.jsx("p",{id:w,className:"text-xs text-foreground-subtle",children:i}):null]})});hr.displayName="Combobox";const br=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command,{ref:s,className:x("flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground",t),...r})});br.displayName="Command";const vr=l.forwardRef(function({className:t,...r},s){return e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3","cmdk-input-wrapper":"",children:[e.jsx(p.Search,{className:"size-4 shrink-0 text-foreground-subtle","aria-hidden":!0}),e.jsx(de.Command.Input,{ref:s,className:x("flex h-11 w-full bg-transparent py-3 text-sm outline-none","placeholder:text-foreground-subtle disabled:cursor-not-allowed disabled:opacity-50",t),...r})]})});vr.displayName="CommandInput";const wr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.List,{ref:s,className:x("max-h-[320px] overflow-y-auto p-1",t),...r})});wr.displayName="CommandList";const jr=l.forwardRef(function(t,r){return e.jsx(de.Command.Empty,{ref:r,className:"py-8 text-center text-sm text-foreground-subtle",...t})});jr.displayName="CommandEmpty";const yr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.Group,{ref:s,className:x("overflow-hidden text-foreground p-1","[&_[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-foreground-subtle",t),...r})});yr.displayName="CommandGroup";const Nr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});Nr.displayName="CommandSeparator";const Cr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.Item,{ref:s,className:x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none","data-[selected=true]:bg-background-muted data-[selected=true]:text-foreground","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:size-4 [&_svg]:text-foreground-subtle",t),...r})});Cr.displayName="CommandItem";function Ha({children:n,className:t}){return e.jsx("span",{className:x("ml-auto inline-flex items-center gap-0.5 text-xs tracking-widest text-foreground-subtle font-mono",t),children:n})}function Ua({open:n,onOpenChange:t,children:r,title:s="Command palette"}){return e.jsx(H.Root,{open:n,onOpenChange:t,children:e.jsxs(H.Portal,{children:[e.jsx(H.Overlay,{className:x("fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0")}),e.jsxs(H.Content,{className:x("fixed left-1/2 top-[20%] z-[var(--z-modal)] -translate-x-1/2","w-[calc(100%-2rem)] max-w-[640px] overflow-hidden","rounded-lg border border-border bg-popover text-popover-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95"),children:[e.jsx(H.Title,{className:"sr-only",children:s}),r]})]})})}function Va(n){const[t,r]=l.useState(0);l.useEffect(()=>{const s=a=>{a.key==="k"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),n(!0),r(o=>o+1))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[n])}const Ga=fe.Root,qa=fe.Trigger,Wa=fe.Group,Sr=fe.Portal,Xa=fe.Sub,Ka=fe.RadioGroup,Bt=x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none","data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),kr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(fe.SubTrigger,{ref:a,className:x(Bt,"data-[state=open]:bg-background-muted",t),...s,children:[r,e.jsx(p.ChevronRight,{className:"ml-auto size-4 text-foreground-subtle","aria-hidden":!0})]})});kr.displayName="ContextMenuSubTrigger";const Tr=l.forwardRef(function({className:t,...r},s){return e.jsx(fe.SubContent,{ref:s,className:x("z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",t),...r})});Tr.displayName="ContextMenuSubContent";const Dr=l.forwardRef(function({className:t,...r},s){return e.jsx(Sr,{children:e.jsx(fe.Content,{ref:s,className:x("z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})})});Dr.displayName="ContextMenuContent";const Rr=l.forwardRef(function({className:t,destructive:r,...s},a){return e.jsx(fe.Item,{ref:a,className:x(Bt,r&&"text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text",t),...s})});Rr.displayName="ContextMenuItem";const Ir=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(fe.CheckboxItem,{ref:a,className:x(Bt,"pl-8",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(fe.ItemIndicator,{children:e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})})}),r]})});Ir.displayName="ContextMenuCheckboxItem";const Mr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(fe.RadioItem,{ref:a,className:x(Bt,"pl-8",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(fe.ItemIndicator,{children:e.jsx(p.Circle,{className:"size-2 fill-accent text-accent","aria-hidden":!0})})}),r]})});Mr.displayName="ContextMenuRadioItem";const Pr=l.forwardRef(function({className:t,...r},s){return e.jsx(fe.Label,{ref:s,className:x("px-2 py-1.5 text-xs font-medium text-foreground-subtle",t),...r})});Pr.displayName="ContextMenuLabel";const zr=l.forwardRef(function({className:t,...r},s){return e.jsx(fe.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});zr.displayName="ContextMenuSeparator";function Er({className:n,...t}){return e.jsx("span",{className:x("ml-auto text-xs tracking-widest text-foreground-subtle font-mono",n),...t})}Er.displayName="ContextMenuShortcut";const Ar=me.Root,Lr=me.Trigger,Ya=me.Group,Or=me.Portal,Qa=me.Sub,Ja=me.RadioGroup,Ht=x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none","data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","transition-colors duration-[var(--duration-fast)]"),Fr=l.forwardRef(function({className:t,inset:r,children:s,...a},o){return e.jsxs(me.SubTrigger,{ref:o,className:x(Ht,"data-[state=open]:bg-background-muted",r&&"pl-8",t),...a,children:[s,e.jsx(p.ChevronRight,{className:"ml-auto size-4 text-foreground-subtle","aria-hidden":!0})]})});Fr.displayName="DropdownMenuSubTrigger";const _r=l.forwardRef(function({className:t,...r},s){return e.jsx(me.SubContent,{ref:s,className:x("z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",t),...r})});_r.displayName="DropdownMenuSubContent";const bn=l.forwardRef(function({className:t,sideOffset:r=4,align:s="end",...a},o){return e.jsx(Or,{children:e.jsx(me.Content,{ref:o,sideOffset:r,align:s,className:x("z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1",t),...a})})});bn.displayName="DropdownMenuContent";const $r=l.forwardRef(function({className:t,inset:r,destructive:s,...a},o){return e.jsx(me.Item,{ref:o,className:x(Ht,r&&"pl-8",s&&"text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text",t),...a})});$r.displayName="DropdownMenuItem";const vn=l.forwardRef(function({className:t,children:r,checked:s,...a},o){return e.jsxs(me.CheckboxItem,{ref:o,checked:s,className:x(Ht,"pl-8",t),...a,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(me.ItemIndicator,{children:e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})})}),r]})});vn.displayName="DropdownMenuCheckboxItem";const Br=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(me.RadioItem,{ref:a,className:x(Ht,"pl-8",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(me.ItemIndicator,{children:e.jsx(p.Circle,{className:"size-2 fill-accent text-accent","aria-hidden":!0})})}),r]})});Br.displayName="DropdownMenuRadioItem";const wn=l.forwardRef(function({className:t,inset:r,...s},a){return e.jsx(me.Label,{ref:a,className:x("px-2 py-1.5 text-xs font-medium text-foreground-subtle",r&&"pl-8",t),...s})});wn.displayName="DropdownMenuLabel";const jn=l.forwardRef(function({className:t,...r},s){return e.jsx(me.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});jn.displayName="DropdownMenuSeparator";function Hr({className:n,...t}){return e.jsx("span",{className:x("ml-auto text-xs tracking-widest text-foreground-subtle font-mono",n),...t})}Hr.displayName="DropdownMenuShortcut";const Za=Se.cva(["inline-flex items-center justify-center shrink-0","rounded-md","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none"],{variants:{variant:{primary:"bg-accent text-on-accent hover:bg-accent-700 active:bg-accent-800",secondary:"bg-background-muted text-foreground border border-border hover:bg-neutral-200 dark:hover:bg-neutral-800",outline:"border border-border bg-transparent text-foreground hover:bg-background-muted",ghost:"bg-transparent text-foreground-muted hover:bg-background-muted hover:text-foreground",destructive:"bg-danger text-on-danger hover:bg-danger-700 active:bg-danger-800"},size:{sm:"h-7 w-7 [&_svg]:size-3.5",md:"h-8 w-8 [&_svg]:size-4",lg:"h-10 w-10 [&_svg]:size-5"}},defaultVariants:{variant:"ghost",size:"md"}}),it=l.forwardRef(function({className:t,variant:r,size:s,icon:a,loading:o,disabled:i,type:d="button",...u},c){const g=i||o;return e.jsx("button",{ref:c,type:d,"aria-busy":o||void 0,disabled:g,className:x(Za({variant:r,size:s}),t),...u,children:o?e.jsx(p.Loader2,{className:"animate-spin","aria-hidden":"true"}):a})});it.displayName="IconButton";const eo=Se.cva(["group inline-flex items-center w-full","rounded-md border bg-card text-sm","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","has-disabled:opacity-50 has-disabled:pointer-events-none","focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-background"],{variants:{size:{sm:"h-8 px-2.5 gap-1.5",md:"h-9 px-3 gap-2",lg:"h-10 px-3.5 gap-2"},tone:{default:"border-border focus-within:border-accent focus-within:ring-ring",error:"border-danger focus-within:border-danger focus-within:ring-danger"}},defaultVariants:{size:"md",tone:"default"}}),to=Se.cva(["flex-1 min-w-0 bg-transparent outline-none","placeholder:text-foreground-subtle","text-foreground","disabled:cursor-not-allowed"]),se=l.forwardRef(function({className:t,type:r="text",size:s,tone:a,label:o,helperText:i,error:d,prefix:u,suffix:c,clearable:g,onClear:m,hideLabel:f,id:b,disabled:h,value:v,...j},w){const N=l.useId(),S=b??N,y=`${S}-helper`,k=`${S}-error`,[D,C]=l.useState(!1),T=r==="password"?D?"text":"password":r,R=!!d,L=R?"error":a,E=u??(r==="search"?e.jsx(p.Search,{className:"size-4 text-foreground-subtle","aria-hidden":!0}):null),F=v!==void 0&&v!==""&&v!==null;return e.jsxs("div",{className:x("flex flex-col gap-1.5",t),children:[o&&e.jsx("label",{htmlFor:S,className:x("text-sm font-medium text-foreground",f&&"sr-only"),children:o}),e.jsxs("div",{className:x(eo({size:s,tone:L})),children:[E&&e.jsx("span",{className:"flex items-center text-foreground-subtle [&_svg]:size-4",children:E}),e.jsx("input",{ref:w,id:S,type:T,disabled:h,value:v,"aria-invalid":R||void 0,"aria-describedby":d?k:i?y:void 0,className:x(to()),...j}),g&&F&&e.jsx("button",{type:"button",onClick:m,tabIndex:-1,"aria-label":"Clear input",className:"flex items-center text-foreground-subtle hover:text-foreground",children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})}),r==="password"&&e.jsx("button",{type:"button",onClick:()=>C(I=>!I),tabIndex:-1,"aria-label":D?"Hide password":"Show password","aria-pressed":D,className:"flex items-center text-foreground-subtle hover:text-foreground",children:D?e.jsx(p.EyeOff,{className:"size-4","aria-hidden":!0}):e.jsx(p.Eye,{className:"size-4","aria-hidden":!0})}),c&&e.jsx("span",{className:"flex items-center text-foreground-subtle [&_svg]:size-4",children:c})]}),d?e.jsx("p",{id:k,role:"alert",className:"text-xs text-danger-text",children:d}):i?e.jsx("p",{id:y,className:"text-xs text-foreground-subtle",children:i}):null]})});se.displayName="Input";const Ut=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:s,className:x("w-full caption-bottom text-sm border-collapse",t),...r})})});Ut.displayName="Table";const Vt=l.forwardRef(function({className:t,...r},s){return e.jsx("thead",{ref:s,className:x("sticky top-0 z-10 bg-background-subtle text-foreground-muted","[&_tr]:border-b [&_tr]:border-border",t),...r})});Vt.displayName="TableHeader";const Gt=l.forwardRef(function({className:t,...r},s){return e.jsx("tbody",{ref:s,className:x("[&_tr:last-child]:border-0",t),...r})});Gt.displayName="TableBody";const Ur=l.forwardRef(function({className:t,...r},s){return e.jsx("tfoot",{ref:s,className:x("border-t border-border bg-background-subtle font-medium",t),...r})});Ur.displayName="TableFooter";const Ge=l.forwardRef(function({className:t,selected:r,...s},a){return e.jsx("tr",{ref:a,"data-selected":r||void 0,className:x("border-b border-border transition-colors duration-[var(--duration-fast)]","hover:bg-background-subtle","data-[selected]:bg-accent-soft data-[selected]:hover:bg-accent-soft",t),...s})});Ge.displayName="TableRow";const qe=l.forwardRef(function({className:t,...r},s){return e.jsx("th",{ref:s,className:x("h-10 px-3 text-left align-middle text-xs font-medium uppercase tracking-wide text-foreground-subtle","[&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0",t),...r})});qe.displayName="TableHead";const He=l.forwardRef(function({className:t,...r},s){return e.jsx("td",{ref:s,className:x("px-3 py-3 align-middle text-foreground",t),...r})});He.displayName="TableCell";const Vr=l.forwardRef(function({className:t,...r},s){return e.jsx("caption",{ref:s,className:x("mt-4 text-sm text-foreground-subtle",t),...r})});Vr.displayName="TableCaption";const yn=l.forwardRef(function({sortKey:t,currentSort:r,onSortChange:s,children:a,className:o,...i},d){const u=(r==null?void 0:r.key)===t,c=u?r==null?void 0:r.direction:void 0,g=()=>{s(t,u&&c==="asc"?"desc":"asc")};return e.jsx(qe,{ref:d,className:x("p-0",o),"aria-sort":u?c==="asc"?"ascending":"descending":"none",...i,children:e.jsxs("button",{type:"button",onClick:g,className:x("inline-flex h-10 w-full items-center gap-1.5 px-3 outline-none","transition-colors duration-[var(--duration-fast)]","hover:text-foreground focus-visible:text-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm",u&&"text-foreground"),children:[a,c==="asc"?e.jsx(p.ArrowUp,{className:"size-3.5","aria-hidden":!0}):c==="desc"?e.jsx(p.ArrowDown,{className:"size-3.5","aria-hidden":!0}):e.jsx(p.ArrowUpDown,{className:"size-3.5 opacity-40","aria-hidden":!0})]})})});yn.displayName="TableSortHeader";const Nn=l.forwardRef(function({className:t,variant:r,...s},a){return e.jsx("div",{ref:a,"aria-hidden":!0,className:x("animate-pulse bg-background-muted",r==="text"&&"h-3 rounded-sm",r==="circle"&&"rounded-full aspect-square",r==="avatar"&&"size-8 rounded-full",r==="card"&&"rounded-lg",!r&&"rounded-md",t),...s})});Nn.displayName="Skeleton";function Gr({columns:n,rows:t,loading:r,sort:s,onSortChange:a,filter:o,emptyState:i,className:d}){const[u,c]=l.useState({}),g=l.useMemo(()=>n.filter(f=>!u[f.key]),[n,u]),m=()=>r?Array.from({length:5}).map((f,b)=>e.jsx(Ge,{children:g.map(h=>e.jsx(He,{children:e.jsx(Nn,{variant:"text",className:"w-3/4"})},h.key))},`skel-${b}`)):t.length===0?e.jsx(Ge,{children:e.jsx(He,{colSpan:g.length,className:"h-32 text-center",children:i??e.jsx("span",{className:"text-foreground-subtle",children:"No results."})})}):t.map(f=>e.jsx(Ge,{children:g.map(b=>e.jsx(He,{className:x(b.align==="right"&&"text-right tabular"),children:b.cell?b.cell(f):f[b.key]},b.key))},f.id));return e.jsxs("div",{className:x("flex flex-col gap-3",d),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o?e.jsx(se,{type:"search",placeholder:o.placeholder??"Filter…",value:o.value,onChange:f=>o.onChange(f.target.value),clearable:!0,onClear:()=>o.onChange(""),className:"max-w-sm w-full",hideLabel:!0,label:"Filter rows"}):e.jsx("div",{}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(Ar,{children:[e.jsx(Lr,{asChild:!0,children:e.jsx(it,{"aria-label":"Column visibility",icon:e.jsx(p.Settings,{}),variant:"outline"})}),e.jsxs(bn,{children:[e.jsx(wn,{children:"Columns"}),e.jsx(jn,{}),n.map(f=>e.jsx(vn,{checked:!u[f.key],onCheckedChange:b=>c(h=>({...h,[f.key]:!b})),children:f.header},f.key))]})]})})]}),e.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:e.jsxs(Ut,{children:[e.jsx("colgroup",{children:g.map(f=>e.jsx("col",{style:f.width?{width:f.width}:void 0},f.key))}),e.jsx(Vt,{children:e.jsx(Ge,{children:g.map(f=>f.sortable&&a?e.jsx(yn,{sortKey:f.key,currentSort:s??null,onSortChange:(b,h)=>a({key:b,direction:h}),children:f.header},f.key):e.jsx(qe,{className:x(f.align==="right"&&"text-right"),children:f.header},f.key))})}),e.jsx(Gt,{children:m()})]})})]})}const qr={root:"p-3",month:"space-y-2",caption:"flex items-center justify-between px-1 pb-2",caption_label:"text-sm font-medium text-foreground",nav:"flex items-center gap-1",nav_button:"inline-flex size-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted hover:text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring",table:"w-full border-collapse",head_row:"flex",head_cell:"w-9 text-xs font-medium text-foreground-subtle",row:"flex w-full mt-1",cell:"relative size-9 p-0 text-center",day:"inline-flex size-9 items-center justify-center rounded-md text-sm text-foreground transition-colors outline-none hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring",day_selected:"bg-accent text-on-accent hover:bg-accent hover:text-on-accent",day_today:"font-semibold text-accent",day_outside:"text-foreground-subtle opacity-50",day_disabled:"text-foreground-subtle opacity-50 pointer-events-none",day_range_start:"rounded-l-md",day_range_end:"rounded-r-md",day_range_middle:"bg-accent-soft text-on-accent-soft rounded-none"},Wr={IconLeft:()=>e.jsx(p.ChevronLeft,{className:"size-4","aria-hidden":!0}),IconRight:()=>e.jsx(p.ChevronRight,{className:"size-4","aria-hidden":!0})};function Ot(n){return n?n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):""}function Xr({label:n,placeholder:t,hasValue:r,children:s,error:a,fieldId:o,disabled:i}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[n&&e.jsx("label",{htmlFor:o,className:"text-sm font-medium text-foreground",children:n}),e.jsx(Z.Trigger,{asChild:!0,children:e.jsxs("button",{id:o,type:"button",disabled:i,"aria-invalid":!!a||void 0,className:x("inline-flex h-9 w-full items-center justify-start gap-2 rounded-md border bg-card px-3 text-left text-sm","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:opacity-50 disabled:cursor-not-allowed",a?"border-danger focus-visible:border-danger focus-visible:ring-danger":"border-border focus-visible:border-accent focus-visible:ring-ring",!r&&"text-foreground-subtle"),children:[e.jsx(p.Calendar,{className:"size-4 text-foreground-subtle","aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r?s:t})]})}),a&&e.jsx("p",{role:"alert",className:"text-xs text-danger-text",children:a})]})}const Kr=l.forwardRef(function({value:t,onChange:r,label:s,placeholder:a="Pick a date",error:o,disabled:i,fromDate:d,toDate:u,className:c},g){const m=l.useId(),[f,b]=l.useState(!1);return e.jsx("div",{ref:g,className:x(c),children:e.jsxs(Z.Root,{open:f,onOpenChange:b,children:[e.jsx(Xr,{label:s,placeholder:a,hasValue:!!t,error:o,fieldId:m,disabled:i,children:Ot(t)}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md",children:e.jsx(gn.DayPicker,{mode:"single",selected:t,onSelect:h=>{r(h??void 0),h&&b(!1)},fromDate:d,toDate:u,classNames:qr,components:Wr})})})]})})});Kr.displayName="DatePicker";const Yr=l.forwardRef(function({value:t,onChange:r,label:s,placeholder:a="Pick a range",error:o,disabled:i,fromDate:d,toDate:u,className:c},g){const m=l.useId(),[f,b]=l.useState(!1),h=!!(t!=null&&t.from);return e.jsx("div",{ref:g,className:x(c),children:e.jsxs(Z.Root,{open:f,onOpenChange:b,children:[e.jsx(Xr,{label:s,placeholder:a,hasValue:h,error:o,fieldId:m,disabled:i,children:t!=null&&t.from&&t.to?`${Ot(t.from)} – ${Ot(t.to)}`:t!=null&&t.from?Ot(t.from):""}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md",children:e.jsx(gn.DayPicker,{mode:"range",selected:t,onSelect:r,numberOfMonths:2,fromDate:d,toDate:u,classNames:qr,components:Wr})})})]})})});Yr.displayName="DateRangePicker";const Qr=H.Root,no=H.Trigger,Jr=H.Portal,Zr=H.Close,Cn=l.forwardRef(function({className:t,...r},s){return e.jsx(H.Overlay,{ref:s,className:x("fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})});Cn.displayName="DialogOverlay";const Sn=l.forwardRef(function({className:t,children:r,showClose:s=!0,size:a="md",...o},i){return e.jsxs(Jr,{children:[e.jsx(Cn,{}),e.jsxs(H.Content,{ref:i,className:x("fixed left-1/2 top-1/2 z-[var(--z-modal)] -translate-x-1/2 -translate-y-1/2","w-[calc(100%-2rem)] rounded-lg border border-border bg-card text-card-foreground shadow-lg","p-6","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",a==="sm"&&"max-w-[400px]",a==="md"&&"max-w-[520px]",a==="lg"&&"max-w-[720px]",t),...o,children:[r,s&&e.jsx(H.Close,{"aria-label":"Close",className:x("absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-foreground-subtle","hover:bg-background-muted hover:text-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card","transition-colors duration-[var(--duration-fast)]"),children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})})]})]})});Sn.displayName="DialogContent";function kn({className:n,...t}){return e.jsx("div",{className:x("flex flex-col gap-1 pb-4",n),...t})}kn.displayName="DialogHeader";function Tn({className:n,...t}){return e.jsx("div",{className:x("flex flex-col-reverse gap-2 pt-6 sm:flex-row sm:justify-end",n),...t})}Tn.displayName="DialogFooter";const Dn=l.forwardRef(function({className:t,...r},s){return e.jsx(H.Title,{ref:s,className:x("text-lg font-semibold text-foreground leading-tight",t),...r})});Dn.displayName="DialogTitle";const Rn=l.forwardRef(function({className:t,...r},s){return e.jsx(H.Description,{ref:s,className:x("text-sm text-foreground-muted",t),...r})});Rn.displayName="DialogDescription";function es({open:n,onOpenChange:t,title:r,description:s,confirmLabel:a="Confirm",cancelLabel:o="Cancel",confirmVariant:i="primary",onConfirm:d,loading:u}){return e.jsx(Qr,{open:n,onOpenChange:t,children:e.jsxs(Sn,{size:"sm",children:[e.jsxs(kn,{children:[e.jsx(Dn,{children:r}),s&&e.jsx(Rn,{children:s})]}),e.jsxs(Tn,{children:[e.jsx(Zr,{asChild:!0,children:e.jsx(q,{variant:"outline",children:o})}),e.jsx(q,{variant:i,loading:u,onClick:d,children:a})]})]})})}es.displayName="ConfirmationDialog";const qt=l.forwardRef(function({icon:t,title:r,description:s,action:a,secondaryAction:o,className:i,...d},u){return e.jsxs("div",{ref:u,className:x("flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border bg-background-subtle p-10 text-center",i),...d,children:[t&&e.jsx("div",{className:"inline-flex size-12 items-center justify-center rounded-full bg-background-muted text-foreground-muted [&_svg]:size-6",children:t}),e.jsx("h3",{className:"text-base font-semibold text-foreground leading-tight",children:r}),s&&e.jsx("p",{className:"max-w-md text-sm text-foreground-muted leading-relaxed",children:s}),(a||o)&&e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[a,o]})]})});qt.displayName="EmptyState";const ro={404:{icon:e.jsx(p.AlertTriangle,{}),title:"Page not found",description:"We couldn't find what you were looking for."},500:{icon:e.jsx(p.XCircle,{}),title:"Something went wrong",description:"We're looking into it. Please try again in a moment."},generic:{icon:e.jsx(p.AlertTriangle,{}),title:"Unexpected error",description:"Something interrupted this action."}},ts=l.forwardRef(function({variant:t="generic",title:r,description:s,action:a,onRetry:o,className:i,...d},u){const c=ro[t];return e.jsxs("div",{ref:u,role:"alert",className:x("flex flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background-subtle p-10 text-center",i),...d,children:[e.jsx("div",{className:"inline-flex size-12 items-center justify-center rounded-full bg-danger-soft text-danger-text [&_svg]:size-6",children:c.icon}),e.jsx("h3",{className:"text-base font-semibold text-foreground leading-tight",children:r??c.title}),e.jsx("p",{className:"max-w-md text-sm text-foreground-muted leading-relaxed",children:s??c.description}),(a||o)&&e.jsx("div",{className:"mt-2 flex items-center gap-2",children:a??e.jsx(q,{onClick:o,variant:"outline",children:"Try again"})})]})});ts.displayName="ErrorState";const so=pn.FormProvider,ns=l.createContext(null);function ao(n){return e.jsx(ns.Provider,{value:{name:n.name},children:e.jsx(pn.Controller,{...n})})}const rs=l.createContext(null);function St(){const n=l.useContext(ns),t=l.useContext(rs),{getFieldState:r,formState:s}=pn.useFormContext();if(!n)throw new Error("useFormField must be used inside <FormField>");const a=r(n.name,s),o=(t==null?void 0:t.id)??"";return{id:o,name:n.name,formItemId:`${o}-item`,formDescriptionId:`${o}-desc`,formMessageId:`${o}-error`,...a}}const ss=l.forwardRef(function({className:t,...r},s){const a=l.useId();return e.jsx(rs.Provider,{value:{id:a},children:e.jsx("div",{ref:s,className:x("flex flex-col gap-1.5",t),...r})})});ss.displayName="FormItem";const as=l.forwardRef(function({className:t,...r},s){const{formItemId:a,error:o}=St();return e.jsx(ka.Root,{ref:s,htmlFor:a,className:x("text-sm font-medium text-foreground",o&&"text-danger-text",t),...r})});as.displayName="FormLabel";const os=l.forwardRef(function(t,r){const{error:s,formItemId:a,formDescriptionId:o,formMessageId:i}=St();return e.jsx(cr.Slot,{ref:r,id:a,"aria-describedby":s?`${o} ${i}`:o,"aria-invalid":!!s,...t})});os.displayName="FormControl";const is=l.forwardRef(function({className:t,...r},s){const{formDescriptionId:a}=St();return e.jsx("p",{ref:s,id:a,className:x("text-xs text-foreground-subtle",t),...r})});is.displayName="FormDescription";const ls=l.forwardRef(function({className:t,children:r,...s},a){const{error:o,formMessageId:i}=St(),d=o?String((o==null?void 0:o.message)??""):r;return d?e.jsx("p",{ref:a,id:i,role:"alert",className:x("text-xs text-danger-text",t),...s,children:d}):null});ls.displayName="FormError";const cs=l.forwardRef(function({size:t="sm",className:r,...s},a){return e.jsx("kbd",{ref:a,className:x("inline-flex items-center justify-center rounded border border-border bg-background-subtle font-mono","text-foreground-muted shadow-xs",t==="sm"?"h-5 min-w-5 px-1 text-[10px]":"h-6 min-w-6 px-1.5 text-xs",r),...s})});cs.displayName="Kbd";const ds=l.forwardRef(function({options:t,value:r,onChange:s,label:a,helperText:o,error:i,placeholder:d="Select…",emptyText:u="No results.",maxVisibleChips:c=4,clearable:g=!0,disabled:m,className:f},b){const h=l.useId(),v=h,j=`${h}-helper`,w=`${h}-error`,[N,S]=l.useState(!1),[y,k]=l.useState(""),D=l.useRef(null),C=l.useMemo(()=>t.filter(P=>r.includes(P.value)),[t,r]),T=l.useCallback(P=>{r.includes(P)?s(r.filter(_=>_!==P)):s([...r,P])},[r,s]),R=l.useCallback(()=>s([]),[s]),L=P=>{P.key==="Backspace"&&y===""&&r.length>0&&s(r.slice(0,-1))},E=C.slice(0,c),F=C.length-E.length,I=!!i;return e.jsxs("div",{ref:b,className:x("flex flex-col gap-1.5",f),children:[a&&e.jsx("label",{htmlFor:v,className:"text-sm font-medium text-foreground",children:a}),e.jsxs(Z.Root,{open:N,onOpenChange:S,children:[e.jsx(Z.Trigger,{asChild:!0,children:e.jsxs("div",{role:"combobox","aria-expanded":N,"aria-controls":`${v}-list`,"aria-haspopup":"listbox",id:v,tabIndex:m?-1:0,onKeyDown:L,"aria-disabled":m||void 0,"aria-invalid":I||void 0,"aria-describedby":I?w:o?j:void 0,className:x("flex w-full min-h-9 cursor-text flex-wrap items-center gap-1.5 rounded-md border bg-card px-2 py-1 text-sm","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background",I?"border-danger focus-visible:border-danger focus-visible:ring-danger":"border-border focus-visible:border-accent focus-visible:ring-ring",m&&"opacity-50 pointer-events-none"),onClick:()=>{var P;return(P=D.current)==null?void 0:P.focus()},children:[E.length===0&&e.jsx("span",{className:"text-foreground-subtle px-1",children:d}),E.map(P=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-accent-soft px-1.5 py-0.5 text-xs font-medium text-on-accent-soft",children:[P.label,e.jsx("button",{type:"button","aria-label":`Remove ${P.label}`,className:"inline-flex items-center text-on-accent-soft hover:text-foreground",onClick:_=>{_.stopPropagation(),T(P.value)},children:e.jsx(p.X,{className:"size-3","aria-hidden":!0})})]},P.value)),F>0&&e.jsxs("span",{className:"rounded-md bg-background-muted px-1.5 py-0.5 text-xs font-medium text-foreground-muted",children:["+",F," more"]}),e.jsx("input",{ref:D,value:y,onChange:P=>k(P.target.value),onFocus:()=>S(!0),className:"flex-1 min-w-[8ch] bg-transparent text-sm outline-none placeholder:text-foreground-subtle",placeholder:(C.length===0,""),disabled:m}),e.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[g&&C.length>0&&e.jsx("button",{type:"button","aria-label":"Clear all",onClick:P=>{P.stopPropagation(),R()},className:"text-foreground-subtle hover:text-foreground",children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})}),e.jsx(p.ChevronsUpDown,{className:"size-4 text-foreground-subtle","aria-hidden":!0})]})]})}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:x("z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),onOpenAutoFocus:P=>P.preventDefault(),children:e.jsx(de.Command,{shouldFilter:!1,className:"flex h-full w-full flex-col",children:e.jsxs(de.Command.List,{id:`${v}-list`,className:"max-h-64 overflow-y-auto p-1",children:[t.filter(P=>P.label.toLowerCase().includes(y.toLowerCase())).map(P=>{const _=r.includes(P.value);return e.jsxs(de.Command.Item,{value:P.value,disabled:P.disabled,onSelect:()=>T(P.value),className:x("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground","data-[selected=true]:bg-background-muted","data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none"),children:[e.jsx("span",{"aria-hidden":!0,className:x("flex size-4 items-center justify-center rounded-sm border",_?"border-accent bg-accent text-on-accent":"border-border"),children:_&&e.jsx(p.Check,{className:"size-3","aria-hidden":!0})}),e.jsx("span",{className:"flex-1",children:P.label}),P.description&&e.jsx("span",{className:"text-xs text-foreground-subtle",children:P.description})]},P.value)}),e.jsx(de.Command.Empty,{className:"px-2 py-6 text-center text-sm text-foreground-subtle",children:u})]})})})})]}),i?e.jsx("p",{id:w,role:"alert",className:"text-xs text-danger-text",children:i}):o?e.jsx("p",{id:j,className:"text-xs text-foreground-subtle",children:o}):null]})});ds.displayName="MultiSelect";const In=ue.Root,oo=ue.Value,Wt=l.forwardRef(function({className:t,placeholder:r,size:s="md",tone:a="default",...o},i){return e.jsxs(ue.Trigger,{ref:i,className:x("inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:opacity-50 disabled:cursor-not-allowed","data-[placeholder]:text-foreground-subtle",s==="sm"&&"h-8 px-2.5",s==="md"&&"h-9 px-3",s==="lg"&&"h-10 px-3.5",a==="default"?"border-border focus-visible:border-accent focus-visible:ring-ring":"border-danger focus-visible:border-danger focus-visible:ring-danger",t),...o,children:[e.jsx(ue.Value,{placeholder:r}),e.jsx(ue.Icon,{asChild:!0,children:e.jsx(p.ChevronsUpDown,{className:"size-4 text-foreground-subtle shrink-0","aria-hidden":!0})})]})});Wt.displayName="SelectTrigger";const us="flex h-6 cursor-default items-center justify-center text-foreground-subtle",Mn=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.ScrollUpButton,{ref:s,className:x(us,t),...r,children:e.jsx(p.ChevronUp,{className:"size-4","aria-hidden":!0})})});Mn.displayName="SelectScrollUpButton";const Pn=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.ScrollDownButton,{ref:s,className:x(us,t),...r,children:e.jsx(p.ChevronDown,{className:"size-4","aria-hidden":!0})})});Pn.displayName="SelectScrollDownButton";const Xt=l.forwardRef(function({className:t,children:r,position:s="popper",...a},o){return e.jsx(ue.Portal,{children:e.jsxs(ue.Content,{ref:o,position:s,className:x("z-[var(--z-popover)] min-w-[var(--radix-select-trigger-width)] max-h-96","overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground","shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",t),...a,children:[e.jsx(Mn,{}),e.jsx(ue.Viewport,{className:"p-1",children:r}),e.jsx(Pn,{})]})})});Xt.displayName="SelectContent";const zn=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.Label,{ref:s,className:x("px-2 py-1.5 text-xs font-medium text-foreground-subtle",t),...r})});zn.displayName="SelectLabel";const Ze=l.forwardRef(function({className:t,children:r,leadingIcon:s,...a},o){return e.jsxs(ue.Item,{ref:o,className:x("relative flex w-full cursor-default select-none items-center gap-2","rounded-sm px-2 py-1.5 pr-8 text-sm text-foreground outline-none","data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[s&&e.jsx("span",{className:"flex items-center text-foreground-subtle [&_svg]:size-4",children:s}),e.jsx(ue.ItemText,{children:r}),e.jsx("span",{className:"absolute right-2 flex items-center justify-center",children:e.jsx(ue.ItemIndicator,{children:e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})})})]})});Ze.displayName="SelectItem";const fs=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});fs.displayName="SelectSeparator";const ms=l.forwardRef(function({label:t,children:r,...s},a){return e.jsxs(ue.Group,{ref:a,...s,children:[t&&e.jsx(zn,{children:t}),r]})});ms.displayName="SelectGroup";function io(n,t,r=7){if(t<=r)return Array.from({length:t},(d,u)=>u+1);const s=1,a=[],o=Math.max(2,n-s),i=Math.min(t-1,n+s);a.push(1),o>2&&a.push("gap");for(let d=o;d<=i;d++)a.push(d);return i<t-1&&a.push("gap"),a.push(t),a}const En=l.forwardRef(function({page:t,pageCount:r,onPageChange:s,totalItems:a,pageSize:o,pageSizeOptions:i,onPageSizeChange:d,showJump:u=!0,className:c,...g},m){const f=l.useMemo(()=>io(t,r),[t,r]),b=o?(t-1)*o+1:void 0,h=o&&a?Math.min(t*o,a):void 0,v=j=>{j<1||j>r||j===t||s(j)};return e.jsxs("nav",{ref:m,"aria-label":"Pagination",className:x("flex flex-wrap items-center justify-between gap-3",c),...g,children:[e.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground-muted",children:[a!==void 0&&o!==void 0&&e.jsxs("span",{className:"tabular",children:["Showing ",b,"–",h," of ",a]}),i&&d&&o!==void 0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:"page-size",className:"sr-only",children:"Rows per page"}),e.jsxs(In,{value:String(o),onValueChange:j=>d(Number(j)),children:[e.jsx(Wt,{size:"sm",className:"w-20"}),e.jsx(Xt,{children:i.map(j=>e.jsxs(Ze,{value:String(j),children:[j," / page"]},j))})]})]})]}),e.jsxs("ul",{className:"flex items-center gap-1",children:[u&&e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Go to first page",disabled:t===1,onClick:()=>v(1),className:Pt,children:e.jsx(p.ChevronsLeft,{className:"size-4","aria-hidden":!0})})}),e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Previous page",disabled:t===1,onClick:()=>v(t-1),className:Pt,children:e.jsx(p.ChevronLeft,{className:"size-4","aria-hidden":!0})})}),f.map((j,w)=>j==="gap"?e.jsx("li",{className:"px-2 text-foreground-subtle",children:"…"},`gap-${w}`):e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":`Page ${j}`,"aria-current":j===t?"page":void 0,onClick:()=>v(j),className:x("inline-flex size-8 items-center justify-center rounded-md text-sm tabular outline-none","transition-colors duration-[var(--duration-fast)]","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",j===t?"bg-accent text-on-accent font-medium":"text-foreground-muted hover:bg-background-muted hover:text-foreground"),children:j})},j)),e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Next page",disabled:t===r,onClick:()=>v(t+1),className:Pt,children:e.jsx(p.ChevronRight,{className:"size-4","aria-hidden":!0})})}),u&&e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Go to last page",disabled:t===r,onClick:()=>v(r),className:Pt,children:e.jsx(p.ChevronsRight,{className:"size-4","aria-hidden":!0})})})]})]})});En.displayName="Pagination";const Pt=x("inline-flex size-8 items-center justify-center rounded-md text-foreground-muted","transition-colors duration-[var(--duration-fast)]","hover:bg-background-muted hover:text-foreground","disabled:opacity-50 disabled:pointer-events-none","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"),lo=Z.Root,co=Z.Trigger,uo=Z.Anchor,fo=Z.Close,xs=l.forwardRef(function({className:t,align:r="center",sideOffset:s=4,...a},o){return e.jsx(Z.Portal,{children:e.jsx(Z.Content,{ref:o,align:r,sideOffset:s,className:x("z-[var(--z-popover)] w-72 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-md","outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1","data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1",t),...a})})});xs.displayName="PopoverContent";const mo={sm:"h-1",md:"h-1.5",lg:"h-2"},xo={accent:"bg-accent",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},gs=l.forwardRef(function({className:t,value:r,size:s="md",tone:a="accent",...o},i){const d=r==null;return e.jsxs(Yn.Root,{ref:i,value:d?void 0:r,className:x("relative w-full overflow-hidden rounded-full bg-background-muted",mo[s],t),...o,children:[e.jsx(Yn.Indicator,{className:x("h-full w-full flex-1 transition-transform",xo[a],d&&"animate-[progressIndeterminate_1.4s_ease-in-out_infinite] origin-left"),style:d?void 0:{transform:`translateX(-${100-(r??0)}%)`}}),e.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const aa=require("clsx"),oa=require("tailwind-merge"),l=require("react"),p=require("lucide-react"),e=require("react/jsx-runtime"),ia=require("@radix-ui/react-accordion"),Se=require("class-variance-authority"),la=require("@radix-ui/react-avatar"),cr=require("@radix-ui/react-slot"),ca=require("@radix-ui/react-checkbox"),da=require("@radix-ui/react-popover"),de=require("cmdk"),ua=require("@radix-ui/react-dialog"),fa=require("@radix-ui/react-context-menu"),ma=require("@radix-ui/react-dropdown-menu"),gn=require("react-day-picker"),xa=require("@radix-ui/react-label"),pn=require("react-hook-form"),ga=require("@radix-ui/react-select"),pa=require("@radix-ui/react-progress"),ha=require("@radix-ui/react-radio-group"),ba=require("@radix-ui/react-scroll-area"),va=require("@radix-ui/react-separator"),wa=require("@radix-ui/react-slider"),ja=require("@radix-ui/react-switch"),ya=require("@radix-ui/react-tabs"),Na=require("@radix-ui/react-toast"),Ca=require("@radix-ui/react-tooltip");function ae(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>n[r]})}}return t.default=n,Object.freeze(t)}const Sa=ae(l),vt=ae(ia),sn=ae(la),Kn=ae(ca),Z=ae(da),H=ae(ua),fe=ae(fa),me=ae(ma),ka=ae(xa),ue=ae(ga),Yn=ae(pa),dn=ae(ha),gt=ae(ba),Ta=ae(va),Mt=ae(wa),Qn=ae(ja),$t=ae(ya),nt=ae(Na),wt=ae(Ca);function x(...n){return oa.twMerge(aa.clsx(n))}let Jn=0;function Da(n="ds"){return Jn+=1,`${n}-${Jn}`}function dr(n){const[t,r]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return l.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(n),a=o=>r(o.matches);return r(s.matches),s.addEventListener("change",a),()=>s.removeEventListener("change",a)},[n]),t}function Ra(){return dr("(prefers-reduced-motion: reduce)")}const Qe={toasts:[],listeners:new Set,emit(){for(const n of this.listeners)n(this.toasts)},push(n){const t=n.id??`t_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,r={open:!0,duration:5e3,variant:"default",...n,id:t};return this.toasts=[r,...this.toasts].slice(0,3),this.emit(),t},dismiss(n){this.toasts=this.toasts.map(t=>t.id===n?{...t,open:!1}:t),this.emit()},remove(n){this.toasts=this.toasts.filter(t=>t.id!==n),this.emit()}};function Ia(){const[n,t]=l.useState(()=>[...Qe.toasts]);l.useEffect(()=>{const o=i=>t([...i]);return Qe.listeners.add(o),()=>{Qe.listeners.delete(o)}},[]);const r=l.useCallback(o=>Qe.push(o),[]),s=l.useCallback(o=>Qe.dismiss(o),[]),a=l.useCallback(o=>Qe.remove(o),[]);return{toasts:n,push:r,dismiss:s,remove:a}}const Ma=n=>Qe.push(n),Pa=Object.freeze(Object.defineProperty({__proto__:null,AlertCircle:p.AlertCircle,AlertTriangle:p.AlertTriangle,ArrowDown:p.ArrowDown,ArrowLeft:p.ArrowLeft,ArrowRight:p.ArrowRight,ArrowUp:p.ArrowUp,ArrowUpDown:p.ArrowUpDown,Bell:p.Bell,Calendar:p.Calendar,Check:p.Check,CheckCircle2:p.CheckCircle2,ChevronDown:p.ChevronDown,ChevronLeft:p.ChevronLeft,ChevronRight:p.ChevronRight,ChevronUp:p.ChevronUp,ChevronsLeft:p.ChevronsLeft,ChevronsRight:p.ChevronsRight,ChevronsUpDown:p.ChevronsUpDown,Circle:p.Circle,Copy:p.Copy,CornerDownLeft:p.CornerDownLeft,CreditCard:p.CreditCard,Download:p.Download,Edit2:p.Edit2,Ellipsis:p.Ellipsis,ExternalLink:p.ExternalLink,Eye:p.Eye,EyeOff:p.EyeOff,Filter:p.Filter,Folder:p.Folder,GripVertical:p.GripVertical,HelpCircle:p.HelpCircle,Home:p.Home,Info:p.Info,Link2:p.Link2,Loader2:p.Loader2,Lock:p.Lock,Mail:p.Mail,Menu:p.Menu,Minus:p.Minus,Moon:p.Moon,MoreHorizontal:p.MoreHorizontal,Plus:p.Plus,Search:p.Search,Settings:p.Settings,Sun:p.Sun,Trash2:p.Trash2,Upload:p.Upload,User:p.User,Users:p.Users,X:p.X,XCircle:p.XCircle},Symbol.toStringTag,{value:"Module"})),za=vt.Root,ur=l.forwardRef(function({className:t,...r},s){return e.jsx(vt.Item,{ref:s,className:x("border-b border-border",t),...r})});ur.displayName="AccordionItem";const fr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsx(vt.Header,{className:"flex",children:e.jsxs(vt.Trigger,{ref:a,className:x("flex flex-1 items-center justify-between gap-2 py-4 text-left text-sm font-medium text-foreground","outline-none transition-colors duration-[var(--duration-fast)]","hover:text-accent","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","[&[data-state=open]>svg]:rotate-180",t),...s,children:[r,e.jsx(p.ChevronDown,{className:"size-4 shrink-0 text-foreground-subtle transition-transform duration-[var(--duration-base)]","aria-hidden":!0})]})})});fr.displayName="AccordionTrigger";const mr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsx(vt.Content,{ref:a,className:x("overflow-hidden text-sm text-foreground-muted","data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"),...s,children:e.jsx("div",{className:x("pb-4 pt-0",t),children:r})})});mr.displayName="AccordionContent";const Ea=Se.cva(["relative flex w-full gap-3 rounded-lg border p-4","text-sm"],{variants:{variant:{default:"border-border bg-background-subtle text-foreground",info:"border-info-border-soft bg-info-soft text-info-text",success:"border-success-border-soft bg-success-soft text-success-text",warning:"border-warning-border-soft bg-warning-soft text-warning-text",danger:"border-danger-border-soft bg-danger-soft text-danger-text"}},defaultVariants:{variant:"default"}}),Aa={default:null,info:e.jsx(p.Info,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0}),success:e.jsx(p.CheckCircle2,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0}),warning:e.jsx(p.AlertTriangle,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0}),danger:e.jsx(p.XCircle,{className:"size-4 shrink-0 mt-0.5","aria-hidden":!0})},Ct=l.forwardRef(function({className:t,variant:r="default",title:s,dismissible:a,onDismiss:o,icon:i,children:d,...u},c){const[g,m]=l.useState(!0);if(!g)return null;const f=()=>{m(!1),o==null||o()},b=i===!1?null:i??Aa[r??"default"];return e.jsxs("div",{ref:c,role:"alert",className:x(Ea({variant:r}),t),...u,children:[b,e.jsxs("div",{className:"flex-1 min-w-0",children:[s&&e.jsx("h5",{className:"font-medium leading-tight mb-1",children:s}),e.jsx("div",{className:"text-sm leading-relaxed [&_p]:leading-relaxed",children:d})]}),a&&e.jsx("button",{type:"button","aria-label":"Dismiss",onClick:f,className:x("inline-flex size-6 shrink-0 items-center justify-center rounded-md","hover:bg-current/10 outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"),children:e.jsx(p.X,{className:"size-3.5","aria-hidden":!0})})]})});Ct.displayName="Alert";const xr={xs:"size-5 text-[10px]",sm:"size-6 text-xs",md:"size-8 text-xs",lg:"size-10 text-sm",xl:"size-12 text-base"},La=Se.cva(["relative inline-flex shrink-0 overflow-hidden rounded-full","bg-background-muted text-foreground-muted"],{variants:{size:xr},defaultVariants:{size:"md"}}),Oa={online:"bg-success",busy:"bg-danger",away:"bg-warning",offline:"bg-foreground-subtle"},Re=l.forwardRef(function({className:t,size:r,src:s,alt:a,fallback:o,status:i,...d},u){return e.jsxs(sn.Root,{ref:u,className:x(La({size:r}),t),...d,children:[s&&e.jsx(sn.Image,{src:s,alt:a??"",className:"aspect-square size-full object-cover"}),e.jsx(sn.Fallback,{delayMs:s?200:0,className:"flex size-full items-center justify-center bg-background-muted font-medium uppercase",children:o??"?"}),i&&e.jsx("span",{"aria-label":`Status: ${i}`,className:x("absolute bottom-0 right-0 block size-1/4 rounded-full ring-2 ring-background",Oa[i])})]})});Re.displayName="Avatar";const gr=l.forwardRef(function({max:t=4,size:r="md",className:s,children:a,...o},i){const d=Array.isArray(a)?a:[a],u=d.slice(0,t),c=d.length-u.length;return e.jsxs("div",{ref:i,className:x("flex items-center -space-x-2",s),...o,children:[u.map((g,m)=>e.jsx("div",{className:"ring-2 ring-background rounded-full",children:g},m)),c>0&&e.jsxs("div",{className:x("inline-flex items-center justify-center rounded-full bg-background-muted text-foreground-muted ring-2 ring-background",xr[r],"font-medium"),"aria-label":`${c} more`,children:["+",c]})]})});gr.displayName="AvatarGroup";const Fa=Se.cva(["inline-flex items-center gap-1 rounded-full px-2 py-0.5","text-xs font-medium whitespace-nowrap"],{variants:{variant:{subtle:"",outline:"border bg-transparent"},tone:{neutral:"",accent:"",success:"",warning:"",danger:"",info:""}},compoundVariants:[{variant:"subtle",tone:"neutral",class:"bg-background-muted text-foreground-muted"},{variant:"subtle",tone:"accent",class:"bg-accent-soft text-on-accent-soft"},{variant:"subtle",tone:"success",class:"bg-success-soft text-success-text"},{variant:"subtle",tone:"warning",class:"bg-warning-soft text-warning-text"},{variant:"subtle",tone:"danger",class:"bg-danger-soft text-danger-text"},{variant:"subtle",tone:"info",class:"bg-info-soft text-info-text"},{variant:"outline",tone:"neutral",class:"border-border text-foreground-muted"},{variant:"outline",tone:"accent",class:"border-accent text-accent"},{variant:"outline",tone:"success",class:"border-success-border-soft text-success-text"},{variant:"outline",tone:"warning",class:"border-warning-border-soft text-warning-text"},{variant:"outline",tone:"danger",class:"border-danger-border-soft text-danger-text"},{variant:"outline",tone:"info",class:"border-info-border-soft text-info-text"}],defaultVariants:{variant:"subtle",tone:"neutral"}}),_a={neutral:"bg-foreground-subtle",accent:"bg-accent",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"},Ee=l.forwardRef(function({className:t,variant:r,tone:s="neutral",dot:a,children:o,...i},d){return e.jsxs("span",{ref:d,className:x(Fa({variant:r,tone:s}),t),...i,children:[a&&e.jsx("span",{"aria-hidden":!0,className:x("inline-block size-1.5 rounded-full",_a[s??"neutral"])}),o]})});Ee.displayName="Badge";const hn=l.forwardRef(function({items:t,maxItems:r=4,renderLink:s,className:a,...o},i){const u=t.length>r?[t[0],{collapsed:!0},...t.slice(-2)]:t;return e.jsx("nav",{ref:i,"aria-label":"Breadcrumb",className:x("text-sm",a),...o,children:e.jsx("ol",{className:"flex flex-wrap items-center gap-1.5 text-foreground-subtle",children:u.map((c,g)=>{const m=g===u.length-1;if("collapsed"in c)return e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx(p.MoreHorizontal,{className:"size-4","aria-hidden":!0}),e.jsx(p.ChevronRight,{className:"size-3.5","aria-hidden":!0})]},`ellipsis-${g}`);const f=c,b=m?e.jsx("span",{"aria-current":"page",className:"font-medium text-foreground",children:f.label}):f.href?s?s(f.href,f.label):e.jsx("a",{href:f.href,className:"hover:text-foreground transition-colors duration-[var(--duration-fast)] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",children:f.label}):e.jsx("span",{children:f.label});return e.jsxs("li",{className:"flex items-center gap-1.5",children:[b,!m&&e.jsx(p.ChevronRight,{className:"size-3.5","aria-hidden":!0})]},g)})})})});hn.displayName="Breadcrumbs";const $a=Se.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-md text-sm font-medium","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{variant:{primary:["bg-accent text-on-accent","hover:bg-accent-700","active:bg-accent-800"],secondary:["bg-background-muted text-foreground border border-border","hover:bg-neutral-200 dark:hover:bg-neutral-800","active:bg-neutral-300 dark:active:bg-neutral-700"],outline:["border border-border bg-transparent text-foreground","hover:bg-background-muted","active:bg-background-subtle"],ghost:["bg-transparent text-foreground","hover:bg-background-muted","active:bg-background-subtle"],destructive:["bg-danger text-on-danger","hover:bg-danger-700","active:bg-danger-800"],link:["bg-transparent text-accent underline-offset-4 px-0","hover:underline","active:text-accent-700"]},size:{sm:"h-8 px-3 text-xs [&_svg]:size-4",md:"h-9 px-3.5 text-sm [&_svg]:size-4",lg:"h-10 px-4 text-sm [&_svg]:size-5",icon:"h-9 w-9 [&_svg]:size-4"}},compoundVariants:[{variant:"link",size:"sm",class:"h-auto px-0"},{variant:"link",size:"md",class:"h-auto px-0"},{variant:"link",size:"lg",class:"h-auto px-0"}],defaultVariants:{variant:"primary",size:"md"}}),q=l.forwardRef(function({className:t,variant:r,size:s,asChild:a=!1,loading:o=!1,leadingIcon:i,trailingIcon:d,disabled:u,children:c,type:g="button",...m},f){const b=u||o,h=x($a({variant:r,size:s}),t);return a?e.jsx(cr.Slot,{ref:f,"aria-busy":o||void 0,"data-loading":o||void 0,className:h,...m,children:c}):e.jsxs("button",{ref:f,type:g,"aria-busy":o||void 0,disabled:b,"data-loading":o||void 0,className:h,...m,children:[o?e.jsx(p.Loader2,{className:"animate-spin","aria-hidden":"true"}):i,c,!o&&d]})});q.displayName="Button";const Ba=Se.cva(["rounded-lg border bg-card text-card-foreground","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]"],{variants:{variant:{default:"border-border",interactive:"border-border hover:border-border-strong hover:bg-background-subtle cursor-pointer"},padding:{none:"",sm:"p-4",md:"p-5",lg:"p-6"}},defaultVariants:{variant:"default",padding:"md"}}),xe=l.forwardRef(function({className:t,variant:r,padding:s,...a},o){return e.jsx("div",{ref:o,className:x(Ba({variant:r,padding:s}),t),...a})});xe.displayName="Card";const he=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{ref:s,className:x("flex flex-col gap-1 pb-4",t),...r})});he.displayName="CardHeader";const Ce=l.forwardRef(function({className:t,...r},s){return e.jsx("h3",{ref:s,className:x("text-base font-semibold text-foreground leading-tight",t),...r})});Ce.displayName="CardTitle";const ze=l.forwardRef(function({className:t,...r},s){return e.jsx("p",{ref:s,className:x("text-sm text-foreground-muted",t),...r})});ze.displayName="CardDescription";const be=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{ref:s,className:x("text-sm text-foreground",t),...r})});be.displayName="CardContent";const pr=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{ref:s,className:x("flex items-center gap-2 pt-4",t),...r})});pr.displayName="CardFooter";const pt=l.forwardRef(function({className:t,label:r,description:s,error:a,hideLabel:o,id:i,disabled:d,...u},c){const g=l.useId(),m=i??g,f=s?`${m}-desc`:void 0,b=a?`${m}-error`:void 0;return e.jsxs("div",{className:x("flex flex-col gap-1",t),children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(Kn.Root,{ref:c,id:m,disabled:d,"aria-describedby":b??f,"aria-invalid":!!a||void 0,className:x("peer mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm border","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","data-[state=checked]:bg-accent data-[state=checked]:border-accent data-[state=checked]:text-on-accent","data-[state=indeterminate]:bg-accent data-[state=indeterminate]:border-accent data-[state=indeterminate]:text-on-accent","disabled:cursor-not-allowed disabled:opacity-50",a?"border-danger":"border-border-strong"),...u,children:e.jsx(Kn.Indicator,{className:"flex items-center justify-center",children:u.checked==="indeterminate"?e.jsx(p.Minus,{className:"size-3","aria-hidden":!0,strokeWidth:3}):e.jsx(p.Check,{className:"size-3","aria-hidden":!0,strokeWidth:3})})}),r&&e.jsxs("div",{className:x("flex flex-col gap-0.5",o&&"sr-only"),children:[e.jsx("label",{htmlFor:m,className:x("text-sm text-foreground select-none",d&&"opacity-50 cursor-not-allowed"),children:r}),s&&e.jsx("p",{id:f,className:"text-xs text-foreground-subtle",children:s})]})]}),a&&e.jsx("p",{id:b,role:"alert",className:"text-xs text-danger-text",children:a})]})});pt.displayName="Checkbox";const hr=l.forwardRef(function({value:t,onChange:r,options:s,loadOptions:a,label:o,helperText:i,error:d,placeholder:u="Select…",searchPlaceholder:c="Search…",emptyText:g="No results.",clearable:m=!0,disabled:f,size:b="md",className:h},v){const j=l.useId(),w=`${j}-helper`,N=`${j}-error`,[S,y]=l.useState(!1),[k,D]=l.useState(""),[C,T]=l.useState([]),[R,L]=l.useState(!1),E=a?C:s??[];l.useEffect(()=>{if(!a||!S)return;let O=!1;return L(!0),a(k).then(K=>{O||T(K)}).finally(()=>{O||L(!1)}),()=>{O=!0}},[k,S,a]);const F=l.useMemo(()=>E.find(O=>O.value===t)??null,[E,t]),I=b==="sm"?"h-8":b==="lg"?"h-10":"h-9",P=b==="sm"?"px-2.5":b==="lg"?"px-3.5":"px-3",_=l.useCallback(O=>{O.stopPropagation(),r(null)},[r]),W=!!d;return e.jsxs("div",{ref:v,className:x("flex flex-col gap-1.5",h),children:[o&&e.jsx("label",{htmlFor:j,className:"text-sm font-medium text-foreground",children:o}),e.jsxs(Z.Root,{open:S,onOpenChange:y,children:[e.jsx(Z.Trigger,{asChild:!0,children:e.jsxs("button",{id:j,type:"button",role:"combobox","aria-expanded":S,"aria-invalid":W||void 0,"aria-describedby":W?N:i?w:void 0,disabled:f,className:x("inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:opacity-50 disabled:cursor-not-allowed",I,P,W?"border-danger focus-visible:border-danger focus-visible:ring-danger":"border-border focus-visible:border-accent focus-visible:ring-ring"),children:[e.jsx("span",{className:x("truncate",!F&&"text-foreground-subtle"),children:F?F.label:u}),e.jsxs("span",{className:"ml-2 flex items-center gap-1 shrink-0",children:[m&&F&&!f&&e.jsx("span",{role:"button",tabIndex:-1,onClick:_,"aria-label":"Clear selection",className:"text-foreground-subtle hover:text-foreground",children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})}),e.jsx(p.ChevronsUpDown,{className:"size-4 text-foreground-subtle","aria-hidden":!0})]})]})}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:x("z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:e.jsxs(de.Command,{shouldFilter:!a,className:"flex h-full w-full flex-col",children:[e.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[e.jsx(de.Command.Input,{value:k,onValueChange:D,placeholder:c,className:"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-foreground-subtle"}),R&&e.jsx(p.Loader2,{className:"size-4 animate-spin text-foreground-subtle","aria-hidden":!0})]}),e.jsxs(de.Command.List,{className:"max-h-64 overflow-y-auto p-1",children:[E.map(O=>{const K=O.value===t;return e.jsxs(de.Command.Item,{value:O.value,disabled:O.disabled,onSelect:ee=>{r(ee),y(!1)},className:x("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground","data-[selected=true]:bg-background-muted","data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none"),children:[e.jsx("span",{className:"flex-1",children:O.label}),O.description&&e.jsx("span",{className:"text-xs text-foreground-subtle",children:O.description}),K&&e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})]},O.value)}),!R&&E.length===0&&e.jsx(de.Command.Empty,{className:"px-2 py-6 text-center text-sm text-foreground-subtle",children:g})]})]})})})]}),d?e.jsx("p",{id:N,role:"alert",className:"text-xs text-danger-text",children:d}):i?e.jsx("p",{id:w,className:"text-xs text-foreground-subtle",children:i}):null]})});hr.displayName="Combobox";const br=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command,{ref:s,className:x("flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground",t),...r})});br.displayName="Command";const vr=l.forwardRef(function({className:t,...r},s){return e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3","cmdk-input-wrapper":"",children:[e.jsx(p.Search,{className:"size-4 shrink-0 text-foreground-subtle","aria-hidden":!0}),e.jsx(de.Command.Input,{ref:s,className:x("flex h-11 w-full bg-transparent py-3 text-sm outline-none","placeholder:text-foreground-subtle disabled:cursor-not-allowed disabled:opacity-50",t),...r})]})});vr.displayName="CommandInput";const wr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.List,{ref:s,className:x("max-h-[320px] overflow-y-auto p-1",t),...r})});wr.displayName="CommandList";const jr=l.forwardRef(function(t,r){return e.jsx(de.Command.Empty,{ref:r,className:"py-8 text-center text-sm text-foreground-subtle",...t})});jr.displayName="CommandEmpty";const yr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.Group,{ref:s,className:x("overflow-hidden text-foreground p-1","[&_[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-foreground-subtle",t),...r})});yr.displayName="CommandGroup";const Nr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});Nr.displayName="CommandSeparator";const Cr=l.forwardRef(function({className:t,...r},s){return e.jsx(de.Command.Item,{ref:s,className:x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none","data-[selected=true]:bg-background-muted data-[selected=true]:text-foreground","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:size-4 [&_svg]:text-foreground-subtle",t),...r})});Cr.displayName="CommandItem";function Ha({children:n,className:t}){return e.jsx("span",{className:x("ml-auto inline-flex items-center gap-0.5 text-xs tracking-widest text-foreground-subtle font-mono",t),children:n})}function Ua({open:n,onOpenChange:t,children:r,title:s="Command palette"}){return e.jsx(H.Root,{open:n,onOpenChange:t,children:e.jsxs(H.Portal,{children:[e.jsx(H.Overlay,{className:x("fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0")}),e.jsxs(H.Content,{className:x("fixed left-1/2 top-[20%] z-[var(--z-modal)] -translate-x-1/2","w-[calc(100%-2rem)] max-w-[640px] overflow-hidden","rounded-lg border border-border bg-popover text-popover-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95"),children:[e.jsx(H.Title,{className:"sr-only",children:s}),r]})]})})}function Va(n){const[t,r]=l.useState(0);l.useEffect(()=>{const s=a=>{a.key==="k"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),n(!0),r(o=>o+1))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[n])}const Ga=fe.Root,qa=fe.Trigger,Wa=fe.Group,Sr=fe.Portal,Xa=fe.Sub,Ka=fe.RadioGroup,Bt=x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none","data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),kr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(fe.SubTrigger,{ref:a,className:x(Bt,"data-[state=open]:bg-background-muted",t),...s,children:[r,e.jsx(p.ChevronRight,{className:"ml-auto size-4 text-foreground-subtle","aria-hidden":!0})]})});kr.displayName="ContextMenuSubTrigger";const Tr=l.forwardRef(function({className:t,...r},s){return e.jsx(fe.SubContent,{ref:s,className:x("z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",t),...r})});Tr.displayName="ContextMenuSubContent";const Dr=l.forwardRef(function({className:t,...r},s){return e.jsx(Sr,{children:e.jsx(fe.Content,{ref:s,className:x("z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})})});Dr.displayName="ContextMenuContent";const Rr=l.forwardRef(function({className:t,destructive:r,...s},a){return e.jsx(fe.Item,{ref:a,className:x(Bt,r&&"text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text",t),...s})});Rr.displayName="ContextMenuItem";const Ir=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(fe.CheckboxItem,{ref:a,className:x(Bt,"pl-8",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(fe.ItemIndicator,{children:e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})})}),r]})});Ir.displayName="ContextMenuCheckboxItem";const Mr=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(fe.RadioItem,{ref:a,className:x(Bt,"pl-8",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(fe.ItemIndicator,{children:e.jsx(p.Circle,{className:"size-2 fill-accent text-accent","aria-hidden":!0})})}),r]})});Mr.displayName="ContextMenuRadioItem";const Pr=l.forwardRef(function({className:t,...r},s){return e.jsx(fe.Label,{ref:s,className:x("px-2 py-1.5 text-xs font-medium text-foreground-subtle",t),...r})});Pr.displayName="ContextMenuLabel";const zr=l.forwardRef(function({className:t,...r},s){return e.jsx(fe.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});zr.displayName="ContextMenuSeparator";function Er({className:n,...t}){return e.jsx("span",{className:x("ml-auto text-xs tracking-widest text-foreground-subtle font-mono",n),...t})}Er.displayName="ContextMenuShortcut";const Ar=me.Root,Lr=me.Trigger,Ya=me.Group,Or=me.Portal,Qa=me.Sub,Ja=me.RadioGroup,Ht=x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none","data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","transition-colors duration-[var(--duration-fast)]"),Fr=l.forwardRef(function({className:t,inset:r,children:s,...a},o){return e.jsxs(me.SubTrigger,{ref:o,className:x(Ht,"data-[state=open]:bg-background-muted",r&&"pl-8",t),...a,children:[s,e.jsx(p.ChevronRight,{className:"ml-auto size-4 text-foreground-subtle","aria-hidden":!0})]})});Fr.displayName="DropdownMenuSubTrigger";const _r=l.forwardRef(function({className:t,...r},s){return e.jsx(me.SubContent,{ref:s,className:x("z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",t),...r})});_r.displayName="DropdownMenuSubContent";const bn=l.forwardRef(function({className:t,sideOffset:r=4,align:s="end",...a},o){return e.jsx(Or,{children:e.jsx(me.Content,{ref:o,sideOffset:r,align:s,className:x("z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1",t),...a})})});bn.displayName="DropdownMenuContent";const $r=l.forwardRef(function({className:t,inset:r,destructive:s,...a},o){return e.jsx(me.Item,{ref:o,className:x(Ht,r&&"pl-8",s&&"text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text",t),...a})});$r.displayName="DropdownMenuItem";const vn=l.forwardRef(function({className:t,children:r,checked:s,...a},o){return e.jsxs(me.CheckboxItem,{ref:o,checked:s,className:x(Ht,"pl-8",t),...a,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(me.ItemIndicator,{children:e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})})}),r]})});vn.displayName="DropdownMenuCheckboxItem";const Br=l.forwardRef(function({className:t,children:r,...s},a){return e.jsxs(me.RadioItem,{ref:a,className:x(Ht,"pl-8",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex size-4 items-center justify-center",children:e.jsx(me.ItemIndicator,{children:e.jsx(p.Circle,{className:"size-2 fill-accent text-accent","aria-hidden":!0})})}),r]})});Br.displayName="DropdownMenuRadioItem";const wn=l.forwardRef(function({className:t,inset:r,...s},a){return e.jsx(me.Label,{ref:a,className:x("px-2 py-1.5 text-xs font-medium text-foreground-subtle",r&&"pl-8",t),...s})});wn.displayName="DropdownMenuLabel";const jn=l.forwardRef(function({className:t,...r},s){return e.jsx(me.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});jn.displayName="DropdownMenuSeparator";function Hr({className:n,...t}){return e.jsx("span",{className:x("ml-auto text-xs tracking-widest text-foreground-subtle font-mono",n),...t})}Hr.displayName="DropdownMenuShortcut";const Za=Se.cva(["inline-flex items-center justify-center shrink-0","rounded-md","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none"],{variants:{variant:{primary:"bg-accent text-on-accent hover:bg-accent-700 active:bg-accent-800",secondary:"bg-background-muted text-foreground border border-border hover:bg-neutral-200 dark:hover:bg-neutral-800",outline:"border border-border bg-transparent text-foreground hover:bg-background-muted",ghost:"bg-transparent text-foreground-muted hover:bg-background-muted hover:text-foreground",destructive:"bg-danger text-on-danger hover:bg-danger-700 active:bg-danger-800"},size:{sm:"h-7 w-7 [&_svg]:size-3.5",md:"h-8 w-8 [&_svg]:size-4",lg:"h-10 w-10 [&_svg]:size-5"}},defaultVariants:{variant:"ghost",size:"md"}}),it=l.forwardRef(function({className:t,variant:r,size:s,icon:a,loading:o,disabled:i,type:d="button",...u},c){const g=i||o;return e.jsx("button",{ref:c,type:d,"aria-busy":o||void 0,disabled:g,className:x(Za({variant:r,size:s}),t),...u,children:o?e.jsx(p.Loader2,{className:"animate-spin","aria-hidden":"true"}):a})});it.displayName="IconButton";const eo=Se.cva(["group inline-flex items-center w-full","rounded-md border bg-card text-sm","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","has-disabled:opacity-50 has-disabled:pointer-events-none","focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-background"],{variants:{size:{sm:"h-8 px-2.5 gap-1.5",md:"h-9 px-3 gap-2",lg:"h-10 px-3.5 gap-2"},tone:{default:"border-border focus-within:border-accent focus-within:ring-ring",error:"border-danger focus-within:border-danger focus-within:ring-danger"}},defaultVariants:{size:"md",tone:"default"}}),to=Se.cva(["flex-1 min-w-0 bg-transparent outline-none","placeholder:text-foreground-subtle","text-foreground","disabled:cursor-not-allowed"]),se=l.forwardRef(function({className:t,type:r="text",size:s,tone:a,label:o,helperText:i,error:d,prefix:u,suffix:c,clearable:g,onClear:m,hideLabel:f,id:b,disabled:h,value:v,...j},w){const N=l.useId(),S=b??N,y=`${S}-helper`,k=`${S}-error`,[D,C]=l.useState(!1),T=r==="password"?D?"text":"password":r,R=!!d,L=R?"error":a,E=u??(r==="search"?e.jsx(p.Search,{className:"size-4 text-foreground-subtle","aria-hidden":!0}):null),F=v!==void 0&&v!==""&&v!==null;return e.jsxs("div",{className:x("flex flex-col gap-1.5",t),children:[o&&e.jsx("label",{htmlFor:S,className:x("text-sm font-medium text-foreground",f&&"sr-only"),children:o}),e.jsxs("div",{className:x(eo({size:s,tone:L})),children:[E&&e.jsx("span",{className:"flex items-center text-foreground-subtle [&_svg]:size-4",children:E}),e.jsx("input",{ref:w,id:S,type:T,disabled:h,value:v,"aria-invalid":R||void 0,"aria-describedby":d?k:i?y:void 0,className:x(to()),...j}),g&&F&&e.jsx("button",{type:"button",onClick:m,tabIndex:-1,"aria-label":"Clear input",className:"flex items-center text-foreground-subtle hover:text-foreground",children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})}),r==="password"&&e.jsx("button",{type:"button",onClick:()=>C(I=>!I),tabIndex:-1,"aria-label":D?"Hide password":"Show password","aria-pressed":D,className:"flex items-center text-foreground-subtle hover:text-foreground",children:D?e.jsx(p.EyeOff,{className:"size-4","aria-hidden":!0}):e.jsx(p.Eye,{className:"size-4","aria-hidden":!0})}),c&&e.jsx("span",{className:"flex items-center text-foreground-subtle [&_svg]:size-4",children:c})]}),d?e.jsx("p",{id:k,role:"alert",className:"text-xs text-danger-text",children:d}):i?e.jsx("p",{id:y,className:"text-xs text-foreground-subtle",children:i}):null]})});se.displayName="Input";const Ut=l.forwardRef(function({className:t,...r},s){return e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:s,className:x("w-full caption-bottom text-sm border-collapse",t),...r})})});Ut.displayName="Table";const Vt=l.forwardRef(function({className:t,...r},s){return e.jsx("thead",{ref:s,className:x("sticky top-0 z-10 bg-background-subtle text-foreground-muted","[&_tr]:border-b [&_tr]:border-border",t),...r})});Vt.displayName="TableHeader";const Gt=l.forwardRef(function({className:t,...r},s){return e.jsx("tbody",{ref:s,className:x("[&_tr:last-child]:border-0",t),...r})});Gt.displayName="TableBody";const Ur=l.forwardRef(function({className:t,...r},s){return e.jsx("tfoot",{ref:s,className:x("border-t border-border bg-background-subtle font-medium",t),...r})});Ur.displayName="TableFooter";const Ge=l.forwardRef(function({className:t,selected:r,...s},a){return e.jsx("tr",{ref:a,"data-selected":r||void 0,className:x("border-b border-border transition-colors duration-[var(--duration-fast)]","hover:bg-background-subtle","data-[selected]:bg-accent-soft data-[selected]:hover:bg-accent-soft",t),...s})});Ge.displayName="TableRow";const qe=l.forwardRef(function({className:t,...r},s){return e.jsx("th",{ref:s,className:x("h-10 px-3 text-left align-middle text-xs font-medium uppercase tracking-wide text-foreground-subtle","[&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0",t),...r})});qe.displayName="TableHead";const He=l.forwardRef(function({className:t,...r},s){return e.jsx("td",{ref:s,className:x("px-3 py-3 align-middle text-foreground",t),...r})});He.displayName="TableCell";const Vr=l.forwardRef(function({className:t,...r},s){return e.jsx("caption",{ref:s,className:x("mt-4 text-sm text-foreground-subtle",t),...r})});Vr.displayName="TableCaption";const yn=l.forwardRef(function({sortKey:t,currentSort:r,onSortChange:s,children:a,className:o,...i},d){const u=(r==null?void 0:r.key)===t,c=u?r==null?void 0:r.direction:void 0,g=()=>{s(t,u&&c==="asc"?"desc":"asc")};return e.jsx(qe,{ref:d,className:x("p-0",o),"aria-sort":u?c==="asc"?"ascending":"descending":"none",...i,children:e.jsxs("button",{type:"button",onClick:g,className:x("inline-flex h-10 w-full items-center gap-1.5 px-3 outline-none","transition-colors duration-[var(--duration-fast)]","hover:text-foreground focus-visible:text-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm",u&&"text-foreground"),children:[a,c==="asc"?e.jsx(p.ArrowUp,{className:"size-3.5","aria-hidden":!0}):c==="desc"?e.jsx(p.ArrowDown,{className:"size-3.5","aria-hidden":!0}):e.jsx(p.ArrowUpDown,{className:"size-3.5 opacity-40","aria-hidden":!0})]})})});yn.displayName="TableSortHeader";const Nn=l.forwardRef(function({className:t,variant:r,...s},a){return e.jsx("div",{ref:a,"aria-hidden":!0,className:x("animate-pulse bg-background-muted",r==="text"&&"h-3 rounded-sm",r==="circle"&&"rounded-full aspect-square",r==="avatar"&&"size-8 rounded-full",r==="card"&&"rounded-lg",!r&&"rounded-md",t),...s})});Nn.displayName="Skeleton";function Gr({columns:n,rows:t,loading:r,sort:s,onSortChange:a,filter:o,emptyState:i,className:d}){const[u,c]=l.useState({}),g=l.useMemo(()=>n.filter(f=>!u[f.key]),[n,u]),m=()=>r?Array.from({length:5}).map((f,b)=>e.jsx(Ge,{children:g.map(h=>e.jsx(He,{children:e.jsx(Nn,{variant:"text",className:"w-3/4"})},h.key))},`skel-${b}`)):t.length===0?e.jsx(Ge,{children:e.jsx(He,{colSpan:g.length,className:"h-32 text-center",children:i??e.jsx("span",{className:"text-foreground-subtle",children:"No results."})})}):t.map(f=>e.jsx(Ge,{children:g.map(b=>e.jsx(He,{className:x(b.align==="right"&&"text-right tabular"),children:b.cell?b.cell(f):f[b.key]},b.key))},f.id));return e.jsxs("div",{className:x("flex flex-col gap-3",d),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o?e.jsx(se,{type:"search",placeholder:o.placeholder??"Filter…",value:o.value,onChange:f=>o.onChange(f.target.value),clearable:!0,onClear:()=>o.onChange(""),className:"max-w-sm w-full",hideLabel:!0,label:"Filter rows"}):e.jsx("div",{}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(Ar,{children:[e.jsx(Lr,{asChild:!0,children:e.jsx(it,{"aria-label":"Column visibility",icon:e.jsx(p.Settings,{}),variant:"outline"})}),e.jsxs(bn,{children:[e.jsx(wn,{children:"Columns"}),e.jsx(jn,{}),n.map(f=>e.jsx(vn,{checked:!u[f.key],onCheckedChange:b=>c(h=>({...h,[f.key]:!b})),children:f.header},f.key))]})]})})]}),e.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:e.jsxs(Ut,{children:[e.jsx("colgroup",{children:g.map(f=>e.jsx("col",{style:f.width?{width:f.width}:void 0},f.key))}),e.jsx(Vt,{children:e.jsx(Ge,{children:g.map(f=>f.sortable&&a?e.jsx(yn,{sortKey:f.key,currentSort:s??null,onSortChange:(b,h)=>a({key:b,direction:h}),children:f.header},f.key):e.jsx(qe,{className:x(f.align==="right"&&"text-right"),children:f.header},f.key))})}),e.jsx(Gt,{children:m()})]})})]})}const qr={root:"p-3",month:"space-y-2",caption:"flex items-center justify-between px-1 pb-2",caption_label:"text-sm font-medium text-foreground",nav:"flex items-center gap-1",nav_button:"inline-flex size-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted hover:text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring",table:"w-full border-collapse",head_row:"flex",head_cell:"w-9 text-xs font-medium text-foreground-subtle",row:"flex w-full mt-1",cell:"relative size-9 p-0 text-center",day:"inline-flex size-9 items-center justify-center rounded-md text-sm text-foreground transition-colors outline-none hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring",day_selected:"bg-accent text-on-accent hover:bg-accent hover:text-on-accent",day_today:"font-semibold text-accent",day_outside:"text-foreground-subtle opacity-50",day_disabled:"text-foreground-subtle opacity-50 pointer-events-none",day_range_start:"rounded-l-md",day_range_end:"rounded-r-md",day_range_middle:"bg-accent-soft text-on-accent-soft rounded-none"},Wr={IconLeft:()=>e.jsx(p.ChevronLeft,{className:"size-4","aria-hidden":!0}),IconRight:()=>e.jsx(p.ChevronRight,{className:"size-4","aria-hidden":!0})};function Ot(n){return n?n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):""}function Xr({label:n,placeholder:t,hasValue:r,children:s,error:a,fieldId:o,disabled:i}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[n&&e.jsx("label",{htmlFor:o,className:"text-sm font-medium text-foreground",children:n}),e.jsx(Z.Trigger,{asChild:!0,children:e.jsxs("button",{id:o,type:"button",disabled:i,"aria-invalid":!!a||void 0,className:x("inline-flex h-9 w-full items-center justify-start gap-2 rounded-md border bg-card px-3 text-left text-sm","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:opacity-50 disabled:cursor-not-allowed",a?"border-danger focus-visible:border-danger focus-visible:ring-danger":"border-border focus-visible:border-accent focus-visible:ring-ring",!r&&"text-foreground-subtle"),children:[e.jsx(p.Calendar,{className:"size-4 text-foreground-subtle","aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r?s:t})]})}),a&&e.jsx("p",{role:"alert",className:"text-xs text-danger-text",children:a})]})}const Kr=l.forwardRef(function({value:t,onChange:r,label:s,placeholder:a="Pick a date",error:o,disabled:i,fromDate:d,toDate:u,className:c},g){const m=l.useId(),[f,b]=l.useState(!1);return e.jsx("div",{ref:g,className:x(c),children:e.jsxs(Z.Root,{open:f,onOpenChange:b,children:[e.jsx(Xr,{label:s,placeholder:a,hasValue:!!t,error:o,fieldId:m,disabled:i,children:Ot(t)}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md",children:e.jsx(gn.DayPicker,{mode:"single",selected:t,onSelect:h=>{r(h??void 0),h&&b(!1)},fromDate:d,toDate:u,classNames:qr,components:Wr})})})]})})});Kr.displayName="DatePicker";const Yr=l.forwardRef(function({value:t,onChange:r,label:s,placeholder:a="Pick a range",error:o,disabled:i,fromDate:d,toDate:u,className:c},g){const m=l.useId(),[f,b]=l.useState(!1),h=!!(t!=null&&t.from);return e.jsx("div",{ref:g,className:x(c),children:e.jsxs(Z.Root,{open:f,onOpenChange:b,children:[e.jsx(Xr,{label:s,placeholder:a,hasValue:h,error:o,fieldId:m,disabled:i,children:t!=null&&t.from&&t.to?`${Ot(t.from)} – ${Ot(t.to)}`:t!=null&&t.from?Ot(t.from):""}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md",children:e.jsx(gn.DayPicker,{mode:"range",selected:t,onSelect:r,numberOfMonths:2,fromDate:d,toDate:u,classNames:qr,components:Wr})})})]})})});Yr.displayName="DateRangePicker";const Qr=H.Root,no=H.Trigger,Jr=H.Portal,Zr=H.Close,Cn=l.forwardRef(function({className:t,...r},s){return e.jsx(H.Overlay,{ref:s,className:x("fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})});Cn.displayName="DialogOverlay";const Sn=l.forwardRef(function({className:t,children:r,showClose:s=!0,size:a="md",...o},i){return e.jsxs(Jr,{children:[e.jsx(Cn,{}),e.jsxs(H.Content,{ref:i,className:x("fixed left-1/2 top-1/2 z-[var(--z-modal)] -translate-x-1/2 -translate-y-1/2","w-[calc(100%-2rem)] rounded-lg border border-border bg-card text-card-foreground shadow-lg","p-6","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",a==="sm"&&"max-w-[400px]",a==="md"&&"max-w-[520px]",a==="lg"&&"max-w-[720px]",t),...o,children:[r,s&&e.jsx(H.Close,{"aria-label":"Close",className:x("absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-foreground-subtle","hover:bg-background-muted hover:text-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card","transition-colors duration-[var(--duration-fast)]"),children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})})]})]})});Sn.displayName="DialogContent";function kn({className:n,...t}){return e.jsx("div",{className:x("flex flex-col gap-1 pb-4",n),...t})}kn.displayName="DialogHeader";function Tn({className:n,...t}){return e.jsx("div",{className:x("flex flex-col-reverse gap-2 pt-6 sm:flex-row sm:justify-end",n),...t})}Tn.displayName="DialogFooter";const Dn=l.forwardRef(function({className:t,...r},s){return e.jsx(H.Title,{ref:s,className:x("text-lg font-semibold text-foreground leading-tight",t),...r})});Dn.displayName="DialogTitle";const Rn=l.forwardRef(function({className:t,...r},s){return e.jsx(H.Description,{ref:s,className:x("text-sm text-foreground-muted",t),...r})});Rn.displayName="DialogDescription";function es({open:n,onOpenChange:t,title:r,description:s,confirmLabel:a="Confirm",cancelLabel:o="Cancel",confirmVariant:i="primary",onConfirm:d,loading:u}){return e.jsx(Qr,{open:n,onOpenChange:t,children:e.jsxs(Sn,{size:"sm",children:[e.jsxs(kn,{children:[e.jsx(Dn,{children:r}),s&&e.jsx(Rn,{children:s})]}),e.jsxs(Tn,{children:[e.jsx(Zr,{asChild:!0,children:e.jsx(q,{variant:"outline",children:o})}),e.jsx(q,{variant:i,loading:u,onClick:d,children:a})]})]})})}es.displayName="ConfirmationDialog";const qt=l.forwardRef(function({icon:t,title:r,description:s,action:a,secondaryAction:o,className:i,...d},u){return e.jsxs("div",{ref:u,className:x("flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border bg-background-subtle p-10 text-center",i),...d,children:[t&&e.jsx("div",{className:"inline-flex size-12 items-center justify-center rounded-full bg-background-muted text-foreground-muted [&_svg]:size-6",children:t}),e.jsx("h3",{className:"text-base font-semibold text-foreground leading-tight",children:r}),s&&e.jsx("p",{className:"max-w-md text-sm text-foreground-muted leading-relaxed",children:s}),(a||o)&&e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[a,o]})]})});qt.displayName="EmptyState";const ro={404:{icon:e.jsx(p.AlertTriangle,{}),title:"Page not found",description:"We couldn't find what you were looking for."},500:{icon:e.jsx(p.XCircle,{}),title:"Something went wrong",description:"We're looking into it. Please try again in a moment."},generic:{icon:e.jsx(p.AlertTriangle,{}),title:"Unexpected error",description:"Something interrupted this action."}},ts=l.forwardRef(function({variant:t="generic",title:r,description:s,action:a,onRetry:o,className:i,...d},u){const c=ro[t];return e.jsxs("div",{ref:u,role:"alert",className:x("flex flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background-subtle p-10 text-center",i),...d,children:[e.jsx("div",{className:"inline-flex size-12 items-center justify-center rounded-full bg-danger-soft text-danger-text [&_svg]:size-6",children:c.icon}),e.jsx("h3",{className:"text-base font-semibold text-foreground leading-tight",children:r??c.title}),e.jsx("p",{className:"max-w-md text-sm text-foreground-muted leading-relaxed",children:s??c.description}),(a||o)&&e.jsx("div",{className:"mt-2 flex items-center gap-2",children:a??e.jsx(q,{onClick:o,variant:"outline",children:"Try again"})})]})});ts.displayName="ErrorState";const so=pn.FormProvider,ns=l.createContext(null);function ao(n){return e.jsx(ns.Provider,{value:{name:n.name},children:e.jsx(pn.Controller,{...n})})}const rs=l.createContext(null);function St(){const n=l.useContext(ns),t=l.useContext(rs),{getFieldState:r,formState:s}=pn.useFormContext();if(!n)throw new Error("useFormField must be used inside <FormField>");const a=r(n.name,s),o=(t==null?void 0:t.id)??"";return{id:o,name:n.name,formItemId:`${o}-item`,formDescriptionId:`${o}-desc`,formMessageId:`${o}-error`,...a}}const ss=l.forwardRef(function({className:t,...r},s){const a=l.useId();return e.jsx(rs.Provider,{value:{id:a},children:e.jsx("div",{ref:s,className:x("flex flex-col gap-1.5",t),...r})})});ss.displayName="FormItem";const as=l.forwardRef(function({className:t,...r},s){const{formItemId:a,error:o}=St();return e.jsx(ka.Root,{ref:s,htmlFor:a,className:x("text-sm font-medium text-foreground",o&&"text-danger-text",t),...r})});as.displayName="FormLabel";const os=l.forwardRef(function(t,r){const{error:s,formItemId:a,formDescriptionId:o,formMessageId:i}=St();return e.jsx(cr.Slot,{ref:r,id:a,"aria-describedby":s?`${o} ${i}`:o,"aria-invalid":!!s,...t})});os.displayName="FormControl";const is=l.forwardRef(function({className:t,...r},s){const{formDescriptionId:a}=St();return e.jsx("p",{ref:s,id:a,className:x("text-xs text-foreground-subtle",t),...r})});is.displayName="FormDescription";const ls=l.forwardRef(function({className:t,children:r,...s},a){const{error:o,formMessageId:i}=St(),d=o?String((o==null?void 0:o.message)??""):r;return d?e.jsx("p",{ref:a,id:i,role:"alert",className:x("text-xs text-danger-text",t),...s,children:d}):null});ls.displayName="FormError";const cs=l.forwardRef(function({size:t="sm",className:r,...s},a){return e.jsx("kbd",{ref:a,className:x("inline-flex items-center justify-center rounded border border-border bg-background-subtle font-mono","text-foreground-muted shadow-xs",t==="sm"?"h-5 min-w-5 px-1 text-[10px]":"h-6 min-w-6 px-1.5 text-xs",r),...s})});cs.displayName="Kbd";const ds=l.forwardRef(function({options:t,value:r,onChange:s,label:a,helperText:o,error:i,placeholder:d="Select…",emptyText:u="No results.",maxVisibleChips:c=4,clearable:g=!0,disabled:m,className:f},b){const h=l.useId(),v=h,j=`${h}-helper`,w=`${h}-error`,[N,S]=l.useState(!1),[y,k]=l.useState(""),D=l.useRef(null),C=l.useMemo(()=>t.filter(P=>r.includes(P.value)),[t,r]),T=l.useCallback(P=>{r.includes(P)?s(r.filter(_=>_!==P)):s([...r,P])},[r,s]),R=l.useCallback(()=>s([]),[s]),L=P=>{P.key==="Backspace"&&y===""&&r.length>0&&s(r.slice(0,-1))},E=C.slice(0,c),F=C.length-E.length,I=!!i;return e.jsxs("div",{ref:b,className:x("flex flex-col gap-1.5",f),children:[a&&e.jsx("label",{htmlFor:v,className:"text-sm font-medium text-foreground",children:a}),e.jsxs(Z.Root,{open:N,onOpenChange:S,children:[e.jsx(Z.Trigger,{asChild:!0,children:e.jsxs("div",{role:"combobox","aria-expanded":N,"aria-controls":`${v}-list`,"aria-haspopup":"listbox",id:v,tabIndex:m?-1:0,onKeyDown:L,"aria-disabled":m||void 0,"aria-invalid":I||void 0,"aria-describedby":I?w:o?j:void 0,className:x("flex w-full min-h-9 cursor-text flex-wrap items-center gap-1.5 rounded-md border bg-card px-2 py-1 text-sm","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background",I?"border-danger focus-visible:border-danger focus-visible:ring-danger":"border-border focus-visible:border-accent focus-visible:ring-ring",m&&"opacity-50 pointer-events-none"),onClick:()=>{var P;return(P=D.current)==null?void 0:P.focus()},children:[E.length===0&&e.jsx("span",{className:"text-foreground-subtle px-1",children:d}),E.map(P=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-accent-soft px-1.5 py-0.5 text-xs font-medium text-on-accent-soft",children:[P.label,e.jsx("button",{type:"button","aria-label":`Remove ${P.label}`,className:"inline-flex items-center text-on-accent-soft hover:text-foreground",onClick:_=>{_.stopPropagation(),T(P.value)},children:e.jsx(p.X,{className:"size-3","aria-hidden":!0})})]},P.value)),F>0&&e.jsxs("span",{className:"rounded-md bg-background-muted px-1.5 py-0.5 text-xs font-medium text-foreground-muted",children:["+",F," more"]}),e.jsx("input",{ref:D,value:y,onChange:P=>k(P.target.value),onFocus:()=>S(!0),className:"flex-1 min-w-[8ch] bg-transparent text-sm outline-none placeholder:text-foreground-subtle",placeholder:(C.length===0,""),disabled:m}),e.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[g&&C.length>0&&e.jsx("button",{type:"button","aria-label":"Clear all",onClick:P=>{P.stopPropagation(),R()},className:"text-foreground-subtle hover:text-foreground",children:e.jsx(p.X,{className:"size-4","aria-hidden":!0})}),e.jsx(p.ChevronsUpDown,{className:"size-4 text-foreground-subtle","aria-hidden":!0})]})]})}),e.jsx(Z.Portal,{children:e.jsx(Z.Content,{align:"start",sideOffset:4,className:x("z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),onOpenAutoFocus:P=>P.preventDefault(),children:e.jsx(de.Command,{shouldFilter:!1,className:"flex h-full w-full flex-col",children:e.jsxs(de.Command.List,{id:`${v}-list`,className:"max-h-64 overflow-y-auto p-1",children:[t.filter(P=>P.label.toLowerCase().includes(y.toLowerCase())).map(P=>{const _=r.includes(P.value);return e.jsxs(de.Command.Item,{value:P.value,disabled:P.disabled,onSelect:()=>T(P.value),className:x("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground","data-[selected=true]:bg-background-muted","data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none"),children:[e.jsx("span",{"aria-hidden":!0,className:x("flex size-4 items-center justify-center rounded-sm border",_?"border-accent bg-accent text-on-accent":"border-border"),children:_&&e.jsx(p.Check,{className:"size-3","aria-hidden":!0})}),e.jsx("span",{className:"flex-1",children:P.label}),P.description&&e.jsx("span",{className:"text-xs text-foreground-subtle",children:P.description})]},P.value)}),e.jsx(de.Command.Empty,{className:"px-2 py-6 text-center text-sm text-foreground-subtle",children:u})]})})})})]}),i?e.jsx("p",{id:w,role:"alert",className:"text-xs text-danger-text",children:i}):o?e.jsx("p",{id:j,className:"text-xs text-foreground-subtle",children:o}):null]})});ds.displayName="MultiSelect";const In=ue.Root,oo=ue.Value,Wt=l.forwardRef(function({className:t,placeholder:r,size:s="md",tone:a="default",...o},i){return e.jsxs(ue.Trigger,{ref:i,className:x("inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]","outline-none","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:opacity-50 disabled:cursor-not-allowed","data-[placeholder]:text-foreground-subtle",s==="sm"&&"h-8 px-2.5",s==="md"&&"h-9 px-3",s==="lg"&&"h-10 px-3.5",a==="default"?"border-border focus-visible:border-accent focus-visible:ring-ring":"border-danger focus-visible:border-danger focus-visible:ring-danger",t),...o,children:[e.jsx(ue.Value,{placeholder:r}),e.jsx(ue.Icon,{asChild:!0,children:e.jsx(p.ChevronsUpDown,{className:"size-4 text-foreground-subtle shrink-0","aria-hidden":!0})})]})});Wt.displayName="SelectTrigger";const us="flex h-6 cursor-default items-center justify-center text-foreground-subtle",Mn=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.ScrollUpButton,{ref:s,className:x(us,t),...r,children:e.jsx(p.ChevronUp,{className:"size-4","aria-hidden":!0})})});Mn.displayName="SelectScrollUpButton";const Pn=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.ScrollDownButton,{ref:s,className:x(us,t),...r,children:e.jsx(p.ChevronDown,{className:"size-4","aria-hidden":!0})})});Pn.displayName="SelectScrollDownButton";const Xt=l.forwardRef(function({className:t,children:r,position:s="popper",...a},o){return e.jsx(ue.Portal,{children:e.jsxs(ue.Content,{ref:o,position:s,className:x("z-[var(--z-popover)] min-w-[var(--radix-select-trigger-width)] max-h-96","overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground","shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",t),...a,children:[e.jsx(Mn,{}),e.jsx(ue.Viewport,{className:"p-1",children:r}),e.jsx(Pn,{})]})})});Xt.displayName="SelectContent";const zn=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.Label,{ref:s,className:x("px-2 py-1.5 text-xs font-medium text-foreground-subtle",t),...r})});zn.displayName="SelectLabel";const Ze=l.forwardRef(function({className:t,children:r,leadingIcon:s,...a},o){return e.jsxs(ue.Item,{ref:o,className:x("relative flex w-full cursor-default select-none items-center gap-2","rounded-sm px-2 py-1.5 pr-8 text-sm text-foreground outline-none","data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[s&&e.jsx("span",{className:"flex items-center text-foreground-subtle [&_svg]:size-4",children:s}),e.jsx(ue.ItemText,{children:r}),e.jsx("span",{className:"absolute right-2 flex items-center justify-center",children:e.jsx(ue.ItemIndicator,{children:e.jsx(p.Check,{className:"size-4 text-accent","aria-hidden":!0})})})]})});Ze.displayName="SelectItem";const fs=l.forwardRef(function({className:t,...r},s){return e.jsx(ue.Separator,{ref:s,className:x("-mx-1 my-1 h-px bg-border",t),...r})});fs.displayName="SelectSeparator";const ms=l.forwardRef(function({label:t,children:r,...s},a){return e.jsxs(ue.Group,{ref:a,...s,children:[t&&e.jsx(zn,{children:t}),r]})});ms.displayName="SelectGroup";function io(n,t,r=7){if(t<=r)return Array.from({length:t},(d,u)=>u+1);const s=1,a=[],o=Math.max(2,n-s),i=Math.min(t-1,n+s);a.push(1),o>2&&a.push("gap");for(let d=o;d<=i;d++)a.push(d);return i<t-1&&a.push("gap"),a.push(t),a}const En=l.forwardRef(function({page:t,pageCount:r,onPageChange:s,totalItems:a,pageSize:o,pageSizeOptions:i,onPageSizeChange:d,showJump:u=!0,className:c,...g},m){const f=l.useMemo(()=>io(t,r),[t,r]),b=o?(t-1)*o+1:void 0,h=o&&a?Math.min(t*o,a):void 0,v=j=>{j<1||j>r||j===t||s(j)};return e.jsxs("nav",{ref:m,"aria-label":"Pagination",className:x("flex flex-wrap items-center justify-between gap-3",c),...g,children:[e.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground-muted",children:[a!==void 0&&o!==void 0&&e.jsxs("span",{className:"tabular",children:["Showing ",b,"–",h," of ",a]}),i&&d&&o!==void 0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:"page-size",className:"sr-only",children:"Rows per page"}),e.jsxs(In,{value:String(o),onValueChange:j=>d(Number(j)),children:[e.jsx(Wt,{size:"sm",className:"w-20"}),e.jsx(Xt,{children:i.map(j=>e.jsxs(Ze,{value:String(j),children:[j," / page"]},j))})]})]})]}),e.jsxs("ul",{className:"flex items-center gap-1",children:[u&&e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Go to first page",disabled:t===1,onClick:()=>v(1),className:Pt,children:e.jsx(p.ChevronsLeft,{className:"size-4","aria-hidden":!0})})}),e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Previous page",disabled:t===1,onClick:()=>v(t-1),className:Pt,children:e.jsx(p.ChevronLeft,{className:"size-4","aria-hidden":!0})})}),f.map((j,w)=>j==="gap"?e.jsx("li",{className:"px-2 text-foreground-subtle",children:"…"},`gap-${w}`):e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":`Page ${j}`,"aria-current":j===t?"page":void 0,onClick:()=>v(j),className:x("inline-flex size-8 items-center justify-center rounded-md text-sm tabular outline-none","transition-colors duration-[var(--duration-fast)]","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",j===t?"bg-accent text-on-accent font-medium":"text-foreground-muted hover:bg-background-muted hover:text-foreground"),children:j})},j)),e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Next page",disabled:t===r,onClick:()=>v(t+1),className:Pt,children:e.jsx(p.ChevronRight,{className:"size-4","aria-hidden":!0})})}),u&&e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":"Go to last page",disabled:t===r,onClick:()=>v(r),className:Pt,children:e.jsx(p.ChevronsRight,{className:"size-4","aria-hidden":!0})})})]})]})});En.displayName="Pagination";const Pt=x("inline-flex size-8 items-center justify-center rounded-md text-foreground-muted","transition-colors duration-[var(--duration-fast)]","hover:bg-background-muted hover:text-foreground","disabled:opacity-50 disabled:pointer-events-none","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"),lo=Z.Root,co=Z.Trigger,uo=Z.Anchor,fo=Z.Close,xs=l.forwardRef(function({className:t,align:r="center",sideOffset:s=4,...a},o){return e.jsx(Z.Portal,{children:e.jsx(Z.Content,{ref:o,align:r,sideOffset:s,className:x("z-[var(--z-popover)] w-72 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-md","outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1","data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1",t),...a})})});xs.displayName="PopoverContent";const mo={sm:"h-1",md:"h-1.5",lg:"h-2"},xo={accent:"bg-accent",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},gs=l.forwardRef(function({className:t,value:r,size:s="md",tone:a="accent",...o},i){const d=r==null;return e.jsxs(Yn.Root,{ref:i,value:d?void 0:r,className:x("relative w-full overflow-hidden rounded-full bg-background-muted",mo[s],t),...o,children:[e.jsx(Yn.Indicator,{className:x("h-full w-full flex-1 transition-transform",xo[a],d&&"animate-[progressIndeterminate_1.4s_ease-in-out_infinite] origin-left"),style:d?void 0:{transform:`translateX(-${100-(r??0)}%)`}}),e.jsx("style",{children:`
2
2
  @keyframes progressIndeterminate {
3
3
  0% { transform: translateX(-100%) scaleX(0.6); }
4
4
  50% { transform: translateX(0%) scaleX(0.4); }