@tirth_jasoliya/ui 1.0.9 → 1.0.11

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.
Files changed (78) hide show
  1. package/dist/components/data/data-table/data-table-action-bar.cjs +1 -1
  2. package/dist/components/data/data-table/data-table-action-bar.cjs.map +1 -1
  3. package/dist/components/data/data-table/data-table-action-bar.js +1 -1
  4. package/dist/components/data/data-table/data-table-action-bar.js.map +1 -1
  5. package/dist/components/data/data-table/data-table-pagination.cjs +1 -1
  6. package/dist/components/data/data-table/data-table-pagination.cjs.map +1 -1
  7. package/dist/components/data/data-table/data-table-pagination.js +1 -1
  8. package/dist/components/data/data-table/data-table-pagination.js.map +1 -1
  9. package/dist/components/data/data-table/data-table-toolbar.cjs +1 -1
  10. package/dist/components/data/data-table/data-table-toolbar.cjs.map +1 -1
  11. package/dist/components/data/data-table/data-table-toolbar.d.cts +6 -2
  12. package/dist/components/data/data-table/data-table-toolbar.d.ts +6 -2
  13. package/dist/components/data/data-table/data-table-toolbar.js +1 -1
  14. package/dist/components/data/data-table/data-table-toolbar.js.map +1 -1
  15. package/dist/components/data/data-table/data-table-types.cjs +1 -1
  16. package/dist/components/data/data-table/data-table-types.cjs.map +1 -1
  17. package/dist/components/data/data-table/data-table-types.d.cts +48 -2
  18. package/dist/components/data/data-table/data-table-types.d.ts +48 -2
  19. package/dist/components/data/data-table/data-table.cjs +1 -1
  20. package/dist/components/data/data-table/data-table.cjs.map +1 -1
  21. package/dist/components/data/data-table/data-table.d.cts +1 -1
  22. package/dist/components/data/data-table/data-table.d.ts +1 -1
  23. package/dist/components/data/data-table/data-table.js +1 -1
  24. package/dist/components/data/data-table/data-table.js.map +1 -1
  25. package/dist/components/data/data-table/index.cjs +1 -1
  26. package/dist/components/data/data-table/index.cjs.map +1 -1
  27. package/dist/components/data/data-table/index.js +1 -1
  28. package/dist/components/data/data-table/index.js.map +1 -1
  29. package/dist/components/data/data-template/data-template.cjs +1 -1
  30. package/dist/components/data/data-template/data-template.cjs.map +1 -1
  31. package/dist/components/data/data-template/data-template.js +1 -1
  32. package/dist/components/data/data-template/data-template.js.map +1 -1
  33. package/dist/components/data/data-template/index.cjs +1 -1
  34. package/dist/components/data/data-template/index.cjs.map +1 -1
  35. package/dist/components/data/data-template/index.js +1 -1
  36. package/dist/components/data/data-template/index.js.map +1 -1
  37. package/dist/components/date-helper.cjs +3 -0
  38. package/dist/components/date-helper.cjs.map +1 -0
  39. package/dist/components/date-helper.d.cts +27 -0
  40. package/dist/components/date-helper.d.ts +27 -0
  41. package/dist/components/date-helper.js +3 -0
  42. package/dist/components/date-helper.js.map +1 -0
  43. package/dist/components/helper/date-filter.cjs +3 -0
  44. package/dist/components/helper/date-filter.cjs.map +1 -0
  45. package/dist/components/helper/date-filter.d.cts +14 -0
  46. package/dist/components/helper/date-filter.d.ts +14 -0
  47. package/dist/components/helper/date-filter.js +3 -0
  48. package/dist/components/helper/date-filter.js.map +1 -0
  49. package/dist/components/layouts/app-content.cjs +1 -1
  50. package/dist/components/layouts/app-content.cjs.map +1 -1
  51. package/dist/components/layouts/app-content.d.cts +2 -2
  52. package/dist/components/layouts/app-content.d.ts +2 -2
  53. package/dist/components/layouts/app-content.js +1 -1
  54. package/dist/components/layouts/app-content.js.map +1 -1
  55. package/dist/components/layouts/factories.cjs +1 -1
  56. package/dist/components/layouts/factories.cjs.map +1 -1
  57. package/dist/components/layouts/factories.js +1 -1
  58. package/dist/components/layouts/factories.js.map +1 -1
  59. package/dist/components/layouts/index.cjs +1 -1
  60. package/dist/components/layouts/index.cjs.map +1 -1
  61. package/dist/components/layouts/index.js +1 -1
  62. package/dist/components/layouts/index.js.map +1 -1
  63. package/dist/components/ui/calendar.cjs +3 -0
  64. package/dist/components/ui/calendar.cjs.map +1 -0
  65. package/dist/components/ui/calendar.d.cts +13 -0
  66. package/dist/components/ui/calendar.d.ts +13 -0
  67. package/dist/components/ui/calendar.js +3 -0
  68. package/dist/components/ui/calendar.js.map +1 -0
  69. package/dist/components/ui/table.cjs +1 -1
  70. package/dist/components/ui/table.cjs.map +1 -1
  71. package/dist/components/ui/table.js +1 -1
  72. package/dist/components/ui/table.js.map +1 -1
  73. package/dist/index.cjs +1 -1
  74. package/dist/index.cjs.map +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/index.js.map +1 -1
  77. package/package.json +29 -18
  78. package/dist/styles.css +0 -2
@@ -1,3 +1,3 @@
1
1
  "use client"
2
- import{flexRender as Xe,getCoreRowModel as No,getFilteredRowModel as To,getPaginationRowModel as So,getSortedRowModel as Ro,useReactTable as ko}from"@tanstack/react-table";import{Loader2 as wt,ChevronUp as Je,ChevronDown as Qe,ChevronsUpDown as zo,MoreHorizontal as Mo,MoveRightIcon as Io,PinOffIcon as Vo}from"lucide-react";import{Slot as Zt}from"radix-ui";import{cva as eo}from"class-variance-authority";import{clsx as Qt}from"clsx";import{twMerge as Yt}from"tailwind-merge";function o(...e){return Yt(Qt(e))}import{jsx as oo}from"react/jsx-runtime";var to=eo("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 f({className:e,variant:t,size:n,asChild:m=!1,...p}){let c=m?Zt.Slot:"button";return oo(c,{"data-slot":"button",className:o(to({variant:t,size:n,className:e}),"transition-none"),...p})}import{jsx as H}from"react/jsx-runtime";function Le({className:e,...t}){return H("div",{"data-slot":"table-container",className:"relative w-full overflow-auto max-h-full",children:H("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function ct({className:e,...t}){return H("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function pt({className:e,...t}){return H("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function ut({className:e,...t}){return H("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ce({className:e,...t}){return H("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 H("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function xe({className:e,...t}){return H("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as ft}from"react/jsx-runtime";function he({className:e,...t}){return ft("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 we({className:e,...t}){return ft("div",{"data-slot":"card-content",className:o("px-6",e),...t})}import{Tooltip as ee}from"radix-ui";import{jsx as te,jsxs as ao}from"react/jsx-runtime";function pe({delayDuration:e=0,...t}){return te(ee.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ge({...e}){return te(pe,{children:te(ee.Root,{"data-slot":"tooltip",...e})})}function He({...e}){return te(ee.Trigger,{"data-slot":"tooltip-trigger",...e})}function Oe({className:e,sideOffset:t=0,children:n,...m}){return te(ee.Portal,{children:ao(ee.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),...m,children:[n,te(ee.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Search as po,RefreshCw as uo,Download as go,Settings2 as fo,Filter as vt,ArrowUpDown as bo,PinOff as vo,Pin as Ct,ChevronDown as Co}from"lucide-react";import{jsx as no}from"react/jsx-runtime";function Ee({className:e,type:t,...n}){return no("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),...n})}import{Select as z}from"radix-ui";import{CheckIcon as ro,ChevronDownIcon as bt,ChevronUpIcon as io}from"lucide-react";import{jsx as y,jsxs as Ue}from"react/jsx-runtime";function ye({...e}){return y(z.Root,{"data-slot":"select",...e})}function Pe({...e}){return y(z.Value,{"data-slot":"select-value",...e})}function De({className:e,size:t="default",children:n,...m}){return Ue(z.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),...m,children:[n,y(z.Icon,{asChild:!0,children:y(bt,{className:"size-4 opacity-50"})})]})}function Ne({className:e,children:t,position:n="popper",...m}){return y(z.Portal,{children:Ue(z.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",n==="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:n,...m,children:[y(so,{}),y(z.Viewport,{className:o("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),y(lo,{})]})})}function ue({className:e,children:t,...n}){return Ue(z.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),...n,children:[y("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:y(z.ItemIndicator,{children:y(ro,{className:"size-4"})})}),y(z.ItemText,{children:t})]})}function so({className:e,...t}){return y(z.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:y(io,{className:"size-4"})})}function lo({className:e,...t}){return y(z.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:y(bt,{className:"size-4"})})}import{DropdownMenu as B}from"radix-ui";import{CheckIcon as mo,ChevronRightIcon as Va,CircleIcon as _a}from"lucide-react";import{jsx as I,jsxs as co}from"react/jsx-runtime";function A({...e}){return I(B.Root,{"data-slot":"dropdown-menu",...e})}function L({...e}){return I(B.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function G({className:e,sideOffset:t=4,...n}){return I(B.Portal,{children:I(B.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),...n})})}function je({...e}){return I(B.Group,{"data-slot":"dropdown-menu-group",...e})}function P({className:e,inset:t,variant:n="default",...m}){return I(B.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,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),...m})}function ge({className:e,children:t,checked:n,...m}){return co(B.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:n,...m,children:[I("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:I(B.ItemIndicator,{children:I(mo,{className:"size-4"})})}),t]})}function V({className:e,inset:t,...n}){return I(B.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),...n})}function _({className:e,...t}){return I(B.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}import{Fragment as xo,jsx as s,jsxs as b}from"react/jsx-runtime";function We({table:e,filters:t=[],globalFilter:n,onGlobalFilterChange:m,enableGlobalFilter:p=!0,onExport:c,onRefresh:S,loading:R=!1,enableColumnVisibility:ie=!0,data:J,onClearSorting:j,onClearFilters:se,enableColumnPinning:le=!1}){let de=()=>e.getAllLeafColumns().filter(i=>i.getCanHide?.()!==!1),Q=()=>e.getAllColumns().filter(i=>!e.getAllLeafColumns().includes(i)&&i.columns?.length&&i.columns.some(d=>d.getCanHide?.()!==!1)),Y=()=>{let i=new Set(Q().flatMap(d=>d.columns?.filter(M=>M.getCanHide?.()!==!1).map(M=>M.id)||[]));return de().filter(d=>!i.has(d.id))},me=(i,d)=>d&&i.startsWith(`${d}.`)?i.replace(`${d}.`,"").split("_").map(be=>be.slice(1)).join(" "):i.split("_").map(M=>M.charAt(0).toUpperCase()+M.slice(1)).join(" ");return s("div",{className:"rounded-xl",children:s("div",{className:"px-2",children:s("div",{className:"flex flex-col gap-6",children:b("div",{className:"flex items-center justify-between",children:[s("div",{className:"flex items-center gap-3",children:t.length>0&&b("div",{className:"flex items-center gap-3 flex-wrap",children:[s("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:s(vt,{className:"h-4 w-4"})}),t.map(i=>s("div",{className:o("relative min-w-[150px]",i.width),children:i.type==="select"?b(ye,{value:e.getColumn(i.key)?.getFilterValue()??"",onValueChange:d=>e.getColumn(i.key)?.setFilterValue(d==="all"?"":d),children:[i.icon&&s("span",{children:s(i.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),s(De,{className:o("h-9 rounded-lg w-full",i.icon&&"pl-9"),children:s(Pe,{placeholder:i.placeholder})}),b(Ne,{className:"rounded-lg",children:[s(ue,{value:"all",children:"All"}),i.options?.map(d=>s(ue,{value:d.value,children:d.label},d.label))]})]}):b("div",{className:"relative",children:[i.icon&&s("span",{children:s(i.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),s(Ee,{placeholder:i.placeholder,value:e.getColumn(i.key)?.getFilterValue()??"",onChange:d=>e.getColumn(i.key)?.setFilterValue(d.target.value),className:o("h-9 rounded-lg",i.icon&&"pl-9"),type:i.type==="number"?"number":i.type==="date"?"date":"text"})]})},i.key))]})}),b("div",{className:"flex items-center gap-2",children:[p&&b("div",{className:"relative",children:[s(po,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s(Ee,{placeholder:"Global search...",value:n??"",onChange:i=>m(i.target.value),className:"pl-9 max-w-max"})]}),c&&b(f,{variant:"outline",size:"sm",onClick:()=>c(J),className:"rounded-lg",children:[s(go,{className:"mr-2 h-4 w-4"}),"Export"]}),ie&&b(A,{children:[s(L,{asChild:!0,children:b(f,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[s("span",{children:"Columns"}),s(Co,{className:"h-4 w-4 opacity-50"})]})}),b(G,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[s(V,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),s(_,{}),Y().length>0&&b(je,{children:[s(V,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),Y().map(i=>s(ge,{className:"text-sm",checked:i.getIsVisible(),onCheckedChange:d=>i.toggleVisibility(!!d),children:me(i.id)},i.id))]}),Q().map(i=>b(je,{children:[s(_,{}),s(V,{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=>s(ge,{className:"text-sm",checked:d.getIsVisible(),onCheckedChange:M=>d.toggleVisibility(!!M),children:me(d.id,i.id)},d.id))]},i.id))]})]}),b(A,{children:[s(L,{asChild:!0,children:s(f,{variant:"outline",size:"sm",className:"rounded-lg",children:s(fo,{className:"h-4 w-4"})})}),b(G,{align:"end",className:"w-[200px] rounded-lg",children:[s(V,{children:"Table Settings"}),s(_,{}),b(P,{onClick:j,children:[s(bo,{className:"mr-2 h-4 w-4"}),"Clear All Sorting"]}),b(P,{onClick:se,children:[s(vt,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]}),le&&b(xo,{children:[s(_,{}),s(V,{children:"Column Pinning"}),b(P,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[s(vo,{className:"mr-2 h-4 w-4"}),"Reset All Pinning"]}),b(P,{onClick:()=>{let i=de().filter(d=>d.getCanPin?.()!==!1).map(d=>d.id);e.setColumnPinning({left:i,right:[]})},children:[s(Ct,{className:"mr-2 h-4 w-4 rotate-90"}),"Pin All Left"]}),b(P,{onClick:()=>{let i=de().filter(d=>d.getCanPin?.()!==!1).map(d=>d.id);e.setColumnPinning({left:[],right:i})},children:[s(Ct,{className:"mr-2 h-4 w-4 -rotate-90"}),"Pin All Right"]})]})]})]}),S&&s(f,{variant:"outline",size:"sm",onClick:S,disabled:R,className:"rounded-lg",children:s(uo,{className:o("h-4 w-4",R&&"animate-spin")})})]})]})})})})}import{jsx as D,jsxs as oe}from"react/jsx-runtime";function $e({table:e,config:t}){return t.enabled?D("div",{className:"rounded-xl",children:D("div",{children:oe("div",{className:"flex items-center justify-between",children:[D("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&oe("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"]})}),oe("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&oe("div",{className:"flex items-center gap-2",children:[D("span",{className:"text-sm font-medium",children:"Rows per page:"}),oe(ye,{value:`${e.getState().pagination.pageSize}`,onValueChange:n=>e.setPageSize(Number(n)),children:[D(De,{className:"h-9 w-[70px] rounded-lg",children:D(Pe,{})}),D(Ne,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(n=>D(ue,{value:`${n}`,children:n},n))})]})]}),oe("div",{className:"flex items-center gap-2",children:[D(f,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),D(f,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&D("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(n,m)=>{let p=e.getState().pagination.pageIndex,c=p-2+m+1;return c<1||c>e.getPageCount()?null:D(f,{variant:c===p+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(c-1),children:c},c)})}),D(f,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),D(f,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}import{Toggle as ho}from"radix-ui";import{cva as wo}from"class-variance-authority";import{jsx as Po}from"react/jsx-runtime";var yo=wo("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 xt({className:e,variant:t,size:n,noBg:m,...p}){return Po(ho.Root,{"data-slot":"toggle",className:o(yo({className:e,variant:t,size:n,bg:m?"disabled":"enabled"})),...p})}import{Checkbox as ht}from"radix-ui";import{CheckIcon as Do}from"lucide-react";import{jsx as qe}from"react/jsx-runtime";function Ke({className:e,...t}){return qe(ht.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:qe(ht.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:qe(Do,{className:"size-3.5"})})})}import{useCallback as yt,useEffect as Pt,useMemo as _o,useState as K}from"react";import{Fragment as Dt,jsx as r,jsxs as v}from"react/jsx-runtime";function Fo({data:e,columns:t,filters:n=[],pagination:m={enabled:!1},settings:p={},header:c,footer:S,className:R="",maxHeight:ie="600px",loading:J=!1,error:j,emptyMessage:se="No data available",onRowSelectionChange:le,onExport:de,onRefresh:Q,onTableReady:Y,children:me}){let[i,d]=K([]),[M,be]=K([]),[Ft,Bt]=K({}),[tt,At]=K({}),[ot,ze]=K(""),[Lt,Gt]=K([]),[Me,Ht]=K(p.enableColumnPinning?{left:[],right:[]}:{}),{enableSorting:Ie=!0,enableFiltering:Ve=!0,enableGlobalFilter:at=!0,enableColumnVisibility:_e=!0,enableRowSelection:k=!0,stickyHeader:Ot=!0,toolbar:Et=!1,showSerialNumbers:W=!0,fixedCheckboxColumn:ve=!0,striped:Ut=!0,hoverable:jt=!0,compact:nt=!0,bordered:rt=!0,fullHeight:Wt=!1,enableColumnResizing:it=!1,enableColumnPinning:T=!0,hideHeader:$t=!1}=p,Fe=_o(()=>{let g=[...t],C=u=>u.map(l=>{if(l.id==="select"||l.id==="serialNumber")return l;let x={...l,enablePinning:!0};return l.columns&&(x.columns=C(l.columns)),x}),a=C(g);if(k){let u={id:"select",header:({table:l})=>r(Ke,{checked:l.getIsAllPageRowsSelected()||l.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:x=>l.toggleAllPageRowsSelected(!!x),"aria-label":"Select all"}),cell:({row:l})=>r("div",{className:o("flex items-center justify-center"),children:r(Ke,{checked:l.getIsSelected(),onCheckedChange:x=>l.toggleSelected(!!x),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:10};a.unshift(u)}if(W){let u={id:"serialNumber",header:"No.",cell:({row:l})=>r("div",{className:"text-center font-medium text-muted-foreground",children:l.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};a.unshift(u)}return a},[t,W,k,ve]),w=ko({data:e,columns:Fe,onSortingChange:Ie?d:void 0,onColumnFiltersChange:Ve?be:void 0,onGlobalFilterChange:at?ze:void 0,getCoreRowModel:No(),getPaginationRowModel:m.enabled?So():void 0,getSortedRowModel:Ie?Ro():void 0,getFilteredRowModel:Ve?To():void 0,onColumnVisibilityChange:_e?Bt:void 0,onRowSelectionChange:k?At:void 0,onColumnOrderChange:Gt,onColumnPinningChange:T?Ht:void 0,state:{sorting:Ie?i:void 0,columnFilters:Ve?M:void 0,columnVisibility:_e?Ft:void 0,rowSelection:k?tt:{},globalFilter:ot,columnOrder:Lt,columnPinning:T?Me:{}},initialState:{pagination:m.enabled?{pageSize:m.pageSize||10}:void 0,columnPinning:T?{left:[...W?["serialNumber"]:[],...k?["select"]:[]],right:[]}:void 0},enableRowSelection:k,enableColumnResizing:it,enableColumnPinning:T,columnResizeMode:"onChange"});Pt(()=>{Y&&Y(w)},[w,Y]),Pt(()=>{if(k&&le){let g=w.getFilteredSelectedRowModel().rows.map(C=>C.original);le(g)}},[tt,k,le,w]);let qt=yt(()=>{d([])},[]),Kt=yt(()=>{be([]),ze("")},[]),st=(g,C)=>{if(!T)return;let a=[...W?["serialNumber"]:[],...k&&ve?["select"]:[]],u={left:[...(Me.left??[]).filter(l=>a.includes(l))],right:[...Me.right??[]]};C===!1?(u.left=u.left.filter(l=>l!==g),u.right=u.right.filter(l=>l!==g)):C==="right"?(u.left=u.left.filter(l=>l!==g),u.right.includes(g)||u.right.push(g)):C==="left"&&(u.right=u.right.filter(l=>l!==g),!u.left.includes(g)&&!a.includes(g)&&u.left.push(g)),w.setColumnPinning(u)},Xt=()=>r(ct,{className:o(Ot&&"sticky top-0 bg-sidebar z-20"),children:w.getHeaderGroups().map((g,C)=>r(ce,{className:"hover:bg-transparent",children:g.headers.map((a,u)=>{let l=a.depth===0&&a.colSpan>1,x=T&&(a.column.getIsPinned()==="left"||a.column.id==="serialNumber"||a.column.id==="select"&&k),$=T&&a.column.getIsPinned()==="right",q=a.column.getCanSort(),Be=T&&a.column.columnDef.enablePinning!==!1,Ce=a.column.id==="serialNumber",Ae=a.column.id==="select",mt=Ce||Ae&&ve,Z=a.column.columnDef.headerAlign||"left",Jt={left:"justify-start",center:"justify-center",right:"justify-end"}[Z];return v(gt,{colSpan:a.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!nt&&"py-2",rt&&u<g.headers.length-1&&"border-r","relative",x&&"sticky left-0 z-15 bg-sidebar",$&&"sticky right-0 z-15 bg-sidebar",(Ce||Ae)&&"sticky left-0 z-15 bg-sidebar",l?"text-center":"text-left"),style:{width:a.getSize()!==150?a.getSize():"auto",minWidth:a.getSize()!==150?a.getSize():"auto",...x&&{left:Ce?0:Ae?W&&w.getColumn("serialNumber")?.getSize()||0:lt(a.column)},...$&&{right:dt(a.column)},...Ce&&{left:0}},children:[l?r("div",{className:"flex items-center justify-center",children:Xe(a.column.columnDef.header,a.getContext())}):v("div",{className:o("relative flex items-center w-full px-2",Jt),children:[v("div",{className:"flex items-center gap-1",children:[q&&Z==="right"&&r("span",{className:"ml-1 order-2",children:a.column.getIsSorted()&&{asc:r(Je,{className:"h-4 w-4"}),desc:r(Qe,{className:"h-4 w-4"})}[a.column.getIsSorted()]}),a.isPlaceholder?null:Xe(a.column.columnDef.header,a.getContext()),q&&Z!=="right"&&a.column.getIsSorted()&&r("span",{className:"ml-1 order-2",children:a.column.getIsSorted()&&{asc:r(Je,{className:"h-4 w-4"}),desc:r(Qe,{className:"h-4 w-4"})}[a.column.getIsSorted()]})]}),(q||Be&&!mt)&&v(A,{children:[r(L,{asChild:!0,className:o("absolute",Z==="left"&&"right-1",Z==="center"&&"right-1",Z==="right"&&"left-1"),children:r(xt,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:r(Mo,{className:"h-4 w-4"})})}),v(G,{align:"end",className:"w-48",children:[q&&v(Dt,{children:[r(V,{children:"Sorting"}),v(P,{onClick:()=>a.column.toggleSorting(!1),children:[r(Je,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),v(P,{onClick:()=>a.column.toggleSorting(!0),children:[r(Qe,{className:"mr-2 h-4 w-4"}),"Sort Descending"]}),v(P,{onClick:()=>a.column.clearSorting(),disabled:!a.column.getIsSorted(),children:[r(zo,{className:"mr-2 h-4 w-4"}),"Clear Sort"]}),r(_,{})]}),Be&&!mt&&v(Dt,{children:[r(V,{children:"Pin Column"}),v(P,{onClick:()=>st(a.column.id,"right"),disabled:a.column.getIsPinned()==="right",children:[r(Io,{}),"Pin Right"]}),v(P,{onClick:()=>st(a.column.id,!1),disabled:!a.column.getIsPinned(),children:[r(Vo,{}),"Unpin"]})]})]})]})]}),it&&a.column.getCanResize()&&!l&&a.colSpan===1&&r("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:a.getResizeHandler()})]},a.id)})},g.id))}),lt=g=>{if(!T)return;let C=0,a=w.getLeftHeaderGroups()[0]?.headers||[],u=[...W?["serialNumber"]:[],...k?["select"]:[]];for(let l of a){if(l.id===g.id)break;if(u.includes(l.id)){let x=w.getColumn(l.id);x&&(C+=x.getSize())}}return C},dt=g=>{if(!T)return;let C=w.getState().columnPinning.right||[],a=C.indexOf(g.id);if(a===-1)return;let u=0;for(let l=a+1;l<C.length;l++){let x=w.getColumn(C[l]);x&&(u+=x.getSize())}return u};return j?r(he,{className:"w-full rounded-xl shadow-sm",children:r(we,{className:"flex items-center justify-center",children:v("div",{className:"text-center",children:[r("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),r("p",{className:"text-sm text-muted-foreground mb-4",children:j}),Q&&v(f,{variant:"outline",size:"sm",onClick:Q,className:"rounded-lg",children:[r(wt,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):r(pe,{children:v("div",{className:o("w-full space-y-2 flex flex-col h-full",R),children:[c&&r(he,{className:"rounded-2xl py-2 sticky top-0 z-20",children:r(we,{className:"px-2",children:c})}),Et&&r(We,{table:w,filters:n,globalFilter:ot,onGlobalFilterChange:ze,enableGlobalFilter:at,onExport:de,onRefresh:Q,loading:J,enableColumnVisibility:_e,enableColumnPinning:T,data:e,onClearSorting:qt,onClearFilters:Kt}),r(he,{className:o("shadow-sm overflow-auto py-0",Wt&&"flex-1"),children:r(we,{className:"p-0 h-full",children:v("div",{className:"relative flex flex-col h-full justify-between",children:[J&&r("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl",children:v("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[r(wt,{className:"size-5 animate-spin text-primary"}),r("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),r("div",{className:"relative rounded-t-xl overflow-auto border-b",children:v(Le,{className:"border-collapse w-full",children:[!$t&&Xt(),r(pt,{children:w.getRowModel().rows?.length?w.getRowModel().rows.map((g,C)=>r(ce,{"data-state":g.getIsSelected()&&"selected",className:o(jt&&"hover:bg-muted/50",Ut&&C%2===0&&"bg-muted/20",g.getIsSelected()&&"bg-muted","border-b last:border-b-0"),children:g.getVisibleCells().map((a,u)=>{let l=T&&(a.column.getIsPinned()==="left"||a.column.id==="serialNumber"||a.column.id==="select"&&k),x=T&&a.column.getIsPinned()==="right",$=a.column.id==="serialNumber",q=a.column.id==="select",Be=$||q&&ve;return r(xe,{className:o(nt?"py-2":"py-4",rt&&u<g.getVisibleCells().length&&"border-r",l&&"sticky left-0 z-10 bg-sidebar/97",x&&"sticky right-0 z-10 bg-sidebar/97",$&&"sticky left-0 z-10 bg-sidebar/97","p-1"),style:{width:a.column.getSize()!==150?a.column.getSize():"auto",minWidth:a.column.getSize()!==150?a.column.getSize():"auto",...l&&{left:$?0:q?W&&w.getColumn("serialNumber")?.getSize()||0:lt(a.column)},...x&&{right:dt(a.column)},...$&&{left:0}},children:Xe(a.column.columnDef.cell,a.getContext())},a.id)})},g.id)):r(ce,{children:r(xe,{colSpan:Fe.length,className:"h-32 text-center border-0",children:v("div",{className:"flex flex-col items-center gap-3",children:[r("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),r("p",{className:"text-muted-foreground font-medium",children:se})]})})})})]})}),S&&r("div",{className:"sticky bottom-0 bg-sidebar w-full z-20",style:{width:"100%",minWidth:"fit-content"},children:r(Le,{children:r(ut,{children:r(ce,{className:"bg-sidebar",children:r(xe,{colSpan:Fe.length,className:"p-2",children:S})})})})})]})})}),r($e,{table:w,config:m}),me&&me(w)]})})}import{Separator as Bo}from"radix-ui";import{jsx as Ao}from"react/jsx-runtime";function Te({className:e,orientation:t="horizontal",decorative:n=!0,...m}){return Ao(Bo.Root,{"data-slot":"separator-root",decorative:n,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),...m})}import{Loader as Lo,X as Go}from"lucide-react";import{AnimatePresence as Ho,motion as Oo}from"framer-motion";import*as O from"react";import*as Nt from"react-dom";import{jsx as N,jsxs as ae}from"react/jsx-runtime";function Eo({table:e,visible:t,container:n,children:m,className:p,...c}){let[S,R]=O.useState(!1);O.useLayoutEffect(()=>{R(!0)},[]),O.useEffect(()=>{function j(se){se.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[e]);let ie=n??(S?globalThis.document?.body:null);if(!ie||!e)return null;let J=t??e.getFilteredSelectedRowModel().rows.length>0;return Nt.createPortal(N(Ho,{children:J&&N(Oo.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",p),...c,children:ae(pe,{children:["1",m]})})}),ie)}function Uo({size:e="sm",tooltip:t,isPending:n,disabled:m,className:p,children:c,...S}){let R=N(f,{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",p),disabled:m||n,...S,children:n?N(Lo,{className:"animate-spin"}):c});return t?ae(Ge,{children:[N(He,{asChild:!0,children:R}),N(Oe,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:N("p",{children:t})})]}):R}function jo({table:e}){let t=O.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?ae("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[ae("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),N(Te,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),ae(Ge,{children:[N(He,{asChild:!0,children:N(f,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:N(Go,{className:"size-3.5"})})}),ae(Oe,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[N("p",{children:"Clear selection"}),N("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:N("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{ArrowUpDown as fe,EyeOff as Wo}from"lucide-react";import{jsx as F,jsxs as ne}from"react/jsx-runtime";function $o({column:e,title:t,className:n}){return e.getCanSort()?F("div",{className:o("flex items-center space-x-2",n),children:ne(A,{children:[F(L,{asChild:!0,children:ne(f,{variant:"ghost",size:"sm",className:"-ml-3 h-8 data-[state=open]:bg-accent",children:[F("span",{children:t}),e.getIsSorted()==="desc"?F(fe,{className:"ml-2 h-4 w-4"}):e.getIsSorted()==="asc"?F(fe,{className:"ml-2 h-4 w-4"}):F(fe,{className:"ml-2 h-4 w-4"})]})}),ne(G,{align:"start",className:"rounded-lg",children:[ne(P,{onClick:()=>e.toggleSorting(!1),children:[F(fe,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),ne(P,{onClick:()=>e.toggleSorting(!0),children:[F(fe,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),F(_,{}),ne(P,{onClick:()=>e.toggleVisibility(!1),children:[F(Wo,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Hide"]})]})]})}):F("div",{className:o(n),children:t})}import{ChevronDown as qo,Eye as Ko}from"lucide-react";import{jsx as re,jsxs as Ye}from"react/jsx-runtime";function Xo({table:e}){return Ye(A,{children:[re(L,{asChild:!0,children:Ye(f,{variant:"outline",size:"sm",className:"rounded-lg",children:[re(Ko,{className:"mr-2 h-4 w-4"}),"Columns ",re(qo,{className:"ml-2 h-4 w-4"})]})}),Ye(G,{align:"end",className:"w-[200px] rounded-lg",children:[re(V,{children:"Toggle Columns"}),re(_,{}),e.getAllColumns().filter(t=>typeof t.accessorFn<"u"&&t.getCanHide()).map(t=>re(ge,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:n=>t.toggleVisibility(!!n),children:t.id},t.id))]})]})}import{Slot as Jo}from"radix-ui";import{cva as Qo}from"class-variance-authority";import{jsx as Zo}from"react/jsx-runtime";var Yo=Qo("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 Se({className:e,variant:t,asChild:n=!1,...m}){let p=n?Jo.Slot:"span";return Zo(p,{"data-slot":"badge",className:o(Yo({variant:t}),e),...m})}import{Command as X}from"cmdk";import{SearchIcon as ea}from"lucide-react";import{Dialog as Qn}from"radix-ui";import{XIcon as Zn}from"lucide-react";import{jsx as or,jsxs as ar}from"react/jsx-runtime";import{jsx as E,jsxs as ta}from"react/jsx-runtime";function Tt({className:e,...t}){return E(X,{"data-slot":"command",className:o("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function St({className:e,...t}){return ta("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[E(ea,{className:"size-4 shrink-0 opacity-50"}),E(X.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 Rt({className:e,...t}){return E(X.List,{"data-slot":"command-list",className:o("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function kt({...e}){return E(X.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Ze({className:e,...t}){return E(X.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 zt({className:e,...t}){return E(X.Separator,{"data-slot":"command-separator",className:o("bg-border -mx-1 h-px",e),...t})}function et({className:e,...t}){return E(X.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})}import{Popover as Re}from"radix-ui";import{jsx as ke}from"react/jsx-runtime";function Mt({...e}){return ke(Re.Root,{"data-slot":"popover",...e})}function It({...e}){return ke(Re.Trigger,{"data-slot":"popover-trigger",...e})}function Vt({className:e,align:t="center",sideOffset:n=4,...m}){return ke(Re.Portal,{children:ke(Re.Content,{"data-slot":"popover-content",align:t,sideOffset:n,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),...m})})}import{CheckIcon as oa,PlusCircleIcon as aa}from"lucide-react";import{Fragment as _t,jsx as h,jsxs as U}from"react/jsx-runtime";function na({column:e,title:t,options:n}){let m=e?.getFacetedUniqueValues(),p=new Set(e?.getFilterValue());return U(Mt,{children:[h(It,{asChild:!0,children:U(f,{variant:"outline",size:"sm",className:"h-9 border-dashed rounded-lg",children:[h(aa,{className:"mr-2 h-4 w-4"}),t,p?.size>0&&U(_t,{children:[h(Te,{orientation:"vertical",className:"mx-2 h-4"}),h(Se,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:p.size}),h("div",{className:"hidden space-x-1 lg:flex",children:p.size>2?U(Se,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[p.size," selected"]}):n.filter(c=>p.has(c.value)).map(c=>h(Se,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:c.label},c.value))})]})]})}),h(Vt,{className:"w-[200px] p-0 rounded-lg",align:"start",children:U(Tt,{className:"rounded-lg",children:[h(St,{placeholder:t}),U(Rt,{children:[h(kt,{children:"No results found."}),h(Ze,{children:n.map(c=>{let S=p.has(c.value);return U(et,{onSelect:()=>{S?p.delete(c.value):p.add(c.value);let R=Array.from(p);e?.setFilterValue(R.length?R:void 0)},children:[h("div",{className:o("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",S?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:h(oa,{className:o("h-4 w-4")})}),c.icon&&h(c.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),h("span",{children:c.label}),m?.get(c.value)&&h("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:m.get(c.value)})]},c.value)})}),p.size>0&&U(_t,{children:[h(zt,{}),h(Ze,{children:h(et,{onSelect:()=>e?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}export{Fo as DataTable,Eo as DataTableActionBar,Uo as DataTableActionBarAction,jo as DataTableActionBarSelection,$o as DataTableColumnHeader,na as DataTableFacetedFilter,$e as DataTablePagination,We as DataTableToolbar,Xo as DataTableViewOptions};
2
+ import{flexRender as jt,getCoreRowModel as An,getFilteredRowModel as Bn,getPaginationRowModel as Hn,getSortedRowModel as Ln,useReactTable as On}from"@tanstack/react-table";import{Loader2 as No,ChevronUp as Ut,ChevronDown as $t,ChevronsUpDown as En,MoreHorizontal as Gn,MoveRightIcon as jn,PinOffIcon as Un,Calculator as Po}from"lucide-react";import{Slot as rn}from"radix-ui";import{cva as sn}from"class-variance-authority";import{clsx as nn}from"clsx";import{twMerge as an}from"tailwind-merge";function o(...e){return an(nn(e))}import{jsx as ln}from"react/jsx-runtime";var et=sn("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:r,asChild:m=!1,...b}){let c=m?rn.Slot:"button";return ln(c,{"data-slot":"button",className:o(et({variant:t,size:r,className:e}),"transition-none"),...b})}import{jsx as ce}from"react/jsx-runtime";function kt({className:e,...t}){return ce("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:ce("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function no({className:e,...t}){return ce("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function ao({className:e,...t}){return ce("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Rt({className:e,...t}){return ce("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ie({className:e,...t}){return ce("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ro({className:e,...t}){return ce("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function me({className:e,...t}){return ce("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as io}from"react/jsx-runtime";function Mt({className:e,...t}){return io("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 zt({className:e,...t}){return io("div",{"data-slot":"card-content",className:o("px-6",e),...t})}import{Tooltip as Pe}from"radix-ui";import{jsx as De,jsxs as dn}from"react/jsx-runtime";function He({delayDuration:e=0,...t}){return De(Pe.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function It({...e}){return De(He,{children:De(Pe.Root,{"data-slot":"tooltip",...e})})}function Ft({...e}){return De(Pe.Trigger,{"data-slot":"tooltip-trigger",...e})}function _t({className:e,sideOffset:t=0,children:r,...m}){return De(Pe.Portal,{children:dn(Pe.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),...m,children:[r,De(Pe.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Search as vo,RefreshCw as Dn,Download as Tn,Settings2 as Sn,Filter as xo,ArrowUpDown as kn,PinOff as Rn,Pin as Mn,ChevronDown as ho,Calculator as Ot}from"lucide-react";import{jsx as cn}from"react/jsx-runtime";function Vt({className:e,type:t,...r}){return cn("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),...r})}import{Select as X}from"radix-ui";import{CheckIcon as mn,ChevronDownIcon as so,ChevronUpIcon as un}from"lucide-react";import{jsx as F,jsxs as At}from"react/jsx-runtime";function tt({...e}){return F(X.Root,{"data-slot":"select",...e})}function ot({...e}){return F(X.Value,{"data-slot":"select-value",...e})}function nt({className:e,size:t="default",children:r,...m}){return At(X.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),...m,children:[r,F(X.Icon,{asChild:!0,children:F(so,{className:"size-4 opacity-50"})})]})}function at({className:e,children:t,position:r="popper",...m}){return F(X.Portal,{children:At(X.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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...m,children:[F(pn,{}),F(X.Viewport,{className:o("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),F(gn,{})]})})}function Le({className:e,children:t,...r}){return At(X.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),...r,children:[F("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:F(X.ItemIndicator,{children:F(mn,{className:"size-4"})})}),F(X.ItemText,{children:t})]})}function pn({className:e,...t}){return F(X.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:F(un,{className:"size-4"})})}function gn({className:e,...t}){return F(X.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:F(so,{className:"size-4"})})}import{DropdownMenu as U}from"radix-ui";import{CheckIcon as fn,ChevronRightIcon as bn,CircleIcon as Ua}from"lucide-react";import{jsx as L,jsxs as uo}from"react/jsx-runtime";function oe({...e}){return L(U.Root,{"data-slot":"dropdown-menu",...e})}function ne({...e}){return L(U.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function ae({className:e,sideOffset:t=4,...r}){return L(U.Portal,{children:L(U.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),...r})})}function Bt({...e}){return L(U.Group,{"data-slot":"dropdown-menu-group",...e})}function _({className:e,inset:t,variant:r="default",...m}){return L(U.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,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),...m})}function Te({className:e,children:t,checked:r,...m}){return uo(U.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:r,...m,children:[L("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:L(U.ItemIndicator,{children:L(fn,{className:"size-4"})})}),t]})}function $({className:e,inset:t,...r}){return L(U.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),...r})}function K({className:e,...t}){return L(U.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}function lo({...e}){return L(U.Sub,{"data-slot":"dropdown-menu-sub",...e})}function co({className:e,inset:t,children:r,...m}){return uo(U.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:o("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...m,children:[r,L(bn,{className:"ml-auto size-4"})]})}function mo({className:e,...t}){return L(U.SubContent,{"data-slot":"dropdown-menu-sub-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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}import{useState as Co}from"react";import{useEffect as wn,useState as Ht}from"react";import{Calendar as Nn}from"lucide-react";import{format as Oe}from"date-fns";import{Popover as rt}from"radix-ui";import{jsx as it}from"react/jsx-runtime";function st({...e}){return it(rt.Root,{"data-slot":"popover",...e})}function lt({...e}){return it(rt.Trigger,{"data-slot":"popover-trigger",...e})}function dt({className:e,align:t="center",sideOffset:r=4,...m}){return it(rt.Portal,{children:it(rt.Content,{"data-slot":"popover-content",align:t,sideOffset:r,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),...m})})}import*as ct from"react";import{ChevronDownIcon as vn,ChevronLeftIcon as xn,ChevronRightIcon as hn}from"lucide-react";import{DayPicker as Cn,getDefaultClassNames as po}from"react-day-picker";import{jsx as ue}from"react/jsx-runtime";function go({className:e,classNames:t,showOutsideDays:r=!0,captionLayout:m="label",buttonVariant:b="ghost",formatters:c,components:S,...I}){let v=po();return ue(Cn,{showOutsideDays:r,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:m,formatters:{formatMonthDropdown:D=>D.toLocaleString("default",{month:"short"}),...c},classNames:{root:o("w-fit",v.root),months:o("flex gap-4 flex-col md:flex-row relative",v.months),month:o("flex flex-col w-full gap-4",v.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",v.nav),button_previous:o(et({variant:b}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_previous),button_next:o(et({variant:b}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",v.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",v.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",v.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",v.dropdown),caption_label:o("select-none font-medium",m==="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",v.caption_label),table:"w-full border-collapse",weekdays:o("flex",v.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",v.weekday),week:o("flex w-full mt-2",v.week),week_number_header:o("select-none w-(--cell-size)",v.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",v.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",v.day),range_start:o("rounded-l-md bg-accent",v.range_start),range_middle:o("rounded-none",v.range_middle),range_end:o("rounded-r-md bg-accent",v.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",v.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",v.outside),disabled:o("text-muted-foreground opacity-50",v.disabled),hidden:o("invisible",v.hidden),...t},components:{Root:({className:D,rootRef:k,...H})=>ue("div",{"data-slot":"calendar",ref:k,className:o(D),...H}),Chevron:({className:D,orientation:k,...H})=>k==="left"?ue(xn,{className:o("size-4",D),...H}):k==="right"?ue(hn,{className:o("size-4",D),...H}):ue(vn,{className:o("size-4",D),...H}),DayButton:yn,WeekNumber:({children:D,...k})=>ue("td",{...k,children:ue("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:D})}),...S},...I})}function yn({className:e,day:t,modifiers:r,...m}){let b=po(),c=ct.useRef(null);return ct.useEffect(()=>{r.focused&&c.current?.focus()},[r.focused]),ue(C,{ref:c,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.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",b.day,e),...m})}import{jsx as xe,jsxs as Ee}from"react/jsx-runtime";function fo({value:e,onChange:t,placeholder:r,mode:m,externalSearch:b,onExternalChange:c,onlyExternal:S=!1}){let[I,v]=Ht(!1),[D,k]=Ht(e),[H,J]=Ht(e);wn(()=>{S||J(e)},[e,S]);let se=()=>{S||t(D),J(D),b&&c&&c(D),v(!1)},ee=()=>{k(H),v(!1)},W=()=>{let y=m==="single"?null:{from:null,to:null};k(y),S||t(y),J(y),b&&c&&c(y),v(!1)},E=()=>{let y=S?H:e;return y?m==="single"?Oe(y,"PPP"):y.from&&y.to?`${Oe(y.from,"MMM dd")} - ${Oe(y.to,"MMM dd, yyyy")}`:y.from?`From ${Oe(y.from,"MMM dd, yyyy")}`:y.to?`To ${Oe(y.to,"MMM dd, yyyy")}`:r:r},Q=y=>{k(m==="single"?y:y||{from:null,to:null})};return Ee(st,{open:I,onOpenChange:v,children:[xe(lt,{className:"h-8",asChild:!0,children:Ee(C,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!E()&&"text-muted-foreground"),children:[xe(Nn,{className:"mr-2 h-4 w-4"}),E()]})}),Ee(dt,{className:"w-auto p-0",align:"start",children:[xe("div",{className:"p-3",children:xe(go,{mode:m,selected:D,onSelect:Q,numberOfMonths:m==="range"?2:1,className:"rounded-md border",...m==="range"&&{required:!0}})}),Ee("div",{className:"flex items-center justify-between p-3 border-t",children:[xe(C,{variant:"ghost",size:"sm",onClick:W,children:"Clear"}),Ee("div",{className:"flex gap-2",children:[xe(C,{variant:"outline",size:"sm",onClick:ee,children:"Cancel"}),xe(C,{size:"sm",onClick:se,disabled:m==="range"&&(!D?.from||!D?.to),children:"Apply"})]})]})]})]})}import{Checkbox as bo}from"radix-ui";import{CheckIcon as Pn}from"lucide-react";import{jsx as Lt}from"react/jsx-runtime";function Ge({className:e,...t}){return Lt(bo.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:Lt(bo.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:Lt(Pn,{className:"size-3.5"})})})}import{Fragment as zn,jsx as l,jsxs as h}from"react/jsx-runtime";var yo=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}];function Et({table:e,filters:t=[],globalFilter:r,onGlobalFilterChange:m,enableGlobalFilter:b=!0,onExport:c,onRefresh:S,loading:I=!1,enableColumnVisibility:v=!0,data:D,onClearSorting:k,onClearFilters:H,enableColumnPinning:J=!1,onExternalSearch:se,onCustomFilterChange:ee,aggregations:W={},onAggregationChange:E}){let[Q,y]=Co({}),[Me,te]=Co({}),ze=()=>e.getAllLeafColumns().filter(n=>n.getCanHide?.()!==!1),qe=()=>e.getAllColumns().filter(n=>!e.getAllLeafColumns().includes(n)&&n.columns?.length&&n.columns.some(d=>d.getCanHide?.()!==!1)),Ie=()=>{let n=new Set(qe().flatMap(d=>d.columns?.filter(g=>g.getCanHide?.()!==!1).map(g=>g.id)||[]));return ze().filter(d=>!n.has(d.id))},Fe=(n,d)=>d&&n.startsWith(`${d}.`)?n.replace(`${d}.`,"").split("_").map(P=>P.slice(1)).join(" "):n.split("_").map(g=>g.charAt(0).toUpperCase()+g.slice(1)).join(" "),Ce=(n,d)=>{let g={...Q,[n]:d};y(g)},bt=(n,d)=>{let g={...Me,[n]:d};te(g),ee&&ee(n,d),t.find(P=>P.key===n)?.externalSearch&&Ce(n,d)},vt=()=>{se&&se(Q)},We=()=>{y({}),te({}),H(),se&&se({}),ee&&Object.keys(Me).forEach(n=>{ee(n,"")})},_e=n=>t.find(g=>g.key===n)?.customFilter?Me[n]??"":e.getColumn(n)?.getFilterValue(),ye=(n,d)=>{let g=t.find(P=>P.key===n);g?.customFilter?bt(n,d):(e.getColumn(n)?.setFilterValue(d),g?.externalSearch&&Ce(n,d))},Ve=n=>{if(E){let d=W[n],g={enabled:!d?.enabled,functions:d?.functions||["sum","average"]};E(n,g)}},xt=(n,d)=>{if(E){let P=W[n]?.functions||[],z=P.includes(d)?P.filter(Kt=>Kt!==d):[...P,d];E(n,{enabled:z.length>0,functions:z})}},Xe=()=>{E&&Object.keys(W).forEach(n=>{let d=W[n];d&&E(n,{...d,enabled:!1,functions:[]})})},Ae=ze().filter(n=>n.id==="select"||n.id==="serialNumber"?!1:n.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(P=>{let z=P.getValue(n.id);return typeof z=="number"||typeof z=="string"&&!isNaN(parseFloat(String(z)))||typeof z=="object"&&z!==null&&"props"in z})),be=Object.values(W).some(n=>n?.enabled);return l("div",{className:"rounded-xl",children:l("div",{className:"px-2",children:l("div",{className:"flex flex-col gap-6",children:h("div",{className:"flex items-center justify-between",children:[l("div",{className:"flex items-center gap-3",children:t.length>0&&h("div",{className:"flex flex-wrap items-center gap-3",children:[l("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:l(xo,{className:"size-4"})}),t.map(n=>!e.getColumn(n.key)&&!n.customFilter&&!n.externalSearch?null:l("div",{className:o("relative min-w-[150px]",n.width),children:n.type==="select"?h(tt,{value:_e(n.key)??"",onValueChange:g=>{ye(n.key,g==="all"?"":g)},children:[n.icon&&l("span",{children:l(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"})}),l(nt,{className:o("h-7 sm:h-7 rounded-lg w-full",n.icon&&"pl-9"),children:l(ot,{placeholder:n.placeholder})}),h(at,{className:"rounded-lg",children:[l(Le,{value:"all",children:"All"}),n.options?.map(g=>l(Le,{value:g.value,children:g.label},g.label))]})]}):n.type==="date"?l(fo,{value:_e(n.key),onChange:g=>{n.onlyExternal||ye(n.key,g)},placeholder:n.placeholder,mode:n.dateMode||"single",externalSearch:n.externalSearch,onlyExternal:n.onlyExternal,onExternalChange:g=>Ce(n.key,g)}):h("div",{className:"relative",children:[n.icon&&l("span",{children:l(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"})}),l(Vt,{placeholder:n.placeholder,value:_e(n.key)??"",onChange:g=>{ye(n.key,g.target.value)},className:o("h-7 rounded-lg",n.icon&&"pl-9"),type:n.type==="number"?"number":"text"})]})},n.key)),(t.some(n=>n.externalSearch)||t.some(n=>n.customFilter))&&h(C,{variant:"default",size:"sm",onClick:vt,className:"rounded-lg h-7",children:[l(vo,{className:"size-4"}),t.find(n=>n.externalSearch||n.customFilter)?.searchButtonText||"Search"]})]})}),h("div",{className:"flex items-center gap-2",children:[b&&h("div",{className:"relative",children:[l(vo,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),l(Vt,{placeholder:"Global search...",value:r??"",onChange:n=>m(n.target.value),className:"pl-9 h-7 max-w-max"})]}),Ae.length>0&&E&&h(oe,{children:[l(ne,{asChild:!0,children:h(C,{variant:"outline",size:"sm",className:o("rounded-lg gap-1",be&&"bg-primary/10 dark:bg-primary/10 border-primary/20 dark:border-primary/20"),children:[l(Ot,{className:"size-4"}),l("span",{children:"Aggregations"}),l(ho,{className:"opacity-50 size-4"})]})}),h(ae,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[h($,{className:"flex items-center justify-between px-4 py-2",children:[l("span",{className:"text-sm font-medium",children:"Column Aggregations"}),be&&l(C,{variant:"ghost",size:"sm",onClick:Xe,className:"h-6 px-2 text-xs",children:"Clear All"})]}),l(K,{}),Ae.map(n=>{let d=W[n.id],g=d?.enabled;return h(lo,{children:[l(co,{className:"text-sm",children:h("div",{className:"flex items-center w-full gap-2",children:[l(Ge,{checked:g,onCheckedChange:()=>Ve(n.id),className:"data-[state=checked]:bg-primary"}),l("span",{className:o("flex-1",g&&"font-medium text-primary"),children:Fe(n.id)}),g&&h("div",{className:"flex items-center gap-1",children:[d?.functions?.slice(0,2).map(P=>l("div",{className:"w-2 h-2 rounded-full bg-primary",title:yo.find(z=>z.value===P)?.label},P)),d?.functions&&d.functions.length>2&&h("div",{className:"text-xs text-muted-foreground",children:["+",d.functions.length-2]})]})]})}),h(mo,{className:"w-48 rounded-lg",children:[l($,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),yo.map(P=>l(Te,{checked:d?.functions?.includes(P.value)||!1,onCheckedChange:()=>xt(n.id,P.value),className:"py-2 text-sm",children:h("div",{className:"flex flex-col",children:[l("span",{children:P.label}),l("span",{className:"text-xs text-muted-foreground",children:P.description})]})},P.value))]})]},n.id)}),Ae.length===0&&h("div",{className:"px-3 py-4 text-center",children:[l(Ot,{className:"w-8 h-8 mx-auto mb-2 opacity-50 text-muted-foreground"}),l("p",{className:"text-sm text-muted-foreground",children:"No numeric columns available for aggregation"})]})]})]}),c&&h(C,{variant:"outline",size:"sm",onClick:()=>c(D),className:"rounded-lg",children:[l(Tn,{className:"size-4"}),"Export"]}),v&&h(oe,{children:[l(ne,{asChild:!0,className:"h-7",children:h(C,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[l("span",{children:"Columns"}),l(ho,{className:"opacity-50 size-4"})]})}),h(ae,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[l($,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),l(K,{}),Ie().length>0&&h(Bt,{children:[l($,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),Ie().map(n=>l(Te,{className:"text-sm",checked:n.getIsVisible(),onCheckedChange:d=>n.toggleVisibility(!!d),children:Fe(n.id)},n.id))]}),qe().map(n=>h(Bt,{children:[l(K,{}),l($,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:n.id}),n.columns?.filter(d=>d.getCanHide?.()!==!1).map(d=>l(Te,{className:"text-sm",checked:d.getIsVisible(),onCheckedChange:g=>d.toggleVisibility(!!g),children:Fe(d.id,n.id)},d.id))]},n.id))]})]}),h(oe,{children:[l(ne,{asChild:!0,className:"h-7",children:l(C,{variant:"outline",size:"sm",className:"rounded-lg h-7",children:l(Sn,{className:"size-4"})})}),h(ae,{align:"end",className:"w-[200px] rounded-lg",children:[l($,{children:"Table Settings"}),l(K,{}),h(_,{onClick:k,children:[l(kn,{className:"size-4"}),"Clear All Sorting"]}),h(_,{onClick:We,children:[l(xo,{className:"size-4"}),"Clear All Filters"]}),be&&h(_,{onClick:Xe,children:[l(Ot,{className:"size-4"}),"Clear Aggregations"]}),J&&h(zn,{children:[l(K,{}),l($,{children:"Column Pinning"}),h(_,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[l(Rn,{className:"size-4"}),"Reset All Pinning"]}),h(_,{onClick:()=>{let n=ze().filter(d=>d.getCanPin?.()!==!1).map(d=>d.id);e.setColumnPinning({left:[],right:n})},children:[l(Mn,{className:"-rotate-90 size-4"}),"Pin All Right"]})]})]})]}),S&&l(C,{variant:"outline",size:"sm",onClick:S,disabled:I,className:"rounded-lg",children:l(Dn,{className:o("h-4 w-4",I&&"animate-spin")})})]})]})})})})}import{jsx as O,jsxs as Se}from"react/jsx-runtime";function Gt({table:e,config:t}){return t.enabled?O("div",{className:"rounded-xl",children:O("div",{children:Se("div",{className:"flex items-center justify-between",children:[O("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&Se("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"]})}),Se("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&Se("div",{className:"flex items-center gap-2",children:[O("span",{className:"text-sm font-medium",children:"Rows per page:"}),Se(tt,{value:`${e.getState().pagination.pageSize}`,onValueChange:r=>e.setPageSize(Number(r)),children:[O(nt,{className:"h-9 w-[70px] rounded-lg",children:O(ot,{})}),O(at,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(r=>O(Le,{value:`${r}`,children:r},r))})]})]}),Se("div",{className:"flex items-center gap-2",children:[O(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),O(C,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&O("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(r,m)=>{let b=e.getState().pagination.pageIndex,c=b+m;return c<1||c>e.getPageCount()?null:O(C,{variant:c===b+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(c-1),children:c},c)})}),O(C,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),O(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}import{Toggle as In}from"radix-ui";import{cva as Fn}from"class-variance-authority";import{jsx as Vn}from"react/jsx-runtime";var _n=Fn("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 wo({className:e,variant:t,size:r,noBg:m,...b}){return Vn(In.Root,{"data-slot":"toggle",className:o(_n({className:e,variant:t,size:r,bg:m?"disabled":"enabled"})),...b})}import{useCallback as mt,useEffect as ut,useMemo as pt,useRef as je,useState as q}from"react";import{Fragment as To,jsx as s,jsxs as T}from"react/jsx-runtime";var Do={sum:e=>e.reduce((t,r)=>t+r,0),average:e=>e.length>0?e.reduce((t,r)=>t+r,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((m,b)=>m-b),r=Math.floor(t.length/2);return t.length%2===0?(t[r-1]+t[r])/2:t[r]}};function $n({data:e,columns:t,filters:r=[],pagination:m={enabled:!1},settings:b={},header:c,footer:S,className:I="",maxHeight:v="100%",loading:D=!1,error:k,emptyMessage:H="No data available",onRowSelectionChange:J,onExport:se,onRefresh:ee,onTableReady:W,children:E,isRowDisabled:Q,isRowSelectable:y,onExternalSearch:Me,aggregations:te={},onAggregationChange:ze}){let[qe,Ie]=q([]),[Fe,Ce]=q([]),[bt,vt]=q({}),[We,_e]=q({}),[ye,Ve]=q(""),[xt,Xe]=q([]),[Ke,Ae]=q(b.enableColumnPinning?{left:[],right:[]}:{}),[be,n]=q({}),d=je(null),g=je(null),P=je(null),z=je(null),[Kt,_o]=q(0),[Jt,Vo]=q(0),[Ao,Bo]=q(0),[Qt,Ho]=q(0),Je=je(null),[ht,Lo]=q(!1),{enableSorting:Ct=!0,enableFiltering:yt=!0,enableGlobalFilter:Yt=!0,enableColumnVisibility:wt=!0,enableRowSelection:G=!0,stickyHeader:fa=!0,toolbar:Be=!1,toolbarPosition:ve="default",showSerialNumbers:le=!0,fixedCheckboxColumn:Qe=!0,striped:Oo=!0,hoverable:Eo=!0,compact:Ye=!0,bordered:Zt=!0,fullHeight:Go=!1,enableColumnResizing:eo=!1,enableColumnPinning:V=!0,hideHeader:jo=!1,selectionMode:de="multiple",showCheckBox:Uo=!0,checkboxColumnPosition:to=0}=b;ut(()=>{let i=()=>{Je.current&&Lo(Je.current.scrollTop>0)},p=Je.current;if(p)return p.addEventListener("scroll",i),()=>p.removeEventListener("scroll",i)},[]),ut(()=>{let i=()=>{d.current&&_o(d.current.offsetHeight+16),g.current&&Vo(g.current.offsetHeight+16),P.current&&Bo(P.current.offsetHeight+16),z.current&&Ho(z.current.offsetHeight+16)};i();let p=new ResizeObserver(()=>{setTimeout(i,50)});return d.current&&p.observe(d.current),g.current&&p.observe(g.current),P.current&&p.observe(P.current),z.current&&p.observe(z.current),()=>{p.disconnect()}},[Be,c,ve]);let $o=(i,p)=>p.split(".").reduce((a,f)=>a&&a[f],i),Nt=pt(()=>Object.keys(be).length===0?e:e.filter(i=>Object.entries(be).every(([p,a])=>{if(!a||a==="")return!0;let f=$o(i,p);return typeof a=="string"?String(f).toLowerCase().includes(a.toLowerCase()):f===a})),[e,be]),qo=mt((i,p)=>{n(a=>{let f={...a};return p===""||p===null||p===void 0?delete f[i]:f[i]=p,f})},[]),we=pt(()=>{let i=[...t],p=u=>u.map(x=>{if(x.id==="select"||x.id==="serialNumber")return x;let w={...x,enablePinning:!0};return x.columns&&(w.columns=p(x.columns)),w}),a=p(i),f={id:"select",header:({table:u})=>{if(de==="single")return null;let x=u.getRowModel().rows.filter(j=>!Q?.(j.original)&&(y?y(j.original):!0)),w=x.length>0&&x.every(j=>j.getIsSelected()),R=x.some(j=>j.getIsSelected());return s(Ge,{checked:w||R&&"indeterminate",onCheckedChange:j=>{x.forEach(A=>A.toggleSelected(!!j))},"aria-label":"Select all selectable rows"})},cell:({row:u})=>{let x=Q?Q(u.original):!1,w=y?y(u.original):!0;return s("div",{className:o("flex items-center justify-center",x&&"opacity-50"),children:de==="multiple"?s(Ge,{checked:u.getIsSelected(),onCheckedChange:R=>w&&u.toggleSelected(!!R),"aria-label":"Select row",disabled:x||!w}):Uo?s("input",{type:"radio",checked:u.getIsSelected(),onChange:()=>w&&u.toggleSelected(!0),disabled:x||!w,className:"w-4 h-4 rounded-full border-primary text-primary focus:ring-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:de==="multiple"?40:30};if(G){let u=to;u<0&&(u=a.length+u+1),u=Math.max(0,Math.min(u,a.length)),a.splice(u,0,f)}if(le){let u={id:"serialNumber",header:"No.",cell:({row:x})=>s("div",{className:"font-medium text-center text-muted-foreground",children:x.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};a.unshift(u)}return a},[t,le,G,Qe,Q,y,de,to]),N=On({data:Nt,columns:we,onSortingChange:Ct?Ie:void 0,onColumnFiltersChange:yt?Ce:void 0,onGlobalFilterChange:Yt?Ve:void 0,getCoreRowModel:An(),getPaginationRowModel:m.enabled?Hn():void 0,getSortedRowModel:Ct?Ln():void 0,getFilteredRowModel:yt?Bn():void 0,onColumnVisibilityChange:wt?vt:void 0,onRowSelectionChange:G?_e:void 0,onColumnOrderChange:Xe,onColumnPinningChange:V?Ae:void 0,state:{sorting:Ct?qe:void 0,columnFilters:yt?Fe:void 0,columnVisibility:wt?bt:void 0,rowSelection:G?We:{},globalFilter:ye,columnOrder:xt,columnPinning:V?Ke:{}},initialState:{pagination:m.enabled?{pageSize:m.pageSize||10}:void 0,columnPinning:V?{left:[...le?["serialNumber"]:[],...G?["select"]:[]],right:[]}:void 0},enableRowSelection:G,enableColumnResizing:eo,enableColumnPinning:V,columnResizeMode:"onChange"}),Wo=pt(()=>{if(!te||Object.keys(te).length===0)return{};let i={},p=N.getFilteredRowModel().rows;return Object.entries(te).forEach(([a,f])=>{if(!f?.enabled)return;let u=p.map(w=>{if(f.accessor)return f.accessor(w.original);{let R=w.getValue(a);return typeof R=="number"?R:parseFloat(String(R))||0}}).filter(w=>w!==null&&!isNaN(w)),x={};f.functions?.forEach(w=>{Do[w]&&(x[w]=Do[w](u))}),Object.keys(x).length>0&&(i[a]=x)}),i},[Nt,te,N?.getFilteredRowModel().rows]);ut(()=>{if(G&&J){let i=N.getFilteredSelectedRowModel().rows.filter(p=>!Q?.(p.original)&&(y?y(p.original):!0)).map(p=>p.original);J(i)}},[We,G,J,N,Q,y]);let Xo=mt(i=>{de==="single"?(N.resetRowSelection(),i.toggleSelected(!0)):i.toggleSelected()},[de,N]);ut(()=>{W&&W(N)},[N,W]);let Ko=mt(()=>{Ie([])},[]),Jo=mt(()=>{Ce([]),Ve("")},[]),oo=(i,p)=>{if(!V)return;let a=[...le?["serialNumber"]:[],...G&&Qe?["select"]:[]],f={left:[...(Ke.left??[]).filter(u=>a.includes(u))],right:[...Ke.right??[]]};p===!1?(f.left=f.left.filter(u=>u!==i),f.right=f.right.filter(u=>u!==i)):p==="right"?(f.left=f.left.filter(u=>u!==i),f.right.includes(i)||f.right.push(i)):p==="left"&&(f.right=f.right.filter(u=>u!==i),!f.left.includes(i)&&!a.includes(i)&&f.left.push(i)),N.setColumnPinning(f)},Qo=()=>s(Rt,{className:"sticky bottom-0 border-t bg-sidebar z-20",children:s(ie,{className:"hover:bg-transparent bg-sidebar",children:N.getHeaderGroups()[0]?.headers.map((i,p)=>{let a=i.column.id,f=Wo[a],u=V&&(i.column.getIsPinned()==="left"||i.column.id==="serialNumber"||i.column.id==="select"&&G),x=V&&i.column.getIsPinned()==="right",w=i.column.id==="serialNumber",R=i.column.id==="select",A=i.column.columnDef.customFooter;return s(me,{className:o("font-semibold text-sm py-2 px-2 border-r",Ye&&"py-1",u&&"sticky left-0 z-30 bg-sidebar/95",x&&"sticky right-0 z-30 bg-sidebar/95",(w||R)&&"sticky left-0 z-30 bg-sidebar/95",A?.className),style:{width:i.getSize()!==150?i.getSize():"auto",minWidth:i.getSize()!==150?i.getSize():"auto",...u&&{left:w?0:R?le&&N.getColumn("serialNumber")?.getSize()||0:Pt(i.column)},...x&&{right:Dt(i.column)},...w&&{left:0}},children:(()=>{if(A?.content){let re=typeof A.content=="function"?A.content(N):A.content;return s("div",{className:o("w-full h-full",A.align==="center"&&"text-center",A.align==="right"&&"text-right",A.align==="left"&&"text-left"),children:re})}return f?s("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(f).map(([re,Ze])=>T("div",{className:"flex items-center justify-between text-muted-foreground",children:[T("span",{className:"text-xs capitalize",children:[re,":"]}),s("span",{className:"font-medium text-foreground",children:Yo(re,Ze)})]},re))}):a==="serialNumber"?T("div",{className:"text-xs text-center text-muted-foreground",children:["Total: ",N.getFilteredRowModel().rows.length]}):null})()},`agg-${i.id}`)})})}),Yo=(i,p)=>typeof p=="number"?i==="count"||i==="unique"?p.toLocaleString():p.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):p,Zo=()=>N.getHeaderGroups().map((i,p)=>s(ie,{className:"hover:bg-transparent",children:i.headers.map((a,f)=>{let u=a.depth===0&&a.colSpan>1,x=V&&(a.column.getIsPinned()==="left"||a.column.id==="serialNumber"||a.column.id==="select"&&G),w=V&&a.column.getIsPinned()==="right",R=a.column.getCanSort(),j=V&&a.column.columnDef.enablePinning!==!1,A=a.column.id==="serialNumber",re=a.column.id==="select",Ze=A||re&&Qe,Ne=a.column.columnDef.headerAlign||"left",St=te&&te[a.column.id]?.enabled,on={left:"justify-start",center:"justify-center",right:"justify-end"}[Ne];return T(ro,{colSpan:a.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!Ye&&"py-2",Zt&&f<i.headers.length-1&&"border-r","relative",x&&"sticky left-0 z-25 bg-sidebar",w&&"sticky right-0 z-25 bg-sidebar",(A||re)&&"sticky left-0 z-25 bg-sidebar",u?"text-center":"text-left",St&&"border-b-2 border-primary/30"),style:{width:a.getSize()!==150?a.getSize():"auto",minWidth:a.getSize()!==150?a.getSize():"auto",...x&&{left:A?0:re?le&&N.getColumn("serialNumber")?.getSize()||0:Pt(a.column)},...w&&{right:Dt(a.column)},...A&&{left:0}},children:[u?T("div",{className:"flex items-center justify-center",children:[jt(a.column.columnDef.header,a.getContext()),St&&s(Po,{className:"w-3 h-3 ml-1 text-primary"})]}):T("div",{className:o("relative flex items-center w-full px-2",on),children:[T("div",{className:"flex items-center gap-1",children:[St&&s(Po,{className:"w-3 h-3 mr-1 text-primary"}),R&&Ne==="right"&&s("span",{className:"order-2 ml-1",children:a.column.getIsSorted()&&{asc:s(Ut,{className:"w-4 h-4"}),desc:s($t,{className:"w-4 h-4"})}[a.column.getIsSorted()]}),a.isPlaceholder?null:jt(a.column.columnDef.header,a.getContext()),R&&Ne!=="right"&&a.column.getIsSorted()&&s("span",{className:"order-2 ml-1",children:a.column.getIsSorted()&&{asc:s(Ut,{className:"w-4 h-4"}),desc:s($t,{className:"w-4 h-4"})}[a.column.getIsSorted()]})]}),(R||j&&!Ze)&&T(oe,{children:[s(ne,{asChild:!0,className:o("absolute",Ne==="left"&&"right-1",Ne==="center"&&"right-1",Ne==="right"&&"left-1"),children:s(wo,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:s(Gn,{className:"w-4 h-4"})})}),T(ae,{align:"end",className:"w-48",children:[R&&T(To,{children:[s($,{children:"Sorting"}),T(_,{onClick:()=>a.column.toggleSorting(!1),children:[s(Ut,{className:"w-4 h-4 mr-2"}),"Sort Ascending"]}),T(_,{onClick:()=>a.column.toggleSorting(!0),children:[s($t,{className:"w-4 h-4 mr-2"}),"Sort Descending"]}),T(_,{onClick:()=>a.column.clearSorting(),disabled:!a.column.getIsSorted(),children:[s(En,{className:"w-4 h-4 mr-2"}),"Clear Sort"]}),s(K,{})]}),j&&!Ze&&T(To,{children:[s($,{children:"Pin Column"}),T(_,{onClick:()=>oo(a.column.id,"right"),disabled:a.column.getIsPinned()==="right",children:[s(jn,{}),"Pin Right"]}),T(_,{onClick:()=>oo(a.column.id,!1),disabled:!a.column.getIsPinned(),children:[s(Un,{}),"Unpin"]})]})]})]})]}),eo&&a.column.getCanResize()&&!u&&a.colSpan===1&&s("div",{className:"absolute top-0 right-0 w-1 h-full transition-opacity opacity-0 bg-border hover:bg-primary cursor-col-resize hover:opacity-100",onMouseDown:a.getResizeHandler()})]},a.id)})},i.id)),Pt=i=>{if(!V)return;let p=0,a=N.getLeftHeaderGroups()[0]?.headers||[],f=[...le?["serialNumber"]:[],...G?["select"]:[]];for(let u of a){if(u.id===i.id)break;if(f.includes(u.id)){let x=N.getColumn(u.id);x&&(p+=x.getSize())}}return p},Dt=i=>{if(!V)return;let p=N.getState().columnPinning.right||[],a=p.indexOf(i.id);if(a===-1)return;let f=0;for(let u=a+1;u<p.length;u++){let x=N.getColumn(p[u]);x&&(f+=x.getSize())}return f};if(k)return s(Mt,{className:"w-full shadow-sm rounded-xl",children:s(zt,{className:"flex items-center justify-center",children:T("div",{className:"text-center",children:[s("div",{className:"mb-3 text-2xl text-red-500",children:"\u26A0\uFE0F"}),s("p",{className:"mb-4 text-sm text-muted-foreground",children:k}),ee&&T(C,{variant:"outline",size:"sm",onClick:ee,className:"rounded-lg",children:[s(No,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})})});let en=i=>i&&typeof i=="object"&&"content"in i,Y=pt(()=>c?en(c)?{content:c.content,align:c.align||"left",className:c.className||"",sticky:c.sticky!==void 0?c.sticky:!0,showOnEmpty:c.showOnEmpty!==void 0?c.showOnEmpty:!0}:{content:c,align:"left",className:"",sticky:!0,showOnEmpty:!0}:null,[c]),Tt=()=>Be?s(Et,{table:N,filters:r,globalFilter:ye,onGlobalFilterChange:Ve,enableGlobalFilter:Yt,onExport:se,onRefresh:ee,loading:D,enableColumnVisibility:wt,enableColumnPinning:V,data:Nt,onClearSorting:Ko,onClearFilters:Jo,onExternalSearch:Me,onCustomFilterChange:qo,aggregations:te,onAggregationChange:ze}):null,tn=()=>{let i=0;return ve==="above-header"&&(i+=Jt),Y&&(i+=Qt),ve==="below-header"&&(i+=Ao),i};return s(He,{children:T("div",{className:o("w-full space-y-2 flex flex-col h-full",I),children:[Be&&ve==="default"&&s("div",{ref:d,className:"relative z-40",children:Tt()}),s(Mt,{className:o("shadow-sm overflow-hidden py-0",Go&&"flex-1"),children:s(zt,{className:"h-full p-0",children:T("div",{className:"relative flex flex-col justify-between h-full",children:[D&&s("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-xl",children:T("div",{className:"flex items-center gap-3 px-4 py-3 rounded-lg shadow-sm bg-background/90",children:[s(No,{className:"size-5 animate-spin text-primary"}),s("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),s("div",{ref:Je,className:o("relative overflow-auto border-b rounded-t-xl",N.getRowModel().rows?.length===0&&"h-full"),style:{maxHeight:v},children:T(kt,{className:o("w-full border-collapse relative",N.getRowModel().rows?.length===0&&"h-full"),children:[Be&&ve==="above-header"&&s("thead",{className:"sticky top-0 z-40 bg-sidebar border-b",children:s(ie,{className:"hover:bg-transparent",children:s(me,{colSpan:we.length,className:"p-2 bg-sidebar border-b shadow-sm",children:s("div",{ref:g,children:Tt()})})})}),Y&&(Y.showOnEmpty||N.getRowModel().rows?.length>0)&&s("thead",{className:o("sticky bg-sidebar border-b",ht&&"shadow-sm"),style:{top:ve==="above-header"?`${Jt}px`:"0px",zIndex:35},children:s(ie,{className:"hover:bg-transparent",children:s(me,{colSpan:we.length,className:o("p-2 font-semibold text-foreground bg-sidebar",Ye?"py-2":"py-4",Y.className),children:s("div",{ref:z,className:o("flex items-center w-full",Y.align==="center"&&"justify-center",Y.align==="right"&&"justify-end",Y.align==="left"&&"justify-start"),children:typeof Y.content=="string"?s("span",{className:"text-lg font-bold tracking-tight text-foreground",children:Y.content}):Y.content})})})}),Be&&ve==="below-header"&&s("thead",{className:o("sticky bg-sidebar border-b",ht&&"shadow-sm"),style:{top:Y?`${Qt}px`:"0px",zIndex:35},children:s(ie,{className:"hover:bg-transparent",children:s(me,{colSpan:we.length,className:"p-2 bg-sidebar",children:s("div",{ref:P,children:Tt()})})})}),!jo&&s(no,{className:o("sticky bg-sidebar",ht&&"shadow-sm"),style:{top:`${tn()}px`,zIndex:30},children:Zo()}),s(ao,{children:N.getRowModel().rows?.length?N.getRowModel().rows.map((i,p)=>s(ie,{"data-state":i.getIsSelected()&&"selected",className:o(Eo&&"hover:bg-muted/50",Oo&&p%2===0&&"bg-muted/20",i.getIsSelected()&&"bg-muted","border-b last:border-b-0",de==="single"&&"cursor-pointer"),onClick:()=>{de==="single"&&Xo(i)},children:i.getVisibleCells().map((a,f)=>{let u=V&&(a.column.getIsPinned()==="left"||a.column.id==="serialNumber"||a.column.id==="select"&&G),x=V&&a.column.getIsPinned()==="right",w=a.column.id==="serialNumber",R=a.column.id==="select",j=w||R&&Qe;return s(me,{className:o(Ye?"py-2":"py-4",Zt&&f<i.getVisibleCells().length&&"border-r",u&&"sticky left-0 z-20 bg-sidebar/95",x&&"sticky right-0 z-20 bg-sidebar/95",w&&"sticky left-0 z-20 bg-sidebar/95","p-1"),style:{width:a.column.getSize()!==150?a.column.getSize():"auto",minWidth:a.column.getSize()!==150?a.column.getSize():"auto",...u&&{left:w?0:R?le&&N.getColumn("serialNumber")?.getSize()||0:Pt(a.column)},...x&&{right:Dt(a.column)},...w&&{left:0}},children:jt(a.column.columnDef.cell,a.getContext())},a.id)})},i.id)):s(ie,{children:s(me,{colSpan:we.length,className:"h-32 text-center border-0",children:T("div",{className:"flex flex-col items-center gap-3",children:[s("div",{className:"text-6xl text-muted-foreground",children:"\u{1F4CB}"}),s("p",{className:"font-medium text-muted-foreground",children:H})]})})})}),Qo()]})}),S&&s("div",{className:"sticky bottom-0 z-10 w-full bg-sidebar",style:{width:"100%",minWidth:"fit-content"},children:s(kt,{children:s(Rt,{children:s(ie,{className:"bg-sidebar",children:s(me,{colSpan:we.length,className:"p-2",children:S})})})})})]})})}),s(Gt,{table:N,config:m}),E&&E(N)]})})}import{Separator as qn}from"radix-ui";import{jsx as Wn}from"react/jsx-runtime";function gt({className:e,orientation:t="horizontal",decorative:r=!0,...m}){return Wn(qn.Root,{"data-slot":"separator-root",decorative:r,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),...m})}import{Loader as Xn,X as Kn}from"lucide-react";import{AnimatePresence as Jn,motion as Qn}from"framer-motion";import*as pe from"react";import*as So from"react-dom";import{jsx as B,jsxs as Ue}from"react/jsx-runtime";function Yn({table:e,visible:t,container:r,children:m,className:b,...c}){let[S,I]=pe.useState(!1);pe.useLayoutEffect(()=>{I(!0)},[]),pe.useEffect(()=>{function k(H){H.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[e]);let v=r??(S?globalThis.document?.body:null);if(!v||!e)return null;let D=t??e.getFilteredSelectedRowModel().rows.length>0;return So.createPortal(B(Jn,{children:D&&B(Qn.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",b),...c,children:B(He,{children:m})})}),v)}function Zn({size:e="sm",tooltip:t,isPending:r,disabled:m,className:b,children:c,...S}){let I=B(C,{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",b),disabled:m||r,...S,children:r?B(Xn,{className:"animate-spin"}):c});return t?Ue(It,{children:[B(Ft,{asChild:!0,children:I}),B(_t,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:B("p",{children:t})})]}):I}function ea({table:e}){let t=pe.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?Ue("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[Ue("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),B(gt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),Ue(It,{children:[B(Ft,{asChild:!0,children:B(C,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:B(Kn,{className:"size-3.5"})})}),Ue(_t,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[B("p",{children:"Clear selection"}),B("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:B("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{ArrowUpDown as $e,EyeOff as ta}from"lucide-react";import{jsx as Z,jsxs as ke}from"react/jsx-runtime";function oa({column:e,title:t,className:r}){return e.getCanSort()?Z("div",{className:o("flex items-center space-x-2",r),children:ke(oe,{children:[Z(ne,{asChild:!0,children:ke(C,{variant:"ghost",size:"sm",className:"-ml-3 h-8 data-[state=open]:bg-accent",children:[Z("span",{children:t}),e.getIsSorted()==="desc"?Z($e,{className:"ml-2 h-4 w-4"}):e.getIsSorted()==="asc"?Z($e,{className:"ml-2 h-4 w-4"}):Z($e,{className:"ml-2 h-4 w-4"})]})}),ke(ae,{align:"start",className:"rounded-lg",children:[ke(_,{onClick:()=>e.toggleSorting(!1),children:[Z($e,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),ke(_,{onClick:()=>e.toggleSorting(!0),children:[Z($e,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),Z(K,{}),ke(_,{onClick:()=>e.toggleVisibility(!1),children:[Z(ta,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Hide"]})]})]})}):Z("div",{className:o(r),children:t})}import{ChevronDown as na,Eye as aa}from"lucide-react";import{jsx as Re,jsxs as qt}from"react/jsx-runtime";function ra({table:e}){return qt(oe,{children:[Re(ne,{asChild:!0,children:qt(C,{variant:"outline",size:"sm",className:"rounded-lg",children:[Re(aa,{className:"mr-2 h-4 w-4"}),"Columns ",Re(na,{className:"ml-2 h-4 w-4"})]})}),qt(ae,{align:"end",className:"w-[200px] rounded-lg",children:[Re($,{children:"Toggle Columns"}),Re(K,{}),e.getAllColumns().filter(t=>typeof t.accessorFn<"u"&&t.getCanHide()).map(t=>Re(Te,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:r=>t.toggleVisibility(!!r),children:t.id},t.id))]})]})}import{Slot as ia}from"radix-ui";import{cva as sa}from"class-variance-authority";import{jsx as da}from"react/jsx-runtime";var la=sa("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 ft({className:e,variant:t,asChild:r=!1,...m}){let b=r?ia.Slot:"span";return da(b,{"data-slot":"badge",className:o(la({variant:t}),e),...m})}import{Command as he}from"cmdk";import{SearchIcon as ca}from"lucide-react";import{Dialog as Ii}from"radix-ui";import{XIcon as _i}from"lucide-react";import{jsx as Bi,jsxs as Hi}from"react/jsx-runtime";import{jsx as ge,jsxs as ma}from"react/jsx-runtime";function ko({className:e,...t}){return ge(he,{"data-slot":"command",className:o("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Ro({className:e,...t}){return ma("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[ge(ca,{className:"size-4 shrink-0 opacity-50"}),ge(he.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 Mo({className:e,...t}){return ge(he.List,{"data-slot":"command-list",className:o("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function zo({...e}){return ge(he.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Wt({className:e,...t}){return ge(he.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 Io({className:e,...t}){return ge(he.Separator,{"data-slot":"command-separator",className:o("bg-border -mx-1 h-px",e),...t})}function Xt({className:e,...t}){return ge(he.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})}import{CheckIcon as ua,PlusCircleIcon as pa}from"lucide-react";import{Fragment as Fo,jsx as M,jsxs as fe}from"react/jsx-runtime";function ga({column:e,title:t,options:r}){let m=e?.getFacetedUniqueValues(),b=new Set(e?.getFilterValue());return fe(st,{children:[M(lt,{asChild:!0,children:fe(C,{variant:"outline",size:"sm",className:"h-9 border-dashed rounded-lg",children:[M(pa,{className:"mr-2 h-4 w-4"}),t,b?.size>0&&fe(Fo,{children:[M(gt,{orientation:"vertical",className:"mx-2 h-4"}),M(ft,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:b.size}),M("div",{className:"hidden space-x-1 lg:flex",children:b.size>2?fe(ft,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[b.size," selected"]}):r.filter(c=>b.has(c.value)).map(c=>M(ft,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:c.label},c.value))})]})]})}),M(dt,{className:"w-[200px] p-0 rounded-lg",align:"start",children:fe(ko,{className:"rounded-lg",children:[M(Ro,{placeholder:t}),fe(Mo,{children:[M(zo,{children:"No results found."}),M(Wt,{children:r.map(c=>{let S=b.has(c.value);return fe(Xt,{onSelect:()=>{S?b.delete(c.value):b.add(c.value);let I=Array.from(b);e?.setFilterValue(I.length?I:void 0)},children:[M("div",{className:o("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",S?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:M(ua,{className:o("h-4 w-4")})}),c.icon&&M(c.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),M("span",{children:c.label}),m?.get(c.value)&&M("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:m.get(c.value)})]},c.value)})}),b.size>0&&fe(Fo,{children:[M(Io,{}),M(Wt,{children:M(Xt,{onSelect:()=>e?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}export{$n as DataTable,Yn as DataTableActionBar,Zn as DataTableActionBarAction,ea as DataTableActionBarSelection,oa as DataTableColumnHeader,ga as DataTableFacetedFilter,Gt as DataTablePagination,Et as DataTableToolbar,ra as DataTableViewOptions};
3
3
  //# sourceMappingURL=index.js.map