@akshar-technosoft/ui 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data/data-table/data-table-action-bar.d.cts +1 -1
- package/dist/components/data/data-table/data-table-action-bar.d.ts +1 -1
- package/dist/components/data/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/data/data-table/data-table-pagination.cjs.map +1 -1
- package/dist/components/data/data-table/data-table-pagination.js +1 -1
- package/dist/components/data/data-table/data-table-pagination.js.map +1 -1
- package/dist/components/data/data-table/data-table-toolbar.cjs +1 -1
- package/dist/components/data/data-table/data-table-toolbar.cjs.map +1 -1
- package/dist/components/data/data-table/data-table-toolbar.d.cts +2 -1
- package/dist/components/data/data-table/data-table-toolbar.d.ts +2 -1
- package/dist/components/data/data-table/data-table-toolbar.js +1 -1
- package/dist/components/data/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data/data-table/data-table-types.cjs.map +1 -1
- package/dist/components/data/data-table/data-table-types.d.cts +7 -0
- package/dist/components/data/data-table/data-table-types.d.ts +7 -0
- package/dist/components/data/data-table/data-table.cjs +1 -1
- package/dist/components/data/data-table/data-table.cjs.map +1 -1
- package/dist/components/data/data-table/data-table.d.cts +1 -1
- package/dist/components/data/data-table/data-table.d.ts +1 -1
- package/dist/components/data/data-table/data-table.js +1 -1
- package/dist/components/data/data-table/data-table.js.map +1 -1
- package/dist/components/data/data-table/index.cjs +1 -1
- package/dist/components/data/data-table/index.cjs.map +1 -1
- package/dist/components/data/data-table/index.d.cts +1 -1
- package/dist/components/data/data-table/index.d.ts +1 -1
- package/dist/components/data/data-table/index.js +1 -1
- package/dist/components/data/data-table/index.js.map +1 -1
- package/dist/components/date-helper.cjs +3 -0
- package/dist/components/date-helper.cjs.map +1 -0
- package/dist/components/date-helper.d.cts +27 -0
- package/dist/components/date-helper.d.ts +27 -0
- package/dist/components/date-helper.js +3 -0
- package/dist/components/date-helper.js.map +1 -0
- package/dist/components/helper/date-filter.cjs +3 -0
- package/dist/components/helper/date-filter.cjs.map +1 -0
- package/dist/components/helper/date-filter.d.cts +14 -0
- package/dist/components/helper/date-filter.d.ts +14 -0
- package/dist/components/helper/date-filter.js +3 -0
- package/dist/components/helper/date-filter.js.map +1 -0
- package/dist/components/ui/badge.d.cts +2 -2
- package/dist/components/ui/badge.d.ts +2 -2
- package/dist/components/ui/button.d.cts +2 -2
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/calendar.cjs +3 -0
- package/dist/components/ui/calendar.cjs.map +1 -0
- package/dist/components/ui/calendar.d.cts +13 -0
- package/dist/components/ui/calendar.d.ts +13 -0
- package/dist/components/ui/calendar.js +3 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/toggle.d.cts +2 -2
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
"use strict";var vo=Object.create;var he=Object.defineProperty;var Co=Object.getOwnPropertyDescriptor;var xo=Object.getOwnPropertyNames;var ho=Object.getPrototypeOf,wo=Object.prototype.hasOwnProperty;var yo=(e,t)=>{for(var i in t)he(e,i,{get:t[i],enumerable:!0})},ut=(e,t,i,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of xo(t))!wo.call(e,c)&&c!==i&&he(e,c,{get:()=>t[c],enumerable:!(m=Co(t,c))||m.enumerable});return e};var gt=(e,t,i)=>(i=e!=null?vo(ho(e)):{},ut(t||!e||!e.__esModule?he(i,"default",{value:e,enumerable:!0}):i,e)),Po=e=>ut(he({},"__esModule",{value:!0}),e);var zo={};yo(zo,{DataTable:()=>Mt,DataTableActionBar:()=>_t,DataTableActionBarAction:()=>Ft,DataTableActionBarSelection:()=>Bt,DataTableColumnHeader:()=>At,DataTableFacetedFilter:()=>Yt,DataTablePagination:()=>Me,DataTableToolbar:()=>Re,DataTableViewOptions:()=>Lt});module.exports=Po(zo);var M=require("@tanstack/react-table"),D=require("lucide-react");var vt=require("radix-ui"),Ct=require("class-variance-authority");var ft=require("clsx"),bt=require("tailwind-merge");function a(...e){return(0,bt.twMerge)((0,ft.clsx)(e))}var xt=require("react/jsx-runtime"),Do=(0,Ct.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function C({className:e,variant:t,size:i,asChild:m=!1,...c}){let p=m?vt.Slot.Slot:"button";return(0,xt.jsx)(p,{"data-slot":"button",className:a(Do({variant:t,size:i,className:e}),"transition-none"),...c})}var j=require("react/jsx-runtime");function $e({className:e,...t}){return(0,j.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-auto max-h-full",children:(0,j.jsx)("table",{"data-slot":"table",className:a("w-full caption-bottom text-sm",e),...t})})}function ht({className:e,...t}){return(0,j.jsx)("thead",{"data-slot":"table-header",className:a("[&_tr]:border-b",e),...t})}function wt({className:e,...t}){return(0,j.jsx)("tbody",{"data-slot":"table-body",className:a("[&_tr:last-child]:border-0",e),...t})}function yt({className:e,...t}){return(0,j.jsx)("tfoot",{"data-slot":"table-footer",className:a("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function pe({className:e,...t}){return(0,j.jsx)("tr",{"data-slot":"table-row",className:a("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Pt({className:e,...t}){return(0,j.jsx)("th",{"data-slot":"table-head",className:a("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function we({className:e,...t}){return(0,j.jsx)("td",{"data-slot":"table-cell",className:a("p-2 align-middle whitespace-nowrap",e),...t})}var qe=require("react/jsx-runtime");function ye({className:e,...t}){return(0,qe.jsx)("div",{"data-slot":"card",className:a("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Pe({className:e,...t}){return(0,qe.jsx)("div",{"data-slot":"card-content",className:a("px-6",e),...t})}var te=require("radix-ui");var W=require("react/jsx-runtime");function ue({delayDuration:e=0,...t}){return(0,W.jsx)(te.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ke({...e}){return(0,W.jsx)(ue,{children:(0,W.jsx)(te.Tooltip.Root,{"data-slot":"tooltip",...e})})}function Xe({...e}){return(0,W.jsx)(te.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function Je({className:e,sideOffset:t=0,children:i,...m}){return(0,W.jsx)(te.Tooltip.Portal,{children:(0,W.jsxs)(te.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:a("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...m,children:[i,(0,W.jsx)(te.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var y=require("lucide-react");var Dt=require("react/jsx-runtime");function Qe({className:e,type:t,...i}){return(0,Dt.jsx)("input",{type:t,"data-slot":"input",className:a("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...i})}var I=require("radix-ui"),oe=require("lucide-react");var w=require("react/jsx-runtime");function De({...e}){return(0,w.jsx)(I.Select.Root,{"data-slot":"select",...e})}function Ne({...e}){return(0,w.jsx)(I.Select.Value,{"data-slot":"select-value",...e})}function Te({className:e,size:t="default",children:i,...m}){return(0,w.jsxs)(I.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:a("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...m,children:[i,(0,w.jsx)(I.Select.Icon,{asChild:!0,children:(0,w.jsx)(oe.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function Se({className:e,children:t,position:i="popper",...m}){return(0,w.jsx)(I.Select.Portal,{children:(0,w.jsxs)(I.Select.Content,{"data-slot":"select-content",className:a("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:i,...m,children:[(0,w.jsx)(No,{}),(0,w.jsx)(I.Select.Viewport,{className:a("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,w.jsx)(To,{})]})})}function ge({className:e,children:t,...i}){return(0,w.jsxs)(I.Select.Item,{"data-slot":"select-item",className:a("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...i,children:[(0,w.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,w.jsx)(I.Select.ItemIndicator,{children:(0,w.jsx)(oe.CheckIcon,{className:"size-4"})})}),(0,w.jsx)(I.Select.ItemText,{children:t})]})}function No({className:e,...t}){return(0,w.jsx)(I.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:a("flex cursor-default items-center justify-center py-1",e),...t,children:(0,w.jsx)(oe.ChevronUpIcon,{className:"size-4"})})}function To({className:e,...t}){return(0,w.jsx)(I.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:a("flex cursor-default items-center justify-center py-1",e),...t,children:(0,w.jsx)(oe.ChevronDownIcon,{className:"size-4"})})}var G=require("radix-ui"),ke=require("lucide-react");var R=require("react/jsx-runtime");function $({...e}){return(0,R.jsx)(G.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function q({...e}){return(0,R.jsx)(G.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function K({className:e,sideOffset:t=4,...i}){return(0,R.jsx)(G.DropdownMenu.Portal,{children:(0,R.jsx)(G.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:a("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...i})})}function Ye({...e}){return(0,R.jsx)(G.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function S({className:e,inset:t,variant:i="default",...m}){return(0,R.jsx)(G.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":i,className:a("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...m})}function fe({className:e,children:t,checked:i,...m}){return(0,R.jsxs)(G.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:a("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:i,...m,children:[(0,R.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,R.jsx)(G.DropdownMenu.ItemIndicator,{children:(0,R.jsx)(ke.CheckIcon,{className:"size-4"})})}),t]})}function H({className:e,inset:t,...i}){return(0,R.jsx)(G.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:a("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...i})}function O({className:e,...t}){return(0,R.jsx)(G.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:a("bg-border -mx-1 my-1 h-px",e),...t})}var r=require("react/jsx-runtime");function Re({table:e,filters:t=[],globalFilter:i,onGlobalFilterChange:m,enableGlobalFilter:c=!0,onExport:p,onRefresh:V,loading:_=!1,enableColumnVisibility:le=!0,data:ae,onClearSorting:Z,onClearFilters:de,enableColumnPinning:X=!1}){let me=()=>e.getAllLeafColumns().filter(s=>s.getCanHide?.()!==!1),ne=()=>e.getAllColumns().filter(s=>!e.getAllLeafColumns().includes(s)&&s.columns?.length&&s.columns.some(l=>l.getCanHide?.()!==!1)),re=()=>{let s=new Set(ne().flatMap(l=>l.columns?.filter(A=>A.getCanHide?.()!==!1).map(A=>A.id)||[]));return me().filter(l=>!s.has(l.id))},ce=(s,l)=>l&&s.startsWith(`${l}.`)?s.replace(`${l}.`,"").split("_").map(Ce=>Ce.slice(1)).join(" "):s.split("_").map(A=>A.charAt(0).toUpperCase()+A.slice(1)).join(" ");return(0,r.jsx)("div",{className:"rounded-xl",children:(0,r.jsx)("div",{className:"px-2",children:(0,r.jsx)("div",{className:"flex flex-col gap-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,r.jsx)(y.Filter,{className:"h-4 w-4"})}),t.map(s=>(0,r.jsx)("div",{className:a("relative min-w-[150px]",s.width),children:s.type==="select"?(0,r.jsxs)(De,{value:e.getColumn(s.key)?.getFilterValue()??"",onValueChange:l=>e.getColumn(s.key)?.setFilterValue(l==="all"?"":l),children:[s.icon&&(0,r.jsx)("span",{children:(0,r.jsx)(s.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),(0,r.jsx)(Te,{className:a("h-9 rounded-lg w-full",s.icon&&"pl-9"),children:(0,r.jsx)(Ne,{placeholder:s.placeholder})}),(0,r.jsxs)(Se,{className:"rounded-lg",children:[(0,r.jsx)(ge,{value:"all",children:"All"}),s.options?.map(l=>(0,r.jsx)(ge,{value:l.value,children:l.label},l.label))]})]}):(0,r.jsxs)("div",{className:"relative",children:[s.icon&&(0,r.jsx)("span",{children:(0,r.jsx)(s.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),(0,r.jsx)(Qe,{placeholder:s.placeholder,value:e.getColumn(s.key)?.getFilterValue()??"",onChange:l=>e.getColumn(s.key)?.setFilterValue(l.target.value),className:a("h-9 rounded-lg",s.icon&&"pl-9"),type:s.type==="number"?"number":s.type==="date"?"date":"text"})]})},s.key))]})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(y.Search,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(Qe,{placeholder:"Global search...",value:i??"",onChange:s=>m(s.target.value),className:"pl-9 max-w-max"})]}),p&&(0,r.jsxs)(C,{variant:"outline",size:"sm",onClick:()=>p(ae),className:"rounded-lg",children:[(0,r.jsx)(y.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),le&&(0,r.jsxs)($,{children:[(0,r.jsx)(q,{asChild:!0,children:(0,r.jsxs)(C,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[(0,r.jsx)("span",{children:"Columns"}),(0,r.jsx)(y.ChevronDown,{className:"h-4 w-4 opacity-50"})]})}),(0,r.jsxs)(K,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,r.jsx)(H,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,r.jsx)(O,{}),re().length>0&&(0,r.jsxs)(Ye,{children:[(0,r.jsx)(H,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),re().map(s=>(0,r.jsx)(fe,{className:"text-sm",checked:s.getIsVisible(),onCheckedChange:l=>s.toggleVisibility(!!l),children:ce(s.id)},s.id))]}),ne().map(s=>(0,r.jsxs)(Ye,{children:[(0,r.jsx)(O,{}),(0,r.jsx)(H,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:s.id}),s.columns?.filter(l=>l.getCanHide?.()!==!1).map(l=>(0,r.jsx)(fe,{className:"text-sm",checked:l.getIsVisible(),onCheckedChange:A=>l.toggleVisibility(!!A),children:ce(l.id,s.id)},l.id))]},s.id))]})]}),(0,r.jsxs)($,{children:[(0,r.jsx)(q,{asChild:!0,children:(0,r.jsx)(C,{variant:"outline",size:"sm",className:"rounded-lg",children:(0,r.jsx)(y.Settings2,{className:"h-4 w-4"})})}),(0,r.jsxs)(K,{align:"end",className:"w-[200px] rounded-lg",children:[(0,r.jsx)(H,{children:"Table Settings"}),(0,r.jsx)(O,{}),(0,r.jsxs)(S,{onClick:Z,children:[(0,r.jsx)(y.ArrowUpDown,{className:"mr-2 h-4 w-4"}),"Clear All Sorting"]}),(0,r.jsxs)(S,{onClick:de,children:[(0,r.jsx)(y.Filter,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]}),X&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O,{}),(0,r.jsx)(H,{children:"Column Pinning"}),(0,r.jsxs)(S,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[(0,r.jsx)(y.PinOff,{className:"mr-2 h-4 w-4"}),"Reset All Pinning"]}),(0,r.jsxs)(S,{onClick:()=>{let s=me().filter(l=>l.getCanPin?.()!==!1).map(l=>l.id);e.setColumnPinning({left:s,right:[]})},children:[(0,r.jsx)(y.Pin,{className:"mr-2 h-4 w-4 rotate-90"}),"Pin All Left"]}),(0,r.jsxs)(S,{onClick:()=>{let s=me().filter(l=>l.getCanPin?.()!==!1).map(l=>l.id);e.setColumnPinning({left:[],right:s})},children:[(0,r.jsx)(y.Pin,{className:"mr-2 h-4 w-4 -rotate-90"}),"Pin All Right"]})]})]})]}),V&&(0,r.jsx)(C,{variant:"outline",size:"sm",onClick:V,disabled:_,className:"rounded-lg",children:(0,r.jsx)(y.RefreshCw,{className:a("h-4 w-4",_&&"animate-spin")})})]})]})})})})}var x=require("react/jsx-runtime");function Me({table:e,config:t}){return t.enabled?(0,x.jsx)("div",{className:"rounded-xl",children:(0,x.jsx)("div",{children:(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,x.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,x.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,x.jsxs)(De,{value:`${e.getState().pagination.pageSize}`,onValueChange:i=>e.setPageSize(Number(i)),children:[(0,x.jsx)(Te,{className:"h-9 w-[70px] rounded-lg",children:(0,x.jsx)(Ne,{})}),(0,x.jsx)(Se,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(i=>(0,x.jsx)(ge,{value:`${i}`,children:i},i))})]})]}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,x.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,x.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(i,m)=>{let c=e.getState().pagination.pageIndex,p=c-2+m+1;return p<1||p>e.getPageCount()?null:(0,x.jsx)(C,{variant:p===c+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(p-1),children:p},p)})}),(0,x.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,x.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}var Nt=require("radix-ui"),Tt=require("class-variance-authority");var kt=require("react/jsx-runtime"),So=(0,Tt.cva)("inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 px-0 min-w-7",default:"h-8 px-1 min-w-8",lg:"h-9 px-2 min-w-10"},bg:{enabled:"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",disabled:""}},defaultVariants:{variant:"default",size:"default",bg:"enabled"}});function St({className:e,variant:t,size:i,noBg:m,...c}){return(0,kt.jsx)(Nt.Toggle.Root,{"data-slot":"toggle",className:a(So({className:e,variant:t,size:i,bg:m?"disabled":"enabled"})),...c})}var Ze=require("radix-ui"),Rt=require("lucide-react");var ze=require("react/jsx-runtime");function et({className:e,...t}){return(0,ze.jsx)(Ze.Checkbox.Root,{"data-slot":"checkbox",className:a("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,ze.jsx)(Ze.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,ze.jsx)(Rt.CheckIcon,{className:"size-3.5"})})})}var T=require("react"),o=require("react/jsx-runtime");function Mt({data:e,columns:t,filters:i=[],pagination:m={enabled:!1},settings:c={},header:p,footer:V,className:_="",maxHeight:le="600px",loading:ae=!1,error:Z,emptyMessage:de="No data available",onRowSelectionChange:X,onExport:me,onRefresh:ne,onTableReady:re,children:ce,isRowDisabled:s,isRowSelectable:l}){let[A,Ce]=(0,T.useState)([]),[Zt,at]=(0,T.useState)([]),[eo,to]=(0,T.useState)({}),[Le,oo]=(0,T.useState)({}),[nt,Ge]=(0,T.useState)(""),[ao,no]=(0,T.useState)([]),[He,ro]=(0,T.useState)(c.enableColumnPinning?{left:[],right:[]}:{}),{enableSorting:Oe=!0,enableFiltering:Ee=!0,enableGlobalFilter:rt=!0,enableColumnVisibility:Ue=!0,enableRowSelection:k=!0,stickyHeader:io=!0,toolbar:so=!1,showSerialNumbers:ee=!0,fixedCheckboxColumn:xe=!0,striped:lo=!0,hoverable:mo=!0,compact:it=!0,bordered:st=!0,fullHeight:co=!1,enableColumnResizing:lt=!1,enableColumnPinning:z=!0,hideHeader:po=!1}=c,je=(0,T.useMemo)(()=>{let g=[...t],b=f=>f.map(d=>{if(d.id==="select"||d.id==="serialNumber")return d;let v={...d,enablePinning:!0};return d.columns&&(v.columns=b(d.columns)),v}),n=b(g);if(k){let f={id:"select",header:({table:d})=>{let v=d.getRowModel().rows.filter(B=>!s?.(B.original)&&(l?l(B.original):!0)),F=v.length>0&&v.every(B=>B.getIsSelected()),L=v.some(B=>B.getIsSelected());return(0,o.jsx)(et,{checked:F||L&&"indeterminate",onCheckedChange:B=>{v.forEach(ie=>ie.toggleSelected(!!B))},"aria-label":"Select all selectable rows"})},cell:({row:d})=>{let v=s?s(d.original):!1,F=l?l(d.original):!0;return(0,o.jsx)("div",{className:a("flex items-center justify-center",v&&"opacity-50"),children:(0,o.jsx)(et,{checked:d.getIsSelected(),onCheckedChange:L=>F&&d.toggleSelected(!!L),"aria-label":"Select row",disabled:v||!F})})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:10};n.unshift(f)}if(ee){let f={id:"serialNumber",header:"No.",cell:({row:d})=>(0,o.jsx)("div",{className:"text-center font-medium text-muted-foreground",children:d.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};n.unshift(f)}return n},[t,ee,k,xe,s,l]),P=(0,M.useReactTable)({data:e,columns:je,onSortingChange:Oe?Ce:void 0,onColumnFiltersChange:Ee?at:void 0,onGlobalFilterChange:rt?Ge:void 0,getCoreRowModel:(0,M.getCoreRowModel)(),getPaginationRowModel:m.enabled?(0,M.getPaginationRowModel)():void 0,getSortedRowModel:Oe?(0,M.getSortedRowModel)():void 0,getFilteredRowModel:Ee?(0,M.getFilteredRowModel)():void 0,onColumnVisibilityChange:Ue?to:void 0,onRowSelectionChange:k?oo:void 0,onColumnOrderChange:no,onColumnPinningChange:z?ro:void 0,state:{sorting:Oe?A:void 0,columnFilters:Ee?Zt:void 0,columnVisibility:Ue?eo:void 0,rowSelection:k?Le:{},globalFilter:nt,columnOrder:ao,columnPinning:z?He:{}},initialState:{pagination:m.enabled?{pageSize:m.pageSize||10}:void 0,columnPinning:z?{left:[...ee?["serialNumber"]:[],...k?["select"]:[]],right:[]}:void 0},enableRowSelection:k,enableColumnResizing:lt,enableColumnPinning:z,columnResizeMode:"onChange"});(0,T.useEffect)(()=>{re&&re(P)},[P,re]),(0,T.useEffect)(()=>{if(k&&X){let g=P.getFilteredSelectedRowModel().rows.map(b=>b.original);X(g)}},[Le,k,X,P]),(0,T.useEffect)(()=>{if(k&&X){let g=P.getFilteredSelectedRowModel().rows.filter(b=>!s?.(b.original)&&(l?l(b.original):!0)).map(b=>b.original);X(g)}},[Le,k,X,P,s,l]);let uo=(0,T.useCallback)(()=>{Ce([])},[]),go=(0,T.useCallback)(()=>{at([]),Ge("")},[]),dt=(g,b)=>{if(!z)return;let n=[...ee?["serialNumber"]:[],...k&&xe?["select"]:[]],f={left:[...(He.left??[]).filter(d=>n.includes(d))],right:[...He.right??[]]};b===!1?(f.left=f.left.filter(d=>d!==g),f.right=f.right.filter(d=>d!==g)):b==="right"?(f.left=f.left.filter(d=>d!==g),f.right.includes(g)||f.right.push(g)):b==="left"&&(f.right=f.right.filter(d=>d!==g),!f.left.includes(g)&&!n.includes(g)&&f.left.push(g)),P.setColumnPinning(f)},fo=()=>(0,o.jsx)(ht,{className:a(io&&"sticky top-0 bg-sidebar z-20"),children:P.getHeaderGroups().map((g,b)=>(0,o.jsx)(pe,{className:"hover:bg-transparent",children:g.headers.map((n,f)=>{let d=n.depth===0&&n.colSpan>1,v=z&&(n.column.getIsPinned()==="left"||n.column.id==="serialNumber"||n.column.id==="select"&&k),F=z&&n.column.getIsPinned()==="right",L=n.column.getCanSort(),B=z&&n.column.columnDef.enablePinning!==!1,ie=n.column.id==="serialNumber",We=n.column.id==="select",pt=ie||We&&xe,se=n.column.columnDef.headerAlign||"left",bo={left:"justify-start",center:"justify-center",right:"justify-end"}[se];return(0,o.jsxs)(Pt,{colSpan:n.colSpan,className:a("font-semibold text-foreground bg-sidebar group px-0",!it&&"py-2",st&&f<g.headers.length-1&&"border-r","relative",v&&"sticky left-0 z-15 bg-sidebar",F&&"sticky right-0 z-15 bg-sidebar",(ie||We)&&"sticky left-0 z-15 bg-sidebar",d?"text-center":"text-left"),style:{width:n.getSize()!==150?n.getSize():"auto",minWidth:n.getSize()!==150?n.getSize():"auto",...v&&{left:ie?0:We?ee&&P.getColumn("serialNumber")?.getSize()||0:mt(n.column)},...F&&{right:ct(n.column)},...ie&&{left:0}},children:[d?(0,o.jsx)("div",{className:"flex items-center justify-center",children:(0,M.flexRender)(n.column.columnDef.header,n.getContext())}):(0,o.jsxs)("div",{className:a("relative flex items-center w-full px-2",bo),children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[L&&se==="right"&&(0,o.jsx)("span",{className:"ml-1 order-2",children:n.column.getIsSorted()&&{asc:(0,o.jsx)(D.ChevronUp,{className:"h-4 w-4"}),desc:(0,o.jsx)(D.ChevronDown,{className:"h-4 w-4"})}[n.column.getIsSorted()]}),n.isPlaceholder?null:(0,M.flexRender)(n.column.columnDef.header,n.getContext()),L&&se!=="right"&&n.column.getIsSorted()&&(0,o.jsx)("span",{className:"ml-1 order-2",children:n.column.getIsSorted()&&{asc:(0,o.jsx)(D.ChevronUp,{className:"h-4 w-4"}),desc:(0,o.jsx)(D.ChevronDown,{className:"h-4 w-4"})}[n.column.getIsSorted()]})]}),(L||B&&!pt)&&(0,o.jsxs)($,{children:[(0,o.jsx)(q,{asChild:!0,className:a("absolute",se==="left"&&"right-1",se==="center"&&"right-1",se==="right"&&"left-1"),children:(0,o.jsx)(St,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:(0,o.jsx)(D.MoreHorizontal,{className:"h-4 w-4"})})}),(0,o.jsxs)(K,{align:"end",className:"w-48",children:[L&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(H,{children:"Sorting"}),(0,o.jsxs)(S,{onClick:()=>n.column.toggleSorting(!1),children:[(0,o.jsx)(D.ChevronUp,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),(0,o.jsxs)(S,{onClick:()=>n.column.toggleSorting(!0),children:[(0,o.jsx)(D.ChevronDown,{className:"mr-2 h-4 w-4"}),"Sort Descending"]}),(0,o.jsxs)(S,{onClick:()=>n.column.clearSorting(),disabled:!n.column.getIsSorted(),children:[(0,o.jsx)(D.ChevronsUpDown,{className:"mr-2 h-4 w-4"}),"Clear Sort"]}),(0,o.jsx)(O,{})]}),B&&!pt&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(H,{children:"Pin Column"}),(0,o.jsxs)(S,{onClick:()=>dt(n.column.id,"right"),disabled:n.column.getIsPinned()==="right",children:[(0,o.jsx)(D.MoveRightIcon,{}),"Pin Right"]}),(0,o.jsxs)(S,{onClick:()=>dt(n.column.id,!1),disabled:!n.column.getIsPinned(),children:[(0,o.jsx)(D.PinOffIcon,{}),"Unpin"]})]})]})]})]}),lt&&n.column.getCanResize()&&!d&&n.colSpan===1&&(0,o.jsx)("div",{className:"absolute right-0 top-0 h-full w-1 bg-border hover:bg-primary cursor-col-resize opacity-0 hover:opacity-100 transition-opacity",onMouseDown:n.getResizeHandler()})]},n.id)})},g.id))}),mt=g=>{if(!z)return;let b=0,n=P.getLeftHeaderGroups()[0]?.headers||[],f=[...ee?["serialNumber"]:[],...k?["select"]:[]];for(let d of n){if(d.id===g.id)break;if(f.includes(d.id)){let v=P.getColumn(d.id);v&&(b+=v.getSize())}}return b},ct=g=>{if(!z)return;let b=P.getState().columnPinning.right||[],n=b.indexOf(g.id);if(n===-1)return;let f=0;for(let d=n+1;d<b.length;d++){let v=P.getColumn(b[d]);v&&(f+=v.getSize())}return f};return Z?(0,o.jsx)(ye,{className:"w-full rounded-xl shadow-sm",children:(0,o.jsx)(Pe,{className:"flex items-center justify-center",children:(0,o.jsxs)("div",{className:"text-center",children:[(0,o.jsx)("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:Z}),ne&&(0,o.jsxs)(C,{variant:"outline",size:"sm",onClick:ne,className:"rounded-lg",children:[(0,o.jsx)(D.Loader2,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):(0,o.jsx)(ue,{children:(0,o.jsxs)("div",{className:a("w-full space-y-2 flex flex-col h-full",_),children:[p&&(0,o.jsx)(ye,{className:"rounded-2xl py-2 sticky top-0 z-20",children:(0,o.jsx)(Pe,{className:"px-2",children:p})}),so&&(0,o.jsx)(Re,{table:P,filters:i,globalFilter:nt,onGlobalFilterChange:Ge,enableGlobalFilter:rt,onExport:me,onRefresh:ne,loading:ae,enableColumnVisibility:Ue,enableColumnPinning:z,data:e,onClearSorting:uo,onClearFilters:go}),(0,o.jsx)(ye,{className:a("shadow-sm overflow-auto py-0",co&&"flex-1"),children:(0,o.jsx)(Pe,{className:"p-0 h-full",children:(0,o.jsxs)("div",{className:"relative flex flex-col h-full justify-between",children:[ae&&(0,o.jsx)("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[(0,o.jsx)(D.Loader2,{className:"size-5 animate-spin text-primary"}),(0,o.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),(0,o.jsx)("div",{className:"relative rounded-t-xl overflow-auto border-b",children:(0,o.jsxs)($e,{className:"border-collapse w-full",children:[!po&&fo(),(0,o.jsx)(wt,{children:P.getRowModel().rows?.length?P.getRowModel().rows.map((g,b)=>(0,o.jsx)(pe,{"data-state":g.getIsSelected()&&"selected",className:a(mo&&"hover:bg-muted/50",lo&&b%2===0&&"bg-muted/20",g.getIsSelected()&&"bg-muted","border-b last:border-b-0"),children:g.getVisibleCells().map((n,f)=>{let d=z&&(n.column.getIsPinned()==="left"||n.column.id==="serialNumber"||n.column.id==="select"&&k),v=z&&n.column.getIsPinned()==="right",F=n.column.id==="serialNumber",L=n.column.id==="select",B=F||L&&xe;return(0,o.jsx)(we,{className:a(it?"py-2":"py-4",st&&f<g.getVisibleCells().length&&"border-r",d&&"sticky left-0 z-10 bg-sidebar/97",v&&"sticky right-0 z-10 bg-sidebar/97",F&&"sticky left-0 z-10 bg-sidebar/97","p-1"),style:{width:n.column.getSize()!==150?n.column.getSize():"auto",minWidth:n.column.getSize()!==150?n.column.getSize():"auto",...d&&{left:F?0:L?ee&&P.getColumn("serialNumber")?.getSize()||0:mt(n.column)},...v&&{right:ct(n.column)},...F&&{left:0}},children:(0,M.flexRender)(n.column.columnDef.cell,n.getContext())},n.id)})},g.id)):(0,o.jsx)(pe,{children:(0,o.jsx)(we,{colSpan:je.length,className:"h-32 text-center border-0",children:(0,o.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,o.jsx)("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),(0,o.jsx)("p",{className:"text-muted-foreground font-medium",children:de})]})})})})]})}),V&&(0,o.jsx)("div",{className:"sticky bottom-0 bg-sidebar w-full z-20",style:{width:"100%",minWidth:"fit-content"},children:(0,o.jsx)($e,{children:(0,o.jsx)(yt,{children:(0,o.jsx)(pe,{className:"bg-sidebar",children:(0,o.jsx)(we,{colSpan:je.length,className:"p-2",children:V})})})})})]})})}),(0,o.jsx)(Me,{table:P,config:m}),ce&&ce(P)]})})}var zt=require("radix-ui");var It=require("react/jsx-runtime");function Ie({className:e,orientation:t="horizontal",decorative:i=!0,...m}){return(0,It.jsx)(zt.Separator.Root,{"data-slot":"separator-root",decorative:i,orientation:t,className:a("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...m})}var Ve=require("lucide-react"),_e=require("framer-motion"),J=gt(require("react"),1),Vt=gt(require("react-dom"),1),h=require("react/jsx-runtime");function _t({table:e,visible:t,container:i,children:m,className:c,...p}){let[V,_]=J.useState(!1);J.useLayoutEffect(()=>{_(!0)},[]),J.useEffect(()=>{function Z(de){de.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[e]);let le=i??(V?globalThis.document?.body:null);if(!le||!e)return null;let ae=t??e.getFilteredSelectedRowModel().rows.length>0;return Vt.createPortal((0,h.jsx)(_e.AnimatePresence,{children:ae&&(0,h.jsx)(_e.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:a("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",c),...p,children:(0,h.jsx)(ue,{children:m})})}),le)}function Ft({size:e="sm",tooltip:t,isPending:i,disabled:m,className:c,children:p,...V}){let _=(0,h.jsx)(C,{variant:"secondary",size:e,className:a("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",c),disabled:m||i,...V,children:i?(0,h.jsx)(Ve.Loader,{className:"animate-spin"}):p});return t?(0,h.jsxs)(Ke,{children:[(0,h.jsx)(Xe,{asChild:!0,children:_}),(0,h.jsx)(Je,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,h.jsx)("p",{children:t})})]}):_}function Bt({table:e}){let t=J.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,h.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,h.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,h.jsx)(Ie,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,h.jsxs)(Ke,{children:[(0,h.jsx)(Xe,{asChild:!0,children:(0,h.jsx)(C,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,h.jsx)(Ve.X,{className:"size-3.5"})})}),(0,h.jsxs)(Je,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,h.jsx)("p",{children:"Clear selection"}),(0,h.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,h.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var Q=require("lucide-react");var N=require("react/jsx-runtime");function At({column:e,title:t,className:i}){return e.getCanSort()?(0,N.jsx)("div",{className:a("flex items-center space-x-2",i),children:(0,N.jsxs)($,{children:[(0,N.jsx)(q,{asChild:!0,children:(0,N.jsxs)(C,{variant:"ghost",size:"sm",className:"-ml-3 h-8 data-[state=open]:bg-accent",children:[(0,N.jsx)("span",{children:t}),e.getIsSorted()==="desc"?(0,N.jsx)(Q.ArrowUpDown,{className:"ml-2 h-4 w-4"}):e.getIsSorted()==="asc"?(0,N.jsx)(Q.ArrowUpDown,{className:"ml-2 h-4 w-4"}):(0,N.jsx)(Q.ArrowUpDown,{className:"ml-2 h-4 w-4"})]})}),(0,N.jsxs)(K,{align:"start",className:"rounded-lg",children:[(0,N.jsxs)(S,{onClick:()=>e.toggleSorting(!1),children:[(0,N.jsx)(Q.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),(0,N.jsxs)(S,{onClick:()=>e.toggleSorting(!0),children:[(0,N.jsx)(Q.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),(0,N.jsx)(O,{}),(0,N.jsxs)(S,{onClick:()=>e.toggleVisibility(!1),children:[(0,N.jsx)(Q.EyeOff,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Hide"]})]})]})}):(0,N.jsx)("div",{className:a(i),children:t})}var Fe=require("lucide-react");var E=require("react/jsx-runtime");function Lt({table:e}){return(0,E.jsxs)($,{children:[(0,E.jsx)(q,{asChild:!0,children:(0,E.jsxs)(C,{variant:"outline",size:"sm",className:"rounded-lg",children:[(0,E.jsx)(Fe.Eye,{className:"mr-2 h-4 w-4"}),"Columns ",(0,E.jsx)(Fe.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),(0,E.jsxs)(K,{align:"end",className:"w-[200px] rounded-lg",children:[(0,E.jsx)(H,{children:"Toggle Columns"}),(0,E.jsx)(O,{}),e.getAllColumns().filter(t=>typeof t.accessorFn<"u"&&t.getCanHide()).map(t=>(0,E.jsx)(fe,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:i=>t.toggleVisibility(!!i),children:t.id},t.id))]})]})}var Gt=require("radix-ui"),Ht=require("class-variance-authority");var Ot=require("react/jsx-runtime"),ko=(0,Ht.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Be({className:e,variant:t,asChild:i=!1,...m}){let c=i?Gt.Slot.Slot:"span";return(0,Ot.jsx)(c,{"data-slot":"badge",className:a(ko({variant:t}),e),...m})}var Y=require("cmdk"),Ut=require("lucide-react");var Ro=require("radix-ui"),Mo=require("lucide-react");var Et=require("react/jsx-runtime");var U=require("react/jsx-runtime");function jt({className:e,...t}){return(0,U.jsx)(Y.Command,{"data-slot":"command",className:a("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Wt({className:e,...t}){return(0,U.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,U.jsx)(Ut.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,U.jsx)(Y.Command.Input,{"data-slot":"command-input",className:a("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function $t({className:e,...t}){return(0,U.jsx)(Y.Command.List,{"data-slot":"command-list",className:a("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function qt({...e}){return(0,U.jsx)(Y.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function tt({className:e,...t}){return(0,U.jsx)(Y.Command.Group,{"data-slot":"command-group",className:a("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function Kt({className:e,...t}){return(0,U.jsx)(Y.Command.Separator,{"data-slot":"command-separator",className:a("bg-border -mx-1 h-px",e),...t})}function ot({className:e,...t}){return(0,U.jsx)(Y.Command.Item,{"data-slot":"command-item",className:a("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var be=require("radix-ui");var ve=require("react/jsx-runtime");function Xt({...e}){return(0,ve.jsx)(be.Popover.Root,{"data-slot":"popover",...e})}function Jt({...e}){return(0,ve.jsx)(be.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function Qt({className:e,align:t="center",sideOffset:i=4,...m}){return(0,ve.jsx)(be.Popover.Portal,{children:(0,ve.jsx)(be.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:i,className:a("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...m})})}var Ae=require("lucide-react"),u=require("react/jsx-runtime");function Yt({column:e,title:t,options:i}){let m=e?.getFacetedUniqueValues(),c=new Set(e?.getFilterValue());return(0,u.jsxs)(Xt,{children:[(0,u.jsx)(Jt,{asChild:!0,children:(0,u.jsxs)(C,{variant:"outline",size:"sm",className:"h-9 border-dashed rounded-lg",children:[(0,u.jsx)(Ae.PlusCircleIcon,{className:"mr-2 h-4 w-4"}),t,c?.size>0&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ie,{orientation:"vertical",className:"mx-2 h-4"}),(0,u.jsx)(Be,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:c.size}),(0,u.jsx)("div",{className:"hidden space-x-1 lg:flex",children:c.size>2?(0,u.jsxs)(Be,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[c.size," selected"]}):i.filter(p=>c.has(p.value)).map(p=>(0,u.jsx)(Be,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:p.label},p.value))})]})]})}),(0,u.jsx)(Qt,{className:"w-[200px] p-0 rounded-lg",align:"start",children:(0,u.jsxs)(jt,{className:"rounded-lg",children:[(0,u.jsx)(Wt,{placeholder:t}),(0,u.jsxs)($t,{children:[(0,u.jsx)(qt,{children:"No results found."}),(0,u.jsx)(tt,{children:i.map(p=>{let V=c.has(p.value);return(0,u.jsxs)(ot,{onSelect:()=>{V?c.delete(p.value):c.add(p.value);let _=Array.from(c);e?.setFilterValue(_.length?_:void 0)},children:[(0,u.jsx)("div",{className:a("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",V?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,u.jsx)(Ae.CheckIcon,{className:a("h-4 w-4")})}),p.icon&&(0,u.jsx)(p.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),(0,u.jsx)("span",{children:p.label}),m?.get(p.value)&&(0,u.jsx)("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:m.get(p.value)})]},p.value)})}),c.size>0&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Kt,{}),(0,u.jsx)(tt,{children:(0,u.jsx)(ot,{onSelect:()=>e?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}0&&(module.exports={DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTableColumnHeader,DataTableFacetedFilter,DataTablePagination,DataTableToolbar,DataTableViewOptions});
|
|
2
|
+
"use strict";var zo=Object.create;var _e=Object.defineProperty;var Mo=Object.getOwnPropertyDescriptor;var Io=Object.getOwnPropertyNames;var _o=Object.getPrototypeOf,Vo=Object.prototype.hasOwnProperty;var Bo=(e,t)=>{for(var a in t)_e(e,a,{get:t[a],enumerable:!0})},zt=(e,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of Io(t))!Vo.call(e,m)&&m!==a&&_e(e,m,{get:()=>t[m],enumerable:!(l=Mo(t,m))||l.enumerable});return e};var ct=(e,t,a)=>(a=e!=null?zo(_o(e)):{},zt(t||!e||!e.__esModule?_e(a,"default",{value:e,enumerable:!0}):a,e)),Fo=e=>zt(_e({},"__esModule",{value:!0}),e);var Uo={};Bo(Uo,{DataTable:()=>Jt,DataTableActionBar:()=>eo,DataTableActionBarAction:()=>to,DataTableActionBarSelection:()=>oo,DataTableColumnHeader:()=>ao,DataTableFacetedFilter:()=>bo,DataTablePagination:()=>Xe,DataTableToolbar:()=>We,DataTableViewOptions:()=>no});module.exports=Fo(Uo);var G=require("@tanstack/react-table"),R=require("lucide-react");var _t=require("radix-ui"),Vt=require("class-variance-authority");var Mt=require("clsx"),It=require("tailwind-merge");function o(...e){return(0,It.twMerge)((0,Mt.clsx)(e))}var Bt=require("react/jsx-runtime"),Ve=(0,Vt.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function b({className:e,variant:t,size:a,asChild:l=!1,...m}){let c=l?_t.Slot.Slot:"button";return(0,Bt.jsx)(c,{"data-slot":"button",className:o(Ve({variant:t,size:a,className:e}),"transition-none"),...m})}var Y=require("react/jsx-runtime");function mt({className:e,...t}){return(0,Y.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-auto max-h-full",children:(0,Y.jsx)("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function Ft({className:e,...t}){return(0,Y.jsx)("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function At({className:e,...t}){return(0,Y.jsx)("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Lt({className:e,...t}){return(0,Y.jsx)("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function we({className:e,...t}){return(0,Y.jsx)("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Gt({className:e,...t}){return(0,Y.jsx)("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function Be({className:e,...t}){return(0,Y.jsx)("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}var ut=require("react/jsx-runtime");function Fe({className:e,...t}){return(0,ut.jsx)("div",{"data-slot":"card",className:o("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ae({className:e,...t}){return(0,ut.jsx)("div",{"data-slot":"card-content",className:o("px-6",e),...t})}var ue=require("radix-ui");var Z=require("react/jsx-runtime");function Pe({delayDuration:e=0,...t}){return(0,Z.jsx)(ue.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function pt({...e}){return(0,Z.jsx)(Pe,{children:(0,Z.jsx)(ue.Tooltip.Root,{"data-slot":"tooltip",...e})})}function gt({...e}){return(0,Z.jsx)(ue.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function ft({className:e,sideOffset:t=0,children:a,...l}){return(0,Z.jsx)(ue.Tooltip.Portal,{children:(0,Z.jsxs)(ue.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:o("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...l,children:[a,(0,Z.jsx)(ue.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var T=require("lucide-react");var Ht=require("react/jsx-runtime");function bt({className:e,type:t,...a}){return(0,Ht.jsx)("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var E=require("radix-ui"),pe=require("lucide-react");var D=require("react/jsx-runtime");function Le({...e}){return(0,D.jsx)(E.Select.Root,{"data-slot":"select",...e})}function Ge({...e}){return(0,D.jsx)(E.Select.Value,{"data-slot":"select-value",...e})}function He({className:e,size:t="default",children:a,...l}){return(0,D.jsxs)(E.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:o("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l,children:[a,(0,D.jsx)(E.Select.Icon,{asChild:!0,children:(0,D.jsx)(pe.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function Oe({className:e,children:t,position:a="popper",...l}){return(0,D.jsx)(E.Select.Portal,{children:(0,D.jsxs)(E.Select.Content,{"data-slot":"select-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...l,children:[(0,D.jsx)(Ao,{}),(0,D.jsx)(E.Select.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,D.jsx)(Lo,{})]})})}function De({className:e,children:t,...a}){return(0,D.jsxs)(E.Select.Item,{"data-slot":"select-item",className:o("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[(0,D.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,D.jsx)(E.Select.ItemIndicator,{children:(0,D.jsx)(pe.CheckIcon,{className:"size-4"})})}),(0,D.jsx)(E.Select.ItemText,{children:t})]})}function Ao({className:e,...t}){return(0,D.jsx)(E.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,D.jsx)(pe.ChevronUpIcon,{className:"size-4"})})}function Lo({className:e,...t}){return(0,D.jsx)(E.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,D.jsx)(pe.ChevronDownIcon,{className:"size-4"})})}var W=require("radix-ui"),Ee=require("lucide-react");var A=require("react/jsx-runtime");function ee({...e}){return(0,A.jsx)(W.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function te({...e}){return(0,A.jsx)(W.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function oe({className:e,sideOffset:t=4,...a}){return(0,A.jsx)(W.DropdownMenu.Portal,{children:(0,A.jsx)(W.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...a})})}function vt({...e}){return(0,A.jsx)(W.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function _({className:e,inset:t,variant:a="default",...l}){return(0,A.jsx)(W.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l})}function Ne({className:e,children:t,checked:a,...l}){return(0,A.jsxs)(W.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...l,children:[(0,A.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,A.jsx)(W.DropdownMenu.ItemIndicator,{children:(0,A.jsx)(Ee.CheckIcon,{className:"size-4"})})}),t]})}function X({className:e,inset:t,...a}){return(0,A.jsx)(W.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function K({className:e,...t}){return(0,A.jsx)(W.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}var Ut=require("react");var he=require("react"),Et=require("lucide-react"),xe=require("date-fns");var Te=require("radix-ui");var Se=require("react/jsx-runtime");function je({...e}){return(0,Se.jsx)(Te.Popover.Root,{"data-slot":"popover",...e})}function Ue({...e}){return(0,Se.jsx)(Te.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function $e({className:e,align:t="center",sideOffset:a=4,...l}){return(0,Se.jsx)(Te.Popover.Portal,{children:(0,Se.jsx)(Te.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...l})})}var qe=ct(require("react"),1),ve=require("lucide-react"),ke=require("react-day-picker");var ae=require("react/jsx-runtime");function Ot({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:l="label",buttonVariant:m="ghost",formatters:c,components:N,...I}){let p=(0,ke.getDefaultClassNames)();return(0,ae.jsx)(ke.DayPicker,{showOutsideDays:a,className:o("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:l,formatters:{formatMonthDropdown:h=>h.toLocaleString("default",{month:"short"}),...c},classNames:{root:o("w-fit",p.root),months:o("flex gap-4 flex-col md:flex-row relative",p.months),month:o("flex flex-col w-full gap-4",p.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",p.nav),button_previous:o(Ve({variant:m}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(Ve({variant:m}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",p.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",p.dropdowns),dropdown_root:o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",p.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",p.dropdown),caption_label:o("select-none font-medium",l==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:o("flex",p.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",p.weekday),week:o("flex w-full mt-2",p.week),week_number_header:o("select-none w-(--cell-size)",p.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",p.week_number),day:o("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",p.day),range_start:o("rounded-l-md bg-accent",p.range_start),range_middle:o("rounded-none",p.range_middle),range_end:o("rounded-r-md bg-accent",p.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:o("text-muted-foreground opacity-50",p.disabled),hidden:o("invisible",p.hidden),...t},components:{Root:({className:h,rootRef:S,...V})=>(0,ae.jsx)("div",{"data-slot":"calendar",ref:S,className:o(h),...V}),Chevron:({className:h,orientation:S,...V})=>S==="left"?(0,ae.jsx)(ve.ChevronLeftIcon,{className:o("size-4",h),...V}):S==="right"?(0,ae.jsx)(ve.ChevronRightIcon,{className:o("size-4",h),...V}):(0,ae.jsx)(ve.ChevronDownIcon,{className:o("size-4",h),...V}),DayButton:Go,WeekNumber:({children:h,...S})=>(0,ae.jsx)("td",{...S,children:(0,ae.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:h})}),...N},...I})}function Go({className:e,day:t,modifiers:a,...l}){let m=(0,ke.getDefaultClassNames)(),c=qe.useRef(null);return qe.useEffect(()=>{a.focused&&c.current?.focus()},[a.focused]),(0,ae.jsx)(b,{ref:c,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:o("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",m.day,e),...l})}var L=require("react/jsx-runtime");function jt({value:e,onChange:t,placeholder:a,mode:l,externalSearch:m,onExternalChange:c,onlyExternal:N=!1}){let[I,p]=(0,he.useState)(!1),[h,S]=(0,he.useState)(e),[V,B]=(0,he.useState)(e);(0,he.useEffect)(()=>{N||B(e)},[e,N]);let ne=()=>{N||t(h),B(h),m&&c&&c(h),p(!1)},re=()=>{S(V),p(!1)},ie=()=>{let g=l==="single"?null:{from:null,to:null};S(g),N||t(g),B(g),m&&c&&c(g),p(!1)},se=()=>{let g=N?V:e;return g?l==="single"?(0,xe.format)(g,"PPP"):g.from&&g.to?`${(0,xe.format)(g.from,"MMM dd")} - ${(0,xe.format)(g.to,"MMM dd, yyyy")}`:g.from?`From ${(0,xe.format)(g.from,"MMM dd, yyyy")}`:g.to?`To ${(0,xe.format)(g.to,"MMM dd, yyyy")}`:a:a},$=g=>{S(l==="single"?g:g||{from:null,to:null})};return(0,L.jsxs)(je,{open:I,onOpenChange:p,children:[(0,L.jsx)(Ue,{asChild:!0,children:(0,L.jsxs)(b,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!se()&&"text-muted-foreground"),children:[(0,L.jsx)(Et.Calendar,{className:"mr-2 h-4 w-4"}),se()]})}),(0,L.jsxs)($e,{className:"w-auto p-0",align:"start",children:[(0,L.jsx)("div",{className:"p-3",children:(0,L.jsx)(Ot,{mode:l,selected:h,onSelect:$,numberOfMonths:l==="range"?2:1,className:"rounded-md border",...l==="range"&&{required:!0}})}),(0,L.jsxs)("div",{className:"flex items-center justify-between p-3 border-t",children:[(0,L.jsx)(b,{variant:"ghost",size:"sm",onClick:ie,children:"Clear"}),(0,L.jsxs)("div",{className:"flex gap-2",children:[(0,L.jsx)(b,{variant:"outline",size:"sm",onClick:re,children:"Cancel"}),(0,L.jsx)(b,{size:"sm",onClick:ne,disabled:l==="range"&&(!h?.from||!h?.to),children:"Apply"})]})]})]})]})}var r=require("react/jsx-runtime");function We({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:l,enableGlobalFilter:m=!0,onExport:c,onRefresh:N,loading:I=!1,enableColumnVisibility:p=!0,data:h,onClearSorting:S,onClearFilters:V,enableColumnPinning:B=!1,onExternalSearch:ne}){let[re,ie]=(0,Ut.useState)({}),se=()=>e.getAllLeafColumns().filter(i=>i.getCanHide?.()!==!1),$=()=>e.getAllColumns().filter(i=>!e.getAllLeafColumns().includes(i)&&i.columns?.length&&i.columns.some(d=>d.getCanHide?.()!==!1)),g=()=>{let i=new Set($().flatMap(d=>d.columns?.filter(H=>H.getCanHide?.()!==!1).map(H=>H.id)||[]));return se().filter(d=>!i.has(d.id))},Re=(i,d)=>d&&i.startsWith(`${d}.`)?i.replace(`${d}.`,"").split("_").map(Me=>Me.slice(1)).join(" "):i.split("_").map(H=>H.charAt(0).toUpperCase()+H.slice(1)).join(" "),Ce=(i,d)=>{let H={...re,[i]:d};ie(H)},ze=()=>{ne&&ne(re)},ot=()=>{ie({}),V(),ne&&ne({})},ge=i=>e.getColumn(i)?.getFilterValue(),ye=(i,d)=>{e.getColumn(i)?.setFilterValue(d)};return(0,r.jsx)("div",{className:"rounded-xl",children:(0,r.jsx)("div",{className:"px-2",children:(0,r.jsx)("div",{className:"flex flex-col gap-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,r.jsx)(T.Filter,{className:"h-4 w-4"})}),t.map(i=>(0,r.jsx)("div",{className:o("relative min-w-[150px]",i.width),children:i.type==="select"?(0,r.jsxs)(Le,{value:ge(i.key)??"",onValueChange:d=>{ye(i.key,d==="all"?"":d),i.externalSearch&&Ce(i.key,d==="all"?"":d)},children:[i.icon&&(0,r.jsx)("span",{children:(0,r.jsx)(i.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),(0,r.jsx)(He,{className:o("h-9 rounded-lg w-full",i.icon&&"pl-9"),children:(0,r.jsx)(Ge,{placeholder:i.placeholder})}),(0,r.jsxs)(Oe,{className:"rounded-lg",children:[(0,r.jsx)(De,{value:"all",children:"All"}),i.options?.map(d=>(0,r.jsx)(De,{value:d.value,children:d.label},d.label))]})]}):i.type==="date"?(0,r.jsx)(jt,{value:ge(i.key),onChange:d=>{i.onlyExternal||ye(i.key,d)},placeholder:i.placeholder,mode:i.dateMode||"single",externalSearch:i.externalSearch,onlyExternal:i.onlyExternal,onExternalChange:d=>Ce(i.key,d)}):(0,r.jsxs)("div",{className:"relative",children:[i.icon&&(0,r.jsx)("span",{children:(0,r.jsx)(i.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),(0,r.jsx)(bt,{placeholder:i.placeholder,value:ge(i.key)??"",onChange:d=>{ye(i.key,d.target.value),i.externalSearch&&Ce(i.key,d.target.value)},className:o("h-9 rounded-lg",i.icon&&"pl-9"),type:i.type==="number"?"number":"text"})]})},i.key)),t.some(i=>i.externalSearch)&&(0,r.jsxs)(b,{variant:"default",size:"sm",onClick:ze,className:"rounded-lg",children:[(0,r.jsx)(T.Search,{className:"mr-2 h-4 w-4"}),t.find(i=>i.externalSearch)?.searchButtonText||"Search"]})]})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[m&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(T.Search,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(bt,{placeholder:"Global search...",value:a??"",onChange:i=>l(i.target.value),className:"pl-9 max-w-max"})]}),c&&(0,r.jsxs)(b,{variant:"outline",size:"sm",onClick:()=>c(h),className:"rounded-lg",children:[(0,r.jsx)(T.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),p&&(0,r.jsxs)(ee,{children:[(0,r.jsx)(te,{asChild:!0,children:(0,r.jsxs)(b,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[(0,r.jsx)("span",{children:"Columns"}),(0,r.jsx)(T.ChevronDown,{className:"h-4 w-4 opacity-50"})]})}),(0,r.jsxs)(oe,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,r.jsx)(X,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,r.jsx)(K,{}),g().length>0&&(0,r.jsxs)(vt,{children:[(0,r.jsx)(X,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),g().map(i=>(0,r.jsx)(Ne,{className:"text-sm",checked:i.getIsVisible(),onCheckedChange:d=>i.toggleVisibility(!!d),children:Re(i.id)},i.id))]}),$().map(i=>(0,r.jsxs)(vt,{children:[(0,r.jsx)(K,{}),(0,r.jsx)(X,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:i.id}),i.columns?.filter(d=>d.getCanHide?.()!==!1).map(d=>(0,r.jsx)(Ne,{className:"text-sm",checked:d.getIsVisible(),onCheckedChange:H=>d.toggleVisibility(!!H),children:Re(d.id,i.id)},d.id))]},i.id))]})]}),(0,r.jsxs)(ee,{children:[(0,r.jsx)(te,{asChild:!0,children:(0,r.jsx)(b,{variant:"outline",size:"sm",className:"rounded-lg",children:(0,r.jsx)(T.Settings2,{className:"h-4 w-4"})})}),(0,r.jsxs)(oe,{align:"end",className:"w-[200px] rounded-lg",children:[(0,r.jsx)(X,{children:"Table Settings"}),(0,r.jsx)(K,{}),(0,r.jsxs)(_,{onClick:S,children:[(0,r.jsx)(T.ArrowUpDown,{className:"mr-2 h-4 w-4"}),"Clear All Sorting"]}),(0,r.jsxs)(_,{onClick:ot,children:[(0,r.jsx)(T.Filter,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]}),B&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K,{}),(0,r.jsx)(X,{children:"Column Pinning"}),(0,r.jsxs)(_,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[(0,r.jsx)(T.PinOff,{className:"mr-2 h-4 w-4"}),"Reset All Pinning"]}),(0,r.jsxs)(_,{onClick:()=>{let i=se().filter(d=>d.getCanPin?.()!==!1).map(d=>d.id);e.setColumnPinning({left:[],right:i})},children:[(0,r.jsx)(T.Pin,{className:"mr-2 h-4 w-4 -rotate-90"}),"Pin All Right"]})]})]})]}),N&&(0,r.jsx)(b,{variant:"outline",size:"sm",onClick:N,disabled:I,className:"rounded-lg",children:(0,r.jsx)(T.RefreshCw,{className:o("h-4 w-4",I&&"animate-spin")})})]})]})})})})}var w=require("react/jsx-runtime");function Xe({table:e,config:t}){return t.enabled?(0,w.jsx)("div",{className:"rounded-xl",children:(0,w.jsx)("div",{children:(0,w.jsxs)("div",{className:"flex items-center justify-between",children:[(0,w.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,w.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,w.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,w.jsxs)("div",{className:"flex items-center gap-2",children:[(0,w.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,w.jsxs)(Le,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[(0,w.jsx)(He,{className:"h-9 w-[70px] rounded-lg",children:(0,w.jsx)(Ge,{})}),(0,w.jsx)(Oe,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>(0,w.jsx)(De,{value:`${a}`,children:a},a))})]})]}),(0,w.jsxs)("div",{className:"flex items-center gap-2",children:[(0,w.jsx)(b,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,w.jsx)(b,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,w.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,l)=>{let m=e.getState().pagination.pageIndex,c=m+l;return c<1||c>e.getPageCount()?null:(0,w.jsx)(b,{variant:c===m+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(c-1),children:c},c)})}),(0,w.jsx)(b,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,w.jsx)(b,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}var $t=require("radix-ui"),qt=require("class-variance-authority");var Xt=require("react/jsx-runtime"),Ho=(0,qt.cva)("inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 px-0 min-w-7",default:"h-8 px-1 min-w-8",lg:"h-9 px-2 min-w-10"},bg:{enabled:"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",disabled:""}},defaultVariants:{variant:"default",size:"default",bg:"enabled"}});function Wt({className:e,variant:t,size:a,noBg:l,...m}){return(0,Xt.jsx)($t.Toggle.Root,{"data-slot":"toggle",className:o(Ho({className:e,variant:t,size:a,bg:l?"disabled":"enabled"})),...m})}var xt=require("radix-ui"),Kt=require("lucide-react");var Ke=require("react/jsx-runtime");function ht({className:e,...t}){return(0,Ke.jsx)(xt.Checkbox.Root,{"data-slot":"checkbox",className:o("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,Ke.jsx)(xt.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,Ke.jsx)(Kt.CheckIcon,{className:"size-3.5"})})})}var M=require("react"),n=require("react/jsx-runtime");function Jt({data:e,columns:t,filters:a=[],pagination:l={enabled:!1},settings:m={},header:c,footer:N,className:I="",maxHeight:p="600px",loading:h=!1,error:S,emptyMessage:V="No data available",onRowSelectionChange:B,onExport:ne,onRefresh:re,onTableReady:ie,children:se,isRowDisabled:$,isRowSelectable:g,onExternalSearch:Re}){let[Ce,ze]=(0,M.useState)([]),[ot,ge]=(0,M.useState)([]),[ye,i]=(0,M.useState)({}),[d,H]=(0,M.useState)({}),[Me,at]=(0,M.useState)(""),[vo,xo]=(0,M.useState)([]),[nt,ho]=(0,M.useState)(m.enableColumnPinning?{left:[],right:[]}:{}),{enableSorting:rt=!0,enableFiltering:it=!0,enableGlobalFilter:wt=!0,enableColumnVisibility:st=!0,enableRowSelection:F=!0,stickyHeader:Co=!0,toolbar:yo=!1,showSerialNumbers:me=!0,fixedCheckboxColumn:Ie=!0,striped:wo=!0,hoverable:Po=!0,compact:Pt=!0,bordered:Dt=!0,fullHeight:Do=!1,enableColumnResizing:Nt=!1,enableColumnPinning:O=!0,hideHeader:No=!1}=m,lt=(0,M.useMemo)(()=>{let v=[...t],C=x=>x.map(u=>{if(u.id==="select"||u.id==="serialNumber")return u;let y={...u,enablePinning:!0};return u.columns&&(y.columns=C(u.columns)),y}),s=C(v);if(F){let x={id:"select",header:({table:u})=>{let y=u.getRowModel().rows.filter(U=>!$?.(U.original)&&(g?g(U.original):!0)),j=y.length>0&&y.every(U=>U.getIsSelected()),q=y.some(U=>U.getIsSelected());return(0,n.jsx)(ht,{checked:j||q&&"indeterminate",onCheckedChange:U=>{y.forEach(fe=>fe.toggleSelected(!!U))},"aria-label":"Select all selectable rows"})},cell:({row:u})=>{let y=$?$(u.original):!1,j=g?g(u.original):!0;return(0,n.jsx)("div",{className:o("flex items-center justify-center",y&&"opacity-50"),children:(0,n.jsx)(ht,{checked:u.getIsSelected(),onCheckedChange:q=>j&&u.toggleSelected(!!q),"aria-label":"Select row",disabled:y||!j})})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:10};s.unshift(x)}if(me){let x={id:"serialNumber",header:"No.",cell:({row:u})=>(0,n.jsx)("div",{className:"text-center font-medium text-muted-foreground",children:u.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};s.unshift(x)}return s},[t,me,F,Ie,$,g]),k=(0,G.useReactTable)({data:e,columns:lt,onSortingChange:rt?ze:void 0,onColumnFiltersChange:it?ge:void 0,onGlobalFilterChange:wt?at:void 0,getCoreRowModel:(0,G.getCoreRowModel)(),getPaginationRowModel:l.enabled?(0,G.getPaginationRowModel)():void 0,getSortedRowModel:rt?(0,G.getSortedRowModel)():void 0,getFilteredRowModel:it?(0,G.getFilteredRowModel)():void 0,onColumnVisibilityChange:st?i:void 0,onRowSelectionChange:F?H:void 0,onColumnOrderChange:xo,onColumnPinningChange:O?ho:void 0,state:{sorting:rt?Ce:void 0,columnFilters:it?ot:void 0,columnVisibility:st?ye:void 0,rowSelection:F?d:{},globalFilter:Me,columnOrder:vo,columnPinning:O?nt:{}},initialState:{pagination:l.enabled?{pageSize:l.pageSize||10}:void 0,columnPinning:O?{left:[...me?["serialNumber"]:[],...F?["select"]:[]],right:[]}:void 0},enableRowSelection:F,enableColumnResizing:Nt,enableColumnPinning:O,columnResizeMode:"onChange"});(0,M.useEffect)(()=>{ie&&ie(k)},[k,ie]),(0,M.useEffect)(()=>{if(F&&B){let v=k.getFilteredSelectedRowModel().rows.map(C=>C.original);B(v)}},[d,F,B,k]),(0,M.useEffect)(()=>{if(F&&B){let v=k.getFilteredSelectedRowModel().rows.filter(C=>!$?.(C.original)&&(g?g(C.original):!0)).map(C=>C.original);B(v)}},[d,F,B,k,$,g]);let To=(0,M.useCallback)(()=>{ze([])},[]),So=(0,M.useCallback)(()=>{ge([]),at("")},[]),Tt=(v,C)=>{if(!O)return;let s=[...me?["serialNumber"]:[],...F&&Ie?["select"]:[]],x={left:[...(nt.left??[]).filter(u=>s.includes(u))],right:[...nt.right??[]]};C===!1?(x.left=x.left.filter(u=>u!==v),x.right=x.right.filter(u=>u!==v)):C==="right"?(x.left=x.left.filter(u=>u!==v),x.right.includes(v)||x.right.push(v)):C==="left"&&(x.right=x.right.filter(u=>u!==v),!x.left.includes(v)&&!s.includes(v)&&x.left.push(v)),k.setColumnPinning(x)},ko=()=>(0,n.jsx)(Ft,{className:o(Co&&"sticky top-0 bg-sidebar z-20"),children:k.getHeaderGroups().map((v,C)=>(0,n.jsx)(we,{className:"hover:bg-transparent",children:v.headers.map((s,x)=>{let u=s.depth===0&&s.colSpan>1,y=O&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&F),j=O&&s.column.getIsPinned()==="right",q=s.column.getCanSort(),U=O&&s.column.columnDef.enablePinning!==!1,fe=s.column.id==="serialNumber",dt=s.column.id==="select",Rt=fe||dt&&Ie,be=s.column.columnDef.headerAlign||"left",Ro={left:"justify-start",center:"justify-center",right:"justify-end"}[be];return(0,n.jsxs)(Gt,{colSpan:s.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!Pt&&"py-2",Dt&&x<v.headers.length-1&&"border-r","relative",y&&"sticky left-0 z-15 bg-sidebar",j&&"sticky right-0 z-15 bg-sidebar",(fe||dt)&&"sticky left-0 z-15 bg-sidebar",u?"text-center":"text-left"),style:{width:s.getSize()!==150?s.getSize():"auto",minWidth:s.getSize()!==150?s.getSize():"auto",...y&&{left:fe?0:dt?me&&k.getColumn("serialNumber")?.getSize()||0:St(s.column)},...j&&{right:kt(s.column)},...fe&&{left:0}},children:[u?(0,n.jsx)("div",{className:"flex items-center justify-center",children:(0,G.flexRender)(s.column.columnDef.header,s.getContext())}):(0,n.jsxs)("div",{className:o("relative flex items-center w-full px-2",Ro),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[q&&be==="right"&&(0,n.jsx)("span",{className:"ml-1 order-2",children:s.column.getIsSorted()&&{asc:(0,n.jsx)(R.ChevronUp,{className:"h-4 w-4"}),desc:(0,n.jsx)(R.ChevronDown,{className:"h-4 w-4"})}[s.column.getIsSorted()]}),s.isPlaceholder?null:(0,G.flexRender)(s.column.columnDef.header,s.getContext()),q&&be!=="right"&&s.column.getIsSorted()&&(0,n.jsx)("span",{className:"ml-1 order-2",children:s.column.getIsSorted()&&{asc:(0,n.jsx)(R.ChevronUp,{className:"h-4 w-4"}),desc:(0,n.jsx)(R.ChevronDown,{className:"h-4 w-4"})}[s.column.getIsSorted()]})]}),(q||U&&!Rt)&&(0,n.jsxs)(ee,{children:[(0,n.jsx)(te,{asChild:!0,className:o("absolute",be==="left"&&"right-1",be==="center"&&"right-1",be==="right"&&"left-1"),children:(0,n.jsx)(Wt,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:(0,n.jsx)(R.MoreHorizontal,{className:"h-4 w-4"})})}),(0,n.jsxs)(oe,{align:"end",className:"w-48",children:[q&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(X,{children:"Sorting"}),(0,n.jsxs)(_,{onClick:()=>s.column.toggleSorting(!1),children:[(0,n.jsx)(R.ChevronUp,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),(0,n.jsxs)(_,{onClick:()=>s.column.toggleSorting(!0),children:[(0,n.jsx)(R.ChevronDown,{className:"mr-2 h-4 w-4"}),"Sort Descending"]}),(0,n.jsxs)(_,{onClick:()=>s.column.clearSorting(),disabled:!s.column.getIsSorted(),children:[(0,n.jsx)(R.ChevronsUpDown,{className:"mr-2 h-4 w-4"}),"Clear Sort"]}),(0,n.jsx)(K,{})]}),U&&!Rt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(X,{children:"Pin Column"}),(0,n.jsxs)(_,{onClick:()=>Tt(s.column.id,"right"),disabled:s.column.getIsPinned()==="right",children:[(0,n.jsx)(R.MoveRightIcon,{}),"Pin Right"]}),(0,n.jsxs)(_,{onClick:()=>Tt(s.column.id,!1),disabled:!s.column.getIsPinned(),children:[(0,n.jsx)(R.PinOffIcon,{}),"Unpin"]})]})]})]})]}),Nt&&s.column.getCanResize()&&!u&&s.colSpan===1&&(0,n.jsx)("div",{className:"absolute right-0 top-0 h-full w-1 bg-border hover:bg-primary cursor-col-resize opacity-0 hover:opacity-100 transition-opacity",onMouseDown:s.getResizeHandler()})]},s.id)})},v.id))}),St=v=>{if(!O)return;let C=0,s=k.getLeftHeaderGroups()[0]?.headers||[],x=[...me?["serialNumber"]:[],...F?["select"]:[]];for(let u of s){if(u.id===v.id)break;if(x.includes(u.id)){let y=k.getColumn(u.id);y&&(C+=y.getSize())}}return C},kt=v=>{if(!O)return;let C=k.getState().columnPinning.right||[],s=C.indexOf(v.id);if(s===-1)return;let x=0;for(let u=s+1;u<C.length;u++){let y=k.getColumn(C[u]);y&&(x+=y.getSize())}return x};return S?(0,n.jsx)(Fe,{className:"w-full rounded-xl shadow-sm",children:(0,n.jsx)(Ae,{className:"flex items-center justify-center",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:S}),re&&(0,n.jsxs)(b,{variant:"outline",size:"sm",onClick:re,className:"rounded-lg",children:[(0,n.jsx)(R.Loader2,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):(0,n.jsx)(Pe,{children:(0,n.jsxs)("div",{className:o("w-full space-y-2 flex flex-col h-full",I),children:[c&&(0,n.jsx)(Fe,{className:"rounded-2xl py-2 sticky top-0 z-20",children:(0,n.jsx)(Ae,{className:"px-2",children:c})}),yo&&(0,n.jsx)(We,{table:k,filters:a,globalFilter:Me,onGlobalFilterChange:at,enableGlobalFilter:wt,onExport:ne,onRefresh:re,loading:h,enableColumnVisibility:st,enableColumnPinning:O,data:e,onClearSorting:To,onClearFilters:So,onExternalSearch:Re}),(0,n.jsx)(Fe,{className:o("shadow-sm overflow-auto py-0",Do&&"flex-1"),children:(0,n.jsx)(Ae,{className:"p-0 h-full",children:(0,n.jsxs)("div",{className:"relative flex flex-col h-full justify-between",children:[h&&(0,n.jsx)("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl",children:(0,n.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[(0,n.jsx)(R.Loader2,{className:"size-5 animate-spin text-primary"}),(0,n.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),(0,n.jsx)("div",{className:"relative rounded-t-xl overflow-auto border-b",children:(0,n.jsxs)(mt,{className:"border-collapse w-full",children:[!No&&ko(),(0,n.jsx)(At,{children:k.getRowModel().rows?.length?k.getRowModel().rows.map((v,C)=>(0,n.jsx)(we,{"data-state":v.getIsSelected()&&"selected",className:o(Po&&"hover:bg-muted/50",wo&&C%2===0&&"bg-muted/20",v.getIsSelected()&&"bg-muted","border-b last:border-b-0"),children:v.getVisibleCells().map((s,x)=>{let u=O&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&F),y=O&&s.column.getIsPinned()==="right",j=s.column.id==="serialNumber",q=s.column.id==="select",U=j||q&&Ie;return(0,n.jsx)(Be,{className:o(Pt?"py-2":"py-4",Dt&&x<v.getVisibleCells().length&&"border-r",u&&"sticky left-0 z-10 bg-sidebar/97",y&&"sticky right-0 z-10 bg-sidebar/97",j&&"sticky left-0 z-10 bg-sidebar/97","p-1"),style:{width:s.column.getSize()!==150?s.column.getSize():"auto",minWidth:s.column.getSize()!==150?s.column.getSize():"auto",...u&&{left:j?0:q?me&&k.getColumn("serialNumber")?.getSize()||0:St(s.column)},...y&&{right:kt(s.column)},...j&&{left:0}},children:(0,G.flexRender)(s.column.columnDef.cell,s.getContext())},s.id)})},v.id)):(0,n.jsx)(we,{children:(0,n.jsx)(Be,{colSpan:lt.length,className:"h-32 text-center border-0",children:(0,n.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,n.jsx)("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),(0,n.jsx)("p",{className:"text-muted-foreground font-medium",children:V})]})})})})]})}),N&&(0,n.jsx)("div",{className:"sticky bottom-0 bg-sidebar w-full z-20",style:{width:"100%",minWidth:"fit-content"},children:(0,n.jsx)(mt,{children:(0,n.jsx)(Lt,{children:(0,n.jsx)(we,{className:"bg-sidebar",children:(0,n.jsx)(Be,{colSpan:lt.length,className:"p-2",children:N})})})})})]})})}),(0,n.jsx)(Xe,{table:k,config:l}),se&&se(k)]})})}var Qt=require("radix-ui");var Yt=require("react/jsx-runtime");function Je({className:e,orientation:t="horizontal",decorative:a=!0,...l}){return(0,Yt.jsx)(Qt.Separator.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...l})}var Qe=require("lucide-react"),Ye=require("framer-motion"),le=ct(require("react"),1),Zt=ct(require("react-dom"),1),P=require("react/jsx-runtime");function eo({table:e,visible:t,container:a,children:l,className:m,...c}){let[N,I]=le.useState(!1);le.useLayoutEffect(()=>{I(!0)},[]),le.useEffect(()=>{function S(V){V.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e]);let p=a??(N?globalThis.document?.body:null);if(!p||!e)return null;let h=t??e.getFilteredSelectedRowModel().rows.length>0;return Zt.createPortal((0,P.jsx)(Ye.AnimatePresence,{children:h&&(0,P.jsx)(Ye.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:o("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",m),...c,children:(0,P.jsx)(Pe,{children:l})})}),p)}function to({size:e="sm",tooltip:t,isPending:a,disabled:l,className:m,children:c,...N}){let I=(0,P.jsx)(b,{variant:"secondary",size:e,className:o("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",m),disabled:l||a,...N,children:a?(0,P.jsx)(Qe.Loader,{className:"animate-spin"}):c});return t?(0,P.jsxs)(pt,{children:[(0,P.jsx)(gt,{asChild:!0,children:I}),(0,P.jsx)(ft,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,P.jsx)("p",{children:t})})]}):I}function oo({table:e}){let t=le.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,P.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,P.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,P.jsx)(Je,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,P.jsxs)(pt,{children:[(0,P.jsx)(gt,{asChild:!0,children:(0,P.jsx)(b,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,P.jsx)(Qe.X,{className:"size-3.5"})})}),(0,P.jsxs)(ft,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,P.jsx)("p",{children:"Clear selection"}),(0,P.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,P.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var de=require("lucide-react");var z=require("react/jsx-runtime");function ao({column:e,title:t,className:a}){return e.getCanSort()?(0,z.jsx)("div",{className:o("flex items-center space-x-2",a),children:(0,z.jsxs)(ee,{children:[(0,z.jsx)(te,{asChild:!0,children:(0,z.jsxs)(b,{variant:"ghost",size:"sm",className:"-ml-3 h-8 data-[state=open]:bg-accent",children:[(0,z.jsx)("span",{children:t}),e.getIsSorted()==="desc"?(0,z.jsx)(de.ArrowUpDown,{className:"ml-2 h-4 w-4"}):e.getIsSorted()==="asc"?(0,z.jsx)(de.ArrowUpDown,{className:"ml-2 h-4 w-4"}):(0,z.jsx)(de.ArrowUpDown,{className:"ml-2 h-4 w-4"})]})}),(0,z.jsxs)(oe,{align:"start",className:"rounded-lg",children:[(0,z.jsxs)(_,{onClick:()=>e.toggleSorting(!1),children:[(0,z.jsx)(de.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),(0,z.jsxs)(_,{onClick:()=>e.toggleSorting(!0),children:[(0,z.jsx)(de.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),(0,z.jsx)(K,{}),(0,z.jsxs)(_,{onClick:()=>e.toggleVisibility(!1),children:[(0,z.jsx)(de.EyeOff,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Hide"]})]})]})}):(0,z.jsx)("div",{className:o(a),children:t})}var Ze=require("lucide-react");var J=require("react/jsx-runtime");function no({table:e}){return(0,J.jsxs)(ee,{children:[(0,J.jsx)(te,{asChild:!0,children:(0,J.jsxs)(b,{variant:"outline",size:"sm",className:"rounded-lg",children:[(0,J.jsx)(Ze.Eye,{className:"mr-2 h-4 w-4"}),"Columns ",(0,J.jsx)(Ze.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),(0,J.jsxs)(oe,{align:"end",className:"w-[200px] rounded-lg",children:[(0,J.jsx)(X,{children:"Toggle Columns"}),(0,J.jsx)(K,{}),e.getAllColumns().filter(t=>typeof t.accessorFn<"u"&&t.getCanHide()).map(t=>(0,J.jsx)(Ne,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:a=>t.toggleVisibility(!!a),children:t.id},t.id))]})]})}var ro=require("radix-ui"),io=require("class-variance-authority");var so=require("react/jsx-runtime"),Oo=(0,io.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function et({className:e,variant:t,asChild:a=!1,...l}){let m=a?ro.Slot.Slot:"span";return(0,so.jsx)(m,{"data-slot":"badge",className:o(Oo({variant:t}),e),...l})}var ce=require("cmdk"),co=require("lucide-react");var Eo=require("radix-ui"),jo=require("lucide-react");var lo=require("react/jsx-runtime");var Q=require("react/jsx-runtime");function mo({className:e,...t}){return(0,Q.jsx)(ce.Command,{"data-slot":"command",className:o("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function uo({className:e,...t}){return(0,Q.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,Q.jsx)(co.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,Q.jsx)(ce.Command.Input,{"data-slot":"command-input",className:o("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function po({className:e,...t}){return(0,Q.jsx)(ce.Command.List,{"data-slot":"command-list",className:o("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function go({...e}){return(0,Q.jsx)(ce.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Ct({className:e,...t}){return(0,Q.jsx)(ce.Command.Group,{"data-slot":"command-group",className:o("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function fo({className:e,...t}){return(0,Q.jsx)(ce.Command.Separator,{"data-slot":"command-separator",className:o("bg-border -mx-1 h-px",e),...t})}function yt({className:e,...t}){return(0,Q.jsx)(ce.Command.Item,{"data-slot":"command-item",className:o("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var tt=require("lucide-react"),f=require("react/jsx-runtime");function bo({column:e,title:t,options:a}){let l=e?.getFacetedUniqueValues(),m=new Set(e?.getFilterValue());return(0,f.jsxs)(je,{children:[(0,f.jsx)(Ue,{asChild:!0,children:(0,f.jsxs)(b,{variant:"outline",size:"sm",className:"h-9 border-dashed rounded-lg",children:[(0,f.jsx)(tt.PlusCircleIcon,{className:"mr-2 h-4 w-4"}),t,m?.size>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Je,{orientation:"vertical",className:"mx-2 h-4"}),(0,f.jsx)(et,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:m.size}),(0,f.jsx)("div",{className:"hidden space-x-1 lg:flex",children:m.size>2?(0,f.jsxs)(et,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[m.size," selected"]}):a.filter(c=>m.has(c.value)).map(c=>(0,f.jsx)(et,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:c.label},c.value))})]})]})}),(0,f.jsx)($e,{className:"w-[200px] p-0 rounded-lg",align:"start",children:(0,f.jsxs)(mo,{className:"rounded-lg",children:[(0,f.jsx)(uo,{placeholder:t}),(0,f.jsxs)(po,{children:[(0,f.jsx)(go,{children:"No results found."}),(0,f.jsx)(Ct,{children:a.map(c=>{let N=m.has(c.value);return(0,f.jsxs)(yt,{onSelect:()=>{N?m.delete(c.value):m.add(c.value);let I=Array.from(m);e?.setFilterValue(I.length?I:void 0)},children:[(0,f.jsx)("div",{className:o("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",N?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,f.jsx)(tt.CheckIcon,{className:o("h-4 w-4")})}),c.icon&&(0,f.jsx)(c.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),(0,f.jsx)("span",{children:c.label}),l?.get(c.value)&&(0,f.jsx)("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(c.value)})]},c.value)})}),m.size>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(fo,{}),(0,f.jsx)(Ct,{children:(0,f.jsx)(yt,{onSelect:()=>e?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}0&&(module.exports={DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTableColumnHeader,DataTableFacetedFilter,DataTablePagination,DataTableToolbar,DataTableViewOptions});
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|