mantine-datatable 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var Vr=Object.create;var ye=Object.defineProperty;var Gr=Object.getOwnPropertyDescriptor;var Xr=Object.getOwnPropertyNames;var Zr=Object.getPrototypeOf,Qr=Object.prototype.hasOwnProperty;var Kr=(o,e)=>()=>(o&&(e=o(o=0)),e);var No=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var $r=(o,e,a,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of Xr(e))!Qr.call(o,f)&&f!==a&&ye(o,f,{get:()=>e[f],enumerable:!(t=Gr(e,f))||t.enumerable});return o};var Yr=(o,e,a)=>(a=o!=null?Vr(Zr(o)):{},$r(e||!o||!o.__esModule?ye(a,"default",{value:o,enumerable:!0}):a,o));import*as c from"react";var r=Kr(()=>{"use strict"});var Pe=No((Wt,we)=>{"use strict";r();var Jr="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";we.exports=Jr});var ke=No((zt,Oe)=>{"use strict";r();var oa=Pe();function Me(){}function Re(){}Re.resetWarningCache=Me;Oe.exports=function(){function o(t,f,n,d,u,p){if(p!==oa){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}o.isRequired=o;function e(){return o}var a={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Re,resetWarningCache:Me};return a.PropTypes=a,a}});var ve=No((Zt,Fe)=>{r();Fe.exports=ke()();var Gt,Xt});r();r();import{Box as Mt,createStyles as Rt,packSx as Ot,Table as kt}from"@mantine/core";import{useElementSize as So,useMergedRef as Ft}from"@mantine/hooks";import{useCallback as de,useState as ho}from"react";r();import{createStyles as _r}from"@mantine/core";import{jsx as Te}from"react/jsx-runtime";var jr=_r({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function qo(){let{classes:o}=jr();return Te("tr",{className:o.root,children:Te("td",{})})}r();import{Center as la,createStyles as da,Text as sa}from"@mantine/core";r();r();var L=Yr(ve());import{forwardRef as ea,createElement as Le}from"react";r();var Ae={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ra=Object.defineProperty,aa=Object.defineProperties,ta=Object.getOwnPropertyDescriptors,mo=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,He=(o,e,a)=>e in o?ra(o,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[e]=a,Ee=(o,e)=>{for(var a in e||(e={}))Ne.call(e,a)&&He(o,a,e[a]);if(mo)for(var a of mo(e))qe.call(e,a)&&He(o,a,e[a]);return o},fa=(o,e)=>aa(o,ta(e)),na=(o,e)=>{var a={};for(var t in o)Ne.call(o,t)&&e.indexOf(t)<0&&(a[t]=o[t]);if(o!=null&&mo)for(var t of mo(o))e.indexOf(t)<0&&qe.call(o,t)&&(a[t]=o[t]);return a},G=(o,e,a)=>{let t=ea((f,n)=>{var d=f,{color:u="currentColor",size:p=24,stroke:l=2,children:m}=d,i=na(d,["color","size","stroke","children"]);return Le("svg",Ee(fa(Ee({ref:n},Ae),{width:p,height:p,stroke:u,strokeWidth:l,className:`tabler-icon tabler-icon-${o}`}),i),[...a.map(([I,s])=>Le(I,s)),...m||[]])});return t.propTypes={color:L.default.string,size:L.default.oneOfType([L.default.string,L.default.number]),stroke:L.default.oneOfType([L.default.string,L.default.number])},t.displayName=`${e}`,t};r();var Wo=G("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);r();var Uo=G("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);r();var zo=G("database-off","IconDatabaseOff",[["path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74",key:"svg-0"}],["path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6",key:"svg-1"}],["path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]]);import{Fragment as ua,jsx as xo,jsxs as pa}from"react/jsx-runtime";var ca=da(o=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[6],opacity:0,transition:"opacity .15s ease"},active:{opacity:1},standardIcon:{fontSize:0,borderRadius:"50%",padding:o.spacing.xs,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[2]}}));function Vo({icon:o,text:e,pt:a,pb:t,active:f,children:n}){let{classes:d,cx:u}=ca();return xo(la,{pt:a,pb:t,className:u(d.root,{[d.active]:f}),children:n||pa(ua,{children:[o||xo("div",{className:d.standardIcon,children:xo(zo,{})}),xo(sa,{size:"sm",color:"dimmed",children:e})]})})}r();import{createStyles as Ta}from"@mantine/core";import{forwardRef as wa}from"react";r();import{Box as Xo,Center as Ue,createStyles as ga,Group as Ca}from"@mantine/core";r();import{useMantineTheme as ma}from"@mantine/core";import{useMediaQuery as xa}from"@mantine/hooks";import{useEffect as Ia,useLayoutEffect as ia}from"react";var We=typeof window<"u"?ia:Ia;function Io(o){let e=ma(),a=typeof o=="function"?o(e):o;return xa(a||"",!0)}function J(o){let e=o.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Go(o,e,a){return o.filter(t=>!e.map(a).includes(a(t)))}function oo(o,e){return o.filter((a,t,f)=>t===f.findIndex(n=>e(a)===e(n)))}function B(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}import{jsx as W,jsxs as ha}from"react/jsx-runtime";var Sa=ga(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover":{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[0]}},sortableColumnHeaderGroup:{gap:"0.25em"},columnHeaderText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},sortableColumnHeaderText:{minWidth:0,flexGrow:1},sortableColumnHeaderIcon:{transition:"transform .15s ease"},sortableColumnHeaderIconRotated:{transform:"rotate3d(0, 0, 1, 180deg)"},sortableColumnHeaderUnsortedIcon:{color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5],transition:"color .15s ease","th:hover &":{color:o.colorScheme==="dark"?o.colors.dark[2]:o.colors.gray[6]}}}));function Zo({className:o,sx:e,style:a,accessor:t,visibleMediaQuery:f,title:n,sortable:d,sortIcons:u,textAlignment:p,width:l,sortStatus:m,onSortStatusChange:i}){let{cx:I,classes:s}=Sa();if(!Io(f))return null;let C=n??J(t),g=typeof C=="string"?C:void 0,b=d&&i?()=>{i({columnAccessor:t,direction:m?.direction==="asc"?"desc":"asc"})}:void 0;return W(Xo,{component:"th",className:I({[s.sortableColumnHeader]:d},o),sx:[{"&&":{textAlign:p},width:l,minWidth:l,maxWidth:l},e],style:a,role:d?"button":void 0,tabIndex:d?0:void 0,onClick:b,onKeyDown:S=>S.key==="Enter"&&b?.(),children:d||m?.columnAccessor===t?ha(Ca,{className:s.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[W(Xo,{className:I(s.columnHeaderText,s.sortableColumnHeaderText),title:g,children:C}),m?.columnAccessor===t?W(Ue,{className:I(s.sortableColumnHeaderIcon,{[s.sortableColumnHeaderIconRotated]:m.direction==="desc"}),"aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:u?.sorted||W(Wo,{size:14})}):W(Ue,{className:s.sortableColumnHeaderUnsortedIcon,children:u?.unsorted||W(Uo,{size:14})})]}):W(Xo,{className:s.columnHeaderText,title:g,children:C})})}r();import{Checkbox as ba,createStyles as Ba,px as Da}from"@mantine/core";import{jsx as ze}from"react/jsx-runtime";var ya=Ba(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-Da(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}},checkboxInput:{cursor:"pointer"}}});function Qo({shadowVisible:o,checked:e,indeterminate:a,onChange:t}){let{cx:f,classes:n}=ya();return ze("th",{className:f(n.root,{[n.shadowVisible]:o}),children:ze(ba,{classNames:{input:n.checkboxInput},checked:e,indeterminate:a,disabled:!t,onChange:t})})}import{jsx as Ko,jsxs as Ma}from"react/jsx-runtime";var Pa=Ta(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),Ve=wa(function({className:e,style:a,sortStatus:t,sortIcons:f,onSortStatusChange:n,columns:d,selectionVisible:u,selectionChecked:p,selectionIndeterminate:l,onSelectionChange:m,leftShadowVisible:i},I){let{classes:s,cx:C}=Pa();return Ko("thead",{className:C(s.root,e),style:a,ref:I,children:Ma("tr",{children:[u&&Ko(Qo,{shadowVisible:i,checked:p,indeterminate:l,onChange:m}),d.map(({accessor:g,hidden:b,visibleMediaQuery:S,textAlignment:H,width:v,title:M,sortable:w,titleClassName:y,titleStyle:R,titleSx:k})=>b?null:Ko(Zo,{className:y,style:R,sx:k,accessor:g,visibleMediaQuery:S,textAlignment:H,width:v,title:M,sortable:w,sortStatus:t,sortIcons:f,onSortStatusChange:n},g))]})})});r();import{Center as Ra,createStyles as Oa,Loader as ka}from"@mantine/core";import{jsx as Ge}from"react/jsx-runtime";var Fa=Oa(o=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:o.fn.rgba(o.colorScheme==="dark"?o.colors.dark[8]:o.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function $o({pt:o,pb:e,fetching:a,customContent:t,backgroundBlur:f,size:n,variant:d,color:u}){let{classes:p,cx:l}=Fa();return Ge(Ra,{pt:o,pb:e,className:l(p.root,{[p.fetching]:a}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:a&&(t||Ge(ka,{size:n,variant:d,color:u}))})}r();import{Box as La,Pagination as Ha,Text as Ea,createStyles as Na}from"@mantine/core";import{forwardRef as qa}from"react";r();import{Button as va,Group as Aa,Menu as io,Text as Xe}from"@mantine/core";import{jsx as X,jsxs as Qe}from"react/jsx-runtime";var Ze={xs:22,sm:26,md:32,lg:38,xl:44};function Yo({size:o,label:e,values:a,value:t,onChange:f,color:n}){return Qe(Aa,{spacing:"xs",children:[X(Xe,{size:o,children:e}),Qe(io,{withinPortal:!0,withArrow:!0,children:[X(io.Target,{children:X(va,{size:o,variant:"default",sx:[{fontWeight:"normal"},d=>({height:Ze[o],paddingLeft:d.spacing[o],paddingRight:d.spacing[o]})],children:t})}),X(io.Dropdown,{children:a.map(d=>{let u=d===t;return X(io.Item,{sx:[{height:Ze[o]},p=>({"&&":{color:u?p.white:void 0},background:u?p.colors[n||p.primaryColor][6]:void 0})],disabled:u,onClick:()=>f(d),children:X(Xe,{size:o,children:d})},d)})})]})]})}import{jsx as _o,jsxs as Ua}from"react/jsx-runtime";var Wa=Na((o,{topBorderColor:e,paginationWrapBreakpoint:a})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(a)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),Ke=qa(function({className:e,style:a,topBorderColor:t,fetching:f,page:n,onPageChange:d,paginationColor:u,paginationSize:p,loadingText:l,noRecordsText:m,paginationText:i,totalRecords:I,recordsPerPage:s,onRecordsPerPageChange:C,recordsPerPageLabel:g,recordsPerPageOptions:b,recordsLength:S,horizontalSpacing:H,paginationWrapBreakpoint:v},M){let w;if(f)w=l;else if(!I)w=m;else{let k=(n-1)*s+1,Z=k+S-1;w=i({from:k,to:Z,totalRecords:I})}let{classes:y,cx:R}=Wa({topBorderColor:t,paginationWrapBreakpoint:v});return Ua(La,{ref:M,px:H??"xs",py:"xs",className:R(y.root,e),style:a,children:[_o(Ea,{className:y.text,size:p,children:w}),b&&_o(Yo,{size:p,label:g,values:b,value:s,onChange:C}),_o(Ha,{color:u,className:R(y.pagination,{[y.paginationFetching]:f||!S}),value:n,onChange:d,size:p,total:Math.ceil(I/s)})]})});r();import{Box as et,createStyles as rt}from"@mantine/core";r();import{Box as za,createStyles as Va}from"@mantine/core";import{jsx as Xa}from"react/jsx-runtime";var Ga=Va({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function jo({className:o,sx:e,style:a,visibleMediaQuery:t,record:f,recordIndex:n,onClick:d,noWrap:u,ellipsis:p,textAlignment:l,width:m,accessor:i,render:I,defaultRender:s,customCellAttributes:C}){let{cx:g,classes:b}=Ga();return Io(t)?Xa(za,{component:"td",className:g({[b.noWrap]:u||p,[b.ellipsis]:p,[b.withPointerCursor]:d},o),sx:[{width:m,minWidth:m,maxWidth:m,textAlign:l},e],style:a,onClick:d,...C?.(f,n),children:I?I(f,n):s?s(f,n,i):B(f,i)}):null}r();import{Collapse as Za,createStyles as Qa}from"@mantine/core";r();import{useTimeout as $e}from"@mantine/hooks";import{useEffect as Jo,useState as eo}from"react";function Ye(o){let[e,a]=eo(null),t=o?.join(":")||"";return Jo(()=>{a(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:a}}function _e(o){let[e,a]=eo(null);return Jo(()=>{o&&a(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:a}}function je({rowExpansion:o,records:e,idAccessor:a}){let t=[];if(o&&e){let{trigger:u,allowMultiple:p,initiallyExpanded:l}=o;e&&u==="always"?t=e.map(m=>B(m,a)):l&&(t=e.filter(l).map(m=>B(m,a)),p||(t=[t[0]]))}let f,n,d=eo(t);if(o){let{trigger:u,allowMultiple:p,collapseProps:l,content:m}=o;o.expanded?{recordIds:f,onRecordIdsChange:n}=o.expanded:[f,n]=d;let i=I=>n(f.filter(s=>s!==B(I,a)));return{expandOnClick:u!=="always"&&u!=="never",isRowExpanded:I=>u==="always"?!0:f.includes(B(I,a)),expandRow:I=>{let s=B(I,a);n(p?[...f,s]:[s])},collapseRow:i,collapseProps:l,content:(I,s)=>()=>m({record:I,recordIndex:s,collapse:()=>i(I)})}}}function Je(o,e){let[a,t]=eo(o),[f,n]=eo(o),d=$e(()=>t(!0),0),u=$e(()=>n(!1),e||200);return Jo(()=>{o?(u.clear(),n(!0),d.start()):(d.clear(),t(!1),u.start())},[d,u,o]),{expanded:a,visible:f}}import{Fragment as $a,jsx as go,jsxs as Ya}from"react/jsx-runtime";var Ka=Qa({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function oe({open:o,colSpan:e,content:a,collapseProps:t}){let{expanded:f,visible:n}=Je(o,t?.transitionDuration),{cx:d,classes:u}=Ka();return n?Ya($a,{children:[go("tr",{}),go("tr",{children:go("td",{className:d(u.cell,{[u.expandedCell]:f}),colSpan:e,children:go(Za,{in:f,...t,children:a()})})})]}):null}r();import{Checkbox as _a,createStyles as ja,px as Ja}from"@mantine/core";import{jsx as or}from"react/jsx-runtime";var ot=ja(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-Ja(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},withRightShadow:{"&::after":{opacity:1}},checkbox:{cursor:"pointer"}}});function ee({withRightShadow:o,...e}){let{cx:a,classes:t}=ot();return or("td",{className:a(t.root,{[t.withRightShadow]:o}),onClick:f=>f.stopPropagation(),children:or(_a,{classNames:{input:t.checkbox},...e})})}import{Fragment as tt,jsx as re,jsxs as er}from"react/jsx-runtime";var at=rt(o=>{let e=o.colors[o.primaryColor][6];return{withPointerCursor:{cursor:"pointer"},selected:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.6):o.fn.lighten(e,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.55):o.fn.lighten(e,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.5):o.fn.lighten(e,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.45):o.fn.lighten(e,.65)}}}}});function ae({record:o,recordIndex:e,columns:a,defaultColumnRender:t,selectionVisible:f,selectionChecked:n,onSelectionChange:d,isRecordSelectable:u,onClick:p,onCellClick:l,onContextMenu:m,expansion:i,customRowAttributes:I,className:s,style:C,sx:g,contextMenuVisible:b,leftShadowVisible:S}){let{cx:H,classes:v}=at();return er(tt,{children:[er(et,{component:"tr",className:H({[v.withPointerCursor]:p||i?.expandOnClick,[v.selected]:n,[v.contextMenuVisible]:b},typeof s=="function"?s(o,e):s),onClick:M=>{if(i){let{isRowExpanded:w,expandOnClick:y,expandRow:R,collapseRow:k}=i;y&&(w(o)?k(o):R(o))}p?.(M)},style:typeof C=="function"?C(o,e):C,sx:g,...I?.(o,e),onContextMenu:m,children:[f&&re(ee,{withRightShadow:S,checked:n,disabled:!d||(u?!u(o,e):!1),onChange:d}),a.map((M,w)=>{let{accessor:y,hidden:R,visibleMediaQuery:k,textAlignment:Z,noWrap:bo,ellipsis:Bo,width:Do,render:yo,cellsClassName:Q,cellsStyle:K,cellsSx:To,customCellAttributes:wo}=M,ro;return l&&(ro=()=>l({record:o,recordIndex:e,column:M,columnIndex:w})),R?null:re(jo,{className:typeof Q=="function"?Q(o,e):Q,style:typeof K=="function"?K(o,e):K,sx:To,visibleMediaQuery:k,record:o,recordIndex:e,onClick:ro,accessor:y,textAlignment:Z,noWrap:bo,ellipsis:Bo,width:Do,render:yo,defaultRender:t,customCellAttributes:wo},y)})]}),i&&re(oe,{colSpan:a.filter(M=>!M.hidden).length+(f?1:0),open:i.isRowExpanded(o),content:i.content(o,e),collapseProps:i.collapseProps})]})}r();import{createStyles as ft,Paper as nt,px as lt}from"@mantine/core";import{useClickOutside as dt,useElementSize as st,useMergedRef as ct,useWindowEvent as rr}from"@mantine/hooks";import{jsx as pt}from"react/jsx-runtime";var ut=ft(o=>({root:{position:"fixed",border:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function te({borderRadius:o="xs",shadow:e="sm",zIndex:a=3,y:t,x:f,onDestroy:n,children:d}){rr("resize",n),rr("scroll",n);let u=dt(n),{ref:p,width:l,height:m}=st(),i=ct(u,p),{innerWidth:I,innerHeight:s}=window,{classes:C,theme:{dir:g,spacing:b}}=ut(),S=lt(b.md);return pt(nt,{ref:i,shadow:e,radius:o,className:C.root,sx:{zIndex:a,top:t+m+S>s?s-m-S:t,left:g==="ltr"?f+l+S>I?I-l-S:f:I-S-(f-l-S<0?l+S:f)},children:d})}r();import{createStyles as mt}from"@mantine/core";import{jsx as It}from"react/jsx-runtime";var xt=mt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function fe(){let{classes:o}=xt();return It("div",{className:o.root})}r();import{Box as it,Text as gt,UnstyledButton as Ct,createStyles as St,px as ht}from"@mantine/core";import{jsx as ar,jsxs as Bt}from"react/jsx-runtime";var bt=St((o,{color:e})=>{let a=ht(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:a,paddingBottom:a,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function ne({icon:o,title:e,color:a,disabled:t,onClick:f}){let{classes:n}=bt({color:a});return Bt(Ct,{className:n.root,disabled:t,onClick:f,children:[o&&ar(it,{className:n.icon,children:o}),ar(gt,{className:n.title,size:"sm",children:e})]})}r();import{Box as Dt,createStyles as yt,ScrollArea as Tt}from"@mantine/core";import{jsx as Co,jsxs as Pt}from"react/jsx-runtime";var wt=yt(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{flex:"1 1 100%"},scrollbar:{'&[data-state="visible"]':{background:"transparent"},"div::before":{pointerEvents:"none"}},corner:{background:"transparent"},thumb:{zIndex:3},shadow:{position:"absolute",pointerEvents:"none",opacity:0,transition:"opacity .15s ease"},topShadow:{zIndex:2,top:0,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},leftShadow:{zIndex:3,top:0,left:0,bottom:0,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},rightShadow:{zIndex:2,top:0,bottom:0,right:0,width:o.spacing.sm,background:`linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},bottomShadow:{zIndex:2,left:0,right:0,bottom:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,0)}, ${o.fn.rgba(o.black,e)}), linear-gradient(${o.fn.rgba(o.black,0)} 30%, ${o.fn.rgba(o.black,e)})`},shadowVisible:{opacity:1}}});function le({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:a,bottomShadowVisible:t,headerHeight:f,onScrollPositionChange:n,children:d,viewportRef:u}){let{cx:p,classes:l}=wt();return Pt(Tt,{viewportRef:u,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:f}},onScrollPositionChange:n,children:[d,Co(Dt,{className:p(l.shadow,l.topShadow,{[l.shadowVisible]:o}),sx:{top:f}}),Co("div",{className:p(l.shadow,l.leftShadow,{[l.shadowVisible]:e})}),Co("div",{className:p(l.shadow,l.rightShadow,{[l.shadowVisible]:a})}),Co("div",{className:p(l.shadow,l.bottomShadow,{[l.shadowVisible]:t})})]})}import{jsx as O,jsxs as fr}from"react/jsx-runtime";var tr={},vt=Rt((o,{borderColor:e,rowBorderColor:a})=>{let t=typeof e=="function"?e(o):e,f=typeof a=="function"?a(o):a;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function nr({withBorder:o,borderRadius:e,borderColor:a=D=>D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],rowBorderColor:t=D=>D.fn.rgba(D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:n,height:d="100%",minHeight:u,shadow:p,verticalAlignment:l="center",fetching:m,columns:i,defaultColumnRender:I,idAccessor:s="id",records:C,selectedRecords:g,onSelectedRecordsChange:b,isRecordSelectable:S,sortStatus:H,sortIcons:v,onSortStatusChange:M,horizontalSpacing:w,page:y,onPageChange:R,totalRecords:k,recordsPerPage:Z,onRecordsPerPageChange:bo,recordsPerPageOptions:Bo,recordsPerPageLabel:Do="Records per page",paginationColor:yo,paginationSize:Q="sm",paginationText:K=({from:D,to:$,totalRecords:U})=>`${D} - ${$} / ${U}`,paginationWrapBreakpoint:To="sm",loaderBackgroundBlur:wo,customLoader:ro,loaderSize:lr,loaderVariant:dr,loaderColor:sr,loadingText:cr="...",emptyState:ur,noRecordsText:se="No records",noRecordsIcon:pr,striped:mr,onRowClick:Po,onCellClick:xr,onScrollToTop:ce,onScrollToBottom:ue,onScrollToLeft:pe,onScrollToRight:me,rowContextMenu:F,rowExpansion:Ir,rowClassName:ir,rowStyle:gr,rowSx:Cr,customRowAttributes:Sr,scrollViewportRef:hr,bodyRef:br,m:Br,my:Dr,mx:yr,mt:Tr,mb:wr,ml:Pr,mr:Mr,sx:Rr,className:Or,classNames:Mo,style:kr,styles:Ro,...Fr}){let{ref:D,width:$,height:U}=So(),{ref:vr,height:Oo}=So(),{ref:Ar,width:ko,height:ao}=So(),{ref:Lr,height:xe}=So(),[Fo,Ie]=ho(!0),[vo,ie]=ho(!0),[to,ge]=ho(!0),[Ao,Ce]=ho(!0),{rowContextMenuInfo:E,setRowContextMenuInfo:z}=_e(m),Hr=je({rowExpansion:Ir,records:C,idAccessor:s}),Lo=de(()=>{if(!m&&F&&z(null),m||ao<=U)Ie(!0),ie(!0);else{let x=D.current.scrollTop,h=x===0,T=ao-x-U<1;Ie(h),ie(T),h&&h!==Fo&&ce?.(),T&&T!==vo&&ue?.()}if(m||ko===$)ge(!0),Ce(!0);else{let x=D.current.scrollLeft,h=x===0,T=ko-x-$<1;ge(h),Ce(T),h&&h!==to&&pe?.(),T&&T!==Ao&&me?.()}},[m,ue,pe,me,ce,F,U,D,$,vo,to,Ao,Fo,z,ao,ko]);We(Lo,[Lo]);let Er=de(x=>{D.current.scrollTo({top:0,left:0}),R(x)},[R,D]),fo=C?.length,Se=C?.map(x=>B(x,s)),Y=g?.map(x=>B(x,s)),he=Se!==void 0&&Y!==void 0&&Y.length>0,Ho=S?C?.filter(S):C,no=Ho?.map(x=>B(x,s)),lo=he&&no.every(x=>Y.includes(x)),Nr=he&&no.some(x=>Y.includes(x)),qr=de(()=>{b?.(lo?g.filter(x=>!no.includes(B(x,s))):oo([...g,...Ho],x=>B(x,s)))},[lo,s,b,no,Ho,g]),{lastSelectionChangeIndex:so,setLastSelectionChangeIndex:Wr}=Ye(Se),be=!!g&&!to,{cx:Be,classes:A,theme:Ur}=vt({borderColor:a,rowBorderColor:t}),zr={m:Br,my:Dr,mx:yr,mt:Tr,mb:wr,ml:Pr,mr:Mr},Eo=typeof Ro=="function"?Ro(Ur,tr,tr):Ro;return fr(Mt,{...zr,className:Be(A.root,{[A.tableWithBorder]:o},Or,Mo?.root),sx:[x=>({borderRadius:x.radius[e]||e,boxShadow:x.shadows[p]||p,height:d,minHeight:u}),...Ot(Rr)],style:{...Eo?.root,...kr},children:[O(le,{viewportRef:Ft(D,hr||null),topShadowVisible:!Fo,leftShadowVisible:!(g||to),rightShadowVisible:!Ao,bottomShadowVisible:!vo,headerHeight:Oo,onScrollPositionChange:Lo,children:fr(kt,{ref:Ar,horizontalSpacing:w,className:Be(A.table,{[A.tableWithColumnBorders]:f,[A.lastRowBorderBottomVisible]:ao<U,[A.textSelectionDisabled]:n,[A.verticalAlignmentTop]:l==="top",[A.verticalAlignmentBottom]:l==="bottom"}),striped:fo?mr:!1,...Fr,children:[O(Ve,{ref:vr,className:Mo?.header,style:Eo?.header,columns:i,sortStatus:H,sortIcons:v,onSortStatusChange:M,selectionVisible:!!g,selectionChecked:lo,selectionIndeterminate:Nr&&!lo,onSelectionChange:qr,leftShadowVisible:be}),O("tbody",{ref:br,children:fo?C.map((x,h)=>{let T=B(x,s),_=Y?.includes(T)||!1,co=!1,uo=!1;if(F){let{hidden:P}=F;(!P||!(typeof P=="function"?P(x,h):P))&&(F.trigger==="click"?co=!0:uo=!0)}let po;b&&(po=P=>{if(P.nativeEvent.shiftKey&&so!==null){let V=C.filter(h>so?(N,q)=>q>=so&&q<=h&&(S?S(N,q):!0):(N,q)=>q>=h&&q<=so&&(S?S(N,q):!0));b(_?Go(g,V,N=>B(N,s)):oo([...g,...V],N=>B(N,s)))}else b(_?g.filter(V=>B(V,s)!==T):oo([...g,x],V=>B(V,s)));Wr(h)});let j;co?j=P=>{z({y:P.clientY,x:P.clientX,record:x,recordIndex:h}),Po?.(x,h)}:Po&&(j=()=>{Po(x,h)});let De;return uo&&(De=P=>{P.preventDefault(),z({y:P.clientY,x:P.clientX,record:x,recordIndex:h})}),O(ae,{record:x,recordIndex:h,columns:i,defaultColumnRender:I,selectionVisible:!!g,selectionChecked:_,onSelectionChange:po,isRecordSelectable:S,onClick:j,onCellClick:xr,onContextMenu:De,contextMenuVisible:E?B(E.record,s)===T:!1,expansion:Hr,className:ir,style:gr,sx:Cr,customRowAttributes:Sr,leftShadowVisible:be},T)}):O(qo,{})})]})}),y&&O(Ke,{ref:Lr,className:Mo?.pagination,style:Eo?.pagination,topBorderColor:a,horizontalSpacing:w,fetching:m,page:y,onPageChange:Er,totalRecords:k,recordsPerPage:Z,onRecordsPerPageChange:bo,recordsPerPageOptions:Bo,recordsPerPageLabel:Do,paginationColor:yo,paginationSize:Q,paginationText:K,paginationWrapBreakpoint:To,noRecordsText:se,loadingText:cr,recordsLength:fo}),O($o,{pt:Oo,pb:xe,fetching:m,backgroundBlur:wo,customContent:ro,size:lr,variant:dr,color:sr}),O(Vo,{pt:Oo,pb:xe,icon:pr,text:se,active:!m&&!fo,children:ur}),F&&E&&O(te,{zIndex:F.zIndex,borderRadius:F.borderRadius,shadow:F.shadow,y:E.y,x:E.x,onDestroy:()=>z(null),children:F.items(E.record,E.recordIndex).map(({divider:x,key:h,title:T,icon:_,color:co,hidden:uo,disabled:po,onClick:j})=>x?O(fe,{},h):uo?null:O(ne,{title:T??J(h),icon:_,color:co,disabled:po,onClick:()=>{z(null),j()}},h))})]})}r();r();r();r();r();r();r();r();r();r();r();r();r();r();r();r();export{nr as DataTable,Go as differenceBy,B as getValueAtPath,J as humanize,oo as uniqBy};
1
+ var Vr=Object.create;var Te=Object.defineProperty;var Gr=Object.getOwnPropertyDescriptor;var Xr=Object.getOwnPropertyNames;var Zr=Object.getPrototypeOf,Qr=Object.prototype.hasOwnProperty;var Kr=(o,e)=>()=>(o&&(e=o(o=0)),e);var qo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var $r=(o,e,a,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of Xr(e))!Qr.call(o,f)&&f!==a&&Te(o,f,{get:()=>e[f],enumerable:!(t=Gr(e,f))||t.enumerable});return o};var Yr=(o,e,a)=>(a=o!=null?Vr(Zr(o)):{},$r(e||!o||!o.__esModule?Te(a,"default",{value:o,enumerable:!0}):a,o));import*as c from"react";var r=Kr(()=>{"use strict"});var Me=qo((Wt,Pe)=>{"use strict";r();var Jr="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Pe.exports=Jr});var Fe=qo((zt,ke)=>{"use strict";r();var oa=Me();function Re(){}function Oe(){}Oe.resetWarningCache=Re;ke.exports=function(){function o(t,f,n,d,u,p){if(p!==oa){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}o.isRequired=o;function e(){return o}var a={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Oe,resetWarningCache:Re};return a.PropTypes=a,a}});var Ae=qo((Zt,ve)=>{r();ve.exports=Fe()();var Gt,Xt});r();r();import{Box as Mt,createStyles as Rt,packSx as Ot,Table as kt}from"@mantine/core";import{useElementSize as So,useMergedRef as Ft}from"@mantine/hooks";import{useCallback as se,useState as ho}from"react";r();import{createStyles as _r}from"@mantine/core";import{jsx as we}from"react/jsx-runtime";var jr=_r({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Wo(){let{classes:o}=jr();return we("tr",{className:o.root,children:we("td",{})})}r();import{Center as la,createStyles as da,Text as sa}from"@mantine/core";r();r();var L=Yr(Ae());import{forwardRef as ea,createElement as He}from"react";r();var Le={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ra=Object.defineProperty,aa=Object.defineProperties,ta=Object.getOwnPropertyDescriptors,mo=Object.getOwnPropertySymbols,qe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Ee=(o,e,a)=>e in o?ra(o,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[e]=a,Ne=(o,e)=>{for(var a in e||(e={}))qe.call(e,a)&&Ee(o,a,e[a]);if(mo)for(var a of mo(e))We.call(e,a)&&Ee(o,a,e[a]);return o},fa=(o,e)=>aa(o,ta(e)),na=(o,e)=>{var a={};for(var t in o)qe.call(o,t)&&e.indexOf(t)<0&&(a[t]=o[t]);if(o!=null&&mo)for(var t of mo(o))e.indexOf(t)<0&&We.call(o,t)&&(a[t]=o[t]);return a},G=(o,e,a)=>{let t=ea((f,n)=>{var d=f,{color:u="currentColor",size:p=24,stroke:l=2,children:m}=d,i=na(d,["color","size","stroke","children"]);return He("svg",Ne(fa(Ne({ref:n},Le),{width:p,height:p,stroke:u,strokeWidth:l,className:`tabler-icon tabler-icon-${o}`}),i),[...a.map(([I,s])=>He(I,s)),...m||[]])});return t.propTypes={color:L.default.string,size:L.default.oneOfType([L.default.string,L.default.number]),stroke:L.default.oneOfType([L.default.string,L.default.number])},t.displayName=`${e}`,t};r();var Uo=G("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);r();var zo=G("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);r();var Vo=G("database-off","IconDatabaseOff",[["path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74",key:"svg-0"}],["path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6",key:"svg-1"}],["path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]]);import{Fragment as ua,jsx as xo,jsxs as pa}from"react/jsx-runtime";var ca=da(o=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[6],opacity:0,transition:"opacity .15s ease"},active:{opacity:1},standardIcon:{fontSize:0,borderRadius:"50%",padding:o.spacing.xs,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[2]}}));function Go({icon:o,text:e,pt:a,pb:t,active:f,children:n}){let{classes:d,cx:u}=ca();return xo(la,{pt:a,pb:t,className:u(d.root,{[d.active]:f}),children:n||pa(ua,{children:[o||xo("div",{className:d.standardIcon,children:xo(Vo,{})}),xo(sa,{size:"sm",color:"dimmed",children:e})]})})}r();import{createStyles as Ta}from"@mantine/core";import{forwardRef as wa}from"react";r();import{Box as Zo,Center as ze,createStyles as ga,Group as Ca}from"@mantine/core";r();import{useMantineTheme as ma}from"@mantine/core";import{useMediaQuery as xa}from"@mantine/hooks";import{useEffect as Ia,useLayoutEffect as ia}from"react";var Ue=typeof window<"u"?ia:Ia;function Io(o){let e=ma(),a=typeof o=="function"?o(e):o;return xa(a||"",!0)}function J(o){let e=o.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Xo(o,e,a){return o.filter(t=>!e.map(a).includes(a(t)))}function oo(o,e){return o.filter((a,t,f)=>t===f.findIndex(n=>e(a)===e(n)))}function B(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}import{jsx as W,jsxs as ha}from"react/jsx-runtime";var Sa=ga(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover":{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[0]}},sortableColumnHeaderGroup:{gap:"0.25em"},columnHeaderText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},sortableColumnHeaderText:{minWidth:0,flexGrow:1},sortableColumnHeaderIcon:{transition:"transform .15s ease"},sortableColumnHeaderIconRotated:{transform:"rotate3d(0, 0, 1, 180deg)"},sortableColumnHeaderUnsortedIcon:{color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5],transition:"color .15s ease","th:hover &":{color:o.colorScheme==="dark"?o.colors.dark[2]:o.colors.gray[6]}}}));function Qo({className:o,sx:e,style:a,accessor:t,visibleMediaQuery:f,title:n,sortable:d,sortIcons:u,textAlignment:p,width:l,sortStatus:m,onSortStatusChange:i}){let{cx:I,classes:s}=Sa();if(!Io(f))return null;let C=n??J(t),g=typeof C=="string"?C:void 0,b=d&&i?()=>{i({columnAccessor:t,direction:m?.direction==="asc"?"desc":"asc"})}:void 0;return W(Zo,{component:"th",className:I({[s.sortableColumnHeader]:d},o),sx:[{"&&":{textAlign:p},width:l,minWidth:l,maxWidth:l},e],style:a,role:d?"button":void 0,tabIndex:d?0:void 0,onClick:b,onKeyDown:S=>S.key==="Enter"&&b?.(),children:d||m?.columnAccessor===t?ha(Ca,{className:s.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[W(Zo,{className:I(s.columnHeaderText,s.sortableColumnHeaderText),title:g,children:C}),m?.columnAccessor===t?W(ze,{className:I(s.sortableColumnHeaderIcon,{[s.sortableColumnHeaderIconRotated]:m.direction==="desc"}),"aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:u?.sorted||W(Uo,{size:14})}):W(ze,{className:s.sortableColumnHeaderUnsortedIcon,children:u?.unsorted||W(zo,{size:14})})]}):W(Zo,{className:s.columnHeaderText,title:g,children:C})})}r();import{Checkbox as ba,createStyles as Ba,px as Da}from"@mantine/core";import{jsx as Ve}from"react/jsx-runtime";var ya=Ba(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-Da(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}},checkboxInput:{cursor:"pointer"}}});function Ko({shadowVisible:o,checked:e,indeterminate:a,onChange:t}){let{cx:f,classes:n}=ya();return Ve("th",{className:f(n.root,{[n.shadowVisible]:o}),children:Ve(ba,{classNames:{input:n.checkboxInput},checked:e,indeterminate:a,disabled:!t,onChange:t})})}import{jsx as $o,jsxs as Ma}from"react/jsx-runtime";var Pa=Ta(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),Ge=wa(function({className:e,style:a,sortStatus:t,sortIcons:f,onSortStatusChange:n,columns:d,selectionVisible:u,selectionChecked:p,selectionIndeterminate:l,onSelectionChange:m,leftShadowVisible:i},I){let{classes:s,cx:C}=Pa();return $o("thead",{className:C(s.root,e),style:a,ref:I,children:Ma("tr",{children:[u&&$o(Ko,{shadowVisible:i,checked:p,indeterminate:l,onChange:m}),d.map(({accessor:g,hidden:b,visibleMediaQuery:S,textAlignment:H,width:v,title:M,sortable:P,titleClassName:T,titleStyle:R,titleSx:k})=>b?null:$o(Qo,{className:T,style:R,sx:k,accessor:g,visibleMediaQuery:S,textAlignment:H,width:v,title:M,sortable:P,sortStatus:t,sortIcons:f,onSortStatusChange:n},g))]})})});r();import{Center as Ra,createStyles as Oa,Loader as ka}from"@mantine/core";import{jsx as Xe}from"react/jsx-runtime";var Fa=Oa(o=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:o.fn.rgba(o.colorScheme==="dark"?o.colors.dark[8]:o.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function Yo({pt:o,pb:e,fetching:a,customContent:t,backgroundBlur:f,size:n,variant:d,color:u}){let{classes:p,cx:l}=Fa();return Xe(Ra,{pt:o,pb:e,className:l(p.root,{[p.fetching]:a}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:a&&(t||Xe(ka,{size:n,variant:d,color:u}))})}r();import{Box as La,Pagination as Ha,Text as Ea,createStyles as Na}from"@mantine/core";import{forwardRef as qa}from"react";r();import{Button as va,Group as Aa,Menu as io,Text as Ze}from"@mantine/core";import{jsx as X,jsxs as Ke}from"react/jsx-runtime";var Qe={xs:22,sm:26,md:32,lg:38,xl:44};function _o({size:o,label:e,values:a,value:t,onChange:f,color:n}){return Ke(Aa,{spacing:"xs",children:[X(Ze,{size:o,children:e}),Ke(io,{withinPortal:!0,withArrow:!0,children:[X(io.Target,{children:X(va,{size:o,variant:"default",sx:[{fontWeight:"normal"},d=>({height:Qe[o],paddingLeft:d.spacing[o],paddingRight:d.spacing[o]})],children:t})}),X(io.Dropdown,{children:a.map(d=>{let u=d===t;return X(io.Item,{sx:[{height:Qe[o]},p=>({"&&":{color:u?p.white:void 0},background:u?p.colors[n||p.primaryColor][6]:void 0})],disabled:u,onClick:()=>f(d),children:X(Ze,{size:o,children:d})},d)})})]})]})}import{jsx as jo,jsxs as Ua}from"react/jsx-runtime";var Wa=Na((o,{topBorderColor:e,paginationWrapBreakpoint:a})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(a)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),$e=qa(function({className:e,style:a,topBorderColor:t,fetching:f,page:n,onPageChange:d,paginationColor:u,paginationSize:p,loadingText:l,noRecordsText:m,paginationText:i,totalRecords:I,recordsPerPage:s,onRecordsPerPageChange:C,recordsPerPageLabel:g,recordsPerPageOptions:b,recordsLength:S,horizontalSpacing:H,paginationWrapBreakpoint:v},M){let P;if(f)P=l;else if(!I)P=m;else{let k=(n-1)*s+1,Z=k+S-1;P=i({from:k,to:Z,totalRecords:I})}let{classes:T,cx:R}=Wa({topBorderColor:t,paginationWrapBreakpoint:v});return Ua(La,{ref:M,px:H??"xs",py:"xs",className:R(T.root,e),style:a,children:[jo(Ea,{className:T.text,size:p,children:P}),b&&jo(_o,{size:p,label:g,values:b,value:s,onChange:C}),jo(Ha,{color:u,className:R(T.pagination,{[T.paginationFetching]:f||!S}),value:n,onChange:d,size:p,total:Math.ceil(I/s)})]})});r();import{Box as et,createStyles as rt}from"@mantine/core";r();import{Box as za,createStyles as Va}from"@mantine/core";import{jsx as Xa}from"react/jsx-runtime";var Ga=Va({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function Jo({className:o,sx:e,style:a,visibleMediaQuery:t,record:f,recordIndex:n,onClick:d,noWrap:u,ellipsis:p,textAlignment:l,width:m,accessor:i,render:I,defaultRender:s,customCellAttributes:C}){let{cx:g,classes:b}=Ga();return Io(t)?Xa(za,{component:"td",className:g({[b.noWrap]:u||p,[b.ellipsis]:p,[b.withPointerCursor]:d},o),sx:[{width:m,minWidth:m,maxWidth:m,textAlign:l},e],style:a,onClick:d,...C?.(f,n),children:I?I(f,n):s?s(f,n,i):B(f,i)}):null}r();import{Collapse as Za,createStyles as Qa}from"@mantine/core";r();import{useTimeout as Ye}from"@mantine/hooks";import{useEffect as oe,useState as eo}from"react";function _e(o){let[e,a]=eo(null),t=o?.join(":")||"";return oe(()=>{a(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:a}}function je(o){let[e,a]=eo(null);return oe(()=>{o&&a(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:a}}function Je({rowExpansion:o,records:e,idAccessor:a}){let t=[];if(o&&e){let{trigger:u,allowMultiple:p,initiallyExpanded:l}=o;e&&u==="always"?t=e.map(m=>B(m,a)):l&&(t=e.filter(l).map(m=>B(m,a)),p||(t=[t[0]]))}let f,n,d=eo(t);if(o){let{trigger:u,allowMultiple:p,collapseProps:l,content:m}=o;o.expanded?{recordIds:f,onRecordIdsChange:n}=o.expanded:[f,n]=d;let i=I=>n(f.filter(s=>s!==B(I,a)));return{expandOnClick:u!=="always"&&u!=="never",isRowExpanded:I=>u==="always"?!0:f.includes(B(I,a)),expandRow:I=>{let s=B(I,a);n(p?[...f,s]:[s])},collapseRow:i,collapseProps:l,content:(I,s)=>()=>m({record:I,recordIndex:s,collapse:()=>i(I)})}}}function or(o,e){let[a,t]=eo(o),[f,n]=eo(o),d=Ye(()=>t(!0),0),u=Ye(()=>n(!1),e||200);return oe(()=>{o?(u.clear(),n(!0),d.start()):(d.clear(),t(!1),u.start())},[d,u,o]),{expanded:a,visible:f}}import{Fragment as $a,jsx as go,jsxs as Ya}from"react/jsx-runtime";var Ka=Qa({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function ee({open:o,colSpan:e,content:a,collapseProps:t}){let{expanded:f,visible:n}=or(o,t?.transitionDuration),{cx:d,classes:u}=Ka();return n?Ya($a,{children:[go("tr",{}),go("tr",{children:go("td",{className:d(u.cell,{[u.expandedCell]:f}),colSpan:e,children:go(Za,{in:f,...t,children:a()})})})]}):null}r();import{Checkbox as _a,createStyles as ja,px as Ja}from"@mantine/core";import{jsx as er}from"react/jsx-runtime";var ot=ja(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-Ja(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},withRightShadow:{"&::after":{opacity:1}},checkbox:{cursor:"pointer"}}});function re({withRightShadow:o,...e}){let{cx:a,classes:t}=ot();return er("td",{className:a(t.root,{[t.withRightShadow]:o}),onClick:f=>f.stopPropagation(),children:er(_a,{classNames:{input:t.checkbox},...e})})}import{Fragment as tt,jsx as ae,jsxs as rr}from"react/jsx-runtime";var at=rt(o=>{let e=o.colors[o.primaryColor][6];return{withPointerCursor:{cursor:"pointer"},selected:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.6):o.fn.lighten(e,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.55):o.fn.lighten(e,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.5):o.fn.lighten(e,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.45):o.fn.lighten(e,.65)}}}}});function te({record:o,recordIndex:e,columns:a,defaultColumnRender:t,selectionVisible:f,selectionChecked:n,onSelectionChange:d,isRecordSelectable:u,onClick:p,onCellClick:l,onContextMenu:m,expansion:i,customRowAttributes:I,className:s,style:C,sx:g,contextMenuVisible:b,leftShadowVisible:S}){let{cx:H,classes:v}=at();return rr(tt,{children:[rr(et,{component:"tr",className:H({[v.withPointerCursor]:p||i?.expandOnClick,[v.selected]:n,[v.contextMenuVisible]:b},typeof s=="function"?s(o,e):s),onClick:M=>{if(i){let{isRowExpanded:P,expandOnClick:T,expandRow:R,collapseRow:k}=i;T&&(P(o)?k(o):R(o))}p?.(M)},style:typeof C=="function"?C(o,e):C,sx:g,...I?.(o,e),onContextMenu:m,children:[f&&ae(re,{withRightShadow:S,checked:n,disabled:!d||(u?!u(o,e):!1),onChange:d}),a.map((M,P)=>{let{accessor:T,hidden:R,visibleMediaQuery:k,textAlignment:Z,noWrap:bo,ellipsis:Bo,width:Do,render:yo,cellsClassName:Q,cellsStyle:K,cellsSx:To,customCellAttributes:wo}=M,ro;return l&&(ro=Po=>l({event:Po,record:o,recordIndex:e,column:M,columnIndex:P})),R?null:ae(Jo,{className:typeof Q=="function"?Q(o,e):Q,style:typeof K=="function"?K(o,e):K,sx:To,visibleMediaQuery:k,record:o,recordIndex:e,onClick:ro,accessor:T,textAlignment:Z,noWrap:bo,ellipsis:Bo,width:Do,render:yo,defaultRender:t,customCellAttributes:wo},T)})]}),i&&ae(ee,{colSpan:a.filter(M=>!M.hidden).length+(f?1:0),open:i.isRowExpanded(o),content:i.content(o,e),collapseProps:i.collapseProps})]})}r();import{createStyles as ft,Paper as nt,px as lt}from"@mantine/core";import{useClickOutside as dt,useElementSize as st,useMergedRef as ct,useWindowEvent as ar}from"@mantine/hooks";import{jsx as pt}from"react/jsx-runtime";var ut=ft(o=>({root:{position:"fixed",border:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function fe({borderRadius:o="xs",shadow:e="sm",zIndex:a=3,y:t,x:f,onDestroy:n,children:d}){ar("resize",n),ar("scroll",n);let u=dt(n),{ref:p,width:l,height:m}=st(),i=ct(u,p),{innerWidth:I,innerHeight:s}=window,{classes:C,theme:{dir:g,spacing:b}}=ut(),S=lt(b.md);return pt(nt,{ref:i,shadow:e,radius:o,className:C.root,sx:{zIndex:a,top:t+m+S>s?s-m-S:t,left:g==="ltr"?f+l+S>I?I-l-S:f:I-S-(f-l-S<0?l+S:f)},children:d})}r();import{createStyles as mt}from"@mantine/core";import{jsx as It}from"react/jsx-runtime";var xt=mt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function ne(){let{classes:o}=xt();return It("div",{className:o.root})}r();import{Box as it,Text as gt,UnstyledButton as Ct,createStyles as St,px as ht}from"@mantine/core";import{jsx as tr,jsxs as Bt}from"react/jsx-runtime";var bt=St((o,{color:e})=>{let a=ht(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:a,paddingBottom:a,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function le({icon:o,title:e,color:a,disabled:t,onClick:f}){let{classes:n}=bt({color:a});return Bt(Ct,{className:n.root,disabled:t,onClick:f,children:[o&&tr(it,{className:n.icon,children:o}),tr(gt,{className:n.title,size:"sm",children:e})]})}r();import{Box as Dt,createStyles as yt,ScrollArea as Tt}from"@mantine/core";import{jsx as Co,jsxs as Pt}from"react/jsx-runtime";var wt=yt(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{flex:"1 1 100%"},scrollbar:{'&[data-state="visible"]':{background:"transparent"},"div::before":{pointerEvents:"none"}},corner:{background:"transparent"},thumb:{zIndex:3},shadow:{position:"absolute",pointerEvents:"none",opacity:0,transition:"opacity .15s ease"},topShadow:{zIndex:2,top:0,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},leftShadow:{zIndex:3,top:0,left:0,bottom:0,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},rightShadow:{zIndex:2,top:0,bottom:0,right:0,width:o.spacing.sm,background:`linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},bottomShadow:{zIndex:2,left:0,right:0,bottom:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,0)}, ${o.fn.rgba(o.black,e)}), linear-gradient(${o.fn.rgba(o.black,0)} 30%, ${o.fn.rgba(o.black,e)})`},shadowVisible:{opacity:1}}});function de({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:a,bottomShadowVisible:t,headerHeight:f,onScrollPositionChange:n,children:d,viewportRef:u}){let{cx:p,classes:l}=wt();return Pt(Tt,{viewportRef:u,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:f}},onScrollPositionChange:n,children:[d,Co(Dt,{className:p(l.shadow,l.topShadow,{[l.shadowVisible]:o}),sx:{top:f}}),Co("div",{className:p(l.shadow,l.leftShadow,{[l.shadowVisible]:e})}),Co("div",{className:p(l.shadow,l.rightShadow,{[l.shadowVisible]:a})}),Co("div",{className:p(l.shadow,l.bottomShadow,{[l.shadowVisible]:t})})]})}import{jsx as O,jsxs as nr}from"react/jsx-runtime";var fr={},vt=Rt((o,{borderColor:e,rowBorderColor:a})=>{let t=typeof e=="function"?e(o):e,f=typeof a=="function"?a(o):a;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function lr({withBorder:o,borderRadius:e,borderColor:a=D=>D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],rowBorderColor:t=D=>D.fn.rgba(D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:n,height:d="100%",minHeight:u,shadow:p,verticalAlignment:l="center",fetching:m,columns:i,defaultColumnRender:I,idAccessor:s="id",records:C,selectedRecords:g,onSelectedRecordsChange:b,isRecordSelectable:S,sortStatus:H,sortIcons:v,onSortStatusChange:M,horizontalSpacing:P,page:T,onPageChange:R,totalRecords:k,recordsPerPage:Z,onRecordsPerPageChange:bo,recordsPerPageOptions:Bo,recordsPerPageLabel:Do="Records per page",paginationColor:yo,paginationSize:Q="sm",paginationText:K=({from:D,to:$,totalRecords:U})=>`${D} - ${$} / ${U}`,paginationWrapBreakpoint:To="sm",loaderBackgroundBlur:wo,customLoader:ro,loaderSize:Po,loaderVariant:dr,loaderColor:sr,loadingText:cr="...",emptyState:ur,noRecordsText:ce="No records",noRecordsIcon:pr,striped:mr,onRowClick:Mo,onCellClick:xr,onScrollToTop:ue,onScrollToBottom:pe,onScrollToLeft:me,onScrollToRight:xe,rowContextMenu:F,rowExpansion:Ir,rowClassName:ir,rowStyle:gr,rowSx:Cr,customRowAttributes:Sr,scrollViewportRef:hr,bodyRef:br,m:Br,my:Dr,mx:yr,mt:Tr,mb:wr,ml:Pr,mr:Mr,sx:Rr,className:Or,classNames:Ro,style:kr,styles:Oo,...Fr}){let{ref:D,width:$,height:U}=So(),{ref:vr,height:ko}=So(),{ref:Ar,width:Fo,height:ao}=So(),{ref:Lr,height:Ie}=So(),[vo,ie]=ho(!0),[Ao,ge]=ho(!0),[to,Ce]=ho(!0),[Lo,Se]=ho(!0),{rowContextMenuInfo:E,setRowContextMenuInfo:z}=je(m),Hr=Je({rowExpansion:Ir,records:C,idAccessor:s}),Ho=se(()=>{if(!m&&F&&z(null),m||ao<=U)ie(!0),ge(!0);else{let x=D.current.scrollTop,h=x===0,w=ao-x-U<1;ie(h),ge(w),h&&h!==vo&&ue?.(),w&&w!==Ao&&pe?.()}if(m||Fo===$)Ce(!0),Se(!0);else{let x=D.current.scrollLeft,h=x===0,w=Fo-x-$<1;Ce(h),Se(w),h&&h!==to&&me?.(),w&&w!==Lo&&xe?.()}},[m,pe,me,xe,ue,F,U,D,$,Ao,to,Lo,vo,z,ao,Fo]);Ue(Ho,[Ho]);let Er=se(x=>{D.current.scrollTo({top:0,left:0}),R(x)},[R,D]),fo=C?.length,he=C?.map(x=>B(x,s)),Y=g?.map(x=>B(x,s)),be=he!==void 0&&Y!==void 0&&Y.length>0,Eo=S?C?.filter(S):C,no=Eo?.map(x=>B(x,s)),lo=be&&no.every(x=>Y.includes(x)),Nr=be&&no.some(x=>Y.includes(x)),qr=se(()=>{b?.(lo?g.filter(x=>!no.includes(B(x,s))):oo([...g,...Eo],x=>B(x,s)))},[lo,s,b,no,Eo,g]),{lastSelectionChangeIndex:so,setLastSelectionChangeIndex:Wr}=_e(he),Be=!!g&&!to,{cx:De,classes:A,theme:Ur}=vt({borderColor:a,rowBorderColor:t}),zr={m:Br,my:Dr,mx:yr,mt:Tr,mb:wr,ml:Pr,mr:Mr},No=typeof Oo=="function"?Oo(Ur,fr,fr):Oo;return nr(Mt,{...zr,className:De(A.root,{[A.tableWithBorder]:o},Or,Ro?.root),sx:[x=>({borderRadius:x.radius[e]||e,boxShadow:x.shadows[p]||p,height:d,minHeight:u}),...Ot(Rr)],style:{...No?.root,...kr},children:[O(de,{viewportRef:Ft(D,hr||null),topShadowVisible:!vo,leftShadowVisible:!(g||to),rightShadowVisible:!Lo,bottomShadowVisible:!Ao,headerHeight:ko,onScrollPositionChange:Ho,children:nr(kt,{ref:Ar,horizontalSpacing:P,className:De(A.table,{[A.tableWithColumnBorders]:f,[A.lastRowBorderBottomVisible]:ao<U,[A.textSelectionDisabled]:n,[A.verticalAlignmentTop]:l==="top",[A.verticalAlignmentBottom]:l==="bottom"}),striped:fo?mr:!1,...Fr,children:[O(Ge,{ref:vr,className:Ro?.header,style:No?.header,columns:i,sortStatus:H,sortIcons:v,onSortStatusChange:M,selectionVisible:!!g,selectionChecked:lo,selectionIndeterminate:Nr&&!lo,onSelectionChange:qr,leftShadowVisible:Be}),O("tbody",{ref:br,children:fo?C.map((x,h)=>{let w=B(x,s),_=Y?.includes(w)||!1,co=!1,uo=!1;if(F){let{hidden:y}=F;(!y||!(typeof y=="function"?y(x,h):y))&&(F.trigger==="click"?co=!0:uo=!0)}let po;b&&(po=y=>{if(y.nativeEvent.shiftKey&&so!==null){let V=C.filter(h>so?(N,q)=>q>=so&&q<=h&&(S?S(N,q):!0):(N,q)=>q>=h&&q<=so&&(S?S(N,q):!0));b(_?Xo(g,V,N=>B(N,s)):oo([...g,...V],N=>B(N,s)))}else b(_?g.filter(V=>B(V,s)!==w):oo([...g,x],V=>B(V,s)));Wr(h)});let j;co?j=y=>{z({y:y.clientY,x:y.clientX,record:x,recordIndex:h}),Mo?.(x,h,y)}:Mo&&(j=y=>{Mo(x,h,y)});let ye;return uo&&(ye=y=>{y.preventDefault(),z({y:y.clientY,x:y.clientX,record:x,recordIndex:h})}),O(te,{record:x,recordIndex:h,columns:i,defaultColumnRender:I,selectionVisible:!!g,selectionChecked:_,onSelectionChange:po,isRecordSelectable:S,onClick:j,onCellClick:xr,onContextMenu:ye,contextMenuVisible:E?B(E.record,s)===w:!1,expansion:Hr,className:ir,style:gr,sx:Cr,customRowAttributes:Sr,leftShadowVisible:Be},w)}):O(Wo,{})})]})}),T&&O($e,{ref:Lr,className:Ro?.pagination,style:No?.pagination,topBorderColor:a,horizontalSpacing:P,fetching:m,page:T,onPageChange:Er,totalRecords:k,recordsPerPage:Z,onRecordsPerPageChange:bo,recordsPerPageOptions:Bo,recordsPerPageLabel:Do,paginationColor:yo,paginationSize:Q,paginationText:K,paginationWrapBreakpoint:To,noRecordsText:ce,loadingText:cr,recordsLength:fo}),O(Yo,{pt:ko,pb:Ie,fetching:m,backgroundBlur:wo,customContent:ro,size:Po,variant:dr,color:sr}),O(Go,{pt:ko,pb:Ie,icon:pr,text:ce,active:!m&&!fo,children:ur}),F&&E&&O(fe,{zIndex:F.zIndex,borderRadius:F.borderRadius,shadow:F.shadow,y:E.y,x:E.x,onDestroy:()=>z(null),children:F.items(E.record,E.recordIndex).map(({divider:x,key:h,title:w,icon:_,color:co,hidden:uo,disabled:po,onClick:j})=>x?O(ne,{},h):uo?null:O(le,{title:w??J(h),icon:_,color:co,disabled:po,onClick:()=>{z(null),j()}},h))})]})}r();r();r();r();r();r();r();r();r();r();r();r();r();r();r();r();export{lr as DataTable,Xo as differenceBy,B as getValueAtPath,J as humanize,oo as uniqBy};
2
2
  //# sourceMappingURL=index.mjs.map