simple-table-core 0.8.31 → 0.8.33

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,9 +1,4 @@
1
1
  import { FC, PropsWithChildren } from "react";
2
2
  export interface ScrollSyncProps {
3
- /**
4
- * Callback fired after panes are synchronized.
5
- * Receives the scrolled HTMLElement as an argument.
6
- */
7
- onSync?: (el: HTMLElement) => void;
8
3
  }
9
4
  export declare const ScrollSync: FC<PropsWithChildren<ScrollSyncProps>>;
@@ -1,23 +1,7 @@
1
- import { FC, ReactElement, RefCallback, RefObject } from "react";
2
- export interface ScrollSyncPaneProps {
3
- /**
4
- * Optionally attach scroll sync to an external HTMLElement ref or callback.
5
- * If provided, the pane will sync scroll with this element instead of the child.
6
- */
7
- attachTo?: RefCallback<HTMLElement> | RefObject<HTMLElement>;
8
- /**
9
- * The scrollable child element to be synchronized.
10
- */
1
+ import { FC, ReactElement, RefObject } from "react";
2
+ interface ScrollSyncPaneProps {
3
+ childRef: RefObject<HTMLElement | null>;
11
4
  children: ReactElement<any>;
12
- /**
13
- * Group or groups this pane belongs to for scroll synchronization.
14
- * Panes in the same group will sync scroll positions.
15
- * @default 'default'
16
- */
17
- group?: string | string[];
18
- /**
19
- * Ref or callback to access the underlying HTMLElement of the pane.
20
- */
21
- innerRef?: RefCallback<HTMLElement> | RefObject<HTMLElement>;
22
5
  }
23
6
  export declare const ScrollSyncPane: FC<ScrollSyncPaneProps>;
7
+ export {};
@@ -3,6 +3,7 @@ import HeaderObject from "../types/HeaderObject";
3
3
  import OnSortProps from "../types/OnSortProps";
4
4
  import Cell from "../types/Cell";
5
5
  import CellValue from "../types/CellValue";
6
+ import { Theme } from "..";
6
7
  export interface CellRegistryEntry {
7
8
  updateContent: (newValue: CellValue) => void;
8
9
  }
@@ -49,6 +50,7 @@ interface TableContextType {
49
50
  sortDownIcon?: ReactNode;
50
51
  sortUpIcon?: ReactNode;
51
52
  tableBodyContainerRef: RefObject<HTMLDivElement | null>;
53
+ theme: Theme;
52
54
  useHoverRowBackground?: boolean;
53
55
  useOddColumnBackground?: boolean;
54
56
  useOddEvenRowBackground?: boolean;
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useCallback as a,useEffect as c,useMemo as d,createContext as l,useContext as s,forwardRef as u,useLayoutEffect as h,Fragment as f,cloneElement as v,useReducer as m,createRef as g}from"react";var p=function(){return p=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)};function w(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function c(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}d((r=r.apply(e,n||[])).next())}))}function C(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(d){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,d])}}}function I(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var x=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},y=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},b=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},R=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return R(e)})):[e]},M=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(x({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},E=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(x({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){E(e)}))},S=function(e){return"number"==typeof e.minWidth?e.minWidth:40},k=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},W=l(void 0),D=function(n){var t=n.children,r=n.value;return e(W.Provider,p({value:r},{children:t}))},H=function(){var e=s(W);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},N=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,c=t.onNextPage,d=t.shouldPaginate,l=t.totalPages,s=H(),u=s.nextIcon,h=s.prevIcon,f=o(!0),v=f[0],m=f[1],g=!(r>1),I=!(r<l)&&!c||!v&&r===l;if(i||!d)return null;var x=function(){if(l<=15)return Array.from({length:l},(function(e,n){return n+1}));var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=l-Math.floor(7.5))e=Math.max(1,l-o+1),n=l;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<l-1&&(t.push(-1),t.push(l)),t}();return n("div",p({className:"st-footer"},{children:[e("button",p({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:h})),e("button",p({className:"st-next-prev-btn ".concat(I?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,(function(){var e,n;return C(this,(function(t){switch(t.label){case 0:return e=r===l,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return m(!1),[2];t.label=2;case 2:return(n<=l||c)&&a(n),[2]}}))}))},disabled:I},{children:u})),x.map((function(n,t){return n<0?e("span",p({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",p({onClick:function(){return function(e){e>=1&&e<=l&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},L=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},B=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},T=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},O=function(e){return e.position*(e.rowHeight+1)-1},P=function(e){return e.position*(e.rowHeight+1)},F=function(n){var t=n.children,r=n.onClose,a=n.open,d=n.setOpen,l=n.width,s=n.containerRef,u=H(),h=null==u?void 0:u.mainBodyRef,f=i(null),v=i(null),m=o("bottom-left"),g=m[0],w=m[1],C=o({}),I=C[0],x=C[1],y=o(!1),b=y[0],R=y[1];return c((function(){a&&f.current?(R(!1),!v.current&&f.current.parentElement&&(v.current=f.current.parentElement),requestAnimationFrame((function(){if(f.current&&v.current){var e,n=f.current,t=v.current.getBoundingClientRect(),r=n.offsetHeight,o=l||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==h?void 0:h.current)?h.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,c="bottom",d={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var u="left";o>e.right-t.right+t.width&&(u="right"),"bottom"===c?d.top=t.bottom+4:d.bottom=window.innerHeight-t.top+4,"left"===u?d.left=t.left:d.right=window.innerWidth-t.right,w("".concat(c,"-").concat(u)),x(d),R(!0)}}))):a||R(!1)}),[a,l,s,h]),c((function(){var e=function(e){if(a&&f.current){var n=e.target;f.current&&!f.current.contains(n)&&(d(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,r,d]),c((function(){var e=function(e){f.current&&!f.current.contains(e.target)&&(d(!1),null==r||r())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[r,a,d]),c((function(){var e=function(e){"Escape"===e.key&&a&&(d(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,a,d]),a?e("div",p({ref:f,className:"st-dropdown-content st-dropdown-".concat(g),style:p({width:l?"".concat(l,"px"):"auto",visibility:b?"visible":"hidden"},I)},{children:t})):null},A=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,c=void 0!==a&&a,d=n.className,l=void 0===d?"":d;return e("div",p({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(c?"disabled":""," ").concat(l),onClick:function(){!c&&r&&r()},role:"option","aria-selected":i,"aria-disabled":c},{children:t}))},z=function(t){var r=t.onBlur,i=t.onChange,a=t.open,d=t.setOpen,l=t.value,s=o(l),u=s[0],h=s[1];c((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var f=function(e){h(e),i(e),d(!1),r()};return n(F,p({open:a,onClose:function(){r()},setOpen:d,width:120},{children:[e(A,p({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(A,p({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},j=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)}})},U=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)}})},Y=function(r){var i,a,c=r.value,d=r.onChange,l=r.onClose,s=H(),u=s.nextIcon,h=s.prevIcon,f=o(c||new Date),v=f[0],m=f[1],g=o("days"),w=g[0],C=g[1],I=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",p({className:"st-datepicker"},{children:[n("div",p({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",p({onClick:function(){m(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),n("div",p({className:"st-datepicker-header-label",onClick:function(){return C("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",p({onClick:function(){m(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===w&&e("div",p({className:"st-datepicker-header-label",onClick:function(){return C("years")}},{children:v.getFullYear()})),"years"===w&&e("div",p({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",p({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=I(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=I(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach((function(t,r){n.push(e("div",p({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))}));for(var s=function(t){var r=a-i+t+1;n.push(e("div",p({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);m(n),d(n),null==l||l()}(r)}},{children:r}),"prev-".concat(r)))},u=0;u<i;u++)s(u);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(c).getDate()&&r===new Date(c).getMonth()&&t===new Date(c).getFullYear();n.push(e("div",p({className:"st-datepicker-day ".concat(i?"today":""," ").concat(a?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);m(n),d(n),null==l||l()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var g=35-(i+o),w=function(t){n.push(e("div",p({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);m(n),d(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=g;f++)w(f);return n}(),"months"===w&&(i=[],Array.from({length:12},(function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})})).forEach((function(n,t){var r=t===v.getMonth();i.push(e("div",p({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){m(new Date(v.getFullYear(),e,1)),C("days")}(t)}},{children:n}),"month-".concat(t)))})),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",p({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){m(new Date(e,v.getMonth(),1)),C("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",p({className:"st-datepicker-footer"},{children:e("button",p({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;m(e),d(e),null==l||l()}},{children:"Today"}))}))]}))},q=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.setOpen,d=n.value,l=o(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(d)),s=l[0],u=l[1];c((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){t()};return e(F,p({open:i,onClose:h,setOpen:a,width:280},{children:e(Y,{value:s,onChange:function(e){u(e),r(e.toISOString()),a(!1),t()},onClose:h})}))},J=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,d=n.setOpen,l=n.value,s=o(l||""),u=s[0],h=s[1];c((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e(F,p({open:i,onClose:function(){t()},setOpen:d,width:150},{children:e("div",p({className:"st-enum-dropdown-content"},{children:a.map((function(n){return e(A,p({isSelected:u===n,onClick:function(){return h(e=n),r(e),d(!1),void t();var e}},{children:n}),n)}))}))}))},X=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,d=n.value,l=function(){i(!1)};if("boolean"===c&&"boolean"==typeof d)return e(z,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:d});if("date"===c)return e(q,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:"string"==typeof d?d:""});if("enum"===c)return e(J,{onBlur:l,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:"string"==typeof d?d:""});if("number"===c&&"number"==typeof d)return e(U,{defaultValue:d,onBlur:l,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var s=null==d?"":String(d);return e(j,{defaultValue:s,onBlur:l,onChange:function(e){return o(e)}})},V=0,K=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===V||o-V>=r)&&(V=o,n(t))}},G=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(G);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=G(e[t]));return n},$=Date.now(),_={screenX:0,screenY:0},Q=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return I(I([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Q(o.children,n,I(I([],t,!0),[r],!1));if(i)return i}}return null};var Z=function(e){var n,t,r=e.draggedHeaderRef,o=e.headersRef,a=e.hoveredHeaderRef,d=e.onColumnOrderChange,l=e.onTableHeaderDragEnd,s=(n=o.current,t=i(n),c((function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)}),[n]),t.current);return{handleDragStart:function(e){r.current=e,$=Date.now()},handleDragOver:function(e){var n,t,i=e.event,c=e.hoveredHeader;if(i.preventDefault(),o.current){var d=i.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=i.screenX,h=i.screenY,f=Math.sqrt(Math.pow(u-_.screenX,2)+Math.pow(h-_.screenY,2));a.current=c;var v=o.current,m=Q(v,(null===(n=r.current)||void 0===n?void 0:n.accessor)||""),g=Q(v,c.accessor);if(m&&g){var p=m.length,w=g.length,C=g;if(p!==w){var I=w-p;I>0&&(C=g.slice(0,-I))}var x=function(e,n,t){var r=G(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,C),y=x.newHeaders,b=x.emergencyBreak;if(!(d||c.accessor===(null===(t=r.current)||void 0===t?void 0:t.accessor)||null===r.current||f<10||0===m.length||0===C.length||JSON.stringify(y)===JSON.stringify(o.current)||b)){var R=Date.now();JSON.stringify(y)===JSON.stringify(s)&&(R-$<1500||f<40)||($=R,_={screenX:u,screenY:h},l(y))}}}},handleDragEnd:function(){r.current=null,a.current=null,null==d||d(o.current)}}},ee=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ne=u((function(t,r){var d,l,s=t.borderClass,u=t.colIndex,h=t.header,f=t.isHighlighted,v=t.isInitialFocused,m=t.nestedIndex,g=t.onExpandRowClick,w=t.rowIndex,C=t.visibleRow,I=H(),y=I.cellRegistry,R=I.cellUpdateFlash,M=I.collapseIcon,E=I.draggedHeaderRef,S=I.expandIcon,k=I.handleMouseDown,W=I.handleMouseOver,D=I.headersRef,N=I.hoveredHeaderRef,L=I.onCellEdit,B=I.onTableHeaderDragEnd,T=I.useOddColumnBackground,O=C.depth,P=C.row,F=o(P.rowData[h.accessor]),A=F[0],z=F[1],j=o(!1),U=j[0],Y=j[1],q=o(!1),J=q[0],V=q[1],G=i(null),$=Z({draggedHeaderRef:E,headersRef:D,hoveredHeaderRef:N,onTableHeaderDragEnd:B}).handleDragOver,_=K(),Q="cell-".concat(w,"-").concat(u),ne=b({rowId:P.rowMeta.rowId,accessor:h.accessor});c((function(){if(y){var e="".concat(P.rowMeta.rowId,"-").concat(h.accessor);return y.set(e,{updateContent:function(e){A!==e?(z(e),R&&(V(!0),G.current&&clearTimeout(G.current),G.current=setTimeout((function(){V(!1)}),800))):z(e)}}),function(){y.delete(e),G.current&&clearTimeout(G.current)}}}),[y,R,P.rowMeta.rowId,h.accessor,A]),c((function(){if(J){var e=setTimeout((function(){V(!1)}),850);return function(){return clearTimeout(e)}}}),[J]),c((function(){z(P.rowData[h.accessor])}),[P.rowData,h.accessor]),c((function(){f||Y(!1)}),[f]);var te="boolean"===h.type||"date"===h.type||"enum"===h.type,re=Boolean(null===(l=null===(d=P.rowMeta)||void 0===d?void 0:d.children)||void 0===l?void 0:l.length),oe=Boolean(null==h?void 0:h.isEditable),ie="st-cell ".concat(O>0&&h.expandable?"st-cell-depth-".concat(O):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(oe?"clickable":""," ").concat(J?"st-cell-updating":""," ").concat(T?m%2==0?"even-column":"odd-column":""),ae=a((function(e){z(e),null==L||L({accessor:h.accessor,newValue:e,row:P})}),[h.accessor,L,P]);return U&&!te?e("div",p({className:"st-cell-editing",id:x({accessor:h.accessor,rowIndex:w+1})},{children:e(X,{enumOptions:h.enumOptions,onChange:ae,setIsEditing:Y,type:h.type,value:A})})):n("div",p({className:ie,id:Q,onDoubleClick:function(){return h.isEditable&&Y(!0)},onMouseDown:function(){return k({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onMouseOver:function(){return W({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onDragOver:function(e){return _({callback:$,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||U||(e.preventDefault(),Y(!0))},ref:r,"data-row-index":w,"data-col-index":u,"data-row-id":P.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&re?P.rowMeta.isExpanded?e("div",p({className:"st-sort-icon-container",onClick:function(){return g(P.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:M})):e("div",p({className:"st-sort-icon-container",onClick:function(){return g(P.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:S})):null,e("span",p({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:e("span",{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:P}):ee({content:A,header:h})})})),U&&te&&e(X,{enumOptions:h.enumOptions,onChange:ae,setIsEditing:Y,type:h.type,value:A})]}),ne)})),te=function(n){var r=n.children,o=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children"]);return H().allowAnimations?e(re,p({},o,{children:r})):e(t,{children:r})},re=function(n){var r=n.children,a=n.isBody,d=n.pauseAnimation,l=n.rowIndex,s=i(!1),u=H(),f=u.draggedHeaderRef,v=u.headersRef,m=u.mainBodyRef,g=u.shouldPaginate,p=o({}),w=p[0],C=p[1],I=i({}),y=v.current;return h((function(){if(y){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(x({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),c=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=c}}})),o}({currentHeaders:y,draggedHeaderRef:f,rowIndex:l});JSON.stringify(e)!==JSON.stringify(w)&&(I.current=w,C(e))}}),[w,y,f,a,l]),h((function(){var e=m.current,n=function(){s.current=!0},t=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[f,m]),c((function(){d||s.current||Object.keys(I.current).length&&y&&y.forEach((function(e){var n=document.getElementById(x({accessor:e.accessor,rowIndex:l}));if(n){var t=I.current[e.accessor],r=w[e.accessor];if(t&&r){var o=t.left-r.left,i=g?0:t.top-r.top,a=Math.abs(o),c=Math.abs(i);(a>10||c>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")}))}))}}}))}),[w,y,a,d,I,l,g]),e(t,{children:r})},oe=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,c=n.onExpandRowClick,d=n.pinned,l=n.rowIndex,s=n.rowIndices,u=n.visibleRow,h=o.filter((function(e){return y({hiddenColumns:i,header:e,pinned:d})}));return e(te,p({isBody:!0,pauseAnimation:a,rowIndex:l+1},{children:h.map((function(n,a){return e(ie,{columnIndices:r,header:n,headers:o,hiddenColumns:i,nestedIndex:a+(null!=t?t:0),onExpandRowClick:c,pinned:d,rowIndex:l,rowIndices:s,visibleRow:u},x({accessor:n.accessor,rowIndex:l+1}))}))}))},ie=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.hiddenColumns,a=n.nestedIndex,c=n.onExpandRowClick,d=n.pinned,l=n.rowIndex,s=n.rowIndices,u=n.visibleRow,h=t[r.accessor],v=H(),m=v.getBorderClass,g=v.isSelected,p=v.isInitialFocusedCell;if(r.children){var w=r.children.filter((function(e){return y({hiddenColumns:i,header:e,pinned:d})}));return e(f,{children:w.map((function(n){return e(ie,{columnIndices:t,header:n,headers:o,hiddenColumns:i,nestedIndex:a,onExpandRowClick:c,pinned:d,rowIndex:l,rowIndices:s,visibleRow:u},x({accessor:n.accessor,rowIndex:l+1}))}))})}var C={rowIndex:l,colIndex:h,rowId:u.row.rowMeta.rowId},I=m(C),b=g(C),R=p(C);return e(ne,{borderClass:I,colIndex:h,header:r,isHighlighted:b,isInitialFocused:R,nestedIndex:a,onExpandRowClick:c,rowIndex:l,visibleRow:u},x({accessor:r.accessor,rowIndex:l+1}))},ae=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,c=n.hoveredIndex,d=n.index,l=n.isWidthDragging,s=n.onExpandRowClick,u=n.pinned,h=n.rowHeight,f=n.rowIndices,v=n.setHoveredIndex,m=n.visibleRow,g=H().useHoverRowBackground,w=m.position;return e("div",p({className:"st-row ".concat(w%2==0?"even":"odd"," ").concat(c===d&&g?"hovered":""),onMouseEnter:function(){v(d)},style:{gridTemplateColumns:o,top:P({position:w,rowHeight:h}),height:"".concat(h,"px")}},{children:e(oe,{columnIndexStart:r,columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:l,onExpandRowClick:s,pinned:u,rowIndex:d,rowIndices:f,visibleRow:m},d)}))},ce=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,i=n.templateColumns;return e("div",p({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:O({position:r,rowHeight:o}),minWidth:"100%"}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},de=l(void 0),le=function(e){return Array.isArray(e)?e:[e]},se=function(e){var n=e.attachTo,t=e.children,r=e.group,o=void 0===r?"default":r,d=e.innerRef,l=function(){var e=s(de);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),u=i(null),h=i(null),f=a((function(){h.current=n?"function"==typeof n?null:n.current:u.current}),[n]);return c((function(){return f(),h.current&&l.registerPane(h.current,le(o)),function(){h.current&&l.unregisterPane(h.current,le(o))}}),[l,o,n,f]),n?t:v(t,{ref:function(e){u.current=e,"function"==typeof d?d(e):d&&e&&(d.current=e)}})},ue=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},he=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,a=t.hiddenColumns,c=t.hoveredIndex,d=t.isWidthDragging,l=t.onExpandRowClick,s=t.pinned,u=t.ref,h=t.rowHeight,v=t.rowIndices,m=t.setHoveredIndex,g=t.templateColumns,w=t.totalHeight,C=t.visibleRows,I=t.width,x=s?"st-body-pinned-".concat(s):"st-body-main";return e(ue,p({condition:!s,wrapper:function(n){return e(se,{children:n})}},{children:e("div",p({className:x,ref:u,id:u?"testss":void 0,style:p({position:"relative",height:"".concat(w,"px"),width:I},!s&&{flexGrow:1})},{children:C.map((function(t,u){var p,w,I=C[u-1],x=Boolean((null==I?void 0:I.depth)!==(null==t?void 0:t.depth)&&(null===(w=null===(p=null==t?void 0:t.row.rowMeta)||void 0===p?void 0:p.children)||void 0===w?void 0:w.length)&&0===t.depth);return n(f,{children:[0!==u&&e(ce,{displayStrongBorder:x,position:t.position,rowHeight:h,templateColumns:g}),e(ae,{columnIndexStart:r,columnIndices:o,gridTemplateColumns:g,headers:i,hiddenColumns:a,hoveredIndex:c,index:u,isWidthDragging:d,onExpandRowClick:l,pinned:s,rowHeight:h,rowIndices:v,setHoveredIndex:m,visibleRow:t})]},t.position)}))}))}))};function fe(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,c=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 y({hiddenColumns:t,header:e})})).forEach((function(e,n){c(e,0===n)}))};return r.forEach((function(e,n){c(e,0===n)})),n.current.filter((function(e){return!e.pinned&&y({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;c(e,t)})),o.forEach((function(e){c(e,!1)})),i}var ve=function(t){var r=t.flattenedRows,a=t.headerContainerRef,l=t.isWidthDragging,s=t.mainTemplateColumns,u=t.pinnedLeftColumns,h=t.pinnedLeftTemplateColumns,f=t.pinnedLeftWidth,v=t.pinnedRightColumns,m=t.pinnedRightTemplateColumns,g=t.pinnedRightWidth,w=t.setFlattenedRows,C=t.setScrollTop,I=t.visibleRows,x=H(),y=x.headersRef,b=x.hiddenColumns,R=x.mainBodyRef,M=x.rowHeight,E=x.scrollbarWidth,S=x.tableBodyContainerRef,k=o(null),W=k[0],D=k[1];!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],d=i[1];c((function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,a,r]),c((function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(r),function(){r&&i.unobserve(r)}}}),[n,t])}({headerContainerRef:a,mainSectionRef:S,scrollbarWidth:E});var N,L,B=i(null),T=(N=0,(L=function(e){e.forEach((function(e){N+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&L(e.rowMeta.children)}))})(r),N)*(M+1)-1,O=d((function(){return fe({headersRef:y,hiddenColumns:b,pinnedLeftColumns:u,pinnedRightColumns:v})}),[y,b,u,v]),P=d((function(){var e={};return I.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[I]),F=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?p(p({},t),{rowMeta:p(p({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?p(p({},t),{rowMeta:p(p({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};w((function(e){return e.map(n)}))},A={columnIndices:O,headerContainerRef:a,headers:y.current,hiddenColumns:b,hoveredIndex:W,isWidthDragging:l,rowHeight:M,rowIndices:P,setHoveredIndex:D,visibleRows:I};return n("div",p({className:"st-body-container",onMouseLeave:function(){return D(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame((function(){C(n)}))},ref:S},{children:[u.length>0&&e(he,p({},A,{onExpandRowClick:F,pinned:"left",templateColumns:h,totalHeight:T,width:f})),e(he,p({},A,{columnIndexStart:u.length,onExpandRowClick:F,ref:R,templateColumns:s,totalHeight:T})),v.length>0&&e(he,p({},A,{columnIndexStart:u.length+s.length,onExpandRowClick:F,pinned:"right",templateColumns:m,totalHeight:T,width:g}))]}))},me=function(e){return void 0===e&&(e=0),e?e+1:0},ge=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:R(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=M(e))})))})),n.pinned?me(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},pe=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,d=e.setMainBodyWidth,l=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;c(!0),n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,f="touches"in n;if(i&&!i.hide){var v=S(i),m=r-o>1,g=m?R(i):[i],p=function(e){var n="right"===i.pinned?h-e:e-h;if(m&&g.length>1)we({delta:n,header:i,headersRef:a,leafHeaders:g,minWidth:v,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s,startWidth:u});else{var r=Math.max(u+n,v);i.width=r,ge({header:i,headers:a.current,newWidth:r,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s})}a.current.forEach((function(e){E(e)})),t()};if(f){var w=function(e){var n=e.touches[0];p(n.clientX)},C=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",C),c(!1)};document.addEventListener("touchmove",w),document.addEventListener("touchend",C)}else{var I=function(e){p(e.clientX)},x=function(){document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",x),c(!1)};document.addEventListener("mousemove",I),document.addEventListener("mouseup",x)}}},we=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,d=e.setPinnedRightWidth,l=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,S(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(l+n,s);ge({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:d});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},Ce=u((function(t,r){var o,i,a=t.colIndex,d=t.forceHeadersUpdate,l=t.gridColumnEnd,s=t.gridColumnStart,u=t.gridRowEnd,h=t.gridRowStart,f=t.header,v=t.reverse,m=t.sort,g=H(),w=g.columnReordering,C=g.columnResizing,y=g.draggedHeaderRef,b=g.forceUpdate,R=g.headersRef,M=g.hoveredHeaderRef,E=g.onColumnOrderChange,S=g.onSort,k=g.onTableHeaderDragEnd,W=g.rowHeight,D=g.selectColumns,N=g.selectableColumns,L=g.setInitialFocusedCell,B=g.setIsWidthDragging,T=g.setMainBodyWidth,O=g.setPinnedLeftWidth,P=g.setPinnedRightWidth,F=g.setSelectedCells,A=g.setSelectedColumns,z=g.sortDownIcon,j=g.sortUpIcon,U=Boolean(null==f?void 0:f.isSortable),Y="st-header-cell ".concat(f.accessor===(null===(o=M.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=y.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(U?"clickable":""," ").concat(w&&!U?"columnReordering":""," ").concat(f.children?"parent":""),q=Z({draggedHeaderRef:y,headersRef:R,hoveredHeaderRef:M,onColumnOrderChange:E,onTableHeaderDragEnd:k}),J=q.handleDragStart,X=q.handleDragEnd,V=q.handleDragOver,G=K(),$=function(e){var n=e.event,t=e.header;if(N){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,a);return n.shiftKey&&D?A((function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort((function(e,n){return e-n})),o=t[0],i=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)}));var a,c,d,l,s=I(I([],(a=o,c=n,d=Math.min(a,c),l=Math.max(a,c),Array.from({length:l-d+1},(function(e,n){return d+n}))),!0),r,!0);return new Set(I(I([],Array.from(e),!0),s,!0))})):D&&D(r),F(new Set),void L(null)}t.isSortable&&S(a,t.accessor)};if(c((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 _=C&&e("div",p({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;G({callback:pe,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:l,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:B,setMainBodyWidth:T,setPinnedLeftWidth:O,setPinnedRightWidth:P,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;G({callback:pe,callbackProps:{event:e,forceUpdate:b,gridColumnEnd:l,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:B,setMainBodyWidth:T,setPinnedLeftWidth:O,setPinnedRightWidth:P,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),Q=m&&m.key.accessor===f.accessor&&n("div",p({className:"st-sort-icon-container",onClick:function(e){return $({event:e,header:f})}},{children:["ascending"===m.direction&&j&&j,"descending"===m.direction&&z&&z]}));return n("div",p({className:Y,id:x({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){G({callback:V,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:r,style:p(p({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:l},l-s>1?{}:{width:f.width}),u-h>1?{}:{height:W})},{children:[v&&_,"right"===f.align&&Q,e("div",p({className:"st-header-label",draggable:w&&!f.disableReorder,onClick:function(e){return $({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),X(),d()},onDragStart:function(e){w&&f&&function(e){J(e)}(f)}},{children:e("span",p({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:null==f?void 0:f.label}))})),"right"!==f.align&&Q,!v&&_]}))})),Ie=function(n){var t=n.columnIndices,r=n.gridTemplateColumns,o=n.handleScroll,i=n.headersRef,a=n.hiddenColumns,c=n.maxDepth,l=n.pinned,s=n.sectionRef,u=n.sort,h=m((function(e){return e+1}),0)[1],f=d((function(){var e=[],n=1,r=function(o,i,d){var s,u;if(void 0===d&&(d=!1),!y({hiddenColumns:a,header:o,pinned:l}))return 0;d||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return y({hiddenColumns:a,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,m=i,g=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:m,gridRowEnd:g,colIndex:t[o.accessor]}),o.children){var p=!0;o.children.forEach((function(e){y({hiddenColumns:a,header:e,pinned:l})&&(r(e,i+1,p),p=!1)}))}return v-f},o=i.current.filter((function(e){return y({hiddenColumns:a,header:e,pinned:l})})),d=!0;return o.forEach((function(e){r(e,1,d),d=!1})),e}),[i,a,c,l,t]);return e(ue,p({condition:!l,wrapper:function(n){return e(se,{children:n})}},{children:e("div",p({className:"st-header-".concat(l?"pinned-".concat(l):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:r,display:"grid",position:"relative"}},{children:e(te,p({rowIndex:0},{children:f.map((function(n){return e(Ce,{colIndex:n.colIndex,forceHeadersUpdate:h,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:g(),reverse:"right"===l,sort:u},n.header.accessor)}))}))}))}))},xe=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(xe)):1},ye=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headersRef,a=t.hiddenColumns,c=t.mainTemplateColumns,l=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.sort,m=H(),g=m.pinnedLeftRef,w=m.pinnedRightRef,C=m.setPinnedLeftWidth,I=m.setPinnedRightWidth,x=d((function(){return fe({headersRef:i,hiddenColumns:a,pinnedLeftColumns:l,pinnedRightColumns:u})}),[i,a,l,u]),b=d((function(){var e=i.current,n=0;return e.forEach((function(e){if(y({hiddenColumns:a,header:e})){var t=xe(e);n=Math.max(n,t)}})),{maxDepth:n}}),[i,a]).maxDepth;return h((function(){var e,n;C(me(null===(e=g.current)||void 0===e?void 0:e.clientWidth)),I(me(null===(n=w.current)||void 0===n?void 0:n.clientWidth))}),[g,w,C,I]),n("div",p({className:"st-header-container",ref:o},{children:[l.length>0&&e(Ie,{columnIndices:x,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:b,pinned:"left",sectionRef:g,sort:v}),e(Ie,{columnIndices:x,gridTemplateColumns:c,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:b,sectionRef:r,sort:v}),u.length>0&&e(Ie,{columnIndices:x,gridTemplateColumns:f,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:b,pinned:"right",sectionRef:w,sort:v})]}))},be=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},Re=function(t){var r=t.flattenedRows,o=t.isWidthDragging,a=t.pinnedLeftWidth,c=t.pinnedRightWidth,l=t.setFlattenedRows,s=t.setScrollTop,u=t.sort,h=t.visibleRows,f=H(),v=f.columnResizing,m=f.editColumns,g=f.headersRef,w=f.hiddenColumns,C=i(null),I=i(null),x=g.current.filter((function(e){return!e.pinned})),y=g.current.filter((function(e){return"left"===e.pinned})),b=g.current.filter((function(e){return"right"===e.pinned})),R=d((function(){return be({headers:y,hiddenColumns:w})}),[y,w]),M=d((function(){return be({headers:x,hiddenColumns:w})}),[x,w]),E=d((function(){return be({headers:b,hiddenColumns:w})}),[b,w]),S={centerHeaderRef:I,headerContainerRef:C,headersRef:g,hiddenColumns:w,mainTemplateColumns:M,pinnedLeftColumns:y,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightTemplateColumns:E,sort:u},k={flattenedRows:r,headerContainerRef:C,isWidthDragging:o,mainTemplateColumns:M,pinnedLeftColumns:y,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:b,pinnedRightTemplateColumns:E,pinnedRightWidth:c,setFlattenedRows:l,setScrollTop:s,visibleRows:h};return n("div",p({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:m?"calc(100% - 27.5px)":"100%"}},{children:[e(ye,p({},S)),e(ve,p({},k))]}))},Me=function(t){var r,a,d=t.mainBodyWidth,l=t.mainBodyRef,s=t.pinnedLeftWidth,u=t.pinnedRightWidth,h=t.setMainBodyWidth,f=t.tableBodyContainerRef,v=H().editColumns,m=o(!1),g=m[0],w=m[1],C=i(null),I=f.current&&f.current.scrollHeight>f.current.clientHeight,x=v?28:0,y=(v?u+1:u)+(f.current&&I?f.current.offsetWidth-f.current.clientWidth:0);return c((function(){setTimeout((function(){var e,n;e=document.getElementById("testss"),n=null==e?void 0:e.scrollWidth,console.log(n),e&&h(n||0)}),1)}),[l,h]),c((function(){setTimeout((function(){!function(){var e=document.getElementById("testss");if(e){var n=e.clientWidth;w(d>n)}}()}),1)}),[l,d,h]),g?n("div",p({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(r=C.current)||void 0===r?void 0:r.offsetHeight}}),d>0&&e(se,{children:e("div",p({className:"st-horizontal-scrollbar-middle",ref:C,style:{flexGrow:1}},{children:e("div",{style:{width:d,height:".3px"}})}))}),u>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:y,height:null===(a=C.current)||void 0===a?void 0:a.offsetHeight}}),x>0&&e("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},Ee={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return Ee.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?Ee.string(e,n,t):"number"==typeof e&&"number"==typeof n?Ee.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Ee.boolean(e,n,t):Ee.string(String(e),String(n),t)}},Se=function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return Ee.number(i,a,r)}return"date"===t?Ee.date(String(e),String(n),r):"boolean"===t?Ee.boolean(Boolean(e),Boolean(n),r):"enum"===t?Ee.enum(String(e),String(n),r):Ee.string(String(e),String(n),r)},ke=function(e,n,t){var r,o=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",i=n.direction,a=new Map,c=new Map,d="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(a.size)).toString();d=r,c.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===(t=a.get(i))||void 0===t||t.push(e)}}));var l=[];return a.forEach((function(e,r){if(c.has(r)){var a=c.get(r);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=We(a.rowMeta.children,n,t)),l.push(a)}var d=I([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return Se(a,c,o,i)}));l.push.apply(l,d.map((function(e){var r=p({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var o=We(r.rowMeta.children,n,t);r.rowMeta=p(p({},r.rowMeta),{children:o})}return r})))})),l},We=function(e,n,t){var r=t.find((function(e){return e.accessor===n.key.accessor})),o=(null==r?void 0:r.type)||"string",i=n.direction;return I([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return Se(a,c,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?p(p({},e),{rowMeta:p(p({},e.rowMeta),{children:We(e.rowMeta.children,n,t)})}):e}))},De=function(e){var n=e.headers,t=e.tableRows,r=o(null),i=r[0],a=r[1],c=d((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),l=o(c),s=l[0],u=l[1],h=d((function(){if(!i)return t;var e=function(e,n,t){return{sortedData:ke(n,t,e),newSortConfig:t}}(n,t,i).sortedData;return e}),[t,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,t){var r=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===t)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(n);o&&a((function(e){return e&&e.key.accessor===t?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},He=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",p({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",p({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e("span",{className:"st-checkbox-checkmark"})})),i]}))},Ne=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),d=!1;if(!c)for(var l=0,s=a.children;l<s.length;l++){var u=s[l];if(Ne([u],n,t,r),!1===t[u.accessor]){d=!0;break}}(c||d)&&(t[a.accessor]=!1)}}},Le=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},Be=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(Be(e.children,n),Le(e.children,n)&&(n[e.accessor]=!0))}))},Te=function(r){var i=r.allHeaders,a=r.depth,c=void 0===a?0:a,d=r.header,l=r.hiddenColumns,s=r.setHiddenColumns,u=o(!0),h=u[0],f=u[1],v=H(),m=v.expandIcon,g=v.collapseIcon,w=v.headersRef,C=v.setMainBodyWidth,I=v.setPinnedLeftWidth,x=v.setPinnedRightWidth,y="".concat(16*c,"px"),b=d.children&&d.children.length>0,E=l[d.accessor]||b&&d.children&&Le(d.children,l);return n(t,{children:[n("div",p({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[e("div",p({className:"st-header-icon-container"},{children:b?e("div",p({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?g:m})):null})),e(He,p({checked:E,onChange:function(e){var n=p({},l);(n[d.accessor]=e,e)?Be(i,n):(Ne(i,d.accessor,n),b&&d.children&&d.children.length>0&&d.children.every((function(e){return!0===l[e.accessor]}))&&d.children[0]&&(n[d.children[0].accessor]=!1,Ne(i,d.children[0].accessor,n)));s(n),w.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=R(e).reduce((function(e,n){return e+M(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var d=me(i),l=me(a);r(d),o(l),t(c)}({headers:w.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:x})}},{children:d.label}))]})),b&&h&&d.children&&e("div",p({className:"st-nested-headers"},{children:d.children.map((function(n,t){return e(Te,{allHeaders:i,depth:c+1,header:n,hiddenColumns:l,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},Oe=function(n){var t=n.headers,r=n.open,o=n.position,i=n.setHiddenColumns,a=n.hiddenColumns,c="left"===o?"left":"";return e("div",p({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(c),onClick:function(e){return e.stopPropagation()}},{children:e("div",p({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e(Te,{header:n,hiddenColumns:a,setHiddenColumns:i,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},Pe=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,c=t.headers,d=t.hiddenColumns,l=t.position,s=void 0===l?"right":l,u=t.setHiddenColumns,h=o(a),f=h[0],v=h[1];return i?n("div",p({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e("div",p({className:"st-column-editor-text"},{children:r})),e(Oe,{headers:c,open:f,position:s,setHiddenColumns:u,hiddenColumns:d})]})):null},Fe=function(n){var t=n.className;return e("svg",p({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"down-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Ae=function(n){var t=n.className;return e("svg",p({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"up-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},ze=function(n){var t=n.children,o=n.onSync,c=i({}),d=a((function(e,n){return!!c.current[n]&&c.current[n].find((function(n){return n===e}))}),[]),l=a((function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)}),[]),s=a((function(e){e.onscroll=null}),[]),u=a((function(e,n){e.onscroll=function(){window.requestAnimationFrame((function(){n.forEach((function(n){var t;null===(t=c.current[n])||void 0===t||t.forEach((function(n){e!==n&&(s(n),l(e,n),window.requestAnimationFrame((function(){var e=Object.keys(c.current).filter((function(e){return c.current[e].includes(n)}));u(n,e)})))}))}))})),o&&o(e)}}),[o,s,l]),h=a((function(e,n){n.forEach((function(n){c.current[n]||(c.current[n]=[]),d(e,n)||(c.current[n].length>0&&l(c.current[n][0],e),c.current[n].push(e))})),u(e,n)}),[d,l,u]),f=a((function(e,n){n.forEach((function(n){if(d(e,n)){s(e);var t=c.current[n].indexOf(e);-1!==t&&c.current[n].splice(t,1)}}))}),[d,s]);return e(de.Provider,p({value:{registerPane:h,unregisterPane:f}},{children:r.Children.only(t)}))},je=function(n){var t=o(!1),r=t[0],i=t[1];return c((function(){i(!0)}),[]),r?e(Ue,p({},n)):null},Ue=function(t){var r=t.allowAnimations,l=void 0!==r&&r,s=t.cellUpdateFlash,u=void 0!==s&&s,f=t.collapseIcon,v=void 0===f?e(T,{className:"st-sort-icon"}):f,g=t.columnEditorPosition,w=void 0===g?"right":g,C=t.columnEditorText,I=void 0===C?"Columns":C,x=t.columnReordering,y=void 0!==x&&x,M=t.columnResizing,E=void 0!==M&&M,S=t.defaultHeaders,W=t.editColumns,H=void 0!==W&&W,O=t.editColumnsInitOpen,P=void 0!==O&&O,F=t.expandIcon,A=void 0===F?e(B,{className:"st-sort-icon"}):F,z=t.height,j=t.hideFooter,U=void 0!==j&&j,Y=t.nextIcon,q=void 0===Y?e(B,{className:"st-next-prev-icon"}):Y,J=t.onCellEdit,X=t.onColumnOrderChange,V=t.onGridReady,K=t.onNextPage,G=t.prevIcon,$=void 0===G?e(L,{className:"st-next-prev-icon"}):G,_=t.rowHeight,Q=void 0===_?40:_,Z=t.rows,ee=t.rowsPerPage,ne=void 0===ee?10:ee,te=t.selectableCells,re=void 0!==te&&te,oe=t.selectableColumns,ie=void 0!==oe&&oe,ae=t.shouldPaginate,ce=void 0!==ae&&ae,de=t.sortDownIcon,le=void 0===de?e(Fe,{className:"st-sort-icon"}):de,se=t.sortUpIcon,ue=void 0===se?e(Ae,{className:"st-sort-icon"}):se,he=t.tableRef,fe=t.theme,ve=void 0===fe?"light":fe,me=t.useHoverRowBackground,ge=void 0===me||me,pe=t.useOddEvenRowBackground,we=void 0===pe||pe,Ce=t.useOddColumnBackground,Ie=void 0!==Ce&&Ce;Ie&&(we=!1);var xe=i(null),ye=i(S),be=i(null),Ee=i(null),Se=i(null),ke=i(null),We=i(null),He=o(1),Ne=He[0],Le=He[1],Be=o(!1),Te=Be[0],Oe=Be[1],je=o(0),Ue=je[0],Ye=je[1],qe=o(0),Je=qe[0],Xe=qe[1],Ve=o(0),Ke=Ve[0],Ge=Ve[1],$e=o(0),_e=$e[0],Qe=$e[1],Ze=o(0),en=Ze[0],nn=Ze[1],tn=De({headers:ye.current,tableRows:Z}),rn=tn.sort,on=tn.sortedRows,an=tn.hiddenColumns,cn=tn.setHiddenColumns,dn=tn.updateSort;c((function(){null==V||V()}),[V]);var ln=d((function(){if(!ce)return on;var e=(Ne-1)*ne,n=e+ne;return on.slice(e,n)}),[Ne,ne,ce,on]),sn=o(ln),un=sn[0],hn=sn[1];c((function(){hn(ln)}),[ln]);var fn=d((function(){var e;if(!z)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),t=0;if(z.endsWith("px"))t=parseInt(z,10);else if(z.endsWith("vh")){var r=parseInt(z,10);t=window.innerHeight*r/100}else if(z.endsWith("%")){var o=parseInt(z,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-Q)}),[z,Q]),vn=d((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],d=0,l=Math.max(0,i-a*n),s=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=d*a;if(h>=s)break;h+a>l&&c.push({row:i,depth:n,position:d,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),d+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:fn,flattenedRows:un,rowHeight:Q,scrollTop:_e})}),[fn,Q,un,_e]),mn=m((function(e){return e+1}),0)[1],gn=function(e){var n=e.selectableCells,t=e.headers,r=e.visibleRows,l=o(new Set),s=l[0],u=l[1],h=o(new Set),f=h[0],v=h[1],m=o(null),g=m[0],p=m[1],w=o(null),C=w[0],I=w[1],x=i(!1),y=i(null),b=a((function(){var e=t.flatMap(R).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var o=Array.from(s).reduce((function(e,t){var o=t.split("-").map(Number),i=o[0],a=o[1];e[i]||(e[i]=[]);var c=n.get(a);return e[i][a]=c?r[i].row.rowData[c]:"",e}),{}),i=Object.values(o).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(i)}),[t,s,r]),M=a((function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),c=Math.max(e.colIndex,n.colIndex),d=o;d<=i;d++)for(var l=a;l<=c;l++)if(d>=0&&d<r.length){var s=r[d].row.rowMeta.rowId;t.add(k({colIndex:l,rowIndex:d,rowId:s}))}v(new Set),p(null),u(t)}),[r,v,p,u]),E=a((function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<t.length){var n=k(e);v(new Set),p(null),u(new Set([n])),I(e)}}),[t.length,r.length,v,p,u,I]),S=a((function(e,n){void 0===n&&(n=!1),u(new Set),I(null),v((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&p(e[e.length-1])}),[u,I,v,p]);c((function(){var e=function(e){if(n&&C){var o=C.rowIndex,i=C.colIndex,a=C.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(r[o].row.rowMeta.rowId!==a){var c=r.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===c)return;o=c}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var d={rowIndex:o-1,colIndex:i,rowId:r[o-1].row.rowMeta.rowId};E(d)}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(d={rowIndex:o+1,colIndex:i,rowId:r[o+1].row.rowMeta.rowId},E(d))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(d={rowIndex:o,colIndex:i-1,rowId:r[o].row.rowMeta.rowId},E(d))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<t.length-1&&(d={rowIndex:o,colIndex:i+1,rowId:r[o].row.rowMeta.rowId},E(d))):"Escape"===e.key&&(u(new Set),v(new Set),p(null),y.current=null,I(null))}else b()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[b,t.length,C,M,E,n,r]);var W=a((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=k({colIndex:n,rowIndex:t,rowId:r}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),D=a((function(e){var n,t,o,i,a,c,d=e.colIndex,l=e.rowIndex,s=e.rowId,u=[],h=null===(o=null===(t=null===(n=r[l-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===o?void 0:o.rowId,v={colIndex:d,rowIndex:l+1,rowId:null===(c=null===(a=null===(i=r[l+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===c?void 0:c.rowId},m={colIndex:d-1,rowIndex:l,rowId:s},g={colIndex:d+1,rowIndex:l,rowId:s};return(!W({colIndex:d,rowIndex:l-1,rowId:h})||f.has(d)&&0===l)&&u.push("st-selected-top-border"),(!W(v)||f.has(d)&&l===r.length-1)&&u.push("st-selected-bottom-border"),W(m)||u.push("st-selected-left-border"),W(g)||u.push("st-selected-right-border"),u.join(" ")}),[W,r,f]),H=d((function(){return C?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===C.rowIndex&&t===C.colIndex&&r===C.rowId}:function(){return!1}}),[C]);return{getBorderClass:D,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;if(n){x.current=!0,y.current={rowIndex:r,colIndex:t,rowId:o},v(new Set),p(null);var i=k({colIndex:t,rowIndex:r,rowId:o});u(new Set([i])),I({rowIndex:r,colIndex:t,rowId:o})}},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&x.current&&y.current){for(var i=new Set,a=Math.min(y.current.rowIndex,o),c=Math.max(y.current.rowIndex,o),d=Math.min(y.current.colIndex,t),l=Math.max(y.current.colIndex,t),s=a;s<=c;s++)for(var h=d;h<=l;h++)if(s>=0&&s<r.length){var f=r[s].row.rowMeta.rowId;i.add(k({colIndex:h,rowIndex:s,rowId:f}))}u(i)}},handleMouseUp:function(){x.current=!1},isInitialFocusedCell:H,isSelected:W,lastSelectedColumnIndex:g,selectColumns:S,selectedCells:s,selectedColumns:f,setInitialFocusedCell:I,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:re,headers:ye.current,visibleRows:vn}),pn=gn.getBorderClass,wn=gn.handleMouseDown,Cn=gn.handleMouseOver,In=gn.handleMouseUp,xn=gn.isInitialFocusedCell,yn=gn.isSelected,bn=gn.selectColumns,Rn=gn.selectedCells,Mn=gn.selectedColumns,En=gn.setInitialFocusedCell,Sn=gn.setSelectedCells,kn=gn.setSelectedColumns,Wn=a((function(e,n){dn(e,n)}),[dn]),Dn=a((function(e){ye.current=e,mn()}),[]);c((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(Rn.size>0&&Sn(new Set),Mn.size>0&&kn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,Rn,Mn,Sn,kn]),h((function(){if(We.current){var e=We.current.offsetWidth-We.current.clientWidth;nn(e)}}),[]),h((function(){var e=function(){if(mn(),We.current){var e=We.current.offsetWidth-We.current.clientWidth;nn(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var Hn=i(new Map);return c((function(){he&&(he.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,d=null===(t=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==d){var l=b({rowId:d,accessor:i}),s=Hn.current.get(l);s&&s.updateContent(c),void 0!==(null===(o=null===(r=null==Z?void 0:Z[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=c)}}})}),[he,Z]),e(D,p({value:{allowAnimations:l,cellRegistry:Hn.current,cellUpdateFlash:u,collapseIcon:v,columnReordering:y,columnResizing:E,draggedHeaderRef:xe,editColumns:H,expandIcon:A,forceUpdate:mn,getBorderClass:pn,handleMouseDown:wn,handleMouseOver:Cn,headersRef:ye,hiddenColumns:an,hoveredHeaderRef:be,isInitialFocusedCell:xn,isSelected:yn,mainBodyRef:Ee,nextIcon:q,onCellEdit:J,onColumnOrderChange:X,onSort:Wn,onTableHeaderDragEnd:Dn,pinnedLeftRef:Se,pinnedRightRef:ke,prevIcon:$,rowHeight:Q,scrollbarWidth:en,selectColumns:bn,selectableColumns:ie,setInitialFocusedCell:En,setIsWidthDragging:Oe,setMainBodyWidth:Ye,setPinnedLeftWidth:Xe,setPinnedRightWidth:Ge,setSelectedCells:Sn,setSelectedColumns:kn,shouldPaginate:ce,sortDownIcon:le,sortUpIcon:ue,tableBodyContainerRef:We,useOddColumnBackground:Ie,useHoverRowBackground:ge,useOddEvenRowBackground:we}},{children:e("div",p({className:"simple-table-root st-wrapper theme-".concat(ve),style:z?{height:z}:{}},{children:e(ze,{children:n("div",p({className:"st-wrapper-container"},{children:[n("div",p({className:"st-content-wrapper",onMouseUp:In,onMouseLeave:In},{children:[e(Re,{flattenedRows:un,isWidthDragging:Te,pinnedLeftWidth:Je,pinnedRightWidth:Ke,setFlattenedRows:hn,setScrollTop:Qe,sort:rn,visibleRows:vn}),e(Pe,{columnEditorText:I,editColumns:H,editColumnsInitOpen:P,headers:ye.current,hiddenColumns:an,position:w,setHiddenColumns:cn})]})),e(Me,{mainBodyRef:Ee,mainBodyWidth:Ue,pinnedLeftWidth:Je,pinnedRightWidth:Ke,setMainBodyWidth:Ye,tableBodyContainerRef:We}),e(N,{currentPage:Ne,hideFooter:U,onPageChange:Le,onNextPage:K,shouldPaginate:ce,totalPages:Math.ceil(Z.length/ne)})]}))})}))}))};export{je as SimpleTable};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useCallback as a,useEffect as c,useMemo as d,createContext as l,useContext as s,forwardRef as u,useLayoutEffect as h,Fragment as f,cloneElement as v,useReducer as m,createRef as g}from"react";var p=function(){return p=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)};function w(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function c(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}d((r=r.apply(e,n||[])).next())}))}function C(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(d){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,d])}}}function I(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var x=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},y=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},b=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},R=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return R(e)})):[e]},M=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(x({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},E=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(x({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){E(e)}))},S=function(e){return"number"==typeof e.minWidth?e.minWidth:40},k=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},W=l(void 0),D=function(n){var t=n.children,r=n.value;return e(W.Provider,p({value:r},{children:t}))},H=function(){var e=s(W);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},N=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,c=t.onNextPage,d=t.shouldPaginate,l=t.totalPages,s=H(),u=s.nextIcon,h=s.prevIcon,f=o(!0),v=f[0],m=f[1],g=!(r>1),I=!(r<l)&&!c||!v&&r===l;if(i||!d)return null;var x=function(){if(l<=15)return Array.from({length:l},(function(e,n){return n+1}));var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=l-Math.floor(7.5))e=Math.max(1,l-o+1),n=l;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<l-1&&(t.push(-1),t.push(l)),t}();return n("div",p({className:"st-footer"},{children:[e("button",p({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:h})),e("button",p({className:"st-next-prev-btn ".concat(I?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,(function(){var e,n;return C(this,(function(t){switch(t.label){case 0:return e=r===l,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return m(!1),[2];t.label=2;case 2:return(n<=l||c)&&a(n),[2]}}))}))},disabled:I},{children:u})),x.map((function(n,t){return n<0?e("span",p({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",p({onClick:function(){return function(e){e>=1&&e<=l&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},L=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},B=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},T=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},O=function(e){return e.position*(e.rowHeight+1)-1},P=function(e){return e.position*(e.rowHeight+1)},F=function(n){var t=n.children,r=n.onClose,a=n.open,d=n.setOpen,l=n.width,s=n.containerRef,u=H().mainBodyRef,h=i(null),f=i(null),v=o("bottom-left"),m=v[0],g=v[1],w=o({}),C=w[0],I=w[1],x=o(!1),y=x[0],b=x[1];return c((function(){a&&h.current?(b(!1),!f.current&&h.current.parentElement&&(f.current=h.current.parentElement),requestAnimationFrame((function(){if(h.current&&f.current){var e,n=h.current,t=f.current.getBoundingClientRect(),r=n.offsetHeight,o=l||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==u?void 0:u.current)?u.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,c="bottom",d={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var v="left";o>e.right-t.right+t.width&&(v="right"),"bottom"===c?d.top=t.bottom+4:d.bottom=window.innerHeight-t.top+4,"left"===v?d.left=t.left:d.right=window.innerWidth-t.right,g("".concat(c,"-").concat(v)),I(d),b(!0)}}))):a||b(!1)}),[a,l,s,u]),c((function(){var e=function(e){if(a&&h.current){var n=e.target;h.current&&!h.current.contains(n)&&(d(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,r,d]),c((function(){var e=function(e){h.current&&!h.current.contains(e.target)&&(d(!1),null==r||r())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[r,a,d]),c((function(){var e=function(e){"Escape"===e.key&&a&&(d(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,a,d]),a?e("div",p({ref:h,className:"st-dropdown-content st-dropdown-".concat(m),style:p({width:l?"".concat(l,"px"):"auto",visibility:y?"visible":"hidden"},C)},{children:t})):null},A=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,c=void 0!==a&&a,d=n.className,l=void 0===d?"":d;return e("div",p({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(c?"disabled":""," ").concat(l),onClick:function(){!c&&r&&r()},role:"option","aria-selected":i,"aria-disabled":c},{children:t}))},z=function(t){var r=t.onBlur,i=t.onChange,a=t.open,d=t.setOpen,l=t.value,s=o(l),u=s[0],h=s[1];c((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var f=function(e){h(e),i(e),d(!1),r()};return n(F,p({open:a,onClose:function(){r()},setOpen:d,width:120},{children:[e(A,p({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(A,p({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},j=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)}})},U=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)}})},Y=function(r){var i,a,c=r.value,d=r.onChange,l=r.onClose,s=H(),u=s.nextIcon,h=s.prevIcon,f=o(c||new Date),v=f[0],m=f[1],g=o("days"),w=g[0],C=g[1],I=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",p({className:"st-datepicker"},{children:[n("div",p({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",p({onClick:function(){m(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),n("div",p({className:"st-datepicker-header-label",onClick:function(){return C("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",p({onClick:function(){m(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===w&&e("div",p({className:"st-datepicker-header-label",onClick:function(){return C("years")}},{children:v.getFullYear()})),"years"===w&&e("div",p({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",p({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=I(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=I(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach((function(t,r){n.push(e("div",p({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))}));for(var s=function(t){var r=a-i+t+1;n.push(e("div",p({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);m(n),d(n),null==l||l()}(r)}},{children:r}),"prev-".concat(r)))},u=0;u<i;u++)s(u);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(c).getDate()&&r===new Date(c).getMonth()&&t===new Date(c).getFullYear();n.push(e("div",p({className:"st-datepicker-day ".concat(i?"today":""," ").concat(a?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);m(n),d(n),null==l||l()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var g=35-(i+o),w=function(t){n.push(e("div",p({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);m(n),d(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=g;f++)w(f);return n}(),"months"===w&&(i=[],Array.from({length:12},(function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})})).forEach((function(n,t){var r=t===v.getMonth();i.push(e("div",p({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){m(new Date(v.getFullYear(),e,1)),C("days")}(t)}},{children:n}),"month-".concat(t)))})),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",p({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){m(new Date(e,v.getMonth(),1)),C("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",p({className:"st-datepicker-footer"},{children:e("button",p({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;m(e),d(e),null==l||l()}},{children:"Today"}))}))]}))},q=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.setOpen,d=n.value,l=o(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(d)),s=l[0],u=l[1];c((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){t()};return e(F,p({open:i,onClose:h,setOpen:a,width:280},{children:e(Y,{value:s,onChange:function(e){u(e),r(e.toISOString()),a(!1),t()},onClose:h})}))},J=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,d=n.setOpen,l=n.value,s=o(l||""),u=s[0],h=s[1];c((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e(F,p({open:i,onClose:function(){t()},setOpen:d,width:150},{children:e("div",p({className:"st-enum-dropdown-content"},{children:a.map((function(n){return e(A,p({isSelected:u===n,onClick:function(){return h(e=n),r(e),d(!1),void t();var e}},{children:n}),n)}))}))}))},X=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,d=n.value,l=function(){i(!1)};if("boolean"===c&&"boolean"==typeof d)return e(z,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:d});if("date"===c)return e(q,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:"string"==typeof d?d:""});if("enum"===c)return e(J,{onBlur:l,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:"string"==typeof d?d:""});if("number"===c&&"number"==typeof d)return e(U,{defaultValue:d,onBlur:l,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var s=null==d?"":String(d);return e(j,{defaultValue:s,onBlur:l,onChange:function(e){return o(e)}})},V=0,K=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===V||o-V>=r)&&(V=o,n(t))}},G=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(G);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=G(e[t]));return n},$=Date.now(),_={screenX:0,screenY:0},Q=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return I(I([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Q(o.children,n,I(I([],t,!0),[r],!1));if(i)return i}}return null};var Z=function(e){var n,t,r=e.draggedHeaderRef,o=e.headersRef,a=e.hoveredHeaderRef,d=e.onColumnOrderChange,l=e.onTableHeaderDragEnd,s=(n=o.current,t=i(n),c((function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)}),[n]),t.current);return{handleDragStart:function(e){r.current=e,$=Date.now()},handleDragOver:function(e){var n,t,i=e.event,c=e.hoveredHeader;if(i.preventDefault(),o.current){var d=i.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=i.screenX,h=i.screenY,f=Math.sqrt(Math.pow(u-_.screenX,2)+Math.pow(h-_.screenY,2));a.current=c;var v=o.current,m=Q(v,(null===(n=r.current)||void 0===n?void 0:n.accessor)||""),g=Q(v,c.accessor);if(m&&g){var p=m.length,w=g.length,C=g;if(p!==w){var I=w-p;I>0&&(C=g.slice(0,-I))}var x=function(e,n,t){var r=G(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,C),y=x.newHeaders,b=x.emergencyBreak;if(!(d||c.accessor===(null===(t=r.current)||void 0===t?void 0:t.accessor)||null===r.current||f<10||0===m.length||0===C.length||JSON.stringify(y)===JSON.stringify(o.current)||b)){var R=Date.now();JSON.stringify(y)===JSON.stringify(s)&&(R-$<1500||f<40)||($=R,_={screenX:u,screenY:h},l(y))}}}},handleDragEnd:function(){r.current=null,a.current=null,null==d||d(o.current)}}},ee=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ne=u((function(t,r){var d,l,s=t.borderClass,u=t.colIndex,h=t.header,f=t.isHighlighted,v=t.isInitialFocused,m=t.nestedIndex,g=t.onExpandRowClick,w=t.rowIndex,C=t.visibleRow,I=H(),y=I.cellRegistry,R=I.cellUpdateFlash,M=I.collapseIcon,E=I.draggedHeaderRef,S=I.expandIcon,k=I.handleMouseDown,W=I.handleMouseOver,D=I.headersRef,N=I.hoveredHeaderRef,L=I.onCellEdit,B=I.onTableHeaderDragEnd,T=I.theme,O=I.useOddColumnBackground,P=C.depth,F=C.row,A=o(F.rowData[h.accessor]),z=A[0],j=A[1],U=o(!1),Y=U[0],q=U[1],J=o(!1),V=J[0],G=J[1],$=i(null),_=Z({draggedHeaderRef:E,headersRef:D,hoveredHeaderRef:N,onTableHeaderDragEnd:B}).handleDragOver,Q=K(),ne="cell-".concat(w,"-").concat(u),te=b({rowId:F.rowMeta.rowId,accessor:h.accessor});c((function(){if(y){var e="".concat(F.rowMeta.rowId,"-").concat(h.accessor);return y.set(e,{updateContent:function(e){z!==e?(j(e),R&&(G(!0),$.current&&clearTimeout($.current),$.current=setTimeout((function(){G(!1)}),800))):j(e)}}),function(){y.delete(e),$.current&&clearTimeout($.current)}}}),[y,R,F.rowMeta.rowId,h.accessor,z]),c((function(){if(V){var e=setTimeout((function(){G(!1)}),850);return function(){return clearTimeout(e)}}}),[V]),c((function(){j(F.rowData[h.accessor])}),[F.rowData,h.accessor]),c((function(){f||q(!1)}),[f]);var re="boolean"===h.type||"date"===h.type||"enum"===h.type,oe=Boolean(null===(l=null===(d=F.rowMeta)||void 0===d?void 0:d.children)||void 0===l?void 0:l.length),ie=Boolean(null==h?void 0:h.isEditable),ae="st-cell ".concat(P>0&&h.expandable?"st-cell-depth-".concat(P):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(ie?"clickable":""," ").concat(V?"st-cell-updating":""," ").concat(O?m%2==0?"even-column":"odd-column":""),ce=a((function(e){j(e),null==L||L({accessor:h.accessor,newValue:e,row:F})}),[h.accessor,L,F]);return Y&&!re?e("div",p({className:"st-cell-editing",id:x({accessor:h.accessor,rowIndex:w+1})},{children:e(X,{enumOptions:h.enumOptions,onChange:ce,setIsEditing:q,type:h.type,value:z})})):n("div",p({className:ae,id:ne,onDoubleClick:function(){return h.isEditable&&q(!0)},onMouseDown:function(){return k({rowIndex:w,colIndex:u,rowId:F.rowMeta.rowId})},onMouseOver:function(){return W({rowIndex:w,colIndex:u,rowId:F.rowMeta.rowId})},onDragOver:function(e){return Q({callback:_,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||Y||(e.preventDefault(),q(!0))},ref:r,"data-row-index":w,"data-col-index":u,"data-row-id":F.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&oe?F.rowMeta.isExpanded?e("div",p({className:"st-sort-icon-container",onClick:function(){return g(F.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:M})):e("div",p({className:"st-sort-icon-container",onClick:function(){return g(F.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:S})):null,e("span",p({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:e("span",{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:F,theme:T}):ee({content:z,header:h})})})),Y&&re&&e(X,{enumOptions:h.enumOptions,onChange:ce,setIsEditing:q,type:h.type,value:z})]}),te)})),te=function(n){var r=n.children,o=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children"]);return H().allowAnimations?e(re,p({},o,{children:r})):e(t,{children:r})},re=function(n){var r=n.children,a=n.isBody,d=n.pauseAnimation,l=n.rowIndex,s=i(!1),u=H(),f=u.draggedHeaderRef,v=u.headersRef,m=u.mainBodyRef,g=u.shouldPaginate,p=o({}),w=p[0],C=p[1],I=i({}),y=v.current;return h((function(){if(y){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(x({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),c=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=c}}})),o}({currentHeaders:y,draggedHeaderRef:f,rowIndex:l});JSON.stringify(e)!==JSON.stringify(w)&&(I.current=w,C(e))}}),[w,y,f,a,l]),h((function(){var e=m.current,n=function(){s.current=!0},t=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[f,m]),c((function(){d||s.current||Object.keys(I.current).length&&y&&y.forEach((function(e){var n=document.getElementById(x({accessor:e.accessor,rowIndex:l}));if(n){var t=I.current[e.accessor],r=w[e.accessor];if(t&&r){var o=t.left-r.left,i=g?0:t.top-r.top,a=Math.abs(o),c=Math.abs(i);(a>10||c>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")}))}))}}}))}),[w,y,a,d,I,l,g]),e(t,{children:r})},oe=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,c=n.onExpandRowClick,d=n.pinned,l=n.rowIndex,s=n.rowIndices,u=n.visibleRow,h=o.filter((function(e){return y({hiddenColumns:i,header:e,pinned:d})}));return e(te,p({isBody:!0,pauseAnimation:a,rowIndex:l+1},{children:h.map((function(n,a){return e(ie,{columnIndices:r,header:n,headers:o,hiddenColumns:i,nestedIndex:a+(null!=t?t:0),onExpandRowClick:c,pinned:d,rowIndex:l,rowIndices:s,visibleRow:u},x({accessor:n.accessor,rowIndex:l+1}))}))}))},ie=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.hiddenColumns,a=n.nestedIndex,c=n.onExpandRowClick,d=n.pinned,l=n.rowIndex,s=n.rowIndices,u=n.visibleRow,h=t[r.accessor],v=H(),m=v.getBorderClass,g=v.isSelected,p=v.isInitialFocusedCell;if(r.children){var w=r.children.filter((function(e){return y({hiddenColumns:i,header:e,pinned:d})}));return e(f,{children:w.map((function(n){return e(ie,{columnIndices:t,header:n,headers:o,hiddenColumns:i,nestedIndex:a,onExpandRowClick:c,pinned:d,rowIndex:l,rowIndices:s,visibleRow:u},x({accessor:n.accessor,rowIndex:l+1}))}))})}var C={rowIndex:l,colIndex:h,rowId:u.row.rowMeta.rowId},I=m(C),b=g(C),R=p(C);return e(ne,{borderClass:I,colIndex:h,header:r,isHighlighted:b,isInitialFocused:R,nestedIndex:a,onExpandRowClick:c,rowIndex:l,visibleRow:u},x({accessor:r.accessor,rowIndex:l+1}))},ae=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,c=n.hoveredIndex,d=n.index,l=n.isWidthDragging,s=n.onExpandRowClick,u=n.pinned,h=n.rowHeight,f=n.rowIndices,v=n.setHoveredIndex,m=n.visibleRow,g=H().useHoverRowBackground,w=m.position;return e("div",p({className:"st-row ".concat(w%2==0?"even":"odd"," ").concat(c===d&&g?"hovered":""),onMouseEnter:function(){v(d)},style:{gridTemplateColumns:o,top:P({position:w,rowHeight:h}),height:"".concat(h,"px")}},{children:e(oe,{columnIndexStart:r,columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:l,onExpandRowClick:s,pinned:u,rowIndex:d,rowIndices:f,visibleRow:m},d)}))},ce=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,i=n.templateColumns;return e("div",p({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:O({position:r,rowHeight:o}),minWidth:"100%"}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},de=l(void 0),le=["default"],se=function(e){var n=e.childRef,t=e.children,r=function(){var e=s(de);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return c((function(){return n.current&&o(n.current,le),function(){n.current&&i(n.current,le)}}),[n,o,i]),v(t,{ref:function(e){n.current=e}})},ue=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},he=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,a=t.hiddenColumns,c=t.hoveredIndex,d=t.isWidthDragging,l=t.onExpandRowClick,s=t.pinned,u=t.ref,h=t.rowHeight,v=t.rowIndices,m=t.setHoveredIndex,g=t.templateColumns,w=t.totalHeight,C=t.visibleRows,I=t.width,x=s?"st-body-pinned-".concat(s):"st-body-main";return e(ue,p({condition:!s,wrapper:function(n){return e(se,p({childRef:u},{children:n}))}},{children:e("div",p({className:x,ref:u,style:p({position:"relative",height:"".concat(w,"px"),width:I},!s&&{flexGrow:1})},{children:C.map((function(t,u){var p,w,I=C[u-1],x=Boolean((null==I?void 0:I.depth)!==(null==t?void 0:t.depth)&&(null===(w=null===(p=null==t?void 0:t.row.rowMeta)||void 0===p?void 0:p.children)||void 0===w?void 0:w.length)&&0===t.depth);return n(f,{children:[0!==u&&e(ce,{displayStrongBorder:x,position:t.position,rowHeight:h,templateColumns:g}),e(ae,{columnIndexStart:r,columnIndices:o,gridTemplateColumns:g,headers:i,hiddenColumns:a,hoveredIndex:c,index:u,isWidthDragging:d,onExpandRowClick:l,pinned:s,rowHeight:h,rowIndices:v,setHoveredIndex:m,visibleRow:t})]},t.position)}))}))}))};function fe(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,c=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 y({hiddenColumns:t,header:e})})).forEach((function(e,n){c(e,0===n)}))};return r.forEach((function(e,n){c(e,0===n)})),n.current.filter((function(e){return!e.pinned&&y({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;c(e,t)})),o.forEach((function(e){c(e,!1)})),i}var ve=function(t){var r=t.flattenedRows,a=t.headerContainerRef,l=t.isWidthDragging,s=t.mainTemplateColumns,u=t.pinnedLeftColumns,h=t.pinnedLeftTemplateColumns,f=t.pinnedLeftWidth,v=t.pinnedRightColumns,m=t.pinnedRightTemplateColumns,g=t.pinnedRightWidth,w=t.setFlattenedRows,C=t.setScrollTop,I=t.visibleRows,x=H(),y=x.headersRef,b=x.hiddenColumns,R=x.mainBodyRef,M=x.rowHeight,E=x.scrollbarWidth,S=x.tableBodyContainerRef,k=o(null),W=k[0],D=k[1];!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],d=i[1];c((function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,a,r]),c((function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(r),function(){r&&i.unobserve(r)}}}),[n,t])}({headerContainerRef:a,mainSectionRef:S,scrollbarWidth:E});var N,L,B=i(null),T=(N=0,(L=function(e){e.forEach((function(e){N+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&L(e.rowMeta.children)}))})(r),N)*(M+1)-1,O=d((function(){return fe({headersRef:y,hiddenColumns:b,pinnedLeftColumns:u,pinnedRightColumns:v})}),[y,b,u,v]),P=d((function(){var e={};return I.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[I]),F=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?p(p({},t),{rowMeta:p(p({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?p(p({},t),{rowMeta:p(p({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};w((function(e){return e.map(n)}))},A={columnIndices:O,headerContainerRef:a,headers:y.current,hiddenColumns:b,hoveredIndex:W,isWidthDragging:l,rowHeight:M,rowIndices:P,setHoveredIndex:D,visibleRows:I};return n("div",p({className:"st-body-container",onMouseLeave:function(){return D(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame((function(){C(n)}))},ref:S},{children:[u.length>0&&e(he,p({},A,{onExpandRowClick:F,pinned:"left",templateColumns:h,totalHeight:T,width:f})),e(he,p({},A,{columnIndexStart:u.length,onExpandRowClick:F,ref:R,templateColumns:s,totalHeight:T})),v.length>0&&e(he,p({},A,{columnIndexStart:u.length+s.length,onExpandRowClick:F,pinned:"right",templateColumns:m,totalHeight:T,width:g}))]}))},me=function(e){return void 0===e&&(e=0),e?e+1:0},ge=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:R(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=M(e))})))})),n.pinned?me(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},pe=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,d=e.setMainBodyWidth,l=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;c(!0),n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,f="touches"in n;if(i&&!i.hide){var v=S(i),m=r-o>1,g=m?R(i):[i],p=function(e){var n="right"===i.pinned?h-e:e-h;if(m&&g.length>1)we({delta:n,header:i,headersRef:a,leafHeaders:g,minWidth:v,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s,startWidth:u});else{var r=Math.max(u+n,v);i.width=r,ge({header:i,headers:a.current,newWidth:r,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s})}a.current.forEach((function(e){E(e)})),t()};if(f){var w=function(e){var n=e.touches[0];p(n.clientX)},C=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",C),c(!1)};document.addEventListener("touchmove",w),document.addEventListener("touchend",C)}else{var I=function(e){p(e.clientX)},x=function(){document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",x),c(!1)};document.addEventListener("mousemove",I),document.addEventListener("mouseup",x)}}},we=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,d=e.setPinnedRightWidth,l=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,S(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(l+n,s);ge({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:d});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},Ce=u((function(t,r){var o,i,a=t.colIndex,d=t.forceHeadersUpdate,l=t.gridColumnEnd,s=t.gridColumnStart,u=t.gridRowEnd,h=t.gridRowStart,f=t.header,v=t.reverse,m=t.sort,g=H(),w=g.columnReordering,C=g.columnResizing,y=g.draggedHeaderRef,b=g.forceUpdate,R=g.headersRef,M=g.hoveredHeaderRef,E=g.onColumnOrderChange,S=g.onSort,k=g.onTableHeaderDragEnd,W=g.rowHeight,D=g.selectColumns,N=g.selectableColumns,L=g.setInitialFocusedCell,B=g.setIsWidthDragging,T=g.setMainBodyWidth,O=g.setPinnedLeftWidth,P=g.setPinnedRightWidth,F=g.setSelectedCells,A=g.setSelectedColumns,z=g.sortDownIcon,j=g.sortUpIcon,U=Boolean(null==f?void 0:f.isSortable),Y="st-header-cell ".concat(f.accessor===(null===(o=M.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=y.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(U?"clickable":""," ").concat(w&&!U?"columnReordering":""," ").concat(f.children?"parent":""),q=Z({draggedHeaderRef:y,headersRef:R,hoveredHeaderRef:M,onColumnOrderChange:E,onTableHeaderDragEnd:k}),J=q.handleDragStart,X=q.handleDragEnd,V=q.handleDragOver,G=K(),$=function(e){var n=e.event,t=e.header;if(N){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,a);return n.shiftKey&&D?A((function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort((function(e,n){return e-n})),o=t[0],i=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)}));var a,c,d,l,s=I(I([],(a=o,c=n,d=Math.min(a,c),l=Math.max(a,c),Array.from({length:l-d+1},(function(e,n){return d+n}))),!0),r,!0);return new Set(I(I([],Array.from(e),!0),s,!0))})):D&&D(r),F(new Set),void L(null)}t.isSortable&&S(a,t.accessor)};if(c((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 _=C&&e("div",p({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;G({callback:pe,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:l,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:B,setMainBodyWidth:T,setPinnedLeftWidth:O,setPinnedRightWidth:P,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;G({callback:pe,callbackProps:{event:e,forceUpdate:b,gridColumnEnd:l,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:B,setMainBodyWidth:T,setPinnedLeftWidth:O,setPinnedRightWidth:P,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),Q=m&&m.key.accessor===f.accessor&&n("div",p({className:"st-sort-icon-container",onClick:function(e){return $({event:e,header:f})}},{children:["ascending"===m.direction&&j&&j,"descending"===m.direction&&z&&z]}));return n("div",p({className:Y,id:x({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){G({callback:V,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:r,style:p(p({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:l},l-s>1?{}:{width:f.width}),u-h>1?{}:{height:W})},{children:[v&&_,"right"===f.align&&Q,e("div",p({className:"st-header-label",draggable:w&&!f.disableReorder,onClick:function(e){return $({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),X(),d()},onDragStart:function(e){w&&f&&function(e){J(e)}(f)}},{children:e("span",p({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:null==f?void 0:f.label}))})),"right"!==f.align&&Q,!v&&_]}))})),Ie=function(n){var t=n.columnIndices,r=n.gridTemplateColumns,o=n.handleScroll,i=n.headersRef,a=n.hiddenColumns,c=n.maxDepth,l=n.pinned,s=n.sectionRef,u=n.sort,h=m((function(e){return e+1}),0)[1],f=d((function(){var e=[],n=1,r=function(o,i,d){var s,u;if(void 0===d&&(d=!1),!y({hiddenColumns:a,header:o,pinned:l}))return 0;d||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return y({hiddenColumns:a,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,m=i,g=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:m,gridRowEnd:g,colIndex:t[o.accessor]}),o.children){var p=!0;o.children.forEach((function(e){y({hiddenColumns:a,header:e,pinned:l})&&(r(e,i+1,p),p=!1)}))}return v-f},o=i.current.filter((function(e){return y({hiddenColumns:a,header:e,pinned:l})})),d=!0;return o.forEach((function(e){r(e,1,d),d=!1})),e}),[i,a,c,l,t]);return e(ue,p({condition:!l,wrapper:function(n){return e(se,p({childRef:s},{children:n}))}},{children:e("div",p({className:"st-header-".concat(l?"pinned-".concat(l):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:r,display:"grid",position:"relative"}},{children:e(te,p({rowIndex:0},{children:f.map((function(n){return e(Ce,{colIndex:n.colIndex,forceHeadersUpdate:h,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:g(),reverse:"right"===l,sort:u},n.header.accessor)}))}))}))}))},xe=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(xe)):1},ye=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headersRef,a=t.hiddenColumns,c=t.mainTemplateColumns,l=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.sort,m=H(),g=m.pinnedLeftRef,w=m.pinnedRightRef,C=m.setPinnedLeftWidth,I=m.setPinnedRightWidth,x=d((function(){return fe({headersRef:i,hiddenColumns:a,pinnedLeftColumns:l,pinnedRightColumns:u})}),[i,a,l,u]),b=d((function(){var e=i.current,n=0;return e.forEach((function(e){if(y({hiddenColumns:a,header:e})){var t=xe(e);n=Math.max(n,t)}})),{maxDepth:n}}),[i,a]).maxDepth;return h((function(){var e,n;C(me(null===(e=g.current)||void 0===e?void 0:e.clientWidth)),I(me(null===(n=w.current)||void 0===n?void 0:n.clientWidth))}),[g,w,C,I]),n("div",p({className:"st-header-container",ref:o},{children:[l.length>0&&e(Ie,{columnIndices:x,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:b,pinned:"left",sectionRef:g,sort:v}),e(Ie,{columnIndices:x,gridTemplateColumns:c,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:b,sectionRef:r,sort:v}),u.length>0&&e(Ie,{columnIndices:x,gridTemplateColumns:f,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:b,pinned:"right",sectionRef:w,sort:v})]}))},be=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},Re=function(t){var r=t.flattenedRows,o=t.isWidthDragging,a=t.pinnedLeftWidth,c=t.pinnedRightWidth,l=t.setFlattenedRows,s=t.setScrollTop,u=t.sort,h=t.visibleRows,f=H(),v=f.columnResizing,m=f.editColumns,g=f.headersRef,w=f.hiddenColumns,C=i(null),I=i(null),x=g.current.filter((function(e){return!e.pinned})),y=g.current.filter((function(e){return"left"===e.pinned})),b=g.current.filter((function(e){return"right"===e.pinned})),R=d((function(){return be({headers:y,hiddenColumns:w})}),[y,w]),M=d((function(){return be({headers:x,hiddenColumns:w})}),[x,w]),E=d((function(){return be({headers:b,hiddenColumns:w})}),[b,w]),S={centerHeaderRef:I,headerContainerRef:C,headersRef:g,hiddenColumns:w,mainTemplateColumns:M,pinnedLeftColumns:y,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightTemplateColumns:E,sort:u},k={flattenedRows:r,headerContainerRef:C,isWidthDragging:o,mainTemplateColumns:M,pinnedLeftColumns:y,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:b,pinnedRightTemplateColumns:E,pinnedRightWidth:c,setFlattenedRows:l,setScrollTop:s,visibleRows:h};return n("div",p({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:m?"calc(100% - 27.5px)":"100%"}},{children:[e(ye,p({},S)),e(ve,p({},k))]}))},Me=function(t){var r,a,d=t.mainBodyWidth,l=t.mainBodyRef,s=t.pinnedLeftWidth,u=t.pinnedRightWidth,h=t.setMainBodyWidth,f=t.tableBodyContainerRef,v=H().editColumns,m=o(!1),g=m[0],w=m[1],C=i(null),I=f.current&&f.current.scrollHeight>f.current.clientHeight,x=v?28:0,y=(v?u+1:u)+(f.current&&I?f.current.offsetWidth-f.current.clientWidth:0);return c((function(){setTimeout((function(){!function(){var e;if(l.current){var n=null===(e=l.current)||void 0===e?void 0:e.scrollWidth;h(n||0)}}()}),1)}),[l,h]),c((function(){setTimeout((function(){!function(){if(l.current){var e=l.current.clientWidth;w(d>e)}}()}),1)}),[l,d,h]),g?n("div",p({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(r=C.current)||void 0===r?void 0:r.offsetHeight}}),d>0&&e(se,p({childRef:C},{children:e("div",p({className:"st-horizontal-scrollbar-middle",ref:C,style:{flexGrow:1}},{children:e("div",{style:{width:d,height:".3px"}})}))})),u>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:y,height:null===(a=C.current)||void 0===a?void 0:a.offsetHeight}}),x>0&&e("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},Ee={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return Ee.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?Ee.string(e,n,t):"number"==typeof e&&"number"==typeof n?Ee.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Ee.boolean(e,n,t):Ee.string(String(e),String(n),t)}},Se=function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return Ee.number(i,a,r)}return"date"===t?Ee.date(String(e),String(n),r):"boolean"===t?Ee.boolean(Boolean(e),Boolean(n),r):"enum"===t?Ee.enum(String(e),String(n),r):Ee.string(String(e),String(n),r)},ke=function(e,n,t){var r,o=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",i=n.direction,a=new Map,c=new Map,d="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(a.size)).toString();d=r,c.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===(t=a.get(i))||void 0===t||t.push(e)}}));var l=[];return a.forEach((function(e,r){if(c.has(r)){var a=c.get(r);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=We(a.rowMeta.children,n,t)),l.push(a)}var d=I([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return Se(a,c,o,i)}));l.push.apply(l,d.map((function(e){var r=p({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var o=We(r.rowMeta.children,n,t);r.rowMeta=p(p({},r.rowMeta),{children:o})}return r})))})),l},We=function(e,n,t){var r=t.find((function(e){return e.accessor===n.key.accessor})),o=(null==r?void 0:r.type)||"string",i=n.direction;return I([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return Se(a,c,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?p(p({},e),{rowMeta:p(p({},e.rowMeta),{children:We(e.rowMeta.children,n,t)})}):e}))},De=function(e){var n=e.headers,t=e.tableRows,r=o(null),i=r[0],a=r[1],c=d((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),l=o(c),s=l[0],u=l[1],h=d((function(){if(!i)return t;var e=function(e,n,t){return{sortedData:ke(n,t,e),newSortConfig:t}}(n,t,i).sortedData;return e}),[t,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,t){var r=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===t)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(n);o&&a((function(e){return e&&e.key.accessor===t?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},He=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",p({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",p({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e("span",{className:"st-checkbox-checkmark"})})),i]}))},Ne=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),d=!1;if(!c)for(var l=0,s=a.children;l<s.length;l++){var u=s[l];if(Ne([u],n,t,r),!1===t[u.accessor]){d=!0;break}}(c||d)&&(t[a.accessor]=!1)}}},Le=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},Be=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(Be(e.children,n),Le(e.children,n)&&(n[e.accessor]=!0))}))},Te=function(r){var i=r.allHeaders,a=r.depth,c=void 0===a?0:a,d=r.header,l=r.hiddenColumns,s=r.setHiddenColumns,u=o(!0),h=u[0],f=u[1],v=H(),m=v.expandIcon,g=v.collapseIcon,w=v.headersRef,C=v.setMainBodyWidth,I=v.setPinnedLeftWidth,x=v.setPinnedRightWidth,y="".concat(16*c,"px"),b=d.children&&d.children.length>0,E=l[d.accessor]||b&&d.children&&Le(d.children,l);return n(t,{children:[n("div",p({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[e("div",p({className:"st-header-icon-container"},{children:b?e("div",p({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?g:m})):null})),e(He,p({checked:E,onChange:function(e){var n=p({},l);(n[d.accessor]=e,e)?Be(i,n):(Ne(i,d.accessor,n),b&&d.children&&d.children.length>0&&d.children.every((function(e){return!0===l[e.accessor]}))&&d.children[0]&&(n[d.children[0].accessor]=!1,Ne(i,d.children[0].accessor,n)));s(n),w.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=R(e).reduce((function(e,n){return e+M(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var d=me(i),l=me(a);r(d),o(l),t(c)}({headers:w.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:x})}},{children:d.label}))]})),b&&h&&d.children&&e("div",p({className:"st-nested-headers"},{children:d.children.map((function(n,t){return e(Te,{allHeaders:i,depth:c+1,header:n,hiddenColumns:l,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},Oe=function(n){var t=n.headers,r=n.open,o=n.position,i=n.setHiddenColumns,a=n.hiddenColumns,c="left"===o?"left":"";return e("div",p({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(c),onClick:function(e){return e.stopPropagation()}},{children:e("div",p({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e(Te,{header:n,hiddenColumns:a,setHiddenColumns:i,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},Pe=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,c=t.headers,d=t.hiddenColumns,l=t.position,s=void 0===l?"right":l,u=t.setHiddenColumns,h=o(a),f=h[0],v=h[1];return i?n("div",p({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e("div",p({className:"st-column-editor-text"},{children:r})),e(Oe,{headers:c,open:f,position:s,setHiddenColumns:u,hiddenColumns:d})]})):null},Fe=function(n){var t=n.className;return e("svg",p({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"down-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Ae=function(n){var t=n.className;return e("svg",p({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"up-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},ze=function(n){var t=n.children,o=i({}),c=a((function(e,n){return!!o.current[n]&&o.current[n].find((function(n){return n===e}))}),[]),d=a((function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)}),[]),l=a((function(e){e.onscroll=null}),[]),s=a((function(e,n){e.onscroll=function(){window.requestAnimationFrame((function(){n.forEach((function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach((function(n){e!==n&&(l(n),d(e,n),window.requestAnimationFrame((function(){var e=Object.keys(o.current).filter((function(e){return o.current[e].includes(n)}));s(n,e)})))}))}))}))}}),[l,d]),u=a((function(e,n){n.forEach((function(n){o.current[n]||(o.current[n]=[]),c(e,n)||(o.current[n].length>0&&d(o.current[n][0],e),o.current[n].push(e))})),s(e,n)}),[c,d,s]),h=a((function(e,n){n.forEach((function(n){if(c(e,n)){l(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}}))}),[c,l]);return e(de.Provider,p({value:{registerPane:u,unregisterPane:h}},{children:r.Children.only(t)}))},je=function(n){var t=o(!1),r=t[0],i=t[1];return c((function(){i(!0)}),[]),r?e(Ue,p({},n)):null},Ue=function(t){var r=t.allowAnimations,l=void 0!==r&&r,s=t.cellUpdateFlash,u=void 0!==s&&s,f=t.collapseIcon,v=void 0===f?e(T,{className:"st-sort-icon"}):f,g=t.columnEditorPosition,w=void 0===g?"right":g,C=t.columnEditorText,I=void 0===C?"Columns":C,x=t.columnReordering,y=void 0!==x&&x,M=t.columnResizing,E=void 0!==M&&M,S=t.defaultHeaders,W=t.editColumns,H=void 0!==W&&W,O=t.editColumnsInitOpen,P=void 0!==O&&O,F=t.expandIcon,A=void 0===F?e(B,{className:"st-sort-icon"}):F,z=t.height,j=t.hideFooter,U=void 0!==j&&j,Y=t.nextIcon,q=void 0===Y?e(B,{className:"st-next-prev-icon"}):Y,J=t.onCellEdit,X=t.onColumnOrderChange,V=t.onGridReady,K=t.onNextPage,G=t.prevIcon,$=void 0===G?e(L,{className:"st-next-prev-icon"}):G,_=t.rowHeight,Q=void 0===_?40:_,Z=t.rows,ee=t.rowsPerPage,ne=void 0===ee?10:ee,te=t.selectableCells,re=void 0!==te&&te,oe=t.selectableColumns,ie=void 0!==oe&&oe,ae=t.shouldPaginate,ce=void 0!==ae&&ae,de=t.sortDownIcon,le=void 0===de?e(Fe,{className:"st-sort-icon"}):de,se=t.sortUpIcon,ue=void 0===se?e(Ae,{className:"st-sort-icon"}):se,he=t.tableRef,fe=t.theme,ve=void 0===fe?"light":fe,me=t.useHoverRowBackground,ge=void 0===me||me,pe=t.useOddEvenRowBackground,we=void 0===pe||pe,Ce=t.useOddColumnBackground,Ie=void 0!==Ce&&Ce;Ie&&(we=!1);var xe=i(null),ye=i(S),be=i(null),Ee=i(null),Se=i(null),ke=i(null),We=i(null),He=o(1),Ne=He[0],Le=He[1],Be=o(!1),Te=Be[0],Oe=Be[1],je=o(0),Ue=je[0],Ye=je[1],qe=o(0),Je=qe[0],Xe=qe[1],Ve=o(0),Ke=Ve[0],Ge=Ve[1],$e=o(0),_e=$e[0],Qe=$e[1],Ze=o(0),en=Ze[0],nn=Ze[1],tn=De({headers:ye.current,tableRows:Z}),rn=tn.sort,on=tn.sortedRows,an=tn.hiddenColumns,cn=tn.setHiddenColumns,dn=tn.updateSort;c((function(){null==V||V()}),[V]);var ln=d((function(){if(!ce)return on;var e=(Ne-1)*ne,n=e+ne;return on.slice(e,n)}),[Ne,ne,ce,on]),sn=o(ln),un=sn[0],hn=sn[1];c((function(){hn(ln)}),[ln]);var fn=d((function(){var e;if(!z)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),t=0;if(z.endsWith("px"))t=parseInt(z,10);else if(z.endsWith("vh")){var r=parseInt(z,10);t=window.innerHeight*r/100}else if(z.endsWith("%")){var o=parseInt(z,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-Q)}),[z,Q]),vn=d((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],d=0,l=Math.max(0,i-a*n),s=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=d*a;if(h>=s)break;h+a>l&&c.push({row:i,depth:n,position:d,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),d+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:fn,flattenedRows:un,rowHeight:Q,scrollTop:_e})}),[fn,Q,un,_e]),mn=m((function(e){return e+1}),0)[1],gn=function(e){var n=e.selectableCells,t=e.headers,r=e.visibleRows,l=o(new Set),s=l[0],u=l[1],h=o(new Set),f=h[0],v=h[1],m=o(null),g=m[0],p=m[1],w=o(null),C=w[0],I=w[1],x=i(!1),y=i(null),b=a((function(){var e=t.flatMap(R).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var o=Array.from(s).reduce((function(e,t){var o=t.split("-").map(Number),i=o[0],a=o[1];e[i]||(e[i]=[]);var c=n.get(a);return e[i][a]=c?r[i].row.rowData[c]:"",e}),{}),i=Object.values(o).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(i)}),[t,s,r]),M=a((function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),c=Math.max(e.colIndex,n.colIndex),d=o;d<=i;d++)for(var l=a;l<=c;l++)if(d>=0&&d<r.length){var s=r[d].row.rowMeta.rowId;t.add(k({colIndex:l,rowIndex:d,rowId:s}))}v(new Set),p(null),u(t)}),[r,v,p,u]),E=a((function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<t.length){var n=k(e);v(new Set),p(null),u(new Set([n])),I(e)}}),[t.length,r.length,v,p,u,I]),S=a((function(e,n){void 0===n&&(n=!1),u(new Set),I(null),v((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&p(e[e.length-1])}),[u,I,v,p]);c((function(){var e=function(e){if(n&&C){var o=C.rowIndex,i=C.colIndex,a=C.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(r[o].row.rowMeta.rowId!==a){var c=r.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===c)return;o=c}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var d={rowIndex:o-1,colIndex:i,rowId:r[o-1].row.rowMeta.rowId};E(d)}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(d={rowIndex:o+1,colIndex:i,rowId:r[o+1].row.rowMeta.rowId},E(d))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(d={rowIndex:o,colIndex:i-1,rowId:r[o].row.rowMeta.rowId},E(d))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<t.length-1&&(d={rowIndex:o,colIndex:i+1,rowId:r[o].row.rowMeta.rowId},E(d))):"Escape"===e.key&&(u(new Set),v(new Set),p(null),y.current=null,I(null))}else b()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[b,t.length,C,M,E,n,r]);var W=a((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=k({colIndex:n,rowIndex:t,rowId:r}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),D=a((function(e){var n,t,o,i,a,c,d=e.colIndex,l=e.rowIndex,s=e.rowId,u=[],h=null===(o=null===(t=null===(n=r[l-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===o?void 0:o.rowId,v={colIndex:d,rowIndex:l+1,rowId:null===(c=null===(a=null===(i=r[l+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===c?void 0:c.rowId},m={colIndex:d-1,rowIndex:l,rowId:s},g={colIndex:d+1,rowIndex:l,rowId:s};return(!W({colIndex:d,rowIndex:l-1,rowId:h})||f.has(d)&&0===l)&&u.push("st-selected-top-border"),(!W(v)||f.has(d)&&l===r.length-1)&&u.push("st-selected-bottom-border"),W(m)||u.push("st-selected-left-border"),W(g)||u.push("st-selected-right-border"),u.join(" ")}),[W,r,f]),H=d((function(){return C?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===C.rowIndex&&t===C.colIndex&&r===C.rowId}:function(){return!1}}),[C]);return{getBorderClass:D,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;if(n){x.current=!0,y.current={rowIndex:r,colIndex:t,rowId:o},v(new Set),p(null);var i=k({colIndex:t,rowIndex:r,rowId:o});u(new Set([i])),I({rowIndex:r,colIndex:t,rowId:o})}},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&x.current&&y.current){for(var i=new Set,a=Math.min(y.current.rowIndex,o),c=Math.max(y.current.rowIndex,o),d=Math.min(y.current.colIndex,t),l=Math.max(y.current.colIndex,t),s=a;s<=c;s++)for(var h=d;h<=l;h++)if(s>=0&&s<r.length){var f=r[s].row.rowMeta.rowId;i.add(k({colIndex:h,rowIndex:s,rowId:f}))}u(i)}},handleMouseUp:function(){x.current=!1},isInitialFocusedCell:H,isSelected:W,lastSelectedColumnIndex:g,selectColumns:S,selectedCells:s,selectedColumns:f,setInitialFocusedCell:I,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:re,headers:ye.current,visibleRows:vn}),pn=gn.getBorderClass,wn=gn.handleMouseDown,Cn=gn.handleMouseOver,In=gn.handleMouseUp,xn=gn.isInitialFocusedCell,yn=gn.isSelected,bn=gn.selectColumns,Rn=gn.selectedCells,Mn=gn.selectedColumns,En=gn.setInitialFocusedCell,Sn=gn.setSelectedCells,kn=gn.setSelectedColumns,Wn=a((function(e,n){dn(e,n)}),[dn]),Dn=a((function(e){ye.current=e,mn()}),[]);c((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(Rn.size>0&&Sn(new Set),Mn.size>0&&kn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,Rn,Mn,Sn,kn]),h((function(){if(We.current){var e=We.current.offsetWidth-We.current.clientWidth;nn(e)}}),[]),h((function(){var e=function(){if(mn(),We.current){var e=We.current.offsetWidth-We.current.clientWidth;nn(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var Hn=i(new Map);return c((function(){he&&(he.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,d=null===(t=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==d){var l=b({rowId:d,accessor:i}),s=Hn.current.get(l);s&&s.updateContent(c),void 0!==(null===(o=null===(r=null==Z?void 0:Z[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=c)}}})}),[he,Z]),e(D,p({value:{allowAnimations:l,cellRegistry:Hn.current,cellUpdateFlash:u,collapseIcon:v,columnReordering:y,columnResizing:E,draggedHeaderRef:xe,editColumns:H,expandIcon:A,forceUpdate:mn,getBorderClass:pn,handleMouseDown:wn,handleMouseOver:Cn,headersRef:ye,hiddenColumns:an,hoveredHeaderRef:be,isInitialFocusedCell:xn,isSelected:yn,mainBodyRef:Ee,nextIcon:q,onCellEdit:J,onColumnOrderChange:X,onSort:Wn,onTableHeaderDragEnd:Dn,pinnedLeftRef:Se,pinnedRightRef:ke,prevIcon:$,rowHeight:Q,scrollbarWidth:en,selectColumns:bn,selectableColumns:ie,setInitialFocusedCell:En,setIsWidthDragging:Oe,setMainBodyWidth:Ye,setPinnedLeftWidth:Xe,setPinnedRightWidth:Ge,setSelectedCells:Sn,setSelectedColumns:kn,shouldPaginate:ce,sortDownIcon:le,sortUpIcon:ue,tableBodyContainerRef:We,theme:ve,useOddColumnBackground:Ie,useHoverRowBackground:ge,useOddEvenRowBackground:we}},{children:e("div",p({className:"simple-table-root st-wrapper theme-".concat(ve),style:z?{height:z}:{}},{children:e(ze,{children:n("div",p({className:"st-wrapper-container"},{children:[n("div",p({className:"st-content-wrapper",onMouseUp:In,onMouseLeave:In},{children:[e(Re,{flattenedRows:un,isWidthDragging:Te,pinnedLeftWidth:Je,pinnedRightWidth:Ke,setFlattenedRows:hn,setScrollTop:Qe,sort:rn,visibleRows:vn}),e(Pe,{columnEditorText:I,editColumns:H,editColumnsInitOpen:P,headers:ye.current,hiddenColumns:an,position:w,setHiddenColumns:cn})]})),e(Me,{mainBodyRef:Ee,mainBodyWidth:Ue,pinnedLeftWidth:Je,pinnedRightWidth:Ke,setMainBodyWidth:Ye,tableBodyContainerRef:We}),e(N,{currentPage:Ne,hideFooter:U,onPageChange:Le,onNextPage:K,shouldPaginate:ce,totalPages:Math.ceil(Z.length/ne)})]}))})}))}))};export{je 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");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function i(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function c(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}d((r=r.apply(e,n||[])).next())}))}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(d){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,d])}}}function c(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var d=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},s=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},l=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},u=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return u(e)})):[e]},h=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(d({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},f=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(d({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){f(e)}))},v=function(e){return"number"==typeof e.minWidth?e.minWidth:40},m=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},g=n.createContext(void 0),p=function(n){var t=n.children,r=n.value;return e.jsx(g.Provider,o({value:r},{children:t}))},w=function(){var e=n.useContext(g);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},x=function(t){var r=t.currentPage,c=t.hideFooter,d=t.onPageChange,s=t.onNextPage,l=t.shouldPaginate,u=t.totalPages,h=w(),f=h.nextIcon,v=h.prevIcon,m=n.useState(!0),g=m[0],p=m[1],x=!(r>1),C=!(r<u)&&!s||!g&&r===u;if(c||!l)return null;var I=function(){if(u<=15)return Array.from({length:u},(function(e,n){return n+1}));var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=u-Math.floor(7.5))e=Math.max(1,u-o+1),n=u;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<u-1&&(t.push(-1),t.push(u)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){var e=r-1;e>=1&&d(e)},disabled:x},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return i(void 0,void 0,void 0,(function(){var e,n;return a(this,(function(t){switch(t.label){case 0:return e=r===u,n=r+1,s&&e?[4,s(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=u||s)&&d(n),[2]}}))}))},disabled:C},{children:f})),I.map((function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=u&&d(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},C=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},I=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},y=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},b=function(e){return e.position*(e.rowHeight+1)-1},R=function(e){return e.position*(e.rowHeight+1)},E=function(t){var r=t.children,i=t.onClose,a=t.open,c=t.setOpen,d=t.width,s=t.containerRef,l=w(),u=null==l?void 0:l.mainBodyRef,h=n.useRef(null),f=n.useRef(null),v=n.useState("bottom-left"),m=v[0],g=v[1],p=n.useState({}),x=p[0],C=p[1],I=n.useState(!1),y=I[0],b=I[1];return n.useEffect((function(){a&&h.current?(b(!1),!f.current&&h.current.parentElement&&(f.current=h.current.parentElement),requestAnimationFrame((function(){if(h.current&&f.current){var e,n=h.current,t=f.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==u?void 0:u.current)?u.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,c="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var v="left";o>e.right-t.right+t.width&&(v="right"),"bottom"===c?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===v?l.left=t.left:l.right=window.innerWidth-t.right,g("".concat(c,"-").concat(v)),C(l),b(!0)}}))):a||b(!1)}),[a,d,s,u]),n.useEffect((function(){var e=function(e){if(a&&h.current){var n=e.target;h.current&&!h.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,i,c]),n.useEffect((function(){var e=function(e){h.current&&!h.current.contains(e.target)&&(c(!1),null==i||i())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[i,a,c]),n.useEffect((function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[i,a,c]),a?e.jsx("div",o({ref:h,className:"st-dropdown-content st-dropdown-".concat(m),style:o({width:d?"".concat(d,"px"):"auto",visibility:y?"visible":"hidden"},x)},{children:r})):null},S=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,c=n.disabled,d=void 0!==c&&c,s=n.className,l=void 0===s?"":s;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(d?"disabled":""," ").concat(l),onClick:function(){!d&&r&&r()},role:"option","aria-selected":a,"aria-disabled":d},{children:t}))},j=function(t){var r=t.onBlur,i=t.onChange,a=t.open,c=t.setOpen,d=t.value,s=n.useState(d),l=s[0],u=s[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(e){u(e),i(e),c(!1),r()};return e.jsxs(E,o({open:a,onClose:function(){r()},setOpen:c,width:120},{children:[e.jsx(S,o({isSelected:!0===l,onClick:function(){return h(!0)}},{children:"True"})),e.jsx(S,o({isSelected:!1===l,onClick:function(){return h(!1)}},{children:"False"}))]}))},M=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},k=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},W=function(t){var r,i,a=t.value,c=t.onChange,d=t.onClose,s=w(),l=s.nextIcon,u=s.prevIcon,h=n.useState(a||new Date),f=h[0],v=h[1],m=n.useState("days"),g=m[0],p=m[1],x=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===g&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:u})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return p("months")}},{children:[(i=f,i.toLocaleString("default",{month:"long"}))," ",f.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:l}))]}),"months"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return p("years")}},{children:f.getFullYear()})),"years"===g&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(g,"-grid")},{children:["days"===g&&function(){var n=[],t=f.getFullYear(),r=f.getMonth(),i=x(t,r),s=function(e,n){return new Date(e,n,1).getDay()}(t,r),l=x(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach((function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))}));for(var u=function(t){var r=l-s+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()-1,e);v(n),c(n),null==d||d()}(r)}},{children:r}),"prev-".concat(r)))},h=0;h<s;h++)u(h);for(var m=function(i){var s=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),l=i===new Date(a).getDate()&&r===new Date(a).getMonth()&&t===new Date(a).getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(s?"today":""," ").concat(l?"selected":""),onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth(),e);v(n),c(n),null==d||d()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)m(g);var p=35-(s+i),w=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()+1,e);v(n),c(n),null==d||d()}(t)}},{children:t}),"next-".concat(t)))};for(g=1;g<=p;g++)w(g);return n}(),"months"===g&&(r=[],Array.from({length:12},(function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})})).forEach((function(n,t){var i=t===f.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(f.getFullYear(),e,1)),p("days")}(t)}},{children:n}),"month-".concat(t)))})),r),"years"===g&&function(){for(var n=[],t=f.getFullYear(),r=t-6,i=function(r){var i=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(e,f.getMonth(),1)),p("months")}(r)}},{children:r}),"year-".concat(r)))},a=r;a<r+12;a++)i(a);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),c(e),null==d||d()}},{children:"Today"}))}))]}))},D=function(t){var r=t.onBlur,i=t.onChange,a=t.open,c=t.setOpen,d=t.value,s=n.useState(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(d)),l=s[0],u=s[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){r()};return e.jsx(E,o({open:a,onClose:h,setOpen:c,width:280},{children:e.jsx(W,{value:l,onChange:function(e){u(e),i(e.toISOString()),c(!1),r()},onClose:h})}))},H=function(t){var r=t.onBlur,i=t.onChange,a=t.open,c=t.options,d=t.setOpen,s=t.value,l=n.useState(s||""),u=l[0],h=l[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e.jsx(E,o({open:a,onClose:function(){r()},setOpen:d,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:c.map((function(n){return e.jsx(S,o({isSelected:u===n,onClick:function(){return h(e=n),i(e),d(!1),void r();var e}},{children:n}),n)}))}))}))},N=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,d=n.value,s=function(){i(!1)};if("boolean"===c&&"boolean"==typeof d)return e.jsx(j,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:d});if("date"===c){var l="string"==typeof d?d:"";return e.jsx(D,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l})}if("enum"===c){var u="string"==typeof d?d:"";return e.jsx(H,{onBlur:s,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:u})}if("number"===c&&"number"==typeof d)return e.jsx(k,{defaultValue:d,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var h=null==d?"":String(d);return e.jsx(M,{defaultValue:h,onBlur:s,onChange:function(e){return o(e)}})},L=0,B=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===L||o-L>=r)&&(L=o,n(t))}},T=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(T);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=T(e[t]));return n},O=Date.now(),P={screenX:0,screenY:0},F=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return c(c([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=F(o.children,n,c(c([],t,!0),[r],!1));if(i)return i}}return null};var A=function(e){var t,r,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,c=e.onColumnOrderChange,d=e.onTableHeaderDragEnd,s=(t=i.current,r=n.useRef(t),n.useEffect((function(){JSON.stringify(r.current)!==JSON.stringify(t)&&(r.current=t)}),[t]),r.current);return{handleDragStart:function(e){o.current=e,O=Date.now()},handleDragOver:function(e){var n,t,r=e.event,c=e.hoveredHeader;if(r.preventDefault(),i.current){var l=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,h=r.screenY,f=Math.sqrt(Math.pow(u-P.screenX,2)+Math.pow(h-P.screenY,2));a.current=c;var v=i.current,m=F(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),g=F(v,c.accessor);if(m&&g){var p=m.length,w=g.length,x=g;if(p!==w){var C=w-p;C>0&&(x=g.slice(0,-C))}var I=function(e,n,t){var r=T(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,x),y=I.newHeaders,b=I.emergencyBreak;if(!(l||c.accessor===(null===(t=o.current)||void 0===t?void 0:t.accessor)||null===o.current||f<10||0===m.length||0===x.length||JSON.stringify(y)===JSON.stringify(i.current)||b)){var R=Date.now();JSON.stringify(y)===JSON.stringify(s)&&(R-O<1500||f<40)||(O=R,P={screenX:u,screenY:h},d(y))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==c||c(i.current)}}},z=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},U=n.forwardRef((function(t,r){var i,a,c=t.borderClass,s=t.colIndex,u=t.header,h=t.isHighlighted,f=t.isInitialFocused,v=t.nestedIndex,m=t.onExpandRowClick,g=t.rowIndex,p=t.visibleRow,x=w(),C=x.cellRegistry,I=x.cellUpdateFlash,y=x.collapseIcon,b=x.draggedHeaderRef,R=x.expandIcon,E=x.handleMouseDown,S=x.handleMouseOver,j=x.headersRef,M=x.hoveredHeaderRef,k=x.onCellEdit,W=x.onTableHeaderDragEnd,D=x.useOddColumnBackground,H=p.depth,L=p.row,T=n.useState(L.rowData[u.accessor]),O=T[0],P=T[1],F=n.useState(!1),U=F[0],Y=F[1],q=n.useState(!1),J=q[0],X=q[1],V=n.useRef(null),K=A({draggedHeaderRef:b,headersRef:j,hoveredHeaderRef:M,onTableHeaderDragEnd:W}).handleDragOver,G=B(),_="cell-".concat(g,"-").concat(s),$=l({rowId:L.rowMeta.rowId,accessor:u.accessor});n.useEffect((function(){if(C){var e="".concat(L.rowMeta.rowId,"-").concat(u.accessor);return C.set(e,{updateContent:function(e){O!==e?(P(e),I&&(X(!0),V.current&&clearTimeout(V.current),V.current=setTimeout((function(){X(!1)}),800))):P(e)}}),function(){C.delete(e),V.current&&clearTimeout(V.current)}}}),[C,I,L.rowMeta.rowId,u.accessor,O]),n.useEffect((function(){if(J){var e=setTimeout((function(){X(!1)}),850);return function(){return clearTimeout(e)}}}),[J]),n.useEffect((function(){P(L.rowData[u.accessor])}),[L.rowData,u.accessor]),n.useEffect((function(){h||Y(!1)}),[h]);var Q="boolean"===u.type||"date"===u.type||"enum"===u.type,Z=Boolean(null===(a=null===(i=L.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),ee=Boolean(null==u?void 0:u.isEditable),ne="st-cell ".concat(H>0&&u.expandable?"st-cell-depth-".concat(H):""," ").concat(h?f?"st-cell-selected-first ".concat(c):"st-cell-selected ".concat(c):""," ").concat(ee?"clickable":""," ").concat(J?"st-cell-updating":""," ").concat(D?v%2==0?"even-column":"odd-column":""),te=n.useCallback((function(e){P(e),null==k||k({accessor:u.accessor,newValue:e,row:L})}),[u.accessor,k,L]);return U&&!Q?e.jsx("div",o({className:"st-cell-editing",id:d({accessor:u.accessor,rowIndex:g+1})},{children:e.jsx(N,{enumOptions:u.enumOptions,onChange:te,setIsEditing:Y,type:u.type,value:O})})):e.jsxs("div",o({className:ne,id:_,onDoubleClick:function(){return u.isEditable&&Y(!0)},onMouseDown:function(){return E({rowIndex:g,colIndex:s,rowId:L.rowMeta.rowId})},onMouseOver:function(){return S({rowIndex:g,colIndex:s,rowId:L.rowMeta.rowId})},onDragOver:function(e){return G({callback:K,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||U||(e.preventDefault(),Y(!0))},ref:r,"data-row-index":g,"data-col-index":s,"data-row-id":L.rowMeta.rowId,"data-accessor":u.accessor},{children:[u.expandable&&Z?L.rowMeta.isExpanded?e.jsx("div",o({className:"st-sort-icon-container",onClick:function(){return m(L.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):e.jsx("div",o({className:"st-sort-icon-container",onClick:function(){return m(L.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:R})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:L}):z({content:O,header:u})})})),U&&Q&&e.jsx(N,{enumOptions:u.enumOptions,onChange:te,setIsEditing:Y,type:u.type,value:O})]}),$)})),Y=function(n){var t=n.children,r=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children"]);return w().allowAnimations?e.jsx(q,o({},r,{children:t})):e.jsx(e.Fragment,{children:t})},q=function(t){var r=t.children,o=t.isBody,i=t.pauseAnimation,a=t.rowIndex,c=n.useRef(!1),s=w(),l=s.draggedHeaderRef,u=s.headersRef,h=s.mainBodyRef,f=s.shouldPaginate,v=n.useState({}),m=v[0],g=v[1],p=n.useRef({}),x=u.current;return n.useLayoutEffect((function(){if(x){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(d({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),c=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=c}}})),o}({currentHeaders:x,draggedHeaderRef:l,rowIndex:a});JSON.stringify(e)!==JSON.stringify(m)&&(p.current=m,g(e))}}),[m,x,l,o,a]),n.useLayoutEffect((function(){var e=h.current,n=function(){c.current=!0},t=function(){c.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[l,h]),n.useEffect((function(){i||c.current||Object.keys(p.current).length&&x&&x.forEach((function(e){var n=document.getElementById(d({accessor:e.accessor,rowIndex:a}));if(n){var t=p.current[e.accessor],r=m[e.accessor];if(t&&r){var o=t.left-r.left,i=f?0:t.top-r.top,c=Math.abs(o),s=Math.abs(i);(c>10||s>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,x,o,i,p,a,f]),e.jsx(e.Fragment,{children:r})},J=function(n){var t=n.columnIndexStart,r=n.columnIndices,i=n.headers,a=n.hiddenColumns,c=n.isWidthDragging,l=n.onExpandRowClick,u=n.pinned,h=n.rowIndex,f=n.rowIndices,v=n.visibleRow,m=i.filter((function(e){return s({hiddenColumns:a,header:e,pinned:u})}));return e.jsx(Y,o({isBody:!0,pauseAnimation:c,rowIndex:h+1},{children:m.map((function(n,o){return e.jsx(X,{columnIndices:r,header:n,headers:i,hiddenColumns:a,nestedIndex:o+(null!=t?t:0),onExpandRowClick:l,pinned:u,rowIndex:h,rowIndices:f,visibleRow:v},d({accessor:n.accessor,rowIndex:h+1}))}))}))},X=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.hiddenColumns,c=t.nestedIndex,l=t.onExpandRowClick,u=t.pinned,h=t.rowIndex,f=t.rowIndices,v=t.visibleRow,m=r[o.accessor],g=w(),p=g.getBorderClass,x=g.isSelected,C=g.isInitialFocusedCell;if(o.children){var I=o.children.filter((function(e){return s({hiddenColumns:a,header:e,pinned:u})}));return e.jsx(n.Fragment,{children:I.map((function(n){return e.jsx(X,{columnIndices:r,header:n,headers:i,hiddenColumns:a,nestedIndex:c,onExpandRowClick:l,pinned:u,rowIndex:h,rowIndices:f,visibleRow:v},d({accessor:n.accessor,rowIndex:h+1}))}))})}var y={rowIndex:h,colIndex:m,rowId:v.row.rowMeta.rowId},b=p(y),R=x(y),E=C(y);return e.jsx(U,{borderClass:b,colIndex:m,header:o,isHighlighted:R,isInitialFocused:E,nestedIndex:c,onExpandRowClick:l,rowIndex:h,visibleRow:v},d({accessor:o.accessor,rowIndex:h+1}))},V=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,c=n.hiddenColumns,d=n.hoveredIndex,s=n.index,l=n.isWidthDragging,u=n.onExpandRowClick,h=n.pinned,f=n.rowHeight,v=n.rowIndices,m=n.setHoveredIndex,g=n.visibleRow,p=w().useHoverRowBackground,x=g.position,C=x%2==0;return e.jsx("div",o({className:"st-row ".concat(C?"even":"odd"," ").concat(d===s&&p?"hovered":""),onMouseEnter:function(){m(s)},style:{gridTemplateColumns:i,top:R({position:x,rowHeight:f}),height:"".concat(f,"px")}},{children:e.jsx(J,{columnIndexStart:r,columnIndices:t,headers:a,hiddenColumns:c,isWidthDragging:l,onExpandRowClick:u,pinned:h,rowIndex:s,rowIndices:v,visibleRow:g},s)}))},K=function(n){var t=n.displayStrongBorder,r=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",o({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:b({position:r,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},G=n.createContext(void 0),_=function(e){return Array.isArray(e)?e:[e]},$=function(e){var t=e.attachTo,r=e.children,o=e.group,i=void 0===o?"default":o,a=e.innerRef,c=function(){var e=n.useContext(G);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),d=n.useRef(null),s=n.useRef(null),l=n.useCallback((function(){s.current=t?"function"==typeof t?null:t.current:d.current}),[t]);return n.useEffect((function(){return l(),s.current&&c.registerPane(s.current,_(i)),function(){s.current&&c.unregisterPane(s.current,_(i))}}),[c,i,t,l]),t?r:n.cloneElement(r,{ref:function(e){d.current=e,"function"==typeof a?a(e):a&&e&&(a.current=e)}})},Q=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},Z=function(t){var r=t.columnIndexStart,i=t.columnIndices,a=t.headers,c=t.hiddenColumns,d=t.hoveredIndex,s=t.isWidthDragging,l=t.onExpandRowClick,u=t.pinned,h=t.ref,f=t.rowHeight,v=t.rowIndices,m=t.setHoveredIndex,g=t.templateColumns,p=t.totalHeight,w=t.visibleRows,x=t.width,C=u?"st-body-pinned-".concat(u):"st-body-main";return e.jsx(Q,o({condition:!u,wrapper:function(n){return e.jsx($,{children:n})}},{children:e.jsx("div",o({className:C,ref:h,id:h?"testss":void 0,style:o({position:"relative",height:"".concat(p,"px"),width:x},!u&&{flexGrow:1})},{children:w.map((function(t,o){var h,p,x=w[o-1],C=Boolean((null==x?void 0:x.depth)!==(null==t?void 0:t.depth)&&(null===(p=null===(h=null==t?void 0:t.row.rowMeta)||void 0===h?void 0:h.children)||void 0===p?void 0:p.length)&&0===t.depth);return e.jsxs(n.Fragment,{children:[0!==o&&e.jsx(K,{displayStrongBorder:C,position:t.position,rowHeight:f,templateColumns:g}),e.jsx(V,{columnIndexStart:r,columnIndices:i,gridTemplateColumns:g,headers:a,hiddenColumns:c,hoveredIndex:d,index:o,isWidthDragging:s,onExpandRowClick:l,pinned:u,rowHeight:f,rowIndices:v,setHoveredIndex:m,visibleRow:t})]},t.position)}))}))}))};function ee(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,c=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 s({hiddenColumns:t,header:e})})).forEach((function(e,n){c(e,0===n)}))};return r.forEach((function(e,n){c(e,0===n)})),n.current.filter((function(e){return!e.pinned&&s({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;c(e,t)})),o.forEach((function(e){c(e,!1)})),i}var ne=function(t){var r=t.flattenedRows,i=t.headerContainerRef,a=t.isWidthDragging,c=t.mainTemplateColumns,d=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,l=t.pinnedLeftWidth,u=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,f=t.pinnedRightWidth,v=t.setFlattenedRows,m=t.setScrollTop,g=t.visibleRows,p=w(),x=p.headersRef,C=p.hiddenColumns,I=p.mainBodyRef,y=p.rowHeight,b=p.scrollbarWidth,R=p.tableBodyContainerRef,E=n.useState(null),S=E[0],j=E[1];!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],c=i[1];n.useEffect((function(){var e=null==t?void 0:t.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")}}),[t,a,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[t,r])}({headerContainerRef:i,mainSectionRef:R,scrollbarWidth:b});var M,k,W=n.useRef(null),D=(M=0,(k=function(e){e.forEach((function(e){M+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&k(e.rowMeta.children)}))})(r),M)*(y+1)-1,H=n.useMemo((function(){return ee({headersRef:x,hiddenColumns:C,pinnedLeftColumns:d,pinnedRightColumns:u})}),[x,C,d,u]),N=n.useMemo((function(){var e={};return g.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[g]),L=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?o(o({},t),{rowMeta:o(o({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?o(o({},t),{rowMeta:o(o({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};v((function(e){return e.map(n)}))},B={columnIndices:H,headerContainerRef:i,headers:x.current,hiddenColumns:C,hoveredIndex:S,isWidthDragging:a,rowHeight:y,rowIndices:N,setHoveredIndex:j,visibleRows:g};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return j(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;W.current&&cancelAnimationFrame(W.current),W.current=requestAnimationFrame((function(){m(n)}))},ref:R},{children:[d.length>0&&e.jsx(Z,o({},B,{onExpandRowClick:L,pinned:"left",templateColumns:s,totalHeight:D,width:l})),e.jsx(Z,o({},B,{columnIndexStart:d.length,onExpandRowClick:L,ref:I,templateColumns:c,totalHeight:D})),u.length>0&&e.jsx(Z,o({},B,{columnIndexStart:d.length+c.length,onExpandRowClick:L,pinned:"right",templateColumns:h,totalHeight:D,width:f}))]}))},te=function(e){return void 0===e&&(e=0),e?e+1:0},re=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:u(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=h(e))})))})),n.pinned?te(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},oe=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,d=e.setMainBodyWidth,s=e.setPinnedLeftWidth,l=e.setPinnedRightWidth,h=e.startWidth;c(!0),n.preventDefault();var m="clientX"in n?n.clientX:n.touches[0].clientX,g="touches"in n;if(i&&!i.hide){var p=v(i),w=r-o>1,x=w?u(i):[i],C=function(e){var n="right"===i.pinned?m-e:e-m;if(w&&x.length>1)ie({delta:n,header:i,headersRef:a,leafHeaders:x,minWidth:p,setMainBodyWidth:d,setPinnedLeftWidth:s,setPinnedRightWidth:l,startWidth:h});else{var r=Math.max(h+n,p);i.width=r,re({header:i,headers:a.current,newWidth:r,setMainBodyWidth:d,setPinnedLeftWidth:s,setPinnedRightWidth:l})}a.current.forEach((function(e){f(e)})),t()};if(g){var I=function(e){var n=e.touches[0];C(n.clientX)},y=function(){document.removeEventListener("touchmove",I),document.removeEventListener("touchend",y),c(!1)};document.addEventListener("touchmove",I),document.addEventListener("touchend",y)}else{var b=function(e){C(e.clientX)},R=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",R),c(!1)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",R)}}},ie=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,d=e.setPinnedRightWidth,s=e.startWidth,l=o.reduce((function(e,n){return Math.min(e,v(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(s+n,l);re({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:d});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},ae=n.forwardRef((function(t,r){var i,a,s=t.colIndex,l=t.forceHeadersUpdate,u=t.gridColumnEnd,h=t.gridColumnStart,f=t.gridRowEnd,v=t.gridRowStart,m=t.header,g=t.reverse,p=t.sort,x=w(),C=x.columnReordering,I=x.columnResizing,y=x.draggedHeaderRef,b=x.forceUpdate,R=x.headersRef,E=x.hoveredHeaderRef,S=x.onColumnOrderChange,j=x.onSort,M=x.onTableHeaderDragEnd,k=x.rowHeight,W=x.selectColumns,D=x.selectableColumns,H=x.setInitialFocusedCell,N=x.setIsWidthDragging,L=x.setMainBodyWidth,T=x.setPinnedLeftWidth,O=x.setPinnedRightWidth,P=x.setSelectedCells,F=x.setSelectedColumns,z=x.sortDownIcon,U=x.sortUpIcon,Y=Boolean(null==m?void 0:m.isSortable),q="st-header-cell ".concat(m.accessor===(null===(i=E.current)||void 0===i?void 0:i.accessor)?"st-hovered":""," ").concat((null===(a=y.current)||void 0===a?void 0:a.accessor)===m.accessor?"st-dragging":""," ").concat(Y?"clickable":""," ").concat(C&&!Y?"columnReordering":""," ").concat(m.children?"parent":""),J=A({draggedHeaderRef:y,headersRef:R,hoveredHeaderRef:E,onColumnOrderChange:S,onTableHeaderDragEnd:M}),X=J.handleDragStart,V=J.handleDragEnd,K=J.handleDragOver,G=B(),_=function(e){var n=e.event,t=e.header;if(D){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,s);return n.shiftKey&&W?F((function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort((function(e,n){return e-n})),o=t[0],i=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)}));var a,d,s,l,u=c(c([],(a=o,d=n,s=Math.min(a,d),l=Math.max(a,d),Array.from({length:l-s+1},(function(e,n){return s+n}))),!0),r,!0);return new Set(c(c([],Array.from(e),!0),u,!0))})):W&&W(r),P(new Set),void H(null)}t.isSortable&&j(s,t.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)}}),[]),!m)return null;var $=I&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;G({callback:oe,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:u,gridColumnStart:h,header:m,headersRef:R,setIsWidthDragging:N,setMainBodyWidth:L,setPinnedLeftWidth:T,setPinnedRightWidth:O,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;G({callback:oe,callbackProps:{event:e,forceUpdate:b,gridColumnEnd:u,gridColumnStart:h,header:m,headersRef:R,setIsWidthDragging:N,setMainBodyWidth:L,setPinnedLeftWidth:T,setPinnedRightWidth:O,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Q=p&&p.key.accessor===m.accessor&&e.jsxs("div",o({className:"st-sort-icon-container",onClick:function(e){return _({event:e,header:m})}},{children:["ascending"===p.direction&&U&&U,"descending"===p.direction&&z&&z]}));return e.jsxs("div",o({className:q,id:d({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){G({callback:K,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:r,style:o(o({gridRowStart:v,gridRowEnd:f,gridColumnStart:h,gridColumnEnd:u},u-h>1?{}:{width:m.width}),f-v>1?{}:{height:k})},{children:[g&&$,"right"===m.align&&Q,e.jsx("div",o({className:"st-header-label",draggable:C&&!m.disableReorder,onClick:function(e){return _({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),V(),l()},onDragStart:function(e){C&&m&&function(e){X(e)}(m)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":"left-aligned")},{children:null==m?void 0:m.label}))})),"right"!==m.align&&Q,!g&&$]}))})),ce=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,c=t.headersRef,d=t.hiddenColumns,l=t.maxDepth,u=t.pinned,h=t.sectionRef,f=t.sort,v=n.useReducer((function(e){return e+1}),0)[1],m=n.useMemo((function(){var e=[],n=1,t=function(o,i,a){var c,h;if(void 0===a&&(a=!1),!s({hiddenColumns:d,header:o,pinned:u}))return 0;a||n++;var f=null!==(h=null===(c=o.children)||void 0===c?void 0:c.filter((function(e){return s({hiddenColumns:d,header:e,pinned:u})})).length)&&void 0!==h?h:0,v=n,m=f>0?v+f:v+1,g=i,p=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:m,gridRowStart:g,gridRowEnd:p,colIndex:r[o.accessor]}),o.children){var w=!0;o.children.forEach((function(e){s({hiddenColumns:d,header:e,pinned:u})&&(t(e,i+1,w),w=!1)}))}return m-v},o=c.current.filter((function(e){return s({hiddenColumns:d,header:e,pinned:u})})),i=!0;return o.forEach((function(e){t(e,1,i),i=!1})),e}),[c,d,l,u,r]);return e.jsx(Q,o({condition:!u,wrapper:function(n){return e.jsx($,{children:n})}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},a&&{onScroll:a},{ref:h,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(Y,o({rowIndex:0},{children:m.map((function(t){return e.jsx(ae,{colIndex:t.colIndex,forceHeadersUpdate:v,gridColumnEnd:t.gridColumnEnd,gridColumnStart:t.gridColumnStart,gridRowEnd:t.gridRowEnd,gridRowStart:t.gridRowStart,header:t.header,ref:n.createRef(),reverse:"right"===u,sort:f},t.header.accessor)}))}))}))}))},de=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(de)):1},se=function(t){var r=t.centerHeaderRef,i=t.headerContainerRef,a=t.headersRef,c=t.hiddenColumns,d=t.mainTemplateColumns,l=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.sort,m=w(),g=m.pinnedLeftRef,p=m.pinnedRightRef,x=m.setPinnedLeftWidth,C=m.setPinnedRightWidth,I=n.useMemo((function(){return ee({headersRef:a,hiddenColumns:c,pinnedLeftColumns:l,pinnedRightColumns:h})}),[a,c,l,h]),y=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(s({hiddenColumns:c,header:e})){var t=de(e);n=Math.max(n,t)}})),{maxDepth:n}}),[a,c]).maxDepth;return n.useLayoutEffect((function(){var e,n;x(te(null===(e=g.current)||void 0===e?void 0:e.clientWidth)),C(te(null===(n=p.current)||void 0===n?void 0:n.clientWidth))}),[g,p,x,C]),e.jsxs("div",o({className:"st-header-container",ref:i},{children:[l.length>0&&e.jsx(ce,{columnIndices:I,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:y,pinned:"left",sectionRef:g,sort:v}),e.jsx(ce,{columnIndices:I,gridTemplateColumns:d,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:y,sectionRef:r,sort:v}),h.length>0&&e.jsx(ce,{columnIndices:I,gridTemplateColumns:f,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:y,pinned:"right",sectionRef:p,sort:v})]}))},le=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},ue=function(t){var r=t.flattenedRows,i=t.isWidthDragging,a=t.pinnedLeftWidth,c=t.pinnedRightWidth,d=t.setFlattenedRows,s=t.setScrollTop,l=t.sort,u=t.visibleRows,h=w(),f=h.columnResizing,v=h.editColumns,m=h.headersRef,g=h.hiddenColumns,p=n.useRef(null),x=n.useRef(null),C=m.current.filter((function(e){return!e.pinned})),I=m.current.filter((function(e){return"left"===e.pinned})),y=m.current.filter((function(e){return"right"===e.pinned})),b=n.useMemo((function(){return le({headers:I,hiddenColumns:g})}),[I,g]),R=n.useMemo((function(){return le({headers:C,hiddenColumns:g})}),[C,g]),E=n.useMemo((function(){return le({headers:y,hiddenColumns:g})}),[y,g]),S={centerHeaderRef:x,headerContainerRef:p,headersRef:m,hiddenColumns:g,mainTemplateColumns:R,pinnedLeftColumns:I,pinnedLeftTemplateColumns:b,pinnedRightColumns:y,pinnedRightTemplateColumns:E,sort:l},j={flattenedRows:r,headerContainerRef:p,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:I,pinnedLeftTemplateColumns:b,pinnedLeftWidth:a,pinnedRightColumns:y,pinnedRightTemplateColumns:E,pinnedRightWidth:c,setFlattenedRows:d,setScrollTop:s,visibleRows:u};return e.jsxs("div",o({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(se,o({},S)),e.jsx(ne,o({},j))]}))},he=function(t){var r,i,a=t.mainBodyWidth,c=t.mainBodyRef,d=t.pinnedLeftWidth,s=t.pinnedRightWidth,l=t.setMainBodyWidth,u=t.tableBodyContainerRef,h=w().editColumns,f=n.useState(!1),v=f[0],m=f[1],g=n.useRef(null),p=u.current&&u.current.scrollHeight>u.current.clientHeight,x=h?28:0,C=(h?s+1:s)+(u.current&&p?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect((function(){setTimeout((function(){var e,n;e=document.getElementById("testss"),n=null==e?void 0:e.scrollWidth,console.log(n),e&&l(n||0)}),1)}),[c,l]),n.useEffect((function(){setTimeout((function(){!function(){var e=document.getElementById("testss");if(e){var n=e.clientWidth;m(a>n)}}()}),1)}),[c,a,l]),v?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[d>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:d,height:null===(r=g.current)||void 0===r?void 0:r.offsetHeight}}),a>0&&e.jsx($,{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:g,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})}))}),s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(i=g.current)||void 0===i?void 0:i.offsetHeight}}),x>0&&e.jsx("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},fe={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return fe.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?fe.string(e,n,t):"number"==typeof e&&"number"==typeof n?fe.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?fe.boolean(e,n,t):fe.string(String(e),String(n),t)}},ve=function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return fe.number(i,a,r)}return"date"===t?fe.date(String(e),String(n),r):"boolean"===t?fe.boolean(Boolean(e),Boolean(n),r):"enum"===t?fe.enum(String(e),String(n),r):fe.string(String(e),String(n),r)},me=function(e,n,t){var r,i=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",a=n.direction,d=new Map,s=new Map,l="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(d.size)).toString();l=r,s.set(l,e),d.has(l)||d.set(l,[])}else if(l){var o=d.get(l)||[];o.push(e),d.set(l,o)}else{var i="default";d.has(i)||d.set(i,[]),null===(t=d.get(i))||void 0===t||t.push(e)}}));var u=[];return d.forEach((function(e,r){if(s.has(r)){var d=s.get(r);d.rowMeta.children&&d.rowMeta.children.length>0&&(d.rowMeta.children=ge(d.rowMeta.children,n,t)),u.push(d)}var l=c([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],c=t.rowData[r];return ve(o,c,i,a)}));u.push.apply(u,l.map((function(e){var r=o({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var i=ge(r.rowMeta.children,n,t);r.rowMeta=o(o({},r.rowMeta),{children:i})}return r})))})),u},ge=function(e,n,t){var r=t.find((function(e){return e.accessor===n.key.accessor})),i=(null==r?void 0:r.type)||"string",a=n.direction;return c([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],c=t.rowData[r];return ve(o,c,i,a)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?o(o({},e),{rowMeta:o(o({},e.rowMeta),{children:ge(e.rowMeta.children,n,t)})}):e}))},pe=function(e){var t=e.headers,r=e.tableRows,o=n.useState(null),i=o[0],a=o[1],c=n.useMemo((function(){var e={};return t.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[t]),d=n.useState(c),s=d[0],l=d[1],u=n.useMemo((function(){if(!i)return r;var e=function(e,n,t){return{sortedData:me(n,t,e),newSortConfig:t}}(t,r,i).sortedData;return e}),[r,i,t]);return{hiddenColumns:s,setHiddenColumns:l,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(t);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},we=function(n){var t=n.checked,r=void 0!==t&&t,i=n.children,a=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){a&&a(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},xe=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),d=!1;if(!c)for(var s=0,l=a.children;s<l.length;s++){var u=l[s];if(xe([u],n,t,r),!1===t[u.accessor]){d=!0;break}}(c||d)&&(t[a.accessor]=!1)}}},Ce=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},Ie=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(Ie(e.children,n),Ce(e.children,n)&&(n[e.accessor]=!0))}))},ye=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,c=t.header,d=t.hiddenColumns,s=t.setHiddenColumns,l=n.useState(!0),f=l[0],v=l[1],m=w(),g=m.expandIcon,p=m.collapseIcon,x=m.headersRef,C=m.setMainBodyWidth,I=m.setPinnedLeftWidth,y=m.setPinnedRightWidth,b="".concat(16*a,"px"),R=c.children&&c.children.length>0,E=d[c.accessor]||R&&c.children&&Ce(c.children,d);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:b}},{children:[e.jsx("div",o({className:"st-header-icon-container"},{children:R?e.jsx("div",o({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),v(!f)}},{children:f?p:g})):null})),e.jsx(we,o({checked:E,onChange:function(e){var n=o({},d);(n[c.accessor]=e,e)?Ie(r,n):(xe(r,c.accessor,n),R&&c.children&&c.children.length>0&&c.children.every((function(e){return!0===d[e.accessor]}))&&c.children[0]&&(n[c.children[0].accessor]=!1,xe(r,c.children[0].accessor,n)));s(n),x.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=u(e).reduce((function(e,n){return e+h(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var d=te(i),s=te(a);r(d),o(s),t(c)}({headers:x.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:y})}},{children:c.label}))]})),R&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map((function(n,t){return e.jsx(ye,{allHeaders:r,depth:a+1,header:n,hiddenColumns:d,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},be=function(n){var t=n.headers,r=n.open,i=n.position,a=n.setHiddenColumns,c=n.hiddenColumns,d="left"===i?"left":"";return e.jsx("div",o({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(d),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e.jsx(ye,{header:n,hiddenColumns:c,setHiddenColumns:a,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},Re=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,c=t.headers,d=t.hiddenColumns,s=t.position,l=void 0===s?"right":s,u=t.setHiddenColumns,h=n.useState(a),f=h[0],v=h[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(f?"open":""," ").concat(l),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(be,{headers:c,open:f,position:l,setHiddenColumns:u,hiddenColumns:d})]})):null},Ee=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"down-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Se=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"up-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},je=function(t){var i=t.children,a=t.onSync,c=n.useRef({}),d=n.useCallback((function(e,n){return!!c.current[n]&&c.current[n].find((function(n){return n===e}))}),[]),s=n.useCallback((function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)}),[]),l=n.useCallback((function(e){e.onscroll=null}),[]),u=n.useCallback((function(e,n){e.onscroll=function(){window.requestAnimationFrame((function(){n.forEach((function(n){var t;null===(t=c.current[n])||void 0===t||t.forEach((function(n){e!==n&&(l(n),s(e,n),window.requestAnimationFrame((function(){var e=Object.keys(c.current).filter((function(e){return c.current[e].includes(n)}));u(n,e)})))}))}))})),a&&a(e)}}),[a,l,s]),h=n.useCallback((function(e,n){n.forEach((function(n){c.current[n]||(c.current[n]=[]),d(e,n)||(c.current[n].length>0&&s(c.current[n][0],e),c.current[n].push(e))})),u(e,n)}),[d,s,u]),f=n.useCallback((function(e,n){n.forEach((function(n){if(d(e,n)){l(e);var t=c.current[n].indexOf(e);-1!==t&&c.current[n].splice(t,1)}}))}),[d,l]);return e.jsx(G.Provider,o({value:{registerPane:h,unregisterPane:f}},{children:r.default.Children.only(i)}))},Me=function(t){var r=t.allowAnimations,i=void 0!==r&&r,a=t.cellUpdateFlash,c=void 0!==a&&a,d=t.collapseIcon,s=void 0===d?e.jsx(y,{className:"st-sort-icon"}):d,h=t.columnEditorPosition,f=void 0===h?"right":h,v=t.columnEditorText,g=void 0===v?"Columns":v,w=t.columnReordering,b=void 0!==w&&w,R=t.columnResizing,E=void 0!==R&&R,S=t.defaultHeaders,j=t.editColumns,M=void 0!==j&&j,k=t.editColumnsInitOpen,W=void 0!==k&&k,D=t.expandIcon,H=void 0===D?e.jsx(I,{className:"st-sort-icon"}):D,N=t.height,L=t.hideFooter,B=void 0!==L&&L,T=t.nextIcon,O=void 0===T?e.jsx(I,{className:"st-next-prev-icon"}):T,P=t.onCellEdit,F=t.onColumnOrderChange,A=t.onGridReady,z=t.onNextPage,U=t.prevIcon,Y=void 0===U?e.jsx(C,{className:"st-next-prev-icon"}):U,q=t.rowHeight,J=void 0===q?40:q,X=t.rows,V=t.rowsPerPage,K=void 0===V?10:V,G=t.selectableCells,_=void 0!==G&&G,$=t.selectableColumns,Q=void 0!==$&&$,Z=t.shouldPaginate,ee=void 0!==Z&&Z,ne=t.sortDownIcon,te=void 0===ne?e.jsx(Ee,{className:"st-sort-icon"}):ne,re=t.sortUpIcon,oe=void 0===re?e.jsx(Se,{className:"st-sort-icon"}):re,ie=t.tableRef,ae=t.theme,ce=void 0===ae?"light":ae,de=t.useHoverRowBackground,se=void 0===de||de,le=t.useOddEvenRowBackground,fe=void 0===le||le,ve=t.useOddColumnBackground,me=void 0!==ve&&ve;me&&(fe=!1);var ge=n.useRef(null),we=n.useRef(S),xe=n.useRef(null),Ce=n.useRef(null),Ie=n.useRef(null),ye=n.useRef(null),be=n.useRef(null),Me=n.useState(1),ke=Me[0],We=Me[1],De=n.useState(!1),He=De[0],Ne=De[1],Le=n.useState(0),Be=Le[0],Te=Le[1],Oe=n.useState(0),Pe=Oe[0],Fe=Oe[1],Ae=n.useState(0),ze=Ae[0],Ue=Ae[1],Ye=n.useState(0),qe=Ye[0],Je=Ye[1],Xe=n.useState(0),Ve=Xe[0],Ke=Xe[1],Ge=pe({headers:we.current,tableRows:X}),_e=Ge.sort,$e=Ge.sortedRows,Qe=Ge.hiddenColumns,Ze=Ge.setHiddenColumns,en=Ge.updateSort;n.useEffect((function(){null==A||A()}),[A]);var nn=n.useMemo((function(){if(!ee)return $e;var e=(ke-1)*K,n=e+K;return $e.slice(e,n)}),[ke,K,ee,$e]),tn=n.useState(nn),rn=tn[0],on=tn[1];n.useEffect((function(){on(nn)}),[nn]);var an=n.useMemo((function(){var e;if(!N)return window.innerHeight-J;var n=document.querySelector(".simple-table-root"),t=0;if(N.endsWith("px"))t=parseInt(N,10);else if(N.endsWith("vh")){var r=parseInt(N,10);t=window.innerHeight*r/100}else if(N.endsWith("%")){var o=parseInt(N,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-J)}),[N,J]),cn=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],d=0,s=Math.max(0,i-a*n),l=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=d*a;if(h>=l)break;h+a>s&&c.push({row:i,depth:n,position:d,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),d+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:an,flattenedRows:rn,rowHeight:J,scrollTop:qe})}),[an,J,rn,qe]),dn=n.useReducer((function(e){return e+1}),0)[1],sn=function(e){var t=e.selectableCells,r=e.headers,o=e.visibleRows,i=n.useState(new Set),a=i[0],c=i[1],d=n.useState(new Set),s=d[0],l=d[1],h=n.useState(null),f=h[0],v=h[1],g=n.useState(null),p=g[0],w=g[1],x=n.useRef(!1),C=n.useRef(null),I=n.useCallback((function(){var e=r.flatMap(u).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var t=Array.from(a).reduce((function(e,t){var r=t.split("-").map(Number),i=r[0],a=r[1];e[i]||(e[i]=[]);var c=n.get(a);return e[i][a]=c?o[i].row.rowData[c]:"",e}),{}),i=Object.values(t).map((function(e){return Object.values(e).join("\t")})).join("\n");a.size>0&&navigator.clipboard.writeText(i)}),[r,a,o]),y=n.useCallback((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),d=Math.max(e.colIndex,n.colIndex),s=r;s<=i;s++)for(var u=a;u<=d;u++)if(s>=0&&s<o.length){var h=o[s].row.rowMeta.rowId;t.add(m({colIndex:u,rowIndex:s,rowId:h}))}l(new Set),v(null),c(t)}),[o,l,v,c]),b=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<r.length){var n=m(e);l(new Set),v(null),c(new Set([n])),w(e)}}),[r.length,o.length,l,v,c,w]),R=n.useCallback((function(e,n){void 0===n&&(n=!1),c(new Set),w(null),l((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&v(e[e.length-1])}),[c,w,l,v]);n.useEffect((function(){var e=function(e){if(t&&p){var n=p.rowIndex,i=p.colIndex,a=p.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var d=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===d)return;n=d}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};b(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(s={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},b(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(s={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},b(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<r.length-1&&(s={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},b(s))):"Escape"===e.key&&(c(new Set),l(new Set),v(null),C.current=null,w(null))}else I()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[I,r.length,p,y,b,t,o]);var E=n.useCallback((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r}),i=a.has(o),c=s.has(n);return i||c}),[a,s]),S=n.useCallback((function(e){var n,t,r,i,a,c,d=e.colIndex,l=e.rowIndex,u=e.rowId,h=[],f=null===(r=null===(t=null===(n=o[l-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:d,rowIndex:l+1,rowId:null===(c=null===(a=null===(i=o[l+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===c?void 0:c.rowId},m={colIndex:d-1,rowIndex:l,rowId:u},g={colIndex:d+1,rowIndex:l,rowId:u};return(!E({colIndex:d,rowIndex:l-1,rowId:f})||s.has(d)&&0===l)&&h.push("st-selected-top-border"),(!E(v)||s.has(d)&&l===o.length-1)&&h.push("st-selected-bottom-border"),E(m)||h.push("st-selected-left-border"),E(g)||h.push("st-selected-right-border"),h.join(" ")}),[E,o,s]),j=n.useMemo((function(){return p?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===p.rowIndex&&t===p.colIndex&&r===p.rowId}:function(){return!1}}),[p]);return{getBorderClass:S,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){x.current=!0,C.current={rowIndex:r,colIndex:n,rowId:o},l(new Set),v(null);var i=m({colIndex:n,rowIndex:r,rowId:o});c(new Set([i])),w({rowIndex:r,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&x.current&&C.current){for(var i=new Set,a=Math.min(C.current.rowIndex,r),d=Math.max(C.current.rowIndex,r),s=Math.min(C.current.colIndex,n),l=Math.max(C.current.colIndex,n),u=a;u<=d;u++)for(var h=s;h<=l;h++)if(u>=0&&u<o.length){var f=o[u].row.rowMeta.rowId;i.add(m({colIndex:h,rowIndex:u,rowId:f}))}c(i)}},handleMouseUp:function(){x.current=!1},isInitialFocusedCell:j,isSelected:E,lastSelectedColumnIndex:f,selectColumns:R,selectedCells:a,selectedColumns:s,setInitialFocusedCell:w,setSelectedCells:c,setSelectedColumns:l}}({selectableCells:_,headers:we.current,visibleRows:cn}),ln=sn.getBorderClass,un=sn.handleMouseDown,hn=sn.handleMouseOver,fn=sn.handleMouseUp,vn=sn.isInitialFocusedCell,mn=sn.isSelected,gn=sn.selectColumns,pn=sn.selectedCells,wn=sn.selectedColumns,xn=sn.setInitialFocusedCell,Cn=sn.setSelectedCells,In=sn.setSelectedColumns,yn=n.useCallback((function(e,n){en(e,n)}),[en]),bn=n.useCallback((function(e){we.current=e,dn()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(pn.size>0&&Cn(new Set),wn.size>0&&In(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Q,pn,wn,Cn,In]),n.useLayoutEffect((function(){if(be.current){var e=be.current.offsetWidth-be.current.clientWidth;Ke(e)}}),[]),n.useLayoutEffect((function(){var e=function(){if(dn(),be.current){var e=be.current.offsetWidth-be.current.clientWidth;Ke(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var Rn=n.useRef(new Map);return n.useEffect((function(){ie&&(ie.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,d=null===(t=null===(n=null==X?void 0:X[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==d){var s=l({rowId:d,accessor:i}),u=Rn.current.get(s);u&&u.updateContent(c),void 0!==(null===(o=null===(r=null==X?void 0:X[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(X[a].rowData[i]=c)}}})}),[ie,X]),e.jsx(p,o({value:{allowAnimations:i,cellRegistry:Rn.current,cellUpdateFlash:c,collapseIcon:s,columnReordering:b,columnResizing:E,draggedHeaderRef:ge,editColumns:M,expandIcon:H,forceUpdate:dn,getBorderClass:ln,handleMouseDown:un,handleMouseOver:hn,headersRef:we,hiddenColumns:Qe,hoveredHeaderRef:xe,isInitialFocusedCell:vn,isSelected:mn,mainBodyRef:Ce,nextIcon:O,onCellEdit:P,onColumnOrderChange:F,onSort:yn,onTableHeaderDragEnd:bn,pinnedLeftRef:Ie,pinnedRightRef:ye,prevIcon:Y,rowHeight:J,scrollbarWidth:Ve,selectColumns:gn,selectableColumns:Q,setInitialFocusedCell:xn,setIsWidthDragging:Ne,setMainBodyWidth:Te,setPinnedLeftWidth:Fe,setPinnedRightWidth:Ue,setSelectedCells:Cn,setSelectedColumns:In,shouldPaginate:ee,sortDownIcon:te,sortUpIcon:oe,tableBodyContainerRef:be,useOddColumnBackground:me,useHoverRowBackground:se,useOddEvenRowBackground:fe}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(ce),style:N?{height:N}:{}},{children:e.jsx(je,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:fn,onMouseLeave:fn},{children:[e.jsx(ue,{flattenedRows:rn,isWidthDragging:He,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setFlattenedRows:on,setScrollTop:Je,sort:_e,visibleRows:cn}),e.jsx(Re,{columnEditorText:g,editColumns:M,editColumnsInitOpen:W,headers:we.current,hiddenColumns:Qe,position:f,setHiddenColumns:Ze})]})),e.jsx(he,{mainBodyRef:Ce,mainBodyWidth:Be,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setMainBodyWidth:Te,tableBodyContainerRef:be}),e.jsx(x,{currentPage:ke,hideFooter:B,onPageChange:We,onNextPage:z,shouldPaginate:ee,totalPages:Math.ceil(X.length/K)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(Me,o({},t)):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function i(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function c(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}d((r=r.apply(e,n||[])).next())}))}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(d){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,d])}}}function c(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var d=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},s=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},l=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},u=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return u(e)})):[e]},h=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(d({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},f=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(d({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){f(e)}))},v=function(e){return"number"==typeof e.minWidth?e.minWidth:40},m=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},g=n.createContext(void 0),p=function(n){var t=n.children,r=n.value;return e.jsx(g.Provider,o({value:r},{children:t}))},w=function(){var e=n.useContext(g);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},x=function(t){var r=t.currentPage,c=t.hideFooter,d=t.onPageChange,s=t.onNextPage,l=t.shouldPaginate,u=t.totalPages,h=w(),f=h.nextIcon,v=h.prevIcon,m=n.useState(!0),g=m[0],p=m[1],x=!(r>1),C=!(r<u)&&!s||!g&&r===u;if(c||!l)return null;var I=function(){if(u<=15)return Array.from({length:u},(function(e,n){return n+1}));var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=u-Math.floor(7.5))e=Math.max(1,u-o+1),n=u;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<u-1&&(t.push(-1),t.push(u)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){var e=r-1;e>=1&&d(e)},disabled:x},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return i(void 0,void 0,void 0,(function(){var e,n;return a(this,(function(t){switch(t.label){case 0:return e=r===u,n=r+1,s&&e?[4,s(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=u||s)&&d(n),[2]}}))}))},disabled:C},{children:f})),I.map((function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=u&&d(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},C=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},I=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},b=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},y=function(e){return e.position*(e.rowHeight+1)-1},R=function(e){return e.position*(e.rowHeight+1)},E=function(t){var r=t.children,i=t.onClose,a=t.open,c=t.setOpen,d=t.width,s=t.containerRef,l=w().mainBodyRef,u=n.useRef(null),h=n.useRef(null),f=n.useState("bottom-left"),v=f[0],m=f[1],g=n.useState({}),p=g[0],x=g[1],C=n.useState(!1),I=C[0],b=C[1];return n.useEffect((function(){a&&u.current?(b(!1),!h.current&&u.current.parentElement&&(h.current=u.current.parentElement),requestAnimationFrame((function(){if(u.current&&h.current){var e,n=u.current,t=h.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==l?void 0:l.current)?l.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,c="bottom",f={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var v="left";o>e.right-t.right+t.width&&(v="right"),"bottom"===c?f.top=t.bottom+4:f.bottom=window.innerHeight-t.top+4,"left"===v?f.left=t.left:f.right=window.innerWidth-t.right,m("".concat(c,"-").concat(v)),x(f),b(!0)}}))):a||b(!1)}),[a,d,s,l]),n.useEffect((function(){var e=function(e){if(a&&u.current){var n=e.target;u.current&&!u.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,i,c]),n.useEffect((function(){var e=function(e){u.current&&!u.current.contains(e.target)&&(c(!1),null==i||i())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[i,a,c]),n.useEffect((function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[i,a,c]),a?e.jsx("div",o({ref:u,className:"st-dropdown-content st-dropdown-".concat(v),style:o({width:d?"".concat(d,"px"):"auto",visibility:I?"visible":"hidden"},p)},{children:r})):null},S=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,c=n.disabled,d=void 0!==c&&c,s=n.className,l=void 0===s?"":s;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(d?"disabled":""," ").concat(l),onClick:function(){!d&&r&&r()},role:"option","aria-selected":a,"aria-disabled":d},{children:t}))},j=function(t){var r=t.onBlur,i=t.onChange,a=t.open,c=t.setOpen,d=t.value,s=n.useState(d),l=s[0],u=s[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(e){u(e),i(e),c(!1),r()};return e.jsxs(E,o({open:a,onClose:function(){r()},setOpen:c,width:120},{children:[e.jsx(S,o({isSelected:!0===l,onClick:function(){return h(!0)}},{children:"True"})),e.jsx(S,o({isSelected:!1===l,onClick:function(){return h(!1)}},{children:"False"}))]}))},M=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},k=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},W=function(t){var r,i,a=t.value,c=t.onChange,d=t.onClose,s=w(),l=s.nextIcon,u=s.prevIcon,h=n.useState(a||new Date),f=h[0],v=h[1],m=n.useState("days"),g=m[0],p=m[1],x=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===g&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:u})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return p("months")}},{children:[(i=f,i.toLocaleString("default",{month:"long"}))," ",f.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:l}))]}),"months"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return p("years")}},{children:f.getFullYear()})),"years"===g&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(g,"-grid")},{children:["days"===g&&function(){var n=[],t=f.getFullYear(),r=f.getMonth(),i=x(t,r),s=function(e,n){return new Date(e,n,1).getDay()}(t,r),l=x(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach((function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))}));for(var u=function(t){var r=l-s+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()-1,e);v(n),c(n),null==d||d()}(r)}},{children:r}),"prev-".concat(r)))},h=0;h<s;h++)u(h);for(var m=function(i){var s=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),l=i===new Date(a).getDate()&&r===new Date(a).getMonth()&&t===new Date(a).getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(s?"today":""," ").concat(l?"selected":""),onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth(),e);v(n),c(n),null==d||d()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)m(g);var p=35-(s+i),w=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()+1,e);v(n),c(n),null==d||d()}(t)}},{children:t}),"next-".concat(t)))};for(g=1;g<=p;g++)w(g);return n}(),"months"===g&&(r=[],Array.from({length:12},(function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})})).forEach((function(n,t){var i=t===f.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(f.getFullYear(),e,1)),p("days")}(t)}},{children:n}),"month-".concat(t)))})),r),"years"===g&&function(){for(var n=[],t=f.getFullYear(),r=t-6,i=function(r){var i=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(e,f.getMonth(),1)),p("months")}(r)}},{children:r}),"year-".concat(r)))},a=r;a<r+12;a++)i(a);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),c(e),null==d||d()}},{children:"Today"}))}))]}))},D=function(t){var r=t.onBlur,i=t.onChange,a=t.open,c=t.setOpen,d=t.value,s=n.useState(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(d)),l=s[0],u=s[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){r()};return e.jsx(E,o({open:a,onClose:h,setOpen:c,width:280},{children:e.jsx(W,{value:l,onChange:function(e){u(e),i(e.toISOString()),c(!1),r()},onClose:h})}))},H=function(t){var r=t.onBlur,i=t.onChange,a=t.open,c=t.options,d=t.setOpen,s=t.value,l=n.useState(s||""),u=l[0],h=l[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e.jsx(E,o({open:a,onClose:function(){r()},setOpen:d,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:c.map((function(n){return e.jsx(S,o({isSelected:u===n,onClick:function(){return h(e=n),i(e),d(!1),void r();var e}},{children:n}),n)}))}))}))},N=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,d=n.value,s=function(){i(!1)};if("boolean"===c&&"boolean"==typeof d)return e.jsx(j,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:d});if("date"===c){var l="string"==typeof d?d:"";return e.jsx(D,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l})}if("enum"===c){var u="string"==typeof d?d:"";return e.jsx(H,{onBlur:s,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:u})}if("number"===c&&"number"==typeof d)return e.jsx(k,{defaultValue:d,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var h=null==d?"":String(d);return e.jsx(M,{defaultValue:h,onBlur:s,onChange:function(e){return o(e)}})},L=0,B=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===L||o-L>=r)&&(L=o,n(t))}},T=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(T);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=T(e[t]));return n},O=Date.now(),P={screenX:0,screenY:0},F=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return c(c([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=F(o.children,n,c(c([],t,!0),[r],!1));if(i)return i}}return null};var A=function(e){var t,r,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,c=e.onColumnOrderChange,d=e.onTableHeaderDragEnd,s=(t=i.current,r=n.useRef(t),n.useEffect((function(){JSON.stringify(r.current)!==JSON.stringify(t)&&(r.current=t)}),[t]),r.current);return{handleDragStart:function(e){o.current=e,O=Date.now()},handleDragOver:function(e){var n,t,r=e.event,c=e.hoveredHeader;if(r.preventDefault(),i.current){var l=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,h=r.screenY,f=Math.sqrt(Math.pow(u-P.screenX,2)+Math.pow(h-P.screenY,2));a.current=c;var v=i.current,m=F(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),g=F(v,c.accessor);if(m&&g){var p=m.length,w=g.length,x=g;if(p!==w){var C=w-p;C>0&&(x=g.slice(0,-C))}var I=function(e,n,t){var r=T(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,x),b=I.newHeaders,y=I.emergencyBreak;if(!(l||c.accessor===(null===(t=o.current)||void 0===t?void 0:t.accessor)||null===o.current||f<10||0===m.length||0===x.length||JSON.stringify(b)===JSON.stringify(i.current)||y)){var R=Date.now();JSON.stringify(b)===JSON.stringify(s)&&(R-O<1500||f<40)||(O=R,P={screenX:u,screenY:h},d(b))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==c||c(i.current)}}},z=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},U=n.forwardRef((function(t,r){var i,a,c=t.borderClass,s=t.colIndex,u=t.header,h=t.isHighlighted,f=t.isInitialFocused,v=t.nestedIndex,m=t.onExpandRowClick,g=t.rowIndex,p=t.visibleRow,x=w(),C=x.cellRegistry,I=x.cellUpdateFlash,b=x.collapseIcon,y=x.draggedHeaderRef,R=x.expandIcon,E=x.handleMouseDown,S=x.handleMouseOver,j=x.headersRef,M=x.hoveredHeaderRef,k=x.onCellEdit,W=x.onTableHeaderDragEnd,D=x.theme,H=x.useOddColumnBackground,L=p.depth,T=p.row,O=n.useState(T.rowData[u.accessor]),P=O[0],F=O[1],U=n.useState(!1),Y=U[0],q=U[1],J=n.useState(!1),X=J[0],V=J[1],K=n.useRef(null),G=A({draggedHeaderRef:y,headersRef:j,hoveredHeaderRef:M,onTableHeaderDragEnd:W}).handleDragOver,_=B(),$="cell-".concat(g,"-").concat(s),Q=l({rowId:T.rowMeta.rowId,accessor:u.accessor});n.useEffect((function(){if(C){var e="".concat(T.rowMeta.rowId,"-").concat(u.accessor);return C.set(e,{updateContent:function(e){P!==e?(F(e),I&&(V(!0),K.current&&clearTimeout(K.current),K.current=setTimeout((function(){V(!1)}),800))):F(e)}}),function(){C.delete(e),K.current&&clearTimeout(K.current)}}}),[C,I,T.rowMeta.rowId,u.accessor,P]),n.useEffect((function(){if(X){var e=setTimeout((function(){V(!1)}),850);return function(){return clearTimeout(e)}}}),[X]),n.useEffect((function(){F(T.rowData[u.accessor])}),[T.rowData,u.accessor]),n.useEffect((function(){h||q(!1)}),[h]);var Z="boolean"===u.type||"date"===u.type||"enum"===u.type,ee=Boolean(null===(a=null===(i=T.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),ne=Boolean(null==u?void 0:u.isEditable),te="st-cell ".concat(L>0&&u.expandable?"st-cell-depth-".concat(L):""," ").concat(h?f?"st-cell-selected-first ".concat(c):"st-cell-selected ".concat(c):""," ").concat(ne?"clickable":""," ").concat(X?"st-cell-updating":""," ").concat(H?v%2==0?"even-column":"odd-column":""),re=n.useCallback((function(e){F(e),null==k||k({accessor:u.accessor,newValue:e,row:T})}),[u.accessor,k,T]);return Y&&!Z?e.jsx("div",o({className:"st-cell-editing",id:d({accessor:u.accessor,rowIndex:g+1})},{children:e.jsx(N,{enumOptions:u.enumOptions,onChange:re,setIsEditing:q,type:u.type,value:P})})):e.jsxs("div",o({className:te,id:$,onDoubleClick:function(){return u.isEditable&&q(!0)},onMouseDown:function(){return E({rowIndex:g,colIndex:s,rowId:T.rowMeta.rowId})},onMouseOver:function(){return S({rowIndex:g,colIndex:s,rowId:T.rowMeta.rowId})},onDragOver:function(e){return _({callback:G,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||Y||(e.preventDefault(),q(!0))},ref:r,"data-row-index":g,"data-col-index":s,"data-row-id":T.rowMeta.rowId,"data-accessor":u.accessor},{children:[u.expandable&&ee?T.rowMeta.isExpanded?e.jsx("div",o({className:"st-sort-icon-container",onClick:function(){return m(T.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):e.jsx("div",o({className:"st-sort-icon-container",onClick:function(){return m(T.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:R})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:T,theme:D}):z({content:P,header:u})})})),Y&&Z&&e.jsx(N,{enumOptions:u.enumOptions,onChange:re,setIsEditing:q,type:u.type,value:P})]}),Q)})),Y=function(n){var t=n.children,r=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children"]);return w().allowAnimations?e.jsx(q,o({},r,{children:t})):e.jsx(e.Fragment,{children:t})},q=function(t){var r=t.children,o=t.isBody,i=t.pauseAnimation,a=t.rowIndex,c=n.useRef(!1),s=w(),l=s.draggedHeaderRef,u=s.headersRef,h=s.mainBodyRef,f=s.shouldPaginate,v=n.useState({}),m=v[0],g=v[1],p=n.useRef({}),x=u.current;return n.useLayoutEffect((function(){if(x){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(d({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),c=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=c}}})),o}({currentHeaders:x,draggedHeaderRef:l,rowIndex:a});JSON.stringify(e)!==JSON.stringify(m)&&(p.current=m,g(e))}}),[m,x,l,o,a]),n.useLayoutEffect((function(){var e=h.current,n=function(){c.current=!0},t=function(){c.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[l,h]),n.useEffect((function(){i||c.current||Object.keys(p.current).length&&x&&x.forEach((function(e){var n=document.getElementById(d({accessor:e.accessor,rowIndex:a}));if(n){var t=p.current[e.accessor],r=m[e.accessor];if(t&&r){var o=t.left-r.left,i=f?0:t.top-r.top,c=Math.abs(o),s=Math.abs(i);(c>10||s>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,x,o,i,p,a,f]),e.jsx(e.Fragment,{children:r})},J=function(n){var t=n.columnIndexStart,r=n.columnIndices,i=n.headers,a=n.hiddenColumns,c=n.isWidthDragging,l=n.onExpandRowClick,u=n.pinned,h=n.rowIndex,f=n.rowIndices,v=n.visibleRow,m=i.filter((function(e){return s({hiddenColumns:a,header:e,pinned:u})}));return e.jsx(Y,o({isBody:!0,pauseAnimation:c,rowIndex:h+1},{children:m.map((function(n,o){return e.jsx(X,{columnIndices:r,header:n,headers:i,hiddenColumns:a,nestedIndex:o+(null!=t?t:0),onExpandRowClick:l,pinned:u,rowIndex:h,rowIndices:f,visibleRow:v},d({accessor:n.accessor,rowIndex:h+1}))}))}))},X=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.hiddenColumns,c=t.nestedIndex,l=t.onExpandRowClick,u=t.pinned,h=t.rowIndex,f=t.rowIndices,v=t.visibleRow,m=r[o.accessor],g=w(),p=g.getBorderClass,x=g.isSelected,C=g.isInitialFocusedCell;if(o.children){var I=o.children.filter((function(e){return s({hiddenColumns:a,header:e,pinned:u})}));return e.jsx(n.Fragment,{children:I.map((function(n){return e.jsx(X,{columnIndices:r,header:n,headers:i,hiddenColumns:a,nestedIndex:c,onExpandRowClick:l,pinned:u,rowIndex:h,rowIndices:f,visibleRow:v},d({accessor:n.accessor,rowIndex:h+1}))}))})}var b={rowIndex:h,colIndex:m,rowId:v.row.rowMeta.rowId},y=p(b),R=x(b),E=C(b);return e.jsx(U,{borderClass:y,colIndex:m,header:o,isHighlighted:R,isInitialFocused:E,nestedIndex:c,onExpandRowClick:l,rowIndex:h,visibleRow:v},d({accessor:o.accessor,rowIndex:h+1}))},V=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,c=n.hiddenColumns,d=n.hoveredIndex,s=n.index,l=n.isWidthDragging,u=n.onExpandRowClick,h=n.pinned,f=n.rowHeight,v=n.rowIndices,m=n.setHoveredIndex,g=n.visibleRow,p=w().useHoverRowBackground,x=g.position,C=x%2==0;return e.jsx("div",o({className:"st-row ".concat(C?"even":"odd"," ").concat(d===s&&p?"hovered":""),onMouseEnter:function(){m(s)},style:{gridTemplateColumns:i,top:R({position:x,rowHeight:f}),height:"".concat(f,"px")}},{children:e.jsx(J,{columnIndexStart:r,columnIndices:t,headers:a,hiddenColumns:c,isWidthDragging:l,onExpandRowClick:u,pinned:h,rowIndex:s,rowIndices:v,visibleRow:g},s)}))},K=function(n){var t=n.displayStrongBorder,r=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",o({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:y({position:r,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},G=n.createContext(void 0),_=["default"],$=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(G);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),i=o.registerPane,a=o.unregisterPane;return n.useEffect((function(){return t.current&&i(t.current,_),function(){t.current&&a(t.current,_)}}),[t,i,a]),n.cloneElement(r,{ref:function(e){t.current=e}})},Q=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},Z=function(t){var r=t.columnIndexStart,i=t.columnIndices,a=t.headers,c=t.hiddenColumns,d=t.hoveredIndex,s=t.isWidthDragging,l=t.onExpandRowClick,u=t.pinned,h=t.ref,f=t.rowHeight,v=t.rowIndices,m=t.setHoveredIndex,g=t.templateColumns,p=t.totalHeight,w=t.visibleRows,x=t.width,C=u?"st-body-pinned-".concat(u):"st-body-main";return e.jsx(Q,o({condition:!u,wrapper:function(n){return e.jsx($,o({childRef:h},{children:n}))}},{children:e.jsx("div",o({className:C,ref:h,style:o({position:"relative",height:"".concat(p,"px"),width:x},!u&&{flexGrow:1})},{children:w.map((function(t,o){var h,p,x=w[o-1],C=Boolean((null==x?void 0:x.depth)!==(null==t?void 0:t.depth)&&(null===(p=null===(h=null==t?void 0:t.row.rowMeta)||void 0===h?void 0:h.children)||void 0===p?void 0:p.length)&&0===t.depth);return e.jsxs(n.Fragment,{children:[0!==o&&e.jsx(K,{displayStrongBorder:C,position:t.position,rowHeight:f,templateColumns:g}),e.jsx(V,{columnIndexStart:r,columnIndices:i,gridTemplateColumns:g,headers:a,hiddenColumns:c,hoveredIndex:d,index:o,isWidthDragging:s,onExpandRowClick:l,pinned:u,rowHeight:f,rowIndices:v,setHoveredIndex:m,visibleRow:t})]},t.position)}))}))}))};function ee(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,c=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 s({hiddenColumns:t,header:e})})).forEach((function(e,n){c(e,0===n)}))};return r.forEach((function(e,n){c(e,0===n)})),n.current.filter((function(e){return!e.pinned&&s({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;c(e,t)})),o.forEach((function(e){c(e,!1)})),i}var ne=function(t){var r=t.flattenedRows,i=t.headerContainerRef,a=t.isWidthDragging,c=t.mainTemplateColumns,d=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,l=t.pinnedLeftWidth,u=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,f=t.pinnedRightWidth,v=t.setFlattenedRows,m=t.setScrollTop,g=t.visibleRows,p=w(),x=p.headersRef,C=p.hiddenColumns,I=p.mainBodyRef,b=p.rowHeight,y=p.scrollbarWidth,R=p.tableBodyContainerRef,E=n.useState(null),S=E[0],j=E[1];!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],c=i[1];n.useEffect((function(){var e=null==t?void 0:t.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")}}),[t,a,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[t,r])}({headerContainerRef:i,mainSectionRef:R,scrollbarWidth:y});var M,k,W=n.useRef(null),D=(M=0,(k=function(e){e.forEach((function(e){M+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&k(e.rowMeta.children)}))})(r),M)*(b+1)-1,H=n.useMemo((function(){return ee({headersRef:x,hiddenColumns:C,pinnedLeftColumns:d,pinnedRightColumns:u})}),[x,C,d,u]),N=n.useMemo((function(){var e={};return g.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[g]),L=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?o(o({},t),{rowMeta:o(o({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?o(o({},t),{rowMeta:o(o({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};v((function(e){return e.map(n)}))},B={columnIndices:H,headerContainerRef:i,headers:x.current,hiddenColumns:C,hoveredIndex:S,isWidthDragging:a,rowHeight:b,rowIndices:N,setHoveredIndex:j,visibleRows:g};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return j(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;W.current&&cancelAnimationFrame(W.current),W.current=requestAnimationFrame((function(){m(n)}))},ref:R},{children:[d.length>0&&e.jsx(Z,o({},B,{onExpandRowClick:L,pinned:"left",templateColumns:s,totalHeight:D,width:l})),e.jsx(Z,o({},B,{columnIndexStart:d.length,onExpandRowClick:L,ref:I,templateColumns:c,totalHeight:D})),u.length>0&&e.jsx(Z,o({},B,{columnIndexStart:d.length+c.length,onExpandRowClick:L,pinned:"right",templateColumns:h,totalHeight:D,width:f}))]}))},te=function(e){return void 0===e&&(e=0),e?e+1:0},re=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:u(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=h(e))})))})),n.pinned?te(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},oe=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,d=e.setMainBodyWidth,s=e.setPinnedLeftWidth,l=e.setPinnedRightWidth,h=e.startWidth;c(!0),n.preventDefault();var m="clientX"in n?n.clientX:n.touches[0].clientX,g="touches"in n;if(i&&!i.hide){var p=v(i),w=r-o>1,x=w?u(i):[i],C=function(e){var n="right"===i.pinned?m-e:e-m;if(w&&x.length>1)ie({delta:n,header:i,headersRef:a,leafHeaders:x,minWidth:p,setMainBodyWidth:d,setPinnedLeftWidth:s,setPinnedRightWidth:l,startWidth:h});else{var r=Math.max(h+n,p);i.width=r,re({header:i,headers:a.current,newWidth:r,setMainBodyWidth:d,setPinnedLeftWidth:s,setPinnedRightWidth:l})}a.current.forEach((function(e){f(e)})),t()};if(g){var I=function(e){var n=e.touches[0];C(n.clientX)},b=function(){document.removeEventListener("touchmove",I),document.removeEventListener("touchend",b),c(!1)};document.addEventListener("touchmove",I),document.addEventListener("touchend",b)}else{var y=function(e){C(e.clientX)},R=function(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",R),c(!1)};document.addEventListener("mousemove",y),document.addEventListener("mouseup",R)}}},ie=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,d=e.setPinnedRightWidth,s=e.startWidth,l=o.reduce((function(e,n){return Math.min(e,v(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(s+n,l);re({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:d});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},ae=n.forwardRef((function(t,r){var i,a,s=t.colIndex,l=t.forceHeadersUpdate,u=t.gridColumnEnd,h=t.gridColumnStart,f=t.gridRowEnd,v=t.gridRowStart,m=t.header,g=t.reverse,p=t.sort,x=w(),C=x.columnReordering,I=x.columnResizing,b=x.draggedHeaderRef,y=x.forceUpdate,R=x.headersRef,E=x.hoveredHeaderRef,S=x.onColumnOrderChange,j=x.onSort,M=x.onTableHeaderDragEnd,k=x.rowHeight,W=x.selectColumns,D=x.selectableColumns,H=x.setInitialFocusedCell,N=x.setIsWidthDragging,L=x.setMainBodyWidth,T=x.setPinnedLeftWidth,O=x.setPinnedRightWidth,P=x.setSelectedCells,F=x.setSelectedColumns,z=x.sortDownIcon,U=x.sortUpIcon,Y=Boolean(null==m?void 0:m.isSortable),q="st-header-cell ".concat(m.accessor===(null===(i=E.current)||void 0===i?void 0:i.accessor)?"st-hovered":""," ").concat((null===(a=b.current)||void 0===a?void 0:a.accessor)===m.accessor?"st-dragging":""," ").concat(Y?"clickable":""," ").concat(C&&!Y?"columnReordering":""," ").concat(m.children?"parent":""),J=A({draggedHeaderRef:b,headersRef:R,hoveredHeaderRef:E,onColumnOrderChange:S,onTableHeaderDragEnd:M}),X=J.handleDragStart,V=J.handleDragEnd,K=J.handleDragOver,G=B(),_=function(e){var n=e.event,t=e.header;if(D){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,s);return n.shiftKey&&W?F((function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort((function(e,n){return e-n})),o=t[0],i=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)}));var a,d,s,l,u=c(c([],(a=o,d=n,s=Math.min(a,d),l=Math.max(a,d),Array.from({length:l-s+1},(function(e,n){return s+n}))),!0),r,!0);return new Set(c(c([],Array.from(e),!0),u,!0))})):W&&W(r),P(new Set),void H(null)}t.isSortable&&j(s,t.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)}}),[]),!m)return null;var $=I&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;G({callback:oe,callbackProps:{event:e.nativeEvent,forceUpdate:y,gridColumnEnd:u,gridColumnStart:h,header:m,headersRef:R,setIsWidthDragging:N,setMainBodyWidth:L,setPinnedLeftWidth:T,setPinnedRightWidth:O,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;G({callback:oe,callbackProps:{event:e,forceUpdate:y,gridColumnEnd:u,gridColumnStart:h,header:m,headersRef:R,setIsWidthDragging:N,setMainBodyWidth:L,setPinnedLeftWidth:T,setPinnedRightWidth:O,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Q=p&&p.key.accessor===m.accessor&&e.jsxs("div",o({className:"st-sort-icon-container",onClick:function(e){return _({event:e,header:m})}},{children:["ascending"===p.direction&&U&&U,"descending"===p.direction&&z&&z]}));return e.jsxs("div",o({className:q,id:d({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){G({callback:K,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:r,style:o(o({gridRowStart:v,gridRowEnd:f,gridColumnStart:h,gridColumnEnd:u},u-h>1?{}:{width:m.width}),f-v>1?{}:{height:k})},{children:[g&&$,"right"===m.align&&Q,e.jsx("div",o({className:"st-header-label",draggable:C&&!m.disableReorder,onClick:function(e){return _({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),V(),l()},onDragStart:function(e){C&&m&&function(e){X(e)}(m)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":"left-aligned")},{children:null==m?void 0:m.label}))})),"right"!==m.align&&Q,!g&&$]}))})),ce=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,c=t.headersRef,d=t.hiddenColumns,l=t.maxDepth,u=t.pinned,h=t.sectionRef,f=t.sort,v=n.useReducer((function(e){return e+1}),0)[1],m=n.useMemo((function(){var e=[],n=1,t=function(o,i,a){var c,h;if(void 0===a&&(a=!1),!s({hiddenColumns:d,header:o,pinned:u}))return 0;a||n++;var f=null!==(h=null===(c=o.children)||void 0===c?void 0:c.filter((function(e){return s({hiddenColumns:d,header:e,pinned:u})})).length)&&void 0!==h?h:0,v=n,m=f>0?v+f:v+1,g=i,p=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:m,gridRowStart:g,gridRowEnd:p,colIndex:r[o.accessor]}),o.children){var w=!0;o.children.forEach((function(e){s({hiddenColumns:d,header:e,pinned:u})&&(t(e,i+1,w),w=!1)}))}return m-v},o=c.current.filter((function(e){return s({hiddenColumns:d,header:e,pinned:u})})),i=!0;return o.forEach((function(e){t(e,1,i),i=!1})),e}),[c,d,l,u,r]);return e.jsx(Q,o({condition:!u,wrapper:function(n){return e.jsx($,o({childRef:h},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},a&&{onScroll:a},{ref:h,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(Y,o({rowIndex:0},{children:m.map((function(t){return e.jsx(ae,{colIndex:t.colIndex,forceHeadersUpdate:v,gridColumnEnd:t.gridColumnEnd,gridColumnStart:t.gridColumnStart,gridRowEnd:t.gridRowEnd,gridRowStart:t.gridRowStart,header:t.header,ref:n.createRef(),reverse:"right"===u,sort:f},t.header.accessor)}))}))}))}))},de=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(de)):1},se=function(t){var r=t.centerHeaderRef,i=t.headerContainerRef,a=t.headersRef,c=t.hiddenColumns,d=t.mainTemplateColumns,l=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.sort,m=w(),g=m.pinnedLeftRef,p=m.pinnedRightRef,x=m.setPinnedLeftWidth,C=m.setPinnedRightWidth,I=n.useMemo((function(){return ee({headersRef:a,hiddenColumns:c,pinnedLeftColumns:l,pinnedRightColumns:h})}),[a,c,l,h]),b=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(s({hiddenColumns:c,header:e})){var t=de(e);n=Math.max(n,t)}})),{maxDepth:n}}),[a,c]).maxDepth;return n.useLayoutEffect((function(){var e,n;x(te(null===(e=g.current)||void 0===e?void 0:e.clientWidth)),C(te(null===(n=p.current)||void 0===n?void 0:n.clientWidth))}),[g,p,x,C]),e.jsxs("div",o({className:"st-header-container",ref:i},{children:[l.length>0&&e.jsx(ce,{columnIndices:I,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:b,pinned:"left",sectionRef:g,sort:v}),e.jsx(ce,{columnIndices:I,gridTemplateColumns:d,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:b,sectionRef:r,sort:v}),h.length>0&&e.jsx(ce,{columnIndices:I,gridTemplateColumns:f,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:b,pinned:"right",sectionRef:p,sort:v})]}))},le=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},ue=function(t){var r=t.flattenedRows,i=t.isWidthDragging,a=t.pinnedLeftWidth,c=t.pinnedRightWidth,d=t.setFlattenedRows,s=t.setScrollTop,l=t.sort,u=t.visibleRows,h=w(),f=h.columnResizing,v=h.editColumns,m=h.headersRef,g=h.hiddenColumns,p=n.useRef(null),x=n.useRef(null),C=m.current.filter((function(e){return!e.pinned})),I=m.current.filter((function(e){return"left"===e.pinned})),b=m.current.filter((function(e){return"right"===e.pinned})),y=n.useMemo((function(){return le({headers:I,hiddenColumns:g})}),[I,g]),R=n.useMemo((function(){return le({headers:C,hiddenColumns:g})}),[C,g]),E=n.useMemo((function(){return le({headers:b,hiddenColumns:g})}),[b,g]),S={centerHeaderRef:x,headerContainerRef:p,headersRef:m,hiddenColumns:g,mainTemplateColumns:R,pinnedLeftColumns:I,pinnedLeftTemplateColumns:y,pinnedRightColumns:b,pinnedRightTemplateColumns:E,sort:l},j={flattenedRows:r,headerContainerRef:p,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:I,pinnedLeftTemplateColumns:y,pinnedLeftWidth:a,pinnedRightColumns:b,pinnedRightTemplateColumns:E,pinnedRightWidth:c,setFlattenedRows:d,setScrollTop:s,visibleRows:u};return e.jsxs("div",o({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(se,o({},S)),e.jsx(ne,o({},j))]}))},he=function(t){var r,i,a=t.mainBodyWidth,c=t.mainBodyRef,d=t.pinnedLeftWidth,s=t.pinnedRightWidth,l=t.setMainBodyWidth,u=t.tableBodyContainerRef,h=w().editColumns,f=n.useState(!1),v=f[0],m=f[1],g=n.useRef(null),p=u.current&&u.current.scrollHeight>u.current.clientHeight,x=h?28:0,C=(h?s+1:s)+(u.current&&p?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect((function(){setTimeout((function(){!function(){var e;if(c.current){var n=null===(e=c.current)||void 0===e?void 0:e.scrollWidth;l(n||0)}}()}),1)}),[c,l]),n.useEffect((function(){setTimeout((function(){!function(){if(c.current){var e=c.current.clientWidth;m(a>e)}}()}),1)}),[c,a,l]),v?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[d>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:d,height:null===(r=g.current)||void 0===r?void 0:r.offsetHeight}}),a>0&&e.jsx($,o({childRef:g},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:g,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})}))})),s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(i=g.current)||void 0===i?void 0:i.offsetHeight}}),x>0&&e.jsx("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},fe={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return fe.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?fe.string(e,n,t):"number"==typeof e&&"number"==typeof n?fe.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?fe.boolean(e,n,t):fe.string(String(e),String(n),t)}},ve=function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return fe.number(i,a,r)}return"date"===t?fe.date(String(e),String(n),r):"boolean"===t?fe.boolean(Boolean(e),Boolean(n),r):"enum"===t?fe.enum(String(e),String(n),r):fe.string(String(e),String(n),r)},me=function(e,n,t){var r,i=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",a=n.direction,d=new Map,s=new Map,l="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(d.size)).toString();l=r,s.set(l,e),d.has(l)||d.set(l,[])}else if(l){var o=d.get(l)||[];o.push(e),d.set(l,o)}else{var i="default";d.has(i)||d.set(i,[]),null===(t=d.get(i))||void 0===t||t.push(e)}}));var u=[];return d.forEach((function(e,r){if(s.has(r)){var d=s.get(r);d.rowMeta.children&&d.rowMeta.children.length>0&&(d.rowMeta.children=ge(d.rowMeta.children,n,t)),u.push(d)}var l=c([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],c=t.rowData[r];return ve(o,c,i,a)}));u.push.apply(u,l.map((function(e){var r=o({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var i=ge(r.rowMeta.children,n,t);r.rowMeta=o(o({},r.rowMeta),{children:i})}return r})))})),u},ge=function(e,n,t){var r=t.find((function(e){return e.accessor===n.key.accessor})),i=(null==r?void 0:r.type)||"string",a=n.direction;return c([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],c=t.rowData[r];return ve(o,c,i,a)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?o(o({},e),{rowMeta:o(o({},e.rowMeta),{children:ge(e.rowMeta.children,n,t)})}):e}))},pe=function(e){var t=e.headers,r=e.tableRows,o=n.useState(null),i=o[0],a=o[1],c=n.useMemo((function(){var e={};return t.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[t]),d=n.useState(c),s=d[0],l=d[1],u=n.useMemo((function(){if(!i)return r;var e=function(e,n,t){return{sortedData:me(n,t,e),newSortConfig:t}}(t,r,i).sortedData;return e}),[r,i,t]);return{hiddenColumns:s,setHiddenColumns:l,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(t);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},we=function(n){var t=n.checked,r=void 0!==t&&t,i=n.children,a=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){a&&a(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},xe=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),d=!1;if(!c)for(var s=0,l=a.children;s<l.length;s++){var u=l[s];if(xe([u],n,t,r),!1===t[u.accessor]){d=!0;break}}(c||d)&&(t[a.accessor]=!1)}}},Ce=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},Ie=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(Ie(e.children,n),Ce(e.children,n)&&(n[e.accessor]=!0))}))},be=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,c=t.header,d=t.hiddenColumns,s=t.setHiddenColumns,l=n.useState(!0),f=l[0],v=l[1],m=w(),g=m.expandIcon,p=m.collapseIcon,x=m.headersRef,C=m.setMainBodyWidth,I=m.setPinnedLeftWidth,b=m.setPinnedRightWidth,y="".concat(16*a,"px"),R=c.children&&c.children.length>0,E=d[c.accessor]||R&&c.children&&Ce(c.children,d);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[e.jsx("div",o({className:"st-header-icon-container"},{children:R?e.jsx("div",o({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),v(!f)}},{children:f?p:g})):null})),e.jsx(we,o({checked:E,onChange:function(e){var n=o({},d);(n[c.accessor]=e,e)?Ie(r,n):(xe(r,c.accessor,n),R&&c.children&&c.children.length>0&&c.children.every((function(e){return!0===d[e.accessor]}))&&c.children[0]&&(n[c.children[0].accessor]=!1,xe(r,c.children[0].accessor,n)));s(n),x.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=u(e).reduce((function(e,n){return e+h(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var d=te(i),s=te(a);r(d),o(s),t(c)}({headers:x.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:b})}},{children:c.label}))]})),R&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map((function(n,t){return e.jsx(be,{allHeaders:r,depth:a+1,header:n,hiddenColumns:d,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},ye=function(n){var t=n.headers,r=n.open,i=n.position,a=n.setHiddenColumns,c=n.hiddenColumns,d="left"===i?"left":"";return e.jsx("div",o({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(d),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e.jsx(be,{header:n,hiddenColumns:c,setHiddenColumns:a,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},Re=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,c=t.headers,d=t.hiddenColumns,s=t.position,l=void 0===s?"right":s,u=t.setHiddenColumns,h=n.useState(a),f=h[0],v=h[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(f?"open":""," ").concat(l),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(ye,{headers:c,open:f,position:l,setHiddenColumns:u,hiddenColumns:d})]})):null},Ee=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"down-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Se=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"up-long",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},je=function(t){var i=t.children,a=n.useRef({}),c=n.useCallback((function(e,n){return!!a.current[n]&&a.current[n].find((function(n){return n===e}))}),[]),d=n.useCallback((function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)}),[]),s=n.useCallback((function(e){e.onscroll=null}),[]),l=n.useCallback((function(e,n){e.onscroll=function(){window.requestAnimationFrame((function(){n.forEach((function(n){var t;null===(t=a.current[n])||void 0===t||t.forEach((function(n){e!==n&&(s(n),d(e,n),window.requestAnimationFrame((function(){var e=Object.keys(a.current).filter((function(e){return a.current[e].includes(n)}));l(n,e)})))}))}))}))}}),[s,d]),u=n.useCallback((function(e,n){n.forEach((function(n){a.current[n]||(a.current[n]=[]),c(e,n)||(a.current[n].length>0&&d(a.current[n][0],e),a.current[n].push(e))})),l(e,n)}),[c,d,l]),h=n.useCallback((function(e,n){n.forEach((function(n){if(c(e,n)){s(e);var t=a.current[n].indexOf(e);-1!==t&&a.current[n].splice(t,1)}}))}),[c,s]);return e.jsx(G.Provider,o({value:{registerPane:u,unregisterPane:h}},{children:r.default.Children.only(i)}))},Me=function(t){var r=t.allowAnimations,i=void 0!==r&&r,a=t.cellUpdateFlash,c=void 0!==a&&a,d=t.collapseIcon,s=void 0===d?e.jsx(b,{className:"st-sort-icon"}):d,h=t.columnEditorPosition,f=void 0===h?"right":h,v=t.columnEditorText,g=void 0===v?"Columns":v,w=t.columnReordering,y=void 0!==w&&w,R=t.columnResizing,E=void 0!==R&&R,S=t.defaultHeaders,j=t.editColumns,M=void 0!==j&&j,k=t.editColumnsInitOpen,W=void 0!==k&&k,D=t.expandIcon,H=void 0===D?e.jsx(I,{className:"st-sort-icon"}):D,N=t.height,L=t.hideFooter,B=void 0!==L&&L,T=t.nextIcon,O=void 0===T?e.jsx(I,{className:"st-next-prev-icon"}):T,P=t.onCellEdit,F=t.onColumnOrderChange,A=t.onGridReady,z=t.onNextPage,U=t.prevIcon,Y=void 0===U?e.jsx(C,{className:"st-next-prev-icon"}):U,q=t.rowHeight,J=void 0===q?40:q,X=t.rows,V=t.rowsPerPage,K=void 0===V?10:V,G=t.selectableCells,_=void 0!==G&&G,$=t.selectableColumns,Q=void 0!==$&&$,Z=t.shouldPaginate,ee=void 0!==Z&&Z,ne=t.sortDownIcon,te=void 0===ne?e.jsx(Ee,{className:"st-sort-icon"}):ne,re=t.sortUpIcon,oe=void 0===re?e.jsx(Se,{className:"st-sort-icon"}):re,ie=t.tableRef,ae=t.theme,ce=void 0===ae?"light":ae,de=t.useHoverRowBackground,se=void 0===de||de,le=t.useOddEvenRowBackground,fe=void 0===le||le,ve=t.useOddColumnBackground,me=void 0!==ve&&ve;me&&(fe=!1);var ge=n.useRef(null),we=n.useRef(S),xe=n.useRef(null),Ce=n.useRef(null),Ie=n.useRef(null),be=n.useRef(null),ye=n.useRef(null),Me=n.useState(1),ke=Me[0],We=Me[1],De=n.useState(!1),He=De[0],Ne=De[1],Le=n.useState(0),Be=Le[0],Te=Le[1],Oe=n.useState(0),Pe=Oe[0],Fe=Oe[1],Ae=n.useState(0),ze=Ae[0],Ue=Ae[1],Ye=n.useState(0),qe=Ye[0],Je=Ye[1],Xe=n.useState(0),Ve=Xe[0],Ke=Xe[1],Ge=pe({headers:we.current,tableRows:X}),_e=Ge.sort,$e=Ge.sortedRows,Qe=Ge.hiddenColumns,Ze=Ge.setHiddenColumns,en=Ge.updateSort;n.useEffect((function(){null==A||A()}),[A]);var nn=n.useMemo((function(){if(!ee)return $e;var e=(ke-1)*K,n=e+K;return $e.slice(e,n)}),[ke,K,ee,$e]),tn=n.useState(nn),rn=tn[0],on=tn[1];n.useEffect((function(){on(nn)}),[nn]);var an=n.useMemo((function(){var e;if(!N)return window.innerHeight-J;var n=document.querySelector(".simple-table-root"),t=0;if(N.endsWith("px"))t=parseInt(N,10);else if(N.endsWith("vh")){var r=parseInt(N,10);t=window.innerHeight*r/100}else if(N.endsWith("%")){var o=parseInt(N,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-J)}),[N,J]),cn=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],d=0,s=Math.max(0,i-a*n),l=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=d*a;if(h>=l)break;h+a>s&&c.push({row:i,depth:n,position:d,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),d+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:an,flattenedRows:rn,rowHeight:J,scrollTop:qe})}),[an,J,rn,qe]),dn=n.useReducer((function(e){return e+1}),0)[1],sn=function(e){var t=e.selectableCells,r=e.headers,o=e.visibleRows,i=n.useState(new Set),a=i[0],c=i[1],d=n.useState(new Set),s=d[0],l=d[1],h=n.useState(null),f=h[0],v=h[1],g=n.useState(null),p=g[0],w=g[1],x=n.useRef(!1),C=n.useRef(null),I=n.useCallback((function(){var e=r.flatMap(u).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var t=Array.from(a).reduce((function(e,t){var r=t.split("-").map(Number),i=r[0],a=r[1];e[i]||(e[i]=[]);var c=n.get(a);return e[i][a]=c?o[i].row.rowData[c]:"",e}),{}),i=Object.values(t).map((function(e){return Object.values(e).join("\t")})).join("\n");a.size>0&&navigator.clipboard.writeText(i)}),[r,a,o]),b=n.useCallback((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),d=Math.max(e.colIndex,n.colIndex),s=r;s<=i;s++)for(var u=a;u<=d;u++)if(s>=0&&s<o.length){var h=o[s].row.rowMeta.rowId;t.add(m({colIndex:u,rowIndex:s,rowId:h}))}l(new Set),v(null),c(t)}),[o,l,v,c]),y=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<r.length){var n=m(e);l(new Set),v(null),c(new Set([n])),w(e)}}),[r.length,o.length,l,v,c,w]),R=n.useCallback((function(e,n){void 0===n&&(n=!1),c(new Set),w(null),l((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&v(e[e.length-1])}),[c,w,l,v]);n.useEffect((function(){var e=function(e){if(t&&p){var n=p.rowIndex,i=p.colIndex,a=p.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var d=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===d)return;n=d}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};y(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(s={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},y(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(s={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},y(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<r.length-1&&(s={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},y(s))):"Escape"===e.key&&(c(new Set),l(new Set),v(null),C.current=null,w(null))}else I()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[I,r.length,p,b,y,t,o]);var E=n.useCallback((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r}),i=a.has(o),c=s.has(n);return i||c}),[a,s]),S=n.useCallback((function(e){var n,t,r,i,a,c,d=e.colIndex,l=e.rowIndex,u=e.rowId,h=[],f=null===(r=null===(t=null===(n=o[l-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:d,rowIndex:l+1,rowId:null===(c=null===(a=null===(i=o[l+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===c?void 0:c.rowId},m={colIndex:d-1,rowIndex:l,rowId:u},g={colIndex:d+1,rowIndex:l,rowId:u};return(!E({colIndex:d,rowIndex:l-1,rowId:f})||s.has(d)&&0===l)&&h.push("st-selected-top-border"),(!E(v)||s.has(d)&&l===o.length-1)&&h.push("st-selected-bottom-border"),E(m)||h.push("st-selected-left-border"),E(g)||h.push("st-selected-right-border"),h.join(" ")}),[E,o,s]),j=n.useMemo((function(){return p?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===p.rowIndex&&t===p.colIndex&&r===p.rowId}:function(){return!1}}),[p]);return{getBorderClass:S,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){x.current=!0,C.current={rowIndex:r,colIndex:n,rowId:o},l(new Set),v(null);var i=m({colIndex:n,rowIndex:r,rowId:o});c(new Set([i])),w({rowIndex:r,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&x.current&&C.current){for(var i=new Set,a=Math.min(C.current.rowIndex,r),d=Math.max(C.current.rowIndex,r),s=Math.min(C.current.colIndex,n),l=Math.max(C.current.colIndex,n),u=a;u<=d;u++)for(var h=s;h<=l;h++)if(u>=0&&u<o.length){var f=o[u].row.rowMeta.rowId;i.add(m({colIndex:h,rowIndex:u,rowId:f}))}c(i)}},handleMouseUp:function(){x.current=!1},isInitialFocusedCell:j,isSelected:E,lastSelectedColumnIndex:f,selectColumns:R,selectedCells:a,selectedColumns:s,setInitialFocusedCell:w,setSelectedCells:c,setSelectedColumns:l}}({selectableCells:_,headers:we.current,visibleRows:cn}),ln=sn.getBorderClass,un=sn.handleMouseDown,hn=sn.handleMouseOver,fn=sn.handleMouseUp,vn=sn.isInitialFocusedCell,mn=sn.isSelected,gn=sn.selectColumns,pn=sn.selectedCells,wn=sn.selectedColumns,xn=sn.setInitialFocusedCell,Cn=sn.setSelectedCells,In=sn.setSelectedColumns,bn=n.useCallback((function(e,n){en(e,n)}),[en]),yn=n.useCallback((function(e){we.current=e,dn()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(pn.size>0&&Cn(new Set),wn.size>0&&In(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Q,pn,wn,Cn,In]),n.useLayoutEffect((function(){if(ye.current){var e=ye.current.offsetWidth-ye.current.clientWidth;Ke(e)}}),[]),n.useLayoutEffect((function(){var e=function(){if(dn(),ye.current){var e=ye.current.offsetWidth-ye.current.clientWidth;Ke(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var Rn=n.useRef(new Map);return n.useEffect((function(){ie&&(ie.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,d=null===(t=null===(n=null==X?void 0:X[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==d){var s=l({rowId:d,accessor:i}),u=Rn.current.get(s);u&&u.updateContent(c),void 0!==(null===(o=null===(r=null==X?void 0:X[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(X[a].rowData[i]=c)}}})}),[ie,X]),e.jsx(p,o({value:{allowAnimations:i,cellRegistry:Rn.current,cellUpdateFlash:c,collapseIcon:s,columnReordering:y,columnResizing:E,draggedHeaderRef:ge,editColumns:M,expandIcon:H,forceUpdate:dn,getBorderClass:ln,handleMouseDown:un,handleMouseOver:hn,headersRef:we,hiddenColumns:Qe,hoveredHeaderRef:xe,isInitialFocusedCell:vn,isSelected:mn,mainBodyRef:Ce,nextIcon:O,onCellEdit:P,onColumnOrderChange:F,onSort:bn,onTableHeaderDragEnd:yn,pinnedLeftRef:Ie,pinnedRightRef:be,prevIcon:Y,rowHeight:J,scrollbarWidth:Ve,selectColumns:gn,selectableColumns:Q,setInitialFocusedCell:xn,setIsWidthDragging:Ne,setMainBodyWidth:Te,setPinnedLeftWidth:Fe,setPinnedRightWidth:Ue,setSelectedCells:Cn,setSelectedColumns:In,shouldPaginate:ee,sortDownIcon:te,sortUpIcon:oe,tableBodyContainerRef:ye,theme:ce,useOddColumnBackground:me,useHoverRowBackground:se,useOddEvenRowBackground:fe}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(ce),style:N?{height:N}:{}},{children:e.jsx(je,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:fn,onMouseLeave:fn},{children:[e.jsx(ue,{flattenedRows:rn,isWidthDragging:He,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setFlattenedRows:on,setScrollTop:Je,sort:_e,visibleRows:cn}),e.jsx(Re,{columnEditorText:g,editColumns:M,editColumnsInitOpen:W,headers:we.current,hiddenColumns:Qe,position:f,setHiddenColumns:Ze})]})),e.jsx(he,{mainBodyRef:Ce,mainBodyWidth:Be,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setMainBodyWidth:Te,tableBodyContainerRef:ye}),e.jsx(x,{currentPage:ke,hideFooter:B,onPageChange:We,onNextPage:z,shouldPaginate:ee,totalPages:Math.ceil(X.length/K)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(Me,o({},t)):null};
2
2
  //# sourceMappingURL=index.js.map
package/dist/styles.css CHANGED
@@ -1 +1 @@
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-container-width:10px;--st-border-width:1px;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--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-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-slate-50);--st-even-column-background-color:var(--st-white);--st-hover-row-background-color:var(--st-slate-100);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(--st-slate-900);--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-slate-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-color:var(--st-blue-500);--st-editable-cell-focus-border-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-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-gray-800);--st-even-column-background-color:var(--st-gray-900);--st-hover-row-background-color:var(--st-gray-700);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(--st-gray-100);--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-color:var(--st-blue-400);--st-editable-cell-focus-border-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-cell-flash-color:var(--st-gray-600)}.theme-neutral{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-neutral-50);--st-even-column-background-color:var(--st-neutral-100);--st-hover-row-background-color:var(--st-neutral-200);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(--st-neutral-900);--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-color:var(--st-neutral-600);--st-editable-cell-focus-border-color:var(--st-neutral-500);--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-cell-flash-color:var(--st-neutral-400)}.theme-sky{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-blue-50);--st-even-column-background-color:var(--st-blue-100);--st-hover-row-background-color:var(--st-blue-200);--st-header-background-color:var(--st-blue-200);--st-header-label-color:var(--st-blue-900);--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-color:var(--st-blue-600);--st-editable-cell-focus-border-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-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-cell-flash-color:var(--st-blue-300)}.theme-funky{--st-border-radius:8px;--st-cell-padding:12px;--st-spacing-small:6px;--st-spacing-medium:10px;--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-odd-column-background-color:var(--st-violet-50);--st-even-column-background-color:var(--st-amber-50);--st-hover-row-background-color:var(--st-amber-200);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(--st-white);--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-color:var(--st-violet-500);--st-editable-cell-focus-border-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-cell-flash-color:var(--st-violet-200)}.simple-table-root *{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root ::-webkit-scrollbar{height:8px;width:8px}.simple-table-root ::-webkit-scrollbar-track{background:var(--st-scrollbar-bg-color)}.simple-table-root ::-webkit-scrollbar-thumb{background:var(--st-scrollbar-thumb-color);border-radius:4px}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.st-wrapper{-webkit-box-flex:1;-ms-flex-positive:1;border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);flex-grow:1;max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.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{border-bottom:var(--st-border-width) solid var(--st-border-color);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{-webkit-overflow-scrolling:touch;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none;-ms-touch-action:auto;touch-action:auto}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-overflow-scrolling:touch;background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;-ms-touch-action:auto;touch-action:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-height:100%}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{-webkit-overflow-scrolling:touch;overflow:auto;scrollbar-width:none;-ms-touch-action:auto;touch-action:auto}.st-body-main::-webkit-scrollbar{display:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.hovered .st-cell:not(.st-cell-selected){background-color:var(--st-hover-row-background-color)}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color)}.st-row.odd .st-cell-content{color:var(--st-cell-odd-row-color)}.st-row.even .st-cell-content{color:var(--st-cell-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-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.parent{border-bottom:var(--st-border-width) solid var(--st-border-color)}.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;position:relative}.st-cell.left-aligned,.st-header-cell.left-aligned{padding-left:var(--st-cell-padding);text-align:left}.st-cell.center-aligned,.st-header-cell.center-aligned{text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label-text{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-flex:1;-ms-flex-positive:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;height:100%;min-width:0}.st-cell-content,.st-header-label-text{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;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-text{color:var(--st-header-label-color);padding-left:var(--st-cell-padding);padding-right:var(--st-cell-padding)}.st-cell-content.left-aligned,.st-header-label-text.left-aligned{text-align:left}.st-cell-content.center-aligned,.st-header-label-text.center-aligned{text-align:center}.st-cell-content.right-aligned,.st-header-label-text.right-aligned{text-align:right}.st-not-resizeable .st-cell-content{padding-left:var(--st-cell-padding);padding-right:var(--st-cell-padding)}.st-resizeable .st-body-pinned-right .st-cell-content{padding-left:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width));padding-right:var(--st-cell-padding)}.st-resizeable .st-body-main .st-cell-content,.st-resizeable .st-body-pinned-left .st-cell-content{padding-left:var(--st-cell-padding);padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width))}.st-cell{border:var(--st-border-width) solid #0000}.st-cell.even-column:not(.st-cell-selected){background-color:var(--st-even-column-background-color)}.st-cell.odd-column:not(.st-cell-selected){background-color:var(--st-odd-column-background-color)}.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-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;cursor:col-resize;display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;justify-content:center;width:var(--st-resize-handle-container-width)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);height:calc(100% - 20px);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-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color)}.st-cell-selected .st-cell-content{color:var(--st-selected-cell-color)!important}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border:var(--st-border-width) solid var(--st-selected-border-color)}.st-cell-selected-first .st-cell-content{color:var(--st-selected-first-cell-color)!important}.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-scrollbar-bg-color);border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px;width:100%}.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{height:100%}.st-horizontal-scrollbar-middle{-webkit-overflow-scrolling:touch;min-height:11px;overflow:auto;-ms-touch-action:auto;touch-action:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{-ms-flex-negative:0;background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);flex-shrink:0;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}.st-page-ellipsis{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;color:var(--st-cell-color);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-weight:700;justify-content:center;margin:0 var(--st-spacing-small);padding:var(--st-spacing-small)}.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);font-size:.875rem;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-column-editor-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;-webkit-overflow-scrolling:touch;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-medium);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small);-ms-touch-action:auto;touch-action:auto}.st-header-checkbox-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.st-header-checkbox-item,.st-header-icon-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-icon-container{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:24px}.st-collapsible-header-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer}.st-collapsible-header-icon,.st-nested-headers{display:-webkit-box;display:-ms-flexbox;display:flex}.st-nested-headers{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium)}.st-column-editor-popout.open{min-width:200px;width:auto}.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);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}.st-dropdown-content{-webkit-overflow-scrolling:touch;background-color:var(--st-odd-row-background-color);border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow);box-shadow:var(--st-edit-cell-shadow);max-height:400px;min-width:120px;overflow:auto;position:fixed;-ms-touch-action:auto;touch-action:auto;-webkit-transform:translateZ(0);transform:translateZ(0);will-change:transform;z-index:100}.st-dropdown-bottom-left,.st-dropdown-bottom-right{margin-top:4px}.st-dropdown-top-left,.st-dropdown-top-right{margin-bottom:4px}.st-dropdown-item{color:var(--st-cell-color);cursor:pointer;padding:8px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);white-space:nowrap}.st-dropdown-item:hover{background-color:var(--st-button-hover-background-color)}.st-dropdown-item.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-dropdown-group-label{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 12px}.st-dropdown-divider{background-color:var(--st-border-color);height:1px;margin:4px 0}.st-datepicker{background-color:var(--st-odd-row-background-color);font-family:inherit}.st-datepicker-header{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;padding:10px}.st-datepicker-header-label{-webkit-box-flex:1;color:var(--st-header-label-color);cursor:pointer;-ms-flex:1;flex:1;font-weight:600;text-align:center}.st-datepicker-nav-btn{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background:#0000;border:none;border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:1.2em;justify-content:center;padding:0 8px}.st-datepicker-nav-btn>*{fill:var(--st-cell-color)!important}.st-datepicker-nav-btn:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-grid{display:grid;padding:10px}.st-datepicker-days-grid{gap:4px;grid-template-columns:repeat(7,1fr)}.st-datepicker-months-grid,.st-datepicker-years-grid{gap:8px;grid-template-columns:repeat(3,1fr)}.st-datepicker-weekday{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 0;text-align:center}.st-datepicker-day{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:50%;color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;height:32px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-day.empty{cursor:default}.st-datepicker-day:not(.empty):hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-day.today{color:var(--st-button-active-background-color);font-weight:600}.st-datepicker-day.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-day.other-month{color:var(--st-slate-400)}.st-datepicker-month,.st-datepicker-year{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:var(--st-border-radius);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:12px 8px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-month:hover,.st-datepicker-year:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-month.selected,.st-datepicker-year.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-footer{-webkit-box-pack:end;-ms-flex-pack:end;border-top:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:flex-end;padding:10px}.st-datepicker-today-btn{background-color:initial;border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;padding:6px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-today-btn:hover{background-color:var(--st-button-hover-background-color)}
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-container-width:10px;--st-border-width:1px;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--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-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-slate-50);--st-even-column-background-color:var(--st-white);--st-hover-row-background-color:var(--st-slate-100);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(--st-slate-900);--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-slate-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-color:var(--st-blue-500);--st-editable-cell-focus-border-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-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-gray-800);--st-even-column-background-color:var(--st-gray-900);--st-hover-row-background-color:var(--st-gray-700);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(--st-gray-100);--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-color:var(--st-blue-400);--st-editable-cell-focus-border-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-cell-flash-color:var(--st-gray-600)}.theme-neutral{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-neutral-50);--st-even-column-background-color:var(--st-neutral-100);--st-hover-row-background-color:var(--st-neutral-200);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(--st-neutral-900);--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-color:var(--st-neutral-600);--st-editable-cell-focus-border-color:var(--st-neutral-500);--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-cell-flash-color:var(--st-neutral-400)}.theme-sky{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--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-odd-column-background-color:var(--st-blue-50);--st-even-column-background-color:var(--st-blue-100);--st-hover-row-background-color:var(--st-blue-200);--st-header-background-color:var(--st-blue-200);--st-header-label-color:var(--st-blue-900);--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-color:var(--st-blue-600);--st-editable-cell-focus-border-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-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-cell-flash-color:var(--st-blue-300)}.theme-funky{--st-border-radius:8px;--st-cell-padding:12px;--st-spacing-small:6px;--st-spacing-medium:10px;--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-odd-column-background-color:var(--st-violet-50);--st-even-column-background-color:var(--st-amber-50);--st-hover-row-background-color:var(--st-amber-200);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(--st-white);--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-color:var(--st-violet-500);--st-editable-cell-focus-border-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-cell-flash-color:var(--st-violet-200)}.simple-table-root *{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root ::-webkit-scrollbar{height:8px;width:8px}.simple-table-root ::-webkit-scrollbar-track{background:var(--st-scrollbar-bg-color)}.simple-table-root ::-webkit-scrollbar-thumb{background:var(--st-scrollbar-thumb-color);border-radius:4px}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.st-wrapper{-webkit-box-flex:1;-ms-flex-positive:1;border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);flex-grow:1;max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.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{border-bottom:var(--st-border-width) solid var(--st-border-color);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{-webkit-overflow-scrolling:touch;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none;-ms-touch-action:auto;touch-action:auto}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-overflow-scrolling:touch;background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;-ms-touch-action:auto;touch-action:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-height:100%}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{-webkit-overflow-scrolling:touch;overflow:auto;scrollbar-width:none;-ms-touch-action:auto;touch-action:auto}.st-body-main::-webkit-scrollbar{display:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.hovered .st-cell:not(.st-cell-selected){background-color:var(--st-hover-row-background-color)}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color)}.st-row.odd .st-cell-content{color:var(--st-cell-odd-row-color)}.st-row.even .st-cell-content{color:var(--st-cell-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-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.parent{border-bottom:var(--st-border-width) solid var(--st-border-color)}.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;position:relative}.st-cell.left-aligned,.st-header-cell.left-aligned{padding-left:var(--st-cell-padding);text-align:left}.st-cell.center-aligned,.st-header-cell.center-aligned{text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label-text{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-flex:1;-ms-flex-positive:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;height:100%;min-width:0}.st-cell-content,.st-header-label-text{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;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-text{color:var(--st-header-label-color);font-weight:600;padding-left:var(--st-cell-padding);padding-right:var(--st-cell-padding)}.st-cell-content.left-aligned,.st-header-label-text.left-aligned{text-align:left}.st-cell-content.center-aligned,.st-header-label-text.center-aligned{text-align:center}.st-cell-content.right-aligned,.st-header-label-text.right-aligned{text-align:right}.st-not-resizeable .st-cell-content{padding-left:var(--st-cell-padding);padding-right:var(--st-cell-padding)}.st-resizeable .st-body-pinned-right .st-cell-content{padding-left:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width));padding-right:var(--st-cell-padding)}.st-resizeable .st-body-main .st-cell-content,.st-resizeable .st-body-pinned-left .st-cell-content{padding-left:var(--st-cell-padding);padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width))}.st-cell{border:var(--st-border-width) solid #0000}.st-cell.even-column:not(.st-cell-selected){background-color:var(--st-even-column-background-color)}.st-cell.odd-column:not(.st-cell-selected){background-color:var(--st-odd-column-background-color)}.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-cell-depth-1 .st-cell-content{color:rgb(from var(--st-cell-color) r g b/80%)!important}.st-cell-depth-2 .st-cell-content,.st-cell-depth-3 .st-cell-content,.st-cell-depth-4 .st-cell-content,.st-cell-depth-5 .st-cell-content,.st-cell-depth-6 .st-cell-content,.st-cell-depth-7 .st-cell-content{color:rgb(from var(--st-cell-color) r g b/70%)!important}.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-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;cursor:col-resize;display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;justify-content:center;width:var(--st-resize-handle-container-width)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);height:calc(100% - 20px);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-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color)}.st-cell-selected .st-cell-content{color:var(--st-selected-cell-color)!important}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border:var(--st-border-width) solid var(--st-selected-border-color)}.st-cell-selected-first .st-cell-content{color:var(--st-selected-first-cell-color)!important}.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-scrollbar-bg-color);border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px;width:100%}.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{height:100%}.st-horizontal-scrollbar-middle{-webkit-overflow-scrolling:touch;min-height:11px;overflow:auto;-ms-touch-action:auto;touch-action:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{-ms-flex-negative:0;background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);flex-shrink:0;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}.st-page-ellipsis{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;color:var(--st-cell-color);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-weight:700;justify-content:center;margin:0 var(--st-spacing-small);padding:var(--st-spacing-small)}.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);font-size:.875rem;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-column-editor-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;-webkit-overflow-scrolling:touch;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-medium);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small);-ms-touch-action:auto;touch-action:auto}.st-header-checkbox-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.st-header-checkbox-item,.st-header-icon-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-icon-container{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:24px}.st-collapsible-header-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer}.st-collapsible-header-icon,.st-nested-headers{display:-webkit-box;display:-ms-flexbox;display:flex}.st-nested-headers{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium)}.st-column-editor-popout.open{min-width:200px;width:auto}.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);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}.st-dropdown-content{-webkit-overflow-scrolling:touch;background-color:var(--st-odd-row-background-color);border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow);box-shadow:var(--st-edit-cell-shadow);max-height:400px;min-width:120px;overflow:auto;position:fixed;-ms-touch-action:auto;touch-action:auto;-webkit-transform:translateZ(0);transform:translateZ(0);will-change:transform;z-index:100}.st-dropdown-bottom-left,.st-dropdown-bottom-right{margin-top:4px}.st-dropdown-top-left,.st-dropdown-top-right{margin-bottom:4px}.st-dropdown-item{color:var(--st-cell-color);cursor:pointer;padding:8px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);white-space:nowrap}.st-dropdown-item:hover{background-color:var(--st-button-hover-background-color)}.st-dropdown-item.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-dropdown-group-label{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 12px}.st-dropdown-divider{background-color:var(--st-border-color);height:1px;margin:4px 0}.st-datepicker{background-color:var(--st-odd-row-background-color);font-family:inherit}.st-datepicker-header{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;padding:10px}.st-datepicker-header-label{-webkit-box-flex:1;color:var(--st-header-label-color);cursor:pointer;-ms-flex:1;flex:1;font-weight:600;text-align:center}.st-datepicker-nav-btn{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background:#0000;border:none;border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:1.2em;justify-content:center;padding:0 8px}.st-datepicker-nav-btn>*{fill:var(--st-cell-color)!important}.st-datepicker-nav-btn:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-grid{display:grid;padding:10px}.st-datepicker-days-grid{gap:4px;grid-template-columns:repeat(7,1fr)}.st-datepicker-months-grid,.st-datepicker-years-grid{gap:8px;grid-template-columns:repeat(3,1fr)}.st-datepicker-weekday{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 0;text-align:center}.st-datepicker-day{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:50%;color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;height:32px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-day.empty{cursor:default}.st-datepicker-day:not(.empty):hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-day.today{color:var(--st-button-active-background-color);font-weight:600}.st-datepicker-day.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-day.other-month{color:var(--st-slate-400)}.st-datepicker-month,.st-datepicker-year{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:var(--st-border-radius);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:12px 8px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-month:hover,.st-datepicker-year:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-month.selected,.st-datepicker-year.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-footer{-webkit-box-pack:end;-ms-flex-pack:end;border-top:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:flex-end;padding:10px}.st-datepicker-today-btn{background-color:initial;border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;padding:6px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-today-btn:hover{background-color:var(--st-button-hover-background-color)}
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from "react";
2
2
  import Row from "./Row";
3
3
  import { Pinned } from "./Pinned";
4
+ import Theme from "./Theme";
4
5
  type HeaderObject = {
5
6
  accessor: string;
6
7
  align?: "left" | "center" | "right";
@@ -8,6 +9,7 @@ type HeaderObject = {
8
9
  accessor: string;
9
10
  colIndex: number;
10
11
  row: Row;
12
+ theme: Theme;
11
13
  }) => ReactNode | string;
12
14
  children?: HeaderObject[];
13
15
  disableReorder?: boolean;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.8.31",
2
+ "version": "0.8.33",
3
3
  "main": "dist/index.js",
4
4
  "module": "dist/index.es.js",
5
5
  "types": "dist/index.d.ts",