simple-table-core 1.5.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ interface SimpleTableProps {
35
35
  headerExpandIcon?: ReactNode;
36
36
  headerDropdown?: HeaderDropdown;
37
37
  headerHeight?: number;
38
- height?: string;
38
+ height?: string | number;
39
39
  hideFooter?: boolean;
40
40
  nextIcon?: ReactNode;
41
41
  onCellEdit?: (props: CellChangeProps) => void;
@@ -1,5 +1,5 @@
1
1
  interface UseContentHeightProps {
2
- height?: string;
2
+ height?: string | number;
3
3
  rowHeight: number;
4
4
  }
5
5
  export declare const useContentHeight: ({ height, rowHeight }: UseContentHeightProps) => number;
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,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as h,cloneElement as f,forwardRef as v,useImperativeHandle as p,useReducer as g}from"react";var w=function(){return w=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},w.apply(this,arguments)};function m(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(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 C=function(e){return e<480?.3:e<768?.4:.8},S=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 l=a[i];o=r(l,o)}return o};return r(e,n),t},I=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,I(e.children)),n})},x=function(e){return void 0===e&&(e=0),e?e+1:0},R=function(e,n,t){var r=function(e,n){for(var t=0,r=I(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)},E=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},N=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&R(n,r,o))||null},H=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},k=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return k(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return k(e,n)}):[e]},A=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(E({accessor:e.accessor,rowId:"header"}));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(E({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){F(e)})},W=function(e){return"number"==typeof e.minWidth?e.minWidth:40},T=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},D=function(e){return e.row[e.rowIdAccessor]},M=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=D({row:t,rowIdAccessor:c}),h=l[n],f=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:h,position:r,isLastGroupRow:f}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return T(t)?t:[]}(t,h);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},L=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},B=s(void 0),O=function(n){var t=n.children,r=n.value;return e(B.Provider,w({value:r},{children:t}))},P=function(){var e=u(B);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},q=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=P(),d=u.nextIcon,h=u.prevIcon,f=o(!0),v=f[0],p=f[1],g=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},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>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;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<s-1&&(t.push(-1),t.push(s)),t}();return n("div",w({className:"st-footer"},{children:[e("button",w({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:h})),e("button",w({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return m(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",w({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",w({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},z=function(n){var t=n.className;return e("svg",w({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"})}))},j=function(n){var t=n.className;return e("svg",w({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"})}))},Y=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},G=function(e){return e.position*(e.rowHeight+1)-1},U=function(e){return e.position*(e.rowHeight+1)},V=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,h=n.containerRef,f=n.positioning,v=void 0===f?"fixed":f,p=P().mainBodyRef,g=i(null),m=i(null),y=o("bottom-left"),b=y[0],C=y[1],S=o({}),I=S[0],x=S[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!m.current&&g.current.parentElement&&(m.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&m.current){var e,n=g.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==h?void 0:h.current)?h.current.getBoundingClientRect():(null==p?void 0:p.current)?p.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,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,h,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",w({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:w(w({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},I),{overflow:s})},{children:t})):null},K=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",w({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},J=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],h=function(e){d(e),i(e),l(!1),r()};return n(V,w({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(K,w({isSelected:!0===u,onClick:function(){return h(!0)}},{children:"True"})),e(K,w({isSelected:!1===u,onClick:function(){return h(!1)}},{children:"False"}))]}))},X=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},_=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},$=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=P(),d=u.nextIcon,h=u.prevIcon,f=o(s||new Date),v=f[0],p=f[1],g=o("days"),m=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",w({className:"st-datepicker"},{children:[n("div",w({className:"st-datepicker-header"},{children:["days"===m&&n(t,{children:[e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),n("div",w({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===m&&e("div",w({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===m&&e("div",w({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",w({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",w({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",w({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e,12,0,0);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=new Date(s),u=o===a.getDate()&&r===a.getMonth()&&t===a.getFullYear();n.push(e("div",w({className:"st-datepicker-day ".concat(i?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=v.getFullYear(),t=v.getMonth(),r=new Date(n,t,e,12,0,0);p(r),l(r),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var g=35-(i+o),m=function(t){n.push(e("div",w({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e,12,0,0);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=g;f++)m(f);return n}(),"months"===m&&(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",w({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===m&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",w({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",w({className:"st-datepicker-footer"},{children:e("button",w({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);p(n),l(n),null==c||c()}},{children:"Today"}))}))]}))},Q=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},Z=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},ee=function(e){if(!e)return new Date;if("string"==typeof e)return Q(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:Z(n)}return e instanceof Date?Z(e):new Date},ne=function(e){return e?Q(e.toString()):new Date},te=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;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 l=function(){t()};return e(V,w({open:o,onClose:l,setOpen:i,width:280},{children:e($,{value:ne(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},re=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(V,w({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",w({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(K,w({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},oe=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(J,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(te,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(re,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(_,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(X,{defaultValue:u,onBlur:s,onChange:o})},ie=0,ae=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===ie||o-ie>=r)&&(ie=o,n(t))}},le=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},ce=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ce);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=ce(e[t]));return n},se=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ue=Date.now(),de={screenX:0,screenY:0},he=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 b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=he(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},fe=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ve(e,n,t){var r,o,i=ce(e),a=!1;try{var l=fe(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=w({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),h=s;i.splice(h,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var pe=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=P().setHeaders,l=le(t);return{handleDragStart:function(e){n.current=e,ue=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-de.screenX,2)+Math.pow(u-de.screenY,2));r.current=a;var h,f=n.current,v=!1;if(fe(f)!==fe(a)){h=(S=ve(t,f,a)).newHeaders,v=S.emergencyBreak}else{var p=t,g=he(p,f.accessor),w=he(p,a.accessor);if(!g||!w)return;var m=g.length,y=w.length,b=w;if(m!==y){var C=y-m;C>0&&(b=w.slice(0,-C))}var S=function(e,n,t){var r=ce(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 l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);h=S.newHeaders,v=S.emergencyBreak}if(!(c||a.accessor===f.accessor||d<10||JSON.stringify(h)===JSON.stringify(t)||v)){var I=Date.now();JSON.stringify(h)===JSON.stringify(l)&&(I-ue<1500||d<40)||(ue=I,de={screenX:s,screenY:u},i(h))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return b([],e,!0)}),null==o||o(t)},10)}}},ge=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},we={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},me={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ye={duration:150,easing:"ease-out",delay:0},be=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},Ce=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){be(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Se=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return m(void 0,void 0,void 0,function(){var e,i,a;return y(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:ge()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),ge()?w(w({},ye),e):w(w({},"column"===n?we:me),e)}(t,i?"column":"row"),be(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,Ce(n,a,t)]);case 1:return l.sent(),[2]}})})},Ie=function(e){var n=e.element,t=e.options;return m(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,h,f,v,p,g,w;return y(this,function(m){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,h=t.respectReducedMotion,f=void 0===h||h,ge()&&f?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,w=r-p,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},xe=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=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","id","parentRef","tableRow"]),c=P(),s=c.allowAnimations,u=c.isResizing,h=c.isScrolling,f=c.rowHeight,v=i(null),p=i(null),g=le(h),m=le(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!h)if(!g||h)if(!m||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=w(w({},me),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,S=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==S){var I=5*f,x=b-I,R=b+C+I,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,H=i.y<b,k=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,F=.6*f,W=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&k){var T=b+C+W(i.y,b,b+C)+A%15*F*2.5+A%7*(.4*f);return void Ie({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&H){T=b-W(i.y,b,b+C)-A%15*F*2.5-A%7*(.4*f);return void Ie({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var D=b+C+W(l.y,b,b+C)+A%10*F*1;return void Ie({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){D=b-W(l.y,b,b+C)-A%10*F*1;return void Ie({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}Se({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,h,o,g,m,f,null==a?void 0:a.position,a]),e("div",w({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};xe.displayName="Animate";var Re=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:w({height:"10px"},r)},{children:e("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},Ee=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",w({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",w({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(Re,{className:"st-checkbox-checkmark"})})),i]}))},Ne=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?ee(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},He=function(t){var r=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,h=t.isInitialFocused,f=t.nestedIndex,v=t.rowIndex,p=t.tableRow,g=P(),m=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,C=g.draggedHeaderRef,S=g.enableRowSelection,I=g.expandIcon,x=g.handleMouseDown,R=g.handleMouseOver,N=g.handleRowSelect,k=g.headers,A=g.hoveredHeaderRef,F=g.isCopyFlashing,W=g.isRowSelected,M=g.isWarningFlashing,L=g.onCellEdit,B=g.onCellClick,O=g.onTableHeaderDragEnd,q=g.rowButtons,z=g.rowGrouping,j=g.rowIdAccessor,Y=g.rowsWithSelectedCells,G=g.selectedColumns,U=g.setUnexpandedRows,V=g.tableBodyContainerRef,K=g.theme,J=g.unexpandedRows,X=g.useOddColumnBackground,_=p.depth,$=p.row,Q=o($[u.accessor]),Z=Q[0],ee=Q[1],ne=o(!1),te=ne[0],re=ne[1],ie=o(!1),le=ie[0],ce=ie[1],se=o(!1),ue=se[0],de=se[1],he=i(null),fe=D({row:$,rowIdAccessor:j}),ve=z&&z[_],ge=!!ve&&function(e,n){if(!n)return!1;var t=e[n];return T(t)}($,ve),we=!J.has(String(fe)),me=F({rowIndex:v,colIndex:s,rowId:fe}),ye=M({rowIndex:v,colIndex:s,rowId:fe}),be=a(function(){var e,n,t;if(!b)return!1;var r=k.filter(function(e){return"left"===e.pinned}),o=k.filter(function(e){return!e.pinned}),i=k.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,k,u.accessor,u.pinned]),Ce=pe({draggedHeaderRef:C,headers:k,hoveredHeaderRef:A,onTableHeaderDragEnd:O}).handleDragOver,Se=ae(),Ie=E({accessor:u.accessor,rowId:fe}),Re=H({rowId:fe,accessor:u.accessor}),He=u.isSelectionColumn&&S;c(function(){if(m){var e="".concat(fe,"-").concat(u.accessor);return m.set(e,{updateContent:function(e){Z!==e?(ee(e),y&&(ce(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){ce(!1)},800))):ee(e)}}),function(){m.delete(e),he.current&&clearTimeout(he.current)}}},[m,y,fe,u.accessor,Z]),c(function(){if(le){var e=setTimeout(function(){ce(!1)},850);return function(){return clearTimeout(e)}}},[le]),c(function(){ee($[u.accessor])},[$,u.accessor]);var ke="boolean"===u.type||"date"===u.type||"enum"===u.type,Ae=Boolean(null==u?void 0:u.isEditable),Fe=G.has(s),We=d&&!Fe,Te=a(function(){return!!He&&Y.has(String(fe))},[He,Y,fe]),De="st-cell ".concat(_>0&&u.expandable?"st-cell-depth-".concat(_):""," ").concat(We?h?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Fe?h?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ae?"clickable":""," ").concat(le?h?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?h?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ye?h?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(X?f%2==0?"even-column":"odd-column":""," ").concat(He?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(be?"st-last-column":""),Me=l(function(e){ee(e),$[u.accessor]=e,null==L||L({accessor:u.accessor,newValue:e,row:$,rowIndex:v})},[u.accessor,L,$,v]),Le=l(function(){U(function(e){var n=new Set(e),t=String(fe);return n.has(t)?n.delete(t):n.add(t),n})},[fe,U]);return!te||ke||He?n(xe,w({className:De,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":fe,"data-row-index":v,id:Ie,onClick:function(){B&&!He&&B({accessor:u.accessor,colIndex:s,row:$,rowId:fe,rowIndex:v,value:Z})},onDoubleClick:function(){return u.isEditable&&!He&&re(!0)},onDragOver:function(e){He||Se({callback:Ce,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){te||He||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||te||(e.preventDefault(),re(!0))},onMouseDown:function(){te||He||x({rowIndex:v,colIndex:s,rowId:fe})},onMouseEnter:function(){de(!0)},onMouseLeave:function(){de(!1)},onMouseOver:function(){te||He||R({rowIndex:v,colIndex:s,rowId:fe})},parentRef:V,tableRow:p},{children:[u.expandable&&ge?e("div",w({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:Le},{children:I})):null,e("span",w({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:He?n("div",w({className:"st-selection-cell-content"},{children:[e("div",w({className:"st-selection-control"},{children:ue||W&&W(String(fe))?e(Ee,{checked:!!W&&W(String(fe)),onChange:function(e){N&&N(String(fe),e)}}):e("span",w({className:"st-row-number"},{children:v+1}))})),function(){if(!q||!He||0===q.length)return null;if(!(ue||W&&W(String(fe))))return null;var n={row:$};return e("div",w({className:"st-row-buttons"},{children:q.map(function(t,r){return e("span",w({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:$,theme:K}):Ne({content:Z,header:u})})})),te&&ke&&!He&&e(oe,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})]}),Re):e("div",w({className:"st-cell-editing",id:E({accessor:u.accessor,rowId:fe}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(oe,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})}))},ke=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=P(),d=u.rowIdAccessor,h=u.collapsedHeaders,f=i.filter(function(e){return N({header:e,pinned:a,headers:i,collapsedHeaders:h})});return e(t,{children:f.map(function(n,t){var u=D({row:s.row,rowIdAccessor:d}),h=E({accessor:n.accessor,rowId:u});return e(Ae,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},h)})})},Ae=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=P(),f=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,w=d.collapsedHeaders,m=D({row:s.row,rowIdAccessor:g});if(r.children&&r.children.length>0){var y=r.children.filter(function(e){return N({header:e,pinned:a,headers:o,collapsedHeaders:w})});return e(h,{children:y.map(function(n){var r=E({accessor:n.accessor,rowId:m});return e(Ae,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var b={rowIndex:l,colIndex:u,rowId:m},C=f(b),S=v(b),I=p(b),x=E({accessor:r.accessor,rowId:m});return e(He,{borderClass:C,colIndex:u,header:r,isHighlighted:S,isInitialFocused:I,nestedIndex:i,rowIndex:l,tableRow:s},x)},Fe=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,l=n.pinned,c=n.rowHeight,s=n.rowIndices,u=n.setHoveredIndex,d=n.tableRow,h=P(),f=h.useHoverRowBackground,v=h.rowIdAccessor,p=h.isAnimating,g=h.isRowSelected,m=h.useOddEvenRowBackground,y=d.position,b=y%2==0,C=D({row:d.row,rowIdAccessor:v}),S=!!g&&g(String(C));return e("div",w({className:"st-row ".concat(m?b?"even":"odd":""," ").concat(S?"selected":""),"data-index":a,onMouseEnter:function(){!p&&f&&u(a)},style:{gridTemplateColumns:o,top:U({position:y,rowHeight:c}),height:"".concat(c,"px")}},{children:e(ke,{columnIndexStart:r,columnIndices:t,headers:i,pinned:l,rowIndex:y,rowIndices:s,tableRow:d},C)}))},We=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",w({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var h=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(h)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:G({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},Te=s(void 0),De=function(e){var n=e.childRef,t=e.children,r=e.group,o=void 0===r?"default":r,i=function(){var e=u(Te);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),a=i.registerPane,l=i.unregisterPane,s=[o];return c(function(){return n.current&&a(n.current,s),function(){n.current&&l(n.current,s)}},[n,a,l,o]),f(t,{ref:function(e){n.current=e}})},Me=v(function(t,r){var o=t.columnIndexStart,l=t.columnIndices,c=t.headers,s=t.pinned,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,v=t.templateColumns,g=t.totalHeight,m=t.rowsToRender,y=t.width,b=s?"st-body-pinned-".concat(s):"st-body-main",C=P().rowIdAccessor,S=i(null);if(p(r,function(){return S.current},[]),!a(function(){return se(c,s)},[c,s]))return null;var I=s?"pinned-".concat(s):"default";return e(De,w({childRef:S,group:I},{children:e("div",w({className:b,ref:S,style:w({position:"relative",height:"".concat(g,"px"),width:y},!s&&{flexGrow:1})},{children:m.map(function(t,r){var i=D({row:t.row,rowIdAccessor:C});return n(h,{children:[0!==r&&e(We,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:v,rowIndex:r-1}),e(Fe,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:v,headers:c,index:r,pinned:s,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:t},i)]},i)})}))}))});function Le(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=b(b(b([],t,!0),n,!0),r,!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 N({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&N({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Me.displayName="TableSection";var Be=function(t){var r=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.rowsToRender,g=t.setScrollTop,m=t.tableRows,y=P(),b=y.collapsedHeaders,C=y.headerContainerRef,S=y.headers,I=y.isAnimating,x=y.mainBodyRef,R=y.onLoadMore,E=y.rowHeight,N=y.rowIdAccessor,H=y.scrollbarWidth,k=y.setIsScrolling,A=y.shouldPaginate,F=y.tableBodyContainerRef,W=o(!1),T=W[0],M=W[1],L=i(new Set),B=l(function(e){(L.current.forEach(function(e){return e.classList.remove("hovered")}),L.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),L.current.add(e)})},[]);c(function(){I&&B(null)},[I,B]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=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;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:C,mainSectionRef:F,scrollbarWidth:H}),c(function(){return function(){q.current&&clearTimeout(q.current)}},[]);var O=i(null),q=i(null),z=i(0),j=function(e){return e.length}(m),Y=j*(E+1)-1,G=a(function(){return Le({headers:S,pinnedLeftColumns:s,pinnedRightColumns:h,collapsedHeaders:b})},[S,s,h,b]),U=a(function(){var e={};return p.forEach(function(n,t){var r=String(D({row:n.row,rowIdAccessor:N}));e[r]=t}),e},[p,N]),V=l(function(e,n){if(R&&!A&&!T){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(M(!0),R(),setTimeout(function(){M(!1)},1e3))}},[R,A,T]),K={columnIndices:G,headerContainerRef:C,headers:S,rowHeight:E,rowIndices:U,rowsToRender:p,setHoveredIndex:B};return n("div",w({className:"st-body-container",onMouseLeave:function(){return B(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(function(){k(!1)},150),O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(function(){g(t),V(n,t),z.current=t})},ref:F},{children:[e(Me,w({},K,{pinned:"left",templateColumns:u,totalHeight:Y,width:d})),e(Me,w({},K,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:Y})),e(Me,w({},K,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:f,totalHeight:Y,width:v}))]}))},Oe=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(t&&!t.hide){i(!0);var u,d=W(t);if(t.children&&t.children.length>0){var h=k(t,l);u=h.length>0?h:[t]}else u=[t];var f=function(e){var n="right"===t.pinned?c-e:e-c,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=i*C(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var l=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+k(n,r).reduce(function(e,n){return e+A(n)},0)},0),c=W(n);return l<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):l}({header:t,headers:r,collapsedHeaders:l});if(u.length>1)Pe({delta:n,leafHeaders:u,minWidth:d,startWidth:a,maxWidth:i});else{var s=Math.max(Math.min(a+n,i),d);u[0].width=s}r.forEach(function(e){F(e)});var h=b([],r,!0);o(h)};if(s){var v=function(e){var n=e.touches[0];f(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p),i(!1)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var g=function(e){f(e.clientX)},w=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",w),i(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",w)}}},Pe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,W(n))},40),l=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),c=Math.max(Math.min(o+n,i),a)-l;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=c*(n/l),o=Math.max(n+t,r);e.width=o})},qe=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:w({height:"1em"},r)},{children:e("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},ze={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},je=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Ye=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ge=function(e){return["between","notBetween","in","notIn"].includes(e)},Ue=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ve=function(n){var t=n.children;return e("div",w({className:"st-filter-container"},{children:t}))},Ke=function(){return e("svg",w({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Je=function(t){var r=t.value,a=t.onChange,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,h=void 0===d?"":d,f=t.disabled,v=void 0!==f&&f,p=o(!1),g=p[0],m=p[1],y=o(-1),b=y[0],C=y[1],S=i(null),I=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),m(!1),C(-1));break;case"Escape":e.preventDefault(),m(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",w({ref:S,className:"st-custom-select ".concat(h," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",w({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(m(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",w({className:"st-custom-select-value"},{children:I?I.label:u})),e(Ke,{})]})),e(V,w({open:g,setOpen:m,onClose:function(){m(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",w({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",w({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),m(!1),void C(-1);var e}},{children:n.label}),t)})}))}))]}))},Xe=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:ze[e]}});return e("div",w({className:"st-filter-section"},{children:e(Je,{value:t,onChange:function(e){r(e)},options:o})}))},_e=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},$e=function(n){var t=n.children,r=n.className;return e("div",w({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Qe=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",w({className:"st-filter-actions"},{children:[e("button",w({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",w({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Ze=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],h=o(String((null==i?void 0:i.value)||"")),f=h[0],v=h[1],p=je("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=w({accessor:r.accessor,operator:u},Ye(u)&&{value:f});a(e)},m=Ue(u)||f.trim();return n(Ve,{children:[e(Xe,{value:u,onChange:d,operators:p}),Ye(u)&&e($e,{children:e(_e,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Qe,{onApply:g,onClear:l,canApply:!!m,showClear:!!i})]})},en=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),h=d[0],f=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],w=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),m=w[0],y=w[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],S=b[1],I=je("number");c(function(){var e,n;l?(f(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),g(""),y(""),S(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:h};Ye(h)?e.value=parseFloat(p):Ge(h)&&(e.values=[parseFloat(m.toString()),parseFloat(C.toString())]),s(e)};return n(Ve,{children:[e(Xe,{value:h,onChange:f,operators:I}),Ye(h)&&e($e,{children:e(_e,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),Ge(h)&&n($e,{children:[e(_e,{type:"number",value:m,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e(_e,{type:"number",value:C,onChange:S,placeholder:"To...",onEnterPress:x})]}),e(Qe,{onApply:x,onClear:u,canApply:!!Ue(h)||(Ye(h)?""!==p.trim():!!Ge(h)&&""!==String(m).trim()&&""!==String(C).trim()),showClear:!!l})]})},nn=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(Je,{value:t,onChange:r,options:o,className:a,placeholder:l})},tn=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=je("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Ue(u)||""!==f;return n(Ve,{children:[e(Xe,{value:u,onChange:d,operators:p}),Ye(u)&&e($e,{children:e(nn,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Qe,{onApply:function(){var e={accessor:r.accessor,operator:u};Ye(u)&&(e.value="true"===f),a(e)},onClear:l,canApply:g,showClear:!!i})]})},rn=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,h=o((null==s?void 0:s.operator)||"equals"),f=h[0],v=h[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],m=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],S=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),I=S[0],x=S[1],R=je("date");c(function(){var e,n;s?(v(s.operator),m(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),m(""),C(""),x(""))},[s]);var E=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),h=d[0],f=d[1],v=o(""),p=v[0],g=v[1],m=i(null);c(function(){if(r){var e=ee(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&m.current&&m.current.focus()},[s]);var y=r?ee(r):new Date;return n("div",w({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:m,type:"text",value:p,placeholder:l,onClick:function(){f(!h)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),f(!h)):"Escape"===e.key&&f(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(V,w({open:h,setOpen:f,onClose:function(){f(!1)},positioning:"absolute",overflow:"visible"},{children:e($,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),f(!1)},onClose:function(){return f(!1)}})}))]}))};return n(Ve,{children:[e(Xe,{value:f,onChange:v,operators:R}),Ye(f)&&e($e,{children:e(E,{value:g,onChange:m,placeholder:"Select date...",autoFocus:!0})}),Ge(f)&&n($e,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:I,onChange:x,placeholder:"To date..."})]}),e(Qe,{onApply:function(){var e={accessor:l.accessor,operator:f};Ye(f)?e.value=g:Ge(f)&&(e.values=[b,I]),u(e)},onClear:d,canApply:!!Ue(f)||(Ye(f)?""!==g.trim():!!Ge(f)&&""!==b.trim()&&""!==I.trim()),showClear:!!s})]})},on=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),h=o((null==i?void 0:i.values)?i.values.map(String):d),f=h[0],v=h[1],p=o(""),g=p[0],m=p[1],y=a(function(){if(!g)return u;var e=g.toLowerCase();return u.filter(function(n){return n.label.toLowerCase().includes(e)})},[u,g]);c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var C=f.length===d.length,S=u.length>10;return n(Ve,{children:[e($e,{children:n("div",w({className:"st-enum-filter-options"},{children:[e("div",w({className:"st-enum-select-all"},{children:e(Ee,w({checked:C,onChange:function(e){v(e?d:[])}},{children:e("span",w({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),S&&e("div",w({className:"st-enum-search"},{children:e(_e,{type:"text",value:g,onChange:m,placeholder:"Search..."})})),y.map(function(n,t){return e(Ee,w({checked:f.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",w({className:"st-enum-option-label"},{children:n.label}))}),t)}),g&&0===y.length&&e("div",w({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e(Qe,{onApply:function(){if(f.length!==d.length){var e={accessor:r.accessor,operator:"in",values:f};l(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==d.length,showClear:!!i})]})},an=function(n){var r=n.header,o=n.currentFilter,i=n.onApplyFilter,a=n.onClearFilter;return e(t,{children:function(){switch(r.type){case"number":return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(tn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(rn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(on,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(Ze,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},ln=function(t){var r,s,u=t.colIndex,d=t.gridColumnEnd,h=t.gridColumnStart,f=t.gridRowEnd,v=t.gridRowStart,p=t.header,g=t.reverse,m=t.sort,y=o(!1),C=y[0],I=y[1],x=o(!1),R=x[0],N=x[1],H=o(p.label||""),k=H[0],A=H[1],F=P(),W=F.activeHeaderDropdown,T=F.areAllRowsSelected,D=F.collapsedHeaders,M=F.columnBorders,L=F.columnReordering,B=F.columnResizing,O=F.columnsWithSelectedCells,q=F.draggedHeaderRef,z=F.enableHeaderEditing,j=F.enableRowSelection,Y=F.filters,G=F.handleApplyFilter,U=F.handleClearFilter,K=F.handleSelectAll,J=F.headerCollapseIcon,_=F.headerDropdown,$=F.headerExpandIcon,Q=F.headerRegistry,Z=F.headers,ee=F.hoveredHeaderRef,ne=F.onColumnOrderChange,te=F.onColumnSelect,re=F.onHeaderEdit,oe=F.onSort,ie=F.onTableHeaderDragEnd,le=F.headerHeight,ce=F.selectColumns,se=F.selectableColumns,ue=F.selectedColumns,de=F.setActiveHeaderDropdown,he=F.setCollapsedHeaders,fe=F.setHeaders,ve=F.setInitialFocusedCell,ge=F.setIsResizing,we=F.setSelectedCells,me=F.setSelectedColumns,ye=F.sortDownIcon,be=F.sortUpIcon,Ce=Boolean(null==p?void 0:p.isSortable),Se=Boolean(null==p?void 0:p.filterable),Ie=Y[p.accessor],Re=(null==W?void 0:W.accessor)===p.accessor,Ne=p.isSelectionColumn&&j,He=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(p),ke=D.has(p.accessor),Ae=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),h=o({}),f=h[0],v=h[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:f}}({isOpen:Re,estimatedHeight:200,estimatedWidth:250,margin:4}),Fe=Ae.triggerRef,We=Ae.position,Te=a(function(){var e,n,t;if(!M)return!1;var r=Z.filter(function(e){return"left"===e.pinned}),o=Z.filter(function(e){return!e.pinned}),i=Z.filter(function(e){return"right"===e.pinned});return"left"===p.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===p.accessor:"right"===p.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===p.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===p.accessor},[M,Z,p.accessor,p.pinned]),De=a(function(){return!(!se||Ne)&&S(p,u).some(function(e){return ue.has(e)})},[se,Ne,p,u,ue]),Me=a(function(){return!Ne&&S(p,u).some(function(e){return O.has(e)})},[Ne,p,u,O]),Le=a(function(){return!(!p.children||0===p.children.length)&&(!ke||p.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[p.children,ke]),Be="st-header-cell ".concat(p.accessor===(null===(r=ee.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=q.current)||void 0===s?void 0:s.accessor)===p.accessor?"st-dragging":""," ").concat(Ce?"clickable":""," ").concat(L&&!Ce?"columnReordering":""," ").concat(Le?"parent":""," ").concat(Te?"st-last-column":""," ").concat(z&&!Ne?"st-header-editable":""," ").concat(De?"st-header-selected":""," ").concat(Me&&!De?"st-header-has-highlighted-cell":""),Pe=pe({draggedHeaderRef:q,headers:Z,hoveredHeaderRef:ee,onColumnOrderChange:ne,onTableHeaderDragEnd:ie}),ze=Pe.handleDragStart,je=Pe.handleDragEnd,Ye=Pe.handleDragOver,Ge=ae();c(function(){if(Q&&!p.isSelectionColumn){var e=String(p.accessor);return Q.set(e,{setEditing:function(e){N(e)}}),function(){Q.delete(e)}}},[Q,p.accessor,p.isSelectionColumn]),c(function(){A(p.label||"")},[p.label]);var Ue=l(function(e){A(e);var n=Z.map(function(n){return n.accessor===p.accessor?w(w({},n),{label:e}):n});fe(n),re&&re(p,e)},[Z,fe,re,p]),Ve=l(function(){de&&de(null)},[de]),Ke=l(function(e){e.stopPropagation(),he(function(e){var n=new Set(e);return ke?n.delete(p.accessor):n.add(p.accessor),n})},[he,ke,p.accessor]),Je=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(se){var r=S(t,u),o=r.some(function(e){return ue.has(e)});if(z&&o&&!n.shiftKey)return _&&Re&&Ve(),void N(!0);n.shiftKey&&ce?me(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,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):ce&&ce(r),we(new Set),ve(null)}te&&te(t),!se&&t.isSortable&&oe(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)}},[]),!p)return null;var Xe=B&&!Ne&&e("div",w({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(E({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Oe,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:h,header:p,headers:Z,setHeaders:fe,setIsResizing:ge,startWidth:t,collapsedHeaders:D},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(E({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Oe,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:h,header:p,headers:Z,setHeaders:fe,setIsResizing:ge,startWidth:t,collapsedHeaders:D},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),_e=m&&m.key.accessor===p.accessor&&n("div",w({className:"st-icon-container",onClick:function(e){return Je({event:e,header:p})}},{children:["ascending"===m.direction&&be&&be,"descending"===m.direction&&ye&&ye]})),$e=Se&&n("div",w({className:"st-icon-container",onClick:function(e){e.stopPropagation(),I(!C)}},{children:[e(qe,{className:"st-header-icon",style:{fill:Ie?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(V,w({open:C,overflow:"visible",setOpen:I,onClose:function(){return I(!1)}},{children:e(an,{header:p,currentFilter:Ie,onApplyFilter:function(e){G(e),I(!1)},onClearFilter:function(){U(p.accessor),I(!1)}})}))]})),Qe=He&&!Ne&&e("div",w({className:"st-icon-container st-collapse-icon-container",onClick:Ke},{children:ke?J:$}));return n(xe,w({className:Be,id:E({accessor:p.accessor,rowId:"header"}),onDragOver:function(e){Ne||Ge({callback:Ye,callbackProps:{event:e,hoveredHeader:p},limit:50})},style:w({gridRowStart:v,gridRowEnd:f,gridColumnStart:h,gridColumnEnd:d},f-v>1?{}:{height:le})},{children:[g&&Xe,"right"===p.align&&Qe,"right"===p.align&&$e,"right"===p.align&&_e,e("div",w({ref:Fe,className:"st-header-label",draggable:L&&!p.disableReorder&&!Ne,onClick:function(e){Ne||Je({event:e,header:p})},onDoubleClick:function(e){Ne||function(e){e.event;var n=e.header;n.isSelectionColumn||se&&n.isSortable&&oe(n.accessor)}({event:e,header:p})},onDragEnd:Ne?void 0:function(e){e.preventDefault(),je()},onDragStart:Ne?void 0:function(e){L&&p&&function(e){ze(e)}(p)}},{children:e("span",w({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:Ne?e(Ee,{checked:!!T&&T(),onChange:function(e){K&&K(e)}}):R?e(X,{defaultValue:k,onBlur:function(){return N(!1)},onChange:Ue}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:u,header:p}):k||(null==p?void 0:p.label)}))})),"right"!==p.align&&_e,"right"!==p.align&&$e,"right"!==p.align&&Qe,!g&&Xe,_&&!Ne&&e("div",w({className:"st-header-dropdown-container"},{children:_({accessor:p.accessor,colIndex:u,header:p,isOpen:Re,onClose:Ve,position:We})}))]}))},cn=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,h=n.width,f=P().collapsedHeaders,v=a(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!N({header:o,pinned:s,headers:l,collapsedHeaders:f}))return 0;a||n++;var h=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return N({header:e,pinned:s,headers:l,collapsedHeaders:f})}).length)&&void 0!==d?d:0,v=n,p=h>0?v+h:v+1,g=i,w=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:p,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var m=!0;o.children.forEach(function(e){N({header:e,pinned:s,headers:l,collapsedHeaders:f})&&(t(e,i+1,m),m=!1)})}return p-v},o=l.filter(function(e){return N({header:e,pinned:s,headers:l,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r,f]),p=s?"pinned-".concat(s):"default";return e(De,w({childRef:u,group:p},{children:e("div",w({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,width:h,position:"relative"}},{children:e(t,{children:v.map(function(n){return e(ln,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},sn=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(sn)):1},un=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.sort,h=t.pinnedLeftWidth,f=t.pinnedRightWidth,v=P(),p=v.headerContainerRef,g=v.pinnedLeftRef,m=v.pinnedRightRef,y=v.collapsedHeaders,C=a(function(){return Le({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s,collapsedHeaders:y})},[o,l,s,y]),S=a(function(){var e=0,n=b(b(b([],l,!0),o,!0),s,!0);return o.forEach(function(t){if(N({header:t,headers:n,collapsedHeaders:y})){var r=sn(t);e=Math.max(e,r)}}),{maxDepth:e}},[o,l,s,y]).maxDepth;return n("div",w({className:"st-header-container",ref:p},{children:[se(o,"left")&&e(cn,{columnIndices:C,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:S,pinned:"left",sectionRef:g,sort:d,width:h}),e(cn,{columnIndices:C,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:S,sectionRef:r,sort:d}),se(o,"right")&&e(cn,{columnIndices:C,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:S,pinned:"right",sectionRef:m,sort:d,width:f})]}))},dn=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});r({headers:i,flattenedHeaders:o})}else 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(" "))},hn=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=P(),h=d.columnResizing,f=d.editColumns,v=d.headers,p=d.collapsedHeaders,g=i(null),m=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return dn({headers:y,collapsedHeaders:p})},[y,p]),S=a(function(){return dn({headers:m,collapsedHeaders:p})},[m,p]),I=a(function(){return dn({headers:b,collapsedHeaders:p})},[b,p]),x={centerHeaderRef:g,headers:v,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},R={tableRows:s,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",w({className:"st-content ".concat(h?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e(un,w({},x)),e(Be,w({},R))]}))},fn=function(t){var r=t.mainBodyWidth,a=t.mainBodyRef,l=t.pinnedLeftWidth,s=t.pinnedRightWidth,u=t.pinnedLeftContentWidth,d=t.pinnedRightContentWidth,h=t.tableBodyContainerRef,f=P().editColumns,v=o(!1),p=v[0],g=v[1],m=i(null),y=i(null),b=i(null),C=h.current&&h.current.scrollHeight>h.current.clientHeight,S=f?28:0,I=(f?s+1:s)+(h.current&&C?h.current.offsetWidth-h.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(a.current){var e=a.current.clientWidth;g(r>e)}}()},1)},[a,r]),p?n("div",w({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e(De,w({childRef:y,group:"pinned-left"},{children:e("div",w({className:"st-horizontal-scrollbar-left",ref:y,style:{width:l}},{children:e("div",{style:{width:u}})}))})),r>0&&e(De,w({childRef:m},{children:e("div",w({className:"st-horizontal-scrollbar-middle",ref:m},{children:e("div",{style:{width:r}})}))})),s>0&&e(De,w({childRef:b,group:"pinned-right"},{children:e("div",w({className:"st-horizontal-scrollbar-right",ref:b,style:{width:I}},{children:e("div",{style:{width:d}})}))})),S>0&&e("div",{style:{width:S-1.5,height:"100%",flexShrink:0}})]})):null},vn={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 vn.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?vn.string(e,n,t):"number"==typeof e&&"number"==typeof n?vn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?vn.boolean(e,n,t):vn.string(String(e),String(n),t)}},pn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return b([],n,!0).sort(function(e,n){var r=t.key.accessor;return 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 vn.number(i,a,r)}return"date"===t?vn.date(String(e),String(n),r):"boolean"===t?vn.boolean(Boolean(e),Boolean(n),r):"enum"===t?vn.enum(String(e),String(n),r):vn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},gn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return pn({rows:t,sortColumn:r,headers:n})},wn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):gn({headers:i,rows:t,sortColumn:r}):t},mn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(mn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},yn=function(e){return e.every(function(e){return e.hide})},bn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(bn(e.children),yn(e.children)&&(e.hide=!0))})},Cn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),h=d[0],f=d[1],v=P(),p=v.expandIcon,g=v.headers,m=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,S=null!=u?u:s.hide||C&&s.children&&yn(s.children);return n(t,{children:[n("div",w({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",w({className:"st-header-icon-container"},{children:C?e("div",w({className:"st-collapsible-header-icon st-expand-icon-container ".concat(h?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!h)}},{children:p})):null})),e(Ee,w({checked:S,onChange:function(e){(s.hide=e,e)?bn(i):(mn(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,mn(i,s.children[0].accessor)));m(b([],g,!0))}},{children:s.label}))]})),C&&h&&s.children&&e("div",w({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(Cn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!S||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},Sn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",w({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",w({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(Cn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},In=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],h=u[1];return i?n("div",w({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){h(e)}(!d)},style:{width:28}},{children:[e("div",w({className:"st-column-editor-text"},{children:r})),e(Sn,{headers:l,open:d,position:s})]})):null},xn=function(n){var t=n.className;return e("svg",w({"aria-hidden":"true",focusable:"false",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"})}))},Rn=function(n){var t=n.className;return e("svg",w({"aria-hidden":"true",focusable:"false",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"})}))},En=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(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&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),h=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(Te.Provider,w({value:{registerPane:d,unregisterPane:h}},{children:r.Children.only(t)}))},Nn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=ze[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},Hn=function(){var t=P(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",w({className:"st-filter-bar"},{children:e("div",w({className:"st-filter-bar-content"},{children:e("div",w({className:"st-filter-chips"},{children:a.map(function(t){return n("div",w({className:"st-filter-chip"},{children:[e("span",w({className:"st-filter-chip-text"},{children:Nn(t,i)})),e("button",w({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},kn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);return u=h[0],d=h[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=ee(e),v=ee(String(r||"")),p=Z(f),g=Z(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var w=o.map(function(e){return Z(ee(String(e||"")))}),m=w[0],y=w[1];return p>=m&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return Z(ee(String(e||"")))});return m=b[0],y=b[1],p<m||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var S=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=S}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var I=String(e),x=o.includes(I);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},An=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return I(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&T(l)){var c=i(l,t+1),s=w({},n);return s[o]=c,e.forEach(function(e){var n=Fn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},Fn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&T(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Wn=function(e){if(null==e)return"";var n=String(e);if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},Tn=function(e,n,t){var r=function(e,n){var t=function(e){var n=[],t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?t(i.children):n.push(i))}};return t(e),n}(n);return b([t.map(function(e){return Wn(e.label)}).join(",")],e.map(function(e){var n=e.row;return t.map(function(e){var t=n[e.accessor];return Wn(t)}).join(",")}),!0).join("\n")}(e,n);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(r,t)},Dn=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],h=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),f=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),w=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),m=l(function(e){if(c){var n=h(e);g(e,!n)}},[h,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:h,areAllRowsSelected:f,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:w,handleToggleRow:m,clearSelection:y}},Mn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(Ln,w({},n)):null},Ln=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,h=void 0!==u&&u,f=t.className,v=t.columnBorders,p=void 0!==v&&v,S=t.columnEditorPosition,I=void 0===S?"right":S,R=t.columnEditorText,E=void 0===R?"Columns":R,N=t.columnReordering,F=void 0!==N&&N,W=t.columnResizing,B=void 0!==W&&W,P=t.defaultHeaders,G=t.editColumns,U=void 0!==G&&G,V=t.editColumnsInitOpen,K=void 0!==V&&V,J=t.enableHeaderEditing,X=void 0!==J&&J,_=t.enableRowSelection,$=void 0!==_&&_,Q=t.expandAll,Z=void 0===Q||Q,ee=t.expandIcon,ne=void 0===ee?e(j,{className:"st-expand-icon"}):ee,te=t.externalFilterHandling,re=void 0!==te&&te,oe=t.externalSortHandling,ie=void 0!==oe&&oe,ae=t.headerCollapseIcon,ce=void 0===ae?e(j,{className:"st-header-icon"}):ae,se=t.headerExpandIcon,ue=void 0===se?e(z,{className:"st-header-icon"}):se,de=t.headerDropdown,he=t.headerHeight,fe=t.height,ve=t.hideFooter,pe=void 0!==ve&&ve,ge=t.nextIcon,we=void 0===ge?e(j,{className:"st-next-prev-icon"}):ge,ye=t.onCellEdit,be=t.onCellClick,Ce=t.onColumnOrderChange,Se=t.onColumnSelect,Ie=t.onFilterChange,xe=t.onGridReady,Re=t.onHeaderEdit,Ee=t.onLoadMore,Ne=t.onNextPage,He=t.onRowSelectionChange,ke=t.onSortChange,Ae=t.prevIcon,Fe=void 0===Ae?e(z,{className:"st-next-prev-icon"}):Ae,We=t.rowButtons,Te=t.rowGrouping,De=t.rowHeight,Me=void 0===De?32:De,Le=t.rowIdAccessor,Be=t.rows,Oe=t.selectionColumnWidth,Pe=void 0===Oe?42:Oe,qe=t.rowsPerPage,ze=void 0===qe?10:qe,je=t.selectableCells,Ye=void 0!==je&&je,Ge=t.selectableColumns,Ue=void 0!==Ge&&Ge,Ve=t.shouldPaginate,Ke=void 0!==Ve&&Ve,Je=t.sortDownIcon,Xe=void 0===Je?e(xn,{className:"st-header-icon"}):Je,_e=t.sortUpIcon,$e=void 0===_e?e(Rn,{className:"st-header-icon"}):_e,Qe=t.tableRef,Ze=t.theme,en=void 0===Ze?"light":Ze,nn=t.useHoverRowBackground,tn=void 0===nn||nn,rn=t.useOddEvenRowBackground,on=void 0!==rn&&rn,an=t.useOddColumnBackground,ln=void 0!==an&&an;ln&&(on=!1),p&&(tn=!1);var cn=g(function(e){return e+1},0)[1],sn=i(null),un=i(null),dn=i(null),vn=i(null),pn=i(null),mn=i(null),yn=i(null),bn=o(1),Cn=bn[0],Sn=bn[1],Nn=o(P),Fn=Nn[0],Wn=Nn[1],Mn=o(!1),Ln=Mn[0],Bn=Mn[1],On=o(!1),Pn=On[0],qn=On[1],zn=o(null),jn=zn[0],Yn=zn[1],Gn=o(new Set),Un=Gn[0],Vn=Gn[1];c(function(){Wn(P)},[P]);var Kn=Dn({rows:Be,rowIdAccessor:Le,onRowSelectionChange:He,enableRowSelection:$}),Jn=Kn.selectedRows,Xn=Kn.setSelectedRows,_n=Kn.isRowSelected,$n=Kn.areAllRowsSelected,Qn=Kn.selectedRowCount,Zn=Kn.selectedRowsData,et=Kn.handleRowSelect,nt=Kn.handleSelectAll,tt=Kn.handleToggleRow,rt=Kn.clearSelection,ot=a(function(){var e,n=b([],Fn,!0);$&&!(null===(e=null==Fn?void 0:Fn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=b([{accessor:"__row_selection__",label:"",width:Pe,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[$,Fn,Pe]),it=o(0),at=it[0],lt=it[1],ct=o(new Set),st=ct[0],ut=ct[1],dt=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:mn}),ht=dt.scrollbarWidth,ft=dt.setScrollbarWidth,vt=o(0),pt=vt[0],gt=vt[1];d(function(){var e=function(){mn.current&&gt(mn.current.clientWidth)};e();var n=null;return mn.current&&(n=new ResizeObserver(e)).observe(mn.current),function(){n&&n.disconnect()}},[]);var wt=a(function(){var e=C(window.innerWidth),n=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,l=0,c=0;n.forEach(function(e){if(!e.hide){var n=k(e,i).reduce(function(e,n){return e+A(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?l+=n:c+=n}});var s=a,u=l;if(t&&t>0){var d=t*o;a>d&&(a=d),l>d&&(l=d)}return{leftWidth:x(a),rightWidth:x(l),mainWidth:c,leftContentWidth:s,rightContentWidth:u}}({headers:ot,containerWidth:pt,maxPinnedWidthPercent:e,collapsedHeaders:Un});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[ot,pt,Un]),mt=wt.mainBodyWidth,yt=wt.pinnedLeftWidth,bt=wt.pinnedRightWidth,Ct=wt.pinnedLeftContentWidth,St=wt.pinnedRightContentWidth,It=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-t)},[n,t])}({height:fe,rowHeight:Me}),xt=An({rows:Be,headers:Fn,rowGrouping:Te}),Rt=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return kn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=w(w({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),h=l(function(e){var n=w({},c);delete n[e],s(n),null==r||r(n)},[c,r]),f=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=w(w({},c),((r={})[e.accessor]=e,r));return kn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:h,clearAllFilters:f,filters:c,computeFilteredRowsPreview:v}}({rows:xt,externalFilterHandling:re,onFilterChange:Ie}),Et=Rt.filters,Nt=Rt.filteredRows,Ht=Rt.updateFilter,kt=Rt.clearFilter,At=Rt.clearAllFilters,Ft=Rt.computeFilteredRowsPreview,Wt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],h=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=gn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(T(a)){var l=h({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return w(w({},e),((r={})[i]=l,r))}return e}):i},[]),f=a(function(){return wn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:h})},[t,u,n,r,c,h]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},wn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:h})},[u,n,t,r,c,h]);return{sort:u,sortedRows:f,updateSort:v,computeSortedRowsPreview:p}}({headers:Fn,tableRows:Nt,externalSortHandling:ie,onSortChange:ke,rowGrouping:Te}),Tt=Wt.sort,Dt=Wt.sortedRows,Mt=Wt.updateSort,Lt=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,h=e.rowGrouping,f=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,m=e.rowHeight,y=e.scrollTop,C=e.computeFilteredRowsPreview,S=e.computeSortedRowsPreview,I=o(!1),x=I[0],R=I[1],E=o([]),N=E[0],H=E[1],k=i([]),A=i([]),F=i(new Map),W=i(null),T=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return h&&0!==h.length?M({rows:n,rowGrouping:h,rowIdAccessor:f,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,h,f,v,p]);a(function(){if(0===F.current.size){var e=T(r),n=new Map;e.forEach(function(e){var t=String(D({row:e.row,rowIdAccessor:f}));n.set(t,e.position)}),F.current=n}},[r,T,f]);var L=a(function(){return T(t)},[t,T]),B=a(function(){return Y({bufferRowCount:5,contentHeight:g,tableRows:L,rowHeight:m,scrollTop:y})},[L,g,m,y]),O=l(function(e,n){var t=new Set(e.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))})),r=new Set(n.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))}));return{staying:n.filter(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return t.has(n)}),entering:n.filter(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return!r.has(n)})}},[f]),P=a(function(){if(0===k.current.length)return!1;var e=L.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))}),n=k.current.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L,f]);d(function(){if(!x){if(!n||u)return H([]),k.current=L,void(A.current=B);if(0===k.current.length)return H([]),k.current=L,void(A.current=B);if(!P)return H([]),k.current=L,void(A.current=B);W.current={tableRows:L,visibleRows:B},R(!0)}},[n,L,P,x,u,B]),d(function(){if(x&&W.current&&N.length>0){var e=setTimeout(function(){var e=W.current;R(!1),H([]),k.current=e.tableRows,A.current=e.visibleRows,W.current=null},me.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var q=a(function(){if(!n||u)return B;if(N.length>0){var e=new Map;return L.forEach(function(n){var t=String(D({row:n.row,rowIdAccessor:f}));e.set(t,n.position)}),N.map(function(n){var t=String(D({row:n.row,rowIdAccessor:f})),r=e.get(t);return void 0!==r?w(w({},n),{position:r}):n})}return B},[B,N,L,n,u,f]),z=l(function(e){if(n&&!u){var t=C(e),r=T(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return L.find(function(e){return String(D({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],B,!0),i,!0))}},[n,u,C,T,g,m,y,O,L,B,f]),j=l(function(e){if(n&&!u){var t=S(e),r=T(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return L.find(function(e){return String(D({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],B,!0),i,!0))}},[n,u,S,T,g,m,y,O,L,B,f]);return{currentTableRows:L,currentVisibleRows:B,isAnimating:x,prepareForFilterChange:z,prepareForSortChange:j,rowsToRender:q}}({allowAnimations:s,sortedRows:Dt,originalRows:xt,currentPage:Cn,rowsPerPage:ze,shouldPaginate:Ke,rowGrouping:Te,rowIdAccessor:Le,unexpandedRows:st,expandAll:Z,contentHeight:It,rowHeight:Me,scrollTop:at,computeFilteredRowsPreview:Ft,computeSortedRowsPreview:Wt.computeSortedRowsPreview}),Bt=Lt.currentTableRows,Ot=Lt.rowsToRender,Pt=Lt.prepareForFilterChange,qt=Lt.prepareForSortChange,zt=Lt.isAnimating,jt=i(new Map),Yt=i(new Map),Gt=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,h=e.collapsedHeaders,f=o(new Set),v=f[0],p=f[1],g=o(new Set),w=g[0],b=g[1],C=o(null),S=C[0],I=C[1],x=o(null),R=x[0],E=x[1],N=o(new Set),H=N[0],A=N[1],F=o(new Set),W=F[0],T=F[1],M=i(!1),B=i(null),O=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),w.forEach(function(n){e.add(n)}),e},[v,w]),P=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),w.size>0&&r.forEach(function(n){var t=D({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[v,w,r,s]),q=a(function(){return t.flatMap(function(e){return k(e,h)})},[t,h]),z=l(function(){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(v).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");v.size>0&&(navigator.clipboard.writeText(o),A(new Set(v)),setTimeout(function(){A(new Set)},800))},[q,v,r]),j=l(function(){return m(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(h){switch(h.label){case 0:if(!R)return[2];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=h.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=q.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var h=a+n,f=l+c;if(!(h>=r.length||f>=t.length)){var v=r[h],p=t[f],g=D({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=Number(e);isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(w=y)}if(v.row[p.accessor]=w,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(w)}null==u||u({accessor:p.accessor,newValue:w,row:v.row,rowIndex:h});var S=L({colIndex:f,rowIndex:h,rowId:g});o.add(S)}else{var I=L({colIndex:f,rowIndex:h,rowId:g});i.add(I)}}})}),o.size>0&&(A(o),setTimeout(function(){A(new Set)},800)),i.size>0&&(T(i),setTimeout(function(){T(new Set)},800)),[3,4]):[2];case 3:return c=h.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,q,r,s,u,d]),Y=l(function(){if(0!==v.size){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(v).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],h=e[l],f=D({row:c.row,rowIdAccessor:s});if(null==h?void 0:h.isEditable){var v=null;if(v="string"===h.type?"":"number"===h.type?null:"boolean"!==h.type&&("date"===h.type?null:Array.isArray(c.row[h.accessor])?[]:""),c.row[h.accessor]=v,d){var p="".concat(f,"-").concat(h.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:h.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(A(t),setTimeout(function(){A(new Set)},800)),o.size>0&&(T(o),setTimeout(function(){T(new Set)},800))}},[v,q,r,s,u,d]),G=l(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),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=D({row:r[c].row,rowIdAccessor:s});t.add(L({colIndex:u,rowIndex:c,rowId:d}))}b(new Set),I(null),p(t)},[r,s,b,I,p]),U=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<q.length){var n=L(e);b(new Set),I(null),p(new Set([n])),E(e)}},[q.length,r.length,b,I,p,E]),V=l(function(e,n){void 0===n&&(n=!1),p(new Set),E(null),b(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&I(e[e.length-1])},[p,E,b,I]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void j();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void Y();if(D({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return D({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=D({row:r[o-1].row,rowIdAccessor:s});U({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=D({row:r[o+1].row,rowIdAccessor:s}),U({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=D({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<q.length-1&&(c=D({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(p(new Set),b(new Set),I(null),B.current=null,E(null))}else z()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[z,q.length,R,s,G,U,n,r,j,Y]);var K=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=L({colIndex:n,rowIndex:t,rowId:r}),i=v.has(o),a=w.has(n);return i||a},[v,w]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?D({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?D({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},h={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!K(c)||w.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!K(u)||w.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),K(d)||i.push("st-selected-left-border"),K(h)||i.push("st-selected-right-border"),i.join(" ")},[K,r,w,s]),X=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=L({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]),$=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=L({colIndex:n,rowIndex:t,rowId:r});return W.has(o)},[W]);return{getBorderClass:J,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(M.current=!0,B.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){b(new Set),I(null);var e=L({colIndex:t,rowIndex:r,rowId:o});p(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&M.current&&B.current){for(var i=new Set,a=Math.min(B.current.rowIndex,o),l=Math.max(B.current.rowIndex,o),c=Math.min(B.current.colIndex,t),u=Math.max(B.current.colIndex,t),d=a;d<=l;d++)for(var h=c;h<=u;h++)if(d>=0&&d<r.length){var f=D({row:r[d].row,rowIdAccessor:s});i.add(L({colIndex:h,rowIndex:d,rowId:f}))}p(i)}},handleMouseUp:function(){M.current=!1},isCopyFlashing:_,isWarningFlashing:$,isInitialFocusedCell:X,isSelected:K,lastSelectedColumnIndex:S,pasteFromClipboard:j,selectColumns:V,selectedCells:v,selectedColumns:w,setInitialFocusedCell:E,setSelectedCells:p,setSelectedColumns:b,deleteSelectedCells:Y,columnsWithSelectedCells:O,rowsWithSelectedCells:P}}({selectableCells:Ye,headers:Fn,tableRows:Bt,rowIdAccessor:Le,onCellEdit:ye,cellRegistry:jt.current,collapsedHeaders:Un}),Ut=Gt.getBorderClass,Vt=Gt.handleMouseDown,Kt=Gt.handleMouseOver,Jt=Gt.handleMouseUp,Xt=Gt.isCopyFlashing,_t=Gt.isInitialFocusedCell,$t=Gt.isSelected,Qt=Gt.isWarningFlashing,Zt=Gt.selectColumns,er=Gt.selectedCells,nr=Gt.selectedColumns,tr=Gt.setInitialFocusedCell,rr=Gt.setSelectedCells,or=Gt.setSelectedColumns,ir=Gt.columnsWithSelectedCells,ar=Gt.rowsWithSelectedCells,lr=l(function(e){qt(e),setTimeout(function(){Mt(e)},0)},[qt,Mt]),cr=l(function(e){Wn(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:Ue,selectedCells:er,selectedColumns:nr,setSelectedCells:rr,setSelectedColumns:or,activeHeaderDropdown:jn,setActiveHeaderDropdown:Yn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:cn,tableBodyContainerRef:mn,setScrollbarWidth:ft}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:xe}),function(e){var n=e.cellRegistryRef,t=e.currentTableRows,r=e.headerRegistryRef,o=e.headers,i=e.rowIdAccessor,a=e.rows,l=e.tableRef,s=e.visibleRows;c(function(){l&&(l.current={updateData:function(e){var t=e.accessor,r=e.rowIndex,o=e.newValue,l=null==a?void 0:a[r];if(l){var c=D({row:l,rowIdAccessor:i}),s=H({rowId:c,accessor:t}),u=n.current.get(s);u&&u.updateContent(o),void 0!==l[t]&&(l[t]=o)}},setHeaderRename:function(e){var n=e.accessor,t=r.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return s},exportToCSV:function(e){var n=(void 0===e?{}:e).filename;Tn(t,o,n)}})},[n,r,a,i,l,s,o])}({cellRegistryRef:jt,currentTableRows:Bt,headerRegistryRef:Yt,headers:ot,rowIdAccessor:Le,rows:Be,tableRef:Qe,visibleRows:Ot}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:Et,onFilterChange:Ie}),function(e){var n=e.sort,t=e.onSortChange,r=le(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:Tt,onSortChange:ke});var sr=l(function(e){Pt(e),setTimeout(function(){Ht(e)},0)},[Pt,Ht]);return e(O,w({value:{allowAnimations:s,areAllRowsSelected:$n,cellRegistry:jt.current,cellUpdateFlash:h,clearSelection:rt,collapsedHeaders:Un,columnBorders:p,columnReordering:F,columnResizing:B,draggedHeaderRef:sn,editColumns:U,enableHeaderEditing:X,enableRowSelection:$,expandIcon:ne,filters:Et,forceUpdate:cn,getBorderClass:Ut,handleApplyFilter:sr,handleClearAllFilters:At,handleClearFilter:kt,handleMouseDown:Vt,handleMouseOver:Kt,handleRowSelect:et,handleSelectAll:nt,handleToggleRow:tt,headerCollapseIcon:ce,headerContainerRef:yn,headerDropdown:de,headerExpandIcon:ue,headerRegistry:Yt.current,headers:ot,hoveredHeaderRef:un,isAnimating:zt,isCopyFlashing:Xt,isInitialFocusedCell:_t,isResizing:Ln,isRowSelected:_n,isScrolling:Pn,isSelected:$t,isWarningFlashing:Qt,mainBodyRef:dn,nextIcon:we,onCellEdit:ye,onCellClick:be,onColumnOrderChange:Ce,onColumnSelect:Se,onLoadMore:Ee,onSort:lr,onTableHeaderDragEnd:cr,pinnedLeftRef:vn,pinnedRightRef:pn,prevIcon:Fe,rowButtons:We,rowGrouping:Te,rowHeight:Me,headerHeight:null!=he?he:Me,rowIdAccessor:Le,scrollbarWidth:ht,selectColumns:Zt,selectableColumns:Ue,selectedColumns:nr,columnsWithSelectedCells:ir,rowsWithSelectedCells:ar,selectedRows:Jn,selectedRowCount:Qn,selectedRowsData:Zn,setCollapsedHeaders:Vn,setHeaders:Wn,setInitialFocusedCell:tr,setIsResizing:Bn,setIsScrolling:qn,setSelectedCells:rr,setSelectedColumns:or,setSelectedRows:Xn,setUnexpandedRows:ut,shouldPaginate:Ke,sortDownIcon:Xe,sortUpIcon:$e,tableBodyContainerRef:mn,tableRows:Bt,theme:en,unexpandedRows:st,useHoverRowBackground:tn,useOddColumnBackground:ln,useOddEvenRowBackground:on,activeHeaderDropdown:jn,setActiveHeaderDropdown:Yn,onHeaderEdit:Re}},{children:e("div",w({className:"simple-table-root st-wrapper theme-".concat(en," ").concat(null!=f?f:""," ").concat(p?"st-column-borders":""),style:fe?{height:fe}:{}},{children:e(En,{children:n("div",w({className:"st-wrapper-container"},{children:[e(Hn,{}),n("div",w({className:"st-content-wrapper",onMouseUp:Jt,onMouseLeave:Jt},{children:[e(hn,{pinnedLeftWidth:yt,pinnedRightWidth:bt,setScrollTop:lt,sort:Tt,tableRows:Bt,rowsToRender:Ot}),e(In,{columnEditorText:E,editColumns:U,editColumnsInitOpen:K,headers:Fn,position:I})]})),e(fn,{mainBodyRef:dn,mainBodyWidth:mt,pinnedLeftWidth:yt,pinnedRightWidth:bt,pinnedLeftContentWidth:Ct,pinnedRightContentWidth:St,tableBodyContainerRef:mn}),e(q,{currentPage:Cn,hideFooter:pe,onPageChange:Sn,onNextPage:Ne,shouldPaginate:Ke,totalPages:Math.ceil(Dt.length/ze)})]}))})}))}))};export{Mn 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,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as h,cloneElement as f,forwardRef as v,useImperativeHandle as p,useReducer as g}from"react";var w=function(){return w=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},w.apply(this,arguments)};function m(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(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 C=function(e){return e<480?.3:e<768?.4:.8},S=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 l=a[i];o=r(l,o)}return o};return r(e,n),t},I=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,I(e.children)),n})},x=function(e){return void 0===e&&(e=0),e?e+1:0},R=function(e,n,t){var r=function(e,n){for(var t=0,r=I(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)},E=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},N=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&R(n,r,o))||null},H=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},k=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return k(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return k(e,n)}):[e]},A=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(E({accessor:e.accessor,rowId:"header"}));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(E({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){F(e)})},W=function(e){return"number"==typeof e.minWidth?e.minWidth:40},T=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},D=function(e){return e.row[e.rowIdAccessor]},M=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=D({row:t,rowIdAccessor:c}),h=l[n],f=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:h,position:r,isLastGroupRow:f}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return T(t)?t:[]}(t,h);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},L=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},B=s(void 0),O=function(n){var t=n.children,r=n.value;return e(B.Provider,w({value:r},{children:t}))},P=function(){var e=u(B);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},q=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=P(),d=u.nextIcon,h=u.prevIcon,f=o(!0),v=f[0],p=f[1],g=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},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>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;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<s-1&&(t.push(-1),t.push(s)),t}();return n("div",w({className:"st-footer"},{children:[e("button",w({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:h})),e("button",w({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return m(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",w({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",w({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},z=function(n){var t=n.className;return e("svg",w({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"})}))},j=function(n){var t=n.className;return e("svg",w({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"})}))},Y=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},G=function(e){return e.position*(e.rowHeight+1)-1},U=function(e){return e.position*(e.rowHeight+1)},V=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,h=n.containerRef,f=n.positioning,v=void 0===f?"fixed":f,p=P().mainBodyRef,g=i(null),m=i(null),y=o("bottom-left"),b=y[0],C=y[1],S=o({}),I=S[0],x=S[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!m.current&&g.current.parentElement&&(m.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&m.current){var e,n=g.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==h?void 0:h.current)?h.current.getBoundingClientRect():(null==p?void 0:p.current)?p.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,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,h,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",w({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:w(w({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},I),{overflow:s})},{children:t})):null},K=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",w({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},J=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],h=function(e){d(e),i(e),l(!1),r()};return n(V,w({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(K,w({isSelected:!0===u,onClick:function(){return h(!0)}},{children:"True"})),e(K,w({isSelected:!1===u,onClick:function(){return h(!1)}},{children:"False"}))]}))},X=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},_=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},$=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=P(),d=u.nextIcon,h=u.prevIcon,f=o(s||new Date),v=f[0],p=f[1],g=o("days"),m=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",w({className:"st-datepicker"},{children:[n("div",w({className:"st-datepicker-header"},{children:["days"===m&&n(t,{children:[e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),n("div",w({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===m&&e("div",w({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===m&&e("div",w({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",w({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",w({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",w({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e,12,0,0);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=new Date(s),u=o===a.getDate()&&r===a.getMonth()&&t===a.getFullYear();n.push(e("div",w({className:"st-datepicker-day ".concat(i?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=v.getFullYear(),t=v.getMonth(),r=new Date(n,t,e,12,0,0);p(r),l(r),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var g=35-(i+o),m=function(t){n.push(e("div",w({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e,12,0,0);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=g;f++)m(f);return n}(),"months"===m&&(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",w({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===m&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",w({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",w({className:"st-datepicker-footer"},{children:e("button",w({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);p(n),l(n),null==c||c()}},{children:"Today"}))}))]}))},Q=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},Z=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},ee=function(e){if(!e)return new Date;if("string"==typeof e)return Q(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:Z(n)}return e instanceof Date?Z(e):new Date},ne=function(e){return e?Q(e.toString()):new Date},te=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;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 l=function(){t()};return e(V,w({open:o,onClose:l,setOpen:i,width:280},{children:e($,{value:ne(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},re=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(V,w({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",w({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(K,w({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},oe=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(J,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(te,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(re,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(_,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(X,{defaultValue:u,onBlur:s,onChange:o})},ie=0,ae=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===ie||o-ie>=r)&&(ie=o,n(t))}},le=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},ce=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ce);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=ce(e[t]));return n},se=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ue=Date.now(),de={screenX:0,screenY:0},he=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 b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=he(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},fe=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ve(e,n,t){var r,o,i=ce(e),a=!1;try{var l=fe(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=w({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),h=s;i.splice(h,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var pe=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=P().setHeaders,l=le(t);return{handleDragStart:function(e){n.current=e,ue=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-de.screenX,2)+Math.pow(u-de.screenY,2));r.current=a;var h,f=n.current,v=!1;if(fe(f)!==fe(a)){h=(S=ve(t,f,a)).newHeaders,v=S.emergencyBreak}else{var p=t,g=he(p,f.accessor),w=he(p,a.accessor);if(!g||!w)return;var m=g.length,y=w.length,b=w;if(m!==y){var C=y-m;C>0&&(b=w.slice(0,-C))}var S=function(e,n,t){var r=ce(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 l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);h=S.newHeaders,v=S.emergencyBreak}if(!(c||a.accessor===f.accessor||d<10||JSON.stringify(h)===JSON.stringify(t)||v)){var I=Date.now();JSON.stringify(h)===JSON.stringify(l)&&(I-ue<1500||d<40)||(ue=I,de={screenX:s,screenY:u},i(h))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return b([],e,!0)}),null==o||o(t)},10)}}},ge=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},we={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},me={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ye={duration:150,easing:"ease-out",delay:0},be=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},Ce=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){be(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Se=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return m(void 0,void 0,void 0,function(){var e,i,a;return y(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:ge()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),ge()?w(w({},ye),e):w(w({},"column"===n?we:me),e)}(t,i?"column":"row"),be(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,Ce(n,a,t)]);case 1:return l.sent(),[2]}})})},Ie=function(e){var n=e.element,t=e.options;return m(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,h,f,v,p,g,w;return y(this,function(m){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,h=t.respectReducedMotion,f=void 0===h||h,ge()&&f?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,w=r-p,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},xe=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=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","id","parentRef","tableRow"]),c=P(),s=c.allowAnimations,u=c.isResizing,h=c.isScrolling,f=c.rowHeight,v=i(null),p=i(null),g=le(h),m=le(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!h)if(!g||h)if(!m||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=w(w({},me),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,S=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==S){var I=5*f,x=b-I,R=b+C+I,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,H=i.y<b,k=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,F=.6*f,W=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&k){var T=b+C+W(i.y,b,b+C)+A%15*F*2.5+A%7*(.4*f);return void Ie({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&H){T=b-W(i.y,b,b+C)-A%15*F*2.5-A%7*(.4*f);return void Ie({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var D=b+C+W(l.y,b,b+C)+A%10*F*1;return void Ie({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){D=b-W(l.y,b,b+C)-A%10*F*1;return void Ie({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}Se({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,h,o,g,m,f,null==a?void 0:a.position,a]),e("div",w({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};xe.displayName="Animate";var Re=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:w({height:"10px"},r)},{children:e("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},Ee=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",w({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",w({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(Re,{className:"st-checkbox-checkmark"})})),i]}))},Ne=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?ee(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},He=function(t){var r=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,h=t.isInitialFocused,f=t.nestedIndex,v=t.rowIndex,p=t.tableRow,g=P(),m=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,C=g.draggedHeaderRef,S=g.enableRowSelection,I=g.expandIcon,x=g.handleMouseDown,R=g.handleMouseOver,N=g.handleRowSelect,k=g.headers,A=g.hoveredHeaderRef,F=g.isCopyFlashing,W=g.isRowSelected,M=g.isWarningFlashing,L=g.onCellEdit,B=g.onCellClick,O=g.onTableHeaderDragEnd,q=g.rowButtons,z=g.rowGrouping,j=g.rowIdAccessor,Y=g.rowsWithSelectedCells,G=g.selectedColumns,U=g.setUnexpandedRows,V=g.tableBodyContainerRef,K=g.theme,J=g.unexpandedRows,X=g.useOddColumnBackground,_=p.depth,$=p.row,Q=o($[u.accessor]),Z=Q[0],ee=Q[1],ne=o(!1),te=ne[0],re=ne[1],ie=o(!1),le=ie[0],ce=ie[1],se=o(!1),ue=se[0],de=se[1],he=i(null),fe=D({row:$,rowIdAccessor:j}),ve=z&&z[_],ge=!!ve&&function(e,n){if(!n)return!1;var t=e[n];return T(t)}($,ve),we=!J.has(String(fe)),me=F({rowIndex:v,colIndex:s,rowId:fe}),ye=M({rowIndex:v,colIndex:s,rowId:fe}),be=a(function(){var e,n,t;if(!b)return!1;var r=k.filter(function(e){return"left"===e.pinned}),o=k.filter(function(e){return!e.pinned}),i=k.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,k,u.accessor,u.pinned]),Ce=pe({draggedHeaderRef:C,headers:k,hoveredHeaderRef:A,onTableHeaderDragEnd:O}).handleDragOver,Se=ae(),Ie=E({accessor:u.accessor,rowId:fe}),Re=H({rowId:fe,accessor:u.accessor}),He=u.isSelectionColumn&&S;c(function(){if(m){var e="".concat(fe,"-").concat(u.accessor);return m.set(e,{updateContent:function(e){Z!==e?(ee(e),y&&(ce(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){ce(!1)},800))):ee(e)}}),function(){m.delete(e),he.current&&clearTimeout(he.current)}}},[m,y,fe,u.accessor,Z]),c(function(){if(le){var e=setTimeout(function(){ce(!1)},850);return function(){return clearTimeout(e)}}},[le]),c(function(){ee($[u.accessor])},[$,u.accessor]);var ke="boolean"===u.type||"date"===u.type||"enum"===u.type,Ae=Boolean(null==u?void 0:u.isEditable),Fe=G.has(s),We=d&&!Fe,Te=a(function(){return!!He&&Y.has(String(fe))},[He,Y,fe]),De="st-cell ".concat(_>0&&u.expandable?"st-cell-depth-".concat(_):""," ").concat(We?h?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Fe?h?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ae?"clickable":""," ").concat(le?h?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?h?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ye?h?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(X?f%2==0?"even-column":"odd-column":""," ").concat(He?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(be?"st-last-column":""),Me=l(function(e){ee(e),$[u.accessor]=e,null==L||L({accessor:u.accessor,newValue:e,row:$,rowIndex:v})},[u.accessor,L,$,v]),Le=l(function(){U(function(e){var n=new Set(e),t=String(fe);return n.has(t)?n.delete(t):n.add(t),n})},[fe,U]);return!te||ke||He?n(xe,w({className:De,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":fe,"data-row-index":v,id:Ie,onClick:function(){B&&!He&&B({accessor:u.accessor,colIndex:s,row:$,rowId:fe,rowIndex:v,value:Z})},onDoubleClick:function(){return u.isEditable&&!He&&re(!0)},onDragOver:function(e){He||Se({callback:Ce,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){te||He||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||te||(e.preventDefault(),re(!0))},onMouseDown:function(){te||He||x({rowIndex:v,colIndex:s,rowId:fe})},onMouseEnter:function(){de(!0)},onMouseLeave:function(){de(!1)},onMouseOver:function(){te||He||R({rowIndex:v,colIndex:s,rowId:fe})},parentRef:V,tableRow:p},{children:[u.expandable&&ge?e("div",w({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:Le},{children:I})):null,e("span",w({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:He?n("div",w({className:"st-selection-cell-content"},{children:[e("div",w({className:"st-selection-control"},{children:ue||W&&W(String(fe))?e(Ee,{checked:!!W&&W(String(fe)),onChange:function(e){N&&N(String(fe),e)}}):e("span",w({className:"st-row-number"},{children:v+1}))})),function(){if(!q||!He||0===q.length)return null;if(!(ue||W&&W(String(fe))))return null;var n={row:$};return e("div",w({className:"st-row-buttons"},{children:q.map(function(t,r){return e("span",w({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:$,theme:K}):Ne({content:Z,header:u})})})),te&&ke&&!He&&e(oe,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})]}),Re):e("div",w({className:"st-cell-editing",id:E({accessor:u.accessor,rowId:fe}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(oe,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})}))},ke=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=P(),d=u.rowIdAccessor,h=u.collapsedHeaders,f=i.filter(function(e){return N({header:e,pinned:a,headers:i,collapsedHeaders:h})});return e(t,{children:f.map(function(n,t){var u=D({row:s.row,rowIdAccessor:d}),h=E({accessor:n.accessor,rowId:u});return e(Ae,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},h)})})},Ae=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=P(),f=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,w=d.collapsedHeaders,m=D({row:s.row,rowIdAccessor:g});if(r.children&&r.children.length>0){var y=r.children.filter(function(e){return N({header:e,pinned:a,headers:o,collapsedHeaders:w})});return e(h,{children:y.map(function(n){var r=E({accessor:n.accessor,rowId:m});return e(Ae,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var b={rowIndex:l,colIndex:u,rowId:m},C=f(b),S=v(b),I=p(b),x=E({accessor:r.accessor,rowId:m});return e(He,{borderClass:C,colIndex:u,header:r,isHighlighted:S,isInitialFocused:I,nestedIndex:i,rowIndex:l,tableRow:s},x)},Fe=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,l=n.pinned,c=n.rowHeight,s=n.rowIndices,u=n.setHoveredIndex,d=n.tableRow,h=P(),f=h.useHoverRowBackground,v=h.rowIdAccessor,p=h.isAnimating,g=h.isRowSelected,m=h.useOddEvenRowBackground,y=d.position,b=y%2==0,C=D({row:d.row,rowIdAccessor:v}),S=!!g&&g(String(C));return e("div",w({className:"st-row ".concat(m?b?"even":"odd":""," ").concat(S?"selected":""),"data-index":a,onMouseEnter:function(){!p&&f&&u(a)},style:{gridTemplateColumns:o,top:U({position:y,rowHeight:c}),height:"".concat(c,"px")}},{children:e(ke,{columnIndexStart:r,columnIndices:t,headers:i,pinned:l,rowIndex:y,rowIndices:s,tableRow:d},C)}))},We=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",w({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var h=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(h)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:G({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},Te=s(void 0),De=function(e){var n=e.childRef,t=e.children,r=e.group,o=void 0===r?"default":r,i=function(){var e=u(Te);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),a=i.registerPane,l=i.unregisterPane,s=[o];return c(function(){return n.current&&a(n.current,s),function(){n.current&&l(n.current,s)}},[n,a,l,o]),f(t,{ref:function(e){n.current=e}})},Me=v(function(t,r){var o=t.columnIndexStart,l=t.columnIndices,c=t.headers,s=t.pinned,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,v=t.templateColumns,g=t.totalHeight,m=t.rowsToRender,y=t.width,b=s?"st-body-pinned-".concat(s):"st-body-main",C=P().rowIdAccessor,S=i(null);if(p(r,function(){return S.current},[]),!a(function(){return se(c,s)},[c,s]))return null;var I=s?"pinned-".concat(s):"default";return e(De,w({childRef:S,group:I},{children:e("div",w({className:b,ref:S,style:w({position:"relative",height:"".concat(g,"px"),width:y},!s&&{flexGrow:1})},{children:m.map(function(t,r){var i=D({row:t.row,rowIdAccessor:C});return n(h,{children:[0!==r&&e(We,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:v,rowIndex:r-1}),e(Fe,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:v,headers:c,index:r,pinned:s,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:t},i)]},i)})}))}))});function Le(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=b(b(b([],t,!0),n,!0),r,!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 N({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&N({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Me.displayName="TableSection";var Be=function(t){var r=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.rowsToRender,g=t.setScrollTop,m=t.tableRows,y=P(),b=y.collapsedHeaders,C=y.headerContainerRef,S=y.headers,I=y.isAnimating,x=y.mainBodyRef,R=y.onLoadMore,E=y.rowHeight,N=y.rowIdAccessor,H=y.scrollbarWidth,k=y.setIsScrolling,A=y.shouldPaginate,F=y.tableBodyContainerRef,W=o(!1),T=W[0],M=W[1],L=i(new Set),B=l(function(e){(L.current.forEach(function(e){return e.classList.remove("hovered")}),L.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),L.current.add(e)})},[]);c(function(){I&&B(null)},[I,B]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=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;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:C,mainSectionRef:F,scrollbarWidth:H}),c(function(){return function(){q.current&&clearTimeout(q.current)}},[]);var O=i(null),q=i(null),z=i(0),j=function(e){return e.length}(m),Y=j*(E+1)-1,G=a(function(){return Le({headers:S,pinnedLeftColumns:s,pinnedRightColumns:h,collapsedHeaders:b})},[S,s,h,b]),U=a(function(){var e={};return p.forEach(function(n,t){var r=String(D({row:n.row,rowIdAccessor:N}));e[r]=t}),e},[p,N]),V=l(function(e,n){if(R&&!A&&!T){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(M(!0),R(),setTimeout(function(){M(!1)},1e3))}},[R,A,T]),K={columnIndices:G,headerContainerRef:C,headers:S,rowHeight:E,rowIndices:U,rowsToRender:p,setHoveredIndex:B};return n("div",w({className:"st-body-container",onMouseLeave:function(){return B(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(function(){k(!1)},150),O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(function(){g(t),V(n,t),z.current=t})},ref:F},{children:[e(Me,w({},K,{pinned:"left",templateColumns:u,totalHeight:Y,width:d})),e(Me,w({},K,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:Y})),e(Me,w({},K,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:f,totalHeight:Y,width:v}))]}))},Oe=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(t&&!t.hide){i(!0);var u,d=W(t);if(t.children&&t.children.length>0){var h=k(t,l);u=h.length>0?h:[t]}else u=[t];var f=function(e){var n="right"===t.pinned?c-e:e-c,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=i*C(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var l=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+k(n,r).reduce(function(e,n){return e+A(n)},0)},0),c=W(n);return l<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):l}({header:t,headers:r,collapsedHeaders:l});if(u.length>1)Pe({delta:n,leafHeaders:u,minWidth:d,startWidth:a,maxWidth:i});else{var s=Math.max(Math.min(a+n,i),d);u[0].width=s}r.forEach(function(e){F(e)});var h=b([],r,!0);o(h)};if(s){var v=function(e){var n=e.touches[0];f(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p),i(!1)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var g=function(e){f(e.clientX)},w=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",w),i(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",w)}}},Pe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,W(n))},40),l=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),c=Math.max(Math.min(o+n,i),a)-l;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=c*(n/l),o=Math.max(n+t,r);e.width=o})},qe=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:w({height:"1em"},r)},{children:e("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},ze={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},je=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Ye=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ge=function(e){return["between","notBetween","in","notIn"].includes(e)},Ue=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ve=function(n){var t=n.children;return e("div",w({className:"st-filter-container"},{children:t}))},Ke=function(){return e("svg",w({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Je=function(t){var r=t.value,a=t.onChange,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,h=void 0===d?"":d,f=t.disabled,v=void 0!==f&&f,p=o(!1),g=p[0],m=p[1],y=o(-1),b=y[0],C=y[1],S=i(null),I=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),m(!1),C(-1));break;case"Escape":e.preventDefault(),m(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",w({ref:S,className:"st-custom-select ".concat(h," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",w({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(m(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",w({className:"st-custom-select-value"},{children:I?I.label:u})),e(Ke,{})]})),e(V,w({open:g,setOpen:m,onClose:function(){m(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",w({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",w({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),m(!1),void C(-1);var e}},{children:n.label}),t)})}))}))]}))},Xe=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:ze[e]}});return e("div",w({className:"st-filter-section"},{children:e(Je,{value:t,onChange:function(e){r(e)},options:o})}))},_e=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},$e=function(n){var t=n.children,r=n.className;return e("div",w({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Qe=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",w({className:"st-filter-actions"},{children:[e("button",w({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",w({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Ze=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],h=o(String((null==i?void 0:i.value)||"")),f=h[0],v=h[1],p=je("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=w({accessor:r.accessor,operator:u},Ye(u)&&{value:f});a(e)},m=Ue(u)||f.trim();return n(Ve,{children:[e(Xe,{value:u,onChange:d,operators:p}),Ye(u)&&e($e,{children:e(_e,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Qe,{onApply:g,onClear:l,canApply:!!m,showClear:!!i})]})},en=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),h=d[0],f=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],w=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),m=w[0],y=w[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],S=b[1],I=je("number");c(function(){var e,n;l?(f(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),g(""),y(""),S(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:h};Ye(h)?e.value=parseFloat(p):Ge(h)&&(e.values=[parseFloat(m.toString()),parseFloat(C.toString())]),s(e)};return n(Ve,{children:[e(Xe,{value:h,onChange:f,operators:I}),Ye(h)&&e($e,{children:e(_e,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),Ge(h)&&n($e,{children:[e(_e,{type:"number",value:m,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e(_e,{type:"number",value:C,onChange:S,placeholder:"To...",onEnterPress:x})]}),e(Qe,{onApply:x,onClear:u,canApply:!!Ue(h)||(Ye(h)?""!==p.trim():!!Ge(h)&&""!==String(m).trim()&&""!==String(C).trim()),showClear:!!l})]})},nn=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(Je,{value:t,onChange:r,options:o,className:a,placeholder:l})},tn=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=je("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Ue(u)||""!==f;return n(Ve,{children:[e(Xe,{value:u,onChange:d,operators:p}),Ye(u)&&e($e,{children:e(nn,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Qe,{onApply:function(){var e={accessor:r.accessor,operator:u};Ye(u)&&(e.value="true"===f),a(e)},onClear:l,canApply:g,showClear:!!i})]})},rn=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,h=o((null==s?void 0:s.operator)||"equals"),f=h[0],v=h[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],m=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],S=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),I=S[0],x=S[1],R=je("date");c(function(){var e,n;s?(v(s.operator),m(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),m(""),C(""),x(""))},[s]);var E=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),h=d[0],f=d[1],v=o(""),p=v[0],g=v[1],m=i(null);c(function(){if(r){var e=ee(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&m.current&&m.current.focus()},[s]);var y=r?ee(r):new Date;return n("div",w({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:m,type:"text",value:p,placeholder:l,onClick:function(){f(!h)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),f(!h)):"Escape"===e.key&&f(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(V,w({open:h,setOpen:f,onClose:function(){f(!1)},positioning:"absolute",overflow:"visible"},{children:e($,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),f(!1)},onClose:function(){return f(!1)}})}))]}))};return n(Ve,{children:[e(Xe,{value:f,onChange:v,operators:R}),Ye(f)&&e($e,{children:e(E,{value:g,onChange:m,placeholder:"Select date...",autoFocus:!0})}),Ge(f)&&n($e,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:I,onChange:x,placeholder:"To date..."})]}),e(Qe,{onApply:function(){var e={accessor:l.accessor,operator:f};Ye(f)?e.value=g:Ge(f)&&(e.values=[b,I]),u(e)},onClear:d,canApply:!!Ue(f)||(Ye(f)?""!==g.trim():!!Ge(f)&&""!==b.trim()&&""!==I.trim()),showClear:!!s})]})},on=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),h=o((null==i?void 0:i.values)?i.values.map(String):d),f=h[0],v=h[1],p=o(""),g=p[0],m=p[1],y=a(function(){if(!g)return u;var e=g.toLowerCase();return u.filter(function(n){return n.label.toLowerCase().includes(e)})},[u,g]);c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var C=f.length===d.length,S=u.length>10;return n(Ve,{children:[e($e,{children:n("div",w({className:"st-enum-filter-options"},{children:[e("div",w({className:"st-enum-select-all"},{children:e(Ee,w({checked:C,onChange:function(e){v(e?d:[])}},{children:e("span",w({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),S&&e("div",w({className:"st-enum-search"},{children:e(_e,{type:"text",value:g,onChange:m,placeholder:"Search..."})})),y.map(function(n,t){return e(Ee,w({checked:f.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",w({className:"st-enum-option-label"},{children:n.label}))}),t)}),g&&0===y.length&&e("div",w({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e(Qe,{onApply:function(){if(f.length!==d.length){var e={accessor:r.accessor,operator:"in",values:f};l(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==d.length,showClear:!!i})]})},an=function(n){var r=n.header,o=n.currentFilter,i=n.onApplyFilter,a=n.onClearFilter;return e(t,{children:function(){switch(r.type){case"number":return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(tn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(rn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(on,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(Ze,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},ln=function(t){var r,s,u=t.colIndex,d=t.gridColumnEnd,h=t.gridColumnStart,f=t.gridRowEnd,v=t.gridRowStart,p=t.header,g=t.reverse,m=t.sort,y=o(!1),C=y[0],I=y[1],x=o(!1),R=x[0],N=x[1],H=o(p.label||""),k=H[0],A=H[1],F=P(),W=F.activeHeaderDropdown,T=F.areAllRowsSelected,D=F.collapsedHeaders,M=F.columnBorders,L=F.columnReordering,B=F.columnResizing,O=F.columnsWithSelectedCells,q=F.draggedHeaderRef,z=F.enableHeaderEditing,j=F.enableRowSelection,Y=F.filters,G=F.handleApplyFilter,U=F.handleClearFilter,K=F.handleSelectAll,J=F.headerCollapseIcon,_=F.headerDropdown,$=F.headerExpandIcon,Q=F.headerRegistry,Z=F.headers,ee=F.hoveredHeaderRef,ne=F.onColumnOrderChange,te=F.onColumnSelect,re=F.onHeaderEdit,oe=F.onSort,ie=F.onTableHeaderDragEnd,le=F.headerHeight,ce=F.selectColumns,se=F.selectableColumns,ue=F.selectedColumns,de=F.setActiveHeaderDropdown,he=F.setCollapsedHeaders,fe=F.setHeaders,ve=F.setInitialFocusedCell,ge=F.setIsResizing,we=F.setSelectedCells,me=F.setSelectedColumns,ye=F.sortDownIcon,be=F.sortUpIcon,Ce=Boolean(null==p?void 0:p.isSortable),Se=Boolean(null==p?void 0:p.filterable),Ie=Y[p.accessor],Re=(null==W?void 0:W.accessor)===p.accessor,Ne=p.isSelectionColumn&&j,He=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(p),ke=D.has(p.accessor),Ae=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),h=o({}),f=h[0],v=h[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:f}}({isOpen:Re,estimatedHeight:200,estimatedWidth:250,margin:4}),Fe=Ae.triggerRef,We=Ae.position,Te=a(function(){var e,n,t;if(!M)return!1;var r=Z.filter(function(e){return"left"===e.pinned}),o=Z.filter(function(e){return!e.pinned}),i=Z.filter(function(e){return"right"===e.pinned});return"left"===p.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===p.accessor:"right"===p.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===p.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===p.accessor},[M,Z,p.accessor,p.pinned]),De=a(function(){return!(!se||Ne)&&S(p,u).some(function(e){return ue.has(e)})},[se,Ne,p,u,ue]),Me=a(function(){return!Ne&&S(p,u).some(function(e){return O.has(e)})},[Ne,p,u,O]),Le=a(function(){return!(!p.children||0===p.children.length)&&(!ke||p.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[p.children,ke]),Be="st-header-cell ".concat(p.accessor===(null===(r=ee.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=q.current)||void 0===s?void 0:s.accessor)===p.accessor?"st-dragging":""," ").concat(Ce?"clickable":""," ").concat(L&&!Ce?"columnReordering":""," ").concat(Le?"parent":""," ").concat(Te?"st-last-column":""," ").concat(z&&!Ne?"st-header-editable":""," ").concat(De?"st-header-selected":""," ").concat(Me&&!De?"st-header-has-highlighted-cell":""),Pe=pe({draggedHeaderRef:q,headers:Z,hoveredHeaderRef:ee,onColumnOrderChange:ne,onTableHeaderDragEnd:ie}),ze=Pe.handleDragStart,je=Pe.handleDragEnd,Ye=Pe.handleDragOver,Ge=ae();c(function(){if(Q&&!p.isSelectionColumn){var e=String(p.accessor);return Q.set(e,{setEditing:function(e){N(e)}}),function(){Q.delete(e)}}},[Q,p.accessor,p.isSelectionColumn]),c(function(){A(p.label||"")},[p.label]);var Ue=l(function(e){A(e);var n=Z.map(function(n){return n.accessor===p.accessor?w(w({},n),{label:e}):n});fe(n),re&&re(p,e)},[Z,fe,re,p]),Ve=l(function(){de&&de(null)},[de]),Ke=l(function(e){e.stopPropagation(),he(function(e){var n=new Set(e);return ke?n.delete(p.accessor):n.add(p.accessor),n})},[he,ke,p.accessor]),Je=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(se){var r=S(t,u),o=r.some(function(e){return ue.has(e)});if(z&&o&&!n.shiftKey)return _&&Re&&Ve(),void N(!0);n.shiftKey&&ce?me(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,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):ce&&ce(r),we(new Set),ve(null)}te&&te(t),!se&&t.isSortable&&oe(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)}},[]),!p)return null;var Xe=B&&!Ne&&e("div",w({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(E({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Oe,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:h,header:p,headers:Z,setHeaders:fe,setIsResizing:ge,startWidth:t,collapsedHeaders:D},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(E({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Oe,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:h,header:p,headers:Z,setHeaders:fe,setIsResizing:ge,startWidth:t,collapsedHeaders:D},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),_e=m&&m.key.accessor===p.accessor&&n("div",w({className:"st-icon-container",onClick:function(e){return Je({event:e,header:p})}},{children:["ascending"===m.direction&&be&&be,"descending"===m.direction&&ye&&ye]})),$e=Se&&n("div",w({className:"st-icon-container",onClick:function(e){e.stopPropagation(),I(!C)}},{children:[e(qe,{className:"st-header-icon",style:{fill:Ie?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(V,w({open:C,overflow:"visible",setOpen:I,onClose:function(){return I(!1)}},{children:e(an,{header:p,currentFilter:Ie,onApplyFilter:function(e){G(e),I(!1)},onClearFilter:function(){U(p.accessor),I(!1)}})}))]})),Qe=He&&!Ne&&e("div",w({className:"st-icon-container st-collapse-icon-container",onClick:Ke},{children:ke?J:$}));return n(xe,w({className:Be,id:E({accessor:p.accessor,rowId:"header"}),onDragOver:function(e){Ne||Ge({callback:Ye,callbackProps:{event:e,hoveredHeader:p},limit:50})},style:w({gridRowStart:v,gridRowEnd:f,gridColumnStart:h,gridColumnEnd:d},f-v>1?{}:{height:le})},{children:[g&&Xe,"right"===p.align&&Qe,"right"===p.align&&$e,"right"===p.align&&_e,e("div",w({ref:Fe,className:"st-header-label",draggable:L&&!p.disableReorder&&!Ne,onClick:function(e){Ne||Je({event:e,header:p})},onDoubleClick:function(e){Ne||function(e){e.event;var n=e.header;n.isSelectionColumn||se&&n.isSortable&&oe(n.accessor)}({event:e,header:p})},onDragEnd:Ne?void 0:function(e){e.preventDefault(),je()},onDragStart:Ne?void 0:function(e){L&&p&&function(e){ze(e)}(p)}},{children:e("span",w({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:Ne?e(Ee,{checked:!!T&&T(),onChange:function(e){K&&K(e)}}):R?e(X,{defaultValue:k,onBlur:function(){return N(!1)},onChange:Ue}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:u,header:p}):k||(null==p?void 0:p.label)}))})),"right"!==p.align&&_e,"right"!==p.align&&$e,"right"!==p.align&&Qe,!g&&Xe,_&&!Ne&&e("div",w({className:"st-header-dropdown-container"},{children:_({accessor:p.accessor,colIndex:u,header:p,isOpen:Re,onClose:Ve,position:We})}))]}))},cn=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,h=n.width,f=P().collapsedHeaders,v=a(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!N({header:o,pinned:s,headers:l,collapsedHeaders:f}))return 0;a||n++;var h=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return N({header:e,pinned:s,headers:l,collapsedHeaders:f})}).length)&&void 0!==d?d:0,v=n,p=h>0?v+h:v+1,g=i,w=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:p,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var m=!0;o.children.forEach(function(e){N({header:e,pinned:s,headers:l,collapsedHeaders:f})&&(t(e,i+1,m),m=!1)})}return p-v},o=l.filter(function(e){return N({header:e,pinned:s,headers:l,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r,f]),p=s?"pinned-".concat(s):"default";return e(De,w({childRef:u,group:p},{children:e("div",w({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,width:h,position:"relative"}},{children:e(t,{children:v.map(function(n){return e(ln,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},sn=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(sn)):1},un=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.sort,h=t.pinnedLeftWidth,f=t.pinnedRightWidth,v=P(),p=v.headerContainerRef,g=v.pinnedLeftRef,m=v.pinnedRightRef,y=v.collapsedHeaders,C=a(function(){return Le({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s,collapsedHeaders:y})},[o,l,s,y]),S=a(function(){var e=0,n=b(b(b([],l,!0),o,!0),s,!0);return o.forEach(function(t){if(N({header:t,headers:n,collapsedHeaders:y})){var r=sn(t);e=Math.max(e,r)}}),{maxDepth:e}},[o,l,s,y]).maxDepth;return n("div",w({className:"st-header-container",ref:p},{children:[se(o,"left")&&e(cn,{columnIndices:C,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:S,pinned:"left",sectionRef:g,sort:d,width:h}),e(cn,{columnIndices:C,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:S,sectionRef:r,sort:d}),se(o,"right")&&e(cn,{columnIndices:C,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:S,pinned:"right",sectionRef:m,sort:d,width:f})]}))},dn=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});r({headers:i,flattenedHeaders:o})}else 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(" "))},hn=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=P(),h=d.columnResizing,f=d.editColumns,v=d.headers,p=d.collapsedHeaders,g=i(null),m=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return dn({headers:y,collapsedHeaders:p})},[y,p]),S=a(function(){return dn({headers:m,collapsedHeaders:p})},[m,p]),I=a(function(){return dn({headers:b,collapsedHeaders:p})},[b,p]),x={centerHeaderRef:g,headers:v,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},R={tableRows:s,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",w({className:"st-content ".concat(h?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e(un,w({},x)),e(Be,w({},R))]}))},fn=function(t){var r=t.mainBodyWidth,a=t.mainBodyRef,l=t.pinnedLeftWidth,s=t.pinnedRightWidth,u=t.pinnedLeftContentWidth,d=t.pinnedRightContentWidth,h=t.tableBodyContainerRef,f=P().editColumns,v=o(!1),p=v[0],g=v[1],m=i(null),y=i(null),b=i(null),C=h.current&&h.current.scrollHeight>h.current.clientHeight,S=f?28:0,I=(f?s+1:s)+(h.current&&C?h.current.offsetWidth-h.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(a.current){var e=a.current.clientWidth;g(r>e)}}()},1)},[a,r]),p?n("div",w({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e(De,w({childRef:y,group:"pinned-left"},{children:e("div",w({className:"st-horizontal-scrollbar-left",ref:y,style:{width:l}},{children:e("div",{style:{width:u}})}))})),r>0&&e(De,w({childRef:m},{children:e("div",w({className:"st-horizontal-scrollbar-middle",ref:m},{children:e("div",{style:{width:r}})}))})),s>0&&e(De,w({childRef:b,group:"pinned-right"},{children:e("div",w({className:"st-horizontal-scrollbar-right",ref:b,style:{width:I}},{children:e("div",{style:{width:d}})}))})),S>0&&e("div",{style:{width:S-1.5,height:"100%",flexShrink:0}})]})):null},vn={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 vn.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?vn.string(e,n,t):"number"==typeof e&&"number"==typeof n?vn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?vn.boolean(e,n,t):vn.string(String(e),String(n),t)}},pn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return b([],n,!0).sort(function(e,n){var r=t.key.accessor;return 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 vn.number(i,a,r)}return"date"===t?vn.date(String(e),String(n),r):"boolean"===t?vn.boolean(Boolean(e),Boolean(n),r):"enum"===t?vn.enum(String(e),String(n),r):vn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},gn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return pn({rows:t,sortColumn:r,headers:n})},wn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):gn({headers:i,rows:t,sortColumn:r}):t},mn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(mn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},yn=function(e){return e.every(function(e){return e.hide})},bn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(bn(e.children),yn(e.children)&&(e.hide=!0))})},Cn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),h=d[0],f=d[1],v=P(),p=v.expandIcon,g=v.headers,m=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,S=null!=u?u:s.hide||C&&s.children&&yn(s.children);return n(t,{children:[n("div",w({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",w({className:"st-header-icon-container"},{children:C?e("div",w({className:"st-collapsible-header-icon st-expand-icon-container ".concat(h?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!h)}},{children:p})):null})),e(Ee,w({checked:S,onChange:function(e){(s.hide=e,e)?bn(i):(mn(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,mn(i,s.children[0].accessor)));m(b([],g,!0))}},{children:s.label}))]})),C&&h&&s.children&&e("div",w({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(Cn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!S||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},Sn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",w({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",w({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(Cn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},In=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],h=u[1];return i?n("div",w({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){h(e)}(!d)},style:{width:28}},{children:[e("div",w({className:"st-column-editor-text"},{children:r})),e(Sn,{headers:l,open:d,position:s})]})):null},xn=function(n){var t=n.className;return e("svg",w({"aria-hidden":"true",focusable:"false",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"})}))},Rn=function(n){var t=n.className;return e("svg",w({"aria-hidden":"true",focusable:"false",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"})}))},En=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(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&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),h=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(Te.Provider,w({value:{registerPane:d,unregisterPane:h}},{children:r.Children.only(t)}))},Nn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=ze[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},Hn=function(){var t=P(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",w({className:"st-filter-bar"},{children:e("div",w({className:"st-filter-bar-content"},{children:e("div",w({className:"st-filter-chips"},{children:a.map(function(t){return n("div",w({className:"st-filter-chip"},{children:[e("span",w({className:"st-filter-chip-text"},{children:Nn(t,i)})),e("button",w({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},kn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);return u=h[0],d=h[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=ee(e),v=ee(String(r||"")),p=Z(f),g=Z(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var w=o.map(function(e){return Z(ee(String(e||"")))}),m=w[0],y=w[1];return p>=m&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return Z(ee(String(e||"")))});return m=b[0],y=b[1],p<m||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var S=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=S}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var I=String(e),x=o.includes(I);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},An=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return I(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&T(l)){var c=i(l,t+1),s=w({},n);return s[o]=c,e.forEach(function(e){var n=Fn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},Fn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&T(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Wn=function(e){if(null==e)return"";var n=String(e);if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},Tn=function(e,n,t){var r=function(e,n){var t=function(e){var n=[],t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?t(i.children):n.push(i))}};return t(e),n}(n);return b([t.map(function(e){return Wn(e.label)}).join(",")],e.map(function(e){var n=e.row;return t.map(function(e){var t=n[e.accessor];return Wn(t)}).join(",")}),!0).join("\n")}(e,n);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(r,t)},Dn=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],h=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),f=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),w=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),m=l(function(e){if(c){var n=h(e);g(e,!n)}},[h,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:h,areAllRowsSelected:f,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:w,handleToggleRow:m,clearSelection:y}},Mn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(Ln,w({},n)):null},Ln=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,h=void 0!==u&&u,f=t.className,v=t.columnBorders,p=void 0!==v&&v,S=t.columnEditorPosition,I=void 0===S?"right":S,R=t.columnEditorText,E=void 0===R?"Columns":R,N=t.columnReordering,F=void 0!==N&&N,W=t.columnResizing,B=void 0!==W&&W,P=t.defaultHeaders,G=t.editColumns,U=void 0!==G&&G,V=t.editColumnsInitOpen,K=void 0!==V&&V,J=t.enableHeaderEditing,X=void 0!==J&&J,_=t.enableRowSelection,$=void 0!==_&&_,Q=t.expandAll,Z=void 0===Q||Q,ee=t.expandIcon,ne=void 0===ee?e(j,{className:"st-expand-icon"}):ee,te=t.externalFilterHandling,re=void 0!==te&&te,oe=t.externalSortHandling,ie=void 0!==oe&&oe,ae=t.headerCollapseIcon,ce=void 0===ae?e(j,{className:"st-header-icon"}):ae,se=t.headerExpandIcon,ue=void 0===se?e(z,{className:"st-header-icon"}):se,de=t.headerDropdown,he=t.headerHeight,fe=t.height,ve=t.hideFooter,pe=void 0!==ve&&ve,ge=t.nextIcon,we=void 0===ge?e(j,{className:"st-next-prev-icon"}):ge,ye=t.onCellEdit,be=t.onCellClick,Ce=t.onColumnOrderChange,Se=t.onColumnSelect,Ie=t.onFilterChange,xe=t.onGridReady,Re=t.onHeaderEdit,Ee=t.onLoadMore,Ne=t.onNextPage,He=t.onRowSelectionChange,ke=t.onSortChange,Ae=t.prevIcon,Fe=void 0===Ae?e(z,{className:"st-next-prev-icon"}):Ae,We=t.rowButtons,Te=t.rowGrouping,De=t.rowHeight,Me=void 0===De?32:De,Le=t.rowIdAccessor,Be=t.rows,Oe=t.selectionColumnWidth,Pe=void 0===Oe?42:Oe,qe=t.rowsPerPage,ze=void 0===qe?10:qe,je=t.selectableCells,Ye=void 0!==je&&je,Ge=t.selectableColumns,Ue=void 0!==Ge&&Ge,Ve=t.shouldPaginate,Ke=void 0!==Ve&&Ve,Je=t.sortDownIcon,Xe=void 0===Je?e(xn,{className:"st-header-icon"}):Je,_e=t.sortUpIcon,$e=void 0===_e?e(Rn,{className:"st-header-icon"}):_e,Qe=t.tableRef,Ze=t.theme,en=void 0===Ze?"light":Ze,nn=t.useHoverRowBackground,tn=void 0===nn||nn,rn=t.useOddEvenRowBackground,on=void 0!==rn&&rn,an=t.useOddColumnBackground,ln=void 0!==an&&an;ln&&(on=!1),p&&(tn=!1);var cn=g(function(e){return e+1},0)[1],sn=i(null),un=i(null),dn=i(null),vn=i(null),pn=i(null),mn=i(null),yn=i(null),bn=o(1),Cn=bn[0],Sn=bn[1],Nn=o(P),Fn=Nn[0],Wn=Nn[1],Mn=o(!1),Ln=Mn[0],Bn=Mn[1],On=o(!1),Pn=On[0],qn=On[1],zn=o(null),jn=zn[0],Yn=zn[1],Gn=o(new Set),Un=Gn[0],Vn=Gn[1];c(function(){Wn(P)},[P]);var Kn=Dn({rows:Be,rowIdAccessor:Le,onRowSelectionChange:He,enableRowSelection:$}),Jn=Kn.selectedRows,Xn=Kn.setSelectedRows,_n=Kn.isRowSelected,$n=Kn.areAllRowsSelected,Qn=Kn.selectedRowCount,Zn=Kn.selectedRowsData,et=Kn.handleRowSelect,nt=Kn.handleSelectAll,tt=Kn.handleToggleRow,rt=Kn.clearSelection,ot=a(function(){var e,n=b([],Fn,!0);$&&!(null===(e=null==Fn?void 0:Fn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=b([{accessor:"__row_selection__",label:"",width:Pe,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[$,Fn,Pe]),it=o(0),at=it[0],lt=it[1],ct=o(new Set),st=ct[0],ut=ct[1],dt=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:mn}),ht=dt.scrollbarWidth,ft=dt.setScrollbarWidth,vt=o(0),pt=vt[0],gt=vt[1];d(function(){var e=function(){mn.current&&gt(mn.current.clientWidth)};e();var n=null;return mn.current&&(n=new ResizeObserver(e)).observe(mn.current),function(){n&&n.disconnect()}},[]);var wt=a(function(){var e=C(window.innerWidth),n=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,l=0,c=0;n.forEach(function(e){if(!e.hide){var n=k(e,i).reduce(function(e,n){return e+A(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?l+=n:c+=n}});var s=a,u=l;if(t&&t>0){var d=t*o;a>d&&(a=d),l>d&&(l=d)}return{leftWidth:x(a),rightWidth:x(l),mainWidth:c,leftContentWidth:s,rightContentWidth:u}}({headers:ot,containerWidth:pt,maxPinnedWidthPercent:e,collapsedHeaders:Un});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[ot,pt,Un]),mt=wt.mainBodyWidth,yt=wt.pinnedLeftWidth,bt=wt.pinnedRightWidth,Ct=wt.pinnedLeftContentWidth,St=wt.pinnedRightContentWidth,It=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if("string"==typeof n)if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;else o=n;return Math.max(0,o-t)},[n,t])}({height:fe,rowHeight:Me}),xt=An({rows:Be,headers:Fn,rowGrouping:Te}),Rt=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return kn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=w(w({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),h=l(function(e){var n=w({},c);delete n[e],s(n),null==r||r(n)},[c,r]),f=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=w(w({},c),((r={})[e.accessor]=e,r));return kn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:h,clearAllFilters:f,filters:c,computeFilteredRowsPreview:v}}({rows:xt,externalFilterHandling:re,onFilterChange:Ie}),Et=Rt.filters,Nt=Rt.filteredRows,Ht=Rt.updateFilter,kt=Rt.clearFilter,At=Rt.clearAllFilters,Ft=Rt.computeFilteredRowsPreview,Wt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],h=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=gn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(T(a)){var l=h({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return w(w({},e),((r={})[i]=l,r))}return e}):i},[]),f=a(function(){return wn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:h})},[t,u,n,r,c,h]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},wn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:h})},[u,n,t,r,c,h]);return{sort:u,sortedRows:f,updateSort:v,computeSortedRowsPreview:p}}({headers:Fn,tableRows:Nt,externalSortHandling:ie,onSortChange:ke,rowGrouping:Te}),Tt=Wt.sort,Dt=Wt.sortedRows,Mt=Wt.updateSort,Lt=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,h=e.rowGrouping,f=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,m=e.rowHeight,y=e.scrollTop,C=e.computeFilteredRowsPreview,S=e.computeSortedRowsPreview,I=o(!1),x=I[0],R=I[1],E=o([]),N=E[0],H=E[1],k=i([]),A=i([]),F=i(new Map),W=i(null),T=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return h&&0!==h.length?M({rows:n,rowGrouping:h,rowIdAccessor:f,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,h,f,v,p]);a(function(){if(0===F.current.size){var e=T(r),n=new Map;e.forEach(function(e){var t=String(D({row:e.row,rowIdAccessor:f}));n.set(t,e.position)}),F.current=n}},[r,T,f]);var L=a(function(){return T(t)},[t,T]),B=a(function(){return Y({bufferRowCount:5,contentHeight:g,tableRows:L,rowHeight:m,scrollTop:y})},[L,g,m,y]),O=l(function(e,n){var t=new Set(e.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))})),r=new Set(n.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))}));return{staying:n.filter(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return t.has(n)}),entering:n.filter(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return!r.has(n)})}},[f]),P=a(function(){if(0===k.current.length)return!1;var e=L.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))}),n=k.current.map(function(e){return String(D({row:e.row,rowIdAccessor:f}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L,f]);d(function(){if(!x){if(!n||u)return H([]),k.current=L,void(A.current=B);if(0===k.current.length)return H([]),k.current=L,void(A.current=B);if(!P)return H([]),k.current=L,void(A.current=B);W.current={tableRows:L,visibleRows:B},R(!0)}},[n,L,P,x,u,B]),d(function(){if(x&&W.current&&N.length>0){var e=setTimeout(function(){var e=W.current;R(!1),H([]),k.current=e.tableRows,A.current=e.visibleRows,W.current=null},me.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var q=a(function(){if(!n||u)return B;if(N.length>0){var e=new Map;return L.forEach(function(n){var t=String(D({row:n.row,rowIdAccessor:f}));e.set(t,n.position)}),N.map(function(n){var t=String(D({row:n.row,rowIdAccessor:f})),r=e.get(t);return void 0!==r?w(w({},n),{position:r}):n})}return B},[B,N,L,n,u,f]),z=l(function(e){if(n&&!u){var t=C(e),r=T(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return L.find(function(e){return String(D({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],B,!0),i,!0))}},[n,u,C,T,g,m,y,O,L,B,f]),j=l(function(e){if(n&&!u){var t=S(e),r=T(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(D({row:e.row,rowIdAccessor:f}));return L.find(function(e){return String(D({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],B,!0),i,!0))}},[n,u,S,T,g,m,y,O,L,B,f]);return{currentTableRows:L,currentVisibleRows:B,isAnimating:x,prepareForFilterChange:z,prepareForSortChange:j,rowsToRender:q}}({allowAnimations:s,sortedRows:Dt,originalRows:xt,currentPage:Cn,rowsPerPage:ze,shouldPaginate:Ke,rowGrouping:Te,rowIdAccessor:Le,unexpandedRows:st,expandAll:Z,contentHeight:It,rowHeight:Me,scrollTop:at,computeFilteredRowsPreview:Ft,computeSortedRowsPreview:Wt.computeSortedRowsPreview}),Bt=Lt.currentTableRows,Ot=Lt.rowsToRender,Pt=Lt.prepareForFilterChange,qt=Lt.prepareForSortChange,zt=Lt.isAnimating,jt=i(new Map),Yt=i(new Map),Gt=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,h=e.collapsedHeaders,f=o(new Set),v=f[0],p=f[1],g=o(new Set),w=g[0],b=g[1],C=o(null),S=C[0],I=C[1],x=o(null),R=x[0],E=x[1],N=o(new Set),H=N[0],A=N[1],F=o(new Set),W=F[0],T=F[1],M=i(!1),B=i(null),O=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),w.forEach(function(n){e.add(n)}),e},[v,w]),P=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),w.size>0&&r.forEach(function(n){var t=D({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[v,w,r,s]),q=a(function(){return t.flatMap(function(e){return k(e,h)})},[t,h]),z=l(function(){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(v).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");v.size>0&&(navigator.clipboard.writeText(o),A(new Set(v)),setTimeout(function(){A(new Set)},800))},[q,v,r]),j=l(function(){return m(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(h){switch(h.label){case 0:if(!R)return[2];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=h.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=q.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var h=a+n,f=l+c;if(!(h>=r.length||f>=t.length)){var v=r[h],p=t[f],g=D({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=Number(e);isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(w=y)}if(v.row[p.accessor]=w,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(w)}null==u||u({accessor:p.accessor,newValue:w,row:v.row,rowIndex:h});var S=L({colIndex:f,rowIndex:h,rowId:g});o.add(S)}else{var I=L({colIndex:f,rowIndex:h,rowId:g});i.add(I)}}})}),o.size>0&&(A(o),setTimeout(function(){A(new Set)},800)),i.size>0&&(T(i),setTimeout(function(){T(new Set)},800)),[3,4]):[2];case 3:return c=h.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,q,r,s,u,d]),Y=l(function(){if(0!==v.size){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(v).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],h=e[l],f=D({row:c.row,rowIdAccessor:s});if(null==h?void 0:h.isEditable){var v=null;if(v="string"===h.type?"":"number"===h.type?null:"boolean"!==h.type&&("date"===h.type?null:Array.isArray(c.row[h.accessor])?[]:""),c.row[h.accessor]=v,d){var p="".concat(f,"-").concat(h.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:h.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(A(t),setTimeout(function(){A(new Set)},800)),o.size>0&&(T(o),setTimeout(function(){T(new Set)},800))}},[v,q,r,s,u,d]),G=l(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),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=D({row:r[c].row,rowIdAccessor:s});t.add(L({colIndex:u,rowIndex:c,rowId:d}))}b(new Set),I(null),p(t)},[r,s,b,I,p]),U=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<q.length){var n=L(e);b(new Set),I(null),p(new Set([n])),E(e)}},[q.length,r.length,b,I,p,E]),V=l(function(e,n){void 0===n&&(n=!1),p(new Set),E(null),b(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&I(e[e.length-1])},[p,E,b,I]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void j();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void Y();if(D({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return D({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=D({row:r[o-1].row,rowIdAccessor:s});U({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=D({row:r[o+1].row,rowIdAccessor:s}),U({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=D({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<q.length-1&&(c=D({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(p(new Set),b(new Set),I(null),B.current=null,E(null))}else z()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[z,q.length,R,s,G,U,n,r,j,Y]);var K=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=L({colIndex:n,rowIndex:t,rowId:r}),i=v.has(o),a=w.has(n);return i||a},[v,w]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?D({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?D({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},h={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!K(c)||w.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!K(u)||w.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),K(d)||i.push("st-selected-left-border"),K(h)||i.push("st-selected-right-border"),i.join(" ")},[K,r,w,s]),X=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=L({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]),$=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=L({colIndex:n,rowIndex:t,rowId:r});return W.has(o)},[W]);return{getBorderClass:J,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(M.current=!0,B.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){b(new Set),I(null);var e=L({colIndex:t,rowIndex:r,rowId:o});p(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&M.current&&B.current){for(var i=new Set,a=Math.min(B.current.rowIndex,o),l=Math.max(B.current.rowIndex,o),c=Math.min(B.current.colIndex,t),u=Math.max(B.current.colIndex,t),d=a;d<=l;d++)for(var h=c;h<=u;h++)if(d>=0&&d<r.length){var f=D({row:r[d].row,rowIdAccessor:s});i.add(L({colIndex:h,rowIndex:d,rowId:f}))}p(i)}},handleMouseUp:function(){M.current=!1},isCopyFlashing:_,isWarningFlashing:$,isInitialFocusedCell:X,isSelected:K,lastSelectedColumnIndex:S,pasteFromClipboard:j,selectColumns:V,selectedCells:v,selectedColumns:w,setInitialFocusedCell:E,setSelectedCells:p,setSelectedColumns:b,deleteSelectedCells:Y,columnsWithSelectedCells:O,rowsWithSelectedCells:P}}({selectableCells:Ye,headers:Fn,tableRows:Bt,rowIdAccessor:Le,onCellEdit:ye,cellRegistry:jt.current,collapsedHeaders:Un}),Ut=Gt.getBorderClass,Vt=Gt.handleMouseDown,Kt=Gt.handleMouseOver,Jt=Gt.handleMouseUp,Xt=Gt.isCopyFlashing,_t=Gt.isInitialFocusedCell,$t=Gt.isSelected,Qt=Gt.isWarningFlashing,Zt=Gt.selectColumns,er=Gt.selectedCells,nr=Gt.selectedColumns,tr=Gt.setInitialFocusedCell,rr=Gt.setSelectedCells,or=Gt.setSelectedColumns,ir=Gt.columnsWithSelectedCells,ar=Gt.rowsWithSelectedCells,lr=l(function(e){qt(e),setTimeout(function(){Mt(e)},0)},[qt,Mt]),cr=l(function(e){Wn(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:Ue,selectedCells:er,selectedColumns:nr,setSelectedCells:rr,setSelectedColumns:or,activeHeaderDropdown:jn,setActiveHeaderDropdown:Yn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:cn,tableBodyContainerRef:mn,setScrollbarWidth:ft}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:xe}),function(e){var n=e.cellRegistryRef,t=e.currentTableRows,r=e.headerRegistryRef,o=e.headers,i=e.rowIdAccessor,a=e.rows,l=e.tableRef,s=e.visibleRows;c(function(){l&&(l.current={updateData:function(e){var t=e.accessor,r=e.rowIndex,o=e.newValue,l=null==a?void 0:a[r];if(l){var c=D({row:l,rowIdAccessor:i}),s=H({rowId:c,accessor:t}),u=n.current.get(s);u&&u.updateContent(o),void 0!==l[t]&&(l[t]=o)}},setHeaderRename:function(e){var n=e.accessor,t=r.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return s},exportToCSV:function(e){var n=(void 0===e?{}:e).filename;Tn(t,o,n)}})},[n,r,a,i,l,s,o])}({cellRegistryRef:jt,currentTableRows:Bt,headerRegistryRef:Yt,headers:ot,rowIdAccessor:Le,rows:Be,tableRef:Qe,visibleRows:Ot}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:Et,onFilterChange:Ie}),function(e){var n=e.sort,t=e.onSortChange,r=le(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:Tt,onSortChange:ke});var sr=l(function(e){Pt(e),setTimeout(function(){Ht(e)},0)},[Pt,Ht]);return e(O,w({value:{allowAnimations:s,areAllRowsSelected:$n,cellRegistry:jt.current,cellUpdateFlash:h,clearSelection:rt,collapsedHeaders:Un,columnBorders:p,columnReordering:F,columnResizing:B,draggedHeaderRef:sn,editColumns:U,enableHeaderEditing:X,enableRowSelection:$,expandIcon:ne,filters:Et,forceUpdate:cn,getBorderClass:Ut,handleApplyFilter:sr,handleClearAllFilters:At,handleClearFilter:kt,handleMouseDown:Vt,handleMouseOver:Kt,handleRowSelect:et,handleSelectAll:nt,handleToggleRow:tt,headerCollapseIcon:ce,headerContainerRef:yn,headerDropdown:de,headerExpandIcon:ue,headerRegistry:Yt.current,headers:ot,hoveredHeaderRef:un,isAnimating:zt,isCopyFlashing:Xt,isInitialFocusedCell:_t,isResizing:Ln,isRowSelected:_n,isScrolling:Pn,isSelected:$t,isWarningFlashing:Qt,mainBodyRef:dn,nextIcon:we,onCellEdit:ye,onCellClick:be,onColumnOrderChange:Ce,onColumnSelect:Se,onLoadMore:Ee,onSort:lr,onTableHeaderDragEnd:cr,pinnedLeftRef:vn,pinnedRightRef:pn,prevIcon:Fe,rowButtons:We,rowGrouping:Te,rowHeight:Me,headerHeight:null!=he?he:Me,rowIdAccessor:Le,scrollbarWidth:ht,selectColumns:Zt,selectableColumns:Ue,selectedColumns:nr,columnsWithSelectedCells:ir,rowsWithSelectedCells:ar,selectedRows:Jn,selectedRowCount:Qn,selectedRowsData:Zn,setCollapsedHeaders:Vn,setHeaders:Wn,setInitialFocusedCell:tr,setIsResizing:Bn,setIsScrolling:qn,setSelectedCells:rr,setSelectedColumns:or,setSelectedRows:Xn,setUnexpandedRows:ut,shouldPaginate:Ke,sortDownIcon:Xe,sortUpIcon:$e,tableBodyContainerRef:mn,tableRows:Bt,theme:en,unexpandedRows:st,useHoverRowBackground:tn,useOddColumnBackground:ln,useOddEvenRowBackground:on,activeHeaderDropdown:jn,setActiveHeaderDropdown:Yn,onHeaderEdit:Re}},{children:e("div",w({className:"simple-table-root st-wrapper theme-".concat(en," ").concat(null!=f?f:""," ").concat(p?"st-column-borders":""),style:fe?{height:fe}:{}},{children:e(En,{children:n("div",w({className:"st-wrapper-container"},{children:[e(Hn,{}),n("div",w({className:"st-content-wrapper",onMouseUp:Jt,onMouseLeave:Jt},{children:[e(hn,{pinnedLeftWidth:yt,pinnedRightWidth:bt,setScrollTop:lt,sort:Tt,tableRows:Bt,rowsToRender:Ot}),e(In,{columnEditorText:E,editColumns:U,editColumnsInitOpen:K,headers:Fn,position:I})]})),e(fn,{mainBodyRef:dn,mainBodyWidth:mt,pinnedLeftWidth:yt,pinnedRightWidth:bt,pinnedLeftContentWidth:Ct,pinnedRightContentWidth:St,tableBodyContainerRef:mn}),e(q,{currentPage:Cn,hideFooter:pe,onPageChange:Sn,onNextPage:Ne,shouldPaginate:Ke,totalPages:Math.ceil(Dt.length/ze)})]}))})}))}))};export{Mn 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{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,s)}l((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=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function s(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 l=function(e){return e<480?.3:e<768?.4:.8},c=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 s=a[i];o=r(s,o)}return o};return r(e,n),t},u=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,u(e.children)),n})},d=function(e){return void 0===e&&(e=0),e?e+1:0},f=function(e,n,t){var r=function(e,n){for(var t=0,r=u(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)},h=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},v=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&f(n,r,o))||null},p=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},g=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return g(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return g(e,n)}):[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(h({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},w=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(h({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){w(e)})},x=function(e){return"number"==typeof e.minWidth?e.minWidth:40},b=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},y=function(e){return e.row[e.rowIdAccessor]},C=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,s=void 0===a?[]:a,l=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var c=y({row:t,rowIdAccessor:l}),f=s[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(c);if((o?!i.has(v):i.has(v))&&n<s.length){var p=function(e,n){var t=e[n];return b(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(c,t),u},S=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},I=n.createContext(void 0),R=function(n){var t=n.children,r=n.value;return e.jsx(I.Provider,o({value:r},{children:t}))},j=function(){var e=n.useContext(I);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},E=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=j(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),g=p[0],m=p[1],w=!(r>1),x=!(r<d)&&!c||!g&&r===d;if(s||!u)return null;var b=function(){if(d<=15)return Array.from({length:d},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>=d-Math.floor(7.5))e=Math.max(1,d-o+1),n=d;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<d-1&&(t.push(-1),t.push(d)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&l(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"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===d,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<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),b.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<=d&&l(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},k=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"})}))},N=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"})}))},H=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,s=Math.max(0,o-a*n),l=o+t+a*n,c=Math.max(0,Math.floor(s/a)),u=Math.min(i.length,Math.ceil(l/a));return i.slice(c,u)},A=function(e){return e.position*(e.rowHeight+1)-1},M=function(e){return e.position*(e.rowHeight+1)},F=function(t){var r=t.children,i=t.onClose,a=t.open,s=t.overflow,l=void 0===s?"auto":s,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=j().mainBodyRef,p=n.useRef(null),g=n.useRef(null),m=n.useState("bottom-left"),w=m[0],x=m[1],b=n.useState({}),y=b[0],C=b[1],S=n.useState(!1),I=S[0],R=S[1];return n.useEffect(function(){a&&p.current?(R(!1),!g.current&&p.current.parentElement&&(g.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&g.current){var e,n=p.current,t=g.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,i=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.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,s="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(s="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===s?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===c?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===s?l.top=t.height+4:l.bottom=t.height+4,"left"===c?l.left=0:l.right=0),x("".concat(s,"-").concat(c)),C(l),R(!0)}})):a||R(!1)},[a,u,d,v,h]),n.useEffect(function(){var e=function(e){if(a&&p.current){var n=e.target;p.current&&!p.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){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.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:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:I?"visible":"hidden"},y),{overflow:l})},{children:r})):null},W=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,s=n.disabled,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(l?"disabled":""," ").concat(u),onClick:function(){!l&&r&&r()},role:"option","aria-selected":a,"aria-disabled":l},{children:t}))},T=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value,c=n.useState(l),u=c[0],d=c[1],f=function(e){d(e),i(e),s(!1),r()};return e.jsxs(F,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(W,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(W,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},D=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},L=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},B=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=j(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),g=p[0],m=p[1],w=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(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return m("months")}},{children:[(i=h,i.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return m("years")}},{children:h.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=h.getFullYear(),r=h.getMonth(),i=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(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 d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e,12,0,0);v(n),a(n),null==s||s()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(i){var c=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=new Date(l),d=i===u.getDate()&&r===u.getMonth()&&t===u.getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(d?"selected":""),onClick:function(){return function(e){var n=h.getFullYear(),t=h.getMonth(),r=new Date(n,t,e,12,0,0);v(r),a(r),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)p(g);var m=35-(c+i),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e,12,0,0);v(n),a(n),null==s||s()}(t)}},{children:t}),"next-".concat(t)))};for(g=1;g<=m;g++)x(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===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),m("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===g&&function(){for(var n=[],t=h.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,h.getMonth(),1)),m("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,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);v(n),a(n),null==s||s()}},{children:"Today"}))}))]}))},O=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},P=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},q=function(e){if(!e)return new Date;if("string"==typeof e)return O(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:P(n)}return e instanceof Date?P(e):new Date},z=function(e){return e?O(e.toString()):new Date},Y=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value;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 c=function(){r()};return e.jsx(F,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(B,{value:z(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},G=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.options,l=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(F,o({open:a,onClose:function(){r()},setOpen:l,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:s.map(function(n){return e.jsx(W,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),i(e),l(!1),void r();var e}},{children:n.label}),n.value)})}))}))},U=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,s=void 0===a?"string":a,l=n.value,c=function(){i(!1)};if("boolean"===s&&"boolean"==typeof l)return e.jsx(T,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(Y,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(G,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(L,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==l?"":String(l);return e.jsx(D,{defaultValue:d,onBlur:c,onChange:o})},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))}},J=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},X=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(X);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=X(e[t]));return n},_=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},$=Date.now(),Q={screenX:0,screenY:0},Z=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 s(s([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Z(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},ee=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ne(e,n,t){var r,i,a=X(e),s=!1;try{var l=ee(t),c=a.findIndex(function(e){return e.accessor===n.accessor}),u=a.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:a,emergencyBreak:s=!0};var d=a.splice(c,1)[0],f=(r=l,i=o({},d),"left"===r?i.pinned="left":"right"===r?i.pinned="right":delete i.pinned,i),h=u;a.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),s=!0}return{newHeaders:a,emergencyBreak:s}}var te=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=j().setHeaders,l=J(t);return{handleDragStart:function(e){n.current=e,$=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var s=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(c-Q.screenX,2)+Math.pow(u-Q.screenY,2));r.current=a;var f,h=n.current,v=!1;if(ee(h)!==ee(a)){f=(C=ne(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,g=Z(p,h.accessor),m=Z(p,a.accessor);if(!g||!m)return;var w=g.length,x=m.length,b=m;if(w!==x){var y=x-w;y>0&&(b=m.slice(0,-y))}var C=function(e,n,t){var r=X(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 s=i(r,n);return a(r,n,i(r,t)),a(r,t,s),{newHeaders:r,emergencyBreak:o}}(p,g,b);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-$<1500||d<40)||($=S,Q={screenX:c,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return s([],e,!0)}),null==o||o(t)},10)}}},re=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},oe={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ie={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ae={duration:150,easing:"ease-out",delay:0},se=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},le=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){se(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ce=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,s=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i,l;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,s),0===e.x&&0===e.y?[2]:re()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),re()?o(o({},ae),e):o(o({},"column"===n?oe:ie),e)}(t,i?"column":"row"),se(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,le(n,l,t)]);case 1:return a.sent(),[2]}})})},ue=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,s,l,c,u,d,f,h,v,p,g,m,w;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,s=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,u=t.delay,d=void 0===u?0:u,f=t.onComplete,h=t.respectReducedMotion,v=void 0===h||h,re()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),g=p.top,m=e-g,w=r-g,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(s,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,s+(d||0)+50)})])})})},de=function(t){var r=t.children,i=t.id,a=t.parentRef,s=t.tableRow,l=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}(t,["children","id","parentRef","tableRow"]),c=j(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),g=J(f),m=J(d);return n.useLayoutEffect(function(){var e,n,t,r;if(u&&v.current&&!d){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!m||d){if(p.current=i,l){var c=i.x-l.x,w=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(w)<=5)){if(Math.abs(c)>5||Math.abs(w)>5){var x=o(o({},ie),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,y=null===(n=null==a?void 0:a.current)||void 0===n?void 0:n.clientHeight,C=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==y&&void 0!==C){var S=5*h,I=b-S,R=b+y+S,j=l.y>I&&l.y<R,E=i.y>I&&i.y<R,k=i.y<b,N=i.y>b+y,H=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,A=.6*h,M=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(j&&!E&&N){var F=b+y+M(i.y,b,b+y)+H%15*A*2.5+H%7*(.4*h);return void ue({element:v.current,options:{startY:l.y,endY:F,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){F=b-M(i.y,b,b+y)-H%15*A*2.5-H%7*(.4*h);return void ue({element:v.current,options:{startY:l.y,endY:F,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>b+y){var W=b+y+M(l.y,b,b+y)+H%10*A*1;return void ue({element:v.current,options:{startY:W,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<b){W=b-M(l.y,b,b+y)-H%10*A*1;return void ue({element:v.current,options:{startY:W,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}ce({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,g,m,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};de.displayName="Animate";var fe=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},he=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(fe,{className:"st-checkbox-checkmark"})})),i]}))},ve=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?q(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},pe=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,l=t.isInitialFocused,c=t.nestedIndex,u=t.rowIndex,d=t.tableRow,f=j(),v=f.cellRegistry,g=f.cellUpdateFlash,m=f.columnBorders,w=f.draggedHeaderRef,x=f.enableRowSelection,C=f.expandIcon,S=f.handleMouseDown,I=f.handleMouseOver,R=f.handleRowSelect,E=f.headers,k=f.hoveredHeaderRef,N=f.isCopyFlashing,H=f.isRowSelected,A=f.isWarningFlashing,M=f.onCellEdit,F=f.onCellClick,W=f.onTableHeaderDragEnd,T=f.rowButtons,D=f.rowGrouping,L=f.rowIdAccessor,B=f.rowsWithSelectedCells,O=f.selectedColumns,P=f.setUnexpandedRows,q=f.tableBodyContainerRef,z=f.theme,Y=f.unexpandedRows,G=f.useOddColumnBackground,V=d.depth,J=d.row,X=n.useState(J[a.accessor]),_=X[0],$=X[1],Q=n.useState(!1),Z=Q[0],ee=Q[1],ne=n.useState(!1),re=ne[0],oe=ne[1],ie=n.useState(!1),ae=ie[0],se=ie[1],le=n.useRef(null),ce=y({row:J,rowIdAccessor:L}),ue=D&&D[V],fe=!!ue&&function(e,n){if(!n)return!1;var t=e[n];return b(t)}(J,ue),pe=!Y.has(String(ce)),ge=N({rowIndex:u,colIndex:i,rowId:ce}),me=A({rowIndex:u,colIndex:i,rowId:ce}),we=n.useMemo(function(){var e,n,t;if(!m)return!1;var r=E.filter(function(e){return"left"===e.pinned}),o=E.filter(function(e){return!e.pinned}),i=E.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[m,E,a.accessor,a.pinned]),xe=te({draggedHeaderRef:w,headers:E,hoveredHeaderRef:k,onTableHeaderDragEnd:W}).handleDragOver,be=K(),ye=h({accessor:a.accessor,rowId:ce}),Ce=p({rowId:ce,accessor:a.accessor}),Se=a.isSelectionColumn&&x;n.useEffect(function(){if(v){var e="".concat(ce,"-").concat(a.accessor);return v.set(e,{updateContent:function(e){_!==e?($(e),g&&(oe(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(function(){oe(!1)},800))):$(e)}}),function(){v.delete(e),le.current&&clearTimeout(le.current)}}},[v,g,ce,a.accessor,_]),n.useEffect(function(){if(re){var e=setTimeout(function(){oe(!1)},850);return function(){return clearTimeout(e)}}},[re]),n.useEffect(function(){$(J[a.accessor])},[J,a.accessor]);var Ie="boolean"===a.type||"date"===a.type||"enum"===a.type,Re=Boolean(null==a?void 0:a.isEditable),je=O.has(i),Ee=s&&!je,ke=n.useMemo(function(){return!!Se&&B.has(String(ce))},[Se,B,ce]),Ne="st-cell ".concat(V>0&&a.expandable?"st-cell-depth-".concat(V):""," ").concat(Ee?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(je?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Re?"clickable":""," ").concat(re?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(ge?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(me?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(G?c%2==0?"even-column":"odd-column":""," ").concat(Se?"st-selection-cell":""," ").concat(ke?"st-selection-has-highlighted-cell":""," ").concat(we?"st-last-column":""),He=n.useCallback(function(e){$(e),J[a.accessor]=e,null==M||M({accessor:a.accessor,newValue:e,row:J,rowIndex:u})},[a.accessor,M,J,u]),Ae=n.useCallback(function(){P(function(e){var n=new Set(e),t=String(ce);return n.has(t)?n.delete(t):n.add(t),n})},[ce,P]);return!Z||Ie||Se?e.jsxs(de,o({className:Ne,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":ce,"data-row-index":u,id:ye,onClick:function(){F&&!Se&&F({accessor:a.accessor,colIndex:i,row:J,rowId:ce,rowIndex:u,value:_})},onDoubleClick:function(){return a.isEditable&&!Se&&ee(!0)},onDragOver:function(e){Se||be({callback:xe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){Z||Se||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||Z||(e.preventDefault(),ee(!0))},onMouseDown:function(){Z||Se||S({rowIndex:u,colIndex:i,rowId:ce})},onMouseEnter:function(){se(!0)},onMouseLeave:function(){se(!1)},onMouseOver:function(){Z||Se||I({rowIndex:u,colIndex:i,rowId:ce})},parentRef:q,tableRow:d},{children:[a.expandable&&fe?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(pe?"expanded":"collapsed"),onClick:Ae},{children:C})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:Se?e.jsxs("div",o({className:"st-selection-cell-content"},{children:[e.jsx("div",o({className:"st-selection-control"},{children:ae||H&&H(String(ce))?e.jsx(he,{checked:!!H&&H(String(ce)),onChange:function(e){R&&R(String(ce),e)}}):e.jsx("span",o({className:"st-row-number"},{children:u+1}))})),function(){if(!T||!Se||0===T.length)return null;if(!(ae||H&&H(String(ce))))return null;var n={row:J};return e.jsx("div",o({className:"st-row-buttons"},{children:T.map(function(t,r){return e.jsx("span",o({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:J,theme:z}):ve({content:_,header:a})})})),Z&&Ie&&!Se&&e.jsx(U,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ee,type:a.type,value:_})]}),Ce):e.jsx("div",o({className:"st-cell-editing",id:h({accessor:a.accessor,rowId:ce}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(U,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ee,type:a.type,value:_})}))},ge=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,l=n.tableRow,c=j(),u=c.rowIdAccessor,d=c.collapsedHeaders,f=o.filter(function(e){return v({header:e,pinned:i,headers:o,collapsedHeaders:d})});return e.jsx(e.Fragment,{children:f.map(function(n,c){var d=y({row:l.row,rowIdAccessor:u}),f=h({accessor:n.accessor,rowId:d});return e.jsx(me,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:l},f)})})},me=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,l=t.rowIndex,c=t.rowIndices,u=t.tableRow,d=r[o.accessor],f=j(),p=f.getBorderClass,g=f.isSelected,m=f.isInitialFocusedCell,w=f.rowIdAccessor,x=f.collapsedHeaders,b=y({row:u.row,rowIdAccessor:w});if(o.children&&o.children.length>0){var C=o.children.filter(function(e){return v({header:e,pinned:s,headers:i,collapsedHeaders:x})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=h({accessor:n.accessor,rowId:b});return e.jsx(me,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:l,rowIndices:c,tableRow:u},t)})})}var S={rowIndex:l,colIndex:d,rowId:b},I=p(S),R=g(S),E=m(S),k=h({accessor:o.accessor,rowId:b});return e.jsx(pe,{borderClass:I,colIndex:d,header:o,isHighlighted:R,isInitialFocused:E,nestedIndex:a,rowIndex:l,tableRow:u},k)},we=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,s=n.index,l=n.pinned,c=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,h=j(),v=h.useHoverRowBackground,p=h.rowIdAccessor,g=h.isAnimating,m=h.isRowSelected,w=h.useOddEvenRowBackground,x=f.position,b=x%2==0,C=y({row:f.row,rowIdAccessor:p}),S=!!m&&m(String(C));return e.jsx("div",o({className:"st-row ".concat(w?b?"even":"odd":""," ").concat(S?"selected":""),"data-index":s,onMouseEnter:function(){!g&&v&&d(s)},style:{gridTemplateColumns:i,top:M({position:x,rowHeight:c}),height:"".concat(c,"px")}},{children:e.jsx(ge,{columnIndexStart:r,columnIndices:t,headers:a,pinned:l,rowIndex:x,rowIndices:u,tableRow:f},C)}))},xe=function(t){var r=t.displayStrongBorder,i=t.position,a=t.rowHeight,s=t.templateColumns,l=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=s.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=s.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,a=0;a<r.length;a++){if(t<=o+r[a]){i=a;break}o+=r[a],i=a}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:s,top:A({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},be=n.createContext(void 0),ye=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(be);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),s=a.registerPane,l=a.unregisterPane,c=[i];return n.useEffect(function(){return t.current&&s(t.current,c),function(){t.current&&l(t.current,c)}},[t,s,l,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},Ce=n.forwardRef(function(t,r){var i=t.columnIndexStart,a=t.columnIndices,s=t.headers,l=t.pinned,c=t.rowHeight,u=t.rowIndices,d=t.setHoveredIndex,f=t.templateColumns,h=t.totalHeight,v=t.rowsToRender,p=t.width,g=l?"st-body-pinned-".concat(l):"st-body-main",m=j().rowIdAccessor,w=n.useRef(null);if(n.useImperativeHandle(r,function(){return w.current},[]),!n.useMemo(function(){return _(s,l)},[s,l]))return null;var x=l?"pinned-".concat(l):"default";return e.jsx(ye,o({childRef:w,group:x},{children:e.jsx("div",o({className:g,ref:w,style:o({position:"relative",height:"".concat(h,"px"),width:p},!l&&{flexGrow:1})},{children:v.map(function(t,r){var o=y({row:t.row,rowIdAccessor:m});return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(xe,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:c,templateColumns:f,rowIndex:r-1}),e.jsx(we,{columnIndexStart:i,columnIndices:a,gridTemplateColumns:f,headers:s,index:r,pinned:l,rowHeight:c,rowIndices:u,setHoveredIndex:d,tableRow:t},o)]},o)})}))}))});function Se(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=s(s(s([],t,!0),n,!0),r,!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 v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Ce.displayName="TableSection";var Ie=function(t){var r=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,l=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,u=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,h=t.tableRows,v=j(),p=v.collapsedHeaders,g=v.headerContainerRef,m=v.headers,w=v.isAnimating,x=v.mainBodyRef,b=v.onLoadMore,C=v.rowHeight,S=v.rowIdAccessor,I=v.scrollbarWidth,R=v.setIsScrolling,E=v.shouldPaginate,k=v.tableBodyContainerRef,N=n.useState(!1),H=N[0],A=N[1],M=n.useRef(new Set),F=n.useCallback(function(e){(M.current.forEach(function(e){return e.classList.remove("hovered")}),M.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),M.current.add(e)})},[]);n.useEffect(function(){w&&F(null)},[w,F]),function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],s=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;s(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(n),function(){n&&i.unobserve(n)}}},[t,r])}({headerContainerRef:g,mainSectionRef:k,scrollbarWidth:I}),n.useEffect(function(){return function(){T.current&&clearTimeout(T.current)}},[]);var W=n.useRef(null),T=n.useRef(null),D=n.useRef(0),L=function(e){return e.length}(h),B=L*(C+1)-1,O=n.useMemo(function(){return Se({headers:m,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:p})},[m,i,l,p]),P=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(y({row:n.row,rowIdAccessor:S}));e[r]=t}),e},[d,S]),q=n.useCallback(function(e,n){if(b&&!E&&!H){e.scrollHeight-(n+e.clientHeight)<=200&&n>D.current&&(A(!0),b(),setTimeout(function(){A(!1)},1e3))}},[b,E,H]),z={columnIndices:O,headerContainerRef:g,headers:m,rowHeight:C,rowIndices:P,rowsToRender:d,setHoveredIndex:F};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;R(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(function(){R(!1)},150),W.current&&cancelAnimationFrame(W.current),W.current=requestAnimationFrame(function(){f(t),q(n,t),D.current=t})},ref:k},{children:[e.jsx(Ce,o({},z,{pinned:"left",templateColumns:a,totalHeight:B,width:s})),e.jsx(Ce,o({},z,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:B})),e.jsx(Ce,o({},z,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:B,width:u}))]}))},Re=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,c=e.collapsedHeaders;n.preventDefault();var u="clientX"in n?n.clientX:n.touches[0].clientX,d="touches"in n;if(t&&!t.hide){i(!0);var f,h=x(t);if(t.children&&t.children.length>0){var v=g(t,c);f=v.length>0?v:[t]}else f=[t];var p=function(e){var n="right"===t.pinned?u-e:e-u,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=i*l(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var s=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+g(n,r).reduce(function(e,n){return e+m(n)},0)},0),c=x(n);return s<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):s}({header:t,headers:r,collapsedHeaders:c});if(f.length>1)je({delta:n,leafHeaders:f,minWidth:h,startWidth:a,maxWidth:i});else{var d=Math.max(Math.min(a+n,i),h);f[0].width=d}r.forEach(function(e){w(e)});var v=s([],r,!0);o(v)};if(d){var b=function(e){var n=e.touches[0];p(n.clientX)},y=function(){document.removeEventListener("touchmove",b),document.removeEventListener("touchend",y),i(!1)};document.addEventListener("touchmove",b),document.addEventListener("touchend",y)}else{var C=function(e){p(e.clientX)},S=function(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",S),i(!1)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",S)}}},je=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,x(n))},40),s=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-s;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/s),o=Math.max(n+t,r);e.width=o})},Ee=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},ke={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Ne=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},He=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ae=function(e){return["between","notBetween","in","notIn"].includes(e)},Me=function(e){return["isEmpty","isNotEmpty"].includes(e)},Fe=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},We=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Te=function(t){var r=t.value,i=t.onChange,a=t.options,s=t.placeholder,l=void 0===s?"Select...":s,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],g=n.useState(-1),m=g[0],w=g[1],x=n.useRef(null),b=a.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<a.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:a.length-1});break;case"Enter":e.preventDefault(),m>=0&&(i(a[m].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,m,a,i]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=a.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:b?b.label:l})),e.jsx(We,{})]})),e.jsx(F,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:a.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===m?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,i(e),p(!1),void w(-1);var e}},{children:n.label}),t)})}))}))]}))},De=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:ke[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Te,{value:t,onChange:function(e){r(e)},options:i})}))},Le=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,s=n.autoFocus,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c,d=n.onEnterPress;return e.jsx("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:l,className:"st-filter-input ".concat(u).trim()})},Be=function(n){var t=n.children,r=n.className,i=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(i).trim()},{children:t}))},Oe=function(n){var t=n.onApply,r=n.onClear,i=n.canApply,a=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Pe=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,s=t.onClearFilter,l=n.useState((null==i?void 0:i.operator)||"contains"),c=l[0],u=l[1],d=n.useState(String((null==i?void 0:i.value)||"")),f=d[0],h=d[1],v=Ne("string");n.useEffect(function(){i?(u(i.operator),h(String(i.value||""))):(u("contains"),h(""))},[i]);var p=function(){var e=o({accessor:r.accessor,operator:c},He(c)&&{value:f});a(e)},g=Me(c)||f.trim();return e.jsxs(Fe,{children:[e.jsx(De,{value:c,onChange:u,operators:v}),He(c)&&e.jsx(Be,{children:e.jsx(Le,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(Oe,{onApply:p,onClear:s,canApply:!!g,showClear:!!i})]})},qe=function(t){var r,o,i=t.header,a=t.currentFilter,s=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==a?void 0:a.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")),g=p[0],m=p[1],w=n.useState(String((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")),x=w[0],b=w[1],y=Ne("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),m(String((null===(e=a.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=a.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),m(""),b(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};He(u)?e.value=parseFloat(h):Ae(u)&&(e.values=[parseFloat(g.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(Fe,{children:[e.jsx(De,{value:u,onChange:d,operators:y}),He(u)&&e.jsx(Be,{children:e.jsx(Le,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Ae(u)&&e.jsxs(Be,{children:[e.jsx(Le,{type:"number",value:g,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(Le,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(Oe,{onApply:C,onClear:l,canApply:!!Me(u)||(He(u)?""!==h.trim():!!Ae(u)&&""!==String(g).trim()&&""!==String(x).trim()),showClear:!!a})]})},ze=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,s=n.placeholder;return e.jsx(Te,{value:t,onChange:r,options:o,className:a,placeholder:s})},Ye=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,s=n.useState((null==o?void 0:o.operator)||"equals"),l=s[0],c=s[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=Ne("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=Me(l)||""!==d;return e.jsxs(Fe,{children:[e.jsx(De,{value:l,onChange:c,operators:h}),He(l)&&e.jsx(Be,{children:e.jsx(ze,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Oe,{onApply:function(){var e={accessor:r.accessor,operator:l};He(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},Ge=function(t){var r,i,a=t.header,s=t.currentFilter,l=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==s?void 0:s.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==s?void 0:s.value)?String(s.value):""),v=h[0],p=h[1],g=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),m=g[0],w=g[1],x=n.useState(String((null===(i=null==s?void 0:s.values)||void 0===i?void 0:i[1])||"")),b=x[0],y=x[1],C=Ne("date");n.useEffect(function(){var e,n;s?(f(s.operator),p(String(s.value||"")),w(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),y(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),y(""))},[s]);var S=function(t){var r=t.value,i=t.onChange,a=t.placeholder,s=t.autoFocus,l=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=q(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){s&&p.current&&p.current.focus()},[s]);var g=r?q(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:a,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(l||""),style:{cursor:"pointer"}}),e.jsx(F,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(B,{value:g,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(Fe,{children:[e.jsx(De,{value:d,onChange:f,operators:C}),He(d)&&e.jsx(Be,{children:e.jsx(S,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Ae(d)&&e.jsxs(Be,{children:[e.jsx(S,{value:m,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(S,{value:b,onChange:y,placeholder:"To date..."})]}),e.jsx(Oe,{onApply:function(){var e={accessor:a.accessor,operator:d};He(d)?e.value=v:Ae(d)&&(e.values=[m,b]),l(e)},onClear:c,canApply:!!Me(d)||(He(d)?""!==v.trim():!!Ae(d)&&""!==m.trim()&&""!==b.trim()),showClear:!!s})]})},Ue=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==i?void 0:i.values)?i.values.map(String):u),f=d[0],h=d[1],v=n.useState(""),p=v[0],g=v[1],m=n.useMemo(function(){if(!p)return c;var e=p.toLowerCase();return c.filter(function(n){return n.label.toLowerCase().includes(e)})},[c,p]);n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var w=f.length===u.length,x=c.length>10;return e.jsxs(Fe,{children:[e.jsx(Be,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(he,o({checked:w,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),x&&e.jsx("div",o({className:"st-enum-search"},{children:e.jsx(Le,{type:"text",value:p,onChange:g,placeholder:"Search..."})})),m.map(function(n,t){return e.jsx(he,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):s(s([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===m.length&&e.jsx("div",o({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(Oe,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else l()},onClear:l,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},Ve=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Ye,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Ge,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(Ue,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Pe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Ke=function(t){var r,i,a=t.colIndex,l=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,f=t.gridRowStart,v=t.header,p=t.reverse,g=t.sort,m=n.useState(!1),w=m[0],x=m[1],b=n.useState(!1),y=b[0],C=b[1],S=n.useState(v.label||""),I=S[0],R=S[1],E=j(),k=E.activeHeaderDropdown,N=E.areAllRowsSelected,H=E.collapsedHeaders,A=E.columnBorders,M=E.columnReordering,W=E.columnResizing,T=E.columnsWithSelectedCells,L=E.draggedHeaderRef,B=E.enableHeaderEditing,O=E.enableRowSelection,P=E.filters,q=E.handleApplyFilter,z=E.handleClearFilter,Y=E.handleSelectAll,G=E.headerCollapseIcon,U=E.headerDropdown,V=E.headerExpandIcon,J=E.headerRegistry,X=E.headers,_=E.hoveredHeaderRef,$=E.onColumnOrderChange,Q=E.onColumnSelect,Z=E.onHeaderEdit,ee=E.onSort,ne=E.onTableHeaderDragEnd,re=E.headerHeight,oe=E.selectColumns,ie=E.selectableColumns,ae=E.selectedColumns,se=E.setActiveHeaderDropdown,le=E.setCollapsedHeaders,ce=E.setHeaders,ue=E.setInitialFocusedCell,fe=E.setIsResizing,ve=E.setSelectedCells,pe=E.setSelectedColumns,ge=E.sortDownIcon,me=E.sortUpIcon,we=Boolean(null==v?void 0:v.isSortable),xe=Boolean(null==v?void 0:v.filterable),be=P[v.accessor],ye=(null==k?void 0:k.accessor)===v.accessor,Ce=v.isSelectionColumn&&O,Se=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(v),Ie=H.has(v.accessor),je=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,s=e.margin,l=void 0===s?4:s,c=n.useRef(null),u=n.useState({}),d=u[0],f=u[1];return n.useEffect(function(){if(t&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,r=window.innerWidth-e.right,i="bottom",s={};o>n&&o<=t&&(i="top");var u="left";a>r+e.width&&(u="right"),"bottom"===i?s.top=e.bottom+l:s.bottom=window.innerHeight-e.top+l,"left"===u?s.left=e.left:s.right=window.innerWidth-e.right,f(s)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:c,position:d}}({isOpen:ye,estimatedHeight:200,estimatedWidth:250,margin:4}),ke=je.triggerRef,Ne=je.position,He=n.useMemo(function(){var e,n,t;if(!A)return!1;var r=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===v.accessor},[A,X,v.accessor,v.pinned]),Ae=n.useMemo(function(){return!(!ie||Ce)&&c(v,a).some(function(e){return ae.has(e)})},[ie,Ce,v,a,ae]),Me=n.useMemo(function(){return!Ce&&c(v,a).some(function(e){return T.has(e)})},[Ce,v,a,T]),Fe=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!Ie||v.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[v.children,Ie]),We="st-header-cell ".concat(v.accessor===(null===(r=_.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=L.current)||void 0===i?void 0:i.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(M&&!we?"columnReordering":""," ").concat(Fe?"parent":""," ").concat(He?"st-last-column":""," ").concat(B&&!Ce?"st-header-editable":""," ").concat(Ae?"st-header-selected":""," ").concat(Me&&!Ae?"st-header-has-highlighted-cell":""),Te=te({draggedHeaderRef:L,headers:X,hoveredHeaderRef:_,onColumnOrderChange:$,onTableHeaderDragEnd:ne}),De=Te.handleDragStart,Le=Te.handleDragEnd,Be=Te.handleDragOver,Oe=K();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=String(v.accessor);return J.set(e,{setEditing:function(e){C(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){R(v.label||"")},[v.label]);var Pe=n.useCallback(function(e){R(e);var n=X.map(function(n){return n.accessor===v.accessor?o(o({},n),{label:e}):n});ce(n),Z&&Z(v,e)},[X,ce,Z,v]),qe=n.useCallback(function(){se&&se(null)},[se]),ze=n.useCallback(function(e){e.stopPropagation(),le(function(e){var n=new Set(e);return Ie?n.delete(v.accessor):n.add(v.accessor),n})},[le,Ie,v.accessor]),Ye=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ie){var r=c(t,a),o=r.some(function(e){return ae.has(e)});if(B&&o&&!n.shiftKey)return U&&ye&&qe(),void C(!0);n.shiftKey&&oe?pe(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,l,c,u,d=s(s([],(a=o,l=n,c=Math.min(a,l),u=Math.max(a,l),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(s(s([],Array.from(e),!0),d,!0))}):oe&&oe(r),ve(new Set),ue(null)}Q&&Q(t),!ie&&t.isSortable&&ee(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)}},[]),!v)return null;var Ge=W&&!Ce&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:Re,callbackProps:{event:e.nativeEvent,gridColumnEnd:l,gridColumnStart:u,header:v,headers:X,setHeaders:ce,setIsResizing:fe,startWidth:t,collapsedHeaders:H},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:Re,callbackProps:{event:e,gridColumnEnd:l,gridColumnStart:u,header:v,headers:X,setHeaders:ce,setIsResizing:fe,startWidth:t,collapsedHeaders:H},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ue=g&&g.key.accessor===v.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return Ye({event:e,header:v})}},{children:["ascending"===g.direction&&me&&me,"descending"===g.direction&&ge&&ge]})),Ke=xe&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),x(!w)}},{children:[e.jsx(Ee,{className:"st-header-icon",style:{fill:be?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(F,o({open:w,overflow:"visible",setOpen:x,onClose:function(){return x(!1)}},{children:e.jsx(Ve,{header:v,currentFilter:be,onApplyFilter:function(e){q(e),x(!1)},onClearFilter:function(){z(v.accessor),x(!1)}})}))]})),Je=Se&&!Ce&&e.jsx("div",o({className:"st-icon-container st-collapse-icon-container",onClick:ze},{children:Ie?G:V}));return e.jsxs(de,o({className:We,id:h({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){Ce||Oe({callback:Be,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:o({gridRowStart:f,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:l},d-f>1?{}:{height:re})},{children:[p&&Ge,"right"===v.align&&Je,"right"===v.align&&Ke,"right"===v.align&&Ue,e.jsx("div",o({ref:ke,className:"st-header-label",draggable:M&&!v.disableReorder&&!Ce,onClick:function(e){Ce||Ye({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){e.event;var n=e.header;n.isSelectionColumn||ie&&n.isSortable&&ee(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),Le()},onDragStart:Ce?void 0:function(e){M&&v&&function(e){De(e)}(v)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(he,{checked:!!N&&N(),onChange:function(e){Y&&Y(e)}}):y?e.jsx(D,{defaultValue:I,onBlur:function(){return C(!1)},onChange:Pe}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:a,header:v}):I||(null==v?void 0:v.label)}))})),"right"!==v.align&&Ue,"right"!==v.align&&Ke,"right"!==v.align&&Je,!p&&Ge,U&&!Ce&&e.jsx("div",o({className:"st-header-dropdown-container"},{children:U({accessor:v.accessor,colIndex:a,header:v,isOpen:ye,onClose:qe,position:Ne})}))]}))},Je=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,c=t.pinned,u=t.sectionRef,d=t.sort,f=t.width,h=j().collapsedHeaders,p=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!v({header:o,pinned:c,headers:s,collapsedHeaders:h}))return 0;a||n++;var f=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return v({header:e,pinned:c,headers:s,collapsedHeaders:h})}).length)&&void 0!==d?d:0,p=n,g=f>0?p+f:p+1,m=i,w=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:p,gridColumnEnd:g,gridRowStart:m,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var x=!0;o.children.forEach(function(e){v({header:e,pinned:c,headers:s,collapsedHeaders:h})&&(t(e,i+1,x),x=!1)})}return g-p},o=s.filter(function(e){return v({header:e,pinned:c,headers:s,collapsedHeaders:h})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,c,r,h]),g=c?"pinned-".concat(c):"default";return e.jsx(ye,o({childRef:u,group:g},{children:e.jsx("div",o({className:"st-header-".concat(c?"pinned-".concat(c):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,width:f,position:"relative"}},{children:e.jsx(e.Fragment,{children:p.map(function(n){return e.jsx(Ke,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===c,sort:d},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},_e=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,h=t.pinnedLeftWidth,p=t.pinnedRightWidth,g=j(),m=g.headerContainerRef,w=g.pinnedLeftRef,x=g.pinnedRightRef,b=g.collapsedHeaders,y=n.useMemo(function(){return Se({headers:i,pinnedLeftColumns:l,pinnedRightColumns:u,collapsedHeaders:b})},[i,l,u,b]),C=n.useMemo(function(){var e=0,n=s(s(s([],l,!0),i,!0),u,!0);return i.forEach(function(t){if(v({header:t,headers:n,collapsedHeaders:b})){var r=Xe(t);e=Math.max(e,r)}}),{maxDepth:e}},[i,l,u,b]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:m},{children:[_(i,"left")&&e.jsx(Je,{columnIndices:y,gridTemplateColumns:c,handleScroll:void 0,headers:i,maxDepth:C,pinned:"left",sectionRef:w,sort:f,width:h}),e.jsx(Je,{columnIndices:y,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:C,sectionRef:r,sort:f}),_(i,"right")&&e.jsx(Je,{columnIndices:y,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:C,pinned:"right",sectionRef:x,sort:f,width:p})]}))},$e=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});r({headers:i,flattenedHeaders:o})}else 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(" "))},Qe=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=j(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=u.collapsedHeaders,p=n.useRef(null),g=h.filter(function(e){return!e.pinned}),m=h.filter(function(e){return"left"===e.pinned}),w=h.filter(function(e){return"right"===e.pinned}),x=n.useMemo(function(){return $e({headers:m,collapsedHeaders:v})},[m,v]),b=n.useMemo(function(){return $e({headers:g,collapsedHeaders:v})},[g,v]),y=n.useMemo(function(){return $e({headers:w,collapsedHeaders:v})},[w,v]),C={centerHeaderRef:p,headers:h,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedRightColumns:w,pinnedRightTemplateColumns:y,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},S={tableRows:l,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedLeftWidth:r,pinnedRightColumns:w,pinnedRightTemplateColumns:y,pinnedRightWidth:i,setScrollTop:a,rowsToRender:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(_e,o({},C)),e.jsx(Ie,o({},S))]}))},Ze=function(t){var r=t.mainBodyWidth,i=t.mainBodyRef,a=t.pinnedLeftWidth,s=t.pinnedRightWidth,l=t.pinnedLeftContentWidth,c=t.pinnedRightContentWidth,u=t.tableBodyContainerRef,d=j().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),g=n.useRef(null),m=n.useRef(null),w=u.current&&u.current.scrollHeight>u.current.clientHeight,x=d?28:0,b=(d?s+1:s)+(u.current&&w?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(i.current){var e=i.current.clientWidth;v(r>e)}}()},1)},[i,r]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[a>0&&e.jsx(ye,o({childRef:g,group:"pinned-left"},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-left",ref:g,style:{width:a}},{children:e.jsx("div",{style:{width:l}})}))})),r>0&&e.jsx(ye,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p},{children:e.jsx("div",{style:{width:r}})}))})),s>0&&e.jsx(ye,o({childRef:m,group:"pinned-right"},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-right",ref:m,style:{width:b}},{children:e.jsx("div",{style:{width:c}})}))})),x>0&&e.jsx("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},en={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 en.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?en.string(e,n,t):"number"==typeof e&&"number"==typeof n?en.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?en.boolean(e,n,t):en.string(String(e),String(n),t)}},nn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return s([],n,!0).sort(function(e,n){var r=t.key.accessor;return 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 en.number(i,a,r)}return"date"===t?en.date(String(e),String(n),r):"boolean"===t?en.boolean(Boolean(e),Boolean(n),r):"enum"===t?en.enum(String(e),String(n),r):en.string(String(e),String(n),r)}(e[r],n[r],a,l)})},tn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return nn({rows:t,sortColumn:r,headers:n})},rn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):tn({headers:i,rows:t,sortColumn:r}):t},on=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),s=!1;if(!a)for(var l=0,c=i.children;l<c.length;l++){var u=c[l];if(on([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},an=function(e){return e.every(function(e){return e.hide})},sn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(sn(e.children),an(e.children)&&(e.hide=!0))})},ln=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=j(),p=v.expandIcon,g=v.headers,m=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,b=null!=u?u:c.hide||x&&c.children&&an(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[l&&e.jsx("div",o({className:"st-header-icon-container"},{children:x?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(he,o({checked:b,onChange:function(e){(c.hide=e,e)?sn(r):(on(r,c.accessor),x&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,on(r,c.children[0].accessor)));m(s([],g,!0))}},{children:c.label}))]})),x&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(ln,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!b||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},cn=function(t){var r=t.headers,i=t.open,a="left"===t.position?"left":"",s=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(i?"open":""," ").concat(a),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn?null:e.jsx(ln,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},un=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,s=t.headers,l=t.position,c=void 0===l?"right":l,u=n.useState(a),d=u[0],f=u[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(cn,{headers:s,open:d,position:c})]})):null},dn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",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"})}))},fn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",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"})}))},hn=function(t){var i=t.children,a=n.useRef({}),s=n.useCallback(function(e,n){return!!a.current[n]&&a.current[n].find(function(n){return n===e})},[]),l=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=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=a.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),l(e,n),window.requestAnimationFrame(function(){var e=Object.keys(a.current).filter(function(e){return a.current[e].includes(n)});u(n,e)}))})})})}},[c,l]),d=n.useCallback(function(e,n){n.forEach(function(n){a.current[n]||(a.current[n]=[]),s(e,n)||(a.current[n].length>0&&l(a.current[n][0],e),a.current[n].push(e))}),u(e,n)},[s,l,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(s(e,n)){c(e);var t=a.current[n].indexOf(e);-1!==t&&a.current[n].splice(t,1)}})},[s,c]);return e.jsx(be.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},vn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=ke[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},pn=function(){var n=j(),t=n.filters,r=n.handleClearFilter,i=n.headers,a=Object.values(t);return 0===a.length||a.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:a.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:vn(n,i)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},gn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var s=Number(e),l=Number(r);switch(t){case"equals":return s===l;case"notEquals":return s!==l;case"greaterThan":return s>l;case"lessThan":return s<l;case"greaterThanOrEqual":return s>=l;case"lessThanOrEqual":return s<=l;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return s>=u&&s<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],s<u||s>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=q(e),v=q(String(r||"")),p=P(h),g=P(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var m=o.map(function(e){return P(q(String(e||"")))}),w=m[0],x=m[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return P(q(String(e||"")))});return w=b[0],x=b[1],p<w||p>x}return!0}}if("boolean"==typeof e){var y=Boolean(r);if("equals"===t)return e===y}if(Array.isArray(e)){var C=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),I=o.includes(S);return"in"===t?I:!I}return!1}var R=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return R===j;case"notEquals":return R!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},mn=function(e){var t=e.rows,r=e.headers,i=e.rowGrouping;return n.useMemo(function(){if(!i||0===i.length)return t;var e=function(e){return u(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),a=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=i[t],s=i[t+1],l=n[r];if(l&&b(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=wn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},wn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&b(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,s=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===s.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=s.reduce(function(e,n){return e+n},0);break;case"average":a=s.reduce(function(e,n){return e+n},0)/s.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,s);break;case"max":a=Math.max.apply(Math,s);break;default:return}return t.formatResult?t.formatResult(a):a}},xn=function(e){if(null==e)return"";var n=String(e);if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},bn=function(e,n,t){var r=function(e,n){var t=function(e){var n=[],t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?t(i.children):n.push(i))}};return t(e),n}(n);return s([t.map(function(e){return xn(e.label)}).join(",")],e.map(function(e){var n=e.row;return t.map(function(e){var t=n[e.accessor];return xn(t)}).join(",")}),!0).join("\n")}(e,n);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(r,t)},yn=function(e){var t=e.rows,r=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,s=n.useState(new Set),l=s[0],c=s[1],u=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(t,r,l)},[t,r,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),h=n.useMemo(function(){return a?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(t,r,l):[]},[t,r,l,a]),v=n.useCallback(function(e,n){if(a){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,l);if(c(i),o){var s=t.find(function(n){return String(n[r])===e});s&&o({row:s,isSelected:n,selectedRows:i})}}},[l,t,r,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(t,r),o&&t.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=t.find(function(n){return String(n[r])===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[t,r,o,l,a]),g=n.useCallback(function(e){if(a){var n=u(e);v(e,!n)}},[u,v,a]),m=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=t.find(function(e){return String(e[r])===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,t,r,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:u,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:h,handleRowSelect:v,handleSelectAll:p,handleToggleRow:g,clearSelection:m}},Cn=function(t){var r=t.allowAnimations,c=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.className,v=t.columnBorders,w=void 0!==v&&v,x=t.columnEditorPosition,I=void 0===x?"right":x,j=t.columnEditorText,A=void 0===j?"Columns":j,M=t.columnReordering,F=void 0!==M&&M,W=t.columnResizing,T=void 0!==W&&W,D=t.defaultHeaders,L=t.editColumns,B=void 0!==L&&L,O=t.editColumnsInitOpen,P=void 0!==O&&O,q=t.enableHeaderEditing,z=void 0!==q&&q,Y=t.enableRowSelection,G=void 0!==Y&&Y,U=t.expandAll,V=void 0===U||U,K=t.expandIcon,X=void 0===K?e.jsx(N,{className:"st-expand-icon"}):K,_=t.externalFilterHandling,$=void 0!==_&&_,Q=t.externalSortHandling,Z=void 0!==Q&&Q,ee=t.headerCollapseIcon,ne=void 0===ee?e.jsx(N,{className:"st-header-icon"}):ee,te=t.headerExpandIcon,re=void 0===te?e.jsx(k,{className:"st-header-icon"}):te,oe=t.headerDropdown,ae=t.headerHeight,se=t.height,le=t.hideFooter,ce=void 0!==le&&le,ue=t.nextIcon,de=void 0===ue?e.jsx(N,{className:"st-next-prev-icon"}):ue,fe=t.onCellEdit,he=t.onCellClick,ve=t.onColumnOrderChange,pe=t.onColumnSelect,ge=t.onFilterChange,me=t.onGridReady,we=t.onHeaderEdit,xe=t.onLoadMore,be=t.onNextPage,ye=t.onRowSelectionChange,Ce=t.onSortChange,Se=t.prevIcon,Ie=void 0===Se?e.jsx(k,{className:"st-next-prev-icon"}):Se,Re=t.rowButtons,je=t.rowGrouping,Ee=t.rowHeight,ke=void 0===Ee?32:Ee,Ne=t.rowIdAccessor,He=t.rows,Ae=t.selectionColumnWidth,Me=void 0===Ae?42:Ae,Fe=t.rowsPerPage,We=void 0===Fe?10:Fe,Te=t.selectableCells,De=void 0!==Te&&Te,Le=t.selectableColumns,Be=void 0!==Le&&Le,Oe=t.shouldPaginate,Pe=void 0!==Oe&&Oe,qe=t.sortDownIcon,ze=void 0===qe?e.jsx(dn,{className:"st-header-icon"}):qe,Ye=t.sortUpIcon,Ge=void 0===Ye?e.jsx(fn,{className:"st-header-icon"}):Ye,Ue=t.tableRef,Ve=t.theme,Ke=void 0===Ve?"light":Ve,Je=t.useHoverRowBackground,Xe=void 0===Je||Je,_e=t.useOddEvenRowBackground,$e=void 0!==_e&&_e,en=t.useOddColumnBackground,nn=void 0!==en&&en;nn&&($e=!1),w&&(Xe=!1);var on=n.useReducer(function(e){return e+1},0)[1],an=n.useRef(null),sn=n.useRef(null),ln=n.useRef(null),cn=n.useRef(null),vn=n.useRef(null),wn=n.useRef(null),xn=n.useRef(null),Cn=n.useState(1),Sn=Cn[0],In=Cn[1],Rn=n.useState(D),jn=Rn[0],En=Rn[1],kn=n.useState(!1),Nn=kn[0],Hn=kn[1],An=n.useState(!1),Mn=An[0],Fn=An[1],Wn=n.useState(null),Tn=Wn[0],Dn=Wn[1],Ln=n.useState(new Set),Bn=Ln[0],On=Ln[1];n.useEffect(function(){En(D)},[D]);var Pn=yn({rows:He,rowIdAccessor:Ne,onRowSelectionChange:ye,enableRowSelection:G}),qn=Pn.selectedRows,zn=Pn.setSelectedRows,Yn=Pn.isRowSelected,Gn=Pn.areAllRowsSelected,Un=Pn.selectedRowCount,Vn=Pn.selectedRowsData,Kn=Pn.handleRowSelect,Jn=Pn.handleSelectAll,Xn=Pn.handleToggleRow,_n=Pn.clearSelection,$n=n.useMemo(function(){var e,n=s([],jn,!0);G&&!(null===(e=null==jn?void 0:jn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=s([{accessor:"__row_selection__",label:"",width:Me,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[G,jn,Me]),Qn=n.useState(0),Zn=Qn[0],et=Qn[1],nt=n.useState(new Set),tt=nt[0],rt=nt[1],ot=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){if(t.current){var e=t.current.offsetWidth-t.current.clientWidth;i(e)}},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:wn}),it=ot.scrollbarWidth,at=ot.setScrollbarWidth,st=n.useState(0),lt=st[0],ct=st[1];n.useLayoutEffect(function(){var e=function(){wn.current&&ct(wn.current.clientWidth)};e();var n=null;return wn.current&&(n=new ResizeObserver(e)).observe(wn.current),function(){n&&n.disconnect()}},[]);var ut=n.useMemo(function(){var e=l(window.innerWidth),n=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,s=0,l=0;n.forEach(function(e){if(!e.hide){var n=g(e,i).reduce(function(e,n){return e+m(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?s+=n:l+=n}});var c=a,u=s;if(t&&t>0){var f=t*o;a>f&&(a=f),s>f&&(s=f)}return{leftWidth:d(a),rightWidth:d(s),mainWidth:l,leftContentWidth:c,rightContentWidth:u}}({headers:$n,containerWidth:lt,maxPinnedWidthPercent:e,collapsedHeaders:Bn});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[$n,lt,Bn]),dt=ut.mainBodyWidth,ft=ut.pinnedLeftWidth,ht=ut.pinnedRightWidth,vt=ut.pinnedLeftContentWidth,pt=ut.pinnedRightContentWidth,gt=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var i=parseInt(t,10);o=window.innerHeight*i/100}else if(t.endsWith("%")){var a=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-r)},[t,r])}({height:se,rowHeight:ke}),mt=mn({rows:He,headers:jn,rowGrouping:je}),wt=function(e){var t=e.rows,r=e.externalFilterHandling,i=e.onFilterChange,a=n.useState({}),s=a[0],l=a[1],c=n.useMemo(function(){return gn({externalFilterHandling:r,tableRows:t,filterState:s})},[t,s,r]),u=n.useCallback(function(e){var n,t=o(o({},s),((n={})[e.accessor]=e,n));l(t),null==i||i(t)},[s,i]),d=n.useCallback(function(e){var n=o({},s);delete n[e],l(n),null==i||i(n)},[s,i]),f=n.useCallback(function(){l({}),null==i||i({})},[i]),h=n.useCallback(function(e){var n,i=o(o({},s),((n={})[e.accessor]=e,n));return gn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:mt,externalFilterHandling:$,onFilterChange:ge}),xt=wt.filters,bt=wt.filteredRows,yt=wt.updateFilter,Ct=wt.clearFilter,St=wt.clearAllFilters,It=wt.computeFilteredRowsPreview,Rt=function(e){var t=e.headers,r=e.tableRows,i=e.externalSortHandling,a=e.onSortChange,s=e.rowGrouping,l=n.useState(null),c=l[0],u=l[1],d=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,i=e.sortColumn,a=tn({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(b(s)){var l=d({rows:s,sortColumn:i,headers:t,groupingKeys:n.slice(1)});return o(o({},e),((r={})[a]=l,r))}return e}):a},[]),f=n.useMemo(function(){return rn({externalSortHandling:i,tableRows:r,sortColumn:c,rowGrouping:s,headers:t,sortNestedRows:d})},[r,c,t,i,s,d]),h=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},r=n(t);if(r){var o=null;c&&c.key.accessor===e?"ascending"===c.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},u(o),null==a||a(o)}},[c,t,a]),v=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},o=n(t);if(!o)return r;var a=null;return c&&c.key.accessor===e?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},rn({externalSortHandling:i,tableRows:r,sortColumn:a,rowGrouping:s,headers:t,sortNestedRows:d})},[c,t,r,i,s,d]);return{sort:c,sortedRows:f,updateSort:h,computeSortedRowsPreview:v}}({headers:jn,tableRows:bt,externalSortHandling:Z,onSortChange:Ce,rowGrouping:je}),jt=Rt.sort,Et=Rt.sortedRows,kt=Rt.updateSort,Nt=function(e){var t=e.allowAnimations,r=e.sortedRows,i=e.originalRows,a=e.currentPage,l=e.rowsPerPage,c=e.shouldPaginate,u=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,h=e.expandAll,v=e.contentHeight,p=e.rowHeight,g=e.scrollTop,m=e.computeFilteredRowsPreview,w=e.computeSortedRowsPreview,x=n.useState(!1),b=x[0],S=x[1],I=n.useState([]),R=I[0],j=I[1],E=n.useRef([]),k=n.useRef([]),N=n.useRef(new Map),A=n.useRef(null),M=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?C({rows:n,rowGrouping:u,rowIdAccessor:d,unexpandedRows:f,expandAll:h}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[a,l,c,u,d,f,h]);n.useMemo(function(){if(0===N.current.size){var e=M(i),n=new Map;e.forEach(function(e){var t=String(y({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),N.current=n}},[i,M,d]);var F=n.useMemo(function(){return M(r)},[r,M]),W=n.useMemo(function(){return H({bufferRowCount:5,contentHeight:v,tableRows:F,rowHeight:p,scrollTop:g})},[F,v,p,g]),T=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),D=n.useMemo(function(){if(0===E.current.length)return!1;var e=F.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}),n=E.current.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[F,d]);n.useLayoutEffect(function(){if(!b){if(!t||c)return j([]),E.current=F,void(k.current=W);if(0===E.current.length)return j([]),E.current=F,void(k.current=W);if(!D)return j([]),E.current=F,void(k.current=W);A.current={tableRows:F,visibleRows:W},S(!0)}},[t,F,D,b,c,W]),n.useLayoutEffect(function(){if(b&&A.current&&R.length>0){var e=setTimeout(function(){var e=A.current;S(!1),j([]),E.current=e.tableRows,k.current=e.visibleRows,A.current=null},ie.duration+100);return function(){return clearTimeout(e)}}},[b,R.length]);var L=n.useMemo(function(){if(!t||c)return W;if(R.length>0){var e=new Map;return F.forEach(function(n){var t=String(y({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),R.map(function(n){var t=String(y({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return W},[W,R,F,t,c,d]),B=n.useCallback(function(e){if(t&&!c){var n=m(e),r=M(n),o=H({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:g}),i=T(W,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return F.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],W,!0),i,!0))}},[t,c,m,M,v,p,g,T,F,W,d]),O=n.useCallback(function(e){if(t&&!c){var n=w(e),r=M(n),o=H({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:g}),i=T(W,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return F.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],W,!0),i,!0))}},[t,c,w,M,v,p,g,T,F,W,d]);return{currentTableRows:F,currentVisibleRows:W,isAnimating:b,prepareForFilterChange:B,prepareForSortChange:O,rowsToRender:L}}({allowAnimations:c,sortedRows:Et,originalRows:mt,currentPage:Sn,rowsPerPage:We,shouldPaginate:Pe,rowGrouping:je,rowIdAccessor:Ne,unexpandedRows:tt,expandAll:V,contentHeight:gt,rowHeight:ke,scrollTop:Zn,computeFilteredRowsPreview:It,computeSortedRowsPreview:Rt.computeSortedRowsPreview}),Ht=Nt.currentTableRows,At=Nt.rowsToRender,Mt=Nt.prepareForFilterChange,Ft=Nt.prepareForSortChange,Wt=Nt.isAnimating,Tt=n.useRef(new Map),Dt=n.useRef(new Map),Lt=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=e.collapsedHeaders,d=n.useState(new Set),f=d[0],h=d[1],v=n.useState(new Set),p=v[0],m=v[1],w=n.useState(null),x=w[0],b=w[1],C=n.useState(null),I=C[0],R=C[1],j=n.useState(new Set),E=j[0],k=j[1],N=n.useState(new Set),H=N[0],A=N[1],M=n.useRef(!1),F=n.useRef(null),W=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),p.forEach(function(n){e.add(n)}),e},[f,p]),T=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),p.size>0&&o.forEach(function(n){var t=y({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[f,p,o,s]),D=n.useMemo(function(){return r.flatMap(function(e){return g(e,u)})},[r,u]),L=n.useCallback(function(){var e=D.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,i=t.split("-").map(Number),a=i[0],s=i[1];e[a]||(e[a]=[]);var l=n.get(s);return l&&(null===(r=o[a])||void 0===r?void 0:r.row)?e[a][s]=o[a].row[l]:e[a][s]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),k(new Set(f)),setTimeout(function(){k(new Set)},800))},[D,f,o]),B=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,u,d,f;return a(this,function(a){switch(a.label){case 0:if(!I)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=D.filter(function(e){return!e.hide}),r=new Set,i=new Set,u=I.rowIndex,d=I.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,a){var f=u+n,h=d+a;if(!(f>=o.length||h>=t.length)){var v=o[f],p=t[h],g=y({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var w=Number(e);isNaN(w)||(m=w)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var x=new Date(e);isNaN(x.getTime())||(m=x)}if(v.row[p.accessor]=m,c){var b="".concat(g,"-").concat(p.accessor),C=c.get(b);C&&C.updateContent(m)}null==l||l({accessor:p.accessor,newValue:m,row:v.row,rowIndex:f});var I=S({colIndex:h,rowIndex:f,rowId:g});r.add(I)}else{var R=S({colIndex:h,rowIndex:f,rowId:g});i.add(R)}}})}),r.size>0&&(k(r),setTimeout(function(){k(new Set)},800)),i.size>0&&(A(i),setTimeout(function(){A(new Set)},800)),[3,4]):[2];case 3:return f=a.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[I,D,o,s,l,c]),O=n.useCallback(function(){if(0!==f.size){var e=D.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],u=i[1];if(!(a>=o.length||u>=e.length)){var d=o[a],f=e[u],h=y({row:d.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),d.row[f.accessor]=v,c){var p="".concat(h,"-").concat(f.accessor),g=c.get(p);g&&g.updateContent(v)}null==l||l({accessor:f.accessor,newValue:v,row:d.row,rowIndex:a}),t.add(n)}else r.add(n)}}),t.size>0&&(k(t),setTimeout(function(){k(new Set)},800)),r.size>0&&(A(r),setTimeout(function(){A(new Set)},800))}},[f,D,o,s,l,c]),P=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),l=Math.max(e.colIndex,n.colIndex),c=r;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<o.length){var d=y({row:o[c].row,rowIdAccessor:s});t.add(S({colIndex:u,rowIndex:c,rowId:d}))}m(new Set),b(null),h(t)},[o,s,m,b,h]),q=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<D.length){var n=S(e);m(new Set),b(null),h(new Set([n])),R(e)}},[D.length,o.length,m,b,h,R]),z=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),R(null),m(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&b(e[e.length-1])},[h,R,m,b]);n.useEffect(function(){var e=function(e){var n;if(t&&I){var r=I.rowIndex,i=I.colIndex,a=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void B();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void O();if(y({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return y({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=y({row:o[r-1].row,rowIdAccessor:s});q({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=y({row:o[r+1].row,rowIdAccessor:s}),q({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<D.length-1&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),m(new Set),b(null),F.current=null,R(null))}else L()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[L,D.length,I,s,P,q,t,o,B,O]);var Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=S({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=p.has(n);return i||a},[f,p]),G=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?y({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?y({row:o[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!Y(c)||p.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!Y(u)||p.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),Y(d)||i.push("st-selected-left-border"),Y(f)||i.push("st-selected-right-border"),i.join(" ")},[Y,o,p,s]),U=n.useMemo(function(){return I?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===I.rowIndex&&t===I.colIndex&&r===I.rowId}:function(){return!1}},[I]),V=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=S({colIndex:n,rowIndex:t,rowId:r});return E.has(o)},[E]),K=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=S({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]);return{getBorderClass:G,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(M.current=!0,F.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){m(new Set),b(null);var e=S({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),R({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&M.current&&F.current){for(var i=new Set,a=Math.min(F.current.rowIndex,r),l=Math.max(F.current.rowIndex,r),c=Math.min(F.current.colIndex,n),u=Math.max(F.current.colIndex,n),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var v=y({row:o[d].row,rowIdAccessor:s});i.add(S({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){M.current=!1},isCopyFlashing:V,isWarningFlashing:K,isInitialFocusedCell:U,isSelected:Y,lastSelectedColumnIndex:x,pasteFromClipboard:B,selectColumns:z,selectedCells:f,selectedColumns:p,setInitialFocusedCell:R,setSelectedCells:h,setSelectedColumns:m,deleteSelectedCells:O,columnsWithSelectedCells:W,rowsWithSelectedCells:T}}({selectableCells:De,headers:jn,tableRows:Ht,rowIdAccessor:Ne,onCellEdit:fe,cellRegistry:Tt.current,collapsedHeaders:Bn}),Bt=Lt.getBorderClass,Ot=Lt.handleMouseDown,Pt=Lt.handleMouseOver,qt=Lt.handleMouseUp,zt=Lt.isCopyFlashing,Yt=Lt.isInitialFocusedCell,Gt=Lt.isSelected,Ut=Lt.isWarningFlashing,Vt=Lt.selectColumns,Kt=Lt.selectedCells,Jt=Lt.selectedColumns,Xt=Lt.setInitialFocusedCell,_t=Lt.setSelectedCells,$t=Lt.setSelectedColumns,Qt=Lt.columnsWithSelectedCells,Zt=Lt.rowsWithSelectedCells,er=n.useCallback(function(e){Ft(e),setTimeout(function(){kt(e)},0)},[Ft,kt]),nr=n.useCallback(function(e){En(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,s=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(s&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,s,l])}({selectableColumns:Be,selectedCells:Kt,selectedColumns:Jt,setSelectedCells:_t,setSelectedColumns:$t,activeHeaderDropdown:Tn,setActiveHeaderDropdown:Dn}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:on,tableBodyContainerRef:wn,setScrollbarWidth:at}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:me}),function(e){var t=e.cellRegistryRef,r=e.currentTableRows,o=e.headerRegistryRef,i=e.headers,a=e.rowIdAccessor,s=e.rows,l=e.tableRef,c=e.visibleRows;n.useEffect(function(){l&&(l.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==s?void 0:s[r];if(i){var l=y({row:i,rowIdAccessor:a}),c=p({rowId:l,accessor:n}),u=t.current.get(c);u&&u.updateContent(o),void 0!==i[n]&&(i[n]=o)}},setHeaderRename:function(e){var n=e.accessor,t=o.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return c},exportToCSV:function(e){var n=(void 0===e?{}:e).filename;bn(r,i,n)}})},[t,o,s,a,l,c,i])}({cellRegistryRef:Tt,currentTableRows:Ht,headerRegistryRef:Dt,headers:$n,rowIdAccessor:Ne,rows:He,tableRef:Ue,visibleRows:At}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:xt,onFilterChange:ge}),function(e){var t=e.sort,r=e.onSortChange,o=J(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:jt,onSortChange:Ce});var tr=n.useCallback(function(e){Mt(e),setTimeout(function(){yt(e)},0)},[Mt,yt]);return e.jsx(R,o({value:{allowAnimations:c,areAllRowsSelected:Gn,cellRegistry:Tt.current,cellUpdateFlash:f,clearSelection:_n,collapsedHeaders:Bn,columnBorders:w,columnReordering:F,columnResizing:T,draggedHeaderRef:an,editColumns:B,enableHeaderEditing:z,enableRowSelection:G,expandIcon:X,filters:xt,forceUpdate:on,getBorderClass:Bt,handleApplyFilter:tr,handleClearAllFilters:St,handleClearFilter:Ct,handleMouseDown:Ot,handleMouseOver:Pt,handleRowSelect:Kn,handleSelectAll:Jn,handleToggleRow:Xn,headerCollapseIcon:ne,headerContainerRef:xn,headerDropdown:oe,headerExpandIcon:re,headerRegistry:Dt.current,headers:$n,hoveredHeaderRef:sn,isAnimating:Wt,isCopyFlashing:zt,isInitialFocusedCell:Yt,isResizing:Nn,isRowSelected:Yn,isScrolling:Mn,isSelected:Gt,isWarningFlashing:Ut,mainBodyRef:ln,nextIcon:de,onCellEdit:fe,onCellClick:he,onColumnOrderChange:ve,onColumnSelect:pe,onLoadMore:xe,onSort:er,onTableHeaderDragEnd:nr,pinnedLeftRef:cn,pinnedRightRef:vn,prevIcon:Ie,rowButtons:Re,rowGrouping:je,rowHeight:ke,headerHeight:null!=ae?ae:ke,rowIdAccessor:Ne,scrollbarWidth:it,selectColumns:Vt,selectableColumns:Be,selectedColumns:Jt,columnsWithSelectedCells:Qt,rowsWithSelectedCells:Zt,selectedRows:qn,selectedRowCount:Un,selectedRowsData:Vn,setCollapsedHeaders:On,setHeaders:En,setInitialFocusedCell:Xt,setIsResizing:Hn,setIsScrolling:Fn,setSelectedCells:_t,setSelectedColumns:$t,setSelectedRows:zn,setUnexpandedRows:rt,shouldPaginate:Pe,sortDownIcon:ze,sortUpIcon:Ge,tableBodyContainerRef:wn,tableRows:Ht,theme:Ke,unexpandedRows:tt,useHoverRowBackground:Xe,useOddColumnBackground:nn,useOddEvenRowBackground:$e,activeHeaderDropdown:Tn,setActiveHeaderDropdown:Dn,onHeaderEdit:we}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(Ke," ").concat(null!=h?h:""," ").concat(w?"st-column-borders":""),style:se?{height:se}:{}},{children:e.jsx(hn,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(pn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:qt,onMouseLeave:qt},{children:[e.jsx(Qe,{pinnedLeftWidth:ft,pinnedRightWidth:ht,setScrollTop:et,sort:jt,tableRows:Ht,rowsToRender:At}),e.jsx(un,{columnEditorText:A,editColumns:B,editColumnsInitOpen:P,headers:jn,position:I})]})),e.jsx(Ze,{mainBodyRef:ln,mainBodyWidth:dt,pinnedLeftWidth:ft,pinnedRightWidth:ht,pinnedLeftContentWidth:vt,pinnedRightContentWidth:pt,tableBodyContainerRef:wn}),e.jsx(E,{currentPage:Sn,hideFooter:ce,onPageChange:In,onNextPage:be,shouldPaginate:Pe,totalPages:Math.ceil(Et.length/We)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(Cn,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{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,s)}l((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=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function s(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 l=function(e){return e<480?.3:e<768?.4:.8},c=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 s=a[i];o=r(s,o)}return o};return r(e,n),t},u=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,u(e.children)),n})},d=function(e){return void 0===e&&(e=0),e?e+1:0},f=function(e,n,t){var r=function(e,n){for(var t=0,r=u(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)},h=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},v=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&f(n,r,o))||null},p=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},g=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return g(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return g(e,n)}):[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(h({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},w=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(h({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){w(e)})},x=function(e){return"number"==typeof e.minWidth?e.minWidth:40},b=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},y=function(e){return e.row[e.rowIdAccessor]},C=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,s=void 0===a?[]:a,l=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var c=y({row:t,rowIdAccessor:l}),f=s[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(c);if((o?!i.has(v):i.has(v))&&n<s.length){var p=function(e,n){var t=e[n];return b(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(c,t),u},S=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},I=n.createContext(void 0),R=function(n){var t=n.children,r=n.value;return e.jsx(I.Provider,o({value:r},{children:t}))},j=function(){var e=n.useContext(I);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},E=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=j(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),g=p[0],m=p[1],w=!(r>1),x=!(r<d)&&!c||!g&&r===d;if(s||!u)return null;var b=function(){if(d<=15)return Array.from({length:d},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>=d-Math.floor(7.5))e=Math.max(1,d-o+1),n=d;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<d-1&&(t.push(-1),t.push(d)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&l(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"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===d,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<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),b.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<=d&&l(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},k=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"})}))},N=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"})}))},H=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,s=Math.max(0,o-a*n),l=o+t+a*n,c=Math.max(0,Math.floor(s/a)),u=Math.min(i.length,Math.ceil(l/a));return i.slice(c,u)},A=function(e){return e.position*(e.rowHeight+1)-1},M=function(e){return e.position*(e.rowHeight+1)},F=function(t){var r=t.children,i=t.onClose,a=t.open,s=t.overflow,l=void 0===s?"auto":s,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=j().mainBodyRef,p=n.useRef(null),g=n.useRef(null),m=n.useState("bottom-left"),w=m[0],x=m[1],b=n.useState({}),y=b[0],C=b[1],S=n.useState(!1),I=S[0],R=S[1];return n.useEffect(function(){a&&p.current?(R(!1),!g.current&&p.current.parentElement&&(g.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&g.current){var e,n=p.current,t=g.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,i=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.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,s="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(s="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===s?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===c?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===s?l.top=t.height+4:l.bottom=t.height+4,"left"===c?l.left=0:l.right=0),x("".concat(s,"-").concat(c)),C(l),R(!0)}})):a||R(!1)},[a,u,d,v,h]),n.useEffect(function(){var e=function(e){if(a&&p.current){var n=e.target;p.current&&!p.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){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.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:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:I?"visible":"hidden"},y),{overflow:l})},{children:r})):null},W=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,s=n.disabled,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(l?"disabled":""," ").concat(u),onClick:function(){!l&&r&&r()},role:"option","aria-selected":a,"aria-disabled":l},{children:t}))},T=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value,c=n.useState(l),u=c[0],d=c[1],f=function(e){d(e),i(e),s(!1),r()};return e.jsxs(F,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(W,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(W,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},D=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},L=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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},B=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=j(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),g=p[0],m=p[1],w=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(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return m("months")}},{children:[(i=h,i.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return m("years")}},{children:h.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=h.getFullYear(),r=h.getMonth(),i=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(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 d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e,12,0,0);v(n),a(n),null==s||s()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(i){var c=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=new Date(l),d=i===u.getDate()&&r===u.getMonth()&&t===u.getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(d?"selected":""),onClick:function(){return function(e){var n=h.getFullYear(),t=h.getMonth(),r=new Date(n,t,e,12,0,0);v(r),a(r),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)p(g);var m=35-(c+i),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e,12,0,0);v(n),a(n),null==s||s()}(t)}},{children:t}),"next-".concat(t)))};for(g=1;g<=m;g++)x(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===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),m("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===g&&function(){for(var n=[],t=h.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,h.getMonth(),1)),m("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,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);v(n),a(n),null==s||s()}},{children:"Today"}))}))]}))},O=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},P=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},q=function(e){if(!e)return new Date;if("string"==typeof e)return O(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:P(n)}return e instanceof Date?P(e):new Date},z=function(e){return e?O(e.toString()):new Date},Y=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value;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 c=function(){r()};return e.jsx(F,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(B,{value:z(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},G=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.options,l=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(F,o({open:a,onClose:function(){r()},setOpen:l,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:s.map(function(n){return e.jsx(W,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),i(e),l(!1),void r();var e}},{children:n.label}),n.value)})}))}))},U=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,s=void 0===a?"string":a,l=n.value,c=function(){i(!1)};if("boolean"===s&&"boolean"==typeof l)return e.jsx(T,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(Y,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(G,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(L,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==l?"":String(l);return e.jsx(D,{defaultValue:d,onBlur:c,onChange:o})},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))}},J=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},X=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(X);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=X(e[t]));return n},_=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},$=Date.now(),Q={screenX:0,screenY:0},Z=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 s(s([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Z(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},ee=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ne(e,n,t){var r,i,a=X(e),s=!1;try{var l=ee(t),c=a.findIndex(function(e){return e.accessor===n.accessor}),u=a.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:a,emergencyBreak:s=!0};var d=a.splice(c,1)[0],f=(r=l,i=o({},d),"left"===r?i.pinned="left":"right"===r?i.pinned="right":delete i.pinned,i),h=u;a.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),s=!0}return{newHeaders:a,emergencyBreak:s}}var te=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=j().setHeaders,l=J(t);return{handleDragStart:function(e){n.current=e,$=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var s=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(c-Q.screenX,2)+Math.pow(u-Q.screenY,2));r.current=a;var f,h=n.current,v=!1;if(ee(h)!==ee(a)){f=(C=ne(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,g=Z(p,h.accessor),m=Z(p,a.accessor);if(!g||!m)return;var w=g.length,x=m.length,b=m;if(w!==x){var y=x-w;y>0&&(b=m.slice(0,-y))}var C=function(e,n,t){var r=X(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 s=i(r,n);return a(r,n,i(r,t)),a(r,t,s),{newHeaders:r,emergencyBreak:o}}(p,g,b);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-$<1500||d<40)||($=S,Q={screenX:c,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return s([],e,!0)}),null==o||o(t)},10)}}},re=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},oe={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ie={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ae={duration:150,easing:"ease-out",delay:0},se=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},le=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){se(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ce=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,s=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i,l;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,s),0===e.x&&0===e.y?[2]:re()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),re()?o(o({},ae),e):o(o({},"column"===n?oe:ie),e)}(t,i?"column":"row"),se(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,le(n,l,t)]);case 1:return a.sent(),[2]}})})},ue=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,s,l,c,u,d,f,h,v,p,g,m,w;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,s=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,u=t.delay,d=void 0===u?0:u,f=t.onComplete,h=t.respectReducedMotion,v=void 0===h||h,re()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),g=p.top,m=e-g,w=r-g,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(s,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,s+(d||0)+50)})])})})},de=function(t){var r=t.children,i=t.id,a=t.parentRef,s=t.tableRow,l=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}(t,["children","id","parentRef","tableRow"]),c=j(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),g=J(f),m=J(d);return n.useLayoutEffect(function(){var e,n,t,r;if(u&&v.current&&!d){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!m||d){if(p.current=i,l){var c=i.x-l.x,w=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(w)<=5)){if(Math.abs(c)>5||Math.abs(w)>5){var x=o(o({},ie),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,y=null===(n=null==a?void 0:a.current)||void 0===n?void 0:n.clientHeight,C=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==y&&void 0!==C){var S=5*h,I=b-S,R=b+y+S,j=l.y>I&&l.y<R,E=i.y>I&&i.y<R,k=i.y<b,N=i.y>b+y,H=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,A=.6*h,M=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(j&&!E&&N){var F=b+y+M(i.y,b,b+y)+H%15*A*2.5+H%7*(.4*h);return void ue({element:v.current,options:{startY:l.y,endY:F,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){F=b-M(i.y,b,b+y)-H%15*A*2.5-H%7*(.4*h);return void ue({element:v.current,options:{startY:l.y,endY:F,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>b+y){var W=b+y+M(l.y,b,b+y)+H%10*A*1;return void ue({element:v.current,options:{startY:W,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<b){W=b-M(l.y,b,b+y)-H%10*A*1;return void ue({element:v.current,options:{startY:W,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}ce({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,g,m,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};de.displayName="Animate";var fe=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},he=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(fe,{className:"st-checkbox-checkmark"})})),i]}))},ve=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?q(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},pe=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,l=t.isInitialFocused,c=t.nestedIndex,u=t.rowIndex,d=t.tableRow,f=j(),v=f.cellRegistry,g=f.cellUpdateFlash,m=f.columnBorders,w=f.draggedHeaderRef,x=f.enableRowSelection,C=f.expandIcon,S=f.handleMouseDown,I=f.handleMouseOver,R=f.handleRowSelect,E=f.headers,k=f.hoveredHeaderRef,N=f.isCopyFlashing,H=f.isRowSelected,A=f.isWarningFlashing,M=f.onCellEdit,F=f.onCellClick,W=f.onTableHeaderDragEnd,T=f.rowButtons,D=f.rowGrouping,L=f.rowIdAccessor,B=f.rowsWithSelectedCells,O=f.selectedColumns,P=f.setUnexpandedRows,q=f.tableBodyContainerRef,z=f.theme,Y=f.unexpandedRows,G=f.useOddColumnBackground,V=d.depth,J=d.row,X=n.useState(J[a.accessor]),_=X[0],$=X[1],Q=n.useState(!1),Z=Q[0],ee=Q[1],ne=n.useState(!1),re=ne[0],oe=ne[1],ie=n.useState(!1),ae=ie[0],se=ie[1],le=n.useRef(null),ce=y({row:J,rowIdAccessor:L}),ue=D&&D[V],fe=!!ue&&function(e,n){if(!n)return!1;var t=e[n];return b(t)}(J,ue),pe=!Y.has(String(ce)),ge=N({rowIndex:u,colIndex:i,rowId:ce}),me=A({rowIndex:u,colIndex:i,rowId:ce}),we=n.useMemo(function(){var e,n,t;if(!m)return!1;var r=E.filter(function(e){return"left"===e.pinned}),o=E.filter(function(e){return!e.pinned}),i=E.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[m,E,a.accessor,a.pinned]),xe=te({draggedHeaderRef:w,headers:E,hoveredHeaderRef:k,onTableHeaderDragEnd:W}).handleDragOver,be=K(),ye=h({accessor:a.accessor,rowId:ce}),Ce=p({rowId:ce,accessor:a.accessor}),Se=a.isSelectionColumn&&x;n.useEffect(function(){if(v){var e="".concat(ce,"-").concat(a.accessor);return v.set(e,{updateContent:function(e){_!==e?($(e),g&&(oe(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(function(){oe(!1)},800))):$(e)}}),function(){v.delete(e),le.current&&clearTimeout(le.current)}}},[v,g,ce,a.accessor,_]),n.useEffect(function(){if(re){var e=setTimeout(function(){oe(!1)},850);return function(){return clearTimeout(e)}}},[re]),n.useEffect(function(){$(J[a.accessor])},[J,a.accessor]);var Ie="boolean"===a.type||"date"===a.type||"enum"===a.type,Re=Boolean(null==a?void 0:a.isEditable),je=O.has(i),Ee=s&&!je,ke=n.useMemo(function(){return!!Se&&B.has(String(ce))},[Se,B,ce]),Ne="st-cell ".concat(V>0&&a.expandable?"st-cell-depth-".concat(V):""," ").concat(Ee?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(je?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Re?"clickable":""," ").concat(re?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(ge?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(me?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(G?c%2==0?"even-column":"odd-column":""," ").concat(Se?"st-selection-cell":""," ").concat(ke?"st-selection-has-highlighted-cell":""," ").concat(we?"st-last-column":""),He=n.useCallback(function(e){$(e),J[a.accessor]=e,null==M||M({accessor:a.accessor,newValue:e,row:J,rowIndex:u})},[a.accessor,M,J,u]),Ae=n.useCallback(function(){P(function(e){var n=new Set(e),t=String(ce);return n.has(t)?n.delete(t):n.add(t),n})},[ce,P]);return!Z||Ie||Se?e.jsxs(de,o({className:Ne,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":ce,"data-row-index":u,id:ye,onClick:function(){F&&!Se&&F({accessor:a.accessor,colIndex:i,row:J,rowId:ce,rowIndex:u,value:_})},onDoubleClick:function(){return a.isEditable&&!Se&&ee(!0)},onDragOver:function(e){Se||be({callback:xe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){Z||Se||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||Z||(e.preventDefault(),ee(!0))},onMouseDown:function(){Z||Se||S({rowIndex:u,colIndex:i,rowId:ce})},onMouseEnter:function(){se(!0)},onMouseLeave:function(){se(!1)},onMouseOver:function(){Z||Se||I({rowIndex:u,colIndex:i,rowId:ce})},parentRef:q,tableRow:d},{children:[a.expandable&&fe?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(pe?"expanded":"collapsed"),onClick:Ae},{children:C})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:Se?e.jsxs("div",o({className:"st-selection-cell-content"},{children:[e.jsx("div",o({className:"st-selection-control"},{children:ae||H&&H(String(ce))?e.jsx(he,{checked:!!H&&H(String(ce)),onChange:function(e){R&&R(String(ce),e)}}):e.jsx("span",o({className:"st-row-number"},{children:u+1}))})),function(){if(!T||!Se||0===T.length)return null;if(!(ae||H&&H(String(ce))))return null;var n={row:J};return e.jsx("div",o({className:"st-row-buttons"},{children:T.map(function(t,r){return e.jsx("span",o({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:J,theme:z}):ve({content:_,header:a})})})),Z&&Ie&&!Se&&e.jsx(U,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ee,type:a.type,value:_})]}),Ce):e.jsx("div",o({className:"st-cell-editing",id:h({accessor:a.accessor,rowId:ce}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(U,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ee,type:a.type,value:_})}))},ge=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,l=n.tableRow,c=j(),u=c.rowIdAccessor,d=c.collapsedHeaders,f=o.filter(function(e){return v({header:e,pinned:i,headers:o,collapsedHeaders:d})});return e.jsx(e.Fragment,{children:f.map(function(n,c){var d=y({row:l.row,rowIdAccessor:u}),f=h({accessor:n.accessor,rowId:d});return e.jsx(me,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:l},f)})})},me=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,l=t.rowIndex,c=t.rowIndices,u=t.tableRow,d=r[o.accessor],f=j(),p=f.getBorderClass,g=f.isSelected,m=f.isInitialFocusedCell,w=f.rowIdAccessor,x=f.collapsedHeaders,b=y({row:u.row,rowIdAccessor:w});if(o.children&&o.children.length>0){var C=o.children.filter(function(e){return v({header:e,pinned:s,headers:i,collapsedHeaders:x})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=h({accessor:n.accessor,rowId:b});return e.jsx(me,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:l,rowIndices:c,tableRow:u},t)})})}var S={rowIndex:l,colIndex:d,rowId:b},I=p(S),R=g(S),E=m(S),k=h({accessor:o.accessor,rowId:b});return e.jsx(pe,{borderClass:I,colIndex:d,header:o,isHighlighted:R,isInitialFocused:E,nestedIndex:a,rowIndex:l,tableRow:u},k)},we=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,s=n.index,l=n.pinned,c=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,h=j(),v=h.useHoverRowBackground,p=h.rowIdAccessor,g=h.isAnimating,m=h.isRowSelected,w=h.useOddEvenRowBackground,x=f.position,b=x%2==0,C=y({row:f.row,rowIdAccessor:p}),S=!!m&&m(String(C));return e.jsx("div",o({className:"st-row ".concat(w?b?"even":"odd":""," ").concat(S?"selected":""),"data-index":s,onMouseEnter:function(){!g&&v&&d(s)},style:{gridTemplateColumns:i,top:M({position:x,rowHeight:c}),height:"".concat(c,"px")}},{children:e.jsx(ge,{columnIndexStart:r,columnIndices:t,headers:a,pinned:l,rowIndex:x,rowIndices:u,tableRow:f},C)}))},xe=function(t){var r=t.displayStrongBorder,i=t.position,a=t.rowHeight,s=t.templateColumns,l=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=s.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=s.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,a=0;a<r.length;a++){if(t<=o+r[a]){i=a;break}o+=r[a],i=a}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:s,top:A({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},be=n.createContext(void 0),ye=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(be);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),s=a.registerPane,l=a.unregisterPane,c=[i];return n.useEffect(function(){return t.current&&s(t.current,c),function(){t.current&&l(t.current,c)}},[t,s,l,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},Ce=n.forwardRef(function(t,r){var i=t.columnIndexStart,a=t.columnIndices,s=t.headers,l=t.pinned,c=t.rowHeight,u=t.rowIndices,d=t.setHoveredIndex,f=t.templateColumns,h=t.totalHeight,v=t.rowsToRender,p=t.width,g=l?"st-body-pinned-".concat(l):"st-body-main",m=j().rowIdAccessor,w=n.useRef(null);if(n.useImperativeHandle(r,function(){return w.current},[]),!n.useMemo(function(){return _(s,l)},[s,l]))return null;var x=l?"pinned-".concat(l):"default";return e.jsx(ye,o({childRef:w,group:x},{children:e.jsx("div",o({className:g,ref:w,style:o({position:"relative",height:"".concat(h,"px"),width:p},!l&&{flexGrow:1})},{children:v.map(function(t,r){var o=y({row:t.row,rowIdAccessor:m});return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(xe,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:c,templateColumns:f,rowIndex:r-1}),e.jsx(we,{columnIndexStart:i,columnIndices:a,gridTemplateColumns:f,headers:s,index:r,pinned:l,rowHeight:c,rowIndices:u,setHoveredIndex:d,tableRow:t},o)]},o)})}))}))});function Se(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=s(s(s([],t,!0),n,!0),r,!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 v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Ce.displayName="TableSection";var Ie=function(t){var r=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,l=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,u=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,h=t.tableRows,v=j(),p=v.collapsedHeaders,g=v.headerContainerRef,m=v.headers,w=v.isAnimating,x=v.mainBodyRef,b=v.onLoadMore,C=v.rowHeight,S=v.rowIdAccessor,I=v.scrollbarWidth,R=v.setIsScrolling,E=v.shouldPaginate,k=v.tableBodyContainerRef,N=n.useState(!1),H=N[0],A=N[1],M=n.useRef(new Set),F=n.useCallback(function(e){(M.current.forEach(function(e){return e.classList.remove("hovered")}),M.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),M.current.add(e)})},[]);n.useEffect(function(){w&&F(null)},[w,F]),function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],s=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;s(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(n),function(){n&&i.unobserve(n)}}},[t,r])}({headerContainerRef:g,mainSectionRef:k,scrollbarWidth:I}),n.useEffect(function(){return function(){T.current&&clearTimeout(T.current)}},[]);var W=n.useRef(null),T=n.useRef(null),D=n.useRef(0),L=function(e){return e.length}(h),B=L*(C+1)-1,O=n.useMemo(function(){return Se({headers:m,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:p})},[m,i,l,p]),P=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(y({row:n.row,rowIdAccessor:S}));e[r]=t}),e},[d,S]),q=n.useCallback(function(e,n){if(b&&!E&&!H){e.scrollHeight-(n+e.clientHeight)<=200&&n>D.current&&(A(!0),b(),setTimeout(function(){A(!1)},1e3))}},[b,E,H]),z={columnIndices:O,headerContainerRef:g,headers:m,rowHeight:C,rowIndices:P,rowsToRender:d,setHoveredIndex:F};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;R(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(function(){R(!1)},150),W.current&&cancelAnimationFrame(W.current),W.current=requestAnimationFrame(function(){f(t),q(n,t),D.current=t})},ref:k},{children:[e.jsx(Ce,o({},z,{pinned:"left",templateColumns:a,totalHeight:B,width:s})),e.jsx(Ce,o({},z,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:B})),e.jsx(Ce,o({},z,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:B,width:u}))]}))},Re=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,c=e.collapsedHeaders;n.preventDefault();var u="clientX"in n?n.clientX:n.touches[0].clientX,d="touches"in n;if(t&&!t.hide){i(!0);var f,h=x(t);if(t.children&&t.children.length>0){var v=g(t,c);f=v.length>0?v:[t]}else f=[t];var p=function(e){var n="right"===t.pinned?u-e:e-u,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=i*l(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var s=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+g(n,r).reduce(function(e,n){return e+m(n)},0)},0),c=x(n);return s<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):s}({header:t,headers:r,collapsedHeaders:c});if(f.length>1)je({delta:n,leafHeaders:f,minWidth:h,startWidth:a,maxWidth:i});else{var d=Math.max(Math.min(a+n,i),h);f[0].width=d}r.forEach(function(e){w(e)});var v=s([],r,!0);o(v)};if(d){var b=function(e){var n=e.touches[0];p(n.clientX)},y=function(){document.removeEventListener("touchmove",b),document.removeEventListener("touchend",y),i(!1)};document.addEventListener("touchmove",b),document.addEventListener("touchend",y)}else{var C=function(e){p(e.clientX)},S=function(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",S),i(!1)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",S)}}},je=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,x(n))},40),s=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-s;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/s),o=Math.max(n+t,r);e.width=o})},Ee=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},ke={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Ne=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},He=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ae=function(e){return["between","notBetween","in","notIn"].includes(e)},Me=function(e){return["isEmpty","isNotEmpty"].includes(e)},Fe=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},We=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Te=function(t){var r=t.value,i=t.onChange,a=t.options,s=t.placeholder,l=void 0===s?"Select...":s,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],g=n.useState(-1),m=g[0],w=g[1],x=n.useRef(null),b=a.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<a.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:a.length-1});break;case"Enter":e.preventDefault(),m>=0&&(i(a[m].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,m,a,i]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=a.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:b?b.label:l})),e.jsx(We,{})]})),e.jsx(F,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:a.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===m?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,i(e),p(!1),void w(-1);var e}},{children:n.label}),t)})}))}))]}))},De=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:ke[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Te,{value:t,onChange:function(e){r(e)},options:i})}))},Le=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,s=n.autoFocus,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c,d=n.onEnterPress;return e.jsx("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:l,className:"st-filter-input ".concat(u).trim()})},Be=function(n){var t=n.children,r=n.className,i=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(i).trim()},{children:t}))},Oe=function(n){var t=n.onApply,r=n.onClear,i=n.canApply,a=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Pe=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,s=t.onClearFilter,l=n.useState((null==i?void 0:i.operator)||"contains"),c=l[0],u=l[1],d=n.useState(String((null==i?void 0:i.value)||"")),f=d[0],h=d[1],v=Ne("string");n.useEffect(function(){i?(u(i.operator),h(String(i.value||""))):(u("contains"),h(""))},[i]);var p=function(){var e=o({accessor:r.accessor,operator:c},He(c)&&{value:f});a(e)},g=Me(c)||f.trim();return e.jsxs(Fe,{children:[e.jsx(De,{value:c,onChange:u,operators:v}),He(c)&&e.jsx(Be,{children:e.jsx(Le,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(Oe,{onApply:p,onClear:s,canApply:!!g,showClear:!!i})]})},qe=function(t){var r,o,i=t.header,a=t.currentFilter,s=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==a?void 0:a.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")),g=p[0],m=p[1],w=n.useState(String((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")),x=w[0],b=w[1],y=Ne("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),m(String((null===(e=a.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=a.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),m(""),b(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};He(u)?e.value=parseFloat(h):Ae(u)&&(e.values=[parseFloat(g.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(Fe,{children:[e.jsx(De,{value:u,onChange:d,operators:y}),He(u)&&e.jsx(Be,{children:e.jsx(Le,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Ae(u)&&e.jsxs(Be,{children:[e.jsx(Le,{type:"number",value:g,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(Le,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(Oe,{onApply:C,onClear:l,canApply:!!Me(u)||(He(u)?""!==h.trim():!!Ae(u)&&""!==String(g).trim()&&""!==String(x).trim()),showClear:!!a})]})},ze=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,s=n.placeholder;return e.jsx(Te,{value:t,onChange:r,options:o,className:a,placeholder:s})},Ye=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,s=n.useState((null==o?void 0:o.operator)||"equals"),l=s[0],c=s[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=Ne("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=Me(l)||""!==d;return e.jsxs(Fe,{children:[e.jsx(De,{value:l,onChange:c,operators:h}),He(l)&&e.jsx(Be,{children:e.jsx(ze,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Oe,{onApply:function(){var e={accessor:r.accessor,operator:l};He(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},Ge=function(t){var r,i,a=t.header,s=t.currentFilter,l=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==s?void 0:s.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==s?void 0:s.value)?String(s.value):""),v=h[0],p=h[1],g=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),m=g[0],w=g[1],x=n.useState(String((null===(i=null==s?void 0:s.values)||void 0===i?void 0:i[1])||"")),b=x[0],y=x[1],C=Ne("date");n.useEffect(function(){var e,n;s?(f(s.operator),p(String(s.value||"")),w(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),y(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),y(""))},[s]);var S=function(t){var r=t.value,i=t.onChange,a=t.placeholder,s=t.autoFocus,l=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=q(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){s&&p.current&&p.current.focus()},[s]);var g=r?q(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:a,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(l||""),style:{cursor:"pointer"}}),e.jsx(F,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(B,{value:g,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(Fe,{children:[e.jsx(De,{value:d,onChange:f,operators:C}),He(d)&&e.jsx(Be,{children:e.jsx(S,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Ae(d)&&e.jsxs(Be,{children:[e.jsx(S,{value:m,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(S,{value:b,onChange:y,placeholder:"To date..."})]}),e.jsx(Oe,{onApply:function(){var e={accessor:a.accessor,operator:d};He(d)?e.value=v:Ae(d)&&(e.values=[m,b]),l(e)},onClear:c,canApply:!!Me(d)||(He(d)?""!==v.trim():!!Ae(d)&&""!==m.trim()&&""!==b.trim()),showClear:!!s})]})},Ue=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==i?void 0:i.values)?i.values.map(String):u),f=d[0],h=d[1],v=n.useState(""),p=v[0],g=v[1],m=n.useMemo(function(){if(!p)return c;var e=p.toLowerCase();return c.filter(function(n){return n.label.toLowerCase().includes(e)})},[c,p]);n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var w=f.length===u.length,x=c.length>10;return e.jsxs(Fe,{children:[e.jsx(Be,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(he,o({checked:w,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),x&&e.jsx("div",o({className:"st-enum-search"},{children:e.jsx(Le,{type:"text",value:p,onChange:g,placeholder:"Search..."})})),m.map(function(n,t){return e.jsx(he,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):s(s([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===m.length&&e.jsx("div",o({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(Oe,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else l()},onClear:l,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},Ve=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Ye,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Ge,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(Ue,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Pe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Ke=function(t){var r,i,a=t.colIndex,l=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,f=t.gridRowStart,v=t.header,p=t.reverse,g=t.sort,m=n.useState(!1),w=m[0],x=m[1],b=n.useState(!1),y=b[0],C=b[1],S=n.useState(v.label||""),I=S[0],R=S[1],E=j(),k=E.activeHeaderDropdown,N=E.areAllRowsSelected,H=E.collapsedHeaders,A=E.columnBorders,M=E.columnReordering,W=E.columnResizing,T=E.columnsWithSelectedCells,L=E.draggedHeaderRef,B=E.enableHeaderEditing,O=E.enableRowSelection,P=E.filters,q=E.handleApplyFilter,z=E.handleClearFilter,Y=E.handleSelectAll,G=E.headerCollapseIcon,U=E.headerDropdown,V=E.headerExpandIcon,J=E.headerRegistry,X=E.headers,_=E.hoveredHeaderRef,$=E.onColumnOrderChange,Q=E.onColumnSelect,Z=E.onHeaderEdit,ee=E.onSort,ne=E.onTableHeaderDragEnd,re=E.headerHeight,oe=E.selectColumns,ie=E.selectableColumns,ae=E.selectedColumns,se=E.setActiveHeaderDropdown,le=E.setCollapsedHeaders,ce=E.setHeaders,ue=E.setInitialFocusedCell,fe=E.setIsResizing,ve=E.setSelectedCells,pe=E.setSelectedColumns,ge=E.sortDownIcon,me=E.sortUpIcon,we=Boolean(null==v?void 0:v.isSortable),xe=Boolean(null==v?void 0:v.filterable),be=P[v.accessor],ye=(null==k?void 0:k.accessor)===v.accessor,Ce=v.isSelectionColumn&&O,Se=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(v),Ie=H.has(v.accessor),je=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,s=e.margin,l=void 0===s?4:s,c=n.useRef(null),u=n.useState({}),d=u[0],f=u[1];return n.useEffect(function(){if(t&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,r=window.innerWidth-e.right,i="bottom",s={};o>n&&o<=t&&(i="top");var u="left";a>r+e.width&&(u="right"),"bottom"===i?s.top=e.bottom+l:s.bottom=window.innerHeight-e.top+l,"left"===u?s.left=e.left:s.right=window.innerWidth-e.right,f(s)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:c,position:d}}({isOpen:ye,estimatedHeight:200,estimatedWidth:250,margin:4}),ke=je.triggerRef,Ne=je.position,He=n.useMemo(function(){var e,n,t;if(!A)return!1;var r=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===v.accessor},[A,X,v.accessor,v.pinned]),Ae=n.useMemo(function(){return!(!ie||Ce)&&c(v,a).some(function(e){return ae.has(e)})},[ie,Ce,v,a,ae]),Me=n.useMemo(function(){return!Ce&&c(v,a).some(function(e){return T.has(e)})},[Ce,v,a,T]),Fe=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!Ie||v.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[v.children,Ie]),We="st-header-cell ".concat(v.accessor===(null===(r=_.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=L.current)||void 0===i?void 0:i.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(M&&!we?"columnReordering":""," ").concat(Fe?"parent":""," ").concat(He?"st-last-column":""," ").concat(B&&!Ce?"st-header-editable":""," ").concat(Ae?"st-header-selected":""," ").concat(Me&&!Ae?"st-header-has-highlighted-cell":""),Te=te({draggedHeaderRef:L,headers:X,hoveredHeaderRef:_,onColumnOrderChange:$,onTableHeaderDragEnd:ne}),De=Te.handleDragStart,Le=Te.handleDragEnd,Be=Te.handleDragOver,Oe=K();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=String(v.accessor);return J.set(e,{setEditing:function(e){C(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){R(v.label||"")},[v.label]);var Pe=n.useCallback(function(e){R(e);var n=X.map(function(n){return n.accessor===v.accessor?o(o({},n),{label:e}):n});ce(n),Z&&Z(v,e)},[X,ce,Z,v]),qe=n.useCallback(function(){se&&se(null)},[se]),ze=n.useCallback(function(e){e.stopPropagation(),le(function(e){var n=new Set(e);return Ie?n.delete(v.accessor):n.add(v.accessor),n})},[le,Ie,v.accessor]),Ye=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ie){var r=c(t,a),o=r.some(function(e){return ae.has(e)});if(B&&o&&!n.shiftKey)return U&&ye&&qe(),void C(!0);n.shiftKey&&oe?pe(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,l,c,u,d=s(s([],(a=o,l=n,c=Math.min(a,l),u=Math.max(a,l),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(s(s([],Array.from(e),!0),d,!0))}):oe&&oe(r),ve(new Set),ue(null)}Q&&Q(t),!ie&&t.isSortable&&ee(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)}},[]),!v)return null;var Ge=W&&!Ce&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:Re,callbackProps:{event:e.nativeEvent,gridColumnEnd:l,gridColumnStart:u,header:v,headers:X,setHeaders:ce,setIsResizing:fe,startWidth:t,collapsedHeaders:H},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:Re,callbackProps:{event:e,gridColumnEnd:l,gridColumnStart:u,header:v,headers:X,setHeaders:ce,setIsResizing:fe,startWidth:t,collapsedHeaders:H},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ue=g&&g.key.accessor===v.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return Ye({event:e,header:v})}},{children:["ascending"===g.direction&&me&&me,"descending"===g.direction&&ge&&ge]})),Ke=xe&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),x(!w)}},{children:[e.jsx(Ee,{className:"st-header-icon",style:{fill:be?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(F,o({open:w,overflow:"visible",setOpen:x,onClose:function(){return x(!1)}},{children:e.jsx(Ve,{header:v,currentFilter:be,onApplyFilter:function(e){q(e),x(!1)},onClearFilter:function(){z(v.accessor),x(!1)}})}))]})),Je=Se&&!Ce&&e.jsx("div",o({className:"st-icon-container st-collapse-icon-container",onClick:ze},{children:Ie?G:V}));return e.jsxs(de,o({className:We,id:h({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){Ce||Oe({callback:Be,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:o({gridRowStart:f,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:l},d-f>1?{}:{height:re})},{children:[p&&Ge,"right"===v.align&&Je,"right"===v.align&&Ke,"right"===v.align&&Ue,e.jsx("div",o({ref:ke,className:"st-header-label",draggable:M&&!v.disableReorder&&!Ce,onClick:function(e){Ce||Ye({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){e.event;var n=e.header;n.isSelectionColumn||ie&&n.isSortable&&ee(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),Le()},onDragStart:Ce?void 0:function(e){M&&v&&function(e){De(e)}(v)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(he,{checked:!!N&&N(),onChange:function(e){Y&&Y(e)}}):y?e.jsx(D,{defaultValue:I,onBlur:function(){return C(!1)},onChange:Pe}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:a,header:v}):I||(null==v?void 0:v.label)}))})),"right"!==v.align&&Ue,"right"!==v.align&&Ke,"right"!==v.align&&Je,!p&&Ge,U&&!Ce&&e.jsx("div",o({className:"st-header-dropdown-container"},{children:U({accessor:v.accessor,colIndex:a,header:v,isOpen:ye,onClose:qe,position:Ne})}))]}))},Je=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,c=t.pinned,u=t.sectionRef,d=t.sort,f=t.width,h=j().collapsedHeaders,p=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!v({header:o,pinned:c,headers:s,collapsedHeaders:h}))return 0;a||n++;var f=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return v({header:e,pinned:c,headers:s,collapsedHeaders:h})}).length)&&void 0!==d?d:0,p=n,g=f>0?p+f:p+1,m=i,w=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:p,gridColumnEnd:g,gridRowStart:m,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var x=!0;o.children.forEach(function(e){v({header:e,pinned:c,headers:s,collapsedHeaders:h})&&(t(e,i+1,x),x=!1)})}return g-p},o=s.filter(function(e){return v({header:e,pinned:c,headers:s,collapsedHeaders:h})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,c,r,h]),g=c?"pinned-".concat(c):"default";return e.jsx(ye,o({childRef:u,group:g},{children:e.jsx("div",o({className:"st-header-".concat(c?"pinned-".concat(c):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,width:f,position:"relative"}},{children:e.jsx(e.Fragment,{children:p.map(function(n){return e.jsx(Ke,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===c,sort:d},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},_e=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,h=t.pinnedLeftWidth,p=t.pinnedRightWidth,g=j(),m=g.headerContainerRef,w=g.pinnedLeftRef,x=g.pinnedRightRef,b=g.collapsedHeaders,y=n.useMemo(function(){return Se({headers:i,pinnedLeftColumns:l,pinnedRightColumns:u,collapsedHeaders:b})},[i,l,u,b]),C=n.useMemo(function(){var e=0,n=s(s(s([],l,!0),i,!0),u,!0);return i.forEach(function(t){if(v({header:t,headers:n,collapsedHeaders:b})){var r=Xe(t);e=Math.max(e,r)}}),{maxDepth:e}},[i,l,u,b]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:m},{children:[_(i,"left")&&e.jsx(Je,{columnIndices:y,gridTemplateColumns:c,handleScroll:void 0,headers:i,maxDepth:C,pinned:"left",sectionRef:w,sort:f,width:h}),e.jsx(Je,{columnIndices:y,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:C,sectionRef:r,sort:f}),_(i,"right")&&e.jsx(Je,{columnIndices:y,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:C,pinned:"right",sectionRef:x,sort:f,width:p})]}))},$e=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});r({headers:i,flattenedHeaders:o})}else 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(" "))},Qe=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=j(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=u.collapsedHeaders,p=n.useRef(null),g=h.filter(function(e){return!e.pinned}),m=h.filter(function(e){return"left"===e.pinned}),w=h.filter(function(e){return"right"===e.pinned}),x=n.useMemo(function(){return $e({headers:m,collapsedHeaders:v})},[m,v]),b=n.useMemo(function(){return $e({headers:g,collapsedHeaders:v})},[g,v]),y=n.useMemo(function(){return $e({headers:w,collapsedHeaders:v})},[w,v]),C={centerHeaderRef:p,headers:h,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedRightColumns:w,pinnedRightTemplateColumns:y,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},S={tableRows:l,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedLeftWidth:r,pinnedRightColumns:w,pinnedRightTemplateColumns:y,pinnedRightWidth:i,setScrollTop:a,rowsToRender:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(_e,o({},C)),e.jsx(Ie,o({},S))]}))},Ze=function(t){var r=t.mainBodyWidth,i=t.mainBodyRef,a=t.pinnedLeftWidth,s=t.pinnedRightWidth,l=t.pinnedLeftContentWidth,c=t.pinnedRightContentWidth,u=t.tableBodyContainerRef,d=j().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),g=n.useRef(null),m=n.useRef(null),w=u.current&&u.current.scrollHeight>u.current.clientHeight,x=d?28:0,b=(d?s+1:s)+(u.current&&w?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(i.current){var e=i.current.clientWidth;v(r>e)}}()},1)},[i,r]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[a>0&&e.jsx(ye,o({childRef:g,group:"pinned-left"},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-left",ref:g,style:{width:a}},{children:e.jsx("div",{style:{width:l}})}))})),r>0&&e.jsx(ye,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p},{children:e.jsx("div",{style:{width:r}})}))})),s>0&&e.jsx(ye,o({childRef:m,group:"pinned-right"},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-right",ref:m,style:{width:b}},{children:e.jsx("div",{style:{width:c}})}))})),x>0&&e.jsx("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},en={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 en.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?en.string(e,n,t):"number"==typeof e&&"number"==typeof n?en.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?en.boolean(e,n,t):en.string(String(e),String(n),t)}},nn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return s([],n,!0).sort(function(e,n){var r=t.key.accessor;return 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 en.number(i,a,r)}return"date"===t?en.date(String(e),String(n),r):"boolean"===t?en.boolean(Boolean(e),Boolean(n),r):"enum"===t?en.enum(String(e),String(n),r):en.string(String(e),String(n),r)}(e[r],n[r],a,l)})},tn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return nn({rows:t,sortColumn:r,headers:n})},rn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):tn({headers:i,rows:t,sortColumn:r}):t},on=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),s=!1;if(!a)for(var l=0,c=i.children;l<c.length;l++){var u=c[l];if(on([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},an=function(e){return e.every(function(e){return e.hide})},sn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(sn(e.children),an(e.children)&&(e.hide=!0))})},ln=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=j(),p=v.expandIcon,g=v.headers,m=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,b=null!=u?u:c.hide||x&&c.children&&an(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[l&&e.jsx("div",o({className:"st-header-icon-container"},{children:x?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(he,o({checked:b,onChange:function(e){(c.hide=e,e)?sn(r):(on(r,c.accessor),x&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,on(r,c.children[0].accessor)));m(s([],g,!0))}},{children:c.label}))]})),x&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(ln,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!b||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},cn=function(t){var r=t.headers,i=t.open,a="left"===t.position?"left":"",s=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(i?"open":""," ").concat(a),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn?null:e.jsx(ln,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},un=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,s=t.headers,l=t.position,c=void 0===l?"right":l,u=n.useState(a),d=u[0],f=u[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(cn,{headers:s,open:d,position:c})]})):null},dn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",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"})}))},fn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",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"})}))},hn=function(t){var i=t.children,a=n.useRef({}),s=n.useCallback(function(e,n){return!!a.current[n]&&a.current[n].find(function(n){return n===e})},[]),l=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=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=a.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),l(e,n),window.requestAnimationFrame(function(){var e=Object.keys(a.current).filter(function(e){return a.current[e].includes(n)});u(n,e)}))})})})}},[c,l]),d=n.useCallback(function(e,n){n.forEach(function(n){a.current[n]||(a.current[n]=[]),s(e,n)||(a.current[n].length>0&&l(a.current[n][0],e),a.current[n].push(e))}),u(e,n)},[s,l,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(s(e,n)){c(e);var t=a.current[n].indexOf(e);-1!==t&&a.current[n].splice(t,1)}})},[s,c]);return e.jsx(be.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},vn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=ke[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},pn=function(){var n=j(),t=n.filters,r=n.handleClearFilter,i=n.headers,a=Object.values(t);return 0===a.length||a.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:a.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:vn(n,i)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},gn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var s=Number(e),l=Number(r);switch(t){case"equals":return s===l;case"notEquals":return s!==l;case"greaterThan":return s>l;case"lessThan":return s<l;case"greaterThanOrEqual":return s>=l;case"lessThanOrEqual":return s<=l;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return s>=u&&s<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],s<u||s>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=q(e),v=q(String(r||"")),p=P(h),g=P(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var m=o.map(function(e){return P(q(String(e||"")))}),w=m[0],x=m[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return P(q(String(e||"")))});return w=b[0],x=b[1],p<w||p>x}return!0}}if("boolean"==typeof e){var y=Boolean(r);if("equals"===t)return e===y}if(Array.isArray(e)){var C=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),I=o.includes(S);return"in"===t?I:!I}return!1}var R=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return R===j;case"notEquals":return R!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},mn=function(e){var t=e.rows,r=e.headers,i=e.rowGrouping;return n.useMemo(function(){if(!i||0===i.length)return t;var e=function(e){return u(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),a=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=i[t],s=i[t+1],l=n[r];if(l&&b(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=wn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},wn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&b(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,s=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===s.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=s.reduce(function(e,n){return e+n},0);break;case"average":a=s.reduce(function(e,n){return e+n},0)/s.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,s);break;case"max":a=Math.max.apply(Math,s);break;default:return}return t.formatResult?t.formatResult(a):a}},xn=function(e){if(null==e)return"";var n=String(e);if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},bn=function(e,n,t){var r=function(e,n){var t=function(e){var n=[],t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?t(i.children):n.push(i))}};return t(e),n}(n);return s([t.map(function(e){return xn(e.label)}).join(",")],e.map(function(e){var n=e.row;return t.map(function(e){var t=n[e.accessor];return xn(t)}).join(",")}),!0).join("\n")}(e,n);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(r,t)},yn=function(e){var t=e.rows,r=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,s=n.useState(new Set),l=s[0],c=s[1],u=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(t,r,l)},[t,r,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),h=n.useMemo(function(){return a?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(t,r,l):[]},[t,r,l,a]),v=n.useCallback(function(e,n){if(a){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,l);if(c(i),o){var s=t.find(function(n){return String(n[r])===e});s&&o({row:s,isSelected:n,selectedRows:i})}}},[l,t,r,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(t,r),o&&t.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=t.find(function(n){return String(n[r])===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[t,r,o,l,a]),g=n.useCallback(function(e){if(a){var n=u(e);v(e,!n)}},[u,v,a]),m=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=t.find(function(e){return String(e[r])===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,t,r,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:u,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:h,handleRowSelect:v,handleSelectAll:p,handleToggleRow:g,clearSelection:m}},Cn=function(t){var r=t.allowAnimations,c=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.className,v=t.columnBorders,w=void 0!==v&&v,x=t.columnEditorPosition,I=void 0===x?"right":x,j=t.columnEditorText,A=void 0===j?"Columns":j,M=t.columnReordering,F=void 0!==M&&M,W=t.columnResizing,T=void 0!==W&&W,D=t.defaultHeaders,L=t.editColumns,B=void 0!==L&&L,O=t.editColumnsInitOpen,P=void 0!==O&&O,q=t.enableHeaderEditing,z=void 0!==q&&q,Y=t.enableRowSelection,G=void 0!==Y&&Y,U=t.expandAll,V=void 0===U||U,K=t.expandIcon,X=void 0===K?e.jsx(N,{className:"st-expand-icon"}):K,_=t.externalFilterHandling,$=void 0!==_&&_,Q=t.externalSortHandling,Z=void 0!==Q&&Q,ee=t.headerCollapseIcon,ne=void 0===ee?e.jsx(N,{className:"st-header-icon"}):ee,te=t.headerExpandIcon,re=void 0===te?e.jsx(k,{className:"st-header-icon"}):te,oe=t.headerDropdown,ae=t.headerHeight,se=t.height,le=t.hideFooter,ce=void 0!==le&&le,ue=t.nextIcon,de=void 0===ue?e.jsx(N,{className:"st-next-prev-icon"}):ue,fe=t.onCellEdit,he=t.onCellClick,ve=t.onColumnOrderChange,pe=t.onColumnSelect,ge=t.onFilterChange,me=t.onGridReady,we=t.onHeaderEdit,xe=t.onLoadMore,be=t.onNextPage,ye=t.onRowSelectionChange,Ce=t.onSortChange,Se=t.prevIcon,Ie=void 0===Se?e.jsx(k,{className:"st-next-prev-icon"}):Se,Re=t.rowButtons,je=t.rowGrouping,Ee=t.rowHeight,ke=void 0===Ee?32:Ee,Ne=t.rowIdAccessor,He=t.rows,Ae=t.selectionColumnWidth,Me=void 0===Ae?42:Ae,Fe=t.rowsPerPage,We=void 0===Fe?10:Fe,Te=t.selectableCells,De=void 0!==Te&&Te,Le=t.selectableColumns,Be=void 0!==Le&&Le,Oe=t.shouldPaginate,Pe=void 0!==Oe&&Oe,qe=t.sortDownIcon,ze=void 0===qe?e.jsx(dn,{className:"st-header-icon"}):qe,Ye=t.sortUpIcon,Ge=void 0===Ye?e.jsx(fn,{className:"st-header-icon"}):Ye,Ue=t.tableRef,Ve=t.theme,Ke=void 0===Ve?"light":Ve,Je=t.useHoverRowBackground,Xe=void 0===Je||Je,_e=t.useOddEvenRowBackground,$e=void 0!==_e&&_e,en=t.useOddColumnBackground,nn=void 0!==en&&en;nn&&($e=!1),w&&(Xe=!1);var on=n.useReducer(function(e){return e+1},0)[1],an=n.useRef(null),sn=n.useRef(null),ln=n.useRef(null),cn=n.useRef(null),vn=n.useRef(null),wn=n.useRef(null),xn=n.useRef(null),Cn=n.useState(1),Sn=Cn[0],In=Cn[1],Rn=n.useState(D),jn=Rn[0],En=Rn[1],kn=n.useState(!1),Nn=kn[0],Hn=kn[1],An=n.useState(!1),Mn=An[0],Fn=An[1],Wn=n.useState(null),Tn=Wn[0],Dn=Wn[1],Ln=n.useState(new Set),Bn=Ln[0],On=Ln[1];n.useEffect(function(){En(D)},[D]);var Pn=yn({rows:He,rowIdAccessor:Ne,onRowSelectionChange:ye,enableRowSelection:G}),qn=Pn.selectedRows,zn=Pn.setSelectedRows,Yn=Pn.isRowSelected,Gn=Pn.areAllRowsSelected,Un=Pn.selectedRowCount,Vn=Pn.selectedRowsData,Kn=Pn.handleRowSelect,Jn=Pn.handleSelectAll,Xn=Pn.handleToggleRow,_n=Pn.clearSelection,$n=n.useMemo(function(){var e,n=s([],jn,!0);G&&!(null===(e=null==jn?void 0:jn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=s([{accessor:"__row_selection__",label:"",width:Me,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[G,jn,Me]),Qn=n.useState(0),Zn=Qn[0],et=Qn[1],nt=n.useState(new Set),tt=nt[0],rt=nt[1],ot=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){if(t.current){var e=t.current.offsetWidth-t.current.clientWidth;i(e)}},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:wn}),it=ot.scrollbarWidth,at=ot.setScrollbarWidth,st=n.useState(0),lt=st[0],ct=st[1];n.useLayoutEffect(function(){var e=function(){wn.current&&ct(wn.current.clientWidth)};e();var n=null;return wn.current&&(n=new ResizeObserver(e)).observe(wn.current),function(){n&&n.disconnect()}},[]);var ut=n.useMemo(function(){var e=l(window.innerWidth),n=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,s=0,l=0;n.forEach(function(e){if(!e.hide){var n=g(e,i).reduce(function(e,n){return e+m(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?s+=n:l+=n}});var c=a,u=s;if(t&&t>0){var f=t*o;a>f&&(a=f),s>f&&(s=f)}return{leftWidth:d(a),rightWidth:d(s),mainWidth:l,leftContentWidth:c,rightContentWidth:u}}({headers:$n,containerWidth:lt,maxPinnedWidthPercent:e,collapsedHeaders:Bn});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[$n,lt,Bn]),dt=ut.mainBodyWidth,ft=ut.pinnedLeftWidth,ht=ut.pinnedRightWidth,vt=ut.pinnedLeftContentWidth,pt=ut.pinnedRightContentWidth,gt=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if("string"==typeof t)if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var i=parseInt(t,10);o=window.innerHeight*i/100}else if(t.endsWith("%")){var a=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;else o=t;return Math.max(0,o-r)},[t,r])}({height:se,rowHeight:ke}),mt=mn({rows:He,headers:jn,rowGrouping:je}),wt=function(e){var t=e.rows,r=e.externalFilterHandling,i=e.onFilterChange,a=n.useState({}),s=a[0],l=a[1],c=n.useMemo(function(){return gn({externalFilterHandling:r,tableRows:t,filterState:s})},[t,s,r]),u=n.useCallback(function(e){var n,t=o(o({},s),((n={})[e.accessor]=e,n));l(t),null==i||i(t)},[s,i]),d=n.useCallback(function(e){var n=o({},s);delete n[e],l(n),null==i||i(n)},[s,i]),f=n.useCallback(function(){l({}),null==i||i({})},[i]),h=n.useCallback(function(e){var n,i=o(o({},s),((n={})[e.accessor]=e,n));return gn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:mt,externalFilterHandling:$,onFilterChange:ge}),xt=wt.filters,bt=wt.filteredRows,yt=wt.updateFilter,Ct=wt.clearFilter,St=wt.clearAllFilters,It=wt.computeFilteredRowsPreview,Rt=function(e){var t=e.headers,r=e.tableRows,i=e.externalSortHandling,a=e.onSortChange,s=e.rowGrouping,l=n.useState(null),c=l[0],u=l[1],d=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,i=e.sortColumn,a=tn({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(b(s)){var l=d({rows:s,sortColumn:i,headers:t,groupingKeys:n.slice(1)});return o(o({},e),((r={})[a]=l,r))}return e}):a},[]),f=n.useMemo(function(){return rn({externalSortHandling:i,tableRows:r,sortColumn:c,rowGrouping:s,headers:t,sortNestedRows:d})},[r,c,t,i,s,d]),h=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},r=n(t);if(r){var o=null;c&&c.key.accessor===e?"ascending"===c.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},u(o),null==a||a(o)}},[c,t,a]),v=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},o=n(t);if(!o)return r;var a=null;return c&&c.key.accessor===e?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},rn({externalSortHandling:i,tableRows:r,sortColumn:a,rowGrouping:s,headers:t,sortNestedRows:d})},[c,t,r,i,s,d]);return{sort:c,sortedRows:f,updateSort:h,computeSortedRowsPreview:v}}({headers:jn,tableRows:bt,externalSortHandling:Z,onSortChange:Ce,rowGrouping:je}),jt=Rt.sort,Et=Rt.sortedRows,kt=Rt.updateSort,Nt=function(e){var t=e.allowAnimations,r=e.sortedRows,i=e.originalRows,a=e.currentPage,l=e.rowsPerPage,c=e.shouldPaginate,u=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,h=e.expandAll,v=e.contentHeight,p=e.rowHeight,g=e.scrollTop,m=e.computeFilteredRowsPreview,w=e.computeSortedRowsPreview,x=n.useState(!1),b=x[0],S=x[1],I=n.useState([]),R=I[0],j=I[1],E=n.useRef([]),k=n.useRef([]),N=n.useRef(new Map),A=n.useRef(null),M=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?C({rows:n,rowGrouping:u,rowIdAccessor:d,unexpandedRows:f,expandAll:h}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[a,l,c,u,d,f,h]);n.useMemo(function(){if(0===N.current.size){var e=M(i),n=new Map;e.forEach(function(e){var t=String(y({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),N.current=n}},[i,M,d]);var F=n.useMemo(function(){return M(r)},[r,M]),W=n.useMemo(function(){return H({bufferRowCount:5,contentHeight:v,tableRows:F,rowHeight:p,scrollTop:g})},[F,v,p,g]),T=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),D=n.useMemo(function(){if(0===E.current.length)return!1;var e=F.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}),n=E.current.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[F,d]);n.useLayoutEffect(function(){if(!b){if(!t||c)return j([]),E.current=F,void(k.current=W);if(0===E.current.length)return j([]),E.current=F,void(k.current=W);if(!D)return j([]),E.current=F,void(k.current=W);A.current={tableRows:F,visibleRows:W},S(!0)}},[t,F,D,b,c,W]),n.useLayoutEffect(function(){if(b&&A.current&&R.length>0){var e=setTimeout(function(){var e=A.current;S(!1),j([]),E.current=e.tableRows,k.current=e.visibleRows,A.current=null},ie.duration+100);return function(){return clearTimeout(e)}}},[b,R.length]);var L=n.useMemo(function(){if(!t||c)return W;if(R.length>0){var e=new Map;return F.forEach(function(n){var t=String(y({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),R.map(function(n){var t=String(y({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return W},[W,R,F,t,c,d]),B=n.useCallback(function(e){if(t&&!c){var n=m(e),r=M(n),o=H({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:g}),i=T(W,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return F.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],W,!0),i,!0))}},[t,c,m,M,v,p,g,T,F,W,d]),O=n.useCallback(function(e){if(t&&!c){var n=w(e),r=M(n),o=H({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:g}),i=T(W,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return F.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],W,!0),i,!0))}},[t,c,w,M,v,p,g,T,F,W,d]);return{currentTableRows:F,currentVisibleRows:W,isAnimating:b,prepareForFilterChange:B,prepareForSortChange:O,rowsToRender:L}}({allowAnimations:c,sortedRows:Et,originalRows:mt,currentPage:Sn,rowsPerPage:We,shouldPaginate:Pe,rowGrouping:je,rowIdAccessor:Ne,unexpandedRows:tt,expandAll:V,contentHeight:gt,rowHeight:ke,scrollTop:Zn,computeFilteredRowsPreview:It,computeSortedRowsPreview:Rt.computeSortedRowsPreview}),Ht=Nt.currentTableRows,At=Nt.rowsToRender,Mt=Nt.prepareForFilterChange,Ft=Nt.prepareForSortChange,Wt=Nt.isAnimating,Tt=n.useRef(new Map),Dt=n.useRef(new Map),Lt=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=e.collapsedHeaders,d=n.useState(new Set),f=d[0],h=d[1],v=n.useState(new Set),p=v[0],m=v[1],w=n.useState(null),x=w[0],b=w[1],C=n.useState(null),I=C[0],R=C[1],j=n.useState(new Set),E=j[0],k=j[1],N=n.useState(new Set),H=N[0],A=N[1],M=n.useRef(!1),F=n.useRef(null),W=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),p.forEach(function(n){e.add(n)}),e},[f,p]),T=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),p.size>0&&o.forEach(function(n){var t=y({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[f,p,o,s]),D=n.useMemo(function(){return r.flatMap(function(e){return g(e,u)})},[r,u]),L=n.useCallback(function(){var e=D.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,i=t.split("-").map(Number),a=i[0],s=i[1];e[a]||(e[a]=[]);var l=n.get(s);return l&&(null===(r=o[a])||void 0===r?void 0:r.row)?e[a][s]=o[a].row[l]:e[a][s]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),k(new Set(f)),setTimeout(function(){k(new Set)},800))},[D,f,o]),B=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,u,d,f;return a(this,function(a){switch(a.label){case 0:if(!I)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=D.filter(function(e){return!e.hide}),r=new Set,i=new Set,u=I.rowIndex,d=I.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,a){var f=u+n,h=d+a;if(!(f>=o.length||h>=t.length)){var v=o[f],p=t[h],g=y({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var w=Number(e);isNaN(w)||(m=w)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var x=new Date(e);isNaN(x.getTime())||(m=x)}if(v.row[p.accessor]=m,c){var b="".concat(g,"-").concat(p.accessor),C=c.get(b);C&&C.updateContent(m)}null==l||l({accessor:p.accessor,newValue:m,row:v.row,rowIndex:f});var I=S({colIndex:h,rowIndex:f,rowId:g});r.add(I)}else{var R=S({colIndex:h,rowIndex:f,rowId:g});i.add(R)}}})}),r.size>0&&(k(r),setTimeout(function(){k(new Set)},800)),i.size>0&&(A(i),setTimeout(function(){A(new Set)},800)),[3,4]):[2];case 3:return f=a.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[I,D,o,s,l,c]),O=n.useCallback(function(){if(0!==f.size){var e=D.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],u=i[1];if(!(a>=o.length||u>=e.length)){var d=o[a],f=e[u],h=y({row:d.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),d.row[f.accessor]=v,c){var p="".concat(h,"-").concat(f.accessor),g=c.get(p);g&&g.updateContent(v)}null==l||l({accessor:f.accessor,newValue:v,row:d.row,rowIndex:a}),t.add(n)}else r.add(n)}}),t.size>0&&(k(t),setTimeout(function(){k(new Set)},800)),r.size>0&&(A(r),setTimeout(function(){A(new Set)},800))}},[f,D,o,s,l,c]),P=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),l=Math.max(e.colIndex,n.colIndex),c=r;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<o.length){var d=y({row:o[c].row,rowIdAccessor:s});t.add(S({colIndex:u,rowIndex:c,rowId:d}))}m(new Set),b(null),h(t)},[o,s,m,b,h]),q=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<D.length){var n=S(e);m(new Set),b(null),h(new Set([n])),R(e)}},[D.length,o.length,m,b,h,R]),z=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),R(null),m(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&b(e[e.length-1])},[h,R,m,b]);n.useEffect(function(){var e=function(e){var n;if(t&&I){var r=I.rowIndex,i=I.colIndex,a=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void B();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void O();if(y({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return y({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=y({row:o[r-1].row,rowIdAccessor:s});q({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=y({row:o[r+1].row,rowIdAccessor:s}),q({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<D.length-1&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),m(new Set),b(null),F.current=null,R(null))}else L()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[L,D.length,I,s,P,q,t,o,B,O]);var Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=S({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=p.has(n);return i||a},[f,p]),G=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?y({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?y({row:o[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!Y(c)||p.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!Y(u)||p.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),Y(d)||i.push("st-selected-left-border"),Y(f)||i.push("st-selected-right-border"),i.join(" ")},[Y,o,p,s]),U=n.useMemo(function(){return I?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===I.rowIndex&&t===I.colIndex&&r===I.rowId}:function(){return!1}},[I]),V=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=S({colIndex:n,rowIndex:t,rowId:r});return E.has(o)},[E]),K=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=S({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]);return{getBorderClass:G,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(M.current=!0,F.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){m(new Set),b(null);var e=S({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),R({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&M.current&&F.current){for(var i=new Set,a=Math.min(F.current.rowIndex,r),l=Math.max(F.current.rowIndex,r),c=Math.min(F.current.colIndex,n),u=Math.max(F.current.colIndex,n),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var v=y({row:o[d].row,rowIdAccessor:s});i.add(S({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){M.current=!1},isCopyFlashing:V,isWarningFlashing:K,isInitialFocusedCell:U,isSelected:Y,lastSelectedColumnIndex:x,pasteFromClipboard:B,selectColumns:z,selectedCells:f,selectedColumns:p,setInitialFocusedCell:R,setSelectedCells:h,setSelectedColumns:m,deleteSelectedCells:O,columnsWithSelectedCells:W,rowsWithSelectedCells:T}}({selectableCells:De,headers:jn,tableRows:Ht,rowIdAccessor:Ne,onCellEdit:fe,cellRegistry:Tt.current,collapsedHeaders:Bn}),Bt=Lt.getBorderClass,Ot=Lt.handleMouseDown,Pt=Lt.handleMouseOver,qt=Lt.handleMouseUp,zt=Lt.isCopyFlashing,Yt=Lt.isInitialFocusedCell,Gt=Lt.isSelected,Ut=Lt.isWarningFlashing,Vt=Lt.selectColumns,Kt=Lt.selectedCells,Jt=Lt.selectedColumns,Xt=Lt.setInitialFocusedCell,_t=Lt.setSelectedCells,$t=Lt.setSelectedColumns,Qt=Lt.columnsWithSelectedCells,Zt=Lt.rowsWithSelectedCells,er=n.useCallback(function(e){Ft(e),setTimeout(function(){kt(e)},0)},[Ft,kt]),nr=n.useCallback(function(e){En(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,s=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(s&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,s,l])}({selectableColumns:Be,selectedCells:Kt,selectedColumns:Jt,setSelectedCells:_t,setSelectedColumns:$t,activeHeaderDropdown:Tn,setActiveHeaderDropdown:Dn}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:on,tableBodyContainerRef:wn,setScrollbarWidth:at}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:me}),function(e){var t=e.cellRegistryRef,r=e.currentTableRows,o=e.headerRegistryRef,i=e.headers,a=e.rowIdAccessor,s=e.rows,l=e.tableRef,c=e.visibleRows;n.useEffect(function(){l&&(l.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==s?void 0:s[r];if(i){var l=y({row:i,rowIdAccessor:a}),c=p({rowId:l,accessor:n}),u=t.current.get(c);u&&u.updateContent(o),void 0!==i[n]&&(i[n]=o)}},setHeaderRename:function(e){var n=e.accessor,t=o.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return c},exportToCSV:function(e){var n=(void 0===e?{}:e).filename;bn(r,i,n)}})},[t,o,s,a,l,c,i])}({cellRegistryRef:Tt,currentTableRows:Ht,headerRegistryRef:Dt,headers:$n,rowIdAccessor:Ne,rows:He,tableRef:Ue,visibleRows:At}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:xt,onFilterChange:ge}),function(e){var t=e.sort,r=e.onSortChange,o=J(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:jt,onSortChange:Ce});var tr=n.useCallback(function(e){Mt(e),setTimeout(function(){yt(e)},0)},[Mt,yt]);return e.jsx(R,o({value:{allowAnimations:c,areAllRowsSelected:Gn,cellRegistry:Tt.current,cellUpdateFlash:f,clearSelection:_n,collapsedHeaders:Bn,columnBorders:w,columnReordering:F,columnResizing:T,draggedHeaderRef:an,editColumns:B,enableHeaderEditing:z,enableRowSelection:G,expandIcon:X,filters:xt,forceUpdate:on,getBorderClass:Bt,handleApplyFilter:tr,handleClearAllFilters:St,handleClearFilter:Ct,handleMouseDown:Ot,handleMouseOver:Pt,handleRowSelect:Kn,handleSelectAll:Jn,handleToggleRow:Xn,headerCollapseIcon:ne,headerContainerRef:xn,headerDropdown:oe,headerExpandIcon:re,headerRegistry:Dt.current,headers:$n,hoveredHeaderRef:sn,isAnimating:Wt,isCopyFlashing:zt,isInitialFocusedCell:Yt,isResizing:Nn,isRowSelected:Yn,isScrolling:Mn,isSelected:Gt,isWarningFlashing:Ut,mainBodyRef:ln,nextIcon:de,onCellEdit:fe,onCellClick:he,onColumnOrderChange:ve,onColumnSelect:pe,onLoadMore:xe,onSort:er,onTableHeaderDragEnd:nr,pinnedLeftRef:cn,pinnedRightRef:vn,prevIcon:Ie,rowButtons:Re,rowGrouping:je,rowHeight:ke,headerHeight:null!=ae?ae:ke,rowIdAccessor:Ne,scrollbarWidth:it,selectColumns:Vt,selectableColumns:Be,selectedColumns:Jt,columnsWithSelectedCells:Qt,rowsWithSelectedCells:Zt,selectedRows:qn,selectedRowCount:Un,selectedRowsData:Vn,setCollapsedHeaders:On,setHeaders:En,setInitialFocusedCell:Xt,setIsResizing:Hn,setIsScrolling:Fn,setSelectedCells:_t,setSelectedColumns:$t,setSelectedRows:zn,setUnexpandedRows:rt,shouldPaginate:Pe,sortDownIcon:ze,sortUpIcon:Ge,tableBodyContainerRef:wn,tableRows:Ht,theme:Ke,unexpandedRows:tt,useHoverRowBackground:Xe,useOddColumnBackground:nn,useOddEvenRowBackground:$e,activeHeaderDropdown:Tn,setActiveHeaderDropdown:Dn,onHeaderEdit:we}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(Ke," ").concat(null!=h?h:""," ").concat(w?"st-column-borders":""),style:se?{height:se}:{}},{children:e.jsx(hn,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(pn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:qt,onMouseLeave:qt},{children:[e.jsx(Qe,{pinnedLeftWidth:ft,pinnedRightWidth:ht,setScrollTop:et,sort:jt,tableRows:Ht,rowsToRender:At}),e.jsx(un,{columnEditorText:A,editColumns:B,editColumnsInitOpen:P,headers:jn,position:I})]})),e.jsx(Ze,{mainBodyRef:ln,mainBodyWidth:dt,pinnedLeftWidth:ft,pinnedRightWidth:ht,pinnedLeftContentWidth:vt,pinnedRightContentWidth:pt,tableBodyContainerRef:wn}),e.jsx(E,{currentPage:Sn,hideFooter:ce,onPageChange:In,onNextPage:be,shouldPaginate:Pe,totalPages:Math.ceil(Et.length/We)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(Cn,o({},t)):null};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.1",
2
+ "version": "1.5.3",
3
3
  "main": "dist/index.js",
4
4
  "module": "dist/index.es.js",
5
5
  "types": "dist/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "./styles.css": "./dist/styles.css"
21
21
  },
22
- "license": "SEE LICENSE IN EULA.txt",
22
+ "license": "MIT",
23
23
  "files": [
24
24
  "dist",
25
25
  "LICENSE",