@akshar-technosoft/ui 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data/data-table/data-table.cjs +1 -1
- package/dist/components/data/data-table/data-table.cjs.map +1 -1
- package/dist/components/data/data-table/data-table.js +1 -1
- package/dist/components/data/data-table/data-table.js.map +1 -1
- package/dist/components/data/data-table/index.cjs +1 -1
- package/dist/components/data/data-table/index.cjs.map +1 -1
- package/dist/components/data/data-table/index.js +1 -1
- package/dist/components/data/data-table/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{flexRender as mo,getCoreRowModel as on,getFilteredRowModel as an,getPaginationRowModel as nn,getSortedRowModel as rn,useReactTable as sn}from"@tanstack/react-table";import{Loader2 as Vo,ChevronUp as po,ChevronDown as uo,ChevronsUpDown as ln,MoreHorizontal as dn,MoveRightIcon as cn,PinOffIcon as mn}from"lucide-react";import{Slot as Sa}from"radix-ui";import{cva as Ta}from"class-variance-authority";import{clsx as Na}from"clsx";import{twMerge as Pa}from"tailwind-merge";function o(...e){return Pa(Na(e))}import{jsx as Da}from"react/jsx-runtime";var Ot=Ta("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 u({className:e,variant:t,size:a,asChild:n=!1,...l}){let i=n?Sa.Slot:"button";return Da(i,{"data-slot":"button",className:o(Ot({variant:t,size:a,className:e}),"transition-none"),...l})}import{jsx as Ee}from"react/jsx-runtime";function eo({className:e,...t}){return Ee("div",{"data-slot":"table-container",className:"relative w-full overflow-auto max-h-full",children:Ee("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function So({className:e,...t}){return Ee("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function To({className:e,...t}){return Ee("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Do({className:e,...t}){return Ee("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function wt({className:e,...t}){return Ee("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ko({className:e,...t}){return Ee("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function Vt({className:e,...t}){return Ee("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as Ro}from"react/jsx-runtime";function Se({className:e,...t}){return Ro("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 Te({className:e,...t}){return Ro("div",{"data-slot":"card-content",className:o("px-6",e),...t})}import{Tooltip as dt}from"radix-ui";import{jsx as ct,jsxs as ka}from"react/jsx-runtime";function et({delayDuration:e=0,...t}){return ct(dt.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ge({...e}){return ct(et,{children:ct(dt.Root,{"data-slot":"tooltip",...e})})}function He({...e}){return ct(dt.Trigger,{"data-slot":"tooltip-trigger",...e})}function je({className:e,sideOffset:t=0,children:a,...n}){return ct(dt.Portal,{children:ka(dt.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),...n,children:[a,ct(dt.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Search as Fo,RefreshCw as ja,Download as $a,Settings2 as Ua,Filter as Bo,ArrowUpDown as Wa,PinOff as Ja,Pin as qa,ChevronDown as Xa}from"lucide-react";import{jsx as Ra}from"react/jsx-runtime";function mt({className:e,type:t,...a}){return Ra("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}import{Select as ue}from"radix-ui";import{CheckIcon as Ma,ChevronDownIcon as Mo,ChevronUpIcon as za}from"lucide-react";import{jsx as Y,jsxs as to}from"react/jsx-runtime";function $e({...e}){return Y(ue.Root,{"data-slot":"select",...e})}function Ue({...e}){return Y(ue.Value,{"data-slot":"select-value",...e})}function We({className:e,size:t="default",children:a,...n}){return to(ue.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),...n,children:[a,Y(ue.Icon,{asChild:!0,children:Y(Mo,{className:"size-4 opacity-50"})})]})}function Je({className:e,children:t,position:a="popper",...n}){return Y(ue.Portal,{children:to(ue.Content,{"data-slot":"select-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...n,children:[Y(Aa,{}),Y(ue.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),Y(Ia,{})]})})}function De({className:e,children:t,...a}){return to(ue.Item,{"data-slot":"select-item",className:o("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[Y("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:Y(ue.ItemIndicator,{children:Y(Ma,{className:"size-4"})})}),Y(ue.ItemText,{children:t})]})}function Aa({className:e,...t}){return Y(ue.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:Y(za,{className:"size-4"})})}function Ia({className:e,...t}){return Y(ue.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:Y(Mo,{className:"size-4"})})}import{DropdownMenu as ke}from"radix-ui";import{CheckIcon as Fa,ChevronRightIcon as Xr,CircleIcon as Kr}from"lucide-react";import{jsx as he,jsxs as Ba}from"react/jsx-runtime";function Re({...e}){return he(ke.Root,{"data-slot":"dropdown-menu",...e})}function Me({...e}){return he(ke.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function ze({className:e,sideOffset:t=4,...a}){return he(ke.Portal,{children:he(ke.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...a})})}function oo({...e}){return he(ke.Group,{"data-slot":"dropdown-menu-group",...e})}function J({className:e,inset:t,variant:a="default",...n}){return he(ke.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function Et({className:e,children:t,checked:a,...n}){return Ba(ke.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...n,children:[he("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:he(ke.ItemIndicator,{children:he(Fa,{className:"size-4"})})}),t]})}function se({className:e,inset:t,...a}){return he(ke.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function le({className:e,...t}){return he(ke.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}import{useState as _o}from"react";import{useEffect as Ga,useState as io}from"react";import{Calendar as Ha}from"lucide-react";import{format as Nt}from"date-fns";import{Popover as Gt}from"radix-ui";import{jsx as Ht}from"react/jsx-runtime";function ao({...e}){return Ht(Gt.Root,{"data-slot":"popover",...e})}function no({...e}){return Ht(Gt.Trigger,{"data-slot":"popover-trigger",...e})}function ro({className:e,align:t="center",sideOffset:a=4,...n}){return Ht(Gt.Portal,{children:Ht(Gt.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}import*as jt from"react";import{ChevronDownIcon as _a,ChevronLeftIcon as La,ChevronRightIcon as Oa}from"lucide-react";import{DayPicker as Va,getDefaultClassNames as zo}from"react-day-picker";import{jsx as qe}from"react/jsx-runtime";function Ao({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:n="label",buttonVariant:l="ghost",formatters:i,components:m,...b}){let p=zo();return qe(Va,{showOutsideDays:a,className:o("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:n,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:o("w-fit",p.root),months:o("flex gap-4 flex-col md:flex-row relative",p.months),month:o("flex flex-col w-full gap-4",p.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",p.nav),button_previous:o(Ot({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(Ot({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",p.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",p.dropdowns),dropdown_root:o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",p.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",p.dropdown),caption_label:o("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:o("flex",p.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",p.weekday),week:o("flex w-full mt-2",p.week),week_number_header:o("select-none w-(--cell-size)",p.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",p.week_number),day:o("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",p.day),range_start:o("rounded-l-md bg-accent",p.range_start),range_middle:o("rounded-none",p.range_middle),range_end:o("rounded-r-md bg-accent",p.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:o("text-muted-foreground opacity-50",p.disabled),hidden:o("invisible",p.hidden),...t},components:{Root:({className:d,rootRef:c,...N})=>qe("div",{"data-slot":"calendar",ref:c,className:o(d),...N}),Chevron:({className:d,orientation:c,...N})=>c==="left"?qe(La,{className:o("size-4",d),...N}):c==="right"?qe(Oa,{className:o("size-4",d),...N}):qe(_a,{className:o("size-4",d),...N}),DayButton:Ea,WeekNumber:({children:d,...c})=>qe("td",{...c,children:qe("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:d})}),...m},...b})}function Ea({className:e,day:t,modifiers:a,...n}){let l=zo(),i=jt.useRef(null);return jt.useEffect(()=>{a.focused&&i.current?.focus()},[a.focused]),qe(u,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:o("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",l.day,e),...n})}import{jsx as tt,jsxs as Pt}from"react/jsx-runtime";function Io({value:e,onChange:t,placeholder:a,mode:n,externalSearch:l,onExternalChange:i,onlyExternal:m=!1}){let[b,p]=io(!1),[d,c]=io(e),[N,T]=io(e);Ga(()=>{m||T(e)},[e,m]);let A=()=>{m||t(d),T(d),l&&i&&i(d),p(!1)},D=()=>{c(N),p(!1)},M=()=>{let v=n==="single"?null:{from:null,to:null};c(v),m||t(v),T(v),l&&i&&i(v),p(!1)},F=()=>{let v=m?N:e;return v?n==="single"?Nt(v,"PPP"):v.from&&v.to?`${Nt(v.from,"MMM dd")} - ${Nt(v.to,"MMM dd, yyyy")}`:v.from?`From ${Nt(v.from,"MMM dd, yyyy")}`:v.to?`To ${Nt(v.to,"MMM dd, yyyy")}`:a:a},B=v=>{c(n==="single"?v:v||{from:null,to:null})};return Pt(ao,{open:b,onOpenChange:p,children:[tt(no,{asChild:!0,children:Pt(u,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!F()&&"text-muted-foreground"),children:[tt(Ha,{className:"mr-2 h-4 w-4"}),F()]})}),Pt(ro,{className:"w-auto p-0",align:"start",children:[tt("div",{className:"p-3",children:tt(Ao,{mode:n,selected:d,onSelect:B,numberOfMonths:n==="range"?2:1,className:"rounded-md border",...n==="range"&&{required:!0}})}),Pt("div",{className:"flex items-center justify-between p-3 border-t",children:[tt(u,{variant:"ghost",size:"sm",onClick:M,children:"Clear"}),Pt("div",{className:"flex gap-2",children:[tt(u,{variant:"outline",size:"sm",onClick:D,children:"Cancel"}),tt(u,{size:"sm",onClick:A,disabled:n==="range"&&(!d?.from||!d?.to),children:"Apply"})]})]})]})]})}import{Fragment as Ka,jsx as y,jsxs as E}from"react/jsx-runtime";function so({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:n,enableGlobalFilter:l=!0,onExport:i,onRefresh:m,loading:b=!1,enableColumnVisibility:p=!0,data:d,onClearSorting:c,onClearFilters:N,enableColumnPinning:T=!1,onExternalSearch:A,onCustomFilterChange:D}){let[M,F]=_o({}),[B,v]=_o({}),oe=()=>e.getAllLeafColumns().filter(r=>r.getCanHide?.()!==!1),h=()=>e.getAllColumns().filter(r=>!e.getAllLeafColumns().includes(r)&&r.columns?.length&&r.columns.some(C=>C.getCanHide?.()!==!1)),_=()=>{let r=new Set(h().flatMap(C=>C.columns?.filter(S=>S.getCanHide?.()!==!1).map(S=>S.id)||[]));return oe().filter(C=>!r.has(C.id))},fe=(r,C)=>C&&r.startsWith(`${C}.`)?r.replace(`${C}.`,"").split("_").map(Z=>Z.slice(1)).join(" "):r.split("_").map(S=>S.charAt(0).toUpperCase()+S.slice(1)).join(" "),ce=(r,C)=>{let S={...M,[r]:C};F(S)},ge=(r,C)=>{let S={...B,[r]:C};v(S),D&&D(r,C),t.find(Z=>Z.key===r)?.externalSearch&&ce(r,C)},Fe=()=>{A&&A(M)},U=()=>{F({}),v({}),N(),A&&A({}),D&&Object.keys(B).forEach(r=>{D(r,"")})},be=r=>t.find(S=>S.key===r)?.customFilter?B[r]??"":e.getColumn(r)?.getFilterValue(),q=(r,C)=>{let S=t.find(Z=>Z.key===r);S?.customFilter?ge(r,C):(e.getColumn(r)?.setFilterValue(C),S?.externalSearch&&ce(r,C))};return y("div",{className:"rounded-xl",children:y("div",{className:"px-2",children:y("div",{className:"flex flex-col gap-6",children:E("div",{className:"flex items-center justify-between",children:[y("div",{className:"flex items-center gap-3",children:t.length>0&&E("div",{className:"flex items-center gap-3 flex-wrap",children:[y("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:y(Bo,{className:"h-4 w-4"})}),t.map(r=>!e.getColumn(r.key)&&!r.customFilter&&!r.externalSearch?null:y("div",{className:o("relative min-w-[150px]",r.width),children:r.type==="select"?E($e,{value:be(r.key)??"",onValueChange:S=>{q(r.key,S==="all"?"":S)},children:[r.icon&&y("span",{children:y(r.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),y(We,{className:o("h-9 rounded-lg w-full",r.icon&&"pl-9"),children:y(Ue,{placeholder:r.placeholder})}),E(Je,{className:"rounded-lg",children:[y(De,{value:"all",children:"All"}),r.options?.map(S=>y(De,{value:S.value,children:S.label},S.label))]})]}):r.type==="date"?y(Io,{value:be(r.key),onChange:S=>{r.onlyExternal||q(r.key,S)},placeholder:r.placeholder,mode:r.dateMode||"single",externalSearch:r.externalSearch,onlyExternal:r.onlyExternal,onExternalChange:S=>ce(r.key,S)}):E("div",{className:"relative",children:[r.icon&&y("span",{children:y(r.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),y(mt,{placeholder:r.placeholder,value:be(r.key)??"",onChange:S=>{q(r.key,S.target.value)},className:o("h-9 rounded-lg",r.icon&&"pl-9"),type:r.type==="number"?"number":"text"})]})},r.key)),(t.some(r=>r.externalSearch)||t.some(r=>r.customFilter))&&E(u,{variant:"default",size:"sm",onClick:Fe,className:"rounded-lg",children:[y(Fo,{className:"mr-2 h-4 w-4"}),t.find(r=>r.externalSearch||r.customFilter)?.searchButtonText||"Search"]})]})}),E("div",{className:"flex items-center gap-2",children:[l&&E("div",{className:"relative",children:[y(Fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),y(mt,{placeholder:"Global search...",value:a??"",onChange:r=>n(r.target.value),className:"pl-9 max-w-max"})]}),i&&E(u,{variant:"outline",size:"sm",onClick:()=>i(d),className:"rounded-lg",children:[y($a,{className:"mr-2 h-4 w-4"}),"Export"]}),p&&E(Re,{children:[y(Me,{asChild:!0,children:E(u,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[y("span",{children:"Columns"}),y(Xa,{className:"h-4 w-4 opacity-50"})]})}),E(ze,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[y(se,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),y(le,{}),_().length>0&&E(oo,{children:[y(se,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),_().map(r=>y(Et,{className:"text-sm",checked:r.getIsVisible(),onCheckedChange:C=>r.toggleVisibility(!!C),children:fe(r.id)},r.id))]}),h().map(r=>E(oo,{children:[y(le,{}),y(se,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:r.id}),r.columns?.filter(C=>C.getCanHide?.()!==!1).map(C=>y(Et,{className:"text-sm",checked:C.getIsVisible(),onCheckedChange:S=>C.toggleVisibility(!!S),children:fe(C.id,r.id)},C.id))]},r.id))]})]}),E(Re,{children:[y(Me,{asChild:!0,children:y(u,{variant:"outline",size:"sm",className:"rounded-lg",children:y(Ua,{className:"h-4 w-4"})})}),E(ze,{align:"end",className:"w-[200px] rounded-lg",children:[y(se,{children:"Table Settings"}),y(le,{}),E(J,{onClick:c,children:[y(Wa,{className:"mr-2 h-4 w-4"}),"Clear All Sorting"]}),E(J,{onClick:U,children:[y(Bo,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]}),T&&E(Ka,{children:[y(le,{}),y(se,{children:"Column Pinning"}),E(J,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[y(Ja,{className:"mr-2 h-4 w-4"}),"Reset All Pinning"]}),E(J,{onClick:()=>{let r=oe().filter(C=>C.getCanPin?.()!==!1).map(C=>C.id);e.setColumnPinning({left:[],right:r})},children:[y(qa,{className:"mr-2 h-4 w-4 -rotate-90"}),"Pin All Right"]})]})]})]}),m&&y(u,{variant:"outline",size:"sm",onClick:m,disabled:b,className:"rounded-lg",children:y(ja,{className:o("h-4 w-4",b&&"animate-spin")})})]})]})})})})}import{jsx as ne,jsxs as pt}from"react/jsx-runtime";function lo({table:e,config:t}){return t.enabled?ne("div",{className:"rounded-xl",children:ne("div",{children:pt("div",{className:"flex items-center justify-between",children:[ne("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&pt("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"]})}),pt("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&pt("div",{className:"flex items-center gap-2",children:[ne("span",{className:"text-sm font-medium",children:"Rows per page:"}),pt($e,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[ne(We,{className:"h-9 w-[70px] rounded-lg",children:ne(Ue,{})}),ne(Je,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>ne(De,{value:`${a}`,children:a},a))})]})]}),pt("div",{className:"flex items-center gap-2",children:[ne(u,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),ne(u,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&ne("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,n)=>{let l=e.getState().pagination.pageIndex,i=l+n;return i<1||i>e.getPageCount()?null:ne(u,{variant:i===l+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(i-1),children:i},i)})}),ne(u,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),ne(u,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}import{Toggle as Ya}from"radix-ui";import{cva as Za}from"class-variance-authority";import{jsx as en}from"react/jsx-runtime";var Qa=Za("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 Lo({className:e,variant:t,size:a,noBg:n,...l}){return en(Ya.Root,{"data-slot":"toggle",className:o(Qa({className:e,variant:t,size:a,bg:n?"disabled":"enabled"})),...l})}import{Checkbox as Oo}from"radix-ui";import{CheckIcon as tn}from"lucide-react";import{jsx as co}from"react/jsx-runtime";function St({className:e,...t}){return co(Oo.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:co(Oo.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:co(tn,{className:"size-3.5"})})})}import{useCallback as $t,useEffect as Ut,useMemo as Eo,useState as Xe}from"react";import{Fragment as Go,jsx as f,jsxs as j}from"react/jsx-runtime";function Ho({data:e,columns:t,filters:a=[],pagination:n={enabled:!1},settings:l={},header:i,footer:m,className:b="",maxHeight:p="600px",loading:d=!1,error:c,emptyMessage:N="No data available",onRowSelectionChange:T,onExport:A,onRefresh:D,onTableReady:M,children:F,isRowDisabled:B,isRowSelectable:v,onExternalSearch:oe}){let[h,_]=Xe([]),[fe,ce]=Xe([]),[ge,Fe]=Xe({}),[U,be]=Xe({}),[q,r]=Xe(""),[C,S]=Xe([]),[Z,Mt]=Xe(l.enableColumnPinning?{left:[],right:[]}:{}),[Ce,zt]=Xe({}),Be=Eo(()=>Object.keys(Ce).length===0?e:e.filter(w=>Object.entries(Ce).every(([P,s])=>{if(!s||s==="")return!0;let k=Yt(w,P);return typeof s=="string"?String(k).toLowerCase().includes(s.toLowerCase()):k===s})),[e,Ce]),{enableSorting:nt=!0,enableFiltering:me=!0,enableGlobalFilter:Qe=!0,enableColumnVisibility:_e=!0,enableRowSelection:V=!0,stickyHeader:Le=!0,toolbar:Kt=!1,showSerialNumbers:we=!0,fixedCheckboxColumn:yt=!0,striped:W=!0,hoverable:At=!0,compact:It=!0,bordered:rt=!0,fullHeight:Ft=!1,enableColumnResizing:Bt=!1,enableColumnPinning:Q=!0,hideHeader:_t=!1,selectionMode:Ne="multiple",showCheckBox:Lt=!0,checkboxColumnPosition:it=0}=l,Yt=(w,P)=>P.split(".").reduce((s,k)=>s&&s[k],w),Zt=$t((w,P)=>{zt(s=>{let k={...s};return P===""||P===null||P===void 0?delete k[w]:k[w]=P,k})},[]),Ct=Eo(()=>{let w=[...t],P=x=>x.map(I=>{if(I.id==="select"||I.id==="serialNumber")return I;let X={...I,enablePinning:!0};return I.columns&&(X.columns=P(I.columns)),X}),s=P(w),k={id:"select",header:({table:x})=>{if(Ne==="single")return null;let I=x.getRowModel().rows.filter(pe=>!B?.(pe.original)&&(v?v(pe.original):!0)),X=I.length>0&&I.every(pe=>pe.getIsSelected()),ve=I.some(pe=>pe.getIsSelected());return f(St,{checked:X||ve&&"indeterminate",onCheckedChange:pe=>{I.forEach(st=>st.toggleSelected(!!pe))},"aria-label":"Select all selectable rows"})},cell:({row:x})=>{let I=B?B(x.original):!1,X=v?v(x.original):!0;return f("div",{className:o("flex items-center justify-center",I&&"opacity-50"),children:Ne==="multiple"?f(St,{checked:x.getIsSelected(),onCheckedChange:ve=>X&&x.toggleSelected(!!ve),"aria-label":"Select row",disabled:I||!X}):Lt?f("input",{type:"radio",checked:x.getIsSelected(),onChange:()=>X&&x.toggleSelected(!0),disabled:I||!X,className:"h-4 w-4 rounded-full border-primary text-primary focus:ring-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:Ne==="multiple"?40:30};if(V){let x=it;x<0&&(x=s.length+x+1),x=Math.max(0,Math.min(x,s.length)),s.splice(x,0,k)}if(we){let x={id:"serialNumber",header:"No.",cell:({row:I})=>f("div",{className:"text-center font-medium text-muted-foreground",children:I.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};s.unshift(x)}return s},[t,we,V,yt,B,v,Ne,it]),g=sn({data:Be,columns:Ct,onSortingChange:nt?_:void 0,onColumnFiltersChange:me?ce:void 0,onGlobalFilterChange:Qe?r:void 0,getCoreRowModel:on(),getPaginationRowModel:n.enabled?nn():void 0,getSortedRowModel:nt?rn():void 0,getFilteredRowModel:me?an():void 0,onColumnVisibilityChange:_e?Fe:void 0,onRowSelectionChange:V?be:void 0,onColumnOrderChange:S,onColumnPinningChange:Q?Mt:void 0,state:{sorting:nt?h:void 0,columnFilters:me?fe:void 0,columnVisibility:_e?ge:void 0,rowSelection:V?U:{},globalFilter:q,columnOrder:C,columnPinning:Q?Z:{}},initialState:{pagination:n.enabled?{pageSize:n.pageSize||10}:void 0,columnPinning:Q?{left:[...we?["serialNumber"]:[],...V?["select"]:[]],right:[]}:void 0},enableRowSelection:V,enableColumnResizing:Bt,enableColumnPinning:Q,columnResizeMode:"onChange"});Ut(()=>{if(V&&T){let w=g.getFilteredSelectedRowModel().rows.filter(P=>!B?.(P.original)&&(v?v(P.original):!0)).map(P=>P.original);T(w)}},[U,V,T,g,B,v]);let L=$t(w=>{Ne==="single"?(g.resetRowSelection(),w.toggleSelected(!0)):w.toggleSelected()},[Ne,g]);Ut(()=>{M&&M(g)},[g,M]),Ut(()=>{if(V&&T){let w=g.getFilteredSelectedRowModel().rows.map(P=>P.original);T(w)}},[U,V,T,g]),Ut(()=>{if(V&&T){let w=g.getFilteredSelectedRowModel().rows.filter(P=>!B?.(P.original)&&(v?v(P.original):!0)).map(P=>P.original);T(w)}},[U,V,T,g,B,v]);let z=$t(()=>{_([])},[]),ie=$t(()=>{ce([]),r("")},[]),ae=(w,P)=>{if(!Q)return;let s=[...we?["serialNumber"]:[],...V&&yt?["select"]:[]],k={left:[...(Z.left??[]).filter(x=>s.includes(x))],right:[...Z.right??[]]};P===!1?(k.left=k.left.filter(x=>x!==w),k.right=k.right.filter(x=>x!==w)):P==="right"?(k.left=k.left.filter(x=>x!==w),k.right.includes(w)||k.right.push(w)):P==="left"&&(k.right=k.right.filter(x=>x!==w),!k.left.includes(w)&&!s.includes(w)&&k.left.push(w)),g.setColumnPinning(k)},Pe=()=>f(So,{className:o(Le&&"sticky top-0 bg-sidebar z-20"),children:g.getHeaderGroups().map((w,P)=>f(wt,{className:"hover:bg-transparent",children:w.headers.map((s,k)=>{let x=s.depth===0&&s.colSpan>1,I=Q&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&V),X=Q&&s.column.getIsPinned()==="right",ve=s.column.getCanSort(),pe=Q&&s.column.columnDef.enablePinning!==!1,st=s.column.id==="serialNumber",Qt=s.column.id==="select",Po=st||Qt&&yt,lt=s.column.columnDef.headerAlign||"left",wa={left:"justify-start",center:"justify-center",right:"justify-end"}[lt];return j(ko,{colSpan:s.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!It&&"py-2",rt&&k<w.headers.length-1&&"border-r","relative",I&&"sticky left-0 z-15 bg-sidebar",X&&"sticky right-0 z-15 bg-sidebar",(st||Qt)&&"sticky left-0 z-15 bg-sidebar",x?"text-center":"text-left"),style:{width:s.getSize()!==150?s.getSize():"auto",minWidth:s.getSize()!==150?s.getSize():"auto",...I&&{left:st?0:Qt?we&&g.getColumn("serialNumber")?.getSize()||0:Oe(s.column)},...X&&{right:Ve(s.column)},...st&&{left:0}},children:[x?f("div",{className:"flex items-center justify-center",children:mo(s.column.columnDef.header,s.getContext())}):j("div",{className:o("relative flex items-center w-full px-2",wa),children:[j("div",{className:"flex items-center gap-1",children:[ve&<==="right"&&f("span",{className:"ml-1 order-2",children:s.column.getIsSorted()&&{asc:f(po,{className:"h-4 w-4"}),desc:f(uo,{className:"h-4 w-4"})}[s.column.getIsSorted()]}),s.isPlaceholder?null:mo(s.column.columnDef.header,s.getContext()),ve&<!=="right"&&s.column.getIsSorted()&&f("span",{className:"ml-1 order-2",children:s.column.getIsSorted()&&{asc:f(po,{className:"h-4 w-4"}),desc:f(uo,{className:"h-4 w-4"})}[s.column.getIsSorted()]})]}),(ve||pe&&!Po)&&j(Re,{children:[f(Me,{asChild:!0,className:o("absolute",lt==="left"&&"right-1",lt==="center"&&"right-1",lt==="right"&&"left-1"),children:f(Lo,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:f(dn,{className:"h-4 w-4"})})}),j(ze,{align:"end",className:"w-48",children:[ve&&j(Go,{children:[f(se,{children:"Sorting"}),j(J,{onClick:()=>s.column.toggleSorting(!1),children:[f(po,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),j(J,{onClick:()=>s.column.toggleSorting(!0),children:[f(uo,{className:"mr-2 h-4 w-4"}),"Sort Descending"]}),j(J,{onClick:()=>s.column.clearSorting(),disabled:!s.column.getIsSorted(),children:[f(ln,{className:"mr-2 h-4 w-4"}),"Clear Sort"]}),f(le,{})]}),pe&&!Po&&j(Go,{children:[f(se,{children:"Pin Column"}),j(J,{onClick:()=>ae(s.column.id,"right"),disabled:s.column.getIsPinned()==="right",children:[f(cn,{}),"Pin Right"]}),j(J,{onClick:()=>ae(s.column.id,!1),disabled:!s.column.getIsPinned(),children:[f(mn,{}),"Unpin"]})]})]})]})]}),Bt&&s.column.getCanResize()&&!x&&s.colSpan===1&&f("div",{className:"absolute right-0 top-0 h-full w-1 bg-border hover:bg-primary cursor-col-resize opacity-0 hover:opacity-100 transition-opacity",onMouseDown:s.getResizeHandler()})]},s.id)})},w.id))}),Oe=w=>{if(!Q)return;let P=0,s=g.getLeftHeaderGroups()[0]?.headers||[],k=[...we?["serialNumber"]:[],...V?["select"]:[]];for(let x of s){if(x.id===w.id)break;if(k.includes(x.id)){let I=g.getColumn(x.id);I&&(P+=I.getSize())}}return P},Ve=w=>{if(!Q)return;let P=g.getState().columnPinning.right||[],s=P.indexOf(w.id);if(s===-1)return;let k=0;for(let x=s+1;x<P.length;x++){let I=g.getColumn(P[x]);I&&(k+=I.getSize())}return k};return c?f(Se,{className:"w-full rounded-xl shadow-sm",children:f(Te,{className:"flex items-center justify-center",children:j("div",{className:"text-center",children:[f("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),f("p",{className:"text-sm text-muted-foreground mb-4",children:c}),D&&j(u,{variant:"outline",size:"sm",onClick:D,className:"rounded-lg",children:[f(Vo,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):f(et,{children:j("div",{className:o("w-full space-y-2 flex flex-col h-full",b),children:[i&&f(Se,{className:"rounded-2xl py-2 sticky top-0 z-20",children:f(Te,{className:"px-2",children:i})}),Kt&&f(so,{table:g,filters:a,globalFilter:q,onGlobalFilterChange:r,enableGlobalFilter:Qe,onExport:A,onRefresh:D,loading:d,enableColumnVisibility:_e,enableColumnPinning:Q,data:Be,onClearSorting:z,onClearFilters:ie,onExternalSearch:oe,onCustomFilterChange:Zt}),f(Se,{className:o("shadow-sm overflow-auto py-0",Ft&&"flex-1"),children:f(Te,{className:"p-0 h-full",children:j("div",{className:"relative flex flex-col h-full justify-between",children:[d&&f("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl",children:j("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[f(Vo,{className:"size-5 animate-spin text-primary"}),f("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),f("div",{className:"relative rounded-t-xl overflow-auto border-b",children:j(eo,{className:"border-collapse w-full",children:[!_t&&Pe(),f(To,{children:g.getRowModel().rows?.length?g.getRowModel().rows.map((w,P)=>f(wt,{"data-state":w.getIsSelected()&&"selected",className:o(At&&"hover:bg-muted/50",W&&P%2===0&&"bg-muted/20",w.getIsSelected()&&"bg-muted","border-b last:border-b-0",Ne==="single"&&"cursor-pointer"),onClick:()=>{Ne==="single"&&L(w)},children:w.getVisibleCells().map((s,k)=>{let x=Q&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&V),I=Q&&s.column.getIsPinned()==="right",X=s.column.id==="serialNumber",ve=s.column.id==="select",pe=X||ve&&yt;return f(Vt,{className:o(It?"py-2":"py-4",rt&&k<w.getVisibleCells().length&&"border-r",x&&"sticky left-0 z-10 bg-sidebar/97",I&&"sticky right-0 z-10 bg-sidebar/97",X&&"sticky left-0 z-10 bg-sidebar/97","p-1"),style:{width:s.column.getSize()!==150?s.column.getSize():"auto",minWidth:s.column.getSize()!==150?s.column.getSize():"auto",...x&&{left:X?0:ve?we&&g.getColumn("serialNumber")?.getSize()||0:Oe(s.column)},...I&&{right:Ve(s.column)},...X&&{left:0}},children:mo(s.column.columnDef.cell,s.getContext())},s.id)})},w.id)):f(wt,{children:f(Vt,{colSpan:Ct.length,className:"h-32 text-center border-0",children:j("div",{className:"flex flex-col items-center gap-3",children:[f("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),f("p",{className:"text-muted-foreground font-medium",children:N})]})})})})]})}),m&&f("div",{className:"sticky bottom-0 bg-sidebar w-full z-20",style:{width:"100%",minWidth:"fit-content"},children:f(eo,{children:f(Do,{children:f(wt,{className:"bg-sidebar",children:f(Vt,{colSpan:Ct.length,className:"p-2",children:m})})})})})]})})}),f(lo,{table:g,config:n}),F&&F(g)]})})}import{Separator as pn}from"radix-ui";import{jsx as un}from"react/jsx-runtime";function Tt({className:e,orientation:t="horizontal",decorative:a=!0,...n}){return un(pn.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}import{Loader as fn,X as gn}from"lucide-react";import{AnimatePresence as bn,motion as vn}from"framer-motion";import*as Ke from"react";import*as jo from"react-dom";import{jsx as ee,jsxs as Dt}from"react/jsx-runtime";function $o({table:e,visible:t,container:a,children:n,className:l,...i}){let[m,b]=Ke.useState(!1);Ke.useLayoutEffect(()=>{b(!0)},[]),Ke.useEffect(()=>{function c(N){N.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=t??e.getFilteredSelectedRowModel().rows.length>0;return jo.createPortal(ee(bn,{children:d&&ee(vn.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",l),...i,children:ee(et,{children:n})})}),p)}function Uo({size:e="sm",tooltip:t,isPending:a,disabled:n,className:l,children:i,...m}){let b=ee(u,{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",l),disabled:n||a,...m,children:a?ee(fn,{className:"animate-spin"}):i});return t?Dt(Ge,{children:[ee(He,{asChild:!0,children:b}),ee(je,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:ee("p",{children:t})})]}):b}function Wo({table:e}){let t=Ke.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?Dt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[Dt("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),ee(Tt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),Dt(Ge,{children:[ee(He,{asChild:!0,children:ee(u,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:ee(gn,{className:"size-3.5"})})}),Dt(je,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[ee("p",{children:"Clear selection"}),ee("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:ee("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{ArrowUpDown as ys,EyeOff as Cs}from"lucide-react";import{jsx as Ts,jsxs as Ds}from"react/jsx-runtime";import{ChevronDown as Ms,Eye as zs}from"lucide-react";import{jsx as Bs,jsxs as _s}from"react/jsx-runtime";import{Slot as Vs}from"radix-ui";import{cva as hn}from"class-variance-authority";import{jsx as $s}from"react/jsx-runtime";var Hs=hn("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"}});import{Command as sl}from"cmdk";import{SearchIcon as dl}from"lucide-react";import{Dialog as Js}from"radix-ui";import{XIcon as Xs}from"lucide-react";import{jsx as Zs,jsxs as Qs}from"react/jsx-runtime";import{jsx as ul,jsxs as fl}from"react/jsx-runtime";import{CheckIcon as zl,PlusCircleIcon as Al}from"lucide-react";import{Fragment as _l,jsx as Fl,jsxs as Bl}from"react/jsx-runtime";import{useState as Ye,useEffect as qo,useMemo as go,useCallback as ut,useRef as Mn}from"react";import{Loader2 as Xo}from"lucide-react";import{Search as xn,Download as yn,RefreshCw as Cn,Filter as wn,ChevronDown as Nn,Settings2 as Pn}from"lucide-react";import{Fragment as Sn,jsx as R,jsxs as K}from"react/jsx-runtime";function fo({fields:e,filters:t,globalFilter:a,onGlobalFilterChange:n,fieldFilters:l,onFieldFilterChange:i,sortField:m,sortDirection:b,onSortChange:p,selectedCount:d,totalCount:c,visibleCount:N,onExport:T,onRefresh:A,loading:D,onClearFilters:M,onClearSorting:F}){let B=e.filter(h=>h.sortable),v=Object.values(l).some(h=>h!=null&&h!=="")||a!=="",oe=m!=="";return R("div",{className:"rounded-xl p-0.5",children:R("div",{className:"px-2",children:R("div",{className:"flex flex-col gap-6",children:K("div",{className:"flex items-center justify-between",children:[R("div",{className:"flex items-center gap-3",children:t.length>0&&K("div",{className:"flex items-center gap-3 flex-wrap",children:[R("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:R(wn,{className:"h-4 w-4"})}),t.map(h=>R("div",{className:"relative min-w-[150px]",children:h.type==="select"?K($e,{value:l[h.key]||"all",onValueChange:_=>i(h.key,_),children:[h.icon&&R(h.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),R(We,{className:o("h-9 rounded-lg w-full",h.icon&&"pl-9"),children:R(Ue,{placeholder:h.placeholder||"Select..."})}),K(Je,{className:"rounded-lg",children:[R(De,{value:"all",children:"All"}),h.options?.map(_=>R(De,{value:_.value,children:_.label},_.value))]})]}):K("div",{className:"relative",children:[h.icon&&R(h.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),R(mt,{type:h.type,placeholder:h.placeholder,value:l[h.key]||"",onChange:_=>i(h.key,_.target.value),className:o("h-9 rounded-lg",h.icon&&"pl-9")})]})},String(h.key)))]})}),K("div",{className:"flex items-center gap-2",children:[K("div",{className:"relative",children:[R(xn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),R(mt,{placeholder:"Global search...",value:a,onChange:h=>n(h.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),B.length>0&&K(Re,{children:[R(Me,{asChild:!0,children:K(u,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[R("span",{children:"Sort"}),R(Nn,{className:"h-4 w-4 opacity-50"})]})}),K(ze,{align:"end",className:"w-[200px] rounded-lg",children:[R(se,{children:"Sort By"}),R(le,{}),B.map(h=>K("div",{children:[K(J,{onClick:()=>p(h.key,"asc"),children:[h.label," (A-Z)"]}),K(J,{onClick:()=>p(h.key,"desc"),children:[h.label," (Z-A)"]})]},String(h.key))),oe&&K(Sn,{children:[R(le,{}),R(J,{onClick:F,children:"Clear All Sorting"})]})]})]}),K(Re,{children:[R(Me,{asChild:!0,children:R(u,{variant:"outline",size:"sm",className:"rounded-lg",children:R(Pn,{className:"h-4 w-4"})})}),K(ze,{align:"end",className:"w-[200px] rounded-lg",children:[R(se,{children:"Table Settings"}),R(le,{}),R(J,{onClick:F,children:"Clear All Sorting"}),R(J,{onClick:M,children:"Clear All Filters"})]})]}),T&&K(u,{variant:"outline",size:"sm",onClick:T,className:"rounded-lg",children:[R(yn,{className:"mr-2 h-4 w-4"}),"Export"]}),A&&R(u,{variant:"outline",size:"sm",onClick:A,disabled:D,className:"rounded-lg",children:R(Cn,{className:o("h-4 w-4",D&&"animate-spin")})})]})]})})})})}import{ChevronLeft as Tn,ChevronRight as Dn,ChevronsLeft as kn,ChevronsRight as Rn}from"lucide-react";import{jsx as G,jsxs as xe}from"react/jsx-runtime";function Jo({currentPage:e,totalPages:t,pageSize:a,totalItems:n,onPageChange:l,onPageSizeChange:i,config:m}){if(!m.enabled)return null;let b=m.pageSizeOptions||[10,20,50,100],p=(e-1)*a+1,d=Math.min(e*a,n),c=e>1,N=e<t,T=()=>{let D=[],M=[];for(let F=Math.max(2,e-2);F<=Math.min(t-1,e+2);F++)D.push(F);return e-2>2?M.push(1,"..."):M.push(1),M.push(...D),e+2<t-1?M.push("...",t):t>1&&M.push(t),M};return G("div",{className:"rounded-xl",children:xe("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[G("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:m.showInfo!==!1&&xe("span",{children:["Showing ",p," to ",d," of ",n," entries"]})}),xe("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[b&&xe("div",{className:"flex items-center gap-2",children:[G("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),xe($e,{value:`${a}`,onValueChange:A=>i(Number(A)),children:[G(We,{className:"h-9 w-[70px] rounded-lg",children:G(Ue,{})}),G(Je,{side:"top",className:"rounded-lg",children:b.map(A=>G(De,{value:`${A}`,children:A},A))})]})]}),xe("div",{className:"flex items-center gap-2",children:[xe(u,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:!c,className:"hidden sm:flex rounded-lg",children:[G(kn,{className:"h-4 w-4"}),G("span",{className:"sr-only",children:"Go to first page"})]}),xe(u,{variant:"outline",size:"sm",onClick:()=>l(e-1),disabled:!c,className:"rounded-lg",children:[G(Tn,{className:"h-4 w-4 sm:mr-2"}),G("span",{className:"hidden sm:inline",children:"Previous"}),G("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),m.showPageNumbers&&t>1&&G("div",{className:"hidden sm:flex items-center gap-1",children:T().map((A,D)=>{if(A==="...")return G("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${D}`);let M=A;return G(u,{variant:M===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>l(M),children:M},M)})}),xe("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),xe(u,{variant:"outline",size:"sm",onClick:()=>l(e+1),disabled:!N,className:"rounded-lg",children:[G("span",{className:"hidden sm:inline",children:"Next"}),G(Dn,{className:"h-4 w-4 sm:ml-2"}),G("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),xe(u,{variant:"outline",size:"sm",onClick:()=>l(t),disabled:!N,className:"hidden sm:flex rounded-lg",children:[G(Rn,{className:"h-4 w-4"}),G("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}import{jsx as O,jsxs as ot}from"react/jsx-runtime";function Ko({data:e,template:t,fields:a=[],filters:n=[],pagination:l={enabled:!1},settings:i={},header:m,footer:b,className:p="",loading:d=!1,error:c,emptyMessage:N="No items found",emptyIcon:T,onSelectionChange:A,onExport:D,onRefresh:M,onTemplateReady:F,children:B}){let{enableSorting:v=!0,enableFiltering:oe=!0,enableGlobalSearch:h=!0,enableSelection:_=!1,enableExport:fe=!1,toolbar:ce=!0,selectionMode:ge="multiple",gridCols:Fe={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:U=4,aspectRatio:be="auto",minCardWidth:q=350,maxCardWidth:r=350}=i,[C,S]=Ye(""),[Z,Mt]=Ye({}),[Ce,zt]=Ye(""),[Be,nt]=Ye("asc"),[me,Qe]=Ye(new Set),[_e,V]=Ye(1),[Le,Kt]=Ye(l.pageSize||12),[we,yt]=Ye(Fe.default),W=go(()=>{let g=[...e];if(h&&C){let L=a.filter(z=>z.searchable!==!1);g=g.filter(z=>L.some(ie=>z[ie.key]?.toString().toLowerCase().includes(C.toLowerCase())))}if(oe&&Object.keys(Z).forEach(L=>{let z=Z[L];if(z!=null&&z!==""){let ie=a.find(ae=>ae.key===L);ie&&(g=g.filter(ae=>{let Pe=ae[L];return ie.type==="boolean"?Pe===(z==="true"):ie.type==="number"?Pe===Number(z):Pe?.toString().toLowerCase().includes(String(z).toLowerCase())}))}}),v&&Ce){let L=a.find(z=>z.key===Ce);L&&g.sort((z,ie)=>{let ae=z[Ce],Pe=ie[Ce];if(L.type==="number")return Be==="asc"?Number(ae)-Number(Pe):Number(Pe)-Number(ae);if(L.type==="date"){let Oe=new Date(ae),Ve=new Date(Pe);return Be==="asc"?Oe.getTime()-Ve.getTime():Ve.getTime()-Oe.getTime()}else{let Oe=String(ae).toLowerCase(),Ve=String(Pe).toLowerCase();return Be==="asc"?Oe.localeCompare(Ve):Ve.localeCompare(Oe)}})}return g},[e,C,Z,Ce,Be,a,h,oe,v]),At=go(()=>{if(!l.enabled)return W;let g=(_e-1)*Le,L=g+Le;return W.slice(g,L)},[W,_e,Le,l.enabled]),It=Math.ceil(W.length/Le),rt=ut(g=>{_&&Qe(L=>{let z=new Set(L);return ge==="single"?(z.clear(),z.add(g)):z.has(g)?z.delete(g):z.add(g),z})},[_,ge]),Ft=ut(()=>{!_||ge==="single"||(me.size===W.length?Qe(new Set):Qe(new Set(W.map((g,L)=>L))))},[_,ge,me.size,W.length]),Bt=ut((g,L)=>{Mt(z=>({...z,[g]:L})),V(1)},[]),Q=ut((g,L)=>{zt(g),nt(L)},[]),_t=ut(()=>{S(""),Mt({}),V(1)},[]),Ne=ut(()=>{zt(""),nt("asc")},[]),Lt=go(()=>({getSelectedItems:()=>Array.from(me).map(g=>W[g]),clearSelection:()=>Qe(new Set),selectAll:Ft,getFilteredData:()=>W,getTotalCount:()=>e.length,getVisibleCount:()=>W.length,refresh:()=>M?.(),exportData:()=>D?.(W)}),[me,W,e.length,Ft,M,D]),it=Mn(null);it.current=Lt,qo(()=>{F&&it.current&&F(it.current)},[]),qo(()=>{if(_&&A){let g=Array.from(me).map(L=>W[L]);A(g)}},[me]);let Yt=o("w-full","overflow-hidden",p),Zt=o("grid",`gap-${U}`,"w-full","mx-auto","items-start"),Ct={gridTemplateColumns:we===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${q}px, calc(100%/${we} - ${U*4}px), ${r}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return c?O(Se,{className:"w-full",children:O(Te,{className:"flex items-center justify-center py-12",children:ot("div",{className:"text-center",children:[O("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),O("p",{className:"text-sm text-muted-foreground mb-4",children:c}),M&&ot(u,{variant:"outline",size:"sm",onClick:M,children:[O(Xo,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):ot("div",{className:o("w-full flex gap-2 flex-col h-full",Yt),children:[m&&O(Se,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:O(Te,{className:"p-2",children:m})}),ce&&O(fo,{fields:a,filters:n,globalFilter:C,onGlobalFilterChange:S,fieldFilters:Z,onFieldFilterChange:Bt,sortField:Ce,sortDirection:Be,onSortChange:Q,selectedCount:me.size,totalCount:e.length,visibleCount:W.length,onExport:fe?()=>D?.(W):void 0,onRefresh:M,loading:d,onClearFilters:_t,onClearSorting:Ne}),O(Se,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:O(Te,{className:"px-0",children:ot("div",{className:"relative",children:[d&&O("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:ot("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[O(Xo,{className:"size-5 animate-spin text-primary"}),O("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),At.length>0?O("div",{className:o(Zt),style:Ct,children:At.map((g,L)=>{let z=l.enabled?(_e-1)*Le+L:L,ie=me.has(z);return ot("div",{className:o("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",be==="square"?"aspect-square":"",be==="video"?"aspect-video":"",_?"cursor-pointer":"",ie?"ring-2 ring-primary":""),onClick:()=>_&&rt(z),children:[_&&ge==="multiple"&&O("div",{className:"absolute top-2 right-2 z-10",children:O(St,{checked:ie,onCheckedChange:()=>rt(z),className:"bg-background/80 backdrop-blur-sm",onClick:ae=>ae.stopPropagation()})}),t(g,L,ie,()=>rt(z))]},z)})}):ot("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[O("div",{className:"text-6xl",children:T||"\u{1F4CB}"}),O("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:N}),(C||Object.values(Z).some(g=>g))&&O(u,{variant:"outline",onClick:_t,children:"Clear Filters"})]})]})})}),l.enabled&&O("div",{className:"pb-1",children:O(Jo,{currentPage:_e,totalPages:It,pageSize:Le,totalItems:W.length,onPageChange:V,onPageSizeChange:g=>{Kt(g),V(1)},config:l})}),b&&O("div",{className:"p-2 m-0.5",children:b}),B&&B(Lt)]})}import{Loader as zn,X as An}from"lucide-react";import{AnimatePresence as In,motion as Fn}from"framer-motion";import*as Ze from"react";import*as Yo from"react-dom";import{jsx as te,jsxs as kt}from"react/jsx-runtime";function Zo({controller:e,visible:t,container:a,children:n,className:l,...i}){let[m,b]=Ze.useState(!1);Ze.useLayoutEffect(()=>{b(!0)},[]),Ze.useEffect(()=>{function N(T){T.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=e.getSelectedItems(),c=t??d.length>0;return Yo.createPortal(te(In,{children:c&&te(Fn.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-8 ring-primary/5",l),...i,children:te(et,{children:n})})}),p)}function Qo({size:e="sm",variant:t="secondary",tooltip:a,isPending:n,disabled:l,className:i,children:m,onClick:b,...p}){let d=te(u,{variant:t,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",i),disabled:l||n,onClick:b,...p,children:n?te(zn,{className:"animate-spin"}):m});return a?kt(Ge,{children:[te(He,{asChild:!0,children:d}),te(je,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:te("p",{children:a})})]}):d}function ea({controller:e}){let t=Ze.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let a=e.getSelectedItems();return kt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[kt("span",{className:"whitespace-nowrap text-sm font-medium",children:[a.length," selected"]}),te(Tt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),kt(Ge,{children:[te(He,{asChild:!0,children:te(u,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:te(An,{className:"size-3.5"})})}),kt(je,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[te("p",{children:"Clear selection"}),te("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:te("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}import{jsx as Ln}from"react/jsx-runtime";var Bn={none:"gap-0",tight:"gap-2",default:"gap-4",loose:"gap-6","extra-loose":"gap-8"},_n={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},ta=({children:e,className:t,spacing:a="tight",padding:n="none"})=>Ln("div",{className:o("flex flex-col h-full",Bn[a],_n[n],t),children:e});import{ArrowLeftIcon as oa,ChevronRight as On}from"lucide-react";import{NavLink as Vn}from"react-router";import{jsx as re,jsxs as at}from"react/jsx-runtime";var aa=({className:e,columns:t=[],showBackButton:a=!0,meta:n={title:""}})=>{let l=()=>{if(!n.backAction||!a)return null;let c={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return n.backAction.href?re(Vn,{to:n.backAction.href,children:at(u,{...c,children:[re(oa,{className:"size-6"}),n.backAction.content]})}):at(u,{...c,onClick:n.backAction.onClick,children:[re(oa,{className:"size-6"}),n.backAction.content]})},i=()=>!n.metadata||n.metadata.length===0?null:re("div",{className:"flex gap-4",children:n.metadata.map((c,N)=>c.value&&at("div",{className:"text-sm",children:[at("span",{className:"text-muted-foreground",children:[c.label," "]}),re("span",{children:c.value})]},N))}),m=()=>n.status?re("span",{className:o("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",critical:"bg-red-100 text-red-800",info:"bg-blue-100 text-blue-800",default:"bg-gray-100 text-gray-800"}[n.status.color]),children:n.status.content}):null,b={content:at("div",{className:"flex gap-2 items-center",children:[l(),at("div",{className:"flex flex-col gap-2 w-max",children:[re("h1",{className:"text-2xl font-bold tracking-tight",children:n.title}),m(),n.description&&re("p",{className:"text-muted-foreground",children:n.description}),i(),n.breadcrumbs&&n.breadcrumbs.length>0&&re("div",{className:"flex items-center text-sm text-muted-foreground",children:n.breadcrumbs.map((c,N)=>at("div",{className:"flex items-center",children:[c.href?re("span",{className:"hover:text-primary hover:underline",children:c.label}):re("span",{children:c.label}),N<n.breadcrumbs.length-1&&re(On,{className:"mx-2 h-4 w-4"})]},N))})]})]}),align:"left",width:"fill"},p={content:n.primaryActions,align:"right",width:"auto"},d=[b,...t.filter(c=>c!==void 0),p];return re("div",{className:o("flex items-center w-full gap-4 p-2",e),children:d.map((c,N)=>re("div",{className:o("flex items-center h-full",c.className,{"justify-start":c.align==="left","justify-center":c.align==="center","justify-end":c.align==="right","flex-1":c.width==="fill"}),children:c.content},N))})};import Hn,{useState as jn,createContext as $n,useContext as Un}from"react";import{Dialog as Rt}from"radix-ui";import{XIcon as En}from"lucide-react";import{jsx as ft,jsxs as bo}from"react/jsx-runtime";function na({...e}){return ft(Rt.Root,{"data-slot":"sheet",...e})}function vo({...e}){return ft(Rt.Portal,{"data-slot":"sheet-portal",...e})}function Gn({className:e,...t}){return ft(Rt.Overlay,{"data-slot":"sheet-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function ra({className:e,children:t,side:a="right",...n}){return bo(vo,{children:[ft(Gn,{}),bo(Rt.Content,{"data-slot":"sheet-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...n,children:[t,bo(Rt.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[ft(En,{className:"size-4"}),ft("span",{className:"sr-only",children:"Close"})]})]})]})}import{Fragment as Xn,jsx as $,jsxs as bt}from"react/jsx-runtime";var ia=$n(!1),Wt={"one-half":["w-1/2","w-1/2"],"one-third":["w-1/3","w-2/3"],"two-third":["w-2/3","w-1/3"],"one-fourth":["w-1/4","w-3/4"],"three-fourth":["w-3/4","w-1/4"],"one-fifth":["w-1/5","w-4/5"],"four-fifth":["w-4/5","w-1/5"]},gt={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Wn=(e,t)=>{let[a,n]=Wt[t];return{container:"inset-y-0 z-50 transition-all duration-500 ease-in-out",content:o("h-full bg-background transition-all duration-500 ease-in-out",e==="right"?"border-l":"border-r"),transform:e==="right"?"translate-x-full":"-translate-x-full",transformOpen:"translate-x-0",contentPushClass:e==="right"?n:a,sheetPushClass:e==="right"?a:n}},Jn="flex flex-col overflow-hidden rounded-2xl relative",qn={default:"bg-background",card:"bg-background shadow-sm border",border:"bg-background border-2",transparent:"bg-transparent"},sa=e=>{let{children:t,className:a,variant:n="default",layout:l="full",header:i,footer:m,headerClassName:b,footerClassName:p,parentContainer:d=!1,padding:c=d?"none":"tight"}=e,N=Un(ia),[T,A]=jn(!1),D=Hn.useCallback(F=>$("div",{className:o("flex-1 overflow-auto h-full no-scrollbar",d&&"flex",!d&>[c]),children:F}),[c,d]),M=()=>{switch(l){case"split":{let{splitRatio:F="three-fourth",reverse:B=!1}=e;if(!Array.isArray(t)||t.length!==2)return $("div",{className:"flex items-center justify-center h-full text-red-500",children:'Error: AppContent with layout="split" requires exactly 2 children'});let[v,oe]=Wt[F],[h,_]=B?[t[1],t[0]]:[t[0],t[1]],[fe,ce]=B?[oe,v]:[v,oe];return bt("div",{className:"flex h-full gap-2",children:[$("div",{className:o(fe,"overflow-auto"),children:D(h)}),$("div",{className:o(ce,"overflow-auto"),children:D(_)})]})}case"with-sheet":{let{sheetContent:F,sheetWidth:B="four-fifth",sheetSide:v="right",sheetMode:oe="container",sheetClassName:h,isSheetOpen:_,onSheetOpenChange:fe,disableOverlay:ce=!0,showSheetOverlay:ge=!0}=e,Fe=_!==void 0&&fe,U=Fe?_:T,be=Fe?fe:A;if(oe==="container"){let q=Wn(v,B),r=Wt[B][0];return ce?bt("div",{className:o("flex relative flex-1 overflow-hidden"),children:[$("div",{className:o("h-full overflow-auto transition-all duration-500",U?q.contentPushClass:"w-full",U&&"overflow-y-auto overflow-x-hidden"),children:$("div",{className:o("h-full",!d&>[c]),children:t})}),$("div",{className:o(q.container,"transition-all duration-500 ease-in-out h-full",r,U&&["left","right"].includes(v)?o(q.sheetPushClass,"overflow-y-auto"):U?q.transformOpen:o(q.transform,"hidden"),"overflow-y-auto"),children:$("div",{className:o(q.content,h,"h-full"),children:F})})]}):bt("div",{className:o("flex relative flex-1 overflow-hidden"),children:[$("div",{className:o("h-full overflow-auto w-full transition-all duration-500 relative z-10"),children:$("div",{className:o("h-full",!d&>[c]),children:t})}),bt("div",{className:o("absolute inset-0 z-20",!U&&"pointer-events-none"),children:[ge&&$("div",{className:o("absolute inset-0 bg-black/50 transition-opacity duration-500",U?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>be(!1)}),$("div",{className:o(q.container,"transition-all duration-500 backdrop-blur-2xl ease-in-out h-full absolute",r,U?"translate-x-0 opacity-100":o(v==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),"overflow-y-auto"),style:{[v]:0},children:$("div",{className:o(q.content,h,"h-full"),children:F})})]})]})}return bt(Xn,{children:[t,$(na,{open:U,onOpenChange:be,children:$(vo,{children:$(ra,{side:v,className:o("fixed bg-background border sm:max-w-full","transition-all duration-500 ease-in-out",Wt[B][0],h),children:F})})})]})}default:return D(t)}};return $(ia.Provider,{value:!0,children:bt("div",{className:o(Jn,qn[n],gt[c],N&&"flex-1",d&&"h-full",!d&&"rounded-2xl",a),children:[i&&$("div",{className:o("border-b",b,n==="card"&&!d&&"rounded-t-2xl",n==="border"&&"border-b-2",gt[c]),children:i}),M(),m&&$("div",{className:o("border-t",p,n==="card"&&!d&&"rounded-b-2xl",n==="border"&&"border-t-2",gt[c]),children:m})]})})};import{jsx as ho}from"react/jsx-runtime";var la=({className:e,columns:t=[],meta:a={title:""}})=>{let n={content:ho("div",{className:"flex items-center gap-4 p-2",children:a.secondaryActions}),align:"right",width:"fill"},l=[...t.filter(i=>i!==void 0),n];return ho("div",{className:o("flex items-center w-full gap-4",e),children:l.map((i,m)=>ho("div",{className:o("flex items-center h-full",i.className,{"justify-start":i.align==="left","justify-center":i.align==="center","justify-end":i.align==="right","flex-1":i.width==="fill"}),children:i.content},m))})};import{jsx as Jt}from"react/jsx-runtime";function Kn({useTypedAppMeta:e}){return{AppHeader:i=>{let{meta:m}=e();return Jt(aa,{...i,meta:m})},AppFooter:i=>{let{meta:m}=e();return Jt(la,{...i,meta:m})},AppContent:i=>Jt(sa,{...i}),AppContainer:i=>Jt(ta,{...i})}}import{createContext as da,useContext as Yn,useState as ca,useCallback as qt,useMemo as ma}from"react";import{jsx as pa}from"react/jsx-runtime";var Zn=da(void 0),Qn=({children:e})=>{let[t,a]=ca({title:"",description:"",breadcrumbs:[]}),n=qt(m=>{a(b=>Object.keys(m).some(d=>JSON.stringify(b[d])!==JSON.stringify(m[d]))?{...b,...m}:b)},[]),l=qt(()=>{a(m=>m.title===""&&m.description===""&&(m.breadcrumbs?.length??0)===0?m:{title:"",description:"",breadcrumbs:[]})},[]),i=ma(()=>({meta:t,setMeta:n,resetMeta:l}),[t,n,l]);return pa(Zn.Provider,{value:i,children:e})};function er(){let e=da(void 0);return{TypedAppMetaProvider:({children:n})=>{let[l,i]=ca({title:"",description:"",breadcrumbs:[]}),m=qt(d=>{i(c=>Object.keys(d).some(T=>{let A=c[T],D=d[T];return JSON.stringify(A)!==JSON.stringify(D)})?{...c,...d}:c)},[]),b=qt(()=>{i(d=>d.title===""&&d.description===""&&(d.breadcrumbs?.length??0)===0?d:{title:"",description:"",breadcrumbs:[]})},[]),p=ma(()=>({meta:l,setMeta:m,resetMeta:b}),[l,m,b]);return pa(e.Provider,{value:p,children:n})},useTypedAppMeta:()=>{let n=Yn(e);if(!n)throw new Error("useTypedAppMeta must be used within a TypedAppMetaProvider");return n},TypedAppMetaContext:e}}import{useEffect as tr,useMemo as xo}from"react";function or({useTypedAppMeta:e}){function t(a){let{setMeta:n,resetMeta:l}=e(),i=xo(()=>{if(a.backAction)return{...a.backAction,onClick:a.backAction.onClick}},[a.backAction?.content,a.backAction?.href,a.backAction?.onClick?.toString()]),m=xo(()=>a.metadata,[JSON.stringify(a.metadata)]),b=xo(()=>({...a,backAction:i,metadata:m}),[a.title,a.description,a.breadcrumbs,a.primaryActions,a.secondaryActions,a.pagination,a.status,i,m]);tr(()=>(n(b),()=>l()),[b,n,l])}return{usePageTemplate:t}}import{useState as ua}from"react";import{Copy as ar,Check as nr,Loader2Icon as rr}from"lucide-react";import{jsx as Ae,jsxs as fa}from"react/jsx-runtime";var yo=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(a){throw console.error("Failed to copy text:",a),a}}static CopyToClipboard=({text:t,children:a,className:n,size:l="icon",variant:i="ghost"})=>{let[m,b]=ua(!1),[p,d]=ua(!1),c=async()=>{if(!(!t||p)){d(!0);try{await this.copyToClipboard(t),b(!0),setTimeout(()=>b(!1),2e3)}catch(N){console.error("Failed to copy text:",N)}finally{d(!1)}}};return fa(Ge,{children:[Ae(He,{asChild:!0,children:Ae(u,{variant:i,size:l,className:o(l==="icon"&&"size-6",n),onClick:c,disabled:p||!t,children:p?Ae(rr,{className:"animate-spin"}):m?Ae(nr,{className:"h-3 w-3"}):a||Ae(ar,{className:"h-3 w-3"})})}),Ae(je,{children:m?"Copied!":p?"Copying...":"Copy to clipboard"})]})};static formatINR(t,a={}){let{prefix:n="",suffix:l="",withSymbol:i=!0,compact:m=!1}=a;if(typeof t!="number"||isNaN(t))return`${n}${i?"\u20B9 ":""}0.00${l}`;let b=t<0,p=Math.abs(t),c=(m&&p>=1e5?this.compactFormatter:this.currencyFormatter).format(p).replace("\u20B9","");return`${n}${b?"- ":""}${i?"\u20B9 ":""}${c}${l}`}static formatDate(t,a={}){let{format:n="dd-mm-yyyy",separator:l="-"}=a,i=new Date(t);if(isNaN(i.getTime()))return"";let m=String(i.getDate()).padStart(2,"0"),b=String(i.getMonth()+1).padStart(2,"0"),p=this.MONTH_NAMES_SHORT[i.getMonth()],d=i.getFullYear();switch(n){case"dd-mmm-yyyy":return`${m}${l}${p}${l}${d}`;case"iso":return i.toISOString().split("T")[0];case"long":return i.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return i.toLocaleDateString("en-IN");default:return`${m}${l}${b}${l}${d}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((a,n,l)=>["-","'"," "].includes(a)||n>0&&["-","'"].includes(l[n-1])?a:a.charAt(0).toUpperCase()+a.slice(1)).join(""):""}static StatusBadge=({status:t,className:a,showDot:n=!0,capitalize:l=!0,size:i="md",variant:m="outline",customColors:b,icon:p,trueMessage:d="active",falseMessage:c="inactive"})=>{let N=typeof t=="boolean"?t?d:c:typeof t=="number"?t>0?d:c:t.toLowerCase(),T={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},A=T[N.toLowerCase()]||T.inactive,D=b||A[m],M={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},F=l?N.charAt(0).toUpperCase()+N.slice(1):N;return Ae("div",{className:"flex justify-center",children:fa("span",{className:o("inline-flex items-center gap-1.5 rounded-full border font-medium",D.bg,D.text,D.border,M[i],a),children:[n&&(p?Ae("span",{className:"flex items-center",children:p}):Ae("span",{className:o("size-2 rounded-full",D.dot),"aria-hidden":"true"})),F]})})}};import{AlertTriangleIcon as ir}from"lucide-react";import{useRouteError as sr,isRouteErrorResponse as lr,useNavigate as dr}from"react-router";import{Fragment as Co,jsx as ye,jsxs as vt}from"react/jsx-runtime";var ga=()=>{let e=sr(),t=dr();return ye("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:vt("div",{className:"flex flex-col items-center space-y-4 text-center",children:[ye(ir,{className:"h-16 w-16 text-destructive"}),lr(e)?vt(Co,{children:[vt("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?ye("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&ye("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?vt(Co,{children:[ye("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),ye("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&vt("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[ye("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),ye("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):vt(Co,{children:[ye("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),ye("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),ye(u,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};import{motion as Ie}from"framer-motion";import{jsx as H,jsxs as de}from"react/jsx-runtime";function cr({size:e=100,strokeWidth:t=2,color:a="currentColor",className:n=""}){return de(Ie.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:n,children:[H("title",{children:"Animated Checkmark"}),H(Ie.circle,{cx:"50",cy:"50",r:"40",stroke:a,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),H(Ie.path,{d:"M30 50L45 65L70 35",stroke:a,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function ba(){return H(Se,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:de(Te,{className:"space-y-4 flex flex-col items-center justify-center",children:[H(Ie.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:de("div",{className:"relative",children:[H(Ie.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),H(cr,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),de(Ie.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[H(Ie.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),H("div",{className:"flex items-center gap-4",children:H(Ie.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:de("div",{className:"flex flex-col items-start gap-2",children:[de("div",{className:"space-y-1.5",children:[de("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[de("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[H("title",{children:"From"}),H("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),de("div",{className:"flex items-center gap-2.5 group transition-all",children:[H("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),H("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),H("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),de("div",{className:"space-y-1.5",children:[de("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[de("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[H("title",{children:"To"}),H("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),de("div",{className:"flex items-center gap-2.5 group transition-all",children:[H("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),H("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),H(Ie.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}import{jsx as Xt,jsxs as mr}from"react/jsx-runtime";var va=()=>Xt("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:mr("div",{className:"flex flex-col items-center space-y-4",children:[Xt("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),Xt("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),Xt("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});import{useLocation as pr}from"react-router";import{GhostIcon as ur}from"lucide-react";import{NavLink as fr,useNavigate as gr}from"react-router";import{jsx as ht,jsxs as wo}from"react/jsx-runtime";var ha=()=>{let e=pr(),t=gr(),a=()=>{window.history.length>2?t(-1):t("/")};return wo("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[ht(ur,{className:"h-15 w-15 text-destructive mb-4"}),ht("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),wo("p",{className:"text-xl mb-4",children:["The page ",ht("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),wo("div",{className:"flex space-x-4",children:[ht(u,{variant:"outline",onClick:a,children:"Go Back"}),ht(u,{variant:"ghost",children:ht(fr,{to:"/",children:"Return Home"})})]})]})};import{WifiOffIcon as br}from"lucide-react";import{jsx as No,jsxs as vr}from"react/jsx-runtime";var xa=()=>vr("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[No(br,{className:"h-15 w-15 text-destructive mb-4"}),No("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),No("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});import{ShieldOffIcon as hr}from"lucide-react";import{NavLink as xr,useNavigate as yr}from"react-router";import{jsx as xt,jsxs as ya}from"react/jsx-runtime";var Ca=()=>{let e=yr();return ya("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[xt(hr,{className:"h-15 w-15 text-destructive mb-4"}),xt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),xt("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),ya("div",{className:"flex space-x-4",children:[xt(u,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),xt(u,{variant:"ghost",children:xt(xr,{to:"/",children:"Go to Home"})})]})]})};export{Qn as AppMetaProvider,ba as CurrencyTransfer,Ho as DataTable,$o as DataTableActionBar,Uo as DataTableActionBarAction,Wo as DataTableActionBarSelection,Ko as DataTemplate,Zo as DataTemplateActionBar,Qo as DataTemplateActionBarAction,ea as DataTemplateActionBarSelection,ga as ErrorComponent,yo as GeneralHelper,va as Loader,ha as NotFound,xa as OfflineUI,Ca as Unauthorized,Kn as createLayoutComponents,or as createPageTemplateHook,er as createTypedAppMetaContext};
|
|
2
|
+
import{flexRender as mo,getCoreRowModel as on,getFilteredRowModel as an,getPaginationRowModel as nn,getSortedRowModel as rn,useReactTable as sn}from"@tanstack/react-table";import{Loader2 as Vo,ChevronUp as po,ChevronDown as uo,ChevronsUpDown as ln,MoreHorizontal as dn,MoveRightIcon as cn,PinOffIcon as mn}from"lucide-react";import{Slot as Sa}from"radix-ui";import{cva as Ta}from"class-variance-authority";import{clsx as Na}from"clsx";import{twMerge as Pa}from"tailwind-merge";function o(...e){return Pa(Na(e))}import{jsx as Da}from"react/jsx-runtime";var _t=Ta("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 u({className:e,variant:t,size:a,asChild:n=!1,...l}){let i=n?Sa.Slot:"button";return Da(i,{"data-slot":"button",className:o(_t({variant:t,size:a,className:e}),"transition-none"),...l})}import{jsx as Ve}from"react/jsx-runtime";function eo({className:e,...t}){return Ve("div",{"data-slot":"table-container",className:"relative w-full overflow-auto max-h-full",children:Ve("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function So({className:e,...t}){return Ve("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function To({className:e,...t}){return Ve("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Do({className:e,...t}){return Ve("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function wt({className:e,...t}){return Ve("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ko({className:e,...t}){return Ve("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function Lt({className:e,...t}){return Ve("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as Ro}from"react/jsx-runtime";function Pe({className:e,...t}){return Ro("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 Se({className:e,...t}){return Ro("div",{"data-slot":"card-content",className:o("px-6",e),...t})}import{Tooltip as st}from"radix-ui";import{jsx as lt,jsxs as ka}from"react/jsx-runtime";function et({delayDuration:e=0,...t}){return lt(st.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ee({...e}){return lt(et,{children:lt(st.Root,{"data-slot":"tooltip",...e})})}function Ge({...e}){return lt(st.Trigger,{"data-slot":"tooltip-trigger",...e})}function He({className:e,sideOffset:t=0,children:a,...n}){return lt(st.Portal,{children:ka(st.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),...n,children:[a,lt(st.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Search as Fo,RefreshCw as ja,Download as $a,Settings2 as Ua,Filter as Bo,ArrowUpDown as Wa,PinOff as Ja,Pin as qa,ChevronDown as Xa}from"lucide-react";import{jsx as Ra}from"react/jsx-runtime";function dt({className:e,type:t,...a}){return Ra("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}import{Select as ue}from"radix-ui";import{CheckIcon as Ma,ChevronDownIcon as Mo,ChevronUpIcon as za}from"lucide-react";import{jsx as Z,jsxs as to}from"react/jsx-runtime";function je({...e}){return Z(ue.Root,{"data-slot":"select",...e})}function $e({...e}){return Z(ue.Value,{"data-slot":"select-value",...e})}function Ue({className:e,size:t="default",children:a,...n}){return to(ue.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),...n,children:[a,Z(ue.Icon,{asChild:!0,children:Z(Mo,{className:"size-4 opacity-50"})})]})}function We({className:e,children:t,position:a="popper",...n}){return Z(ue.Portal,{children:to(ue.Content,{"data-slot":"select-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...n,children:[Z(Aa,{}),Z(ue.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),Z(Ia,{})]})})}function Te({className:e,children:t,...a}){return to(ue.Item,{"data-slot":"select-item",className:o("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[Z("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:Z(ue.ItemIndicator,{children:Z(Ma,{className:"size-4"})})}),Z(ue.ItemText,{children:t})]})}function Aa({className:e,...t}){return Z(ue.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:Z(za,{className:"size-4"})})}function Ia({className:e,...t}){return Z(ue.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:Z(Mo,{className:"size-4"})})}import{DropdownMenu as De}from"radix-ui";import{CheckIcon as Fa,ChevronRightIcon as Xr,CircleIcon as Kr}from"lucide-react";import{jsx as xe,jsxs as Ba}from"react/jsx-runtime";function ke({...e}){return xe(De.Root,{"data-slot":"dropdown-menu",...e})}function Re({...e}){return xe(De.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Me({className:e,sideOffset:t=4,...a}){return xe(De.Portal,{children:xe(De.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...a})})}function oo({...e}){return xe(De.Group,{"data-slot":"dropdown-menu-group",...e})}function J({className:e,inset:t,variant:a="default",...n}){return xe(De.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function Ot({className:e,children:t,checked:a,...n}){return Ba(De.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...n,children:[xe("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:xe(De.ItemIndicator,{children:xe(Fa,{className:"size-4"})})}),t]})}function se({className:e,inset:t,...a}){return xe(De.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function le({className:e,...t}){return xe(De.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}import{useState as _o}from"react";import{useEffect as Ga,useState as io}from"react";import{Calendar as Ha}from"lucide-react";import{format as Nt}from"date-fns";import{Popover as Vt}from"radix-ui";import{jsx as Et}from"react/jsx-runtime";function ao({...e}){return Et(Vt.Root,{"data-slot":"popover",...e})}function no({...e}){return Et(Vt.Trigger,{"data-slot":"popover-trigger",...e})}function ro({className:e,align:t="center",sideOffset:a=4,...n}){return Et(Vt.Portal,{children:Et(Vt.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}import*as Gt from"react";import{ChevronDownIcon as _a,ChevronLeftIcon as La,ChevronRightIcon as Oa}from"lucide-react";import{DayPicker as Va,getDefaultClassNames as zo}from"react-day-picker";import{jsx as Je}from"react/jsx-runtime";function Ao({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:n="label",buttonVariant:l="ghost",formatters:i,components:m,...b}){let p=zo();return Je(Va,{showOutsideDays:a,className:o("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:n,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:o("w-fit",p.root),months:o("flex gap-4 flex-col md:flex-row relative",p.months),month:o("flex flex-col w-full gap-4",p.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",p.nav),button_previous:o(_t({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(_t({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",p.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",p.dropdowns),dropdown_root:o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",p.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",p.dropdown),caption_label:o("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:o("flex",p.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",p.weekday),week:o("flex w-full mt-2",p.week),week_number_header:o("select-none w-(--cell-size)",p.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",p.week_number),day:o("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",p.day),range_start:o("rounded-l-md bg-accent",p.range_start),range_middle:o("rounded-none",p.range_middle),range_end:o("rounded-r-md bg-accent",p.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:o("text-muted-foreground opacity-50",p.disabled),hidden:o("invisible",p.hidden),...t},components:{Root:({className:d,rootRef:c,...N})=>Je("div",{"data-slot":"calendar",ref:c,className:o(d),...N}),Chevron:({className:d,orientation:c,...N})=>c==="left"?Je(La,{className:o("size-4",d),...N}):c==="right"?Je(Oa,{className:o("size-4",d),...N}):Je(_a,{className:o("size-4",d),...N}),DayButton:Ea,WeekNumber:({children:d,...c})=>Je("td",{...c,children:Je("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:d})}),...m},...b})}function Ea({className:e,day:t,modifiers:a,...n}){let l=zo(),i=Gt.useRef(null);return Gt.useEffect(()=>{a.focused&&i.current?.focus()},[a.focused]),Je(u,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:o("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",l.day,e),...n})}import{jsx as tt,jsxs as Pt}from"react/jsx-runtime";function Io({value:e,onChange:t,placeholder:a,mode:n,externalSearch:l,onExternalChange:i,onlyExternal:m=!1}){let[b,p]=io(!1),[d,c]=io(e),[N,T]=io(e);Ga(()=>{m||T(e)},[e,m]);let A=()=>{m||t(d),T(d),l&&i&&i(d),p(!1)},D=()=>{c(N),p(!1)},M=()=>{let v=n==="single"?null:{from:null,to:null};c(v),m||t(v),T(v),l&&i&&i(v),p(!1)},F=()=>{let v=m?N:e;return v?n==="single"?Nt(v,"PPP"):v.from&&v.to?`${Nt(v.from,"MMM dd")} - ${Nt(v.to,"MMM dd, yyyy")}`:v.from?`From ${Nt(v.from,"MMM dd, yyyy")}`:v.to?`To ${Nt(v.to,"MMM dd, yyyy")}`:a:a},B=v=>{c(n==="single"?v:v||{from:null,to:null})};return Pt(ao,{open:b,onOpenChange:p,children:[tt(no,{asChild:!0,children:Pt(u,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!F()&&"text-muted-foreground"),children:[tt(Ha,{className:"mr-2 h-4 w-4"}),F()]})}),Pt(ro,{className:"w-auto p-0",align:"start",children:[tt("div",{className:"p-3",children:tt(Ao,{mode:n,selected:d,onSelect:B,numberOfMonths:n==="range"?2:1,className:"rounded-md border",...n==="range"&&{required:!0}})}),Pt("div",{className:"flex items-center justify-between p-3 border-t",children:[tt(u,{variant:"ghost",size:"sm",onClick:M,children:"Clear"}),Pt("div",{className:"flex gap-2",children:[tt(u,{variant:"outline",size:"sm",onClick:D,children:"Cancel"}),tt(u,{size:"sm",onClick:A,disabled:n==="range"&&(!d?.from||!d?.to),children:"Apply"})]})]})]})]})}import{Fragment as Ka,jsx as y,jsxs as G}from"react/jsx-runtime";function so({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:n,enableGlobalFilter:l=!0,onExport:i,onRefresh:m,loading:b=!1,enableColumnVisibility:p=!0,data:d,onClearSorting:c,onClearFilters:N,enableColumnPinning:T=!1,onExternalSearch:A,onCustomFilterChange:D}){let[M,F]=_o({}),[B,v]=_o({}),oe=()=>e.getAllLeafColumns().filter(r=>r.getCanHide?.()!==!1),h=()=>e.getAllColumns().filter(r=>!e.getAllLeafColumns().includes(r)&&r.columns?.length&&r.columns.some(C=>C.getCanHide?.()!==!1)),_=()=>{let r=new Set(h().flatMap(C=>C.columns?.filter(S=>S.getCanHide?.()!==!1).map(S=>S.id)||[]));return oe().filter(C=>!r.has(C.id))},fe=(r,C)=>C&&r.startsWith(`${C}.`)?r.replace(`${C}.`,"").split("_").map(Q=>Q.slice(1)).join(" "):r.split("_").map(S=>S.charAt(0).toUpperCase()+S.slice(1)).join(" "),ce=(r,C)=>{let S={...M,[r]:C};F(S)},ge=(r,C)=>{let S={...B,[r]:C};v(S),D&&D(r,C),t.find(Q=>Q.key===r)?.externalSearch&&ce(r,C)},Ie=()=>{A&&A(M)},W=()=>{F({}),v({}),N(),A&&A({}),D&&Object.keys(B).forEach(r=>{D(r,"")})},be=r=>t.find(S=>S.key===r)?.customFilter?B[r]??"":e.getColumn(r)?.getFilterValue(),q=(r,C)=>{let S=t.find(Q=>Q.key===r);S?.customFilter?ge(r,C):(e.getColumn(r)?.setFilterValue(C),S?.externalSearch&&ce(r,C))};return y("div",{className:"rounded-xl",children:y("div",{className:"px-2",children:y("div",{className:"flex flex-col gap-6",children:G("div",{className:"flex items-center justify-between",children:[y("div",{className:"flex items-center gap-3",children:t.length>0&&G("div",{className:"flex items-center gap-3 flex-wrap",children:[y("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:y(Bo,{className:"h-4 w-4"})}),t.map(r=>!e.getColumn(r.key)&&!r.customFilter&&!r.externalSearch?null:y("div",{className:o("relative min-w-[150px]",r.width),children:r.type==="select"?G(je,{value:be(r.key)??"",onValueChange:S=>{q(r.key,S==="all"?"":S)},children:[r.icon&&y("span",{children:y(r.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),y(Ue,{className:o("h-9 rounded-lg w-full",r.icon&&"pl-9"),children:y($e,{placeholder:r.placeholder})}),G(We,{className:"rounded-lg",children:[y(Te,{value:"all",children:"All"}),r.options?.map(S=>y(Te,{value:S.value,children:S.label},S.label))]})]}):r.type==="date"?y(Io,{value:be(r.key),onChange:S=>{r.onlyExternal||q(r.key,S)},placeholder:r.placeholder,mode:r.dateMode||"single",externalSearch:r.externalSearch,onlyExternal:r.onlyExternal,onExternalChange:S=>ce(r.key,S)}):G("div",{className:"relative",children:[r.icon&&y("span",{children:y(r.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),y(dt,{placeholder:r.placeholder,value:be(r.key)??"",onChange:S=>{q(r.key,S.target.value)},className:o("h-9 rounded-lg",r.icon&&"pl-9"),type:r.type==="number"?"number":"text"})]})},r.key)),(t.some(r=>r.externalSearch)||t.some(r=>r.customFilter))&&G(u,{variant:"default",size:"sm",onClick:Ie,className:"rounded-lg",children:[y(Fo,{className:"mr-2 h-4 w-4"}),t.find(r=>r.externalSearch||r.customFilter)?.searchButtonText||"Search"]})]})}),G("div",{className:"flex items-center gap-2",children:[l&&G("div",{className:"relative",children:[y(Fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),y(dt,{placeholder:"Global search...",value:a??"",onChange:r=>n(r.target.value),className:"pl-9 max-w-max"})]}),i&&G(u,{variant:"outline",size:"sm",onClick:()=>i(d),className:"rounded-lg",children:[y($a,{className:"mr-2 h-4 w-4"}),"Export"]}),p&&G(ke,{children:[y(Re,{asChild:!0,children:G(u,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[y("span",{children:"Columns"}),y(Xa,{className:"h-4 w-4 opacity-50"})]})}),G(Me,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[y(se,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),y(le,{}),_().length>0&&G(oo,{children:[y(se,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),_().map(r=>y(Ot,{className:"text-sm",checked:r.getIsVisible(),onCheckedChange:C=>r.toggleVisibility(!!C),children:fe(r.id)},r.id))]}),h().map(r=>G(oo,{children:[y(le,{}),y(se,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:r.id}),r.columns?.filter(C=>C.getCanHide?.()!==!1).map(C=>y(Ot,{className:"text-sm",checked:C.getIsVisible(),onCheckedChange:S=>C.toggleVisibility(!!S),children:fe(C.id,r.id)},C.id))]},r.id))]})]}),G(ke,{children:[y(Re,{asChild:!0,children:y(u,{variant:"outline",size:"sm",className:"rounded-lg",children:y(Ua,{className:"h-4 w-4"})})}),G(Me,{align:"end",className:"w-[200px] rounded-lg",children:[y(se,{children:"Table Settings"}),y(le,{}),G(J,{onClick:c,children:[y(Wa,{className:"mr-2 h-4 w-4"}),"Clear All Sorting"]}),G(J,{onClick:W,children:[y(Bo,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]}),T&&G(Ka,{children:[y(le,{}),y(se,{children:"Column Pinning"}),G(J,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[y(Ja,{className:"mr-2 h-4 w-4"}),"Reset All Pinning"]}),G(J,{onClick:()=>{let r=oe().filter(C=>C.getCanPin?.()!==!1).map(C=>C.id);e.setColumnPinning({left:[],right:r})},children:[y(qa,{className:"mr-2 h-4 w-4 -rotate-90"}),"Pin All Right"]})]})]})]}),m&&y(u,{variant:"outline",size:"sm",onClick:m,disabled:b,className:"rounded-lg",children:y(ja,{className:o("h-4 w-4",b&&"animate-spin")})})]})]})})})})}import{jsx as ne,jsxs as ct}from"react/jsx-runtime";function lo({table:e,config:t}){return t.enabled?ne("div",{className:"rounded-xl",children:ne("div",{children:ct("div",{className:"flex items-center justify-between",children:[ne("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&ct("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"]})}),ct("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&ct("div",{className:"flex items-center gap-2",children:[ne("span",{className:"text-sm font-medium",children:"Rows per page:"}),ct(je,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[ne(Ue,{className:"h-9 w-[70px] rounded-lg",children:ne($e,{})}),ne(We,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>ne(Te,{value:`${a}`,children:a},a))})]})]}),ct("div",{className:"flex items-center gap-2",children:[ne(u,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),ne(u,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&ne("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,n)=>{let l=e.getState().pagination.pageIndex,i=l+n;return i<1||i>e.getPageCount()?null:ne(u,{variant:i===l+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(i-1),children:i},i)})}),ne(u,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),ne(u,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}import{Toggle as Ya}from"radix-ui";import{cva as Za}from"class-variance-authority";import{jsx as en}from"react/jsx-runtime";var Qa=Za("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 Lo({className:e,variant:t,size:a,noBg:n,...l}){return en(Ya.Root,{"data-slot":"toggle",className:o(Qa({className:e,variant:t,size:a,bg:n?"disabled":"enabled"})),...l})}import{Checkbox as Oo}from"radix-ui";import{CheckIcon as tn}from"lucide-react";import{jsx as co}from"react/jsx-runtime";function St({className:e,...t}){return co(Oo.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:co(Oo.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:co(tn,{className:"size-3.5"})})})}import{useCallback as Ht,useEffect as jt,useMemo as Eo,useState as qe}from"react";import{Fragment as Go,jsx as f,jsxs as $}from"react/jsx-runtime";function Ho({data:e,columns:t,filters:a=[],pagination:n={enabled:!1},settings:l={},header:i,footer:m,className:b="",maxHeight:p="600px",loading:d=!1,error:c,emptyMessage:N="No data available",onRowSelectionChange:T,onExport:A,onRefresh:D,onTableReady:M,children:F,isRowDisabled:B,isRowSelectable:v,onExternalSearch:oe}){let[h,_]=qe([]),[fe,ce]=qe([]),[ge,Ie]=qe({}),[W,be]=qe({}),[q,r]=qe(""),[C,S]=qe([]),[Q,Mt]=qe(l.enableColumnPinning?{left:[],right:[]}:{}),[we,zt]=qe({}),Ze=(w,P)=>P.split(".").reduce((s,k)=>s&&s[k],w),ht=Eo(()=>Object.keys(we).length===0?e:e.filter(w=>Object.entries(we).every(([P,s])=>{if(!s||s==="")return!0;let k=Ze(w,P);return typeof s=="string"?String(k).toLowerCase().includes(s.toLowerCase()):k===s})),[e,we]),{enableSorting:me=!0,enableFiltering:Fe=!0,enableGlobalFilter:Qe=!0,enableColumnVisibility:Be=!0,enableRowSelection:O=!0,stickyHeader:qt=!0,toolbar:At=!1,showSerialNumbers:_e=!0,fixedCheckboxColumn:E=!0,striped:It=!0,hoverable:Xt=!0,compact:nt=!0,bordered:xt=!0,fullHeight:Kt=!1,enableColumnResizing:Ft=!1,enableColumnPinning:Y=!0,hideHeader:Yt=!1,selectionMode:ve="multiple",showCheckBox:yt=!0,checkboxColumnPosition:Bt=0}=l,Zt=Ht((w,P)=>{zt(s=>{let k={...s};return P===""||P===null||P===void 0?delete k[w]:k[w]=P,k})},[]),Ct=Eo(()=>{let w=[...t],P=x=>x.map(I=>{if(I.id==="select"||I.id==="serialNumber")return I;let X={...I,enablePinning:!0};return I.columns&&(X.columns=P(I.columns)),X}),s=P(w),k={id:"select",header:({table:x})=>{if(ve==="single")return null;let I=x.getRowModel().rows.filter(pe=>!B?.(pe.original)&&(v?v(pe.original):!0)),X=I.length>0&&I.every(pe=>pe.getIsSelected()),he=I.some(pe=>pe.getIsSelected());return f(St,{checked:X||he&&"indeterminate",onCheckedChange:pe=>{I.forEach(rt=>rt.toggleSelected(!!pe))},"aria-label":"Select all selectable rows"})},cell:({row:x})=>{let I=B?B(x.original):!1,X=v?v(x.original):!0;return f("div",{className:o("flex items-center justify-center",I&&"opacity-50"),children:ve==="multiple"?f(St,{checked:x.getIsSelected(),onCheckedChange:he=>X&&x.toggleSelected(!!he),"aria-label":"Select row",disabled:I||!X}):yt?f("input",{type:"radio",checked:x.getIsSelected(),onChange:()=>X&&x.toggleSelected(!0),disabled:I||!X,className:"h-4 w-4 rounded-full border-primary text-primary focus:ring-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:ve==="multiple"?40:30};if(O){let x=Bt;x<0&&(x=s.length+x+1),x=Math.max(0,Math.min(x,s.length)),s.splice(x,0,k)}if(_e){let x={id:"serialNumber",header:"No.",cell:({row:I})=>f("div",{className:"text-center font-medium text-muted-foreground",children:I.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};s.unshift(x)}return s},[t,_e,O,E,B,v,ve,Bt]),g=sn({data:ht,columns:Ct,onSortingChange:me?_:void 0,onColumnFiltersChange:Fe?ce:void 0,onGlobalFilterChange:Qe?r:void 0,getCoreRowModel:on(),getPaginationRowModel:n.enabled?nn():void 0,getSortedRowModel:me?rn():void 0,getFilteredRowModel:Fe?an():void 0,onColumnVisibilityChange:Be?Ie:void 0,onRowSelectionChange:O?be:void 0,onColumnOrderChange:S,onColumnPinningChange:Y?Mt:void 0,state:{sorting:me?h:void 0,columnFilters:Fe?fe:void 0,columnVisibility:Be?ge:void 0,rowSelection:O?W:{},globalFilter:q,columnOrder:C,columnPinning:Y?Q:{}},initialState:{pagination:n.enabled?{pageSize:n.pageSize||10}:void 0,columnPinning:Y?{left:[..._e?["serialNumber"]:[],...O?["select"]:[]],right:[]}:void 0},enableRowSelection:O,enableColumnResizing:Ft,enableColumnPinning:Y,columnResizeMode:"onChange"});jt(()=>{if(O&&T){let w=g.getFilteredSelectedRowModel().rows.filter(P=>!B?.(P.original)&&(v?v(P.original):!0)).map(P=>P.original);T(w)}},[W,O,T,g,B,v]);let L=Ht(w=>{ve==="single"?(g.resetRowSelection(),w.toggleSelected(!0)):w.toggleSelected()},[ve,g]);jt(()=>{M&&M(g)},[g,M]),jt(()=>{if(O&&T){let w=g.getFilteredSelectedRowModel().rows.map(P=>P.original);T(w)}},[W,O,T,g]),jt(()=>{if(O&&T){let w=g.getFilteredSelectedRowModel().rows.filter(P=>!B?.(P.original)&&(v?v(P.original):!0)).map(P=>P.original);T(w)}},[W,O,T,g,B,v]);let z=Ht(()=>{_([])},[]),ie=Ht(()=>{ce([]),r("")},[]),ae=(w,P)=>{if(!Y)return;let s=[..._e?["serialNumber"]:[],...O&&E?["select"]:[]],k={left:[...(Q.left??[]).filter(x=>s.includes(x))],right:[...Q.right??[]]};P===!1?(k.left=k.left.filter(x=>x!==w),k.right=k.right.filter(x=>x!==w)):P==="right"?(k.left=k.left.filter(x=>x!==w),k.right.includes(w)||k.right.push(w)):P==="left"&&(k.right=k.right.filter(x=>x!==w),!k.left.includes(w)&&!s.includes(w)&&k.left.push(w)),g.setColumnPinning(k)},Ne=()=>f(So,{className:o(qt&&"sticky top-0 bg-sidebar z-20"),children:g.getHeaderGroups().map((w,P)=>f(wt,{className:"hover:bg-transparent",children:w.headers.map((s,k)=>{let x=s.depth===0&&s.colSpan>1,I=Y&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&O),X=Y&&s.column.getIsPinned()==="right",he=s.column.getCanSort(),pe=Y&&s.column.columnDef.enablePinning!==!1,rt=s.column.id==="serialNumber",Qt=s.column.id==="select",Po=rt||Qt&&E,it=s.column.columnDef.headerAlign||"left",wa={left:"justify-start",center:"justify-center",right:"justify-end"}[it];return $(ko,{colSpan:s.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!nt&&"py-2",xt&&k<w.headers.length-1&&"border-r","relative",I&&"sticky left-0 z-15 bg-sidebar",X&&"sticky right-0 z-15 bg-sidebar",(rt||Qt)&&"sticky left-0 z-15 bg-sidebar",x?"text-center":"text-left"),style:{width:s.getSize()!==150?s.getSize():"auto",minWidth:s.getSize()!==150?s.getSize():"auto",...I&&{left:rt?0:Qt?_e&&g.getColumn("serialNumber")?.getSize()||0:Le(s.column)},...X&&{right:Oe(s.column)},...rt&&{left:0}},children:[x?f("div",{className:"flex items-center justify-center",children:mo(s.column.columnDef.header,s.getContext())}):$("div",{className:o("relative flex items-center w-full px-2",wa),children:[$("div",{className:"flex items-center gap-1",children:[he&&it==="right"&&f("span",{className:"ml-1 order-2",children:s.column.getIsSorted()&&{asc:f(po,{className:"h-4 w-4"}),desc:f(uo,{className:"h-4 w-4"})}[s.column.getIsSorted()]}),s.isPlaceholder?null:mo(s.column.columnDef.header,s.getContext()),he&&it!=="right"&&s.column.getIsSorted()&&f("span",{className:"ml-1 order-2",children:s.column.getIsSorted()&&{asc:f(po,{className:"h-4 w-4"}),desc:f(uo,{className:"h-4 w-4"})}[s.column.getIsSorted()]})]}),(he||pe&&!Po)&&$(ke,{children:[f(Re,{asChild:!0,className:o("absolute",it==="left"&&"right-1",it==="center"&&"right-1",it==="right"&&"left-1"),children:f(Lo,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:f(dn,{className:"h-4 w-4"})})}),$(Me,{align:"end",className:"w-48",children:[he&&$(Go,{children:[f(se,{children:"Sorting"}),$(J,{onClick:()=>s.column.toggleSorting(!1),children:[f(po,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),$(J,{onClick:()=>s.column.toggleSorting(!0),children:[f(uo,{className:"mr-2 h-4 w-4"}),"Sort Descending"]}),$(J,{onClick:()=>s.column.clearSorting(),disabled:!s.column.getIsSorted(),children:[f(ln,{className:"mr-2 h-4 w-4"}),"Clear Sort"]}),f(le,{})]}),pe&&!Po&&$(Go,{children:[f(se,{children:"Pin Column"}),$(J,{onClick:()=>ae(s.column.id,"right"),disabled:s.column.getIsPinned()==="right",children:[f(cn,{}),"Pin Right"]}),$(J,{onClick:()=>ae(s.column.id,!1),disabled:!s.column.getIsPinned(),children:[f(mn,{}),"Unpin"]})]})]})]})]}),Ft&&s.column.getCanResize()&&!x&&s.colSpan===1&&f("div",{className:"absolute right-0 top-0 h-full w-1 bg-border hover:bg-primary cursor-col-resize opacity-0 hover:opacity-100 transition-opacity",onMouseDown:s.getResizeHandler()})]},s.id)})},w.id))}),Le=w=>{if(!Y)return;let P=0,s=g.getLeftHeaderGroups()[0]?.headers||[],k=[..._e?["serialNumber"]:[],...O?["select"]:[]];for(let x of s){if(x.id===w.id)break;if(k.includes(x.id)){let I=g.getColumn(x.id);I&&(P+=I.getSize())}}return P},Oe=w=>{if(!Y)return;let P=g.getState().columnPinning.right||[],s=P.indexOf(w.id);if(s===-1)return;let k=0;for(let x=s+1;x<P.length;x++){let I=g.getColumn(P[x]);I&&(k+=I.getSize())}return k};return c?f(Pe,{className:"w-full rounded-xl shadow-sm",children:f(Se,{className:"flex items-center justify-center",children:$("div",{className:"text-center",children:[f("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),f("p",{className:"text-sm text-muted-foreground mb-4",children:c}),D&&$(u,{variant:"outline",size:"sm",onClick:D,className:"rounded-lg",children:[f(Vo,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):f(et,{children:$("div",{className:o("w-full space-y-2 flex flex-col h-full",b),children:[i&&f(Pe,{className:"rounded-2xl py-2 sticky top-0 z-20",children:f(Se,{className:"px-2",children:i})}),At&&f(so,{table:g,filters:a,globalFilter:q,onGlobalFilterChange:r,enableGlobalFilter:Qe,onExport:A,onRefresh:D,loading:d,enableColumnVisibility:Be,enableColumnPinning:Y,data:ht,onClearSorting:z,onClearFilters:ie,onExternalSearch:oe,onCustomFilterChange:Zt}),f(Pe,{className:o("shadow-sm overflow-auto py-0",Kt&&"flex-1"),children:f(Se,{className:"p-0 h-full",children:$("div",{className:"relative flex flex-col h-full justify-between",children:[d&&f("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl",children:$("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[f(Vo,{className:"size-5 animate-spin text-primary"}),f("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),f("div",{className:"relative rounded-t-xl overflow-auto border-b",children:$(eo,{className:"border-collapse w-full",children:[!Yt&&Ne(),f(To,{children:g.getRowModel().rows?.length?g.getRowModel().rows.map((w,P)=>f(wt,{"data-state":w.getIsSelected()&&"selected",className:o(Xt&&"hover:bg-muted/50",It&&P%2===0&&"bg-muted/20",w.getIsSelected()&&"bg-muted","border-b last:border-b-0",ve==="single"&&"cursor-pointer"),onClick:()=>{ve==="single"&&L(w)},children:w.getVisibleCells().map((s,k)=>{let x=Y&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&O),I=Y&&s.column.getIsPinned()==="right",X=s.column.id==="serialNumber",he=s.column.id==="select",pe=X||he&&E;return f(Lt,{className:o(nt?"py-2":"py-4",xt&&k<w.getVisibleCells().length&&"border-r",x&&"sticky left-0 z-10 bg-sidebar/97",I&&"sticky right-0 z-10 bg-sidebar/97",X&&"sticky left-0 z-10 bg-sidebar/97","p-1"),style:{width:s.column.getSize()!==150?s.column.getSize():"auto",minWidth:s.column.getSize()!==150?s.column.getSize():"auto",...x&&{left:X?0:he?_e&&g.getColumn("serialNumber")?.getSize()||0:Le(s.column)},...I&&{right:Oe(s.column)},...X&&{left:0}},children:mo(s.column.columnDef.cell,s.getContext())},s.id)})},w.id)):f(wt,{children:f(Lt,{colSpan:Ct.length,className:"h-32 text-center border-0",children:$("div",{className:"flex flex-col items-center gap-3",children:[f("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),f("p",{className:"text-muted-foreground font-medium",children:N})]})})})})]})}),m&&f("div",{className:"sticky bottom-0 bg-sidebar w-full z-20",style:{width:"100%",minWidth:"fit-content"},children:f(eo,{children:f(Do,{children:f(wt,{className:"bg-sidebar",children:f(Lt,{colSpan:Ct.length,className:"p-2",children:m})})})})})]})})}),f(lo,{table:g,config:n}),F&&F(g)]})})}import{Separator as pn}from"radix-ui";import{jsx as un}from"react/jsx-runtime";function Tt({className:e,orientation:t="horizontal",decorative:a=!0,...n}){return un(pn.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}import{Loader as fn,X as gn}from"lucide-react";import{AnimatePresence as bn,motion as vn}from"framer-motion";import*as Xe from"react";import*as jo from"react-dom";import{jsx as ee,jsxs as Dt}from"react/jsx-runtime";function $o({table:e,visible:t,container:a,children:n,className:l,...i}){let[m,b]=Xe.useState(!1);Xe.useLayoutEffect(()=>{b(!0)},[]),Xe.useEffect(()=>{function c(N){N.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=t??e.getFilteredSelectedRowModel().rows.length>0;return jo.createPortal(ee(bn,{children:d&&ee(vn.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",l),...i,children:ee(et,{children:n})})}),p)}function Uo({size:e="sm",tooltip:t,isPending:a,disabled:n,className:l,children:i,...m}){let b=ee(u,{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",l),disabled:n||a,...m,children:a?ee(fn,{className:"animate-spin"}):i});return t?Dt(Ee,{children:[ee(Ge,{asChild:!0,children:b}),ee(He,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:ee("p",{children:t})})]}):b}function Wo({table:e}){let t=Xe.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?Dt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[Dt("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),ee(Tt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),Dt(Ee,{children:[ee(Ge,{asChild:!0,children:ee(u,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:ee(gn,{className:"size-3.5"})})}),Dt(He,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[ee("p",{children:"Clear selection"}),ee("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:ee("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{ArrowUpDown as ys,EyeOff as Cs}from"lucide-react";import{jsx as Ts,jsxs as Ds}from"react/jsx-runtime";import{ChevronDown as Ms,Eye as zs}from"lucide-react";import{jsx as Bs,jsxs as _s}from"react/jsx-runtime";import{Slot as Vs}from"radix-ui";import{cva as hn}from"class-variance-authority";import{jsx as $s}from"react/jsx-runtime";var Hs=hn("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"}});import{Command as sl}from"cmdk";import{SearchIcon as dl}from"lucide-react";import{Dialog as Js}from"radix-ui";import{XIcon as Xs}from"lucide-react";import{jsx as Zs,jsxs as Qs}from"react/jsx-runtime";import{jsx as ul,jsxs as fl}from"react/jsx-runtime";import{CheckIcon as zl,PlusCircleIcon as Al}from"lucide-react";import{Fragment as _l,jsx as Fl,jsxs as Bl}from"react/jsx-runtime";import{useState as Ke,useEffect as qo,useMemo as go,useCallback as mt,useRef as Mn}from"react";import{Loader2 as Xo}from"lucide-react";import{Search as xn,Download as yn,RefreshCw as Cn,Filter as wn,ChevronDown as Nn,Settings2 as Pn}from"lucide-react";import{Fragment as Sn,jsx as R,jsxs as K}from"react/jsx-runtime";function fo({fields:e,filters:t,globalFilter:a,onGlobalFilterChange:n,fieldFilters:l,onFieldFilterChange:i,sortField:m,sortDirection:b,onSortChange:p,selectedCount:d,totalCount:c,visibleCount:N,onExport:T,onRefresh:A,loading:D,onClearFilters:M,onClearSorting:F}){let B=e.filter(h=>h.sortable),v=Object.values(l).some(h=>h!=null&&h!=="")||a!=="",oe=m!=="";return R("div",{className:"rounded-xl p-0.5",children:R("div",{className:"px-2",children:R("div",{className:"flex flex-col gap-6",children:K("div",{className:"flex items-center justify-between",children:[R("div",{className:"flex items-center gap-3",children:t.length>0&&K("div",{className:"flex items-center gap-3 flex-wrap",children:[R("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:R(wn,{className:"h-4 w-4"})}),t.map(h=>R("div",{className:"relative min-w-[150px]",children:h.type==="select"?K(je,{value:l[h.key]||"all",onValueChange:_=>i(h.key,_),children:[h.icon&&R(h.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),R(Ue,{className:o("h-9 rounded-lg w-full",h.icon&&"pl-9"),children:R($e,{placeholder:h.placeholder||"Select..."})}),K(We,{className:"rounded-lg",children:[R(Te,{value:"all",children:"All"}),h.options?.map(_=>R(Te,{value:_.value,children:_.label},_.value))]})]}):K("div",{className:"relative",children:[h.icon&&R(h.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),R(dt,{type:h.type,placeholder:h.placeholder,value:l[h.key]||"",onChange:_=>i(h.key,_.target.value),className:o("h-9 rounded-lg",h.icon&&"pl-9")})]})},String(h.key)))]})}),K("div",{className:"flex items-center gap-2",children:[K("div",{className:"relative",children:[R(xn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),R(dt,{placeholder:"Global search...",value:a,onChange:h=>n(h.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),B.length>0&&K(ke,{children:[R(Re,{asChild:!0,children:K(u,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[R("span",{children:"Sort"}),R(Nn,{className:"h-4 w-4 opacity-50"})]})}),K(Me,{align:"end",className:"w-[200px] rounded-lg",children:[R(se,{children:"Sort By"}),R(le,{}),B.map(h=>K("div",{children:[K(J,{onClick:()=>p(h.key,"asc"),children:[h.label," (A-Z)"]}),K(J,{onClick:()=>p(h.key,"desc"),children:[h.label," (Z-A)"]})]},String(h.key))),oe&&K(Sn,{children:[R(le,{}),R(J,{onClick:F,children:"Clear All Sorting"})]})]})]}),K(ke,{children:[R(Re,{asChild:!0,children:R(u,{variant:"outline",size:"sm",className:"rounded-lg",children:R(Pn,{className:"h-4 w-4"})})}),K(Me,{align:"end",className:"w-[200px] rounded-lg",children:[R(se,{children:"Table Settings"}),R(le,{}),R(J,{onClick:F,children:"Clear All Sorting"}),R(J,{onClick:M,children:"Clear All Filters"})]})]}),T&&K(u,{variant:"outline",size:"sm",onClick:T,className:"rounded-lg",children:[R(yn,{className:"mr-2 h-4 w-4"}),"Export"]}),A&&R(u,{variant:"outline",size:"sm",onClick:A,disabled:D,className:"rounded-lg",children:R(Cn,{className:o("h-4 w-4",D&&"animate-spin")})})]})]})})})})}import{ChevronLeft as Tn,ChevronRight as Dn,ChevronsLeft as kn,ChevronsRight as Rn}from"lucide-react";import{jsx as H,jsxs as ye}from"react/jsx-runtime";function Jo({currentPage:e,totalPages:t,pageSize:a,totalItems:n,onPageChange:l,onPageSizeChange:i,config:m}){if(!m.enabled)return null;let b=m.pageSizeOptions||[10,20,50,100],p=(e-1)*a+1,d=Math.min(e*a,n),c=e>1,N=e<t,T=()=>{let D=[],M=[];for(let F=Math.max(2,e-2);F<=Math.min(t-1,e+2);F++)D.push(F);return e-2>2?M.push(1,"..."):M.push(1),M.push(...D),e+2<t-1?M.push("...",t):t>1&&M.push(t),M};return H("div",{className:"rounded-xl",children:ye("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[H("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:m.showInfo!==!1&&ye("span",{children:["Showing ",p," to ",d," of ",n," entries"]})}),ye("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[b&&ye("div",{className:"flex items-center gap-2",children:[H("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),ye(je,{value:`${a}`,onValueChange:A=>i(Number(A)),children:[H(Ue,{className:"h-9 w-[70px] rounded-lg",children:H($e,{})}),H(We,{side:"top",className:"rounded-lg",children:b.map(A=>H(Te,{value:`${A}`,children:A},A))})]})]}),ye("div",{className:"flex items-center gap-2",children:[ye(u,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:!c,className:"hidden sm:flex rounded-lg",children:[H(kn,{className:"h-4 w-4"}),H("span",{className:"sr-only",children:"Go to first page"})]}),ye(u,{variant:"outline",size:"sm",onClick:()=>l(e-1),disabled:!c,className:"rounded-lg",children:[H(Tn,{className:"h-4 w-4 sm:mr-2"}),H("span",{className:"hidden sm:inline",children:"Previous"}),H("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),m.showPageNumbers&&t>1&&H("div",{className:"hidden sm:flex items-center gap-1",children:T().map((A,D)=>{if(A==="...")return H("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${D}`);let M=A;return H(u,{variant:M===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>l(M),children:M},M)})}),ye("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),ye(u,{variant:"outline",size:"sm",onClick:()=>l(e+1),disabled:!N,className:"rounded-lg",children:[H("span",{className:"hidden sm:inline",children:"Next"}),H(Dn,{className:"h-4 w-4 sm:ml-2"}),H("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),ye(u,{variant:"outline",size:"sm",onClick:()=>l(t),disabled:!N,className:"hidden sm:flex rounded-lg",children:[H(Rn,{className:"h-4 w-4"}),H("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}import{jsx as V,jsxs as ot}from"react/jsx-runtime";function Ko({data:e,template:t,fields:a=[],filters:n=[],pagination:l={enabled:!1},settings:i={},header:m,footer:b,className:p="",loading:d=!1,error:c,emptyMessage:N="No items found",emptyIcon:T,onSelectionChange:A,onExport:D,onRefresh:M,onTemplateReady:F,children:B}){let{enableSorting:v=!0,enableFiltering:oe=!0,enableGlobalSearch:h=!0,enableSelection:_=!1,enableExport:fe=!1,toolbar:ce=!0,selectionMode:ge="multiple",gridCols:Ie={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:W=4,aspectRatio:be="auto",minCardWidth:q=350,maxCardWidth:r=350}=i,[C,S]=Ke(""),[Q,Mt]=Ke({}),[we,zt]=Ke(""),[Ze,ht]=Ke("asc"),[me,Fe]=Ke(new Set),[Qe,Be]=Ke(1),[O,qt]=Ke(l.pageSize||12),[At,_e]=Ke(Ie.default),E=go(()=>{let g=[...e];if(h&&C){let L=a.filter(z=>z.searchable!==!1);g=g.filter(z=>L.some(ie=>z[ie.key]?.toString().toLowerCase().includes(C.toLowerCase())))}if(oe&&Object.keys(Q).forEach(L=>{let z=Q[L];if(z!=null&&z!==""){let ie=a.find(ae=>ae.key===L);ie&&(g=g.filter(ae=>{let Ne=ae[L];return ie.type==="boolean"?Ne===(z==="true"):ie.type==="number"?Ne===Number(z):Ne?.toString().toLowerCase().includes(String(z).toLowerCase())}))}}),v&&we){let L=a.find(z=>z.key===we);L&&g.sort((z,ie)=>{let ae=z[we],Ne=ie[we];if(L.type==="number")return Ze==="asc"?Number(ae)-Number(Ne):Number(Ne)-Number(ae);if(L.type==="date"){let Le=new Date(ae),Oe=new Date(Ne);return Ze==="asc"?Le.getTime()-Oe.getTime():Oe.getTime()-Le.getTime()}else{let Le=String(ae).toLowerCase(),Oe=String(Ne).toLowerCase();return Ze==="asc"?Le.localeCompare(Oe):Oe.localeCompare(Le)}})}return g},[e,C,Q,we,Ze,a,h,oe,v]),It=go(()=>{if(!l.enabled)return E;let g=(Qe-1)*O,L=g+O;return E.slice(g,L)},[E,Qe,O,l.enabled]),Xt=Math.ceil(E.length/O),nt=mt(g=>{_&&Fe(L=>{let z=new Set(L);return ge==="single"?(z.clear(),z.add(g)):z.has(g)?z.delete(g):z.add(g),z})},[_,ge]),xt=mt(()=>{!_||ge==="single"||(me.size===E.length?Fe(new Set):Fe(new Set(E.map((g,L)=>L))))},[_,ge,me.size,E.length]),Kt=mt((g,L)=>{Mt(z=>({...z,[g]:L})),Be(1)},[]),Ft=mt((g,L)=>{zt(g),ht(L)},[]),Y=mt(()=>{S(""),Mt({}),Be(1)},[]),Yt=mt(()=>{zt(""),ht("asc")},[]),ve=go(()=>({getSelectedItems:()=>Array.from(me).map(g=>E[g]),clearSelection:()=>Fe(new Set),selectAll:xt,getFilteredData:()=>E,getTotalCount:()=>e.length,getVisibleCount:()=>E.length,refresh:()=>M?.(),exportData:()=>D?.(E)}),[me,E,e.length,xt,M,D]),yt=Mn(null);yt.current=ve,qo(()=>{F&&yt.current&&F(yt.current)},[]),qo(()=>{if(_&&A){let g=Array.from(me).map(L=>E[L]);A(g)}},[me]);let Bt=o("w-full","overflow-hidden",p),Zt=o("grid",`gap-${W}`,"w-full","mx-auto","items-start"),Ct={gridTemplateColumns:At===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${q}px, calc(100%/${At} - ${W*4}px), ${r}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return c?V(Pe,{className:"w-full",children:V(Se,{className:"flex items-center justify-center py-12",children:ot("div",{className:"text-center",children:[V("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),V("p",{className:"text-sm text-muted-foreground mb-4",children:c}),M&&ot(u,{variant:"outline",size:"sm",onClick:M,children:[V(Xo,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):ot("div",{className:o("w-full flex gap-2 flex-col h-full",Bt),children:[m&&V(Pe,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:V(Se,{className:"p-2",children:m})}),ce&&V(fo,{fields:a,filters:n,globalFilter:C,onGlobalFilterChange:S,fieldFilters:Q,onFieldFilterChange:Kt,sortField:we,sortDirection:Ze,onSortChange:Ft,selectedCount:me.size,totalCount:e.length,visibleCount:E.length,onExport:fe?()=>D?.(E):void 0,onRefresh:M,loading:d,onClearFilters:Y,onClearSorting:Yt}),V(Pe,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:V(Se,{className:"px-0",children:ot("div",{className:"relative",children:[d&&V("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:ot("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[V(Xo,{className:"size-5 animate-spin text-primary"}),V("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),It.length>0?V("div",{className:o(Zt),style:Ct,children:It.map((g,L)=>{let z=l.enabled?(Qe-1)*O+L:L,ie=me.has(z);return ot("div",{className:o("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",be==="square"?"aspect-square":"",be==="video"?"aspect-video":"",_?"cursor-pointer":"",ie?"ring-2 ring-primary":""),onClick:()=>_&&nt(z),children:[_&&ge==="multiple"&&V("div",{className:"absolute top-2 right-2 z-10",children:V(St,{checked:ie,onCheckedChange:()=>nt(z),className:"bg-background/80 backdrop-blur-sm",onClick:ae=>ae.stopPropagation()})}),t(g,L,ie,()=>nt(z))]},z)})}):ot("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[V("div",{className:"text-6xl",children:T||"\u{1F4CB}"}),V("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:N}),(C||Object.values(Q).some(g=>g))&&V(u,{variant:"outline",onClick:Y,children:"Clear Filters"})]})]})})}),l.enabled&&V("div",{className:"pb-1",children:V(Jo,{currentPage:Qe,totalPages:Xt,pageSize:O,totalItems:E.length,onPageChange:Be,onPageSizeChange:g=>{qt(g),Be(1)},config:l})}),b&&V("div",{className:"p-2 m-0.5",children:b}),B&&B(ve)]})}import{Loader as zn,X as An}from"lucide-react";import{AnimatePresence as In,motion as Fn}from"framer-motion";import*as Ye from"react";import*as Yo from"react-dom";import{jsx as te,jsxs as kt}from"react/jsx-runtime";function Zo({controller:e,visible:t,container:a,children:n,className:l,...i}){let[m,b]=Ye.useState(!1);Ye.useLayoutEffect(()=>{b(!0)},[]),Ye.useEffect(()=>{function N(T){T.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=e.getSelectedItems(),c=t??d.length>0;return Yo.createPortal(te(In,{children:c&&te(Fn.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-8 ring-primary/5",l),...i,children:te(et,{children:n})})}),p)}function Qo({size:e="sm",variant:t="secondary",tooltip:a,isPending:n,disabled:l,className:i,children:m,onClick:b,...p}){let d=te(u,{variant:t,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",i),disabled:l||n,onClick:b,...p,children:n?te(zn,{className:"animate-spin"}):m});return a?kt(Ee,{children:[te(Ge,{asChild:!0,children:d}),te(He,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:te("p",{children:a})})]}):d}function ea({controller:e}){let t=Ye.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let a=e.getSelectedItems();return kt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[kt("span",{className:"whitespace-nowrap text-sm font-medium",children:[a.length," selected"]}),te(Tt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),kt(Ee,{children:[te(Ge,{asChild:!0,children:te(u,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:te(An,{className:"size-3.5"})})}),kt(He,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[te("p",{children:"Clear selection"}),te("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:te("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}import{jsx as Ln}from"react/jsx-runtime";var Bn={none:"gap-0",tight:"gap-2",default:"gap-4",loose:"gap-6","extra-loose":"gap-8"},_n={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},ta=({children:e,className:t,spacing:a="tight",padding:n="none"})=>Ln("div",{className:o("flex flex-col h-full",Bn[a],_n[n],t),children:e});import{ArrowLeftIcon as oa,ChevronRight as On}from"lucide-react";import{NavLink as Vn}from"react-router";import{jsx as re,jsxs as at}from"react/jsx-runtime";var aa=({className:e,columns:t=[],showBackButton:a=!0,meta:n={title:""}})=>{let l=()=>{if(!n.backAction||!a)return null;let c={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return n.backAction.href?re(Vn,{to:n.backAction.href,children:at(u,{...c,children:[re(oa,{className:"size-6"}),n.backAction.content]})}):at(u,{...c,onClick:n.backAction.onClick,children:[re(oa,{className:"size-6"}),n.backAction.content]})},i=()=>!n.metadata||n.metadata.length===0?null:re("div",{className:"flex gap-4",children:n.metadata.map((c,N)=>c.value&&at("div",{className:"text-sm",children:[at("span",{className:"text-muted-foreground",children:[c.label," "]}),re("span",{children:c.value})]},N))}),m=()=>n.status?re("span",{className:o("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",critical:"bg-red-100 text-red-800",info:"bg-blue-100 text-blue-800",default:"bg-gray-100 text-gray-800"}[n.status.color]),children:n.status.content}):null,b={content:at("div",{className:"flex gap-2 items-center",children:[l(),at("div",{className:"flex flex-col gap-2 w-max",children:[re("h1",{className:"text-2xl font-bold tracking-tight",children:n.title}),m(),n.description&&re("p",{className:"text-muted-foreground",children:n.description}),i(),n.breadcrumbs&&n.breadcrumbs.length>0&&re("div",{className:"flex items-center text-sm text-muted-foreground",children:n.breadcrumbs.map((c,N)=>at("div",{className:"flex items-center",children:[c.href?re("span",{className:"hover:text-primary hover:underline",children:c.label}):re("span",{children:c.label}),N<n.breadcrumbs.length-1&&re(On,{className:"mx-2 h-4 w-4"})]},N))})]})]}),align:"left",width:"fill"},p={content:n.primaryActions,align:"right",width:"auto"},d=[b,...t.filter(c=>c!==void 0),p];return re("div",{className:o("flex items-center w-full gap-4 p-2",e),children:d.map((c,N)=>re("div",{className:o("flex items-center h-full",c.className,{"justify-start":c.align==="left","justify-center":c.align==="center","justify-end":c.align==="right","flex-1":c.width==="fill"}),children:c.content},N))})};import Hn,{useState as jn,createContext as $n,useContext as Un}from"react";import{Dialog as Rt}from"radix-ui";import{XIcon as En}from"lucide-react";import{jsx as pt,jsxs as bo}from"react/jsx-runtime";function na({...e}){return pt(Rt.Root,{"data-slot":"sheet",...e})}function vo({...e}){return pt(Rt.Portal,{"data-slot":"sheet-portal",...e})}function Gn({className:e,...t}){return pt(Rt.Overlay,{"data-slot":"sheet-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function ra({className:e,children:t,side:a="right",...n}){return bo(vo,{children:[pt(Gn,{}),bo(Rt.Content,{"data-slot":"sheet-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...n,children:[t,bo(Rt.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[pt(En,{className:"size-4"}),pt("span",{className:"sr-only",children:"Close"})]})]})]})}import{Fragment as Xn,jsx as U,jsxs as ft}from"react/jsx-runtime";var ia=$n(!1),$t={"one-half":["w-1/2","w-1/2"],"one-third":["w-1/3","w-2/3"],"two-third":["w-2/3","w-1/3"],"one-fourth":["w-1/4","w-3/4"],"three-fourth":["w-3/4","w-1/4"],"one-fifth":["w-1/5","w-4/5"],"four-fifth":["w-4/5","w-1/5"]},ut={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Wn=(e,t)=>{let[a,n]=$t[t];return{container:"inset-y-0 z-50 transition-all duration-500 ease-in-out",content:o("h-full bg-background transition-all duration-500 ease-in-out",e==="right"?"border-l":"border-r"),transform:e==="right"?"translate-x-full":"-translate-x-full",transformOpen:"translate-x-0",contentPushClass:e==="right"?n:a,sheetPushClass:e==="right"?a:n}},Jn="flex flex-col overflow-hidden rounded-2xl relative",qn={default:"bg-background",card:"bg-background shadow-sm border",border:"bg-background border-2",transparent:"bg-transparent"},sa=e=>{let{children:t,className:a,variant:n="default",layout:l="full",header:i,footer:m,headerClassName:b,footerClassName:p,parentContainer:d=!1,padding:c=d?"none":"tight"}=e,N=Un(ia),[T,A]=jn(!1),D=Hn.useCallback(F=>U("div",{className:o("flex-1 overflow-auto h-full no-scrollbar",d&&"flex",!d&&ut[c]),children:F}),[c,d]),M=()=>{switch(l){case"split":{let{splitRatio:F="three-fourth",reverse:B=!1}=e;if(!Array.isArray(t)||t.length!==2)return U("div",{className:"flex items-center justify-center h-full text-red-500",children:'Error: AppContent with layout="split" requires exactly 2 children'});let[v,oe]=$t[F],[h,_]=B?[t[1],t[0]]:[t[0],t[1]],[fe,ce]=B?[oe,v]:[v,oe];return ft("div",{className:"flex h-full gap-2",children:[U("div",{className:o(fe,"overflow-auto"),children:D(h)}),U("div",{className:o(ce,"overflow-auto"),children:D(_)})]})}case"with-sheet":{let{sheetContent:F,sheetWidth:B="four-fifth",sheetSide:v="right",sheetMode:oe="container",sheetClassName:h,isSheetOpen:_,onSheetOpenChange:fe,disableOverlay:ce=!0,showSheetOverlay:ge=!0}=e,Ie=_!==void 0&&fe,W=Ie?_:T,be=Ie?fe:A;if(oe==="container"){let q=Wn(v,B),r=$t[B][0];return ce?ft("div",{className:o("flex relative flex-1 overflow-hidden"),children:[U("div",{className:o("h-full overflow-auto transition-all duration-500",W?q.contentPushClass:"w-full",W&&"overflow-y-auto overflow-x-hidden"),children:U("div",{className:o("h-full",!d&&ut[c]),children:t})}),U("div",{className:o(q.container,"transition-all duration-500 ease-in-out h-full",r,W&&["left","right"].includes(v)?o(q.sheetPushClass,"overflow-y-auto"):W?q.transformOpen:o(q.transform,"hidden"),"overflow-y-auto"),children:U("div",{className:o(q.content,h,"h-full"),children:F})})]}):ft("div",{className:o("flex relative flex-1 overflow-hidden"),children:[U("div",{className:o("h-full overflow-auto w-full transition-all duration-500 relative z-10"),children:U("div",{className:o("h-full",!d&&ut[c]),children:t})}),ft("div",{className:o("absolute inset-0 z-20",!W&&"pointer-events-none"),children:[ge&&U("div",{className:o("absolute inset-0 bg-black/50 transition-opacity duration-500",W?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>be(!1)}),U("div",{className:o(q.container,"transition-all duration-500 backdrop-blur-2xl ease-in-out h-full absolute",r,W?"translate-x-0 opacity-100":o(v==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),"overflow-y-auto"),style:{[v]:0},children:U("div",{className:o(q.content,h,"h-full"),children:F})})]})]})}return ft(Xn,{children:[t,U(na,{open:W,onOpenChange:be,children:U(vo,{children:U(ra,{side:v,className:o("fixed bg-background border sm:max-w-full","transition-all duration-500 ease-in-out",$t[B][0],h),children:F})})})]})}default:return D(t)}};return U(ia.Provider,{value:!0,children:ft("div",{className:o(Jn,qn[n],ut[c],N&&"flex-1",d&&"h-full",!d&&"rounded-2xl",a),children:[i&&U("div",{className:o("border-b",b,n==="card"&&!d&&"rounded-t-2xl",n==="border"&&"border-b-2",ut[c]),children:i}),M(),m&&U("div",{className:o("border-t",p,n==="card"&&!d&&"rounded-b-2xl",n==="border"&&"border-t-2",ut[c]),children:m})]})})};import{jsx as ho}from"react/jsx-runtime";var la=({className:e,columns:t=[],meta:a={title:""}})=>{let n={content:ho("div",{className:"flex items-center gap-4 p-2",children:a.secondaryActions}),align:"right",width:"fill"},l=[...t.filter(i=>i!==void 0),n];return ho("div",{className:o("flex items-center w-full gap-4",e),children:l.map((i,m)=>ho("div",{className:o("flex items-center h-full",i.className,{"justify-start":i.align==="left","justify-center":i.align==="center","justify-end":i.align==="right","flex-1":i.width==="fill"}),children:i.content},m))})};import{jsx as Ut}from"react/jsx-runtime";function Kn({useTypedAppMeta:e}){return{AppHeader:i=>{let{meta:m}=e();return Ut(aa,{...i,meta:m})},AppFooter:i=>{let{meta:m}=e();return Ut(la,{...i,meta:m})},AppContent:i=>Ut(sa,{...i}),AppContainer:i=>Ut(ta,{...i})}}import{createContext as da,useContext as Yn,useState as ca,useCallback as Wt,useMemo as ma}from"react";import{jsx as pa}from"react/jsx-runtime";var Zn=da(void 0),Qn=({children:e})=>{let[t,a]=ca({title:"",description:"",breadcrumbs:[]}),n=Wt(m=>{a(b=>Object.keys(m).some(d=>JSON.stringify(b[d])!==JSON.stringify(m[d]))?{...b,...m}:b)},[]),l=Wt(()=>{a(m=>m.title===""&&m.description===""&&(m.breadcrumbs?.length??0)===0?m:{title:"",description:"",breadcrumbs:[]})},[]),i=ma(()=>({meta:t,setMeta:n,resetMeta:l}),[t,n,l]);return pa(Zn.Provider,{value:i,children:e})};function er(){let e=da(void 0);return{TypedAppMetaProvider:({children:n})=>{let[l,i]=ca({title:"",description:"",breadcrumbs:[]}),m=Wt(d=>{i(c=>Object.keys(d).some(T=>{let A=c[T],D=d[T];return JSON.stringify(A)!==JSON.stringify(D)})?{...c,...d}:c)},[]),b=Wt(()=>{i(d=>d.title===""&&d.description===""&&(d.breadcrumbs?.length??0)===0?d:{title:"",description:"",breadcrumbs:[]})},[]),p=ma(()=>({meta:l,setMeta:m,resetMeta:b}),[l,m,b]);return pa(e.Provider,{value:p,children:n})},useTypedAppMeta:()=>{let n=Yn(e);if(!n)throw new Error("useTypedAppMeta must be used within a TypedAppMetaProvider");return n},TypedAppMetaContext:e}}import{useEffect as tr,useMemo as xo}from"react";function or({useTypedAppMeta:e}){function t(a){let{setMeta:n,resetMeta:l}=e(),i=xo(()=>{if(a.backAction)return{...a.backAction,onClick:a.backAction.onClick}},[a.backAction?.content,a.backAction?.href,a.backAction?.onClick?.toString()]),m=xo(()=>a.metadata,[JSON.stringify(a.metadata)]),b=xo(()=>({...a,backAction:i,metadata:m}),[a.title,a.description,a.breadcrumbs,a.primaryActions,a.secondaryActions,a.pagination,a.status,i,m]);tr(()=>(n(b),()=>l()),[b,n,l])}return{usePageTemplate:t}}import{useState as ua}from"react";import{Copy as ar,Check as nr,Loader2Icon as rr}from"lucide-react";import{jsx as ze,jsxs as fa}from"react/jsx-runtime";var yo=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(a){throw console.error("Failed to copy text:",a),a}}static CopyToClipboard=({text:t,children:a,className:n,size:l="icon",variant:i="ghost"})=>{let[m,b]=ua(!1),[p,d]=ua(!1),c=async()=>{if(!(!t||p)){d(!0);try{await this.copyToClipboard(t),b(!0),setTimeout(()=>b(!1),2e3)}catch(N){console.error("Failed to copy text:",N)}finally{d(!1)}}};return fa(Ee,{children:[ze(Ge,{asChild:!0,children:ze(u,{variant:i,size:l,className:o(l==="icon"&&"size-6",n),onClick:c,disabled:p||!t,children:p?ze(rr,{className:"animate-spin"}):m?ze(nr,{className:"h-3 w-3"}):a||ze(ar,{className:"h-3 w-3"})})}),ze(He,{children:m?"Copied!":p?"Copying...":"Copy to clipboard"})]})};static formatINR(t,a={}){let{prefix:n="",suffix:l="",withSymbol:i=!0,compact:m=!1}=a;if(typeof t!="number"||isNaN(t))return`${n}${i?"\u20B9 ":""}0.00${l}`;let b=t<0,p=Math.abs(t),c=(m&&p>=1e5?this.compactFormatter:this.currencyFormatter).format(p).replace("\u20B9","");return`${n}${b?"- ":""}${i?"\u20B9 ":""}${c}${l}`}static formatDate(t,a={}){let{format:n="dd-mm-yyyy",separator:l="-"}=a,i=new Date(t);if(isNaN(i.getTime()))return"";let m=String(i.getDate()).padStart(2,"0"),b=String(i.getMonth()+1).padStart(2,"0"),p=this.MONTH_NAMES_SHORT[i.getMonth()],d=i.getFullYear();switch(n){case"dd-mmm-yyyy":return`${m}${l}${p}${l}${d}`;case"iso":return i.toISOString().split("T")[0];case"long":return i.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return i.toLocaleDateString("en-IN");default:return`${m}${l}${b}${l}${d}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((a,n,l)=>["-","'"," "].includes(a)||n>0&&["-","'"].includes(l[n-1])?a:a.charAt(0).toUpperCase()+a.slice(1)).join(""):""}static StatusBadge=({status:t,className:a,showDot:n=!0,capitalize:l=!0,size:i="md",variant:m="outline",customColors:b,icon:p,trueMessage:d="active",falseMessage:c="inactive"})=>{let N=typeof t=="boolean"?t?d:c:typeof t=="number"?t>0?d:c:t.toLowerCase(),T={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},A=T[N.toLowerCase()]||T.inactive,D=b||A[m],M={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},F=l?N.charAt(0).toUpperCase()+N.slice(1):N;return ze("div",{className:"flex justify-center",children:fa("span",{className:o("inline-flex items-center gap-1.5 rounded-full border font-medium",D.bg,D.text,D.border,M[i],a),children:[n&&(p?ze("span",{className:"flex items-center",children:p}):ze("span",{className:o("size-2 rounded-full",D.dot),"aria-hidden":"true"})),F]})})}};import{AlertTriangleIcon as ir}from"lucide-react";import{useRouteError as sr,isRouteErrorResponse as lr,useNavigate as dr}from"react-router";import{Fragment as Co,jsx as Ce,jsxs as gt}from"react/jsx-runtime";var ga=()=>{let e=sr(),t=dr();return Ce("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:gt("div",{className:"flex flex-col items-center space-y-4 text-center",children:[Ce(ir,{className:"h-16 w-16 text-destructive"}),lr(e)?gt(Co,{children:[gt("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?Ce("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&Ce("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?gt(Co,{children:[Ce("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),Ce("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&>("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[Ce("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),Ce("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):gt(Co,{children:[Ce("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),Ce("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),Ce(u,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};import{motion as Ae}from"framer-motion";import{jsx as j,jsxs as de}from"react/jsx-runtime";function cr({size:e=100,strokeWidth:t=2,color:a="currentColor",className:n=""}){return de(Ae.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:n,children:[j("title",{children:"Animated Checkmark"}),j(Ae.circle,{cx:"50",cy:"50",r:"40",stroke:a,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),j(Ae.path,{d:"M30 50L45 65L70 35",stroke:a,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function ba(){return j(Pe,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:de(Se,{className:"space-y-4 flex flex-col items-center justify-center",children:[j(Ae.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:de("div",{className:"relative",children:[j(Ae.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),j(cr,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),de(Ae.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[j(Ae.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),j("div",{className:"flex items-center gap-4",children:j(Ae.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:de("div",{className:"flex flex-col items-start gap-2",children:[de("div",{className:"space-y-1.5",children:[de("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[de("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[j("title",{children:"From"}),j("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),de("div",{className:"flex items-center gap-2.5 group transition-all",children:[j("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),j("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),j("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),de("div",{className:"space-y-1.5",children:[de("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[de("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[j("title",{children:"To"}),j("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),de("div",{className:"flex items-center gap-2.5 group transition-all",children:[j("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),j("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),j(Ae.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}import{jsx as Jt,jsxs as mr}from"react/jsx-runtime";var va=()=>Jt("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:mr("div",{className:"flex flex-col items-center space-y-4",children:[Jt("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),Jt("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),Jt("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});import{useLocation as pr}from"react-router";import{GhostIcon as ur}from"lucide-react";import{NavLink as fr,useNavigate as gr}from"react-router";import{jsx as bt,jsxs as wo}from"react/jsx-runtime";var ha=()=>{let e=pr(),t=gr(),a=()=>{window.history.length>2?t(-1):t("/")};return wo("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[bt(ur,{className:"h-15 w-15 text-destructive mb-4"}),bt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),wo("p",{className:"text-xl mb-4",children:["The page ",bt("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),wo("div",{className:"flex space-x-4",children:[bt(u,{variant:"outline",onClick:a,children:"Go Back"}),bt(u,{variant:"ghost",children:bt(fr,{to:"/",children:"Return Home"})})]})]})};import{WifiOffIcon as br}from"lucide-react";import{jsx as No,jsxs as vr}from"react/jsx-runtime";var xa=()=>vr("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[No(br,{className:"h-15 w-15 text-destructive mb-4"}),No("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),No("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});import{ShieldOffIcon as hr}from"lucide-react";import{NavLink as xr,useNavigate as yr}from"react-router";import{jsx as vt,jsxs as ya}from"react/jsx-runtime";var Ca=()=>{let e=yr();return ya("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[vt(hr,{className:"h-15 w-15 text-destructive mb-4"}),vt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),vt("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),ya("div",{className:"flex space-x-4",children:[vt(u,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),vt(u,{variant:"ghost",children:vt(xr,{to:"/",children:"Go to Home"})})]})]})};export{Qn as AppMetaProvider,ba as CurrencyTransfer,Ho as DataTable,$o as DataTableActionBar,Uo as DataTableActionBarAction,Wo as DataTableActionBarSelection,Ko as DataTemplate,Zo as DataTemplateActionBar,Qo as DataTemplateActionBarAction,ea as DataTemplateActionBarSelection,ga as ErrorComponent,yo as GeneralHelper,va as Loader,ha as NotFound,xa as OfflineUI,Ca as Unauthorized,Kn as createLayoutComponents,or as createPageTemplateHook,er as createTypedAppMetaContext};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|