@akshar-technosoft/ui 1.0.25 → 1.1.0
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/README.md +466 -215
- package/dist/components/date-helper.cjs.map +1 -1
- package/dist/components/date-helper.d.cts +36 -0
- package/dist/components/date-helper.d.ts +36 -0
- package/dist/components/date-helper.js.map +1 -1
- package/dist/components/general.cjs +1 -1
- package/dist/components/general.cjs.map +1 -1
- package/dist/components/general.d.cts +25 -0
- package/dist/components/general.d.ts +25 -0
- package/dist/components/general.js +1 -1
- package/dist/components/general.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +817 -28
- package/dist/index.d.ts +817 -28
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/package.json +94 -87
- package/dist/components/core/error.cjs +0 -3
- package/dist/components/core/error.cjs.map +0 -1
- package/dist/components/core/error.d.cts +0 -5
- package/dist/components/core/error.d.ts +0 -5
- package/dist/components/core/error.js +0 -3
- package/dist/components/core/error.js.map +0 -1
- package/dist/components/core/event-success.cjs +0 -3
- package/dist/components/core/event-success.cjs.map +0 -1
- package/dist/components/core/event-success.d.cts +0 -5
- package/dist/components/core/event-success.d.ts +0 -5
- package/dist/components/core/event-success.js +0 -3
- package/dist/components/core/event-success.js.map +0 -1
- package/dist/components/core/index.cjs +0 -3
- package/dist/components/core/index.cjs.map +0 -1
- package/dist/components/core/index.d.cts +0 -7
- package/dist/components/core/index.d.ts +0 -7
- package/dist/components/core/index.js +0 -3
- package/dist/components/core/index.js.map +0 -1
- package/dist/components/core/loader.cjs +0 -3
- package/dist/components/core/loader.cjs.map +0 -1
- package/dist/components/core/loader.d.cts +0 -5
- package/dist/components/core/loader.d.ts +0 -5
- package/dist/components/core/loader.js +0 -3
- package/dist/components/core/loader.js.map +0 -1
- package/dist/components/core/notfound.cjs +0 -3
- package/dist/components/core/notfound.cjs.map +0 -1
- package/dist/components/core/notfound.d.cts +0 -5
- package/dist/components/core/notfound.d.ts +0 -5
- package/dist/components/core/notfound.js +0 -3
- package/dist/components/core/notfound.js.map +0 -1
- package/dist/components/core/offline-content.cjs +0 -3
- package/dist/components/core/offline-content.cjs.map +0 -1
- package/dist/components/core/offline-content.d.cts +0 -5
- package/dist/components/core/offline-content.d.ts +0 -5
- package/dist/components/core/offline-content.js +0 -3
- package/dist/components/core/offline-content.js.map +0 -1
- package/dist/components/core/unauthorized.cjs +0 -3
- package/dist/components/core/unauthorized.cjs.map +0 -1
- package/dist/components/core/unauthorized.d.cts +0 -5
- package/dist/components/core/unauthorized.d.ts +0 -5
- package/dist/components/core/unauthorized.js +0 -3
- package/dist/components/core/unauthorized.js.map +0 -1
- package/dist/components/data/data-table/data-table-action-bar.cjs +0 -3
- package/dist/components/data/data-table/data-table-action-bar.cjs.map +0 -1
- package/dist/components/data/data-table/data-table-action-bar.d.cts +0 -26
- package/dist/components/data/data-table/data-table-action-bar.d.ts +0 -26
- package/dist/components/data/data-table/data-table-action-bar.js +0 -3
- package/dist/components/data/data-table/data-table-action-bar.js.map +0 -1
- package/dist/components/data/data-table/data-table-column-header.cjs +0 -3
- package/dist/components/data/data-table/data-table-column-header.cjs.map +0 -1
- package/dist/components/data/data-table/data-table-column-header.d.cts +0 -11
- package/dist/components/data/data-table/data-table-column-header.d.ts +0 -11
- package/dist/components/data/data-table/data-table-column-header.js +0 -3
- package/dist/components/data/data-table/data-table-column-header.js.map +0 -1
- package/dist/components/data/data-table/data-table-faceted-filter.cjs +0 -3
- package/dist/components/data/data-table/data-table-faceted-filter.cjs.map +0 -1
- package/dist/components/data/data-table/data-table-faceted-filter.d.cts +0 -18
- package/dist/components/data/data-table/data-table-faceted-filter.d.ts +0 -18
- package/dist/components/data/data-table/data-table-faceted-filter.js +0 -3
- package/dist/components/data/data-table/data-table-faceted-filter.js.map +0 -1
- package/dist/components/data/data-table/data-table-pagination.cjs +0 -3
- package/dist/components/data/data-table/data-table-pagination.cjs.map +0 -1
- package/dist/components/data/data-table/data-table-pagination.d.cts +0 -12
- package/dist/components/data/data-table/data-table-pagination.d.ts +0 -12
- package/dist/components/data/data-table/data-table-pagination.js +0 -3
- package/dist/components/data/data-table/data-table-pagination.js.map +0 -1
- package/dist/components/data/data-table/data-table-toolbar.cjs +0 -3
- package/dist/components/data/data-table/data-table-toolbar.cjs.map +0 -1
- package/dist/components/data/data-table/data-table-toolbar.d.cts +0 -30
- package/dist/components/data/data-table/data-table-toolbar.d.ts +0 -30
- package/dist/components/data/data-table/data-table-toolbar.js +0 -3
- package/dist/components/data/data-table/data-table-toolbar.js.map +0 -1
- package/dist/components/data/data-table/data-table-types.cjs +0 -3
- package/dist/components/data/data-table/data-table-types.cjs.map +0 -1
- package/dist/components/data/data-table/data-table-types.d.cts +0 -120
- package/dist/components/data/data-table/data-table-types.d.ts +0 -120
- package/dist/components/data/data-table/data-table-types.js +0 -2
- package/dist/components/data/data-table/data-table-types.js.map +0 -1
- package/dist/components/data/data-table/data-table-view-options.cjs +0 -3
- package/dist/components/data/data-table/data-table-view-options.cjs.map +0 -1
- package/dist/components/data/data-table/data-table-view-options.d.cts +0 -9
- package/dist/components/data/data-table/data-table-view-options.d.ts +0 -9
- package/dist/components/data/data-table/data-table-view-options.js +0 -3
- package/dist/components/data/data-table/data-table-view-options.js.map +0 -1
- package/dist/components/data/data-table/data-table.cjs +0 -3
- package/dist/components/data/data-table/data-table.cjs.map +0 -1
- package/dist/components/data/data-table/data-table.d.cts +0 -8
- package/dist/components/data/data-table/data-table.d.ts +0 -8
- package/dist/components/data/data-table/data-table.js +0 -3
- package/dist/components/data/data-table/data-table.js.map +0 -1
- package/dist/components/data/data-table/index.cjs +0 -3
- package/dist/components/data/data-table/index.cjs.map +0 -1
- package/dist/components/data/data-table/index.d.cts +0 -16
- package/dist/components/data/data-table/index.d.ts +0 -16
- package/dist/components/data/data-table/index.js +0 -3
- package/dist/components/data/data-table/index.js.map +0 -1
- package/dist/components/data/data-template/data-template-action-bar.cjs +0 -3
- package/dist/components/data/data-template/data-template-action-bar.cjs.map +0 -1
- package/dist/components/data/data-template/data-template-action-bar.d.cts +0 -14
- package/dist/components/data/data-template/data-template-action-bar.d.ts +0 -14
- package/dist/components/data/data-template/data-template-action-bar.js +0 -3
- package/dist/components/data/data-template/data-template-action-bar.js.map +0 -1
- package/dist/components/data/data-template/data-template-pagination.cjs +0 -3
- package/dist/components/data/data-template/data-template-pagination.cjs.map +0 -1
- package/dist/components/data/data-template/data-template-pagination.d.cts +0 -17
- package/dist/components/data/data-template/data-template-pagination.d.ts +0 -17
- package/dist/components/data/data-template/data-template-pagination.js +0 -3
- package/dist/components/data/data-template/data-template-pagination.js.map +0 -1
- package/dist/components/data/data-template/data-template-toolbar.cjs +0 -3
- package/dist/components/data/data-template/data-template-toolbar.cjs.map +0 -1
- package/dist/components/data/data-template/data-template-toolbar.d.cts +0 -27
- package/dist/components/data/data-template/data-template-toolbar.d.ts +0 -27
- package/dist/components/data/data-template/data-template-toolbar.js +0 -3
- package/dist/components/data/data-template/data-template-toolbar.js.map +0 -1
- package/dist/components/data/data-template/data-template-types.cjs +0 -3
- package/dist/components/data/data-template/data-template-types.cjs.map +0 -1
- package/dist/components/data/data-template/data-template-types.d.cts +0 -107
- package/dist/components/data/data-template/data-template-types.d.ts +0 -107
- package/dist/components/data/data-template/data-template-types.js +0 -2
- package/dist/components/data/data-template/data-template-types.js.map +0 -1
- package/dist/components/data/data-template/data-template.cjs +0 -3
- package/dist/components/data/data-template/data-template.cjs.map +0 -1
- package/dist/components/data/data-template/data-template.d.cts +0 -8
- package/dist/components/data/data-template/data-template.d.ts +0 -8
- package/dist/components/data/data-template/data-template.js +0 -3
- package/dist/components/data/data-template/data-template.js.map +0 -1
- package/dist/components/data/data-template/index.cjs +0 -3
- package/dist/components/data/data-template/index.cjs.map +0 -1
- package/dist/components/data/data-template/index.d.cts +0 -8
- package/dist/components/data/data-template/index.d.ts +0 -8
- package/dist/components/data/data-template/index.js +0 -3
- package/dist/components/data/data-template/index.js.map +0 -1
- package/dist/components/helper/date-filter.cjs +0 -3
- package/dist/components/helper/date-filter.cjs.map +0 -1
- package/dist/components/helper/date-filter.d.cts +0 -14
- package/dist/components/helper/date-filter.d.ts +0 -14
- package/dist/components/helper/date-filter.js +0 -3
- package/dist/components/helper/date-filter.js.map +0 -1
- package/dist/components/layouts/app-container.cjs +0 -3
- package/dist/components/layouts/app-container.cjs.map +0 -1
- package/dist/components/layouts/app-container.d.cts +0 -13
- package/dist/components/layouts/app-container.d.ts +0 -13
- package/dist/components/layouts/app-container.js +0 -3
- package/dist/components/layouts/app-container.js.map +0 -1
- package/dist/components/layouts/app-content.cjs +0 -3
- package/dist/components/layouts/app-content.cjs.map +0 -1
- package/dist/components/layouts/app-content.d.cts +0 -45
- package/dist/components/layouts/app-content.d.ts +0 -45
- package/dist/components/layouts/app-content.js +0 -3
- package/dist/components/layouts/app-content.js.map +0 -1
- package/dist/components/layouts/app-footer.cjs +0 -3
- package/dist/components/layouts/app-footer.cjs.map +0 -1
- package/dist/components/layouts/app-footer.d.cts +0 -18
- package/dist/components/layouts/app-footer.d.ts +0 -18
- package/dist/components/layouts/app-footer.js +0 -3
- package/dist/components/layouts/app-footer.js.map +0 -1
- package/dist/components/layouts/app-header.cjs +0 -3
- package/dist/components/layouts/app-header.cjs.map +0 -1
- package/dist/components/layouts/app-header.d.cts +0 -19
- package/dist/components/layouts/app-header.d.ts +0 -19
- package/dist/components/layouts/app-header.js +0 -3
- package/dist/components/layouts/app-header.js.map +0 -1
- package/dist/components/layouts/factories.cjs +0 -3
- package/dist/components/layouts/factories.cjs.map +0 -1
- package/dist/components/layouts/factories.d.cts +0 -18
- package/dist/components/layouts/factories.d.ts +0 -18
- package/dist/components/layouts/factories.js +0 -3
- package/dist/components/layouts/factories.js.map +0 -1
- package/dist/components/layouts/index.cjs +0 -3
- package/dist/components/layouts/index.cjs.map +0 -1
- package/dist/components/layouts/index.d.cts +0 -8
- package/dist/components/layouts/index.d.ts +0 -8
- package/dist/components/layouts/index.js +0 -3
- package/dist/components/layouts/index.js.map +0 -1
- package/dist/components/ui/badge.cjs +0 -3
- package/dist/components/ui/badge.cjs.map +0 -1
- package/dist/components/ui/badge.d.cts +0 -13
- package/dist/components/ui/badge.d.ts +0 -13
- package/dist/components/ui/badge.js +0 -3
- package/dist/components/ui/badge.js.map +0 -1
- package/dist/components/ui/button.cjs +0 -3
- package/dist/components/ui/button.cjs.map +0 -1
- package/dist/components/ui/button.d.cts +0 -14
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/button.js +0 -3
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/calendar.cjs +0 -3
- package/dist/components/ui/calendar.cjs.map +0 -1
- package/dist/components/ui/calendar.d.cts +0 -13
- package/dist/components/ui/calendar.d.ts +0 -13
- package/dist/components/ui/calendar.js +0 -3
- package/dist/components/ui/calendar.js.map +0 -1
- package/dist/components/ui/card.cjs +0 -3
- package/dist/components/ui/card.cjs.map +0 -1
- package/dist/components/ui/card.d.cts +0 -12
- package/dist/components/ui/card.d.ts +0 -12
- package/dist/components/ui/card.js +0 -3
- package/dist/components/ui/card.js.map +0 -1
- package/dist/components/ui/checkbox.cjs +0 -3
- package/dist/components/ui/checkbox.cjs.map +0 -1
- package/dist/components/ui/checkbox.d.cts +0 -7
- package/dist/components/ui/checkbox.d.ts +0 -7
- package/dist/components/ui/checkbox.js +0 -3
- package/dist/components/ui/checkbox.js.map +0 -1
- package/dist/components/ui/command.cjs +0 -3
- package/dist/components/ui/command.cjs.map +0 -1
- package/dist/components/ui/command.d.cts +0 -20
- package/dist/components/ui/command.d.ts +0 -20
- package/dist/components/ui/command.js +0 -3
- package/dist/components/ui/command.js.map +0 -1
- package/dist/components/ui/dialog.cjs +0 -3
- package/dist/components/ui/dialog.cjs.map +0 -1
- package/dist/components/ui/dialog.d.cts +0 -16
- package/dist/components/ui/dialog.d.ts +0 -16
- package/dist/components/ui/dialog.js +0 -3
- package/dist/components/ui/dialog.js.map +0 -1
- package/dist/components/ui/dropdown-menu.cjs +0 -3
- package/dist/components/ui/dropdown-menu.cjs.map +0 -1
- package/dist/components/ui/dropdown-menu.d.cts +0 -28
- package/dist/components/ui/dropdown-menu.d.ts +0 -28
- package/dist/components/ui/dropdown-menu.js +0 -3
- package/dist/components/ui/dropdown-menu.js.map +0 -1
- package/dist/components/ui/input.cjs +0 -3
- package/dist/components/ui/input.cjs.map +0 -1
- package/dist/components/ui/input.d.cts +0 -6
- package/dist/components/ui/input.d.ts +0 -6
- package/dist/components/ui/input.js +0 -3
- package/dist/components/ui/input.js.map +0 -1
- package/dist/components/ui/popover.cjs +0 -3
- package/dist/components/ui/popover.cjs.map +0 -1
- package/dist/components/ui/popover.d.cts +0 -10
- package/dist/components/ui/popover.d.ts +0 -10
- package/dist/components/ui/popover.js +0 -3
- package/dist/components/ui/popover.js.map +0 -1
- package/dist/components/ui/select.cjs +0 -3
- package/dist/components/ui/select.cjs.map +0 -1
- package/dist/components/ui/select.d.cts +0 -18
- package/dist/components/ui/select.d.ts +0 -18
- package/dist/components/ui/select.js +0 -3
- package/dist/components/ui/select.js.map +0 -1
- package/dist/components/ui/separator.cjs +0 -3
- package/dist/components/ui/separator.cjs.map +0 -1
- package/dist/components/ui/separator.d.cts +0 -7
- package/dist/components/ui/separator.d.ts +0 -7
- package/dist/components/ui/separator.js +0 -3
- package/dist/components/ui/separator.js.map +0 -1
- package/dist/components/ui/sheet.cjs +0 -3
- package/dist/components/ui/sheet.cjs.map +0 -1
- package/dist/components/ui/sheet.d.cts +0 -18
- package/dist/components/ui/sheet.d.ts +0 -18
- package/dist/components/ui/sheet.js +0 -3
- package/dist/components/ui/sheet.js.map +0 -1
- package/dist/components/ui/table.cjs +0 -3
- package/dist/components/ui/table.cjs.map +0 -1
- package/dist/components/ui/table.d.cts +0 -13
- package/dist/components/ui/table.d.ts +0 -13
- package/dist/components/ui/table.js +0 -3
- package/dist/components/ui/table.js.map +0 -1
- package/dist/components/ui/toggle.cjs +0 -3
- package/dist/components/ui/toggle.cjs.map +0 -1
- package/dist/components/ui/toggle.d.cts +0 -16
- package/dist/components/ui/toggle.d.ts +0 -16
- package/dist/components/ui/toggle.js +0 -3
- package/dist/components/ui/toggle.js.map +0 -1
- package/dist/components/ui/tooltip.cjs +0 -3
- package/dist/components/ui/tooltip.cjs.map +0 -1
- package/dist/components/ui/tooltip.d.cts +0 -10
- package/dist/components/ui/tooltip.d.ts +0 -10
- package/dist/components/ui/tooltip.js +0 -3
- package/dist/components/ui/tooltip.js.map +0 -1
- package/dist/context/app-meta/context.cjs +0 -3
- package/dist/context/app-meta/context.cjs.map +0 -1
- package/dist/context/app-meta/context.d.cts +0 -18
- package/dist/context/app-meta/context.d.ts +0 -18
- package/dist/context/app-meta/context.js +0 -3
- package/dist/context/app-meta/context.js.map +0 -1
- package/dist/context/app-meta/hooks.cjs +0 -3
- package/dist/context/app-meta/hooks.cjs.map +0 -1
- package/dist/context/app-meta/hooks.d.cts +0 -10
- package/dist/context/app-meta/hooks.d.ts +0 -10
- package/dist/context/app-meta/hooks.js +0 -3
- package/dist/context/app-meta/hooks.js.map +0 -1
- package/dist/context/app-meta/index.cjs +0 -3
- package/dist/context/app-meta/index.cjs.map +0 -1
- package/dist/context/app-meta/index.d.cts +0 -5
- package/dist/context/app-meta/index.d.ts +0 -5
- package/dist/context/app-meta/index.js +0 -3
- package/dist/context/app-meta/index.js.map +0 -1
- package/dist/context/app-meta/types.cjs +0 -3
- package/dist/context/app-meta/types.cjs.map +0 -1
- package/dist/context/app-meta/types.d.cts +0 -48
- package/dist/context/app-meta/types.d.ts +0 -48
- package/dist/context/app-meta/types.js +0 -2
- package/dist/context/app-meta/types.js.map +0 -1
- package/dist/context/index.cjs +0 -3
- package/dist/context/index.cjs.map +0 -1
- package/dist/context/index.d.cts +0 -5
- package/dist/context/index.d.ts +0 -5
- package/dist/context/index.js +0 -3
- package/dist/context/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
"use strict";var Bn=Object.create;var fo=Object.defineProperty;var Ln=Object.getOwnPropertyDescriptor;var On=Object.getOwnPropertyNames;var _n=Object.getPrototypeOf,Vn=Object.prototype.hasOwnProperty;var Hn=(e,t)=>{for(var a in t)fo(e,a,{get:t[a],enumerable:!0})},va=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of On(t))!Vn.call(e,c)&&c!==a&&fo(e,c,{get:()=>t[c],enumerable:!(r=Ln(t,c))||r.enumerable});return e};var zt=(e,t,a)=>(a=e!=null?Bn(_n(e)):{},va(t||!e||!e.__esModule?fo(a,"default",{value:e,enumerable:!0}):a,e)),En=e=>va(fo({},"__esModule",{value:!0}),e);var nr={};Hn(nr,{AppMetaProvider:()=>mn,CurrencyTransfer:()=>ia,DataTable:()=>Wo,DataTableActionBar:()=>qo,DataTableActionBarAction:()=>Jo,DataTableActionBarSelection:()=>Xo,DataTemplate:()=>Qo,DataTemplateActionBar:()=>ea,DataTemplateActionBarAction:()=>ta,DataTemplateActionBarSelection:()=>oa,ErrorComponent:()=>sa,GeneralHelper:()=>Po,Loader:()=>la,NotFound:()=>da,OfflineUI:()=>ca,Unauthorized:()=>ma,createLayoutComponents:()=>cn,createPageTemplateHook:()=>un,createTypedAppMetaContext:()=>pn});module.exports=En(nr);var Se=require("@tanstack/react-table"),Q=require("lucide-react");var ya=require("radix-ui"),Ca=require("class-variance-authority");var ha=require("clsx"),xa=require("tailwind-merge");function o(...e){return(0,xa.twMerge)((0,ha.clsx)(e))}var wa=require("react/jsx-runtime"),bo=(0,Ca.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function v({className:e,variant:t,size:a,asChild:r=!1,...c}){let l=r?ya.Slot.Slot:"button";return(0,wa.jsx)(l,{"data-slot":"button",className:o(bo({variant:t,size:a,className:e}),"transition-none"),...c})}var et=require("react/jsx-runtime");function Fo({className:e,...t}){return(0,et.jsx)("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:(0,et.jsx)("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function Na({className:e,...t}){return(0,et.jsx)("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function Ta({className:e,...t}){return(0,et.jsx)("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Bo({className:e,...t}){return(0,et.jsx)("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function tt({className:e,...t}){return(0,et.jsx)("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Sa({className:e,...t}){return(0,et.jsx)("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function ot({className:e,...t}){return(0,et.jsx)("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}var Lo=require("react/jsx-runtime");function at({className:e,...t}){return(0,Lo.jsx)("div",{"data-slot":"card",className:o("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function nt({className:e,...t}){return(0,Lo.jsx)("div",{"data-slot":"card-content",className:o("px-6",e),...t})}var wt=require("radix-ui");var rt=require("react/jsx-runtime");function Nt({delayDuration:e=0,...t}){return(0,rt.jsx)(wt.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function mt({...e}){return(0,rt.jsx)(Nt,{children:(0,rt.jsx)(wt.Tooltip.Root,{"data-slot":"tooltip",...e})})}function pt({...e}){return(0,rt.jsx)(wt.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function ut({className:e,sideOffset:t=0,children:a,...r}){return(0,rt.jsx)(wt.Tooltip.Portal,{children:(0,rt.jsxs)(wt.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:o("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[a,(0,rt.jsx)(wt.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var L=require("lucide-react");var Pa=require("react/jsx-runtime");function At({className:e,type:t,...a}){return(0,Pa.jsx)("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var Tt=require("cmdk"),Da=require("lucide-react");var Gn=require("radix-ui"),jn=require("lucide-react");var ka=require("react/jsx-runtime");var Je=require("react/jsx-runtime");function Oo({className:e,...t}){return(0,Je.jsx)(Tt.Command,{"data-slot":"command",className:o("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function _o({className:e,...t}){return(0,Je.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,Je.jsx)(Da.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,Je.jsx)(Tt.Command.Input,{"data-slot":"command-input",className:o("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Vo({className:e,...t}){return(0,Je.jsx)(Tt.Command.List,{"data-slot":"command-list",className:o("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Ho({...e}){return(0,Je.jsx)(Tt.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Eo({className:e,...t}){return(0,Je.jsx)(Tt.Command.Group,{"data-slot":"command-group",className:o("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function vo({className:e,...t}){return(0,Je.jsx)(Tt.Command.Item,{"data-slot":"command-item",className:o("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var we=require("radix-ui"),Yt=require("lucide-react");var le=require("react/jsx-runtime");function Fe({...e}){return(0,le.jsx)(we.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function Be({...e}){return(0,le.jsx)(we.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Le({className:e,sideOffset:t=4,...a}){return(0,le.jsx)(we.DropdownMenu.Portal,{children:(0,le.jsx)(we.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...a})})}function Go({...e}){return(0,le.jsx)(we.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function ne({className:e,inset:t,variant:a="default",...r}){return(0,le.jsx)(we.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Zt({className:e,children:t,checked:a,...r}){return(0,le.jsxs)(we.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[(0,le.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,le.jsx)(we.DropdownMenu.ItemIndicator,{children:(0,le.jsx)(Yt.CheckIcon,{className:"size-4"})})}),t]})}function ye({className:e,inset:t,...a}){return(0,le.jsx)(we.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function Ne({className:e,...t}){return(0,le.jsx)(we.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}function Ra({...e}){return(0,le.jsx)(we.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}function Ma({className:e,inset:t,children:a,...r}){return(0,le.jsxs)(we.DropdownMenu.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:o("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[a,(0,le.jsx)(Yt.ChevronRightIcon,{className:"ml-auto size-4"})]})}function za({className:e,...t}){return(0,le.jsx)(we.DropdownMenu.SubContent,{"data-slot":"dropdown-menu-sub-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var ro=require("react");var Bt=require("react"),Ia=require("lucide-react"),Ft=require("date-fns");var Qt=require("radix-ui");var eo=require("react/jsx-runtime");function to({...e}){return(0,eo.jsx)(Qt.Popover.Root,{"data-slot":"popover",...e})}function oo({...e}){return(0,eo.jsx)(Qt.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function ao({className:e,align:t="center",sideOffset:a=4,...r}){return(0,eo.jsx)(Qt.Popover.Portal,{children:(0,eo.jsx)(Qt.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}var ho=zt(require("react"),1),It=require("lucide-react"),no=require("react-day-picker");var st=require("react/jsx-runtime");function Aa({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:r="label",buttonVariant:c="ghost",formatters:l,components:f,...T}){let p=(0,no.getDefaultClassNames)();return(0,st.jsx)(no.DayPicker,{showOutsideDays:a,className:o("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:b=>b.toLocaleString("default",{month:"short"}),...l},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(bo({variant:c}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(bo({variant:c}),"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",r==="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:b,rootRef:u,...S})=>(0,st.jsx)("div",{"data-slot":"calendar",ref:u,className:o(b),...S}),Chevron:({className:b,orientation:u,...S})=>u==="left"?(0,st.jsx)(It.ChevronLeftIcon,{className:o("size-4",b),...S}):u==="right"?(0,st.jsx)(It.ChevronRightIcon,{className:o("size-4",b),...S}):(0,st.jsx)(It.ChevronDownIcon,{className:o("size-4",b),...S}),DayButton:$n,WeekNumber:({children:b,...u})=>(0,st.jsx)("td",{...u,children:(0,st.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:b})}),...f},...T})}function $n({className:e,day:t,modifiers:a,...r}){let c=(0,no.getDefaultClassNames)(),l=ho.useRef(null);return ho.useEffect(()=>{a.focused&&l.current?.focus()},[a.focused]),(0,st.jsx)(v,{ref:l,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",c.day,e),...r})}var Te=require("react/jsx-runtime");function Fa({value:e,onChange:t,placeholder:a,mode:r,externalSearch:c,onExternalChange:l,onlyExternal:f=!1}){let[T,p]=(0,Bt.useState)(!1),[b,u]=(0,Bt.useState)(e),[S,E]=(0,Bt.useState)(e);(0,Bt.useEffect)(()=>{f||E(e)},[e,f]);let _=()=>{f||t(b),E(b),c&&l&&l(b),p(!1)},F=()=>{u(S),p(!1)},D=()=>{let k=r==="single"?null:{from:null,to:null};u(k),f||t(k),E(k),c&&l&&l(k),p(!1)},j=()=>{let k=f?S:e;return k?r==="single"?(0,Ft.format)(k,"PPP"):k.from&&k.to?`${(0,Ft.format)(k.from,"MMM dd")} - ${(0,Ft.format)(k.to,"MMM dd, yyyy")}`:k.from?`From ${(0,Ft.format)(k.from,"MMM dd, yyyy")}`:k.to?`To ${(0,Ft.format)(k.to,"MMM dd, yyyy")}`:a:a},G=k=>{u(r==="single"?k:k||{from:null,to:null})};return(0,Te.jsxs)(to,{open:T,onOpenChange:p,children:[(0,Te.jsx)(oo,{className:"h-8",asChild:!0,children:(0,Te.jsxs)(v,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!j()&&"text-muted-foreground"),children:[(0,Te.jsx)(Ia.Calendar,{className:"mr-2 h-4 w-4"}),j()]})}),(0,Te.jsxs)(ao,{className:"w-auto p-0",align:"start",children:[(0,Te.jsx)("div",{className:"p-3",children:(0,Te.jsx)(Aa,{mode:r,selected:b,onSelect:G,numberOfMonths:r==="range"?2:1,className:"rounded-md border",...r==="range"&&{required:!0}})}),(0,Te.jsxs)("div",{className:"flex items-center justify-between p-3 border-t",children:[(0,Te.jsx)(v,{variant:"ghost",size:"sm",onClick:D,children:"Clear"}),(0,Te.jsxs)("div",{className:"flex gap-2",children:[(0,Te.jsx)(v,{variant:"outline",size:"sm",onClick:F,children:"Cancel"}),(0,Te.jsx)(v,{size:"sm",onClick:_,disabled:r==="range"&&(!b?.from||!b?.to),children:"Apply"})]})]})]})]})}var jo=require("radix-ui"),Ba=require("lucide-react");var xo=require("react/jsx-runtime");function St({className:e,...t}){return(0,xo.jsx)(jo.Checkbox.Root,{"data-slot":"checkbox",className:o("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,xo.jsx)(jo.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,xo.jsx)(Ba.CheckIcon,{className:"size-3.5"})})})}var s=require("react/jsx-runtime"),La=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}];function $o({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:r,enableGlobalFilter:c=!0,onExport:l,onRefresh:f,loading:T=!1,enableColumnVisibility:p=!0,data:b,onClearSorting:u,onClearFilters:S,enableColumnPinning:E=!1,onExternalSearch:_,onCustomFilterChange:F,aggregations:D={},onAggregationChange:j,enableGroupedGlobalFilter:G=!1,groupedFilterLabel:k="Search in",onGroupedFilterChange:ae}){let[w,$]=(0,ro.useState)({}),[Pe,_e]=(0,ro.useState)({}),[ue,ht]=(0,ro.useState)({}),[ke,ge]=(0,ro.useState)("all"),je=()=>e.getAllLeafColumns().filter(n=>n.getCanHide?.()!==!1),de=()=>e.getAllColumns().filter(n=>!e.getAllLeafColumns().includes(n)&&n.columns?.length&&n.columns.some(h=>h.getCanHide?.()!==!1)),De=()=>{let n=new Set(de().flatMap(h=>h.columns?.filter(N=>N.getCanHide?.()!==!1).map(N=>N.id)||[]));return je().filter(h=>!n.has(h.id))},Re=(n,h)=>h&&n.startsWith(`${h}.`)?n.replace(`${h}.`,"").split("_").map(W=>W.slice(1)).join(" "):n.split("_").map(N=>N.charAt(0).toUpperCase()+N.slice(1)).join(" "),fe=(n,h)=>{let N={...w,[n]:h};$(N)},Rt=(n,h)=>{let N={...Pe,[n]:h};_e(N),F&&F(n,h),t.find(W=>W.key===n)?.externalSearch&&fe(n,h)},$e=()=>{_&&_(w)},it=()=>{$({}),_e({}),S(),_&&_({}),F&&Object.keys(Pe).forEach(n=>{F(n,"")})},be=n=>t.find(N=>N.key===n)?.customFilter?Pe[n]??"":e.getColumn(n)?.getFilterValue(),Ve=(n,h)=>{let N=t.find(W=>W.key===n);N?.customFilter?Rt(n,h):(e.getColumn(n)?.setFilterValue(h),N?.externalSearch&&fe(n,h))},ve=(n,h)=>{ht(N=>({...N,[n]:h}))},Ue=n=>{if(j){let h=D[n],N={enabled:!h?.enabled,functions:h?.functions||["sum","average"]};j(n,N)}},Ye=(n,h)=>{if(j){let W=D[n]?.functions||[],he=W.includes(h)?W.filter(Qe=>Qe!==h):[...W,h];j(n,{enabled:he.length>0,functions:he})}},Me=()=>{j&&Object.keys(D).forEach(n=>{let h=D[n];h&&j(n,{...h,enabled:!1,functions:[]})})},Ce=()=>je().filter(n=>n.id==="select"||n.id==="serialNumber"?!1:n.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(W=>{let he=W.getValue(n.id);return typeof he=="number"||typeof he=="string"&&!isNaN(parseFloat(String(he)))||typeof he=="object"&&he!==null&&"props"in he})),Ze=n=>{ge(n),ae&&ae(n,a)},We=n=>{r(n),ae&&G&&ae(ke,n)},Wt=Ce(),K=Object.values(D).some(n=>n?.enabled),lt=[{value:"all",label:"All Fields"},...t.map(n=>({value:n.key,label:n.placeholder}))];return(0,s.jsx)("div",{className:"rounded-xl",children:(0,s.jsx)("div",{className:"px-2",children:(0,s.jsx)("div",{className:"flex flex-col gap-6",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,s.jsx)(L.Filter,{className:"size-4"})}),t.map(n=>!e.getColumn(n.key)&&!n.customFilter&&!n.externalSearch?null:(0,s.jsx)("div",{className:o("relative min-w-[150px]",n.width),children:n.type==="select"?(0,s.jsxs)(to,{open:ue[n.key],onOpenChange:N=>ve(n.key,N),children:[(0,s.jsx)(oo,{asChild:!0,children:(0,s.jsxs)("div",{className:"relative w-full",children:[n.icon&&(0,s.jsx)(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground pointer-events-none z-10"}),(0,s.jsxs)(v,{variant:"outline",role:"combobox","aria-expanded":ue[n.key],className:o("h-8 sm:h-8 rounded-lg w-full justify-between font-normal",!be(n.key)&&"text-muted-foreground"),children:[(0,s.jsx)("span",{className:o("truncate",n.icon&&"pl-6"),children:be(n.key)?n.options?.find(N=>N.value===be(n.key))?.label:n.placeholder}),(0,s.jsx)(L.ChevronDown,{className:"ml-2 opacity-50 size-4 shrink-0"})]})]})}),(0,s.jsx)(ao,{className:"w-[--radix-popover-trigger-width] p-0 rounded-lg",children:(0,s.jsxs)(Oo,{className:"rounded-lg",children:[(0,s.jsx)(_o,{placeholder:`Search ${n.placeholder?.toLowerCase()}...`}),(0,s.jsxs)(Vo,{children:[(0,s.jsx)(Ho,{children:"No option found."}),(0,s.jsxs)(Eo,{children:[(0,s.jsxs)(vo,{value:"all",onSelect:()=>{Ve(n.key,""),ve(n.key,!1)},className:"flex items-center cursor-pointer",children:[(0,s.jsx)(L.Check,{className:o("mr-2 size-4 shrink-0",be(n.key)?"opacity-0":"opacity-100")}),(0,s.jsx)("span",{children:"All"})]}),n.options?.map(N=>(0,s.jsxs)(vo,{value:N.label,onSelect:()=>{Ve(n.key,N.value),ve(n.key,!1)},className:"flex items-center cursor-pointer",children:[(0,s.jsx)(L.Check,{className:o("mr-2 size-4 shrink-0",be(n.key)===N.value?"opacity-100":"opacity-0")}),(0,s.jsx)("span",{children:N.label})]},N.label))]})]})]})})]}):n.type==="date"?(0,s.jsx)(Fa,{value:be(n.key),onChange:N=>{n.onlyExternal||Ve(n.key,N)},placeholder:n.placeholder,mode:n.dateMode||"single",externalSearch:n.externalSearch,onlyExternal:n.onlyExternal,onExternalChange:N=>fe(n.key,N)}):(0,s.jsxs)("div",{className:"relative",children:[n.icon&&(0,s.jsx)(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,s.jsx)(At,{placeholder:n.placeholder,value:be(n.key)??"",onChange:N=>{Ve(n.key,N.target.value)},className:o("h-8 rounded-lg",n.icon&&"pl-9"),type:n.type==="number"?"number":"text"})]})},n.key)),(t.some(n=>n.externalSearch)||t.some(n=>n.customFilter))&&(0,s.jsxs)(v,{variant:"default",size:"sm",onClick:$e,className:"rounded-lg h-7",children:[(0,s.jsx)(L.Search,{className:"size-4"}),t.find(n=>n.externalSearch||n.customFilter)?.searchButtonText||"Search"]})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,s.jsxs)("div",{className:o("flex items-center",G?"bg-background border rounded-lg":""),children:[G&&(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,children:(0,s.jsxs)(v,{variant:"ghost",size:"sm",className:"gap-1 border-0 border-r rounded-r-none hover:bg-transparent",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:k}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsx)(Le,{align:"end",className:"w-48 rounded-lg",children:lt.map(n=>(0,s.jsxs)(ne,{onClick:()=>Ze(n.value),className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:n.label}),ke===n.value&&(0,s.jsx)(L.Check,{className:"size-4 text-primary"})]},n.value))})]}),(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(L.Search,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,s.jsx)(At,{placeholder:G&&ke!=="all"?`Search in ${lt.find(n=>n.value===ke)?.label}...`:"Global search...",value:a??"",onChange:n=>We(n.target.value),className:o("pl-9 h-8 max-w-max",G&&"border-0 rounded-l-none")})]})]}),Wt.length>0&&j&&(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,children:(0,s.jsxs)(v,{variant:"outline",size:"sm",className:o("rounded-lg gap-1",K&&"bg-primary/10 dark:bg-primary/10 border-primary/20 dark:border-primary/20"),children:[(0,s.jsx)(L.Calculator,{className:"size-4"}),(0,s.jsx)("span",{children:"Aggregations"}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsxs)(Le,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[(0,s.jsxs)(ye,{className:"flex items-center justify-between px-4 py-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Column Aggregations"}),K&&(0,s.jsx)(v,{variant:"ghost",size:"sm",onClick:Me,className:"h-6 px-2 text-xs",children:"Clear All"})]}),(0,s.jsx)(Ne,{}),Wt.map(n=>{let h=D[n.id],N=h?.enabled;return(0,s.jsxs)(Ra,{children:[(0,s.jsx)(Ma,{className:"text-sm",children:(0,s.jsxs)("div",{className:"flex items-center w-full gap-2",children:[(0,s.jsx)(St,{checked:N,onCheckedChange:()=>Ue(n.id),className:"data-[state=checked]:bg-primary"}),(0,s.jsx)("span",{className:o("flex-1",N&&"font-medium text-primary"),children:Re(n.id)}),N&&(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[h?.functions?.slice(0,2).map(W=>(0,s.jsx)("div",{className:"w-2 h-2 rounded-full bg-primary",title:La.find(he=>he.value===W)?.label},W)),h?.functions&&h.functions.length>2&&(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:["+",h.functions.length-2]})]})]})}),(0,s.jsxs)(za,{className:"w-48 rounded-lg",children:[(0,s.jsx)(ye,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),La.map(W=>(0,s.jsx)(Zt,{checked:h?.functions?.includes(W.value)||!1,onCheckedChange:()=>Ye(n.id,W.value),className:"py-2 text-sm",children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{children:W.label}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:W.description})]})},W.value))]})]},n.id)}),Wt.length===0&&(0,s.jsxs)("div",{className:"px-3 py-4 text-center",children:[(0,s.jsx)(L.Calculator,{className:"w-8 h-8 mx-auto mb-2 opacity-50 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No numeric columns available for aggregation"})]})]})]}),l&&(0,s.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>l(b),className:"rounded-lg",children:[(0,s.jsx)(L.Download,{className:"size-4"}),"Export"]}),p&&(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,className:"h-7",children:(0,s.jsxs)(v,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[(0,s.jsx)("span",{children:"Columns"}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsxs)(Le,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,s.jsx)(ye,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,s.jsx)(Ne,{}),De().length>0&&(0,s.jsxs)(Go,{children:[(0,s.jsx)(ye,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),De().map(n=>(0,s.jsx)(Zt,{className:"text-sm",checked:n.getIsVisible(),onCheckedChange:h=>n.toggleVisibility(!!h),children:Re(n.id)},n.id))]}),de().map(n=>(0,s.jsxs)(Go,{children:[(0,s.jsx)(Ne,{}),(0,s.jsx)(ye,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:n.id}),n.columns?.filter(h=>h.getCanHide?.()!==!1).map(h=>(0,s.jsx)(Zt,{className:"text-sm",checked:h.getIsVisible(),onCheckedChange:N=>h.toggleVisibility(!!N),children:Re(h.id,n.id)},h.id))]},n.id))]})]}),(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,className:"h-7",children:(0,s.jsx)(v,{variant:"outline",size:"sm",className:"rounded-lg h-7",children:(0,s.jsx)(L.Settings2,{className:"size-4"})})}),(0,s.jsxs)(Le,{align:"end",className:"w-[200px] rounded-lg",children:[(0,s.jsx)(ye,{children:"Table Settings"}),(0,s.jsx)(Ne,{}),(0,s.jsxs)(ne,{onClick:u,children:[(0,s.jsx)(L.ArrowUpDown,{className:"size-4"}),"Clear All Sorting"]}),(0,s.jsxs)(ne,{onClick:it,children:[(0,s.jsx)(L.Filter,{className:"size-4"}),"Clear All Filters"]}),K&&(0,s.jsxs)(ne,{onClick:Me,children:[(0,s.jsx)(L.Calculator,{className:"size-4"}),"Clear Aggregations"]}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ne,{}),(0,s.jsx)(ye,{children:"Column Pinning"}),(0,s.jsxs)(ne,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[(0,s.jsx)(L.PinOff,{className:"size-4"}),"Reset All Pinning"]}),(0,s.jsxs)(ne,{onClick:()=>{let n=je().filter(h=>h.getCanPin?.()!==!1).map(h=>h.id);e.setColumnPinning({left:[],right:n})},children:[(0,s.jsx)(L.Pin,{className:"-rotate-90 size-4"}),"Pin All Right"]})]})]})]}),f&&(0,s.jsx)(v,{variant:"outline",size:"sm",onClick:f,disabled:T,className:"rounded-lg",children:(0,s.jsx)(L.RefreshCw,{className:o("h-4 w-4",T&&"animate-spin")})})]})]})})})})}var Ae=require("radix-ui"),Pt=require("lucide-react");var oe=require("react/jsx-runtime");function Lt({...e}){return(0,oe.jsx)(Ae.Select.Root,{"data-slot":"select",...e})}function Ot({...e}){return(0,oe.jsx)(Ae.Select.Value,{"data-slot":"select-value",...e})}function _t({className:e,size:t="default",children:a,...r}){return(0,oe.jsxs)(Ae.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:o("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,(0,oe.jsx)(Ae.Select.Icon,{asChild:!0,children:(0,oe.jsx)(Pt.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function Vt({className:e,children:t,position:a="popper",...r}){return(0,oe.jsx)(Ae.Select.Portal,{children:(0,oe.jsxs)(Ae.Select.Content,{"data-slot":"select-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...r,children:[(0,oe.jsx)(Un,{}),(0,oe.jsx)(Ae.Select.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,oe.jsx)(Wn,{})]})})}function kt({className:e,children:t,...a}){return(0,oe.jsxs)(Ae.Select.Item,{"data-slot":"select-item",className:o("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[(0,oe.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,oe.jsx)(Ae.Select.ItemIndicator,{children:(0,oe.jsx)(Pt.CheckIcon,{className:"size-4"})})}),(0,oe.jsx)(Ae.Select.ItemText,{children:t})]})}function Un({className:e,...t}){return(0,oe.jsx)(Ae.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,oe.jsx)(Pt.ChevronUpIcon,{className:"size-4"})})}function Wn({className:e,...t}){return(0,oe.jsx)(Ae.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,oe.jsx)(Pt.ChevronDownIcon,{className:"size-4"})})}var Z=require("react/jsx-runtime");function Uo({table:e,config:t}){return t.enabled?(0,Z.jsx)("div",{className:"rounded-xl",children:(0,Z.jsx)("div",{children:(0,Z.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Z.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,Z.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,Z.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,Z.jsxs)(Lt,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[(0,Z.jsx)(_t,{className:"h-9 w-[70px] rounded-lg",children:(0,Z.jsx)(Ot,{})}),(0,Z.jsx)(Vt,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>(0,Z.jsx)(kt,{value:`${a}`,children:a},a))})]})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,Z.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,r)=>{let c=e.getState().pagination.pageIndex,l=c+r;return l<1||l>e.getPageCount()?null:(0,Z.jsx)(v,{variant:l===c+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(l-1),children:l},l)})}),(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}var Oa=require("radix-ui"),_a=require("class-variance-authority");var Ha=require("react/jsx-runtime"),qn=(0,_a.cva)("inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 px-0 min-w-7",default:"h-8 px-1 min-w-8",lg:"h-9 px-2 min-w-10"},bg:{enabled:"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",disabled:""}},defaultVariants:{variant:"default",size:"default",bg:"enabled"}});function Va({className:e,variant:t,size:a,noBg:r,...c}){return(0,Ha.jsx)(Oa.Toggle.Root,{"data-slot":"toggle",className:o(qn({className:e,variant:t,size:a,bg:r?"disabled":"enabled"})),...c})}var M=require("react"),i=require("react/jsx-runtime"),Ea={sum:e=>e.reduce((t,a)=>t+a,0),average:e=>e.length>0?e.reduce((t,a)=>t+a,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((r,c)=>r-c),a=Math.floor(t.length/2);return t.length%2===0?(t[a-1]+t[a])/2:t[a]}};function Wo({data:e,columns:t,filters:a=[],pagination:r={enabled:!1},settings:c={},header:l,footer:f,className:T="",maxHeight:p="100%",loading:b=!1,error:u,emptyMessage:S="No data available",onRowSelectionChange:E,onExport:_,onRefresh:F,onTableReady:D,children:j,isRowDisabled:G,isRowSelectable:k,onExternalSearch:ae,aggregations:w={},onAggregationChange:$,rowClassName:Pe}){let[_e,ue]=(0,M.useState)([]),[ht,ke]=(0,M.useState)([]),[ge,je]=(0,M.useState)({}),[de,De]=(0,M.useState)({}),[Re,fe]=(0,M.useState)(""),[Rt,$e]=(0,M.useState)([]),[it,be]=(0,M.useState)(c.enableColumnPinning?{left:[],right:[]}:{}),[Ve,ve]=(0,M.useState)({}),[Ue,Ye]=(0,M.useState)({group:"all",value:""}),Me=(0,M.useRef)(null),Ce=(0,M.useRef)(null),Ze=(0,M.useRef)(null),We=(0,M.useRef)(null),[Wt,K]=(0,M.useState)(0),[lt,n]=(0,M.useState)(0),[h,N]=(0,M.useState)(0),[W,he]=(0,M.useState)(0),Qe=(0,M.useRef)(null),[qt,co]=(0,M.useState)(!1),{enableSorting:xt=!0,enableFiltering:Jt=!0,enableGlobalFilter:mo=!0,enableColumnVisibility:Xt=!0,enableRowSelection:P=!0,stickyHeader:U=!0,toolbar:z=!1,disableHeaderCheckbox:ze=!1,toolbarPosition:re="default",showSerialNumbers:se=!0,fixedCheckboxColumn:qe=!0,striped:yt=!0,hoverable:xn=!0,compact:Kt=!0,bordered:pa=!0,fullHeight:yn=!1,enableColumnResizing:ua=!1,enableColumnPinning:xe=!0,hideHeader:Cn=!1,selectionMode:dt="multiple",showCheckBox:wn=!0,checkboxColumnPosition:ga=0,rounded:rr=!0,enableGroupedGlobalFilter:Ro=!1,groupedFilterLabel:Nn="Search in"}=c;(0,M.useEffect)(()=>{let g=()=>{Qe.current&&co(Qe.current.scrollTop>0)},x=Qe.current;if(x)return x.addEventListener("scroll",g),()=>x.removeEventListener("scroll",g)},[]),(0,M.useEffect)(()=>{let g=()=>{Me.current&&K(Me.current.offsetHeight+16),Ce.current&&n(Ce.current.offsetHeight+16),Ze.current&&N(Ze.current.offsetHeight+16),We.current&&he(We.current.offsetHeight+16)};g();let x=new ResizeObserver(()=>{setTimeout(g,50)});return Me.current&&x.observe(Me.current),Ce.current&&x.observe(Ce.current),Ze.current&&x.observe(Ze.current),We.current&&x.observe(We.current),()=>{x.disconnect()}},[z,l,re]);let Mo=(g,x)=>x.split(".").reduce((m,d)=>m&&m[d],g),zo=(0,M.useMemo)(()=>{let g=e;return Object.keys(Ve).length>0&&(g=g.filter(x=>Object.entries(Ve).every(([m,d])=>{if(!d||d==="")return!0;let y=Mo(x,m);return typeof d=="string"?String(y).toLowerCase().includes(d.toLowerCase()):y===d}))),Re&&Ro&&(g=g.filter(x=>{if(Ue.group==="all")return Object.keys(x).some(m=>{let d=Mo(x,m);if(d==null)return!1;let y=String(d).toLowerCase(),R=Re.toLowerCase();return y.includes(R)});{let m=Mo(x,Ue.group);if(m==null)return!1;let d=String(m).toLowerCase(),y=Re.toLowerCase();return d.includes(y)}})),g},[e,Ve,Re,Ue,Ro]),Tn=(0,M.useCallback)((g,x)=>{ve(m=>{let d={...m};return x===""||x===null||x===void 0?delete d[g]:d[g]=x,d})},[]),Sn=(0,M.useCallback)((g,x)=>{Ye({group:g,value:x}),fe(x)},[]),Mt=(0,M.useMemo)(()=>{let g=[...t],x=y=>y.map(R=>{if(R.id==="select"||R.id==="serialNumber")return R;let V={...R,enablePinning:!0};return R.columns&&(V.columns=x(R.columns)),V}),m=x(g),d={id:"select",header:({table:y})=>{if(dt==="single")return null;let R=y.getRowModel().rows.filter(ie=>!G?.(ie.original)&&(k?k(ie.original):!0)),V=R.length>0&&R.every(ie=>ie.getIsSelected()),Y=R.some(ie=>ie.getIsSelected());return(0,i.jsx)(St,{checked:V||Y&&"indeterminate",onCheckedChange:ie=>{R.forEach(ce=>ce.toggleSelected(!!ie))},disabled:ze||R.length===0,"aria-label":"Select all selectable rows"})},cell:({row:y})=>{let R=G?G(y.original):!1,V=k?k(y.original):!0;return(0,i.jsx)("div",{className:o("flex justify-center items-center",R&&"opacity-50"),children:dt==="multiple"?(0,i.jsx)(St,{checked:y.getIsSelected(),onCheckedChange:Y=>V&&y.toggleSelected(!!Y),"aria-label":"Select row",disabled:R||!V}):wn?(0,i.jsx)("input",{type:"radio",checked:y.getIsSelected(),onChange:()=>V&&y.toggleSelected(!0),disabled:R||!V,className:"border-primary rounded-full focus:ring-primary w-4 h-4 text-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:dt==="multiple"?40:30};if(P){let y=ga;y<0&&(y=m.length+y+1),y=Math.max(0,Math.min(y,m.length)),m.splice(y,0,d)}if(se){let y={id:"serialNumber",header:"No.",cell:({row:R})=>(0,i.jsx)("div",{className:"font-medium text-muted-foreground text-center",children:R.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};m.unshift(y)}return m},[t,se,P,qe,G,k,dt,ga]),B=(0,Se.useReactTable)({data:zo,columns:Mt,onSortingChange:xt?ue:void 0,onColumnFiltersChange:Jt?ke:void 0,onGlobalFilterChange:mo?fe:void 0,getCoreRowModel:(0,Se.getCoreRowModel)(),getPaginationRowModel:r.enabled?(0,Se.getPaginationRowModel)():void 0,getSortedRowModel:xt?(0,Se.getSortedRowModel)():void 0,getFilteredRowModel:Jt?(0,Se.getFilteredRowModel)():void 0,onColumnVisibilityChange:Xt?je:void 0,onRowSelectionChange:P?De:void 0,onColumnOrderChange:$e,onColumnPinningChange:xe?be:void 0,state:{sorting:xt?_e:void 0,columnFilters:Jt?ht:void 0,columnVisibility:Xt?ge:void 0,rowSelection:P?de:{},globalFilter:Re,columnOrder:Rt,columnPinning:xe?it:{}},initialState:{pagination:r.enabled?{pageSize:r.pageSize||10}:void 0,columnPinning:xe?{left:[...se?["serialNumber"]:[],...P?["select"]:[]],right:[]}:void 0},enableRowSelection:P,enableColumnResizing:ua,enableColumnPinning:xe,columnResizeMode:"onChange"}),fa=(0,M.useMemo)(()=>{if(!w||Object.keys(w).length===0)return{};let g={},x=B.getFilteredRowModel().rows;return Object.entries(w).forEach(([m,d])=>{if(!d?.enabled)return;let y=x.map(V=>{if(d.accessor)return d.accessor(V.original);{let Y=V.getValue(m);return typeof Y=="number"?Y:parseFloat(String(Y))||0}}).filter(V=>V!==null&&!isNaN(V)),R={};d.functions?.forEach(V=>{Ea[V]&&(R[V]=Ea[V](y))}),Object.keys(R).length>0&&(g[m]=R)}),g},[zo,w,B?.getFilteredRowModel().rows]);(0,M.useEffect)(()=>{if(P&&E){let g=B.getFilteredSelectedRowModel().rows.filter(x=>!G?.(x.original)&&(k?k(x.original):!0)).map(x=>x.original);E(g)}},[de,P,E,B,G,k]);let Pn=(0,M.useCallback)(g=>{dt==="single"?(B.resetRowSelection(),g.toggleSelected(!0)):g.toggleSelected()},[dt,B]);(0,M.useEffect)(()=>{D&&D(B)},[B,D]);let kn=(0,M.useCallback)(()=>{ue([])},[]),Dn=(0,M.useCallback)(()=>{ke([]),fe(""),Ye({group:"all",value:""}),ve({})},[]),ba=(g,x)=>{if(!xe)return;let m=[...se?["serialNumber"]:[],...P&&qe?["select"]:[]],d={left:[...(it.left??[]).filter(y=>m.includes(y))],right:[...it.right??[]]};x===!1?(d.left=d.left.filter(y=>y!==g),d.right=d.right.filter(y=>y!==g)):x==="right"?(d.left=d.left.filter(y=>y!==g),d.right.includes(g)||d.right.push(g)):x==="left"&&(d.right=d.right.filter(y=>y!==g),!d.left.includes(g)&&!m.includes(g)&&d.left.push(g)),B.setColumnPinning(d)},Rn=()=>{let g=Object.keys(fa).length>0,x=B.getHeaderGroups()[0]?.headers.some(d=>d.column.columnDef.customFooter),m=se&&B.getFilteredRowModel().rows.length>0&&(g||x);return!g&&!x&&!m?null:(0,i.jsx)(Bo,{className:"bottom-0 z-20 sticky bg-sidebar border-t",children:(0,i.jsx)(tt,{className:"bg-sidebar hover:bg-transparent",children:B.getHeaderGroups()[0]?.headers.map((d,y)=>{let R=d.column.id,V=fa[R],Y=xe&&(d.column.getIsPinned()==="left"||d.column.id==="serialNumber"||d.column.id==="select"&&P),ie=xe&&d.column.getIsPinned()==="right",ce=d.column.id==="serialNumber",ct=d.column.id==="select",me=d.column.columnDef.customFooter;return V||me||ce&&m?(0,i.jsx)(ot,{className:o("px-2 py-2 border-r font-semibold text-sm",Kt&&"py-1",Y&&"sticky left-0 z-30 bg-sidebar/95",ie&&"sticky right-0 z-30 bg-sidebar/95",(ce||ct)&&"sticky left-0 z-30 bg-sidebar/95",me?.className),style:{width:d.getSize()!==150?d.getSize():"auto",minWidth:d.getSize()!==150?d.getSize():"auto",...Y&&{left:ce?0:ct?se&&B.getColumn("serialNumber")?.getSize()||0:po(d.column)},...ie&&{right:uo(d.column)},...ce&&{left:0}},children:(()=>{if(me?.content){let Ct=typeof me.content=="function"?me.content(B):me.content;return(0,i.jsx)("div",{className:o("w-full h-full",me.align==="center"&&"text-center",me.align==="right"&&"text-right",me.align==="left"&&"text-left"),children:Ct})}return V?(0,i.jsx)("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(V).map(([Ct,Fn])=>(0,i.jsxs)("div",{className:"flex justify-between items-center text-muted-foreground",children:[(0,i.jsxs)("span",{className:"text-xs capitalize",children:[Ct,":"]}),(0,i.jsx)("span",{className:"font-medium text-foreground",children:Mn(Ct,Fn)})]},Ct))}):ce&&m?(0,i.jsxs)("div",{className:"text-muted-foreground text-xs text-center",children:["Total: ",B.getFilteredRowModel().rows.length]}):null})()},`agg-${d.id}`):(0,i.jsx)(ot,{className:o("px-0 py-0 border-r",Kt&&"py-0",Y&&"sticky left-0 z-30 bg-sidebar/95",ie&&"sticky right-0 z-30 bg-sidebar/95",(ce||ct)&&"sticky left-0 z-30 bg-sidebar/95"),style:{width:d.getSize()!==150?d.getSize():"auto",minWidth:d.getSize()!==150?d.getSize():"auto",...Y&&{left:ce?0:ct?se&&B.getColumn("serialNumber")?.getSize()||0:po(d.column)},...ie&&{right:uo(d.column)},...ce&&{left:0}}},`agg-${d.id}`)})})})},Mn=(g,x)=>typeof x=="number"?g==="count"||g==="unique"?x.toLocaleString():x.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):x,zn=()=>B.getHeaderGroups().map((g,x)=>(0,i.jsx)(tt,{className:"hover:bg-transparent",children:g.headers.map((m,d)=>{let y=m.depth===0&&m.colSpan>1,R=xe&&(m.column.getIsPinned()==="left"||m.column.id==="serialNumber"||m.column.id==="select"&&P),V=xe&&m.column.getIsPinned()==="right",Y=m.column.getCanSort(),ie=xe&&m.column.columnDef.enablePinning!==!1,ce=m.column.id==="serialNumber",ct=m.column.id==="select",Io=ce||ct&&qe,me=m.column.columnDef.headerAlign||"left",go=w&&w[m.column.id]?.enabled,Ct={left:"justify-start",center:"justify-center",right:"justify-end"}[me];return(0,i.jsxs)(Sa,{colSpan:m.colSpan,className:o("group bg-sidebar px-0 font-semibold text-foreground",!Kt&&"py-2",pa&&d<g.headers.length-1&&"border-r","relative",R&&"sticky left-0 z-25 bg-sidebar",V&&"sticky right-0 z-25 bg-sidebar",(ce||ct)&&"sticky left-0 z-25 bg-sidebar",y?"text-center":"text-left",go&&"border-b-2 border-primary/30"),style:{width:m.getSize()!==150?m.getSize():"auto",minWidth:m.getSize()!==150?m.getSize():"auto",...R&&{left:ce?0:ct?se&&B.getColumn("serialNumber")?.getSize()||0:po(m.column)},...V&&{right:uo(m.column)},...ce&&{left:0}},children:[y?(0,i.jsxs)("div",{className:"flex justify-center items-center",children:[(0,Se.flexRender)(m.column.columnDef.header,m.getContext()),go&&(0,i.jsx)(Q.Calculator,{className:"ml-1 w-3 h-3 text-primary"})]}):(0,i.jsxs)("div",{className:o("relative flex items-center px-2 w-full",Ct),children:[(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[go&&(0,i.jsx)(Q.Calculator,{className:"mr-1 w-3 h-3 text-primary"}),Y&&me==="right"&&(0,i.jsx)("span",{className:"order-2 ml-1",children:m.column.getIsSorted()&&{asc:(0,i.jsx)(Q.ChevronUp,{className:"w-4 h-4"}),desc:(0,i.jsx)(Q.ChevronDown,{className:"w-4 h-4"})}[m.column.getIsSorted()]}),m.isPlaceholder?null:(0,Se.flexRender)(m.column.columnDef.header,m.getContext()),Y&&me!=="right"&&m.column.getIsSorted()&&(0,i.jsx)("span",{className:"order-2 ml-1",children:m.column.getIsSorted()&&{asc:(0,i.jsx)(Q.ChevronUp,{className:"w-4 h-4"}),desc:(0,i.jsx)(Q.ChevronDown,{className:"w-4 h-4"})}[m.column.getIsSorted()]})]}),(Y||ie&&!Io)&&(0,i.jsxs)(Fe,{children:[(0,i.jsx)(Be,{asChild:!0,className:o("absolute",me==="left"&&"right-1",me==="center"&&"right-1",me==="right"&&"left-1"),children:(0,i.jsx)(Va,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 data-[state=open]:opacity-100 hover:opacity-100 group-hover:opacity-70",children:(0,i.jsx)(Q.MoreHorizontal,{className:"w-4 h-4"})})}),(0,i.jsxs)(Le,{align:"end",className:"w-48",children:[Y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ye,{children:"Sorting"}),(0,i.jsxs)(ne,{onClick:()=>m.column.toggleSorting(!1),children:[(0,i.jsx)(Q.ChevronUp,{className:"mr-2 w-4 h-4"}),"Sort Ascending"]}),(0,i.jsxs)(ne,{onClick:()=>m.column.toggleSorting(!0),children:[(0,i.jsx)(Q.ChevronDown,{className:"mr-2 w-4 h-4"}),"Sort Descending"]}),(0,i.jsxs)(ne,{onClick:()=>m.column.clearSorting(),disabled:!m.column.getIsSorted(),children:[(0,i.jsx)(Q.ChevronsUpDown,{className:"mr-2 w-4 h-4"}),"Clear Sort"]}),(0,i.jsx)(Ne,{})]}),ie&&!Io&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ye,{children:"Pin Column"}),(0,i.jsxs)(ne,{onClick:()=>ba(m.column.id,"right"),disabled:m.column.getIsPinned()==="right",children:[(0,i.jsx)(Q.MoveRightIcon,{}),"Pin Right"]}),(0,i.jsxs)(ne,{onClick:()=>ba(m.column.id,!1),disabled:!m.column.getIsPinned(),children:[(0,i.jsx)(Q.PinOffIcon,{}),"Unpin"]})]})]})]})]}),ua&&m.column.getCanResize()&&!y&&m.colSpan===1&&(0,i.jsx)("div",{className:"top-0 right-0 absolute hover:bg-primary opacity-0 hover:opacity-100 bg-border w-1 h-full transition-opacity cursor-col-resize",onMouseDown:m.getResizeHandler()})]},m.id)})},g.id)),po=g=>{if(!xe)return;let x=0,m=B.getLeftHeaderGroups()[0]?.headers||[],d=[...se?["serialNumber"]:[],...P?["select"]:[]];for(let y of m){if(y.id===g.id)break;if(d.includes(y.id)){let R=B.getColumn(y.id);R&&(x+=R.getSize())}}return x},uo=g=>{if(!xe)return;let x=B.getState().columnPinning.right||[],m=x.indexOf(g.id);if(m===-1)return;let d=0;for(let y=m+1;y<x.length;y++){let R=B.getColumn(x[y]);R&&(d+=R.getSize())}return d};if(u)return(0,i.jsx)(at,{className:"shadow-sm rounded-xl w-full",children:(0,i.jsx)(nt,{className:"flex justify-center items-center",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"mb-3 text-red-500 text-2xl",children:"\u26A0\uFE0F"}),(0,i.jsx)("p",{className:"mb-4 text-muted-foreground text-sm",children:u}),F&&(0,i.jsxs)(v,{variant:"outline",size:"sm",onClick:F,className:"rounded-lg",children:[(0,i.jsx)(Q.Loader2,{className:"mr-2 w-4 h-4"}),"Try Again"]})]})})});let An=g=>g&&typeof g=="object"&&"content"in g,He=(0,M.useMemo)(()=>l?An(l)?{content:l.content,align:l.align||"left",className:l.className||"",sticky:l.sticky!==void 0?l.sticky:!0,showOnEmpty:l.showOnEmpty!==void 0?l.showOnEmpty:!0}:{content:l,align:"left",className:"",sticky:!0,showOnEmpty:!0}:null,[l]),Ao=()=>z?(0,i.jsx)($o,{table:B,filters:a,globalFilter:Re,onGlobalFilterChange:fe,enableGlobalFilter:mo,onExport:_,onRefresh:F,loading:b,enableColumnVisibility:Xt,enableColumnPinning:xe,data:zo,onClearSorting:kn,onClearFilters:Dn,onExternalSearch:ae,onCustomFilterChange:Tn,aggregations:w,onAggregationChange:$,enableGroupedGlobalFilter:Ro,groupedFilterLabel:Nn,onGroupedFilterChange:Sn}):null,In=()=>{let g=0;return re==="above-header"&&(g+=lt),He&&(g+=W),re==="below-header"&&(g+=h),g};return(0,i.jsx)(Nt,{children:(0,i.jsxs)("div",{className:o("flex flex-col space-y-2 w-full h-full",T),children:[z&&re==="default"&&(0,i.jsx)("div",{ref:Me,className:"z-40 relative",children:Ao()}),(0,i.jsx)(at,{className:o("shadow-sm overflow-hidden py-0",yn&&"flex-1"),children:(0,i.jsx)(nt,{className:"h-full p-0",children:(0,i.jsxs)("div",{className:"relative flex flex-col justify-between h-full",children:[b&&(0,i.jsx)("div",{className:"z-50 absolute inset-0 flex justify-center items-center bg-background/80 backdrop-blur-sm rounded-xl",children:(0,i.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 shadow-sm px-4 py-3 rounded-lg",children:[(0,i.jsx)(Q.Loader2,{className:"size-5 text-primary animate-spin"}),(0,i.jsx)("span",{className:"font-medium text-muted-foreground text-sm",children:"Loading..."})]})}),(0,i.jsx)("div",{ref:Qe,className:o("relative overflow-auto border-b rounded-t-xl",B.getRowModel().rows?.length===0&&"h-full"),style:{maxHeight:p},children:(0,i.jsxs)(Fo,{className:o("w-full border-collapse relative",B.getRowModel().rows?.length===0&&"h-full"),children:[z&&re==="above-header"&&(0,i.jsx)("thead",{className:"top-0 z-40 sticky bg-sidebar border-b",children:(0,i.jsx)(tt,{className:"hover:bg-transparent",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:"p-2 bg-sidebar border-b shadow-sm",children:(0,i.jsx)("div",{ref:Ce,children:Ao()})})})}),He&&(He.showOnEmpty||B.getRowModel().rows?.length>0)&&(0,i.jsx)("thead",{className:o("sticky bg-sidebar border-b",qt&&"shadow-sm"),style:{top:re==="above-header"?`${lt}px`:"0px",zIndex:35},children:(0,i.jsx)(tt,{className:"hover:bg-transparent",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:o("bg-sidebar p-2 font-semibold text-foreground",Kt?"py-2":"py-4",He.className),children:(0,i.jsx)("div",{ref:We,className:o("flex items-center w-full",He.align==="center"&&"justify-center",He.align==="right"&&"justify-end",He.align==="left"&&"justify-start"),children:typeof He.content=="string"?(0,i.jsx)("span",{className:"font-bold text-foreground text-lg tracking-tight",children:He.content}):He.content})})})}),z&&re==="below-header"&&(0,i.jsx)("thead",{className:o("sticky bg-sidebar border-b",qt&&"shadow-sm"),style:{top:He?`${W}px`:"0px",zIndex:35},children:(0,i.jsx)(tt,{className:"hover:bg-transparent",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:"bg-sidebar p-2",children:(0,i.jsx)("div",{ref:Ze,children:Ao()})})})}),!Cn&&(0,i.jsx)(Na,{className:o("sticky bg-sidebar",qt&&"shadow-sm"),style:{top:`${In()}px`,zIndex:30},children:zn()}),(0,i.jsx)(Ta,{children:B.getRowModel().rows?.length?B.getRowModel().rows.map((g,x)=>{let m=Pe?Pe(g):"";return(0,i.jsx)(tt,{"data-index":x,"data-state":g.getIsSelected()&&"selected",className:o(xn&&"hover:bg-muted/50",yt&&x%2===0&&"bg-muted/20",g.getIsSelected()&&"bg-muted","border-b last:border-b-0",dt==="single"&&"cursor-pointer",m),onClick:()=>{dt==="single"&&Pn(g)},children:g.getVisibleCells().map((d,y)=>{let R=xe&&(d.column.getIsPinned()==="left"||d.column.id==="serialNumber"||d.column.id==="select"&&P),V=xe&&d.column.getIsPinned()==="right",Y=d.column.id==="serialNumber",ie=d.column.id==="select",ce=Y||ie&&qe;return(0,i.jsx)(ot,{className:o(Kt?"py-2":"py-4",pa&&y<g.getVisibleCells().length&&"border-r",R&&"sticky left-0 z-20 bg-sidebar/95",V&&"sticky right-0 z-20 bg-sidebar/95",Y&&"sticky left-0 z-20 bg-sidebar/95","p-1"),style:{width:d.column.getSize()!==150?d.column.getSize():"auto",minWidth:d.column.getSize()!==150?d.column.getSize():"auto",...R&&{left:Y?0:ie?se&&B.getColumn("serialNumber")?.getSize()||0:po(d.column)},...V&&{right:uo(d.column)},...Y&&{left:0}},children:(0,Se.flexRender)(d.column.columnDef.cell,d.getContext())},d.id)})},g.id)}):(0,i.jsx)(tt,{children:(0,i.jsx)(ot,{colSpan:Mt.length,className:"border-0 h-32 text-center",children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,i.jsx)("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),(0,i.jsx)("p",{className:"font-medium text-muted-foreground",children:S})]})})})}),Rn()]})}),f&&(0,i.jsx)("div",{className:"bottom-0 z-10 sticky bg-sidebar w-full",style:{width:"100%",minWidth:"fit-content"},children:(0,i.jsx)(Fo,{children:(0,i.jsx)(Bo,{children:(0,i.jsx)(tt,{className:"bg-sidebar",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:"p-2",children:f})})})})})]})})}),(0,i.jsx)(Uo,{table:B,config:r}),j&&j(B)]})})}var Ga=require("radix-ui");var ja=require("react/jsx-runtime");function so({className:e,orientation:t="horizontal",decorative:a=!0,...r}){return(0,ja.jsx)(Ga.Separator.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var yo=require("lucide-react"),Co=require("framer-motion"),gt=zt(require("react"),1),$a=zt(require("react-dom"),1),ee=require("react/jsx-runtime");function qo({table:e,visible:t,container:a,children:r,className:c,...l}){let[f,T]=gt.useState(!1);gt.useLayoutEffect(()=>{T(!0)},[]),gt.useEffect(()=>{function u(S){S.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e]);let p=a??(f?globalThis.document?.body:null);if(!p||!e)return null;let b=t??e.getFilteredSelectedRowModel().rows.length>0;return $a.createPortal((0,ee.jsx)(Co.AnimatePresence,{children:b&&(0,ee.jsx)(Co.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:o("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",c),...l,children:(0,ee.jsx)(Nt,{children:r})})}),p)}function Jo({size:e="sm",tooltip:t,isPending:a,disabled:r,className:c,children:l,...f}){let T=(0,ee.jsx)(v,{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",c),disabled:r||a,...f,children:a?(0,ee.jsx)(yo.Loader,{className:"animate-spin"}):l});return t?(0,ee.jsxs)(mt,{children:[(0,ee.jsx)(pt,{asChild:!0,children:T}),(0,ee.jsx)(ut,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,ee.jsx)("p",{children:t})})]}):T}function Xo({table:e}){let t=gt.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,ee.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,ee.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,ee.jsx)(so,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,ee.jsxs)(mt,{children:[(0,ee.jsx)(pt,{asChild:!0,children:(0,ee.jsx)(v,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,ee.jsx)(yo.X,{className:"size-3.5"})})}),(0,ee.jsxs)(ut,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,ee.jsx)("p",{children:"Clear selection"}),(0,ee.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,ee.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var Ua=require("lucide-react");var Wa=require("react/jsx-runtime");var qa=require("lucide-react");var Ja=require("react/jsx-runtime");var Jn=require("radix-ui"),Xa=require("class-variance-authority");var Xn=require("react/jsx-runtime"),Bs=(0,Xa.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});var Ka=require("lucide-react"),Ko=require("react/jsx-runtime");var q=require("react"),Zo=require("lucide-react");var Oe=require("lucide-react");var C=require("react/jsx-runtime");function Yo({fields:e,filters:t,globalFilter:a,onGlobalFilterChange:r,fieldFilters:c,onFieldFilterChange:l,sortField:f,sortDirection:T,onSortChange:p,selectedCount:b,totalCount:u,visibleCount:S,onExport:E,onRefresh:_,loading:F,onClearFilters:D,onClearSorting:j}){let G=e.filter(w=>w.sortable),k=Object.values(c).some(w=>w!=null&&w!=="")||a!=="",ae=f!=="";return(0,C.jsx)("div",{className:"rounded-xl p-0.5",children:(0,C.jsx)("div",{className:"px-2",children:(0,C.jsx)("div",{className:"flex flex-col gap-6",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,C.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,C.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,C.jsx)(Oe.Filter,{className:"h-4 w-4"})}),t.map(w=>(0,C.jsx)("div",{className:"relative min-w-[150px]",children:w.type==="select"?(0,C.jsxs)(Lt,{value:c[w.key]||"all",onValueChange:$=>l(w.key,$),children:[w.icon&&(0,C.jsx)(w.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,C.jsx)(_t,{className:o("h-9 rounded-lg w-full",w.icon&&"pl-9"),children:(0,C.jsx)(Ot,{placeholder:w.placeholder||"Select..."})}),(0,C.jsxs)(Vt,{className:"rounded-lg",children:[(0,C.jsx)(kt,{value:"all",children:"All"}),w.options?.map($=>(0,C.jsx)(kt,{value:$.value,children:$.label},$.value))]})]}):(0,C.jsxs)("div",{className:"relative",children:[w.icon&&(0,C.jsx)(w.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,C.jsx)(At,{type:w.type,placeholder:w.placeholder,value:c[w.key]||"",onChange:$=>l(w.key,$.target.value),className:o("h-9 rounded-lg",w.icon&&"pl-9")})]})},String(w.key)))]})}),(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsxs)("div",{className:"relative",children:[(0,C.jsx)(Oe.Search,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,C.jsx)(At,{placeholder:"Global search...",value:a,onChange:w=>r(w.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),G.length>0&&(0,C.jsxs)(Fe,{children:[(0,C.jsx)(Be,{asChild:!0,children:(0,C.jsxs)(v,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[(0,C.jsx)("span",{children:"Sort"}),(0,C.jsx)(Oe.ChevronDown,{className:"h-4 w-4 opacity-50"})]})}),(0,C.jsxs)(Le,{align:"end",className:"w-[200px] rounded-lg",children:[(0,C.jsx)(ye,{children:"Sort By"}),(0,C.jsx)(Ne,{}),G.map(w=>(0,C.jsxs)("div",{children:[(0,C.jsxs)(ne,{onClick:()=>p(w.key,"asc"),children:[w.label," (A-Z)"]}),(0,C.jsxs)(ne,{onClick:()=>p(w.key,"desc"),children:[w.label," (Z-A)"]})]},String(w.key))),ae&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ne,{}),(0,C.jsx)(ne,{onClick:j,children:"Clear All Sorting"})]})]})]}),(0,C.jsxs)(Fe,{children:[(0,C.jsx)(Be,{asChild:!0,children:(0,C.jsx)(v,{variant:"outline",size:"sm",className:"rounded-lg",children:(0,C.jsx)(Oe.Settings2,{className:"h-4 w-4"})})}),(0,C.jsxs)(Le,{align:"end",className:"w-[200px] rounded-lg",children:[(0,C.jsx)(ye,{children:"Table Settings"}),(0,C.jsx)(Ne,{}),(0,C.jsx)(ne,{onClick:j,children:"Clear All Sorting"}),(0,C.jsx)(ne,{onClick:D,children:"Clear All Filters"})]})]}),E&&(0,C.jsxs)(v,{variant:"outline",size:"sm",onClick:E,className:"rounded-lg",children:[(0,C.jsx)(Oe.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),_&&(0,C.jsx)(v,{variant:"outline",size:"sm",onClick:_,disabled:F,className:"rounded-lg",children:(0,C.jsx)(Oe.RefreshCw,{className:o("h-4 w-4",F&&"animate-spin")})})]})]})})})})}var ft=require("lucide-react");var I=require("react/jsx-runtime");function Ya({currentPage:e,totalPages:t,pageSize:a,totalItems:r,onPageChange:c,onPageSizeChange:l,config:f}){if(!f.enabled)return null;let T=f.pageSizeOptions||[10,20,50,100],p=(e-1)*a+1,b=Math.min(e*a,r),u=e>1,S=e<t,E=()=>{let F=[],D=[];for(let j=Math.max(2,e-2);j<=Math.min(t-1,e+2);j++)F.push(j);return e-2>2?D.push(1,"..."):D.push(1),D.push(...F),e+2<t-1?D.push("...",t):t>1&&D.push(t),D};return(0,I.jsx)("div",{className:"rounded-xl",children:(0,I.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[(0,I.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:f.showInfo!==!1&&(0,I.jsxs)("span",{children:["Showing ",p," to ",b," of ",r," entries"]})}),(0,I.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[T&&(0,I.jsxs)("div",{className:"flex items-center gap-2",children:[(0,I.jsx)("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),(0,I.jsxs)(Lt,{value:`${a}`,onValueChange:_=>l(Number(_)),children:[(0,I.jsx)(_t,{className:"h-9 w-[70px] rounded-lg",children:(0,I.jsx)(Ot,{})}),(0,I.jsx)(Vt,{side:"top",className:"rounded-lg",children:T.map(_=>(0,I.jsx)(kt,{value:`${_}`,children:_},_))})]})]}),(0,I.jsxs)("div",{className:"flex items-center gap-2",children:[(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:!u,className:"hidden sm:flex rounded-lg",children:[(0,I.jsx)(ft.ChevronsLeft,{className:"h-4 w-4"}),(0,I.jsx)("span",{className:"sr-only",children:"Go to first page"})]}),(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(e-1),disabled:!u,className:"rounded-lg",children:[(0,I.jsx)(ft.ChevronLeft,{className:"h-4 w-4 sm:mr-2"}),(0,I.jsx)("span",{className:"hidden sm:inline",children:"Previous"}),(0,I.jsx)("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),f.showPageNumbers&&t>1&&(0,I.jsx)("div",{className:"hidden sm:flex items-center gap-1",children:E().map((_,F)=>{if(_==="...")return(0,I.jsx)("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${F}`);let D=_;return(0,I.jsx)(v,{variant:D===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>c(D),children:D},D)})}),(0,I.jsxs)("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]}),(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(e+1),disabled:!S,className:"rounded-lg",children:[(0,I.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,I.jsx)(ft.ChevronRight,{className:"h-4 w-4 sm:ml-2"}),(0,I.jsx)("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(t),disabled:!S,className:"hidden sm:flex rounded-lg",children:[(0,I.jsx)(ft.ChevronsRight,{className:"h-4 w-4"}),(0,I.jsx)("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}var O=require("react/jsx-runtime");function Qo({data:e,template:t,fields:a=[],filters:r=[],pagination:c={enabled:!1},settings:l={},header:f,footer:T,className:p="",loading:b=!1,error:u,emptyMessage:S="No items found",emptyIcon:E,onSelectionChange:_,onExport:F,onRefresh:D,onTemplateReady:j,children:G}){let{enableSorting:k=!0,enableFiltering:ae=!0,enableGlobalSearch:w=!0,enableSelection:$=!1,enableExport:Pe=!1,toolbar:_e=!0,selectionMode:ue="multiple",gridCols:ht={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:ke=4,aspectRatio:ge="auto",minCardWidth:je=350,maxCardWidth:de=350}=l,[De,Re]=(0,q.useState)(""),[fe,Rt]=(0,q.useState)({}),[$e,it]=(0,q.useState)(""),[be,Ve]=(0,q.useState)("asc"),[ve,Ue]=(0,q.useState)(new Set),[Ye,Me]=(0,q.useState)(1),[Ce,Ze]=(0,q.useState)(c.pageSize||12),[We,Wt]=(0,q.useState)(ht.default),K=(0,q.useMemo)(()=>{let P=[...e];if(w&&De){let U=a.filter(z=>z.searchable!==!1);P=P.filter(z=>U.some(ze=>z[ze.key]?.toString().toLowerCase().includes(De.toLowerCase())))}if(ae&&Object.keys(fe).forEach(U=>{let z=fe[U];if(z!=null&&z!==""){let ze=a.find(re=>re.key===U);ze&&(P=P.filter(re=>{let se=re[U];return ze.type==="boolean"?se===(z==="true"):ze.type==="number"?se===Number(z):se?.toString().toLowerCase().includes(String(z).toLowerCase())}))}}),k&&$e){let U=a.find(z=>z.key===$e);U&&P.sort((z,ze)=>{let re=z[$e],se=ze[$e];if(U.type==="number")return be==="asc"?Number(re)-Number(se):Number(se)-Number(re);if(U.type==="date"){let qe=new Date(re),yt=new Date(se);return be==="asc"?qe.getTime()-yt.getTime():yt.getTime()-qe.getTime()}else{let qe=String(re).toLowerCase(),yt=String(se).toLowerCase();return be==="asc"?qe.localeCompare(yt):yt.localeCompare(qe)}})}return P},[e,De,fe,$e,be,a,w,ae,k]),lt=(0,q.useMemo)(()=>{if(!c.enabled)return K;let P=(Ye-1)*Ce,U=P+Ce;return K.slice(P,U)},[K,Ye,Ce,c.enabled]),n=Math.ceil(K.length/Ce),h=(0,q.useCallback)(P=>{$&&Ue(U=>{let z=new Set(U);return ue==="single"?(z.clear(),z.add(P)):z.has(P)?z.delete(P):z.add(P),z})},[$,ue]),N=(0,q.useCallback)(()=>{!$||ue==="single"||(ve.size===K.length?Ue(new Set):Ue(new Set(K.map((P,U)=>U))))},[$,ue,ve.size,K.length]),W=(0,q.useCallback)((P,U)=>{Rt(z=>({...z,[P]:U})),Me(1)},[]),he=(0,q.useCallback)((P,U)=>{it(P),Ve(U)},[]),Qe=(0,q.useCallback)(()=>{Re(""),Rt({}),Me(1)},[]),qt=(0,q.useCallback)(()=>{it(""),Ve("asc")},[]),co=(0,q.useMemo)(()=>({getSelectedItems:()=>Array.from(ve).map(P=>K[P]),clearSelection:()=>Ue(new Set),selectAll:N,getFilteredData:()=>K,getTotalCount:()=>e.length,getVisibleCount:()=>K.length,refresh:()=>D?.(),exportData:()=>F?.(K)}),[ve,K,e.length,N,D,F]),xt=(0,q.useRef)(null);xt.current=co,(0,q.useEffect)(()=>{j&&xt.current&&j(xt.current)},[]),(0,q.useEffect)(()=>{if($&&_){let P=Array.from(ve).map(U=>K[U]);_(P)}},[ve]);let Jt=o("w-full","overflow-hidden",p),mo=o("grid",`gap-${ke}`,"w-full","mx-auto","items-start"),Xt={gridTemplateColumns:We===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${je}px, calc(100%/${We} - ${ke*4}px), ${de}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return u?(0,O.jsx)(at,{className:"w-full",children:(0,O.jsx)(nt,{className:"flex items-center justify-center py-12",children:(0,O.jsxs)("div",{className:"text-center",children:[(0,O.jsx)("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),(0,O.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:u}),D&&(0,O.jsxs)(v,{variant:"outline",size:"sm",onClick:D,children:[(0,O.jsx)(Zo.Loader2,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):(0,O.jsxs)("div",{className:o("w-full flex gap-2 flex-col h-full",Jt),children:[f&&(0,O.jsx)(at,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:(0,O.jsx)(nt,{className:"p-2",children:f})}),_e&&(0,O.jsx)(Yo,{fields:a,filters:r,globalFilter:De,onGlobalFilterChange:Re,fieldFilters:fe,onFieldFilterChange:W,sortField:$e,sortDirection:be,onSortChange:he,selectedCount:ve.size,totalCount:e.length,visibleCount:K.length,onExport:Pe?()=>F?.(K):void 0,onRefresh:D,loading:b,onClearFilters:Qe,onClearSorting:qt}),(0,O.jsx)(at,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:(0,O.jsx)(nt,{className:"px-0",children:(0,O.jsxs)("div",{className:"relative",children:[b&&(0,O.jsx)("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:(0,O.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[(0,O.jsx)(Zo.Loader2,{className:"size-5 animate-spin text-primary"}),(0,O.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),lt.length>0?(0,O.jsx)("div",{className:o(mo),style:Xt,children:lt.map((P,U)=>{let z=c.enabled?(Ye-1)*Ce+U:U,ze=ve.has(z);return(0,O.jsxs)("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",ge==="square"?"aspect-square":"",ge==="video"?"aspect-video":"",$?"cursor-pointer":"",ze?"ring-2 ring-primary":""),onClick:()=>$&&h(z),children:[$&&ue==="multiple"&&(0,O.jsx)("div",{className:"absolute top-2 right-2 z-10",children:(0,O.jsx)(St,{checked:ze,onCheckedChange:()=>h(z),className:"bg-background/80 backdrop-blur-sm",onClick:re=>re.stopPropagation()})}),t(P,U,ze,()=>h(z))]},z)})}):(0,O.jsxs)("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[(0,O.jsx)("div",{className:"text-6xl",children:E||"\u{1F4CB}"}),(0,O.jsx)("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:S}),(De||Object.values(fe).some(P=>P))&&(0,O.jsx)(v,{variant:"outline",onClick:Qe,children:"Clear Filters"})]})]})})}),c.enabled&&(0,O.jsx)("div",{className:"pb-1",children:(0,O.jsx)(Ya,{currentPage:Ye,totalPages:n,pageSize:Ce,totalItems:K.length,onPageChange:Me,onPageSizeChange:P=>{Ze(P),Me(1)},config:c})}),T&&(0,O.jsx)("div",{className:"p-2 m-0.5",children:T}),G&&G(co)]})}var wo=require("lucide-react"),No=require("framer-motion"),bt=zt(require("react"),1),Za=zt(require("react-dom"),1),te=require("react/jsx-runtime");function ea({controller:e,visible:t,container:a,children:r,className:c,...l}){let[f,T]=bt.useState(!1);bt.useLayoutEffect(()=>{T(!0)},[]),bt.useEffect(()=>{function S(E){E.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e]);let p=a??(f?globalThis.document?.body:null);if(!p||!e)return null;let b=e.getSelectedItems(),u=t??b.length>0;return Za.createPortal((0,te.jsx)(No.AnimatePresence,{children:u&&(0,te.jsx)(No.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:o("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-8 ring-primary/5",c),...l,children:(0,te.jsx)(Nt,{children:r})})}),p)}function ta({size:e="sm",variant:t="secondary",tooltip:a,isPending:r,disabled:c,className:l,children:f,onClick:T,...p}){let b=(0,te.jsx)(v,{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",l),disabled:c||r,onClick:T,...p,children:r?(0,te.jsx)(wo.Loader,{className:"animate-spin"}):f});return a?(0,te.jsxs)(mt,{children:[(0,te.jsx)(pt,{asChild:!0,children:b}),(0,te.jsx)(ut,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,te.jsx)("p",{children:a})})]}):b}function oa({controller:e}){let t=bt.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let a=e.getSelectedItems();return(0,te.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,te.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[a.length," selected"]}),(0,te.jsx)(so,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,te.jsxs)(mt,{children:[(0,te.jsx)(pt,{asChild:!0,children:(0,te.jsx)(v,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,te.jsx)(wo.X,{className:"size-3.5"})})}),(0,te.jsxs)(ut,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[(0,te.jsx)("p",{children:"Clear selection"}),(0,te.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,te.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}var en=require("react/jsx-runtime"),Kn={none:"gap-0",tight:"gap-2",default:"gap-4",loose:"gap-6","extra-loose":"gap-8"},Yn={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Qa=({children:e,className:t,spacing:a="tight",padding:r="none"})=>(0,en.jsx)("div",{className:o("flex flex-col h-full",Kn[a],Yn[r],t),children:e});var io=require("lucide-react");var tn=require("react-router"),J=require("react/jsx-runtime"),on=({className:e,columns:t=[],showBackButton:a=!0,meta:r={title:""}})=>{let c=()=>{if(!r.backAction||!a)return null;let u={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return r.backAction.href?(0,J.jsx)(tn.NavLink,{to:r.backAction.href,children:(0,J.jsxs)(v,{...u,children:[(0,J.jsx)(io.ArrowLeftIcon,{className:"size-6"}),r.backAction.content]})}):(0,J.jsxs)(v,{...u,onClick:r.backAction.onClick,children:[(0,J.jsx)(io.ArrowLeftIcon,{className:"size-6"}),r.backAction.content]})},l=()=>!r.metadata||r.metadata.length===0?null:(0,J.jsx)("div",{className:"flex gap-4",children:r.metadata.map((u,S)=>u.value&&(0,J.jsxs)("div",{className:"text-sm",children:[(0,J.jsxs)("span",{className:"text-muted-foreground",children:[u.label," "]}),(0,J.jsx)("span",{children:u.value})]},S))}),f=()=>r.status?(0,J.jsx)("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"}[r.status.color]),children:r.status.content}):null,T={content:(0,J.jsxs)("div",{className:"flex gap-2 items-center",children:[c(),(0,J.jsxs)("div",{className:"flex flex-col gap-2 w-max",children:[(0,J.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:r.title}),f(),r.description&&(0,J.jsx)("p",{className:"text-muted-foreground",children:r.description}),l(),r.breadcrumbs&&r.breadcrumbs.length>0&&(0,J.jsx)("div",{className:"flex items-center text-sm text-muted-foreground",children:r.breadcrumbs.map((u,S)=>(0,J.jsxs)("div",{className:"flex items-center",children:[u.href?(0,J.jsx)("span",{className:"hover:text-primary hover:underline",children:u.label}):(0,J.jsx)("span",{children:u.label}),S<r.breadcrumbs.length-1&&(0,J.jsx)(io.ChevronRight,{className:"mx-2 h-4 w-4"})]},S))})]})]}),align:"left",width:"fill"},p={content:r.primaryActions,align:"right",width:"auto"},b=[T,...t.filter(u=>u!==void 0),p];return(0,J.jsx)("div",{className:o("flex items-center w-full gap-4 p-2",e),children:b.map((u,S)=>(0,J.jsx)("div",{className:o("flex items-center h-full",u.className,{"justify-start":u.align==="left","justify-center":u.align==="center","justify-end":u.align==="right","flex-1":u.width==="fill"}),children:u.content},S))})};var vt=zt(require("react"),1);var Ht=require("radix-ui"),an=require("lucide-react");var Ee=require("react/jsx-runtime");function nn({...e}){return(0,Ee.jsx)(Ht.Dialog.Root,{"data-slot":"sheet",...e})}function aa({...e}){return(0,Ee.jsx)(Ht.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function Zn({className:e,...t}){return(0,Ee.jsx)(Ht.Dialog.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 rn({className:e,children:t,side:a="right",...r}){return(0,Ee.jsxs)(aa,{children:[(0,Ee.jsx)(Zn,{}),(0,Ee.jsxs)(Ht.Dialog.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),...r,children:[t,(0,Ee.jsxs)(Ht.Dialog.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:[(0,Ee.jsx)(an.XIcon,{className:"size-4"}),(0,Ee.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var H=require("react/jsx-runtime"),sn=(0,vt.createContext)(!1),To={"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"]},Et={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Qn=(e,t)=>{let[a,r]=To[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"?r:a,sheetPushClass:e==="right"?a:r}},er="flex flex-col overflow-hidden rounded-2xl relative",tr={default:"bg-background",card:"bg-background shadow-sm border",border:"bg-background border-2",transparent:"bg-transparent"},ln=e=>{let{children:t,className:a,variant:r="default",layout:c="full",header:l,footer:f,headerClassName:T,contentClassName:p,footerClassName:b,parentContainer:u=!1,padding:S=u?"none":"tight"}=e,E=(0,vt.useContext)(sn),[_,F]=(0,vt.useState)(!1),D=vt.default.useCallback(G=>(0,H.jsx)("div",{className:o("flex-1 overflow-auto h-full no-scrollbar",u&&"flex",!u&&Et[S],p),children:G}),[S,u,p]),j=()=>{switch(c){case"split":{let{splitRatio:G="three-fourth",reverse:k=!1}=e;if(!Array.isArray(t)||t.length!==2)return(0,H.jsx)("div",{className:"flex items-center justify-center h-full text-red-500",children:'Error: AppContent with layout="split" requires exactly 2 children'});let[ae,w]=To[G],[$,Pe]=k?[t[1],t[0]]:[t[0],t[1]],[_e,ue]=k?[w,ae]:[ae,w];return(0,H.jsxs)("div",{className:"flex h-full gap-2",children:[(0,H.jsx)("div",{className:o(_e,"overflow-auto"),children:D($)}),(0,H.jsx)("div",{className:o(ue,"overflow-auto"),children:D(Pe)})]})}case"with-sheet":{let{sheetContent:G,sheetWidth:k="four-fifth",sheetSide:ae="right",sheetMode:w="container",sheetClassName:$,isSheetOpen:Pe,onSheetOpenChange:_e,disableOverlay:ue=!0,showSheetOverlay:ht=!0}=e,ke=Pe!==void 0&&_e,ge=ke?Pe:_,je=ke?_e:F;if(w==="container"){let de=Qn(ae,k),De=To[k][0];return ue?(0,H.jsxs)("div",{className:o("flex relative flex-1 overflow-hidden",p),children:[(0,H.jsx)("div",{className:o("h-full overflow-auto transition-all duration-500",ge?de.contentPushClass:"w-full",ge&&"overflow-y-auto overflow-x-hidden"),children:(0,H.jsx)("div",{className:o("h-full",!u&&Et[S]),children:t})}),(0,H.jsx)("div",{className:o(de.container,"transition-all duration-500 ease-in-out h-full",De,ge&&["left","right"].includes(ae)?o(de.sheetPushClass,"overflow-y-auto"):ge?de.transformOpen:o(de.transform,"hidden"),"overflow-y-auto"),children:(0,H.jsx)("div",{className:o(de.content,$,"h-full"),children:G})})]}):(0,H.jsxs)("div",{tabIndex:-1,className:o("flex relative flex-1 overflow-hidden",p),children:[(0,H.jsx)("div",{className:o("h-full overflow-auto w-full transition-all duration-500 relative z-10"),children:(0,H.jsx)("div",{className:o("h-full",!u&&Et[S]),children:t})}),(0,H.jsxs)("div",{tabIndex:-1,className:o("absolute inset-0 z-20",!ge&&"pointer-events-none"),children:[ht&&(0,H.jsx)("div",{className:o("absolute inset-0 bg-black/50 transition-opacity duration-500",ge?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>je(!1)}),(0,H.jsx)("div",{className:o(de.container,"transition-all duration-500 backdrop-blur-2xl ease-in-out h-full absolute",De,ge?"translate-x-0 opacity-100":o(ae==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),"overflow-y-auto"),style:{[ae]:0},tabIndex:-1,children:(0,H.jsx)("div",{className:o(de.content,$,"h-full"),children:G})})]})]})}return(0,H.jsxs)(H.Fragment,{children:[t,(0,H.jsx)(nn,{open:ge,onOpenChange:je,children:(0,H.jsx)(aa,{children:(0,H.jsx)(rn,{side:ae,className:o("fixed bg-background border sm:max-w-full","transition-all duration-500 ease-in-out",To[k][0],$),children:G})})})]})}default:return D(t)}};return(0,H.jsx)(sn.Provider,{value:!0,children:(0,H.jsxs)("div",{className:o(er,tr[r],Et[S],E&&"flex-1",u&&"h-full",!u&&"rounded-2xl",a),children:[l&&(0,H.jsx)("div",{className:o("border-b",T,r==="card"&&!u&&"rounded-t-2xl",r==="border"&&"border-b-2",Et[S]),children:l}),j(),f&&(0,H.jsx)("div",{className:o("border-t",b,r==="card"&&!u&&"rounded-b-2xl",r==="border"&&"border-t-2",Et[S]),children:f})]})})};var So=require("react/jsx-runtime"),dn=({className:e,columns:t=[],meta:a={title:""}})=>{let r={content:(0,So.jsx)("div",{className:"flex items-center gap-4 p-2",children:a.secondaryActions}),align:"right",width:"fill"},c=[...t.filter(l=>l!==void 0),r];return(0,So.jsx)("div",{className:o("flex items-center w-full gap-4",e),children:c.map((l,f)=>(0,So.jsx)("div",{className:o("flex items-center h-full",l.className,{"justify-start":l.align==="left","justify-center":l.align==="center","justify-end":l.align==="right","flex-1":l.width==="fill"}),children:l.content},f))})};var lo=require("react/jsx-runtime");function cn({useTypedAppMeta:e}){return{AppHeader:l=>{let{meta:f}=e();return(0,lo.jsx)(on,{...l,meta:f})},AppFooter:l=>{let{meta:f}=e();return(0,lo.jsx)(dn,{...l,meta:f})},AppContent:l=>(0,lo.jsx)(ln,{...l}),AppContainer:l=>(0,lo.jsx)(Qa,{...l})}}var pe=require("react"),na=require("react/jsx-runtime"),or=(0,pe.createContext)(void 0),mn=({children:e})=>{let[t,a]=(0,pe.useState)({title:"",description:"",breadcrumbs:[]}),r=(0,pe.useCallback)(f=>{a(T=>Object.keys(f).some(b=>JSON.stringify(T[b])!==JSON.stringify(f[b]))?{...T,...f}:T)},[]),c=(0,pe.useCallback)(()=>{a(f=>f.title===""&&f.description===""&&(f.breadcrumbs?.length??0)===0?f:{title:"",description:"",breadcrumbs:[]})},[]),l=(0,pe.useMemo)(()=>({meta:t,setMeta:r,resetMeta:c}),[t,r,c]);return(0,na.jsx)(or.Provider,{value:l,children:e})};function pn(){let e=(0,pe.createContext)(void 0);return{TypedAppMetaProvider:({children:r})=>{let[c,l]=(0,pe.useState)({title:"",description:"",breadcrumbs:[]}),f=(0,pe.useCallback)(b=>{l(u=>Object.keys(b).some(E=>{let _=u[E],F=b[E];return JSON.stringify(_)!==JSON.stringify(F)})?{...u,...b}:u)},[]),T=(0,pe.useCallback)(()=>{l(b=>b.title===""&&b.description===""&&(b.breadcrumbs?.length??0)===0?b:{title:"",description:"",breadcrumbs:[]})},[]),p=(0,pe.useMemo)(()=>({meta:c,setMeta:f,resetMeta:T}),[c,f,T]);return(0,na.jsx)(e.Provider,{value:p,children:r})},useTypedAppMeta:()=>{let r=(0,pe.useContext)(e);if(!r)throw new Error("useTypedAppMeta must be used within a TypedAppMetaProvider");return r},TypedAppMetaContext:e}}var Gt=require("react");function un({useTypedAppMeta:e}){function t(a){let{setMeta:r,resetMeta:c}=e(),l=(0,Gt.useMemo)(()=>{if(a.backAction)return{...a.backAction,onClick:a.backAction.onClick}},[a.backAction?.content,a.backAction?.href,a.backAction?.onClick?.toString()]),f=(0,Gt.useMemo)(()=>a.metadata,[JSON.stringify(a.metadata)]),T=(0,Gt.useMemo)(()=>({...a,backAction:l,metadata:f}),[a.title,a.description,a.breadcrumbs,a.primaryActions,a.secondaryActions,a.pagination,a.status,l,f]);(0,Gt.useEffect)(()=>(r(T),()=>c()),[T,r,c])}return{usePageTemplate:t}}var ra=require("react"),jt=require("lucide-react");var Ie=require("react/jsx-runtime"),Po=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:r,size:c="icon",variant:l="ghost"})=>{let[f,T]=(0,ra.useState)(!1),[p,b]=(0,ra.useState)(!1),u=async()=>{if(!(!t||p)){b(!0);try{await this.copyToClipboard(t),T(!0),setTimeout(()=>T(!1),2e3)}catch(S){console.error("Failed to copy text:",S)}finally{b(!1)}}};return(0,Ie.jsxs)(mt,{children:[(0,Ie.jsx)(pt,{asChild:!0,children:(0,Ie.jsx)(v,{variant:l,size:c,className:o(c==="icon"&&"size-6",r),onClick:u,disabled:p||!t,children:p?(0,Ie.jsx)(jt.Loader2Icon,{className:"animate-spin"}):f?(0,Ie.jsx)(jt.Check,{className:"h-3 w-3"}):a||(0,Ie.jsx)(jt.Copy,{className:"h-3 w-3"})})}),(0,Ie.jsx)(ut,{children:f?"Copied!":p?"Copying...":"Copy to clipboard"})]})};static formatINR(t,a={}){let{prefix:r="",suffix:c="",withSymbol:l=!0,compact:f=!1}=a;if(typeof t!="number"||isNaN(t))return`${r}${l?"\u20B9 ":""}0.00${c}`;let T=t<0,p=Math.abs(t),u=(f&&p>=1e5?this.compactFormatter:this.currencyFormatter).format(p).replace("\u20B9","");return`${r}${T?"- ":""}${l?"\u20B9 ":""}${u}${c}`}static formatDate(t,a={}){let{format:r="dd-mm-yyyy",separator:c="-"}=a,l=new Date(t);if(isNaN(l.getTime()))return"";let f=String(l.getDate()).padStart(2,"0"),T=String(l.getMonth()+1).padStart(2,"0"),p=this.MONTH_NAMES_SHORT[l.getMonth()],b=l.getFullYear();switch(r){case"dd-mmm-yyyy":return`${f}${c}${p}${c}${b}`;case"iso":return l.toISOString().split("T")[0];case"long":return l.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return l.toLocaleDateString("en-IN");default:return`${f}${c}${T}${c}${b}`}}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,r,c)=>["-","'"," "].includes(a)||r>0&&["-","'"].includes(c[r-1])?a:a.charAt(0).toUpperCase()+a.slice(1)).join(""):""}static StatusBadge=({status:t,className:a,showDot:r=!0,capitalize:c=!0,size:l="md",variant:f="outline",customColors:T,icon:p,trueMessage:b="active",falseMessage:u="inactive"})=>{let S=typeof t=="boolean"?t?b:u:typeof t=="number"?t>0?b:u:t.toLowerCase(),E={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"}}},_=E[S.toLowerCase()]||E.inactive,F=T||_[f],D={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},j=c?S.charAt(0).toUpperCase()+S.slice(1):S;return(0,Ie.jsx)("div",{className:"flex justify-center",children:(0,Ie.jsxs)("span",{className:o("inline-flex items-center gap-1.5 rounded-full border font-medium",F.bg,F.text,F.border,D[l],a),children:[r&&(p?(0,Ie.jsx)("span",{className:"flex items-center",children:p}):(0,Ie.jsx)("span",{className:o("size-2 rounded-full",F.dot),"aria-hidden":"true"})),j]})})}};var gn=require("lucide-react"),$t=require("react-router"),X=require("react/jsx-runtime"),sa=()=>{let e=(0,$t.useRouteError)(),t=(0,$t.useNavigate)();return(0,X.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-4 text-center",children:[(0,X.jsx)(gn.AlertTriangleIcon,{className:"h-16 w-16 text-destructive"}),(0,$t.isRouteErrorResponse)(e)?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&(0,X.jsxs)("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[(0,X.jsx)("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),(0,X.jsx)("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),(0,X.jsx)("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)})]}),(0,X.jsx)(v,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};var Xe=require("framer-motion");var A=require("react/jsx-runtime");function ar({size:e=100,strokeWidth:t=2,color:a="currentColor",className:r=""}){return(0,A.jsxs)(Xe.motion.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:r,children:[(0,A.jsx)("title",{children:"Animated Checkmark"}),(0,A.jsx)(Xe.motion.circle,{cx:"50",cy:"50",r:"40",stroke:a,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),(0,A.jsx)(Xe.motion.path,{d:"M30 50L45 65L70 35",stroke:a,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function ia(){return(0,A.jsx)(at,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:(0,A.jsxs)(nt,{className:"space-y-4 flex flex-col items-center justify-center",children:[(0,A.jsx)(Xe.motion.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:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)(Xe.motion.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"}}),(0,A.jsx)(ar,{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)]"})]})}),(0,A.jsxs)(Xe.motion.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:[(0,A.jsx)(Xe.motion.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"}),(0,A.jsx)("div",{className:"flex items-center gap-4",children:(0,A.jsx)(Xe.motion.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:(0,A.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("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:[(0,A.jsx)("title",{children:"From"}),(0,A.jsx)("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("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:"$"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),(0,A.jsx)("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("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:[(0,A.jsx)("title",{children:"To"}),(0,A.jsx)("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("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"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),(0,A.jsx)(Xe.motion.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"})]})]})})}var Dt=require("react/jsx-runtime"),la=()=>(0,Dt.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:(0,Dt.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,Dt.jsx)("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),(0,Dt.jsx)("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});var fn=require("react-router");var bn=require("lucide-react"),ko=require("react-router"),Ge=require("react/jsx-runtime"),da=()=>{let e=(0,fn.useLocation)(),t=(0,ko.useNavigate)(),a=()=>{window.history.length>2?t(-1):t("/")};return(0,Ge.jsxs)("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:[(0,Ge.jsx)(bn.GhostIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Ge.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),(0,Ge.jsxs)("p",{className:"text-xl mb-4",children:["The page ",(0,Ge.jsx)("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),(0,Ge.jsxs)("div",{className:"flex space-x-4",children:[(0,Ge.jsx)(v,{variant:"outline",onClick:a,children:"Go Back"}),(0,Ge.jsx)(v,{variant:"ghost",children:(0,Ge.jsx)(ko.NavLink,{to:"/",children:"Return Home"})})]})]})};var vn=require("lucide-react"),Ut=require("react/jsx-runtime"),ca=()=>(0,Ut.jsxs)("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:[(0,Ut.jsx)(vn.WifiOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Ut.jsx)("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),(0,Ut.jsx)("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});var hn=require("lucide-react");var Do=require("react-router"),Ke=require("react/jsx-runtime"),ma=()=>{let e=(0,Do.useNavigate)();return(0,Ke.jsxs)("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:[(0,Ke.jsx)(hn.ShieldOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Ke.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),(0,Ke.jsx)("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."}),(0,Ke.jsxs)("div",{className:"flex space-x-4",children:[(0,Ke.jsx)(v,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),(0,Ke.jsx)(v,{variant:"ghost",children:(0,Ke.jsx)(Do.NavLink,{to:"/",children:"Go to Home"})})]})]})};0&&(module.exports={AppMetaProvider,CurrencyTransfer,DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTemplate,DataTemplateActionBar,DataTemplateActionBarAction,DataTemplateActionBarSelection,ErrorComponent,GeneralHelper,Loader,NotFound,OfflineUI,Unauthorized,createLayoutComponents,createPageTemplateHook,createTypedAppMetaContext});
|
|
2
|
+
"use strict";var Hr=Object.create;var Qt=Object.defineProperty;var jr=Object.getOwnPropertyDescriptor;var $r=Object.getOwnPropertyNames;var Ur=Object.getPrototypeOf,Wr=Object.prototype.hasOwnProperty;var qr=(e,t)=>{for(var o in t)Qt(e,o,{get:t[o],enumerable:!0})},vn=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $r(t))!Wr.call(e,s)&&s!==o&&Qt(e,s,{get:()=>t[s],enumerable:!(n=jr(t,s))||n.enumerable});return e};var zt=(e,t,o)=>(o=e!=null?Hr(Ur(e)):{},vn(t||!e||!e.__esModule?Qt(o,"default",{value:e,enumerable:!0}):o,e)),Kr=e=>vn(Qt({},"__esModule",{value:!0}),e);var na={};qr(na,{AppContainer:()=>pr,AppContent:()=>hr,AppContentFooter:()=>en,AppContentHeader:()=>Qo,AppFooter:()=>vr,AppHeader:()=>br,AppSheet:()=>tn,CurrencyTransfer:()=>rn,DataTable:()=>Ho,DataTableActionBar:()=>jo,DataTableActionBarAction:()=>$o,DataTableActionBarSelection:()=>Uo,DataTemplate:()=>Ko,DataTemplateActionBar:()=>Jo,DataTemplateActionBarAction:()=>Xo,DataTemplateActionBarSelection:()=>Yo,ErrorComponent:()=>nn,GeneralHelper:()=>fo,Loader:()=>an,NotFound:()=>sn,OfflineUI:()=>ln,Unauthorized:()=>dn,getTableExportView:()=>Ut,readPersistedExternal:()=>Go});module.exports=Kr(na);var we=require("@tanstack/react-table"),Vo=require("lucide-react");var wn=require("radix-ui"),Nn=require("class-variance-authority");var yn=require("clsx"),Cn=require("tailwind-merge");function r(...e){return(0,Cn.twMerge)((0,yn.clsx)(e))}var Tn=require("react/jsx-runtime"),eo=(0,Nn.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] 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 dark:focus-visible:border-ring",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function C({className:e,variant:t,size:o,asChild:n=!1,...s}){let i=n?wn.Slot.Slot:"button";return(0,Tn.jsx)(i,{"data-slot":"button",className:r(eo({variant:t,size:o,className:e})),...s})}var Je=require("react/jsx-runtime");function So({className:e,...t}){return(0,Je.jsx)("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:(0,Je.jsx)("table",{"data-slot":"table",className:r("w-full caption-bottom text-sm",e),...t})})}function Sn({className:e,...t}){return(0,Je.jsx)("thead",{"data-slot":"table-header",className:r("[&_tr]:border-b",e),...t})}function Pn({className:e,...t}){return(0,Je.jsx)("tbody",{"data-slot":"table-body",className:r("[&_tr:last-child]:border-0",e),...t})}function to({className:e,...t}){return(0,Je.jsx)("tfoot",{"data-slot":"table-footer",className:r("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ze({className:e,...t}){return(0,Je.jsx)("tr",{"data-slot":"table-row",className:r("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Dn({className:e,...t}){return(0,Je.jsx)("th",{"data-slot":"table-head",className:r("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function Ve({className:e,...t}){return(0,Je.jsx)("td",{"data-slot":"table-cell",className:r("p-2 align-middle whitespace-nowrap",e),...t})}var Po=require("react/jsx-runtime");function Xe({className:e,...t}){return(0,Po.jsx)("div",{"data-slot":"card",className:r("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ye({className:e,...t}){return(0,Po.jsx)("div",{"data-slot":"card-content",className:r("px-6",e),...t})}var yt=require("radix-ui");var Ze=require("react/jsx-runtime");function Ct({delayDuration:e=0,...t}){return(0,Ze.jsx)(yt.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ot({...e}){return(0,Ze.jsx)(Ct,{children:(0,Ze.jsx)(yt.Tooltip.Root,{"data-slot":"tooltip",...e})})}function nt({...e}){return(0,Ze.jsx)(yt.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function rt({className:e,sideOffset:t=0,children:o,...n}){return(0,Ze.jsx)(yt.Tooltip.Portal,{children:(0,Ze.jsxs)(yt.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:r("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:[o,(0,Ze.jsx)(yt.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var $=require("lucide-react");var kn=require("react/jsx-runtime");function Ft({className:e,type:t,...o}){return(0,kn.jsx)("input",{type:t,"data-slot":"input",className:r("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),...o})}var ge=require("radix-ui"),$t=require("lucide-react");var ae=require("react/jsx-runtime");function Fe({...e}){return(0,ae.jsx)(ge.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function Ae({...e}){return(0,ae.jsx)(ge.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Ie({className:e,sideOffset:t=4,...o}){return(0,ae.jsx)(ge.DropdownMenu.Portal,{children:(0,ae.jsx)(ge.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:r("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),...o})})}function Do({...e}){return(0,ae.jsx)(ge.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function ee({className:e,inset:t,variant:o="default",...n}){return(0,ae.jsx)(ge.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:r("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 oo({className:e,children:t,checked:o,...n}){return(0,ae.jsxs)(ge.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:r("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:o,...n,children:[(0,ae.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,ae.jsx)(ge.DropdownMenu.ItemIndicator,{children:(0,ae.jsx)($t.CheckIcon,{className:"size-4"})})}),t]})}function pe({className:e,inset:t,...o}){return(0,ae.jsx)(ge.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:r("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function fe({className:e,...t}){return(0,ae.jsx)(ge.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:r("bg-border -mx-1 my-1 h-px",e),...t})}function Rn({...e}){return(0,ae.jsx)(ge.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}function Mn({className:e,inset:t,children:o,...n}){return(0,ae.jsxs)(ge.DropdownMenu.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:r("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...n,children:[o,(0,ae.jsx)($t.ChevronRightIcon,{className:"ml-auto size-4"})]})}function zn({className:e,...t}){return(0,ae.jsx)(ge.DropdownMenu.SubContent,{"data-slot":"dropdown-menu-sub-content",className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var Jr=new Set(["select","serialNumber"]);function Ut(e){let t=e.getVisibleLeafColumns().filter(n=>Jr.has(n.id)?!1:!!n.columnDef.exportValue||!!n.accessorFn),o=e.getPrePaginationRowModel().rows;return{columns:t.map(n=>{let s=n.columnDef;return{id:n.id,header:s.exportHeader??(typeof s.header=="string"?s.header:n.id)}}),rows:o.map(n=>t.map(s=>{let i=s.columnDef;return i.exportValue?i.exportValue(n.original):n.getValue(s.id)})),originals:o.map(n=>n.original)}}var dt=require("react");var Jt=require("react"),Ln=require("lucide-react"),En=require("date-fns");var Wt=require("radix-ui");var qt=require("react/jsx-runtime");function Fn({...e}){return(0,qt.jsx)(Wt.Popover.Root,{"data-slot":"popover",...e})}function An({...e}){return(0,qt.jsx)(Wt.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function In({className:e,align:t="center",sideOffset:o=4,...n}){return(0,qt.jsx)(Wt.Popover.Portal,{children:(0,qt.jsx)(Wt.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:r("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})})}var no=zt(require("react"),1),At=require("lucide-react"),Kt=require("react-day-picker");var Qe=require("react/jsx-runtime");function Bn({className:e,classNames:t,showOutsideDays:o=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:i,components:u,...d}){let a=(0,Kt.getDefaultClassNames)();return(0,Qe.jsx)(Kt.DayPicker,{showOutsideDays:o,className:r("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:m=>m.toLocaleString("default",{month:"short"}),...i},classNames:{root:r("w-fit",a.root),months:r("flex gap-4 flex-col md:flex-row relative",a.months),month:r("flex flex-col w-full gap-4",a.month),nav:r("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",a.nav),button_previous:r(eo({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",a.button_previous),button_next:r(eo({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",a.button_next),month_caption:r("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",a.month_caption),dropdowns:r("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",a.dropdowns),dropdown_root:r("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",a.dropdown_root),dropdown:r("absolute bg-popover inset-0 opacity-0",a.dropdown),caption_label:r("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",a.caption_label),table:"w-full border-collapse",weekdays:r("flex",a.weekdays),weekday:r("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",a.weekday),week:r("flex w-full mt-2",a.week),week_number_header:r("select-none w-(--cell-size)",a.week_number_header),week_number:r("text-[0.8rem] select-none text-muted-foreground",a.week_number),day:r("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",a.day),range_start:r("rounded-l-md bg-accent",a.range_start),range_middle:r("rounded-none",a.range_middle),range_end:r("rounded-r-md bg-accent",a.range_end),today:r("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",a.today),outside:r("text-muted-foreground aria-selected:text-muted-foreground",a.outside),disabled:r("text-muted-foreground opacity-50",a.disabled),hidden:r("invisible",a.hidden),...t},components:{Root:({className:m,rootRef:f,...p})=>(0,Qe.jsx)("div",{"data-slot":"calendar",ref:f,className:r(m),...p}),Chevron:({className:m,orientation:f,...p})=>f==="left"?(0,Qe.jsx)(At.ChevronLeftIcon,{className:r("size-4",m),...p}):f==="right"?(0,Qe.jsx)(At.ChevronRightIcon,{className:r("size-4",m),...p}):(0,Qe.jsx)(At.ChevronDownIcon,{className:r("size-4",m),...p}),DayButton:Xr,WeekNumber:({children:m,...f})=>(0,Qe.jsx)("td",{...f,children:(0,Qe.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:m})}),...u},...d})}function Xr({className:e,day:t,modifiers:o,...n}){let s=(0,Kt.getDefaultClassNames)(),i=no.useRef(null);return no.useEffect(()=>{o.focused&&i.current?.focus()},[o.focused]),(0,Qe.jsx)(C,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:r("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",s.day,e),...n})}var be=require("react/jsx-runtime");function Gn({value:e,onChange:t,placeholder:o,mode:n,externalSearch:s,onExternalChange:i,dateFormat:u,triggerClassName:d}){let a=u?u.replace(/Y/g,"y").replace(/D/g,"d"):null,[m,f]=(0,Jt.useState)(!1),[p,g]=(0,Jt.useState)(e);(0,Jt.useEffect)(()=>{g(e)},[e]);let c=y=>{if(y==null)return null;if(y instanceof Date)return isNaN(y.getTime())?null:y;let w=new Date(y);return isNaN(w.getTime())?null:w},z=(y,w)=>{let _=c(y);return _?(0,En.format)(_,w):null},S=y=>{s?i?.(y):t?.(y)},I=()=>{S(p),f(!1)},b=()=>{g(e),f(!1)},F=()=>{let y=n==="single"?null:{from:null,to:null};g(y),S(y),f(!1)},k=()=>{let y=e;if(!y)return o;if(n==="single")return z(y,a||"PPP")??o;if(y.from&&y.to){let w=z(y.from,a||"MMM dd"),_=z(y.to,a||"MMM dd, yyyy");return w&&_?`${w} - ${_}`:o}if(y.from){let w=z(y.from,a||"MMM dd, yyyy");return w?`From ${w}`:o}if(y.to){let w=z(y.to,a||"MMM dd, yyyy");return w?`To ${w}`:o}return o},x=y=>{g(n==="single"?y:y||{from:null,to:null})};return(0,be.jsxs)(Fn,{open:m,onOpenChange:f,children:[(0,be.jsx)(An,{className:"h-8",asChild:!0,children:(0,be.jsxs)(C,{variant:"outline",className:r("w-full justify-start text-left font-normal h-8 rounded-lg",k()===o&&"text-muted-foreground",d),children:[(0,be.jsx)(Ln.Calendar,{className:"mr-2 h-4 w-4 shrink-0"}),k()]})}),(0,be.jsxs)(In,{className:"w-auto p-0",align:"start",children:[(0,be.jsx)("div",{className:"p-3",children:(0,be.jsx)(Bn,{mode:n,selected:p,onSelect:x,numberOfMonths:n==="range"?2:1,className:"rounded-md border",...n==="range"&&{required:!0}})}),(0,be.jsxs)("div",{className:"flex items-center justify-between p-3 border-t",children:[(0,be.jsx)(C,{variant:"ghost",size:"sm",onClick:F,children:"Clear"}),(0,be.jsxs)("div",{className:"flex gap-2",children:[(0,be.jsx)(C,{variant:"outline",size:"sm",onClick:b,children:"Cancel"}),(0,be.jsx)(C,{size:"sm",onClick:I,disabled:n==="range"&&(!p?.from||!p?.to),children:"Apply"})]})]})]})]})}var Nt=require("lucide-react");var ko=require("radix-ui"),_n=require("lucide-react");var ro=require("react/jsx-runtime");function wt({className:e,...t}){return(0,ro.jsx)(ko.Checkbox.Root,{"data-slot":"checkbox",className:r("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,ro.jsx)(ko.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,ro.jsx)(_n.CheckIcon,{className:"size-3.5"})})})}var R=require("react/jsx-runtime"),On=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}],Ro=(e,t)=>(t&&e.startsWith(`${t}.`)?e.replace(`${t}.`,""):e).split("_").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ");function Mo(e,t){t&&Object.keys(e).forEach(o=>{let n=e[o];n&&t(o,{...n,enabled:!1,functions:[]})})}var Vn=e=>e.getAllLeafColumns().filter(t=>t.getCanHide?.()!==!1);function Hn({table:e,aggregations:t,onAggregationChange:o}){let n=Vn(e).filter(d=>d.id==="select"||d.id==="serialNumber"?!1:d.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(a=>{let m=a.getValue(d.id);return typeof m=="number"||typeof m=="string"&&!isNaN(parseFloat(String(m)))||typeof m=="object"&&m!==null&&"props"in m}));if(n.length===0||!o)return null;let s=Object.values(t).some(d=>d?.enabled),i=d=>{let a=t[d];o(d,{enabled:!a?.enabled,functions:a?.functions||["sum","average"]})},u=(d,a)=>{let m=t[d]?.functions||[],f=m.includes(a)?m.filter(p=>p!==a):[...m,a];o(d,{enabled:f.length>0,functions:f})};return(0,R.jsxs)(Fe,{children:[(0,R.jsx)(Ae,{asChild:!0,children:(0,R.jsxs)(C,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[(0,R.jsx)(Nt.Calculator,{className:"size-4"}),(0,R.jsx)("span",{children:"Aggregations"}),(0,R.jsx)(Nt.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,R.jsxs)(Ie,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[(0,R.jsxs)(pe,{className:"flex items-center justify-between px-4 py-2",children:[(0,R.jsx)("span",{className:"text-sm font-medium",children:"Column Aggregations"}),s&&(0,R.jsx)(C,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>Mo(t,o),children:"Clear All"})]}),(0,R.jsx)(fe,{}),n.map(d=>{let a=t[d.id],m=a?.enabled;return(0,R.jsxs)(Rn,{children:[(0,R.jsx)(Mn,{className:"text-sm",children:(0,R.jsxs)("div",{className:"flex items-center w-full gap-2",children:[(0,R.jsx)(wt,{checked:m,onCheckedChange:()=>i(d.id),className:"data-[state=checked]:bg-primary"}),(0,R.jsx)("span",{className:r("flex-1",m&&"font-medium text-primary"),children:Ro(d.id)}),m&&(0,R.jsxs)("div",{className:"flex items-center gap-1",children:[a?.functions?.slice(0,2).map(f=>(0,R.jsx)("div",{className:"w-2 h-2 rounded-full bg-primary",title:On.find(p=>p.value===f)?.label},f)),a?.functions&&a.functions.length>2&&(0,R.jsxs)("div",{className:"text-xs text-muted-foreground",children:["+",a.functions.length-2]})]})]})}),(0,R.jsxs)(zn,{className:"w-48 rounded-lg",children:[(0,R.jsx)(pe,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),On.map(f=>(0,R.jsx)(oo,{checked:a?.functions?.includes(f.value)||!1,onCheckedChange:()=>u(d.id,f.value),className:"py-2 text-sm",children:(0,R.jsxs)("div",{className:"flex flex-col",children:[(0,R.jsx)("span",{children:f.label}),(0,R.jsx)("span",{className:"text-xs text-muted-foreground",children:f.description})]})},f.value))]})]},d.id)})]})]})}function jn({table:e}){let t=Vn(e),o=e.getAllColumns().filter(i=>!e.getAllLeafColumns().includes(i)&&i.columns?.length&&i.columns.some(u=>u.getCanHide?.()!==!1)),n=new Set(o.flatMap(i=>i.columns?.filter(u=>u.getCanHide?.()!==!1).map(u=>u.id)||[])),s=t.filter(i=>!n.has(i.id));return(0,R.jsxs)(Fe,{children:[(0,R.jsx)(Ae,{asChild:!0,children:(0,R.jsxs)(C,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[(0,R.jsx)(Nt.Columns3,{className:"size-4"}),(0,R.jsx)("span",{children:"Columns"}),(0,R.jsx)(Nt.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,R.jsxs)(Ie,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,R.jsx)(pe,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,R.jsx)(fe,{}),s.length>0&&(0,R.jsxs)(Do,{children:[(0,R.jsx)(pe,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),s.map(i=>(0,R.jsx)(oo,{className:"text-sm",checked:i.getIsVisible(),onCheckedChange:u=>i.toggleVisibility(!!u),children:Ro(i.id)},i.id))]}),o.map(i=>(0,R.jsxs)(Do,{children:[(0,R.jsx)(fe,{}),(0,R.jsx)(pe,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:i.id}),i.columns?.filter(u=>u.getCanHide?.()!==!1).map(u=>(0,R.jsx)(oo,{className:"text-sm",checked:u.getIsVisible(),onCheckedChange:d=>u.toggleVisibility(!!d),children:Ro(u.id,i.id)},u.id))]},i.id))]})]})}var he=require("radix-ui"),Tt=require("lucide-react");var Q=require("react/jsx-runtime");function at({...e}){return(0,Q.jsx)(he.Select.Root,{"data-slot":"select",...e})}function it({...e}){return(0,Q.jsx)(he.Select.Value,{"data-slot":"select-value",...e})}function st({className:e,size:t="default",children:o,...n}){return(0,Q.jsxs)(he.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:r("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:[o,(0,Q.jsx)(he.Select.Icon,{asChild:!0,children:(0,Q.jsx)(Tt.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function lt({className:e,children:t,position:o="popper",...n}){return(0,Q.jsx)(he.Select.Portal,{children:(0,Q.jsxs)(he.Select.Content,{"data-slot":"select-content",className:r("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",o==="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:o,...n,children:[(0,Q.jsx)(Yr,{}),(0,Q.jsx)(he.Select.Viewport,{className:r("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,Q.jsx)(Zr,{})]})})}function He({className:e,children:t,...o}){return(0,Q.jsxs)(he.Select.Item,{"data-slot":"select-item",className:r("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),...o,children:[(0,Q.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,Q.jsx)(he.Select.ItemIndicator,{children:(0,Q.jsx)(Tt.CheckIcon,{className:"size-4"})})}),(0,Q.jsx)(he.Select.ItemText,{children:t})]})}function Yr({className:e,...t}){return(0,Q.jsx)(he.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:(0,Q.jsx)(Tt.ChevronUpIcon,{className:"size-4"})})}function Zr({className:e,...t}){return(0,Q.jsx)(he.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:(0,Q.jsx)(Tt.ChevronDownIcon,{className:"size-4"})})}var v=require("react/jsx-runtime"),ce=e=>e.id??e.key;function zo({table:e,filters:t=[],globalFilter:o,onGlobalFilterChange:n,enableGlobalFilter:s=!0,onExport:i,onRefresh:u,loading:d=!1,enableColumnVisibility:a=!0,onClearSorting:m,onClearFilters:f,enableColumnPinning:p=!1,onExternalSearch:g,initialExternalValues:c,aggregations:z={},onAggregationChange:S,groupedFilterLabel:I="Global",showFilterChips:b=!0,initialGroupedField:F,onGroupedFieldChange:k}){let[x,y]=(0,dt.useState)(c??{}),[w,_]=(0,dt.useState)(F??"all"),j=(0,dt.useRef)(c??{}),Y=(0,dt.useRef)(void 0);(0,dt.useEffect)(()=>()=>clearTimeout(Y.current),[]);let W=(l,H,le=!1)=>{let Z={...j.current,[l]:H};j.current=Z,y(Z),clearTimeout(Y.current),le?Y.current=setTimeout(()=>g?.(Z),500):g?.(Z)},me=()=>{clearTimeout(Y.current),j.current={},y({}),_("all"),k?.("all"),f(),g?.({})},Te=l=>t.find(le=>ce(le)===l)?.externalSearch?x[l]??"":e.getColumn(l)?.getFilterValue(),ne=(l,H)=>{let le=t.find(Z=>ce(Z)===l);le?.externalSearch?W(l,H,le.type==="text"):e.getColumn(l)?.setFilterValue(H)},Ue=l=>{_(l),k?.(l),l!=="all"&&n("")},Ee=Object.values(z).some(l=>l?.enabled),kt=l=>!!e.getColumn(ce(l))||!!l.externalSearch,Se=l=>{let H=Te(ce(l));return H==null||H===""?!1:typeof H=="object"?!!(H.from||H.to):!0},gt=l=>l.type==="date"||l.type==="daterange",Ge=l=>{ne(ce(l),gt(l)?null:"")},ft=l=>{let H=Te(ce(l));return l.type==="select"?l.options?.find(le=>le.value===H)?.label??String(H):gt(l)?"set":String(H)},Pe=(l,H)=>{let le=H?.embedded;if(l.type==="select"){let Z=ce(l),bt=Te(Z);return(0,v.jsxs)(at,{value:bt?String(bt):"",onValueChange:De=>ne(Z,De==="__all__"?"":De),children:[(0,v.jsx)(st,{size:"sm",className:r("w-full",le?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":"rounded-lg"),children:(0,v.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[l.icon&&(0,v.jsx)(l.icon,{className:"size-4 shrink-0 text-muted-foreground"}),(0,v.jsx)(it,{placeholder:l.placeholder})]})}),(0,v.jsxs)(lt,{className:"rounded-lg",children:[(0,v.jsx)(He,{value:"__all__",children:"All"}),l.options?.map(De=>(0,v.jsx)(He,{value:De.value,children:De.label},De.value))]})]})}return l.type==="date"||l.type==="daterange"?(0,v.jsx)(Gn,{value:Te(ce(l)),onChange:Z=>ne(ce(l),Z),placeholder:l.placeholder,mode:l.type==="daterange"?"range":"single",dateFormat:l.dateFormat,externalSearch:l.externalSearch,onExternalChange:Z=>W(ce(l),Z),triggerClassName:le?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":void 0}):(0,v.jsxs)("div",{className:"relative w-full",children:[l.icon&&(0,v.jsx)(l.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,v.jsx)(Ft,{placeholder:l.placeholder,value:Te(ce(l))??"",onChange:Z=>{ne(ce(l),Z.target.value)},className:r("h-8",l.icon&&"pl-9",le?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":"rounded-lg"),type:l.type==="number"?"number":"text"})]})},We=t.filter(l=>(l.placement??"bar")==="bar"),se=t.filter(l=>l.placement==="menu"),ye=s&&se.length>0,et=se.filter(Se),qe=e.getState().columnFilters.length>0||!!o||t.some(Se),{left:_e=[],right:Gt=[]}=e.getState().columnPinning,Oe=_e.some(l=>l!=="serialNumber"&&l!=="select")||Gt.length>0,Ke=[{value:"all",label:"All Fields"},...se.map(l=>({value:ce(l),label:l.placeholder}))];return(0,v.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[We.length>0&&(0,v.jsx)($.Filter,{className:"size-4 text-muted-foreground shrink-0"}),We.map(l=>kt(l)?(0,v.jsx)("div",{className:r("relative min-w-[150px]",l.width),children:Pe(l)},ce(l)):null),b&&et.map(l=>(0,v.jsxs)("span",{className:"inline-flex items-center gap-1 h-8 px-2 rounded-lg border bg-muted/50 text-sm",children:[(0,v.jsxs)("span",{className:"text-muted-foreground",children:[l.placeholder,":"]}),(0,v.jsx)("span",{className:"font-medium truncate max-w-[120px]",children:ft(l)}),(0,v.jsx)("button",{type:"button",onClick:()=>Ge(l),className:"ml-1 p-0.5 rounded hover:bg-accent","aria-label":`Clear ${l.placeholder}`,children:(0,v.jsx)($.X,{className:"size-3.5"})})]},`chip-${ce(l)}`)),qe&&(0,v.jsxs)(C,{variant:"ghost",size:"sm",onClick:me,className:"h-8 px-2 rounded-lg text-muted-foreground hover:text-foreground",children:[(0,v.jsx)($.FilterX,{className:"size-4"}),"Clear Filters"]}),(0,v.jsxs)("div",{className:"flex flex-wrap items-center gap-2 ml-auto",children:[s&&(0,v.jsxs)("div",{className:r("flex items-center",ye&&"bg-background border rounded-lg"),children:[ye&&(0,v.jsxs)(Fe,{children:[(0,v.jsx)(Ae,{asChild:!0,children:(0,v.jsxs)(C,{variant:"ghost",size:"sm",className:"gap-1 border border-transparent border-r-border rounded-l-lg rounded-r-none hover:bg-transparent shrink-0 relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:[(0,v.jsx)("span",{className:"text-sm font-medium max-w-28 truncate",children:w==="all"?I:Ke.find(l=>l.value===w)?.label}),(0,v.jsx)($.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,v.jsx)(Ie,{align:"start",className:"w-48 rounded-lg",children:Ke.map(l=>(0,v.jsxs)(ee,{onClick:()=>Ue(l.value),className:"flex items-center justify-between",children:[(0,v.jsx)("span",{children:l.label}),w===l.value&&(0,v.jsx)($.Check,{className:"size-4 text-primary"})]},l.value))})]}),(()=>{let l=ye&&w!=="all"?se.find(H=>ce(H)===w):void 0;return l?(0,v.jsx)("div",{className:"w-48",children:Pe(l,{embedded:!0})}):(0,v.jsxs)("div",{className:"relative",children:[(0,v.jsx)($.Search,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,v.jsx)(Ft,{placeholder:ye?"Search all fields...":"Global search...",value:o??"",onChange:H=>n(H.target.value),className:r("pl-9 h-8 w-48",ye&&"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]")})]})})()]}),(0,v.jsx)(Hn,{table:e,aggregations:z,onAggregationChange:S}),a&&(0,v.jsx)(jn,{table:e}),(0,v.jsxs)(Fe,{children:[(0,v.jsx)(Ae,{asChild:!0,children:(0,v.jsx)(C,{variant:"outline",size:"sm",className:"rounded-lg",children:(0,v.jsx)($.Settings2,{className:"size-4"})})}),(0,v.jsxs)(Ie,{align:"end",className:"w-[200px] rounded-lg",children:[(0,v.jsx)(pe,{children:"Table Settings"}),(0,v.jsx)(fe,{}),i&&(0,v.jsxs)(ee,{onClick:()=>{let l=Ut(e);i(l.originals,l)},children:[(0,v.jsx)($.Download,{className:"size-4"}),"Export"]}),(0,v.jsxs)(ee,{onClick:m,disabled:e.getState().sorting.length===0,children:[(0,v.jsx)($.ArrowUpDown,{className:"size-4"}),"Clear All Sorting"]}),(0,v.jsxs)(ee,{onClick:me,disabled:!qe,children:[(0,v.jsx)($.Filter,{className:"size-4"}),"Clear All Filters"]}),Object.keys(z).length>0&&(0,v.jsxs)(ee,{onClick:()=>Mo(z,S),disabled:!Ee,children:[(0,v.jsx)($.Calculator,{className:"size-4"}),"Clear Aggregations"]}),p&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(fe,{}),(0,v.jsx)(pe,{children:"Column Pinning"}),(0,v.jsxs)(ee,{onClick:()=>e.setColumnPinning({left:[],right:[]}),disabled:!Oe,children:[(0,v.jsx)($.PinOff,{className:"size-4"}),"Reset All Pinning"]})]})]})]}),u&&(0,v.jsx)(C,{variant:"outline",size:"sm",onClick:u,disabled:d,className:"rounded-lg",children:(0,v.jsx)($.RefreshCw,{className:r("h-4 w-4",d&&"animate-spin")})})]})]})}var ao=require("lucide-react");var q=require("react/jsx-runtime");function Qr(e,t,o=1){let n=e+1,s=o*2+5;if(t<=s)return Array.from({length:t},(p,g)=>g+1);let i=Math.max(n-o,1),u=Math.min(n+o,t),d=i>2,a=u<t-1,m=3+o*2,f=[];if(!d&&a){for(let p=1;p<=m;p++)f.push(p);f.push("ellipsis",t)}else if(d&&!a){f.push(1,"ellipsis");for(let p=t-m+1;p<=t;p++)f.push(p)}else{f.push(1,"ellipsis");for(let p=i;p<=u;p++)f.push(p);f.push("ellipsis",t)}return f}function Fo({table:e,config:t}){if(!t)return null;let o=e.getPageCount(),n=e.getState().pagination.pageIndex,s=e.getState().pagination.pageSize,i=e.getFilteredRowModel().rows.length,u="size-8 p-0 rounded-lg";return(0,q.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl",children:[t.showInfo!==!1&&(0,q.jsxs)("span",{className:"hidden text-sm text-muted-foreground sm:inline",children:["Showing ",i===0?0:n*s+1," to"," ",Math.min((n+1)*s,i)," of ",i," entries"]}),(0,q.jsxs)("div",{className:"flex items-center gap-3",children:[(()=>{let d=t.pageSizeOptions??[10,25,50,100,-1];if(d.length===0)return null;let a=d.includes(-1),m=i>0&&s>=i,f=a&&m?"-1":`${s}`;return(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)("span",{className:"hidden text-sm font-medium md:inline",children:"Rows"}),(0,q.jsxs)(at,{value:f,onValueChange:p=>e.setPageSize(p==="-1"?Math.max(i,1):Number(p)),children:[(0,q.jsx)(st,{className:"h-8 w-auto min-w-[4rem] gap-1 rounded-lg",children:(0,q.jsx)(it,{})}),(0,q.jsx)(lt,{side:"top",className:"rounded-lg",children:d.map(p=>(0,q.jsx)(He,{value:`${p}`,children:p===-1?"All":p},p))})]})]})})(),o>1&&(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),"aria-label":"Previous page",className:u,children:(0,q.jsx)(ao.ChevronLeft,{className:"size-4"})}),t.showPageNumbers&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("span",{className:"px-2 text-sm text-muted-foreground tabular-nums sm:hidden",children:[n+1," / ",o]}),(0,q.jsx)("div",{className:"hidden items-center gap-1 sm:flex",children:Qr(n,o).map((d,a)=>d==="ellipsis"?(0,q.jsx)("span",{className:"flex size-8 items-center justify-center text-sm text-muted-foreground",children:"\u2026"},`e${a}`):(0,q.jsx)(C,{variant:d-1===n?"default":"outline",size:"sm",className:r(u,"tabular-nums"),onClick:()=>e.setPageIndex(d-1),"aria-label":`Page ${d}`,"aria-current":d-1===n?"page":void 0,children:d},d))})]}),(0,q.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),"aria-label":"Next page",className:u,children:(0,q.jsx)(ao.ChevronRight,{className:"size-4"})})]})]})]})}var M=require("react");function St(e,t){if(!t)return{};let o=e.getIsPinned();if(!o)return{};let n=e.getSize();return{position:"sticky",left:o==="left"?e.getStart("left"):void 0,right:o==="right"?e.getAfter("right"):void 0,width:n,minWidth:n,maxWidth:n,boxShadow:o==="right"&&e.getIsFirstColumn("right")?"inset 1px 0 0 0 var(--border)":void 0}}var Be=(e,t)=>t||e!==150?e:"auto";function $n(e,t){return{left:[...t,...(e.left??[]).filter(o=>!t.includes(o))],right:(e.right??[]).filter(o=>!t.includes(o))}}function Un(e,t,o,n){if(o===!1)e.setColumnSizing(d=>{let a={...d};return delete a[t],a});else{let d=n.container?.querySelector(`[data-col-id="${t}"]`),a=d?Math.round(d.getBoundingClientRect().width):0;a>0&&e.setColumnSizing(m=>({...m,[t]:a}))}let{alwaysPinnedLeft:s}=n,i=e.getState().columnPinning,u={left:(i.left??[]).filter(d=>s.includes(d)),right:[...i.right??[]]};o==="right"?u.right.includes(t)||u.right.push(t):o==="left"?(u.right=u.right.filter(d=>d!==t),!u.left.includes(t)&&!s.includes(t)&&u.left.push(t)):(u.left=u.left.filter(d=>d!==t),u.right=u.right.filter(d=>d!==t)),e.setColumnPinning(u)}var Wn={sum:e=>e.reduce((t,o)=>t+o,0),average:e=>e.length>0?e.reduce((t,o)=>t+o,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((n,s)=>n-s),o=Math.floor(t.length/2);return t.length%2===0?(t[o-1]+t[o])/2:t[o]}};function qn(e,t){if(!t||Object.keys(t).length===0)return{};let o={},n=e.getFilteredRowModel().rows;return Object.entries(t).forEach(([s,i])=>{if(!i?.enabled)return;let u=n.map(a=>{if(i.accessor)return i.accessor(a.original);let m=a.getValue(s);return typeof m=="number"?m:parseFloat(String(m))}).filter(a=>a!==null&&!isNaN(a)),d={};i.functions?.forEach(a=>{Wn[a]&&(d[a]=Wn[a](u))}),Object.keys(d).length>0&&(o[s]=d)}),o}function Kn(e,t){return typeof t=="number"?e==="count"||e==="unique"?t.toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):t}function ea(e,t){return t.split(".").reduce((o,n)=>o&&o[n],e)}function Jn(e,t=new Set){for(let o of e){let n=o.id??o.accessorKey;n&&t.add(String(n)),o.columns&&Jn(o.columns,t)}return t}function io(e,t){let o=Jn(e),n=[];for(let s of t){if(s.externalSearch)continue;let i=typeof s.filterFn=="function",u=i?s.id:s.key;if(!u||o.has(String(u)))continue;let d=s.key;n.push({id:String(u),accessorFn:d?a=>ea(a,d):()=>null,...i&&{filterFn:(a,m,f)=>s.filterFn(a.original,f)},enableHiding:!1,enableSorting:!1,enablePinning:!1,enableGlobalFilter:!1,meta:{filterOnly:!0}})}return n}var It=require("react/jsx-runtime");function Xn({initialColumns:e,filters:t,showSerialNumbers:o,enableRowSelection:n,selectionMode:s,showCheckbox:i,enableHeaderCheckbox:u,isRowSelectable:d}){let a=p=>p.map(g=>{if(g.id==="select"||g.id==="serialNumber")return g;let c={...g,enablePinning:!0};return g.columns&&(c.columns=a(g.columns)),c}),m=a([...e]),f={id:"select",header:({table:p})=>{if(s==="single")return null;let g=p.getRowModel().rows.filter(S=>d?.(S.original)??!0),c=g.length>0&&g.every(S=>S.getIsSelected()),z=g.some(S=>S.getIsSelected());return(0,It.jsx)(wt,{checked:c||z&&"indeterminate",onCheckedChange:S=>{g.forEach(I=>I.toggleSelected(!!S))},disabled:!u||g.length===0,"aria-label":"Select all selectable rows"})},cell:({row:p})=>{let g=d?.(p.original)??!0;return(0,It.jsx)("div",{className:r("flex justify-center items-center",!g&&"opacity-50"),children:s==="multiple"?(0,It.jsx)(wt,{checked:p.getIsSelected(),onCheckedChange:c=>g&&p.toggleSelected(!!c),"aria-label":"Select row",disabled:!g}):i?(0,It.jsx)("input",{type:"radio",checked:p.getIsSelected(),onChange:()=>g&&p.toggleSelected(!0),disabled:!g,className:"border-primary rounded-full focus:ring-primary w-4 h-4 text-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:s==="multiple"?40:30};return n&&m.unshift(f),o&&m.unshift({id:"serialNumber",header:"No.",cell:({row:p})=>(0,It.jsx)("div",{className:"font-medium text-muted-foreground text-center",children:p.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"}),[...m,...io(e,t)]}var ct=require("react");var Yn="atsui:tbl:v1:",Bo=new Map,Zn=new Map;function Lo(e){try{let t=localStorage.getItem(Yn+e);return t?JSON.parse(t):void 0}catch{return}}function Qn(e,t){try{localStorage.setItem(Yn+e,JSON.stringify(t))}catch{}}function er(e){return e?typeof e=="string"?{key:e}:e:null}function Eo(e,t){return Bo.get(e)??(t?Lo(e):void 0)??{}}function Pt(e,t,o){let n={...Eo(e,t),...o};Bo.set(e,n),t&&Qn(e,n)}var Io=new Map;function tr(e,t){let o=Io.get(e);return o||(o=new Set,Io.set(e,o)),o.add(t),()=>{o.delete(t)}}function so(e){return{...Lo("g:"+e)??{},...Zn.get(e)??{}}}function lo(e,t,o,n){let s=so(e),i=n==null||n==="";if(i?s[o]===void 0:s[o]===n)return;let u={...s};i?delete u[o]:u[o]=n,Zn.set(e,u),t&&Qn("g:"+e,u),Io.get(e)?.forEach(d=>d())}function or(e,t){if(Pt(e.key,e.local,{filters:{},globalFilter:"",external:{},groupedField:"all"}),e.group)for(let o of t)lo(e.group,e.local,o,void 0)}function Go(e){return(Bo.get(e)??Lo(e))?.external??{}}var Ao=new Set;function nr(e){return Ao.has(e)&&console.warn(`[DataTable] persist key "${e}" is used by two mounted tables \u2014 they will overwrite each other's saved state. Give each table a unique key.`),Ao.add(e),()=>{Ao.delete(e)}}var _o=e=>{if(e==null||e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?e:t},rr=e=>{if(e&&typeof e=="object"&&("from"in e||"to"in e)){let t=_o(e.from),o=_o(e.to);return t===e.from&&o===e.to?e:{from:t,to:o}}return _o(e)};function ar(e,t,o){let n=er(e),s=t.map(b=>({id:String(b.id??b.key),shared:b.shared,persist:b.persist!==!1,external:!!b.externalSearch,isDate:b.type==="date"||b.type==="daterange"})),i=(0,ct.useRef)(s);i.current=s;let u=(0,ct.useMemo)(()=>{if(!n)return{columnFilters:[],globalFilter:"",pagination:{pageIndex:0,pageSize:o},external:{},groupedField:"all"};let b=Eo(n.key,n.local),F=n.group?so(n.group):{},k=w=>{let _=w.shared&&n.group?F[w.shared]:b.filters?.[w.id]??b.external?.[w.id];return w.isDate?rr(_):_},x=[],y={};for(let w of s){if(!w.persist)continue;let _=k(w);_==null||_===""||(w.external?y[w.id]=_:x.push({id:w.id,value:_}))}return{columnFilters:x,globalFilter:b.globalFilter??"",pagination:{pageIndex:n.pagination!==!1?b.pagination?.pageIndex??0:0,pageSize:n.pagination!==!1?b.pagination?.pageSize??o:o},external:y,groupedField:b.groupedField??"all"}},[]),d=(0,ct.useRef)(u.pagination.pageIndex),a=(0,ct.useRef)(u.pagination.pageIndex===0);return(0,ct.useEffect)(()=>{if(n)return!n.group&&i.current.some(b=>b.shared)&&console.warn(`[DataTable] persist key "${n.key}": filters use \`shared\` but the table has no \`persist.group\` \u2014 shared is inert. Add a group to enable it.`),nr(n.key)},[]),{enabled:!!n,initial:u,persistFilters:b=>{if(!n)return;let F={};for(let x of b)F[x.id]=x.value;let k={};for(let x of i.current)!x.persist||x.external||(x.shared&&n.group?lo(n.group,n.local,x.shared,F[x.id]):F[x.id]!==void 0&&(k[x.id]=F[x.id]));Pt(n.key,n.local,{filters:k})},persistGlobalFilter:b=>{n&&Pt(n.key,n.local,{globalFilter:b})},persistExternal:b=>{if(!n)return;let F={};for(let k of i.current)!k.persist||!k.external||(k.shared&&n.group?lo(n.group,n.local,k.shared,b[k.id]):b[k.id]!==void 0&&(F[k.id]=b[k.id]));Pt(n.key,n.local,{external:F})},persistPagination:b=>{!n||n.pagination===!1||a.current&&Pt(n.key,n.local,{pagination:{pageIndex:b.pageIndex,pageSize:b.pageSize}})},persistGroupedField:b=>{n&&Pt(n.key,n.local,{groupedField:b})},restorePageIndex:(b,F)=>{if(!n||a.current||b.getCoreRowModel().rows.length===0)return;let k=Math.min(d.current,Math.max(b.getPageCount()-1,0));a.current=!0,k>0&&F({pageIndex:k,pageSize:b.getState().pagination.pageSize})},syncSharedSlots:b=>{if(!n?.group)return;let F=n.group,k=i.current.filter(x=>x.shared&&x.persist&&!x.external);if(k.length!==0)return tr(F,()=>{let x=so(F);for(let y of k){let w=b.getColumn(y.id);if(!w)continue;let _=x[y.shared],j=_===void 0?void 0:y.isDate?rr(_):_,Y=w.getFilterValue();Object.is(Y??void 0,j??void 0)||w.setFilterValue(j)}})},clearAll:()=>{n&&or(n,i.current.filter(b=>b.shared).map(b=>b.shared))}}}var Oo=require("@tanstack/react-table"),te=require("lucide-react");var P=require("react/jsx-runtime");function ir({table:e,aggregations:t,enableColumnPinning:o,enableColumnResizing:n,enableColumnVisibility:s,enableRowSelection:i,fixedCheckboxColumn:u,bordered:d,compact:a,onPinColumn:m}){let f=e.getVisibleLeafColumns().filter(g=>!g.getIsPinned()),p=f[f.length-1]?.id;return(0,P.jsx)(P.Fragment,{children:e.getHeaderGroups().map(g=>(0,P.jsx)(ze,{className:"hover:bg-transparent",children:g.headers.map((c,z)=>{let S=c.depth===0&&c.colSpan>1,I=o&&(c.column.getIsPinned()==="left"||c.column.id==="serialNumber"||c.column.id==="select"&&i),b=o&&c.column.getIsPinned()==="right",F=c.column.getCanSort(),k=o&&c.column.columnDef.enablePinning!==!1,x=c.column.id==="serialNumber",y=c.column.id==="select",w=x||y&&u,_=c.column.columnDef.headerAlign||"left",j=t&&t[c.column.id]?.enabled,Y=s&&!w&&c.column.getCanHide(),W=F||k&&!w||Y,me=c.column.getIsSorted(),Te={left:"justify-start",center:"justify-center",right:"justify-end"}[_];return(0,P.jsxs)(Dn,{colSpan:c.colSpan,"data-col-id":S?void 0:c.column.id,className:r("group bg-sidebar px-0 font-semibold text-foreground",!a&&"py-2",d&&z<g.headers.length-1&&c.column.id!==p&&"border-r","relative",I&&"sticky left-0 z-25 bg-sidebar/95",b&&"sticky right-0 z-25 bg-sidebar/95",(x||y)&&"sticky left-0 z-25 bg-sidebar/95",S?"text-center":"text-left"),style:{width:Be(c.getSize(),I||b),minWidth:Be(c.getSize(),I||b),...St(c.column,o)},children:[S?(0,P.jsxs)("div",{className:"flex justify-center items-center",children:[(0,Oo.flexRender)(c.column.columnDef.header,c.getContext()),j&&(0,P.jsx)(te.Calculator,{className:"ml-1 w-3 h-3 text-primary"})]}):(0,P.jsxs)("div",{className:r("relative flex items-center px-2 w-full",Te,F&&"cursor-pointer select-none"),onClick:F?ne=>{ne.target.closest("button, a, input, select, [role=button], [role=checkbox]")||c.column.getToggleSortingHandler()?.(ne)}:void 0,children:[(0,P.jsxs)("div",{className:r("flex items-center gap-1 min-w-0 max-w-full",me&&"pr-6"),children:[j&&(0,P.jsx)(te.Calculator,{className:"mr-1 w-3 h-3 text-primary shrink-0"}),c.isPlaceholder?null:(0,P.jsx)("span",{className:"truncate",children:(0,Oo.flexRender)(c.column.columnDef.header,c.getContext())})]}),(W||F)&&(0,P.jsxs)("div",{className:"absolute inset-y-0 right-0 flex items-center pl-8 pr-1 pointer-events-none",children:[(0,P.jsx)("div",{className:r("absolute inset-0 bg-gradient-to-l from-sidebar from-45% to-transparent","transition-opacity duration-200 ease-out","opacity-0 group-hover:opacity-100 group-has-[[data-state=open]]:opacity-100")}),F&&(0,P.jsx)("span",{className:"relative shrink-0",children:me?me==="asc"?(0,P.jsx)(te.ChevronUp,{className:"w-4 h-4"}):(0,P.jsx)(te.ChevronDown,{className:"w-4 h-4"}):(0,P.jsx)(te.ChevronsUpDown,{className:"w-3.5 h-3.5 opacity-0 group-hover:opacity-40 transition-opacity"})}),W&&(0,P.jsxs)(Fe,{children:[(0,P.jsx)(Ae,{asChild:!0,children:(0,P.jsx)(C,{variant:"ghost",size:"icon",tabIndex:-1,"aria-label":"Column options",onClick:ne=>ne.stopPropagation(),className:r("relative size-6 rounded-sm pointer-events-auto overflow-hidden","bg-sidebar hover:bg-border dark:bg-sidebar dark:hover:bg-accent","w-0 opacity-0 ml-0 group-hover:w-5 group-hover:opacity-100",F&&"group-hover:ml-0.5","data-[state=open]:w-5 data-[state=open]:opacity-100",F&&"data-[state=open]:ml-0.5","transition-all duration-200 ease-out"),children:(0,P.jsx)(te.MoreHorizontal,{className:"w-4 h-4"})})}),(0,P.jsxs)(Ie,{align:"end",className:"w-48",onClick:ne=>ne.stopPropagation(),children:[F&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(pe,{children:"Sorting"}),(0,P.jsxs)(ee,{onClick:()=>c.column.toggleSorting(!1),disabled:me==="asc",children:[(0,P.jsx)(te.ChevronUp,{className:"mr-2 w-4 h-4"}),"Sort Ascending"]}),(0,P.jsxs)(ee,{onClick:()=>c.column.toggleSorting(!0),disabled:me==="desc",children:[(0,P.jsx)(te.ChevronDown,{className:"mr-2 w-4 h-4"}),"Sort Descending"]}),(0,P.jsxs)(ee,{onClick:()=>c.column.clearSorting(),disabled:!me,children:[(0,P.jsx)(te.ChevronsUpDown,{className:"mr-2 w-4 h-4"}),"Clear Sort"]}),(k&&!w||Y)&&(0,P.jsx)(fe,{})]}),k&&!w&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(pe,{children:"Pin Column"}),(0,P.jsxs)(ee,{onClick:()=>m(c.column.id,"right"),disabled:c.column.getIsPinned()==="right",children:[(0,P.jsx)(te.MoveRightIcon,{}),"Pin Right"]}),(0,P.jsxs)(ee,{onClick:()=>m(c.column.id,!1),disabled:!c.column.getIsPinned(),children:[(0,P.jsx)(te.PinOffIcon,{}),"Unpin"]}),Y&&(0,P.jsx)(fe,{})]}),Y&&(0,P.jsxs)(ee,{onClick:()=>c.column.toggleVisibility(!1),children:[(0,P.jsx)(te.EyeOff,{className:"mr-2 w-4 h-4"}),"Hide Column"]})]})]})]})]}),(0,P.jsx)("div",{className:r("absolute bottom-0 inset-x-0 pointer-events-none",j?"h-0.5 bg-primary/40":"h-px bg-border")}),n&&c.column.getCanResize()&&!S&&c.colSpan===1&&(0,P.jsx)("div",{className:"top-0 right-0 absolute hover:bg-primary opacity-0 hover:opacity-100 bg-border w-1 h-full transition-opacity cursor-col-resize select-none touch-none",onMouseDown:c.getResizeHandler(),onTouchStart:c.getResizeHandler(),onClick:ne=>ne.stopPropagation()})]},c.id)})},g.id))})}var xe=require("react/jsx-runtime");function sr({table:e,columnAggregations:t,aggregations:o,enableColumnPinning:n,enableRowSelection:s,showSerialNumbers:i,compact:u}){let d=Object.keys(t).length>0,a=e.getHeaderGroups()[0]?.headers.some(c=>c.column.columnDef.customFooter),m=i&&e.getFilteredRowModel().rows.length>0&&(d||a),f=e.getHeaderGroups()[0]?.headers.length??0,p=e.getVisibleLeafColumns().filter(c=>!c.getIsPinned()),g=p[p.length-1]?.id;return!d&&!a&&!m?null:(0,xe.jsx)(to,{className:"bottom-0 z-20 sticky bg-sidebar border-t-0 shadow-[0_1px_0_0_var(--border)]",children:(0,xe.jsx)(ze,{className:"bg-sidebar hover:bg-transparent",children:e.getHeaderGroups()[0]?.headers.map((c,z)=>{let S=c.column.id,I=t[S],b=n&&(c.column.getIsPinned()==="left"||c.column.id==="serialNumber"||c.column.id==="select"&&s),F=n&&c.column.getIsPinned()==="right",k=c.column.id==="serialNumber",x=c.column.id==="select",w=c.column.columnDef.customFooter;return I||w||k&&m?(0,xe.jsxs)(Ve,{className:r("relative px-2 py-2 font-semibold text-sm",z<f-1&&"border-r",u&&"py-1",b&&"sticky left-0 z-30 bg-sidebar",F&&"sticky right-0 z-30 bg-sidebar",(k||x)&&"sticky left-0 z-30 bg-sidebar",w?.className),style:{width:Be(c.getSize(),b||F),minWidth:Be(c.getSize(),b||F),...St(c.column,n)},children:[(0,xe.jsx)("div",{className:"absolute top-0 inset-x-0 h-px bg-border pointer-events-none"}),(()=>{if(w?.content){let j=typeof w.content=="function"?w.content(e):w.content;return(0,xe.jsx)("div",{className:r("w-full h-full",w.align==="center"&&"text-center",w.align==="right"&&"text-right",w.align==="left"&&"text-left"),children:j})}return I?(0,xe.jsx)("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(I).map(([j,Y])=>(0,xe.jsxs)("div",{className:"flex justify-between items-center text-muted-foreground",children:[(0,xe.jsx)("span",{className:"text-xs capitalize",children:j}),(0,xe.jsx)("span",{className:"font-medium text-foreground",children:o?.[S]?.format?.(Y,j)??Kn(j,Y)})]},j))}):k&&m?(0,xe.jsxs)("div",{className:"text-muted-foreground text-xs text-center",children:["Total ",e.getFilteredRowModel().rows.length]}):null})()]},`agg-${c.id}`):(0,xe.jsx)(Ve,{className:r("relative px-0 py-0",z<f-1&&c.column.id!==g&&"border-r",u&&"py-0",b&&"sticky left-0 z-30 bg-sidebar",F&&"sticky right-0 z-30 bg-sidebar",(k||x)&&"sticky left-0 z-30 bg-sidebar"),style:{width:Be(c.getSize(),b||F),minWidth:Be(c.getSize(),b||F),...St(c.column,n)},children:(0,xe.jsx)("div",{className:"absolute top-0 inset-x-0 h-px bg-border pointer-events-none"})},`agg-${c.id}`)})})})}var T=require("react/jsx-runtime");function Ho({data:e,columns:t,filters:o=[],pagination:n,settings:s={},header:i,footer:u,className:d="",maxHeight:a="100%",loading:m=!1,error:f,emptyMessage:p="No data available",onRowSelectionChange:g,onExport:c,onRefresh:z,onTableReady:S,children:I,isRowSelectable:b,getRowId:F,defaultSelectedRows:k,onExternalSearch:x,aggregations:y={},onAggregationChange:w,rowClassName:_,persist:j}){let Y=!!n,W=ar(j,o,n?.pageSize||10),me=(0,M.useRef)(W.initial.external),[Te,ne]=(0,M.useState)([]),[Ue,Ee]=(0,M.useState)(W.initial.columnFilters),[kt,Se]=(0,M.useState)(W.initial.pagination),[gt,Ge]=(0,M.useState)(()=>Object.fromEntries(io(t,o).map(h=>[h.id,!1]))),[ft,Pe]=(0,M.useState)({}),[We,se]=(0,M.useState)(W.initial.globalFilter),[ye,et]=(0,M.useState)([]),[qe,_e]=(0,M.useState)(s.enableColumnPinning!==!1?{left:[...s.showSerialNumbers!==!1?["serialNumber"]:[],...s.enableRowSelection!==!1?["select"]:[]],right:[]}:{}),Gt=(0,M.useRef)(null),Oe=(0,M.useRef)(null),Ke=(0,M.useRef)(null),l=(0,M.useRef)(null),[H,le]=(0,M.useState)(0),[Z,bt]=(0,M.useState)(0),[De,ho]=(0,M.useState)(0),tt=(0,M.useRef)(null),[_t,Yt]=(0,M.useState)(!1),{enableSorting:xt=!0,enableFiltering:Ot=!0,enableGlobalFilter:Vt=!0,enableColumnVisibility:Rt=!0,enableRowSelection:D=!0,showToolbar:L=!1,enableHeaderCheckbox:E=!0,toolbarPosition:oe="default",showSerialNumbers:re=!0,fixedCheckboxColumn:ke=!0,striped:ht=!0,hoverable:vt=!0,compact:Zt=!0,bordered:vo=!0,fullHeight:cn=!1,enableColumnResizing:un=!1,enableColumnPinning:Re=!0,showHeader:Pr=!0,selectionMode:Mt="multiple",showCheckbox:mn=!0,groupedFilterLabel:Dr="Global",showFilterChips:kr=!0}=s;(0,M.useEffect)(()=>{o.length>0&&!L&&console.warn("[DataTable] `filters` are provided but settings.showToolbar is off \u2014 filters live in the toolbar, so none will render."),o.some(h=>h.placement==="menu")&&!Vt&&console.warn("[DataTable] placement:'menu' filters are reached through the global search's field picker \u2014 with enableGlobalFilter off they are unreachable (only their chips would show).")},[]),(0,M.useEffect)(()=>{let h=()=>{tt.current&&Yt(tt.current.scrollTop>0)},V=tt.current;if(V)return V.addEventListener("scroll",h),()=>V.removeEventListener("scroll",h)},[]),(0,M.useEffect)(()=>{let h=()=>{Oe.current&&le(Oe.current.offsetHeight+16),Ke.current&&bt(Ke.current.offsetHeight+16),l.current&&ho(l.current.offsetHeight+16)};h();let V=new ResizeObserver(()=>{setTimeout(h,50)});return Oe.current&&V.observe(Oe.current),Ke.current&&V.observe(Ke.current),l.current&&V.observe(l.current),()=>{V.disconnect()}},[L,i,oe]);let Rr=h=>Ee(V=>{let de=typeof h=="function"?h(V):h;return W.persistFilters(de),de}),pn=h=>se(V=>{let de=typeof h=="function"?h(V):h;return W.persistGlobalFilter(de),de}),Mr=h=>Se(V=>{let de=typeof h=="function"?h(V):h;return W.persistPagination(de),de}),zr=h=>{me.current=h,W.persistExternal(h),x?.(h)},yo=(0,M.useMemo)(()=>Xn({initialColumns:t,filters:o,showSerialNumbers:re,enableRowSelection:D,selectionMode:Mt,showCheckbox:mn,enableHeaderCheckbox:E,isRowSelectable:b}),[t,o,re,D,b,Mt,mn,E]),O=(0,we.useReactTable)({data:e,columns:yo,getRowId:F,onSortingChange:xt?ne:void 0,onColumnFiltersChange:Ot?Rr:void 0,onGlobalFilterChange:Vt?pn:void 0,getCoreRowModel:(0,we.getCoreRowModel)(),getPaginationRowModel:Y?(0,we.getPaginationRowModel)():void 0,getSortedRowModel:xt?(0,we.getSortedRowModel)():void 0,getFilteredRowModel:Ot?(0,we.getFilteredRowModel)():void 0,onColumnVisibilityChange:Rt?Ge:void 0,onRowSelectionChange:D?Pe:void 0,onColumnOrderChange:et,onColumnPinningChange:Re?h=>_e(V=>$n(typeof h=="function"?h(V):h,[...re?["serialNumber"]:[],...D?["select"]:[]])):void 0,state:{sorting:xt?Te:void 0,columnFilters:Ot?Ue:void 0,columnVisibility:Rt?gt:void 0,rowSelection:D?ft:{},globalFilter:We,pagination:Y?kt:void 0,columnOrder:ye,columnPinning:Re?qe:{}},onPaginationChange:Y?Mr:void 0,initialState:{columnPinning:Re?{left:[...re?["serialNumber"]:[],...D?["select"]:[]],right:[]}:void 0},enableRowSelection:D?h=>b?.(h.original)??!0:!1,enableColumnResizing:un,enableColumnPinning:Re,columnResizeMode:"onChange"}),Co=(0,M.useMemo)(()=>qn(O,y),[O,y,e,Ue,We]),Fr=(0,M.useMemo)(()=>Object.keys(Co).length>0||yo.some(h=>h.customFooter),[Co,yo]),gn=(0,M.useRef)({onRowSelectionChange:g,isRowSelectable:b});gn.current={onRowSelectionChange:g,isRowSelectable:b};let fn=(0,M.useRef)(!1);(0,M.useEffect)(()=>{if(fn.current||!k||!D)return;let h=O.getCoreRowModel().rows;if(h.length===0)return;let V={};for(let de of h)de.getCanSelect()&&k(de.original)&&(V[de.id]=!0);fn.current=!0,Object.keys(V).length>0&&Pe(V)},[k,D,O,e]),(0,M.useEffect)(()=>{let{onRowSelectionChange:h,isRowSelectable:V}=gn.current;if(D&&h){let de=O.getFilteredSelectedRowModel().rows.filter(jt=>V?.(jt.original)??!0).map(jt=>jt.original);h(de)}},[ft,D,O]);let Ar=(0,M.useCallback)(h=>{Mt==="single"?(O.resetRowSelection(),h.toggleSelected(!0)):h.toggleSelected()},[Mt,O]),bn=(0,M.useRef)(S);bn.current=S,(0,M.useEffect)(()=>{bn.current?.(O)},[O]);let xn=(0,M.useRef)(!1);(0,M.useEffect)(()=>{xn.current||(xn.current=!0,Object.keys(W.initial.external).length>0&&x?.(W.initial.external))},[]),(0,M.useEffect)(()=>W.syncSharedSlots(O),[O]),(0,M.useEffect)(()=>{Y&&W.restorePageIndex(O,Se)},[e]);let Ir=(0,M.useCallback)(()=>{ne([])},[]),Br=(0,M.useCallback)(()=>{Ee([]),se(""),W.clearAll()},[]),Lr=(h,V)=>{Re&&Un(O,h,V,{container:tt.current,alwaysPinnedLeft:[...re?["serialNumber"]:[],...D&&ke?["select"]:[]]})},Er=h=>h&&typeof h=="object"&&"content"in h,Me=(0,M.useMemo)(()=>i?Er(i)?{content:i.content,align:i.align||"left",className:i.className||"",showOnEmpty:i.showOnEmpty!==void 0?i.showOnEmpty:!0}:{content:i,align:"left",className:"",showOnEmpty:!0}:null,[i]);if(f)return(0,T.jsx)(Xe,{className:"shadow-sm rounded-xl w-full",children:(0,T.jsx)(Ye,{className:"flex justify-center items-center",children:(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsx)("div",{className:"mb-3 text-red-500 text-2xl",children:"\u26A0\uFE0F"}),(0,T.jsx)("p",{className:"mb-4 text-muted-foreground text-sm",children:f}),z&&(0,T.jsxs)(C,{variant:"outline",size:"sm",onClick:z,className:"rounded-lg",children:[(0,T.jsx)(Vo.Loader2,{className:"mr-2 w-4 h-4"}),"Try Again"]})]})})});let wo=()=>L?(0,T.jsx)(zo,{table:O,filters:o,globalFilter:We,onGlobalFilterChange:h=>pn(h),enableGlobalFilter:Vt,onExport:c,onRefresh:z,loading:m,enableColumnVisibility:Rt,enableColumnPinning:Re,showFilterChips:kr,onClearSorting:Ir,onClearFilters:Br,onExternalSearch:zr,initialExternalValues:me.current,aggregations:y,onAggregationChange:w,groupedFilterLabel:Dr,initialGroupedField:W.initial.groupedField,onGroupedFieldChange:W.persistGroupedField}):null,Gr=()=>{let h=0;return oe==="above-header"&&(h+=H),Me&&(h+=De),oe==="below-header"&&(h+=Z),h},hn=O.getVisibleLeafColumns().filter(h=>!h.getIsPinned()),_r=hn[hn.length-1]?.id,Ht=Math.max(O.getVisibleLeafColumns().length,1);return(0,T.jsx)(Ct,{children:(0,T.jsxs)("div",{className:r("flex flex-col space-y-2 w-full h-full p-1",d),children:[L&&oe==="default"&&(0,T.jsx)("div",{ref:Gt,className:"z-40 relative",children:wo()}),(0,T.jsx)(Xe,{className:r("shadow-sm overflow-hidden py-0",cn&&"flex-1 min-h-0"),children:(0,T.jsx)(Ye,{className:"h-full p-0",children:(0,T.jsxs)("div",{className:"relative flex flex-col justify-between h-full",children:[m&&(0,T.jsx)("div",{className:"z-50 absolute inset-0 flex justify-center items-center bg-background/80 rounded-xl",children:(0,T.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 shadow-sm px-4 py-3 rounded-lg",children:[(0,T.jsx)(Vo.Loader2,{className:"size-5 text-primary animate-spin"}),(0,T.jsx)("span",{className:"font-medium text-muted-foreground text-sm",children:"Loading..."})]})}),(0,T.jsx)("div",{ref:tt,className:r("relative overflow-auto rounded-t-xl",cn?"flex-1 min-h-0":O.getRowModel().rows?.length===0&&"h-full"),style:{maxHeight:a},children:(0,T.jsxs)(So,{className:r("w-full border-separate border-spacing-0 relative",O.getState().columnSizingInfo.isResizingColumn&&"select-none",O.getRowModel().rows?.length===0&&"h-full"),children:[L&&oe==="above-header"&&(0,T.jsx)("thead",{className:"top-0 z-40 sticky bg-sidebar border-b",children:(0,T.jsx)(ze,{className:"hover:bg-transparent",children:(0,T.jsx)(Ve,{colSpan:Ht,className:"p-2 bg-sidebar border-b shadow-sm",children:(0,T.jsx)("div",{ref:Oe,children:wo()})})})}),Me&&(Me.showOnEmpty||O.getRowModel().rows?.length>0)&&(0,T.jsx)("thead",{className:r("sticky bg-sidebar border-b",_t&&"shadow-sm"),style:{top:oe==="above-header"?`${H}px`:"0px",zIndex:35},children:(0,T.jsx)(ze,{className:"hover:bg-transparent",children:(0,T.jsx)(Ve,{colSpan:Ht,className:r("bg-sidebar p-2 font-semibold text-foreground",Zt?"py-2":"py-4",Me.className),children:(0,T.jsx)("div",{ref:l,className:r("flex items-center w-full",Me.align==="center"&&"justify-center",Me.align==="right"&&"justify-end",Me.align==="left"&&"justify-start"),children:typeof Me.content=="string"?(0,T.jsx)("span",{className:"font-bold text-foreground text-lg tracking-tight",children:Me.content}):Me.content})})})}),L&&oe==="below-header"&&(0,T.jsx)("thead",{className:r("sticky bg-sidebar border-b",_t&&"shadow-sm"),style:{top:Me?`${De}px`:"0px",zIndex:35},children:(0,T.jsx)(ze,{className:"hover:bg-transparent",children:(0,T.jsx)(Ve,{colSpan:Ht,className:"bg-sidebar p-2",children:(0,T.jsx)("div",{ref:Ke,children:wo()})})})}),Pr&&(0,T.jsx)(Sn,{className:r("sticky bg-sidebar [&_tr]:border-b-0",_t&&"shadow-sm"),style:{top:`${Gr()}px`,zIndex:30},children:(0,T.jsx)(ir,{table:O,aggregations:y,enableColumnPinning:Re,enableColumnResizing:un,enableColumnVisibility:Rt,enableRowSelection:D,fixedCheckboxColumn:ke,bordered:vo,compact:Zt,onPinColumn:Lr})}),(0,T.jsx)(Pn,{children:O.getRowModel().rows?.length?O.getRowModel().rows.map((h,V)=>{let de=V===O.getRowModel().rows.length-1,jt=_?_(h):"";return(0,T.jsx)(ze,{"data-index":V,"data-state":h.getIsSelected()&&"selected",className:r(vt&&"hover:bg-muted/50",ht&&V%2===0&&"bg-muted/20",h.getIsSelected()&&"bg-muted",Mt==="single"&&"cursor-pointer",jt),onClick:()=>{Mt==="single"&&Ar(h)},children:h.getVisibleCells().map((Ce,Or)=>{let No=Re&&(Ce.column.getIsPinned()==="left"||Ce.column.id==="serialNumber"||Ce.column.id==="select"&&D),To=Re&&Ce.column.getIsPinned()==="right",Vr=Ce.column.id==="serialNumber";return(0,T.jsx)(Ve,{className:r(Zt?"py-2":"py-4",vo&&Or<h.getVisibleCells().length-1&&Ce.column.id!==_r&&"border-r",(!de||!Fr)&&"border-b",No&&"sticky left-0 z-20 bg-sidebar/95",Vr&&"sticky left-0 z-20 bg-card/95",To&&"sticky right-0 z-20 bg-sidebar/95","p-1"),style:{width:Be(Ce.column.getSize(),No||To),minWidth:Be(Ce.column.getSize(),No||To),...St(Ce.column,Re)},children:(0,we.flexRender)(Ce.column.columnDef.cell,Ce.getContext())},Ce.id)})},h.id)}):(0,T.jsx)(ze,{children:(0,T.jsx)(Ve,{colSpan:Ht,className:"border-0 h-32 text-center",children:(0,T.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,T.jsx)("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),(0,T.jsx)("p",{className:"font-medium text-muted-foreground",children:p})]})})})}),(0,T.jsx)(sr,{table:O,columnAggregations:Co,aggregations:y,enableColumnPinning:Re,enableRowSelection:D,showSerialNumbers:re,bordered:vo,compact:Zt})]})}),u&&(0,T.jsx)("div",{className:"bottom-0 z-10 sticky bg-sidebar w-full",style:{width:"100%",minWidth:"fit-content"},children:(0,T.jsx)(So,{children:(0,T.jsx)(to,{children:(0,T.jsx)(ze,{className:"bg-sidebar",children:(0,T.jsx)(Ve,{colSpan:Ht,className:"p-2",children:u})})})})})]})})}),(0,T.jsx)(Fo,{table:O,config:n}),I&&I(O)]})})}var lr=require("radix-ui");var dr=require("react/jsx-runtime");function co({className:e,orientation:t="horizontal",decorative:o=!0,...n}){return(0,dr.jsx)(lr.Separator.Root,{"data-slot":"separator-root",decorative:o,orientation:t,className:r("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})}var uo=require("lucide-react"),mo=require("framer-motion"),ut=zt(require("react"),1),cr=zt(require("react-dom"),1),J=require("react/jsx-runtime");function jo({table:e,visible:t,container:o,children:n,className:s,...i}){let[u,d]=ut.useState(!1);ut.useLayoutEffect(()=>{d(!0)},[]),ut.useEffect(()=>{function f(p){p.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e]);let a=o??(u?globalThis.document?.body:null);if(!a||!e)return null;let m=t??e.getFilteredSelectedRowModel().rows.length>0;return cr.createPortal((0,J.jsx)(mo.AnimatePresence,{children:m&&(0,J.jsx)(mo.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:r("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",s),...i,children:(0,J.jsx)(Ct,{children:n})})}),a)}function $o({size:e="sm",tooltip:t,isPending:o,disabled:n,className:s,children:i,...u}){let d=(0,J.jsx)(C,{variant:"secondary",size:e,className:r("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",s),disabled:n||o,...u,children:o?(0,J.jsx)(uo.Loader,{className:"animate-spin"}):i});return t?(0,J.jsxs)(ot,{children:[(0,J.jsx)(nt,{asChild:!0,children:d}),(0,J.jsx)(rt,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,J.jsx)("p",{children:t})})]}):d}function Uo({table:e}){let t=ut.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,J.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,J.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,J.jsx)(co,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,J.jsxs)(ot,{children:[(0,J.jsx)(nt,{asChild:!0,children:(0,J.jsx)(C,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,J.jsx)(uo.X,{className:"size-3.5"})})}),(0,J.jsxs)(rt,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,J.jsx)("p",{children:"Clear selection"}),(0,J.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,J.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var U=require("react"),qo=require("lucide-react");var Ne=require("lucide-react");var N=require("react/jsx-runtime");function Wo({fields:e,filters:t,globalFilter:o,onGlobalFilterChange:n,fieldFilters:s,onFieldFilterChange:i,sortField:u,sortDirection:d,onSortChange:a,selectedCount:m,totalCount:f,visibleCount:p,onExport:g,onRefresh:c,loading:z,onClearFilters:S,onClearSorting:I}){let b=e.filter(x=>x.sortable),F=Object.values(s).some(x=>x!=null&&x!=="")||o!=="",k=u!=="";return(0,N.jsx)("div",{className:"rounded-xl p-0.5",children:(0,N.jsx)("div",{className:"px-2",children:(0,N.jsx)("div",{className:"flex flex-col gap-6",children:(0,N.jsxs)("div",{className:"flex items-center justify-between",children:[(0,N.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,N.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,N.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,N.jsx)(Ne.Filter,{className:"h-4 w-4"})}),t.map(x=>(0,N.jsx)("div",{className:"relative min-w-[150px]",children:x.type==="select"?(0,N.jsxs)(at,{value:s[x.key]||"all",onValueChange:y=>i(x.key,y),children:[x.icon&&(0,N.jsx)(x.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,N.jsx)(st,{className:r("h-9 rounded-lg w-full",x.icon&&"pl-9"),children:(0,N.jsx)(it,{placeholder:x.placeholder||"Select..."})}),(0,N.jsxs)(lt,{className:"rounded-lg",children:[(0,N.jsx)(He,{value:"all",children:"All"}),x.options?.map(y=>(0,N.jsx)(He,{value:y.value,children:y.label},y.value))]})]}):(0,N.jsxs)("div",{className:"relative",children:[x.icon&&(0,N.jsx)(x.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,N.jsx)(Ft,{type:x.type,placeholder:x.placeholder,value:s[x.key]||"",onChange:y=>i(x.key,y.target.value),className:r("h-9 rounded-lg",x.icon&&"pl-9")})]})},String(x.key)))]})}),(0,N.jsxs)("div",{className:"flex items-center gap-2",children:[(0,N.jsxs)("div",{className:"relative",children:[(0,N.jsx)(Ne.Search,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,N.jsx)(Ft,{placeholder:"Global search...",value:o,onChange:x=>n(x.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),b.length>0&&(0,N.jsxs)(Fe,{children:[(0,N.jsx)(Ae,{asChild:!0,children:(0,N.jsxs)(C,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[(0,N.jsx)("span",{children:"Sort"}),(0,N.jsx)(Ne.ChevronDown,{className:"h-4 w-4 opacity-50"})]})}),(0,N.jsxs)(Ie,{align:"end",className:"w-[200px] rounded-lg",children:[(0,N.jsx)(pe,{children:"Sort By"}),(0,N.jsx)(fe,{}),b.map(x=>(0,N.jsxs)("div",{children:[(0,N.jsxs)(ee,{onClick:()=>a(x.key,"asc"),children:[x.label," (A-Z)"]}),(0,N.jsxs)(ee,{onClick:()=>a(x.key,"desc"),children:[x.label," (Z-A)"]})]},String(x.key))),k&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(fe,{}),(0,N.jsx)(ee,{onClick:I,children:"Clear All Sorting"})]})]})]}),(0,N.jsxs)(Fe,{children:[(0,N.jsx)(Ae,{asChild:!0,children:(0,N.jsx)(C,{variant:"outline",size:"sm",className:"rounded-lg",children:(0,N.jsx)(Ne.Settings2,{className:"h-4 w-4"})})}),(0,N.jsxs)(Ie,{align:"end",className:"w-[200px] rounded-lg",children:[(0,N.jsx)(pe,{children:"Table Settings"}),(0,N.jsx)(fe,{}),(0,N.jsx)(ee,{onClick:I,children:"Clear All Sorting"}),(0,N.jsx)(ee,{onClick:S,children:"Clear All Filters"})]})]}),g&&(0,N.jsxs)(C,{variant:"outline",size:"sm",onClick:g,className:"rounded-lg",children:[(0,N.jsx)(Ne.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),c&&(0,N.jsx)(C,{variant:"outline",size:"sm",onClick:c,disabled:z,className:"rounded-lg",children:(0,N.jsx)(Ne.RefreshCw,{className:r("h-4 w-4",z&&"animate-spin")})})]})]})})})})}var mt=require("lucide-react");var B=require("react/jsx-runtime");function ur({currentPage:e,totalPages:t,pageSize:o,totalItems:n,onPageChange:s,onPageSizeChange:i,config:u}){if(!u)return null;let d=u.pageSizeOptions||[10,20,50,100],a=(e-1)*o+1,m=Math.min(e*o,n),f=e>1,p=e<t,g=()=>{let z=[],S=[];for(let I=Math.max(2,e-2);I<=Math.min(t-1,e+2);I++)z.push(I);return e-2>2?S.push(1,"..."):S.push(1),S.push(...z),e+2<t-1?S.push("...",t):t>1&&S.push(t),S};return(0,B.jsx)("div",{className:"rounded-xl",children:(0,B.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[(0,B.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:u.showInfo!==!1&&(0,B.jsxs)("span",{children:["Showing ",a," to ",m," of ",n," entries"]})}),(0,B.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[d&&(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),(0,B.jsxs)(at,{value:`${o}`,onValueChange:c=>i(Number(c)),children:[(0,B.jsx)(st,{className:"h-9 w-[70px] rounded-lg",children:(0,B.jsx)(it,{})}),(0,B.jsx)(lt,{side:"top",className:"rounded-lg",children:d.map(c=>(0,B.jsx)(He,{value:`${c}`,children:c},c))})]})]}),(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsxs)(C,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:!f,className:"hidden sm:flex rounded-lg",children:[(0,B.jsx)(mt.ChevronsLeft,{className:"h-4 w-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Go to first page"})]}),(0,B.jsxs)(C,{variant:"outline",size:"sm",onClick:()=>s(e-1),disabled:!f,className:"rounded-lg",children:[(0,B.jsx)(mt.ChevronLeft,{className:"h-4 w-4 sm:mr-2"}),(0,B.jsx)("span",{className:"hidden sm:inline",children:"Previous"}),(0,B.jsx)("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),u.showPageNumbers&&t>1&&(0,B.jsx)("div",{className:"hidden sm:flex items-center gap-1",children:g().map((c,z)=>{if(c==="...")return(0,B.jsx)("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${z}`);let S=c;return(0,B.jsx)(C,{variant:S===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>s(S),children:S},S)})}),(0,B.jsxs)("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]}),(0,B.jsxs)(C,{variant:"outline",size:"sm",onClick:()=>s(e+1),disabled:!p,className:"rounded-lg",children:[(0,B.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,B.jsx)(mt.ChevronRight,{className:"h-4 w-4 sm:ml-2"}),(0,B.jsx)("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),(0,B.jsxs)(C,{variant:"outline",size:"sm",onClick:()=>s(t),disabled:!p,className:"hidden sm:flex rounded-lg",children:[(0,B.jsx)(mt.ChevronsRight,{className:"h-4 w-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}var G=require("react/jsx-runtime");function Ko({data:e,template:t,fields:o=[],filters:n=[],pagination:s,settings:i={},header:u,footer:d,className:a="",loading:m=!1,error:f,emptyMessage:p="No items found",emptyIcon:g,onSelectionChange:c,onExport:z,onRefresh:S,onTemplateReady:I,children:b}){let{enableSorting:F=!0,enableFiltering:k=!0,enableGlobalSearch:x=!0,enableSelection:y=!1,enableExport:w=!1,showToolbar:_=!0,selectionMode:j="multiple",gridCols:Y={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:W=4,aspectRatio:me="auto",minCardWidth:Te=350,maxCardWidth:ne=350}=i,Ue=!!s,[Ee,kt]=(0,U.useState)(""),[Se,gt]=(0,U.useState)({}),[Ge,ft]=(0,U.useState)(""),[Pe,We]=(0,U.useState)("asc"),[se,ye]=(0,U.useState)(new Set),[et,qe]=(0,U.useState)(1),[_e,Gt]=(0,U.useState)(s?.pageSize||12),[Oe,Ke]=(0,U.useState)(Y.default),l=(0,U.useMemo)(()=>{let D=[...e];if(x&&Ee){let L=o.filter(E=>E.searchable!==!1);D=D.filter(E=>L.some(oe=>E[oe.key]?.toString().toLowerCase().includes(Ee.toLowerCase())))}if(k&&Object.keys(Se).forEach(L=>{let E=Se[L];if(E!=null&&E!==""){let oe=o.find(re=>re.key===L);oe&&(D=D.filter(re=>{let ke=re[L];return oe.type==="boolean"?ke===(E==="true"):oe.type==="number"?ke===Number(E):ke?.toString().toLowerCase().includes(String(E).toLowerCase())}))}}),F&&Ge){let L=o.find(E=>E.key===Ge);L&&D.sort((E,oe)=>{let re=E[Ge],ke=oe[Ge];if(L.type==="number")return Pe==="asc"?Number(re)-Number(ke):Number(ke)-Number(re);if(L.type==="date"){let ht=new Date(re),vt=new Date(ke);return Pe==="asc"?ht.getTime()-vt.getTime():vt.getTime()-ht.getTime()}else{let ht=String(re).toLowerCase(),vt=String(ke).toLowerCase();return Pe==="asc"?ht.localeCompare(vt):vt.localeCompare(ht)}})}return D},[e,Ee,Se,Ge,Pe,o,x,k,F]),H=(0,U.useMemo)(()=>{if(!Ue)return l;let D=(et-1)*_e,L=D+_e;return l.slice(D,L)},[l,et,_e,Ue]),le=Math.ceil(l.length/_e),Z=(0,U.useCallback)(D=>{y&&ye(L=>{let E=new Set(L);return j==="single"?(E.clear(),E.add(D)):E.has(D)?E.delete(D):E.add(D),E})},[y,j]),bt=(0,U.useCallback)(()=>{!y||j==="single"||(se.size===l.length?ye(new Set):ye(new Set(l.map((D,L)=>L))))},[y,j,se.size,l.length]),De=(0,U.useCallback)((D,L)=>{gt(E=>({...E,[D]:L})),qe(1)},[]),ho=(0,U.useCallback)((D,L)=>{ft(D),We(L)},[]),tt=(0,U.useCallback)(()=>{kt(""),gt({}),qe(1)},[]),_t=(0,U.useCallback)(()=>{ft(""),We("asc")},[]),Yt=(0,U.useMemo)(()=>({getSelectedItems:()=>Array.from(se).map(D=>l[D]),clearSelection:()=>ye(new Set),selectAll:bt,getFilteredData:()=>l,getTotalCount:()=>e.length,getVisibleCount:()=>l.length,refresh:()=>S?.(),exportData:()=>z?.(l)}),[se,l,e.length,bt,S,z]),xt=(0,U.useRef)(null);xt.current=Yt,(0,U.useEffect)(()=>{I&&xt.current&&I(xt.current)},[]),(0,U.useEffect)(()=>{if(y&&c){let D=Array.from(se).map(L=>l[L]);c(D)}},[se]);let Ot=r("w-full","overflow-hidden",a),Vt=r("grid",`gap-${W}`,"w-full","mx-auto","items-start"),Rt={gridTemplateColumns:Oe===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${Te}px, calc(100%/${Oe} - ${W*4}px), ${ne}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return f?(0,G.jsx)(Xe,{className:"w-full",children:(0,G.jsx)(Ye,{className:"flex items-center justify-center py-12",children:(0,G.jsxs)("div",{className:"text-center",children:[(0,G.jsx)("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),(0,G.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:f}),S&&(0,G.jsxs)(C,{variant:"outline",size:"sm",onClick:S,children:[(0,G.jsx)(qo.Loader2,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):(0,G.jsxs)("div",{className:r("w-full flex gap-2 flex-col h-full",Ot),children:[u&&(0,G.jsx)(Xe,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:(0,G.jsx)(Ye,{className:"p-2",children:u})}),_&&(0,G.jsx)(Wo,{fields:o,filters:n,globalFilter:Ee,onGlobalFilterChange:kt,fieldFilters:Se,onFieldFilterChange:De,sortField:Ge,sortDirection:Pe,onSortChange:ho,selectedCount:se.size,totalCount:e.length,visibleCount:l.length,onExport:w?()=>z?.(l):void 0,onRefresh:S,loading:m,onClearFilters:tt,onClearSorting:_t}),(0,G.jsx)(Xe,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:(0,G.jsx)(Ye,{className:"px-0",children:(0,G.jsxs)("div",{className:"relative",children:[m&&(0,G.jsx)("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:(0,G.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[(0,G.jsx)(qo.Loader2,{className:"size-5 animate-spin text-primary"}),(0,G.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),H.length>0?(0,G.jsx)("div",{className:r(Vt),style:Rt,children:H.map((D,L)=>{let E=Ue?(et-1)*_e+L:L,oe=se.has(E);return(0,G.jsxs)("div",{className:r("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",me==="square"?"aspect-square":"",me==="video"?"aspect-video":"",y?"cursor-pointer":"",oe?"ring-2 ring-primary":""),onClick:()=>y&&Z(E),children:[y&&j==="multiple"&&(0,G.jsx)("div",{className:"absolute top-2 right-2 z-10",children:(0,G.jsx)(wt,{checked:oe,onCheckedChange:()=>Z(E),className:"bg-background/80 backdrop-blur-sm",onClick:re=>re.stopPropagation()})}),t(D,L,oe,()=>Z(E))]},E)})}):(0,G.jsxs)("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[(0,G.jsx)("div",{className:"text-6xl",children:g||"\u{1F4CB}"}),(0,G.jsx)("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:p}),(Ee||Object.values(Se).some(D=>D))&&(0,G.jsx)(C,{variant:"outline",onClick:tt,children:"Clear Filters"})]})]})})}),Ue&&(0,G.jsx)("div",{className:"pb-1",children:(0,G.jsx)(ur,{currentPage:et,totalPages:le,pageSize:_e,totalItems:l.length,onPageChange:qe,onPageSizeChange:D=>{Gt(D),qe(1)},config:s})}),d&&(0,G.jsx)("div",{className:"p-2 m-0.5",children:d}),b&&b(Yt)]})}var po=require("lucide-react"),go=require("framer-motion"),pt=zt(require("react"),1),mr=zt(require("react-dom"),1),X=require("react/jsx-runtime");function Jo({controller:e,visible:t,container:o,children:n,className:s,...i}){let[u,d]=pt.useState(!1);pt.useLayoutEffect(()=>{d(!0)},[]),pt.useEffect(()=>{function p(g){g.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e]);let a=o??(u?globalThis.document?.body:null);if(!a||!e)return null;let m=e.getSelectedItems(),f=t??m.length>0;return mr.createPortal((0,X.jsx)(go.AnimatePresence,{children:f&&(0,X.jsx)(go.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:r("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",s),...i,children:(0,X.jsx)(Ct,{children:n})})}),a)}function Xo({size:e="sm",variant:t="secondary",tooltip:o,isPending:n,disabled:s,className:i,children:u,onClick:d,...a}){let m=(0,X.jsx)(C,{variant:t,size:e,className:r("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:s||n,onClick:d,...a,children:n?(0,X.jsx)(po.Loader,{className:"animate-spin"}):u});return o?(0,X.jsxs)(ot,{children:[(0,X.jsx)(nt,{asChild:!0,children:m}),(0,X.jsx)(rt,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,X.jsx)("p",{children:o})})]}):m}function Yo({controller:e}){let t=pt.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let o=e.getSelectedItems();return(0,X.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,X.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[o.length," selected"]}),(0,X.jsx)(co,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,X.jsxs)(ot,{children:[(0,X.jsx)(nt,{asChild:!0,children:(0,X.jsx)(C,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,X.jsx)(po.X,{className:"size-3.5"})})}),(0,X.jsxs)(rt,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[(0,X.jsx)("p",{children:"Clear selection"}),(0,X.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,X.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}var gr=require("react/jsx-runtime"),pr=({children:e,className:t})=>(0,gr.jsx)("div",{className:r("flex flex-col h-full gap-2",t),children:e});var Zo=require("lucide-react");var fr=require("react-router"),ie=require("react/jsx-runtime"),br=({className:e,title:t,description:o,backAction:n,metadata:s,children:i,childrenClassName:u})=>{let d=()=>{if(!n)return null;let m={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return n.href?(0,ie.jsx)(fr.NavLink,{to:n.href,children:(0,ie.jsx)(C,{...m,children:(0,ie.jsx)(Zo.ArrowLeftIcon,{className:"size-6"})})}):(0,ie.jsx)(C,{...m,onClick:n.onClick,children:(0,ie.jsx)(Zo.ArrowLeftIcon,{className:"size-6"})})},a=()=>!s||s.length===0?null:(0,ie.jsx)("div",{className:"flex gap-4",children:s.map((m,f)=>m.value&&(0,ie.jsxs)("div",{className:"text-sm",children:[(0,ie.jsxs)("span",{className:"text-muted-foreground",children:[m.label," "]}),(0,ie.jsx)("span",{children:m.value})]},f))});return(0,ie.jsxs)("div",{className:r("flex items-center w-full gap-4 p-2",e),children:[(0,ie.jsxs)("div",{className:"flex gap-2 items-center h-full shrink-0",children:[d(),(0,ie.jsxs)("div",{className:"flex flex-col gap-2 w-max",children:[(0,ie.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:t}),o&&(0,ie.jsx)("p",{className:"text-muted-foreground",children:o}),a()]})]}),i!=null&&(0,ie.jsx)("div",{className:r("flex flex-1 items-center justify-end gap-4 h-full",u),children:i})]})};var Xt=zt(require("react"),1),ue=require("react/jsx-runtime"),xr="(min-width: 1024px)",ta=()=>{let[e,t]=Xt.default.useState(()=>typeof window>"u"||window.matchMedia(xr).matches);return Xt.default.useEffect(()=>{let o=window.matchMedia(xr),n=()=>t(o.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[]),e},Qo=e=>null,en=e=>null,tn=e=>null,hr=({children:e,className:t,contentClassName:o})=>{let n=ta(),s,i,u,d,a,m=Xt.default.Children.toArray(e).filter(g=>{if(Xt.default.isValidElement(g)){if(g.type===Qo){let c=g.props;return s=c.children,i=c.className,!1}if(g.type===en){let c=g.props;return u=c.children,d=c.className,!1}if(g.type===tn)return a=g.props,!1}return!0}),f=(0,ue.jsx)("div",{className:r("flex-1 overflow-auto h-full no-scrollbar p-2",o),children:m}),p=g=>{let{side:c="right"}=g,z=(g.overlay??!0)||!n,S=r("w-[420px] max-w-full",g.className),I=r("h-full bg-background",c==="right"?"border-l":"border-r"),b=(0,ue.jsx)("div",{className:r("h-full p-2",o),children:m});return z?(0,ue.jsxs)("div",{tabIndex:-1,className:"flex relative flex-1 overflow-hidden",children:[(0,ue.jsx)("div",{className:"h-full overflow-auto w-full transition-all duration-500 relative z-10",children:b}),(0,ue.jsxs)("div",{tabIndex:-1,inert:!g.open,className:r("absolute inset-0 z-20",!g.open&&"pointer-events-none"),children:[(0,ue.jsx)("div",{className:r("absolute inset-0 bg-black/50 transition-opacity duration-500",g.open?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>g.onOpenChange(!1)}),(0,ue.jsx)("div",{tabIndex:-1,className:r("absolute inset-y-0 z-50 h-full overflow-y-auto backdrop-blur-2xl","transition-all duration-500 ease-in-out",c==="right"?"right-0":"left-0",g.open?"translate-x-0 opacity-100":r(c==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),I,S),children:g.children})]})]}):(0,ue.jsxs)("div",{className:"flex relative flex-1 overflow-hidden",children:[c==="left"&&(0,ue.jsx)("div",{className:r("shrink-0 overflow-y-auto transition-all duration-500 ease-in-out",I,g.open?S:"w-0 border-0"),children:g.children}),(0,ue.jsx)("div",{className:r("h-full flex-1 min-w-0 overflow-auto transition-all duration-500",g.open&&"overflow-y-auto overflow-x-hidden"),children:b}),c==="right"&&(0,ue.jsx)("div",{className:r("shrink-0 overflow-y-auto transition-all duration-500 ease-in-out",I,g.open?S:"w-0 border-0"),children:g.children})]})};return(0,ue.jsxs)("div",{className:r("flex flex-auto flex-col min-h-0 overflow-hidden rounded-2xl relative bg-background p-2",t),children:[s&&(0,ue.jsx)("div",{className:r("border-b p-2",i),children:s}),a?p(a):f,u&&(0,ue.jsx)("div",{className:r("border-t p-2",d),children:u})]})};var yr=require("react/jsx-runtime"),vr=({className:e,children:t})=>t==null?null:(0,yr.jsx)("div",{className:r("flex items-center w-full gap-4 p-2 [&>*:last-child]:ml-auto",e),children:t});var on=require("react"),Bt=require("lucide-react");var ve=require("react/jsx-runtime"),fo=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(o){throw console.error("Failed to copy text:",o),o}}static CopyToClipboard=({text:t,children:o,className:n,size:s="icon",variant:i="ghost"})=>{let[u,d]=(0,on.useState)(!1),[a,m]=(0,on.useState)(!1),f=async()=>{if(!(!t||a)){m(!0);try{await this.copyToClipboard(t),d(!0),setTimeout(()=>d(!1),2e3)}catch(p){console.error("Failed to copy text:",p)}finally{m(!1)}}};return(0,ve.jsxs)(ot,{children:[(0,ve.jsx)(nt,{asChild:!0,children:(0,ve.jsx)(C,{variant:i,size:s,className:r(s==="icon"&&"size-6",n),onClick:f,disabled:a||!t,children:a?(0,ve.jsx)(Bt.Loader2Icon,{className:"animate-spin"}):u?(0,ve.jsx)(Bt.Check,{className:"h-3 w-3"}):o||(0,ve.jsx)(Bt.Copy,{className:"h-3 w-3"})})}),(0,ve.jsx)(rt,{children:u?"Copied!":a?"Copying...":"Copy to clipboard"})]})};static formatINR(t,o={}){let{prefix:n="",suffix:s="",withSymbol:i=!0,compact:u=!1}=o;if(typeof t!="number"||isNaN(t))return`${n}${i?"\u20B9 ":""}0.00${s}`;let d=t<0,a=Math.abs(t),f=(u&&a>=1e5?this.compactFormatter:this.currencyFormatter).format(a).replace("\u20B9","");return`${n}${d?"- ":""}${i?"\u20B9 ":""}${f}${s}`}static formatDate(t,o={}){let{format:n="dd-mm-yyyy",separator:s="-"}=o,i=new Date(t);if(isNaN(i.getTime()))return"";let u=String(i.getDate()).padStart(2,"0"),d=String(i.getMonth()+1).padStart(2,"0"),a=this.MONTH_NAMES_SHORT[i.getMonth()],m=i.getFullYear();switch(n){case"dd-mmm-yyyy":return`${u}${s}${a}${s}${m}`;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`${u}${s}${d}${s}${m}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((o,n,s)=>["-","'"," "].includes(o)||n>0&&["-","'"].includes(s[n-1])?o:o.charAt(0).toUpperCase()+o.slice(1)).join(""):""}static StatusBadge=({status:t,className:o,showDot:n=!0,capitalize:s=!0,size:i="md",variant:u="outline",customColors:d,icon:a,trueMessage:m="active",falseMessage:f="inactive"})=>{let p=typeof t=="boolean"?t?m:f:typeof t=="number"?t>0?m:f:t.toLowerCase(),g={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"}}},c=g[p.toLowerCase()]||g.inactive,z=d||c[u],S={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},I=s?p.charAt(0).toUpperCase()+p.slice(1):p;return(0,ve.jsx)("div",{className:"flex justify-center",children:(0,ve.jsxs)("span",{className:r("inline-flex items-center gap-1.5 rounded-full border font-medium",z.bg,z.text,z.border,S[i],o),children:[n&&(a?(0,ve.jsx)("span",{className:"flex items-center",children:a}):(0,ve.jsx)("span",{className:r("size-2 rounded-full",z.dot),"aria-hidden":"true"})),I]})})}};var Cr=require("lucide-react"),Lt=require("react-router"),K=require("react/jsx-runtime"),nn=()=>{let e=(0,Lt.useRouteError)(),t=(0,Lt.useNavigate)();return(0,K.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:(0,K.jsxs)("div",{className:"flex flex-col items-center space-y-4 text-center",children:[(0,K.jsx)(Cr.AlertTriangleIcon,{className:"h-16 w-16 text-destructive"}),(0,Lt.isRouteErrorResponse)(e)?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?(0,K.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&(0,K.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),(0,K.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&(0,K.jsxs)("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[(0,K.jsx)("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),(0,K.jsx)("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),(0,K.jsx)("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)})]}),(0,K.jsx)(C,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};var je=require("framer-motion");var A=require("react/jsx-runtime");function oa({size:e=100,strokeWidth:t=2,color:o="currentColor",className:n=""}){return(0,A.jsxs)(je.motion.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:n,children:[(0,A.jsx)("title",{children:"Animated Checkmark"}),(0,A.jsx)(je.motion.circle,{cx:"50",cy:"50",r:"40",stroke:o,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),(0,A.jsx)(je.motion.path,{d:"M30 50L45 65L70 35",stroke:o,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function rn(){return(0,A.jsx)(Xe,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:(0,A.jsxs)(Ye,{className:"space-y-4 flex flex-col items-center justify-center",children:[(0,A.jsx)(je.motion.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:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)(je.motion.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"}}),(0,A.jsx)(oa,{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)]"})]})}),(0,A.jsxs)(je.motion.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:[(0,A.jsx)(je.motion.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"}),(0,A.jsx)("div",{className:"flex items-center gap-4",children:(0,A.jsx)(je.motion.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:(0,A.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("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:[(0,A.jsx)("title",{children:"From"}),(0,A.jsx)("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("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:"$"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),(0,A.jsx)("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("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:[(0,A.jsx)("title",{children:"To"}),(0,A.jsx)("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("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"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),(0,A.jsx)(je.motion.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"})]})]})})}var Dt=require("react/jsx-runtime"),an=()=>(0,Dt.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:(0,Dt.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,Dt.jsx)("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),(0,Dt.jsx)("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});var wr=require("react-router");var Nr=require("lucide-react"),bo=require("react-router"),Le=require("react/jsx-runtime"),sn=()=>{let e=(0,wr.useLocation)(),t=(0,bo.useNavigate)(),o=()=>{window.history.length>2?t(-1):t("/")};return(0,Le.jsxs)("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:[(0,Le.jsx)(Nr.GhostIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Le.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),(0,Le.jsxs)("p",{className:"text-xl mb-4",children:["The page ",(0,Le.jsx)("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),(0,Le.jsxs)("div",{className:"flex space-x-4",children:[(0,Le.jsx)(C,{variant:"outline",onClick:o,children:"Go Back"}),(0,Le.jsx)(C,{variant:"ghost",children:(0,Le.jsx)(bo.NavLink,{to:"/",children:"Return Home"})})]})]})};var Tr=require("lucide-react"),Et=require("react/jsx-runtime"),ln=()=>(0,Et.jsxs)("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:[(0,Et.jsx)(Tr.WifiOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Et.jsx)("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),(0,Et.jsx)("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});var Sr=require("lucide-react");var xo=require("react-router"),$e=require("react/jsx-runtime"),dn=()=>{let e=(0,xo.useNavigate)();return(0,$e.jsxs)("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:[(0,$e.jsx)(Sr.ShieldOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,$e.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),(0,$e.jsx)("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."}),(0,$e.jsxs)("div",{className:"flex space-x-4",children:[(0,$e.jsx)(C,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),(0,$e.jsx)(C,{variant:"ghost",children:(0,$e.jsx)(xo.NavLink,{to:"/",children:"Go to Home"})})]})]})};0&&(module.exports={AppContainer,AppContent,AppContentFooter,AppContentHeader,AppFooter,AppHeader,AppSheet,CurrencyTransfer,DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTemplate,DataTemplateActionBar,DataTemplateActionBarAction,DataTemplateActionBarSelection,ErrorComponent,GeneralHelper,Loader,NotFound,OfflineUI,Unauthorized,getTableExportView,readPersistedExternal});
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|