mantine-datatable 7.11.2 → 7.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";import{Box as Fr,Table as Br}from"@mantine/core";import{useDebouncedCallback as Gr,useMergedRef as Io}from"@mantine/hooks";import Ho from"clsx";import{useCallback as Fe,useMemo as Xr,useState as Be}from"react";import{useState as Mt}from"react";import{createSafeContext as Fa}from"@mantine/core";var[xt,se]=Fa("useDataTableColumnsContext must be used within DataTableColumnProvider");import{jsx as Ba}from"react/jsx-runtime";var et=e=>{let{children:t,columnsOrder:o,setColumnsOrder:a,columnsToggle:n,setColumnsToggle:l,resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:u}=e,[f,p]=Mt(""),[T,g]=Mt("");return Ba(xt,{value:{sourceColumn:f,setSourceColumn:p,targetColumn:T,setTargetColumn:g,columnsToggle:n,setColumnsToggle:l,swapColumns:()=>{if(!o||!a||!f||!T)return;let x=o.indexOf(f),S=o.indexOf(T);if(x!==-1&&S!==-1){let w=o.splice(x,1)[0];o.splice(S,0,w),a([...o])}},resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:u},children:t})};import{jsx as Rt}from"react/jsx-runtime";function kt(){return Rt("tr",{className:"mantine-datatable-empty-row",children:Rt("td",{})})}import{Center as Xa,Text as Qa}from"@mantine/core";import{jsx as ye,jsxs as Ga}from"react/jsx-runtime";function Et(){return Ga("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[ye("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ye("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"}),ye("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"}),ye("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),ye("path",{d:"M3 3l18 18"})]})}import{Fragment as Ua,jsx as ke,jsxs as $a}from"react/jsx-runtime";function Nt({icon:e,text:t,pt:o,pb:a,active:n,children:l}){return ke(Xa,{pt:o,pb:a,className:"mantine-datatable-empty-state","data-active":n||void 0,children:l||$a(Ua,{children:[e||ke("div",{className:"mantine-datatable-empty-state-icon",children:ke(Et,{})}),ke(Qa,{component:"div",size:"sm",c:"dimmed",children:t})]})})}import{TableTfoot as Tn,TableTr as gn,rem as hn}from"@mantine/core";import Cn from"clsx";import{forwardRef as Dn}from"react";import{TableTh as un}from"@mantine/core";import mn from"clsx";import{useLocalStorage as tt}from"@mantine/hooks";import{useMemo as Ka}from"react";var Lt=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function a(c,D){let m=[];return c.forEach(s=>{D.find(C=>C.accessor===s)&&m.push(s)}),D.forEach(s=>{m.includes(s.accessor)||m.push(s.accessor)}),m}function n(c,D){let m=[];return c.forEach(s=>{D.find(C=>C.accessor===s.accessor)&&m.push(s)}),D.forEach(s=>{m.find(C=>C.accessor===s.accessor)||m.push({accessor:s.accessor,defaultToggle:s.defaultToggle||!0,toggleable:s.toggleable,toggled:s.defaultToggle===void 0?!0:s.defaultToggle})}),m}function l(c,D){let m=[];return c.forEach(s=>{let C=Object.keys(s)[0];D.find(b=>b.accessor===C)&&m.push(s)}),D.forEach(s=>{let C=s.accessor;if(!m.find(b=>Object.keys(b)[0]===C)){let b={};b[C]="",m.push(b)}}),m}function r(){let[c,D]=tt({key:e?`${e}-columns-order`:"",defaultValue:e?u:void 0,getInitialValueInEffect:o});function m(b){e&&D(b)}if(!e)return[c,m];let s=a(c,t),C=JSON.stringify(c);return JSON.stringify(s)!==C&&m(s),[s,m]}function i(){let[c,D]=tt({key:e?`${e}-columns-toggle`:"",defaultValue:e?p:void 0,getInitialValueInEffect:o});function m(b){e&&D(b)}if(!e)return[c,m];let s=n(c,t),C=JSON.stringify(c);return JSON.stringify(s)!==C&&m(s),[n(c,t),m]}function d(){let[c,D]=tt({key:e?`${e}-columns-width`:"",defaultValue:e?f:void 0,getInitialValueInEffect:o});function m(b){e&&D(b)}if(!e)return[c,m];let s=l(c,t),C=JSON.stringify(c);return JSON.stringify(s)!==C&&m(s),[l(c,t),m]}let u=t&&t.map(c=>c.accessor)||[],f=t&&t.map(c=>({[c.accessor]:c.width??"initial"}))||[],p=t&&t.map(c=>({accessor:c.accessor,defaultToggle:c.defaultToggle||!0,toggleable:c.toggleable,toggled:c.defaultToggle===void 0?!0:c.defaultToggle})),[T,g]=r(),[h,x]=i(),[S,w]=d(),v=()=>g(u),P=()=>{x(p)},M=()=>w(f);return{effectiveColumns:Ka(()=>T?T.map(m=>t.find(s=>s.accessor===m)).map(m=>({...m,hidden:!h.find(s=>s.accessor===m?.accessor)?.toggled})).map(m=>({...m,width:S.find(s=>s[m?.accessor])?.[m?.accessor]})):t,[t,T,h,S]),setColumnsOrder:g,columnsOrder:T,resetColumnsOrder:v,columnsToggle:h,setColumnsToggle:x,resetColumnsToggle:P,columnsWidth:S,setColumnsWidth:w,setColumnWidth:(c,D)=>{let m=S.map(s=>s[c]?{[c]:D}:s);w(m)},resetColumnsWidth:M}};import{useResizeObserver as Ja}from"@mantine/hooks";function ae(){let[e]=Ja(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}import{useEffect as Za,useLayoutEffect as Ya}from"react";var It=typeof window<"u"?Ya:Za;import{useEffect as qa,useState as ja}from"react";function Ht(e){let[t,o]=ja(null),a=e?.join(":")||"";return qa(()=>{o(null)},[a]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}import{useEffect as en,useRef as tn,useState as on}from"react";function an(e,t){let o=()=>{t(e.map(n=>n.matches))},a=e.map(n=>{try{return n.addEventListener("change",o),()=>n.removeEventListener("change",o)}catch{return n.addListener(o),()=>n.removeListener(o)}});return()=>{a.forEach(n=>n())}}function nn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function Ot(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[a,n]=on(o?t:nn(e,t)),l=tn();return en(()=>{if("matchMedia"in window)return l.current=e.map(r=>window.matchMedia(r)),n(l.current.map(r=>r.matches)),an(l.current,r=>{n(r)})},[e]),a}import{useMantineTheme as rn}from"@mantine/core";import{useMemo as Wt}from"react";function At(e){let t=rn(),o=Wt(()=>e.map(n=>(typeof n=="function"?n(t):n)??""),[e,t]),a=Wt(()=>e.map(()=>!0),[e]);return Ot(o,a)}import{useMantineTheme as ln}from"@mantine/core";import{useMediaQuery as sn}from"@mantine/hooks";function U(e){let t=ln(),o=typeof e=="function"?e(t):e;return sn(o||"",!0)}import{useState as dn}from"react";function de(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 zt(e,t,o){return e.filter(a=>!t.map(o).includes(o(a)))}function Ee(e,t){return e.filter((o,a,n)=>a===n.findIndex(l=>t(o)===t(l)))}function ot(e,t){return t?t.match(/([^[.\]])+/g).reduce((a,n)=>a&&a[n],e):void 0}function L(e,t){return typeof t=="string"?ot(e,t):t(e)}function Vt({rowExpansion:e,records:t,idAccessor:o}){let a=[];if(e&&t){let{trigger:i,allowMultiple:d,initiallyExpanded:u}=e;t&&i==="always"?a=t.map(f=>L(f,o)):u&&(a=t.filter((f,p)=>u({record:f,index:p})).map(f=>L(f,o)),d||(a=[a[0]]))}let n,l,r=dn(a);if(e){let{expandable:i,trigger:d,allowMultiple:u,collapseProps:f,content:p}=e;e.expanded?{recordIds:n,onRecordIdsChange:l}=e.expanded:[n,l]=r;let T=g=>l?.(n.filter(h=>h!==L(g,o)));return{expandOnClick:d!=="always"&&d!=="never",isRowExpanded:g=>d==="always"?!0:n.includes(L(g,o)),isExpandable:({record:g,index:h})=>i?i({record:g,index:h}):!0,expandRow:g=>{let h=L(g,o);l?.(u?[...n,h]:[h])},collapseRow:T,collapseProps:f,content:({record:g,index:h})=>()=>p({record:g,index:h,collapse:()=>T(g)})}}}import{useTimeout as _t}from"@mantine/hooks";import{useEffect as cn,useState as Ft}from"react";function Bt(e,t){let[o,a]=Ft(e),[n,l]=Ft(e),r=_t(()=>a(!0),0),i=_t(()=>l(!1),t||200);return cn(()=>{e?(i.clear(),l(!0),r.start()):(r.clear(),a(!1),i.start())},[r,i,e]),{expanded:o,visible:n}}var ce="mantine-datatable-nowrap",ue="mantine-datatable-ellipsis",B="mantine-datatable-pointer-cursor",Ne="mantine-datatable-context-menu-cursor",Gt="mantine-datatable-text-selection-disabled",$="mantine-datatable-text-align-left",K="mantine-datatable-text-align-center",J="mantine-datatable-text-align-right";import{jsx as pn}from"react/jsx-runtime";function Xt({className:e,style:t,visibleMediaQuery:o,title:a,noWrap:n,ellipsis:l,textAlign:r,width:i}){return U(o)?pn(un,{className:mn({[ce]:n||l,[ue]:l,[$]:r==="left",[K]:r==="center",[J]:r==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:a}):null}import{TableTh as fn}from"@mantine/core";import{jsx as bn}from"react/jsx-runtime";function Qt({shadowVisible:e}){return bn(fn,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}import{jsx as at,jsxs as yn}from"react/jsx-runtime";var Ut=Dn(function({className:t,style:o,columns:a,defaultColumnProps:n,selectionVisible:l,selectorCellShadowVisible:r,scrollDiff:i},d){let u=i<0;return at(Tn,{ref:d,className:Cn("mantine-datatable-footer",t),style:[{position:u?"relative":"sticky",bottom:hn(u?i:0)},o],children:yn(gn,{children:[l&&at(Qt,{shadowVisible:r}),a.map(({hidden:f,...p})=>{if(f)return null;let{accessor:T,visibleMediaQuery:g,textAlign:h,width:x,footer:S,footerClassName:w,footerStyle:v,noWrap:P,ellipsis:M}={...n,...p};return at(Xt,{className:w,style:v,visibleMediaQuery:g,textAlign:h,width:x,title:S,noWrap:P,ellipsis:M},T)})]})})});import{Checkbox as qn,Group as jn,Popover as er,PopoverDropdown as tr,PopoverTarget as or,Stack as ar,TableThead as nr,TableTr as co}from"@mantine/core";import rr from"clsx";import{forwardRef as lr,useState as ir}from"react";import{TableTh as Sn}from"@mantine/core";import wn from"clsx";import{useMemo as $t}from"react";import{jsx as Pn}from"react/jsx-runtime";function Kt({group:{id:e,columns:t,title:o,textAlign:a,className:n,style:l}}){let r=$t(()=>t.map(({visibleMediaQuery:u})=>u),[t]),i=At(r),d=$t(()=>t.filter(({hidden:u},f)=>!u&&i?.[f]).length,[t,i]);return d>0?Pn(Sn,{colSpan:d,className:wn("mantine-datatable-column-group-header-cell",{[$]:a==="left",[K]:a==="center",[J]:a==="right"},n),style:l,children:o??de(e)}):null}import{ActionIcon as ro,Box as Fn,Center as Oe,Flex as Bn,Group as Gn,TableTh as Xn}from"@mantine/core";import We from"clsx";import{useRef as Qn,useState as Un}from"react";import{ActionIcon as Mn,Popover as Rn,PopoverDropdown as kn,PopoverTarget as En}from"@mantine/core";import{useDisclosure as Nn}from"@mantine/hooks";import{jsx as Jt,jsxs as vn}from"react/jsx-runtime";function Zt(){return vn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Jt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Jt("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"})]})}import{jsx as Yt,jsxs as xn}from"react/jsx-runtime";function qt(){return xn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Yt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Yt("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"})]})}import{jsx as Le,jsxs as Ln}from"react/jsx-runtime";function jt({children:e,isActive:t}){let[o,{close:a,toggle:n}]=Nn(!1);return Ln(Rn,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:a,trapFocus:!0,children:[Le(En,{children:Le(Mn,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:r=>{r.preventDefault(),n()},children:Le(t?qt:Zt,{})})}),Le(kn,{onClick:r=>r.stopPropagation(),children:typeof e=="function"?e({close:a}):e})]})}import{rem as In}from"@mantine/core";import{useRef as Hn,useState as On}from"react";import{jsx as Wn}from"react/jsx-runtime";var eo=e=>{let{accessor:t,columnRef:o}=e,a=Hn(null),[n,l]=On(0),{setColumnWidth:r}=se(),i=p=>{p.preventDefault(),p.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",u),document.body.style.cursor="col-resize"},d=p=>{if(!o.current)return;let T=p.clientX-o.current.getBoundingClientRect().right,h=`${o.current.getBoundingClientRect().width+T}px`;o.current.style.width=h,r(t,o.current.style.width),l(-T)},u=()=>{o.current&&(document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u),document.body.style.cursor="initial",r(t,o.current.style.width),l(0))};return Wn("div",{ref:a,onClick:p=>p.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",r(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:In(n)}})};import{jsx as Ie,jsxs as An}from"react/jsx-runtime";function to(){return An("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Ie("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Ie("path",{d:"M12 5l0 14"}),Ie("path",{d:"M16 9l-4 -4"}),Ie("path",{d:"M8 9l4 -4"})]})}import{jsx as He,jsxs as zn}from"react/jsx-runtime";function oo(){return zn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[He("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),He("path",{d:"M8 7l4 -4l4 4"}),He("path",{d:"M8 17l4 4l4 -4"}),He("path",{d:"M12 3l0 18"})]})}import{jsx as ne,jsxs as Vn}from"react/jsx-runtime";function ao(){return Vn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ne("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}import{jsx as nt,jsxs as _n}from"react/jsx-runtime";function no(){return _n("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[nt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),nt("path",{d:"M18 6l-12 12"}),nt("path",{d:"M6 6l12 12"})]})}import{Fragment as $n,jsx as O,jsxs as rt}from"react/jsx-runtime";function lo({className:e,style:t,accessor:o,visibleMediaQuery:a,title:n,sortable:l,draggable:r,toggleable:i,resizable:d,sortIcons:u,textAlign:f,width:p,sortStatus:T,onSortStatusChange:g,filter:h,filtering:x,sortKey:S}){let{setSourceColumn:w,setTargetColumn:v,swapColumns:P,setColumnsToggle:M}=se(),[I,E]=Un(!1),c=Qn(null);if(!U(a))return null;let D=n??de(o),m=typeof D=="string"?D:void 0,s=l&&g?N=>{N?.defaultPrevented||g({sortKey:S,columnAccessor:o,direction:T?.columnAccessor===o?T.direction==="asc"?"desc":"asc":T?.direction??"asc"})}:void 0,C=N=>{N.stopPropagation(),w(o),E(!1)},b=N=>{N.preventDefault(),v(o),E(!0)},k=()=>{v(o),E(!1),P()},H=()=>{E(!0)},A=()=>{E(!1)},F=N=>{N.stopPropagation(),M(Y=>Y.map(G=>G.accessor===o?{...G,toggled:!1}:G))};return rt(Xn,{className:We({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":d},e),style:[{width:p,...d?{minWidth:"1px"}:{minWidth:p,maxWidth:p}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:s,onKeyDown:N=>N.key==="Enter"&&s?.(),ref:c,children:[rt(Gn,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[rt(Bn,{align:"center",w:"100%",className:We({"mantine-datatable-header-cell-draggable":r,"mantine-datatable-header-cell-drag-over":I}),draggable:r,onDragStart:r?C:void 0,onDragEnter:r?H:void 0,onDragOver:r?b:void 0,onDrop:r?k:void 0,onDragLeave:r?A:void 0,children:[r?O(Oe,{role:"img","aria-label":"Drag column",children:O(ro,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:N=>{N.stopPropagation()},children:O(ao,{})})}):null,O(Fn,{className:We("mantine-datatable-header-cell-sortable-text",{[$]:f==="left",[K]:f==="center",[J]:f==="right"},ce,ue),title:m,children:D})]}),i?O(Oe,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:O(ro,{size:"xs",variant:"light",onClick:F,children:O(no,{})})}):null,l||T?.columnAccessor===o?O($n,{children:T?.columnAccessor===o?O(Oe,{className:We("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":T.direction==="desc"}),role:"img","aria-label":`Sorted ${T.direction==="desc"?"descending":"ascending"}`,children:u?.sorted||O(to,{})}):O(Oe,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:u?.unsorted||O(oo,{})})}):null,h?O(jt,{isActive:!!x,children:h}):null]}),d?O(eo,{accessor:o,columnRef:c}):null]})}import{Checkbox as Kn,TableTh as Jn}from"@mantine/core";import Zn from"clsx";import{forwardRef as Yn}from"react";import{jsx as io}from"react/jsx-runtime";var so=Yn(function({className:t,style:o,trigger:a,shadowVisible:n,checked:l,indeterminate:r,checkboxProps:i,onChange:d,rowSpan:u},f){let p=!i.disabled;return io(Jn,{ref:f,className:Zn("mantine-datatable-header-selector-cell",{[B]:a==="cell"&&p},t),style:o,rowSpan:u,"data-shadow-visible":n||void 0,onClick:a==="cell"&&p?d:void 0,children:io(Kn,{classNames:p?{input:B}:void 0,checked:l,indeterminate:r,onChange:d,...i,disabled:!(d||i.onChange)||i.disabled})})});import{jsx as Z,jsxs as Ae}from"react/jsx-runtime";var uo=lr(function({selectionColumnHeaderRef:t,className:o,style:a,sortStatus:n,sortIcons:l,onSortStatusChange:r,columns:i,defaultColumnProps:d,groups:u,selectionTrigger:f,selectionVisible:p,selectionChecked:T,selectionIndeterminate:g,onSelectionChange:h,selectionCheckboxProps:x,selectorCellShadowVisible:S,selectionColumnClassName:w,selectionColumnStyle:v},P){let M=p?Z(so,{ref:t,className:w,style:v,trigger:f,shadowVisible:S,checked:T,indeterminate:g,checkboxProps:x,onChange:h,rowSpan:u?2:void 0}):null,{columnsToggle:I,setColumnsToggle:E}=se(),[c,D]=ir(!1),m=i.some(b=>b.toggleable),s=m?Object.fromEntries(i.map(({accessor:b,title:k})=>[b,k??de(String(b))])):void 0,C=Ae(nr,{className:rr("mantine-datatable-header",o),style:a,ref:P,onContextMenu:m?b=>{b.preventDefault(),D(k=>!k)}:void 0,children:[u&&Ae(co,{children:[M,u.map(b=>Z(Kt,{group:b},b.id))]}),Ae(co,{children:[!u&&M,i.map(({hidden:b,...k},H)=>{if(b)return null;let{accessor:A,visibleMediaQuery:F,textAlign:N,width:Y,title:G,sortable:me,draggable:q,toggleable:pe,resizable:fe,titleClassName:X,titleStyle:Ge,filter:Xe,filtering:Qe,sortKey:Ue}={...d,...k};return Z(lo,{accessor:A,className:X,style:Ge,visibleMediaQuery:F,textAlign:N,width:Y,title:G,sortable:me,draggable:q,toggleable:pe,resizable:fe&&H<i.length-1,sortStatus:n,sortIcons:l,sortKey:Ue,onSortStatusChange:r,filter:Xe,filtering:Qe},A)})]})]});return m?Ae(er,{position:"bottom",withArrow:!0,shadow:"md",opened:c,onChange:D,children:[Z(or,{children:C}),Z(tr,{children:Z(ar,{children:I.filter(b=>b.toggleable).map(b=>Z(jn,{children:Z(qn,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:s[b.accessor],checked:b.toggled,onChange:k=>{E(I.map(H=>H.accessor===b.accessor?{...H,toggled:k.currentTarget.checked}:H))}})},b.accessor))})})]}):C});import{Center as sr,Loader as dr}from"@mantine/core";import cr from"clsx";import{jsx as mo}from"react/jsx-runtime";function po({pt:e,pb:t,fetching:o,customContent:a,backgroundBlur:n,size:l,type:r,color:i}){return mo(sr,{pt:e,pb:t,className:cr("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:n?`blur(${n}px)`:void 0}],children:o&&(a||mo(dr,{size:l,type:r,color:i}))})}import{Box as Dr,Pagination as yr,Text as Sr,rem as wr}from"@mantine/core";import yo from"clsx";import{forwardRef as Pr}from"react";import{Button as pr,Group as fr,Menu as br,MenuDropdown as Tr,MenuItem as gr,MenuTarget as hr,Text as go,rem as Se}from"@mantine/core";import Cr from"clsx";import{parseThemeColor as ur}from"@mantine/core";function R(e,t,o){return e?ur({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function fo({theme:e,c:t,backgroundColor:o,borderColor:a,rowBorderColor:n,stripedColor:l,highlightOnHoverColor:r}){return{"--mantine-datatable-color-light":R(t,e,"light"),"--mantine-datatable-color-dark":R(t,e,"dark"),"--mantine-datatable-background-color-light":R(o,e,"light"),"--mantine-datatable-background-color-dark":R(o,e,"dark"),"--mantine-datatable-border-color-light":R(a,e,"light"),"--mantine-datatable-border-color-dark":R(a,e,"dark"),"--mantine-datatable-row-border-color-light":R(n,e,"light"),"--mantine-datatable-row-border-color-dark":R(n,e,"dark"),"--mantine-datatable-striped-color-light":R(l,e,"light"),"--mantine-datatable-striped-color-dark":R(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":R(r,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":R(r,e,"dark")}}function ze({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":R(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":R(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":R(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":R(o,e,"dark")}}function bo({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":R(t,e,"light"),"--mantine-datatable-row-color-dark":R(t,e,"dark"),"--mantine-datatable-row-background-color-light":R(o,e,"light"),"--mantine-datatable-row-background-color-dark":R(o,e,"dark")}}import{jsx as lt,jsxs as mr}from"react/jsx-runtime";function To(){return mr("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[lt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),lt("path",{d:"M8 9l4 -4l4 4"}),lt("path",{d:"M16 15l-4 4l-4 -4"})]})}import{jsx as re,jsxs as Co}from"react/jsx-runtime";var ho={xs:Se(22),sm:Se(26),md:Se(32),lg:Se(38),xl:Se(44)};function Do({size:e,label:t,values:o,value:a,activeTextColor:n,activeBackgroundColor:l,onChange:r}){return Co(fr,{gap:"xs",children:[re(go,{component:"div",size:e,children:t}),Co(br,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[re(hr,{children:re(pr,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:re(To,{}),style:[{fontWeight:"normal"},i=>({height:ho[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:a})}),re(Tr,{children:o.map(i=>{let d=i===a;return re(gr,{className:Cr({"mantine-datatable-page-size-selector-active":d}),style:[{height:ho[e]},d&&(n||l)?u=>ze({theme:u,paginationActiveTextColor:n,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>r(i),children:re(go,{component:"div",size:e,children:i})},i)})})]})]})}import{jsx as it,jsxs as vr}from"react/jsx-runtime";var So=Pr(function({className:t,style:o,fetching:a,page:n,onPageChange:l,paginationWithEdges:r,paginationWithControls:i,paginationActiveTextColor:d,paginationActiveBackgroundColor:u,paginationSize:f,loadingText:p,noRecordsText:T,paginationText:g,totalRecords:h,recordsPerPage:x,onRecordsPerPageChange:S,recordsPerPageLabel:w,recordsPerPageOptions:v,recordsLength:P,horizontalSpacing:M,paginationWrapBreakpoint:I,getPaginationControlProps:E},c){let D;if(a)D=p;else if(!h)D=T;else{let s=(n-1)*x+1,C=s+P-1;D=g({from:s,to:C,totalRecords:h})}let m=U(({breakpoints:s})=>`(min-width: ${typeof I=="number"?`${wr(I)}rem`:s[I]||I})`);return vr(Dr,{ref:c,px:M??"xs",py:"xs",className:yo("mantine-datatable-pagination",t),style:[{flexDirection:m?"row":"column"},o],children:[it(Sr,{component:"div",className:"mantine-datatable-pagination-text",size:f,children:D}),v&&it(Do,{activeTextColor:d,activeBackgroundColor:u,size:f,label:w,values:v,value:x,onChange:S}),it(yr,{classNames:{root:yo("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":a||!P}),control:"mantine-datatable-pagination-pages-control"},style:d||u?s=>ze({theme:s,paginationActiveTextColor:d,paginationActiveBackgroundColor:u}):void 0,withEdges:r,withControls:i,value:n,onChange:l,size:f,total:Math.ceil(h/x),getControlProps:E})]})});import{TableTr as Wr}from"@mantine/core";import Ar from"clsx";import{TableTd as xr}from"@mantine/core";import Mr from"clsx";import{jsx as Rr}from"react/jsx-runtime";function wo({className:e,style:t,visibleMediaQuery:o,record:a,index:n,onClick:l,onDoubleClick:r,onContextMenu:i,noWrap:d,ellipsis:u,textAlign:f,width:p,accessor:T,render:g,defaultRender:h,customCellAttributes:x}){return U(o)?Rr(xr,{className:Mr({[ce]:d||u,[ue]:u,[B]:l||r,[Ne]:i,[$]:f==="left",[K]:f==="center",[J]:f==="right"},e),style:[{width:p,minWidth:p,maxWidth:p},t],onClick:l,onDoubleClick:r,onContextMenu:i,...x?.(a,n),children:g?g(a,n):h?h(a,n,T):ot(a,T)}):null}import{Collapse as kr,TableTd as Er,TableTr as Po}from"@mantine/core";import{Fragment as Nr,jsx as we,jsxs as Lr}from"react/jsx-runtime";function vo({open:e,colSpan:t,content:o,collapseProps:a}){let{expanded:n,visible:l}=Bt(e,a?.transitionDuration);return l?Lr(Nr,{children:[we(Po,{}),we(Po,{children:we(Er,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:we(kr,{in:n,...a,children:we("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}import{Checkbox as Ir,TableTd as Hr}from"@mantine/core";import Or from"clsx";import{jsx as xo}from"react/jsx-runtime";function Mo({className:e,style:t,record:o,index:a,trigger:n,onChange:l,withRightShadow:r,checkboxProps:i,getCheckboxProps:d,...u}){let f={...i,...d(o,a)},p=!u.disabled&&!f.disabled,T=g=>{g.stopPropagation(),n==="cell"&&p&&l?.(g)};return xo(Hr,{className:Or("mantine-datatable-row-selector-cell",{[B]:n==="cell"&&p},e),style:t,"data-shadow-visible":r||void 0,onClick:T,children:xo(Ir,{classNames:p?{input:B}:void 0,onChange:l,...u,...f})})}import{Fragment as zr,jsx as st,jsxs as Ro}from"react/jsx-runtime";function ko({record:e,index:t,columns:o,defaultColumnProps:a,defaultColumnRender:n,selectionTrigger:l,selectionVisible:r,selectionChecked:i,onSelectionChange:d,isRecordSelectable:u,selectionCheckboxProps:f,getSelectionCheckboxProps:p,onClick:T,onDoubleClick:g,onContextMenu:h,onCellClick:x,onCellDoubleClick:S,onCellContextMenu:w,expansion:v,customAttributes:P,color:M,backgroundColor:I,className:E,style:c,selectorCellShadowVisible:D,selectionColumnClassName:m,selectionColumnStyle:s}){return Ro(zr,{children:[Ro(Wr,{className:Ar("mantine-datatable-row",{[B]:T||g||v?.isExpandable({record:e,index:t})&&v?.expandOnClick},{[Ne]:h},typeof E=="function"?E(e,t):E),"data-selected":i||void 0,onClick:C=>{if(v){let{isExpandable:b,isRowExpanded:k,expandOnClick:H,expandRow:A,collapseRow:F}=v;b({record:e,index:t})&&H&&(k(e)?F(e):A(e))}T?.({event:C,record:e,index:t})},onDoubleClick:g?C=>g({event:C,record:e,index:t}):void 0,onContextMenu:h?C=>h({event:C,record:e,index:t}):void 0,style:[M||I?C=>{let b=M?.(e,t),k=I?.(e,t);return bo({theme:C,color:b,backgroundColor:k})}:void 0,c?.(e,t)],...P?.(e,t),children:[r&&st(Mo,{className:m,style:s,record:e,index:t,trigger:l,withRightShadow:D,checked:i,disabled:!d||(u?!u(e,t):!1),onChange:d,checkboxProps:f,getCheckboxProps:p}),o.map(({hidden:C,...b},k)=>{if(C)return null;let{accessor:H,visibleMediaQuery:A,textAlign:F,noWrap:N,ellipsis:Y,width:G,render:me,cellsClassName:q,cellsStyle:pe,customCellAttributes:fe}={...a,...b};return st(wo,{className:typeof q=="function"?q(e,t):q,style:pe?.(e,t),visibleMediaQuery:A,record:e,index:t,onClick:x?X=>x({event:X,record:e,index:t,column:b,columnIndex:k}):void 0,onDoubleClick:S?X=>S({event:X,record:e,index:t,column:b,columnIndex:k}):void 0,onContextMenu:w?X=>w({event:X,record:e,index:t,column:b,columnIndex:k}):void 0,accessor:H,textAlign:F,noWrap:N,ellipsis:Y,width:G,render:me,defaultRender:n,customCellAttributes:fe},H)})]}),v&&st(vo,{colSpan:o.filter(({hidden:C})=>!C).length+(r?1:0),open:v.isRowExpanded(e),content:v.content({record:e,index:t}),collapseProps:v.collapseProps})]})}import{Box as Eo,ScrollArea as Vr,rem as No}from"@mantine/core";import Ve from"clsx";import{jsx as _e,jsxs as _r}from"react/jsx-runtime";function Lo({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:a,rightShadowBehind:n,bottomShadowVisible:l,headerHeight:r,footerHeight:i,onScrollPositionChange:d,children:u,viewportRef:f,scrollAreaProps:p}){return _r(Vr,{...p,viewportRef:f,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:[u,_e(Eo,{className:Ve("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:r?No(r):0}}),_e("div",{className:Ve("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})}),_e("div",{className:Ve("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":a,"mantine-datatable-scroll-area-shadow-behind":n})}),_e(Eo,{className:Ve("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:i?No(i+1):0}})]})}import{jsx as _,jsxs as Oo}from"react/jsx-runtime";function Qr({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:a="100%",minHeight:n,maxHeight:l,shadow:r,verticalAlign:i="center",fetching:d,columns:u,storeColumnsKey:f,groups:p,pinFirstColumn:T,pinLastColumn:g,defaultColumnProps:h,defaultColumnRender:x,idAccessor:S="id",records:w,selectionTrigger:v="checkbox",selectedRecords:P,onSelectedRecordsChange:M,selectionColumnClassName:I,selectionColumnStyle:E,isRecordSelectable:c,selectionCheckboxProps:D,allRecordsSelectionCheckboxProps:m={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:s=(W,j)=>({"aria-label":`Select record ${j+1}`}),sortStatus:C,sortIcons:b,onSortStatusChange:k,horizontalSpacing:H,page:A,onPageChange:F,totalRecords:N,recordsPerPage:Y,onRecordsPerPageChange:G,recordsPerPageOptions:me,recordsPerPageLabel:q="Records per page",paginationWithEdges:pe,paginationWithControls:fe,paginationActiveTextColor:X,paginationActiveBackgroundColor:Ge,paginationSize:Xe="sm",paginationText:Qe=({from:W,to:j,totalRecords:ee})=>`${W} - ${j} / ${ee}`,paginationWrapBreakpoint:Ue="sm",getPaginationControlProps:Wo=W=>W==="previous"?{"aria-label":"Previous page"}:W==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Ao,customLoader:zo,loaderSize:Vo,loaderType:_o,loaderColor:Fo,loadingText:Bo="...",emptyState:Go,noRecordsText:dt="No records",noRecordsIcon:Xo,highlightOnHover:Qo,striped:Uo,noHeader:$o,onRowClick:Ko,onRowDoubleClick:Jo,onRowContextMenu:Zo,onCellClick:Yo,onCellDoubleClick:qo,onCellContextMenu:jo,onScroll:ct,onScrollToTop:ut,onScrollToBottom:mt,onScrollToLeft:pt,onScrollToRight:ft,c:ea,backgroundColor:ta,borderColor:oa,rowBorderColor:aa,stripedColor:na,highlightOnHoverColor:ra,rowColor:la,rowBackgroundColor:ia,rowExpansion:sa,rowClassName:da,rowStyle:ca,customRowAttributes:ua,scrollViewportRef:ma,scrollAreaProps:pa,tableRef:fa,bodyRef:ba,m:Ta,my:ga,mx:ha,mt:Ca,mb:Da,ml:ya,mr:Sa,className:wa,classNames:be,style:Pa,styles:Te,...bt}){let{ref:W,width:j,height:ee}=ae(),ge=Xr(()=>p?.flatMap(y=>y.columns)??u,[u,p]),Tt=Lt({key:f,columns:ge}),{ref:va,height:$e}=ae(),{ref:xa,width:Ke,height:he}=ae(),{ref:Ma,height:Ra}=ae(),{ref:ka,height:gt}=ae(),{ref:Ea,width:Na}=ae(),La=Io(xa,fa),Ia=Io(W,ma),[Je,ht]=Be(!0),[Ze,Ct]=Be(!0),[Ce,Dt]=Be(!0),[Pe,yt]=Be(!0),Ha=Vt({rowExpansion:sa,records:w,idAccessor:S}),Ye=Fe(()=>{let y=W.current?.scrollTop||0,Q=W.current?.scrollLeft||0;if(d||he<=ee)ht(!0),Ct(!0);else{let z=y===0,V=he-y-ee<1;ht(z),Ct(V),z&&z!==Je&&ut?.(),V&&V!==Ze&&mt?.()}if(d||Ke===j)Dt(!0),yt(!0);else{let z=Q===0,V=Ke-Q-j<1;Dt(z),yt(V),z&&z!==Ce&&pt?.(),V&&V!==Pe&&ft?.()}},[d,mt,pt,ft,ut,ee,W,j,Ze,Ce,Pe,Je,he,Ke]);It(Ye,[Ye]);let St=Gr(Ye,50),Oa=Fe(y=>{ct?.(y),St()},[St,ct]),Wa=Fe(y=>{W.current?.scrollTo({top:0,left:0}),F(y)},[F,W]),ve=w?.length,wt=w?.map(y=>L(y,S)),le=!!P,De=P?.map(y=>L(y,S)),Pt=wt!==void 0&&De!==void 0&&De.length>0,qe=c?w?.filter(c):w,xe=qe?.map(y=>L(y,S)),Me=Pt&&xe.every(y=>De.includes(y)),Aa=Pt&&xe.some(y=>De.includes(y)),za=Fe(()=>{P&&M&&M(Me?P.filter(y=>!xe.includes(L(y,S))):Ee([...P,...qe],y=>L(y,S)))},[Me,S,M,xe,qe,P]),{lastSelectionChangeIndex:Re,setLastSelectionChangeIndex:Va}=Ht(wt),je=le&&!Ce&&!T;return _(et,{...Tt,children:Oo(Fr,{...{m:Ta,my:ga,mx:ha,mt:Ca,mb:Da,ml:ya,mr:Sa},className:Ho("mantine-datatable",{"mantine-datatable-with-border":e},wa,be?.root),style:[y=>({...fo({theme:y,c:ea,backgroundColor:ta,borderColor:oa,rowBorderColor:aa,stripedColor:na,highlightOnHoverColor:ra}),borderRadius:y.radius[t]||t,boxShadow:y.shadows[r]||r,height:a,minHeight:n,maxHeight:l}),Pa,Te?.root],children:[_(Lo,{viewportRef:Ia,topShadowVisible:!Je,leftShadowVisible:!Ce,leftShadowBehind:le||!!T,rightShadowVisible:!Pe,rightShadowBehind:g,bottomShadowVisible:!Ze,headerHeight:$e,footerHeight:Ra,onScrollPositionChange:Oa,scrollAreaProps:pa,children:Oo(Br,{ref:La,horizontalSpacing:H,className:Ho("mantine-datatable-table",{[Gt]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":bt.withRowBorders&&he<ee,"mantine-datatable-pin-last-column":g,"mantine-datatable-pin-last-column-scrolled":!Pe&&g,"mantine-datatable-selection-column-visible":le,"mantine-datatable-pin-first-column":T,"mantine-datatable-pin-first-column-scrolled":!Ce&&T},be?.table),style:{...Te?.table,"--mantine-datatable-selection-column-width":`${Na}px`},"data-striped":ve&&Uo||void 0,"data-highlight-on-hover":Qo||void 0,...bt,children:[$o?null:_(et,{...Tt,children:_(uo,{ref:va,selectionColumnHeaderRef:Ea,className:be?.header,style:Te?.header,columns:ge,defaultColumnProps:h,groups:p,sortStatus:C,sortIcons:b,onSortStatusChange:k,selectionTrigger:v,selectionVisible:le,selectionChecked:Me,selectionIndeterminate:Aa&&!Me,onSelectionChange:za,selectionCheckboxProps:{...D,...m},selectorCellShadowVisible:je,selectionColumnClassName:I,selectionColumnStyle:E})}),_("tbody",{ref:ba,children:ve?w.map((y,Q)=>{let z=L(y,S),V=De?.includes(z)||!1,vt;return M&&P&&(vt=_a=>{if(_a.nativeEvent.shiftKey&&Re!==null){let ie=w.filter(Q>Re?(te,oe)=>oe>=Re&&oe<=Q&&(c?c(te,oe):!0):(te,oe)=>oe>=Q&&oe<=Re&&(c?c(te,oe):!0));M(V?zt(P,ie,te=>L(te,S)):Ee([...P,...ie],te=>L(te,S)))}else M(V?P.filter(ie=>L(ie,S)!==z):Ee([...P,y],ie=>L(ie,S)));Va(Q)}),_(ko,{record:y,index:Q,columns:ge,defaultColumnProps:h,defaultColumnRender:x,selectionTrigger:v,selectionVisible:le,selectionChecked:V,onSelectionChange:vt,isRecordSelectable:c,selectionCheckboxProps:D,getSelectionCheckboxProps:s,onClick:Ko,onDoubleClick:Jo,onCellClick:Yo,onCellDoubleClick:qo,onContextMenu:Zo,onCellContextMenu:jo,expansion:Ha,color:la,backgroundColor:ia,className:da,style:ca,customAttributes:ua,selectorCellShadowVisible:je,selectionColumnClassName:I,selectionColumnStyle:E},z)}):_(kt,{})}),ge.some(({footer:y})=>y)&&_(Ut,{ref:Ma,className:be?.footer,style:Te?.footer,columns:ge,defaultColumnProps:h,selectionVisible:le,selectorCellShadowVisible:je,scrollDiff:he-ee})]})}),A&&_(So,{ref:ka,className:be?.pagination,style:Te?.pagination,horizontalSpacing:H,fetching:d,page:A,onPageChange:Wa,totalRecords:N,recordsPerPage:Y,onRecordsPerPageChange:G,recordsPerPageOptions:me,recordsPerPageLabel:q,paginationWithEdges:pe,paginationWithControls:fe,paginationActiveTextColor:X,paginationActiveBackgroundColor:Ge,paginationSize:Xe,paginationText:Qe,paginationWrapBreakpoint:Ue,getPaginationControlProps:Wo,noRecordsText:dt,loadingText:Bo,recordsLength:ve}),_(po,{pt:$e,pb:gt,fetching:d,backgroundBlur:Ao,customContent:zo,size:Vo,type:_o,color:Fo}),_(Nt,{pt:$e,pb:gt,icon:Xo,text:dt,active:!d&&!ve,children:Go})]})})}export{Qr as DataTable,zt as differenceBy,L as getRecordId,ot as getValueAtPath,de as humanize,Ee as uniqBy,Lt as useDataTableColumns};
1
+ "use client";import{Box as $r,Table as Kr}from"@mantine/core";import{useDebouncedCallback as Jr,useMergedRef as Wo}from"@mantine/hooks";import Ao from"clsx";import{useCallback as Ee,useMemo as Zr,useState as Ke}from"react";import{useState as kt}from"react";import{createSafeContext as $a}from"@mantine/core";var[Mt,se]=$a("useDataTableColumnsContext must be used within DataTableColumnProvider");import{jsx as Ka}from"react/jsx-runtime";var at=e=>{let{children:t,columnsOrder:o,setColumnsOrder:a,columnsToggle:n,setColumnsToggle:r,resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d}=e,[u,b]=kt(""),[m,T]=kt("");return Ka(Mt,{value:{sourceColumn:u,setSourceColumn:b,targetColumn:m,setTargetColumn:T,columnsToggle:n,setColumnsToggle:r,swapColumns:()=>{if(!o||!a||!u||!m)return;let x=o.indexOf(u),D=o.indexOf(m);if(x!==-1&&D!==-1){let S=o.splice(x,1)[0];o.splice(D,0,S),a([...o])}},resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d},children:t})};import{jsx as Et}from"react/jsx-runtime";function Nt(){return Et("tr",{className:"mantine-datatable-empty-row",children:Et("td",{})})}import{Center as Za,Text as Ya}from"@mantine/core";import{jsx as Re,jsxs as Ja}from"react/jsx-runtime";function Lt(){return Ja("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Re("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Re("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"}),Re("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"}),Re("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),Re("path",{d:"M3 3l18 18"})]})}import{Fragment as qa,jsx as We,jsxs as ja}from"react/jsx-runtime";function Ht({icon:e,text:t,pt:o,pb:a,active:n,children:r}){return We(Za,{pt:o,pb:a,className:"mantine-datatable-empty-state","data-active":n||void 0,children:r||ja(qa,{children:[e||We("div",{className:"mantine-datatable-empty-state-icon",children:We(Lt,{})}),We(Ya,{component:"div",size:"sm",c:"dimmed",children:t})]})})}import{TableTfoot as wn,TableTr as Sn,rem as xn}from"@mantine/core";import Pn from"clsx";import{forwardRef as vn}from"react";import{TableTh as gn}from"@mantine/core";import hn from"clsx";import{useLocalStorage as nt}from"@mantine/hooks";import{useMemo as en}from"react";var It=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function a(p,y){let f=[];return p.forEach(c=>{y.find(w=>w.accessor===c)&&f.push(c)}),y.forEach(c=>{f.includes(c.accessor)||f.push(c.accessor)}),f}function n(p,y){let f=[];return p.forEach(c=>{y.find(w=>w.accessor===c.accessor)&&f.push(c)}),y.forEach(c=>{f.find(w=>w.accessor===c.accessor)||f.push({accessor:c.accessor,defaultToggle:c.defaultToggle||!0,toggleable:c.toggleable,toggled:c.defaultToggle===void 0?!0:c.defaultToggle})}),f}function r(p,y){let f=[];return p.forEach(c=>{let w=Object.keys(c)[0];y.find(h=>h.accessor===w)&&f.push(c)}),y.forEach(c=>{let w=c.accessor;if(!f.find(h=>Object.keys(h)[0]===w)){let h={};h[w]="",f.push(h)}}),f}function l(){let[p,y]=nt({key:e?`${e}-columns-order`:"",defaultValue:e?d:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=a(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[c,f]}function i(){let[p,y]=nt({key:e?`${e}-columns-toggle`:"",defaultValue:e?b:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=n(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[n(p,t),f]}function s(){let[p,y]=nt({key:e?`${e}-columns-width`:"",defaultValue:e?u:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=r(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[r(p,t),f]}let d=t&&t.map(p=>p.accessor)||[],u=t&&t.map(p=>({[p.accessor]:p.width??"initial"}))||[],b=t&&t.map(p=>({accessor:p.accessor,defaultToggle:p.defaultToggle||!0,toggleable:p.toggleable,toggled:p.defaultToggle===void 0?!0:p.defaultToggle})),[m,T]=l(),[g,x]=i(),[D,S]=s(),v=()=>T(d),P=()=>{x(b)},k=()=>S(u);return{effectiveColumns:en(()=>m?m.map(f=>t.find(c=>c.accessor===f)).map(f=>({...f,hidden:!g.find(c=>c.accessor===f?.accessor)?.toggled})).map(f=>({...f,width:D.find(c=>c[f?.accessor])?.[f?.accessor]})):t,[t,m,g,D]),setColumnsOrder:T,columnsOrder:m,resetColumnsOrder:v,columnsToggle:g,setColumnsToggle:x,resetColumnsToggle:P,columnsWidth:D,setColumnsWidth:S,setColumnWidth:(p,y)=>{let f=D.map(c=>c[p]?{[p]:y}:c);S(f)},resetColumnsWidth:k}};import{useResizeObserver as tn}from"@mantine/hooks";function ae(){let[e]=tn(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}import{useEffect as on,useLayoutEffect as an}from"react";var Ot=typeof window<"u"?an:on;import{useEffect as nn,useState as rn}from"react";function Wt(e){let[t,o]=rn(null),a=e?.join(":")||"";return nn(()=>{o(null)},[a]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}import{useEffect as ln,useRef as sn,useState as dn}from"react";function cn(e,t){let o=()=>{t(e.map(n=>n.matches))},a=e.map(n=>{try{return n.addEventListener("change",o),()=>n.removeEventListener("change",o)}catch{return n.addListener(o),()=>n.removeListener(o)}});return()=>{a.forEach(n=>n())}}function un(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function At(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[a,n]=dn(o?t:un(e,t)),r=sn();return ln(()=>{if("matchMedia"in window)return r.current=e.map(l=>window.matchMedia(l)),n(r.current.map(l=>l.matches)),cn(r.current,l=>{n(l)})},[e]),a}import{useMantineTheme as mn}from"@mantine/core";import{useMemo as zt}from"react";function Vt(e){let t=mn(),o=zt(()=>e.map(n=>(typeof n=="function"?n(t):n)??""),[e,t]),a=zt(()=>e.map(()=>!0),[e]);return At(o,a)}import{useMantineTheme as pn}from"@mantine/core";import{useMediaQuery as fn}from"@mantine/hooks";function U(e){let t=pn(),o=typeof e=="function"?e(t):e;return fn(o||"",!0)}import{useState as bn}from"react";function de(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 _t(e,t,o){return e.filter(a=>!t.map(o).includes(o(a)))}function Ae(e,t){return e.filter((o,a,n)=>a===n.findIndex(r=>t(o)===t(r)))}function rt(e,t){return t?t.match(/([^[.\]])+/g).reduce((a,n)=>a&&a[n],e):void 0}function E(e,t){return typeof t=="string"?rt(e,t):t(e)}function Wl(e,t){let o=structuredClone(t),a=o[e.source.index];return e.destination&&(o.splice(e.source.index,1),o.splice(e.destination.index,0,a)),o}function Al(e,t){let o=structuredClone(t),a=e.destination;if(!a)return o;let n=o[e.source.index],r=o[a.index];return o.splice(a.index,1,n),o.splice(e.source.index,1,r),o}function Ft({rowExpansion:e,records:t,idAccessor:o}){let a=[];if(e&&t){let{trigger:i,allowMultiple:s,initiallyExpanded:d}=e;t&&i==="always"?a=t.map(u=>E(u,o)):d&&(a=t.filter((u,b)=>d({record:u,index:b})).map(u=>E(u,o)),s||(a=[a[0]]))}let n,r,l=bn(a);if(e){let{expandable:i,trigger:s,allowMultiple:d,collapseProps:u,content:b}=e;e.expanded?{recordIds:n,onRecordIdsChange:r}=e.expanded:[n,r]=l;let m=T=>r?.(n.filter(g=>g!==E(T,o)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:T=>s==="always"?!0:n.includes(E(T,o)),isExpandable:({record:T,index:g})=>i?i({record:T,index:g}):!0,expandRow:T=>{let g=E(T,o);r?.(d?[...n,g]:[g])},collapseRow:m,collapseProps:u,content:({record:T,index:g})=>()=>b({record:T,index:g,collapse:()=>m(T)})}}}import{useTimeout as Bt}from"@mantine/hooks";import{useEffect as Tn,useState as Gt}from"react";function Xt(e,t){let[o,a]=Gt(e),[n,r]=Gt(e),l=Bt(()=>a(!0),0),i=Bt(()=>r(!1),t||200);return Tn(()=>{e?(i.clear(),r(!0),l.start()):(l.clear(),a(!1),i.start())},[l,i,e]),{expanded:o,visible:n}}var ce="mantine-datatable-nowrap",ue="mantine-datatable-ellipsis",B="mantine-datatable-pointer-cursor",ze="mantine-datatable-context-menu-cursor",Qt="mantine-datatable-text-selection-disabled",$="mantine-datatable-text-align-left",K="mantine-datatable-text-align-center",J="mantine-datatable-text-align-right";import{jsx as Cn}from"react/jsx-runtime";function Ut({className:e,style:t,visibleMediaQuery:o,title:a,noWrap:n,ellipsis:r,textAlign:l,width:i}){return U(o)?Cn(gn,{className:hn({[ce]:n||r,[ue]:r,[$]:l==="left",[K]:l==="center",[J]:l==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:a}):null}import{TableTh as Dn}from"@mantine/core";import{jsx as yn}from"react/jsx-runtime";function $t({shadowVisible:e}){return yn(Dn,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}import{jsx as lt,jsxs as Rn}from"react/jsx-runtime";var Kt=vn(function({className:t,style:o,columns:a,defaultColumnProps:n,selectionVisible:r,selectorCellShadowVisible:l,scrollDiff:i},s){let d=i<0;return lt(wn,{ref:s,className:Pn("mantine-datatable-footer",t),style:[{position:d?"relative":"sticky",bottom:xn(d?i:0)},o],children:Rn(Sn,{children:[r&&lt($t,{shadowVisible:l}),a.map(({hidden:u,...b})=>{if(u)return null;let{accessor:m,visibleMediaQuery:T,textAlign:g,width:x,footer:D,footerClassName:S,footerStyle:v,noWrap:P,ellipsis:k}={...n,...b};return lt(Ut,{className:S,style:v,visibleMediaQuery:T,textAlign:g,width:x,title:D,noWrap:P,ellipsis:k},m)})]})})});import{Checkbox as nr,Group as rr,Popover as lr,PopoverDropdown as ir,PopoverTarget as sr,Stack as dr,TableThead as cr,TableTr as mo}from"@mantine/core";import ur from"clsx";import{forwardRef as mr,useState as pr}from"react";import{TableTh as Mn}from"@mantine/core";import kn from"clsx";import{useMemo as Jt}from"react";import{jsx as En}from"react/jsx-runtime";function Zt({group:{id:e,columns:t,title:o,textAlign:a,className:n,style:r}}){let l=Jt(()=>t.map(({visibleMediaQuery:d})=>d),[t]),i=Vt(l),s=Jt(()=>t.filter(({hidden:d},u)=>!d&&i?.[u]).length,[t,i]);return s>0?En(Mn,{colSpan:s,className:kn("mantine-datatable-column-group-header-cell",{[$]:a==="left",[K]:a==="center",[J]:a==="right"},n),style:r,children:o??de(e)}):null}import{ActionIcon as io,Box as $n,Center as Be,Flex as Kn,Group as Jn,TableTh as Zn}from"@mantine/core";import Ge from"clsx";import{useRef as Yn,useState as qn}from"react";import{ActionIcon as Hn,Popover as In,PopoverDropdown as On,PopoverTarget as Wn}from"@mantine/core";import{useDisclosure as An}from"@mantine/hooks";import{jsx as Yt,jsxs as Nn}from"react/jsx-runtime";function qt(){return Nn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Yt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Yt("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"})]})}import{jsx as jt,jsxs as Ln}from"react/jsx-runtime";function eo(){return Ln("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[jt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),jt("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"})]})}import{jsx as Ve,jsxs as zn}from"react/jsx-runtime";function to({children:e,isActive:t}){let[o,{close:a,toggle:n}]=An(!1);return zn(In,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:a,trapFocus:!0,children:[Ve(Wn,{children:Ve(Hn,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:l=>{l.preventDefault(),n()},children:Ve(t?eo:qt,{})})}),Ve(On,{onClick:l=>l.stopPropagation(),children:typeof e=="function"?e({close:a}):e})]})}import{rem as Vn}from"@mantine/core";import{useRef as _n,useState as Fn}from"react";import{jsx as Bn}from"react/jsx-runtime";var oo=e=>{let{accessor:t,columnRef:o}=e,a=_n(null),[n,r]=Fn(0),{setColumnWidth:l}=se(),i=b=>{b.preventDefault(),b.stopPropagation(),document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),document.body.style.cursor="col-resize"},s=b=>{if(!o.current)return;let m=b.clientX-o.current.getBoundingClientRect().right,g=`${o.current.getBoundingClientRect().width+m}px`;o.current.style.width=g,l(t,o.current.style.width),r(-m)},d=()=>{o.current&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),document.body.style.cursor="initial",l(t,o.current.style.width),r(0))};return Bn("div",{ref:a,onClick:b=>b.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",l(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:Vn(n)}})};import{jsx as _e,jsxs as Gn}from"react/jsx-runtime";function ao(){return Gn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[_e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),_e("path",{d:"M12 5l0 14"}),_e("path",{d:"M16 9l-4 -4"}),_e("path",{d:"M8 9l4 -4"})]})}import{jsx as Fe,jsxs as Xn}from"react/jsx-runtime";function no(){return Xn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Fe("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Fe("path",{d:"M8 7l4 -4l4 4"}),Fe("path",{d:"M8 17l4 4l4 -4"}),Fe("path",{d:"M12 3l0 18"})]})}import{jsx as ne,jsxs as Qn}from"react/jsx-runtime";function ro(){return Qn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ne("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),ne("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}import{jsx as it,jsxs as Un}from"react/jsx-runtime";function lo(){return Un("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[it("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),it("path",{d:"M18 6l-12 12"}),it("path",{d:"M6 6l12 12"})]})}import{Fragment as jn,jsx as I,jsxs as st}from"react/jsx-runtime";function so({className:e,style:t,accessor:o,visibleMediaQuery:a,title:n,sortable:r,draggable:l,toggleable:i,resizable:s,sortIcons:d,textAlign:u,width:b,sortStatus:m,onSortStatusChange:T,filter:g,filtering:x,sortKey:D}){let{setSourceColumn:S,setTargetColumn:v,swapColumns:P,setColumnsToggle:k}=se(),[N,L]=qn(!1),p=Yn(null);if(!U(a))return null;let y=n??de(o),f=typeof y=="string"?y:void 0,c=r&&T?R=>{R?.defaultPrevented||T({sortKey:D,columnAccessor:o,direction:m?.columnAccessor===o?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,w=R=>{R.stopPropagation(),S(o),L(!1)},h=R=>{R.preventDefault(),v(o),L(!0)},H=()=>{v(o),L(!1),P()},O=()=>{L(!0)},z=()=>{L(!1)},X=R=>{R.stopPropagation(),k(G=>G.map(F=>F.accessor===o?{...F,toggled:!1}:F))};return st(Zn,{className:Ge({"mantine-datatable-header-cell-sortable":r,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":s},e),style:[{width:b,...s?{minWidth:"1px"}:{minWidth:b,maxWidth:b}},t],role:r?"button":void 0,tabIndex:r?0:void 0,onClick:c,onKeyDown:R=>R.key==="Enter"&&c?.(),ref:p,children:[st(Jn,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[st(Kn,{align:"center",w:"100%",className:Ge({"mantine-datatable-header-cell-draggable":l,"mantine-datatable-header-cell-drag-over":N}),draggable:l,onDragStart:l?w:void 0,onDragEnter:l?O:void 0,onDragOver:l?h:void 0,onDrop:l?H:void 0,onDragLeave:l?z:void 0,children:[l?I(Be,{role:"img","aria-label":"Drag column",children:I(io,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:R=>{R.stopPropagation()},children:I(ro,{})})}):null,I($n,{className:Ge("mantine-datatable-header-cell-sortable-text",{[$]:u==="left",[K]:u==="center",[J]:u==="right"},ce,ue),title:f,children:y})]}),i?I(Be,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:I(io,{size:"xs",variant:"light",onClick:X,children:I(lo,{})})}):null,r||m?.columnAccessor===o?I(jn,{children:m?.columnAccessor===o?I(Be,{className:Ge("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:d?.sorted||I(ao,{})}):I(Be,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:d?.unsorted||I(no,{})})}):null,g?I(to,{isActive:!!x,children:g}):null]}),s?I(oo,{accessor:o,columnRef:p}):null]})}import{Checkbox as er,TableTh as tr}from"@mantine/core";import or from"clsx";import{forwardRef as ar}from"react";import{jsx as co}from"react/jsx-runtime";var uo=ar(function({className:t,style:o,trigger:a,shadowVisible:n,checked:r,indeterminate:l,checkboxProps:i,onChange:s,rowSpan:d},u){let b=!i.disabled;return co(tr,{ref:u,className:or("mantine-datatable-header-selector-cell",{[B]:a==="cell"&&b},t),style:o,rowSpan:d,"data-shadow-visible":n||void 0,onClick:a==="cell"&&b?s:void 0,children:co(er,{classNames:b?{input:B}:void 0,checked:r,indeterminate:l,onChange:s,...i,disabled:!(s||i.onChange)||i.disabled})})});import{jsx as Z,jsxs as Xe}from"react/jsx-runtime";var po=mr(function({selectionColumnHeaderRef:t,className:o,style:a,sortStatus:n,sortIcons:r,onSortStatusChange:l,columns:i,defaultColumnProps:s,groups:d,selectionTrigger:u,selectionVisible:b,selectionChecked:m,selectionIndeterminate:T,onSelectionChange:g,selectionCheckboxProps:x,selectorCellShadowVisible:D,selectionColumnClassName:S,selectionColumnStyle:v},P){let k=b?Z(uo,{ref:t,className:S,style:v,trigger:u,shadowVisible:D,checked:m,indeterminate:T,checkboxProps:x,onChange:g,rowSpan:d?2:void 0}):null,{columnsToggle:N,setColumnsToggle:L}=se(),[p,y]=pr(!1),f=i.some(h=>h.toggleable),c=f?Object.fromEntries(i.map(({accessor:h,title:H})=>[h,H??de(String(h))])):void 0,w=Xe(cr,{className:ur("mantine-datatable-header",o),style:a,ref:P,onContextMenu:f?h=>{h.preventDefault(),y(H=>!H)}:void 0,children:[d&&Xe(mo,{children:[k,d.map(h=>Z(Zt,{group:h},h.id))]}),Xe(mo,{children:[!d&&k,i.map(({hidden:h,...H},O)=>{if(h)return null;let{accessor:z,visibleMediaQuery:X,textAlign:R,width:G,title:F,sortable:pe,draggable:fe,toggleable:be,resizable:Te,titleClassName:ge,titleStyle:he,filter:Y,filtering:Ce,sortKey:De}={...s,...H};return Z(so,{accessor:z,className:ge,style:he,visibleMediaQuery:X,textAlign:R,width:G,title:F,sortable:pe,draggable:fe,toggleable:be,resizable:Te&&O<i.length-1,sortStatus:n,sortIcons:r,sortKey:De,onSortStatusChange:l,filter:Y,filtering:Ce},z)})]})]});return f?Xe(lr,{position:"bottom",withArrow:!0,shadow:"md",opened:p,onChange:y,children:[Z(sr,{children:w}),Z(ir,{children:Z(dr,{children:N.filter(h=>h.toggleable).map(h=>Z(rr,{children:Z(nr,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:c[h.accessor],checked:h.toggled,onChange:H=>{L(N.map(O=>O.accessor===h.accessor?{...O,toggled:H.currentTarget.checked}:O))}})},h.accessor))})})]}):w});import{Center as fr,Loader as br}from"@mantine/core";import Tr from"clsx";import{jsx as fo}from"react/jsx-runtime";function bo({pt:e,pb:t,fetching:o,customContent:a,backgroundBlur:n,size:r,type:l,color:i}){return fo(fr,{pt:e,pb:t,className:Tr("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:n?`blur(${n}px)`:void 0}],children:o&&(a||fo(br,{size:r,type:l,color:i}))})}import{Box as vr,Pagination as Rr,Text as Mr,rem as kr}from"@mantine/core";import So from"clsx";import{forwardRef as Er}from"react";import{Button as Cr,Group as Dr,Menu as yr,MenuDropdown as wr,MenuItem as Sr,MenuTarget as xr,Text as Co,rem as Me}from"@mantine/core";import Pr from"clsx";import{parseThemeColor as gr}from"@mantine/core";function M(e,t,o){return e?gr({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function To({theme:e,c:t,backgroundColor:o,borderColor:a,rowBorderColor:n,stripedColor:r,highlightOnHoverColor:l}){return{"--mantine-datatable-color-light":M(t,e,"light"),"--mantine-datatable-color-dark":M(t,e,"dark"),"--mantine-datatable-background-color-light":M(o,e,"light"),"--mantine-datatable-background-color-dark":M(o,e,"dark"),"--mantine-datatable-border-color-light":M(a,e,"light"),"--mantine-datatable-border-color-dark":M(a,e,"dark"),"--mantine-datatable-row-border-color-light":M(n,e,"light"),"--mantine-datatable-row-border-color-dark":M(n,e,"dark"),"--mantine-datatable-striped-color-light":M(r,e,"light"),"--mantine-datatable-striped-color-dark":M(r,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":M(l,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":M(l,e,"dark")}}function Qe({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":M(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":M(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":M(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":M(o,e,"dark")}}function go({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":M(t,e,"light"),"--mantine-datatable-row-color-dark":M(t,e,"dark"),"--mantine-datatable-row-background-color-light":M(o,e,"light"),"--mantine-datatable-row-background-color-dark":M(o,e,"dark")}}import{jsx as dt,jsxs as hr}from"react/jsx-runtime";function ho(){return hr("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),dt("path",{d:"M8 9l4 -4l4 4"}),dt("path",{d:"M16 15l-4 4l-4 -4"})]})}import{jsx as re,jsxs as yo}from"react/jsx-runtime";var Do={xs:Me(22),sm:Me(26),md:Me(32),lg:Me(38),xl:Me(44)};function wo({size:e,label:t,values:o,value:a,activeTextColor:n,activeBackgroundColor:r,onChange:l}){return yo(Dr,{gap:"xs",children:[re(Co,{component:"div",size:e,children:t}),yo(yr,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[re(xr,{children:re(Cr,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:re(ho,{}),style:[{fontWeight:"normal"},i=>({height:Do[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:a})}),re(wr,{children:o.map(i=>{let s=i===a;return re(Sr,{className:Pr({"mantine-datatable-page-size-selector-active":s}),style:[{height:Do[e]},s&&(n||r)?d=>Qe({theme:d,paginationActiveTextColor:n,paginationActiveBackgroundColor:r}):void 0],disabled:s,onClick:()=>l(i),children:re(Co,{component:"div",size:e,children:i})},i)})})]})]})}import{jsx as ct,jsxs as Nr}from"react/jsx-runtime";var xo=Er(function({className:t,style:o,fetching:a,page:n,onPageChange:r,paginationWithEdges:l,paginationWithControls:i,paginationActiveTextColor:s,paginationActiveBackgroundColor:d,paginationSize:u,loadingText:b,noRecordsText:m,paginationText:T,totalRecords:g,recordsPerPage:x,onRecordsPerPageChange:D,recordsPerPageLabel:S,recordsPerPageOptions:v,recordsLength:P,horizontalSpacing:k,paginationWrapBreakpoint:N,getPaginationControlProps:L},p){let y;if(a)y=b;else if(!g)y=m;else{let c=(n-1)*x+1,w=c+P-1;y=T({from:c,to:w,totalRecords:g})}let f=U(({breakpoints:c})=>`(min-width: ${typeof N=="number"?`${kr(N)}rem`:c[N]||N})`);return Nr(vr,{ref:p,px:k??"xs",py:"xs",className:So("mantine-datatable-pagination",t),style:[{flexDirection:f?"row":"column"},o],children:[ct(Mr,{component:"div",className:"mantine-datatable-pagination-text",size:u,children:y}),v&&ct(wo,{activeTextColor:s,activeBackgroundColor:d,size:u,label:S,values:v,value:x,onChange:D}),ct(Rr,{classNames:{root:So("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":a||!P}),control:"mantine-datatable-pagination-pages-control"},style:s||d?c=>Qe({theme:c,paginationActiveTextColor:s,paginationActiveBackgroundColor:d}):void 0,withEdges:l,withControls:i,value:n,onChange:r,size:u,total:Math.ceil(g/x),getControlProps:L})]})});import{TableTr as Br}from"@mantine/core";import Gr from"clsx";import{TableTd as Lr}from"@mantine/core";import Hr from"clsx";import{jsx as Ir}from"react/jsx-runtime";function Po({className:e,style:t,visibleMediaQuery:o,record:a,index:n,onClick:r,onDoubleClick:l,onContextMenu:i,noWrap:s,ellipsis:d,textAlign:u,width:b,accessor:m,render:T,defaultRender:g,customCellAttributes:x}){return U(o)?Ir(Lr,{className:Hr({[ce]:s||d,[ue]:d,[B]:r||l,[ze]:i,[$]:u==="left",[K]:u==="center",[J]:u==="right"},e),style:[{width:b,minWidth:b,maxWidth:b},t],onClick:r,onDoubleClick:l,onContextMenu:i,...x?.(a,n),children:T?T(a,n):g?g(a,n,m):rt(a,m)}):null}import{Collapse as Or,TableTd as Wr,TableTr as vo}from"@mantine/core";import{Fragment as Ar,jsx as ke,jsxs as zr}from"react/jsx-runtime";function Ro({open:e,colSpan:t,content:o,collapseProps:a}){let{expanded:n,visible:r}=Xt(e,a?.transitionDuration);return r?zr(Ar,{children:[ke(vo,{}),ke(vo,{children:ke(Wr,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:ke(Or,{in:n,...a,children:ke("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}import{Checkbox as Vr,TableTd as _r}from"@mantine/core";import Fr from"clsx";import{jsx as Mo}from"react/jsx-runtime";function ko({className:e,style:t,record:o,index:a,trigger:n,onChange:r,withRightShadow:l,checkboxProps:i,getCheckboxProps:s,...d}){let u={...i,...s(o,a)},b=!d.disabled&&!u.disabled,m=T=>{T.stopPropagation(),n==="cell"&&b&&r?.(T)};return Mo(_r,{className:Fr("mantine-datatable-row-selector-cell",{[B]:n==="cell"&&b},e),style:t,"data-shadow-visible":l||void 0,onClick:m,children:Mo(Vr,{classNames:b?{input:B}:void 0,onChange:r,...d,...u})})}import{Fragment as Eo,jsx as me,jsxs as No}from"react/jsx-runtime";function Lo({record:e,index:t,columns:o,defaultColumnProps:a,defaultColumnRender:n,selectionTrigger:r,selectionVisible:l,selectionChecked:i,onSelectionChange:s,isRecordSelectable:d,selectionCheckboxProps:u,getSelectionCheckboxProps:b,onClick:m,onDoubleClick:T,onContextMenu:g,onCellClick:x,onCellDoubleClick:D,onCellContextMenu:S,expansion:v,customAttributes:P,color:k,backgroundColor:N,className:L,style:p,selectorCellShadowVisible:y,selectionColumnClassName:f,selectionColumnStyle:c,rowFactory:w}){function h(){return No(Eo,{children:[l&&me(ko,{className:f,style:c,record:e,index:t,trigger:r,withRightShadow:y,checked:i,disabled:!s||(d?!d(e,t):!1),onChange:s,checkboxProps:u,getCheckboxProps:b}),o.map(({hidden:z,hiddenContent:X,...R},G)=>{if(z||X)return null;let{accessor:F,visibleMediaQuery:pe,textAlign:fe,noWrap:be,ellipsis:Te,width:ge,render:he,cellsClassName:Y,cellsStyle:Ce,customCellAttributes:De}={...a,...R};return me(Po,{className:typeof Y=="function"?Y(e,t):Y,style:Ce?.(e,t),visibleMediaQuery:pe,record:e,index:t,onClick:x?q=>x({event:q,record:e,index:t,column:R,columnIndex:G}):void 0,onDoubleClick:D?q=>D({event:q,record:e,index:t,column:R,columnIndex:G}):void 0,onContextMenu:S?q=>S({event:q,record:e,index:t,column:R,columnIndex:G}):void 0,accessor:F,textAlign:fe,noWrap:be,ellipsis:Te,width:ge,render:he,defaultRender:n,customCellAttributes:De},F)})]})}let H=v&&me(Ro,{colSpan:o.filter(({hidden:z})=>!z).length+(l?1:0),open:v.isRowExpanded(e),content:v.content({record:e,index:t}),collapseProps:v.collapseProps}),O=Xr({record:e,index:t,selectionChecked:i,onClick:m,onDoubleClick:T,onContextMenu:g,expansion:v,customAttributes:P,color:k,backgroundColor:N,className:L,style:p});return w?w({record:e,index:t,rowProps:O,children:me(h,{}),expandedElement:H}):No(Eo,{children:[me(Br,{...O,children:me(h,{})}),H]})}function Xr({record:e,index:t,selectionChecked:o,onClick:a,onDoubleClick:n,onContextMenu:r,expansion:l,customAttributes:i,color:s,backgroundColor:d,className:u,style:b}){return{className:Gr("mantine-datatable-row",{[B]:a||n||l?.isExpandable({record:e,index:t})&&l?.expandOnClick},{[ze]:r},typeof u=="function"?u(e,t):u),"data-selected":o||void 0,onClick:m=>{if(l){let{isExpandable:T,isRowExpanded:g,expandOnClick:x,expandRow:D,collapseRow:S}=l;T({record:e,index:t})&&x&&(g(e)?S(e):D(e))}a?.({event:m,record:e,index:t})},onDoubleClick:n?m=>n({event:m,record:e,index:t}):void 0,onContextMenu:r?m=>r({event:m,record:e,index:t}):void 0,style:[s||d?m=>{let T=s?.(e,t),g=d?.(e,t);return go({theme:m,color:T,backgroundColor:g})}:void 0,b?.(e,t)],...i?.(e,t)??{}}}import{Box as Ho,ScrollArea as Qr,rem as Io}from"@mantine/core";import Ue from"clsx";import{jsx as $e,jsxs as Ur}from"react/jsx-runtime";function Oo({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:a,rightShadowBehind:n,bottomShadowVisible:r,headerHeight:l,footerHeight:i,onScrollPositionChange:s,children:d,viewportRef:u,scrollAreaProps:b}){return Ur(Qr,{...b,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:s,children:[d,$e(Ho,{className:Ue("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:l?Io(l):0}}),$e("div",{className:Ue("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})}),$e("div",{className:Ue("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":a,"mantine-datatable-scroll-area-shadow-behind":n})}),$e(Ho,{className:Ue("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":r}),style:{bottom:i?Io(i+1):0}})]})}import{jsx as A,jsxs as zo}from"react/jsx-runtime";function Yr({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:a="100%",minHeight:n,maxHeight:r,shadow:l,verticalAlign:i="center",fetching:s,columns:d,storeColumnsKey:u,groups:b,pinFirstColumn:m,pinLastColumn:T,defaultColumnProps:g,defaultColumnRender:x,idAccessor:D="id",records:S,selectionTrigger:v="checkbox",selectedRecords:P,onSelectedRecordsChange:k,selectionColumnClassName:N,selectionColumnStyle:L,isRecordSelectable:p,selectionCheckboxProps:y,allRecordsSelectionCheckboxProps:f={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:c=(W,j)=>({"aria-label":`Select record ${j+1}`}),sortStatus:w,sortIcons:h,onSortStatusChange:H,horizontalSpacing:O,page:z,onPageChange:X,totalRecords:R,recordsPerPage:G,onRecordsPerPageChange:F,recordsPerPageOptions:pe,recordsPerPageLabel:fe="Records per page",paginationWithEdges:be,paginationWithControls:Te,paginationActiveTextColor:ge,paginationActiveBackgroundColor:he,paginationSize:Y="sm",paginationText:Ce=({from:W,to:j,totalRecords:ee})=>`${W} - ${j} / ${ee}`,paginationWrapBreakpoint:De="sm",getPaginationControlProps:q=W=>W==="previous"?{"aria-label":"Previous page"}:W==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:_o,customLoader:Fo,loaderSize:Bo,loaderType:Go,loaderColor:Xo,loadingText:Qo="...",emptyState:Uo,noRecordsText:ut="No records",noRecordsIcon:$o,highlightOnHover:Ko,striped:Jo,noHeader:Zo,onRowClick:Yo,onRowDoubleClick:qo,onRowContextMenu:jo,onCellClick:ea,onCellDoubleClick:ta,onCellContextMenu:oa,onScroll:mt,onScrollToTop:pt,onScrollToBottom:ft,onScrollToLeft:bt,onScrollToRight:Tt,c:aa,backgroundColor:na,borderColor:ra,rowBorderColor:la,stripedColor:ia,highlightOnHoverColor:sa,rowColor:da,rowBackgroundColor:ca,rowExpansion:ua,rowClassName:ma,rowStyle:pa,customRowAttributes:fa,scrollViewportRef:ba,scrollAreaProps:Ta,tableRef:ga,bodyRef:ha,m:Ca,my:Da,mx:ya,mt:wa,mb:Sa,ml:xa,mr:Pa,className:va,classNames:ye,style:Ra,styles:we,rowFactory:Ma,tableWrapper:Je,...gt}){let{ref:W,width:j,height:ee}=ae(),Se=Zr(()=>b?.flatMap(C=>C.columns)??d,[d,b]),ht=It({key:u,columns:Se}),{ref:ka,height:Ze}=ae(),{ref:Ea,width:Ye,height:xe}=ae(),{ref:Na,height:La}=ae(),{ref:Ha,height:Ct}=ae(),{ref:Ia,width:Oa}=ae(),Wa=Wo(Ea,ga),Aa=Wo(W,ba),[qe,Dt]=Ke(!0),[je,yt]=Ke(!0),[Pe,wt]=Ke(!0),[Ne,St]=Ke(!0),za=Ft({rowExpansion:ua,records:S,idAccessor:D}),et=Ee(()=>{let C=W.current?.scrollTop??0,Q=W.current?.scrollLeft??0;if(s||xe<=ee)Dt(!0),yt(!0);else{let V=C===0,_=xe-C-ee<1;Dt(V),yt(_),V&&V!==qe&&pt?.(),_&&_!==je&&ft?.()}if(s||Ye===j)wt(!0),St(!0);else{let V=Q===0,_=Ye-Q-j<1;wt(V),St(_),V&&V!==Pe&&bt?.(),_&&_!==Ne&&Tt?.()}},[s,ft,bt,Tt,pt,ee,W,j,je,Pe,Ne,qe,xe,Ye]);Ot(et,[et]);let xt=Jr(et,50),Va=Ee(C=>{mt?.(C),xt()},[xt,mt]),_a=Ee(C=>{W.current?.scrollTo({top:0,left:0}),X(C)},[X,W]),Le=S?.length,Pt=S?.map(C=>E(C,D)),le=!!P,ve=P?.map(C=>E(C,D)),vt=Pt!==void 0&&ve!==void 0&&ve.length>0,tt=p?S?.filter(p):S,He=tt?.map(C=>E(C,D)),Ie=vt&&He.every(C=>ve.includes(C)),Fa=vt&&He.some(C=>ve.includes(C)),Ba=Ee(()=>{P&&k&&k(Ie?P.filter(C=>!He.includes(E(C,D))):Ae([...P,...tt],C=>E(C,D)))},[Ie,D,k,He,tt,P]),{lastSelectionChangeIndex:Oe,setLastSelectionChangeIndex:Ga}=Wt(Pt),ot=le&&!Pe&&!m,Xa={m:Ca,my:Da,mx:ya,mt:wa,mb:Sa,ml:xa,mr:Pa},Qa=Ee(({children:C})=>Je?Je({children:C}):C,[Je]);return A(at,{...ht,children:zo($r,{...Xa,className:Ao("mantine-datatable",{"mantine-datatable-with-border":e},va,ye?.root),style:[C=>({...To({theme:C,c:aa,backgroundColor:na,borderColor:ra,rowBorderColor:la,stripedColor:ia,highlightOnHoverColor:sa}),borderRadius:C.radius[t]||t,boxShadow:C.shadows[l]||l,height:a,minHeight:n,maxHeight:r}),Ra,we?.root,{position:"relative"}],children:[A(Oo,{viewportRef:Aa,topShadowVisible:!qe,leftShadowVisible:!Pe,leftShadowBehind:le||!!m,rightShadowVisible:!Ne,rightShadowBehind:T,bottomShadowVisible:!je,headerHeight:Ze,footerHeight:La,onScrollPositionChange:Va,scrollAreaProps:Ta,children:A(Qa,{children:zo(Kr,{ref:Wa,horizontalSpacing:O,className:Ao("mantine-datatable-table",{[Qt]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":gt.withRowBorders&&xe<ee,"mantine-datatable-pin-last-column":T,"mantine-datatable-pin-last-column-scrolled":!Ne&&T,"mantine-datatable-selection-column-visible":le,"mantine-datatable-pin-first-column":m,"mantine-datatable-pin-first-column-scrolled":!Pe&&m},ye?.table),style:{...we?.table,"--mantine-datatable-selection-column-width":`${Oa}px`},"data-striped":Le&&Jo||void 0,"data-highlight-on-hover":Ko||void 0,...gt,children:[Zo?null:A(at,{...ht,children:A(po,{ref:ka,selectionColumnHeaderRef:Ia,className:ye?.header,style:we?.header,columns:Se,defaultColumnProps:g,groups:b,sortStatus:w,sortIcons:h,onSortStatusChange:H,selectionTrigger:v,selectionVisible:le,selectionChecked:Ie,selectionIndeterminate:Fa&&!Ie,onSelectionChange:Ba,selectionCheckboxProps:{...y,...f},selectorCellShadowVisible:ot,selectionColumnClassName:N,selectionColumnStyle:L})}),A("tbody",{ref:ha,children:Le?S.map((C,Q)=>{let V=E(C,D),_=ve?.includes(V)||!1,Rt;return k&&P&&(Rt=Ua=>{if(Ua.nativeEvent.shiftKey&&Oe!==null){let ie=S.filter(Q>Oe?(te,oe)=>oe>=Oe&&oe<=Q&&(p?p(te,oe):!0):(te,oe)=>oe>=Q&&oe<=Oe&&(p?p(te,oe):!0));k(_?_t(P,ie,te=>E(te,D)):Ae([...P,...ie],te=>E(te,D)))}else k(_?P.filter(ie=>E(ie,D)!==V):Ae([...P,C],ie=>E(ie,D)));Ga(Q)}),A(Lo,{record:C,index:Q,columns:Se,defaultColumnProps:g,defaultColumnRender:x,selectionTrigger:v,selectionVisible:le,selectionChecked:_,onSelectionChange:Rt,isRecordSelectable:p,selectionCheckboxProps:y,getSelectionCheckboxProps:c,onClick:Yo,onDoubleClick:qo,onCellClick:ea,onCellDoubleClick:ta,onContextMenu:jo,onCellContextMenu:oa,expansion:za,color:da,backgroundColor:ca,className:ma,style:pa,customAttributes:fa,selectorCellShadowVisible:ot,selectionColumnClassName:N,selectionColumnStyle:L,idAccessor:D,rowFactory:Ma},V)}):A(Nt,{})}),Se.some(({footer:C})=>C)&&A(Kt,{ref:Na,className:ye?.footer,style:we?.footer,columns:Se,defaultColumnProps:g,selectionVisible:le,selectorCellShadowVisible:ot,scrollDiff:xe-ee})]})})}),z&&A(xo,{ref:Ha,className:ye?.pagination,style:we?.pagination,horizontalSpacing:O,fetching:s,page:z,onPageChange:_a,totalRecords:R,recordsPerPage:G,onRecordsPerPageChange:F,recordsPerPageOptions:pe,recordsPerPageLabel:fe,paginationWithEdges:be,paginationWithControls:Te,paginationActiveTextColor:ge,paginationActiveBackgroundColor:he,paginationSize:Y,paginationText:Ce,paginationWrapBreakpoint:De,getPaginationControlProps:q,noRecordsText:ut,loadingText:Qo,recordsLength:Le}),A(bo,{pt:Ze,pb:Ct,fetching:s,backgroundBlur:_o,customContent:Fo,size:Bo,type:Go,color:Xo}),A(Ht,{pt:Ze,pb:Ct,icon:$o,text:ut,active:!s&&!Le,children:Uo})]})})}import{TableTr as qr}from"@mantine/core";import{useMergedRef as jr}from"@mantine/hooks";import{forwardRef as el,useEffect as tl,useRef as ol}from"react";import{jsx as al}from"react/jsx-runtime";var Vo=el(function({children:e,isDragging:t,...o},a){let n=ol(null),r=jr(n,a);return tl(()=>{if(!n.current||!t)return;let d=n.current.parentElement.parentElement.children[0].children[0];for(let u=0;u<d.children.length;u++){let m=d.children[u].getBoundingClientRect(),T=n.current.children[u];T.style.height=m.height+"px",T.style.width=m.width+"px",T.style.minWidth=m.width+"px",T.style.maxWidth=m.width+"px"}},[t,e]),al(qr,{"data-is-dragging":t,ref:r,...o,children:e})});Vo.displayName="DataTableDraggableRow";export{Yr as DataTable,Vo as DataTableDraggableRow,_t as differenceBy,E as getRecordId,rt as getValueAtPath,de as humanize,Wl as reorderRecords,Al as swapRecords,Ae as uniqBy,It as useDataTableColumns};
2
2
  //# sourceMappingURL=index.mjs.map