mantine-datatable 2.0.1 → 2.0.3

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