mantine-datatable 2.7.2 → 2.8.1

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