simple-table-core 0.7.53 → 0.7.56

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.
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import HeaderObject from "../../types/HeaderObject";
3
3
  import SortConfig from "../../types/SortConfig";
4
- export interface MinimalHeaderCellProps {
4
+ interface HeaderCellProps {
5
5
  colIndex: number;
6
+ forceHeadersUpdate: () => void;
6
7
  gridColumnEnd: number;
7
8
  gridColumnStart: number;
8
9
  gridRowEnd: number;
@@ -11,5 +12,5 @@ export interface MinimalHeaderCellProps {
11
12
  reverse?: boolean;
12
13
  sort: SortConfig | null;
13
14
  }
14
- declare const TableHeaderCell: import("react").ForwardRefExoticComponent<MinimalHeaderCellProps & import("react").RefAttributes<HTMLDivElement>>;
15
+ declare const TableHeaderCell: import("react").ForwardRefExoticComponent<HeaderCellProps & import("react").RefAttributes<HTMLDivElement>>;
15
16
  export default TableHeaderCell;
@@ -1,4 +1,4 @@
1
1
  export declare const DRAG_THROTTLE_LIMIT = 50;
2
2
  export declare const ROW_SEPARATOR_WIDTH = 1;
3
3
  export declare const PAGE_SIZE = 20;
4
- export declare const BUFFER_ROW_COUNT = 10;
4
+ export declare const BUFFER_ROW_COUNT = 5;
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as l,createContext as d,useContext as c,forwardRef as s,useLayoutEffect as u,Fragment as h,createRef as f,memo as v,useReducer as m}from"react";var g=function(){return g=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},g.apply(this,arguments)};function w(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var p=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},C=function(r){var t=r.currentPage,o=r.hideFooter,i=r.nextIcon,a=r.onPageChange,l=r.onNextPage,d=r.onPreviousPage,c=r.prevIcon,s=r.shouldPaginate,u=r.totalPages;if(o||!s)return null;var h=!(t>1)&&!d,f=!(t<u)&&!l;return e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t-1;e>=1&&a(e),d&&d(e-1)},disabled:h},{children:c})),n("button",g({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&a(e),l&&l(t)},disabled:f},{children:i})),Array.from({length:u},(function(e,r){return n("button",g({onClick:function(){var e;(e=r+1)>=1&&e<=u&&(a(e),e>t&&l?l(e-1):e<t&&d&&d(e-1))},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},I=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},x=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},R=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},b=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},y=function(e){return e.position*(e.rowHeight+1)-1},M=function(e){return e.position*(e.rowHeight+1)},S=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},E=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},D=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",g({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",g({value:"true"},{children:"True"})),n("option",g({value:"false"},{children:"False"}))]}))},H=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},k=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},N=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},l=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(H,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(D,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(k,{defaultValue:i,onBlur:l,onChange:a}):null})},L=0,T=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===L||o-L>=t)&&(L=o,n(r))}},W=Date.now(),O={screenX:0,screenY:0},B=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,d=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){r.current=n}),[n]),r.current);return{handleDragStart:function(e){t.current=e,W=Date.now()},handleDragOver:function(e){var n,r=e.event,o=e.hoveredHeader;if(r.preventDefault(),i.current){var a=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),d=r.screenX,u=r.screenY,h=Math.sqrt(Math.pow(d-O.screenX,2)+Math.pow(u-O.screenY,2));l.current=o;var f=w([],i.current,!0),v=f.findIndex((function(e){var n;return e.accessor===(null===(n=t.current)||void 0===n?void 0:n.accessor)})),m=f.findIndex((function(e){return e.accessor===o.accessor})),g=f.splice(v,1)[0];if(f.splice(m,0,g),!(a||o.accessor===(null===(n=t.current)||void 0===n?void 0:n.accessor)||null===t.current||h<10||void 0===v||void 0===m||JSON.stringify(f)===JSON.stringify(i.current))){var p=Date.now();JSON.stringify(f)===JSON.stringify(s)&&p-W<800&&h<50||(W=p,O={screenX:d,screenY:u},c(f))}}},handleDragEnd:function(){t.current=null,l.current=null,null==d||d(i.current)}}},P=d(void 0),F=function(e){var r=e.children,t=e.value;return n(P.Provider,g({value:t},{children:r}))},A=function(){var e=c(P);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},z=s((function(r,o){var i,l,d=r.borderClass,c=r.colIndex,s=r.header,u=r.isHighlighted,h=r.isInitialFocused,f=r.onExpandRowClick,v=r.rowIndex,m=r.visibleRow,w=A(),p=w.collapseIcon,C=w.draggedHeaderRef,I=w.expandIcon,x=w.handleMouseDown,R=w.handleMouseOver,b=w.headersRef,y=w.hoveredHeaderRef,M=w.onCellEdit,E=w.onTableHeaderDragEnd,D=m.depth,H=m.row,k=t(H.rowData[s.accessor]),L=k[0],W=k[1],O=t(!1),P=O[0],F=O[1],z=B({draggedHeaderRef:C,headersRef:b,hoveredHeaderRef:y,onTableHeaderDragEnd:E}).handleDragOver,j=T(),U="cell-".concat(v,"-").concat(c),K=Boolean(null===(l=null===(i=H.rowMeta)||void 0===i?void 0:i.children)||void 0===l?void 0:l.length),V=Boolean(null==s?void 0:s.isEditable),J=m.position%2==0,X="st-cell ".concat(D>0&&s.expandable?"st-cell-depth-".concat(D):""," ").concat(u?h?"st-cell-selected-first ".concat(d):"st-cell-selected ".concat(d):""," ").concat(J?"st-cell-odd-row":"st-cell-even-row"," ").concat(V?"clickable":"");a((function(){W(H.rowData[s.accessor])}),[s.accessor,H]);return P?n("div",g({className:"st-cell-editing ".concat(J?"st-cell-odd-row":"st-cell-even-row"),id:S({accessor:s.accessor,rowIndex:v+1})},{children:n(N,{onChange:function(e){W(e),null==M||M({accessor:s.accessor,newValue:e,row:H})},setIsEditing:F,value:L})})):e("div",g({className:X,id:U,onDoubleClick:function(){return s.isEditable&&F(!0)},onMouseDown:function(){return x({rowIndex:v,colIndex:c,rowId:H.rowMeta.rowId})},onMouseOver:function(){return R({rowIndex:v,colIndex:c,rowId:H.rowMeta.rowId})},onDragOver:function(e){return j({callback:z,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||P||(e.preventDefault(),F(!0))},ref:o,"data-row-index":v,"data-col-index":c,"aria-selected":u},{children:[s.expandable&&K?H.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return f(H.rowMeta.rowId)}},{children:p})):n("div",g({className:"st-sort-icon-container",onClick:function(){return f(H.rowMeta.rowId)}},{children:I})):null,n("span",g({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"")},{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:c,row:H}):L}))]}))})),j=function(e){var t=e.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(e,["children"]);return A().allowAnimations?n(U,g({},o,{children:t})):n(r,{children:t})},U=function(e){var i=e.children,l=e.isBody,d=e.pauseAnimation,c=e.rowIndex,s=o(!1),h=A(),f=h.draggedHeaderRef,v=h.headersRef,m=h.mainBodyRef,g=h.shouldPaginate,w=t({}),p=w[0],C=w[1],I=o({}),x=v.current;return u((function(){if(x){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(S({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:x,draggedHeaderRef:f,rowIndex:c});JSON.stringify(e)!==JSON.stringify(p)&&(I.current=p,C(e))}}),[p,x,f,l,c]),u((function(){var e=m.current,n=function(){s.current=!0},r=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[f,m]),a((function(){d||s.current||Object.keys(I.current).length&&x&&x.forEach((function(e){var n=document.getElementById(S({accessor:e.accessor,rowIndex:c}));if(n){var r=I.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=g?0:r.top-t.top,a=Math.abs(o),l=Math.abs(i);(a>10||l>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[p,x,l,d,I,c,g]),n(r,{children:i})},K=function(e){var r=e.columnIndices,t=e.headers,o=e.hiddenColumns,i=e.isWidthDragging,a=e.onExpandRowClick,l=e.pinned,d=e.rowIndex,c=e.rowIndices,s=e.visibleRow,u=t.filter((function(e){return E({hiddenColumns:o,header:e,pinned:l})}));return n(j,g({isBody:!0,pauseAnimation:i,rowIndex:d+1},{children:u.map((function(e){return n(V,{columnIndices:r,header:e,headers:t,hiddenColumns:o,onExpandRowClick:a,pinned:l,rowIndex:d,rowIndices:c,visibleRow:s},S({accessor:e.accessor,rowIndex:d+1}))}))}))},V=function(e){var r=e.columnIndices,t=e.header,o=e.headers,i=e.hiddenColumns,a=e.onExpandRowClick,l=e.pinned,d=e.rowIndex,c=e.rowIndices,s=e.visibleRow,u=r[t.accessor],f=A(),v=f.getBorderClass,m=f.isSelected,g=f.isInitialFocusedCell;if(t.children){var w=t.children.filter((function(e){return E({hiddenColumns:i,header:e,pinned:l})}));return n(h,{children:w.map((function(e){return n(V,{columnIndices:r,header:e,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:l,rowIndex:d,rowIndices:c,visibleRow:s},S({accessor:e.accessor,rowIndex:d+1}))}))})}var p={rowIndex:d,colIndex:u,rowId:s.row.rowMeta.rowId},C=v(p),I=m(p),x=g(p);return n(z,{borderClass:C,colIndex:u,header:t,isHighlighted:I,isInitialFocused:x,onExpandRowClick:a,rowIndex:d,visibleRow:s},S({accessor:t.accessor,rowIndex:d+1}))},J=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.headers,i=e.hiddenColumns,a=e.index,l=e.isWidthDragging,d=e.onExpandRowClick,c=e.pinned,s=e.rowHeight,u=e.rowIndices,h=e.visibleRow,f=h.position,v=a;return n("div",g({className:"st-table-row",style:{gridTemplateColumns:t,top:M({position:f,rowHeight:s}),height:"".concat(s,"px")}},{children:n(K,{columnIndices:r,headers:o,hiddenColumns:i,isWidthDragging:l,onExpandRowClick:d,pinned:c,rowIndex:v,rowIndices:u,visibleRow:h},a)}))},X=function(e){var r=e.displayStrongBorder,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",g({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:y({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},q=function(r){var t=r.columnIndices;r.headerContainerRef;var o=r.headers,i=r.hiddenColumns,a=r.isWidthDragging,l=r.onExpandRowClick,d=r.pinned,c=r.rowHeight,s=r.rowIndices,u=r.sectionRef,f=r.templateColumns,v=r.totalHeight,m=r.visibleRows,w=r.width,p=d?"st-table-body-pinned-".concat(d):"st-table-body-main";return n("div",g({className:p,ref:u,style:{position:"relative",height:"".concat(v,"px"),width:w}},{children:m.map((function(r,u){var v,g,w,p,C=Boolean(null===(g=null===(v=r.row.rowMeta)||void 0===v?void 0:v.children)||void 0===g?void 0:g.length),I=null===(p=null===(w=m[u-1])||void 0===w?void 0:w.row.rowMeta)||void 0===p?void 0:p.isExpanded;return e(h,{children:[n(J,{columnIndices:t,gridTemplateColumns:f,headers:o,hiddenColumns:i,index:u,isWidthDragging:a,onExpandRowClick:l,pinned:d,rowHeight:c,rowIndices:s,visibleRow:r}),0!==u&&n(X,{displayStrongBorder:C&&I,position:r.position,rowHeight:c,templateColumns:f})]},u)}))}))};function Y(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return E({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&E({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var $,G=function(r){var i,d,c,s,u,h=r.centerHeaderRef,f=r.flattenedRows,v=r.headerContainerRef,m=r.isWidthDragging,w=r.mainTemplateColumns,p=r.pinnedLeftColumns,C=r.pinnedLeftHeaderRef,I=r.pinnedLeftTemplateColumns,x=r.pinnedRightColumns,R=r.pinnedRightHeaderRef,b=r.pinnedRightTemplateColumns,y=r.setFlattenedRows,M=r.setScrollTop,S=r.visibleRows,E=A(),D=E.rowHeight,H=E.scrollbarWidth,k=E.mainBodyRef,N=E.pinnedLeftRef,L=E.pinnedRightRef,T=E.tableBodyContainerRef,W=E.hiddenColumns,O=E.headersRef;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],d=i[1];a((function(){var e=null==n?void 0:n.current;if(l&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,l,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:v,mainSectionRef:T,scrollbarWidth:H});var B,P,F=o(null),z=(B=0,(P=function(e){e.forEach((function(e){B+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&P(e.rowMeta.children)}))})(f),B)*(D+1)-1,j=l((function(){return Y({headersRef:O,hiddenColumns:W,pinnedLeftColumns:p,pinnedRightColumns:x})}),[O,W,p,x]),U=l((function(){var e={};return S.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[S]),K=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};y((function(e){return e.map(n)}))},V=(null===(i=C.current)||void 0===i?void 0:i.clientWidth)?(null===(d=C.current)||void 0===d?void 0:d.clientWidth)+1:0,J=null===(c=h.current)||void 0===c?void 0:c.clientWidth,X=(null===(s=R.current)||void 0===s?void 0:s.clientWidth)?(null===(u=R.current)||void 0===u?void 0:u.clientWidth)+1:0,$={headerContainerRef:v,headers:O.current,hiddenColumns:W,isWidthDragging:m,rowHeight:D,visibleRows:S,columnIndices:j,rowIndices:U};return e("div",g({className:"st-table-body-container",ref:T,onScroll:function(e){var n=e.currentTarget.scrollTop;F.current&&cancelAnimationFrame(F.current),F.current=requestAnimationFrame((function(){M(n)}))}},{children:[p.length>0&&n(q,g({},$,{onExpandRowClick:K,pinned:"left",sectionRef:N,templateColumns:I,totalHeight:z,width:V})),n(q,g({},$,{onExpandRowClick:K,sectionRef:k,templateColumns:w,totalHeight:z,width:J})),x.length>0&&n(q,g({},$,{onExpandRowClick:K,pinned:"right",sectionRef:L,templateColumns:b,totalHeight:z,width:X}))]}))},_=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},Q={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return Q.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?Q.string(e,n,r):"number"==typeof e&&"number"==typeof n?Q.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?Q.boolean(e,n,r):Q.string(String(e),String(n),r)}},Z=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return Q.number(i,a,t)}return"date"===r?Q.date(String(e),String(n),t):"boolean"===r?Q.boolean(Boolean(e),Boolean(n),t):"enum"===r?Q.enum(String(e),String(n),t):Q.string(String(e),String(n),t)},ee=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction,a=new Map,l=new Map,d="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(a.size)).toString();d=t,l.set(d,e),a.has(d)||a.set(d,[])}else if(d){var o=a.get(d)||[];o.push(e),a.set(d,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var c=[];return a.forEach((function(e,t){if(l.has(t)){var a=l.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=ne(a.rowMeta.children,n,r)),c.push(a)}var d=w([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return Z(a,l,o,i)}));c.push.apply(c,d.map((function(e){var t=g({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=ne(t.rowMeta.children,n,r);t.rowMeta=g(g({},t.rowMeta),{children:o})}return t})))})),c},ne=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return w([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return Z(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:ne(e.rowMeta.children,n,r)})}):e}))},re=function(e){e.colIndex;var n=e.event,r=e.forceUpdate,t=e.header;e.headersRef;var o=e.gridColumnEnd,i=e.gridColumnStart,a=e.setIsWidthDragging,l=e.startWidth;a(!0),n.preventDefault();var d=n.clientX;if(t){var c="number"==typeof t.minWidth?t.minWidth:40,s=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return s(e)})):[e]},u=o-i>1,h=u?s(t):[t],f=h.map((function(e){return"number"==typeof e.width?e.width:parseInt(String(e.width),10)||150})).reduce((function(e,n){return e+n}),0),v=function(e){var n=e.clientX-d;if(u&&h.length>1){for(var o=Math.max(f+n,h.length*c),i=Math.max(Math.floor(o/h.length),c),a=0;a<h.length-1;a++)h[a].width=i;var s=i*(h.length-1),v=Math.max(o-s,c);h[h.length-1].width=v}else{var m=Math.max(l+n,c);t.width=m}r()},m=function(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",m),a(!1)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",m)}},te=s((function(r,o){var i=r.colIndex,l=r.gridColumnEnd,d=r.gridColumnStart,c=r.gridRowEnd,s=r.gridRowStart,u=r.header,h=r.reverse,f=r.sort,v=A(),m=v.columnReordering,p=v.columnResizing,C=v.draggedHeaderRef,I=v.forceUpdate,x=v.headersRef,R=v.hoveredHeaderRef,b=v.onColumnOrderChange,y=v.onSort,M=v.onTableHeaderDragEnd,E=v.rowHeight,D=v.selectColumns,H=v.selectableColumns,k=v.setInitialFocusedCell,N=v.setIsWidthDragging,L=v.setSelectedCells,W=v.setSelectedColumns,O=v.sortDownIcon,P=v.sortUpIcon,F=t(!1),z=F[0],j=F[1],U=Boolean(null==u?void 0:u.isSortable),K="st-header-cell ".concat(u===R.current?"st-hovered":""," ").concat(z?"st-dragging":""," ").concat(U?"clickable":""," ").concat(m&&!U?"columnReordering":""," ").concat("right"===(null==u?void 0:u.align)?"right-aligned":"center"===(null==u?void 0:u.align)?"center-aligned":""),V=B({draggedHeaderRef:C,headersRef:x,hoveredHeaderRef:R,onColumnOrderChange:b,onTableHeaderDragEnd:M}),J=V.handleDragStart,X=V.handleDragEnd,q=V.handleDragOver,Y=T(),$=function(e){var n=e.event,r=e.header;if(H){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,i);return n.shiftKey&&D?W((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],i=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<i&&(i=r,o=e)}));var a,l,d,c,s=w(w([],(a=o,l=n,d=Math.min(a,l),c=Math.max(a,l),Array.from({length:c-d+1},(function(e,n){return d+n}))),!0),t,!0);return new Set(w(w([],Array.from(e),!0),s,!0))})):D&&D(t),L(new Set),void k(null)}r.isSortable&&y(i,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!u)return null;var G=p&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;Y({callback:re,callbackProps:{colIndex:i,event:e,forceUpdate:I,header:u,headersRef:x,gridColumnEnd:l,gridColumnStart:d,setIsWidthDragging:N,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),_=f&&f.key.accessor===u.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return $({event:e,header:u})}},{children:["ascending"===f.direction&&P&&P,"descending"===f.direction&&O&&O]}));return e("div",g({className:K,id:S({accessor:u.accessor,rowIndex:0}),onDragOver:function(e){Y({callback:q,callbackProps:{event:e,hoveredHeader:u},limit:50})},ref:o,style:g(g({gridRowStart:s,gridRowEnd:c,gridColumnStart:d,gridColumnEnd:l},l-d>1?{}:{width:u.width}),c-s>1?{}:{height:E})},{children:[h&&G,e("div",g({className:"st-header-label ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":""),draggable:m,onClick:function(e){return $({event:e,header:u})},onDragEnd:function(e){e.preventDefault(),j(!1),X()},onDragStart:function(e){m&&u&&function(e){j(!0),J(e)}(u)}},{children:["right"===u.align&&_,null==u?void 0:u.label,"right"!==u.align&&_]})),!h&&G]}))})),oe=function(r){var t=r.columnIndices,o=r.depth,i=r.header,a=r.hiddenColumns,l=r.maxDepth,d=r.pinned,c=r.gridPosition,s=r.reverse,u=r.sort;if(!E({hiddenColumns:a,header:i,pinned:d}))return null;var v=c.gridColumnStart,m=c.gridColumnEnd,g=c.gridRowStart,w=c.gridRowEnd,p=t[i.accessor];if(i.children){var C=i.children.filter((function(e){return E({hiddenColumns:a,header:e,pinned:d})}));return e(h,{children:[n(te,{colIndex:p,gridColumnEnd:m,gridColumnStart:v,gridRowEnd:w,gridRowStart:g,header:i,ref:f(),reverse:s,sort:u}),C.map((function(e,r){var i,h=null===(i=c.children)||void 0===i?void 0:i[e.accessor];return h?n(oe,{columnIndices:t,depth:o+1,gridPosition:h,header:e,hiddenColumns:a,maxDepth:l,pinned:d,reverse:s,sort:u},e.accessor):null}))]})}return n(te,{colIndex:p,gridColumnEnd:m,gridColumnStart:v,gridRowEnd:w,gridRowStart:g,header:i,ref:f(),reverse:s,sort:u})},ie=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.handleScroll,i=e.headersRef,a=e.hiddenColumns,d=e.maxDepth,c=e.pinned,s=e.sectionRef,u=e.sort,h=i.current.filter((function(e){return E({hiddenColumns:a,header:e,pinned:c})})),f=l((function(){var e,n,r;return e={},n=1,r=function(t,o,i){var l,s;void 0===i&&(i=!1),i||n++;var u=null!==(s=null===(l=t.children)||void 0===l?void 0:l.filter((function(e){return E({hiddenColumns:a,header:e,pinned:c})})).length)&&void 0!==s?s:0,h={gridColumnStart:n,gridColumnEnd:u>0?n+u:n+1,gridRowStart:o,gridRowEnd:u>0?o+1:d+1,children:{}};return t.children&&t.children.length>0&&t.children.filter((function(e){return E({hiddenColumns:a,header:e,pinned:c})})).forEach((function(e,n){h.children[e.accessor]=r(e,o+1,0===n)})),e[t.accessor]=h,h},h.forEach((function(e,n){r(e,1,0===n)})),e}),[h,a,d,c]);return n("div",g({className:"st-header-".concat(c?"pinned-".concat(c):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:t}},{children:n(j,g({rowIndex:0},{children:h.map((function(e){var t=f[e.accessor];return t?n(oe,{columnIndices:r,depth:1,gridPosition:t,header:e,hiddenColumns:a,maxDepth:d,pinned:c,reverse:"right"===c,sort:u},e.accessor):null}))}))}))},ae=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(ae)):1},le=function(r){var t=r.centerHeaderRef,o=r.headerContainerRef,i=r.headersRef,a=r.hiddenColumns,d=r.mainTemplateColumns,c=r.pinnedLeftColumns,s=r.pinnedLeftHeaderRef,u=r.pinnedLeftTemplateColumns,h=r.pinnedRightColumns,f=r.pinnedRightHeaderRef,v=r.pinnedRightTemplateColumns,m=r.sort,w=A().mainBodyRef;_(w,t);var p=l((function(){return Y({headersRef:i,hiddenColumns:a,pinnedLeftColumns:c,pinnedRightColumns:h})}),[i,a,c,h]),C=l((function(){var e=i.current,n=0;return e.forEach((function(e){if(E({hiddenColumns:a,header:e})){var r=ae(e);n=Math.max(n,r)}})),{maxDepth:n}}),[i,a]).maxDepth;return e("div",g({className:"st-header-container",ref:o},{children:[c.length>0&&n(ie,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"left",sectionRef:s,sort:m}),n(ie,{columnIndices:p,gridTemplateColumns:d,handleScroll:function(e){var n,r,o=null===(n=t.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(r=w.current)||void 0===r||r.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:C,sectionRef:t,sort:m}),h.length>0&&n(ie,{columnIndices:p,gridTemplateColumns:v,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"right",sectionRef:f,sort:m})]}))},de=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},ce=function(r){var t=r.flattenedRows,i=r.isWidthDragging,a=r.setFlattenedRows,d=r.setScrollTop,c=r.sort,s=r.visibleRows,u=A(),h=u.editColumns,f=u.headersRef,v=u.hiddenColumns,m=o(null),w=o(null),p=o(null),C=o(null),I=f.current.filter((function(e){return!e.pinned})),x=f.current.filter((function(e){return"left"===e.pinned})),R=f.current.filter((function(e){return"right"===e.pinned})),b=l((function(){return de({headers:x,hiddenColumns:v})}),[x,v]),y=l((function(){return de({headers:I,hiddenColumns:v})}),[I,v]),M=l((function(){return de({headers:R,hiddenColumns:v})}),[R,v]),S={centerHeaderRef:p,flattenedRows:t,headerContainerRef:m,isWidthDragging:i,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:w,pinnedLeftTemplateColumns:b,pinnedRightColumns:R,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,setFlattenedRows:a,setScrollTop:d,visibleRows:s};return e("div",g({className:"st-table-content",style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[n(le,g({},{centerHeaderRef:p,headerContainerRef:m,headersRef:f,hiddenColumns:v,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:w,pinnedLeftTemplateColumns:b,pinnedRightColumns:R,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,sort:c})),n(G,g({},S))]}))},se=function(e){var n=e.callback,r=e.ref,t=e.widthAttribute;a((function(){var e=r.current;if(e){var o=function(){n(e[t]||0)};o();var i=new ResizeObserver((function(){o()}));return i.observe(e),function(){return i.disconnect()}}}),[n,r,t])},ue=function(r){var i=r.mainBodyRef,a=r.pinnedLeftRef,l=r.pinnedRightRef,d=r.tableContentWidth,c=t(0),s=c[0],u=c[1],h=t(0),f=h[0],v=h[1],m=t(0),w=m[0],p=m[1],C=o(null);return se({widthAttribute:"offsetWidth",callback:u,ref:a}),se({widthAttribute:"scrollWidth",callback:p,ref:i}),se({widthAttribute:"offsetWidth",callback:v,ref:l}),_(i,C),!i.current||i.current.scrollWidth<=i.current.clientWidth?null:e("div",g({className:"st-horizontal-scrollbar-container",style:{width:d}},{children:[s>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s}}),w>0&&n("div",g({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&i.current&&i.current.scrollTo({left:n,behavior:"auto"})},ref:C},{children:n("div",{style:{width:w}})})),f>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},he=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],d=l((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),c=t(d),s=c[0],u=c[1],h=l((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:ee(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{sort:i,setSort:a,updateSort:function(e,r){var t=n.find((function(e){return e.accessor===r}));t&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:h,hiddenColumns:s,setHiddenColumns:u}},fe=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,d=t(i),c=d[0],s=d[1];return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;s(e),l&&l(e)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},ve=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var i=e.setHiddenColumns,a=e.hiddenColumns,l="left"===o?"left":"";return n("div",g({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",g({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(fe,g({checked:a[e.accessor],onChange:function(n){var r;return i(g(g({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},me=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,d=r.position,c=void 0===d?"right":d,s=r.setHiddenColumns,u=r.hiddenColumns,h=t(a),f=h[0],v=h[1];return i?e("div",g({className:"st-column-editor ".concat(f?"open":""," ").concat(c),onClick:function(){return function(e){v(e)}(!f)}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(ve,{headers:l,open:f,position:c,setOpen:v,setHiddenColumns:s,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}($||($={}));var ge=v((function(r){var d=r.allowAnimations,c=void 0!==d&&d,s=r.collapseIcon,h=void 0===s?n(b,{className:"st-sort-icon"}):s,f=r.columnEditorPosition,v=void 0===f?$.Right:f,w=r.columnEditorText,y=void 0===w?"Columns":w,M=r.columnReordering,S=void 0!==M&&M,E=r.columnResizing,D=void 0!==E&&E,H=r.defaultHeaders,k=r.editColumns,N=void 0!==k&&k,L=r.editColumnsInitOpen,T=void 0!==L&&L,W=r.expandIcon,O=void 0===W?n(x,{className:"st-sort-icon"}):W,B=r.height,P=r.hideFooter,A=void 0!==P&&P,z=r.nextIcon,j=void 0===z?n(x,{className:"st-next-prev-icon"}):z,U=r.onCellEdit,K=r.onColumnOrderChange,V=r.onNextPage,J=r.onPreviousPage,X=r.prevIcon,q=void 0===X?n(I,{className:"st-next-prev-icon"}):X,Y=r.rowHeight,G=void 0===Y?40:Y,_=r.rows,Q=r.rowsPerPage,Z=void 0===Q?10:Q,ee=r.selectableCells,ne=void 0!==ee&&ee,re=r.selectableColumns,te=void 0!==re&&re,oe=r.shouldPaginate,ie=void 0!==oe&&oe,ae=r.sortDownIcon,le=void 0===ae?n(b,{className:"st-sort-icon"}):ae,de=r.sortUpIcon,se=void 0===de?n(R,{className:"st-sort-icon"}):de,fe=r.theme,ve=void 0===fe?"light":fe,ge=r.totalPages,we=o(null),pe=o(H),Ce=o(null),Ie=o(null),xe=o(null),Re=o(null),be=o(null),ye=t(!1),Me=ye[0],Se=ye[1],Ee=t(1),De=Ee[0],He=Ee[1],ke=t(0),Ne=ke[0],Le=ke[1],Te=t(0),We=Te[0],Oe=Te[1],Be=t(0),Pe=Be[0],Fe=Be[1],Ae=he({headers:pe.current,tableRows:_}),ze=Ae.sort,je=Ae.sortedRows,Ue=Ae.hiddenColumns,Ke=Ae.setHiddenColumns,Ve=Ae.updateSort,Je=l((function(){if(!ie)return je;var e=(De-1)*Z,n=e+Z;return je.slice(e,n)}),[De,Z,ie,je]),Xe=t(Je),qe=Xe[0],Ye=Xe[1];a((function(){Ye(Je)}),[Je]);var $e=l((function(){var e;if(!B)return window.innerHeight-G;var n=document.querySelector(".simple-table-root"),r=0;if(B.endsWith("px"))r=parseInt(B,10);else if(B.endsWith("vh")){var t=parseInt(B,10);r=window.innerHeight*t/100}else if(B.endsWith("%")){var o=parseInt(B,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-G)}),[B,G]),Ge=l((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=[],l=0,d=Math.max(0,i-o*n),c=i+r+o*n,s=function(e,n){for(var r,t=0,i=e;t<i.length;t++){var u=i[t],h=l*o;if(h>=c)break;h+o>d&&a.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&s(u.rowMeta.children,n+1)}};return s(t,0),a}({bufferRowCount:10,contentHeight:$e,flattenedRows:qe,rowHeight:G,scrollTop:Pe})}),[$e,G,qe,Pe]),_e=m((function(e){return e+1}),0)[1],Qe=function(e){var n=e.selectableCells,r=e.headers,d=e.visibleRows,c=t(new Set),s=c[0],u=c[1],h=t(new Set),f=h[0],v=h[1],m=t(null),g=m[0],w=m[1],C=t(null),I=C[0],x=C[1],R=o(!1),b=o(null),y=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=d[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,d]),M=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),l=t;l<=o;l++)for(var c=i;c<=a;c++)if(l>=0&&l<d.length){var s=d[l].row.rowMeta.rowId;r.add(p({colIndex:c,rowIndex:l,rowId:s}))}v(new Set),w(null),u(r)}),[d,v,w,u]),S=i((function(e){if(e.rowIndex>=0&&e.rowIndex<d.length&&e.colIndex>=0&&e.colIndex<r.length){var n=p(e);v(new Set),w(null),u(new Set([n])),x(e)}}),[r.length,d.length,v,w,u,x]),E=i((function(e,n){void 0===n&&(n=!1),u(new Set),x(null),v((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&w(e[e.length-1])}),[u,x,v,w]);a((function(){var e=function(e){if(n&&I){var t=I.rowIndex,o=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(d[t].row.rowMeta.rowId!==i){var a=d.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var l={rowIndex:t-1,colIndex:o,rowId:d[t-1].row.rowMeta.rowId};S(l)}}else"ArrowDown"===e.key?(e.preventDefault(),t<d.length-1&&(l={rowIndex:t+1,colIndex:o,rowId:d[t+1].row.rowMeta.rowId},S(l))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(l={rowIndex:t,colIndex:o-1,rowId:d[t].row.rowMeta.rowId},S(l))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(l={rowIndex:t,colIndex:o+1,rowId:d[t].row.rowMeta.rowId},S(l))):"Escape"===e.key&&(u(new Set),v(new Set),w(null),b.current=null,x(null))}else y()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[y,r.length,I,M,S,n,d]);var D=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=p({colIndex:n,rowIndex:r,rowId:t}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),H=i((function(e){var n,r,t,o,i,a,l=e.colIndex,c=e.rowIndex,s=e.rowId,u=[],h=null===(t=null===(r=null===(n=d[c-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:l,rowIndex:c+1,rowId:null===(a=null===(i=null===(o=d[c+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},m={colIndex:l-1,rowIndex:c,rowId:s},g={colIndex:l+1,rowIndex:c,rowId:s};return(!D({colIndex:l,rowIndex:c-1,rowId:h})||f.has(l)&&0===c)&&u.push("st-selected-top-border"),(!D(v)||f.has(l)&&c===d.length-1)&&u.push("st-selected-bottom-border"),D(m)||u.push("st-selected-left-border"),D(g)||u.push("st-selected-right-border"),u.join(" ")}),[D,d,f]),k=l((function(){return I?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===I.rowIndex&&r===I.colIndex&&t===I.rowId}:function(){return!1}}),[I]);return{getBorderClass:H,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){R.current=!0,b.current={rowIndex:t,colIndex:r,rowId:o},v(new Set),w(null);var i=p({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),x({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&R.current&&b.current){for(var o=new Set,i=Math.min(b.current.rowIndex,t),a=Math.max(b.current.rowIndex,t),l=Math.min(b.current.colIndex,r),c=Math.max(b.current.colIndex,r),s=i;s<=a;s++)for(var h=l;h<=c;h++)if(s>=0&&s<d.length){var f=d[s].row.rowMeta.rowId;o.add(p({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){R.current=!1},isInitialFocusedCell:k,isSelected:D,lastSelectedColumnIndex:g,selectColumns:E,selectedCells:s,selectedColumns:f,setInitialFocusedCell:x,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:ne,headers:pe.current,visibleRows:Ge}),Ze=Qe.handleMouseDown,en=Qe.handleMouseOver,nn=Qe.handleMouseUp,rn=Qe.isSelected,tn=Qe.getBorderClass,on=Qe.isInitialFocusedCell,an=Qe.setSelectedCells,ln=Qe.setSelectedColumns,dn=Qe.selectColumns,cn=Qe.setInitialFocusedCell,sn=i((function(e,n){Ve(e,n)}),[Ve]),un=i((function(e){pe.current=e,_e()}),[]);return a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||te&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(an(new Set),te&&ln(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[te,an,ln]),u((function(){if(be.current){var e=be.current.offsetWidth-be.current.clientWidth,n=be.current.clientWidth;Le(e),Oe(n)}}),[]),u((function(){var e=function(){if(_e(),be.current){var e=be.current.offsetWidth-be.current.clientWidth,n=be.current.clientWidth;Le(e),Oe(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),n(F,g({value:{allowAnimations:c,collapseIcon:h,columnReordering:S,columnResizing:D,draggedHeaderRef:we,editColumns:N,expandIcon:O,forceUpdate:_e,getBorderClass:tn,handleMouseDown:Ze,handleMouseOver:en,headersRef:pe,hiddenColumns:Ue,hoveredHeaderRef:Ce,isInitialFocusedCell:on,isSelected:rn,mainBodyRef:Ie,onCellEdit:U,onColumnOrderChange:K,onSort:sn,onTableHeaderDragEnd:un,pinnedLeftRef:xe,pinnedRightRef:Re,rowHeight:G,scrollbarWidth:Ne,selectColumns:dn,selectableColumns:te,setInitialFocusedCell:cn,setIsWidthDragging:Se,setSelectedCells:an,setSelectedColumns:ln,shouldPaginate:ie,sortDownIcon:le,sortUpIcon:se,tableBodyContainerRef:be}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(ve),style:B?{height:B}:{}},{children:[e("div",g({className:"st-table-wrapper-container"},{children:[e("div",g({className:"st-table-wrapper",onMouseUp:nn,onMouseLeave:nn},{children:[n(ce,{flattenedRows:qe,isWidthDragging:Me,setFlattenedRows:Ye,setScrollTop:Fe,sort:ze,visibleRows:Ge}),n(me,{columnEditorText:y,editColumns:N,editColumnsInitOpen:T,headers:pe.current,hiddenColumns:Ue,position:v,setHiddenColumns:Ke})]})),n(ue,{mainBodyRef:Ie,pinnedLeftRef:xe,pinnedRightRef:Re,tableContentWidth:We})]})),n(C,{currentPage:De,hideFooter:A,nextIcon:j,onPageChange:He,onNextPage:V,onPreviousPage:J,prevIcon:q,shouldPaginate:ie,totalPages:ge||Math.ceil(je.length/Z)})]}))}))}));export{ge as SimpleTable};
1
+ import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as l,createContext as d,useContext as c,forwardRef as s,useLayoutEffect as u,Fragment as h,useReducer as f,createRef as v,memo as g}from"react";var m=function(){return m=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},m.apply(this,arguments)};function w(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var p=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},C=function(r){var t=r.currentPage,o=r.hideFooter,i=r.nextIcon,a=r.onPageChange,l=r.onNextPage,d=r.onPreviousPage,c=r.prevIcon,s=r.shouldPaginate,u=r.totalPages;if(o||!s)return null;var h=!(t>1)&&!d,f=!(t<u)&&!l;return e("div",m({className:"st-footer"},{children:[n("button",m({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t-1;e>=1&&a(e),d&&d(e-1)},disabled:h},{children:c})),n("button",m({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&a(e),l&&l(t)},disabled:f},{children:i})),Array.from({length:u},(function(e,r){return n("button",m({onClick:function(){var e;(e=r+1)>=1&&e<=u&&(a(e),e>t&&l?l(e-1):e<t&&d&&d(e-1))},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},I=function(e){var r=e.className;return n("svg",m({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},x=function(e){var r=e.className;return n("svg",m({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},R=function(e){var r=e.className;return n("svg",m({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},b=function(e){var r=e.className;return n("svg",m({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},y=function(e){return e.position*(e.rowHeight+1)-1},M=function(e){return e.position*(e.rowHeight+1)},S=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},E=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},D=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",m({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",m({value:"true"},{children:"True"})),n("option",m({value:"false"},{children:"False"}))]}))},H=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},k=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},N=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},l=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(H,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(D,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(k,{defaultValue:i,onBlur:l,onChange:a}):null})},L=0,T=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===L||o-L>=t)&&(L=o,n(r))}},W=Date.now(),O={screenX:0,screenY:0},B=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,d=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){r.current=n}),[n]),r.current);return{handleDragStart:function(e){t.current=e,W=Date.now()},handleDragOver:function(e){var n,r,o=e.event,a=e.hoveredHeader;if(o.preventDefault(),i.current){var d=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=o.screenX,h=o.screenY,f=Math.sqrt(Math.pow(u-O.screenX,2)+Math.pow(h-O.screenY,2));l.current=a;var v=function(e,n,r){void 0===r&&(r=[]);for(var t=0;t<e.length;t++){var o=e[t];if(o.accessor===n)return w(w([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=v(o.children,n,w(w([],r,!0),[t],!1));if(i)return i}}return null},g=!1,m=i.current,p=v(m,(null===(n=t.current)||void 0===n?void 0:n.accessor)||""),C=v(m,a.accessor),I=(null==p?void 0:p.length)||0,x=(null==C?void 0:C.length)||0;if(p&&C){var R=function(e,n,r){var t=JSON.parse(JSON.stringify(e));function o(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function i(e,n,r){for(var t=e,o=0;o<n.length-1;o++){if(!t[n[o]].children){g=!0;break}t=t[n[o]].children}t[n[n.length-1]]=r}var a=o(t,n);return i(t,n,o(t,r)),i(t,r,a),t}(m,p,C);if(!(d||a.accessor===(null===(r=t.current)||void 0===r?void 0:r.accessor)||null===t.current||f<10||0===p.length||0===C.length||JSON.stringify(R)===JSON.stringify(i.current)||I!==x||g)){var b=Date.now();JSON.stringify(R)===JSON.stringify(s)&&b-W<800&&f<50||(W=b,O={screenX:u,screenY:h},c(R))}}}},handleDragEnd:function(){t.current=null,l.current=null,null==d||d(i.current)}}},P=d(void 0),F=function(e){var r=e.children,t=e.value;return n(P.Provider,m({value:t},{children:r}))},A=function(){var e=c(P);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},z=s((function(r,o){var i,l,d=r.borderClass,c=r.colIndex,s=r.header,u=r.isHighlighted,h=r.isInitialFocused,f=r.onExpandRowClick,v=r.rowIndex,g=r.visibleRow,w=A(),p=w.collapseIcon,C=w.draggedHeaderRef,I=w.expandIcon,x=w.handleMouseDown,R=w.handleMouseOver,b=w.headersRef,y=w.hoveredHeaderRef,M=w.onCellEdit,E=w.onTableHeaderDragEnd,D=g.depth,H=g.row,k=t(H.rowData[s.accessor]),L=k[0],W=k[1],O=t(!1),P=O[0],F=O[1],z=B({draggedHeaderRef:C,headersRef:b,hoveredHeaderRef:y,onTableHeaderDragEnd:E}).handleDragOver,j=T(),U="cell-".concat(v,"-").concat(c),J=Boolean(null===(l=null===(i=H.rowMeta)||void 0===i?void 0:i.children)||void 0===l?void 0:l.length),K=Boolean(null==s?void 0:s.isEditable),V=g.position%2==0,X="st-cell ".concat(D>0&&s.expandable?"st-cell-depth-".concat(D):""," ").concat(u?h?"st-cell-selected-first ".concat(d):"st-cell-selected ".concat(d):""," ").concat(V?"st-cell-odd-row":"st-cell-even-row"," ").concat(K?"clickable":"");a((function(){W(H.rowData[s.accessor])}),[s.accessor,H]);return P?n("div",m({className:"st-cell-editing ".concat(V?"st-cell-odd-row":"st-cell-even-row"),id:S({accessor:s.accessor,rowIndex:v+1})},{children:n(N,{onChange:function(e){W(e),null==M||M({accessor:s.accessor,newValue:e,row:H})},setIsEditing:F,value:L})})):e("div",m({className:X,id:U,onDoubleClick:function(){return s.isEditable&&F(!0)},onMouseDown:function(){return x({rowIndex:v,colIndex:c,rowId:H.rowMeta.rowId})},onMouseOver:function(){return R({rowIndex:v,colIndex:c,rowId:H.rowMeta.rowId})},onDragOver:function(e){return j({callback:z,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||P||(e.preventDefault(),F(!0))},ref:o,"data-row-index":v,"data-col-index":c,"aria-selected":u},{children:[s.expandable&&J?H.rowMeta.isExpanded?n("div",m({className:"st-sort-icon-container",onClick:function(){return f(H.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:p})):n("div",m({className:"st-sort-icon-container",onClick:function(){return f(H.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:I})):null,n("span",m({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"")},{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:c,row:H}):L}))]}))})),j=function(e){var t=e.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(e,["children"]);return A().allowAnimations?n(U,m({},o,{children:t})):n(r,{children:t})},U=function(e){var i=e.children,l=e.isBody,d=e.pauseAnimation,c=e.rowIndex,s=o(!1),h=A(),f=h.draggedHeaderRef,v=h.headersRef,g=h.mainBodyRef,m=h.shouldPaginate,w=t({}),p=w[0],C=w[1],I=o({}),x=v.current;return u((function(){if(x){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(S({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:x,draggedHeaderRef:f,rowIndex:c});JSON.stringify(e)!==JSON.stringify(p)&&(I.current=p,C(e))}}),[p,x,f,l,c]),u((function(){var e=g.current,n=function(){s.current=!0},r=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[f,g]),a((function(){d||s.current||Object.keys(I.current).length&&x&&x.forEach((function(e){var n=document.getElementById(S({accessor:e.accessor,rowIndex:c}));if(n){var r=I.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=m?0:r.top-t.top,a=Math.abs(o),l=Math.abs(i);(a>10||l>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[p,x,l,d,I,c,m]),n(r,{children:i})},J=function(e){var r=e.columnIndices,t=e.headers,o=e.hiddenColumns,i=e.isWidthDragging,a=e.onExpandRowClick,l=e.pinned,d=e.rowIndex,c=e.rowIndices,s=e.visibleRow,u=t.filter((function(e){return E({hiddenColumns:o,header:e,pinned:l})}));return n(j,m({isBody:!0,pauseAnimation:i,rowIndex:d+1},{children:u.map((function(e){return n(K,{columnIndices:r,header:e,headers:t,hiddenColumns:o,onExpandRowClick:a,pinned:l,rowIndex:d,rowIndices:c,visibleRow:s},S({accessor:e.accessor,rowIndex:d+1}))}))}))},K=function(e){var r=e.columnIndices,t=e.header,o=e.headers,i=e.hiddenColumns,a=e.onExpandRowClick,l=e.pinned,d=e.rowIndex,c=e.rowIndices,s=e.visibleRow,u=r[t.accessor],f=A(),v=f.getBorderClass,g=f.isSelected,m=f.isInitialFocusedCell;if(t.children){var w=t.children.filter((function(e){return E({hiddenColumns:i,header:e,pinned:l})}));return n(h,{children:w.map((function(e){return n(K,{columnIndices:r,header:e,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:l,rowIndex:d,rowIndices:c,visibleRow:s},S({accessor:e.accessor,rowIndex:d+1}))}))})}var p={rowIndex:d,colIndex:u,rowId:s.row.rowMeta.rowId},C=v(p),I=g(p),x=m(p);return n(z,{borderClass:C,colIndex:u,header:t,isHighlighted:I,isInitialFocused:x,onExpandRowClick:a,rowIndex:d,visibleRow:s},S({accessor:t.accessor,rowIndex:d+1}))},V=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.headers,i=e.hiddenColumns,a=e.index,l=e.isWidthDragging,d=e.onExpandRowClick,c=e.pinned,s=e.rowHeight,u=e.rowIndices,h=e.visibleRow,f=h.position,v=a;return n("div",m({className:"st-table-row",style:{gridTemplateColumns:t,top:M({position:f,rowHeight:s}),height:"".concat(s,"px")}},{children:n(J,{columnIndices:r,headers:o,hiddenColumns:i,isWidthDragging:l,onExpandRowClick:d,pinned:c,rowIndex:v,rowIndices:u,visibleRow:h},a)}))},X=function(e){var r=e.displayStrongBorder,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",m({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:y({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},q=function(r){var t=r.columnIndices;r.headerContainerRef;var o=r.headers,i=r.hiddenColumns,a=r.isWidthDragging,l=r.onExpandRowClick,d=r.pinned,c=r.rowHeight,s=r.rowIndices,u=r.sectionRef,f=r.templateColumns,v=r.totalHeight,g=r.visibleRows,w=r.width,p=d?"st-table-body-pinned-".concat(d):"st-table-body-main";return n("div",m({className:p,ref:u,style:{position:"relative",height:"".concat(v,"px"),width:w}},{children:g.map((function(r,u){var v,m,w,p,C=Boolean(null===(m=null===(v=r.row.rowMeta)||void 0===v?void 0:v.children)||void 0===m?void 0:m.length),I=null===(p=null===(w=g[u-1])||void 0===w?void 0:w.row.rowMeta)||void 0===p?void 0:p.isExpanded;return e(h,{children:[n(V,{columnIndices:t,gridTemplateColumns:f,headers:o,hiddenColumns:i,index:u,isWidthDragging:a,onExpandRowClick:l,pinned:d,rowHeight:c,rowIndices:s,visibleRow:r}),0!==u&&n(X,{displayStrongBorder:C&&I,position:r.position,rowHeight:c,templateColumns:f})]},u)}))}))};function Y(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return E({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&E({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var $,G=function(r){var i,d,c,s,u,h=r.centerHeaderRef,f=r.flattenedRows,v=r.headerContainerRef,g=r.isWidthDragging,w=r.mainTemplateColumns,p=r.pinnedLeftColumns,C=r.pinnedLeftHeaderRef,I=r.pinnedLeftTemplateColumns,x=r.pinnedRightColumns,R=r.pinnedRightHeaderRef,b=r.pinnedRightTemplateColumns,y=r.setFlattenedRows,M=r.setScrollTop,S=r.visibleRows,E=A(),D=E.rowHeight,H=E.scrollbarWidth,k=E.mainBodyRef,N=E.pinnedLeftRef,L=E.pinnedRightRef,T=E.tableBodyContainerRef,W=E.hiddenColumns,O=E.headersRef;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],d=i[1];a((function(){var e=null==n?void 0:n.current;if(l&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,l,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:v,mainSectionRef:T,scrollbarWidth:H});var B,P,F=o(null),z=(B=0,(P=function(e){e.forEach((function(e){B+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&P(e.rowMeta.children)}))})(f),B)*(D+1)-1,j=l((function(){return Y({headersRef:O,hiddenColumns:W,pinnedLeftColumns:p,pinnedRightColumns:x})}),[O,W,p,x]),U=l((function(){var e={};return S.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[S]),J=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?m(m({},r),{rowMeta:m(m({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?m(m({},r),{rowMeta:m(m({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};y((function(e){return e.map(n)}))},K=(null===(i=C.current)||void 0===i?void 0:i.clientWidth)?(null===(d=C.current)||void 0===d?void 0:d.clientWidth)+1:0,V=null===(c=h.current)||void 0===c?void 0:c.clientWidth,X=(null===(s=R.current)||void 0===s?void 0:s.clientWidth)?(null===(u=R.current)||void 0===u?void 0:u.clientWidth)+1:0,$={headerContainerRef:v,headers:O.current,hiddenColumns:W,isWidthDragging:g,rowHeight:D,visibleRows:S,columnIndices:j,rowIndices:U};return e("div",m({className:"st-table-body-container",ref:T,onScroll:function(e){var n=e.currentTarget.scrollTop;F.current&&cancelAnimationFrame(F.current),F.current=requestAnimationFrame((function(){M(n)}))}},{children:[p.length>0&&n(q,m({},$,{onExpandRowClick:J,pinned:"left",sectionRef:N,templateColumns:I,totalHeight:z,width:K})),n(q,m({},$,{onExpandRowClick:J,sectionRef:k,templateColumns:w,totalHeight:z,width:V})),x.length>0&&n(q,m({},$,{onExpandRowClick:J,pinned:"right",sectionRef:L,templateColumns:b,totalHeight:z,width:X}))]}))},_=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},Q={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return Q.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?Q.string(e,n,r):"number"==typeof e&&"number"==typeof n?Q.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?Q.boolean(e,n,r):Q.string(String(e),String(n),r)}},Z=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return Q.number(i,a,t)}return"date"===r?Q.date(String(e),String(n),t):"boolean"===r?Q.boolean(Boolean(e),Boolean(n),t):"enum"===r?Q.enum(String(e),String(n),t):Q.string(String(e),String(n),t)},ee=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction,a=new Map,l=new Map,d="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(a.size)).toString();d=t,l.set(d,e),a.has(d)||a.set(d,[])}else if(d){var o=a.get(d)||[];o.push(e),a.set(d,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var c=[];return a.forEach((function(e,t){if(l.has(t)){var a=l.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=ne(a.rowMeta.children,n,r)),c.push(a)}var d=w([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return Z(a,l,o,i)}));c.push.apply(c,d.map((function(e){var t=m({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=ne(t.rowMeta.children,n,r);t.rowMeta=m(m({},t.rowMeta),{children:o})}return t})))})),c},ne=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return w([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return Z(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?m(m({},e),{rowMeta:m(m({},e.rowMeta),{children:ne(e.rowMeta.children,n,r)})}):e}))},re=function(e){e.colIndex;var n=e.event,r=e.forceUpdate,t=e.header;e.headersRef;var o=e.gridColumnEnd,i=e.gridColumnStart,a=e.setIsWidthDragging,l=e.startWidth;a(!0),n.preventDefault();var d=n.clientX;if(t){var c="number"==typeof t.minWidth?t.minWidth:40,s=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return s(e)})):[e]},u=o-i>1,h=u?s(t):[t],f=h.map((function(e){return"number"==typeof e.width?e.width:parseInt(String(e.width),10)||150})).reduce((function(e,n){return e+n}),0),v=function(e){var n=e.clientX-d;if(u&&h.length>1){for(var o=Math.max(f+n,h.length*c),i=Math.max(Math.floor(o/h.length),c),a=0;a<h.length-1;a++)h[a].width=i;var s=i*(h.length-1),v=Math.max(o-s,c);h[h.length-1].width=v}else{var g=Math.max(l+n,c);t.width=g}r()},g=function(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),a(!1)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",g)}},te=s((function(r,t){var o,i,l=r.colIndex,d=r.forceHeadersUpdate,c=r.gridColumnEnd,s=r.gridColumnStart,u=r.gridRowEnd,h=r.gridRowStart,f=r.header,v=r.reverse,g=r.sort,p=A(),C=p.columnReordering,I=p.columnResizing,x=p.draggedHeaderRef,R=p.forceUpdate,b=p.headersRef,y=p.hoveredHeaderRef,M=p.onColumnOrderChange,E=p.onSort,D=p.onTableHeaderDragEnd,H=p.rowHeight,k=p.selectColumns,N=p.selectableColumns,L=p.setInitialFocusedCell,W=p.setIsWidthDragging,O=p.setSelectedCells,P=p.setSelectedColumns,F=p.sortDownIcon,z=p.sortUpIcon,j=Boolean(null==f?void 0:f.isSortable),U="st-header-cell ".concat(f.accessor===(null===(o=y.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=x.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(j?"clickable":""," ").concat(C&&!j?"columnReordering":""," ").concat("right"===(null==f?void 0:f.align)?"right-aligned":"center"===(null==f?void 0:f.align)?"center-aligned":""),J=B({draggedHeaderRef:x,headersRef:b,hoveredHeaderRef:y,onColumnOrderChange:M,onTableHeaderDragEnd:D}),K=J.handleDragStart,V=J.handleDragEnd,X=J.handleDragOver,q=T(),Y=function(e){var n=e.event,r=e.header;if(N){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,l);return n.shiftKey&&k?P((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],i=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<i&&(i=r,o=e)}));var a,l,d,c,s=w(w([],(a=o,l=n,d=Math.min(a,l),c=Math.max(a,l),Array.from({length:c-d+1},(function(e,n){return d+n}))),!0),t,!0);return new Set(w(w([],Array.from(e),!0),s,!0))})):k&&k(t),O(new Set),void L(null)}r.isSortable&&E(l,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!f)return null;var $=I&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;q({callback:re,callbackProps:{colIndex:l,event:e,forceUpdate:R,header:f,headersRef:b,gridColumnEnd:c,gridColumnStart:s,setIsWidthDragging:W,startWidth:"object"==typeof t&&null!==t&&"current"in t?null===(n=t.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),G=g&&g.key.accessor===f.accessor&&e("div",m({className:"st-sort-icon-container",onClick:function(e){return Y({event:e,header:f})}},{children:["ascending"===g.direction&&z&&z,"descending"===g.direction&&F&&F]}));return e("div",m({className:U,id:S({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){q({callback:X,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:t,style:m(m({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:c},c-s>1?{}:{width:f.width}),u-h>1?{}:{height:H})},{children:[v&&$,e("div",m({className:"st-header-label ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":""),draggable:C&&!f.disableReorder,onClick:function(e){return Y({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),V(),d()},onDragStart:function(e){C&&f&&function(e){K(e)}(f)}},{children:["right"===f.align&&G,null==f?void 0:f.label,"right"!==f.align&&G]})),!v&&$]}))})),oe=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.handleScroll,i=e.headersRef,a=e.hiddenColumns,d=e.maxDepth,c=e.pinned,s=e.sectionRef,u=e.sort,h=f((function(e){return e+1}),0)[1],g=l((function(){var e=[],n=1,t=function(o,i,l){var s,u;if(void 0===l&&(l=!1),!E({hiddenColumns:a,header:o,pinned:c}))return 0;l||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return E({hiddenColumns:a,header:e,pinned:c})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,g=i,m=h>0?i+1:d+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:g,gridRowEnd:m,colIndex:r[o.accessor]}),o.children){var w=!0;o.children.forEach((function(e){E({hiddenColumns:a,header:e,pinned:c})&&(t(e,i+1,w),w=!1)}))}return v-f},o=i.current.filter((function(e){return E({hiddenColumns:a,header:e,pinned:c})})),l=!0;return o.forEach((function(e){t(e,1,l),l=!1})),e}),[i,a,d,c,r]);return n("div",m({className:"st-header-".concat(c?"pinned-".concat(c):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:t,display:"grid",position:"relative"}},{children:n(j,m({rowIndex:0},{children:g.map((function(e){return n(te,{colIndex:e.colIndex,forceHeadersUpdate:h,gridColumnEnd:e.gridColumnEnd,gridColumnStart:e.gridColumnStart,gridRowEnd:e.gridRowEnd,gridRowStart:e.gridRowStart,header:e.header,ref:v(),reverse:"right"===c,sort:u},e.header.accessor)}))}))}))},ie=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(ie)):1},ae=function(r){var t=r.centerHeaderRef,o=r.headerContainerRef,i=r.headersRef,a=r.hiddenColumns,d=r.mainTemplateColumns,c=r.pinnedLeftColumns,s=r.pinnedLeftHeaderRef,u=r.pinnedLeftTemplateColumns,h=r.pinnedRightColumns,f=r.pinnedRightHeaderRef,v=r.pinnedRightTemplateColumns,g=r.sort,w=A().mainBodyRef;_(w,t);var p=l((function(){return Y({headersRef:i,hiddenColumns:a,pinnedLeftColumns:c,pinnedRightColumns:h})}),[i,a,c,h]),C=l((function(){var e=i.current,n=0;return e.forEach((function(e){if(E({hiddenColumns:a,header:e})){var r=ie(e);n=Math.max(n,r)}})),{maxDepth:n}}),[i,a]).maxDepth;return e("div",m({className:"st-header-container",ref:o},{children:[c.length>0&&n(oe,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"left",sectionRef:s,sort:g}),n(oe,{columnIndices:p,gridTemplateColumns:d,handleScroll:function(e){var n,r,o=null===(n=t.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(r=w.current)||void 0===r||r.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:C,sectionRef:t,sort:g}),h.length>0&&n(oe,{columnIndices:p,gridTemplateColumns:v,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"right",sectionRef:f,sort:g})]}))},le=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},de=function(r){var t=r.flattenedRows,i=r.isWidthDragging,a=r.setFlattenedRows,d=r.setScrollTop,c=r.sort,s=r.visibleRows,u=A(),h=u.editColumns,f=u.headersRef,v=u.hiddenColumns,g=o(null),w=o(null),p=o(null),C=o(null),I=f.current.filter((function(e){return!e.pinned})),x=f.current.filter((function(e){return"left"===e.pinned})),R=f.current.filter((function(e){return"right"===e.pinned})),b=l((function(){return le({headers:x,hiddenColumns:v})}),[x,v]),y=l((function(){return le({headers:I,hiddenColumns:v})}),[I,v]),M=l((function(){return le({headers:R,hiddenColumns:v})}),[R,v]),S={centerHeaderRef:p,flattenedRows:t,headerContainerRef:g,isWidthDragging:i,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:w,pinnedLeftTemplateColumns:b,pinnedRightColumns:R,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,setFlattenedRows:a,setScrollTop:d,visibleRows:s};return e("div",m({className:"st-table-content",style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[n(ae,m({},{centerHeaderRef:p,headerContainerRef:g,headersRef:f,hiddenColumns:v,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:w,pinnedLeftTemplateColumns:b,pinnedRightColumns:R,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,sort:c})),n(G,m({},S))]}))},ce=function(e){var n=e.callback,r=e.ref,t=e.widthAttribute;a((function(){var e=r.current;if(e){var o=function(){n(e[t]||0)};o();var i=new ResizeObserver((function(){o()}));return i.observe(e),function(){return i.disconnect()}}}),[n,r,t])},se=function(r){var i=r.mainBodyRef,a=r.pinnedLeftRef,l=r.pinnedRightRef,d=r.tableContentWidth,c=t(0),s=c[0],u=c[1],h=t(0),f=h[0],v=h[1],g=t(0),w=g[0],p=g[1],C=o(null);return ce({widthAttribute:"offsetWidth",callback:u,ref:a}),ce({widthAttribute:"scrollWidth",callback:p,ref:i}),ce({widthAttribute:"offsetWidth",callback:v,ref:l}),_(i,C),!i.current||i.current.scrollWidth<=i.current.clientWidth?null:e("div",m({className:"st-horizontal-scrollbar-container",style:{width:d}},{children:[s>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s}}),w>0&&n("div",m({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&i.current&&i.current.scrollTo({left:n,behavior:"auto"})},ref:C},{children:n("div",{style:{width:w}})})),f>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},ue=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],d=l((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),c=t(d),s=c[0],u=c[1],h=l((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:ee(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{sort:i,setSort:a,updateSort:function(e,r){var t=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===r)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(n);o&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))},sortedRows:h,hiddenColumns:s,setHiddenColumns:u}},he=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,d=t(i),c=d[0],s=d[1];return e("label",m({className:"st-checkbox-label"},{children:[n("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;s(e),l&&l(e)},type:"checkbox"}),n("span",m({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},fe=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var i=e.setHiddenColumns,a=e.hiddenColumns,l="left"===o?"left":"";return n("div",m({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",m({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(he,m({checked:a[e.accessor],onChange:function(n){var r;return i(m(m({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},ve=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,d=r.position,c=void 0===d?"right":d,s=r.setHiddenColumns,u=r.hiddenColumns,h=t(a),f=h[0],v=h[1];return i?e("div",m({className:"st-column-editor ".concat(f?"open":""," ").concat(c),onClick:function(){return function(e){v(e)}(!f)}},{children:[n("div",m({className:"st-column-editor-text"},{children:o})),n(fe,{headers:l,open:f,position:c,setOpen:v,setHiddenColumns:s,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}($||($={}));var ge=g((function(r){var d=r.allowAnimations,c=void 0!==d&&d,s=r.collapseIcon,h=void 0===s?n(b,{className:"st-sort-icon"}):s,v=r.columnEditorPosition,g=void 0===v?$.Right:v,w=r.columnEditorText,y=void 0===w?"Columns":w,M=r.columnReordering,S=void 0!==M&&M,E=r.columnResizing,D=void 0!==E&&E,H=r.defaultHeaders,k=r.editColumns,N=void 0!==k&&k,L=r.editColumnsInitOpen,T=void 0!==L&&L,W=r.expandIcon,O=void 0===W?n(x,{className:"st-sort-icon"}):W,B=r.height,P=r.hideFooter,A=void 0!==P&&P,z=r.nextIcon,j=void 0===z?n(x,{className:"st-next-prev-icon"}):z,U=r.onCellEdit,J=r.onColumnOrderChange,K=r.onNextPage,V=r.onPreviousPage,X=r.prevIcon,q=void 0===X?n(I,{className:"st-next-prev-icon"}):X,Y=r.rowHeight,G=void 0===Y?40:Y,_=r.rows,Q=r.rowsPerPage,Z=void 0===Q?10:Q,ee=r.selectableCells,ne=void 0!==ee&&ee,re=r.selectableColumns,te=void 0!==re&&re,oe=r.shouldPaginate,ie=void 0!==oe&&oe,ae=r.sortDownIcon,le=void 0===ae?n(b,{className:"st-sort-icon"}):ae,ce=r.sortUpIcon,he=void 0===ce?n(R,{className:"st-sort-icon"}):ce,fe=r.theme,ge=void 0===fe?"light":fe,me=r.totalPages,we=o(null),pe=o(H),Ce=o(null),Ie=o(null),xe=o(null),Re=o(null),be=o(null),ye=t(!1),Me=ye[0],Se=ye[1],Ee=t(1),De=Ee[0],He=Ee[1],ke=t(0),Ne=ke[0],Le=ke[1],Te=t(0),We=Te[0],Oe=Te[1],Be=t(0),Pe=Be[0],Fe=Be[1],Ae=ue({headers:pe.current,tableRows:_}),ze=Ae.sort,je=Ae.sortedRows,Ue=Ae.hiddenColumns,Je=Ae.setHiddenColumns,Ke=Ae.updateSort,Ve=l((function(){if(!ie)return je;var e=(De-1)*Z,n=e+Z;return je.slice(e,n)}),[De,Z,ie,je]),Xe=t(Ve),qe=Xe[0],Ye=Xe[1];a((function(){Ye(Ve)}),[Ve]);var $e=l((function(){var e;if(!B)return window.innerHeight-G;var n=document.querySelector(".simple-table-root"),r=0;if(B.endsWith("px"))r=parseInt(B,10);else if(B.endsWith("vh")){var t=parseInt(B,10);r=window.innerHeight*t/100}else if(B.endsWith("%")){var o=parseInt(B,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-G)}),[B,G]),Ge=l((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=[],l=0,d=Math.max(0,i-o*n),c=i+r+o*n,s=function(e,n){for(var r,t=0,i=e;t<i.length;t++){var u=i[t],h=l*o;if(h>=c)break;h+o>d&&a.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&s(u.rowMeta.children,n+1)}};return s(t,0),a}({bufferRowCount:5,contentHeight:$e,flattenedRows:qe,rowHeight:G,scrollTop:Pe})}),[$e,G,qe,Pe]),_e=f((function(e){return e+1}),0)[1],Qe=function(e){var n=e.selectableCells,r=e.headers,d=e.visibleRows,c=t(new Set),s=c[0],u=c[1],h=t(new Set),f=h[0],v=h[1],g=t(null),m=g[0],w=g[1],C=t(null),I=C[0],x=C[1],R=o(!1),b=o(null),y=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=d[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,d]),M=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),l=t;l<=o;l++)for(var c=i;c<=a;c++)if(l>=0&&l<d.length){var s=d[l].row.rowMeta.rowId;r.add(p({colIndex:c,rowIndex:l,rowId:s}))}v(new Set),w(null),u(r)}),[d,v,w,u]),S=i((function(e){if(e.rowIndex>=0&&e.rowIndex<d.length&&e.colIndex>=0&&e.colIndex<r.length){var n=p(e);v(new Set),w(null),u(new Set([n])),x(e)}}),[r.length,d.length,v,w,u,x]),E=i((function(e,n){void 0===n&&(n=!1),u(new Set),x(null),v((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&w(e[e.length-1])}),[u,x,v,w]);a((function(){var e=function(e){if(n&&I){var t=I.rowIndex,o=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(d[t].row.rowMeta.rowId!==i){var a=d.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var l={rowIndex:t-1,colIndex:o,rowId:d[t-1].row.rowMeta.rowId};S(l)}}else"ArrowDown"===e.key?(e.preventDefault(),t<d.length-1&&(l={rowIndex:t+1,colIndex:o,rowId:d[t+1].row.rowMeta.rowId},S(l))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(l={rowIndex:t,colIndex:o-1,rowId:d[t].row.rowMeta.rowId},S(l))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(l={rowIndex:t,colIndex:o+1,rowId:d[t].row.rowMeta.rowId},S(l))):"Escape"===e.key&&(u(new Set),v(new Set),w(null),b.current=null,x(null))}else y()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[y,r.length,I,M,S,n,d]);var D=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=p({colIndex:n,rowIndex:r,rowId:t}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),H=i((function(e){var n,r,t,o,i,a,l=e.colIndex,c=e.rowIndex,s=e.rowId,u=[],h=null===(t=null===(r=null===(n=d[c-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:l,rowIndex:c+1,rowId:null===(a=null===(i=null===(o=d[c+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},g={colIndex:l-1,rowIndex:c,rowId:s},m={colIndex:l+1,rowIndex:c,rowId:s};return(!D({colIndex:l,rowIndex:c-1,rowId:h})||f.has(l)&&0===c)&&u.push("st-selected-top-border"),(!D(v)||f.has(l)&&c===d.length-1)&&u.push("st-selected-bottom-border"),D(g)||u.push("st-selected-left-border"),D(m)||u.push("st-selected-right-border"),u.join(" ")}),[D,d,f]),k=l((function(){return I?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===I.rowIndex&&r===I.colIndex&&t===I.rowId}:function(){return!1}}),[I]);return{getBorderClass:H,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){R.current=!0,b.current={rowIndex:t,colIndex:r,rowId:o},v(new Set),w(null);var i=p({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),x({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&R.current&&b.current){for(var o=new Set,i=Math.min(b.current.rowIndex,t),a=Math.max(b.current.rowIndex,t),l=Math.min(b.current.colIndex,r),c=Math.max(b.current.colIndex,r),s=i;s<=a;s++)for(var h=l;h<=c;h++)if(s>=0&&s<d.length){var f=d[s].row.rowMeta.rowId;o.add(p({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){R.current=!1},isInitialFocusedCell:k,isSelected:D,lastSelectedColumnIndex:m,selectColumns:E,selectedCells:s,selectedColumns:f,setInitialFocusedCell:x,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:ne,headers:pe.current,visibleRows:Ge}),Ze=Qe.handleMouseDown,en=Qe.handleMouseOver,nn=Qe.handleMouseUp,rn=Qe.isSelected,tn=Qe.getBorderClass,on=Qe.isInitialFocusedCell,an=Qe.setSelectedCells,ln=Qe.setSelectedColumns,dn=Qe.selectColumns,cn=Qe.setInitialFocusedCell,sn=i((function(e,n){Ke(e,n)}),[Ke]),un=i((function(e){pe.current=e,_e()}),[]);return a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||te&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(an(new Set),te&&ln(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[te,an,ln]),u((function(){if(be.current){var e=be.current.offsetWidth-be.current.clientWidth,n=be.current.clientWidth;Le(e),Oe(n)}}),[]),u((function(){var e=function(){if(_e(),be.current){var e=be.current.offsetWidth-be.current.clientWidth,n=be.current.clientWidth;Le(e),Oe(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),n(F,m({value:{allowAnimations:c,collapseIcon:h,columnReordering:S,columnResizing:D,draggedHeaderRef:we,editColumns:N,expandIcon:O,forceUpdate:_e,getBorderClass:tn,handleMouseDown:Ze,handleMouseOver:en,headersRef:pe,hiddenColumns:Ue,hoveredHeaderRef:Ce,isInitialFocusedCell:on,isSelected:rn,mainBodyRef:Ie,onCellEdit:U,onColumnOrderChange:J,onSort:sn,onTableHeaderDragEnd:un,pinnedLeftRef:xe,pinnedRightRef:Re,rowHeight:G,scrollbarWidth:Ne,selectColumns:dn,selectableColumns:te,setInitialFocusedCell:cn,setIsWidthDragging:Se,setSelectedCells:an,setSelectedColumns:ln,shouldPaginate:ie,sortDownIcon:le,sortUpIcon:he,tableBodyContainerRef:be}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(ge),style:B?{height:B}:{}},{children:[e("div",m({className:"st-table-wrapper-container"},{children:[e("div",m({className:"st-table-wrapper",onMouseUp:nn,onMouseLeave:nn},{children:[n(de,{flattenedRows:qe,isWidthDragging:Me,setFlattenedRows:Ye,setScrollTop:Fe,sort:ze,visibleRows:Ge}),n(ve,{columnEditorText:y,editColumns:N,editColumnsInitOpen:T,headers:pe.current,hiddenColumns:Ue,position:g,setHiddenColumns:Je})]})),n(se,{mainBodyRef:Ie,pinnedLeftRef:xe,pinnedRightRef:Re,tableContentWidth:We})]})),n(C,{currentPage:De,hideFooter:A,nextIcon:j,onPageChange:He,onNextPage:K,onPreviousPage:V,prevIcon:q,shouldPaginate:ie,totalPages:me||Math.ceil(je.length/Z)})]}))}))}));export{ge as SimpleTable};
2
2
  //# sourceMappingURL=index.es.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=function(){return r=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function t(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var o=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},i=function(n){var t=n.currentPage,o=n.hideFooter,i=n.nextIcon,a=n.onPageChange,l=n.onNextPage,d=n.onPreviousPage,s=n.prevIcon,c=n.shouldPaginate,u=n.totalPages;if(o||!c)return null;var f=!(t>1)&&!d,h=!(t<u)&&!l;return e.jsxs("div",r({className:"st-footer"},{children:[e.jsx("button",r({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t-1;e>=1&&a(e),d&&d(e-1)},disabled:f},{children:s})),e.jsx("button",r({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&a(e),l&&l(t)},disabled:h},{children:i})),Array.from({length:u},(function(n,o){return e.jsx("button",r({onClick:function(){var e;(e=o+1)>=1&&e<=u&&(a(e),e>t&&l?l(e-1):e<t&&d&&d(e-1))},className:"st-page-btn ".concat(t===o+1?"active":"")},{children:o+1}),o)}))]}))},a=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},l=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},d=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},s=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},c=function(e){return e.position*(e.rowHeight+1)-1},u=function(e){return e.position*(e.rowHeight+1)},f=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},h=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},v=function(n){var t=n.value,o=n.onBlur,i=n.onChange;return e.jsxs("select",r({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[e.jsx("option",r({value:"true"},{children:"True"})),e.jsx("option",r({value:"false"},{children:"False"}))]}))},m=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},g=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},w=function(n){var r=n.onChange,t=n.setIsEditing,o=n.value,i=function(e){null==r||r(e)},a=function(){t(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(m,{defaultValue:o,onBlur:a,onChange:i}):"boolean"==typeof o?e.jsx(v,{onBlur:a,onChange:i,value:o}):"number"==typeof o?e.jsx(g,{defaultValue:o,onBlur:a,onChange:i}):null})},p=0,x=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===p||o-p>=t)&&(p=o,n(r))}},C=Date.now(),I={screenX:0,screenY:0},R=function(e){var r,o,i=e.draggedHeaderRef,a=e.headersRef,l=e.hoveredHeaderRef,d=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,c=(r=a.current,o=n.useRef(r),n.useEffect((function(){o.current=r}),[r]),o.current);return{handleDragStart:function(e){i.current=e,C=Date.now()},handleDragOver:function(e){var n,r=e.event,o=e.hoveredHeader;if(r.preventDefault(),a.current){var d=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,f=r.screenY,h=Math.sqrt(Math.pow(u-I.screenX,2)+Math.pow(f-I.screenY,2));l.current=o;var v=t([],a.current,!0),m=v.findIndex((function(e){var n;return e.accessor===(null===(n=i.current)||void 0===n?void 0:n.accessor)})),g=v.findIndex((function(e){return e.accessor===o.accessor})),w=v.splice(m,1)[0];if(v.splice(g,0,w),!(d||o.accessor===(null===(n=i.current)||void 0===n?void 0:n.accessor)||null===i.current||h<10||void 0===m||void 0===g||JSON.stringify(v)===JSON.stringify(a.current))){var p=Date.now();JSON.stringify(v)===JSON.stringify(c)&&p-C<800&&h<50||(C=p,I={screenX:u,screenY:f},s(v))}}},handleDragEnd:function(){i.current=null,l.current=null,null==d||d(a.current)}}},b=n.createContext(void 0),S=function(n){var t=n.children,o=n.value;return e.jsx(b.Provider,r({value:o},{children:t}))},y=function(){var e=n.useContext(b);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},M=n.forwardRef((function(t,o){var i,a,l=t.borderClass,d=t.colIndex,s=t.header,c=t.isHighlighted,u=t.isInitialFocused,h=t.onExpandRowClick,v=t.rowIndex,m=t.visibleRow,g=y(),p=g.collapseIcon,C=g.draggedHeaderRef,I=g.expandIcon,b=g.handleMouseDown,S=g.handleMouseOver,M=g.headersRef,E=g.hoveredHeaderRef,j=g.onCellEdit,D=g.onTableHeaderDragEnd,k=m.depth,H=m.row,N=n.useState(H.rowData[s.accessor]),L=N[0],T=N[1],W=n.useState(!1),O=W[0],B=W[1],P=R({draggedHeaderRef:C,headersRef:M,hoveredHeaderRef:E,onTableHeaderDragEnd:D}).handleDragOver,F=x(),A="cell-".concat(v,"-").concat(d),z=Boolean(null===(a=null===(i=H.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),U=Boolean(null==s?void 0:s.isEditable),q=m.position%2==0,K="st-cell ".concat(k>0&&s.expandable?"st-cell-depth-".concat(k):""," ").concat(c?u?"st-cell-selected-first ".concat(l):"st-cell-selected ".concat(l):""," ").concat(q?"st-cell-odd-row":"st-cell-even-row"," ").concat(U?"clickable":"");n.useEffect((function(){T(H.rowData[s.accessor])}),[s.accessor,H]);return O?e.jsx("div",r({className:"st-cell-editing ".concat(q?"st-cell-odd-row":"st-cell-even-row"),id:f({accessor:s.accessor,rowIndex:v+1})},{children:e.jsx(w,{onChange:function(e){T(e),null==j||j({accessor:s.accessor,newValue:e,row:H})},setIsEditing:B,value:L})})):e.jsxs("div",r({className:K,id:A,onDoubleClick:function(){return s.isEditable&&B(!0)},onMouseDown:function(){return b({rowIndex:v,colIndex:d,rowId:H.rowMeta.rowId})},onMouseOver:function(){return S({rowIndex:v,colIndex:d,rowId:H.rowMeta.rowId})},onDragOver:function(e){return F({callback:P,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||O||(e.preventDefault(),B(!0))},ref:o,"data-row-index":v,"data-col-index":d,"aria-selected":c},{children:[s.expandable&&z?H.rowMeta.isExpanded?e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return h(H.rowMeta.rowId)}},{children:p})):e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return h(H.rowMeta.rowId)}},{children:I})):null,e.jsx("span",r({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"")},{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:d,row:H}):L}))]}))})),E=function(n){var t=n.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(n,["children"]);return y().allowAnimations?e.jsx(j,r({},o,{children:t})):e.jsx(e.Fragment,{children:t})},j=function(r){var t=r.children,o=r.isBody,i=r.pauseAnimation,a=r.rowIndex,l=n.useRef(!1),d=y(),s=d.draggedHeaderRef,c=d.headersRef,u=d.mainBodyRef,h=d.shouldPaginate,v=n.useState({}),m=v[0],g=v[1],w=n.useRef({}),p=c.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(f({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:p,draggedHeaderRef:s,rowIndex:a});JSON.stringify(e)!==JSON.stringify(m)&&(w.current=m,g(e))}}),[m,p,s,o,a]),n.useLayoutEffect((function(){var e=u.current,n=function(){l.current=!0},r=function(){l.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[s,u]),n.useEffect((function(){i||l.current||Object.keys(w.current).length&&p&&p.forEach((function(e){var n=document.getElementById(f({accessor:e.accessor,rowIndex:a}));if(n){var r=w.current[e.accessor],t=m[e.accessor];if(r&&t){var o=r.left-t.left,i=h?0:r.top-t.top,l=Math.abs(o),d=Math.abs(i);(l>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[m,p,o,i,w,a,h]),e.jsx(e.Fragment,{children:t})},D=function(n){var t=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,l=n.onExpandRowClick,d=n.pinned,s=n.rowIndex,c=n.rowIndices,u=n.visibleRow,v=o.filter((function(e){return h({hiddenColumns:i,header:e,pinned:d})}));return e.jsx(E,r({isBody:!0,pauseAnimation:a,rowIndex:s+1},{children:v.map((function(n){return e.jsx(k,{columnIndices:t,header:n,headers:o,hiddenColumns:i,onExpandRowClick:l,pinned:d,rowIndex:s,rowIndices:c,visibleRow:u},f({accessor:n.accessor,rowIndex:s+1}))}))}))},k=function(r){var t=r.columnIndices,o=r.header,i=r.headers,a=r.hiddenColumns,l=r.onExpandRowClick,d=r.pinned,s=r.rowIndex,c=r.rowIndices,u=r.visibleRow,v=t[o.accessor],m=y(),g=m.getBorderClass,w=m.isSelected,p=m.isInitialFocusedCell;if(o.children){var x=o.children.filter((function(e){return h({hiddenColumns:a,header:e,pinned:d})}));return e.jsx(n.Fragment,{children:x.map((function(n){return e.jsx(k,{columnIndices:t,header:n,headers:i,hiddenColumns:a,onExpandRowClick:l,pinned:d,rowIndex:s,rowIndices:c,visibleRow:u},f({accessor:n.accessor,rowIndex:s+1}))}))})}var C={rowIndex:s,colIndex:v,rowId:u.row.rowMeta.rowId},I=g(C),R=w(C),b=p(C);return e.jsx(M,{borderClass:I,colIndex:v,header:o,isHighlighted:R,isInitialFocused:b,onExpandRowClick:l,rowIndex:s,visibleRow:u},f({accessor:o.accessor,rowIndex:s+1}))},H=function(n){var t=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,l=n.index,d=n.isWidthDragging,s=n.onExpandRowClick,c=n.pinned,f=n.rowHeight,h=n.rowIndices,v=n.visibleRow,m=v.position,g=l;return e.jsx("div",r({className:"st-table-row",style:{gridTemplateColumns:o,top:u({position:m,rowHeight:f}),height:"".concat(f,"px")}},{children:e.jsx(D,{columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:d,onExpandRowClick:s,pinned:c,rowIndex:g,rowIndices:h,visibleRow:v},l)}))},N=function(n){var t=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",r({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:c({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},L=function(t){var o=t.columnIndices;t.headerContainerRef;var i=t.headers,a=t.hiddenColumns,l=t.isWidthDragging,d=t.onExpandRowClick,s=t.pinned,c=t.rowHeight,u=t.rowIndices,f=t.sectionRef,h=t.templateColumns,v=t.totalHeight,m=t.visibleRows,g=t.width,w=s?"st-table-body-pinned-".concat(s):"st-table-body-main";return e.jsx("div",r({className:w,ref:f,style:{position:"relative",height:"".concat(v,"px"),width:g}},{children:m.map((function(r,t){var f,v,g,w,p=Boolean(null===(v=null===(f=r.row.rowMeta)||void 0===f?void 0:f.children)||void 0===v?void 0:v.length),x=null===(w=null===(g=m[t-1])||void 0===g?void 0:g.row.rowMeta)||void 0===w?void 0:w.isExpanded;return e.jsxs(n.Fragment,{children:[e.jsx(H,{columnIndices:o,gridTemplateColumns:h,headers:i,hiddenColumns:a,index:t,isWidthDragging:l,onExpandRowClick:d,pinned:s,rowHeight:c,rowIndices:u,visibleRow:r}),0!==t&&e.jsx(N,{displayStrongBorder:p&&x,position:r.position,rowHeight:c,templateColumns:h})]},t)}))}))};function T(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return h({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&h({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var W,O=function(t){var o,i,a,l,d,s=t.centerHeaderRef,c=t.flattenedRows,u=t.headerContainerRef,f=t.isWidthDragging,h=t.mainTemplateColumns,v=t.pinnedLeftColumns,m=t.pinnedLeftHeaderRef,g=t.pinnedLeftTemplateColumns,w=t.pinnedRightColumns,p=t.pinnedRightHeaderRef,x=t.pinnedRightTemplateColumns,C=t.setFlattenedRows,I=t.setScrollTop,R=t.visibleRows,b=y(),S=b.rowHeight,M=b.scrollbarWidth,E=b.mainBodyRef,j=b.pinnedLeftRef,D=b.pinnedRightRef,k=b.tableBodyContainerRef,H=b.hiddenColumns,N=b.headersRef;!function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],l=i[1];n.useEffect((function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[r,a,o]),n.useEffect((function(){var e=null==r?void 0:r.current,n=null==t?void 0:t.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;l(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[r,t])}({headerContainerRef:u,mainSectionRef:k,scrollbarWidth:M});var W,O,B=n.useRef(null),P=(W=0,(O=function(e){e.forEach((function(e){W+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&O(e.rowMeta.children)}))})(c),W)*(S+1)-1,F=n.useMemo((function(){return T({headersRef:N,hiddenColumns:H,pinnedLeftColumns:v,pinnedRightColumns:w})}),[N,H,v,w]),A=n.useMemo((function(){var e={};return R.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[R]),z=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};C((function(e){return e.map(n)}))},U=(null===(o=m.current)||void 0===o?void 0:o.clientWidth)?(null===(i=m.current)||void 0===i?void 0:i.clientWidth)+1:0,q=null===(a=s.current)||void 0===a?void 0:a.clientWidth,K=(null===(l=p.current)||void 0===l?void 0:l.clientWidth)?(null===(d=p.current)||void 0===d?void 0:d.clientWidth)+1:0,V={headerContainerRef:u,headers:N.current,hiddenColumns:H,isWidthDragging:f,rowHeight:S,visibleRows:R,columnIndices:F,rowIndices:A};return e.jsxs("div",r({className:"st-table-body-container",ref:k,onScroll:function(e){var n=e.currentTarget.scrollTop;B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame((function(){I(n)}))}},{children:[v.length>0&&e.jsx(L,r({},V,{onExpandRowClick:z,pinned:"left",sectionRef:j,templateColumns:g,totalHeight:P,width:U})),e.jsx(L,r({},V,{onExpandRowClick:z,sectionRef:E,templateColumns:h,totalHeight:P,width:q})),w.length>0&&e.jsx(L,r({},V,{onExpandRowClick:z,pinned:"right",sectionRef:D,templateColumns:x,totalHeight:P,width:K}))]}))},B=function(e,r){n.useEffect((function(){if(e.current){var n=e.current,t=function(){var e,t=null==n?void 0:n.scrollLeft;void 0!==t&&(null===(e=r.current)||void 0===e||e.scrollTo(t,0))};return n.addEventListener("scroll",t),function(){null==n||n.removeEventListener("scroll",t)}}}),[e,r])},P={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return P.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?P.string(e,n,r):"number"==typeof e&&"number"==typeof n?P.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?P.boolean(e,n,r):P.string(String(e),String(n),r)}},F=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return P.number(i,a,t)}return"date"===r?P.date(String(e),String(n),t):"boolean"===r?P.boolean(Boolean(e),Boolean(n),t):"enum"===r?P.enum(String(e),String(n),t):P.string(String(e),String(n),t)},A=function(e,n,o){var i=o.find((function(e){return e.accessor===n.key.accessor})),a=(null==i?void 0:i.type)||"string",l=n.direction,d=new Map,s=new Map,c="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(d.size)).toString();c=t,s.set(c,e),d.has(c)||d.set(c,[])}else if(c){var o=d.get(c)||[];o.push(e),d.set(c,o)}else{var i="default";d.has(i)||d.set(i,[]),null===(r=d.get(i))||void 0===r||r.push(e)}}));var u=[];return d.forEach((function(e,i){if(s.has(i)){var d=s.get(i);d.rowMeta.children&&d.rowMeta.children.length>0&&(d.rowMeta.children=z(d.rowMeta.children,n,o)),u.push(d)}var c=t([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return F(o,i,a,l)}));u.push.apply(u,c.map((function(e){var t=r({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var i=z(t.rowMeta.children,n,o);t.rowMeta=r(r({},t.rowMeta),{children:i})}return t})))})),u},z=function(e,n,o){var i=o.find((function(e){return e.accessor===n.key.accessor})),a=(null==i?void 0:i.type)||"string",l=n.direction;return t([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return F(o,i,a,l)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?r(r({},e),{rowMeta:r(r({},e.rowMeta),{children:z(e.rowMeta.children,n,o)})}):e}))},U=function(e){e.colIndex;var n=e.event,r=e.forceUpdate,t=e.header;e.headersRef;var o=e.gridColumnEnd,i=e.gridColumnStart,a=e.setIsWidthDragging,l=e.startWidth;a(!0),n.preventDefault();var d=n.clientX;if(t){var s="number"==typeof t.minWidth?t.minWidth:40,c=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return c(e)})):[e]},u=o-i>1,f=u?c(t):[t],h=f.map((function(e){return"number"==typeof e.width?e.width:parseInt(String(e.width),10)||150})).reduce((function(e,n){return e+n}),0),v=function(e){var n=e.clientX-d;if(u&&f.length>1){for(var o=Math.max(h+n,f.length*s),i=Math.max(Math.floor(o/f.length),s),a=0;a<f.length-1;a++)f[a].width=i;var c=i*(f.length-1),v=Math.max(o-c,s);f[f.length-1].width=v}else{var m=Math.max(l+n,s);t.width=m}r()},m=function(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",m),a(!1)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",m)}},q=n.forwardRef((function(o,i){var a=o.colIndex,l=o.gridColumnEnd,d=o.gridColumnStart,s=o.gridRowEnd,c=o.gridRowStart,u=o.header,h=o.reverse,v=o.sort,m=y(),g=m.columnReordering,w=m.columnResizing,p=m.draggedHeaderRef,C=m.forceUpdate,I=m.headersRef,b=m.hoveredHeaderRef,S=m.onColumnOrderChange,M=m.onSort,E=m.onTableHeaderDragEnd,j=m.rowHeight,D=m.selectColumns,k=m.selectableColumns,H=m.setInitialFocusedCell,N=m.setIsWidthDragging,L=m.setSelectedCells,T=m.setSelectedColumns,W=m.sortDownIcon,O=m.sortUpIcon,B=n.useState(!1),P=B[0],F=B[1],A=Boolean(null==u?void 0:u.isSortable),z="st-header-cell ".concat(u===b.current?"st-hovered":""," ").concat(P?"st-dragging":""," ").concat(A?"clickable":""," ").concat(g&&!A?"columnReordering":""," ").concat("right"===(null==u?void 0:u.align)?"right-aligned":"center"===(null==u?void 0:u.align)?"center-aligned":""),q=R({draggedHeaderRef:p,headersRef:I,hoveredHeaderRef:b,onColumnOrderChange:S,onTableHeaderDragEnd:E}),K=q.handleDragStart,V=q.handleDragEnd,J=q.handleDragOver,X=x(),Y=function(e){var n=e.event,r=e.header;if(k){var o=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,a);return n.shiftKey&&D?T((function(e){if(0===e.size)return new Set(o);var n=o[0],r=Array.from(e).sort((function(e,n){return e-n})),i=r[0],a=Math.abs(n-i);r.forEach((function(e){var r=Math.abs(n-e);r<a&&(a=r,i=e)}));var l,d,s,c,u=t(t([],(l=i,d=n,s=Math.min(l,d),c=Math.max(l,d),Array.from({length:c-s+1},(function(e,n){return s+n}))),!0),o,!0);return new Set(t(t([],Array.from(e),!0),u,!0))})):D&&D(o),L(new Set),void H(null)}r.isSortable&&M(a,r.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!u)return null;var _=w&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;X({callback:U,callbackProps:{colIndex:a,event:e,forceUpdate:C,header:u,headersRef:I,gridColumnEnd:l,gridColumnStart:d,setIsWidthDragging:N,startWidth:"object"==typeof i&&null!==i&&"current"in i?null===(n=i.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),$=v&&v.key.accessor===u.accessor&&e.jsxs("div",r({className:"st-sort-icon-container",onClick:function(e){return Y({event:e,header:u})}},{children:["ascending"===v.direction&&O&&O,"descending"===v.direction&&W&&W]}));return e.jsxs("div",r({className:z,id:f({accessor:u.accessor,rowIndex:0}),onDragOver:function(e){X({callback:J,callbackProps:{event:e,hoveredHeader:u},limit:50})},ref:i,style:r(r({gridRowStart:c,gridRowEnd:s,gridColumnStart:d,gridColumnEnd:l},l-d>1?{}:{width:u.width}),s-c>1?{}:{height:j})},{children:[h&&_,e.jsxs("div",r({className:"st-header-label ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":""),draggable:g,onClick:function(e){return Y({event:e,header:u})},onDragEnd:function(e){e.preventDefault(),F(!1),V()},onDragStart:function(e){g&&u&&function(e){F(!0),K(e)}(u)}},{children:["right"===u.align&&$,null==u?void 0:u.label,"right"!==u.align&&$]})),!h&&_]}))})),K=function(r){var t=r.columnIndices,o=r.depth,i=r.header,a=r.hiddenColumns,l=r.maxDepth,d=r.pinned,s=r.gridPosition,c=r.reverse,u=r.sort;if(!h({hiddenColumns:a,header:i,pinned:d}))return null;var f=s.gridColumnStart,v=s.gridColumnEnd,m=s.gridRowStart,g=s.gridRowEnd,w=t[i.accessor];if(i.children){var p=i.children.filter((function(e){return h({hiddenColumns:a,header:e,pinned:d})}));return e.jsxs(n.Fragment,{children:[e.jsx(q,{colIndex:w,gridColumnEnd:v,gridColumnStart:f,gridRowEnd:g,gridRowStart:m,header:i,ref:n.createRef(),reverse:c,sort:u}),p.map((function(n,r){var i,f=null===(i=s.children)||void 0===i?void 0:i[n.accessor];return f?e.jsx(K,{columnIndices:t,depth:o+1,gridPosition:f,header:n,hiddenColumns:a,maxDepth:l,pinned:d,reverse:c,sort:u},n.accessor):null}))]})}return e.jsx(q,{colIndex:w,gridColumnEnd:v,gridColumnStart:f,gridRowEnd:g,gridRowStart:m,header:i,ref:n.createRef(),reverse:c,sort:u})},V=function(t){var o=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,l=t.headersRef,d=t.hiddenColumns,s=t.maxDepth,c=t.pinned,u=t.sectionRef,f=t.sort,v=l.current.filter((function(e){return h({hiddenColumns:d,header:e,pinned:c})})),m=n.useMemo((function(){var e,n,r;return e={},n=1,r=function(t,o,i){var a,l;void 0===i&&(i=!1),i||n++;var u=null!==(l=null===(a=t.children)||void 0===a?void 0:a.filter((function(e){return h({hiddenColumns:d,header:e,pinned:c})})).length)&&void 0!==l?l:0,f={gridColumnStart:n,gridColumnEnd:u>0?n+u:n+1,gridRowStart:o,gridRowEnd:u>0?o+1:s+1,children:{}};return t.children&&t.children.length>0&&t.children.filter((function(e){return h({hiddenColumns:d,header:e,pinned:c})})).forEach((function(e,n){f.children[e.accessor]=r(e,o+1,0===n)})),e[t.accessor]=f,f},v.forEach((function(e,n){r(e,1,0===n)})),e}),[v,d,s,c]);return e.jsx("div",r({className:"st-header-".concat(c?"pinned-".concat(c):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i}},{children:e.jsx(E,r({rowIndex:0},{children:v.map((function(n){var r=m[n.accessor];return r?e.jsx(K,{columnIndices:o,depth:1,gridPosition:r,header:n,hiddenColumns:d,maxDepth:s,pinned:c,reverse:"right"===c,sort:f},n.accessor):null}))}))}))},J=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(J)):1},X=function(t){var o=t.centerHeaderRef,i=t.headerContainerRef,a=t.headersRef,l=t.hiddenColumns,d=t.mainTemplateColumns,s=t.pinnedLeftColumns,c=t.pinnedLeftHeaderRef,u=t.pinnedLeftTemplateColumns,f=t.pinnedRightColumns,v=t.pinnedRightHeaderRef,m=t.pinnedRightTemplateColumns,g=t.sort,w=y().mainBodyRef;B(w,o);var p=n.useMemo((function(){return T({headersRef:a,hiddenColumns:l,pinnedLeftColumns:s,pinnedRightColumns:f})}),[a,l,s,f]),x=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(h({hiddenColumns:l,header:e})){var r=J(e);n=Math.max(n,r)}})),{maxDepth:n}}),[a,l]).maxDepth;return e.jsxs("div",r({className:"st-header-container",ref:i},{children:[s.length>0&&e.jsx(V,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"left",sectionRef:c,sort:g}),e.jsx(V,{columnIndices:p,gridTemplateColumns:d,handleScroll:function(e){var n,r,t=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=w.current)||void 0===r||r.scrollTo(t,0))},headersRef:a,hiddenColumns:l,maxDepth:x,sectionRef:o,sort:g}),f.length>0&&e.jsx(V,{columnIndices:p,gridTemplateColumns:m,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"right",sectionRef:v,sort:g})]}))},Y=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},_=function(t){var o=t.flattenedRows,i=t.isWidthDragging,a=t.setFlattenedRows,l=t.setScrollTop,d=t.sort,s=t.visibleRows,c=y(),u=c.editColumns,f=c.headersRef,h=c.hiddenColumns,v=n.useRef(null),m=n.useRef(null),g=n.useRef(null),w=n.useRef(null),p=f.current.filter((function(e){return!e.pinned})),x=f.current.filter((function(e){return"left"===e.pinned})),C=f.current.filter((function(e){return"right"===e.pinned})),I=n.useMemo((function(){return Y({headers:x,hiddenColumns:h})}),[x,h]),R=n.useMemo((function(){return Y({headers:p,hiddenColumns:h})}),[p,h]),b=n.useMemo((function(){return Y({headers:C,hiddenColumns:h})}),[C,h]),S={centerHeaderRef:g,headerContainerRef:v,headersRef:f,hiddenColumns:h,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,sort:d},M={centerHeaderRef:g,flattenedRows:o,headerContainerRef:v,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,setFlattenedRows:a,setScrollTop:l,visibleRows:s};return e.jsxs("div",r({className:"st-table-content",style:{width:u?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(X,r({},S)),e.jsx(O,r({},M))]}))},$=function(e){var r=e.callback,t=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=t.current;if(e){var n=function(){r(e[o]||0)};n();var i=new ResizeObserver((function(){n()}));return i.observe(e),function(){return i.disconnect()}}}),[r,t,o])},G=function(t){var o=t.mainBodyRef,i=t.pinnedLeftRef,a=t.pinnedRightRef,l=t.tableContentWidth,d=n.useState(0),s=d[0],c=d[1],u=n.useState(0),f=u[0],h=u[1],v=n.useState(0),m=v[0],g=v[1],w=n.useRef(null);return $({widthAttribute:"offsetWidth",callback:c,ref:i}),$({widthAttribute:"scrollWidth",callback:g,ref:o}),$({widthAttribute:"offsetWidth",callback:h,ref:a}),B(o,w),!o.current||o.current.scrollWidth<=o.current.clientWidth?null:e.jsxs("div",r({className:"st-horizontal-scrollbar-container",style:{width:l}},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s}}),m>0&&e.jsx("div",r({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&o.current&&o.current.scrollTo({left:n,behavior:"auto"})},ref:w},{children:e.jsx("div",{style:{width:m}})})),f>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},Q=function(e){var r=e.headers,t=e.tableRows,o=n.useState(null),i=o[0],a=o[1],l=n.useMemo((function(){var e={};return r.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[r]),d=n.useState(l),s=d[0],c=d[1],u=n.useMemo((function(){if(!i)return t;var e=function(e,n,r){return{sortedData:A(n,r,e),newSortConfig:r}}(r,t,i).sortedData;return e}),[t,i,r]);return{sort:i,setSort:a,updateSort:function(e,n){var t=r.find((function(e){return e.accessor===n}));t&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:u,hiddenColumns:s,setHiddenColumns:c}},Z=function(t){var o=t.checked,i=void 0!==o&&o,a=t.children,l=t.onChange,d=n.useState(i),s=d[0],c=d[1];return e.jsxs("label",r({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:s,className:"st-checkbox-input",onChange:function(){var e=!s;c(e),l&&l(e)},type:"checkbox"}),e.jsx("span",r({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&e.jsx("span",{className:"st-checkbox-checkmark"})})),a]}))},ee=function(n){var t=n.headers,o=n.open,i=n.position;n.setOpen;var a=n.setHiddenColumns,l=n.hiddenColumns,d="left"===i?"left":"";return e.jsx("div",r({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(d),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",r({className:"st-column-editor-popout-content"},{children:t.map((function(n,t){return e.jsx(Z,r({checked:l[n.accessor],onChange:function(e){var t;return a(r(r({},l),((t={})[n.accessor]=e,t)))}},{children:n.label}),t)}))}))}))},ne=function(t){var o=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,d=t.position,s=void 0===d?"right":d,c=t.setHiddenColumns,u=t.hiddenColumns,f=n.useState(a),h=f[0],v=f[1];return i?e.jsxs("div",r({className:"st-column-editor ".concat(h?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!h)}},{children:[e.jsx("div",r({className:"st-column-editor-text"},{children:o})),e.jsx(ee,{headers:l,open:h,position:s,setOpen:v,setHiddenColumns:c,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(W||(W={}));var re=n.memo((function(t){var c=t.allowAnimations,u=void 0!==c&&c,f=t.collapseIcon,h=void 0===f?e.jsx(s,{className:"st-sort-icon"}):f,v=t.columnEditorPosition,m=void 0===v?W.Right:v,g=t.columnEditorText,w=void 0===g?"Columns":g,p=t.columnReordering,x=void 0!==p&&p,C=t.columnResizing,I=void 0!==C&&C,R=t.defaultHeaders,b=t.editColumns,y=void 0!==b&&b,M=t.editColumnsInitOpen,E=void 0!==M&&M,j=t.expandIcon,D=void 0===j?e.jsx(l,{className:"st-sort-icon"}):j,k=t.height,H=t.hideFooter,N=void 0!==H&&H,L=t.nextIcon,T=void 0===L?e.jsx(l,{className:"st-next-prev-icon"}):L,O=t.onCellEdit,B=t.onColumnOrderChange,P=t.onNextPage,F=t.onPreviousPage,A=t.prevIcon,z=void 0===A?e.jsx(a,{className:"st-next-prev-icon"}):A,U=t.rowHeight,q=void 0===U?40:U,K=t.rows,V=t.rowsPerPage,J=void 0===V?10:V,X=t.selectableCells,Y=void 0!==X&&X,$=t.selectableColumns,Z=void 0!==$&&$,ee=t.shouldPaginate,re=void 0!==ee&&ee,te=t.sortDownIcon,oe=void 0===te?e.jsx(s,{className:"st-sort-icon"}):te,ie=t.sortUpIcon,ae=void 0===ie?e.jsx(d,{className:"st-sort-icon"}):ie,le=t.theme,de=void 0===le?"light":le,se=t.totalPages,ce=n.useRef(null),ue=n.useRef(R),fe=n.useRef(null),he=n.useRef(null),ve=n.useRef(null),me=n.useRef(null),ge=n.useRef(null),we=n.useState(!1),pe=we[0],xe=we[1],Ce=n.useState(1),Ie=Ce[0],Re=Ce[1],be=n.useState(0),Se=be[0],ye=be[1],Me=n.useState(0),Ee=Me[0],je=Me[1],De=n.useState(0),ke=De[0],He=De[1],Ne=Q({headers:ue.current,tableRows:K}),Le=Ne.sort,Te=Ne.sortedRows,We=Ne.hiddenColumns,Oe=Ne.setHiddenColumns,Be=Ne.updateSort,Pe=n.useMemo((function(){if(!re)return Te;var e=(Ie-1)*J,n=e+J;return Te.slice(e,n)}),[Ie,J,re,Te]),Fe=n.useState(Pe),Ae=Fe[0],ze=Fe[1];n.useEffect((function(){ze(Pe)}),[Pe]);var Ue=n.useMemo((function(){var e;if(!k)return window.innerHeight-q;var n=document.querySelector(".simple-table-root"),r=0;if(k.endsWith("px"))r=parseInt(k,10);else if(k.endsWith("vh")){var t=parseInt(k,10);r=window.innerHeight*t/100}else if(k.endsWith("%")){var o=parseInt(k,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-q)}),[k,q]),qe=n.useMemo((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=[],l=0,d=Math.max(0,i-o*n),s=i+r+o*n,c=function(e,n){for(var r,t=0,i=e;t<i.length;t++){var u=i[t],f=l*o;if(f>=s)break;f+o>d&&a.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&c(u.rowMeta.children,n+1)}};return c(t,0),a}({bufferRowCount:10,contentHeight:Ue,flattenedRows:Ae,rowHeight:q,scrollTop:ke})}),[Ue,q,Ae,ke]),Ke=n.useReducer((function(e){return e+1}),0)[1],Ve=function(e){var r=e.selectableCells,t=e.headers,i=e.visibleRows,a=n.useState(new Set),l=a[0],d=a[1],s=n.useState(new Set),c=s[0],u=s[1],f=n.useState(null),h=f[0],v=f[1],m=n.useState(null),g=m[0],w=m[1],p=n.useRef(!1),x=n.useRef(null),C=n.useCallback((function(){var e=Array.from(l).reduce((function(e,n){var r=n.split("-").map(Number),o=r[0],a=r[1];return e[o]||(e[o]=[]),e[o][a]=i[o].row.rowData[t[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");l.size>0&&navigator.clipboard.writeText(n)}),[t,l,i]),I=n.useCallback((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),a=Math.max(e.rowIndex,n.rowIndex),l=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),c=t;c<=a;c++)for(var f=l;f<=s;f++)if(c>=0&&c<i.length){var h=i[c].row.rowMeta.rowId;r.add(o({colIndex:f,rowIndex:c,rowId:h}))}u(new Set),v(null),d(r)}),[i,u,v,d]),R=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<i.length&&e.colIndex>=0&&e.colIndex<t.length){var n=o(e);u(new Set),v(null),d(new Set([n])),w(e)}}),[t.length,i.length,u,v,d,w]),b=n.useCallback((function(e,n){void 0===n&&(n=!1),d(new Set),w(null),u((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&v(e[e.length-1])}),[d,w,u,v]);n.useEffect((function(){var e=function(e){if(r&&g){var n=g.rowIndex,o=g.colIndex,a=g.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(i[n].row.rowMeta.rowId!==a){var l=i.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===l)return;n=l}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:o,rowId:i[n-1].row.rowMeta.rowId};R(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<i.length-1&&(s={rowIndex:n+1,colIndex:o,rowId:i[n+1].row.rowMeta.rowId},R(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(s={rowIndex:n,colIndex:o-1,rowId:i[n].row.rowMeta.rowId},R(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<t.length-1&&(s={rowIndex:n,colIndex:o+1,rowId:i[n].row.rowMeta.rowId},R(s))):"Escape"===e.key&&(d(new Set),u(new Set),v(null),x.current=null,w(null))}else C()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[C,t.length,g,I,R,r,i]);var S=n.useCallback((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,i=o({colIndex:n,rowIndex:r,rowId:t}),a=l.has(i),d=c.has(n);return a||d}),[l,c]),y=n.useCallback((function(e){var n,r,t,o,a,l,d=e.colIndex,s=e.rowIndex,u=e.rowId,f=[],h=null===(t=null===(r=null===(n=i[s-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:d,rowIndex:s+1,rowId:null===(l=null===(a=null===(o=i[s+1])||void 0===o?void 0:o.row)||void 0===a?void 0:a.rowMeta)||void 0===l?void 0:l.rowId},m={colIndex:d-1,rowIndex:s,rowId:u},g={colIndex:d+1,rowIndex:s,rowId:u};return(!S({colIndex:d,rowIndex:s-1,rowId:h})||c.has(d)&&0===s)&&f.push("st-selected-top-border"),(!S(v)||c.has(d)&&s===i.length-1)&&f.push("st-selected-bottom-border"),S(m)||f.push("st-selected-left-border"),S(g)||f.push("st-selected-right-border"),f.join(" ")}),[S,i,c]),M=n.useMemo((function(){return g?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===g.rowIndex&&r===g.colIndex&&t===g.rowId}:function(){return!1}}),[g]);return{getBorderClass:y,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,i=e.rowId;if(r){p.current=!0,x.current={rowIndex:t,colIndex:n,rowId:i},u(new Set),v(null);var a=o({colIndex:n,rowIndex:t,rowId:i});d(new Set([a])),w({rowIndex:t,colIndex:n,rowId:i})}},handleMouseOver:function(e){var n=e.colIndex,t=e.rowIndex;if(e.rowId,r&&p.current&&x.current){for(var a=new Set,l=Math.min(x.current.rowIndex,t),s=Math.max(x.current.rowIndex,t),c=Math.min(x.current.colIndex,n),u=Math.max(x.current.colIndex,n),f=l;f<=s;f++)for(var h=c;h<=u;h++)if(f>=0&&f<i.length){var v=i[f].row.rowMeta.rowId;a.add(o({colIndex:h,rowIndex:f,rowId:v}))}d(a)}},handleMouseUp:function(){p.current=!1},isInitialFocusedCell:M,isSelected:S,lastSelectedColumnIndex:h,selectColumns:b,selectedCells:l,selectedColumns:c,setInitialFocusedCell:w,setSelectedCells:d,setSelectedColumns:u}}({selectableCells:Y,headers:ue.current,visibleRows:qe}),Je=Ve.handleMouseDown,Xe=Ve.handleMouseOver,Ye=Ve.handleMouseUp,_e=Ve.isSelected,$e=Ve.getBorderClass,Ge=Ve.isInitialFocusedCell,Qe=Ve.setSelectedCells,Ze=Ve.setSelectedColumns,en=Ve.selectColumns,nn=Ve.setInitialFocusedCell,rn=n.useCallback((function(e,n){Be(e,n)}),[Be]),tn=n.useCallback((function(e){ue.current=e,Ke()}),[]);return n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Z&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(Qe(new Set),Z&&Ze(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Z,Qe,Ze]),n.useLayoutEffect((function(){if(ge.current){var e=ge.current.offsetWidth-ge.current.clientWidth,n=ge.current.clientWidth;ye(e),je(n)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Ke(),ge.current){var e=ge.current.offsetWidth-ge.current.clientWidth,n=ge.current.clientWidth;ye(e),je(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e.jsx(S,r({value:{allowAnimations:u,collapseIcon:h,columnReordering:x,columnResizing:I,draggedHeaderRef:ce,editColumns:y,expandIcon:D,forceUpdate:Ke,getBorderClass:$e,handleMouseDown:Je,handleMouseOver:Xe,headersRef:ue,hiddenColumns:We,hoveredHeaderRef:fe,isInitialFocusedCell:Ge,isSelected:_e,mainBodyRef:he,onCellEdit:O,onColumnOrderChange:B,onSort:rn,onTableHeaderDragEnd:tn,pinnedLeftRef:ve,pinnedRightRef:me,rowHeight:q,scrollbarWidth:Se,selectColumns:en,selectableColumns:Z,setInitialFocusedCell:nn,setIsWidthDragging:xe,setSelectedCells:Qe,setSelectedColumns:Ze,shouldPaginate:re,sortDownIcon:oe,sortUpIcon:ae,tableBodyContainerRef:ge}},{children:e.jsxs("div",r({className:"simple-table-root st-wrapper theme-".concat(de),style:k?{height:k}:{}},{children:[e.jsxs("div",r({className:"st-table-wrapper-container"},{children:[e.jsxs("div",r({className:"st-table-wrapper",onMouseUp:Ye,onMouseLeave:Ye},{children:[e.jsx(_,{flattenedRows:Ae,isWidthDragging:pe,setFlattenedRows:ze,setScrollTop:He,sort:Le,visibleRows:qe}),e.jsx(ne,{columnEditorText:w,editColumns:y,editColumnsInitOpen:E,headers:ue.current,hiddenColumns:We,position:m,setHiddenColumns:Oe})]})),e.jsx(G,{mainBodyRef:he,pinnedLeftRef:ve,pinnedRightRef:me,tableContentWidth:Ee})]})),e.jsx(i,{currentPage:Ie,hideFooter:N,nextIcon:T,onPageChange:Re,onNextPage:P,onPreviousPage:F,prevIcon:z,shouldPaginate:re,totalPages:se||Math.ceil(Te.length/J)})]}))}))}));exports.SimpleTable=re;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=function(){return r=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function t(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var o=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},i=function(n){var t=n.currentPage,o=n.hideFooter,i=n.nextIcon,a=n.onPageChange,l=n.onNextPage,d=n.onPreviousPage,s=n.prevIcon,c=n.shouldPaginate,u=n.totalPages;if(o||!c)return null;var f=!(t>1)&&!d,h=!(t<u)&&!l;return e.jsxs("div",r({className:"st-footer"},{children:[e.jsx("button",r({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t-1;e>=1&&a(e),d&&d(e-1)},disabled:f},{children:s})),e.jsx("button",r({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&a(e),l&&l(t)},disabled:h},{children:i})),Array.from({length:u},(function(n,o){return e.jsx("button",r({onClick:function(){var e;(e=o+1)>=1&&e<=u&&(a(e),e>t&&l?l(e-1):e<t&&d&&d(e-1))},className:"st-page-btn ".concat(t===o+1?"active":"")},{children:o+1}),o)}))]}))},a=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},l=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},d=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},s=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},c=function(e){return e.position*(e.rowHeight+1)-1},u=function(e){return e.position*(e.rowHeight+1)},f=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},h=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},v=function(n){var t=n.value,o=n.onBlur,i=n.onChange;return e.jsxs("select",r({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[e.jsx("option",r({value:"true"},{children:"True"})),e.jsx("option",r({value:"false"},{children:"False"}))]}))},g=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},m=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},w=function(n){var r=n.onChange,t=n.setIsEditing,o=n.value,i=function(e){null==r||r(e)},a=function(){t(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(g,{defaultValue:o,onBlur:a,onChange:i}):"boolean"==typeof o?e.jsx(v,{onBlur:a,onChange:i,value:o}):"number"==typeof o?e.jsx(m,{defaultValue:o,onBlur:a,onChange:i}):null})},p=0,x=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===p||o-p>=t)&&(p=o,n(r))}},C=Date.now(),I={screenX:0,screenY:0},R=function(e){var r,o,i=e.draggedHeaderRef,a=e.headersRef,l=e.hoveredHeaderRef,d=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,c=(r=a.current,o=n.useRef(r),n.useEffect((function(){o.current=r}),[r]),o.current);return{handleDragStart:function(e){i.current=e,C=Date.now()},handleDragOver:function(e){var n,r,o=e.event,d=e.hoveredHeader;if(o.preventDefault(),a.current){var u=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),f=o.screenX,h=o.screenY,v=Math.sqrt(Math.pow(f-I.screenX,2)+Math.pow(h-I.screenY,2));l.current=d;var g=function(e,n,r){void 0===r&&(r=[]);for(var o=0;o<e.length;o++){var i=e[o];if(i.accessor===n)return t(t([],r,!0),[o],!1);if(i.children&&i.children.length>0){var a=g(i.children,n,t(t([],r,!0),[o],!1));if(a)return a}}return null},m=!1,w=a.current,p=g(w,(null===(n=i.current)||void 0===n?void 0:n.accessor)||""),x=g(w,d.accessor),R=(null==p?void 0:p.length)||0,b=(null==x?void 0:x.length)||0;if(p&&x){var y=function(e,n,r){var t=JSON.parse(JSON.stringify(e));function o(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function i(e,n,r){for(var t=e,o=0;o<n.length-1;o++){if(!t[n[o]].children){m=!0;break}t=t[n[o]].children}t[n[n.length-1]]=r}var a=o(t,n);return i(t,n,o(t,r)),i(t,r,a),t}(w,p,x);if(!(u||d.accessor===(null===(r=i.current)||void 0===r?void 0:r.accessor)||null===i.current||v<10||0===p.length||0===x.length||JSON.stringify(y)===JSON.stringify(a.current)||R!==b||m)){var S=Date.now();JSON.stringify(y)===JSON.stringify(c)&&S-C<800&&v<50||(C=S,I={screenX:f,screenY:h},s(y))}}}},handleDragEnd:function(){i.current=null,l.current=null,null==d||d(a.current)}}},b=n.createContext(void 0),y=function(n){var t=n.children,o=n.value;return e.jsx(b.Provider,r({value:o},{children:t}))},S=function(){var e=n.useContext(b);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},M=n.forwardRef((function(t,o){var i,a,l=t.borderClass,d=t.colIndex,s=t.header,c=t.isHighlighted,u=t.isInitialFocused,h=t.onExpandRowClick,v=t.rowIndex,g=t.visibleRow,m=S(),p=m.collapseIcon,C=m.draggedHeaderRef,I=m.expandIcon,b=m.handleMouseDown,y=m.handleMouseOver,M=m.headersRef,E=m.hoveredHeaderRef,j=m.onCellEdit,k=m.onTableHeaderDragEnd,D=g.depth,H=g.row,N=n.useState(H.rowData[s.accessor]),L=N[0],T=N[1],W=n.useState(!1),O=W[0],B=W[1],P=R({draggedHeaderRef:C,headersRef:M,hoveredHeaderRef:E,onTableHeaderDragEnd:k}).handleDragOver,F=x(),A="cell-".concat(v,"-").concat(d),z=Boolean(null===(a=null===(i=H.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),U=Boolean(null==s?void 0:s.isEditable),J=g.position%2==0,q="st-cell ".concat(D>0&&s.expandable?"st-cell-depth-".concat(D):""," ").concat(c?u?"st-cell-selected-first ".concat(l):"st-cell-selected ".concat(l):""," ").concat(J?"st-cell-odd-row":"st-cell-even-row"," ").concat(U?"clickable":"");n.useEffect((function(){T(H.rowData[s.accessor])}),[s.accessor,H]);return O?e.jsx("div",r({className:"st-cell-editing ".concat(J?"st-cell-odd-row":"st-cell-even-row"),id:f({accessor:s.accessor,rowIndex:v+1})},{children:e.jsx(w,{onChange:function(e){T(e),null==j||j({accessor:s.accessor,newValue:e,row:H})},setIsEditing:B,value:L})})):e.jsxs("div",r({className:q,id:A,onDoubleClick:function(){return s.isEditable&&B(!0)},onMouseDown:function(){return b({rowIndex:v,colIndex:d,rowId:H.rowMeta.rowId})},onMouseOver:function(){return y({rowIndex:v,colIndex:d,rowId:H.rowMeta.rowId})},onDragOver:function(e){return F({callback:P,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||O||(e.preventDefault(),B(!0))},ref:o,"data-row-index":v,"data-col-index":d,"aria-selected":c},{children:[s.expandable&&z?H.rowMeta.isExpanded?e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return h(H.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:p})):e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return h(H.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:I})):null,e.jsx("span",r({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"")},{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:d,row:H}):L}))]}))})),E=function(n){var t=n.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(n,["children"]);return S().allowAnimations?e.jsx(j,r({},o,{children:t})):e.jsx(e.Fragment,{children:t})},j=function(r){var t=r.children,o=r.isBody,i=r.pauseAnimation,a=r.rowIndex,l=n.useRef(!1),d=S(),s=d.draggedHeaderRef,c=d.headersRef,u=d.mainBodyRef,h=d.shouldPaginate,v=n.useState({}),g=v[0],m=v[1],w=n.useRef({}),p=c.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(f({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:p,draggedHeaderRef:s,rowIndex:a});JSON.stringify(e)!==JSON.stringify(g)&&(w.current=g,m(e))}}),[g,p,s,o,a]),n.useLayoutEffect((function(){var e=u.current,n=function(){l.current=!0},r=function(){l.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[s,u]),n.useEffect((function(){i||l.current||Object.keys(w.current).length&&p&&p.forEach((function(e){var n=document.getElementById(f({accessor:e.accessor,rowIndex:a}));if(n){var r=w.current[e.accessor],t=g[e.accessor];if(r&&t){var o=r.left-t.left,i=h?0:r.top-t.top,l=Math.abs(o),d=Math.abs(i);(l>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[g,p,o,i,w,a,h]),e.jsx(e.Fragment,{children:t})},k=function(n){var t=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,l=n.onExpandRowClick,d=n.pinned,s=n.rowIndex,c=n.rowIndices,u=n.visibleRow,v=o.filter((function(e){return h({hiddenColumns:i,header:e,pinned:d})}));return e.jsx(E,r({isBody:!0,pauseAnimation:a,rowIndex:s+1},{children:v.map((function(n){return e.jsx(D,{columnIndices:t,header:n,headers:o,hiddenColumns:i,onExpandRowClick:l,pinned:d,rowIndex:s,rowIndices:c,visibleRow:u},f({accessor:n.accessor,rowIndex:s+1}))}))}))},D=function(r){var t=r.columnIndices,o=r.header,i=r.headers,a=r.hiddenColumns,l=r.onExpandRowClick,d=r.pinned,s=r.rowIndex,c=r.rowIndices,u=r.visibleRow,v=t[o.accessor],g=S(),m=g.getBorderClass,w=g.isSelected,p=g.isInitialFocusedCell;if(o.children){var x=o.children.filter((function(e){return h({hiddenColumns:a,header:e,pinned:d})}));return e.jsx(n.Fragment,{children:x.map((function(n){return e.jsx(D,{columnIndices:t,header:n,headers:i,hiddenColumns:a,onExpandRowClick:l,pinned:d,rowIndex:s,rowIndices:c,visibleRow:u},f({accessor:n.accessor,rowIndex:s+1}))}))})}var C={rowIndex:s,colIndex:v,rowId:u.row.rowMeta.rowId},I=m(C),R=w(C),b=p(C);return e.jsx(M,{borderClass:I,colIndex:v,header:o,isHighlighted:R,isInitialFocused:b,onExpandRowClick:l,rowIndex:s,visibleRow:u},f({accessor:o.accessor,rowIndex:s+1}))},H=function(n){var t=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,l=n.index,d=n.isWidthDragging,s=n.onExpandRowClick,c=n.pinned,f=n.rowHeight,h=n.rowIndices,v=n.visibleRow,g=v.position,m=l;return e.jsx("div",r({className:"st-table-row",style:{gridTemplateColumns:o,top:u({position:g,rowHeight:f}),height:"".concat(f,"px")}},{children:e.jsx(k,{columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:d,onExpandRowClick:s,pinned:c,rowIndex:m,rowIndices:h,visibleRow:v},l)}))},N=function(n){var t=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",r({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:c({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},L=function(t){var o=t.columnIndices;t.headerContainerRef;var i=t.headers,a=t.hiddenColumns,l=t.isWidthDragging,d=t.onExpandRowClick,s=t.pinned,c=t.rowHeight,u=t.rowIndices,f=t.sectionRef,h=t.templateColumns,v=t.totalHeight,g=t.visibleRows,m=t.width,w=s?"st-table-body-pinned-".concat(s):"st-table-body-main";return e.jsx("div",r({className:w,ref:f,style:{position:"relative",height:"".concat(v,"px"),width:m}},{children:g.map((function(r,t){var f,v,m,w,p=Boolean(null===(v=null===(f=r.row.rowMeta)||void 0===f?void 0:f.children)||void 0===v?void 0:v.length),x=null===(w=null===(m=g[t-1])||void 0===m?void 0:m.row.rowMeta)||void 0===w?void 0:w.isExpanded;return e.jsxs(n.Fragment,{children:[e.jsx(H,{columnIndices:o,gridTemplateColumns:h,headers:i,hiddenColumns:a,index:t,isWidthDragging:l,onExpandRowClick:d,pinned:s,rowHeight:c,rowIndices:u,visibleRow:r}),0!==t&&e.jsx(N,{displayStrongBorder:p&&x,position:r.position,rowHeight:c,templateColumns:h})]},t)}))}))};function T(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return h({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&h({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var W,O=function(t){var o,i,a,l,d,s=t.centerHeaderRef,c=t.flattenedRows,u=t.headerContainerRef,f=t.isWidthDragging,h=t.mainTemplateColumns,v=t.pinnedLeftColumns,g=t.pinnedLeftHeaderRef,m=t.pinnedLeftTemplateColumns,w=t.pinnedRightColumns,p=t.pinnedRightHeaderRef,x=t.pinnedRightTemplateColumns,C=t.setFlattenedRows,I=t.setScrollTop,R=t.visibleRows,b=S(),y=b.rowHeight,M=b.scrollbarWidth,E=b.mainBodyRef,j=b.pinnedLeftRef,k=b.pinnedRightRef,D=b.tableBodyContainerRef,H=b.hiddenColumns,N=b.headersRef;!function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],l=i[1];n.useEffect((function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[r,a,o]),n.useEffect((function(){var e=null==r?void 0:r.current,n=null==t?void 0:t.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;l(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[r,t])}({headerContainerRef:u,mainSectionRef:D,scrollbarWidth:M});var W,O,B=n.useRef(null),P=(W=0,(O=function(e){e.forEach((function(e){W+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&O(e.rowMeta.children)}))})(c),W)*(y+1)-1,F=n.useMemo((function(){return T({headersRef:N,hiddenColumns:H,pinnedLeftColumns:v,pinnedRightColumns:w})}),[N,H,v,w]),A=n.useMemo((function(){var e={};return R.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[R]),z=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};C((function(e){return e.map(n)}))},U=(null===(o=g.current)||void 0===o?void 0:o.clientWidth)?(null===(i=g.current)||void 0===i?void 0:i.clientWidth)+1:0,J=null===(a=s.current)||void 0===a?void 0:a.clientWidth,q=(null===(l=p.current)||void 0===l?void 0:l.clientWidth)?(null===(d=p.current)||void 0===d?void 0:d.clientWidth)+1:0,K={headerContainerRef:u,headers:N.current,hiddenColumns:H,isWidthDragging:f,rowHeight:y,visibleRows:R,columnIndices:F,rowIndices:A};return e.jsxs("div",r({className:"st-table-body-container",ref:D,onScroll:function(e){var n=e.currentTarget.scrollTop;B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame((function(){I(n)}))}},{children:[v.length>0&&e.jsx(L,r({},K,{onExpandRowClick:z,pinned:"left",sectionRef:j,templateColumns:m,totalHeight:P,width:U})),e.jsx(L,r({},K,{onExpandRowClick:z,sectionRef:E,templateColumns:h,totalHeight:P,width:J})),w.length>0&&e.jsx(L,r({},K,{onExpandRowClick:z,pinned:"right",sectionRef:k,templateColumns:x,totalHeight:P,width:q}))]}))},B=function(e,r){n.useEffect((function(){if(e.current){var n=e.current,t=function(){var e,t=null==n?void 0:n.scrollLeft;void 0!==t&&(null===(e=r.current)||void 0===e||e.scrollTo(t,0))};return n.addEventListener("scroll",t),function(){null==n||n.removeEventListener("scroll",t)}}}),[e,r])},P={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return P.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?P.string(e,n,r):"number"==typeof e&&"number"==typeof n?P.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?P.boolean(e,n,r):P.string(String(e),String(n),r)}},F=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return P.number(i,a,t)}return"date"===r?P.date(String(e),String(n),t):"boolean"===r?P.boolean(Boolean(e),Boolean(n),t):"enum"===r?P.enum(String(e),String(n),t):P.string(String(e),String(n),t)},A=function(e,n,o){var i=o.find((function(e){return e.accessor===n.key.accessor})),a=(null==i?void 0:i.type)||"string",l=n.direction,d=new Map,s=new Map,c="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(d.size)).toString();c=t,s.set(c,e),d.has(c)||d.set(c,[])}else if(c){var o=d.get(c)||[];o.push(e),d.set(c,o)}else{var i="default";d.has(i)||d.set(i,[]),null===(r=d.get(i))||void 0===r||r.push(e)}}));var u=[];return d.forEach((function(e,i){if(s.has(i)){var d=s.get(i);d.rowMeta.children&&d.rowMeta.children.length>0&&(d.rowMeta.children=z(d.rowMeta.children,n,o)),u.push(d)}var c=t([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return F(o,i,a,l)}));u.push.apply(u,c.map((function(e){var t=r({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var i=z(t.rowMeta.children,n,o);t.rowMeta=r(r({},t.rowMeta),{children:i})}return t})))})),u},z=function(e,n,o){var i=o.find((function(e){return e.accessor===n.key.accessor})),a=(null==i?void 0:i.type)||"string",l=n.direction;return t([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return F(o,i,a,l)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?r(r({},e),{rowMeta:r(r({},e.rowMeta),{children:z(e.rowMeta.children,n,o)})}):e}))},U=function(e){e.colIndex;var n=e.event,r=e.forceUpdate,t=e.header;e.headersRef;var o=e.gridColumnEnd,i=e.gridColumnStart,a=e.setIsWidthDragging,l=e.startWidth;a(!0),n.preventDefault();var d=n.clientX;if(t){var s="number"==typeof t.minWidth?t.minWidth:40,c=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return c(e)})):[e]},u=o-i>1,f=u?c(t):[t],h=f.map((function(e){return"number"==typeof e.width?e.width:parseInt(String(e.width),10)||150})).reduce((function(e,n){return e+n}),0),v=function(e){var n=e.clientX-d;if(u&&f.length>1){for(var o=Math.max(h+n,f.length*s),i=Math.max(Math.floor(o/f.length),s),a=0;a<f.length-1;a++)f[a].width=i;var c=i*(f.length-1),v=Math.max(o-c,s);f[f.length-1].width=v}else{var g=Math.max(l+n,s);t.width=g}r()},g=function(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),a(!1)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",g)}},J=n.forwardRef((function(o,i){var a,l,d=o.colIndex,s=o.forceHeadersUpdate,c=o.gridColumnEnd,u=o.gridColumnStart,h=o.gridRowEnd,v=o.gridRowStart,g=o.header,m=o.reverse,w=o.sort,p=S(),C=p.columnReordering,I=p.columnResizing,b=p.draggedHeaderRef,y=p.forceUpdate,M=p.headersRef,E=p.hoveredHeaderRef,j=p.onColumnOrderChange,k=p.onSort,D=p.onTableHeaderDragEnd,H=p.rowHeight,N=p.selectColumns,L=p.selectableColumns,T=p.setInitialFocusedCell,W=p.setIsWidthDragging,O=p.setSelectedCells,B=p.setSelectedColumns,P=p.sortDownIcon,F=p.sortUpIcon,A=Boolean(null==g?void 0:g.isSortable),z="st-header-cell ".concat(g.accessor===(null===(a=E.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(l=b.current)||void 0===l?void 0:l.accessor)===g.accessor?"st-dragging":""," ").concat(A?"clickable":""," ").concat(C&&!A?"columnReordering":""," ").concat("right"===(null==g?void 0:g.align)?"right-aligned":"center"===(null==g?void 0:g.align)?"center-aligned":""),J=R({draggedHeaderRef:b,headersRef:M,hoveredHeaderRef:E,onColumnOrderChange:j,onTableHeaderDragEnd:D}),q=J.handleDragStart,K=J.handleDragEnd,V=J.handleDragOver,X=x(),Y=function(e){var n=e.event,r=e.header;if(L){var o=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,d);return n.shiftKey&&N?B((function(e){if(0===e.size)return new Set(o);var n=o[0],r=Array.from(e).sort((function(e,n){return e-n})),i=r[0],a=Math.abs(n-i);r.forEach((function(e){var r=Math.abs(n-e);r<a&&(a=r,i=e)}));var l,d,s,c,u=t(t([],(l=i,d=n,s=Math.min(l,d),c=Math.max(l,d),Array.from({length:c-s+1},(function(e,n){return s+n}))),!0),o,!0);return new Set(t(t([],Array.from(e),!0),u,!0))})):N&&N(o),O(new Set),void T(null)}r.isSortable&&k(d,r.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!g)return null;var _=I&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;X({callback:U,callbackProps:{colIndex:d,event:e,forceUpdate:y,header:g,headersRef:M,gridColumnEnd:c,gridColumnStart:u,setIsWidthDragging:W,startWidth:"object"==typeof i&&null!==i&&"current"in i?null===(n=i.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),$=w&&w.key.accessor===g.accessor&&e.jsxs("div",r({className:"st-sort-icon-container",onClick:function(e){return Y({event:e,header:g})}},{children:["ascending"===w.direction&&F&&F,"descending"===w.direction&&P&&P]}));return e.jsxs("div",r({className:z,id:f({accessor:g.accessor,rowIndex:0}),onDragOver:function(e){X({callback:V,callbackProps:{event:e,hoveredHeader:g},limit:50})},ref:i,style:r(r({gridRowStart:v,gridRowEnd:h,gridColumnStart:u,gridColumnEnd:c},c-u>1?{}:{width:g.width}),h-v>1?{}:{height:H})},{children:[m&&_,e.jsxs("div",r({className:"st-header-label ".concat("right"===g.align?"right-aligned":"center"===g.align?"center-aligned":""),draggable:C&&!g.disableReorder,onClick:function(e){return Y({event:e,header:g})},onDragEnd:function(e){e.preventDefault(),K(),s()},onDragStart:function(e){C&&g&&function(e){q(e)}(g)}},{children:["right"===g.align&&$,null==g?void 0:g.label,"right"!==g.align&&$]})),!m&&_]}))})),q=function(t){var o=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,l=t.headersRef,d=t.hiddenColumns,s=t.maxDepth,c=t.pinned,u=t.sectionRef,f=t.sort,v=n.useReducer((function(e){return e+1}),0)[1],g=n.useMemo((function(){var e=[],n=1,r=function(t,i,a){var l,u;if(void 0===a&&(a=!1),!h({hiddenColumns:d,header:t,pinned:c}))return 0;a||n++;var f=null!==(u=null===(l=t.children)||void 0===l?void 0:l.filter((function(e){return h({hiddenColumns:d,header:e,pinned:c})})).length)&&void 0!==u?u:0,v=n,g=f>0?v+f:v+1,m=i,w=f>0?i+1:s+1;if(e.push({header:t,gridColumnStart:v,gridColumnEnd:g,gridRowStart:m,gridRowEnd:w,colIndex:o[t.accessor]}),t.children){var p=!0;t.children.forEach((function(e){h({hiddenColumns:d,header:e,pinned:c})&&(r(e,i+1,p),p=!1)}))}return g-v},t=l.current.filter((function(e){return h({hiddenColumns:d,header:e,pinned:c})})),i=!0;return t.forEach((function(e){r(e,1,i),i=!1})),e}),[l,d,s,c,o]);return e.jsx("div",r({className:"st-header-".concat(c?"pinned-".concat(c):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(E,r({rowIndex:0},{children:g.map((function(r){return e.jsx(J,{colIndex:r.colIndex,forceHeadersUpdate:v,gridColumnEnd:r.gridColumnEnd,gridColumnStart:r.gridColumnStart,gridRowEnd:r.gridRowEnd,gridRowStart:r.gridRowStart,header:r.header,ref:n.createRef(),reverse:"right"===c,sort:f},r.header.accessor)}))}))}))},K=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(K)):1},V=function(t){var o=t.centerHeaderRef,i=t.headerContainerRef,a=t.headersRef,l=t.hiddenColumns,d=t.mainTemplateColumns,s=t.pinnedLeftColumns,c=t.pinnedLeftHeaderRef,u=t.pinnedLeftTemplateColumns,f=t.pinnedRightColumns,v=t.pinnedRightHeaderRef,g=t.pinnedRightTemplateColumns,m=t.sort,w=S().mainBodyRef;B(w,o);var p=n.useMemo((function(){return T({headersRef:a,hiddenColumns:l,pinnedLeftColumns:s,pinnedRightColumns:f})}),[a,l,s,f]),x=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(h({hiddenColumns:l,header:e})){var r=K(e);n=Math.max(n,r)}})),{maxDepth:n}}),[a,l]).maxDepth;return e.jsxs("div",r({className:"st-header-container",ref:i},{children:[s.length>0&&e.jsx(q,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"left",sectionRef:c,sort:m}),e.jsx(q,{columnIndices:p,gridTemplateColumns:d,handleScroll:function(e){var n,r,t=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=w.current)||void 0===r||r.scrollTo(t,0))},headersRef:a,hiddenColumns:l,maxDepth:x,sectionRef:o,sort:m}),f.length>0&&e.jsx(q,{columnIndices:p,gridTemplateColumns:g,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"right",sectionRef:v,sort:m})]}))},X=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},Y=function(t){var o=t.flattenedRows,i=t.isWidthDragging,a=t.setFlattenedRows,l=t.setScrollTop,d=t.sort,s=t.visibleRows,c=S(),u=c.editColumns,f=c.headersRef,h=c.hiddenColumns,v=n.useRef(null),g=n.useRef(null),m=n.useRef(null),w=n.useRef(null),p=f.current.filter((function(e){return!e.pinned})),x=f.current.filter((function(e){return"left"===e.pinned})),C=f.current.filter((function(e){return"right"===e.pinned})),I=n.useMemo((function(){return X({headers:x,hiddenColumns:h})}),[x,h]),R=n.useMemo((function(){return X({headers:p,hiddenColumns:h})}),[p,h]),b=n.useMemo((function(){return X({headers:C,hiddenColumns:h})}),[C,h]),y={centerHeaderRef:m,headerContainerRef:v,headersRef:f,hiddenColumns:h,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:g,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,sort:d},M={centerHeaderRef:m,flattenedRows:o,headerContainerRef:v,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:g,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,setFlattenedRows:a,setScrollTop:l,visibleRows:s};return e.jsxs("div",r({className:"st-table-content",style:{width:u?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(V,r({},y)),e.jsx(O,r({},M))]}))},_=function(e){var r=e.callback,t=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=t.current;if(e){var n=function(){r(e[o]||0)};n();var i=new ResizeObserver((function(){n()}));return i.observe(e),function(){return i.disconnect()}}}),[r,t,o])},$=function(t){var o=t.mainBodyRef,i=t.pinnedLeftRef,a=t.pinnedRightRef,l=t.tableContentWidth,d=n.useState(0),s=d[0],c=d[1],u=n.useState(0),f=u[0],h=u[1],v=n.useState(0),g=v[0],m=v[1],w=n.useRef(null);return _({widthAttribute:"offsetWidth",callback:c,ref:i}),_({widthAttribute:"scrollWidth",callback:m,ref:o}),_({widthAttribute:"offsetWidth",callback:h,ref:a}),B(o,w),!o.current||o.current.scrollWidth<=o.current.clientWidth?null:e.jsxs("div",r({className:"st-horizontal-scrollbar-container",style:{width:l}},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s}}),g>0&&e.jsx("div",r({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&o.current&&o.current.scrollTo({left:n,behavior:"auto"})},ref:w},{children:e.jsx("div",{style:{width:g}})})),f>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},G=function(e){var r=e.headers,t=e.tableRows,o=n.useState(null),i=o[0],a=o[1],l=n.useMemo((function(){var e={};return r.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[r]),d=n.useState(l),s=d[0],c=d[1],u=n.useMemo((function(){if(!i)return t;var e=function(e,n,r){return{sortedData:A(n,r,e),newSortConfig:r}}(r,t,i).sortedData;return e}),[t,i,r]);return{sort:i,setSort:a,updateSort:function(e,n){var t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(r);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))},sortedRows:u,hiddenColumns:s,setHiddenColumns:c}},Q=function(t){var o=t.checked,i=void 0!==o&&o,a=t.children,l=t.onChange,d=n.useState(i),s=d[0],c=d[1];return e.jsxs("label",r({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:s,className:"st-checkbox-input",onChange:function(){var e=!s;c(e),l&&l(e)},type:"checkbox"}),e.jsx("span",r({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&e.jsx("span",{className:"st-checkbox-checkmark"})})),a]}))},Z=function(n){var t=n.headers,o=n.open,i=n.position;n.setOpen;var a=n.setHiddenColumns,l=n.hiddenColumns,d="left"===i?"left":"";return e.jsx("div",r({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(d),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",r({className:"st-column-editor-popout-content"},{children:t.map((function(n,t){return e.jsx(Q,r({checked:l[n.accessor],onChange:function(e){var t;return a(r(r({},l),((t={})[n.accessor]=e,t)))}},{children:n.label}),t)}))}))}))},ee=function(t){var o=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,d=t.position,s=void 0===d?"right":d,c=t.setHiddenColumns,u=t.hiddenColumns,f=n.useState(a),h=f[0],v=f[1];return i?e.jsxs("div",r({className:"st-column-editor ".concat(h?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!h)}},{children:[e.jsx("div",r({className:"st-column-editor-text"},{children:o})),e.jsx(Z,{headers:l,open:h,position:s,setOpen:v,setHiddenColumns:c,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(W||(W={}));var ne=n.memo((function(t){var c=t.allowAnimations,u=void 0!==c&&c,f=t.collapseIcon,h=void 0===f?e.jsx(s,{className:"st-sort-icon"}):f,v=t.columnEditorPosition,g=void 0===v?W.Right:v,m=t.columnEditorText,w=void 0===m?"Columns":m,p=t.columnReordering,x=void 0!==p&&p,C=t.columnResizing,I=void 0!==C&&C,R=t.defaultHeaders,b=t.editColumns,S=void 0!==b&&b,M=t.editColumnsInitOpen,E=void 0!==M&&M,j=t.expandIcon,k=void 0===j?e.jsx(l,{className:"st-sort-icon"}):j,D=t.height,H=t.hideFooter,N=void 0!==H&&H,L=t.nextIcon,T=void 0===L?e.jsx(l,{className:"st-next-prev-icon"}):L,O=t.onCellEdit,B=t.onColumnOrderChange,P=t.onNextPage,F=t.onPreviousPage,A=t.prevIcon,z=void 0===A?e.jsx(a,{className:"st-next-prev-icon"}):A,U=t.rowHeight,J=void 0===U?40:U,q=t.rows,K=t.rowsPerPage,V=void 0===K?10:K,X=t.selectableCells,_=void 0!==X&&X,Q=t.selectableColumns,Z=void 0!==Q&&Q,ne=t.shouldPaginate,re=void 0!==ne&&ne,te=t.sortDownIcon,oe=void 0===te?e.jsx(s,{className:"st-sort-icon"}):te,ie=t.sortUpIcon,ae=void 0===ie?e.jsx(d,{className:"st-sort-icon"}):ie,le=t.theme,de=void 0===le?"light":le,se=t.totalPages,ce=n.useRef(null),ue=n.useRef(R),fe=n.useRef(null),he=n.useRef(null),ve=n.useRef(null),ge=n.useRef(null),me=n.useRef(null),we=n.useState(!1),pe=we[0],xe=we[1],Ce=n.useState(1),Ie=Ce[0],Re=Ce[1],be=n.useState(0),ye=be[0],Se=be[1],Me=n.useState(0),Ee=Me[0],je=Me[1],ke=n.useState(0),De=ke[0],He=ke[1],Ne=G({headers:ue.current,tableRows:q}),Le=Ne.sort,Te=Ne.sortedRows,We=Ne.hiddenColumns,Oe=Ne.setHiddenColumns,Be=Ne.updateSort,Pe=n.useMemo((function(){if(!re)return Te;var e=(Ie-1)*V,n=e+V;return Te.slice(e,n)}),[Ie,V,re,Te]),Fe=n.useState(Pe),Ae=Fe[0],ze=Fe[1];n.useEffect((function(){ze(Pe)}),[Pe]);var Ue=n.useMemo((function(){var e;if(!D)return window.innerHeight-J;var n=document.querySelector(".simple-table-root"),r=0;if(D.endsWith("px"))r=parseInt(D,10);else if(D.endsWith("vh")){var t=parseInt(D,10);r=window.innerHeight*t/100}else if(D.endsWith("%")){var o=parseInt(D,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-J)}),[D,J]),Je=n.useMemo((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=[],l=0,d=Math.max(0,i-o*n),s=i+r+o*n,c=function(e,n){for(var r,t=0,i=e;t<i.length;t++){var u=i[t],f=l*o;if(f>=s)break;f+o>d&&a.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&c(u.rowMeta.children,n+1)}};return c(t,0),a}({bufferRowCount:5,contentHeight:Ue,flattenedRows:Ae,rowHeight:J,scrollTop:De})}),[Ue,J,Ae,De]),qe=n.useReducer((function(e){return e+1}),0)[1],Ke=function(e){var r=e.selectableCells,t=e.headers,i=e.visibleRows,a=n.useState(new Set),l=a[0],d=a[1],s=n.useState(new Set),c=s[0],u=s[1],f=n.useState(null),h=f[0],v=f[1],g=n.useState(null),m=g[0],w=g[1],p=n.useRef(!1),x=n.useRef(null),C=n.useCallback((function(){var e=Array.from(l).reduce((function(e,n){var r=n.split("-").map(Number),o=r[0],a=r[1];return e[o]||(e[o]=[]),e[o][a]=i[o].row.rowData[t[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");l.size>0&&navigator.clipboard.writeText(n)}),[t,l,i]),I=n.useCallback((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),a=Math.max(e.rowIndex,n.rowIndex),l=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),c=t;c<=a;c++)for(var f=l;f<=s;f++)if(c>=0&&c<i.length){var h=i[c].row.rowMeta.rowId;r.add(o({colIndex:f,rowIndex:c,rowId:h}))}u(new Set),v(null),d(r)}),[i,u,v,d]),R=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<i.length&&e.colIndex>=0&&e.colIndex<t.length){var n=o(e);u(new Set),v(null),d(new Set([n])),w(e)}}),[t.length,i.length,u,v,d,w]),b=n.useCallback((function(e,n){void 0===n&&(n=!1),d(new Set),w(null),u((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&v(e[e.length-1])}),[d,w,u,v]);n.useEffect((function(){var e=function(e){if(r&&m){var n=m.rowIndex,o=m.colIndex,a=m.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(i[n].row.rowMeta.rowId!==a){var l=i.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===l)return;n=l}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:o,rowId:i[n-1].row.rowMeta.rowId};R(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<i.length-1&&(s={rowIndex:n+1,colIndex:o,rowId:i[n+1].row.rowMeta.rowId},R(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(s={rowIndex:n,colIndex:o-1,rowId:i[n].row.rowMeta.rowId},R(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<t.length-1&&(s={rowIndex:n,colIndex:o+1,rowId:i[n].row.rowMeta.rowId},R(s))):"Escape"===e.key&&(d(new Set),u(new Set),v(null),x.current=null,w(null))}else C()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[C,t.length,m,I,R,r,i]);var y=n.useCallback((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,i=o({colIndex:n,rowIndex:r,rowId:t}),a=l.has(i),d=c.has(n);return a||d}),[l,c]),S=n.useCallback((function(e){var n,r,t,o,a,l,d=e.colIndex,s=e.rowIndex,u=e.rowId,f=[],h=null===(t=null===(r=null===(n=i[s-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:d,rowIndex:s+1,rowId:null===(l=null===(a=null===(o=i[s+1])||void 0===o?void 0:o.row)||void 0===a?void 0:a.rowMeta)||void 0===l?void 0:l.rowId},g={colIndex:d-1,rowIndex:s,rowId:u},m={colIndex:d+1,rowIndex:s,rowId:u};return(!y({colIndex:d,rowIndex:s-1,rowId:h})||c.has(d)&&0===s)&&f.push("st-selected-top-border"),(!y(v)||c.has(d)&&s===i.length-1)&&f.push("st-selected-bottom-border"),y(g)||f.push("st-selected-left-border"),y(m)||f.push("st-selected-right-border"),f.join(" ")}),[y,i,c]),M=n.useMemo((function(){return m?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===m.rowIndex&&r===m.colIndex&&t===m.rowId}:function(){return!1}}),[m]);return{getBorderClass:S,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,i=e.rowId;if(r){p.current=!0,x.current={rowIndex:t,colIndex:n,rowId:i},u(new Set),v(null);var a=o({colIndex:n,rowIndex:t,rowId:i});d(new Set([a])),w({rowIndex:t,colIndex:n,rowId:i})}},handleMouseOver:function(e){var n=e.colIndex,t=e.rowIndex;if(e.rowId,r&&p.current&&x.current){for(var a=new Set,l=Math.min(x.current.rowIndex,t),s=Math.max(x.current.rowIndex,t),c=Math.min(x.current.colIndex,n),u=Math.max(x.current.colIndex,n),f=l;f<=s;f++)for(var h=c;h<=u;h++)if(f>=0&&f<i.length){var v=i[f].row.rowMeta.rowId;a.add(o({colIndex:h,rowIndex:f,rowId:v}))}d(a)}},handleMouseUp:function(){p.current=!1},isInitialFocusedCell:M,isSelected:y,lastSelectedColumnIndex:h,selectColumns:b,selectedCells:l,selectedColumns:c,setInitialFocusedCell:w,setSelectedCells:d,setSelectedColumns:u}}({selectableCells:_,headers:ue.current,visibleRows:Je}),Ve=Ke.handleMouseDown,Xe=Ke.handleMouseOver,Ye=Ke.handleMouseUp,_e=Ke.isSelected,$e=Ke.getBorderClass,Ge=Ke.isInitialFocusedCell,Qe=Ke.setSelectedCells,Ze=Ke.setSelectedColumns,en=Ke.selectColumns,nn=Ke.setInitialFocusedCell,rn=n.useCallback((function(e,n){Be(e,n)}),[Be]),tn=n.useCallback((function(e){ue.current=e,qe()}),[]);return n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Z&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(Qe(new Set),Z&&Ze(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Z,Qe,Ze]),n.useLayoutEffect((function(){if(me.current){var e=me.current.offsetWidth-me.current.clientWidth,n=me.current.clientWidth;Se(e),je(n)}}),[]),n.useLayoutEffect((function(){var e=function(){if(qe(),me.current){var e=me.current.offsetWidth-me.current.clientWidth,n=me.current.clientWidth;Se(e),je(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e.jsx(y,r({value:{allowAnimations:u,collapseIcon:h,columnReordering:x,columnResizing:I,draggedHeaderRef:ce,editColumns:S,expandIcon:k,forceUpdate:qe,getBorderClass:$e,handleMouseDown:Ve,handleMouseOver:Xe,headersRef:ue,hiddenColumns:We,hoveredHeaderRef:fe,isInitialFocusedCell:Ge,isSelected:_e,mainBodyRef:he,onCellEdit:O,onColumnOrderChange:B,onSort:rn,onTableHeaderDragEnd:tn,pinnedLeftRef:ve,pinnedRightRef:ge,rowHeight:J,scrollbarWidth:ye,selectColumns:en,selectableColumns:Z,setInitialFocusedCell:nn,setIsWidthDragging:xe,setSelectedCells:Qe,setSelectedColumns:Ze,shouldPaginate:re,sortDownIcon:oe,sortUpIcon:ae,tableBodyContainerRef:me}},{children:e.jsxs("div",r({className:"simple-table-root st-wrapper theme-".concat(de),style:D?{height:D}:{}},{children:[e.jsxs("div",r({className:"st-table-wrapper-container"},{children:[e.jsxs("div",r({className:"st-table-wrapper",onMouseUp:Ye,onMouseLeave:Ye},{children:[e.jsx(Y,{flattenedRows:Ae,isWidthDragging:pe,setFlattenedRows:ze,setScrollTop:He,sort:Le,visibleRows:Je}),e.jsx(ee,{columnEditorText:w,editColumns:S,editColumnsInitOpen:E,headers:ue.current,hiddenColumns:We,position:g,setHiddenColumns:Oe})]})),e.jsx($,{mainBodyRef:he,pinnedLeftRef:ve,pinnedRightRef:ge,tableContentWidth:Ee})]})),e.jsx(i,{currentPage:Ie,hideFooter:N,nextIcon:T,onPageChange:Re,onNextPage:P,onPreviousPage:F,prevIcon:z,shouldPaginate:re,totalPages:se||Math.ceil(Te.length/V)})]}))}))}));exports.SimpleTable=ne;
2
2
  //# sourceMappingURL=index.js.map
package/dist/styles.css CHANGED
@@ -1 +1,11 @@
1
- .simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:#0000;--st-scrollbar-thumb-color:var(--st-slate-200);--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519}.theme-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-gray-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-slate-50);--st-header-background-color:var(--st-white);--st-dragging-background-color:var(--st-gray-200);--st-selected-cell-background-color:var(--st-blue-200);--st-selected-first-cell-background-color:var(--st-blue-100);--st-footer-background-color:var(--st-white);--st-cell-color:var(--st-gray-800);--st-cell-odd-row-color:var(--st-gray-700);--st-edit-cell-shadow:0 1px 2px 0 #0000000d,0 1px 1px -1px #0000000d;--st-selected-cell-color:var(--st-gray-900);--st-selected-first-cell-color:var(--st-gray-900);--st-resize-handle-color:var(--st-blue-300);--st-separator-border-color:var(--st-slate-100);--st-last-group-row-separator-border-color:var(--st-slate-300);--st-selected-border-top-color:var(--st-blue-600);--st-selected-border-bottom-color:var(--st-blue-600);--st-selected-border-left-color:var(--st-blue-600);--st-selected-border-right-color:var(--st-blue-600);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-gray-200);--st-button-active-background-color:var(--st-blue-800);--st-font-family:"Roboto",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-600)}.theme-dark{--st-border-radius:6px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-slate-800);--st-scrollbar-thumb-color:var(--st-slate-600);--st-border-color:var(--st-slate-800);--st-odd-row-background-color:var(--st-slate-800);--st-even-row-background-color:var(--st-slate-900);--st-header-background-color:var(--st-slate-700);--st-dragging-background-color:var(--st-blue-800);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-white);--st-cell-odd-row-color:var(--st-slate-300);--st-edit-cell-shadow:0 1px 3px 0 var(--st-white/0.1),0 1px 2px -1px var(--st-white/0.1);--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-slate-600);--st-separator-border-color:var(--st-slate-500);--st-last-group-row-separator-border-color:var(--st-slate-700);--st-selected-border-top-color:var(--st-blue-400);--st-selected-border-bottom-color:var(--st-blue-400);--st-selected-border-left-color:var(--st-blue-400);--st-selected-border-right-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-700);--st-checkbox-checked-border-color:var(--st-blue-700);--st-column-editor-background-color:var(--st-slate-800);--st-column-editor-popout-background-color:var(--st-slate-800);--st-button-hover-background-color:var(--st-slate-600);--st-button-active-background-color:var(--st-slate-700);--st-font-family:"Open Sans",sans-serif;--st-editable-cell-focus-border-color:var(--st-slate-600)}.theme-high-contrast{--st-border-radius:0;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:500;--st-font-weight-bold:800;--st-transition-duration:0s;--st-transition-ease:ease;--st-opacity-disabled:0.7;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-slate-950);--st-scrollbar-thumb-color:var(--st-slate-200);--st-border-color:var(--st-slate-900);--st-odd-row-background-color:var(--st-slate-400);--st-even-row-background-color:var(--st-slate-900);--st-header-background-color:var(--st-slate-900);--st-dragging-background-color:var(--st-yellow-500);--st-selected-cell-background-color:var(--st-slate-900);--st-selected-first-cell-background-color:var(--st-red-500);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-white);--st-cell-odd-row-color:var(--st-slate-900);--st-edit-cell-shadow:none;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-white);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-900);--st-selected-border-top-color:var(--st-orange-600);--st-selected-border-bottom-color:var(--st-orange-600);--st-selected-border-left-color:var(--st-orange-600);--st-selected-border-right-color:var(--st-orange-600);--st-checkbox-checked-background-color:var(--st-slate-50);--st-checkbox-checked-border-color:var(--st-slate-50);--st-column-editor-background-color:var(--st-slate-900);--st-column-editor-popout-background-color:var(--st-slate-900);--st-button-hover-background-color:var(--st-slate-50);--st-button-active-background-color:var(--st-slate-900);--st-font-family:"Arial",sans-serif;--st-editable-cell-focus-border-color:var(--st-orange-600)}.theme-pastel{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-purple-100);--st-scrollbar-thumb-color:var(--st-purple-300);--st-border-color:var(--st-purple-200);--st-odd-row-background-color:var(--st-purple-50);--st-even-row-background-color:var(--st-blue-50);--st-header-background-color:var(--st-blue-50);--st-dragging-background-color:var(--st-cyan-50);--st-selected-cell-background-color:var(--st-orange-50);--st-selected-first-cell-background-color:var(--st-amber-50);--st-footer-background-color:var(--st-purple-50);--st-cell-color:var(--st-slate-600);--st-cell-odd-row-color:var(--st-slate-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-600);--st-selected-first-cell-color:var(--st-slate-600);--st-resize-handle-color:var(--st-purple-200);--st-separator-border-color:var(--st-purple-200);--st-last-group-row-separator-border-color:var(--st-purple-500);--st-selected-border-top-color:var(--st-amber-500);--st-selected-border-bottom-color:var(--st-amber-500);--st-selected-border-left-color:var(--st-amber-500);--st-selected-border-right-color:var(--st-amber-500);--st-checkbox-checked-background-color:var(--st-purple-200);--st-checkbox-checked-border-color:var(--st-purple-200);--st-column-editor-background-color:var(--st-purple-50);--st-column-editor-popout-background-color:var(--st-purple-50);--st-button-hover-background-color:var(--st-purple-100);--st-button-active-background-color:var(--st-purple-200);--st-font-family:"Comic Sans MS",cursive,sans-serif;--st-editable-cell-focus-border-color:var(--st-purple-300)}.theme-vibrant{--st-border-radius:12px;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:500;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-orange-200);--st-scrollbar-thumb-color:var(--st-orange-300);--st-border-color:var(--st-orange-500);--st-odd-row-background-color:var(--st-orange-100);--st-even-row-background-color:var(--st-orange-200);--st-header-background-color:var(--st-orange-300);--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-amber-300);--st-footer-background-color:var(--st-orange-50);--st-cell-color:var(--st-orange-900);--st-cell-odd-row-color:var(--st-orange-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.2),0 1px 2px -1px var(--st-black/0.2);--st-selected-cell-color:var(--st-orange-900);--st-selected-first-cell-color:var(--st-orange-900);--st-resize-handle-color:var(--st-orange-400);--st-separator-border-color:var(--st-orange-200);--st-last-group-row-separator-border-color:var(--st-orange-500);--st-selected-border-top-color:var(--st-orange-700);--st-selected-border-bottom-color:var(--st-orange-700);--st-selected-border-left-color:var(--st-orange-700);--st-selected-border-right-color:var(--st-orange-700);--st-checkbox-checked-background-color:var(--st-orange-500);--st-checkbox-checked-border-color:var(--st-orange-500);--st-column-editor-background-color:var(--st-orange-100);--st-column-editor-popout-background-color:var(--st-orange-100);--st-button-hover-background-color:var(--st-orange-300);--st-button-active-background-color:var(--st-orange-400);--st-font-family:"Lobster",cursive;--st-editable-cell-focus-border-color:var(--st-orange-600)}.theme-solarized-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-yellow-100);--st-scrollbar-thumb-color:var(--st-yellow-300);--st-border-color:var(--st-yellow-300);--st-odd-row-background-color:var(--st-yellow-50);--st-even-row-background-color:var(--st-yellow-200);--st-header-background-color:var(--st-yellow-200);--st-dragging-background-color:var(--st-yellow-300);--st-selected-cell-background-color:var(--st-slate-400);--st-selected-first-cell-background-color:var(--st-slate-300);--st-footer-background-color:var(--st-yellow-50);--st-cell-color:var(--st-slate-600);--st-cell-odd-row-color:var(--st-slate-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-600);--st-selected-first-cell-color:var(--st-slate-600);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-yellow-300);--st-last-group-row-separator-border-color:var(--st-yellow-500);--st-selected-border-top-color:var(--st-yellow-600);--st-selected-border-bottom-color:var(--st-yellow-600);--st-selected-border-left-color:var(--st-yellow-600);--st-selected-border-right-color:var(--st-yellow-600);--st-checkbox-checked-background-color:var(--st-slate-400);--st-checkbox-checked-border-color:var(--st-slate-400);--st-column-editor-background-color:var(--st-yellow-200);--st-column-editor-popout-background-color:var(--st-yellow-200);--st-button-hover-background-color:var(--st-yellow-200);--st-button-active-background-color:var(--st-slate-400);--st-font-family:"Georgia",serif;--st-editable-cell-focus-border-color:var(--st-yellow-400)}.theme-solarized-dark{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-800);--st-scrollbar-thumb-color:var(--st-slate-600);--st-border-color:var(--st-slate-800);--st-odd-row-background-color:var(--st-slate-900);--st-even-row-background-color:var(--st-slate-800);--st-header-background-color:var(--st-slate-800);--st-dragging-background-color:var(--st-slate-800);--st-selected-cell-background-color:var(--st-slate-600);--st-selected-first-cell-background-color:var(--st-slate-500);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-slate-300);--st-cell-odd-row-color:var(--st-slate-400);--st-edit-cell-shadow:0 1px 3px 0 var(--st-white/0.1),0 1px 2px -1px var(--st-white/0.1);--st-selected-cell-color:var(--st-slate-300);--st-selected-first-cell-color:var(--st-slate-300);--st-resize-handle-color:var(--st-slate-600);--st-separator-border-color:var(--st-slate-400);--st-last-group-row-separator-border-color:var(--st-slate-600);--st-selected-border-top-color:var(--st-blue-800);--st-selected-border-bottom-color:var(--st-blue-800);--st-selected-border-left-color:var(--st-blue-800);--st-selected-border-right-color:var(--st-blue-800);--st-checkbox-checked-background-color:var(--st-slate-600);--st-checkbox-checked-border-color:var(--st-slate-600);--st-column-editor-background-color:var(--st-slate-800);--st-column-editor-popout-background-color:var(--st-slate-800);--st-button-hover-background-color:var(--st-slate-600);--st-button-active-background-color:var(--st-slate-800);--st-font-family:"Courier New",monospace;--st-editable-cell-focus-border-color:var(--st-blue-800)}.theme-ocean{--st-border-radius:6px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-cyan-100);--st-scrollbar-thumb-color:var(--st-cyan-300);--st-border-color:var(--st-cyan-700);--st-odd-row-background-color:var(--st-cyan-50);--st-even-row-background-color:var(--st-cyan-100);--st-header-background-color:var(--st-cyan-100);--st-dragging-background-color:var(--st-cyan-300);--st-selected-cell-background-color:var(--st-cyan-700);--st-selected-first-cell-background-color:var(--st-cyan-600);--st-footer-background-color:var(--st-cyan-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-cyan-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-cyan-300);--st-separator-border-color:var(--st-cyan-200);--st-last-group-row-separator-border-color:var(--st-cyan-500);--st-selected-border-top-color:var(--st-blue-700);--st-selected-border-bottom-color:var(--st-blue-700);--st-selected-border-left-color:var(--st-blue-700);--st-selected-border-right-color:var(--st-blue-700);--st-checkbox-checked-background-color:var(--st-cyan-700);--st-checkbox-checked-border-color:var(--st-cyan-700);--st-column-editor-background-color:var(--st-cyan-100);--st-column-editor-popout-background-color:var(--st-cyan-100);--st-button-hover-background-color:var(--st-cyan-300);--st-button-active-background-color:var(--st-cyan-700);--st-font-family:"Verdana",sans-serif;--st-editable-cell-focus-border-color:var(--st-cyan-500)}.theme-forest{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-green-100);--st-scrollbar-thumb-color:var(--st-green-400);--st-border-color:var(--st-green-800);--st-odd-row-background-color:var(--st-green-50);--st-even-row-background-color:var(--st-green-100);--st-header-background-color:var(--st-green-100);--st-dragging-background-color:var(--st-green-400);--st-selected-cell-background-color:var(--st-green-700);--st-selected-first-cell-background-color:var(--st-green-600);--st-footer-background-color:var(--st-green-50);--st-cell-color:var(--st-green-900);--st-cell-odd-row-color:var(--st-green-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-green-900);--st-selected-first-cell-color:var(--st-green-900);--st-resize-handle-color:var(--st-green-400);--st-separator-border-color:var(--st-green-200);--st-last-group-row-separator-border-color:var(--st-green-500);--st-selected-border-top-color:var(--st-green-600);--st-selected-border-bottom-color:var(--st-green-600);--st-selected-border-left-color:var(--st-green-600);--st-selected-border-right-color:var(--st-green-600);--st-checkbox-checked-background-color:var(--st-green-700);--st-checkbox-checked-border-color:var(--st-green-700);--st-column-editor-background-color:var(--st-green-100);--st-column-editor-popout-background-color:var(--st-green-100);--st-button-hover-background-color:var(--st-green-400);--st-button-active-background-color:var(--st-green-700);--st-font-family:"Tahoma",sans-serif;--st-editable-cell-focus-border-color:var(--st-green-600)}.theme-desert{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-amber-100);--st-scrollbar-thumb-color:var(--st-amber-300);--st-border-color:var(--st-amber-600);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-amber-100);--st-dragging-background-color:var(--st-amber-300);--st-selected-cell-background-color:var(--st-amber-600);--st-selected-first-cell-background-color:var(--st-amber-500);--st-footer-background-color:var(--st-amber-50);--st-cell-color:var(--st-amber-800);--st-cell-odd-row-color:var(--st-amber-600);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-amber-800);--st-selected-first-cell-color:var(--st-amber-800);--st-resize-handle-color:var(--st-amber-300);--st-separator-border-color:var(--st-amber-200);--st-last-group-row-separator-border-color:var(--st-amber-500);--st-selected-border-top-color:var(--st-amber-700);--st-selected-border-bottom-color:var(--st-amber-700);--st-selected-border-left-color:var(--st-amber-700);--st-selected-border-right-color:var(--st-amber-700);--st-checkbox-checked-background-color:var(--st-amber-600);--st-checkbox-checked-border-color:var(--st-amber-600);--st-column-editor-background-color:var(--st-amber-100);--st-column-editor-popout-background-color:var(--st-amber-100);--st-button-hover-background-color:var(--st-amber-300);--st-button-active-background-color:var(--st-amber-600);--st-font-family:"Times New Roman",serif;--st-editable-cell-focus-border-color:var(--st-amber-700)}.theme-bubblegum{--st-border-radius:16px;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-pink-50);--st-scrollbar-thumb-color:var(--st-pink-300);--st-border-color:var(--st-pink-500);--st-odd-row-background-color:var(--st-pink-50);--st-even-row-background-color:var(--st-pink-100);--st-header-background-color:var(--st-pink-200);--st-dragging-background-color:var(--st-pink-300);--st-selected-cell-background-color:var(--st-pink-400);--st-selected-first-cell-background-color:var(--st-pink-300);--st-footer-background-color:var(--st-pink-50);--st-cell-color:var(--st-pink-900);--st-cell-odd-row-color:var(--st-pink-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-pink-900);--st-selected-first-cell-color:var(--st-pink-900);--st-resize-handle-color:var(--st-pink-400);--st-separator-border-color:var(--st-pink-200);--st-last-group-row-separator-border-color:var(--st-pink-500);--st-selected-border-top-color:var(--st-pink-700);--st-selected-border-bottom-color:var(--st-pink-700);--st-selected-border-left-color:var(--st-pink-700);--st-selected-border-right-color:var(--st-pink-700);--st-checkbox-checked-background-color:var(--st-pink-500);--st-checkbox-checked-border-color:var(--st-pink-500);--st-column-editor-background-color:var(--st-pink-100);--st-column-editor-popout-background-color:var(--st-pink-100);--st-button-hover-background-color:var(--st-pink-300);--st-button-active-background-color:var(--st-pink-400);--st-font-family:"Pacifico",cursive;--st-editable-cell-focus-border-color:var(--st-pink-600)}.theme-90s{--st-border-radius:0;--st-border-width:2px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.1s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-gray-200);--st-scrollbar-thumb-color:var(--st-gray-400);--st-border-color:var(--st-gray-500);--st-odd-row-background-color:var(--st-gray-100);--st-even-row-background-color:var(--st-gray-200);--st-header-background-color:var(--st-gray-300);--st-dragging-background-color:var(--st-gray-400);--st-selected-cell-background-color:var(--st-gray-500);--st-selected-first-cell-background-color:var(--st-gray-400);--st-footer-background-color:var(--st-gray-100);--st-cell-color:var(--st-gray-900);--st-cell-odd-row-color:var(--st-gray-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-gray-900);--st-selected-first-cell-color:var(--st-gray-900);--st-resize-handle-color:var(--st-gray-400);--st-separator-border-color:var(--st-gray-200);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-top-color:var(--st-gray-700);--st-selected-border-bottom-color:var(--st-gray-700);--st-selected-border-left-color:var(--st-gray-700);--st-selected-border-right-color:var(--st-gray-700);--st-checkbox-checked-background-color:var(--st-gray-500);--st-checkbox-checked-border-color:var(--st-gray-500);--st-column-editor-background-color:var(--st-gray-200);--st-column-editor-popout-background-color:var(--st-gray-200);--st-button-hover-background-color:var(--st-gray-300);--st-button-active-background-color:var(--st-gray-400);--st-font-family:"Courier New",monospace;--st-editable-cell-focus-border-color:var(--st-gray-600)}.simple-table-root,.st-cell,.st-column-editor,.st-column-editor-popout,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-table-body-container,.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right,.st-table-content,.st-table-wrapper,.st-table-wrapper-container,.st-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:sans-serif;font-family:var(--st-font-family,sans-serif)}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-table-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-table-wrapper,.st-table-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-table-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-table-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-header-container,.st-table-content{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{overflow:auto;scrollbar-width:none;width:100%}.st-header-main::-webkit-scrollbar{display:none}.st-table-body-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content}.st-table-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-body-main{overflow:auto;scrollbar-width:none}.st-table-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-row{display:grid;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:background .2s ease;transition:background .2s ease;width:100%}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-label.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-header-label.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-header-label.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell-content,.st-header-label{-webkit-box-flex:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--st-cell-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label{padding-right:var(--st-cell-padding)}.st-cell-content{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-cell-even-row{background-color:var(--st-even-row-background-color)}.st-cell-odd-row:not(.st-cell-selected){background-color:var(--st-odd-row-background-color);color:var(--st-cell-odd-row-color)}.st-cell:not(.st-cell-odd-row):not(.st-cell-selected){color:var(--st-cell-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color);border-left:var(--st-border-width) solid var(--st-selected-border-left-color);border-right:var(--st-border-width) solid var(--st-selected-border-right-color);color:var(--st-selected-first-cell-color)}.st-cell-selected-first,.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-top-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-left-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-right-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{background-color:var(--st-scrollbar-bg-color);height:100%}.st-horizontal-scrollbar-middle{overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);-webkit-box-sizing:border-box;box-sizing:border-box;font-size:var(--st-font-size);height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-small);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-column-editor-popout.open{width:200px}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium)}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}
1
+ @import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:#0000;--st-scrollbar-thumb-color:var(--st-slate-200);--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09}.theme-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-slate-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-slate-50);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(
2
+ --st-slate-900
3
+ );--st-dragging-background-color:var(--st-slate-200);--st-selected-cell-background-color:var(--st-blue-100);--st-selected-first-cell-background-color:var(--st-blue-50);--st-footer-background-color:var(--st-slate-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-slate-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-top-color:var(--st-blue-500);--st-selected-border-bottom-color:var(--st-blue-500);--st-selected-border-left-color:var(--st-blue-500);--st-selected-border-right-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-slate-100);--st-button-active-background-color:var(--st-blue-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-500)}.theme-dark{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-gray-900);--st-scrollbar-thumb-color:var(--st-gray-600);--st-border-color:var(--st-gray-700);--st-odd-row-background-color:var(--st-gray-800);--st-even-row-background-color:var(--st-gray-900);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(
4
+ --st-gray-100
5
+ );--st-dragging-background-color:var(--st-gray-600);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-gray-900);--st-cell-color:var(--st-gray-100);--st-cell-odd-row-color:var(--st-gray-200);--st-edit-cell-shadow:0 1px 3px 0 #ffffff1a;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-gray-500);--st-separator-border-color:var(--st-gray-600);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-top-color:var(--st-blue-400);--st-selected-border-bottom-color:var(--st-blue-400);--st-selected-border-left-color:var(--st-blue-400);--st-selected-border-right-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-500);--st-checkbox-checked-border-color:var(--st-blue-500);--st-column-editor-background-color:var(--st-gray-800);--st-column-editor-popout-background-color:var(--st-gray-800);--st-button-hover-background-color:var(--st-gray-700);--st-button-active-background-color:var(--st-blue-500);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-400)}.theme-neutral{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-neutral-100);--st-scrollbar-thumb-color:var(--st-neutral-400);--st-border-color:var(--st-neutral-300);--st-odd-row-background-color:var(--st-neutral-50);--st-even-row-background-color:var(--st-neutral-100);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(
6
+ --st-neutral-900
7
+ );--st-dragging-background-color:var(--st-neutral-300);--st-selected-cell-background-color:var(--st-neutral-400);--st-selected-first-cell-background-color:var(--st-neutral-300);--st-footer-background-color:var(--st-neutral-50);--st-cell-color:var(--st-neutral-900);--st-cell-odd-row-color:var(--st-neutral-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-neutral-900);--st-selected-first-cell-color:var(--st-neutral-900);--st-resize-handle-color:var(--st-neutral-400);--st-separator-border-color:var(--st-neutral-200);--st-last-group-row-separator-border-color:var(--st-neutral-400);--st-selected-border-top-color:var(--st-neutral-600);--st-selected-border-bottom-color:var(--st-neutral-600);--st-selected-border-left-color:var(--st-neutral-600);--st-selected-border-right-color:var(--st-neutral-600);--st-checkbox-checked-background-color:var(--st-neutral-600);--st-checkbox-checked-border-color:var(--st-neutral-600);--st-column-editor-background-color:var(--st-neutral-50);--st-column-editor-popout-background-color:var(--st-neutral-50);--st-button-hover-background-color:var(--st-neutral-200);--st-button-active-background-color:var(--st-neutral-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-neutral-500)}.theme-sky{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-blue-50);--st-scrollbar-thumb-color:var(--st-blue-300);--st-border-color:var(--st-blue-300);--st-odd-row-background-color:var(--st-blue-50);--st-even-row-background-color:var(--st-blue-100);--st-header-background-color:var(--st-blue-200);--st-header-label-color:var(
8
+ --st-blue-900
9
+ );--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-blue-300);--st-footer-background-color:var(--st-blue-50);--st-cell-color:var(--st-blue-900);--st-cell-odd-row-color:var(--st-blue-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-blue-900);--st-selected-first-cell-color:var(--st-blue-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-blue-200);--st-last-group-row-separator-border-color:var(--st-blue-400);--st-selected-border-top-color:var(--st-blue-600);--st-selected-border-bottom-color:var(--st-blue-600);--st-selected-border-left-color:var(--st-blue-600);--st-selected-border-right-color:var(--st-blue-600);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-blue-50);--st-column-editor-popout-background-color:var(--st-blue-50);--st-button-hover-background-color:var(--st-blue-200);--st-button-active-background-color:var(--st-blue-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-500)}.theme-funky{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:12px;--st-font-size:0.95rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.25s;--st-transition-ease:cubic-bezier(0.4,0,0.2,1);--st-opacity-disabled:0.6;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-stone-100);--st-scrollbar-thumb-color:var(--st-violet-500);--st-border-color:var(--st-stone-200);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(
10
+ --st-white
11
+ );--st-dragging-background-color:var(--st-violet-50);--st-selected-cell-background-color:var(--st-violet-50);--st-selected-first-cell-background-color:var(--st-violet-100);--st-footer-background-color:var(--st-stone-100);--st-cell-color:var(--st-stone-700);--st-cell-odd-row-color:var(--st-stone-700);--st-edit-cell-shadow:0 4px 6px -1px #7c3aed1a,0 2px 4px -1px #7c3aed0f;--st-selected-cell-color:var(--st-violet-800);--st-selected-first-cell-color:var(--st-violet-800);--st-resize-handle-color:var(--st-violet-400);--st-separator-border-color:var(--st-stone-200);--st-last-group-row-separator-border-color:var(--st-stone-300);--st-selected-border-top-color:var(--st-violet-500);--st-selected-border-bottom-color:var(--st-violet-500);--st-selected-border-left-color:var(--st-violet-500);--st-selected-border-right-color:var(--st-violet-500);--st-checkbox-checked-background-color:var(--st-violet-500);--st-checkbox-checked-border-color:var(--st-violet-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-violet-50);--st-button-active-background-color:var(--st-violet-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-violet-500)}.simple-table-root,.st-cell,.st-column-editor,.st-column-editor-popout,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-table-body-container,.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right,.st-table-content,.st-table-wrapper,.st-table-wrapper-container,.st-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:sans-serif;font-family:var(--st-font-family,sans-serif)}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-table-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-table-wrapper,.st-table-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-table-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-table-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-header-container,.st-table-content{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{overflow:auto;scrollbar-width:none;width:100%}.st-header-main::-webkit-scrollbar{display:none}.st-table-body-container{background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content}.st-table-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-body-main{overflow:auto;scrollbar-width:none}.st-table-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-row{display:grid;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:background .2s ease;transition:background .2s ease;width:100%}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-label.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-header-label.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-header-label.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell-content,.st-header-label{-webkit-box-flex:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label{color:var(--st-header-label-color);padding-right:var(--st-cell-padding)}.st-cell-content{color:var(--st-cell-color);padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-cell-even-row{background-color:var(--st-even-row-background-color)}.st-cell-odd-row:not(.st-cell-selected){background-color:var(--st-odd-row-background-color);color:var(--st-cell-odd-row-color)}.st-cell:not(.st-cell-odd-row):not(.st-cell-selected){color:var(--st-cell-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color);border-left:var(--st-border-width) solid var(--st-selected-border-left-color);border-right:var(--st-border-width) solid var(--st-selected-border-right-color);color:var(--st-selected-first-cell-color)}.st-cell-selected-first,.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-top-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-left-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-right-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{background-color:var(--st-scrollbar-bg-color);height:100%}.st-horizontal-scrollbar-middle{overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);-webkit-box-sizing:border-box;box-sizing:border-box;font-size:var(--st-font-size);height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-small);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-column-editor-popout.open{width:200px}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium)}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}
@@ -10,6 +10,7 @@ type HeaderObject = {
10
10
  row: Row;
11
11
  }) => ReactNode | string;
12
12
  children?: HeaderObject[];
13
+ disableReorder?: boolean;
13
14
  expandable?: boolean;
14
15
  hide?: boolean;
15
16
  isEditable?: boolean;
@@ -1,2 +1,2 @@
1
- type Theme = "custom" | "dark" | "desert" | "forest" | "high-contrast" | "light" | "ocean" | "pastel" | "solarized-dark" | "solarized-light" | "vibrant" | "bubblegum" | "90s";
1
+ type Theme = "light" | "dark" | "sky" | "funky" | "neutral";
2
2
  export default Theme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "0.7.53",
3
+ "version": "0.7.56",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,12 +32,10 @@
32
32
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
33
33
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
34
34
  },
35
- "dependencies": {
35
+ "devDependencies": {
36
36
  "@storybook/addon-a11y": "^8.6.2",
37
37
  "@storybook/addon-controls": "^8.6.2",
38
- "@storybook/addon-docs": "^8.6.2"
39
- },
40
- "devDependencies": {
38
+ "@storybook/addon-docs": "^8.6.2",
41
39
  "@babel/preset-react": "^7.25.7",
42
40
  "@chromatic-com/storybook": "^1.9.0",
43
41
  "@rollup/plugin-node-resolve": "^15.3.0",