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