mantine-datatable 9.7.5 → 9.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +3 -1
- package/dist/index.d.ts +146 -132
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +9 -3
- package/dist/styles.layer.css +9 -3
- package/package.json +42 -26
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
"use client";import{ActionIcon as e,Box as t,Button as n,Center as r,Checkbox as i,Collapse as a,Flex as o,Group as s,Loader as c,Menu as l,MenuDropdown as u,MenuItem as d,MenuTarget as f,Pagination as p,Popover as m,PopoverDropdown as h,PopoverTarget as g,ScrollArea as _,Stack as v,Table as y,TableTd as b,TableTfoot as x,TableTh as S,TableThead as C,TableTr as w,Text as T,createSafeContext as E,parseThemeColor as D,rem as O,useDirection as k,useMantineTheme as A}from"@mantine/core";import{useClickOutside as j,useDisclosure as M,useLocalStorage as N,useMediaQuery as ee,useMergedRef as P,useTimeout as F}from"@mantine/hooks";import I from"clsx";import{useCallback as L,useEffect as R,useLayoutEffect as te,useMemo as z,useRef as B,useState as V}from"react";import{Fragment as H,jsx as U,jsxs as W}from"react/jsx-runtime";function G(e,t,n){return e?D({color:typeof e==`object`?e[n]:e,theme:t}).value:void 0}function ne({theme:e,c:t,backgroundColor:n,borderColor:r,rowBorderColor:i,stripedColor:a,highlightOnHoverColor:o}){return{"--mantine-datatable-color-light":G(t,e,`light`),"--mantine-datatable-color-dark":G(t,e,`dark`),"--mantine-datatable-background-color-light":G(n,e,`light`),"--mantine-datatable-background-color-dark":G(n,e,`dark`),"--mantine-datatable-border-color-light":G(r,e,`light`),"--mantine-datatable-border-color-dark":G(r,e,`dark`),"--mantine-datatable-row-border-color-light":G(i,e,`light`),"--mantine-datatable-row-border-color-dark":G(i,e,`dark`),"--mantine-datatable-striped-color-light":G(a,e,`light`),"--mantine-datatable-striped-color-dark":G(a,e,`dark`),"--mantine-datatable-highlight-on-hover-color-light":G(o,e,`light`),"--mantine-datatable-highlight-on-hover-color-dark":G(o,e,`dark`)}}function re({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:n}){return{"--mantine-datatable-pagination-active-text-color-light":G(t,e,`light`),"--mantine-datatable-pagination-active-text-color-dark":G(t,e,`dark`),"--mantine-datatable-pagination-active-background-color-light":G(n,e,`light`),"--mantine-datatable-pagination-active-background-color-dark":G(n,e,`dark`)}}function ie({theme:e,color:t,backgroundColor:n}){return{"--mantine-datatable-row-color-light":G(t,e,`light`),"--mantine-datatable-row-color-dark":G(t,e,`dark`),"--mantine-datatable-row-background-color-light":G(n,e,`light`),"--mantine-datatable-row-background-color-dark":G(n,e,`dark`)}}const[ae,oe]=E(`useDataTableColumnsContext must be used within DataTableColumnProvider`),se=ae,ce=oe,le=e=>{let{children:t,columnsOrder:n,setColumnsOrder:r,columnsToggle:i,setColumnsToggle:a,columnsPinning:o,setColumnsPinning:s,resetColumnsOrder:c,resetColumnsToggle:l,resetColumnsPinning:u,setColumnWidth:d,setMultipleColumnWidths:f,resetColumnsWidth:p,beginResize:m,endResize:h,pinnedMap:g}=e,[_,v]=V(``),[y,b]=V(``);return/* @__PURE__ */ U(se,{value:{sourceColumn:_,setSourceColumn:v,targetColumn:y,setTargetColumn:b,columnsToggle:i,setColumnsToggle:a,columnsPinning:o,setColumnsPinning:s,swapColumns:()=>{if(!n||!r||!_||!y)return;let e=g.get(_),t=g.get(y);if(e?.logicalSide!==t?.logicalSide)return;let i=n.indexOf(_),a=n.indexOf(y);if(i!==-1&&a!==-1){let e=[...n],[t]=e.splice(i,1);e.splice(a,0,t),r(e)}},resetColumnsOrder:c,resetColumnsToggle:l,resetColumnsPinning:u,setColumnWidth:d,setMultipleColumnWidths:f,resetColumnsWidth:p,beginResize:m,endResize:h},children:t})};function ue(){return/* @__PURE__ */ U(`tr`,{className:`mantine-datatable-empty-row`,children:/* @__PURE__ */ U(`td`,{})})}function de(){return/* @__PURE__ */ W(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`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`}),/* @__PURE__ */ U(`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`}),/* @__PURE__ */ U(`path`,{d:`M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4`}),/* @__PURE__ */ U(`path`,{d:`M3 3l18 18`})]})}function fe({icon:e,text:t,active:n,children:i}){return/* @__PURE__ */ U(r,{className:`mantine-datatable-empty-state`,"data-active":n||void 0,children:i||/* @__PURE__ */ W(H,{children:[e||/* @__PURE__ */ U(`div`,{className:`mantine-datatable-empty-state-icon`,children:/* @__PURE__ */ U(de,{})}),/* @__PURE__ */ U(T,{component:`div`,size:`sm`,c:`dimmed`,children:t})]})})}function pe(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 K(e,t,n){return!Array.isArray(e)||n&&!e.every(n)?t:e}function me(e){return typeof e==`object`&&!!e&&typeof e.accessor==`string`}function he(e,t,n){return e.filter(e=>!t.map(n).includes(n(e)))}function ge(e,t){return e.filter((e,n,r)=>n===r.findIndex(n=>t(e)===t(n)))}function _e(e,t){if(t)return t.match(/([^[.\]])+/g).reduce((e,t)=>e&&e[t],e)}function q(e,t){return typeof t==`string`?_e(e,t):t(e)}function ve(e,t){let n=structuredClone(t),r=n[e.source.index];return e.destination&&(n.splice(e.source.index,1),n.splice(e.destination.index,0,r)),n}function ye(e,t){let n=structuredClone(t),r=e.destination;if(!r)return n;let i=n[e.source.index],a=n[r.index];return n.splice(r.index,1,i),n.splice(e.source.index,1,a),n}function be(e){return!e||e.length===0?0:Math.max(...e.map(e=>e.groups&&e.groups.length>0?1+be(e.groups):1))}function xe(e){let t=[];for(let n of e)n.columns&&n.columns.length>0?t.push(...n.columns.filter(e=>e!=null)):n.groups&&n.groups.length>0&&t.push(...xe(n.groups));return t.filter(e=>e!=null)}function Se(e,t){return e.columns&&e.columns.length>0?e.columns.filter((e,n)=>e.hidden?!1:!t||t[n]!==!1).length:e.groups&&e.groups.length>0?e.groups.reduce((e,n)=>e+Se(n,t),0):0}function Ce(e,t,n=0){if(n===t)return[...e];let r=[];for(let i of e)i.groups&&i.groups.length>0&&r.push(...Ce(i.groups,t,n+1));return r}function we(e,t,n){return n?!e||t:!1}function Te({key:e,columns:t=[],getInitialValueInEffect:n=!0}){let r=z(()=>t.map(e=>({accessor:e.accessor,defaultPinned:e.pinned,pinnable:!!e.pinnable,pinned:e.pinned})),[t]),[i,a]=N({key:e?`${e}-columns-pinning`:``,defaultValue:e?r:void 0,getInitialValueInEffect:n}),o=K(i,r,me);function s(t){e&&a(typeof t==`function`?e=>t(e??r):t)}let c=z(()=>{if(!o)return r;let e=[];return o.forEach(n=>{t.find(e=>e.accessor===n.accessor)&&e.push(n)}),t.forEach(t=>{e.find(e=>e.accessor===t.accessor)||e.push({accessor:t.accessor,defaultPinned:t.pinned,pinnable:!!t.pinnable,pinned:t.pinned})}),e},[o,t,r]);R(()=>{e&&o&&JSON.stringify(c)!==JSON.stringify(o)&&a(c)},[e,c,o,a]);let l=()=>{s(r)};return e?{columnsPinning:c,setColumnsPinning:s,resetColumnsPinning:l}:{columnsPinning:r,setColumnsPinning:s,resetColumnsPinning:l}}function Ee({key:e,columns:t=[],getInitialValueInEffect:n=!0}){let r=z(()=>t?t.map(e=>e.accessor):[],[t]),[i,a]=N({key:e?`${e}-columns-order`:``,defaultValue:e?r:void 0,getInitialValueInEffect:n}),o=K(i,r,e=>typeof e==`string`);function s(t){e&&a(t)}let c=z(()=>{if(!o)return r;let e=[];return o.forEach(n=>{t.find(e=>e.accessor===n)&&e.push(n)}),t.forEach(t=>{e.includes(t.accessor)||e.push(t.accessor)}),e},[o,t,r]);R(()=>{e&&o&&JSON.stringify(c)!==JSON.stringify(o)&&a(c)},[e,c,o,a]);let l=()=>{s(r)};return e?{columnsOrder:c,setColumnsOrder:s,resetColumnsOrder:l}:{columnsOrder:r,setColumnsOrder:s,resetColumnsOrder:l}}function De({key:e,columns:t=[],getInitialValueInEffect:n=!0,headerRef:r}){let i=z(()=>t.some(e=>e.resizable&&!e.hidden&&e.accessor!==`__selection__`),[t]),a=L(()=>t.filter(e=>e.accessor!==`__selection__`).map(e=>({[e.accessor]:e.width??`auto`})),[t]),[o,s]=N({key:e?`${e}-columns-width`:``,defaultValue:e?a():void 0,getInitialValueInEffect:n}),c=K(o,[],e=>typeof e==`object`&&!!e),[l,u]=V(()=>e&&c.length>0?c:a()),[d,f]=V(!1),p=B(!1);R(()=>{e&&c&&c.length!==0&&u(c)},[e,c]),R(()=>{u(e=>{let n=new Set(t.filter(e=>e.accessor!==`__selection__`).map(e=>String(e.accessor))),r=e.filter(e=>n.has(Object.keys(e)[0])),i=new Set(r.map(e=>Object.keys(e)[0])),a=!1;for(let e of t){if(e.accessor===`__selection__`)continue;let t=String(e.accessor);i.has(t)||(r.push({[t]:e.width??`auto`}),a=!0)}return r.length!==e.length||a?r:e})},[t]);let m=L(e=>{let t=e.filter(e=>e.accessor!==`__selection__`);t.length!==0&&(p.current=!0,u(e=>e.map(e=>{let n=Object.keys(e)[0],r=t.find(e=>e.accessor===n);return r?{[n]:r.width}:e})))},[]);R(()=>{e&&p.current&&(d||(p.current=!1,s(l)))},[e,l,d,s]);let h=L((e,t)=>{m([{accessor:e,width:t}])},[m]),g=L(e=>{m(e)},[m]),_=L(()=>{f(!0);let e=r?.current;if(!e)return;let t=Array.from(e.querySelectorAll(`th[data-accessor]`));if(t.length===0)return;let n=[];for(let e of t){let t=e.getAttribute(`data-accessor`);if(!t||t===`__selection__`)continue;let r=Math.round(e.getBoundingClientRect().width);n.push({[t]:`${r}px`})}p.current=!0,u(n)},[r]),v=L(()=>{f(!1)},[]);return{columnsWidth:l,setColumnsWidth:m,setColumnWidth:h,setMultipleColumnWidths:g,resetColumnsWidth:L(()=>{let e=a();p.current=!0,u(e),f(!1)},[a]),hasResizableColumns:i,allResizableWidthsInitial:z(()=>{if(!i)return!1;let e=t.filter(e=>e.resizable&&!e.hidden&&e.accessor!==`__selection__`);return l.filter(t=>{let n=Object.keys(t)[0];return e.some(e=>e.accessor===n)}).every(e=>{let t=Object.values(e)[0];return t===`auto`||t===`initial`})},[i,t,l]),measureAndSetColumnWidths:L(()=>{},[]),isResizing:d,beginResize:_,endResize:v}}function Oe({key:e,columns:t=[],getInitialValueInEffect:n=!0}){let r=z(()=>t?.map(e=>({accessor:e.accessor,defaultToggle:e.defaultToggle||!0,toggleable:e.toggleable,toggled:e.defaultToggle===void 0||e.defaultToggle})),[t]),[i,a]=N({key:e?`${e}-columns-toggle`:``,defaultValue:e?r:void 0,getInitialValueInEffect:n}),o=K(i,r,me);function s(t){e&&a(t)}let c=z(()=>{if(!o)return r;let e=[];return o.forEach(n=>{t.find(e=>e.accessor===n.accessor)&&e.push(n)}),t.forEach(t=>{e.find(e=>e.accessor===t.accessor)||e.push({accessor:t.accessor,defaultToggle:t.defaultToggle||!0,toggleable:t.toggleable,toggled:t.defaultToggle===void 0||t.defaultToggle})}),e},[o,t,r]);R(()=>{e&&o&&JSON.stringify(c)!==JSON.stringify(o)&&a(c)},[e,c,o,a]);let l=()=>{s(r)};return e?{columnsToggle:c,setColumnsToggle:s,resetColumnsToggle:l}:{columnsToggle:r,setColumnsToggle:s,resetColumnsToggle:l}}const ke=({key:e,columns:t=[],getInitialValueInEffect:n=!0,headerRef:r,scrollViewportRef:i})=>{let{columnsOrder:a,setColumnsOrder:o,resetColumnsOrder:s}=Ee({key:e,columns:t,getInitialValueInEffect:n}),{columnsToggle:c,setColumnsToggle:l,resetColumnsToggle:u}=Oe({key:e,columns:t,getInitialValueInEffect:n}),{columnsPinning:d,setColumnsPinning:f,resetColumnsPinning:p}=Te({key:e,columns:t,getInitialValueInEffect:n}),{columnsWidth:m,setColumnsWidth:h,setColumnWidth:g,setMultipleColumnWidths:_,resetColumnsWidth:v,hasResizableColumns:y,allResizableWidthsInitial:b,measureAndSetColumnWidths:x,isResizing:S,beginResize:C,endResize:w}=De({key:e,columns:t,getInitialValueInEffect:n,headerRef:r,scrollViewportRef:i}),T=z(()=>{let e;e=a?a.map(e=>t.find(t=>t.accessor===e)).map(e=>{let t=d.find(t=>t.accessor===e?.accessor),n=e?.pinnable?t?.pinned:e?.pinned;return{...e,hidden:e?.hidden||!c.find(t=>t.accessor===e?.accessor)?.toggled,pinned:n}}):t;let n=e.filter(e=>e.pinned===`left`),r=e.filter(e=>!e.pinned),i=e.filter(e=>e.pinned===`right`);return[...n,...r,...i].map(e=>{if(e?.accessor===`__selection__`)return e;let t=e?.accessor,n=m.find(e=>t in e);if(!n)return e;let r=n[t];return r===void 0||r===`auto`||r===`initial`?e:{...e,width:r}})},[t,a,c,d,m]),E=z(()=>{let e=T.filter(e=>!e.hidden&&e.accessor!==`__selection__`);return e.length!==0&&e.every(e=>typeof e.width==`string`&&/px$/.test(e.width))},[T]);return{effectiveColumns:T,setColumnsOrder:o,columnsOrder:a,resetColumnsOrder:s,columnsToggle:c,setColumnsToggle:l,resetColumnsToggle:u,columnsPinning:d,setColumnsPinning:f,resetColumnsPinning:p,columnsWidth:m,setColumnsWidth:h,setColumnWidth:g,setMultipleColumnWidths:_,resetColumnsWidth:v,hasResizableColumns:y,allResizableWidthsInitial:b,measureAndSetColumnWidths:x,isResizing:S,isLocked:E,tableWidth:z(()=>{if(!E)return null;let e=0;for(let t of T){if(t.hidden||t.accessor===`__selection__`)continue;let n=t.width;if(typeof n!=`string`)continue;let r=parseInt(n,10);Number.isNaN(r)||(e+=r)}return e>0?e:null},[E,T]),beginResize:C,endResize:w}},Ae=typeof window<`u`?te:R;function je(e){let t=B(e);return t.current=e,t}const Me=`--mantine-datatable-header-height`,Ne=`--mantine-datatable-footer-height`,Pe=`--mantine-datatable-selection-column-width`,Fe=`--mantine-datatable-last-row-border-bottom`;function J(e,t,n){e?.style.setProperty(t,n)}function Ie(e){let t=e.borderBoxSize?.[0]||e.contentBoxSize?.[0];return t?{width:t.inlineSize,height:t.blockSize}:{width:e.contentRect.width,height:e.contentRect.height}}function Le(e,t,n){if(e){let r=new ResizeObserver(e=>{let n=e[0];n&&t(Ie(n))});return r.observe(e),()=>{r.disconnect(),n()}}}function Re({scrollCallbacks:e,withRowBorders:t}){let n={root:B(null),table:B(null),scrollViewport:B(null),header:B(null),footer:B(null),selectionColumnHeader:B(null)},{root:r,table:i,scrollViewport:a,header:o,footer:s,selectionColumnHeader:c}=n,l=je({withRowBorders:t}),u=je(e),d=B(()=>void 0),f=B(()=>void 0),p=L(e=>{u.current.onScroll?.(e),d.current()},[]);return R(()=>Le(o.current,e=>{J(r.current,Me,`${e.height}px`)},()=>J(r.current,Me,`0`)),[o.current]),R(()=>Le(s.current,e=>{J(r.current,Ne,`${e.height}px`)},()=>J(r.current,Ne,`0`)),[s.current]),R(()=>Le(c.current,e=>{J(r.current,Pe,`${e.width}px`)},()=>J(r.current,Pe,`0`)),[c.current]),Ae(()=>{if(typeof window>`u`)return;let e={top:!0,bottom:!0,left:!0,right:!0},t={width:0,height:0},n={width:0,height:0};function o(t,n){let i=e[t];return e[t]=n,J(r.current,`--mantine-datatable-${t}-shadow-opacity`,n?`0`:`1`),i}function s(){let e=t.height-n.height,i=e<0;J(r.current,`--mantine-datatable-footer-position`,i?`relative`:`sticky`),J(r.current,`--mantine-datatable-footer-bottom`,i?`${e}px`:`0`)}function c(){l.current.withRowBorders&&t.height<n.height?J(r.current,Fe,`${O(`1px`)} solid var(--mantine-datatable-border-color)`):J(r.current,Fe,`unset`)}f.current=c;function p(){let e=u.current,r=a.current,i=r?.scrollTop??0,s=r?.scrollLeft??0,c=i===0,l=t.height-i-n.height<1,d=o(`top`,c),f=o(`bottom`,l);c&&c!==d&&e.onScrollToTop?.(),l&&l!==f&&e.onScrollToBottom?.();let p=r?getComputedStyle(r).direction===`rtl`:!1,m=(r?.scrollWidth??0)-n.width,h,g;if(p){let e=Math.abs(s);g=e<1,h=m-e<1}else h=s<1,g=t.width-s-n.width<1;let _=o(`left`,h),v=o(`right`,g);h&&h!==_&&e.onScrollToLeft?.(),g&&g!==v&&e.onScrollToRight?.()}d.current=p;let m=new ResizeObserver(e=>{for(let r of e)switch(r.target.tagName){case`TABLE`:t=Ie(r);break;case`DIV`:n=Ie(r)}p(),s(),c()});return m.observe(i.current),m.observe(a.current),()=>{m.disconnect()}},[]),Ae(()=>{f.current()},[t]),{refs:n,onScroll:p}}function ze({columns:e,theadRef:t,tbodyRef:n,selectionColumnHeaderRef:r,selectionVisible:i,pinFirstColumn:a,pinLastColumn:o}){let[s,c]=V(/* @__PURE__ */ new Map),l=L(()=>{if(!a&&!o&&!e.some(e=>e.pinned))return;let s=t.current??n.current;if(!s)return;let l=!!t.current,u=l?s.querySelector(`tr:last-of-type`):s.querySelector(`tr:first-of-type`);if(!u)return;let d=getComputedStyle(s).direction===`rtl`,f=/* @__PURE__ */ new Map;if(l)u.querySelectorAll(`th[data-accessor]`).forEach(e=>{let t=e.dataset.accessor;if(t){let n=e.getBoundingClientRect().width;n>0&&f.set(t,n)}});else{let t=e.filter(e=>!e.hidden);u.querySelectorAll(`td:not(.mantine-datatable-row-selector-cell):not(.mantine-datatable-row-expansion-cell)`).forEach((e,n)=>{if(t[n]){let r=e.getBoundingClientRect().width;r>0&&f.set(String(t[n].accessor),r)}})}let p=0;if(i){let e=r.current??s.querySelector(l?`.mantine-datatable-header-selector-cell`:`.mantine-datatable-row-selector-cell`);e&&(p=e.getBoundingClientRect().width)}let m=e.filter(e=>!e.hidden&&f.has(String(e.accessor))).map(e=>String(e.accessor)),h=/* @__PURE__ */ new Map;for(let t of e){let e=String(t.accessor);m.includes(e)&&(t.pinned?h.set(e,t.pinned):a&&e===m[0]&&!h.has(e)?h.set(e,`left`):o&&e===m[m.length-1]&&!h.has(e)&&h.set(e,`right`))}let g=m.filter(e=>h.get(e)===`left`),_=m.filter(e=>h.get(e)===`right`),v=/* @__PURE__ */ new Map,y=p;g.forEach((e,t)=>{v.set(e,{position:d?`right`:`left`,logicalSide:`left`,offset:y,isBoundary:t===g.length-1}),y+=f.get(e)||0});let b=-.4,x=[..._].reverse();x.forEach((e,t)=>{v.set(e,{position:d?`left`:`right`,logicalSide:`right`,offset:b,isBoundary:t===x.length-1}),b+=f.get(e)||0}),c(e=>{if(e.size!==v.size)return v;for(let[t,n]of v){let r=e.get(t);if(!r||r.position!==n.position||r.logicalSide!==n.logicalSide||r.offset!==n.offset||r.isBoundary!==n.isBoundary)return v}return e})},[e,i,t,n,r,a,o]);return R(()=>{if(!a&&!o&&!e.some(e=>e.pinned))return;let r=t.current??n.current;if(!r)return;let i=!!t.current,s=i?r.querySelector(`tr:last-of-type`):r.querySelector(`tr:first-of-type`);if(!s)return;let c=new ResizeObserver(l);return s.querySelectorAll(i?`th`:`td`).forEach(e=>{c.observe(e)}),()=>c.disconnect()},[t,n,l]),Ae(l,[l]),{pinnedMap:s,hasLeftPinned:[...s.values()].some(e=>e.logicalSide===`left`),hasRightPinned:[...s.values()].some(e=>e.logicalSide===`right`)}}function Be(e){let[t,n]=V(null),r=e?.join(`:`)||``;return R(()=>{n(null)},[r]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:n}}function Ve(e,t){let n=()=>{t(e.map(e=>e.matches))},r=e.map(e=>{try{return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)}catch{return e.addListener(n),()=>e.removeListener(n)}});return()=>{r.forEach(e=>{e()})}}function He(e,t){return t||(typeof window<`u`&&`matchMedia`in window?e.map(e=>window.matchMedia(e).matches):e.map(()=>!1))}function Ue(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=V(n?t:He(e,t)),a=B(null);return R(()=>{if(`matchMedia`in window)return a.current=e.map(e=>window.matchMedia(e)),i(a.current.map(e=>e.matches)),Ve(a.current,e=>{i(e)})},[e]),r}function We(e){let t=A();return Ue(z(()=>e.map(e=>(typeof e==`function`?e(t):e)??``),[e,t]),z(()=>e.map(()=>!0),[e]))}function Ge(e){let t=A(),n=typeof e==`function`?e(t):e;return ee(n||``,!0)}function Ke({rowExpansion:e,records:t,idAccessor:n}){let r=[];if(e&&t){let{trigger:i,allowMultiple:a,initiallyExpanded:o}=e;t&&i===`always`?r=t.map(e=>q(e,n)):o&&(r=t.filter((e,t)=>o({record:e,index:t})).map(e=>q(e,n)),a||(r=[r[0]]))}let i,a,o=V(r);if(e){let{expandable:t,trigger:r,allowMultiple:s,collapseProps:c,content:l}=e;e.expanded?{recordIds:i,onRecordIdsChange:a}=e.expanded:[i,a]=o;let u=e=>a?.(i.filter(t=>t!==q(e,n)));return{expandOnClick:r!==`always`&&r!==`never`,isRowExpanded:e=>r===`always`||i.includes(q(e,n)),isExpandable:({record:e,index:n})=>!t||t({record:e,index:n}),expandRow:e=>{let t=q(e,n);a?.(s?[...i,t]:[t])},collapseRow:u,collapseProps:c,content:({record:e,index:t})=>()=>l({record:e,index:t,collapse:()=>u(e)})}}}function qe(e,t){let[n,r]=V(e),[i,a]=V(e),o=F(()=>r(!0),0),s=F(()=>a(!1),t||200);return R(()=>{e?(s.clear(),a(!0),o.start()):(o.clear(),r(!1),s.start())},[o,s,e]),{expanded:n,visible:i}}const Je=`mantine-datatable-nowrap`,Ye=`mantine-datatable-ellipsis`,Y=`mantine-datatable-pointer-cursor`,Xe=`mantine-datatable-context-menu-cursor`,Ze=`mantine-datatable-text-align-left`,Qe=`mantine-datatable-text-align-center`,$e=`mantine-datatable-text-align-right`;function et({className:e,style:t,pinnedInfo:n,visibleMediaQuery:r,title:i,noWrap:a,ellipsis:o,textAlign:s,width:c}){return Ge(r)?/* @__PURE__ */ U(S,{"data-pinned":n?.position,"data-pinned-shadow":n?.isBoundary?n.position:void 0,className:I({[Je]:a||o,[Ye]:o,[Ze]:s===`left`,[Qe]:s===`center`,[$e]:s===`right`},e),style:[{width:c,minWidth:c,maxWidth:c},t,n&&{position:`sticky`,[n.position]:n.offset,overflow:`visible`}],children:i}):null}function tt({shadowVisible:e}){return/* @__PURE__ */ U(S,{className:`mantine-datatable-footer-selector-placeholder-cell`,"data-shadow-visible":e||void 0})}function nt({className:e,style:t,columns:n,defaultColumnProps:r,pinnedMap:i,selectionVisible:a,selectorCellShadowVisible:o,ref:s}){return/* @__PURE__ */ U(x,{ref:s,className:I(`mantine-datatable-footer`,e),style:t,children:/* @__PURE__ */ W(w,{children:[a&&/* @__PURE__ */ U(tt,{shadowVisible:o}),n.map(({hidden:e,...t})=>{if(e)return null;let{accessor:n,visibleMediaQuery:a,textAlign:o,width:s,footer:c,footerClassName:l,footerStyle:u,noWrap:d,ellipsis:f}={...r,...t};return/* @__PURE__ */ U(et,{pinnedInfo:i.get(String(n)),className:l,style:u,visibleMediaQuery:a,textAlign:o,width:s,title:c,noWrap:d,ellipsis:f},n)})]})})}function rt({group:{id:e,columns:t,groups:n,title:r,textAlign:i,className:a,style:o},pinnedInfo:s,maxDepth:c,currentDepth:l,previousGroups:u,isLastGroup:d,withColumnBorders:f=!1,totalTableColumns:p}){let m=z(()=>t&&t.length>0?t:n&&n.length>0?xe([{id:e,columns:t,groups:n}]):[],[t,n,e]),h=We(z(()=>m.map(({visibleMediaQuery:e})=>e),[m])),g=z(()=>Se({id:e,columns:t,groups:n},h),[e,t,n,h]),_=z(()=>u.reduce((e,t)=>e+Se(t,h),0),[u,h]),v=n&&n.length>0?1:c-l,y=we(d,_+g<p,f);return g>0?/* @__PURE__ */ U(S,{colSpan:g,rowSpan:v>1?v:void 0,"data-pinned":s?.position,"data-pinned-shadow":s?.isBoundary?s.position:void 0,className:I(`mantine-datatable-column-group-header-cell`,{[Ze]:i===`left`,[Qe]:i===`center`,[$e]:i===`right`,"mantine-datatable-column-group-header-cell--needs-border":y},a),style:[o,s&&{position:`sticky`,[s.position]:s.offset,overflow:`visible`}],children:r??pe(e)}):null}function it(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`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`})]})}function at(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`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`})]})}function ot({children:t,isActive:n,filterPopoverProps:r,filterPopoverDisableClickOutside:i}){let[a,{close:o,toggle:s}]=M(!1),c=n?at:it,l=j(o);return i&&(l=void 0),/* @__PURE__ */ W(m,{withArrow:!0,shadow:`md`,trapFocus:!0,...r,opened:a,onClose:o,onDismiss:o,children:[/* @__PURE__ */ U(g,{children:/* @__PURE__ */ U(e,{className:`mantine-datatable-header-cell-filter-action-icon`,"data-active":n||void 0,size:`sm`,variant:`default`,onClick:e=>{e.preventDefault(),s()},onKeyDown:e=>e.stopPropagation(),children:/* @__PURE__ */ U(c,{})})}),/* @__PURE__ */ U(h,{ref:l,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:typeof t==`function`?t({close:o}):t})]})}function st(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M5 12l14 0`}),/* @__PURE__ */ U(`path`,{d:`M5 12l6 6`}),/* @__PURE__ */ U(`path`,{d:`M5 12l6 -6`})]})}function ct(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M5 12l14 0`}),/* @__PURE__ */ U(`path`,{d:`M19 12l-6 6`}),/* @__PURE__ */ U(`path`,{d:`M19 12l-6 -6`})]})}function lt(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M9 4v6l-2 4v2h10v-2l-2-4v-6`}),/* @__PURE__ */ U(`path`,{d:`M12 16v5`}),/* @__PURE__ */ U(`path`,{d:`M8 4h8`})]})}function ut(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M18 6l-12 12`}),/* @__PURE__ */ U(`path`,{d:`M6 6l12 12`})]})}function dt({currentPinned:t,onPinChange:n}){let[i,a]=V(!1),o=B(null),[c,l]=V(!1),u=L(()=>{if(o.current){let e=getComputedStyle(o.current).direction;l(e===`rtl`)}},[]);Ae(()=>{u()},[u]),R(()=>{i&&u()},[i,u]);let d=c?`right`:`left`,f=c?`left`:`right`,p=t===d,h=t===f;return/* @__PURE__ */ W(m,{opened:i,onChange:a,position:`bottom`,withArrow:!0,shadow:`sm`,children:[/* @__PURE__ */ U(m.Target,{children:/* @__PURE__ */ U(r,{ref:o,className:`mantine-datatable-header-cell-pinnable-icon`,role:`button`,"aria-label":`Pin column`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:/* @__PURE__ */ U(e,{size:`xs`,variant:`light`,onClick:e=>e.stopPropagation(),children:/* @__PURE__ */ U(lt,{})})})}),/* @__PURE__ */ U(m.Dropdown,{onClick:e=>e.stopPropagation(),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),className:`mantine-datatable-pinnable-dropdown`,children:/* @__PURE__ */ W(s,{gap:4,children:[/* @__PURE__ */ U(e,{size:`sm`,variant:p?`filled`:`light`,onClick:()=>n(p?void 0:d),"aria-label":`Pin left`,children:/* @__PURE__ */ U(st,{})}),/* @__PURE__ */ U(e,{size:`sm`,variant:h?`filled`:`light`,onClick:()=>n(h?void 0:f),"aria-label":`Pin right`,children:/* @__PURE__ */ U(ct,{})}),t&&/* @__PURE__ */ U(e,{size:`sm`,variant:`light`,color:`red`,onClick:()=>n(void 0),"aria-label":`Unpin`,children:/* @__PURE__ */ U(ut,{})})]})})]})}const ft=e=>{let{accessor:t,columnRef:n}=e,[r,i]=V(!1),a=B(0),o=B({current:0,next:0}),{dir:s}=k(),c=s===`rtl`,{setMultipleColumnWidths:l,beginResize:u,endResize:d}=ce(),f=L(e=>{if(e.preventDefault(),e.stopPropagation(),!n.current)return;let r=n.current,s=r.nextElementSibling;for(;s;){let e=s.getAttribute(`data-accessor`);if(e&&e!==`__selection__`)break;s=s.nextElementSibling}if(!s)return;let f=s.getAttribute(`data-accessor`);if(!f)return;let p=r.offsetWidth,m=s.offsetWidth;u(),i(!0),a.current=e.clientX,o.current={current:p,next:m};let h=e=>{let n=e.clientX-a.current;c&&(n=-n);let r=o.current.current-50,i=o.current.next-50,s=Math.max(-r,Math.min(n,i)),u=o.current.current+s,d=o.current.next-s;l([{accessor:t,width:`${u}px`},{accessor:f,width:`${d}px`}])},g=()=>{i(!1),document.body.style.cursor=`initial`,document.body.style.userSelect=`initial`,d(),document.removeEventListener(`mousemove`,h),document.removeEventListener(`mouseup`,g)};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,document.addEventListener(`mousemove`,h),document.addEventListener(`mouseup`,g)},[t,n,c,l,u,d]),p=L(()=>{if(!n.current)return;let e=n.current.nextElementSibling,r=[{accessor:t,width:`auto`}];if(e){let t=e.getAttribute(`data-accessor`);t&&t!==`__selection__`&&r.push({accessor:t,width:`auto`})}l(r)},[t,n,l]);return/* @__PURE__ */ U(`div`,{className:`mantine-datatable-header-resizable-handle`,style:{cursor:r?`col-resize`:void 0},onMouseDown:f,onDoubleClick:p,onClick:e=>e.stopPropagation(),title:`Drag to resize column, double-click to reset`})};function pt(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M8 7l4 -4l4 4`}),/* @__PURE__ */ U(`path`,{d:`M8 17l4 4l4 -4`}),/* @__PURE__ */ U(`path`,{d:`M12 3l0 18`})]})}function mt(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M12 5l0 14`}),/* @__PURE__ */ U(`path`,{d:`M16 9l-4 -4`}),/* @__PURE__ */ U(`path`,{d:`M8 9l4 -4`})]})}function ht(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ U(`path`,{d:`M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ U(`path`,{d:`M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ U(`path`,{d:`M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ U(`path`,{d:`M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ U(`path`,{d:`M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`})]})}function X({className:n,style:i,pinnedInfo:a,accessor:c,visibleMediaQuery:l,title:u,sortable:d,draggable:f,toggleable:p,pinnable:m,resizable:h,sortIcons:g,textAlign:_,width:v,sortStatus:y,onSortStatusChange:b,filter:x,filterPopoverProps:C,filterPopoverDisableClickOutside:w,filtering:T,sortKey:E}){let{setSourceColumn:D,setTargetColumn:O,swapColumns:k,columnsToggle:A,setColumnsToggle:j,columnsPinning:M,setColumnsPinning:N}=ce(),[ee,P]=V(!1),F=B(null),L=M?.find(e=>e.accessor===c)?.pinned;if(!Ge(l))return null;let R=u??pe(c),te=typeof R==`string`?R:void 0,z=d&&b?e=>{e?.defaultPrevented||b({sortKey:E,columnAccessor:c,direction:y?.columnAccessor===c?y.direction===`asc`?`desc`:`asc`:y?.direction??`asc`})}:void 0,H=e=>{e.stopPropagation(),D(c),P(!1)},G=e=>{e.preventDefault(),O(c),P(!0)},ne=()=>{O(c),P(!1),k()},re=()=>{P(!0)},ie=()=>{P(!1)},ae=e=>{e.stopPropagation(),j(A.map(e=>e.accessor===c?{...e,toggled:!1}:e))},oe=e=>{N(t=>t.map(t=>t.accessor===c?{...t,pinned:e}:t))};return/* @__PURE__ */ W(S,{"data-accessor":c,"data-pinned":a?.position,"data-pinned-shadow":a?.isBoundary?a.position:void 0,className:I({"mantine-datatable-header-cell-sortable":d,"mantine-datatable-header-cell-toggleable":p,"mantine-datatable-header-cell-pinnable":m,"mantine-datatable-header-cell-resizable":h},n),style:[{width:v,...h?{}:{minWidth:v,maxWidth:v}},i,a&&{position:`sticky`,[a.position]:a.offset,overflow:`visible`}],role:d?`button`:void 0,tabIndex:d?0:void 0,onClick:z,onKeyDown:e=>e.key===`Enter`&&z?.(),ref:F,children:[/* @__PURE__ */ W(s,{className:`mantine-datatable-header-cell-sortable-group`,justify:`space-between`,wrap:`nowrap`,children:[/* @__PURE__ */ W(o,{align:`center`,w:`100%`,className:I({"mantine-datatable-header-cell-draggable":f,"mantine-datatable-header-cell-drag-over":ee}),draggable:f,onDragStart:f?H:void 0,onDragEnter:f?re:void 0,onDragOver:f?G:void 0,onDrop:f?ne:void 0,onDragLeave:f?ie:void 0,children:[f?/* @__PURE__ */ U(r,{role:`img`,"aria-label":`Drag column`,children:/* @__PURE__ */ U(e,{className:`mantine-datatable-header-cell-draggable-action-icon`,variant:`subtle`,size:`xs`,onClick:e=>{e.stopPropagation()},children:/* @__PURE__ */ U(ht,{})})}):null,/* @__PURE__ */ U(t,{className:I(`mantine-datatable-header-cell-sortable-text`,{[Ze]:_===`left`,[Qe]:_===`center`,[$e]:_===`right`},Je,Ye),title:te,children:R})]}),m?/* @__PURE__ */ U(dt,{currentPinned:L,onPinChange:oe}):null,p?/* @__PURE__ */ U(r,{className:`mantine-datatable-header-cell-toggleable-icon`,role:`img`,"aria-label":`Toggle column`,children:/* @__PURE__ */ U(e,{size:`xs`,variant:`light`,onClick:ae,children:/* @__PURE__ */ U(ut,{})})}):null,d||y?.columnAccessor===c?y?.columnAccessor===c?/* @__PURE__ */ U(r,{className:I(`mantine-datatable-header-cell-sortable-icon`,{"mantine-datatable-header-cell-sortable-icon-reversed":y.direction===`desc`}),role:`img`,"aria-label":`Sorted ${y.direction===`desc`?`descending`:`ascending`}`,children:g?.sorted||/* @__PURE__ */ U(mt,{})}):/* @__PURE__ */ U(r,{className:`mantine-datatable-header-cell-sortable-unsorted-icon`,role:`img`,"aria-label":`Not sorted`,children:g?.unsorted||/* @__PURE__ */ U(pt,{})}):null,x?/* @__PURE__ */ U(ot,{filterPopoverProps:C,isActive:!!T,filterPopoverDisableClickOutside:w,children:x}):null]}),h&&c!==`__selection__`?/* @__PURE__ */ U(ft,{accessor:c,columnRef:F}):null]})}function gt({className:e,style:t,trigger:n,shadowVisible:r,checked:a,indeterminate:o,checkboxProps:s,onChange:c,rowSpan:l,ref:u}){let d=!s.disabled;return/* @__PURE__ */ U(S,{ref:u,className:I(`mantine-datatable-header-selector-cell`,{[Y]:n===`cell`&&d},e),style:t,rowSpan:l,"data-shadow-visible":r||void 0,"data-accessor":`__selection__`,onClick:n===`cell`&&d?c:void 0,children:/* @__PURE__ */ U(i,{classNames:d?{input:Y}:void 0,checked:a,indeterminate:o,onChange:c,...s,disabled:!(c||s.onChange)||s.disabled})})}function _t(e,t){let n=(e.columns??[]).filter(e=>!e.hidden).map(e=>String(e.accessor)),r=n.map(e=>t.get(e)).filter(Boolean);if(r.length===0||r.length!==n.length)return;let i=new Set(r.map(e=>e.logicalSide));if(i.size>1)return;let a=[...i][0],o=a===`left`?n[0]:n[n.length-1],s=t.get(o);if(!s)return;let c=a===`left`?n[n.length-1]:n[0],l=t.get(c);return{...s,isBoundary:l?.isBoundary??!1}}function vt({selectionColumnHeaderRef:e,className:t,style:n,sortStatus:r,sortIcons:a,onSortStatusChange:o,columns:c,defaultColumnProps:l,groups:u,pinnedMap:d,selectionTrigger:f,selectionVisible:p,selectionChecked:_,selectionIndeterminate:y,onSelectionChange:b,selectionCheckboxProps:x,selectorCellShadowVisible:S,selectionColumnClassName:T,selectionColumnStyle:E,withColumnBorders:D=!1,ref:O}){let k=u?be(u):0,A=k>0?k+1:1,j=p?/* @__PURE__ */ U(gt,{ref:e,className:T,style:E,trigger:f,shadowVisible:S,checked:_,indeterminate:y,checkboxProps:x,onChange:b,rowSpan:u?A:void 0}):null,{columnsToggle:M,setColumnsToggle:N}=ce(),[ee,P]=V(!1),F=c.some(e=>e.toggleable),L=F?Object.fromEntries(c.map(({accessor:e,title:t})=>[e,t??pe(String(e))])):void 0,R=/* @__PURE__ */ W(C,{className:I(`mantine-datatable-header`,t),style:n,ref:O,onContextMenu:F?e=>{e.preventDefault(),P(e=>!e)}:void 0,children:[u&&Array.from({length:k},(e,t)=>{let n=Ce(u,t);return/* @__PURE__ */ W(w,{children:[t===0&&j,n.map((e,r)=>/* @__PURE__ */ U(rt,{group:e,pinnedInfo:_t(e,d),maxDepth:k,currentDepth:t,previousGroups:n.slice(0,r),isLastGroup:r===n.length-1,withColumnBorders:D,totalTableColumns:c.length},e.id))]},`group-depth-${t}`)}),/* @__PURE__ */ W(w,{children:[!u&&j,c.map(({hidden:e,...t},n)=>{if(e)return null;let{accessor:i,visibleMediaQuery:s,textAlign:u,width:f,title:p,sortable:m,draggable:h,toggleable:g,pinnable:_,resizable:v,titleClassName:y,titleStyle:b,filter:x,filterPopoverProps:S,filterPopoverDisableClickOutside:C,filtering:w,sortKey:T}={...l,...t};return/* @__PURE__ */ U(X,{accessor:i,pinnedInfo:d.get(String(i)),className:y,style:b,visibleMediaQuery:s,textAlign:u,width:f,title:p,sortable:m,draggable:h,toggleable:g,pinnable:_,resizable:v&&n<c.length-1,sortStatus:r,sortIcons:a,sortKey:T,onSortStatusChange:o,filter:x,filterPopoverProps:S,filterPopoverDisableClickOutside:C,filtering:w},i)})]})]});return F?/* @__PURE__ */ W(m,{position:`bottom`,withArrow:!0,shadow:`md`,opened:ee,onChange:P,children:[/* @__PURE__ */ U(g,{children:R}),/* @__PURE__ */ U(h,{children:/* @__PURE__ */ U(v,{children:M.filter(e=>e.toggleable).map(e=>/* @__PURE__ */ U(s,{children:/* @__PURE__ */ U(i,{classNames:{label:`mantine-datatable-header-column-toggle-checkbox-label`},size:`xs`,label:L[e.accessor],checked:e.toggled,onChange:t=>{N(M.map(n=>n.accessor===e.accessor?{...n,toggled:t.currentTarget.checked}:n))}})},e.accessor))})})]}):R}function yt({fetching:e,customContent:t,backgroundBlur:n,size:i,type:a,color:o}){return/* @__PURE__ */ U(r,{className:I(`mantine-datatable-loader`,{"mantine-datatable-loader-fetching":e}),style:[{backdropFilter:n?`blur(${n}px)`:void 0}],children:e&&(t||/* @__PURE__ */ U(c,{size:i,type:a,color:o}))})}function bt(){return/* @__PURE__ */ W(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ U(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ U(`path`,{d:`M8 9l4 -4l4 4`}),/* @__PURE__ */ U(`path`,{d:`M16 15l-4 4l-4 -4`})]})}const xt={xs:O(22),sm:O(26),md:O(32),lg:O(38),xl:O(44)};function St({size:e,label:t,values:r,value:i,activeTextColor:a,activeBackgroundColor:o,onChange:c}){return/* @__PURE__ */ W(s,{gap:`xs`,children:[/* @__PURE__ */ U(T,{component:`div`,size:e,children:t}),/* @__PURE__ */ W(l,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:`mantine-datatable-page-size-selector-menu-arrow`},children:[/* @__PURE__ */ U(f,{children:/* @__PURE__ */ U(n,{size:e,variant:`default`,classNames:{section:`mantine-datatable-page-size-selector-button-icon`},rightSection:/* @__PURE__ */ U(bt,{}),style:[{fontWeight:`normal`},t=>({height:xt[e],paddingLeft:t.spacing[e],paddingRight:t.spacing[e]})],children:i})}),/* @__PURE__ */ U(u,{children:r.map(t=>{let n=t===i;return/* @__PURE__ */ U(d,{className:I({"mantine-datatable-page-size-selector-active":n}),style:[{height:xt[e]},n&&(a||o)?e=>re({theme:e,paginationActiveTextColor:a,paginationActiveBackgroundColor:o}):void 0],disabled:n,onClick:()=>c(t),children:/* @__PURE__ */ U(T,{component:`div`,size:e,children:t})},t)})})]})]})}function Ct({className:e,style:n,fetching:r,page:i,onPageChange:a,paginationWithEdges:o,paginationWithControls:s,paginationActiveTextColor:c,paginationActiveBackgroundColor:l,paginationSize:u,loadingText:d,noRecordsText:f,paginationText:m,totalRecords:h,recordsPerPage:g,onRecordsPerPageChange:_,recordsPerPageLabel:v,recordsPerPageOptions:y,recordsLength:b,horizontalSpacing:x,paginationWrapBreakpoint:S,getPaginationControlProps:C,getPaginationItemProps:w,renderPagination:E}){let D;if(h){let e=(i-1)*g+1;D=m({from:e,to:e+(b||0)-1,totalRecords:h})}else D=r?d:f;let k=h&&g?Math.max(1,Math.ceil(h/g)):1,A=h?(i-1)*(g??0)+1:void 0,j=h?(A??1)+(b??0)-1:void 0,M=!Ge(({breakpoints:e})=>`(min-width: ${typeof S==`number`?`${O(S)}rem`:e[S]||S})`),N={Text:e=>/* @__PURE__ */ U(T,{component:`div`,className:`mantine-datatable-pagination-text`,size:u,...e,children:D}),PageSizeSelector:e=>y?/* @__PURE__ */ U(St,{activeTextColor:c,activeBackgroundColor:l,size:u,label:v,values:y,value:g,onChange:_,...e}):null,Pagination:e=>/* @__PURE__ */ U(p,{classNames:{root:I(`mantine-datatable-pagination-pages`,{"mantine-datatable-pagination-pages-fetching":r||!b}),control:`mantine-datatable-pagination-pages-control`},style:c||l?e=>re({theme:e,paginationActiveTextColor:c,paginationActiveBackgroundColor:l}):void 0,withEdges:o,withControls:s,value:i,onChange:a,size:u,total:k,getControlProps:C,getItemProps:w,...e})},ee={state:{paginationSize:u,page:i,totalPages:k,totalRecords:h,recordsPerPage:g,recordsLength:b,fetching:r,from:A,to:j,isWrapped:M},actions:{setPage:e=>a?.(e),setRecordsPerPage:_?e=>_(e):void 0},Controls:N};return/* @__PURE__ */ U(t,{px:x??`xs`,py:`xs`,className:I(`mantine-datatable-pagination`,e),style:[{flexDirection:M?`column`:`row`},n],children:typeof E==`function`?E(ee):/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(N.Text,{}),/* @__PURE__ */ U(N.PageSizeSelector,{}),/* @__PURE__ */ U(N.Pagination,{})]})})}function wt({className:e,style:t,pinnedInfo:n,visibleMediaQuery:r,record:i,index:a,onClick:o,onDoubleClick:s,onContextMenu:c,noWrap:l,ellipsis:u,textAlign:d,width:f,accessor:p,render:m,defaultRender:h,customCellAttributes:g}){return Ge(r)?/* @__PURE__ */ U(b,{"data-pinned":n?.position,"data-pinned-shadow":n?.isBoundary?n.position:void 0,className:I({[Je]:l||u,[Ye]:u,[Y]:o||s,[Xe]:c,[Ze]:d===`left`,[Qe]:d===`center`,[$e]:d===`right`},e),style:[{width:f,minWidth:f,maxWidth:f},t,n&&{position:`sticky`,[n.position]:n.offset,overflow:`visible`}],onClick:o,onDoubleClick:s,onContextMenu:c,...g?.(i,a),children:m?m(i,a):h?h(i,a,p):_e(i,p)}):null}function Z({open:e,colSpan:t,content:n,collapseProps:r}){let{expanded:i,visible:o}=qe(e,r?.transitionDuration);return o?/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(w,{}),/* @__PURE__ */ U(w,{children:/* @__PURE__ */ U(b,{className:`mantine-datatable-row-expansion-cell`,colSpan:t,children:/* @__PURE__ */ U(a,{expanded:i,...r,children:/* @__PURE__ */ U(`div`,{className:`mantine-datatable-row-expansion-cell-content`,children:n()})})})})]}):null}function Tt({className:e,style:t,record:n,index:r,trigger:a,onChange:o,withRightShadow:s,checkboxProps:c,getCheckboxProps:l,...u}){let d={...c,...l(n,r)},f=!u.disabled&&!d.disabled,p=e=>{e.stopPropagation(),a===`cell`&&f&&o?.(e)};return/* @__PURE__ */ U(b,{className:I(`mantine-datatable-row-selector-cell`,{[Y]:a===`cell`&&f},e),style:t,"data-shadow-visible":s||void 0,onClick:p,children:/* @__PURE__ */ U(i,{classNames:f?{input:Y}:void 0,onChange:o,...u,...d})})}function Et({record:e,index:t,columns:n,defaultColumnProps:r,pinnedMap:i,defaultColumnRender:a,selectionTrigger:o,selectionVisible:s,selectionChecked:c,onSelectionChange:l,isRecordSelectable:u,selectionCheckboxProps:d,getSelectionCheckboxProps:f,onClick:p,onDoubleClick:m,onContextMenu:h,onCellClick:g,onCellDoubleClick:_,onCellContextMenu:v,expansion:y,customAttributes:b,color:x,backgroundColor:S,className:C,style:T,selectorCellShadowVisible:E,selectionColumnClassName:D,selectionColumnStyle:O,rowFactory:k}){let A=/* @__PURE__ */ W(H,{children:[s&&/* @__PURE__ */ U(Tt,{className:D,style:O,record:e,index:t,trigger:o,withRightShadow:E,checked:c,disabled:!l||(u?!u(e,t):!1),onChange:l,checkboxProps:d,getCheckboxProps:f}),n.map(({hidden:n,hiddenContent:o,...s},c)=>{if(n||o)return null;let{accessor:l,visibleMediaQuery:u,textAlign:d,noWrap:f,ellipsis:p,width:m,render:h,cellsClassName:y,cellsStyle:b,customCellAttributes:x}={...r,...s};return/* @__PURE__ */ U(wt,{pinnedInfo:i.get(String(l)),className:typeof y==`function`?y(e,t):y,style:b?.(e,t),visibleMediaQuery:u,record:e,index:t,onClick:g?n=>g({event:n,record:e,index:t,column:s,columnIndex:c}):void 0,onDoubleClick:_?n=>_({event:n,record:e,index:t,column:s,columnIndex:c}):void 0,onContextMenu:v?n=>v({event:n,record:e,index:t,column:s,columnIndex:c}):void 0,accessor:l,textAlign:d,noWrap:f,ellipsis:p,width:m,render:h,defaultRender:a,customCellAttributes:x},l)})]}),j=y&&/* @__PURE__ */ U(Z,{colSpan:n.filter(({hidden:e})=>!e).length+ +!!s,open:y.isRowExpanded(e),content:y.content({record:e,index:t}),collapseProps:y.collapseProps}),M=Q({record:e,index:t,selectionChecked:c,onClick:p,onDoubleClick:m,onContextMenu:h,expansion:y,customAttributes:b,color:x,backgroundColor:S,className:C,style:T});return k?k({record:e,index:t,rowProps:M,children:A,expandedElement:j}):/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(w,{...M,children:A}),j]})}function Q({record:e,index:t,selectionChecked:n,onClick:r,onDoubleClick:i,onContextMenu:a,expansion:o,customAttributes:s,color:c,backgroundColor:l,className:u,style:d}){return{className:I(`mantine-datatable-row`,{[Y]:r||i||o?.isExpandable({record:e,index:t})&&o?.expandOnClick},{[Xe]:a},typeof u==`function`?u(e,t):u),"data-selected":n||void 0,onClick:n=>{if(o){let{isExpandable:n,isRowExpanded:r,expandOnClick:i,expandRow:a,collapseRow:s}=o;n({record:e,index:t})&&i&&(r(e)?s(e):a(e))}r?.({event:n,record:e,index:t})},onDoubleClick:i?n=>i({event:n,record:e,index:t}):void 0,onContextMenu:a?n=>a({event:n,record:e,index:t}):void 0,style:[c||l?n=>{let r=c?.(e,t),i=l?.(e,t);return ie({theme:n,color:r,backgroundColor:i})}:void 0,d?.(e,t)],...s?.(e,t)??{}}}function Dt({leftShadowBehind:e,rightShadowBehind:n,onScrollPositionChange:r,children:i,viewportRef:a,scrollAreaProps:o}){return/* @__PURE__ */ W(_,{...o,viewportRef:a,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:r,children:[i,/* @__PURE__ */ U(t,{className:I(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-top-shadow`)}),/* @__PURE__ */ U(`div`,{className:I(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-left-shadow`,{"mantine-datatable-scroll-area-shadow-behind":e})}),/* @__PURE__ */ U(`div`,{className:I(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-right-shadow`,{"mantine-datatable-scroll-area-shadow-behind":n})}),/* @__PURE__ */ U(t,{className:I(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-bottom-shadow`)})]})}function $({withTableBorder:e,borderRadius:n,textSelectionDisabled:r,height:i=`100%`,minHeight:a,maxHeight:o,shadow:s,verticalAlign:c=`center`,fetching:l,columns:u,storeColumnsKey:d,groups:f,pinFirstColumn:p,pinLastColumn:m,defaultColumnProps:h,defaultColumnRender:g,idAccessor:_=`id`,records:v,selectionTrigger:b=`checkbox`,selectedRecords:x,onSelectedRecordsChange:S,selectionColumnClassName:C,selectionColumnStyle:w,isRecordSelectable:T,selectionCheckboxProps:E,allRecordsSelectionCheckboxProps:D={"aria-label":`Select all records`},getRecordSelectionCheckboxProps:O=(e,t)=>({"aria-label":`Select record ${t+1}`}),sortStatus:k,sortIcons:A,onSortStatusChange:j,horizontalSpacing:M,page:N,onPageChange:ee,totalRecords:F,recordsPerPage:V,onRecordsPerPageChange:H,recordsPerPageOptions:G,recordsPerPageLabel:re=`Records per page`,paginationWithEdges:ie,paginationWithControls:ae,paginationActiveTextColor:oe,paginationActiveBackgroundColor:se,paginationSize:ce=`sm`,paginationText:de=({from:e,to:t,totalRecords:n})=>`${e} - ${t} / ${n}`,paginationWrapBreakpoint:pe=`sm`,getPaginationControlProps:K=e=>e===`previous`?{"aria-label":`Previous page`}:e===`next`?{"aria-label":`Next page`}:{},getPaginationItemProps:me,renderPagination:_e,loaderBackgroundBlur:ve,customLoader:ye,loaderSize:be,loaderType:Se,loaderColor:Ce,loadingText:we=`...`,emptyState:Te,noRecordsText:Ee=`No records`,noRecordsIcon:De,highlightOnHover:Oe,striped:Ae,noHeader:je,onRowClick:Me,onRowDoubleClick:Ne,onRowContextMenu:Pe,onCellClick:Fe,onCellDoubleClick:J,onCellContextMenu:Ie,onScroll:Le,onScrollToTop:Ve,onScrollToBottom:He,onScrollToLeft:Ue,onScrollToRight:We,c:Ge,backgroundColor:qe,borderColor:Je,rowBorderColor:Ye,stripedColor:Y,highlightOnHoverColor:Xe,rowColor:Ze,rowBackgroundColor:Qe,rowExpansion:$e,rowClassName:et,rowStyle:tt,customRowAttributes:rt,scrollViewportRef:it,scrollAreaProps:at,tableRef:ot,bodyRef:st,m:ct,my:lt,mx:ut,mt:dt,mb:ft,ml:pt,mr:mt,className:ht,classNames:X,style:gt,styles:_t,rowFactory:bt,tableWrapper:xt,...St}){let wt=z(()=>f?xe(f):u,[u,f]),{refs:Z,onScroll:Tt}=Re({scrollCallbacks:{onScroll:Le,onScrollToTop:Ve,onScrollToBottom:He,onScrollToLeft:Ue,onScrollToRight:We},withRowBorders:St.withRowBorders}),Q=ke({key:d,columns:wt,headerRef:Z.header,scrollViewportRef:Z.scrollViewport}),$=Q.effectiveColumns,Ot=P(Z.table,ot),kt=P(Z.scrollViewport,it),At=B(null),jt=P(At,st),Mt=Ke({rowExpansion:$e,records:v,idAccessor:_}),{pinnedMap:Nt,hasLeftPinned:Pt,hasRightPinned:Ft}=ze({columns:$,theadRef:Z.header,tbodyRef:At,selectionColumnHeaderRef:Z.selectionColumnHeader,selectionVisible:!!x,pinFirstColumn:p,pinLastColumn:m}),It=B(!1),Lt=B(N),Rt=B(v),zt=L(e=>{It.current=!0,Rt.current=v,ee(e)},[ee,v]);R(()=>{Lt.current!==N&&(It.current=!0,Rt.current=v,Lt.current=N)},[N,v]);let Bt=v?.length;te(()=>{if(!It.current||l||v===Rt.current)return;let e=Z.scrollViewport.current;if(!e)return;let t=requestAnimationFrame(()=>{e.scrollTo({top:0,left:0}),It.current=!1});return()=>cancelAnimationFrame(t)},[l,v,Z.scrollViewport]);let Vt=v?.map(e=>q(e,_)),Ht=!!x,Ut=x?.map(e=>q(e,_)),Wt=Vt!==void 0&&Ut!==void 0&&Ut.length>0,Gt=T?v?.filter(T):v,Kt=Gt?.map(e=>q(e,_)),qt=Wt&&Kt.every(e=>Ut.includes(e)),Jt=Wt&&Kt.some(e=>Ut.includes(e)),Yt=L(()=>{x&&S&&S(qt?x.filter(e=>!Kt.includes(q(e,_))):ge([...x,...Gt],e=>q(e,_)))},[qt,_,S,Kt,Gt,x]),{lastSelectionChangeIndex:Xt,setLastSelectionChangeIndex:Zt}=Be(Vt),Qt=Ht&&!Pt,$t={m:ct,my:lt,mx:ut,mt:dt,mb:ft,ml:pt,mr:mt},en=L(({children:e})=>xt?xt({children:e}):e,[xt]);return/* @__PURE__ */ U(le,{...Q,pinnedMap:Nt,children:/* @__PURE__ */ W(t,{ref:Z.root,...$t,className:I(`mantine-datatable`,{"mantine-datatable-with-border":e},ht,X?.root),style:[e=>({...ne({theme:e,c:Ge,backgroundColor:qe,borderColor:Je,rowBorderColor:Ye,stripedColor:Y,highlightOnHoverColor:Xe}),borderRadius:e.radius[n]||n,boxShadow:e.shadows[s]||s,height:i,minHeight:a,maxHeight:o}),gt,_t?.root,{position:`relative`}],children:[/* @__PURE__ */ U(Dt,{viewportRef:kt,leftShadowBehind:Ht||Pt,rightShadowBehind:Ft,onScrollPositionChange:Tt,scrollAreaProps:at,children:/* @__PURE__ */ U(en,{children:/* @__PURE__ */ W(y,{ref:Ot,horizontalSpacing:M,className:I(`mantine-datatable-table`,{"mantine-datatable-text-selection-disabled":r,"mantine-datatable-vertical-align-top":c===`top`,"mantine-datatable-vertical-align-bottom":c===`bottom`,"mantine-datatable-selection-column-visible":Ht,"mantine-datatable-resizable-columns":Q.hasResizableColumns,"mantine-datatable-resize-locked":Q.isLocked,"mantine-datatable-resizing":Q.isResizing},X?.table),style:[_t?.table,Q.isLocked?{tableLayout:`fixed`}:void 0,Q.tableWidth==null?void 0:{width:`${Q.tableWidth}px`}],"data-striped":Bt&&Ae||void 0,"data-highlight-on-hover":Oe||void 0,...St,children:[je?null:/* @__PURE__ */ U(le,{...Q,pinnedMap:Nt,children:/* @__PURE__ */ U(vt,{ref:Z.header,selectionColumnHeaderRef:Z.selectionColumnHeader,className:X?.header,style:_t?.header,columns:$,defaultColumnProps:h,groups:f,pinnedMap:Nt,sortStatus:k,sortIcons:A,onSortStatusChange:j,selectionTrigger:b,selectionVisible:Ht,selectionChecked:qt,selectionIndeterminate:Jt&&!qt,onSelectionChange:Yt,selectionCheckboxProps:{...E,...D},selectorCellShadowVisible:Qt,selectionColumnClassName:C,selectionColumnStyle:w,withColumnBorders:St.withColumnBorders})}),/* @__PURE__ */ U(`tbody`,{ref:jt,children:Bt?v.map((e,t)=>{let n=q(e,_),r=Ut?.includes(n)||!1,i;return S&&x&&(i=i=>{if(i.nativeEvent.shiftKey&&Xt!==null){let e=v.filter(t>Xt?(e,n)=>n>=Xt&&n<=t&&(!T||T(e,n)):(e,n)=>n>=t&&n<=Xt&&(!T||T(e,n)));S(r?he(x,e,e=>q(e,_)):ge([...x,...e],e=>q(e,_)))}else S(r?x.filter(e=>q(e,_)!==n):ge([...x,e],e=>q(e,_)));Zt(t)}),/* @__PURE__ */ U(Et,{record:e,index:t,columns:$,defaultColumnProps:h,pinnedMap:Nt,defaultColumnRender:g,selectionTrigger:b,selectionVisible:Ht,selectionChecked:r,onSelectionChange:i,isRecordSelectable:T,selectionCheckboxProps:E,getSelectionCheckboxProps:O,onClick:Me,onDoubleClick:Ne,onCellClick:Fe,onCellDoubleClick:J,onContextMenu:Pe,onCellContextMenu:Ie,expansion:Mt,color:Ze,backgroundColor:Qe,className:et,style:tt,customAttributes:rt,selectorCellShadowVisible:Qt,selectionColumnClassName:C,selectionColumnStyle:w,idAccessor:_,rowFactory:bt},n)}):/* @__PURE__ */ U(ue,{})}),$.some(({footer:e})=>e)&&/* @__PURE__ */ U(nt,{ref:Z.footer,className:X?.footer,style:_t?.footer,columns:$,defaultColumnProps:h,pinnedMap:Nt,selectionVisible:Ht,selectorCellShadowVisible:Qt})]})})}),!!(N&&Bt)&&/* @__PURE__ */ U(Ct,{className:X?.pagination,style:_t?.pagination,horizontalSpacing:M,fetching:l,page:N,onPageChange:zt,totalRecords:F,recordsPerPage:V,onRecordsPerPageChange:H,recordsPerPageOptions:G,recordsPerPageLabel:re,paginationWithEdges:ie,paginationWithControls:ae,paginationActiveTextColor:oe,paginationActiveBackgroundColor:se,paginationSize:ce,paginationText:de,paginationWrapBreakpoint:pe,getPaginationControlProps:K,getPaginationItemProps:me,noRecordsText:Ee,loadingText:we,recordsLength:Bt,renderPagination:_e}),/* @__PURE__ */ U(yt,{fetching:l,backgroundBlur:ve,customContent:ye,size:be,type:Se,color:Ce}),/* @__PURE__ */ U(fe,{icon:De,text:Ee,active:!l&&!Bt,children:Te})]})})}function Ot({className:e,children:t,isDragging:n,ref:r,...i}){let a=B(null),o=P(a,r);return R(()=>{if(!a.current||!n)return;let e=a.current.parentElement.parentElement.children[0].children[0];for(let t=0;t<e.children.length;t++){let n=e.children[t].getBoundingClientRect(),r=a.current.children[t];r.style.height=`${n.height}px`,r.style.width=`${n.width}px`,r.style.minWidth=`${n.width}px`,r.style.maxWidth=`${n.width}px`}},[n,t]),/* @__PURE__ */ U(w,{"data-is-dragging":n,ref:o,...i,className:e,children:t})}export{$ as DataTable,Ot as DataTableDraggableRow,Se as calculateColSpan,he as differenceBy,xe as flattenColumns,Ce as getGroupsAtDepth,be as getMaxGroupDepth,q as getRecordId,_e as getValueAtPath,me as hasStringAccessor,pe as humanize,we as needsRightBorder,ve as reorderRecords,K as sanitizeStoredArray,ye as swapRecords,ge as uniqBy,ke as useDataTableColumns};
|
|
1
|
+
"use client";import{ActionIcon as e,Box as t,Button as n,Center as r,Checkbox as i,Collapse as a,Flex as o,Group as s,Loader as c,Menu as l,MenuDropdown as u,MenuItem as d,MenuTarget as f,Pagination as p,Popover as m,PopoverDropdown as h,PopoverTarget as g,ScrollArea as _,Stack as v,Table as y,TableTd as b,TableTfoot as x,TableTh as S,TableThead as C,TableTr as w,Text as T,createSafeContext as E,parseThemeColor as D,rem as O,useDirection as k,useMantineTheme as A}from"@mantine/core";import{useClickOutside as j,useDisclosure as M,useLocalStorage as N,useMediaQuery as P,useMergedRef as F,useTimeout as I}from"@mantine/hooks";import L from"clsx";import{useCallback as R,useEffect as z,useLayoutEffect as ee,useMemo as B,useRef as V,useState as H}from"react";import{Fragment as U,jsx as W,jsxs as G}from"react/jsx-runtime";function K(e,t,n){return e?D({color:typeof e==`object`?e[n]:e,theme:t}).value:void 0}function te({theme:e,c:t,backgroundColor:n,borderColor:r,rowBorderColor:i,stripedColor:a,highlightOnHoverColor:o,selectionColor:s}){return{"--mantine-datatable-color-light":K(t,e,`light`),"--mantine-datatable-color-dark":K(t,e,`dark`),"--mantine-datatable-background-color-light":K(n,e,`light`),"--mantine-datatable-background-color-dark":K(n,e,`dark`),"--mantine-datatable-border-color-light":K(r,e,`light`),"--mantine-datatable-border-color-dark":K(r,e,`dark`),"--mantine-datatable-row-border-color-light":K(i,e,`light`),"--mantine-datatable-row-border-color-dark":K(i,e,`dark`),"--mantine-datatable-striped-color-light":K(a,e,`light`),"--mantine-datatable-striped-color-dark":K(a,e,`dark`),"--mantine-datatable-highlight-on-hover-color-light":K(o,e,`light`),"--mantine-datatable-highlight-on-hover-color-dark":K(o,e,`dark`),"--mantine-datatable-selection-color-light":K(s,e,`light`),"--mantine-datatable-selection-color-dark":K(s,e,`dark`)}}function ne({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:n}){return{"--mantine-datatable-pagination-active-text-color-light":K(t,e,`light`),"--mantine-datatable-pagination-active-text-color-dark":K(t,e,`dark`),"--mantine-datatable-pagination-active-background-color-light":K(n,e,`light`),"--mantine-datatable-pagination-active-background-color-dark":K(n,e,`dark`)}}function re({theme:e,color:t,backgroundColor:n}){return{"--mantine-datatable-row-color-light":K(t,e,`light`),"--mantine-datatable-row-color-dark":K(t,e,`dark`),"--mantine-datatable-row-background-color-light":K(n,e,`light`),"--mantine-datatable-row-background-color-dark":K(n,e,`dark`)}}const[ie,ae]=E(`useDataTableColumnsContext must be used within DataTableColumnProvider`),oe=ie,se=ae,ce=e=>{let{children:t,columnsOrder:n,setColumnsOrder:r,columnsToggle:i,setColumnsToggle:a,columnsPinning:o,setColumnsPinning:s,resetColumnsOrder:c,resetColumnsToggle:l,resetColumnsPinning:u,setColumnWidth:d,setMultipleColumnWidths:f,resetColumnsWidth:p,beginResize:m,endResize:h,pinnedMap:g}=e,[_,v]=H(``),[y,b]=H(``);return/* @__PURE__ */ W(oe,{value:{sourceColumn:_,setSourceColumn:v,targetColumn:y,setTargetColumn:b,columnsToggle:i,setColumnsToggle:a,columnsPinning:o,setColumnsPinning:s,swapColumns:()=>{if(!n||!r||!_||!y)return;let e=g.get(_),t=g.get(y);if(e?.logicalSide!==t?.logicalSide)return;let i=n.indexOf(_),a=n.indexOf(y);if(i!==-1&&a!==-1){let e=[...n],[t]=e.splice(i,1);e.splice(a,0,t),r(e)}},resetColumnsOrder:c,resetColumnsToggle:l,resetColumnsPinning:u,setColumnWidth:d,setMultipleColumnWidths:f,resetColumnsWidth:p,beginResize:m,endResize:h},children:t})};function le(){return/* @__PURE__ */ W(`tr`,{className:`mantine-datatable-empty-row`,children:/* @__PURE__ */ W(`td`,{})})}function ue(){return/* @__PURE__ */ G(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`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`}),/* @__PURE__ */ W(`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`}),/* @__PURE__ */ W(`path`,{d:`M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4`}),/* @__PURE__ */ W(`path`,{d:`M3 3l18 18`})]})}function de({icon:e,text:t,active:n,children:i}){return/* @__PURE__ */ W(r,{className:`mantine-datatable-empty-state`,"data-active":n||void 0,children:i||/* @__PURE__ */ G(U,{children:[e||/* @__PURE__ */ W(`div`,{className:`mantine-datatable-empty-state-icon`,children:/* @__PURE__ */ W(ue,{})}),/* @__PURE__ */ W(T,{component:`div`,size:`sm`,c:`dimmed`,children:t})]})})}function fe(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 q(e,t,n){return!Array.isArray(e)||n&&!e.every(n)?t:e}function pe(e){return typeof e==`object`&&!!e&&typeof e.accessor==`string`}function me(e,t,n){return e.filter(e=>!t.map(n).includes(n(e)))}function he(e,t){return e.filter((e,n,r)=>n===r.findIndex(n=>t(e)===t(n)))}function ge(e,t){if(t)return t.match(/([^[.\]])+/g).reduce((e,t)=>e&&e[t],e)}function J(e,t){return typeof t==`string`?ge(e,t):t(e)}function _e(e,t){let n=structuredClone(t),r=n[e.source.index];return e.destination&&(n.splice(e.source.index,1),n.splice(e.destination.index,0,r)),n}function ve(e,t){let n=structuredClone(t),r=e.destination;if(!r)return n;let i=n[e.source.index],a=n[r.index];return n.splice(r.index,1,i),n.splice(e.source.index,1,a),n}function ye(e){return!e||e.length===0?0:Math.max(...e.map(e=>e.groups&&e.groups.length>0?1+ye(e.groups):1))}function be(e){let t=[];for(let n of e)n.columns&&n.columns.length>0?t.push(...n.columns.filter(e=>e!=null)):n.groups&&n.groups.length>0&&t.push(...be(n.groups));return t.filter(e=>e!=null)}function xe(e,t){return e.columns&&e.columns.length>0?e.columns.filter((e,n)=>e.hidden?!1:!t||t[n]!==!1).length:e.groups&&e.groups.length>0?e.groups.reduce((e,n)=>e+xe(n,t),0):0}function Se(e,t,n=0){if(n===t)return[...e];let r=[];for(let i of e)i.groups&&i.groups.length>0&&r.push(...Se(i.groups,t,n+1));return r}function Ce(e,t,n){return n?!e||t:!1}function we({key:e,columns:t=[],getInitialValueInEffect:n=!0}){let r=B(()=>t.map(e=>({accessor:e.accessor,defaultPinned:e.pinned,pinnable:!!e.pinnable,pinned:e.pinned})),[t]),[i,a]=N({key:e?`${e}-columns-pinning`:``,defaultValue:e?r:void 0,getInitialValueInEffect:n}),o=q(i,r,pe);function s(t){e&&a(typeof t==`function`?e=>t(e??r):t)}let c=B(()=>{if(!o)return r;let e=[];return o.forEach(n=>{t.find(e=>e.accessor===n.accessor)&&e.push(n)}),t.forEach(t=>{e.find(e=>e.accessor===t.accessor)||e.push({accessor:t.accessor,defaultPinned:t.pinned,pinnable:!!t.pinnable,pinned:t.pinned})}),e},[o,t,r]);z(()=>{e&&o&&JSON.stringify(c)!==JSON.stringify(o)&&a(c)},[e,c,o,a]);let l=()=>{s(r)};return e?{columnsPinning:c,setColumnsPinning:s,resetColumnsPinning:l}:{columnsPinning:r,setColumnsPinning:s,resetColumnsPinning:l}}function Te({key:e,columns:t=[],getInitialValueInEffect:n=!0}){let r=B(()=>t?t.map(e=>e.accessor):[],[t]),[i,a]=N({key:e?`${e}-columns-order`:``,defaultValue:e?r:void 0,getInitialValueInEffect:n}),o=q(i,r,e=>typeof e==`string`);function s(t){e&&a(t)}let c=B(()=>{if(!o)return r;let e=[];return o.forEach(n=>{t.find(e=>e.accessor===n)&&e.push(n)}),t.forEach(t=>{e.includes(t.accessor)||e.push(t.accessor)}),e},[o,t,r]);z(()=>{e&&o&&JSON.stringify(c)!==JSON.stringify(o)&&a(c)},[e,c,o,a]);let l=()=>{s(r)};return e?{columnsOrder:c,setColumnsOrder:s,resetColumnsOrder:l}:{columnsOrder:r,setColumnsOrder:s,resetColumnsOrder:l}}function Ee({key:e,columns:t=[],getInitialValueInEffect:n=!0,headerRef:r}){let i=B(()=>t.some(e=>e.resizable&&!e.hidden&&e.accessor!==`__selection__`),[t]),a=R(()=>t.filter(e=>e.accessor!==`__selection__`).map(e=>({[e.accessor]:e.width??`auto`})),[t]),[o,s]=N({key:e?`${e}-columns-width`:``,defaultValue:e?a():void 0,getInitialValueInEffect:n}),c=q(o,[],e=>typeof e==`object`&&!!e),[l,u]=H(()=>e&&c.length>0?c:a()),[d,f]=H(!1),p=V(!1);z(()=>{e&&c&&c.length!==0&&u(c)},[e,c]),z(()=>{u(e=>{let n=new Set(t.filter(e=>e.accessor!==`__selection__`).map(e=>String(e.accessor))),r=e.filter(e=>n.has(Object.keys(e)[0])),i=new Set(r.map(e=>Object.keys(e)[0])),a=!1;for(let e of t){if(e.accessor===`__selection__`)continue;let t=String(e.accessor);i.has(t)||(r.push({[t]:e.width??`auto`}),a=!0)}return r.length!==e.length||a?r:e})},[t]);let m=R(e=>{let t=e.filter(e=>e.accessor!==`__selection__`);t.length!==0&&(p.current=!0,u(e=>e.map(e=>{let n=Object.keys(e)[0],r=t.find(e=>e.accessor===n);return r?{[n]:r.width}:e})))},[]);z(()=>{e&&p.current&&(d||(p.current=!1,s(l)))},[e,l,d,s]);let h=R((e,t)=>{m([{accessor:e,width:t}])},[m]),g=R(e=>{m(e)},[m]),_=R(()=>{f(!0);let e=r?.current;if(!e)return;let t=Array.from(e.querySelectorAll(`th[data-accessor]`));if(t.length===0)return;let n=[];for(let e of t){let t=e.getAttribute(`data-accessor`);if(!t||t===`__selection__`)continue;let r=Math.round(e.getBoundingClientRect().width);n.push({[t]:`${r}px`})}p.current=!0,u(n)},[r]),v=R(()=>{f(!1)},[]);return{columnsWidth:l,setColumnsWidth:m,setColumnWidth:h,setMultipleColumnWidths:g,resetColumnsWidth:R(()=>{let e=a();p.current=!0,u(e),f(!1)},[a]),hasResizableColumns:i,allResizableWidthsInitial:B(()=>{if(!i)return!1;let e=t.filter(e=>e.resizable&&!e.hidden&&e.accessor!==`__selection__`);return l.filter(t=>{let n=Object.keys(t)[0];return e.some(e=>e.accessor===n)}).every(e=>{let t=Object.values(e)[0];return t===`auto`||t===`initial`})},[i,t,l]),measureAndSetColumnWidths:R(()=>{},[]),isResizing:d,beginResize:_,endResize:v}}function De({key:e,columns:t=[],getInitialValueInEffect:n=!0}){let r=B(()=>t?.map(e=>({accessor:e.accessor,defaultToggle:e.defaultToggle??!0,toggleable:e.toggleable,toggled:e.defaultToggle===void 0||e.defaultToggle})),[t]),[i,a]=N({key:e?`${e}-columns-toggle`:``,defaultValue:e?r:void 0,getInitialValueInEffect:n}),o=q(i,r,pe);function s(t){e&&a(t)}let c=B(()=>{if(!o)return r;let e=[];return o.forEach(n=>{t.find(e=>e.accessor===n.accessor)&&e.push(n)}),t.forEach(t=>{e.find(e=>e.accessor===t.accessor)||e.push({accessor:t.accessor,defaultToggle:t.defaultToggle??!0,toggleable:t.toggleable,toggled:t.defaultToggle===void 0||t.defaultToggle})}),e},[o,t,r]);z(()=>{e&&o&&JSON.stringify(c)!==JSON.stringify(o)&&a(c)},[e,c,o,a]);let l=()=>{s(r)};return e?{columnsToggle:c,setColumnsToggle:s,resetColumnsToggle:l}:{columnsToggle:r,setColumnsToggle:s,resetColumnsToggle:l}}const Oe=({key:e,columns:t=[],getInitialValueInEffect:n=!0,headerRef:r,scrollViewportRef:i})=>{let{columnsOrder:a,setColumnsOrder:o,resetColumnsOrder:s}=Te({key:e,columns:t,getInitialValueInEffect:n}),{columnsToggle:c,setColumnsToggle:l,resetColumnsToggle:u}=De({key:e,columns:t,getInitialValueInEffect:n}),{columnsPinning:d,setColumnsPinning:f,resetColumnsPinning:p}=we({key:e,columns:t,getInitialValueInEffect:n}),{columnsWidth:m,setColumnsWidth:h,setColumnWidth:g,setMultipleColumnWidths:_,resetColumnsWidth:v,hasResizableColumns:y,allResizableWidthsInitial:b,measureAndSetColumnWidths:x,isResizing:S,beginResize:C,endResize:w}=Ee({key:e,columns:t,getInitialValueInEffect:n,headerRef:r,scrollViewportRef:i}),T=B(()=>{let e;e=a?a.map(e=>t.find(t=>t.accessor===e)).map(e=>{let t=d.find(t=>t.accessor===e?.accessor),n=e?.pinnable?t?.pinned:e?.pinned;return{...e,hidden:e?.hidden||!c.find(t=>t.accessor===e?.accessor)?.toggled,pinned:n}}):t;let n=e.filter(e=>e.pinned===`left`),r=e.filter(e=>!e.pinned),i=e.filter(e=>e.pinned===`right`);return[...n,...r,...i].map(e=>{if(e?.accessor===`__selection__`)return e;let t=e?.accessor,n=m.find(e=>t in e);if(!n)return e;let r=n[t];return r===void 0||r===`auto`||r===`initial`?e:{...e,width:r}})},[t,a,c,d,m]),E=B(()=>{let e=T.filter(e=>!e.hidden&&e.accessor!==`__selection__`);return e.length!==0&&e.every(e=>typeof e.width==`string`&&/px$/.test(e.width))},[T]);return{effectiveColumns:T,setColumnsOrder:o,columnsOrder:a,resetColumnsOrder:s,columnsToggle:c,setColumnsToggle:l,resetColumnsToggle:u,columnsPinning:d,setColumnsPinning:f,resetColumnsPinning:p,columnsWidth:m,setColumnsWidth:h,setColumnWidth:g,setMultipleColumnWidths:_,resetColumnsWidth:v,hasResizableColumns:y,allResizableWidthsInitial:b,measureAndSetColumnWidths:x,isResizing:S,isLocked:E,tableWidth:B(()=>{if(!E)return null;let e=0;for(let t of T){if(t.hidden||t.accessor===`__selection__`)continue;let n=t.width;if(typeof n!=`string`)continue;let r=parseInt(n,10);Number.isNaN(r)||(e+=r)}return e>0?e:null},[E,T]),beginResize:C,endResize:w}},ke=typeof window<`u`?ee:z;function Ae(e){let t=V(e);return t.current=e,t}const je=`--mantine-datatable-header-height`,Me=`--mantine-datatable-footer-height`,Ne=`--mantine-datatable-selection-column-width`,Pe=`--mantine-datatable-last-row-border-bottom`;function Y(e,t,n){e?.style.setProperty(t,n)}function Fe(e){let t=e.borderBoxSize?.[0]||e.contentBoxSize?.[0];return t?{width:t.inlineSize,height:t.blockSize}:{width:e.contentRect.width,height:e.contentRect.height}}function Ie(e,t,n){if(e){let r=new ResizeObserver(e=>{let n=e[0];n&&t(Fe(n))});return r.observe(e),()=>{r.disconnect(),n()}}}function Le({scrollCallbacks:e,withRowBorders:t}){let n={root:V(null),table:V(null),scrollViewport:V(null),header:V(null),footer:V(null),selectionColumnHeader:V(null)},{root:r,table:i,scrollViewport:a,header:o,footer:s,selectionColumnHeader:c}=n,l=Ae({withRowBorders:t}),u=Ae(e),d=V(()=>void 0),f=V(()=>void 0),p=R(e=>{u.current.onScroll?.(e),d.current()},[]);return z(()=>Ie(o.current,e=>{Y(r.current,je,`${e.height}px`)},()=>Y(r.current,je,`0`)),[o.current]),z(()=>Ie(s.current,e=>{Y(r.current,Me,`${e.height}px`)},()=>Y(r.current,Me,`0`)),[s.current]),z(()=>Ie(c.current,e=>{Y(r.current,Ne,`${e.width}px`)},()=>Y(r.current,Ne,`0`)),[c.current]),ke(()=>{if(typeof window>`u`)return;let e={top:!0,bottom:!0,left:!0,right:!0},t={width:0,height:0},n={width:0,height:0};function o(t,n){let i=e[t];return e[t]=n,Y(r.current,`--mantine-datatable-${t}-shadow-opacity`,n?`0`:`1`),i}function s(){let e=t.height-n.height,i=e<0;Y(r.current,`--mantine-datatable-footer-position`,i?`relative`:`sticky`),Y(r.current,`--mantine-datatable-footer-bottom`,i?`${e}px`:`0`)}function c(){l.current.withRowBorders&&t.height<n.height?Y(r.current,Pe,`${O(`1px`)} solid var(--mantine-datatable-border-color)`):Y(r.current,Pe,`unset`)}f.current=c;function p(){let e=u.current,r=a.current,i=r?.scrollTop??0,s=r?.scrollLeft??0,c=i===0,l=t.height-i-n.height<1,d=o(`top`,c),f=o(`bottom`,l);c&&c!==d&&e.onScrollToTop?.(),l&&l!==f&&e.onScrollToBottom?.();let p=r?getComputedStyle(r).direction===`rtl`:!1,m=(r?.scrollWidth??0)-n.width,h,g;if(p){let e=Math.abs(s);g=e<1,h=m-e<1}else h=s<1,g=t.width-s-n.width<1;let _=o(`left`,h),v=o(`right`,g);h&&h!==_&&e.onScrollToLeft?.(),g&&g!==v&&e.onScrollToRight?.()}d.current=p;let m=new ResizeObserver(e=>{for(let r of e)switch(r.target.tagName){case`TABLE`:t=Fe(r);break;case`DIV`:n=Fe(r)}p(),s(),c()});return m.observe(i.current),m.observe(a.current),()=>{m.disconnect()}},[]),ke(()=>{f.current()},[t]),{refs:n,onScroll:p}}function Re({columns:e,theadRef:t,tbodyRef:n,selectionColumnHeaderRef:r,selectionVisible:i,pinFirstColumn:a,pinLastColumn:o}){let[s,c]=H(/* @__PURE__ */ new Map),l=R(()=>{if(!a&&!o&&!e.some(e=>e.pinned))return;let s=t.current??n.current;if(!s)return;let l=!!t.current,u=l?s.querySelector(`tr:last-of-type`):s.querySelector(`tr:first-of-type`);if(!u)return;let d=getComputedStyle(s).direction===`rtl`,f=/* @__PURE__ */ new Map;if(l)u.querySelectorAll(`th[data-accessor]`).forEach(e=>{let t=e.dataset.accessor;if(t){let n=e.getBoundingClientRect().width;n>0&&f.set(t,n)}});else{let t=e.filter(e=>!e.hidden);u.querySelectorAll(`td:not(.mantine-datatable-row-selector-cell):not(.mantine-datatable-row-expansion-cell)`).forEach((e,n)=>{if(t[n]){let r=e.getBoundingClientRect().width;r>0&&f.set(String(t[n].accessor),r)}})}let p=0;if(i){let e=r.current??s.querySelector(l?`.mantine-datatable-header-selector-cell`:`.mantine-datatable-row-selector-cell`);e&&(p=e.getBoundingClientRect().width)}let m=e.filter(e=>!e.hidden&&f.has(String(e.accessor))).map(e=>String(e.accessor)),h=/* @__PURE__ */ new Map;for(let t of e){let e=String(t.accessor);m.includes(e)&&(t.pinned?h.set(e,t.pinned):a&&e===m[0]&&!h.has(e)?h.set(e,`left`):o&&e===m[m.length-1]&&!h.has(e)&&h.set(e,`right`))}let g=m.filter(e=>h.get(e)===`left`),_=m.filter(e=>h.get(e)===`right`),v=/* @__PURE__ */ new Map,y=p;g.forEach((e,t)=>{v.set(e,{position:d?`right`:`left`,logicalSide:`left`,offset:y,isBoundary:t===g.length-1}),y+=f.get(e)||0});let b=-.4,x=[..._].reverse();x.forEach((e,t)=>{v.set(e,{position:d?`left`:`right`,logicalSide:`right`,offset:b,isBoundary:t===x.length-1}),b+=f.get(e)||0}),c(e=>{if(e.size!==v.size)return v;for(let[t,n]of v){let r=e.get(t);if(!r||r.position!==n.position||r.logicalSide!==n.logicalSide||r.offset!==n.offset||r.isBoundary!==n.isBoundary)return v}return e})},[e,i,t,n,r,a,o]);return z(()=>{if(!a&&!o&&!e.some(e=>e.pinned))return;let r=t.current??n.current;if(!r)return;let i=!!t.current,s=i?r.querySelector(`tr:last-of-type`):r.querySelector(`tr:first-of-type`);if(!s)return;let c=new ResizeObserver(l);return s.querySelectorAll(i?`th`:`td`).forEach(e=>{c.observe(e)}),()=>c.disconnect()},[t,n,l]),ke(l,[l]),{pinnedMap:s,hasLeftPinned:[...s.values()].some(e=>e.logicalSide===`left`),hasRightPinned:[...s.values()].some(e=>e.logicalSide===`right`)}}function ze(e){let[t,n]=H(null),r=e?.join(`:`)||``;return z(()=>{n(null)},[r]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:n}}function Be(e,t){let n=()=>{t(e.map(e=>e.matches))},r=e.map(e=>{try{return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)}catch{return e.addListener(n),()=>e.removeListener(n)}});return()=>{r.forEach(e=>{e()})}}function Ve(e,t){return t||(typeof window<`u`&&`matchMedia`in window?e.map(e=>window.matchMedia(e).matches):e.map(()=>!1))}function He(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=H(n?t:Ve(e,t)),a=V(null);return z(()=>{if(`matchMedia`in window)return a.current=e.map(e=>window.matchMedia(e)),i(a.current.map(e=>e.matches)),Be(a.current,e=>{i(e)})},[e]),r}function Ue(e){let t=A(),n=typeof e==`function`?e(t):e;return P(n||``,!0)}function We({rowExpansion:e,records:t,idAccessor:n}){let r=[];if(e&&t){let{trigger:i,allowMultiple:a,initiallyExpanded:o}=e;t&&i===`always`?r=t.map(e=>J(e,n)):o&&(r=t.filter((e,t)=>o({record:e,index:t})).map(e=>J(e,n)),a||(r=[r[0]]))}let i,a,o=H(r);if(e){let{expandable:t,trigger:r,allowMultiple:s,collapseProps:c,content:l}=e;e.expanded?{recordIds:i,onRecordIdsChange:a}=e.expanded:[i,a]=o;let u=e=>a?.(i.filter(t=>t!==J(e,n)));return{expandOnClick:r!==`always`&&r!==`never`,isRowExpanded:e=>r===`always`||i.includes(J(e,n)),isExpandable:({record:e,index:n})=>!t||t({record:e,index:n}),expandRow:e=>{let t=J(e,n);a?.(s?[...i,t]:[t])},collapseRow:u,collapseProps:c,content:({record:e,index:t})=>()=>l({record:e,index:t,collapse:()=>u(e)})}}}function Ge(e,t){let[n,r]=H(e),[i,a]=H(e),o=I(()=>r(!0),0),s=I(()=>a(!1),t||200);return z(()=>{e?(s.clear(),a(!0),o.start()):(o.clear(),r(!1),s.start())},[o,s,e]),{expanded:n,visible:i}}const Ke=`mantine-datatable-nowrap`,qe=`mantine-datatable-ellipsis`,X=`mantine-datatable-pointer-cursor`,Je=`mantine-datatable-context-menu-cursor`,Ye=`mantine-datatable-text-align-left`,Xe=`mantine-datatable-text-align-center`,Ze=`mantine-datatable-text-align-right`;function Qe({className:e,style:t,pinnedInfo:n,visibleMediaQuery:r,title:i,noWrap:a,ellipsis:o,textAlign:s,width:c}){return Ue(r)?/* @__PURE__ */ W(S,{"data-pinned":n?.position,"data-pinned-shadow":n?.isBoundary?n.position:void 0,className:L({[Ke]:a||o,[qe]:o,[Ye]:s===`left`,[Xe]:s===`center`,[Ze]:s===`right`},e),style:[{width:c,minWidth:c,maxWidth:c},t,n&&{position:`sticky`,[n.position]:n.offset,overflow:`visible`}],children:i}):null}function $e({shadowVisible:e}){return/* @__PURE__ */ W(S,{className:`mantine-datatable-footer-selector-placeholder-cell`,"data-shadow-visible":e||void 0})}function et({className:e,style:t,columns:n,defaultColumnProps:r,pinnedMap:i,selectionVisible:a,selectorCellShadowVisible:o,ref:s}){return/* @__PURE__ */ W(x,{ref:s,className:L(`mantine-datatable-footer`,e),style:t,children:/* @__PURE__ */ G(w,{children:[a&&/* @__PURE__ */ W($e,{shadowVisible:o}),n.map(({hidden:e,...t})=>{if(e)return null;let{accessor:n,visibleMediaQuery:a,textAlign:o,width:s,footer:c,footerClassName:l,footerStyle:u,noWrap:d,ellipsis:f}={...r,...t};return/* @__PURE__ */ W(Qe,{pinnedInfo:i.get(String(n)),className:l,style:u,visibleMediaQuery:a,textAlign:o,width:s,title:c,noWrap:d,ellipsis:f},n)})]})})}function tt({group:{id:e,title:t,textAlign:n,className:r,style:i},colSpan:a,rowSpan:o,pinnedInfo:s,needsBorder:c}){return/* @__PURE__ */ W(S,{colSpan:a,rowSpan:o>1?o:void 0,"data-pinned":s?.position,"data-pinned-shadow":s?.isBoundary?s.position:void 0,className:L(`mantine-datatable-column-group-header-cell`,{[Ye]:n===`left`,[Xe]:n===`center`,[Ze]:n===`right`,"mantine-datatable-column-group-header-cell--needs-border":c},r),style:[i,s&&{position:`sticky`,[s.position]:s.offset,overflow:`visible`}],children:t??fe(e)})}function nt(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`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`})]})}function rt(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`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`})]})}function it({children:t,isActive:n,filterPopoverProps:r,filterPopoverDisableClickOutside:i}){let[a,{close:o,toggle:s}]=M(!1),c=n?rt:nt,l=j(o);return i&&(l=void 0),/* @__PURE__ */ G(m,{withArrow:!0,shadow:`md`,trapFocus:!0,...r,opened:a,onClose:o,onDismiss:o,children:[/* @__PURE__ */ W(g,{children:/* @__PURE__ */ W(e,{className:`mantine-datatable-header-cell-filter-action-icon`,"data-active":n||void 0,size:`sm`,variant:`default`,onClick:e=>{e.preventDefault(),s()},onKeyDown:e=>e.stopPropagation(),children:/* @__PURE__ */ W(c,{})})}),/* @__PURE__ */ W(h,{ref:l,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:typeof t==`function`?t({close:o}):t})]})}function at(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M5 12l14 0`}),/* @__PURE__ */ W(`path`,{d:`M5 12l6 6`}),/* @__PURE__ */ W(`path`,{d:`M5 12l6 -6`})]})}function ot(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M5 12l14 0`}),/* @__PURE__ */ W(`path`,{d:`M19 12l-6 6`}),/* @__PURE__ */ W(`path`,{d:`M19 12l-6 -6`})]})}function st(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M9 4v6l-2 4v2h10v-2l-2-4v-6`}),/* @__PURE__ */ W(`path`,{d:`M12 16v5`}),/* @__PURE__ */ W(`path`,{d:`M8 4h8`})]})}function ct(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M18 6l-12 12`}),/* @__PURE__ */ W(`path`,{d:`M6 6l12 12`})]})}function lt({currentPinned:t,onPinChange:n}){let[i,a]=H(!1),o=V(null),[c,l]=H(!1),u=R(()=>{if(o.current){let e=getComputedStyle(o.current).direction;l(e===`rtl`)}},[]);ke(()=>{u()},[u]),z(()=>{i&&u()},[i,u]);let d=c?`right`:`left`,f=c?`left`:`right`,p=t===d,h=t===f;return/* @__PURE__ */ G(m,{opened:i,onChange:a,position:`bottom`,withArrow:!0,shadow:`sm`,children:[/* @__PURE__ */ W(m.Target,{children:/* @__PURE__ */ W(r,{ref:o,className:`mantine-datatable-header-cell-pinnable-icon`,role:`button`,"aria-label":`Pin column`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:/* @__PURE__ */ W(e,{size:`xs`,variant:`light`,onClick:e=>e.stopPropagation(),children:/* @__PURE__ */ W(st,{})})})}),/* @__PURE__ */ W(m.Dropdown,{onClick:e=>e.stopPropagation(),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),className:`mantine-datatable-pinnable-dropdown`,children:/* @__PURE__ */ G(s,{gap:4,children:[/* @__PURE__ */ W(e,{size:`sm`,variant:p?`filled`:`light`,onClick:()=>n(p?void 0:d),"aria-label":`Pin left`,children:/* @__PURE__ */ W(at,{})}),/* @__PURE__ */ W(e,{size:`sm`,variant:h?`filled`:`light`,onClick:()=>n(h?void 0:f),"aria-label":`Pin right`,children:/* @__PURE__ */ W(ot,{})}),t&&/* @__PURE__ */ W(e,{size:`sm`,variant:`light`,color:`red`,onClick:()=>n(void 0),"aria-label":`Unpin`,children:/* @__PURE__ */ W(ct,{})})]})})]})}const ut=e=>{let{accessor:t,columnRef:n}=e,[r,i]=H(!1),a=V(0),o=V({current:0,next:0}),{dir:s}=k(),c=s===`rtl`,{setMultipleColumnWidths:l,beginResize:u,endResize:d}=se(),f=R(e=>{if(e.preventDefault(),e.stopPropagation(),!n.current)return;let r=n.current,s=r.nextElementSibling;for(;s;){let e=s.getAttribute(`data-accessor`);if(e&&e!==`__selection__`)break;s=s.nextElementSibling}if(!s)return;let f=s.getAttribute(`data-accessor`);if(!f)return;let p=r.offsetWidth,m=s.offsetWidth;u(),i(!0),a.current=e.clientX,o.current={current:p,next:m};let h=e=>{let n=e.clientX-a.current;c&&(n=-n);let r=o.current.current-50,i=o.current.next-50,s=Math.max(-r,Math.min(n,i)),u=o.current.current+s,d=o.current.next-s;l([{accessor:t,width:`${u}px`},{accessor:f,width:`${d}px`}])},g=()=>{i(!1),document.body.style.cursor=`initial`,document.body.style.userSelect=`initial`,d(),document.removeEventListener(`mousemove`,h),document.removeEventListener(`mouseup`,g)};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,document.addEventListener(`mousemove`,h),document.addEventListener(`mouseup`,g)},[t,n,c,l,u,d]),p=R(()=>{if(!n.current)return;let e=n.current.nextElementSibling,r=[{accessor:t,width:`auto`}];if(e){let t=e.getAttribute(`data-accessor`);t&&t!==`__selection__`&&r.push({accessor:t,width:`auto`})}l(r)},[t,n,l]);return/* @__PURE__ */ W(`div`,{className:`mantine-datatable-header-resizable-handle`,style:{cursor:r?`col-resize`:void 0},onMouseDown:f,onDoubleClick:p,onClick:e=>e.stopPropagation(),title:`Drag to resize column, double-click to reset`})};function dt(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M8 7l4 -4l4 4`}),/* @__PURE__ */ W(`path`,{d:`M8 17l4 4l4 -4`}),/* @__PURE__ */ W(`path`,{d:`M12 3l0 18`})]})}function ft(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M12 5l0 14`}),/* @__PURE__ */ W(`path`,{d:`M16 9l-4 -4`}),/* @__PURE__ */ W(`path`,{d:`M8 9l4 -4`})]})}function pt(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ W(`path`,{d:`M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ W(`path`,{d:`M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ W(`path`,{d:`M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ W(`path`,{d:`M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),/* @__PURE__ */ W(`path`,{d:`M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`})]})}function mt({className:n,style:i,pinnedInfo:a,accessor:c,visibleMediaQuery:l,title:u,sortable:d,draggable:f,toggleable:p,pinnable:m,resizable:h,sortIcons:g,textAlign:_,width:v,sortStatus:y,onSortStatusChange:b,filter:x,filterPopoverProps:C,filterPopoverDisableClickOutside:w,filtering:T,sortKey:E}){let{setSourceColumn:D,setTargetColumn:O,swapColumns:k,columnsToggle:A,setColumnsToggle:j,columnsPinning:M,setColumnsPinning:N}=se(),[P,F]=H(!1),I=V(null),R=M?.find(e=>e.accessor===c)?.pinned;if(!Ue(l))return null;let z=u??fe(c),ee=typeof z==`string`?z:void 0,B=d&&b?e=>{e?.defaultPrevented||b({sortKey:E,columnAccessor:c,direction:y?.columnAccessor===c?y.direction===`asc`?`desc`:`asc`:y?.direction??`asc`})}:void 0,U=e=>{e.stopPropagation(),D(c),F(!1)},K=e=>{e.preventDefault(),O(c),F(!0)},te=()=>{O(c),F(!1),k()},ne=()=>{F(!0)},re=()=>{F(!1)},ie=e=>{e.stopPropagation(),j(A.map(e=>e.accessor===c?{...e,toggled:!1}:e))},ae=e=>{N(t=>t.map(t=>t.accessor===c?{...t,pinned:e}:t))};return/* @__PURE__ */ G(S,{"data-accessor":c,"data-pinned":a?.position,"data-pinned-shadow":a?.isBoundary?a.position:void 0,className:L({"mantine-datatable-header-cell-sortable":d,"mantine-datatable-header-cell-toggleable":p,"mantine-datatable-header-cell-pinnable":m,"mantine-datatable-header-cell-resizable":h},n),style:[{width:v,...h?{}:{minWidth:v,maxWidth:v}},i,a&&{position:`sticky`,[a.position]:a.offset,overflow:`visible`}],role:d?`button`:void 0,tabIndex:d?0:void 0,onClick:B,onKeyDown:e=>e.key===`Enter`&&B?.(),ref:I,children:[/* @__PURE__ */ G(s,{className:`mantine-datatable-header-cell-sortable-group`,justify:`space-between`,wrap:`nowrap`,children:[/* @__PURE__ */ G(o,{align:`center`,w:`100%`,className:L({"mantine-datatable-header-cell-draggable":f,"mantine-datatable-header-cell-drag-over":P}),draggable:f,onDragStart:f?U:void 0,onDragEnter:f?ne:void 0,onDragOver:f?K:void 0,onDrop:f?te:void 0,onDragLeave:f?re:void 0,children:[f?/* @__PURE__ */ W(r,{role:`img`,"aria-label":`Drag column`,children:/* @__PURE__ */ W(e,{className:`mantine-datatable-header-cell-draggable-action-icon`,variant:`subtle`,size:`xs`,onClick:e=>{e.stopPropagation()},children:/* @__PURE__ */ W(pt,{})})}):null,/* @__PURE__ */ W(t,{className:L(`mantine-datatable-header-cell-sortable-text`,{[Ye]:_===`left`,[Xe]:_===`center`,[Ze]:_===`right`},Ke,qe),title:ee,children:z})]}),m?/* @__PURE__ */ W(lt,{currentPinned:R,onPinChange:ae}):null,p?/* @__PURE__ */ W(r,{className:`mantine-datatable-header-cell-toggleable-icon`,role:`img`,"aria-label":`Toggle column`,children:/* @__PURE__ */ W(e,{size:`xs`,variant:`light`,onClick:ie,children:/* @__PURE__ */ W(ct,{})})}):null,d||y?.columnAccessor===c?y?.columnAccessor===c?/* @__PURE__ */ W(r,{className:L(`mantine-datatable-header-cell-sortable-icon`,{"mantine-datatable-header-cell-sortable-icon-reversed":y.direction===`desc`}),role:`img`,"aria-label":`Sorted ${y.direction===`desc`?`descending`:`ascending`}`,children:g?.sorted||/* @__PURE__ */ W(ft,{})}):/* @__PURE__ */ W(r,{className:`mantine-datatable-header-cell-sortable-unsorted-icon`,role:`img`,"aria-label":`Not sorted`,children:g?.unsorted||/* @__PURE__ */ W(dt,{})}):null,x?/* @__PURE__ */ W(it,{filterPopoverProps:C,isActive:!!T,filterPopoverDisableClickOutside:w,children:x}):null]}),h&&c!==`__selection__`?/* @__PURE__ */ W(ut,{accessor:c,columnRef:I}):null]})}function ht({className:e,style:t,trigger:n,shadowVisible:r,checked:a,indeterminate:o,checkboxProps:s,onChange:c,rowSpan:l,ref:u}){let d=!s.disabled;return/* @__PURE__ */ W(S,{ref:u,className:L(`mantine-datatable-header-selector-cell`,{[X]:n===`cell`&&d},e),style:t,rowSpan:l,"data-shadow-visible":r||void 0,"data-accessor":`__selection__`,onClick:n===`cell`&&d?c:void 0,children:/* @__PURE__ */ W(i,{classNames:d?{input:X}:void 0,checked:a,indeterminate:o,onChange:c,...s,disabled:!(c||s.onChange)||s.disabled})})}function Z(e,t=[],n=/* @__PURE__ */ new Map){for(let r of e){let e=[...t,r];if(r.columns&&r.columns.length>0)for(let t of r.columns)t!=null&&n.set(String(t.accessor),e);else r.groups&&r.groups.length>0&&Z(r.groups,e,n)}return n}function gt(e,t){let n=e.map(e=>t.get(e));if(n.some(e=>!e)||new Set(n.map(e=>e.logicalSide)).size>1)return;let r=n[0].logicalSide===`left`,i=t.get(r?e[0]:e[e.length-1]);if(!i)return;let a=t.get(r?e[e.length-1]:e[0]);return{...i,isBoundary:a?.isBoundary??!1}}function _t({groups:e,maxDepth:t,visibleAccessors:n,pinnedMap:r,withColumnBorders:i}){let a=Z(e),o=n.length;return Array.from({length:t},(e,s)=>{let c=[];return n.forEach((e,n)=>{let r=a.get(e),i=r?.[s];if(!r||!i)return;let o=c[c.length-1];if(o&&o.group===i&&o.start+o.colSpan===n)o.colSpan+=1,o.accessors.push(e);else{let a=s===r.length-1?t-s:1;c.push({group:i,colSpan:1,rowSpan:a,start:n,accessors:[e]})}}),c.map(({group:e,colSpan:t,rowSpan:n,start:a,accessors:s})=>({group:e,colSpan:t,rowSpan:n,pinnedInfo:gt(s,r),needsBorder:i&&a+t<o,key:`${e.id}-${a}`}))})}function vt({selectionColumnHeaderRef:e,className:t,style:n,sortStatus:r,sortIcons:a,onSortStatusChange:o,columns:c,defaultColumnProps:l,groups:u,pinnedMap:d,selectionTrigger:f,selectionVisible:p,selectionChecked:_,selectionIndeterminate:y,onSelectionChange:b,selectionCheckboxProps:x,selectorCellShadowVisible:S,selectionColumnClassName:T,selectionColumnStyle:E,withColumnBorders:D=!1,ref:O}){let k=u?ye(u):0,j=k>0?k+1:1,M=A(),N=c.map(({visibleMediaQuery:e})=>typeof e==`function`?e(M):e??``),P=N.join(`
|
|
2
|
+
`),F=B(()=>N,[P]),I=He(F,B(()=>F.map(()=>!0),[F])),R=u?_t({groups:u,maxDepth:k,visibleAccessors:c.filter((e,t)=>!e.hidden&&I?.[t]!==!1).map(({accessor:e})=>String(e)),pinnedMap:d,withColumnBorders:D}):[],z=p?/* @__PURE__ */ W(ht,{ref:e,className:T,style:E,trigger:f,shadowVisible:S,checked:_,indeterminate:y,checkboxProps:x,onChange:b,rowSpan:u?j:void 0}):null,{columnsToggle:ee,setColumnsToggle:V}=se(),[U,K]=H(!1),te=c.some(e=>e.toggleable),ne=te?Object.fromEntries(c.map(({accessor:e,title:t})=>[e,t??fe(String(e))])):void 0,re=/* @__PURE__ */ G(C,{className:L(`mantine-datatable-header`,t),style:n,ref:O,onContextMenu:te?e=>{e.preventDefault(),K(e=>!e)}:void 0,children:[R.map((e,t)=>/* @__PURE__ */ G(w,{children:[t===0&&z,e.map(({key:e,group:t,colSpan:n,rowSpan:r,pinnedInfo:i,needsBorder:a})=>/* @__PURE__ */ W(tt,{group:t,colSpan:n,rowSpan:r,pinnedInfo:i,needsBorder:a},e))]},`group-depth-${t}`)),/* @__PURE__ */ G(w,{children:[!u&&z,c.map(({hidden:e,...t},n)=>{if(e)return null;let{accessor:i,visibleMediaQuery:s,textAlign:u,width:f,title:p,sortable:m,draggable:h,toggleable:g,pinnable:_,resizable:v,titleClassName:y,titleStyle:b,filter:x,filterPopoverProps:S,filterPopoverDisableClickOutside:C,filtering:w,sortKey:T}={...l,...t};return/* @__PURE__ */ W(mt,{accessor:i,pinnedInfo:d.get(String(i)),className:y,style:b,visibleMediaQuery:s,textAlign:u,width:f,title:p,sortable:m,draggable:h,toggleable:g,pinnable:_,resizable:v&&n<c.length-1,sortStatus:r,sortIcons:a,sortKey:T,onSortStatusChange:o,filter:x,filterPopoverProps:S,filterPopoverDisableClickOutside:C,filtering:w},i)})]})]});return te?/* @__PURE__ */ G(m,{position:`bottom`,withArrow:!0,shadow:`md`,opened:U,onChange:K,children:[/* @__PURE__ */ W(g,{children:re}),/* @__PURE__ */ W(h,{children:/* @__PURE__ */ W(v,{children:ee.filter(e=>e.toggleable).map(e=>/* @__PURE__ */ W(s,{children:/* @__PURE__ */ W(i,{classNames:{label:`mantine-datatable-header-column-toggle-checkbox-label`},size:`xs`,label:ne[e.accessor],checked:e.toggled,onChange:t=>{V(ee.map(n=>n.accessor===e.accessor?{...n,toggled:t.currentTarget.checked}:n))}})},e.accessor))})})]}):re}function yt({fetching:e,customContent:t,backgroundBlur:n,size:i,type:a,color:o}){return/* @__PURE__ */ W(r,{className:L(`mantine-datatable-loader`,{"mantine-datatable-loader-fetching":e}),style:[{backdropFilter:n?`blur(${n}px)`:void 0}],children:e&&(t||/* @__PURE__ */ W(c,{size:i,type:a,color:o}))})}function bt(){return/* @__PURE__ */ G(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ W(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),/* @__PURE__ */ W(`path`,{d:`M8 9l4 -4l4 4`}),/* @__PURE__ */ W(`path`,{d:`M16 15l-4 4l-4 -4`})]})}const xt={xs:O(22),sm:O(26),md:O(32),lg:O(38),xl:O(44)};function St({size:e,label:t,values:r,value:i,activeTextColor:a,activeBackgroundColor:o,onChange:c}){return/* @__PURE__ */ G(s,{gap:`xs`,children:[/* @__PURE__ */ W(T,{component:`div`,size:e,children:t}),/* @__PURE__ */ G(l,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:`mantine-datatable-page-size-selector-menu-arrow`},children:[/* @__PURE__ */ W(f,{children:/* @__PURE__ */ W(n,{size:e,variant:`default`,classNames:{section:`mantine-datatable-page-size-selector-button-icon`},rightSection:/* @__PURE__ */ W(bt,{}),style:[{fontWeight:`normal`},t=>({height:xt[e],paddingLeft:t.spacing[e],paddingRight:t.spacing[e]})],children:i})}),/* @__PURE__ */ W(u,{children:r.map(t=>{let n=t===i;return/* @__PURE__ */ W(d,{className:L({"mantine-datatable-page-size-selector-active":n}),style:[{height:xt[e]},n&&(a||o)?e=>ne({theme:e,paginationActiveTextColor:a,paginationActiveBackgroundColor:o}):void 0],disabled:n,onClick:()=>c(t),children:/* @__PURE__ */ W(T,{component:`div`,size:e,children:t})},t)})})]})]})}function Ct({className:e,style:n,fetching:r,page:i,onPageChange:a,paginationWithEdges:o,paginationWithControls:s,paginationActiveTextColor:c,paginationActiveBackgroundColor:l,paginationSize:u,loadingText:d,noRecordsText:f,paginationText:m,totalRecords:h,recordsPerPage:g,onRecordsPerPageChange:_,recordsPerPageLabel:v,recordsPerPageOptions:y,recordsLength:b,horizontalSpacing:x,paginationWrapBreakpoint:S,getPaginationControlProps:C,getPaginationItemProps:w,renderPagination:E}){let D;if(h){let e=(i-1)*g+1;D=m({from:e,to:e+(b||0)-1,totalRecords:h})}else D=r?d:f;let k=h&&g?Math.max(1,Math.ceil(h/g)):1,A=h?(i-1)*(g??0)+1:void 0,j=h?(A??1)+(b??0)-1:void 0,M=!Ue(({breakpoints:e})=>`(min-width: ${typeof S==`number`?`${O(S)}rem`:e[S]||S})`),N={Text:e=>/* @__PURE__ */ W(T,{component:`div`,className:`mantine-datatable-pagination-text`,size:u,...e,children:D}),PageSizeSelector:e=>y?/* @__PURE__ */ W(St,{activeTextColor:c,activeBackgroundColor:l,size:u,label:v,values:y,value:g,onChange:_,...e}):null,Pagination:e=>/* @__PURE__ */ W(p,{classNames:{root:L(`mantine-datatable-pagination-pages`,{"mantine-datatable-pagination-pages-fetching":r||!b}),control:`mantine-datatable-pagination-pages-control`},style:c||l?e=>ne({theme:e,paginationActiveTextColor:c,paginationActiveBackgroundColor:l}):void 0,withEdges:o,withControls:s,value:i,onChange:a,size:u,total:k,getControlProps:C,getItemProps:w,...e})},P={state:{paginationSize:u,page:i,totalPages:k,totalRecords:h,recordsPerPage:g,recordsLength:b,fetching:r,from:A,to:j,isWrapped:M},actions:{setPage:e=>a?.(e),setRecordsPerPage:_?e=>_(e):void 0},Controls:N};return/* @__PURE__ */ W(t,{px:x??`xs`,py:`xs`,className:L(`mantine-datatable-pagination`,e),style:[{flexDirection:M?`column`:`row`},n],children:typeof E==`function`?E(P):/* @__PURE__ */ G(U,{children:[/* @__PURE__ */ W(N.Text,{}),/* @__PURE__ */ W(N.PageSizeSelector,{}),/* @__PURE__ */ W(N.Pagination,{})]})})}function wt({className:e,style:t,pinnedInfo:n,visibleMediaQuery:r,record:i,index:a,onClick:o,onDoubleClick:s,onContextMenu:c,noWrap:l,ellipsis:u,textAlign:d,width:f,accessor:p,render:m,defaultRender:h,customCellAttributes:g}){return Ue(r)?/* @__PURE__ */ W(b,{"data-pinned":n?.position,"data-pinned-shadow":n?.isBoundary?n.position:void 0,className:L({[Ke]:l||u,[qe]:u,[X]:o||s,[Je]:c,[Ye]:d===`left`,[Xe]:d===`center`,[Ze]:d===`right`},e),style:[{width:f,minWidth:f,maxWidth:f},t,n&&{position:`sticky`,[n.position]:n.offset,overflow:`visible`}],onClick:o,onDoubleClick:s,onContextMenu:c,...g?.(i,a),children:m?m(i,a):h?h(i,a,p):ge(i,p)}):null}function Q({open:e,colSpan:t,content:n,collapseProps:r}){let{expanded:i,visible:o}=Ge(e,r?.transitionDuration);return o?/* @__PURE__ */ G(U,{children:[/* @__PURE__ */ W(w,{}),/* @__PURE__ */ W(w,{children:/* @__PURE__ */ W(b,{className:`mantine-datatable-row-expansion-cell`,colSpan:t,children:/* @__PURE__ */ W(a,{expanded:i,...r,children:/* @__PURE__ */ W(`div`,{className:`mantine-datatable-row-expansion-cell-content`,children:n()})})})})]}):null}function Tt({className:e,style:t,record:n,index:r,trigger:a,onChange:o,withRightShadow:s,checkboxProps:c,getCheckboxProps:l,...u}){let d={...c,...l(n,r)},f=!u.disabled&&!d.disabled,p=e=>{e.stopPropagation(),a===`cell`&&f&&o?.(e)};return/* @__PURE__ */ W(b,{className:L(`mantine-datatable-row-selector-cell`,{[X]:a===`cell`&&f},e),style:t,"data-shadow-visible":s||void 0,onClick:p,children:/* @__PURE__ */ W(i,{classNames:f?{input:X}:void 0,onChange:o,...u,...d})})}function Et({record:e,index:t,columns:n,defaultColumnProps:r,pinnedMap:i,defaultColumnRender:a,selectionTrigger:o,selectionVisible:s,selectionChecked:c,onSelectionChange:l,isRecordSelectable:u,selectionCheckboxProps:d,getSelectionCheckboxProps:f,onClick:p,onDoubleClick:m,onContextMenu:h,onCellClick:g,onCellDoubleClick:_,onCellContextMenu:v,expansion:y,customAttributes:b,color:x,backgroundColor:S,className:C,style:T,selectorCellShadowVisible:E,selectionColumnClassName:D,selectionColumnStyle:O,rowFactory:k}){let A=/* @__PURE__ */ G(U,{children:[s&&/* @__PURE__ */ W(Tt,{className:D,style:O,record:e,index:t,trigger:o,withRightShadow:E,checked:c,disabled:!l||(u?!u(e,t):!1),onChange:l,checkboxProps:d,getCheckboxProps:f}),n.map(({hidden:n,hiddenContent:o,...s},c)=>{if(n||o)return null;let{accessor:l,visibleMediaQuery:u,textAlign:d,noWrap:f,ellipsis:p,width:m,render:h,cellsClassName:y,cellsStyle:b,customCellAttributes:x}={...r,...s};return/* @__PURE__ */ W(wt,{pinnedInfo:i.get(String(l)),className:typeof y==`function`?y(e,t):y,style:b?.(e,t),visibleMediaQuery:u,record:e,index:t,onClick:g?n=>g({event:n,record:e,index:t,column:s,columnIndex:c}):void 0,onDoubleClick:_?n=>_({event:n,record:e,index:t,column:s,columnIndex:c}):void 0,onContextMenu:v?n=>v({event:n,record:e,index:t,column:s,columnIndex:c}):void 0,accessor:l,textAlign:d,noWrap:f,ellipsis:p,width:m,render:h,defaultRender:a,customCellAttributes:x},l)})]}),j=y&&/* @__PURE__ */ W(Q,{colSpan:n.filter(({hidden:e})=>!e).length+ +!!s,open:y.isRowExpanded(e),content:y.content({record:e,index:t}),collapseProps:y.collapseProps}),M=$({record:e,index:t,selectionChecked:c,onClick:p,onDoubleClick:m,onContextMenu:h,expansion:y,customAttributes:b,color:x,backgroundColor:S,className:C,style:T});return k?k({record:e,index:t,rowProps:M,children:A,expandedElement:j}):/* @__PURE__ */ G(U,{children:[/* @__PURE__ */ W(w,{...M,children:A}),j]})}function $({record:e,index:t,selectionChecked:n,onClick:r,onDoubleClick:i,onContextMenu:a,expansion:o,customAttributes:s,color:c,backgroundColor:l,className:u,style:d}){return{className:L(`mantine-datatable-row`,{[X]:r||i||o?.isExpandable({record:e,index:t})&&o?.expandOnClick},{[Je]:a},typeof u==`function`?u(e,t):u),"data-selected":n||void 0,onClick:n=>{if(o){let{isExpandable:n,isRowExpanded:r,expandOnClick:i,expandRow:a,collapseRow:s}=o;n({record:e,index:t})&&i&&(r(e)?s(e):a(e))}r?.({event:n,record:e,index:t})},onDoubleClick:i?n=>i({event:n,record:e,index:t}):void 0,onContextMenu:a?n=>a({event:n,record:e,index:t}):void 0,style:[c||l?n=>{let r=c?.(e,t),i=l?.(e,t);return re({theme:n,color:r,backgroundColor:i})}:void 0,d?.(e,t)],...s?.(e,t)??{}}}function Dt({leftShadowBehind:e,rightShadowBehind:n,onScrollPositionChange:r,children:i,viewportRef:a,scrollAreaProps:o}){return/* @__PURE__ */ G(_,{...o,viewportRef:a,classNames:{root:`mantine-datatable-scroll-area`,viewport:`mantine-datatable-scroll-area-viewport`,scrollbar:`mantine-datatable-scroll-area-scrollbar`,thumb:`mantine-datatable-scroll-area-thumb`,corner:`mantine-datatable-scroll-area-corner`},onScrollPositionChange:r,children:[i,/* @__PURE__ */ W(t,{className:L(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-top-shadow`)}),/* @__PURE__ */ W(`div`,{className:L(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-left-shadow`,{"mantine-datatable-scroll-area-shadow-behind":e})}),/* @__PURE__ */ W(`div`,{className:L(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-right-shadow`,{"mantine-datatable-scroll-area-shadow-behind":n})}),/* @__PURE__ */ W(t,{className:L(`mantine-datatable-scroll-area-shadow`,`mantine-datatable-scroll-area-bottom-shadow`)})]})}function Ot({withTableBorder:e,borderRadius:n,textSelectionDisabled:r,height:i=`100%`,minHeight:a,maxHeight:o,shadow:s,verticalAlign:c=`center`,fetching:l,columns:u,storeColumnsKey:d,groups:f,pinFirstColumn:p,pinLastColumn:m,defaultColumnProps:h,defaultColumnRender:g,idAccessor:_=`id`,records:v,selectionTrigger:b=`checkbox`,selectedRecords:x,onSelectedRecordsChange:S,selectionColumnClassName:C,selectionColumnStyle:w,isRecordSelectable:T,selectionCheckboxProps:E,allRecordsSelectionCheckboxProps:D={"aria-label":`Select all records`},getRecordSelectionCheckboxProps:O=(e,t)=>({"aria-label":`Select record ${t+1}`}),sortStatus:k,sortIcons:A,onSortStatusChange:j,horizontalSpacing:M,page:N,onPageChange:P,totalRecords:I,recordsPerPage:H,onRecordsPerPageChange:U,recordsPerPageOptions:K,recordsPerPageLabel:ne=`Records per page`,paginationWithEdges:re,paginationWithControls:ie,paginationActiveTextColor:ae,paginationActiveBackgroundColor:oe,paginationSize:se=`sm`,paginationText:ue=({from:e,to:t,totalRecords:n})=>`${e} - ${t} / ${n}`,paginationWrapBreakpoint:fe=`sm`,getPaginationControlProps:q=e=>e===`previous`?{"aria-label":`Previous page`}:e===`next`?{"aria-label":`Next page`}:{},getPaginationItemProps:pe,renderPagination:ge,loaderBackgroundBlur:_e,customLoader:ve,loaderSize:ye,loaderType:xe,loaderColor:Se,loadingText:Ce=`...`,emptyState:we,noRecordsText:Te=`No records`,noRecordsIcon:Ee,highlightOnHover:De,striped:ke,noHeader:Ae,onRowClick:je,onRowDoubleClick:Me,onRowContextMenu:Ne,onCellClick:Pe,onCellDoubleClick:Y,onCellContextMenu:Fe,onScroll:Ie,onScrollToTop:Be,onScrollToBottom:Ve,onScrollToLeft:He,onScrollToRight:Ue,c:Ge,backgroundColor:Ke,borderColor:qe,rowBorderColor:X,stripedColor:Je,highlightOnHoverColor:Ye,selectionColor:Xe,rowColor:Ze,rowBackgroundColor:Qe,rowExpansion:$e,rowClassName:tt,rowStyle:nt,customRowAttributes:rt,scrollViewportRef:it,scrollAreaProps:at,tableRef:ot,bodyRef:st,m:ct,my:lt,mx:ut,mt:dt,mb:ft,ml:pt,mr:mt,className:ht,classNames:Z,style:gt,styles:_t,rowFactory:bt,tableWrapper:xt,...St}){let wt=B(()=>{let e=f?be(f):u;return h?e.map(e=>({...h,...e})):e},[u,f,h]),{refs:Q,onScroll:Tt}=Le({scrollCallbacks:{onScroll:Ie,onScrollToTop:Be,onScrollToBottom:Ve,onScrollToLeft:He,onScrollToRight:Ue},withRowBorders:St.withRowBorders}),$=Oe({key:d,columns:wt,headerRef:Q.header,scrollViewportRef:Q.scrollViewport}),Ot=$.effectiveColumns,kt=F(Q.table,ot),At=F(Q.scrollViewport,it),jt=V(null),Mt=F(jt,st),Nt=We({rowExpansion:$e,records:v,idAccessor:_}),{pinnedMap:Pt,hasLeftPinned:Ft,hasRightPinned:It}=Re({columns:Ot,theadRef:Q.header,tbodyRef:jt,selectionColumnHeaderRef:Q.selectionColumnHeader,selectionVisible:!!x,pinFirstColumn:p,pinLastColumn:m}),Lt=V(!1),Rt=V(N),zt=V(v),Bt=R(e=>{Lt.current=!0,zt.current=v,P(e)},[P,v]);z(()=>{Rt.current!==N&&(Lt.current=!0,zt.current=v,Rt.current=N)},[N,v]);let Vt=v?.length;ee(()=>{if(!Lt.current||l||v===zt.current)return;let e=Q.scrollViewport.current;if(!e)return;let t=requestAnimationFrame(()=>{e.scrollTo({top:0,left:0}),Lt.current=!1});return()=>cancelAnimationFrame(t)},[l,v,Q.scrollViewport]);let Ht=v?.map(e=>J(e,_)),Ut=!!x,Wt=x?.map(e=>J(e,_)),Gt=Ht!==void 0&&Wt!==void 0&&Wt.length>0,Kt=T?v?.filter(T):v,qt=Kt?.map(e=>J(e,_)),Jt=Gt&&qt.every(e=>Wt.includes(e)),Yt=Gt&&qt.some(e=>Wt.includes(e)),Xt=R(()=>{x&&S&&S(Jt?x.filter(e=>!qt.includes(J(e,_))):he([...x,...Kt],e=>J(e,_)))},[Jt,_,S,qt,Kt,x]),{lastSelectionChangeIndex:Zt,setLastSelectionChangeIndex:Qt}=ze(Ht),$t=Ut&&!Ft,en={m:ct,my:lt,mx:ut,mt:dt,mb:ft,ml:pt,mr:mt},tn=R(({children:e})=>xt?xt({children:e}):e,[xt]);return/* @__PURE__ */ W(ce,{...$,pinnedMap:Pt,children:/* @__PURE__ */ G(t,{ref:Q.root,...en,className:L(`mantine-datatable`,{"mantine-datatable-with-border":e},ht,Z?.root),style:[e=>({...te({theme:e,c:Ge,backgroundColor:Ke,borderColor:qe,rowBorderColor:X,stripedColor:Je,highlightOnHoverColor:Ye,selectionColor:Xe}),borderRadius:e.radius[n]||n,boxShadow:e.shadows[s]||s,height:i,minHeight:a,maxHeight:o}),gt,_t?.root,{position:`relative`}],children:[/* @__PURE__ */ W(Dt,{viewportRef:At,leftShadowBehind:Ut||Ft,rightShadowBehind:It,onScrollPositionChange:Tt,scrollAreaProps:at,children:/* @__PURE__ */ W(tn,{children:/* @__PURE__ */ G(y,{ref:kt,horizontalSpacing:M,className:L(`mantine-datatable-table`,{"mantine-datatable-text-selection-disabled":r,"mantine-datatable-vertical-align-top":c===`top`,"mantine-datatable-vertical-align-bottom":c===`bottom`,"mantine-datatable-selection-column-visible":Ut,"mantine-datatable-resizable-columns":$.hasResizableColumns,"mantine-datatable-resize-locked":$.isLocked,"mantine-datatable-resizing":$.isResizing},Z?.table),style:[_t?.table,$.isLocked?{tableLayout:`fixed`}:void 0,$.tableWidth==null?void 0:{width:`${$.tableWidth}px`}],"data-striped":Vt&&ke||void 0,"data-highlight-on-hover":De||void 0,...St,children:[Ae?null:/* @__PURE__ */ W(ce,{...$,pinnedMap:Pt,children:/* @__PURE__ */ W(vt,{ref:Q.header,selectionColumnHeaderRef:Q.selectionColumnHeader,className:Z?.header,style:_t?.header,columns:Ot,defaultColumnProps:h,groups:f,pinnedMap:Pt,sortStatus:k,sortIcons:A,onSortStatusChange:j,selectionTrigger:b,selectionVisible:Ut,selectionChecked:Jt,selectionIndeterminate:Yt&&!Jt,onSelectionChange:Xt,selectionCheckboxProps:{...E,...D},selectorCellShadowVisible:$t,selectionColumnClassName:C,selectionColumnStyle:w,withColumnBorders:St.withColumnBorders})}),/* @__PURE__ */ W(`tbody`,{ref:Mt,children:Vt?v.map((e,t)=>{let n=J(e,_),r=Wt?.includes(n)||!1,i;return S&&x&&(i=i=>{if(i.nativeEvent.shiftKey&&Zt!==null){let e=v.filter(t>Zt?(e,n)=>n>=Zt&&n<=t&&(!T||T(e,n)):(e,n)=>n>=t&&n<=Zt&&(!T||T(e,n)));S(r?me(x,e,e=>J(e,_)):he([...x,...e],e=>J(e,_)))}else S(r?x.filter(e=>J(e,_)!==n):he([...x,e],e=>J(e,_)));Qt(t)}),/* @__PURE__ */ W(Et,{record:e,index:t,columns:Ot,defaultColumnProps:h,pinnedMap:Pt,defaultColumnRender:g,selectionTrigger:b,selectionVisible:Ut,selectionChecked:r,onSelectionChange:i,isRecordSelectable:T,selectionCheckboxProps:E,getSelectionCheckboxProps:O,onClick:je,onDoubleClick:Me,onCellClick:Pe,onCellDoubleClick:Y,onContextMenu:Ne,onCellContextMenu:Fe,expansion:Nt,color:Ze,backgroundColor:Qe,className:tt,style:nt,customAttributes:rt,selectorCellShadowVisible:$t,selectionColumnClassName:C,selectionColumnStyle:w,idAccessor:_,rowFactory:bt},n)}):/* @__PURE__ */ W(le,{})}),Ot.some(({footer:e})=>e)&&/* @__PURE__ */ W(et,{ref:Q.footer,className:Z?.footer,style:_t?.footer,columns:Ot,defaultColumnProps:h,pinnedMap:Pt,selectionVisible:Ut,selectorCellShadowVisible:$t})]})})}),!!(N&&Vt)&&/* @__PURE__ */ W(Ct,{className:Z?.pagination,style:_t?.pagination,horizontalSpacing:M,fetching:l,page:N,onPageChange:Bt,totalRecords:I,recordsPerPage:H,onRecordsPerPageChange:U,recordsPerPageOptions:K,recordsPerPageLabel:ne,paginationWithEdges:re,paginationWithControls:ie,paginationActiveTextColor:ae,paginationActiveBackgroundColor:oe,paginationSize:se,paginationText:ue,paginationWrapBreakpoint:fe,getPaginationControlProps:q,getPaginationItemProps:pe,noRecordsText:Te,loadingText:Ce,recordsLength:Vt,renderPagination:ge}),/* @__PURE__ */ W(yt,{fetching:l,backgroundBlur:_e,customContent:ve,size:ye,type:xe,color:Se}),/* @__PURE__ */ W(de,{icon:Ee,text:Te,active:!l&&!Vt,children:we})]})})}function kt({className:e,children:t,isDragging:n,ref:r,...i}){let a=V(null),o=F(a,r);return z(()=>{if(!a.current||!n)return;let e=a.current.parentElement.parentElement.children[0].children[0];for(let t=0;t<e.children.length;t++){let n=e.children[t].getBoundingClientRect(),r=a.current.children[t];r.style.height=`${n.height}px`,r.style.width=`${n.width}px`,r.style.minWidth=`${n.width}px`,r.style.maxWidth=`${n.width}px`}},[n,t]),/* @__PURE__ */ W(w,{"data-is-dragging":n,ref:o,...i,className:e,children:t})}export{Ot as DataTable,kt as DataTableDraggableRow,xe as calculateColSpan,me as differenceBy,be as flattenColumns,Se as getGroupsAtDepth,ye as getMaxGroupDepth,J as getRecordId,ge as getValueAtPath,pe as hasStringAccessor,fe as humanize,Ce as needsRightBorder,_e as reorderRecords,q as sanitizeStoredArray,ve as swapRecords,he as uniqBy,Oe as useDataTableColumns};
|
|
2
3
|
//# sourceMappingURL=index.mjs.map
|