mantine-datatable
Advanced tools
Comparing version 7.4.2 to 7.4.3
@@ -571,2 +571,3 @@ import * as react from 'react'; | ||
isRecordSelectable?: never; | ||
selectionCheckboxProps?: never; | ||
getRecordSelectionCheckboxProps?: never; | ||
@@ -606,3 +607,7 @@ allRecordsSelectionCheckboxProps?: never; | ||
/** | ||
* A function used to determine additional props of the row selection checkbox. | ||
* Props for the selection checkboxes, applied to header and all rows. | ||
*/ | ||
selectionCheckboxProps?: CheckboxProps; | ||
/** | ||
* A function used to determine additional props of the row selection checkboxes. | ||
* Accepts the current record and its index as arguments and returns an object. | ||
@@ -836,3 +841,3 @@ */ | ||
declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, storeColumnsKey, groups, pinFirstColumn, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectionTrigger, selectedRecords, onSelectedRecordsChange, selectionColumnClassName, selectionColumnStyle, isRecordSelectable, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowDoubleClick, onRowContextMenu, onCellClick, onCellDoubleClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, tableRef, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element; | ||
declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, storeColumnsKey, groups, pinFirstColumn, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectionTrigger, selectedRecords, onSelectedRecordsChange, selectionColumnClassName, selectionColumnStyle, isRecordSelectable, selectionCheckboxProps, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowDoubleClick, onRowContextMenu, onCellClick, onCellDoubleClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, tableRef, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element; | ||
@@ -839,0 +844,0 @@ type DataTableColumnToggle = { |
@@ -1,2 +0,2 @@ | ||
"use strict";"use client";var xn=Object.create;var et=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Rn=Object.getOwnPropertyNames;var kn=Object.getPrototypeOf,En=Object.prototype.hasOwnProperty;var Nn=(e,t)=>{for(var a in t)et(e,a,{get:t[a],enumerable:!0})},Zt=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rn(t))!En.call(e,o)&&o!==a&&et(e,o,{get:()=>t[o],enumerable:!(n=Mn(t,o))||n.enumerable});return e};var O=(e,t,a)=>(a=e!=null?xn(kn(e)):{},Zt(t||!e||!e.__esModule?et(a,"default",{value:e,enumerable:!0}):a,e)),Ln=e=>Zt(et({},"__esModule",{value:!0}),e);var Wn={};Nn(Wn,{DataTable:()=>go,differenceBy:()=>xt,getRecordId:()=>k,getValueAtPath:()=>it,humanize:()=>xe,uniqBy:()=>Fe,useDataTableColumns:()=>nt,useDragToggleColumns:()=>In});module.exports=Ln(Wn);var ft=require("@mantine/core"),It=require("@mantine/hooks"),Ht=O(require("clsx")),V=require("react");var wt=require("react");var Yt=require("@mantine/core"),[qt,tt]=(0,Yt.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var jt=require("react/jsx-runtime"),St=e=>{let{children:t,columnsOrder:a,setColumnsOrder:n,columnsToggle:o,setColumnsToggle:l,resetColumnsOrder:i,resetColumnsToggle:r,setColumnWidth:d,resetColumnsWidth:s}=e,[c,u]=(0,wt.useState)(""),[m,f]=(0,wt.useState)("");return(0,jt.jsx)(qt,{value:{sourceColumn:c,setSourceColumn:u,targetColumn:m,setTargetColumn:f,columnsToggle:o,setColumnsToggle:l,swapColumns:()=>{if(!a||!n||!c||!m)return;let g=a.indexOf(c),p=a.indexOf(m);if(g!==-1&&p!==-1){let w=a.splice(g,1)[0];a.splice(p,0,w),n([...a])}},resetColumnsOrder:i,resetColumnsToggle:r,setColumnWidth:d,resetColumnsWidth:s},children:t})};var Pt=require("react/jsx-runtime");function ea(){return(0,Pt.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Pt.jsx)("td",{})})}var at=require("@mantine/core");var j=require("react/jsx-runtime");function ta(){return(0,j.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,j.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,j.jsx)("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"}),(0,j.jsx)("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"}),(0,j.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,j.jsx)("path",{d:"M3 3l18 18"})]})}var Z=require("react/jsx-runtime");function aa({icon:e,text:t,pt:a,pb:n,active:o,children:l}){return(0,Z.jsx)(at.Center,{pt:a,pb:n,className:"mantine-datatable-empty-state","data-active":o||void 0,children:l||(0,Z.jsxs)(Z.Fragment,{children:[e||(0,Z.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,Z.jsx)(ta,{})}),(0,Z.jsx)(at.Text,{size:"sm",c:"dimmed",children:t})]})})}var Ee=require("@mantine/core"),Sa=O(require("clsx")),Pa=require("react");var Ta=require("@mantine/core"),ga=O(require("clsx"));var ot=require("@mantine/hooks"),oa=require("react"),nt=({key:e,columns:t=[]})=>{let a=t&&t.map(p=>p.accessor)||[],n=t&&t.map(p=>({[p.accessor]:p.width??"initial"}))||[],o=t&&t.map(p=>({accessor:p.accessor,title:p.title,defaultToggle:p.defaultToggle||!0,toggleable:p.toggleable,toggled:p.defaultToggle===void 0?!0:p.defaultToggle})),[l,i]=(0,ot.useLocalStorage)({key:`${e}-columns-order`,defaultValue:a,getInitialValueInEffect:!0}),[r,d]=(0,ot.useLocalStorage)({key:`${e}-columns-toggle`,defaultValue:o,getInitialValueInEffect:!0}),[s,c]=(0,ot.useLocalStorage)({key:`${e}-columns-width`,defaultValue:n,getInitialValueInEffect:!0}),u=()=>i(a),m=()=>{d(o)},f=()=>c(n);return{effectiveColumns:(0,oa.useMemo)(()=>l?l.map(b=>t.find(h=>h.accessor===b)).map(b=>({...b,hidden:!r.find(h=>h.accessor===b?.accessor)?.toggled})).map(b=>({...b,width:s.find(h=>h[b?.accessor])?.[b?.accessor]})):t,[t,l,r,s]),setColumnsOrder:i,columnsOrder:l,resetColumnsOrder:u,columnsToggle:r,setColumnsToggle:d,resetColumnsToggle:m,columnsWidth:s,setColumnsWidth:c,setColumnWidth:(p,w)=>{let b=s.map(h=>h[p]?{[p]:w}:h);c(b)},resetColumnsWidth:f}},In=nt;var na=require("@mantine/hooks");function ge(){let[e]=(0,na.useResizeObserver)(),{width:t,height:a}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:a}}var rt=require("react"),ra=typeof window<"u"?rt.useLayoutEffect:rt.useEffect;var lt=require("react");function la(e){let[t,a]=(0,lt.useState)(null),n=e?.join(":")||"";return(0,lt.useEffect)(()=>{a(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:a}}var ve=require("react");function Hn(e,t){let a=()=>{t(e.map(o=>o.matches))},n=e.map(o=>{try{return o.addEventListener("change",a),()=>o.removeEventListener("change",a)}catch{return o.addListener(a),()=>o.removeListener(a)}});return()=>{n.forEach(o=>o())}}function On(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(a=>window.matchMedia(a).matches):e.map(()=>!1))}function ia(e,t,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[n,o]=(0,ve.useState)(a?t:On(e,t)),l=(0,ve.useRef)();return(0,ve.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(i=>window.matchMedia(i)),o(l.current.map(i=>i.matches)),Hn(l.current,i=>{o(i)})},[e]),n}var sa=require("@mantine/core"),vt=require("react");function da(e){let t=(0,sa.useMantineTheme)(),a=(0,vt.useMemo)(()=>e.map(o=>(typeof o=="function"?o(t):o)??""),[e,t]),n=(0,vt.useMemo)(()=>e.map(()=>!0),[e]);return ia(a,n)}var ca=require("@mantine/core"),ua=require("@mantine/hooks");function ee(e){let t=(0,ca.useMantineTheme)(),a=typeof e=="function"?e(t):e;return(0,ua.useMediaQuery)(a||"",!0)}var ma=require("react");function xe(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function xt(e,t,a){return e.filter(n=>!t.map(a).includes(a(n)))}function Fe(e,t){return e.filter((a,n,o)=>n===o.findIndex(l=>t(a)===t(l)))}function it(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,o)=>n&&n[o],e):void 0}function k(e,t){return typeof t=="string"?it(e,t):t(e)}function pa({rowExpansion:e,records:t,idAccessor:a}){let n=[];if(e&&t){let{trigger:r,allowMultiple:d,initiallyExpanded:s}=e;t&&r==="always"?n=t.map(c=>k(c,a)):s&&(n=t.filter((c,u)=>s({record:c,index:u})).map(c=>k(c,a)),d||(n=[n[0]]))}let o,l,i=(0,ma.useState)(n);if(e){let{trigger:r,allowMultiple:d,collapseProps:s,content:c}=e;e.expanded?{recordIds:o,onRecordIdsChange:l}=e.expanded:[o,l]=i;let u=m=>l?.(o.filter(f=>f!==k(m,a)));return{expandOnClick:r!=="always"&&r!=="never",isRowExpanded:m=>r==="always"?!0:o.includes(k(m,a)),expandRow:m=>{let f=k(m,a);l?.(d?[...o,f]:[f])},collapseRow:u,collapseProps:s,content:({record:m,index:f})=>()=>c({record:m,index:f,collapse:()=>u(m)})}}}var Mt=require("@mantine/hooks"),_e=require("react");function fa(e,t){let[a,n]=(0,_e.useState)(e),[o,l]=(0,_e.useState)(e),i=(0,Mt.useTimeout)(()=>n(!0),0),r=(0,Mt.useTimeout)(()=>l(!1),t||200);return(0,_e.useEffect)(()=>{e?(r.clear(),l(!0),i.start()):(i.clear(),n(!1),r.start())},[i,r,e]),{expanded:a,visible:o}}var Me="mantine-datatable-nowrap",Re="mantine-datatable-ellipsis",$="mantine-datatable-pointer-cursor",st="mantine-datatable-context-menu-cursor",ba="mantine-datatable-text-selection-disabled",te="mantine-datatable-text-align-left",ae="mantine-datatable-text-align-center",oe="mantine-datatable-text-align-right";var Ca=require("react/jsx-runtime");function ha({className:e,style:t,visibleMediaQuery:a,title:n,noWrap:o,ellipsis:l,textAlign:i,width:r}){return ee(a)?(0,Ca.jsx)(Ta.TableTh,{className:(0,ga.default)({[Me]:o||l,[Re]:l,[te]:i==="left",[ae]:i==="center",[oe]:i==="right"},e),style:[{width:r,minWidth:r,maxWidth:r},t],children:n}):null}var ya=require("@mantine/core"),wa=require("react/jsx-runtime");function Da({shadowVisible:e}){return(0,wa.jsx)(ya.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var ke=require("react/jsx-runtime"),va=(0,Pa.forwardRef)(function({className:t,style:a,columns:n,defaultColumnProps:o,selectionVisible:l,selectorCellShadowVisible:i,scrollDiff:r},d){let s=r<0;return(0,ke.jsx)(Ee.TableTfoot,{ref:d,className:(0,Sa.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,Ee.rem)(s?r:0)},a],children:(0,ke.jsxs)(Ee.TableTr,{children:[l&&(0,ke.jsx)(Da,{shadowVisible:i}),n.map(({hidden:c,...u})=>{if(c)return null;let{accessor:m,visibleMediaQuery:f,textAlign:S,width:g,footer:p,footerClassName:w,footerStyle:b,noWrap:h,ellipsis:R}={...o,...u};return(0,ke.jsx)(ha,{className:w,style:b,visibleMediaQuery:f,textAlign:S,width:g,title:p,noWrap:h,ellipsis:R},m)})]})})});var Ue=require("@mantine/core"),Qa=O(require("clsx")),Ua=require("react");var xa=require("@mantine/core"),Ma=O(require("clsx")),Rt=require("react");var ka=require("react/jsx-runtime");function Ra({group:{id:e,columns:t,title:a,textAlign:n,className:o,style:l}}){let i=(0,Rt.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),r=da(i),d=(0,Rt.useMemo)(()=>t.filter(({hidden:s},c)=>!s&&r?.[c]).length,[t,r]);return d>0?(0,ka.jsx)(xa.TableTh,{colSpan:d,className:(0,Ma.default)("mantine-datatable-column-group-header-cell",{[te]:n==="left",[ae]:n==="center",[oe]:n==="right"},o),style:l,children:a??xe(e)}):null}var D=require("@mantine/core"),Xe=O(require("clsx")),Qe=require("react");var ne=require("@mantine/core"),La=require("@mantine/hooks");var Be=require("react/jsx-runtime");function Ea(){return(0,Be.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Be.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Be.jsx)("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"})]})}var Ge=require("react/jsx-runtime");function Na(){return(0,Ge.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ge.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ge.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var he=require("react/jsx-runtime");function Ia({children:e,isActive:t}){let[a,{close:n,toggle:o}]=(0,La.useDisclosure)(!1);return(0,he.jsxs)(ne.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:a,onClose:n,trapFocus:!0,children:[(0,he.jsx)(ne.PopoverTarget,{children:(0,he.jsx)(ne.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:i=>{i.preventDefault(),o()},children:(0,he.jsx)(t?Na:Ea,{})})}),(0,he.jsx)(ne.PopoverDropdown,{onClick:i=>i.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var Ha=require("@mantine/core"),dt=require("react");var Wa=require("react/jsx-runtime"),Oa=e=>{let{accessor:t,columnRef:a}=e,n=(0,dt.useRef)(null),[o,l]=(0,dt.useState)(0),{setColumnWidth:i}=tt(),r=u=>{u.preventDefault(),u.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",s),document.body.style.cursor="col-resize"},d=u=>{if(!a.current)return;let m=u.clientX-a.current.getBoundingClientRect().right,S=`${a.current.getBoundingClientRect().width+m}px`;a.current.style.width=S,i(t,a.current.style.width),l(-m)},s=()=>{a.current&&(document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",s),document.body.style.cursor="initial",i(t,a.current.style.width),l(0))};return(0,Wa.jsx)("div",{ref:n,onClick:u=>u.stopPropagation(),onMouseDown:r,onDoubleClick:()=>{a.current&&(a.current.style.maxWidth="initial",a.current.style.minWidth="initial",a.current.style.width="initial",i(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,Ha.rem)(o)}})};var Ce=require("react/jsx-runtime");function Aa(){return(0,Ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ce.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ce.jsx)("path",{d:"M12 5l0 14"}),(0,Ce.jsx)("path",{d:"M16 9l-4 -4"}),(0,Ce.jsx)("path",{d:"M8 9l4 -4"})]})}var ye=require("react/jsx-runtime");function Va(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,ye.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,ye.jsx)("path",{d:"M12 3l0 18"})]})}var K=require("react/jsx-runtime");function za(){return(0,K.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,K.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,K.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Ne=require("react/jsx-runtime");function Fa(){return(0,Ne.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ne.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ne.jsx)("path",{d:"M18 6l-12 12"}),(0,Ne.jsx)("path",{d:"M6 6l12 12"})]})}var y=require("react/jsx-runtime");function _a({className:e,style:t,accessor:a,visibleMediaQuery:n,title:o,sortable:l,draggable:i,toggleable:r,resizable:d,sortIcons:s,textAlign:c,width:u,sortStatus:m,onSortStatusChange:f,filter:S,filtering:g}){let{setSourceColumn:p,setTargetColumn:w,swapColumns:b,columnsToggle:h,setColumnsToggle:R}=tt(),[E,M]=(0,Qe.useState)(!1),W=(0,Qe.useRef)(null),[Q,N]=(0,Qe.useState)(!1);if(!ee(n))return null;let P=o??xe(a),H=typeof P=="string"?P:void 0,L=l&&f?C=>{C?.defaultPrevented||f({columnAccessor:a,direction:m?.columnAccessor===a?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,z=C=>{C.stopPropagation(),p(a),M(!1)},U=C=>{C.preventDefault(),w(a),M(!0)},se=()=>{w(a),M(!1),b()},de=()=>{M(!0)},ce=()=>{M(!1)},ue=C=>{C.stopPropagation(),R(F=>F.map(_=>_.accessor===a?{..._,toggled:!1}:_))};return(0,y.jsxs)(D.TableTh,{className:(0,Xe.default)({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":r,"mantine-datatable-header-cell-resizable":d},e),style:[{width:u,...d?{minWidth:"1px"}:{minWidth:u,maxWidth:u}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:L,onContextMenu:C=>{r&&(C.preventDefault(),N(!0))},onKeyDown:C=>C.key==="Enter"&&L?.(),ref:W,children:[(0,y.jsxs)(D.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,y.jsxs)(D.Popover,{width:200,position:"bottom",withArrow:!0,shadow:"md",opened:Q,onChange:N,children:[(0,y.jsx)(D.PopoverTarget,{children:(0,y.jsxs)(D.Flex,{align:"center",w:"100%",className:(0,Xe.default)({"mantine-datatable-header-cell-draggable":i,"mantine-datatable-header-cell-drag-over":E}),draggable:i,onDragStart:i?z:void 0,onDragEnter:i?de:void 0,onDragOver:i?U:void 0,onDrop:i?se:void 0,onDragLeave:i?ce:void 0,children:[i?(0,y.jsx)(D.Center,{role:"img","aria-label":"Drag column",children:(0,y.jsx)(D.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:C=>{C.stopPropagation()},children:(0,y.jsx)(za,{})})}):null,(0,y.jsx)(D.Box,{className:(0,Xe.default)("mantine-datatable-header-cell-sortable-text",{[te]:c==="left",[ae]:c==="center",[oe]:c==="right"},Me,Re),title:H,children:P})]})}),(0,y.jsx)(D.PopoverDropdown,{children:(0,y.jsx)(D.Stack,{children:h.filter(C=>C.toggleable).map(C=>(0,y.jsx)(D.Group,{children:(0,y.jsx)(D.Checkbox,{size:"xs",label:C.title??xe(C.accessor),checked:C.toggled,onChange:F=>{R(h.map(_=>_.accessor===C.accessor?{..._,toggled:F.currentTarget.checked}:_))}})},C.accessor))})})]}),r?(0,y.jsx)(D.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,y.jsx)(D.ActionIcon,{size:"xs",variant:"light",onClick:ue,children:(0,y.jsx)(Fa,{})})}):null,l||m?.columnAccessor===a?(0,y.jsx)(y.Fragment,{children:m?.columnAccessor===a?(0,y.jsx)(D.Center,{className:(0,Xe.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":m.direction==="desc"}),role:"img","aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||(0,y.jsx)(Aa,{})}):(0,y.jsx)(D.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:s?.unsorted||(0,y.jsx)(Va,{})})}):null,S?(0,y.jsx)(Ia,{isActive:!!g,children:S}):null]}),d?(0,y.jsx)(Oa,{accessor:a,columnRef:W}):null]})}var ct=require("@mantine/core"),Ba=O(require("clsx")),Ga=require("react");var kt=require("react/jsx-runtime"),Xa=(0,Ga.forwardRef)(function({className:t,style:a,trigger:n,shadowVisible:o,checked:l,indeterminate:i,checkboxProps:r,onChange:d,rowSpan:s},c){let u=!r.disabled;return(0,kt.jsx)(ct.TableTh,{ref:c,className:(0,Ba.default)("mantine-datatable-header-selector-cell",{[$]:n==="cell"&&u},t),style:a,rowSpan:s,"data-shadow-visible":o||void 0,onClick:n==="cell"&&u?d:void 0,children:(0,kt.jsx)(ct.Checkbox,{classNames:u?{input:$}:void 0,checked:l,indeterminate:i,onChange:d,...r,disabled:!(d||r.onChange)||r.disabled})})});var re=require("react/jsx-runtime"),$a=(0,Ua.forwardRef)(function({selectionColumnHeaderRef:t,className:a,style:n,sortStatus:o,sortIcons:l,onSortStatusChange:i,columns:r,defaultColumnProps:d,groups:s,selectionTrigger:c,selectionVisible:u,selectionChecked:m,selectionIndeterminate:f,onSelectionChange:S,selectionCheckboxProps:g,selectorCellShadowVisible:p,selectionColumnClassName:w,selectionColumnStyle:b},h){let R=u?(0,re.jsx)(Xa,{ref:t,className:w,style:b,trigger:c,shadowVisible:p,checked:m,indeterminate:f,checkboxProps:g,onChange:S,rowSpan:s?2:void 0}):null;return(0,re.jsxs)(Ue.TableThead,{className:(0,Qa.default)("mantine-datatable-header",a),style:n,ref:h,children:[s&&(0,re.jsxs)(Ue.TableTr,{children:[R,s.map(E=>(0,re.jsx)(Ra,{group:E},E.id))]}),(0,re.jsxs)(Ue.TableTr,{children:[!s&&R,r.map(({hidden:E,...M},W)=>{if(E)return null;let{accessor:Q,visibleMediaQuery:N,textAlign:P,width:H,title:L,sortable:z,draggable:U,toggleable:se,resizable:de,titleClassName:ce,titleStyle:ue,filter:C,filtering:F}={...d,...M};return(0,re.jsx)(_a,{accessor:Q,className:ce,style:ue,visibleMediaQuery:N,textAlign:P,width:H,title:L,sortable:z,draggable:U,toggleable:se,resizable:de&&W<r.length-1,sortStatus:o,sortIcons:l,onSortStatusChange:i,filter:C,filtering:F},Q)})]})]})});var ut=require("@mantine/core"),Ka=O(require("clsx")),Et=require("react/jsx-runtime");function Ja({pt:e,pb:t,fetching:a,customContent:n,backgroundBlur:o,size:l,type:i,color:r}){return(0,Et.jsx)(ut.Center,{pt:e,pb:t,className:(0,Ka.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":a}),style:[{backdropFilter:o?`blur(${o}px)`:void 0}],children:a&&(n||(0,Et.jsx)(ut.Loader,{size:l,type:i,color:r}))})}var le=require("@mantine/core"),Nt=O(require("clsx")),oo=require("react");var v=require("@mantine/core"),to=O(require("clsx"));var Za=require("@mantine/core");function x(e,t,a){return e?(0,Za.parseThemeColor)({color:typeof e=="object"?e[a]:e,theme:t}).value:void 0}function Ya({theme:e,c:t,backgroundColor:a,borderColor:n,rowBorderColor:o,stripedColor:l,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":x(t,e,"light"),"--mantine-datatable-color-dark":x(t,e,"dark"),"--mantine-datatable-background-color-light":x(a,e,"light"),"--mantine-datatable-background-color-dark":x(a,e,"dark"),"--mantine-datatable-border-color-light":x(n,e,"light"),"--mantine-datatable-border-color-dark":x(n,e,"dark"),"--mantine-datatable-row-border-color-light":x(o,e,"light"),"--mantine-datatable-row-border-color-dark":x(o,e,"dark"),"--mantine-datatable-striped-color-light":x(l,e,"light"),"--mantine-datatable-striped-color-dark":x(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":x(i,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":x(i,e,"dark")}}function mt({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:a}){return{"--mantine-datatable-pagination-active-text-color-light":x(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":x(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":x(a,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":x(a,e,"dark")}}function qa({theme:e,color:t,backgroundColor:a}){return{"--mantine-datatable-row-color-light":x(t,e,"light"),"--mantine-datatable-row-color-dark":x(t,e,"dark"),"--mantine-datatable-row-background-color-light":x(a,e,"light"),"--mantine-datatable-row-background-color-dark":x(a,e,"dark")}}var Le=require("react/jsx-runtime");function ja(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Le.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var X=require("react/jsx-runtime"),eo={xs:(0,v.rem)(22),sm:(0,v.rem)(26),md:(0,v.rem)(32),lg:(0,v.rem)(38),xl:(0,v.rem)(44)};function ao({size:e,label:t,values:a,value:n,activeTextColor:o,activeBackgroundColor:l,onChange:i}){return(0,X.jsxs)(v.Group,{gap:"xs",children:[(0,X.jsx)(v.Text,{size:e,children:t}),(0,X.jsxs)(v.Menu,{withinPortal:!0,withArrow:!0,children:[(0,X.jsx)(v.MenuTarget,{children:(0,X.jsx)(v.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,X.jsx)(ja,{}),style:[{fontWeight:"normal"},r=>({height:eo[e],paddingLeft:r.spacing[e],paddingRight:r.spacing[e]})],children:n})}),(0,X.jsx)(v.MenuDropdown,{children:a.map(r=>{let d=r===n;return(0,X.jsx)(v.MenuItem,{className:(0,to.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:eo[e]},d&&(o||l)?s=>mt({theme:s,paginationActiveTextColor:o,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>i(r),children:(0,X.jsx)(v.Text,{size:e,children:r})},r)})})]})]})}var Ie=require("react/jsx-runtime"),no=(0,oo.forwardRef)(function({className:t,style:a,fetching:n,page:o,onPageChange:l,paginationWithEdges:i,paginationActiveTextColor:r,paginationActiveBackgroundColor:d,paginationSize:s,loadingText:c,noRecordsText:u,paginationText:m,totalRecords:f,recordsPerPage:S,onRecordsPerPageChange:g,recordsPerPageLabel:p,recordsPerPageOptions:w,recordsLength:b,horizontalSpacing:h,paginationWrapBreakpoint:R,getPaginationControlProps:E},M){let W;if(n)W=c;else if(!f)W=u;else{let N=(o-1)*S+1,P=N+b-1;W=m({from:N,to:P,totalRecords:f})}let Q=ee(({breakpoints:N})=>`(min-width: ${typeof R=="number"?`${(0,le.rem)(R)}rem`:N[R]||R})`);return(0,Ie.jsxs)(le.Box,{ref:M,px:h??"xs",py:"xs",className:(0,Nt.default)("mantine-datatable-pagination",t),style:[{flexDirection:Q?"row":"column"},a],children:[(0,Ie.jsx)(le.Text,{className:"mantine-datatable-pagination-text",size:s,children:W}),w&&(0,Ie.jsx)(ao,{activeTextColor:r,activeBackgroundColor:d,size:s,label:p,values:w,value:S,onChange:g}),(0,Ie.jsx)(le.Pagination,{classNames:{root:(0,Nt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!b}),control:"mantine-datatable-pagination-pages-control"},style:r||d?N=>mt({theme:N,paginationActiveTextColor:r,paginationActiveBackgroundColor:d}):void 0,withEdges:i,value:o,onChange:l,size:s,total:Math.ceil(f/S),getControlProps:E})]})});var po=require("@mantine/core"),fo=O(require("clsx"));var ro=require("@mantine/core"),lo=O(require("clsx"));var so=require("react/jsx-runtime");function io({className:e,style:t,visibleMediaQuery:a,record:n,index:o,onClick:l,onDoubleClick:i,onContextMenu:r,noWrap:d,ellipsis:s,textAlign:c,width:u,accessor:m,render:f,defaultRender:S,customCellAttributes:g}){return ee(a)?(0,so.jsx)(ro.TableTd,{className:(0,lo.default)({[Me]:d||s,[Re]:s,[$]:l||i,[st]:r,[te]:c==="left",[ae]:c==="center",[oe]:c==="right"},e),style:[{width:u,minWidth:u,maxWidth:u},t],onClick:l,onDoubleClick:i,onContextMenu:r,...g?.(n,o),children:f?f(n,o):S?S(n,o,m):it(n,m)}):null}var De=require("@mantine/core");var J=require("react/jsx-runtime");function co({open:e,colSpan:t,content:a,collapseProps:n}){let{expanded:o,visible:l}=fa(e,n?.transitionDuration);return l?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(De.TableTr,{}),(0,J.jsx)(De.TableTr,{children:(0,J.jsx)(De.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,J.jsx)(De.Collapse,{in:o,...n,children:(0,J.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:a()})})})})]}):null}var pt=require("@mantine/core"),uo=O(require("clsx"));var Lt=require("react/jsx-runtime");function mo({className:e,style:t,record:a,index:n,trigger:o,onChange:l,withRightShadow:i,getCheckboxProps:r,...d}){let s=r(a,n),c=!d.disabled&&!s.disabled,u=m=>{m.stopPropagation(),o==="cell"&&c&&l?.(m)};return(0,Lt.jsx)(pt.TableTd,{className:(0,uo.default)("mantine-datatable-row-selector-cell",{[$]:o==="cell"&&c},e),style:t,"data-shadow-visible":i||void 0,onClick:u,children:(0,Lt.jsx)(pt.Checkbox,{classNames:c?{input:$}:void 0,onChange:l,...d,...s})})}var Y=require("react/jsx-runtime");function bo({record:e,index:t,columns:a,defaultColumnProps:n,defaultColumnRender:o,selectionTrigger:l,selectionVisible:i,selectionChecked:r,onSelectionChange:d,isRecordSelectable:s,getSelectionCheckboxProps:c,onClick:u,onDoubleClick:m,onContextMenu:f,onCellClick:S,onCellDoubleClick:g,onCellContextMenu:p,expansion:w,customAttributes:b,color:h,backgroundColor:R,className:E,style:M,selectorCellShadowVisible:W,selectionColumnClassName:Q,selectionColumnStyle:N}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(po.TableTr,{className:(0,fo.default)("mantine-datatable-row",{[$]:u||m||w?.expandOnClick},{[st]:f},typeof E=="function"?E(e,t):E),"data-selected":r||void 0,onClick:P=>{if(w){let{isRowExpanded:H,expandOnClick:L,expandRow:z,collapseRow:U}=w;L&&(H(e)?U(e):z(e))}u?.({event:P,record:e,index:t})},onDoubleClick:m?P=>m({event:P,record:e,index:t}):void 0,onContextMenu:f?P=>f({event:P,record:e,index:t}):void 0,style:[h||R?P=>{let H=h?.(e,t),L=R?.(e,t);return qa({theme:P,color:H,backgroundColor:L})}:void 0,M?.(e,t)],...b?.(e,t),children:[i&&(0,Y.jsx)(mo,{className:Q,style:N,record:e,index:t,trigger:l,withRightShadow:W,checked:r,disabled:!d||(s?!s(e,t):!1),onChange:d,getCheckboxProps:c}),a.map(({hidden:P,...H},L)=>{if(P)return null;let{accessor:z,visibleMediaQuery:U,textAlign:se,noWrap:de,ellipsis:ce,width:ue,render:C,cellsClassName:F,cellsStyle:_,customCellAttributes:bt}={...n,...H};return(0,Y.jsx)(io,{className:typeof F=="function"?F(e,t):F,style:_?.(e,t),visibleMediaQuery:U,record:e,index:t,onClick:S?me=>S({event:me,record:e,index:t,column:H,columnIndex:L}):void 0,onDoubleClick:g?me=>g({event:me,record:e,index:t,column:H,columnIndex:L}):void 0,onContextMenu:p?me=>p({event:me,record:e,index:t,column:H,columnIndex:L}):void 0,accessor:z,textAlign:se,noWrap:de,ellipsis:ce,width:ue,render:C,defaultRender:o,customCellAttributes:bt},z)})]}),w&&(0,Y.jsx)(co,{colSpan:a.filter(({hidden:P})=>!P).length+(i?1:0),open:w.isRowExpanded(e),content:w.content({record:e,index:t}),collapseProps:w.collapseProps})]})}var ie=require("@mantine/core"),$e=O(require("clsx")),we=require("react/jsx-runtime");function To({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:a,rightShadowVisible:n,rightShadowBehind:o,bottomShadowVisible:l,headerHeight:i,footerHeight:r,onScrollPositionChange:d,children:s,viewportRef:c,scrollAreaProps:u}){return(0,we.jsxs)(ie.ScrollArea,{...u,viewportRef:c,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:d,children:[s,(0,we.jsx)(ie.Box,{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:i?(0,ie.rem)(i):0}}),(0,we.jsx)("div",{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,we.jsx)("div",{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,we.jsx)(ie.Box,{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:r?(0,ie.rem)(r+1):0}})]})}var I=require("react/jsx-runtime");function go({withTableBorder:e,borderRadius:t,textSelectionDisabled:a,height:n="100%",minHeight:o,shadow:l,verticalAlign:i="center",fetching:r,columns:d,storeColumnsKey:s,groups:c,pinFirstColumn:u,pinLastColumn:m,defaultColumnProps:f,defaultColumnRender:S,idAccessor:g="id",records:p,selectionTrigger:w="checkbox",selectedRecords:b,onSelectedRecordsChange:h,selectionColumnClassName:R,selectionColumnStyle:E,isRecordSelectable:M,allRecordsSelectionCheckboxProps:W={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:Q=(A,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:N,sortIcons:P,onSortStatusChange:H,horizontalSpacing:L,page:z,onPageChange:U,totalRecords:se,recordsPerPage:de,onRecordsPerPageChange:ce,recordsPerPageOptions:ue,recordsPerPageLabel:C="Records per page",paginationWithEdges:F,paginationActiveTextColor:_,paginationActiveBackgroundColor:bt,paginationSize:me="sm",paginationText:ho=({from:A,to:pe,totalRecords:fe})=>`${A} - ${pe} / ${fe}`,paginationWrapBreakpoint:Co="sm",getPaginationControlProps:yo=A=>A==="previous"?{"aria-label":"Previous page"}:A==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Do,customLoader:wo,loaderSize:So,loaderType:Po,loaderColor:vo,loadingText:xo="...",emptyState:Mo,noRecordsText:Ot="No records",noRecordsIcon:Ro,highlightOnHover:ko,striped:Eo,noHeader:No,onRowClick:Lo,onRowDoubleClick:Io,onRowContextMenu:Ho,onCellClick:Oo,onCellDoubleClick:Wo,onCellContextMenu:Ao,onScroll:Wt,onScrollToTop:At,onScrollToBottom:Vt,onScrollToLeft:zt,onScrollToRight:Ft,c:Vo,backgroundColor:zo,borderColor:Fo,rowBorderColor:_o,stripedColor:Bo,highlightOnHoverColor:Go,rowColor:Xo,rowBackgroundColor:Qo,rowExpansion:Uo,rowClassName:$o,rowStyle:Ko,customRowAttributes:Jo,scrollViewportRef:Zo,scrollAreaProps:Yo,tableRef:qo,bodyRef:jo,m:en,my:tn,mx:an,mt:on,mb:nn,ml:rn,mr:ln,className:sn,classNames:He,style:dn,styles:Oe,...cn}){let{ref:A,width:pe,height:fe}=ge(),We=(0,V.useMemo)(()=>c?.flatMap(T=>T.columns)??d,[d,c]),_t=nt({key:s,columns:We}),{ref:un,height:Tt}=ge(),{ref:mn,width:gt,height:Ae}=ge(),{ref:pn,height:fn}=ge(),{ref:bn,height:Bt}=ge(),{ref:Tn,width:gn}=ge(),hn=(0,It.useMergedRef)(mn,qo),[ht,Gt]=(0,V.useState)(!0),[Ct,Xt]=(0,V.useState)(!0),[Ve,Qt]=(0,V.useState)(!0),[Ke,Ut]=(0,V.useState)(!0),Cn=pa({rowExpansion:Uo,records:p,idAccessor:g}),Je=(0,V.useCallback)(()=>{let T=A.current?.scrollTop||0,q=A.current?.scrollLeft||0;if(r||Ae<=fe)Gt(!0),Xt(!0);else{let B=T===0,G=Ae-T-fe<1;Gt(B),Xt(G),B&&B!==ht&&At?.(),G&&G!==Ct&&Vt?.()}if(r||gt===pe)Qt(!0),Ut(!0);else{let B=q===0,G=gt-q-pe<1;Qt(B),Ut(G),B&&B!==Ve&&zt?.(),G&&G!==Ke&&Ft?.()}},[r,Vt,zt,Ft,At,fe,A,pe,Ct,Ve,Ke,ht,Ae,gt]);ra(Je,[Je]);let yn=(0,V.useCallback)(T=>{Wt?.(T),Je()},[Je,Wt]),Dn=(0,V.useCallback)(T=>{A.current?.scrollTo({top:0,left:0}),U(T)},[U,A]),Ze=p?.length,$t=p?.map(T=>k(T,g)),Se=!!b,ze=b?.map(T=>k(T,g)),Kt=$t!==void 0&&ze!==void 0&&ze.length>0,yt=M?p?.filter(M):p,Ye=yt?.map(T=>k(T,g)),qe=Kt&&Ye.every(T=>ze.includes(T)),wn=Kt&&Ye.some(T=>ze.includes(T)),Sn=(0,V.useCallback)(()=>{b&&h&&h(qe?b.filter(T=>!Ye.includes(k(T,g))):Fe([...b,...yt],T=>k(T,g)))},[qe,g,h,Ye,yt,b]),{lastSelectionChangeIndex:je,setLastSelectionChangeIndex:Pn}=la($t),Dt=Se&&!Ve&&!u;return(0,I.jsx)(St,{..._t,children:(0,I.jsxs)(ft.Box,{...{m:en,my:tn,mx:an,mt:on,mb:nn,ml:rn,mr:ln},className:(0,Ht.default)("mantine-datatable",{"mantine-datatable-with-border":e},sn,He?.root),style:[T=>({...Ya({theme:T,c:Vo,backgroundColor:zo,borderColor:Fo,rowBorderColor:_o,stripedColor:Bo,highlightOnHoverColor:Go}),borderRadius:T.radius[t]||t,boxShadow:T.shadows[l]||l,height:n,minHeight:o}),dn,Oe?.root],children:[(0,I.jsx)(To,{viewportRef:(0,It.useMergedRef)(A,Zo),topShadowVisible:!ht,leftShadowVisible:!Ve,leftShadowBehind:Se||!!u,rightShadowVisible:!Ke,rightShadowBehind:m,bottomShadowVisible:!Ct,headerHeight:Tt,footerHeight:fn,onScrollPositionChange:yn,scrollAreaProps:Yo,children:(0,I.jsxs)(ft.Table,{ref:hn,horizontalSpacing:L,className:(0,Ht.default)("mantine-datatable-table",{[ba]:a,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":Ae<fe,"mantine-datatable-pin-last-column":m,"mantine-datatable-pin-last-column-scrolled":!Ke&&m,"mantine-datatable-selection-column-visible":Se,"mantine-datatable-pin-first-column":u,"mantine-datatable-pin-first-column-scrolled":!Ve&&u},He?.table),style:{...Oe?.table,"--mantine-datatable-selection-column-width":`${gn}px`},"data-striped":Ze&&Eo||void 0,"data-highlight-on-hover":ko||void 0,...cn,children:[No?null:(0,I.jsx)(St,{..._t,children:(0,I.jsx)($a,{ref:un,selectionColumnHeaderRef:Tn,className:He?.header,style:Oe?.header,columns:We,defaultColumnProps:f,groups:c,sortStatus:N,sortIcons:P,onSortStatusChange:H,selectionTrigger:w,selectionVisible:Se,selectionChecked:qe,selectionIndeterminate:wn&&!qe,onSelectionChange:Sn,selectionCheckboxProps:W,selectorCellShadowVisible:Dt,selectionColumnClassName:R,selectionColumnStyle:E})}),(0,I.jsx)("tbody",{ref:jo,children:Ze?p.map((T,q)=>{let B=k(T,g),G=ze?.includes(B)||!1,Jt;return h&&b&&(Jt=vn=>{if(vn.nativeEvent.shiftKey&&je!==null){let Pe=p.filter(q>je?(be,Te)=>Te>=je&&Te<=q&&(M?M(be,Te):!0):(be,Te)=>Te>=q&&Te<=je&&(M?M(be,Te):!0));h(G?xt(b,Pe,be=>k(be,g)):Fe([...b,...Pe],be=>k(be,g)))}else h(G?b.filter(Pe=>k(Pe,g)!==B):Fe([...b,T],Pe=>k(Pe,g)));Pn(q)}),(0,I.jsx)(bo,{record:T,index:q,columns:We,defaultColumnProps:f,defaultColumnRender:S,selectionTrigger:w,selectionVisible:Se,selectionChecked:G,onSelectionChange:Jt,isRecordSelectable:M,getSelectionCheckboxProps:Q,onClick:Lo,onDoubleClick:Io,onCellClick:Oo,onCellDoubleClick:Wo,onContextMenu:Ho,onCellContextMenu:Ao,expansion:Cn,color:Xo,backgroundColor:Qo,className:$o,style:Ko,customAttributes:Jo,selectorCellShadowVisible:Dt,selectionColumnClassName:R,selectionColumnStyle:E},B)}):(0,I.jsx)(ea,{})}),We.some(({footer:T})=>T)&&(0,I.jsx)(va,{ref:pn,className:He?.footer,style:Oe?.footer,columns:We,defaultColumnProps:f,selectionVisible:Se,selectorCellShadowVisible:Dt,scrollDiff:Ae-fe})]})}),z&&(0,I.jsx)(no,{ref:bn,className:He?.pagination,style:Oe?.pagination,horizontalSpacing:L,fetching:r,page:z,onPageChange:Dn,totalRecords:se,recordsPerPage:de,onRecordsPerPageChange:ce,recordsPerPageOptions:ue,recordsPerPageLabel:C,paginationWithEdges:F,paginationActiveTextColor:_,paginationActiveBackgroundColor:bt,paginationSize:me,paginationText:ho,paginationWrapBreakpoint:Co,getPaginationControlProps:yo,noRecordsText:Ot,loadingText:xo,recordsLength:Ze}),(0,I.jsx)(Ja,{pt:Tt,pb:Bt,fetching:r,backgroundBlur:Do,customContent:wo,size:So,type:Po,color:vo}),(0,I.jsx)(aa,{pt:Tt,pb:Bt,icon:Ro,text:Ot,active:!r&&!Ze,children:Mo})]})})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy,useDataTableColumns,useDragToggleColumns}); | ||
"use strict";"use client";var Mn=Object.create;var et=Object.defineProperty;var kn=Object.getOwnPropertyDescriptor;var Rn=Object.getOwnPropertyNames;var En=Object.getPrototypeOf,Nn=Object.prototype.hasOwnProperty;var Ln=(e,t)=>{for(var o in t)et(e,o,{get:t[o],enumerable:!0})},Yt=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Rn(t))!Nn.call(e,a)&&a!==o&&et(e,a,{get:()=>t[a],enumerable:!(n=kn(t,a))||n.enumerable});return e};var W=(e,t,o)=>(o=e!=null?Mn(En(e)):{},Yt(t||!e||!e.__esModule?et(o,"default",{value:e,enumerable:!0}):o,e)),In=e=>Yt(et({},"__esModule",{value:!0}),e);var An={};Ln(An,{DataTable:()=>ha,differenceBy:()=>Mt,getRecordId:()=>k,getValueAtPath:()=>it,humanize:()=>ve,uniqBy:()=>Fe,useDataTableColumns:()=>nt,useDragToggleColumns:()=>Hn});module.exports=In(An);var ft=require("@mantine/core"),Ht=require("@mantine/hooks"),Ot=W(require("clsx")),z=require("react");var St=require("react");var qt=require("@mantine/core"),[jt,tt]=(0,qt.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var eo=require("react/jsx-runtime"),Pt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:l,resetColumnsOrder:i,resetColumnsToggle:r,setColumnWidth:d,resetColumnsWidth:s}=e,[u,c]=(0,St.useState)(""),[m,b]=(0,St.useState)("");return(0,eo.jsx)(jt,{value:{sourceColumn:u,setSourceColumn:c,targetColumn:m,setTargetColumn:b,columnsToggle:a,setColumnsToggle:l,swapColumns:()=>{if(!o||!n||!u||!m)return;let g=o.indexOf(u),f=o.indexOf(m);if(g!==-1&&f!==-1){let x=o.splice(g,1)[0];o.splice(f,0,x),n([...o])}},resetColumnsOrder:i,resetColumnsToggle:r,setColumnWidth:d,resetColumnsWidth:s},children:t})};var xt=require("react/jsx-runtime");function to(){return(0,xt.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,xt.jsx)("td",{})})}var ot=require("@mantine/core");var ee=require("react/jsx-runtime");function oo(){return(0,ee.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ee.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ee.jsx)("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"}),(0,ee.jsx)("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"}),(0,ee.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,ee.jsx)("path",{d:"M3 3l18 18"})]})}var Y=require("react/jsx-runtime");function ao({icon:e,text:t,pt:o,pb:n,active:a,children:l}){return(0,Y.jsx)(ot.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:l||(0,Y.jsxs)(Y.Fragment,{children:[e||(0,Y.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,Y.jsx)(oo,{})}),(0,Y.jsx)(ot.Text,{size:"sm",c:"dimmed",children:t})]})})}var Ee=require("@mantine/core"),xo=W(require("clsx")),vo=require("react");var ho=require("@mantine/core"),Co=W(require("clsx"));var at=require("@mantine/hooks"),no=require("react"),nt=({key:e,columns:t=[]})=>{let o=t&&t.map(f=>f.accessor)||[],n=t&&t.map(f=>({[f.accessor]:f.width??"initial"}))||[],a=t&&t.map(f=>({accessor:f.accessor,title:f.title,defaultToggle:f.defaultToggle||!0,toggleable:f.toggleable,toggled:f.defaultToggle===void 0?!0:f.defaultToggle})),[l,i]=(0,at.useLocalStorage)({key:`${e}-columns-order`,defaultValue:o,getInitialValueInEffect:!0}),[r,d]=(0,at.useLocalStorage)({key:`${e}-columns-toggle`,defaultValue:a,getInitialValueInEffect:!0}),[s,u]=(0,at.useLocalStorage)({key:`${e}-columns-width`,defaultValue:n,getInitialValueInEffect:!0}),c=()=>i(o),m=()=>{d(a)},b=()=>u(n);return{effectiveColumns:(0,no.useMemo)(()=>l?l.map(p=>t.find(D=>D.accessor===p)).map(p=>({...p,hidden:!r.find(D=>D.accessor===p?.accessor)?.toggled})).map(p=>({...p,width:s.find(D=>D[p?.accessor])?.[p?.accessor]})):t,[t,l,r,s]),setColumnsOrder:i,columnsOrder:l,resetColumnsOrder:c,columnsToggle:r,setColumnsToggle:d,resetColumnsToggle:m,columnsWidth:s,setColumnsWidth:u,setColumnWidth:(f,x)=>{let p=s.map(D=>D[f]?{[f]:x}:D);u(p)},resetColumnsWidth:b}},Hn=nt;var ro=require("@mantine/hooks");function ge(){let[e]=(0,ro.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var rt=require("react"),lo=typeof window<"u"?rt.useLayoutEffect:rt.useEffect;var lt=require("react");function io(e){let[t,o]=(0,lt.useState)(null),n=e?.join(":")||"";return(0,lt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var xe=require("react");function On(e,t){let o=()=>{t(e.map(a=>a.matches))},n=e.map(a=>{try{return a.addEventListener("change",o),()=>a.removeEventListener("change",o)}catch{return a.addListener(o),()=>a.removeListener(o)}});return()=>{n.forEach(a=>a())}}function Wn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function so(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,xe.useState)(o?t:Wn(e,t)),l=(0,xe.useRef)();return(0,xe.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(i=>window.matchMedia(i)),a(l.current.map(i=>i.matches)),On(l.current,i=>{a(i)})},[e]),n}var co=require("@mantine/core"),vt=require("react");function uo(e){let t=(0,co.useMantineTheme)(),o=(0,vt.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,vt.useMemo)(()=>e.map(()=>!0),[e]);return so(o,n)}var mo=require("@mantine/core"),po=require("@mantine/hooks");function te(e){let t=(0,mo.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,po.useMediaQuery)(o||"",!0)}var fo=require("react");function ve(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function Mt(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function Fe(e,t){return e.filter((o,n,a)=>n===a.findIndex(l=>t(o)===t(l)))}function it(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function k(e,t){return typeof t=="string"?it(e,t):t(e)}function bo({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:r,allowMultiple:d,initiallyExpanded:s}=e;t&&r==="always"?n=t.map(u=>k(u,o)):s&&(n=t.filter((u,c)=>s({record:u,index:c})).map(u=>k(u,o)),d||(n=[n[0]]))}let a,l,i=(0,fo.useState)(n);if(e){let{trigger:r,allowMultiple:d,collapseProps:s,content:u}=e;e.expanded?{recordIds:a,onRecordIdsChange:l}=e.expanded:[a,l]=i;let c=m=>l?.(a.filter(b=>b!==k(m,o)));return{expandOnClick:r!=="always"&&r!=="never",isRowExpanded:m=>r==="always"?!0:a.includes(k(m,o)),expandRow:m=>{let b=k(m,o);l?.(d?[...a,b]:[b])},collapseRow:c,collapseProps:s,content:({record:m,index:b})=>()=>u({record:m,index:b,collapse:()=>c(m)})}}}var kt=require("@mantine/hooks"),_e=require("react");function To(e,t){let[o,n]=(0,_e.useState)(e),[a,l]=(0,_e.useState)(e),i=(0,kt.useTimeout)(()=>n(!0),0),r=(0,kt.useTimeout)(()=>l(!1),t||200);return(0,_e.useEffect)(()=>{e?(r.clear(),l(!0),i.start()):(i.clear(),n(!1),r.start())},[i,r,e]),{expanded:o,visible:a}}var Me="mantine-datatable-nowrap",ke="mantine-datatable-ellipsis",$="mantine-datatable-pointer-cursor",st="mantine-datatable-context-menu-cursor",go="mantine-datatable-text-selection-disabled",oe="mantine-datatable-text-align-left",ae="mantine-datatable-text-align-center",ne="mantine-datatable-text-align-right";var Do=require("react/jsx-runtime");function yo({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:l,textAlign:i,width:r}){return te(o)?(0,Do.jsx)(ho.TableTh,{className:(0,Co.default)({[Me]:a||l,[ke]:l,[oe]:i==="left",[ae]:i==="center",[ne]:i==="right"},e),style:[{width:r,minWidth:r,maxWidth:r},t],children:n}):null}var wo=require("@mantine/core"),Po=require("react/jsx-runtime");function So({shadowVisible:e}){return(0,Po.jsx)(wo.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Re=require("react/jsx-runtime"),Mo=(0,vo.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:l,selectorCellShadowVisible:i,scrollDiff:r},d){let s=r<0;return(0,Re.jsx)(Ee.TableTfoot,{ref:d,className:(0,xo.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,Ee.rem)(s?r:0)},o],children:(0,Re.jsxs)(Ee.TableTr,{children:[l&&(0,Re.jsx)(So,{shadowVisible:i}),n.map(({hidden:u,...c})=>{if(u)return null;let{accessor:m,visibleMediaQuery:b,textAlign:w,width:g,footer:f,footerClassName:x,footerStyle:p,noWrap:D,ellipsis:M}={...a,...c};return(0,Re.jsx)(yo,{className:x,style:p,visibleMediaQuery:b,textAlign:w,width:g,title:f,noWrap:D,ellipsis:M},m)})]})})});var Ue=require("@mantine/core"),$o=W(require("clsx")),Ko=require("react");var ko=require("@mantine/core"),Ro=W(require("clsx")),Rt=require("react");var No=require("react/jsx-runtime");function Eo({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:l}}){let i=(0,Rt.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),r=uo(i),d=(0,Rt.useMemo)(()=>t.filter(({hidden:s},u)=>!s&&r?.[u]).length,[t,r]);return d>0?(0,No.jsx)(ko.TableTh,{colSpan:d,className:(0,Ro.default)("mantine-datatable-column-group-header-cell",{[oe]:n==="left",[ae]:n==="center",[ne]:n==="right"},a),style:l,children:o??ve(e)}):null}var y=require("@mantine/core"),Xe=W(require("clsx")),Qe=require("react");var re=require("@mantine/core"),Ho=require("@mantine/hooks");var Be=require("react/jsx-runtime");function Lo(){return(0,Be.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Be.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Be.jsx)("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"})]})}var Ge=require("react/jsx-runtime");function Io(){return(0,Ge.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ge.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ge.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var he=require("react/jsx-runtime");function Oo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,Ho.useDisclosure)(!1);return(0,he.jsxs)(re.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,he.jsx)(re.PopoverTarget,{children:(0,he.jsx)(re.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:i=>{i.preventDefault(),a()},children:(0,he.jsx)(t?Io:Lo,{})})}),(0,he.jsx)(re.PopoverDropdown,{onClick:i=>i.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var Wo=require("@mantine/core"),dt=require("react");var Vo=require("react/jsx-runtime"),Ao=e=>{let{accessor:t,columnRef:o}=e,n=(0,dt.useRef)(null),[a,l]=(0,dt.useState)(0),{setColumnWidth:i}=tt(),r=c=>{c.preventDefault(),c.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",s),document.body.style.cursor="col-resize"},d=c=>{if(!o.current)return;let m=c.clientX-o.current.getBoundingClientRect().right,w=`${o.current.getBoundingClientRect().width+m}px`;o.current.style.width=w,i(t,o.current.style.width),l(-m)},s=()=>{o.current&&(document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",s),document.body.style.cursor="initial",i(t,o.current.style.width),l(0))};return(0,Vo.jsx)("div",{ref:n,onClick:c=>c.stopPropagation(),onMouseDown:r,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",i(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,Wo.rem)(a)}})};var Ce=require("react/jsx-runtime");function zo(){return(0,Ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ce.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ce.jsx)("path",{d:"M12 5l0 14"}),(0,Ce.jsx)("path",{d:"M16 9l-4 -4"}),(0,Ce.jsx)("path",{d:"M8 9l4 -4"})]})}var ye=require("react/jsx-runtime");function Fo(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,ye.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,ye.jsx)("path",{d:"M12 3l0 18"})]})}var K=require("react/jsx-runtime");function _o(){return(0,K.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,K.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,K.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,K.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Ne=require("react/jsx-runtime");function Bo(){return(0,Ne.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ne.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ne.jsx)("path",{d:"M18 6l-12 12"}),(0,Ne.jsx)("path",{d:"M6 6l12 12"})]})}var C=require("react/jsx-runtime");function Go({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:l,draggable:i,toggleable:r,resizable:d,sortIcons:s,textAlign:u,width:c,sortStatus:m,onSortStatusChange:b,filter:w,filtering:g}){let{setSourceColumn:f,setTargetColumn:x,swapColumns:p,columnsToggle:D,setColumnsToggle:M}=tt(),[I,S]=(0,Qe.useState)(!1),H=(0,Qe.useRef)(null),[Q,E]=(0,Qe.useState)(!1);if(!te(n))return null;let F=a??ve(o),R=typeof F=="string"?F:void 0,N=l&&b?h=>{h?.defaultPrevented||b({columnAccessor:o,direction:m?.columnAccessor===o?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,O=h=>{h.stopPropagation(),f(o),S(!1)},_=h=>{h.preventDefault(),x(o),S(!0)},U=()=>{x(o),S(!1),p()},de=()=>{S(!0)},ce=()=>{S(!1)},ue=h=>{h.stopPropagation(),M(Z=>Z.map(A=>A.accessor===o?{...A,toggled:!1}:A))};return(0,C.jsxs)(y.TableTh,{className:(0,Xe.default)({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":r,"mantine-datatable-header-cell-resizable":d},e),style:[{width:c,...d?{minWidth:"1px"}:{minWidth:c,maxWidth:c}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:N,onContextMenu:h=>{r&&(h.preventDefault(),E(!0))},onKeyDown:h=>h.key==="Enter"&&N?.(),ref:H,children:[(0,C.jsxs)(y.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,C.jsxs)(y.Popover,{width:200,position:"bottom",withArrow:!0,shadow:"md",opened:Q,onChange:E,children:[(0,C.jsx)(y.PopoverTarget,{children:(0,C.jsxs)(y.Flex,{align:"center",w:"100%",className:(0,Xe.default)({"mantine-datatable-header-cell-draggable":i,"mantine-datatable-header-cell-drag-over":I}),draggable:i,onDragStart:i?O:void 0,onDragEnter:i?de:void 0,onDragOver:i?_:void 0,onDrop:i?U:void 0,onDragLeave:i?ce:void 0,children:[i?(0,C.jsx)(y.Center,{role:"img","aria-label":"Drag column",children:(0,C.jsx)(y.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:h=>{h.stopPropagation()},children:(0,C.jsx)(_o,{})})}):null,(0,C.jsx)(y.Box,{className:(0,Xe.default)("mantine-datatable-header-cell-sortable-text",{[oe]:u==="left",[ae]:u==="center",[ne]:u==="right"},Me,ke),title:R,children:F})]})}),(0,C.jsx)(y.PopoverDropdown,{children:(0,C.jsx)(y.Stack,{children:D.filter(h=>h.toggleable).map(h=>(0,C.jsx)(y.Group,{children:(0,C.jsx)(y.Checkbox,{size:"xs",label:h.title??ve(h.accessor),checked:h.toggled,onChange:Z=>{M(D.map(A=>A.accessor===h.accessor?{...A,toggled:Z.currentTarget.checked}:A))}})},h.accessor))})})]}),r?(0,C.jsx)(y.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,C.jsx)(y.ActionIcon,{size:"xs",variant:"light",onClick:ue,children:(0,C.jsx)(Bo,{})})}):null,l||m?.columnAccessor===o?(0,C.jsx)(C.Fragment,{children:m?.columnAccessor===o?(0,C.jsx)(y.Center,{className:(0,Xe.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":m.direction==="desc"}),role:"img","aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||(0,C.jsx)(zo,{})}):(0,C.jsx)(y.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:s?.unsorted||(0,C.jsx)(Fo,{})})}):null,w?(0,C.jsx)(Oo,{isActive:!!g,children:w}):null]}),d?(0,C.jsx)(Ao,{accessor:o,columnRef:H}):null]})}var ct=require("@mantine/core"),Xo=W(require("clsx")),Qo=require("react");var Et=require("react/jsx-runtime"),Uo=(0,Qo.forwardRef)(function({className:t,style:o,trigger:n,shadowVisible:a,checked:l,indeterminate:i,checkboxProps:r,onChange:d,rowSpan:s},u){let c=!r.disabled;return(0,Et.jsx)(ct.TableTh,{ref:u,className:(0,Xo.default)("mantine-datatable-header-selector-cell",{[$]:n==="cell"&&c},t),style:o,rowSpan:s,"data-shadow-visible":a||void 0,onClick:n==="cell"&&c?d:void 0,children:(0,Et.jsx)(ct.Checkbox,{classNames:c?{input:$}:void 0,checked:l,indeterminate:i,onChange:d,...r,disabled:!(d||r.onChange)||r.disabled})})});var le=require("react/jsx-runtime"),Jo=(0,Ko.forwardRef)(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:l,onSortStatusChange:i,columns:r,defaultColumnProps:d,groups:s,selectionTrigger:u,selectionVisible:c,selectionChecked:m,selectionIndeterminate:b,onSelectionChange:w,selectionCheckboxProps:g,selectorCellShadowVisible:f,selectionColumnClassName:x,selectionColumnStyle:p},D){let M=c?(0,le.jsx)(Uo,{ref:t,className:x,style:p,trigger:u,shadowVisible:f,checked:m,indeterminate:b,checkboxProps:g,onChange:w,rowSpan:s?2:void 0}):null;return(0,le.jsxs)(Ue.TableThead,{className:(0,$o.default)("mantine-datatable-header",o),style:n,ref:D,children:[s&&(0,le.jsxs)(Ue.TableTr,{children:[M,s.map(I=>(0,le.jsx)(Eo,{group:I},I.id))]}),(0,le.jsxs)(Ue.TableTr,{children:[!s&&M,r.map(({hidden:I,...S},H)=>{if(I)return null;let{accessor:Q,visibleMediaQuery:E,textAlign:F,width:R,title:N,sortable:O,draggable:_,toggleable:U,resizable:de,titleClassName:ce,titleStyle:ue,filter:h,filtering:Z}={...d,...S};return(0,le.jsx)(Go,{accessor:Q,className:ce,style:ue,visibleMediaQuery:E,textAlign:F,width:R,title:N,sortable:O,draggable:_,toggleable:U,resizable:de&&H<r.length-1,sortStatus:a,sortIcons:l,onSortStatusChange:i,filter:h,filtering:Z},Q)})]})]})});var ut=require("@mantine/core"),Zo=W(require("clsx")),Nt=require("react/jsx-runtime");function Yo({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:l,type:i,color:r}){return(0,Nt.jsx)(ut.Center,{pt:e,pb:t,className:(0,Zo.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,Nt.jsx)(ut.Loader,{size:l,type:i,color:r}))})}var ie=require("@mantine/core"),Lt=W(require("clsx")),ra=require("react");var P=require("@mantine/core"),aa=W(require("clsx"));var qo=require("@mantine/core");function v(e,t,o){return e?(0,qo.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function jo({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:l,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":v(t,e,"light"),"--mantine-datatable-color-dark":v(t,e,"dark"),"--mantine-datatable-background-color-light":v(o,e,"light"),"--mantine-datatable-background-color-dark":v(o,e,"dark"),"--mantine-datatable-border-color-light":v(n,e,"light"),"--mantine-datatable-border-color-dark":v(n,e,"dark"),"--mantine-datatable-row-border-color-light":v(a,e,"light"),"--mantine-datatable-row-border-color-dark":v(a,e,"dark"),"--mantine-datatable-striped-color-light":v(l,e,"light"),"--mantine-datatable-striped-color-dark":v(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":v(i,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":v(i,e,"dark")}}function mt({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":v(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":v(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":v(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":v(o,e,"dark")}}function ea({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":v(t,e,"light"),"--mantine-datatable-row-color-dark":v(t,e,"dark"),"--mantine-datatable-row-background-color-light":v(o,e,"light"),"--mantine-datatable-row-background-color-dark":v(o,e,"dark")}}var Le=require("react/jsx-runtime");function ta(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Le.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var X=require("react/jsx-runtime"),oa={xs:(0,P.rem)(22),sm:(0,P.rem)(26),md:(0,P.rem)(32),lg:(0,P.rem)(38),xl:(0,P.rem)(44)};function na({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:l,onChange:i}){return(0,X.jsxs)(P.Group,{gap:"xs",children:[(0,X.jsx)(P.Text,{size:e,children:t}),(0,X.jsxs)(P.Menu,{withinPortal:!0,withArrow:!0,children:[(0,X.jsx)(P.MenuTarget,{children:(0,X.jsx)(P.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,X.jsx)(ta,{}),style:[{fontWeight:"normal"},r=>({height:oa[e],paddingLeft:r.spacing[e],paddingRight:r.spacing[e]})],children:n})}),(0,X.jsx)(P.MenuDropdown,{children:o.map(r=>{let d=r===n;return(0,X.jsx)(P.MenuItem,{className:(0,aa.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:oa[e]},d&&(a||l)?s=>mt({theme:s,paginationActiveTextColor:a,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>i(r),children:(0,X.jsx)(P.Text,{size:e,children:r})},r)})})]})]})}var Ie=require("react/jsx-runtime"),la=(0,ra.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:l,paginationWithEdges:i,paginationActiveTextColor:r,paginationActiveBackgroundColor:d,paginationSize:s,loadingText:u,noRecordsText:c,paginationText:m,totalRecords:b,recordsPerPage:w,onRecordsPerPageChange:g,recordsPerPageLabel:f,recordsPerPageOptions:x,recordsLength:p,horizontalSpacing:D,paginationWrapBreakpoint:M,getPaginationControlProps:I},S){let H;if(n)H=u;else if(!b)H=c;else{let E=(a-1)*w+1,F=E+p-1;H=m({from:E,to:F,totalRecords:b})}let Q=te(({breakpoints:E})=>`(min-width: ${typeof M=="number"?`${(0,ie.rem)(M)}rem`:E[M]||M})`);return(0,Ie.jsxs)(ie.Box,{ref:S,px:D??"xs",py:"xs",className:(0,Lt.default)("mantine-datatable-pagination",t),style:[{flexDirection:Q?"row":"column"},o],children:[(0,Ie.jsx)(ie.Text,{className:"mantine-datatable-pagination-text",size:s,children:H}),x&&(0,Ie.jsx)(na,{activeTextColor:r,activeBackgroundColor:d,size:s,label:f,values:x,value:w,onChange:g}),(0,Ie.jsx)(ie.Pagination,{classNames:{root:(0,Lt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!p}),control:"mantine-datatable-pagination-pages-control"},style:r||d?E=>mt({theme:E,paginationActiveTextColor:r,paginationActiveBackgroundColor:d}):void 0,withEdges:i,value:a,onChange:l,size:s,total:Math.ceil(b/w),getControlProps:I})]})});var fa=require("@mantine/core"),ba=W(require("clsx"));var ia=require("@mantine/core"),sa=W(require("clsx"));var ca=require("react/jsx-runtime");function da({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:l,onDoubleClick:i,onContextMenu:r,noWrap:d,ellipsis:s,textAlign:u,width:c,accessor:m,render:b,defaultRender:w,customCellAttributes:g}){return te(o)?(0,ca.jsx)(ia.TableTd,{className:(0,sa.default)({[Me]:d||s,[ke]:s,[$]:l||i,[st]:r,[oe]:u==="left",[ae]:u==="center",[ne]:u==="right"},e),style:[{width:c,minWidth:c,maxWidth:c},t],onClick:l,onDoubleClick:i,onContextMenu:r,...g?.(n,a),children:b?b(n,a):w?w(n,a,m):it(n,m)}):null}var De=require("@mantine/core");var J=require("react/jsx-runtime");function ua({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:l}=To(e,n?.transitionDuration);return l?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(De.TableTr,{}),(0,J.jsx)(De.TableTr,{children:(0,J.jsx)(De.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,J.jsx)(De.Collapse,{in:a,...n,children:(0,J.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var pt=require("@mantine/core"),ma=W(require("clsx"));var It=require("react/jsx-runtime");function pa({className:e,style:t,record:o,index:n,trigger:a,onChange:l,withRightShadow:i,checkboxProps:r,getCheckboxProps:d,...s}){let u={...r,...d(o,n)},c=!s.disabled&&!u.disabled,m=b=>{b.stopPropagation(),a==="cell"&&c&&l?.(b)};return(0,It.jsx)(pt.TableTd,{className:(0,ma.default)("mantine-datatable-row-selector-cell",{[$]:a==="cell"&&c},e),style:t,"data-shadow-visible":i||void 0,onClick:m,children:(0,It.jsx)(pt.Checkbox,{classNames:c?{input:$}:void 0,onChange:l,...s,...u})})}var q=require("react/jsx-runtime");function Ta({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:l,selectionVisible:i,selectionChecked:r,onSelectionChange:d,isRecordSelectable:s,selectionCheckboxProps:u,getSelectionCheckboxProps:c,onClick:m,onDoubleClick:b,onContextMenu:w,onCellClick:g,onCellDoubleClick:f,onCellContextMenu:x,expansion:p,customAttributes:D,color:M,backgroundColor:I,className:S,style:H,selectorCellShadowVisible:Q,selectionColumnClassName:E,selectionColumnStyle:F}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(fa.TableTr,{className:(0,ba.default)("mantine-datatable-row",{[$]:m||b||p?.expandOnClick},{[st]:w},typeof S=="function"?S(e,t):S),"data-selected":r||void 0,onClick:R=>{if(p){let{isRowExpanded:N,expandOnClick:O,expandRow:_,collapseRow:U}=p;O&&(N(e)?U(e):_(e))}m?.({event:R,record:e,index:t})},onDoubleClick:b?R=>b({event:R,record:e,index:t}):void 0,onContextMenu:w?R=>w({event:R,record:e,index:t}):void 0,style:[M||I?R=>{let N=M?.(e,t),O=I?.(e,t);return ea({theme:R,color:N,backgroundColor:O})}:void 0,H?.(e,t)],...D?.(e,t),children:[i&&(0,q.jsx)(pa,{className:E,style:F,record:e,index:t,trigger:l,withRightShadow:Q,checked:r,disabled:!d||(s?!s(e,t):!1),onChange:d,checkboxProps:u,getCheckboxProps:c}),o.map(({hidden:R,...N},O)=>{if(R)return null;let{accessor:_,visibleMediaQuery:U,textAlign:de,noWrap:ce,ellipsis:ue,width:h,render:Z,cellsClassName:A,cellsStyle:bt,customCellAttributes:Tt}={...n,...N};return(0,q.jsx)(da,{className:typeof A=="function"?A(e,t):A,style:bt?.(e,t),visibleMediaQuery:U,record:e,index:t,onClick:g?me=>g({event:me,record:e,index:t,column:N,columnIndex:O}):void 0,onDoubleClick:f?me=>f({event:me,record:e,index:t,column:N,columnIndex:O}):void 0,onContextMenu:x?me=>x({event:me,record:e,index:t,column:N,columnIndex:O}):void 0,accessor:_,textAlign:de,noWrap:ce,ellipsis:ue,width:h,render:Z,defaultRender:a,customCellAttributes:Tt},_)})]}),p&&(0,q.jsx)(ua,{colSpan:o.filter(({hidden:R})=>!R).length+(i?1:0),open:p.isRowExpanded(e),content:p.content({record:e,index:t}),collapseProps:p.collapseProps})]})}var se=require("@mantine/core"),$e=W(require("clsx")),we=require("react/jsx-runtime");function ga({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:l,headerHeight:i,footerHeight:r,onScrollPositionChange:d,children:s,viewportRef:u,scrollAreaProps:c}){return(0,we.jsxs)(se.ScrollArea,{...c,viewportRef:u,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:d,children:[s,(0,we.jsx)(se.Box,{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:i?(0,se.rem)(i):0}}),(0,we.jsx)("div",{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,we.jsx)("div",{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,we.jsx)(se.Box,{className:(0,$e.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:r?(0,se.rem)(r+1):0}})]})}var L=require("react/jsx-runtime");function ha({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,shadow:l,verticalAlign:i="center",fetching:r,columns:d,storeColumnsKey:s,groups:u,pinFirstColumn:c,pinLastColumn:m,defaultColumnProps:b,defaultColumnRender:w,idAccessor:g="id",records:f,selectionTrigger:x="checkbox",selectedRecords:p,onSelectedRecordsChange:D,selectionColumnClassName:M,selectionColumnStyle:I,isRecordSelectable:S,selectionCheckboxProps:H,allRecordsSelectionCheckboxProps:Q={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:E=(V,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:F,sortIcons:R,onSortStatusChange:N,horizontalSpacing:O,page:_,onPageChange:U,totalRecords:de,recordsPerPage:ce,onRecordsPerPageChange:ue,recordsPerPageOptions:h,recordsPerPageLabel:Z="Records per page",paginationWithEdges:A,paginationActiveTextColor:bt,paginationActiveBackgroundColor:Tt,paginationSize:me="sm",paginationText:Ca=({from:V,to:pe,totalRecords:fe})=>`${V} - ${pe} / ${fe}`,paginationWrapBreakpoint:ya="sm",getPaginationControlProps:Da=V=>V==="previous"?{"aria-label":"Previous page"}:V==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:wa,customLoader:Sa,loaderSize:Pa,loaderType:xa,loaderColor:va,loadingText:Ma="...",emptyState:ka,noRecordsText:Wt="No records",noRecordsIcon:Ra,highlightOnHover:Ea,striped:Na,noHeader:La,onRowClick:Ia,onRowDoubleClick:Ha,onRowContextMenu:Oa,onCellClick:Wa,onCellDoubleClick:Aa,onCellContextMenu:Va,onScroll:At,onScrollToTop:Vt,onScrollToBottom:zt,onScrollToLeft:Ft,onScrollToRight:_t,c:za,backgroundColor:Fa,borderColor:_a,rowBorderColor:Ba,stripedColor:Ga,highlightOnHoverColor:Xa,rowColor:Qa,rowBackgroundColor:Ua,rowExpansion:$a,rowClassName:Ka,rowStyle:Ja,customRowAttributes:Za,scrollViewportRef:Ya,scrollAreaProps:qa,tableRef:ja,bodyRef:en,m:tn,my:on,mx:an,mt:nn,mb:rn,ml:ln,mr:sn,className:dn,classNames:He,style:cn,styles:Oe,...un}){let{ref:V,width:pe,height:fe}=ge(),We=(0,z.useMemo)(()=>u?.flatMap(T=>T.columns)??d,[d,u]),Bt=nt({key:s,columns:We}),{ref:mn,height:gt}=ge(),{ref:pn,width:ht,height:Ae}=ge(),{ref:fn,height:bn}=ge(),{ref:Tn,height:Gt}=ge(),{ref:gn,width:hn}=ge(),Cn=(0,Ht.useMergedRef)(pn,ja),[Ct,Xt]=(0,z.useState)(!0),[yt,Qt]=(0,z.useState)(!0),[Ve,Ut]=(0,z.useState)(!0),[Ke,$t]=(0,z.useState)(!0),yn=bo({rowExpansion:$a,records:f,idAccessor:g}),Je=(0,z.useCallback)(()=>{let T=V.current?.scrollTop||0,j=V.current?.scrollLeft||0;if(r||Ae<=fe)Xt(!0),Qt(!0);else{let B=T===0,G=Ae-T-fe<1;Xt(B),Qt(G),B&&B!==Ct&&Vt?.(),G&&G!==yt&&zt?.()}if(r||ht===pe)Ut(!0),$t(!0);else{let B=j===0,G=ht-j-pe<1;Ut(B),$t(G),B&&B!==Ve&&Ft?.(),G&&G!==Ke&&_t?.()}},[r,zt,Ft,_t,Vt,fe,V,pe,yt,Ve,Ke,Ct,Ae,ht]);lo(Je,[Je]);let Dn=(0,z.useCallback)(T=>{At?.(T),Je()},[Je,At]),wn=(0,z.useCallback)(T=>{V.current?.scrollTo({top:0,left:0}),U(T)},[U,V]),Ze=f?.length,Kt=f?.map(T=>k(T,g)),Se=!!p,ze=p?.map(T=>k(T,g)),Jt=Kt!==void 0&&ze!==void 0&&ze.length>0,Dt=S?f?.filter(S):f,Ye=Dt?.map(T=>k(T,g)),qe=Jt&&Ye.every(T=>ze.includes(T)),Sn=Jt&&Ye.some(T=>ze.includes(T)),Pn=(0,z.useCallback)(()=>{p&&D&&D(qe?p.filter(T=>!Ye.includes(k(T,g))):Fe([...p,...Dt],T=>k(T,g)))},[qe,g,D,Ye,Dt,p]),{lastSelectionChangeIndex:je,setLastSelectionChangeIndex:xn}=io(Kt),wt=Se&&!Ve&&!c;return(0,L.jsx)(Pt,{...Bt,children:(0,L.jsxs)(ft.Box,{...{m:tn,my:on,mx:an,mt:nn,mb:rn,ml:ln,mr:sn},className:(0,Ot.default)("mantine-datatable",{"mantine-datatable-with-border":e},dn,He?.root),style:[T=>({...jo({theme:T,c:za,backgroundColor:Fa,borderColor:_a,rowBorderColor:Ba,stripedColor:Ga,highlightOnHoverColor:Xa}),borderRadius:T.radius[t]||t,boxShadow:T.shadows[l]||l,height:n,minHeight:a}),cn,Oe?.root],children:[(0,L.jsx)(ga,{viewportRef:(0,Ht.useMergedRef)(V,Ya),topShadowVisible:!Ct,leftShadowVisible:!Ve,leftShadowBehind:Se||!!c,rightShadowVisible:!Ke,rightShadowBehind:m,bottomShadowVisible:!yt,headerHeight:gt,footerHeight:bn,onScrollPositionChange:Dn,scrollAreaProps:qa,children:(0,L.jsxs)(ft.Table,{ref:Cn,horizontalSpacing:O,className:(0,Ot.default)("mantine-datatable-table",{[go]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":Ae<fe,"mantine-datatable-pin-last-column":m,"mantine-datatable-pin-last-column-scrolled":!Ke&&m,"mantine-datatable-selection-column-visible":Se,"mantine-datatable-pin-first-column":c,"mantine-datatable-pin-first-column-scrolled":!Ve&&c},He?.table),style:{...Oe?.table,"--mantine-datatable-selection-column-width":`${hn}px`},"data-striped":Ze&&Na||void 0,"data-highlight-on-hover":Ea||void 0,...un,children:[La?null:(0,L.jsx)(Pt,{...Bt,children:(0,L.jsx)(Jo,{ref:mn,selectionColumnHeaderRef:gn,className:He?.header,style:Oe?.header,columns:We,defaultColumnProps:b,groups:u,sortStatus:F,sortIcons:R,onSortStatusChange:N,selectionTrigger:x,selectionVisible:Se,selectionChecked:qe,selectionIndeterminate:Sn&&!qe,onSelectionChange:Pn,selectionCheckboxProps:{...H,...Q},selectorCellShadowVisible:wt,selectionColumnClassName:M,selectionColumnStyle:I})}),(0,L.jsx)("tbody",{ref:en,children:Ze?f.map((T,j)=>{let B=k(T,g),G=ze?.includes(B)||!1,Zt;return D&&p&&(Zt=vn=>{if(vn.nativeEvent.shiftKey&&je!==null){let Pe=f.filter(j>je?(be,Te)=>Te>=je&&Te<=j&&(S?S(be,Te):!0):(be,Te)=>Te>=j&&Te<=je&&(S?S(be,Te):!0));D(G?Mt(p,Pe,be=>k(be,g)):Fe([...p,...Pe],be=>k(be,g)))}else D(G?p.filter(Pe=>k(Pe,g)!==B):Fe([...p,T],Pe=>k(Pe,g)));xn(j)}),(0,L.jsx)(Ta,{record:T,index:j,columns:We,defaultColumnProps:b,defaultColumnRender:w,selectionTrigger:x,selectionVisible:Se,selectionChecked:G,onSelectionChange:Zt,isRecordSelectable:S,selectionCheckboxProps:H,getSelectionCheckboxProps:E,onClick:Ia,onDoubleClick:Ha,onCellClick:Wa,onCellDoubleClick:Aa,onContextMenu:Oa,onCellContextMenu:Va,expansion:yn,color:Qa,backgroundColor:Ua,className:Ka,style:Ja,customAttributes:Za,selectorCellShadowVisible:wt,selectionColumnClassName:M,selectionColumnStyle:I},B)}):(0,L.jsx)(to,{})}),We.some(({footer:T})=>T)&&(0,L.jsx)(Mo,{ref:fn,className:He?.footer,style:Oe?.footer,columns:We,defaultColumnProps:b,selectionVisible:Se,selectorCellShadowVisible:wt,scrollDiff:Ae-fe})]})}),_&&(0,L.jsx)(la,{ref:Tn,className:He?.pagination,style:Oe?.pagination,horizontalSpacing:O,fetching:r,page:_,onPageChange:wn,totalRecords:de,recordsPerPage:ce,onRecordsPerPageChange:ue,recordsPerPageOptions:h,recordsPerPageLabel:Z,paginationWithEdges:A,paginationActiveTextColor:bt,paginationActiveBackgroundColor:Tt,paginationSize:me,paginationText:Ca,paginationWrapBreakpoint:ya,getPaginationControlProps:Da,noRecordsText:Wt,loadingText:Ma,recordsLength:Ze}),(0,L.jsx)(Yo,{pt:gt,pb:Gt,fetching:r,backgroundBlur:wa,customContent:Sa,size:Pa,type:xa,color:va}),(0,L.jsx)(ao,{pt:gt,pb:Gt,icon:Ra,text:Wt,active:!r&&!Ze,children:ka})]})})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy,useDataTableColumns,useDragToggleColumns}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "mantine-datatable", | ||
"version": "7.4.2", | ||
"version": "7.4.3", | ||
"description": "The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
514645
2721