mantine-datatable 2.5.5 → 2.5.7

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 ta=Object.create;var Me=Object.defineProperty;var fa=Object.getOwnPropertyDescriptor;var na=Object.getOwnPropertyNames;var la=Object.getPrototypeOf,da=Object.prototype.hasOwnProperty;var sa=(o,e)=>()=>(o&&(e=o(o=0)),e);var Uo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var ca=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of na(e))!da.call(o,f)&&f!==r&&Me(o,f,{get:()=>e[f],enumerable:!(t=fa(e,f))||t.enumerable});return o};var ua=(o,e,r)=>(r=o!=null?ta(la(o)):{},ca(e||!o||!o.__esModule?Me(r,"default",{value:o,enumerable:!0}):r,o));import*as d from"react";var a=sa(()=>{"use strict"});var Ae=Uo((gf,ve)=>{"use strict";a();var xa="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ve.exports=xa});var Ne=Uo((Sf,Ee)=>{"use strict";a();var Ia=Ae();function Le(){}function He(){}He.resetWarningCache=Le;Ee.exports=function(){function o(t,f,l,n,s,p){if(p!==Ia){var x=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 x.name="Invariant Violation",x}}o.isRequired=o;function e(){return o}var r={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:He,resetWarningCache:Le};return r.PropTypes=r,r}});var We=Uo((Df,qe)=>{a();qe.exports=Ne()();var bf,Bf});a();a();import{Box as tf,createStyles as ff,packSx as nf,Table as lf}from"@mantine/core";import{useElementSize as no,useMergedRef as df}from"@mantine/hooks";import{useCallback as ie,useState as wo}from"react";a();import{createStyles as pa}from"@mantine/core";import{jsx as Oe}from"react/jsx-runtime";var ma=pa({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Vo(){let{classes:o}=ma();return Oe("tr",{className:o.root,children:Oe("td",{})})}a();import{Center as Ba,createStyles as Da,Text as ya}from"@mantine/core";a();a();var N=ua(We());import{forwardRef as ia,createElement as Ue}from"react";a();var ze={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 ga=Object.defineProperty,Ca=Object.defineProperties,Sa=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Ve=(o,e,r)=>e in o?ga(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ge=(o,e)=>{for(var r in e||(e={}))Xe.call(e,r)&&Ve(o,r,e[r]);if(ho)for(var r of ho(e))Qe.call(e,r)&&Ve(o,r,e[r]);return o},ha=(o,e)=>Ca(o,Sa(e)),ba=(o,e)=>{var r={};for(var t in o)Xe.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&ho)for(var t of ho(o))e.indexOf(t)<0&&Qe.call(o,t)&&(r[t]=o[t]);return r},q=(o,e,r)=>{let t=ia((f,l)=>{var n=f,{color:s="currentColor",size:p=24,stroke:x=2,children:c}=n,u=ba(n,["color","size","stroke","children"]);return Ue("svg",Ge(ha(Ge({ref:l},ze),{width:p,height:p,stroke:s,strokeWidth:x,className:`tabler-icon tabler-icon-${o}`}),u),[...r.map(([I,m])=>Ue(I,m)),...c||[]])});return t.propTypes={color:N.default.string,size:N.default.oneOfType([N.default.string,N.default.number]),stroke:N.default.oneOfType([N.default.string,N.default.number])},t.displayName=`${e}`,t};a();var Go=q("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"}]]);a();var Xo=q("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"}]]);a();var Qo=q("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"}]]);a();var Zo=q("filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);import{Fragment as Ta,jsx as bo,jsxs as Pa}from"react/jsx-runtime";var wa=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 Ko({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:n,cx:s}=wa();return bo(Ba,{pt:r,pb:t,className:s(n.root,{[n.active]:f}),children:l||Pa(Ta,{children:[o||bo("div",{className:n.standardIcon,children:bo(Qo,{})}),bo(ya,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as Wa,createStyles as za}from"@mantine/core";import{forwardRef as Ua}from"react";a();import{Box as Oa,createStyles as va}from"@mantine/core";a();import{useMantineTheme as Ra}from"@mantine/core";import{useMediaQuery as ka}from"@mantine/hooks";import{useEffect as Fa,useLayoutEffect as Ma}from"react";var Ze=typeof window<"u"?Ma:Fa;function K(o){let e=Ra(),r=typeof o=="function"?o(e):o;return ka(r||"",!0)}function ao(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 $o(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function to(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function D(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}import{jsx as La}from"react/jsx-runtime";var Aa=va({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function Yo({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:l,ellipsis:n,textAlignment:s,width:p}){let{cx:x,classes:c}=Aa();return K(t)?La(Oa,{component:"th",className:x({[c.noWrap]:l||n,[c.ellipsis]:n},o),sx:[{"&&":{textAlign:s},width:p,minWidth:p,maxWidth:p},e],style:r,children:f}):null}a();import{createStyles as Ha,px as Ea}from"@mantine/core";import{jsx as qa}from"react/jsx-runtime";var Na=Ha(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:-Ea(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}}}});function _o({shadowVisible:o}){let{cx:e,classes:r}=Na();return qa("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as jo,jsxs as Ga}from"react/jsx-runtime";var Va=za((o,{scrollDiff:e,borderColor:r})=>{let t=e<0,f=typeof r=="function"?r(o):r;return{root:{zIndex:2,position:t?"relative":"sticky",bottom:t?e:-1,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,"&& tr th":{borderTopColor:f}},relative:{position:"relative"},textSelectionDisabled:{userSelect:"none"}}}),Ke=Ua(function({className:e,style:r,borderColor:t,columns:f,selectionVisible:l,leftShadowVisible:n,scrollDiff:s},p){let{cx:x,classes:c}=Va({scrollDiff:s,borderColor:t});return jo(Wa,{component:"tfoot",ref:p,className:x(c.root,e),style:r,children:Ga("tr",{children:[l&&jo(_o,{shadowVisible:n}),f.map(({accessor:u,hidden:I,visibleMediaQuery:m,textAlignment:S,width:g,footer:h,footerClassName:C,footerStyle:k,footerSx:R,noWrap:v,ellipsis:w})=>I?null:jo(Yo,{className:C,style:k,sx:R,visibleMediaQuery:m,textAlignment:S,width:g,title:h,noWrap:v,ellipsis:w},u))]})})});a();import{createStyles as rt}from"@mantine/core";import{forwardRef as at}from"react";a();import{Box as $e,Center as Ye,createStyles as Xa,Group as Qa,ActionIcon as Za,Popover as Jo}from"@mantine/core";import{useDisclosure as Ka}from"@mantine/hooks";import{Fragment as _a,jsx as M,jsxs as _e}from"react/jsx-runtime";var $a=Xa(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover:not(:has(button: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 Ya({children:o,isActive:e}){let[r,{close:t,toggle:f}]=Ka(!1);return _e(Jo,{withArrow:!0,withinPortal:!0,shadow:"md",opened:r,onClose:t,trapFocus:!0,children:[M(Jo.Target,{children:M(Za,{onClick:l=>{l.preventDefault(),f()},variant:e?"default":"subtle",children:M(Zo,{size:14})})}),M(Jo.Dropdown,{children:typeof o=="function"?o({close:t}):o})]})}function oe({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:n,sortIcons:s,textAlignment:p,width:x,sortStatus:c,onSortStatusChange:u,filter:I,filtering:m}){let{cx:S,classes:g}=$a();if(!K(f))return null;let h=l??ao(t),C=typeof h=="string"?h:void 0,k=n&&u?R=>{R?.defaultPrevented||u({columnAccessor:t,direction:c?.columnAccessor===t?c.direction==="asc"?"desc":"asc":c?.direction??"asc"})}:void 0;return M($e,{component:"th",className:S({[g.sortableColumnHeader]:n},o),sx:[{"&&":{textAlign:p},width:x,minWidth:x,maxWidth:x},e],style:r,role:n?"button":void 0,tabIndex:n?0:void 0,onClick:k,onKeyDown:R=>R.key==="Enter"&&k?.(),children:_e(Qa,{className:g.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[M($e,{className:S(g.columnHeaderText,g.sortableColumnHeaderText),title:C,children:h}),n||c?.columnAccessor===t?M(_a,{children:c?.columnAccessor===t?M(Ye,{className:S(g.sortableColumnHeaderIcon,{[g.sortableColumnHeaderIconRotated]:c.direction==="desc"}),role:"img","aria-label":`Sorted ${c.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||M(Go,{size:14})}):M(Ye,{className:g.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:s?.unsorted||M(Xo,{size:14})})}):null,I?M(Ya,{isActive:!!m,children:I}):null]})})}a();import{Checkbox as ja,createStyles as Ja,px as ot}from"@mantine/core";import{jsx as je}from"react/jsx-runtime";var et=Ja(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:-ot(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 ee({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f}){let{cx:l,classes:n}=et();return je("th",{className:l(n.root,{[n.shadowVisible]:o}),children:je(ja,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as re,jsxs as ft}from"react/jsx-runtime";var tt=rt(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),Je=at(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:l,columns:n,selectionVisible:s,selectionChecked:p,selectionIndeterminate:x,onSelectionChange:c,selectionCheckboxProps:u,leftShadowVisible:I},m){let{classes:S,cx:g}=tt();return re("thead",{className:g(S.root,e),style:r,ref:m,children:ft("tr",{children:[s&&re(ee,{shadowVisible:I,checked:p,indeterminate:x,checkboxProps:u,onChange:c}),n.map(({accessor:h,hidden:C,visibleMediaQuery:k,textAlignment:R,width:v,title:w,sortable:F,titleClassName:T,titleStyle:A,titleSx:L,filter:W,filtering:Y})=>C?null:re(oe,{className:T,style:A,sx:L,accessor:h,visibleMediaQuery:k,textAlignment:R,width:v,title:w,sortable:F,sortStatus:t,sortIcons:f,onSortStatusChange:l,filter:W,filtering:Y},h))]})})});a();import{Center as nt,createStyles as lt,Loader as dt}from"@mantine/core";import{jsx as or}from"react/jsx-runtime";var st=lt(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 ae({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:n,color:s}){let{classes:p,cx:x}=st();return or(nt,{pt:o,pb:e,className:x(p.root,{[p.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||or(dt,{size:l,variant:n,color:s}))})}a();import{Box as pt,Pagination as mt,Text as xt,createStyles as It}from"@mantine/core";import{forwardRef as it}from"react";a();import{Button as ct,Group as ut,Menu as Bo,Text as er}from"@mantine/core";import{jsx as $,jsxs as ar}from"react/jsx-runtime";var rr={xs:22,sm:26,md:32,lg:38,xl:44};function te({size:o,label:e,values:r,value:t,onChange:f,color:l}){return ar(ut,{spacing:"xs",children:[$(er,{size:o,children:e}),ar(Bo,{withinPortal:!0,withArrow:!0,children:[$(Bo.Target,{children:$(ct,{size:o,variant:"default",sx:[{fontWeight:"normal"},n=>({height:rr[o],paddingLeft:n.spacing[o],paddingRight:n.spacing[o]})],children:t})}),$(Bo.Dropdown,{children:r.map(n=>{let s=n===t;return $(Bo.Item,{sx:[{height:rr[o]},p=>({"&&":{color:s?p.white:void 0},background:s?p.colors[l||p.primaryColor][6]:void 0})],disabled:s,onClick:()=>f(n),children:$(er,{size:o,children:n})},n)})})]})]})}import{jsx as fe,jsxs as Ct}from"react/jsx-runtime";var gt=It((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({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(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),tr=it(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:n,paginationColor:s,paginationSize:p,loadingText:x,noRecordsText:c,paginationText:u,totalRecords:I,recordsPerPage:m,onRecordsPerPageChange:S,recordsPerPageLabel:g,recordsPerPageOptions:h,recordsLength:C,horizontalSpacing:k,paginationWrapBreakpoint:R,getPaginationControlProps:v},w){let F;if(f)F=x;else if(!I)F=c;else{let L=(l-1)*m+1,W=L+C-1;F=u({from:L,to:W,totalRecords:I})}let{classes:T,cx:A}=gt({topBorderColor:t,paginationWrapBreakpoint:R});return Ct(pt,{ref:w,px:k??"xs",py:"xs",className:A(T.root,e),style:r,children:[fe(xt,{className:T.text,size:p,children:F}),h&&fe(te,{size:p,label:g,values:h,color:s,value:m,onChange:S}),fe(mt,{color:s,className:A(T.pagination,{[T.paginationFetching]:f||!C}),value:l,onChange:n,size:p,total:Math.ceil(I/m),getControlProps:v})]})});a();import{Box as Ot,createStyles as vt}from"@mantine/core";a();import{Box as St,createStyles as ht}from"@mantine/core";import{jsx as Bt}from"react/jsx-runtime";var bt=ht({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function ne({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:n,noWrap:s,ellipsis:p,textAlignment:x,width:c,accessor:u,render:I,defaultRender:m,customCellAttributes:S}){let{cx:g,classes:h}=bt();return K(t)?Bt(St,{component:"td",className:g({[h.noWrap]:s||p,[h.ellipsis]:p,[h.withPointerCursor]:n},o),sx:[{width:c,minWidth:c,maxWidth:c,textAlign:x},e],style:r,onClick:n,...S?.(f,l),children:I?I(f,l):m?m(f,l,u):D(f,u)}):null}a();import{Collapse as Dt,createStyles as yt}from"@mantine/core";a();import{useTimeout as fr}from"@mantine/hooks";import{useEffect as le,useState as fo}from"react";function nr(o){let[e,r]=fo(null),t=o?.join(":")||"";return le(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function lr(o){let[e,r]=fo(null);return le(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function dr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:s,allowMultiple:p,initiallyExpanded:x}=o;e&&s==="always"?t=e.map(c=>D(c,r)):x&&(t=e.filter(x).map(c=>D(c,r)),p||(t=[t[0]]))}let f,l,n=fo(t);if(o){let{trigger:s,allowMultiple:p,collapseProps:x,content:c}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=n;let u=I=>l?.(f.filter(m=>m!==D(I,r)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:I=>s==="always"?!0:f.includes(D(I,r)),expandRow:I=>{let m=D(I,r);l?.(p?[...f,m]:[m])},collapseRow:u,collapseProps:x,content:(I,m)=>()=>c({record:I,recordIndex:m,collapse:()=>u(I)})}}}function sr(o,e){let[r,t]=fo(o),[f,l]=fo(o),n=fr(()=>t(!0),0),s=fr(()=>l(!1),e||200);return le(()=>{o?(s.clear(),l(!0),n.start()):(n.clear(),t(!1),s.start())},[n,s,o]),{expanded:r,visible:f}}import{Fragment as Tt,jsx as Do,jsxs as Pt}from"react/jsx-runtime";var wt=yt({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function de({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=sr(o,t?.transitionDuration),{cx:n,classes:s}=wt();return l?Pt(Tt,{children:[Do("tr",{}),Do("tr",{children:Do("td",{className:n(s.cell,{[s.expandedCell]:f}),colSpan:e,children:Do(Dt,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as Rt,createStyles as kt,px as Ft}from"@mantine/core";import{jsx as cr}from"react/jsx-runtime";var Mt=kt(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:-Ft(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 se({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:l,classes:n}=Mt();return cr("td",{className:l(n.root,{[n.withRightShadow]:r}),onClick:s=>s.stopPropagation(),children:cr(Rt,{classNames:{input:n.checkbox},...f,...t(o,e)})})}import{Fragment as Lt,jsx as ce,jsxs as ur}from"react/jsx-runtime";var At=vt(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 ue({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:l,onSelectionChange:n,isRecordSelectable:s,getSelectionCheckboxProps:p,onClick:x,onCellClick:c,onContextMenu:u,expansion:I,customRowAttributes:m,className:S,style:g,sx:h,contextMenuVisible:C,leftShadowVisible:k}){let{cx:R,classes:v}=At();return ur(Lt,{children:[ur(Ot,{component:"tr",className:R({[v.withPointerCursor]:x||I?.expandOnClick,[v.selected]:l,[v.contextMenuVisible]:C},typeof S=="function"?S(o,e):S),onClick:w=>{if(I){let{isRowExpanded:F,expandOnClick:T,expandRow:A,collapseRow:L}=I;T&&(F(o)?L(o):A(o))}x?.(w)},style:typeof g=="function"?g(o,e):g,sx:h,...m?.(o,e),onContextMenu:u,children:[f&&ce(se,{record:o,recordIndex:e,withRightShadow:k,checked:l,disabled:!n||(s?!s(o,e):!1),onChange:n,getCheckboxProps:p}),r.map((w,F)=>{let{accessor:T,hidden:A,visibleMediaQuery:L,textAlignment:W,noWrap:Y,ellipsis:To,width:Po,render:Ro,cellsClassName:_,cellsStyle:j,cellsSx:ko,customCellAttributes:Fo}=w,lo;return c&&(lo=Mo=>c({event:Mo,record:o,recordIndex:e,column:w,columnIndex:F})),A?null:ce(ne,{className:typeof _=="function"?_(o,e):_,style:typeof j=="function"?j(o,e):j,sx:ko,visibleMediaQuery:L,record:o,recordIndex:e,onClick:lo,accessor:T,textAlignment:W,noWrap:Y,ellipsis:To,width:Po,render:Ro,defaultRender:t,customCellAttributes:Fo},T)})]}),I&&ce(de,{colSpan:r.filter(w=>!w.hidden).length+(f?1:0),open:I.isRowExpanded(o),content:I.content(o,e),collapseProps:I.collapseProps})]})}a();import{createStyles as Ht,Paper as Et,px as Nt}from"@mantine/core";import{useClickOutside as qt,useElementSize as Wt,useMergedRef as zt,useWindowEvent as pr}from"@mantine/hooks";import{jsx as Vt}from"react/jsx-runtime";var Ut=Ht(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 pe({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:l,children:n}){pr("resize",l),pr("scroll",l);let s=qt(l),{ref:p,width:x,height:c}=Wt(),u=zt(s,p),{innerWidth:I,innerHeight:m}=window,{classes:S,theme:{dir:g,spacing:h}}=Ut(),C=Nt(h.md);return Vt(Et,{ref:u,shadow:e,radius:o,className:S.root,sx:{zIndex:r,top:t+c+C>m?m-c-C:t,left:g==="ltr"?f+x+C>I?I-x-C:f:I-C-(f-x-C<0?x+C:f)},children:n})}a();import{createStyles as Gt}from"@mantine/core";import{jsx as Qt}from"react/jsx-runtime";var Xt=Gt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function me(){let{classes:o}=Xt();return Qt("div",{className:o.root})}a();import{Box as Zt,Text as Kt,UnstyledButton as $t,createStyles as Yt,px as _t}from"@mantine/core";import{jsx as mr,jsxs as Jt}from"react/jsx-runtime";var jt=Yt((o,{color:e})=>{let r=_t(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,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 xe({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=jt({color:r});return Jt($t,{className:l.root,disabled:t,onClick:f,children:[o&&mr(Zt,{className:l.icon,children:o}),mr(Kt,{className:l.title,size:"sm",children:e})]})}a();import{Box as xr,createStyles as of,ScrollArea as ef}from"@mantine/core";import{jsx as yo,jsxs as af}from"react/jsx-runtime";var rf=of(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,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,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 Ie({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:l,onScrollPositionChange:n,children:s,viewportRef:p}){let x=l?l-1:0,{cx:c,classes:u}=rf();return af(ef,{viewportRef:p,classNames:{root:u.root,scrollbar:u.scrollbar,thumb:u.thumb,corner:u.corner},styles:{scrollbar:{marginTop:f,marginBottom:x}},onScrollPositionChange:n,children:[s,yo(xr,{className:c(u.shadow,u.topShadow,{[u.shadowVisible]:o}),sx:{top:f}}),yo("div",{className:c(u.shadow,u.leftShadow,{[u.shadowVisible]:e})}),yo("div",{className:c(u.shadow,u.rightShadow,{[u.shadowVisible]:r})}),yo(xr,{className:c(u.shadow,u.bottomShadow,{[u.shadowVisible]:t}),sx:{bottom:x}})]})}import{jsx as O,jsxs as ir}from"react/jsx-runtime";var Ir={},sf=ff((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r;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 gr({withBorder:o,borderRadius:e,borderColor:r=B=>B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],rowBorderColor:t=B=>B.fn.rgba(B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:l,height:n="100%",minHeight:s,shadow:p,verticalAlignment:x="center",fetching:c,columns:u,defaultColumnRender:I,idAccessor:m="id",records:S,selectedRecords:g,onSelectedRecordsChange:h,isRecordSelectable:C,allRecordsSelectionCheckboxProps:k={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:R=(B,z)=>({"aria-label":`Select record ${z+1}`}),sortStatus:v,sortIcons:w,onSortStatusChange:F,horizontalSpacing:T,page:A,onPageChange:L,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:To,recordsPerPageOptions:Po,recordsPerPageLabel:Ro="Records per page",paginationColor:_,paginationSize:j="sm",paginationText:ko=({from:B,to:z,totalRecords:U})=>`${B} - ${z} / ${U}`,paginationWrapBreakpoint:Fo="sm",getPaginationControlProps:lo=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Mo,customLoader:Cr,loaderSize:Sr,loaderVariant:hr,loaderColor:br,loadingText:Br="...",emptyState:Dr,noRecordsText:ge="No records",noRecordsIcon:yr,striped:wr,noHeader:Tr,onRowClick:Oo,onCellClick:Pr,onScrollToTop:Ce,onScrollToBottom:Se,onScrollToLeft:he,onScrollToRight:be,rowContextMenu:H,rowExpansion:Rr,rowClassName:kr,rowStyle:Fr,rowSx:Mr,customRowAttributes:Or,scrollViewportRef:vr,bodyRef:Ar,m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr,sx:Ur,className:Vr,classNames:so,style:Gr,styles:vo,...Xr}){let{ref:B,width:z,height:U}=no(),{ref:Qr,height:Ao}=no(),{ref:Zr,width:Lo,height:J}=no(),{ref:Kr,height:$r}=no(),{ref:Yr,height:Be}=no(),[Ho,De]=wo(!0),[Eo,ye]=wo(!0),[co,we]=wo(!0),[No,Te]=wo(!0),{rowContextMenuInfo:V,setRowContextMenuInfo:Q}=lr(c),_r=dr({rowExpansion:Rr,records:S,idAccessor:m}),qo=ie(()=>{if(!c&&H&&Q(null),c||J<=U)De(!0),ye(!0);else{let i=B.current.scrollTop,b=i===0,P=J-i-U<1;De(b),ye(P),b&&b!==Ho&&Ce?.(),P&&P!==Eo&&Se?.()}if(c||Lo===z)we(!0),Te(!0);else{let i=B.current.scrollLeft,b=i===0,P=Lo-i-z<1;we(b),Te(P),b&&b!==co&&he?.(),P&&P!==No&&be?.()}},[c,Se,he,be,Ce,H,U,B,z,Eo,co,No,Ho,Q,J,Lo]);Ze(qo,[qo]);let jr=ie(i=>{B.current.scrollTo({top:0,left:0}),L(i)},[L,B]),uo=S?.length,Pe=S?.map(i=>D(i,m)),po=!!g,oo=g?.map(i=>D(i,m)),Re=Pe!==void 0&&oo!==void 0&&oo.length>0,Wo=C?S?.filter(C):S,mo=Wo?.map(i=>D(i,m)),xo=Re&&mo.every(i=>oo.includes(i)),Jr=Re&&mo.some(i=>oo.includes(i)),oa=ie(()=>{h?.(xo?g.filter(i=>!mo.includes(D(i,m))):to([...g,...Wo],i=>D(i,m)))},[xo,m,h,mo,Wo,g]),{lastSelectionChangeIndex:Io,setLastSelectionChangeIndex:ea}=nr(Pe),zo=po&&!co,{cx:ke,classes:E,theme:ra}=sf({borderColor:r,rowBorderColor:t}),aa={m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr},io=typeof vo=="function"?vo(ra,Ir,Ir):vo;return ir(tf,{...aa,className:ke(E.root,{[E.tableWithBorder]:o},Vr,so?.root),sx:[i=>({borderRadius:i.radius[e]||e,boxShadow:i.shadows[p]||p,height:n,minHeight:s}),...nf(Ur)],style:{...io?.root,...Gr},children:[O(Ie,{viewportRef:df(B,vr||null),topShadowVisible:!Ho,leftShadowVisible:!(g||co),rightShadowVisible:!No,bottomShadowVisible:!Eo,headerHeight:Ao,footerHeight:$r,onScrollPositionChange:qo,children:ir(lf,{ref:Zr,horizontalSpacing:T,className:ke(E.table,{[E.tableWithColumnBorders]:f,[E.lastRowBorderBottomVisible]:J<U,[E.textSelectionDisabled]:l,[E.verticalAlignmentTop]:x==="top",[E.verticalAlignmentBottom]:x==="bottom"}),striped:uo?wr:!1,...Xr,children:[Tr?null:O(Je,{ref:Qr,className:so?.header,style:io?.header,columns:u,sortStatus:v,sortIcons:w,onSortStatusChange:F,selectionVisible:po,selectionChecked:xo,selectionIndeterminate:Jr&&!xo,onSelectionChange:oa,selectionCheckboxProps:k,leftShadowVisible:zo}),O("tbody",{ref:Ar,children:uo?S.map((i,b)=>{let P=D(i,m),eo=oo?.includes(P)||!1,go=!1,Co=!1;if(H){let{hidden:y}=H;(!y||!(typeof y=="function"?y(i,b):y))&&(H.trigger==="click"?go=!0:Co=!0)}let So;h&&(So=y=>{if(y.nativeEvent.shiftKey&&Io!==null){let Z=S.filter(b>Io?(G,X)=>X>=Io&&X<=b&&(C?C(G,X):!0):(G,X)=>X>=b&&X<=Io&&(C?C(G,X):!0));h(eo?$o(g,Z,G=>D(G,m)):to([...g,...Z],G=>D(G,m)))}else h(eo?g.filter(Z=>D(Z,m)!==P):to([...g,i],Z=>D(Z,m)));ea(b)});let ro;go?ro=y=>{Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b}),Oo?.(i,b,y)}:Oo&&(ro=y=>{Oo(i,b,y)});let Fe;return Co&&(Fe=y=>{y.preventDefault(),Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b})}),O(ue,{record:i,recordIndex:b,columns:u,defaultColumnRender:I,selectionVisible:po,selectionChecked:eo,onSelectionChange:So,isRecordSelectable:C,getSelectionCheckboxProps:R,onClick:ro,onCellClick:Pr,onContextMenu:Fe,contextMenuVisible:V?D(V.record,m)===P:!1,expansion:_r,className:kr,style:Fr,sx:Mr,customRowAttributes:Or,leftShadowVisible:zo},P)}):O(Vo,{})}),u.some(i=>i.footer)&&O(Ke,{ref:Kr,className:so?.footer,style:io?.footer,borderColor:r,columns:u,selectionVisible:po,leftShadowVisible:zo,scrollDiff:J-U})]})}),A&&O(tr,{ref:Yr,className:so?.pagination,style:io?.pagination,topBorderColor:r,horizontalSpacing:T,fetching:c,page:A,onPageChange:jr,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:To,recordsPerPageOptions:Po,recordsPerPageLabel:Ro,paginationColor:_,paginationSize:j,paginationText:ko,paginationWrapBreakpoint:Fo,getPaginationControlProps:lo,noRecordsText:ge,loadingText:Br,recordsLength:uo}),O(ae,{pt:Ao,pb:Be,fetching:c,backgroundBlur:Mo,customContent:Cr,size:Sr,variant:hr,color:br}),O(Ko,{pt:Ao,pb:Be,icon:yr,text:ge,active:!c&&!uo,children:Dr}),H&&V&&O(pe,{zIndex:H.zIndex,borderRadius:H.borderRadius,shadow:H.shadow,y:V.y,x:V.x,onDestroy:()=>Q(null),children:H.items(V.record,V.recordIndex).map(({divider:i,key:b,title:P,icon:eo,color:go,hidden:Co,disabled:So,onClick:ro})=>i?O(me,{},b):Co?null:O(xe,{title:P??ao(b),icon:eo,color:go,disabled:So,onClick:()=>{Q(null),ro()}},b))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{gr as DataTable,$o as differenceBy,D as getValueAtPath,ao as humanize,to as uniqBy};
1
+ var fa=Object.create;var Oe=Object.defineProperty;var na=Object.getOwnPropertyDescriptor;var la=Object.getOwnPropertyNames;var da=Object.getPrototypeOf,sa=Object.prototype.hasOwnProperty;var ca=(o,e)=>()=>(o&&(e=o(o=0)),e);var Vo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var ua=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of la(e))!sa.call(o,f)&&f!==r&&Oe(o,f,{get:()=>e[f],enumerable:!(t=na(e,f))||t.enumerable});return o};var pa=(o,e,r)=>(r=o!=null?fa(da(o)):{},ua(e||!o||!o.__esModule?Oe(r,"default",{value:o,enumerable:!0}):r,o));import*as d from"react";var a=ca(()=>{"use strict"});var Le=Vo((Cf,Ae)=>{"use strict";a();var Ia="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ae.exports=Ia});var qe=Vo((hf,Ne)=>{"use strict";a();var ia=Le();function He(){}function Ee(){}Ee.resetWarningCache=He;Ne.exports=function(){function o(t,f,l,n,s,p){if(p!==ia){var x=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 x.name="Invariant Violation",x}}o.isRequired=o;function e(){return o}var r={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:Ee,resetWarningCache:He};return r.PropTypes=r,r}});var ze=Vo((yf,We)=>{a();We.exports=qe()();var Bf,Df});a();a();import{Box as ff,createStyles as nf,packSx as lf,Table as df}from"@mantine/core";import{useElementSize as no,useMergedRef as sf}from"@mantine/hooks";import{useCallback as ge,useState as wo}from"react";a();import{createStyles as ma}from"@mantine/core";import{jsx as ve}from"react/jsx-runtime";var xa=ma({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Go(){let{classes:o}=xa();return ve("tr",{className:o.root,children:ve("td",{})})}a();import{Center as Da,createStyles as ya,Text as Ta}from"@mantine/core";a();a();var N=pa(ze());import{forwardRef as ga,createElement as Ve}from"react";a();var Ue={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 Ca=Object.defineProperty,Sa=Object.defineProperties,ha=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,Ge=(o,e,r)=>e in o?Ca(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Xe=(o,e)=>{for(var r in e||(e={}))Qe.call(e,r)&&Ge(o,r,e[r]);if(ho)for(var r of ho(e))Ze.call(e,r)&&Ge(o,r,e[r]);return o},ba=(o,e)=>Sa(o,ha(e)),Ba=(o,e)=>{var r={};for(var t in o)Qe.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&ho)for(var t of ho(o))e.indexOf(t)<0&&Ze.call(o,t)&&(r[t]=o[t]);return r},q=(o,e,r)=>{let t=ga((f,l)=>{var n=f,{color:s="currentColor",size:p=24,stroke:x=2,children:c}=n,u=Ba(n,["color","size","stroke","children"]);return Ve("svg",Xe(ba(Xe({ref:l},Ue),{width:p,height:p,stroke:s,strokeWidth:x,className:`tabler-icon tabler-icon-${o}`}),u),[...r.map(([I,m])=>Ve(I,m)),...c||[]])});return t.propTypes={color:N.default.string,size:N.default.oneOfType([N.default.string,N.default.number]),stroke:N.default.oneOfType([N.default.string,N.default.number])},t.displayName=`${e}`,t};a();var Xo=q("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"}]]);a();var Qo=q("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"}]]);a();var Zo=q("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"}]]);a();var Ko=q("filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);import{Fragment as Pa,jsx as bo,jsxs as Ra}from"react/jsx-runtime";var wa=ya(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 $o({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:n,cx:s}=wa();return bo(Da,{pt:r,pb:t,className:s(n.root,{[n.active]:f}),children:l||Ra(Pa,{children:[o||bo("div",{className:n.standardIcon,children:bo(Zo,{})}),bo(Ta,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as za,createStyles as Ua}from"@mantine/core";import{forwardRef as Va}from"react";a();import{Box as va,createStyles as Aa}from"@mantine/core";a();import{useMantineTheme as ka}from"@mantine/core";import{useMediaQuery as Fa}from"@mantine/hooks";import{useEffect as Ma,useLayoutEffect as Oa}from"react";var Ke=typeof window<"u"?Oa:Ma;function K(o){let e=ka(),r=typeof o=="function"?o(e):o;return Fa(r||"",!0)}function ao(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 Yo(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function to(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function Bo(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}function D(o,e){return typeof e=="string"?Bo(o,e):e(o)}import{jsx as Ha}from"react/jsx-runtime";var La=Aa({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function _o({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:l,ellipsis:n,textAlignment:s,width:p}){let{cx:x,classes:c}=La();return K(t)?Ha(va,{component:"th",className:x({[c.noWrap]:l||n,[c.ellipsis]:n},o),sx:[{"&&":{textAlign:s},width:p,minWidth:p,maxWidth:p},e],style:r,children:f}):null}a();import{createStyles as Ea,px as Na}from"@mantine/core";import{jsx as Wa}from"react/jsx-runtime";var qa=Ea(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:-Na(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}}}});function jo({shadowVisible:o}){let{cx:e,classes:r}=qa();return Wa("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as Jo,jsxs as Xa}from"react/jsx-runtime";var Ga=Ua((o,{scrollDiff:e,borderColor:r})=>{let t=e<0,f=typeof r=="function"?r(o):r;return{root:{zIndex:2,position:t?"relative":"sticky",bottom:t?e:-1,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,"&& tr th":{borderTopColor:f}},relative:{position:"relative"},textSelectionDisabled:{userSelect:"none"}}}),$e=Va(function({className:e,style:r,borderColor:t,columns:f,selectionVisible:l,leftShadowVisible:n,scrollDiff:s},p){let{cx:x,classes:c}=Ga({scrollDiff:s,borderColor:t});return Jo(za,{component:"tfoot",ref:p,className:x(c.root,e),style:r,children:Xa("tr",{children:[l&&Jo(jo,{shadowVisible:n}),f.map(({accessor:u,hidden:I,visibleMediaQuery:m,textAlignment:S,width:g,footer:h,footerClassName:C,footerStyle:k,footerSx:R,noWrap:v,ellipsis:T})=>I?null:Jo(_o,{className:C,style:k,sx:R,visibleMediaQuery:m,textAlignment:S,width:g,title:h,noWrap:v,ellipsis:T},u))]})})});a();import{createStyles as at}from"@mantine/core";import{forwardRef as tt}from"react";a();import{ActionIcon as Qa,Box as Ye,Center as _e,Group as Za,Popover as oe,createStyles as Ka}from"@mantine/core";import{useDisclosure as $a}from"@mantine/hooks";import{Fragment as ja,jsx as M,jsxs as je}from"react/jsx-runtime";var Ya=Ka(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover:not(:has(button: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 _a({children:o,isActive:e}){let[r,{close:t,toggle:f}]=$a(!1);return je(oe,{withArrow:!0,withinPortal:!0,shadow:"md",opened:r,onClose:t,trapFocus:!0,children:[M(oe.Target,{children:M(Qa,{onClick:l=>{l.preventDefault(),f()},variant:e?"default":"subtle",children:M(Ko,{size:14})})}),M(oe.Dropdown,{children:typeof o=="function"?o({close:t}):o})]})}function ee({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:n,sortIcons:s,textAlignment:p,width:x,sortStatus:c,onSortStatusChange:u,filter:I,filtering:m}){let{cx:S,classes:g}=Ya();if(!K(f))return null;let h=l??ao(t),C=typeof h=="string"?h:void 0,k=n&&u?R=>{R?.defaultPrevented||u({columnAccessor:t,direction:c?.columnAccessor===t?c.direction==="asc"?"desc":"asc":c?.direction??"asc"})}:void 0;return M(Ye,{component:"th",className:S({[g.sortableColumnHeader]:n},o),sx:[{"&&":{textAlign:p},width:x,minWidth:x,maxWidth:x},e],style:r,role:n?"button":void 0,tabIndex:n?0:void 0,onClick:k,onKeyDown:R=>R.key==="Enter"&&k?.(),children:je(Za,{className:g.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[M(Ye,{className:S(g.columnHeaderText,g.sortableColumnHeaderText),title:C,children:h}),n||c?.columnAccessor===t?M(ja,{children:c?.columnAccessor===t?M(_e,{className:S(g.sortableColumnHeaderIcon,{[g.sortableColumnHeaderIconRotated]:c.direction==="desc"}),role:"img","aria-label":`Sorted ${c.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||M(Xo,{size:14})}):M(_e,{className:g.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:s?.unsorted||M(Qo,{size:14})})}):null,I?M(_a,{isActive:!!m,children:I}):null]})})}a();import{Checkbox as Ja,createStyles as ot,px as et}from"@mantine/core";import{jsx as Je}from"react/jsx-runtime";var rt=ot(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:-et(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 re({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f}){let{cx:l,classes:n}=rt();return Je("th",{className:l(n.root,{[n.shadowVisible]:o}),children:Je(Ja,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as ae,jsxs as nt}from"react/jsx-runtime";var ft=at(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),or=tt(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:l,columns:n,selectionVisible:s,selectionChecked:p,selectionIndeterminate:x,onSelectionChange:c,selectionCheckboxProps:u,leftShadowVisible:I},m){let{classes:S,cx:g}=ft();return ae("thead",{className:g(S.root,e),style:r,ref:m,children:nt("tr",{children:[s&&ae(re,{shadowVisible:I,checked:p,indeterminate:x,checkboxProps:u,onChange:c}),n.map(({accessor:h,hidden:C,visibleMediaQuery:k,textAlignment:R,width:v,title:T,sortable:F,titleClassName:w,titleStyle:A,titleSx:L,filter:W,filtering:Y})=>C?null:ae(ee,{className:w,style:A,sx:L,accessor:h,visibleMediaQuery:k,textAlignment:R,width:v,title:T,sortable:F,sortStatus:t,sortIcons:f,onSortStatusChange:l,filter:W,filtering:Y},h))]})})});a();import{Center as lt,createStyles as dt,Loader as st}from"@mantine/core";import{jsx as er}from"react/jsx-runtime";var ct=dt(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 te({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:n,color:s}){let{classes:p,cx:x}=ct();return er(lt,{pt:o,pb:e,className:x(p.root,{[p.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||er(st,{size:l,variant:n,color:s}))})}a();import{Box as mt,Pagination as xt,Text as It,createStyles as it}from"@mantine/core";import{forwardRef as gt}from"react";a();import{Button as ut,Group as pt,Menu as Do,Text as rr}from"@mantine/core";import{jsx as $,jsxs as tr}from"react/jsx-runtime";var ar={xs:22,sm:26,md:32,lg:38,xl:44};function fe({size:o,label:e,values:r,value:t,onChange:f,color:l}){return tr(pt,{spacing:"xs",children:[$(rr,{size:o,children:e}),tr(Do,{withinPortal:!0,withArrow:!0,children:[$(Do.Target,{children:$(ut,{size:o,variant:"default",sx:[{fontWeight:"normal"},n=>({height:ar[o],paddingLeft:n.spacing[o],paddingRight:n.spacing[o]})],children:t})}),$(Do.Dropdown,{children:r.map(n=>{let s=n===t;return $(Do.Item,{sx:[{height:ar[o]},p=>({"&&":{color:s?p.white:void 0},background:s?p.colors[l||p.primaryColor][6]:void 0})],disabled:s,onClick:()=>f(n),children:$(rr,{size:o,children:n})},n)})})]})]})}import{jsx as ne,jsxs as St}from"react/jsx-runtime";var Ct=it((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({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(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),fr=gt(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:n,paginationColor:s,paginationSize:p,loadingText:x,noRecordsText:c,paginationText:u,totalRecords:I,recordsPerPage:m,onRecordsPerPageChange:S,recordsPerPageLabel:g,recordsPerPageOptions:h,recordsLength:C,horizontalSpacing:k,paginationWrapBreakpoint:R,getPaginationControlProps:v},T){let F;if(f)F=x;else if(!I)F=c;else{let L=(l-1)*m+1,W=L+C-1;F=u({from:L,to:W,totalRecords:I})}let{classes:w,cx:A}=Ct({topBorderColor:t,paginationWrapBreakpoint:R});return St(mt,{ref:T,px:k??"xs",py:"xs",className:A(w.root,e),style:r,children:[ne(It,{className:w.text,size:p,children:F}),h&&ne(fe,{size:p,label:g,values:h,color:s,value:m,onChange:S}),ne(xt,{color:s,className:A(w.pagination,{[w.paginationFetching]:f||!C}),value:l,onChange:n,size:p,total:Math.ceil(I/m),getControlProps:v})]})});a();import{Box as vt,createStyles as At}from"@mantine/core";a();import{Box as ht,createStyles as bt}from"@mantine/core";import{jsx as Dt}from"react/jsx-runtime";var Bt=bt({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function le({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:n,noWrap:s,ellipsis:p,textAlignment:x,width:c,accessor:u,render:I,defaultRender:m,customCellAttributes:S}){let{cx:g,classes:h}=Bt();return K(t)?Dt(ht,{component:"td",className:g({[h.noWrap]:s||p,[h.ellipsis]:p,[h.withPointerCursor]:n},o),sx:[{width:c,minWidth:c,maxWidth:c,textAlign:x},e],style:r,onClick:n,...S?.(f,l),children:I?I(f,l):m?m(f,l,u):Bo(f,u)}):null}a();import{Collapse as yt,createStyles as Tt}from"@mantine/core";a();import{useTimeout as nr}from"@mantine/hooks";import{useEffect as de,useState as fo}from"react";function lr(o){let[e,r]=fo(null),t=o?.join(":")||"";return de(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function dr(o){let[e,r]=fo(null);return de(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function sr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:s,allowMultiple:p,initiallyExpanded:x}=o;e&&s==="always"?t=e.map(c=>D(c,r)):x&&(t=e.filter(x).map(c=>D(c,r)),p||(t=[t[0]]))}let f,l,n=fo(t);if(o){let{trigger:s,allowMultiple:p,collapseProps:x,content:c}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=n;let u=I=>l?.(f.filter(m=>m!==D(I,r)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:I=>s==="always"?!0:f.includes(D(I,r)),expandRow:I=>{let m=D(I,r);l?.(p?[...f,m]:[m])},collapseRow:u,collapseProps:x,content:(I,m)=>()=>c({record:I,recordIndex:m,collapse:()=>u(I)})}}}function cr(o,e){let[r,t]=fo(o),[f,l]=fo(o),n=nr(()=>t(!0),0),s=nr(()=>l(!1),e||200);return de(()=>{o?(s.clear(),l(!0),n.start()):(n.clear(),t(!1),s.start())},[n,s,o]),{expanded:r,visible:f}}import{Fragment as Pt,jsx as yo,jsxs as Rt}from"react/jsx-runtime";var wt=Tt({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function se({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=cr(o,t?.transitionDuration),{cx:n,classes:s}=wt();return l?Rt(Pt,{children:[yo("tr",{}),yo("tr",{children:yo("td",{className:n(s.cell,{[s.expandedCell]:f}),colSpan:e,children:yo(yt,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as kt,createStyles as Ft,px as Mt}from"@mantine/core";import{jsx as ur}from"react/jsx-runtime";var Ot=Ft(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:-Mt(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 ce({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:l,classes:n}=Ot();return ur("td",{className:l(n.root,{[n.withRightShadow]:r}),onClick:s=>s.stopPropagation(),children:ur(kt,{classNames:{input:n.checkbox},...f,...t(o,e)})})}import{Fragment as Ht,jsx as ue,jsxs as pr}from"react/jsx-runtime";var Lt=At(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 pe({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:l,onSelectionChange:n,isRecordSelectable:s,getSelectionCheckboxProps:p,onClick:x,onCellClick:c,onContextMenu:u,expansion:I,customRowAttributes:m,className:S,style:g,sx:h,contextMenuVisible:C,leftShadowVisible:k}){let{cx:R,classes:v}=Lt();return pr(Ht,{children:[pr(vt,{component:"tr",className:R({[v.withPointerCursor]:x||I?.expandOnClick,[v.selected]:l,[v.contextMenuVisible]:C},typeof S=="function"?S(o,e):S),onClick:T=>{if(I){let{isRowExpanded:F,expandOnClick:w,expandRow:A,collapseRow:L}=I;w&&(F(o)?L(o):A(o))}x?.(T)},style:typeof g=="function"?g(o,e):g,sx:h,...m?.(o,e),onContextMenu:u,children:[f&&ue(ce,{record:o,recordIndex:e,withRightShadow:k,checked:l,disabled:!n||(s?!s(o,e):!1),onChange:n,getCheckboxProps:p}),r.map((T,F)=>{let{accessor:w,hidden:A,visibleMediaQuery:L,textAlignment:W,noWrap:Y,ellipsis:Po,width:Ro,render:ko,cellsClassName:_,cellsStyle:j,cellsSx:Fo,customCellAttributes:Mo}=T,lo;return c&&(lo=Oo=>c({event:Oo,record:o,recordIndex:e,column:T,columnIndex:F})),A?null:ue(le,{className:typeof _=="function"?_(o,e):_,style:typeof j=="function"?j(o,e):j,sx:Fo,visibleMediaQuery:L,record:o,recordIndex:e,onClick:lo,accessor:w,textAlignment:W,noWrap:Y,ellipsis:Po,width:Ro,render:ko,defaultRender:t,customCellAttributes:Mo},w)})]}),I&&ue(se,{colSpan:r.filter(T=>!T.hidden).length+(f?1:0),open:I.isRowExpanded(o),content:I.content(o,e),collapseProps:I.collapseProps})]})}a();import{createStyles as Et,Paper as Nt,px as qt}from"@mantine/core";import{useClickOutside as Wt,useElementSize as zt,useMergedRef as Ut,useWindowEvent as mr}from"@mantine/hooks";import{jsx as Gt}from"react/jsx-runtime";var Vt=Et(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 me({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:l,children:n}){mr("resize",l),mr("scroll",l);let s=Wt(l),{ref:p,width:x,height:c}=zt(),u=Ut(s,p),{innerWidth:I,innerHeight:m}=window,{classes:S,theme:{dir:g,spacing:h}}=Vt(),C=qt(h.md);return Gt(Nt,{ref:u,shadow:e,radius:o,className:S.root,sx:{zIndex:r,top:t+c+C>m?m-c-C:t,left:g==="ltr"?f+x+C>I?I-x-C:f:I-C-(f-x-C<0?x+C:f)},children:n})}a();import{createStyles as Xt}from"@mantine/core";import{jsx as Zt}from"react/jsx-runtime";var Qt=Xt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function xe(){let{classes:o}=Qt();return Zt("div",{className:o.root})}a();import{Box as Kt,Text as $t,UnstyledButton as Yt,createStyles as _t,px as jt}from"@mantine/core";import{jsx as xr,jsxs as of}from"react/jsx-runtime";var Jt=_t((o,{color:e})=>{let r=jt(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,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 Ie({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=Jt({color:r});return of(Yt,{className:l.root,disabled:t,onClick:f,children:[o&&xr(Kt,{className:l.icon,children:o}),xr($t,{className:l.title,size:"sm",children:e})]})}a();import{Box as Ir,createStyles as ef,ScrollArea as rf}from"@mantine/core";import{jsx as To,jsxs as tf}from"react/jsx-runtime";var af=ef(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,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,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 ie({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:l,onScrollPositionChange:n,children:s,viewportRef:p}){let x=l?l-1:0,{cx:c,classes:u}=af();return tf(rf,{viewportRef:p,classNames:{root:u.root,scrollbar:u.scrollbar,thumb:u.thumb,corner:u.corner},styles:{scrollbar:{marginTop:f,marginBottom:x}},onScrollPositionChange:n,children:[s,To(Ir,{className:c(u.shadow,u.topShadow,{[u.shadowVisible]:o}),sx:{top:f}}),To("div",{className:c(u.shadow,u.leftShadow,{[u.shadowVisible]:e})}),To("div",{className:c(u.shadow,u.rightShadow,{[u.shadowVisible]:r})}),To(Ir,{className:c(u.shadow,u.bottomShadow,{[u.shadowVisible]:t}),sx:{bottom:x}})]})}import{jsx as O,jsxs as gr}from"react/jsx-runtime";var ir={},cf=nf((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r;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 Cr({withBorder:o,borderRadius:e,borderColor:r=B=>B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],rowBorderColor:t=B=>B.fn.rgba(B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:l,height:n="100%",minHeight:s,shadow:p,verticalAlignment:x="center",fetching:c,columns:u,defaultColumnRender:I,idAccessor:m="id",records:S,selectedRecords:g,onSelectedRecordsChange:h,isRecordSelectable:C,allRecordsSelectionCheckboxProps:k={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:R=(B,z)=>({"aria-label":`Select record ${z+1}`}),sortStatus:v,sortIcons:T,onSortStatusChange:F,horizontalSpacing:w,page:A,onPageChange:L,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:Po,recordsPerPageOptions:Ro,recordsPerPageLabel:ko="Records per page",paginationColor:_,paginationSize:j="sm",paginationText:Fo=({from:B,to:z,totalRecords:U})=>`${B} - ${z} / ${U}`,paginationWrapBreakpoint:Mo="sm",getPaginationControlProps:lo=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Oo,customLoader:Sr,loaderSize:hr,loaderVariant:br,loaderColor:Br,loadingText:Dr="...",emptyState:yr,noRecordsText:Ce="No records",noRecordsIcon:Tr,striped:wr,noHeader:Pr,onRowClick:vo,onCellClick:Rr,onScrollToTop:Se,onScrollToBottom:he,onScrollToLeft:be,onScrollToRight:Be,rowContextMenu:H,rowExpansion:kr,rowClassName:Fr,rowStyle:Mr,rowSx:Or,customRowAttributes:vr,scrollViewportRef:Ar,bodyRef:Lr,m:Hr,my:Er,mx:Nr,mt:qr,mb:Wr,ml:zr,mr:Ur,sx:Vr,className:Gr,classNames:so,style:Xr,styles:Ao,...Qr}){let{ref:B,width:z,height:U}=no(),{ref:Zr,height:Lo}=no(),{ref:Kr,width:Ho,height:J}=no(),{ref:$r,height:Yr}=no(),{ref:_r,height:De}=no(),[Eo,ye]=wo(!0),[No,Te]=wo(!0),[co,we]=wo(!0),[qo,Pe]=wo(!0),{rowContextMenuInfo:V,setRowContextMenuInfo:Q}=dr(c),jr=sr({rowExpansion:kr,records:S,idAccessor:m}),Wo=ge(()=>{if(!c&&H&&Q(null),c||J<=U)ye(!0),Te(!0);else{let i=B.current.scrollTop,b=i===0,P=J-i-U<1;ye(b),Te(P),b&&b!==Eo&&Se?.(),P&&P!==No&&he?.()}if(c||Ho===z)we(!0),Pe(!0);else{let i=B.current.scrollLeft,b=i===0,P=Ho-i-z<1;we(b),Pe(P),b&&b!==co&&be?.(),P&&P!==qo&&Be?.()}},[c,he,be,Be,Se,H,U,B,z,No,co,qo,Eo,Q,J,Ho]);Ke(Wo,[Wo]);let Jr=ge(i=>{B.current.scrollTo({top:0,left:0}),L(i)},[L,B]),uo=S?.length,Re=S?.map(i=>D(i,m)),po=!!g,oo=g?.map(i=>D(i,m)),ke=Re!==void 0&&oo!==void 0&&oo.length>0,zo=C?S?.filter(C):S,mo=zo?.map(i=>D(i,m)),xo=ke&&mo.every(i=>oo.includes(i)),oa=ke&&mo.some(i=>oo.includes(i)),ea=ge(()=>{h?.(xo?g.filter(i=>!mo.includes(D(i,m))):to([...g,...zo],i=>D(i,m)))},[xo,m,h,mo,zo,g]),{lastSelectionChangeIndex:Io,setLastSelectionChangeIndex:ra}=lr(Re),Uo=po&&!co,{cx:Fe,classes:E,theme:aa}=cf({borderColor:r,rowBorderColor:t}),ta={m:Hr,my:Er,mx:Nr,mt:qr,mb:Wr,ml:zr,mr:Ur},io=typeof Ao=="function"?Ao(aa,ir,ir):Ao;return gr(ff,{...ta,className:Fe(E.root,{[E.tableWithBorder]:o},Gr,so?.root),sx:[i=>({borderRadius:i.radius[e]||e,boxShadow:i.shadows[p]||p,height:n,minHeight:s}),...lf(Vr)],style:{...io?.root,...Xr},children:[O(ie,{viewportRef:sf(B,Ar||null),topShadowVisible:!Eo,leftShadowVisible:!(g||co),rightShadowVisible:!qo,bottomShadowVisible:!No,headerHeight:Lo,footerHeight:Yr,onScrollPositionChange:Wo,children:gr(df,{ref:Kr,horizontalSpacing:w,className:Fe(E.table,{[E.tableWithColumnBorders]:f,[E.lastRowBorderBottomVisible]:J<U,[E.textSelectionDisabled]:l,[E.verticalAlignmentTop]:x==="top",[E.verticalAlignmentBottom]:x==="bottom"}),striped:uo?wr:!1,...Qr,children:[Pr?null:O(or,{ref:Zr,className:so?.header,style:io?.header,columns:u,sortStatus:v,sortIcons:T,onSortStatusChange:F,selectionVisible:po,selectionChecked:xo,selectionIndeterminate:oa&&!xo,onSelectionChange:ea,selectionCheckboxProps:k,leftShadowVisible:Uo}),O("tbody",{ref:Lr,children:uo?S.map((i,b)=>{let P=D(i,m),eo=oo?.includes(P)||!1,go=!1,Co=!1;if(H){let{hidden:y}=H;(!y||!(typeof y=="function"?y(i,b):y))&&(H.trigger==="click"?go=!0:Co=!0)}let So;h&&(So=y=>{if(y.nativeEvent.shiftKey&&Io!==null){let Z=S.filter(b>Io?(G,X)=>X>=Io&&X<=b&&(C?C(G,X):!0):(G,X)=>X>=b&&X<=Io&&(C?C(G,X):!0));h(eo?Yo(g,Z,G=>D(G,m)):to([...g,...Z],G=>D(G,m)))}else h(eo?g.filter(Z=>D(Z,m)!==P):to([...g,i],Z=>D(Z,m)));ra(b)});let ro;go?ro=y=>{Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b}),vo?.(i,b,y)}:vo&&(ro=y=>{vo(i,b,y)});let Me;return Co&&(Me=y=>{y.preventDefault(),Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b})}),O(pe,{record:i,recordIndex:b,columns:u,defaultColumnRender:I,selectionVisible:po,selectionChecked:eo,onSelectionChange:So,isRecordSelectable:C,getSelectionCheckboxProps:R,onClick:ro,onCellClick:Rr,onContextMenu:Me,contextMenuVisible:V?D(V.record,m)===P:!1,expansion:jr,className:Fr,style:Mr,sx:Or,customRowAttributes:vr,leftShadowVisible:Uo},P)}):O(Go,{})}),u.some(i=>i.footer)&&O($e,{ref:$r,className:so?.footer,style:io?.footer,borderColor:r,columns:u,selectionVisible:po,leftShadowVisible:Uo,scrollDiff:J-U})]})}),A&&O(fr,{ref:_r,className:so?.pagination,style:io?.pagination,topBorderColor:r,horizontalSpacing:w,fetching:c,page:A,onPageChange:Jr,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:Po,recordsPerPageOptions:Ro,recordsPerPageLabel:ko,paginationColor:_,paginationSize:j,paginationText:Fo,paginationWrapBreakpoint:Mo,getPaginationControlProps:lo,noRecordsText:Ce,loadingText:Dr,recordsLength:uo}),O(te,{pt:Lo,pb:De,fetching:c,backgroundBlur:Oo,customContent:Sr,size:hr,variant:br,color:Br}),O($o,{pt:Lo,pb:De,icon:Tr,text:Ce,active:!c&&!uo,children:yr}),H&&V&&O(me,{zIndex:H.zIndex,borderRadius:H.borderRadius,shadow:H.shadow,y:V.y,x:V.x,onDestroy:()=>Q(null),children:H.items(V.record,V.recordIndex).map(({divider:i,key:b,title:P,icon:eo,color:go,hidden:Co,disabled:So,onClick:ro})=>i?O(xe,{},b):Co?null:O(Ie,{title:P??ao(b),icon:eo,color:go,disabled:So,onClick:()=>{Q(null),ro()}},b))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{Cr as DataTable,Yo as differenceBy,Bo as getValueAtPath,ao as humanize,to as uniqBy};
2
2
  //# sourceMappingURL=index.mjs.map