mantine-datatable 7.1.4 → 7.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -131,7 +131,9 @@ Make sure to browse the comprehensive list of [usage examples](https://icfloresc
131
131
 
132
132
  ## Other useful resources
133
133
 
134
- Mantine DataTable works perfectly with [Mantine Context Menu](https://icflorescu.github.io/mantine-contextmenu/).
134
+ Mantine DataTable works perfectly with [Mantine Context Menu](https://icflorescu.github.io/mantine-contextmenu/), a library built by the same author that enables you to enhance your UIs with desktop-grade, lightweight yet fully-featured context menus that respect the Mantine color scheme out of the box:
135
+
136
+ [![Mantine ContextMenu](https://user-images.githubusercontent.com/581999/279488420-96467a1b-2fb7-4876-bbc0-6976d26ed79b.png)](https://icflorescu.github.io/mantine-contextmenu/)
135
137
 
136
138
  ## Contributing
137
139
 
@@ -143,11 +145,11 @@ Here's the list of people who have already contributed to Mantine DataTable:
143
145
 
144
146
  Want to [become a code contributor](https://icflorescu.github.io/mantine-datatable/contribute-and-support)?
145
147
 
146
- ## Sponsor the project
148
+ ## Support the project
147
149
 
148
150
  If you find this package useful, please consider ❤️ [sponsoring my work](https://github.com/sponsors/icflorescu).
149
151
  Your sponsorship will help me dedicate more time to maintaining the project and will encourage me to add new features and fix existing bugs.
150
- If you're a company using Mantine DataTable in a commercial project, you can also [hire my services](https://github.com/icflorescu).
152
+ If you're a company using Mantine, Mantine DataTable or [Mantine ContextMenu](https://icflorescu.github.io/mantine-contextmenu/) in a commercial project, you can also [hire my services](https://github.com/icflorescu).
151
153
 
152
154
  ## Other means of support
153
155
 
package/dist/index.d.ts CHANGED
@@ -545,13 +545,21 @@ type DataTableScrollProps = {
545
545
  onScrollToRight?: () => void;
546
546
  };
547
547
 
548
+ type DataTableSelectionTrigger = 'cell' | 'checkbox';
549
+
548
550
  type DataTableSelectionProps<T = Record<string, unknown>> = {
551
+ selectionTrigger?: never;
549
552
  selectedRecords?: never;
550
553
  onSelectedRecordsChange?: never;
551
554
  isRecordSelectable?: never;
552
555
  getRecordSelectionCheckboxProps?: never;
553
556
  allRecordsSelectionCheckboxProps?: never;
554
557
  } | {
558
+ /**
559
+ * Defines how selection is triggered.
560
+ * @default 'checkbox'
561
+ */
562
+ selectionTrigger?: DataTableSelectionTrigger;
555
563
  /**
556
564
  * Currently-selected records.
557
565
  */
@@ -772,7 +780,7 @@ type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
772
780
  [Property in Key]-?: Type[Property];
773
781
  };
774
782
 
775
- declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, groups, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectedRecords, onSelectedRecordsChange, isRecordSelectable, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowContextMenu, onCellClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element;
783
+ declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, groups, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectionTrigger, selectedRecords, onSelectedRecordsChange, isRecordSelectable, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowContextMenu, onCellClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element;
776
784
 
777
785
  /**
778
786
  * Utility function that returns a humanized version of a string, e.g. "camelCase" -> "Camel Case"
@@ -795,4 +803,4 @@ declare function getValueAtPath<T>(obj: T, path: keyof T | (string & NonNullable
795
803
  */
796
804
  declare function getRecordId<T>(record: T, idAccessor: keyof T | (string & NonNullable<unknown>) | ((record: T) => React.Key)): unknown;
797
805
 
798
- export { DataTable, DataTableCellClickHandler, DataTableColumn, DataTableColumnGroup, DataTableColumnTextAlign, DataTableDefaultColumnProps, DataTableEmptyStateProps, DataTableOuterBorderProps, DataTablePaginationProps, DataTableProps, DataTableRowClickHandler, DataTableRowExpansionCollapseProps, DataTableRowExpansionProps, DataTableSelectionProps, DataTableSortProps, DataTableSortStatus, DataTableVerticalAlign, WithOptionalProperty, WithRequiredProperty, differenceBy, getRecordId, getValueAtPath, humanize, uniqBy };
806
+ export { DataTable, DataTableCellClickHandler, DataTableColumn, DataTableColumnGroup, DataTableColumnTextAlign, DataTableDefaultColumnProps, DataTableEmptyStateProps, DataTableOuterBorderProps, DataTablePaginationProps, DataTableProps, DataTableRowClickHandler, DataTableRowExpansionCollapseProps, DataTableRowExpansionProps, DataTableSelectionProps, DataTableSelectionTrigger, DataTableSortProps, DataTableSortStatus, DataTableVerticalAlign, WithOptionalProperty, WithRequiredProperty, differenceBy, getRecordId, getValueAtPath, humanize, uniqBy };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var Xo=Object.create;var Ge=Object.defineProperty;var $o=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Ko=Object.getPrototypeOf,Jo=Object.prototype.hasOwnProperty;var Zo=(e,t)=>{for(var a in t)Ge(e,a,{get:t[a],enumerable:!0})},Lt=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Uo(t))!Jo.call(e,o)&&o!==a&&Ge(e,o,{get:()=>t[o],enumerable:!(n=$o(t,o))||n.enumerable});return e};var N=(e,t,a)=>(a=e!=null?Xo(Ko(e)):{},Lt(t||!e||!e.__esModule?Ge(a,"default",{value:e,enumerable:!0}):a,e)),Yo=e=>Lt(Ge({},"__esModule",{value:!0}),e);var en={};Zo(en,{DataTable:()=>Ga,differenceBy:()=>ct,getRecordId:()=>w,getValueAtPath:()=>$e,humanize:()=>ke,uniqBy:()=>Re});module.exports=Yo(en);var qe=require("@mantine/core"),Wa=require("@mantine/hooks"),gt=N(require("clsx")),I=require("react");var dt=require("react/jsx-runtime");function Ht(){return(0,dt.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,dt.jsx)("td",{})})}var Be=require("@mantine/core");var B=require("react/jsx-runtime");function Ft(){return(0,B.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,B.jsx)("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),(0,B.jsx)("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),(0,B.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,B.jsx)("path",{d:"M3 3l18 18"})]})}var O=require("react/jsx-runtime");function Vt({icon:e,text:t,pt:a,pb:n,active:o,children:r}){return(0,O.jsx)(Be.Center,{pt:a,pb:n,className:"mantine-datatable-empty-state","data-active":o||void 0,children:r||(0,O.jsxs)(O.Fragment,{children:[e||(0,O.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,O.jsx)(Ft,{})}),(0,O.jsx)(Be.Text,{size:"sm",c:"dimmed",children:t})]})})}var be=require("@mantine/core"),aa=N(require("clsx")),oa=require("react");var Jt=require("@mantine/core"),Zt=N(require("clsx"));var At=require("@mantine/hooks");function pe(){let[e]=(0,At.useResizeObserver)(),{width:t,height:a}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:a}}var Qe=require("react"),_t=typeof window<"u"?Qe.useLayoutEffect:Qe.useEffect;var Xe=require("react");function Ot(e){let[t,a]=(0,Xe.useState)(null),n=e?.join(":")||"";return(0,Xe.useEffect)(()=>{a(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:a}}var ce=require("react");function qo(e,t){let a=()=>{t(e.map(o=>o.matches))},n=e.map(o=>{try{return o.addEventListener("change",a),()=>o.removeEventListener("change",a)}catch{return o.addListener(a),()=>o.removeListener(a)}});return()=>{n.forEach(o=>o())}}function jo(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(a=>window.matchMedia(a).matches):e.map(()=>!1))}function zt(e,t,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[n,o]=(0,ce.useState)(a?t:jo(e,t)),r=(0,ce.useRef)();return(0,ce.useEffect)(()=>{if("matchMedia"in window)return r.current=e.map(i=>window.matchMedia(i)),o(r.current.map(i=>i.matches)),qo(r.current,i=>{o(i)})},[e]),n}var Wt=require("@mantine/core"),pt=require("react");function Gt(e){let t=(0,Wt.useMantineTheme)(),a=(0,pt.useMemo)(()=>e.map(o=>(typeof o=="function"?o(t):o)??""),[e,t]),n=(0,pt.useMemo)(()=>e.map(()=>!0),[e]);return zt(a,n)}var Bt=require("@mantine/core"),Qt=require("@mantine/hooks");function Q(e){let t=(0,Bt.useMantineTheme)(),a=typeof e=="function"?e(t):e;return(0,Qt.useMediaQuery)(a||"",!0)}var Xt=require("react");function ke(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function ct(e,t,a){return e.filter(n=>!t.map(a).includes(a(n)))}function Re(e,t){return e.filter((a,n,o)=>n===o.findIndex(r=>t(a)===t(r)))}function $e(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,o)=>n&&n[o],e):void 0}function w(e,t){return typeof t=="string"?$e(e,t):t(e)}function $t({rowExpansion:e,records:t,idAccessor:a}){let n=[];if(e&&t){let{trigger:l,allowMultiple:p,initiallyExpanded:s}=e;t&&l==="always"?n=t.map(m=>w(m,a)):s&&(n=t.filter((m,f)=>s({record:m,index:f})).map(m=>w(m,a)),p||(n=[n[0]]))}let o,r,i=(0,Xt.useState)(n);if(e){let{trigger:l,allowMultiple:p,collapseProps:s,content:m}=e;e.expanded?{recordIds:o,onRecordIdsChange:r}=e.expanded:[o,r]=i;let f=b=>r?.(o.filter(d=>d!==w(b,a)));return{expandOnClick:l!=="always"&&l!=="never",isRowExpanded:b=>l==="always"?!0:o.includes(w(b,a)),expandRow:b=>{let d=w(b,a);r?.(p?[...o,d]:[d])},collapseRow:f,collapseProps:s,content:({record:b,index:d})=>()=>m({record:b,index:d,collapse:()=>f(b)})}}}var mt=require("@mantine/hooks"),ve=require("react");function Ut(e,t){let[a,n]=(0,ve.useState)(e),[o,r]=(0,ve.useState)(e),i=(0,mt.useTimeout)(()=>n(!0),0),l=(0,mt.useTimeout)(()=>r(!1),t||200);return(0,ve.useEffect)(()=>{e?(l.clear(),r(!0),i.start()):(i.clear(),n(!1),l.start())},[i,l,e]),{expanded:a,visible:o}}var me="mantine-datatable-nowrap",ue="mantine-datatable-ellipsis",X="mantine-datatable-pointer-cursor",Kt="mantine-datatable-text-selection-disabled",$="mantine-datatable-text-align-left",U="mantine-datatable-text-align-center",K="mantine-datatable-text-align-right";var qt=require("react/jsx-runtime");function Yt({className:e,style:t,visibleMediaQuery:a,title:n,noWrap:o,ellipsis:r,textAlign:i,width:l}){return Q(a)?(0,qt.jsx)(Jt.TableTh,{className:(0,Zt.default)({[me]:o||r,[ue]:r,[$]:i==="left",[U]:i==="center",[K]:i==="right"},e),style:[{width:l,minWidth:l,maxWidth:l},t],children:n}):null}var jt=require("@mantine/core"),ta=require("react/jsx-runtime");function ea({shadowVisible:e}){return(0,ta.jsx)(jt.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var fe=require("react/jsx-runtime"),na=(0,oa.forwardRef)(function({className:t,style:a,columns:n,defaultColumnProps:o,selectionVisible:r,selectorCellShadowVisible:i,scrollDiff:l},p){let s=l<0;return(0,fe.jsx)(be.TableTfoot,{ref:p,className:(0,aa.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,be.rem)(s?l:0)},a],children:(0,fe.jsxs)(be.TableTr,{children:[r&&(0,fe.jsx)(ea,{shadowVisible:i}),n.map(({hidden:m,...f})=>{if(m)return null;let{accessor:b,visibleMediaQuery:d,textAlign:u,width:T,footer:g,footerClassName:C,footerStyle:R,noWrap:A,ellipsis:v}={...o,...f};return(0,fe.jsx)(Yt,{className:C,style:R,visibleMediaQuery:d,textAlign:u,width:T,title:g,noWrap:A,ellipsis:v},b)})]})})});var Ie=require("@mantine/core"),ha=N(require("clsx")),ga=require("react");var ra=require("@mantine/core"),la=N(require("clsx")),ut=require("react");var sa=require("react/jsx-runtime");function ia({group:{id:e,columns:t,title:a,textAlign:n,className:o,style:r}}){let i=(0,ut.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),l=Gt(i),p=(0,ut.useMemo)(()=>t.filter(({hidden:s},m)=>!s&&l?.[m]).length,[t,l]);return p>0?(0,sa.jsx)(ra.TableTh,{colSpan:p,className:(0,la.default)("mantine-datatable-column-group-header-cell",{[$]:n==="left",[U]:n==="center",[K]:n==="right"},o),style:r,children:a??ke(e)}):null}var z=require("@mantine/core"),Ue=N(require("clsx"));var ne=require("@mantine/core"),ca=require("@mantine/hooks");var Ee=require("react/jsx-runtime");function da(){return(0,Ee.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ee.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ee.jsx)("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}var Ne=require("react/jsx-runtime");function pa(){return(0,Ne.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ne.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ne.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var oe=require("react/jsx-runtime");function ma({children:e,isActive:t}){let[a,{close:n,toggle:o}]=(0,ca.useDisclosure)(!1);return(0,oe.jsxs)(ne.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:a,onClose:n,trapFocus:!0,children:[(0,oe.jsx)(ne.PopoverTarget,{children:(0,oe.jsx)(ne.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:i=>{i.preventDefault(),o()},children:(0,oe.jsx)(t?pa:da,{})})}),(0,oe.jsx)(ne.Popover.Dropdown,{onClick:i=>i.preventDefault(),children:typeof e=="function"?e({close:n}):e})]})}var re=require("react/jsx-runtime");function ua(){return(0,re.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,re.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,re.jsx)("path",{d:"M12 5l0 14"}),(0,re.jsx)("path",{d:"M16 9l-4 -4"}),(0,re.jsx)("path",{d:"M8 9l4 -4"})]})}var le=require("react/jsx-runtime");function fa(){return(0,le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,le.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,le.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,le.jsx)("path",{d:"M12 3l0 18"})]})}var D=require("react/jsx-runtime");function ba({className:e,style:t,accessor:a,visibleMediaQuery:n,title:o,sortable:r,sortIcons:i,textAlign:l,width:p,sortStatus:s,onSortStatusChange:m,filter:f,filtering:b}){if(!Q(n))return null;let d=o??ke(a),u=typeof d=="string"?d:void 0,T=r&&m?g=>{g?.defaultPrevented||m({columnAccessor:a,direction:s?.columnAccessor===a?s.direction==="asc"?"desc":"asc":s?.direction??"asc"})}:void 0;return(0,D.jsx)(z.TableTh,{className:(0,Ue.default)({"mantine-datatable-header-cell-sortable":r},e),style:[{width:p,minWidth:p,maxWidth:p},t],role:r?"button":void 0,tabIndex:r?0:void 0,onClick:T,onKeyDown:g=>g.key==="Enter"&&T?.(),children:(0,D.jsxs)(z.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,D.jsx)(z.Box,{className:(0,Ue.default)("mantine-datatable-header-cell-sortable-text",{[$]:l==="left",[U]:l==="center",[K]:l==="right"},me,ue),title:u,children:d}),r||s?.columnAccessor===a?(0,D.jsx)(D.Fragment,{children:s?.columnAccessor===a?(0,D.jsx)(z.Center,{className:(0,Ue.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":s.direction==="desc"}),role:"img","aria-label":`Sorted ${s.direction==="desc"?"descending":"ascending"}`,children:i?.sorted||(0,D.jsx)(ua,{})}):(0,D.jsx)(z.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:i?.unsorted||(0,D.jsx)(fa,{})})}):null,f?(0,D.jsx)(ma,{isActive:!!b,children:f}):null]})})}var Ke=require("@mantine/core");var ft=require("react/jsx-runtime");function Ta({shadowVisible:e,checked:t,indeterminate:a,checkboxProps:n,onChange:o,rowSpan:r}){return(0,ft.jsx)(Ke.TableTh,{className:"mantine-datatable-header-selector-cell",rowSpan:r,"data-shadow-visible":e||void 0,children:(0,ft.jsx)(Ke.Checkbox,{classNames:{input:X},checked:t,indeterminate:a,onChange:o,...n,disabled:!(o||n.onChange)||n.disabled})})}var J=require("react/jsx-runtime"),Ca=(0,ga.forwardRef)(function({className:t,style:a,sortStatus:n,sortIcons:o,onSortStatusChange:r,columns:i,defaultColumnProps:l,groups:p,selectionVisible:s,selectionChecked:m,selectionIndeterminate:f,onSelectionChange:b,selectionCheckboxProps:d,selectorCellShadowVisible:u},T){let g=s?(0,J.jsx)(Ta,{shadowVisible:u,checked:m,indeterminate:f,checkboxProps:d,onChange:b,rowSpan:p?2:void 0}):null;return(0,J.jsxs)(Ie.TableThead,{className:(0,ha.default)("mantine-datatable-header",t),style:a,ref:T,children:[p&&(0,J.jsxs)(Ie.TableTr,{children:[g,p.map(C=>(0,J.jsx)(ia,{group:C},C.id))]}),(0,J.jsxs)(Ie.TableTr,{children:[!p&&g,i.map(({hidden:C,...R})=>{if(C)return null;let{accessor:A,visibleMediaQuery:v,textAlign:P,width:M,title:S,sortable:L,titleClassName:x,titleStyle:q,filter:ge,filtering:Ce}={...l,...R};return(0,J.jsx)(ba,{accessor:A,className:x,style:q,visibleMediaQuery:v,textAlign:P,width:M,title:S,sortable:L,sortStatus:n,sortIcons:o,onSortStatusChange:r,filter:ge,filtering:Ce},A)})]})]})});var Je=require("@mantine/core"),ya=N(require("clsx")),bt=require("react/jsx-runtime");function wa({pt:e,pb:t,fetching:a,customContent:n,backgroundBlur:o,size:r,type:i,color:l}){return(0,bt.jsx)(Je.Center,{pt:e,pb:t,className:(0,ya.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":a}),style:[{backdropFilter:o?`blur(${o}px)`:void 0}],children:a&&(n||(0,bt.jsx)(Je.Loader,{size:r,type:i,color:l}))})}var Z=require("@mantine/core"),Tt=N(require("clsx")),va=require("react");var h=require("@mantine/core"),ka=N(require("clsx"));var Sa=require("@mantine/core");function y(e,t,a){return e?(0,Sa.parseThemeColor)({color:typeof e=="object"?e[a]:e,theme:t}).value:void 0}function Pa({theme:e,c:t,backgroundColor:a,borderColor:n,rowBorderColor:o,stripedColor:r,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":y(t,e,"light"),"--mantine-datatable-color-dark":y(t,e,"dark"),"--mantine-datatable-background-color-light":y(a,e,"light"),"--mantine-datatable-background-color-dark":y(a,e,"dark"),"--mantine-datatable-border-color-light":y(n,e,"light"),"--mantine-datatable-border-color-dark":y(n,e,"dark"),"--mantine-datatable-row-border-color-light":y(o,e,"light"),"--mantine-datatable-row-border-color-dark":y(o,e,"dark"),"--mantine-datatable-striped-color-light":y(r,e,"light"),"--mantine-datatable-striped-color-dark":y(r,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":y(i,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":y(i,e,"dark")}}function Ze({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:a}){return{"--mantine-datatable-pagination-active-text-color-light":y(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":y(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":y(a,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":y(a,e,"dark")}}function xa({theme:e,color:t,backgroundColor:a}){return{"--mantine-datatable-row-color-light":y(t,e,"light"),"--mantine-datatable-row-color-dark":y(t,e,"dark"),"--mantine-datatable-row-background-color-light":y(a,e,"light"),"--mantine-datatable-row-background-color-dark":y(a,e,"dark")}}var Te=require("react/jsx-runtime");function Ma(){return(0,Te.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Te.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Te.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Te.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var V=require("react/jsx-runtime"),Da={xs:(0,h.rem)(22),sm:(0,h.rem)(26),md:(0,h.rem)(32),lg:(0,h.rem)(38),xl:(0,h.rem)(44)};function Ra({size:e,label:t,values:a,value:n,activeTextColor:o,activeBackgroundColor:r,onChange:i}){return(0,V.jsxs)(h.Group,{gap:"xs",children:[(0,V.jsx)(h.Text,{size:e,children:t}),(0,V.jsxs)(h.Menu,{withinPortal:!0,withArrow:!0,children:[(0,V.jsx)(h.MenuTarget,{children:(0,V.jsx)(h.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,V.jsx)(Ma,{}),style:[{fontWeight:"normal"},l=>({height:Da[e],paddingLeft:l.spacing[e],paddingRight:l.spacing[e]})],children:n})}),(0,V.jsx)(h.MenuDropdown,{children:a.map(l=>{let p=l===n;return(0,V.jsx)(h.MenuItem,{className:(0,ka.default)({"mantine-datatable-page-size-selector-active":p}),style:[{height:Da[e]},p&&(o||r)?s=>Ze({theme:s,paginationActiveTextColor:o,paginationActiveBackgroundColor:r}):void 0],disabled:p,onClick:()=>i(l),children:(0,V.jsx)(h.Text,{size:e,children:l})},l)})})]})]})}var he=require("react/jsx-runtime"),Ea=(0,va.forwardRef)(function({className:t,style:a,fetching:n,page:o,onPageChange:r,paginationWithEdges:i,paginationActiveTextColor:l,paginationActiveBackgroundColor:p,paginationSize:s,loadingText:m,noRecordsText:f,paginationText:b,totalRecords:d,recordsPerPage:u,onRecordsPerPageChange:T,recordsPerPageLabel:g,recordsPerPageOptions:C,recordsLength:R,horizontalSpacing:A,paginationWrapBreakpoint:v,getPaginationControlProps:P},M){let S;if(n)S=m;else if(!d)S=f;else{let x=(o-1)*u+1,q=x+R-1;S=b({from:x,to:q,totalRecords:d})}let L=Q(({breakpoints:x})=>`(min-width: ${typeof v=="number"?`${(0,Z.rem)(v)}rem`:x[v]||v})`);return(0,he.jsxs)(Z.Box,{ref:M,px:A??"xs",py:"xs",className:(0,Tt.default)("mantine-datatable-pagination",t),style:[{flexDirection:L?"row":"column"},a],children:[(0,he.jsx)(Z.Text,{className:"mantine-datatable-pagination-text",size:s,children:S}),C&&(0,he.jsx)(Ra,{activeTextColor:l,activeBackgroundColor:p,size:s,label:g,values:C,value:u,onChange:T}),(0,he.jsx)(Z.Pagination,{classNames:{root:(0,Tt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!R}),control:"mantine-datatable-pagination-pages-control"},style:l||p?x=>Ze({theme:x,paginationActiveTextColor:l,paginationActiveBackgroundColor:p}):void 0,withEdges:i,value:o,onChange:r,size:s,total:Math.ceil(d/u),getControlProps:P})]})});var Aa=require("@mantine/core"),_a=N(require("clsx"));var Na=require("@mantine/core"),Ia=N(require("clsx"));var Ha=require("react/jsx-runtime");function La({className:e,style:t,visibleMediaQuery:a,record:n,index:o,onClick:r,onContextMenu:i,noWrap:l,ellipsis:p,textAlign:s,width:m,accessor:f,render:b,defaultRender:d,customCellAttributes:u}){return Q(a)?(0,Ha.jsx)(Na.TableTd,{className:(0,Ia.default)({[me]:l||p,[ue]:p,[X]:r,[$]:s==="left",[U]:s==="center",[K]:s==="right"},e),style:[{width:m,minWidth:m,maxWidth:m},t],onClick:r,onContextMenu:i,...u?.(n,o),children:b?b(n,o):d?d(n,o,f):$e(n,f)}):null}var ie=require("@mantine/core");var _=require("react/jsx-runtime");function Fa({open:e,colSpan:t,content:a,collapseProps:n}){let{expanded:o,visible:r}=Ut(e,n?.transitionDuration);return r?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ie.TableTr,{}),(0,_.jsx)(ie.TableTr,{children:(0,_.jsx)(ie.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,_.jsx)(ie.Collapse,{in:o,...n,children:(0,_.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:a()})})})})]}):null}var Ye=require("@mantine/core");var ht=require("react/jsx-runtime");function Va({record:e,index:t,withRightShadow:a,getCheckboxProps:n,...o}){return(0,ht.jsx)(Ye.TableTd,{className:"mantine-datatable-row-selector-cell","data-shadow-visible":a||void 0,onClick:r=>r.stopPropagation(),children:(0,ht.jsx)(Ye.Checkbox,{classNames:{input:X},...o,...n(e,t)})})}var W=require("react/jsx-runtime");function Oa({record:e,index:t,columns:a,defaultColumnProps:n,defaultColumnRender:o,selectionVisible:r,selectionChecked:i,onSelectionChange:l,isRecordSelectable:p,getSelectionCheckboxProps:s,onClick:m,onContextMenu:f,onCellClick:b,onCellContextMenu:d,expansion:u,customAttributes:T,color:g,backgroundColor:C,className:R,style:A,selectorCellShadowVisible:v}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Aa.TableTr,{className:(0,_a.default)("mantine-datatable-row",{[X]:m||u?.expandOnClick},typeof R=="function"?R(e,t):R),"data-selected":i||void 0,onClick:P=>{if(u){let{isRowExpanded:M,expandOnClick:S,expandRow:L,collapseRow:x}=u;S&&(M(e)?x(e):L(e))}m?.({event:P,record:e,index:t})},onContextMenu:f?P=>f({event:P,record:e,index:t}):void 0,style:[g||C?P=>{let M=g?.(e,t),S=C?.(e,t);return xa({theme:P,color:M,backgroundColor:S})}:void 0,A?.(e,t)],...T?.(e,t),children:[r&&(0,W.jsx)(Va,{record:e,index:t,withRightShadow:v,checked:i,disabled:!l||(p?!p(e,t):!1),onChange:l,getCheckboxProps:s}),a.map(({hidden:P,...M},S)=>{if(P)return null;let{accessor:L,visibleMediaQuery:x,textAlign:q,noWrap:ge,ellipsis:Ce,width:je,render:et,cellsClassName:ye,cellsStyle:tt,customCellAttributes:at}={...n,...M};return(0,W.jsx)(La,{className:typeof ye=="function"?ye(e,t):ye,style:tt?.(e,t),visibleMediaQuery:x,record:e,index:t,onClick:b?we=>b({event:we,record:e,index:t,column:M,columnIndex:S}):void 0,onContextMenu:d?we=>d({event:we,record:e,index:t,column:M,columnIndex:S}):void 0,accessor:L,textAlign:q,noWrap:ge,ellipsis:Ce,width:je,render:et,defaultRender:o,customCellAttributes:at},L)})]}),u&&(0,W.jsx)(Fa,{colSpan:a.filter(({hidden:P})=>!P).length+(r?1:0),open:u.isRowExpanded(e),content:u.content({record:e,index:t}),collapseProps:u.collapseProps})]})}var Y=require("@mantine/core"),Le=N(require("clsx")),se=require("react/jsx-runtime");function za({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:a,rightShadowVisible:n,rightShadowBehind:o,bottomShadowVisible:r,headerHeight:i,footerHeight:l,onScrollPositionChange:p,children:s,viewportRef:m,scrollAreaProps:f}){return(0,se.jsxs)(Y.ScrollArea,{...f,viewportRef:m,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:p,children:[s,(0,se.jsx)(Y.Box,{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:i?(0,Y.rem)(i):0}}),(0,se.jsx)("div",{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,se.jsx)("div",{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,se.jsx)(Y.Box,{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":r}),style:{bottom:l?(0,Y.rem)(l+1):0}})]})}var k=require("react/jsx-runtime");function Ga({withTableBorder:e,borderRadius:t,textSelectionDisabled:a,height:n="100%",minHeight:o,shadow:r,verticalAlign:i="center",fetching:l,columns:p,groups:s,pinLastColumn:m,defaultColumnProps:f,defaultColumnRender:b,idAccessor:d="id",records:u,selectedRecords:T,onSelectedRecordsChange:g,isRecordSelectable:C,allRecordsSelectionCheckboxProps:R={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:A=(E,j)=>({"aria-label":`Select record ${j+1}`}),sortStatus:v,sortIcons:P,onSortStatusChange:M,horizontalSpacing:S,page:L,onPageChange:x,totalRecords:q,recordsPerPage:ge,onRecordsPerPageChange:Ce,recordsPerPageOptions:je,recordsPerPageLabel:et="Records per page",paginationWithEdges:ye,paginationActiveTextColor:tt,paginationActiveBackgroundColor:at,paginationSize:we="sm",paginationText:Ba=({from:E,to:j,totalRecords:ee})=>`${E} - ${j} / ${ee}`,paginationWrapBreakpoint:Qa="sm",getPaginationControlProps:Xa=E=>E==="previous"?{"aria-label":"Previous page"}:E==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:$a,customLoader:Ua,loaderSize:Ka,loaderType:Ja,loaderColor:Za,loadingText:Ya="...",emptyState:qa,noRecordsText:Ct="No records",noRecordsIcon:ja,highlightOnHover:eo,striped:to,noHeader:ao,onRowClick:oo,onRowContextMenu:no,onCellClick:ro,onCellContextMenu:lo,onScroll:yt,onScrollToTop:wt,onScrollToBottom:St,onScrollToLeft:Pt,onScrollToRight:xt,c:io,backgroundColor:so,borderColor:po,rowBorderColor:co,stripedColor:mo,highlightOnHoverColor:uo,rowColor:fo,rowBackgroundColor:bo,rowExpansion:To,rowClassName:ho,rowStyle:go,customRowAttributes:Co,scrollViewportRef:yo,scrollAreaProps:wo,bodyRef:So,m:Po,my:xo,mx:Mo,mt:Do,mb:ko,ml:Ro,mr:vo,className:Eo,classNames:Se,style:No,styles:Pe,...Io}){let{ref:E,width:j,height:ee}=pe(),He=(0,I.useMemo)(()=>s?.flatMap(c=>c.columns)??p,[p,s]),{ref:Lo,height:ot}=pe(),{ref:Ho,width:nt,height:xe}=pe(),{ref:Fo,height:Vo}=pe(),{ref:Ao,height:Mt}=pe(),[rt,Dt]=(0,I.useState)(!0),[lt,kt]=(0,I.useState)(!0),[Fe,Rt]=(0,I.useState)(!0),[Ve,vt]=(0,I.useState)(!0),_o=$t({rowExpansion:To,records:u,idAccessor:d}),Ae=(0,I.useCallback)(()=>{let c=E.current?.scrollTop||0,G=E.current?.scrollLeft||0;if(l||xe<=ee)Dt(!0),kt(!0);else{let H=c===0,F=xe-c-ee<1;Dt(H),kt(F),H&&H!==rt&&wt?.(),F&&F!==lt&&St?.()}if(l||nt===j)Rt(!0),vt(!0);else{let H=G===0,F=nt-G-j<1;Rt(H),vt(F),H&&H!==Fe&&Pt?.(),F&&F!==Ve&&xt?.()}},[l,St,Pt,xt,wt,ee,E,j,lt,Fe,Ve,rt,xe,nt]);_t(Ae,[Ae]);let Oo=(0,I.useCallback)(c=>{yt?.(c),Ae()},[Ae,yt]),zo=(0,I.useCallback)(c=>{E.current?.scrollTo({top:0,left:0}),x(c)},[x,E]),_e=u?.length,Et=u?.map(c=>w(c,d)),Me=!!T,De=T?.map(c=>w(c,d)),Nt=Et!==void 0&&De!==void 0&&De.length>0,it=C?u?.filter(C):u,Oe=it?.map(c=>w(c,d)),ze=Nt&&Oe.every(c=>De.includes(c)),Wo=Nt&&Oe.some(c=>De.includes(c)),Go=(0,I.useCallback)(()=>{T&&g&&g(ze?T.filter(c=>!Oe.includes(w(c,d))):Re([...T,...it],c=>w(c,d)))},[ze,d,g,Oe,it,T]),{lastSelectionChangeIndex:We,setLastSelectionChangeIndex:Bo}=Ot(Et),st=Me&&!Fe;return(0,k.jsxs)(qe.Box,{...{m:Po,my:xo,mx:Mo,mt:Do,mb:ko,ml:Ro,mr:vo},className:(0,gt.default)("mantine-datatable",{"mantine-datatable-with-border":e},Eo,Se?.root),style:[c=>({...Pa({theme:c,c:io,backgroundColor:so,borderColor:po,rowBorderColor:co,stripedColor:mo,highlightOnHoverColor:uo}),borderRadius:c.radius[t]||t,boxShadow:c.shadows[r]||r,height:n,minHeight:o}),No,Pe?.root],children:[(0,k.jsx)(za,{viewportRef:(0,Wa.useMergedRef)(E,yo),topShadowVisible:!rt,leftShadowVisible:!Fe,leftShadowBehind:Me,rightShadowVisible:!Ve,rightShadowBehind:m,bottomShadowVisible:!lt,headerHeight:ot,footerHeight:Vo,onScrollPositionChange:Oo,scrollAreaProps:wo,children:(0,k.jsxs)(qe.Table,{ref:Ho,horizontalSpacing:S,className:(0,gt.default)("mantine-datatable-table",{[Kt]:a,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":xe<ee,"mantine-datatable-pin-last-column":m,"mantine-datatable-pin-last-column-scrolled":!Ve&&m},Se?.table),style:Pe?.table,"data-striped":_e&&to||void 0,"data-highlight-on-hover":eo||void 0,...Io,children:[ao?null:(0,k.jsx)(Ca,{ref:Lo,className:Se?.header,style:Pe?.header,columns:He,defaultColumnProps:f,groups:s,sortStatus:v,sortIcons:P,onSortStatusChange:M,selectionVisible:Me,selectionChecked:ze,selectionIndeterminate:Wo&&!ze,onSelectionChange:Go,selectionCheckboxProps:R,selectorCellShadowVisible:st}),(0,k.jsx)("tbody",{ref:So,children:_e?u.map((c,G)=>{let H=w(c,d),F=De?.includes(H)||!1,It;return g&&T&&(It=Qo=>{if(Qo.nativeEvent.shiftKey&&We!==null){let de=u.filter(G>We?(te,ae)=>ae>=We&&ae<=G&&(C?C(te,ae):!0):(te,ae)=>ae>=G&&ae<=We&&(C?C(te,ae):!0));g(F?ct(T,de,te=>w(te,d)):Re([...T,...de],te=>w(te,d)))}else g(F?T.filter(de=>w(de,d)!==H):Re([...T,c],de=>w(de,d)));Bo(G)}),(0,k.jsx)(Oa,{record:c,index:G,columns:He,defaultColumnProps:f,defaultColumnRender:b,selectionVisible:Me,selectionChecked:F,onSelectionChange:It,isRecordSelectable:C,getSelectionCheckboxProps:A,onClick:oo,onCellClick:ro,onContextMenu:no,onCellContextMenu:lo,expansion:_o,color:fo,backgroundColor:bo,className:ho,style:go,customAttributes:Co,selectorCellShadowVisible:st},H)}):(0,k.jsx)(Ht,{})}),He.some(({footer:c})=>c)&&(0,k.jsx)(na,{ref:Fo,className:Se?.footer,style:Pe?.footer,columns:He,defaultColumnProps:f,selectionVisible:Me,selectorCellShadowVisible:st,scrollDiff:xe-ee})]})}),L&&(0,k.jsx)(Ea,{ref:Ao,className:Se?.pagination,style:Pe?.pagination,horizontalSpacing:S,fetching:l,page:L,onPageChange:zo,totalRecords:q,recordsPerPage:ge,onRecordsPerPageChange:Ce,recordsPerPageOptions:je,recordsPerPageLabel:et,paginationWithEdges:ye,paginationActiveTextColor:tt,paginationActiveBackgroundColor:at,paginationSize:we,paginationText:Ba,paginationWrapBreakpoint:Qa,getPaginationControlProps:Xa,noRecordsText:Ct,loadingText:Ya,recordsLength:_e}),(0,k.jsx)(wa,{pt:ot,pb:Mt,fetching:l,backgroundBlur:$a,customContent:Ua,size:Ka,type:Ja,color:Za}),(0,k.jsx)(Vt,{pt:ot,pb:Mt,icon:ja,text:Ct,active:!l&&!_e,children:qa})]})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy});
1
+ "use strict";"use client";var Ko=Object.create;var Be=Object.defineProperty;var Jo=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Yo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var jo=(e,t)=>{for(var a in t)Be(e,a,{get:t[a],enumerable:!0})},Ht=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zo(t))!qo.call(e,o)&&o!==a&&Be(e,o,{get:()=>t[o],enumerable:!(n=Jo(t,o))||n.enumerable});return e};var M=(e,t,a)=>(a=e!=null?Ko(Yo(e)):{},Ht(t||!e||!e.__esModule?Be(a,"default",{value:e,enumerable:!0}):a,e)),en=e=>Ht(Be({},"__esModule",{value:!0}),e);var on={};jo(on,{DataTable:()=>Xa,differenceBy:()=>mt,getRecordId:()=>S,getValueAtPath:()=>Ue,humanize:()=>Re,uniqBy:()=>ve});module.exports=en(on);var je=require("@mantine/core"),Qa=require("@mantine/hooks"),Ct=M(require("clsx")),I=require("react");var ct=require("react/jsx-runtime");function Ft(){return(0,ct.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,ct.jsx)("td",{})})}var Qe=require("@mantine/core");var Q=require("react/jsx-runtime");function Vt(){return(0,Q.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Q.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Q.jsx)("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),(0,Q.jsx)("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),(0,Q.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,Q.jsx)("path",{d:"M3 3l18 18"})]})}var z=require("react/jsx-runtime");function At({icon:e,text:t,pt:a,pb:n,active:o,children:l}){return(0,z.jsx)(Qe.Center,{pt:a,pb:n,className:"mantine-datatable-empty-state","data-active":o||void 0,children:l||(0,z.jsxs)(z.Fragment,{children:[e||(0,z.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,z.jsx)(Vt,{})}),(0,z.jsx)(Qe.Text,{size:"sm",c:"dimmed",children:t})]})})}var be=require("@mantine/core"),oa=M(require("clsx")),na=require("react");var Zt=require("@mantine/core"),Yt=M(require("clsx"));var _t=require("@mantine/hooks");function ce(){let[e]=(0,_t.useResizeObserver)(),{width:t,height:a}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:a}}var Xe=require("react"),Ot=typeof window<"u"?Xe.useLayoutEffect:Xe.useEffect;var $e=require("react");function zt(e){let[t,a]=(0,$e.useState)(null),n=e?.join(":")||"";return(0,$e.useEffect)(()=>{a(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:a}}var pe=require("react");function tn(e,t){let a=()=>{t(e.map(o=>o.matches))},n=e.map(o=>{try{return o.addEventListener("change",a),()=>o.removeEventListener("change",a)}catch{return o.addListener(a),()=>o.removeListener(a)}});return()=>{n.forEach(o=>o())}}function an(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(a=>window.matchMedia(a).matches):e.map(()=>!1))}function Wt(e,t,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[n,o]=(0,pe.useState)(a?t:an(e,t)),l=(0,pe.useRef)();return(0,pe.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(i=>window.matchMedia(i)),o(l.current.map(i=>i.matches)),tn(l.current,i=>{o(i)})},[e]),n}var Gt=require("@mantine/core"),pt=require("react");function Bt(e){let t=(0,Gt.useMantineTheme)(),a=(0,pt.useMemo)(()=>e.map(o=>(typeof o=="function"?o(t):o)??""),[e,t]),n=(0,pt.useMemo)(()=>e.map(()=>!0),[e]);return Wt(a,n)}var Qt=require("@mantine/core"),Xt=require("@mantine/hooks");function X(e){let t=(0,Qt.useMantineTheme)(),a=typeof e=="function"?e(t):e;return(0,Xt.useMediaQuery)(a||"",!0)}var $t=require("react");function Re(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function mt(e,t,a){return e.filter(n=>!t.map(a).includes(a(n)))}function ve(e,t){return e.filter((a,n,o)=>n===o.findIndex(l=>t(a)===t(l)))}function Ue(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,o)=>n&&n[o],e):void 0}function S(e,t){return typeof t=="string"?Ue(e,t):t(e)}function Ut({rowExpansion:e,records:t,idAccessor:a}){let n=[];if(e&&t){let{trigger:r,allowMultiple:d,initiallyExpanded:s}=e;t&&r==="always"?n=t.map(p=>S(p,a)):s&&(n=t.filter((p,u)=>s({record:p,index:u})).map(p=>S(p,a)),d||(n=[n[0]]))}let o,l,i=(0,$t.useState)(n);if(e){let{trigger:r,allowMultiple:d,collapseProps:s,content:p}=e;e.expanded?{recordIds:o,onRecordIdsChange:l}=e.expanded:[o,l]=i;let u=f=>l?.(o.filter(c=>c!==S(f,a)));return{expandOnClick:r!=="always"&&r!=="never",isRowExpanded:f=>r==="always"?!0:o.includes(S(f,a)),expandRow:f=>{let c=S(f,a);l?.(d?[...o,c]:[c])},collapseRow:u,collapseProps:s,content:({record:f,index:c})=>()=>p({record:f,index:c,collapse:()=>u(f)})}}}var ut=require("@mantine/hooks"),Ee=require("react");function Kt(e,t){let[a,n]=(0,Ee.useState)(e),[o,l]=(0,Ee.useState)(e),i=(0,ut.useTimeout)(()=>n(!0),0),r=(0,ut.useTimeout)(()=>l(!1),t||200);return(0,Ee.useEffect)(()=>{e?(r.clear(),l(!0),i.start()):(i.clear(),n(!1),r.start())},[i,r,e]),{expanded:a,visible:o}}var me="mantine-datatable-nowrap",ue="mantine-datatable-ellipsis",_="mantine-datatable-pointer-cursor",Jt="mantine-datatable-text-selection-disabled",$="mantine-datatable-text-align-left",U="mantine-datatable-text-align-center",K="mantine-datatable-text-align-right";var jt=require("react/jsx-runtime");function qt({className:e,style:t,visibleMediaQuery:a,title:n,noWrap:o,ellipsis:l,textAlign:i,width:r}){return X(a)?(0,jt.jsx)(Zt.TableTh,{className:(0,Yt.default)({[me]:o||l,[ue]:l,[$]:i==="left",[U]:i==="center",[K]:i==="right"},e),style:[{width:r,minWidth:r,maxWidth:r},t],children:n}):null}var ea=require("@mantine/core"),aa=require("react/jsx-runtime");function ta({shadowVisible:e}){return(0,aa.jsx)(ea.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var fe=require("react/jsx-runtime"),ra=(0,na.forwardRef)(function({className:t,style:a,columns:n,defaultColumnProps:o,selectionVisible:l,selectorCellShadowVisible:i,scrollDiff:r},d){let s=r<0;return(0,fe.jsx)(be.TableTfoot,{ref:d,className:(0,oa.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,be.rem)(s?r:0)},a],children:(0,fe.jsxs)(be.TableTr,{children:[l&&(0,fe.jsx)(ta,{shadowVisible:i}),n.map(({hidden:p,...u})=>{if(p)return null;let{accessor:f,visibleMediaQuery:c,textAlign:T,width:y,footer:b,footerClassName:w,footerStyle:g,noWrap:L,ellipsis:k}={...o,...u};return(0,fe.jsx)(qt,{className:w,style:g,visibleMediaQuery:c,textAlign:T,width:y,title:b,noWrap:L,ellipsis:k},f)})]})})});var Le=require("@mantine/core"),Ca=M(require("clsx")),ya=require("react");var la=require("@mantine/core"),ia=M(require("clsx")),ft=require("react");var da=require("react/jsx-runtime");function sa({group:{id:e,columns:t,title:a,textAlign:n,className:o,style:l}}){let i=(0,ft.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),r=Bt(i),d=(0,ft.useMemo)(()=>t.filter(({hidden:s},p)=>!s&&r?.[p]).length,[t,r]);return d>0?(0,da.jsx)(la.TableTh,{colSpan:d,className:(0,ia.default)("mantine-datatable-column-group-header-cell",{[$]:n==="left",[U]:n==="center",[K]:n==="right"},o),style:l,children:a??Re(e)}):null}var W=require("@mantine/core"),Ke=M(require("clsx"));var ne=require("@mantine/core"),ma=require("@mantine/hooks");var Ne=require("react/jsx-runtime");function ca(){return(0,Ne.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ne.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ne.jsx)("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}var Ie=require("react/jsx-runtime");function pa(){return(0,Ie.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ie.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ie.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var oe=require("react/jsx-runtime");function ua({children:e,isActive:t}){let[a,{close:n,toggle:o}]=(0,ma.useDisclosure)(!1);return(0,oe.jsxs)(ne.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:a,onClose:n,trapFocus:!0,children:[(0,oe.jsx)(ne.PopoverTarget,{children:(0,oe.jsx)(ne.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:i=>{i.preventDefault(),o()},children:(0,oe.jsx)(t?pa:ca,{})})}),(0,oe.jsx)(ne.Popover.Dropdown,{onClick:i=>i.preventDefault(),children:typeof e=="function"?e({close:n}):e})]})}var re=require("react/jsx-runtime");function fa(){return(0,re.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,re.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,re.jsx)("path",{d:"M12 5l0 14"}),(0,re.jsx)("path",{d:"M16 9l-4 -4"}),(0,re.jsx)("path",{d:"M8 9l4 -4"})]})}var le=require("react/jsx-runtime");function ba(){return(0,le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,le.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,le.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,le.jsx)("path",{d:"M12 3l0 18"})]})}var v=require("react/jsx-runtime");function Ta({className:e,style:t,accessor:a,visibleMediaQuery:n,title:o,sortable:l,sortIcons:i,textAlign:r,width:d,sortStatus:s,onSortStatusChange:p,filter:u,filtering:f}){if(!X(n))return null;let c=o??Re(a),T=typeof c=="string"?c:void 0,y=l&&p?b=>{b?.defaultPrevented||p({columnAccessor:a,direction:s?.columnAccessor===a?s.direction==="asc"?"desc":"asc":s?.direction??"asc"})}:void 0;return(0,v.jsx)(W.TableTh,{className:(0,Ke.default)({"mantine-datatable-header-cell-sortable":l},e),style:[{width:d,minWidth:d,maxWidth:d},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:y,onKeyDown:b=>b.key==="Enter"&&y?.(),children:(0,v.jsxs)(W.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,v.jsx)(W.Box,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-text",{[$]:r==="left",[U]:r==="center",[K]:r==="right"},me,ue),title:T,children:c}),l||s?.columnAccessor===a?(0,v.jsx)(v.Fragment,{children:s?.columnAccessor===a?(0,v.jsx)(W.Center,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":s.direction==="desc"}),role:"img","aria-label":`Sorted ${s.direction==="desc"?"descending":"ascending"}`,children:i?.sorted||(0,v.jsx)(fa,{})}):(0,v.jsx)(W.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:i?.unsorted||(0,v.jsx)(ba,{})})}):null,u?(0,v.jsx)(ua,{isActive:!!f,children:u}):null]})})}var Je=require("@mantine/core"),ha=M(require("clsx"));var bt=require("react/jsx-runtime");function ga({trigger:e,shadowVisible:t,checked:a,indeterminate:n,checkboxProps:o,onChange:l,rowSpan:i}){let r=!o.disabled;return(0,bt.jsx)(Je.TableTh,{className:(0,ha.default)("mantine-datatable-header-selector-cell",{[_]:e==="cell"&&r}),rowSpan:i,"data-shadow-visible":t||void 0,onClick:e==="cell"&&r?l:void 0,children:(0,bt.jsx)(Je.Checkbox,{classNames:r?{input:_}:void 0,checked:a,indeterminate:n,onChange:l,...o,disabled:!(l||o.onChange)||o.disabled})})}var J=require("react/jsx-runtime"),Sa=(0,ya.forwardRef)(function({className:t,style:a,sortStatus:n,sortIcons:o,onSortStatusChange:l,columns:i,defaultColumnProps:r,groups:d,selectionTrigger:s,selectionVisible:p,selectionChecked:u,selectionIndeterminate:f,onSelectionChange:c,selectionCheckboxProps:T,selectorCellShadowVisible:y},b){let w=p?(0,J.jsx)(ga,{trigger:s,shadowVisible:y,checked:u,indeterminate:f,checkboxProps:T,onChange:c,rowSpan:d?2:void 0}):null;return(0,J.jsxs)(Le.TableThead,{className:(0,Ca.default)("mantine-datatable-header",t),style:a,ref:b,children:[d&&(0,J.jsxs)(Le.TableTr,{children:[w,d.map(g=>(0,J.jsx)(sa,{group:g},g.id))]}),(0,J.jsxs)(Le.TableTr,{children:[!d&&w,i.map(({hidden:g,...L})=>{if(g)return null;let{accessor:k,visibleMediaQuery:q,textAlign:D,width:P,title:R,sortable:x,titleClassName:A,titleStyle:ge,filter:Ce,filtering:ye}={...r,...L};return(0,J.jsx)(Ta,{accessor:k,className:A,style:ge,visibleMediaQuery:q,textAlign:D,width:P,title:R,sortable:x,sortStatus:n,sortIcons:o,onSortStatusChange:l,filter:Ce,filtering:ye},k)})]})]})});var Ze=require("@mantine/core"),wa=M(require("clsx")),Tt=require("react/jsx-runtime");function Pa({pt:e,pb:t,fetching:a,customContent:n,backgroundBlur:o,size:l,type:i,color:r}){return(0,Tt.jsx)(Ze.Center,{pt:e,pb:t,className:(0,wa.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":a}),style:[{backdropFilter:o?`blur(${o}px)`:void 0}],children:a&&(n||(0,Tt.jsx)(Ze.Loader,{size:l,type:i,color:r}))})}var Z=require("@mantine/core"),ht=M(require("clsx")),Na=require("react");var h=require("@mantine/core"),va=M(require("clsx"));var xa=require("@mantine/core");function C(e,t,a){return e?(0,xa.parseThemeColor)({color:typeof e=="object"?e[a]:e,theme:t}).value:void 0}function Da({theme:e,c:t,backgroundColor:a,borderColor:n,rowBorderColor:o,stripedColor:l,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":C(t,e,"light"),"--mantine-datatable-color-dark":C(t,e,"dark"),"--mantine-datatable-background-color-light":C(a,e,"light"),"--mantine-datatable-background-color-dark":C(a,e,"dark"),"--mantine-datatable-border-color-light":C(n,e,"light"),"--mantine-datatable-border-color-dark":C(n,e,"dark"),"--mantine-datatable-row-border-color-light":C(o,e,"light"),"--mantine-datatable-row-border-color-dark":C(o,e,"dark"),"--mantine-datatable-striped-color-light":C(l,e,"light"),"--mantine-datatable-striped-color-dark":C(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":C(i,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":C(i,e,"dark")}}function Ye({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:a}){return{"--mantine-datatable-pagination-active-text-color-light":C(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":C(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":C(a,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":C(a,e,"dark")}}function Ma({theme:e,color:t,backgroundColor:a}){return{"--mantine-datatable-row-color-light":C(t,e,"light"),"--mantine-datatable-row-color-dark":C(t,e,"dark"),"--mantine-datatable-row-background-color-light":C(a,e,"light"),"--mantine-datatable-row-background-color-dark":C(a,e,"dark")}}var Te=require("react/jsx-runtime");function ka(){return(0,Te.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Te.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Te.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Te.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var V=require("react/jsx-runtime"),Ra={xs:(0,h.rem)(22),sm:(0,h.rem)(26),md:(0,h.rem)(32),lg:(0,h.rem)(38),xl:(0,h.rem)(44)};function Ea({size:e,label:t,values:a,value:n,activeTextColor:o,activeBackgroundColor:l,onChange:i}){return(0,V.jsxs)(h.Group,{gap:"xs",children:[(0,V.jsx)(h.Text,{size:e,children:t}),(0,V.jsxs)(h.Menu,{withinPortal:!0,withArrow:!0,children:[(0,V.jsx)(h.MenuTarget,{children:(0,V.jsx)(h.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,V.jsx)(ka,{}),style:[{fontWeight:"normal"},r=>({height:Ra[e],paddingLeft:r.spacing[e],paddingRight:r.spacing[e]})],children:n})}),(0,V.jsx)(h.MenuDropdown,{children:a.map(r=>{let d=r===n;return(0,V.jsx)(h.MenuItem,{className:(0,va.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:Ra[e]},d&&(o||l)?s=>Ye({theme:s,paginationActiveTextColor:o,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>i(r),children:(0,V.jsx)(h.Text,{size:e,children:r})},r)})})]})]})}var he=require("react/jsx-runtime"),Ia=(0,Na.forwardRef)(function({className:t,style:a,fetching:n,page:o,onPageChange:l,paginationWithEdges:i,paginationActiveTextColor:r,paginationActiveBackgroundColor:d,paginationSize:s,loadingText:p,noRecordsText:u,paginationText:f,totalRecords:c,recordsPerPage:T,onRecordsPerPageChange:y,recordsPerPageLabel:b,recordsPerPageOptions:w,recordsLength:g,horizontalSpacing:L,paginationWrapBreakpoint:k,getPaginationControlProps:q},D){let P;if(n)P=p;else if(!c)P=u;else{let x=(o-1)*T+1,A=x+g-1;P=f({from:x,to:A,totalRecords:c})}let R=X(({breakpoints:x})=>`(min-width: ${typeof k=="number"?`${(0,Z.rem)(k)}rem`:x[k]||k})`);return(0,he.jsxs)(Z.Box,{ref:D,px:L??"xs",py:"xs",className:(0,ht.default)("mantine-datatable-pagination",t),style:[{flexDirection:R?"row":"column"},a],children:[(0,he.jsx)(Z.Text,{className:"mantine-datatable-pagination-text",size:s,children:P}),w&&(0,he.jsx)(Ea,{activeTextColor:r,activeBackgroundColor:d,size:s,label:b,values:w,value:T,onChange:y}),(0,he.jsx)(Z.Pagination,{classNames:{root:(0,ht.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!g}),control:"mantine-datatable-pagination-pages-control"},style:r||d?x=>Ye({theme:x,paginationActiveTextColor:r,paginationActiveBackgroundColor:d}):void 0,withEdges:i,value:o,onChange:l,size:s,total:Math.ceil(c/T),getControlProps:q})]})});var za=require("@mantine/core"),Wa=M(require("clsx"));var La=require("@mantine/core"),Ha=M(require("clsx"));var Va=require("react/jsx-runtime");function Fa({className:e,style:t,visibleMediaQuery:a,record:n,index:o,onClick:l,onContextMenu:i,noWrap:r,ellipsis:d,textAlign:s,width:p,accessor:u,render:f,defaultRender:c,customCellAttributes:T}){return X(a)?(0,Va.jsx)(La.TableTd,{className:(0,Ha.default)({[me]:r||d,[ue]:d,[_]:l,[$]:s==="left",[U]:s==="center",[K]:s==="right"},e),style:[{width:p,minWidth:p,maxWidth:p},t],onClick:l,onContextMenu:i,...T?.(n,o),children:f?f(n,o):c?c(n,o,u):Ue(n,u)}):null}var ie=require("@mantine/core");var O=require("react/jsx-runtime");function Aa({open:e,colSpan:t,content:a,collapseProps:n}){let{expanded:o,visible:l}=Kt(e,n?.transitionDuration);return l?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(ie.TableTr,{}),(0,O.jsx)(ie.TableTr,{children:(0,O.jsx)(ie.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,O.jsx)(ie.Collapse,{in:o,...n,children:(0,O.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:a()})})})})]}):null}var qe=require("@mantine/core"),_a=M(require("clsx"));var gt=require("react/jsx-runtime");function Oa({record:e,index:t,trigger:a,onChange:n,withRightShadow:o,getCheckboxProps:l,...i}){let r=l(e,t),d=!i.disabled&&!r.disabled,s=p=>{p.stopPropagation(),a==="cell"&&d&&n?.(p)};return(0,gt.jsx)(qe.TableTd,{className:(0,_a.default)("mantine-datatable-row-selector-cell",{[_]:a==="cell"&&d}),"data-shadow-visible":o||void 0,onClick:s,children:(0,gt.jsx)(qe.Checkbox,{classNames:d?{input:_}:void 0,onChange:n,...i,...r})})}var G=require("react/jsx-runtime");function Ga({record:e,index:t,columns:a,defaultColumnProps:n,defaultColumnRender:o,selectionTrigger:l,selectionVisible:i,selectionChecked:r,onSelectionChange:d,isRecordSelectable:s,getSelectionCheckboxProps:p,onClick:u,onContextMenu:f,onCellClick:c,onCellContextMenu:T,expansion:y,customAttributes:b,color:w,backgroundColor:g,className:L,style:k,selectorCellShadowVisible:q}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(za.TableTr,{className:(0,Wa.default)("mantine-datatable-row",{[_]:u||y?.expandOnClick},typeof L=="function"?L(e,t):L),"data-selected":r||void 0,onClick:D=>{if(y){let{isRowExpanded:P,expandOnClick:R,expandRow:x,collapseRow:A}=y;R&&(P(e)?A(e):x(e))}u?.({event:D,record:e,index:t})},onContextMenu:f?D=>f({event:D,record:e,index:t}):void 0,style:[w||g?D=>{let P=w?.(e,t),R=g?.(e,t);return Ma({theme:D,color:P,backgroundColor:R})}:void 0,k?.(e,t)],...b?.(e,t),children:[i&&(0,G.jsx)(Oa,{record:e,index:t,trigger:l,withRightShadow:q,checked:r,disabled:!d||(s?!s(e,t):!1),onChange:d,getCheckboxProps:p}),a.map(({hidden:D,...P},R)=>{if(D)return null;let{accessor:x,visibleMediaQuery:A,textAlign:ge,noWrap:Ce,ellipsis:ye,width:et,render:tt,cellsClassName:Se,cellsStyle:at,customCellAttributes:ot}={...n,...P};return(0,G.jsx)(Fa,{className:typeof Se=="function"?Se(e,t):Se,style:at?.(e,t),visibleMediaQuery:A,record:e,index:t,onClick:c?we=>c({event:we,record:e,index:t,column:P,columnIndex:R}):void 0,onContextMenu:T?we=>T({event:we,record:e,index:t,column:P,columnIndex:R}):void 0,accessor:x,textAlign:ge,noWrap:Ce,ellipsis:ye,width:et,render:tt,defaultRender:o,customCellAttributes:ot},x)})]}),y&&(0,G.jsx)(Aa,{colSpan:a.filter(({hidden:D})=>!D).length+(i?1:0),open:y.isRowExpanded(e),content:y.content({record:e,index:t}),collapseProps:y.collapseProps})]})}var Y=require("@mantine/core"),He=M(require("clsx")),se=require("react/jsx-runtime");function Ba({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:a,rightShadowVisible:n,rightShadowBehind:o,bottomShadowVisible:l,headerHeight:i,footerHeight:r,onScrollPositionChange:d,children:s,viewportRef:p,scrollAreaProps:u}){return(0,se.jsxs)(Y.ScrollArea,{...u,viewportRef:p,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:d,children:[s,(0,se.jsx)(Y.Box,{className:(0,He.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:i?(0,Y.rem)(i):0}}),(0,se.jsx)("div",{className:(0,He.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,se.jsx)("div",{className:(0,He.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,se.jsx)(Y.Box,{className:(0,He.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:r?(0,Y.rem)(r+1):0}})]})}var E=require("react/jsx-runtime");function Xa({withTableBorder:e,borderRadius:t,textSelectionDisabled:a,height:n="100%",minHeight:o,shadow:l,verticalAlign:i="center",fetching:r,columns:d,groups:s,pinLastColumn:p,defaultColumnProps:u,defaultColumnRender:f,idAccessor:c="id",records:T,selectionTrigger:y="checkbox",selectedRecords:b,onSelectedRecordsChange:w,isRecordSelectable:g,allRecordsSelectionCheckboxProps:L={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:k=(N,j)=>({"aria-label":`Select record ${j+1}`}),sortStatus:q,sortIcons:D,onSortStatusChange:P,horizontalSpacing:R,page:x,onPageChange:A,totalRecords:ge,recordsPerPage:Ce,onRecordsPerPageChange:ye,recordsPerPageOptions:et,recordsPerPageLabel:tt="Records per page",paginationWithEdges:Se,paginationActiveTextColor:at,paginationActiveBackgroundColor:ot,paginationSize:we="sm",paginationText:$a=({from:N,to:j,totalRecords:ee})=>`${N} - ${j} / ${ee}`,paginationWrapBreakpoint:Ua="sm",getPaginationControlProps:Ka=N=>N==="previous"?{"aria-label":"Previous page"}:N==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Ja,customLoader:Za,loaderSize:Ya,loaderType:qa,loaderColor:ja,loadingText:eo="...",emptyState:to,noRecordsText:yt="No records",noRecordsIcon:ao,highlightOnHover:oo,striped:no,noHeader:ro,onRowClick:lo,onRowContextMenu:io,onCellClick:so,onCellContextMenu:co,onScroll:St,onScrollToTop:wt,onScrollToBottom:Pt,onScrollToLeft:xt,onScrollToRight:Dt,c:po,backgroundColor:mo,borderColor:uo,rowBorderColor:fo,stripedColor:bo,highlightOnHoverColor:To,rowColor:ho,rowBackgroundColor:go,rowExpansion:Co,rowClassName:yo,rowStyle:So,customRowAttributes:wo,scrollViewportRef:Po,scrollAreaProps:xo,bodyRef:Do,m:Mo,my:ko,mx:Ro,mt:vo,mb:Eo,ml:No,mr:Io,className:Lo,classNames:Pe,style:Ho,styles:xe,...Fo}){let{ref:N,width:j,height:ee}=ce(),Fe=(0,I.useMemo)(()=>s?.flatMap(m=>m.columns)??d,[d,s]),{ref:Vo,height:nt}=ce(),{ref:Ao,width:rt,height:De}=ce(),{ref:_o,height:Oo}=ce(),{ref:zo,height:Mt}=ce(),[lt,kt]=(0,I.useState)(!0),[it,Rt]=(0,I.useState)(!0),[Ve,vt]=(0,I.useState)(!0),[Ae,Et]=(0,I.useState)(!0),Wo=Ut({rowExpansion:Co,records:T,idAccessor:c}),_e=(0,I.useCallback)(()=>{let m=N.current?.scrollTop||0,B=N.current?.scrollLeft||0;if(r||De<=ee)kt(!0),Rt(!0);else{let H=m===0,F=De-m-ee<1;kt(H),Rt(F),H&&H!==lt&&wt?.(),F&&F!==it&&Pt?.()}if(r||rt===j)vt(!0),Et(!0);else{let H=B===0,F=rt-B-j<1;vt(H),Et(F),H&&H!==Ve&&xt?.(),F&&F!==Ae&&Dt?.()}},[r,Pt,xt,Dt,wt,ee,N,j,it,Ve,Ae,lt,De,rt]);Ot(_e,[_e]);let Go=(0,I.useCallback)(m=>{St?.(m),_e()},[_e,St]),Bo=(0,I.useCallback)(m=>{N.current?.scrollTo({top:0,left:0}),A(m)},[A,N]),Oe=T?.length,Nt=T?.map(m=>S(m,c)),Me=!!b,ke=b?.map(m=>S(m,c)),It=Nt!==void 0&&ke!==void 0&&ke.length>0,st=g?T?.filter(g):T,ze=st?.map(m=>S(m,c)),We=It&&ze.every(m=>ke.includes(m)),Qo=It&&ze.some(m=>ke.includes(m)),Xo=(0,I.useCallback)(()=>{b&&w&&w(We?b.filter(m=>!ze.includes(S(m,c))):ve([...b,...st],m=>S(m,c)))},[We,c,w,ze,st,b]),{lastSelectionChangeIndex:Ge,setLastSelectionChangeIndex:$o}=zt(Nt),dt=Me&&!Ve;return(0,E.jsxs)(je.Box,{...{m:Mo,my:ko,mx:Ro,mt:vo,mb:Eo,ml:No,mr:Io},className:(0,Ct.default)("mantine-datatable",{"mantine-datatable-with-border":e},Lo,Pe?.root),style:[m=>({...Da({theme:m,c:po,backgroundColor:mo,borderColor:uo,rowBorderColor:fo,stripedColor:bo,highlightOnHoverColor:To}),borderRadius:m.radius[t]||t,boxShadow:m.shadows[l]||l,height:n,minHeight:o}),Ho,xe?.root],children:[(0,E.jsx)(Ba,{viewportRef:(0,Qa.useMergedRef)(N,Po),topShadowVisible:!lt,leftShadowVisible:!Ve,leftShadowBehind:Me,rightShadowVisible:!Ae,rightShadowBehind:p,bottomShadowVisible:!it,headerHeight:nt,footerHeight:Oo,onScrollPositionChange:Go,scrollAreaProps:xo,children:(0,E.jsxs)(je.Table,{ref:Ao,horizontalSpacing:R,className:(0,Ct.default)("mantine-datatable-table",{[Jt]:a,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":De<ee,"mantine-datatable-pin-last-column":p,"mantine-datatable-pin-last-column-scrolled":!Ae&&p},Pe?.table),style:xe?.table,"data-striped":Oe&&no||void 0,"data-highlight-on-hover":oo||void 0,...Fo,children:[ro?null:(0,E.jsx)(Sa,{ref:Vo,className:Pe?.header,style:xe?.header,columns:Fe,defaultColumnProps:u,groups:s,sortStatus:q,sortIcons:D,onSortStatusChange:P,selectionTrigger:y,selectionVisible:Me,selectionChecked:We,selectionIndeterminate:Qo&&!We,onSelectionChange:Xo,selectionCheckboxProps:L,selectorCellShadowVisible:dt}),(0,E.jsx)("tbody",{ref:Do,children:Oe?T.map((m,B)=>{let H=S(m,c),F=ke?.includes(H)||!1,Lt;return w&&b&&(Lt=Uo=>{if(Uo.nativeEvent.shiftKey&&Ge!==null){let de=T.filter(B>Ge?(te,ae)=>ae>=Ge&&ae<=B&&(g?g(te,ae):!0):(te,ae)=>ae>=B&&ae<=Ge&&(g?g(te,ae):!0));w(F?mt(b,de,te=>S(te,c)):ve([...b,...de],te=>S(te,c)))}else w(F?b.filter(de=>S(de,c)!==H):ve([...b,m],de=>S(de,c)));$o(B)}),(0,E.jsx)(Ga,{record:m,index:B,columns:Fe,defaultColumnProps:u,defaultColumnRender:f,selectionTrigger:y,selectionVisible:Me,selectionChecked:F,onSelectionChange:Lt,isRecordSelectable:g,getSelectionCheckboxProps:k,onClick:lo,onCellClick:so,onContextMenu:io,onCellContextMenu:co,expansion:Wo,color:ho,backgroundColor:go,className:yo,style:So,customAttributes:wo,selectorCellShadowVisible:dt},H)}):(0,E.jsx)(Ft,{})}),Fe.some(({footer:m})=>m)&&(0,E.jsx)(ra,{ref:_o,className:Pe?.footer,style:xe?.footer,columns:Fe,defaultColumnProps:u,selectionVisible:Me,selectorCellShadowVisible:dt,scrollDiff:De-ee})]})}),x&&(0,E.jsx)(Ia,{ref:zo,className:Pe?.pagination,style:xe?.pagination,horizontalSpacing:R,fetching:r,page:x,onPageChange:Bo,totalRecords:ge,recordsPerPage:Ce,onRecordsPerPageChange:ye,recordsPerPageOptions:et,recordsPerPageLabel:tt,paginationWithEdges:Se,paginationActiveTextColor:at,paginationActiveBackgroundColor:ot,paginationSize:we,paginationText:$a,paginationWrapBreakpoint:Ua,getPaginationControlProps:Ka,noRecordsText:yt,loadingText:eo,recordsLength:Oe}),(0,E.jsx)(Pa,{pt:nt,pb:Mt,fetching:r,backgroundBlur:Ja,customContent:Za,size:Ya,type:qa,color:ja}),(0,E.jsx)(At,{pt:nt,pb:Mt,icon:ao,text:yt,active:!r&&!Oe,children:to})]})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy});
2
2
  //# sourceMappingURL=index.js.map