simple-table-core 1.8.8 → 1.8.9

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.
Files changed (33) hide show
  1. package/dist/{Animate-0fec37fc.js → Animate-2b4177d4.js} +2 -2
  2. package/dist/Animate-2b4177d4.js.map +1 -0
  3. package/dist/{DatePicker-3baedbf0.js → DatePicker-b28d8e22.js} +2 -2
  4. package/dist/DatePicker-b28d8e22.js.map +1 -0
  5. package/dist/cjs/{Animate-b13abc6f.js → Animate-5b511261.js} +2 -2
  6. package/dist/cjs/Animate-5b511261.js.map +1 -0
  7. package/dist/cjs/{DatePicker-1565e4c0.js → DatePicker-59c069e5.js} +2 -2
  8. package/dist/cjs/DatePicker-59c069e5.js.map +1 -0
  9. package/dist/cjs/components/simple-table/SimpleTable.d.ts +2 -0
  10. package/dist/cjs/context/TableContext.d.ts +3 -0
  11. package/dist/cjs/index-185a7b0e.js +2 -0
  12. package/dist/cjs/index-185a7b0e.js.map +1 -0
  13. package/dist/cjs/index.d.ts +2 -1
  14. package/dist/cjs/index.js +1 -1
  15. package/dist/cjs/types/OnRowGroupExpandProps.d.ts +12 -0
  16. package/dist/cjs/utils/rowUtils.d.ts +8 -0
  17. package/dist/components/simple-table/SimpleTable.d.ts +2 -0
  18. package/dist/context/TableContext.d.ts +3 -0
  19. package/dist/index-76da1a62.js +2 -0
  20. package/dist/index-76da1a62.js.map +1 -0
  21. package/dist/index.d.ts +2 -1
  22. package/dist/index.es.js +1 -1
  23. package/dist/types/OnRowGroupExpandProps.d.ts +12 -0
  24. package/dist/utils/rowUtils.d.ts +8 -0
  25. package/package.json +1 -1
  26. package/dist/Animate-0fec37fc.js.map +0 -1
  27. package/dist/DatePicker-3baedbf0.js.map +0 -1
  28. package/dist/cjs/Animate-b13abc6f.js.map +0 -1
  29. package/dist/cjs/DatePicker-1565e4c0.js.map +0 -1
  30. package/dist/cjs/index-53415a9e.js +0 -2
  31. package/dist/cjs/index-53415a9e.js.map +0 -1
  32. package/dist/index-168b7d60.js +0 -2
  33. package/dist/index-168b7d60.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import t,{useEffect as o,useState as i,useRef as a,useMemo as u,useCallback as l,createContext as c,useContext as s,lazy as d,Suspense as f,Fragment as v,cloneElement as h,forwardRef as w,useImperativeHandle as p,isValidElement as m,useLayoutEffect as g,useReducer as b}from"react";var I=function(){return I=Object.assign||function(n){for(var e,r=1,t=arguments.length;t>r;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},I.apply(this,arguments)};function x(n,e){var r={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&0>e.indexOf(t)&&(r[t]=n[t]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(n);t.length>o;o++)0>e.indexOf(t[o])&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(r[t[o]]=n[t[o]])}return r}function C(n,e,r,t){return new(r||(r=Promise))(function(o,i){function a(n){try{l(t.next(n))}catch(n){i(n)}}function u(n){try{l(t.throw(n))}catch(n){i(n)}}function l(n){var e;n.done?o(n.value):(e=n.value,e instanceof r?e:new r(function(n){n(e)})).then(a,u)}l((t=t.apply(n,e||[])).next())})}function y(n,e){var r,t,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=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&u[0]?t.return:u[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,u[1])).done)return o;switch(t=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,t=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&o[3]>u[1])){i.label=u[1];break}if(6===u[0]&&o[1]>i.label){i.label=o[1],o=u;break}if(o&&o[2]>i.label){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=e.call(n,i)}catch(n){u=[6,n],t=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}function R(n,e,r){if(r||2===arguments.length)for(var t,o=0,i=e.length;i>o;o++)!t&&o in e||(t||(t=Array.prototype.slice.call(e,0,o)),t[o]=e[o]);return n.concat(t||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var S=1,N=function(n){return Math.ceil(800/(n+1))},A=function(n){return 480>n?.3:768>n?.4:.8},M="parentExpanded",k=function(n,e){if(!n.children||0===n.children.length)return[e];var r=[],t=function(n,e){if(!n.children||0===n.children.length)return r.push(e),e+1;for(var o=e,i=0,a=n.children;a.length>i;i++)o=t(a[i],o);return o};return t(n,e),r},E=function(n){return n.flatMap(function(n){var e=[n];return n.children&&n.children.length>0&&e.push.apply(e,E(n.children)),e})},H=function(n){return void 0===n&&(n=0),n?n+1:0},T=function(n){var e=n.accessor;return"".concat(n.rowId,"-").concat(e)},F=function(n){var e=n.header,r=n.pinned,t=n.headers,o=n.collapsedHeaders;return e.hide||e.excludeFromRender||(r||e.pinned)&&e.pinned!==r?null:!(t&&o&&function(n,e,r){var t=function(n,e){for(var r=0,t=E(n);t.length>r;r++){var o=t[r];if(o.children&&o.children.length>0&&o.children.some(function(n){return n.accessor===e}))return o}return null}(e,n.accessor);if(t){var o=r.has(t.accessor),i=n.showWhen||M;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(e,t,o))||null},D=function(n){var e=n.accessor;return"".concat(n.rowId,"-").concat(e)},O=function(n,e){return n.hide?[]:n.children&&0!==n.children.length?e&&e.has(n.accessor)?n.children.filter(function(n){var e=n.showWhen||M;return"parentCollapsed"===e||"always"===e}).flatMap(function(n){return O(n,e)}):n.children.filter(function(n){var e=n.showWhen||M;return"parentExpanded"===e||"always"===e}).flatMap(function(n){return O(n,e)}):[n]},L=function(n){if(n.hide)return 0;if("number"==typeof n.width)return n.width;if("string"==typeof n.width&&n.width.endsWith("px"))return parseFloat(n.width);var e=document.getElementById(T({accessor:n.accessor,rowId:"header"}));return(null==e?void 0:e.offsetWidth)||150},P=function(n){var e,r=n.width;"string"==typeof r&&r.includes("fr")&&(n.width=(null===(e=document.getElementById(T({accessor:n.accessor,rowId:"header"})))||void 0===e?void 0:e.offsetWidth)||150),n.children&&n.children.length>0&&n.children.forEach(function(n){P(n)})},B=function(n){return"number"==typeof n.minWidth?n.minWidth:40},W=function(n,e){return e.includes(".")?(e+"").split(".").reduce(function(n,e){return null==n?void 0:n[e]},n):n[e]},q=function(n,e,r){if("string"!=typeof e||e.includes(".")){for(var t=(e+"").split("."),o=n,i=0;t.length-1>i;i++){var a=t[i];null!=o[a]&&"object"==typeof o[a]||(o[a]={}),o=o[a]}o[t[t.length-1]]=r}else n[e]=r},z=function(n){return Array.isArray(n)&&n.length>0&&"object"==typeof n[0]&&null!==n[0]},j=function(n){return n.row[n.rowIdAccessor]},_=function(n,e,r){var t=n+"";return e?!r.has(t):r.has(t)},U=function(n){var e=n.contentHeight,r=n.scrollTop,t=n.tableRows,o=n.scrollDirection,i=void 0===o?"none":o,a=n.rowHeight+1,u=n.bufferRowCount*a,l=u,c=u;"down"===i?(l=Math.max(a,.1*u),c=.9*u):"up"===i&&(l=.9*u,c=Math.max(a,.1*u));var s=r+e+c,d=Math.max(0,Math.floor(Math.max(0,r-l)/a)),f=Math.min(t.length,Math.ceil(s/a)),v=r+e,h=Math.max(0,Math.ceil(r/a)),w=Math.min(t.length,Math.floor(v/a)),p=r+e,m=Math.max(0,Math.floor(r/a)),g=Math.min(t.length,Math.ceil(p/a));return{rendered:{startIndex:d,endIndex:f,rows:t.slice(d,f)},fullyVisible:{startIndex:h,endIndex:w,rows:t.slice(h,w)},partiallyVisible:{startIndex:m,endIndex:g,rows:t.slice(m,g)}}},G=function(n){return U({bufferRowCount:n.bufferRowCount,contentHeight:n.contentHeight,rowHeight:n.rowHeight,scrollTop:n.scrollTop,tableRows:n.tableRows,scrollDirection:n.scrollDirection}).rendered.rows},V=function(n){return n.position*(n.rowHeight+1)-1},K=function(n){return n.position*(n.rowHeight+1)},J=function(n,e,r){var t=n.getBoundingClientRect(),o=e.getBoundingClientRect(),i=10;if(o.top+i>t.top?e.scrollTop-=o.top-t.top+i:t.bottom>o.bottom-i&&(e.scrollTop+=t.bottom-o.bottom+i),r){var a=r.getBoundingClientRect();a.left+i>t.left?r.scrollLeft-=a.left-t.left+i:t.right>a.right-i&&(r.scrollLeft+=t.right-a.right+i)}},X=function(n,e,r){var t=document.querySelector(".st-body-container"),o=document.querySelector(".st-body-main");if(t){var i=e+1,a=document.querySelector('.st-cell[data-row-index="'.concat(n.rowIndex,'"][data-col-index="').concat(n.colIndex,'"][data-row-id="').concat(n.rowId,'"]'));if(a&&r){var u=function(n,e,r,t){var o=U({bufferRowCount:0,contentHeight:e.clientHeight,rowHeight:r,scrollTop:e.scrollTop,tableRows:t,scrollDirection:"none"}).fullyVisible;return n>=o.startIndex&&o.endIndex>n}(n.rowIndex,t,e,r);if(u)return void J(a,t,o)}if(!a)return t.scrollTop=Math.max(0,n.rowIndex*i-t.clientHeight/3),void setTimeout(function(){var e=document.querySelector('.st-cell[data-row-index="'.concat(n.rowIndex,'"][data-col-index="').concat(n.colIndex,'"][data-row-id="').concat(n.rowId,'"]'));e&&J(e,t,o)},100);J(a,t,o)}},Y=function(n){var e=n.colIndex,r=n.rowId;return"".concat(n.rowIndex,"-").concat(e,"-").concat(r)},$=c(void 0),Z=function(e){return n($.Provider,I({value:e.value},{children:e.children}))},Q=function(){var n=s($);if(void 0===n)throw Error("useTableContext must be used within a TableProvider");return n},nn=function(t){var o=t.currentPage,a=t.footerRenderer,u=t.hideFooter,l=t.onPageChange,c=t.onNextPage,s=t.onUserPageChange,d=t.rowsPerPage,f=t.shouldPaginate,v=t.totalPages,h=t.totalRows,w=Q(),p=w.nextIcon,m=w.prevIcon,g=i(!0),b=g[0],x=g[1],R=o>1,S=v>o,N=o===v,A=Math.min((o-1)*d+1,h),M=Math.min(o*d,h),k=!R,E=!S&&!c||!b&&N,H=function(){return C(void 0,void 0,void 0,function(){var n;return y(this,function(e){switch(e.label){case 0:return 1>(n=o-1)?[3,2]:(l(n),s?[4,s(n)]:[3,2]);case 1:e.sent(),e.label=2;case 2:return[2]}})})},T=function(){return C(void 0,void 0,void 0,function(){var n,e;return y(this,function(r){switch(r.label){case 0:return n=o===v,e=o+1,c&&n?[4,c(o)]:[3,2];case 1:if(!r.sent())return x(!1),[2];r.label=2;case 2:return e>v&&!c?[3,4]:(l(e),s?[4,s(e)]:[3,4]);case 3:r.sent(),r.label=4;case 4:return[2]}})})},F=function(n){return C(void 0,void 0,void 0,function(){return y(this,function(e){switch(e.label){case 0:return 1>n||n>v?[3,2]:(l(n),s?[4,s(n)]:[3,2]);case 1:e.sent(),e.label=2;case 2:return[2]}})})};if(u||!f)return null;if(a)return n(e,{children:a({currentPage:o,totalPages:v,rowsPerPage:d,totalRows:h,startRow:A,endRow:M,onPageChange:F,onNextPage:T,onPrevPage:H,hasNextPage:!E,hasPrevPage:!k,nextIcon:p,prevIcon:m})});var D=function(){if(15>=v)return Array.from({length:v},function(n,e){return e+1});var n,e,r=[];o>8?v-7>o?(n=o-7,e=o+7):(n=Math.max(1,v-15+1),e=v):(n=1,e=14);for(var t=n;e>=t;t++)r.push(t);return v-1>e&&(r.push(-1),r.push(v)),r}();return r("div",I({className:"st-footer"},{children:[n("div",I({className:"st-footer-info"},{children:r("span",I({className:"st-footer-results-text"},{children:["Showing ",A," to ",M," of ",h.toLocaleString()," results"]}))})),r("div",I({className:"st-footer-pagination"},{children:[D.map(function(e,r){return 0>e?n("span",I({className:"st-page-ellipsis"},{children:"..."}),r):n("button",I({onClick:function(){return F(e)},className:"st-page-btn ".concat(o===e?"active":"")},{children:e}),r)}),n("button",I({className:"st-next-prev-btn ".concat(k?"disabled":""),onClick:H,disabled:k},{children:m})),n("button",I({className:"st-next-prev-btn ".concat(E?"disabled":""),onClick:T,disabled:E},{children:p}))]}))]}))},en=function(e){return n("svg",I({className:e.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},rn=function(e){return n("svg",I({className:e.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},tn=function(e){return n("svg",I({className:e.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},on=function(e){return n("svg",I({className:e.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},an=function(e){return n("svg",I({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:e.className,style:{height:"1em"}},{children:n("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"})}))},un=function(e){return n("svg",I({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:e.className,style:I({height:"10px"},e.style)},{children:n("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"})}))},ln=function(e){return n("svg",I({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:e.className,style:{height:"1em"}},{children:n("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"})}))},cn=function(e){return n("svg",I({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:e.className,style:I({height:"1em"},e.style)},{children:n("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"})}))},sn=function(){return n("svg",I({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},dn=function(n){var e=n.headerContainerRef,r=n.mainSectionRef,t=n.scrollbarWidth,a=i(!1),u=a[0],l=a[1];return o(function(){var n=null==e?void 0:e.current;if(u&&n)return n.classList.add("st-header-scroll-padding"),n.style.setProperty("--st-after-width","".concat(t,"px")),function(){n.classList.remove("st-header-scroll-padding")}},[e,u,t]),o(function(){var n=null==r?void 0:r.current;if(n&&(null==e?void 0:e.current)){var t=function(){n&&l(n.scrollHeight>n.clientHeight)};t();var o=new ResizeObserver(function(){t()});return o.observe(n),function(){n&&o.unobserve(n)}}},[e,r]),{isMainSectionScrollable:u}},fn=function(e){var r=e.children,t=e.onClose,u=e.open,l=e.overflow,c=void 0===l?"auto":l,s=e.setOpen,d=e.width,f=e.containerRef,v=e.positioning,h=void 0===v?"fixed":v,w=Q().mainBodyRef,p=a(null),m=a(null),g=i("bottom-left"),b=g[0],x=g[1],C=i({}),y=C[0],R=C[1],S=i(!1),N=S[0],A=S[1];return o(function(){u&&p.current?(A(!1),!m.current&&p.current.parentElement&&(m.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&m.current){var n,e=p.current,r=m.current.getBoundingClientRect(),t=e.offsetHeight,o=d||e.offsetWidth,i=(n=(null==f?void 0:f.current)?f.current.getBoundingClientRect():(null==w?void 0:w.current)?w.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-r.bottom,a=r.top-n.top,u="bottom",l={};(t>i&&a>=t||t>i&&a>i)&&(u="top");var c="left";o>n.right-r.right+r.width&&(c="right"),"fixed"===h?("bottom"===u?l.top=r.bottom+4:l.bottom=window.innerHeight-r.top+4,"left"===c?l.left=r.left:l.right=window.innerWidth-r.right):("bottom"===u?l.top=r.height+4:l.bottom=r.height+4,"left"===c?l.left=0:l.right=0),x("".concat(u,"-").concat(c)),R(l),A(!0)}})):u||A(!1)},[u,d,f,w,h]),o(function(){var n=function(n){u&&p.current&&p.current&&!p.current.contains(n.target)&&(s(!1),null==t||t())};return u&&window.addEventListener("scroll",n,!0),function(){window.removeEventListener("scroll",n,!0)}},[u,t,s]),o(function(){var n=function(n){if(p.current&&!p.current.contains(n.target)){var e=p.current.parentElement;e&&!e.contains(n.target)&&(s(!1),null==t||t())}};return u&&document.addEventListener("mousedown",n,!0),function(){document.removeEventListener("mousedown",n,!0)}},[t,u,s]),o(function(){var n=function(n){"Escape"===n.key&&u&&(s(!1),null==t||t())};return u&&document.addEventListener("keydown",n),function(){document.removeEventListener("keydown",n)}},[t,u,s]),u?n("div",I({ref:p,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(n){return n.stopPropagation()},style:I(I({position:h,width:d?"".concat(d,"px"):"auto",visibility:N?"visible":"hidden"},y),{overflow:c})},{children:r})):null},vn=function(e){var r=e.children,t=e.onClick,o=e.isSelected,i=void 0!==o&&o,a=e.disabled,u=void 0!==a&&a,l=e.className,c=void 0===l?"":l;return n("div",I({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(u?"disabled":""," ").concat(c),onClick:function(){!u&&t&&t()},role:"option","aria-selected":i,"aria-disabled":u},{children:r}))},hn=function(e){var t=e.onBlur,o=e.onChange,a=e.open,u=e.setOpen,l=i(e.value),c=l[0],s=l[1],d=function(n){s(n),o(n),u(!1),t()};return r(fn,I({open:a,onClose:function(){t()},setOpen:u,width:120},{children:[n(vn,I({isSelected:!0===c,onClick:function(){return d(!0)}},{children:"True"})),n(vn,I({isSelected:!1===c,onClick:function(){return d(!1)}},{children:"False"}))]}))},wn=function(e){var r=e.defaultValue,t=e.onBlur,o=e.onChange,i=a(null);return n("input",{className:"editable-cell-input",ref:i,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(n){o(n.target.value)},onKeyDown:function(n){n.stopPropagation(),"Enter"!==n.key&&"Escape"!==n.key||t()},onMouseDown:function(n){n.stopPropagation()}})},pn=function(e){var r=e.defaultValue,t=e.onBlur,o=e.onChange,i=a(null);return n("input",{className:"editable-cell-input",ref:i,autoFocus:!0,defaultValue:""+r,onBlur:t,onChange:function(n){var e=n.target.value;/^\d*\.?\d*$/.test(e)&&o(e)},onKeyDown:function(n){n.stopPropagation(),"Enter"!==n.key&&"Escape"!==n.key||t()},onMouseDown:function(n){n.stopPropagation()}})},mn=d(function(){return import("./Animate-2b4177d4.js")}),gn=d(function(){return import("./DatePicker-b28d8e22.js")}),bn=d(function(){return Promise.resolve().then(function(){return Ye})}),In=d(function(){return Promise.resolve().then(function(){return Ze})}),xn=function(e){var r=x(e,["parentRef","tableRow"]);return n(f,I({fallback:n("div",I({},r))},{children:n(mn,I({},e))}))},Cn=function(e){return n(f,I({fallback:n("div",I({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:n(gn,I({},e))}))},yn=function(e){var r=e.width,t=e.height;return n(f,I({fallback:n("div",{style:{width:void 0===r?100:r,height:void 0===t?30:t,background:"#f3f4f6"}})},{children:n(bn,I({},e))}))},Rn=function(e){var r=e.width,t=e.height;return n(f,I({fallback:n("div",{style:{width:void 0===r?100:r,height:void 0===t?30:t,background:"#f3f4f6"}})},{children:n(In,I({},e))}))},Sn=function(n){if(!n)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(n)){var e=n.split("-").map(Number);return new Date(e[0],e[1]-1,e[2],12,0,0)}var r=new Date(n);return isNaN(r.getTime())?new Date:new Date(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0)},Nn=function(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0)},An=function(n){if(!n)return new Date;if("string"==typeof n)return Sn(n);if("number"==typeof n){var e=new Date(n);return isNaN(e.getTime())?new Date:Nn(e)}return n instanceof Date?Nn(n):new Date},Mn=function(n){return n?Sn(""+n):new Date},kn=function(e){var r=e.onBlur,t=e.onChange,i=e.open,a=e.setOpen,u=e.value;o(function(){var n=setTimeout(function(){var n=document.querySelector(".st-dropdown-container");n instanceof HTMLElement&&n.focus()},0);return function(){return clearTimeout(n)}},[]);var l=function(){r()};return n(fn,I({open:i,onClose:l,setOpen:a,width:280},{children:n(Cn,{value:Mn(u),onChange:function(n){var e=n.toISOString().split("T")[0];t(e),a(!1),r()},onClose:l})}))},En=function(e){var r=e.onBlur,t=e.onChange,o=e.open,a=e.options,u=e.setOpen,l=i(e.value||""),c=l[0],s=l[1];return n(fn,I({open:o,onClose:function(){r()},setOpen:u,width:150},{children:n("div",I({className:"st-enum-dropdown-content"},{children:a.map(function(e){return n(vn,I({isSelected:c===e.value,onClick:function(){return s(n=e.value),t(n),u(!1),void r();var n}},{children:e.label}),e.value)})}))}))},Hn=function(e){var r=e.enumOptions,t=void 0===r?[]:r,o=e.onChange,i=e.setIsEditing,a=e.type,u=void 0===a?"string":a,l=e.value,c=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?n(hn,{onBlur:c,onChange:function(n){return o(n)},open:!0,setOpen:i,value:l}):"date"===u?n(kn,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?n(En,{onBlur:c,onChange:o,open:!0,options:t,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?n(pn,{defaultValue:l,onBlur:c,onChange:function(n){var e=""===n?0:parseFloat(n);o(isNaN(e)?0:e)}}):n(wn,{defaultValue:null==l?"":l+"",onBlur:c,onChange:o})},Tn=0,Fn=function(){return function(n){var e=n.callback,r=n.callbackProps,t=n.limit,o=Date.now();0!==Tn&&t>o-Tn||(Tn=o,e(r))}},Dn=function(n){var e=a(n);return o(function(){JSON.stringify(e.current)!==JSON.stringify(n)&&(e.current=n)},[n]),e.current},On=function(n){if(null===n||"object"!=typeof n)return n;if(Array.isArray(n))return n.map(On);var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=On(n[r]));return e},Ln=function(n,e){return n.filter(function(n){return n.pinned===e}).some(function(n){return!n.hide})},Pn=Date.now(),Bn={screenX:0,screenY:0},Wn=function(n,e,r){void 0===r&&(r=[]);for(var t=0;n.length>t;t++){var o=n[t];if(o.accessor===e)return R(R([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=Wn(o.children,e,R(R([],r,!0),[t],!1));if(i)return i}}return null},qn=function(n){return"left"===n.pinned?"left":"right"===n.pinned?"right":"main"};var zn=function(n){var e=n.draggedHeaderRef,r=n.headers,t=n.hoveredHeaderRef,o=n.onColumnOrderChange,i=n.onTableHeaderDragEnd,a=Q().setHeaders,u=Dn(r);return{handleDragStart:function(n){e.current=n,Pn=Date.now()},handleDragOver:function(n){var o=n.event,a=n.hoveredHeader;if(o.preventDefault(),r&&e.current){var l=o.currentTarget.getAnimations().some(function(n){return"running"===n.playState}),c=o.screenX,s=o.screenY,d=Math.sqrt(Math.pow(c-Bn.screenX,2)+Math.pow(s-Bn.screenY,2));t.current=a;var f,v=e.current,h=!1;if(qn(v)!==qn(a))f=(y=function(n,e,r){var t,o,i=On(n),a=!1;try{var u=qn(r),l=i.findIndex(function(n){return n.accessor===e.accessor}),c=i.findIndex(function(n){return n.accessor===r.accessor});if(-1===l||-1===c)return{newHeaders:i,emergencyBreak:a=!0};var s=i.splice(l,1)[0],d=(t=u,o=I({},s),"left"===t?o.pinned="left":"right"===t?o.pinned="right":delete o.pinned,o);i.splice(c,0,d)}catch(n){console.error("Error in insertHeaderAcrossSections:",n),a=!0}return{newHeaders:i,emergencyBreak:a}}(r,v,a)).newHeaders,h=y.emergencyBreak;else{var w=r,p=Wn(w,v.accessor),m=Wn(w,a.accessor);if(!p||!m)return;var g=p.length,b=m.length,x=m;if(g!==b){var C=b-g;C>0&&(x=m.slice(0,-C))}var y=function(n,e,r){var t=On(n),o=!1;function i(n,e){for(var r=n,t=0;e.length-1>t;t++)r=r[e[t]].children;return r[e[e.length-1]]}function a(n,e,r){for(var t=n,i=0;e.length-1>i;i++){if(!t[e[i]].children){o=!0;break}t=t[e[i]].children}t[e[e.length-1]]=r}var u=i(t,e);return a(t,e,i(t,r)),a(t,r,u),{newHeaders:t,emergencyBreak:o}}(w,p,x);f=y.newHeaders,h=y.emergencyBreak}if(!(l||a.accessor===v.accessor||10>d||JSON.stringify(f)===JSON.stringify(r)||h)){var R=Date.now();JSON.stringify(f)===JSON.stringify(u)&&(1500>R-Pn||40>d)||(Pn=R,Bn={screenX:c,screenY:s},i(f))}}},handleDragEnd:function(){e.current=null,t.current=null,setTimeout(function(){a(function(n){return R([],n,!0)}),null==o||o(r)},10)}}},jn=function(e){var t=e.checked,o=void 0!==t&&t,i=e.children,a=e.onChange;return r("label",I({className:"st-checkbox-label"},{children:[n("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),n("span",I({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&n(un,{className:"st-checkbox-checkmark"})})),i]}))},_n=function(e){var r,t=e.content,o=e.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:e.colIndex,row:e.row,rowIndex:e.rowIndex,value:t}):"lineAreaChart"===o.type&&Array.isArray(t)?(r=t.filter(function(n){return"number"==typeof n})).length>0?n(yn,I({data:r},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(t)?(r=t.filter(function(n){return"number"==typeof n})).length>0?n(Rn,I({data:r},o.chartOptions)):null:"boolean"==typeof t?t?"True":"False":Array.isArray(t)?0===t.length?"[]":t.map(function(n){return"object"==typeof n&&null!==n?JSON.stringify(n):n+""}).join(", "):"date"===o.type&&null!==t&&("string"==typeof t||"number"==typeof t||"object"==typeof t&&t instanceof Date)?An(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):t},Un=t.memo(function(e){var t=e.borderClass,c=e.colIndex,s=e.displayRowNumber,d=e.header,f=e.isHighlighted,v=e.isInitialFocused,h=e.nestedIndex,w=e.parentHeader,p=e.rowIndex,m=e.tableRow,g=Q(),b=g.cellRegistry,x=g.cellUpdateFlash,C=g.columnBorders,y=g.draggedHeaderRef,R=g.enableRowSelection,S=g.expandAll,N=g.expandIcon,A=g.handleMouseDown,M=g.handleMouseOver,k=g.handleRowSelect,E=g.headers,H=g.hoveredHeaderRef,F=g.isCopyFlashing,O=g.isLoading,L=g.isRowSelected,P=g.isWarningFlashing,B=g.onCellEdit,U=g.onCellClick,G=g.onRowGroupExpand,V=g.onTableHeaderDragEnd,K=g.rowButtons,J=g.rowGrouping,X=g.rowIdAccessor,Y=g.rowsWithSelectedCells,$=g.selectedColumns,Z=g.setUnexpandedRows,nn=g.tableBodyContainerRef,en=g.theme,rn=g.unexpandedRows,tn=g.useOddColumnBackground,on=m.depth,an=m.row,un=i(W(an,d.accessor)),ln=un[0],cn=un[1],sn=i(!1),dn=sn[0],fn=sn[1],vn=i(!1),hn=vn[0],wn=vn[1],pn=i(!1),mn=pn[0],gn=pn[1],bn=a(null),In=j({row:an,rowIdAccessor:X}),Cn=J&&J[on],yn=!!Cn&&function(n,e){return!!e&&z(n[e])}(an,Cn),Rn=J&&J.length>on,Sn=_(In,S,rn),Nn=F({rowIndex:p,colIndex:c,rowId:In}),An=P({rowIndex:p,colIndex:c,rowId:In}),Mn=u(function(){var n,e,r;if(!C)return!1;var t=E.filter(function(n){return"left"===n.pinned}),o=E.filter(function(n){return!n.pinned}),i=E.filter(function(n){return"right"===n.pinned});return"left"===d.pinned?(null===(n=t[t.length-1])||void 0===n?void 0:n.accessor)===d.accessor:"right"===d.pinned?(null===(e=i[i.length-1])||void 0===e?void 0:e.accessor)===d.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===d.accessor},[C,E,d.accessor,d.pinned]),kn=zn({draggedHeaderRef:y,headers:E,hoveredHeaderRef:H,onTableHeaderDragEnd:V}).handleDragOver,En=Fn(),Tn=T({accessor:d.accessor,rowId:In}),Dn=D({rowId:In,accessor:d.accessor}),On=d.isSelectionColumn&&R;o(function(){if(b){var n="".concat(In,"-").concat(d.accessor);return b.set(n,{updateContent:function(n){ln!==n?(cn(n),x&&(wn(!0),bn.current&&clearTimeout(bn.current),bn.current=setTimeout(function(){wn(!1)},800))):cn(n)}}),function(){b.delete(n),bn.current&&clearTimeout(bn.current)}}},[b,x,In,d.accessor,ln]),o(function(){if(hn){var n=setTimeout(function(){wn(!1)},850);return function(){return clearTimeout(n)}}},[hn]),o(function(){cn(W(an,d.accessor))},[an,d.accessor]);var Ln="boolean"===d.type||"date"===d.type||"enum"===d.type,Pn=!!(null==d?void 0:d.isEditable),Bn=$.has(c),Wn=f&&!Bn,qn=u(function(){return!!On&&Y.has(In+"")},[On,Y,In]),Un=null==w?void 0:w.singleRowChildren,Gn="st-cell ".concat(on>0&&d.expandable?"st-cell-depth-".concat(on):""," ").concat(Wn?v?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").concat(Bn?v?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Pn?"clickable":""," ").concat(hn?v?"st-cell-updating-first":"st-cell-updating":""," ").concat(Nn?v?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(An?v?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(tn?h%2==0?"even-column":"odd-column":""," ").concat(On?"st-selection-cell":""," ").concat(qn?"st-selection-has-highlighted-cell":""," ").concat(Mn?"st-last-column":""," ").concat(Un?"st-sub-cell":""),Vn=l(function(n){null==n&&(n="number"===d.type?0:"boolean"!==d.type&&""),cn(n),q(an,d.accessor,n),null==B||B({accessor:d.accessor,newValue:n,row:an,rowIndex:p})},[d.accessor,d.type,B,an,p]),Kn=l(function(n){n.stopPropagation();var e=_(In,S,rn),r=In+"";Z(function(n){var e=new Set(n);return e.has(r)?e.delete(r):e.add(r),e}),G&&G({row:an,rowIndex:p,depth:on,event:n,rowId:In,groupingKey:Cn,isExpanded:!e})},[In,an,p,on,Cn,S,rn,Z,G]);return O?n("div",I({className:Gn},{children:n("span",I({className:"st-cell-content ".concat("right"===d.align?"right-aligned":"center"===d.align?"center-aligned":"left-aligned")},{children:n("div",{className:"st-loading-skeleton"})}))})):!dn||Ln||On?r(xn,I({className:Gn,"data-accessor":d.accessor,"data-col-index":c,"data-row-id":In,"data-row-index":p,id:Tn,onClick:function(){U&&!On&&U({accessor:d.accessor,colIndex:c,row:an,rowId:In,rowIndex:p,value:ln})},onDoubleClick:function(){return d.isEditable&&!On&&fn(!0)},onDragOver:function(n){On||En({callback:kn,callbackProps:{event:n,hoveredHeader:d},limit:50})},onKeyDown:function(n){dn||On||"F2"!==n.key&&"Enter"!==n.key||!d.isEditable||dn||(n.preventDefault(),fn(!0))},onMouseDown:function(){dn||On||A({rowIndex:p,colIndex:c,rowId:In})},onMouseEnter:function(){gn(!0)},onMouseLeave:function(){gn(!1)},onMouseOver:function(){dn||On||M({rowIndex:p,colIndex:c,rowId:In})},parentRef:nn,tableRow:m},{children:[d.expandable&&Rn&&(yn||G)?n("div",I({className:"st-icon-container st-expand-icon-container ".concat(Sn?"expanded":"collapsed"),onClick:Kn},{children:N})):null,n("span",I({className:"st-cell-content ".concat("right"===d.align?"right-aligned":"center"===d.align?"center-aligned":"left-aligned")},{children:O?n("div",{className:"st-loading-skeleton"}):n("span",{children:On?r("div",I({className:"st-selection-cell-content"},{children:[n("div",I({className:"st-selection-control"},{children:mn||L&&L(In+"")?n(jn,{checked:!!L&&L(In+""),onChange:function(n){k&&k(In+"",n)}}):n("span",I({className:"st-row-number"},{children:s+1}))})),function(){if(!K||!On||0===K.length)return null;if(!(mn||L&&L(In+"")))return null;var e={row:an};return n("div",I({className:"st-row-buttons"},{children:K.map(function(r,t){return n("span",I({className:"st-row-button"},{children:r(e)}),t)})}))}()]})):d.cellRenderer?function(){var n;return d.cellRenderer({accessor:d.accessor,colIndex:c,row:an,theme:en,value:ln,formattedValue:null===(n=null==d?void 0:d.valueFormatter)||void 0===n?void 0:n.call(d,{accessor:d.accessor,colIndex:c,row:an,rowIndex:p,value:ln})})}():_n({content:ln,header:d,colIndex:c,row:an,rowIndex:p})})})),!O&&dn&&Ln&&!On&&n(Hn,{enumOptions:d.enumOptions,onChange:Vn,setIsEditing:fn,type:d.type,value:ln})]}),Dn):n("div",I({className:"st-cell-editing",id:T({accessor:d.accessor,rowId:In}),onMouseDown:function(n){return n.stopPropagation()},onKeyDown:function(n){return n.stopPropagation()}},{children:n(Hn,{enumOptions:d.enumOptions,onChange:Vn,setIsEditing:fn,type:d.type,value:ln})}))},function(n,e){if(n.rowIndex!==e.rowIndex||n.colIndex!==e.colIndex||n.isHighlighted!==e.isHighlighted||n.isInitialFocused!==e.isInitialFocused||n.borderClass!==e.borderClass)return!1;if(n.tableRow!==e.tableRow){if(n.tableRow.row!==e.tableRow.row)return!1;if(n.tableRow.position!==e.tableRow.position||n.tableRow.displayPosition!==e.tableRow.displayPosition)return!1}return(n.header===e.header||n.header.accessor===e.header.accessor&&n.header.isEditable===e.header.isEditable&&n.header.type===e.header.type&&n.header.cellRenderer===e.header.cellRenderer&&n.header.valueFormatter===e.header.valueFormatter)&&n.parentHeader===e.parentHeader&&n.displayRowNumber===e.displayRowNumber&&n.nestedIndex===e.nestedIndex}),Gn=function(e){var t=e.columnIndices,o=e.displayRowNumber,i=e.header,a=e.headers,u=e.nestedIndex,l=e.parentHeader,c=e.pinned,s=e.rowIndex,d=e.rowIndices,f=e.tableRow,h=t[i.accessor],w=Q(),p=w.getBorderClass,m=w.isSelected,g=w.isInitialFocusedCell,b=w.collapsedHeaders,I=j({row:f.row,rowIdAccessor:w.rowIdAccessor});if(i.children&&i.children.length>0){var x=i.children.filter(function(n){return F({header:n,pinned:c,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var C={rowIndex:s,colIndex:h,rowId:I},y=p(C),R=m(C),S=g(C),N=T({accessor:i.accessor,rowId:I});return r(v,{children:[n(Un,{borderClass:y,colIndex:h,displayRowNumber:o,header:i,isHighlighted:R,isInitialFocused:S,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},N),x.map(function(e){var r=T({accessor:e.accessor,rowId:I});return n(Gn,{columnIndices:t,displayRowNumber:o,header:e,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},r)})]})}return n(v,{children:x.map(function(e){var r=T({accessor:e.accessor,rowId:I});return n(Gn,{columnIndices:t,displayRowNumber:o,header:e,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},r)})})}var A={rowIndex:s,colIndex:h,rowId:I},M=p(A),k=m(A),E=g(A),H=T({accessor:i.accessor,rowId:I});return n(Un,{borderClass:M,colIndex:h,displayRowNumber:o,header:i,isHighlighted:k,isInitialFocused:E,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},H)},Vn=t.memo(function(r){var t=r.columnIndexStart,o=r.columnIndices,i=r.headers,a=r.pinned,u=r.rowIndex,l=r.displayRowNumber,c=r.rowIndices,s=r.tableRow,d=Q(),f=d.rowIdAccessor,v=d.collapsedHeaders,h=i.filter(function(n){return F({header:n,pinned:a,headers:i,collapsedHeaders:v})});return n(e,{children:h.map(function(e,r){var d=j({row:s.row,rowIdAccessor:f}),v=T({accessor:e.accessor,rowId:d});return n(Gn,{columnIndices:o,displayRowNumber:l,header:e,headers:i,nestedIndex:r+(null!=t?t:0),pinned:a,rowIndex:u,rowIndices:c,tableRow:s},v)})})},function(n,e){return n.rowIndex===e.rowIndex&&n.displayRowNumber===e.displayRowNumber&&n.columnIndexStart===e.columnIndexStart&&(n.tableRow===e.tableRow||n.tableRow.row===e.tableRow.row)&&n.pinned===e.pinned&&n.headers===e.headers&&n.columnIndices===e.columnIndices&&n.rowIndices===e.rowIndices}),Kn=t.memo(function(e){var r=e.columnIndices,t=e.columnIndexStart,o=e.gridTemplateColumns,i=e.headers,a=e.index,u=e.pinned,l=e.rowHeight,c=e.rowIndices,s=e.setHoveredIndex,d=e.tableRow,f=Q(),v=f.useHoverRowBackground,h=f.isAnimating,w=f.isRowSelected,p=f.useOddEvenRowBackground,m=d.position,g=d.displayPosition,b=m%2==0,x=j({row:d.row,rowIdAccessor:f.rowIdAccessor}),C=!!w&&w(x+"");return n("div",I({className:"st-row ".concat(p?b?"even":"odd":""," ").concat(C?"selected":""),"data-index":a,onMouseEnter:function(){!h&&v&&s(a)},style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(K({position:m,rowHeight:l}),"px, 0)"),height:"".concat(l,"px")}},{children:n(Vn,{columnIndexStart:t,columnIndices:r,displayRowNumber:g,headers:i,pinned:u,rowIndex:m,rowIndices:c,tableRow:d},x)}))},function(n,e){return n.index===e.index&&n.tableRow.position===e.tableRow.position&&n.tableRow.displayPosition===e.tableRow.displayPosition&&n.tableRow.row===e.tableRow.row&&n.rowHeight===e.rowHeight&&n.gridTemplateColumns===e.gridTemplateColumns&&n.pinned===e.pinned&&n.headers===e.headers&&n.columnIndices===e.columnIndices&&n.rowIndices===e.rowIndices&&n.columnIndexStart===e.columnIndexStart}),Jn=function(e){var r=e.displayStrongBorder,t=e.position,o=e.rowHeight,i=e.templateColumns,u=a(null);return n("div",I({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(n){var e=n.currentTarget,r=e.style.pointerEvents;e.style.pointerEvents="none";var t=document.elementFromPoint(n.clientX,n.clientY);if(e.style.pointerEvents=r,t){var o=t.closest(".st-cell");if(o instanceof HTMLElement){u.current=o;var i=o.getBoundingClientRect(),a=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:n.clientX,clientY:i.top+i.height/2});o.dispatchEvent(a)}}},onMouseUp:function(n){if(u.current){var e=u.current.getBoundingClientRect(),r=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:n.clientX,clientY:e.top+e.height/2});u.current.dispatchEvent(r),u.current=null}},style:{gridTemplateColumns:i,transform:"translate3d(0, ".concat(V({position:t,rowHeight:o}),"px, 0)")}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},Xn=c(void 0),Yn=function(n){var e=n.childRef,r=n.children,t=n.group,i=void 0===t?"default":t,a=function(){var n=s(Xn);if(!n)throw Error("useScrollSyncContext must be used within a ScrollSyncProvider");return n}(),u=a.registerPane,l=a.unregisterPane;return o(function(){var n=[i];return e.current&&u(e.current,n),function(){e.current&&l(e.current,n)}},[e,u,l,i]),h(r,{ref:function(n){e.current=n}})},$n=w(function(e,t){var o=e.columnIndexStart,i=e.columnIndices,l=e.headers,c=e.pinned,s=e.rowHeight,d=e.rowIndices,f=e.setHoveredIndex,h=e.templateColumns,w=e.totalHeight,m=e.rowsToRender,g=e.width,b=c?"st-body-pinned-".concat(c):"st-body-main",x=Q().rowIdAccessor,C=a(null);return p(t,function(){return C.current},[]),u(function(){return Ln(l,c)},[l,c])?n(Yn,I({childRef:C,group:c?"pinned-".concat(c):"default"},{children:n("div",I({className:b,ref:C,style:I({position:"relative",height:"".concat(w,"px"),width:g},!c&&{flexGrow:1})},{children:m.map(function(e,t){var a=j({row:e.row,rowIdAccessor:x});return r(v,{children:[0!==t&&n(Jn,{displayStrongBorder:e.isLastGroupRow,position:e.position,rowHeight:s,templateColumns:h,rowIndex:t-1}),n(Kn,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:h,headers:l,index:t,pinned:c,rowHeight:s,rowIndices:d,setHoveredIndex:f,tableRow:e},a)]},a)})}))})):null});function Zn(n){var e=n.headers,r=n.pinnedLeftColumns,t=n.pinnedRightColumns,o=n.collapsedHeaders,i={},a=0,u=R(R(R([],r,!0),e,!0),t,!0),l=function(n,e){void 0===e&&(e=!1),e||a++,i[n.accessor]=a,n.children&&n.children.length>0&&n.children.filter(function(n){return F({header:n,headers:u,collapsedHeaders:o})}).forEach(function(e,r){l(e,!n.singleRowChildren&&0===r)})};return r.forEach(function(n,e){l(n,0===e)}),e.filter(function(n){return!n.pinned&&F({header:n,headers:u,collapsedHeaders:o})}).forEach(function(n,e){l(n,0===e&&0===r.length)}),t.forEach(function(n){l(n,!1)}),i}$n.displayName="TableSection";var Qn=function(e){var t=e.mainTemplateColumns,c=e.pinnedLeftColumns,s=e.pinnedLeftTemplateColumns,d=e.pinnedLeftWidth,f=e.pinnedRightColumns,v=e.pinnedRightTemplateColumns,h=e.pinnedRightWidth,w=e.rowsToRender,p=e.setScrollTop,m=e.setScrollDirection,g=e.tableRows,b=Q(),x=b.collapsedHeaders,C=b.headerContainerRef,y=b.headers,R=b.isAnimating,S=b.mainBodyRef,N=b.onLoadMore,A=b.rowHeight,M=b.rowIdAccessor,k=b.scrollbarWidth,E=b.setIsScrolling,H=b.shouldPaginate,T=b.tableBodyContainerRef,F=i(!1),D=F[0],O=F[1],L=a(new Set),P=l(function(n){L.current.forEach(function(n){return n.classList.remove("hovered")}),L.current.clear(),null!==n&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(n,'"]')).forEach(function(n){n.classList.add("hovered"),L.current.add(n)})},[]);o(function(){R&&P(null)},[R,P]),dn({headerContainerRef:C,mainSectionRef:T,scrollbarWidth:k}),o(function(){return function(){W.current&&clearTimeout(W.current)}},[]);var B=a(null),W=a(null),q=a(0),z=function(n){return n.length}(g),_=z*(A+1)-1,U=u(function(){return Zn({headers:y,pinnedLeftColumns:c,pinnedRightColumns:f,collapsedHeaders:x})},[y,c,f,x]),G=u(function(){var n={};return w.forEach(function(e,r){var t=j({row:e.row,rowIdAccessor:M})+"";n[t]=r}),n},[w,M]),V=l(function(n,e){!N||H||D||200>=n.scrollHeight-(e+n.clientHeight)&&e>q.current&&(O(!0),N(),setTimeout(function(){O(!1)},1e3))},[N,H,D]),K={columnIndices:U,headerContainerRef:C,headers:y,rowHeight:A,rowIndices:G,rowsToRender:w,setHoveredIndex:P};return r("div",I({className:"st-body-container",onMouseLeave:function(){return P(null)},onScroll:function(n){var e=n.currentTarget,r=e.scrollTop;E(!0),W.current&&clearTimeout(W.current),W.current=setTimeout(function(){E(!1)},150),B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame(function(){var n=q.current,t=r>n?"down":n>r?"up":"none";p(r),m(t),V(e,r),q.current=r})},ref:T},{children:[n($n,I({},K,{pinned:"left",templateColumns:s,totalHeight:_,width:d})),n($n,I({},K,{columnIndexStart:c.length,ref:S,templateColumns:t,totalHeight:_})),n($n,I({},K,{columnIndexStart:c.length+t.length,pinned:"right",templateColumns:v,totalHeight:_,width:h}))]}))},ne=function(n){var e=n.event,r=n.header,t=n.headers,o=n.setHeaders,i=n.setIsResizing,a=n.startWidth,u=n.collapsedHeaders;e.preventDefault();var l="clientX"in e?e.clientX:e.touches[0].clientX,c="touches"in e;if(r&&!r.hide){i(!0);var s,d=B(r);if(r.children&&r.children.length>0){var f=O(r,u);s=f.length>0?f:[r]}else s=[r];var v=function(n){var e="right"===r.pinned?l-n:n-l,i=function(n){var e=n.header,r=n.headers,t=n.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=i*A(window.innerWidth);if(!e.pinned)return Math.max(.6*i,600);var u=a-r.filter(function(n){return n.pinned===e.pinned&&n.accessor!==e.accessor}).reduce(function(n,e){return e.hide?n:n+O(e,t).reduce(function(n,e){return n+L(e)},0)},0),l=B(e);return l>u?(console.warn("Header ".concat(e.accessor," exceeds pinned section width limit")),l):u}({header:r,headers:t,collapsedHeaders:u});s.length>1?ee({delta:e,leafHeaders:s,minWidth:d,startWidth:a,maxWidth:i}):s[0].width=Math.max(Math.min(a+e,i),d),t.forEach(function(n){P(n)});var c=R([],t,!0);o(c)};if(c){var h=function(n){v(n.touches[0].clientX)},w=function(){document.removeEventListener("touchmove",h),document.removeEventListener("touchend",w),i(!1)};document.addEventListener("touchmove",h),document.addEventListener("touchend",w)}else{var p=function(n){v(n.clientX)},m=function(){document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",m),i(!1)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",m)}}},ee=function(n){var e=n.delta,r=n.leafHeaders,t=n.minWidth,o=n.startWidth,i=n.maxWidth,a=r.reduce(function(n,e){return Math.min(n,B(e))},40),u=r.reduce(function(n,e){return n+("number"==typeof e.width?e.width:150)},0),l=Math.max(Math.min(o+e,i),a)-u;r.forEach(function(n){var e="number"==typeof n.width?n.width:150;n.width=Math.max(e+l*(e/u),t)})},re={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"},te=function(n){switch(n){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"]}},oe=function(n){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(n)},ie=function(n){return["between","notBetween","in","notIn"].includes(n)},ae=function(n){return["isEmpty","isNotEmpty"].includes(n)},ue=function(e){return n("div",I({className:"st-filter-container"},{children:e.children}))},le=function(e){var t=e.value,u=e.onChange,l=e.options,c=e.placeholder,s=void 0===c?"Select...":c,d=e.className,f=void 0===d?"":d,v=e.disabled,h=void 0!==v&&v,w=i(!1),p=w[0],m=w[1],g=i(-1),b=g[0],x=g[1],C=a(null),y=l.find(function(n){return n.value===t});return o(function(){var n=function(n){if(p)switch(n.key){case"ArrowDown":n.preventDefault(),x(function(n){return l.length-1>n?n+1:0});break;case"ArrowUp":n.preventDefault(),x(function(n){return n>0?n-1:l.length-1});break;case"Enter":n.preventDefault(),0>b||(u(l[b].value),m(!1),x(-1));break;case"Escape":n.preventDefault(),m(!1),x(-1)}};if(p)return document.addEventListener("keydown",n),function(){return document.removeEventListener("keydown",n)}},[p,b,l,u]),r("div",I({ref:C,className:"st-custom-select ".concat(f," ").concat(h?"st-custom-select-disabled":""," ").concat(p?"st-custom-select-open":"").trim()},{children:[r("button",I({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!h)if(m(!p),p)x(-1);else{var n=l.findIndex(function(n){return n.value===t});x(0>n?0:n)}},disabled:h,"aria-haspopup":"listbox","aria-expanded":p,"aria-labelledby":"select-label"},{children:[n("span",I({className:"st-custom-select-value"},{children:y?y.label:s})),n(sn,{})]})),n(fn,I({open:p,setOpen:m,onClose:function(){m(!1),x(-1)},positioning:"absolute",overflow:"auto"},{children:n("div",I({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(e,r){return n("div",I({className:"st-custom-select-option ".concat(e.value===t?"st-custom-select-option-selected":""," ").concat(r===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":e.value===t,onClick:function(){return u(e.value),m(!1),void x(-1)}},{children:e.label}),r)})}))}))]}))},ce=function(e){var r=e.value,t=e.onChange,o=e.operators.map(function(n){return{value:n,label:re[n]}});return n("div",I({className:"st-filter-section"},{children:n(le,{value:r,onChange:function(n){t(n)},options:o})}))},se=function(e){var r=e.type,t=e.onChange,o=e.autoFocus,i=e.className,a=e.onEnterPress;return n("input",{type:void 0===r?"text":r,value:e.value,onChange:function(n){return t(n.target.value)},onKeyDown:function(n){"Enter"===n.key&&a&&a()},placeholder:e.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},de=function(e){var r=e.children,t=e.className;return n("div",I({className:"st-filter-section ".concat(void 0===t?"":t).trim()},{children:r}))},fe=function(e){var t=e.onClear,o=e.canApply,i=e.showClear;return r("div",I({className:"st-filter-actions"},{children:[n("button",I({onClick:e.onApply,disabled:!o,className:"st-filter-button st-filter-button-apply ".concat(o?"":"st-filter-button-disabled")},{children:"Apply"})),i&&t&&n("button",I({onClick:t,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},ve=function(e){var t=e.header,a=e.currentFilter,u=e.onApplyFilter,l=e.onClearFilter,c=i((null==a?void 0:a.operator)||"contains"),s=c[0],d=c[1],f=i(((null==a?void 0:a.value)||"")+""),v=f[0],h=f[1],w=te("string");o(function(){a?(d(a.operator),h((a.value||"")+"")):(d("contains"),h(""))},[a]);var p=function(){var n=I({accessor:t.accessor,operator:s},oe(s)&&{value:v});u(n)},m=ae(s)||v.trim();return r(ue,{children:[n(ce,{value:s,onChange:d,operators:w}),oe(s)&&n(de,{children:n(se,{type:"text",value:v,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),n(fe,{onApply:p,onClear:l,canApply:!!m,showClear:!!a})]})},he=function(e){var t,a,u=e.header,l=e.currentFilter,c=e.onApplyFilter,s=e.onClearFilter,d=i((null==l?void 0:l.operator)||"equals"),f=d[0],v=d[1],h=i(((null==l?void 0:l.value)||"")+""),w=h[0],p=h[1],m=i(((null===(t=null==l?void 0:l.values)||void 0===t?void 0:t[0])||"")+""),g=m[0],b=m[1],I=i(((null===(a=null==l?void 0:l.values)||void 0===a?void 0:a[1])||"")+""),x=I[0],C=I[1],y=te("number");o(function(){var n,e;l?(v(l.operator),p((l.value||"")+""),b(((null===(n=l.values)||void 0===n?void 0:n[0])||"")+""),C(((null===(e=l.values)||void 0===e?void 0:e[1])||"")+"")):(v("equals"),p(""),b(""),C(""))},[l]);var R=function(){var n={accessor:u.accessor,operator:f};oe(f)?n.value=parseFloat(w):ie(f)&&(n.values=[parseFloat(""+g),parseFloat(""+x)]),c(n)};return r(ue,{children:[n(ce,{value:f,onChange:v,operators:y}),oe(f)&&n(de,{children:n(se,{type:"number",value:w,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:R})}),ie(f)&&r(de,{children:[n(se,{type:"number",value:g,onChange:b,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:R}),n(se,{type:"number",value:x,onChange:C,placeholder:"To...",onEnterPress:R})]}),n(fe,{onApply:R,onClear:s,canApply:!!ae(f)||(oe(f)?""!==w.trim():!!ie(f)&&""!==(g+"").trim()&&""!==(x+"").trim()),showClear:!!l})]})},we=function(e){var r=e.className;return n(le,{value:e.value,onChange:e.onChange,options:e.options,className:void 0===r?"":r,placeholder:e.placeholder})},pe=function(e){var t=e.header,a=e.currentFilter,u=e.onApplyFilter,l=e.onClearFilter,c=i((null==a?void 0:a.operator)||"equals"),s=c[0],d=c[1],f=i(void 0!==(null==a?void 0:a.value)?a.value+"":"true"),v=f[0],h=f[1],w=te("boolean");o(function(){a?(d(a.operator),h(void 0!==a.value?a.value+"":"true")):(d("equals"),h("true"))},[a]);var p=ae(s)||""!==v;return r(ue,{children:[n(ce,{value:s,onChange:d,operators:w}),oe(s)&&n(de,{children:n(we,{value:v,onChange:h,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),n(fe,{onApply:function(){var n={accessor:t.accessor,operator:s};oe(s)&&(n.value="true"===v),u(n)},onClear:l,canApply:p,showClear:!!a})]})},me=function(e){var t,u,l=e.header,c=e.currentFilter,s=e.onApplyFilter,d=e.onClearFilter,f=i((null==c?void 0:c.operator)||"equals"),v=f[0],h=f[1],w=i((null==c?void 0:c.value)?c.value+"":""),p=w[0],m=w[1],g=i((null===(t=null==c?void 0:c.values)||void 0===t?void 0:t[0])?c.values[0]+"":""),b=g[0],x=g[1],C=i(((null===(u=null==c?void 0:c.values)||void 0===u?void 0:u[1])||"")+""),y=C[0],R=C[1],S=te("date");o(function(){var n,e;c?(h(c.operator),m((c.value||"")+""),x(((null===(n=c.values)||void 0===n?void 0:n[0])||"")+""),R(((null===(e=c.values)||void 0===e?void 0:e[1])||"")+"")):(h("equals"),m(""),x(""),R(""))},[c]);var N=function(e){var t=e.value,u=e.onChange,l=e.placeholder,c=e.autoFocus,s=e.className,d=i(!1),f=d[0],v=d[1],h=i(""),w=h[0],p=h[1],m=a(null);o(function(){if(t){var n=An(t);isNaN(n.getTime())||p(n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else p("")},[t]),o(function(){c&&m.current&&m.current.focus()},[c]);var g=t?An(t):new Date;return r("div",I({className:"st-date-input-container",style:{position:"relative"}},{children:[n("input",{ref:m,type:"text",value:w,placeholder:l,onClick:function(){v(!f)},onKeyDown:function(n){"Enter"===n.key||" "===n.key?(n.preventDefault(),v(!f)):"Escape"===n.key&&v(!1)},readOnly:!0,className:"st-filter-input ".concat(s||""),style:{cursor:"pointer"}}),n(fn,I({open:f,setOpen:v,onClose:function(){v(!1)},positioning:"absolute",overflow:"visible"},{children:n(Cn,{value:g,onChange:function(n){var e=n.toISOString().split("T")[0];u(e),v(!1)},onClose:function(){return v(!1)}})}))]}))};return r(ue,{children:[n(ce,{value:v,onChange:h,operators:S}),oe(v)&&n(de,{children:n(N,{value:p,onChange:m,placeholder:"Select date...",autoFocus:!0})}),ie(v)&&r(de,{children:[n(N,{value:b,onChange:x,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),n(N,{value:y,onChange:R,placeholder:"To date..."})]}),n(fe,{onApply:function(){var n={accessor:l.accessor,operator:v};oe(v)?n.value=p:ie(v)&&(n.values=[b,y]),s(n)},onClear:d,canApply:!!ae(v)||(oe(v)?""!==p.trim():!!ie(v)&&""!==b.trim()&&""!==y.trim()),showClear:!!c})]})},ge=function(e){var t=e.header,a=e.currentFilter,l=e.onApplyFilter,c=e.onClearFilter,s=u(function(){return t.enumOptions||[]},[t.enumOptions]),d=u(function(){return s.map(function(n){return n.value})},[s]),f=i((null==a?void 0:a.values)?a.values.map(String):d),v=f[0],h=f[1],w=i(""),p=w[0],m=w[1],g=u(function(){if(!p)return s;var n=p.toLowerCase();return s.filter(function(e){return e.label.toLowerCase().includes(n)})},[s,p]);o(function(){h(a?a.values?a.values.map(String):[]:d)},[a,d]);var b=s.length>10;return r(ue,{children:[n(de,{children:r("div",I({className:"st-enum-filter-options"},{children:[n("div",I({className:"st-enum-select-all"},{children:n(jn,I({checked:v.length===d.length,onChange:function(n){h(n?d:[])}},{children:n("span",I({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),b&&n("div",I({className:"st-enum-search"},{children:n(se,{type:"text",value:p,onChange:m,placeholder:"Search..."})})),g.map(function(e,r){return n(jn,I({checked:v.includes(e.value),onChange:function(){return n=e.value,void h(function(e){return e.includes(n)?e.filter(function(e){return e!==n}):R(R([],e,!0),[n],!1)});var n}},{children:n("span",I({className:"st-enum-option-label"},{children:e.label}))}),r)}),p&&0===g.length&&n("div",I({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),n(fe,{onApply:function(){v.length!==d.length?l({accessor:t.accessor,operator:"in",values:v}):c()},onClear:c,canApply:0!==v.length&&v.length!==d.length,showClear:!!a})]})},be=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter;return n(e,{children:function(){switch(t.type){case"number":return n(he,{header:t,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return n(pe,{header:t,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return n(me,{header:t,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return n(ge,{header:t,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return n(ve,{header:t,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},Ie=function(t){var u=t.content,l=t.children,c=t.delay,s=void 0===c?500:c,d=i(!1),f=d[0],v=d[1],w=i({top:0,left:0}),p=w[0],g=w[1],b=a(null),x=a(null);if(o(function(){return function(){b.current&&clearTimeout(b.current)}},[]),!u||!m(l))return n(e,{children:l});var C=h(l,{ref:x,onMouseEnter:function(){b.current=setTimeout(function(){if(x.current&&u.trim()){var n=x.current.getBoundingClientRect();if(n.width>0&&n.height>0){var e=n.left+n.width/2-100,r=n.bottom+8;8>e?e=8:e+200>window.innerWidth-8&&(e=window.innerWidth-200-8),r+40>window.innerHeight-8&&(r=n.top-40-8),g({top:r,left:e}),v(!0)}}},s)},onMouseLeave:function(){b.current&&(clearTimeout(b.current),b.current=null),v(!1)}});return r(e,{children:[C,f&&n("div",I({className:"st-tooltip",style:{position:"fixed",top:"".concat(p.top,"px"),left:"".concat(p.left,"px"),zIndex:1e4}},{children:u}))]})},xe=function(e){var t,c,s=e.colIndex,d=e.gridColumnEnd,f=e.gridColumnStart,v=e.gridRowEnd,w=e.gridRowStart,p=e.header,m=e.parentHeader,g=e.reverse,b=e.sort,x=i(!1),C=x[0],y=x[1],S=i(!1),N=S[0],A=S[1],E=i(p.label||""),H=E[0],F=E[1],D=Q(),O=D.activeHeaderDropdown,L=D.areAllRowsSelected,P=D.collapsedHeaders,B=D.columnBorders,W=D.columnReordering,q=D.columnResizing,z=D.columnsWithSelectedCells,j=D.draggedHeaderRef,_=D.enableHeaderEditing,U=D.filterIcon,G=D.handleApplyFilter,V=D.handleClearFilter,K=D.handleSelectAll,J=D.headerCollapseIcon,X=D.headerDropdown,Y=D.headerExpandIcon,$=D.headerRegistry,Z=D.headers,nn=D.hoveredHeaderRef,en=D.onColumnOrderChange,rn=D.onColumnSelect,tn=D.onHeaderEdit,on=D.onSort,an=D.onTableHeaderDragEnd,un=D.headerHeight,ln=D.selectColumns,cn=D.selectableColumns,sn=D.selectedColumns,dn=D.setActiveHeaderDropdown,vn=D.setCollapsedHeaders,hn=D.setHeaders,pn=D.setInitialFocusedCell,mn=D.setIsResizing,gn=D.setSelectedCells,bn=D.setSelectedColumns,In=D.sortDownIcon,Cn=D.sortUpIcon,yn=!!(null==p?void 0:p.isSortable),Rn=!!(null==p?void 0:p.filterable),Sn=D.filters[p.accessor],Nn=(null==O?void 0:O.accessor)===p.accessor,An=p.isSelectionColumn&&D.enableRowSelection,Mn=function(n){var e;return!(!(null===(e=n.children)||void 0===e?void 0:e.length)||!n.collapsible)}(p),kn=P.has(p.accessor),En=function(n){var e=n.isOpen,r=n.estimatedHeight,t=void 0===r?200:r,u=n.estimatedWidth,l=void 0===u?250:u,c=n.margin,s=void 0===c?4:c,d=a(null),f=i({}),v=f[0],h=f[1];return o(function(){if(e&&d.current){var n=function(){if(d.current){var n=d.current.getBoundingClientRect(),e=window.innerHeight-n.bottom,r=window.innerWidth-n.right,o="bottom",i={};t>e&&n.top>=t&&(o="top");var a="left";l>r+n.width&&(a="right"),"bottom"===o?i.top=n.bottom+s:i.bottom=window.innerHeight-n.top+s,"left"===a?i.left=n.left:i.right=window.innerWidth-n.right,h(i)}};requestAnimationFrame(n);var r=function(){return requestAnimationFrame(n)},o=function(){return requestAnimationFrame(n)};return window.addEventListener("resize",r),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",r),window.removeEventListener("scroll",o,!0)}}h({})},[e,t,l,s]),{triggerRef:d,position:v}}({isOpen:Nn,estimatedHeight:200,estimatedWidth:250,margin:4}),Hn=En.triggerRef,Tn=En.position,Dn=u(function(){var n,e,r;if(!B)return!1;var t=Z.filter(function(n){return"left"===n.pinned}),o=Z.filter(function(n){return!n.pinned}),i=Z.filter(function(n){return"right"===n.pinned});return"left"===p.pinned?(null===(n=t[t.length-1])||void 0===n?void 0:n.accessor)===p.accessor:"right"===p.pinned?(null===(e=i[i.length-1])||void 0===e?void 0:e.accessor)===p.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===p.accessor},[B,Z,p.accessor,p.pinned]),On=u(function(){return!(!cn||An)&&k(p,s).some(function(n){return sn.has(n)})},[cn,An,p,s,sn]),Ln=u(function(){return!An&&k(p,s).some(function(n){return z.has(n)})},[An,p,s,z]),Pn=u(function(){return!(!p.children||0===p.children.length)&&(!kn||p.children.some(function(n){var e=n.showWhen||M;return"parentCollapsed"===e||"always"===e}))},[p.children,kn]),Bn=null==m?void 0:m.singleRowChildren,Wn=Pn&&!p.singleRowChildren,qn="st-header-cell ".concat(p.accessor===(null===(t=nn.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(c=j.current)||void 0===c?void 0:c.accessor)===p.accessor?"st-dragging":""," ").concat(yn?"clickable":""," ").concat(W&&!yn?"columnReordering":""," ").concat(Wn?"parent":""," ").concat(Bn?"st-sub-header":""," ").concat(Dn?"st-last-column":""," ").concat(_&&!An?"st-header-editable":""," ").concat(On?"st-header-selected":""," ").concat(Ln&&!On?"st-header-has-highlighted-cell":""),_n=zn({draggedHeaderRef:j,headers:Z,hoveredHeaderRef:nn,onColumnOrderChange:en,onTableHeaderDragEnd:an}),Un=_n.handleDragStart,Gn=_n.handleDragEnd,Vn=_n.handleDragOver,Kn=Fn();o(function(){if($&&!p.isSelectionColumn){var n=p.accessor+"";return $.set(n,{setEditing:function(n){A(n)}}),function(){$.delete(n)}}},[$,p.accessor,p.isSelectionColumn]),o(function(){F(p.label||"")},[p.label]);var Jn=l(function(n){F(n);var e=Z.map(function(e){return e.accessor===p.accessor?I(I({},e),{label:n}):e});hn(e),tn&&tn(p,n)},[Z,hn,tn,p]),Xn=l(function(){dn&&dn(null)},[dn]),Yn=l(function(n){n.stopPropagation(),vn(function(n){var e=new Set(n);return kn?e.delete(p.accessor):e.add(p.accessor),e})},[vn,kn,p.accessor]),$n=function(n){var e=n.event,r=n.header;if(!r.isSelectionColumn){if(cn){var t=k(r,s),o=t.some(function(n){return sn.has(n)});if(_&&o&&!e.shiftKey)return X&&Nn&&Xn(),void A(!0);e.shiftKey&&ln?bn(function(n){if(0===n.size)return new Set(t);var e=t[0],r=Array.from(n).sort(function(n,e){return n-e}),o=r[0],i=Math.abs(e-o);r.forEach(function(n){var r=Math.abs(e-n);i>r&&(i=r,o=n)});var a,u,l,c=R(R([],(l=Math.min(a=o,u=e),Array.from({length:Math.max(a,u)-l+1},function(n,e){return l+e})),!0),t,!0);return new Set(R(R([],Array.from(n),!0),c,!0))}):ln&&ln(t),gn(new Set),pn(null)}rn&&rn(r),!cn&&r.isSortable&&on(r.accessor)}};if(o(function(){var n=function(n){n.preventDefault(),n.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",n),function(){document.removeEventListener("dragover",n)}},[]),!p)return null;var Zn=q&&!An&&n("div",I({className:"st-header-resize-handle-container",onMouseDown:function(n){var e,r=null===(e=document.getElementById(T({accessor:p.accessor,rowId:"header"})))||void 0===e?void 0:e.offsetWidth;Kn({callback:ne,callbackProps:{event:n.nativeEvent,gridColumnEnd:d,gridColumnStart:f,header:p,headers:Z,setHeaders:hn,setIsResizing:mn,startWidth:r,collapsedHeaders:P},limit:10})},onTouchStart:function(n){var e,r=null===(e=document.getElementById(T({accessor:p.accessor,rowId:"header"})))||void 0===e?void 0:e.offsetWidth;Kn({callback:ne,callbackProps:{event:n,gridColumnEnd:d,gridColumnStart:f,header:p,headers:Z,setHeaders:hn,setIsResizing:mn,startWidth:r,collapsedHeaders:P},limit:10})}},{children:n("div",{className:"st-header-resize-handle"})})),Qn=b&&b.key.accessor===p.accessor&&r("div",I({className:"st-icon-container",onClick:function(n){return $n({event:n,header:p})}},{children:["ascending"===b.direction&&Cn&&Cn,"descending"===b.direction&&In&&In]})),ee=Rn&&U&&r("div",I({className:"st-icon-container",onClick:function(n){n.stopPropagation(),y(!C)}},{children:[h(U,{style:{fill:Sn?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),n(fn,I({open:C,overflow:"visible",setOpen:y,onClose:function(){return y(!1)}},{children:n(be,{header:p,currentFilter:Sn,onApplyFilter:function(n){G(n),y(!1)},onClearFilter:function(){V(p.accessor),y(!1)}})}))]})),re=Mn&&!An&&n("div",I({className:"st-icon-container st-collapse-icon-container",onClick:Yn},{children:kn?J:Y}));return r(xn,I({className:qn,id:T({accessor:p.accessor,rowId:"header"}),onDragOver:function(n){An||Kn({callback:Vn,callbackProps:{event:n,hoveredHeader:p},limit:50})},style:I({gridRowStart:w,gridRowEnd:v,gridColumnStart:f,gridColumnEnd:d},v-w>1?{}:{height:un})},{children:[g&&Zn,"right"===p.align&&re,"right"===p.align&&ee,"right"===p.align&&Qn,n("div",I({ref:Hn,className:"st-header-label",draggable:W&&!p.disableReorder&&!An,onClick:function(n){An||$n({event:n,header:p})},onDoubleClick:function(n){An||function(n){var e=n.header;e.isSelectionColumn||cn&&e.isSortable&&on(e.accessor)}({event:n,header:p})},onDragEnd:An?void 0:function(n){n.preventDefault(),Gn()},onDragStart:An?void 0:function(n){W&&p&&function(n){Un(n)}(p)}},{children:n(Ie,I({content:p.tooltip||""},{children:n("span",I({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:An?n(jn,{checked:!!L&&L(),onChange:function(n){K&&K(n)}}):N?n(wn,{defaultValue:H,onBlur:function(){return A(!1)},onChange:Jn}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:s,header:p}):H||(null==p?void 0:p.label)}))}))})),"right"!==p.align&&Qn,"right"!==p.align&&ee,"right"!==p.align&&re,!g&&Zn,X&&!An&&n("div",I({className:"st-header-dropdown-container"},{children:X({accessor:p.accessor,colIndex:s,header:p,isOpen:Nn,onClose:Xn,position:Tn})}))]}))},Ce=function(r){var t=r.columnIndices,o=r.gridTemplateColumns,i=r.handleScroll,a=r.headers,l=r.maxDepth,c=r.pinned,s=r.sectionRef,d=r.sort,f=r.width,v=Q().collapsedHeaders,h=u(function(){var n=[],e=1,r=function(o,i,u,s){var d,f;if(void 0===u&&(u=!1),!F({header:o,pinned:c,headers:a,collapsedHeaders:v}))return 0;u||e++;var h,w,p=null!==(f=null===(d=o.children)||void 0===d?void 0:d.filter(function(n){return F({header:n,pinned:c,headers:a,collapsedHeaders:v})}).length)&&void 0!==f?f:0,m=e;if(o.singleRowChildren&&p>0?(h=m+1,w=l+1):p>0?(h=m+p,w=i+1):(h=m+1,w=l+1),n.push({header:o,gridColumnStart:m,gridColumnEnd:h,gridRowStart:i,gridRowEnd:w,colIndex:t[o.accessor],parentHeader:s}),o.children&&o.children.length>0){var g=o.singleRowChildren?i:i+1,b=!o.singleRowChildren;o.children.forEach(function(n){F({header:n,pinned:c,headers:a,collapsedHeaders:v})&&(r(n,g,b,o),b=!1)})}return h-m},o=a.filter(function(n){return F({header:n,pinned:c,headers:a,collapsedHeaders:v})}),i=!0;return o.forEach(function(n){r(n,1,i),i=!1}),n},[a,l,c,t,v]);return n(Yn,I({childRef:s,group:c?"pinned-".concat(c):"default"},{children:n("div",I({className:"st-header-".concat(c?"pinned-".concat(c):"main")},i&&{onScroll:i},{ref:s,style:{gridTemplateColumns:o,width:f,position:"relative"}},{children:n(e,{children:h.map(function(e){return n(xe,{colIndex:e.colIndex,gridColumnEnd:e.gridColumnEnd,gridColumnStart:e.gridColumnStart,gridRowEnd:e.gridRowEnd,gridRowStart:e.gridRowStart,header:e.header,parentHeader:e.parentHeader,reverse:"right"===c,sort:d},e.header.accessor)})})}))}))},ye=function(n){var e,r;return n.singleRowChildren&&(null===(e=n.children)||void 0===e?void 0:e.length)?1:(null===(r=n.children)||void 0===r?void 0:r.length)?1+Math.max.apply(Math,n.children.map(ye)):1},Re=function(e){var t=e.centerHeaderRef,o=e.headers,i=e.mainTemplateColumns,a=e.pinnedLeftColumns,l=e.pinnedLeftTemplateColumns,c=e.pinnedRightColumns,s=e.pinnedRightTemplateColumns,d=e.sort,f=e.pinnedLeftWidth,v=e.pinnedRightWidth,h=Q(),w=h.headerContainerRef,p=h.pinnedLeftRef,m=h.pinnedRightRef,g=h.collapsedHeaders,b=u(function(){return Zn({headers:o,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:g})},[o,a,c,g]),x=u(function(){var n=0,e=R(R(R([],a,!0),o,!0),c,!0);return o.forEach(function(r){if(F({header:r,headers:e,collapsedHeaders:g})){var t=ye(r);n=Math.max(n,t)}}),{maxDepth:n}},[o,a,c,g]).maxDepth;return r("div",I({className:"st-header-container",ref:w},{children:[Ln(o,"left")&&n(Ce,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headers:o,maxDepth:x,pinned:"left",sectionRef:p,sort:d,width:f}),n(Ce,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:x,sectionRef:t,sort:d}),Ln(o,"right")&&n(Ce,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:x,pinned:"right",sectionRef:m,sort:d,width:v})]}))},Se=function(n){var e=n.collapsedHeaders,r=function(n){var t=n.flattenedHeaders;return n.headers.forEach(function(n){if(!n.hide&&!n.excludeFromRender)if(n.children&&n.children.length>0)if(e&&e.has(n.accessor)){var o=n.children.filter(function(n){var e=n.showWhen||M;return"parentCollapsed"===e||"always"===e});n.singleRowChildren&&t.push(n),o.length>0?r({headers:o,flattenedHeaders:t}):n.singleRowChildren||t.push(n)}else{var i=n.children.filter(function(n){var e=n.showWhen||M;return"parentExpanded"===e||"always"===e});n.singleRowChildren&&t.push(n),r({headers:i,flattenedHeaders:t})}else t.push(n)}),t},t=r({headers:n.headers,flattenedHeaders:[]});return"".concat(t.map(function(n){return function(n){var e=n.minWidth,r=n.width;return"number"==typeof r&&(r="".concat(r,"px")),e&&"number"==typeof e&&(e="".concat(e,"px")),void 0!==e?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(e,", ").concat(r,")"):"max(".concat(e,", ").concat(r,")"):r}(n)}).join(" "))},Ne=function(e){var t=e.pinnedLeftWidth,o=e.pinnedRightWidth,i=e.setScrollTop,l=e.setScrollDirection,c=e.sort,s=e.tableRows,d=e.rowsToRender,f=Q(),v=f.columnResizing,h=f.editColumns,w=f.headers,p=f.collapsedHeaders,m=a(null),g=w.filter(function(n){return!n.pinned}),b=w.filter(function(n){return"left"===n.pinned}),x=w.filter(function(n){return"right"===n.pinned}),C=u(function(){return Se({headers:b,collapsedHeaders:p})},[b,p]),y=u(function(){return Se({headers:g,collapsedHeaders:p})},[g,p]),R=u(function(){return Se({headers:x,collapsedHeaders:p})},[x,p]),S={centerHeaderRef:m,headers:w,mainTemplateColumns:y,pinnedLeftColumns:b,pinnedLeftTemplateColumns:C,pinnedRightColumns:x,pinnedRightTemplateColumns:R,sort:c,pinnedLeftWidth:t,pinnedRightWidth:o},N={tableRows:s,mainTemplateColumns:y,pinnedLeftColumns:b,pinnedLeftTemplateColumns:C,pinnedLeftWidth:t,pinnedRightColumns:x,pinnedRightTemplateColumns:R,pinnedRightWidth:o,setScrollTop:i,setScrollDirection:l,rowsToRender:d};return r("div",I({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[n(Re,I({},S)),n(Qn,I({},N))]}))},Ae=function(e){var t=e.mainBodyWidth,u=e.mainBodyRef,l=e.pinnedLeftWidth,c=e.pinnedRightWidth,s=e.pinnedLeftContentWidth,d=e.pinnedRightContentWidth,f=e.tableBodyContainerRef,v=Q().editColumns,h=i(!1),w=h[0],p=h[1],m=a(null),g=a(null),b=a(null),x=v?28:0,C=(v?c+1:c)+(f.current&&f.current&&f.current.scrollHeight>f.current.clientHeight?f.current.offsetWidth-f.current.clientWidth:0);return o(function(){setTimeout(function(){u.current&&p(t>u.current.clientWidth)},1)},[u,t]),w?r("div",I({className:"st-horizontal-scrollbar-container"},{children:[l>0&&n(Yn,I({childRef:g,group:"pinned-left"},{children:n("div",I({className:"st-horizontal-scrollbar-left",ref:g,style:{width:l}},{children:n("div",{style:{width:s}})}))})),t>0&&n(Yn,I({childRef:m},{children:n("div",I({className:"st-horizontal-scrollbar-middle",ref:m},{children:n("div",{style:{width:t}})}))})),c>0&&n(Yn,I({childRef:b,group:"pinned-right"},{children:n("div",I({className:"st-horizontal-scrollbar-right",ref:b,style:{width:C}},{children:n("div",{style:{width:d}})}))})),x>0&&n("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},Me={string:function(n,e,r){if(n===e)return 0;var t=n.localeCompare(e);return"ascending"===r?t:-t},number:function(n,e,r){if(n===e)return 0;var t=n-e;return"ascending"===r?t:-t},boolean:function(n,e,r){if(n===e)return 0;var t=n===e?0:n?-1:1;return"ascending"===r?t:-t},date:function(n,e,r){var t=new Date(n),o=new Date(e);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(n,e,r){return Me.string(n,e,r)},default:function(n,e,r){return n===e?0:null==n?"ascending"===r?-1:1:null==e?"ascending"===r?1:-1:"string"==typeof n&&"string"==typeof e?Me.string(n,e,r):"number"==typeof n&&"number"==typeof e?Me.number(n,e,r):"boolean"==typeof n&&"boolean"==typeof e?Me.boolean(n,e,r):Me.string(n+"",e+"",r)}},ke=function(n){return function(n){var e=n.rows,r=n.sortColumn,t=function(n,e){for(var r=0,o=n;o.length>r;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children,e);if(a)return a}}},o=t(n.headers,r.key.accessor),i=(null==o?void 0:o.type)||"string",a=r.direction;return R([],e,!0).sort(function(n,t){if(null==o?void 0:o.comparator)return o.comparator({rowA:n,rowB:t,direction:a});var u,l,c=r.key.accessor;if(null==o?void 0:o.valueGetter){var s=e.indexOf(n),d=e.indexOf(t);u=o.valueGetter({accessor:c,row:n,rowIndex:s}),l=o.valueGetter({accessor:c,row:t,rowIndex:d})}else u=W(n,c),l=W(t,c);return function(n,e,r,t){if(void 0===r&&(r="string"),null==n||""===n)return"ascending"===t?-1:1;if(null==e||""===e)return"ascending"===t?1:-1;if("number"===r){var o=function(n){var e;if("number"==typeof n)return n;var r=n+"";if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(e=t[2])||void 0===e?void 0:e.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(n),a=o(e);return Me.number(i,a,t)}return"date"===r?Me.date(n+"",e+"",t):"boolean"===r?Me.boolean(!!n,!!e,t):"enum"===r?Me.enum(n+"",e+"",t):Me.string(n+"",e+"",t)}(u,l,i,a)})}({rows:n.rows,sortColumn:n.sortColumn,headers:n.headers})},Ee=function(n){var e=n.tableRows,r=n.sortColumn,t=n.rowGrouping,o=n.headers;return n.externalSortHandling?e:r?t&&t.length>0?(0,n.sortNestedRows)({groupingKeys:t,headers:o,rows:e,sortColumn:r}):ke({headers:o,rows:e,sortColumn:r}):e},He=function(n,e,r){void 0===r&&(r=new Set);for(var t=0,o=n;o.length>t;t++){var i=o[t];if(!r.has(i.accessor)&&(r.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(n){return n.accessor===e}),u=!1;if(!a)for(var l=0,c=i.children;c.length>l;l++){var s=c[l];if(He([s],e,r),!1===s.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},Te=function(n){return n.every(function(n){return n.hide})},Fe=function(n){n.forEach(function(n){n.children&&n.children.length>0&&(Fe(n.children),Te(n.children)&&(n.hide=!0))})},De=function(t){var o=t.allHeaders,a=t.depth,u=void 0===a?0:a,l=t.doesAnyHeaderHaveChildren,c=t.header,s=t.isCheckedOverride,d=i(!0),f=d[0],v=d[1],h=Q(),w=h.expandIcon,p=h.headers,m=h.setHeaders,g=l?"".concat(16*u,"px"):"8px",b=c.children&&c.children.length>0,x=null!=s?s:c.hide||b&&c.children&&Te(c.children);return r(e,{children:[r("div",I({className:"st-header-checkbox-item",style:{paddingLeft:g}},{children:[l&&n("div",I({className:"st-header-icon-container"},{children:b?n("div",I({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(n){n.stopPropagation(),v(!f)}},{children:w})):null})),n(jn,I({checked:x,onChange:function(n){c.hide=n,n?Fe(o):(He(o,c.accessor),b&&c.children&&c.children.length>0&&c.children.every(function(n){return!0===n.hide})&&c.children[0]&&(c.children[0].hide=!1,He(o,c.children[0].accessor))),m(R([],p,!0))}},{children:c.label}))]})),b&&f&&c.children&&n("div",I({className:"st-nested-headers"},{children:c.children.map(function(e,r){return n(De,{allHeaders:o,depth:u+1,doesAnyHeaderHaveChildren:l,header:e,isCheckedOverride:!!x||void 0},"".concat(e.accessor,"-").concat(r))})}))]})},Oe=function(e){var r=e.headers,t=e.open,o="left"===e.position?"left":"",i=u(function(){return r.some(function(n){return n.children&&n.children.length>0})},[r]);return n("div",I({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(o),onClick:function(n){return n.stopPropagation()}},{children:n("div",I({className:"st-column-editor-popout-content"},{children:r.map(function(e,t){return e.isSelectionColumn?null:n(De,{doesAnyHeaderHaveChildren:i,header:e,allHeaders:r},"".concat(e.accessor,"-").concat(t))})}))}))},Le=function(e){var t=e.columnEditorText,o=e.editColumns,a=e.headers,u=e.position,l=void 0===u?"right":u,c=i(e.editColumnsInitOpen),s=c[0],d=c[1];return o?r("div",I({className:"st-column-editor ".concat(s?"open":""," ").concat(l),onClick:function(){return function(n){d(n)}(!s)},style:{width:28}},{children:[n("div",I({className:"st-column-editor-text"},{children:t})),n(Oe,{headers:a,open:s,position:l})]})):null},Pe=function(e){var r=e.children,o=a({}),i=l(function(n,e){return!!o.current[e]&&o.current[e].find(function(e){return e===n})},[]),u=l(function(n,e){n.scrollWidth-n.clientWidth>0&&(e.scrollLeft=n.scrollLeft)},[]),c=l(function(n){n.onscroll=null},[]),s=l(function(n,e){n.onscroll=function(){window.requestAnimationFrame(function(){e.forEach(function(e){var r;null===(r=o.current[e])||void 0===r||r.forEach(function(e){n!==e&&(c(e),u(n,e),window.requestAnimationFrame(function(){var n=Object.keys(o.current).filter(function(n){return o.current[n].includes(e)});s(e,n)}))})})})}},[c,u]),d=l(function(n,e){e.forEach(function(e){o.current[e]||(o.current[e]=[]),i(n,e)||(o.current[e].length>0&&u(o.current[e][0],n),o.current[e].push(n))}),s(n,e)},[i,u,s]),f=l(function(n,e){e.forEach(function(e){if(i(n,e)){c(n);var r=o.current[e].indexOf(n);-1!==r&&o.current[e].splice(r,1)}})},[i,c]);return n(Xn.Provider,I({value:{registerPane:d,unregisterPane:f}},{children:t.Children.only(r)}))},Be=function(n){var e=n.tableRows,r=n.filterState;return n.externalFilterHandling?e:r&&0!==Object.keys(r).length?e.filter(function(n){return Object.values(r).every(function(e){try{return function(n,e){var r=e.operator,t=e.value,o=e.values;if(null==n)return"isEmpty"===r;if("isEmpty"===r)return!n||""===(n+"").trim();if("isNotEmpty"===r)return n&&""!==(n+"").trim();if("string"==typeof n||"contains"===r||"notContains"===r||"startsWith"===r||"endsWith"===r){var i=(n+"").toLowerCase(),a=t?(t+"").toLowerCase():"";switch(r){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 n||!isNaN(+n)){var u=+n,l=+t;switch(r){case"equals":return u===l;case"notEquals":return u!==l;case"greaterThan":return u>l;case"lessThan":return l>u;case"greaterThanOrEqual":return u>=l;case"lessThanOrEqual":return l>=u;case"between":if(o&&2===o.length){var c=o.map(Number),s=c[1];return u>=c[0]&&s>=u}return!1;case"notBetween":if(o&&2===o.length){var d=o.map(Number);return s=d[1],d[0]>u||u>s}return!0}}if(n instanceof Date||!isNaN(Date.parse(n))){var f=An(n),v=An((t||"")+""),h=Nn(f),w=Nn(v);switch(r){case"equals":return h.getTime()===w.getTime();case"notEquals":return h.getTime()!==w.getTime();case"before":return w>h;case"after":return h>w;case"between":if(o&&2===o.length){var p=o.map(function(n){return Nn(An((n||"")+""))}),m=p[1];return h>=p[0]&&m>=h}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(n){return Nn(An((n||"")+""))});return m=g[1],g[0]>h||h>m}return!0}}if("boolean"==typeof n&&"equals"===r)return n===!!t;if(Array.isArray(n)){var b=n.map(function(n){return"object"==typeof n&&null!==n?JSON.stringify(n):n+""}).join(", ");n=b}if("in"===r||"notIn"===r){if(o&&Array.isArray(o)){var I=o.includes(n+"");return"in"===r?I:!I}return!1}var x=(n+"").toLowerCase(),C=t?(t+"").toLowerCase():"";switch(r){case"equals":return x===C;case"notEquals":return x!==C;default:return!0}}(W(n,e.accessor),e)}catch(n){return console.warn("Filter error for accessor ".concat(e.accessor,":"),n),!0}})}):e},We=function(n,e,r,t){var o=[],i=function(n){n.forEach(function(n){var r=t?n[t]:void 0;if(t&&r&&z(r))i(r);else{var a=W(n,e);null!=a&&o.push(a)}})};if(i(n),0!==o.length){if("custom"===r.type&&r.customFn)return r.customFn(o);var a,u=r.parseValue?o.map(r.parseValue).filter(function(n){return!isNaN(n)}):o.map(function(n){return"number"==typeof n?n:"string"==typeof n?parseFloat(n):NaN}).filter(function(n){return!isNaN(n)});if(0===u.length)return"count"===r.type?o.length:void 0;switch(r.type){case"sum":a=u.reduce(function(n,e){return n+e},0);break;case"average":a=u.reduce(function(n,e){return n+e},0)/u.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,u);break;case"max":a=Math.max.apply(Math,u);break;default:return}return r.formatResult?r.formatResult(a):a}},qe=function(n){if(null==n)return"";var e=n+"";if(e.includes(",")||e.includes('"')||e.includes("\n")||e.includes("\r")){var r=e.replace(/"/g,'""');return'"'.concat(r,'"')}return e},ze=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},je={COLUMN_REORDER:{duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ROW_REORDER:{duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},REDUCED_MOTION:{duration:150,easing:"ease-out",delay:0}},_e=function(n){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.top="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating")},Ue=function(n,e,r,t){return void 0===r&&(r={}),new Promise(function(t){n.style.transition="transform ".concat(e.duration,"ms ").concat(e.easing),e.delay&&(n.style.transitionDelay="".concat(e.delay,"ms")),n.style.transform="translate3d(0, 0, 0)";var o=function(){_e(n),n.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};n.addEventListener("transitionend",o),setTimeout(o,e.duration+(e.delay||0)+50)})},Ge=function(n){var e=n.element,r=n.finalConfig,t=n.fromBounds,o=n.toBounds;return C(void 0,void 0,void 0,function(){var n,i;return y(this,function(a){switch(a.label){case 0:return n=function(n,e){return{x:("x"in n?n.x:n.left)-e.x,y:("y"in n?n.y:n.top)-e.y}}(t,o),0===n.x&&0===n.y||ze()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(n.x)>Math.abs(n.y)?"column":"row",void 0===u&&(u={}),i=ze()?I(I({},je.REDUCED_MOTION),u):I(I({},"column"===l?je.COLUMN_REORDER:je.ROW_REORDER),u),_e(e),function(n,e){n.style.transform="translate3d(".concat(e.x,"px, ").concat(e.y,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating")}(e,n),[4,Ue(e,i,r)]);case 1:return a.sent(),[2]}var u,l})})},Ve=function(n){var e=n.element,r=n.options;return C(void 0,void 0,void 0,function(){var n,t,o,i,a,u,l,c,s,d,f,v,h,w,p,m;return y(this,function(g){return n=r.startY,t=r.endY,o=r.finalY,a=void 0===(i=r.duration)?300:i,l=void 0===(u=r.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":u,s=void 0===(c=r.delay)?0:c,d=r.onComplete,v=void 0===(f=r.respectReducedMotion)||f,ze()&&v?(void 0!==o&&(e.style.transform="",e.style.top="".concat(o,"px")),d&&d(),[2]):(h=e.getBoundingClientRect(),p=n-(w=h.top),m=t-w,[2,new Promise(function(n){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating"),e.style.transform="translate3d(0, ".concat(p,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating"),e.style.transition="transform ".concat(a,"ms ").concat(l),s&&(e.style.transitionDelay="".concat(s,"ms")),e.style.transform="translate3d(0, ".concat(m,"px, 0)");var r=function(){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating"),void 0!==o&&(e.style.top="".concat(o,"px")),e.removeEventListener("transitionend",r),d&&d(),n()};e.addEventListener("transitionend",r),setTimeout(r,a+(s||0)+50)})])})})},Ke=function(e){var r=i(!1),t=r[0],a=r[1];return o(function(){a(!0)},[]),t?n(Je,I({},e)):null},Je=function(e){var t=e.allowAnimations,c=void 0!==t&&t,s=e.cellUpdateFlash,d=void 0!==s&&s,f=e.className,v=e.columnBorders,h=void 0!==v&&v,w=e.columnEditorPosition,p=void 0===w?"right":w,m=e.columnEditorText,x=void 0===m?"Columns":m,S=e.columnReordering,M=void 0!==S&&S,k=e.columnResizing,T=void 0!==k&&k,F=e.defaultHeaders,P=e.editColumns,B=void 0!==P&&P,U=e.editColumnsInitOpen,V=void 0!==U&&U,K=e.enableHeaderEditing,J=void 0!==K&&K,$=e.enableRowSelection,Q=void 0!==$&&$,en=e.expandAll,on=void 0===en||en,un=e.expandIcon,sn=void 0===un?n(tn,{className:"st-expand-icon"}):un,fn=e.externalFilterHandling,vn=void 0!==fn&&fn,hn=e.externalSortHandling,wn=void 0!==hn&&hn,pn=e.filterIcon,mn=void 0===pn?n(cn,{className:"st-header-icon"}):pn,gn=e.footerRenderer,bn=e.headerCollapseIcon,In=void 0===bn?n(tn,{className:"st-header-icon"}):bn,xn=e.headerExpandIcon,Cn=void 0===xn?n(rn,{className:"st-header-icon"}):xn,yn=e.headerDropdown,Rn=e.headerHeight,Sn=e.height,Nn=e.hideFooter,An=void 0!==Nn&&Nn,Mn=e.initialSortColumn,kn=e.initialSortDirection,En=void 0===kn?"ascending":kn,Hn=e.isLoading,Tn=void 0!==Hn&&Hn,Fn=e.nextIcon,On=void 0===Fn?n(tn,{className:"st-next-prev-icon"}):Fn,Ln=e.onCellEdit,Pn=e.onCellClick,Bn=e.onColumnOrderChange,Wn=e.onColumnSelect,qn=e.onFilterChange,zn=e.onGridReady,jn=e.onHeaderEdit,_n=e.onLoadMore,Un=e.onNextPage,Gn=e.onPageChange,Vn=e.onRowGroupExpand,Kn=e.onRowSelectionChange,Jn=e.onSortChange,Xn=e.prevIcon,Yn=void 0===Xn?n(rn,{className:"st-next-prev-icon"}):Xn,$n=e.rowButtons,Zn=e.rowGrouping,Qn=e.rowHeight,ne=void 0===Qn?32:Qn,ee=e.rowIdAccessor,re=e.rows,te=e.selectionColumnWidth,oe=void 0===te?42:te,ie=e.rowsPerPage,ae=void 0===ie?10:ie,ue=e.selectableCells,le=void 0!==ue&&ue,ce=e.selectableColumns,se=void 0!==ce&&ce,de=e.serverSidePagination,fe=void 0!==de&&de,ve=e.shouldPaginate,he=void 0!==ve&&ve,we=e.sortDownIcon,pe=void 0===we?n(ln,{className:"st-header-icon"}):we,me=e.sortUpIcon,ge=void 0===me?n(an,{className:"st-header-icon"}):me,be=e.tableRef,Ie=e.theme,xe=void 0===Ie?"light":Ie,Ce=e.totalRowCount,ye=e.useHoverRowBackground,Re=void 0===ye||ye,Se=e.useOddEvenRowBackground,Me=void 0!==Se&&Se,He=e.useOddColumnBackground,Te=void 0!==He&&He;Te&&(Me=!1),h&&(Re=!1);var Fe=a(null),De=a(null),Oe=a(null),ze=a(null),_e=a(null),Ue=a(null),Ge=a(null),Ve=function(n){var e=n.tableBodyContainerRef,r=i(0),t=r[0],o=r[1];return g(function(){e.current&&o(e.current.offsetWidth-e.current.clientWidth)},[e]),{setScrollbarWidth:o,scrollbarWidth:t,tableBodyContainerRef:e}}({tableBodyContainerRef:Ue}),Ke=Ve.scrollbarWidth,Je=Ve.setScrollbarWidth,Xe=dn({headerContainerRef:Ge,mainSectionRef:Ue,scrollbarWidth:Ke}).isMainSectionScrollable,Ye=u(function(){if(Tn&&0===re.length){var n=he?ae:10;Xe&&(n+=1);var e=Array.from({length:n},function(n,e){var r;return(r={})[ee]="loading-".concat(e),r});return e}return re},[Tn,re,ee,ae,Xe,he]),$e=b(function(n){return n+1},0)[1],Ze=i(1),Qe=Ze[0],nr=Ze[1],er=i(F),rr=er[0],tr=er[1],or=i(!1),ir=or[0],ar=or[1],ur=i(!1),lr=ur[0],cr=ur[1],sr=i(null),dr=sr[0],fr=sr[1],vr=l(function(){var n=new Set,e=function(r){r.forEach(function(r){r.collapseDefault&&r.collapsible&&n.add(r.accessor),r.children&&e(r.children)})};return e(F),n},[F]),hr=i(vr),wr=hr[0],pr=hr[1];o(function(){tr(F)},[F]);var mr=function(n){var e=n.rows,r=n.rowIdAccessor,t=n.onRowSelectionChange,o=n.enableRowSelection,a=void 0!==o&&o,c=i(new Set),s=c[0],d=c[1],f=l(function(n){return!!a&&function(n,e){return e.has(n)}(n,s)},[s,a]),v=l(function(){return!!a&&function(n,e,r){return 0!==n.length&&n.every(function(n){return r.has(n[e]+"")})}(e,r,s)},[e,r,s,a]),h=u(function(){return a?function(n){return n.size}(s):0},[s,a]),w=u(function(){return a?function(n,e,r){return n.filter(function(n){return r.has(n[e]+"")})}(e,r,s):[]},[e,r,s,a]),p=l(function(n,o){if(a){var i=function(n,e){var r=new Set(e);return r.has(n)?r.delete(n):r.add(n),r}(n,s);if(d(i),t){var u=e.find(function(e){return e[r]+""===n});u&&t({row:u,isSelected:o,selectedRows:i})}}},[s,e,r,t,a]),m=l(function(n){var o;a&&(n?(o=function(n,e){return new Set(n.map(function(n){return n[e]+""}))}(e,r),t&&e.forEach(function(n){return t({row:n,isSelected:!0,selectedRows:o})})):(o=new Set,t&&s.forEach(function(n){var i=e.find(function(e){return e[r]+""===n});i&&t({row:i,isSelected:!1,selectedRows:o})})),d(o))},[e,r,t,s,a]),g=l(function(n){if(a){var e=f(n);p(n,!e)}},[f,p,a]),b=l(function(){if(a){if(t){var n=new Set;s.forEach(function(o){var i=e.find(function(n){return n[r]+""===o});i&&t({row:i,isSelected:!1,selectedRows:n})})}d(new Set)}},[s,e,r,t,a]);return{selectedRows:s,setSelectedRows:d,isRowSelected:f,areAllRowsSelected:v,selectedRowCount:h,selectedRowsData:w,handleRowSelect:p,handleSelectAll:m,handleToggleRow:g,clearSelection:b}}({rows:Ye,rowIdAccessor:ee,onRowSelectionChange:Kn,enableRowSelection:Q}),gr=mr.selectedRows,br=mr.setSelectedRows,Ir=mr.isRowSelected,xr=mr.areAllRowsSelected,Cr=mr.selectedRowCount,yr=mr.selectedRowsData,Rr=mr.handleRowSelect,Sr=mr.handleSelectAll,Nr=mr.handleToggleRow,Ar=mr.clearSelection,Mr=u(function(){var n,e=R([],rr,!0);return Q&&!(null===(n=null==rr?void 0:rr[0])||void 0===n?void 0:n.isSelectionColumn)&&(e=R([{accessor:"__row_selection__",label:"",width:oe,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],e,!0)),e},[Q,rr,oe]),kr=i(0),Er=kr[0],Hr=kr[1],Tr=i("none"),Fr=Tr[0],Dr=Tr[1],Or=i(new Set),Lr=Or[0],Pr=Or[1],Br=i(0),Wr=Br[0],qr=Br[1];g(function(){var n=function(){Ue.current&&qr(Ue.current.clientWidth)};n();var e=null;return Ue.current&&(e=new ResizeObserver(n)).observe(Ue.current),function(){e&&e.disconnect()}},[]);var zr=u(function(){var n=A(window.innerWidth),e=function(n){var e=n.containerWidth,r=n.maxPinnedWidthPercent,t=void 0===r?.8:r,o=n.collapsedHeaders,i=0,a=0,u=0;n.headers.forEach(function(n){if(!n.hide){var e=O(n,o).reduce(function(n,e){return n+L(e)},0);"left"===n.pinned?i+=e:"right"===n.pinned?a+=e:u+=e}});var l=i,c=a;if(e&&e>0){var s=e*t;i>s&&(i=s),a>s&&(a=s)}return{leftWidth:H(i),rightWidth:H(a),mainWidth:u,leftContentWidth:l,rightContentWidth:c}}({headers:Mr,containerWidth:Wr,maxPinnedWidthPercent:n,collapsedHeaders:wr});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth,pinnedLeftContentWidth:e.leftContentWidth,pinnedRightContentWidth:e.rightContentWidth}},[Mr,Wr,wr]),jr=zr.mainBodyWidth,_r=zr.pinnedLeftWidth,Ur=zr.pinnedRightWidth,Gr=zr.pinnedLeftContentWidth,Vr=zr.pinnedRightContentWidth,Kr=function(n){var e=n.height,r=n.rowHeight,t=n.shouldPaginate,o=n.rowsPerPage;return u(function(){var n;if(!e&&t&&o)return r*(o+1);if(!e)return window.innerHeight-r;var i,a=document.querySelector(".simple-table-root");return i="string"==typeof e?e.endsWith("px")?parseInt(e,10):e.endsWith("vh")?window.innerHeight*parseInt(e,10)/100:e.endsWith("%")?((null===(n=null==a?void 0:a.parentElement)||void 0===n?void 0:n.clientHeight)||window.innerHeight)*parseInt(e,10)/100:window.innerHeight:e,Math.max(0,i-r)},[e,r,t,o])}({height:Sn,rowHeight:ne,shouldPaginate:he,rowsPerPage:ae}),Jr=function(n){var e=n.rows,r=n.headers,t=n.rowGrouping;return u(function(){if(!t||0===t.length)return e;var n=function(n){return E(n).filter(function(n){return n.aggregation})}(r);if(0===n.length)return e;var o=JSON.parse(JSON.stringify(e)),i=function(e,r){return void 0===r&&(r=0),e.map(function(e){var o=t[r],a=t[r+1],u=e[o];if(u&&z(u)){var l=i(u,r+1),c=I({},e);return c[o]=l,n.forEach(function(n){var e=We(l,n.accessor,n.aggregation,a);void 0!==e&&q(c,n.accessor,e)}),c}return e})};return i(o)},[e,r,t])}({rows:Ye,headers:rr,rowGrouping:Zn}),Xr=function(n){var e=n.rows,r=n.externalFilterHandling,t=n.onFilterChange,o=i({}),a=o[0],c=o[1],s=u(function(){return Be({externalFilterHandling:r,tableRows:e,filterState:a})},[e,a,r]),d=l(function(n){var e,r=I(I({},a),((e={})[n.accessor]=n,e));c(r),null==t||t(r)},[a,t]),f=l(function(n){var e=I({},a);delete e[n],c(e),null==t||t(e)},[a,t]),v=l(function(){c({}),null==t||t({})},[t]),h=l(function(n){var t,o=I(I({},a),((t={})[n.accessor]=n,t));return Be({externalFilterHandling:r,tableRows:e,filterState:o})},[a,e,r]);return{filteredRows:s,updateFilter:d,clearFilter:f,clearAllFilters:v,filters:a,computeFilteredRowsPreview:h}}({rows:Jr,externalFilterHandling:vn,onFilterChange:qn}),Yr=Xr.filters,$r=Xr.updateFilter,Zr=Xr.clearFilter,Qr=Xr.clearAllFilters,nt=Xr.computeFilteredRowsPreview,et=function(n){var e=n.headers,r=n.tableRows,t=n.externalSortHandling,o=n.onSortChange,a=n.rowGrouping,c=n.initialSortColumn,s=n.initialSortDirection,d=l(function(){if(!c)return null;var n=function(e){for(var r=0,t=e;t.length>r;r++){var o=t[r];if(o.accessor===c)return o;if(o.children&&o.children.length>0){var i=n(o.children);if(i)return i}}},r=n(e);return r?{key:r,direction:s||"ascending"}:null},[e,c,s]),f=i(d),v=f[0],h=f[1],w=l(function(n){var e=n.groupingKeys,r=n.headers,t=n.sortColumn,o=ke({headers:r,rows:n.rows,sortColumn:t});return e&&0!==e.length?o.map(function(n){var o,i=e[0],a=n[i];if(z(a)){var u=w({rows:a,sortColumn:t,headers:r,groupingKeys:e.slice(1)});return I(I({},n),((o={})[i]=u,o))}return n}):o},[]),p=u(function(){return Ee({externalSortHandling:t,tableRows:r,sortColumn:v,rowGrouping:a,headers:e,sortNestedRows:w})},[r,v,e,t,a,w]),m=l(function(n){var r=function(e){for(var t=0,o=e;o.length>t;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},t=r(e);if(t){var i=null;v&&v.key.accessor===n?"ascending"===v.direction&&(i={key:t,direction:"descending"}):i={key:t,direction:"ascending"},h(i),null==o||o(i)}},[v,e,o]),g=l(function(n){var o=function(e){for(var r=0,t=e;t.length>r;r++){var i=t[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(e);if(!i)return r;var u=null;return v&&v.key.accessor===n?"ascending"===v.direction&&(u={key:i,direction:"descending"}):u={key:i,direction:"ascending"},Ee({externalSortHandling:t,tableRows:r,sortColumn:u,rowGrouping:a,headers:e,sortNestedRows:w})},[v,e,r,t,a,w]);return{sort:v,sortedRows:p,updateSort:m,computeSortedRowsPreview:g}}({headers:rr,tableRows:Xr.filteredRows,externalSortHandling:wn,onSortChange:Jn,rowGrouping:Zn,initialSortColumn:Mn,initialSortDirection:En}),rt=et.sort,tt=et.sortedRows,ot=et.updateSort,it=function(n){var e=n.allowAnimations,r=n.sortedRows,t=n.originalRows,o=n.currentPage,c=n.rowsPerPage,s=n.shouldPaginate,d=n.serverSidePagination,f=n.rowGrouping,v=n.rowIdAccessor,h=n.unexpandedRows,w=n.expandAll,p=n.contentHeight,m=n.rowHeight,b=n.scrollTop,x=n.scrollDirection,C=void 0===x?"none":x,y=n.computeFilteredRowsPreview,S=n.computeSortedRowsPreview,A=i(!1),M=A[0],k=A[1],E=i([]),H=E[0],T=E[1],F=a([]),D=a([]),O=u(function(){return N(m)},[m]),L=a(new Map),P=a(null),B=l(function(n){var e=s&&!d?n.slice((o-1)*c,o*c):n,r=s?(o-1)*c:0;return f&&0!==f.length?function(n){var e=n.depth,r=n.expandAll,t=void 0!==r&&r,o=n.unexpandedRows,i=n.rowGrouping,a=void 0===i?[]:i,u=n.rowIdAccessor,l=n.displayPositionOffset,c=void 0===l?0:l,s=[],d=function(n,e,r,i){void 0===r&&(r=0),void 0===i&&(i=c);var l=r,f=i;return n.forEach(function(r,i){var c=j({row:r,rowIdAccessor:u}),v=a[e];if(s.push({row:r,depth:e,displayPosition:f,groupingKey:v,position:l,isLastGroupRow:0===e&&i===n.length-1}),l++,f++,_(c,t,o)&&a.length>e){var h=function(n,e){var r=n[e];return z(r)?r:[]}(r,v);h.length>0&&(l=d(h,e+1,l,f))}}),l};return d(n.rows,void 0===e?0:e,0,c),s}({rows:e,rowGrouping:f,rowIdAccessor:v,unexpandedRows:h,expandAll:w,displayPositionOffset:r}):e.map(function(n,e){return{row:n,depth:0,displayPosition:r+e,groupingKey:void 0,position:e,isLastGroupRow:!1}})},[o,c,s,d,f,v,h,w]);u(function(){if(0===L.current.size){var n=B(t),e=new Map;n.forEach(function(n){var r=j({row:n.row,rowIdAccessor:v})+"";e.set(r,n.position)}),L.current=e}},[t,B,v]);var W=u(function(){return B(r)},[r,B]),q=u(function(){return G({bufferRowCount:O,contentHeight:p,tableRows:W,rowHeight:m,scrollTop:b,scrollDirection:C})},[W,p,m,b,C,O]),U=l(function(n,e){var r=new Set(n.map(function(n){return j({row:n.row,rowIdAccessor:v})+""})),t=new Set(e.map(function(n){return j({row:n.row,rowIdAccessor:v})+""}));return{staying:e.filter(function(n){var e=j({row:n.row,rowIdAccessor:v})+"";return r.has(e)}),entering:e.filter(function(n){var e=j({row:n.row,rowIdAccessor:v})+"";return!r.has(e)}),leaving:n.filter(function(n){var e=j({row:n.row,rowIdAccessor:v})+"";return!t.has(e)})}},[v]),V=u(function(){if(0===F.current.length)return!1;var n=W.map(function(n){return j({row:n.row,rowIdAccessor:v})+""}),e=F.current.map(function(n){return j({row:n.row,rowIdAccessor:v})+""});return n.length!==e.length||!n.every(function(n,r){return n===e[r]})},[W,v]);g(function(){if(!M){if(!e||s)return T([]),F.current=W,void(D.current=q);if(0===F.current.length)return T([]),F.current=W,void(D.current=q);if(!V)return T([]),F.current=W,void(D.current=q);P.current={tableRows:W,visibleRows:q},k(!0)}},[e,W,V,M,s,q]),g(function(){if(M&&P.current&&H.length>0){var n=setTimeout(function(){var n=P.current;k(!1),T([]),F.current=n.tableRows,D.current=n.visibleRows,P.current=null},je.ROW_REORDER.duration+100);return function(){return clearTimeout(n)}}},[M,H.length]);var K=u(function(){if(!e||s)return q;if(H.length>0){var n=new Map,r=new Map;return W.forEach(function(e){var t=j({row:e.row,rowIdAccessor:v})+"";n.set(t,e.position),r.set(t,e.displayPosition)}),H.map(function(e){var t=j({row:e.row,rowIdAccessor:v})+"",o=n.get(t),i=r.get(t);return void 0!==o&&void 0!==i?I(I({},e),{position:o,displayPosition:i}):e})}return q},[q,H,W,e,s,v]),J=l(function(n){if(e&&!s){var r=y(n),t=B(r),o=G({bufferRowCount:O,contentHeight:p,tableRows:t,rowHeight:m,scrollTop:b,scrollDirection:C}),i=U(q,o).entering.map(function(n){var e=j({row:n.row,rowIdAccessor:v})+"";return W.find(function(n){return j({row:n.row,rowIdAccessor:v})+""===e})||n}).filter(Boolean);i.length>0&&T(R(R([],q,!0),i,!0))}},[e,s,y,B,p,m,b,C,U,W,q,v,O]),X=l(function(n){if(e&&!s){var r=S(n),t=B(r),o=G({bufferRowCount:O,contentHeight:p,tableRows:t,rowHeight:m,scrollTop:b,scrollDirection:C}),i=U(q,o).entering.map(function(n){var e=j({row:n.row,rowIdAccessor:v})+"";return W.find(function(n){return j({row:n.row,rowIdAccessor:v})+""===e})||n}).filter(Boolean);i.length>0&&T(R(R([],q,!0),i,!0))}},[e,s,S,B,p,m,b,C,U,W,q,v,O]);return{currentTableRows:W,currentVisibleRows:q,isAnimating:M,prepareForFilterChange:J,prepareForSortChange:X,rowsToRender:K}}({allowAnimations:c,sortedRows:tt,originalRows:Jr,currentPage:Qe,rowsPerPage:ae,shouldPaginate:he,serverSidePagination:fe,rowGrouping:Zn,rowIdAccessor:ee,unexpandedRows:Lr,expandAll:on,contentHeight:Kr,rowHeight:ne,scrollTop:Er,scrollDirection:Fr,computeFilteredRowsPreview:nt,computeSortedRowsPreview:et.computeSortedRowsPreview}),at=it.currentTableRows,ut=it.rowsToRender,lt=it.prepareForFilterChange,ct=it.prepareForSortChange,st=it.isAnimating,dt=a(new Map),ft=a(new Map),vt=function(n){var e=n.selectableCells,r=n.headers,t=n.tableRows,c=n.rowIdAccessor,s=n.onCellEdit,d=n.cellRegistry,f=n.collapsedHeaders,v=n.rowHeight,h=n.enableRowSelection,w=void 0!==h&&h,p=i(new Set),m=p[0],g=p[1],b=i(new Set),I=b[0],x=b[1],R=i(null),S=R[0],N=R[1],A=i(null),M=A[0],k=A[1],E=i(new Set),H=E[0],T=E[1],F=i(new Set),D=F[0],L=F[1],P=i(!1),B=P[0],z=P[1],_=a(!1),U=a(null),G=u(function(){var n=new Set;return m.forEach(function(e){var r=e.split("-");if(r.length>=2){var t=parseInt(r[1],10);isNaN(t)||n.add(t)}}),I.forEach(function(e){n.add(e)}),n},[m,I]),V=u(function(){var n=new Set;return m.forEach(function(e){var r=e.split("-");if(r.length>=3){var t=r.slice(2).join("-");n.add(t)}}),I.size>0&&t.forEach(function(e){var r=j({row:e.row,rowIdAccessor:c});n.add(r+"")}),n},[m,I,t,c]),K=u(function(){return r.flatMap(function(n){return O(n,f)})},[r,f]),J=l(function(){if(0!==m.size){var n=function(n,e,r){var t=e.filter(function(n){return!n.hide&&!n.excludeFromRender}),o=new Map,i=new Map;t.forEach(function(n,e){o.set(e,n.accessor),i.set(e,n)});var a=Array.from(n).reduce(function(n,e){var t,a=e.split("-").map(Number),u=a[0],l=a[1];n[u]||(n[u]=[]);var c=o.get(l),s=i.get(l);if(c&&(null===(t=r[u])||void 0===t?void 0:t.row)){var d=r[u].row,f=W(d,c);if(!1!==(null==s?void 0:s.useFormattedValueForClipboard)&&(null==s?void 0:s.valueFormatter)){var v=s.valueFormatter({accessor:c,colIndex:l,row:d,rowIndex:u,value:f});n[u][l]=v}else n[u][l]=!s||"lineAreaChart"!==s.type&&"barChart"!==s.type?f:Array.isArray(f)?f.join(", "):""}else n[u][l]="";return n},{});return Object.values(a).map(function(n){return Object.values(n).join("\t")}).join("\n")}(m,K,t);navigator.clipboard.writeText(n),T(new Set(m)),setTimeout(function(){return T(new Set)},800)}},[m,K,t]),$=l(function(){return C(void 0,void 0,void 0,function(){var n,e,r,o,i;return y(this,function(a){switch(a.label){case 0:if(!M)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(n=a.sent())?(e=function(n,e,r,t,o,i,a){var u=new Set,l=new Set,c=n.split("\n").filter(function(n){return n.length>0});if(0===c.length)return{updatedCells:u,warningCells:l};var s=r.filter(function(n){return!n.hide&&!n.excludeFromRender}),d=e.rowIndex,f=e.colIndex;return c.forEach(function(n,e){n.split("\t").forEach(function(n,r){var c=d+e,v=f+r;if(t.length>c&&s.length>v){var h=t[c],w=s[v],p=j({row:h.row,rowIdAccessor:o});if(null==w?void 0:w.isEditable){var m=n;if("number"===w.type){var g=+n;isNaN(g)||(m=g)}else if("boolean"===w.type)m="true"===n.toLowerCase()||"1"===n;else if("date"===w.type){var b=new Date(n);isNaN(b.getTime())||(m=b)}else"lineAreaChart"!==w.type&&"barChart"!==w.type||(m=n.split(",").map(function(n){var e=+n.trim();return isNaN(e)?0:e}));if(q(h.row,w.accessor,m),a){var I="".concat(p,"-").concat(w.accessor),x=a.get(I);x&&x.updateContent(m)}null==i||i({accessor:w.accessor,newValue:m,row:h.row,rowIndex:c});var C="".concat(c,"-").concat(v,"-").concat(p);u.add(C)}else{var y="".concat(c,"-").concat(v,"-").concat(p);l.add(y)}}})}),{updatedCells:u,warningCells:l}}(n,M,K,t,c,s,d),o=e.warningCells,(r=e.updatedCells).size>0&&(T(r),setTimeout(function(){return T(new Set)},800)),o.size>0&&(L(o),setTimeout(function(){return L(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[M,K,t,c,s,d]),Z=l(function(){if(0!==m.size){var n=function(n,e,r,t,o,i){var a=new Set,u=new Set,l=e.filter(function(n){return!n.hide&&!n.excludeFromRender}),c=new Map;return l.forEach(function(n,e){c.set(e,n.accessor)}),Array.from(n).forEach(function(n){var e=n.split("-").map(Number),c=e[0],s=e[1];if(r.length>c&&l.length>s){var d=r[c],f=l[s],v=j({row:d.row,rowIdAccessor:t});if(null==f?void 0:f.isEditable){var h;if(h="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:"lineAreaChart"===f.type||"barChart"===f.type||Array.isArray(W(d.row,f.accessor))?[]:""),q(d.row,f.accessor,h),i){var w="".concat(v,"-").concat(f.accessor),p=i.get(w);p&&p.updateContent(h)}null==o||o({accessor:f.accessor,newValue:h,row:d.row,rowIndex:c}),a.add(n)}else u.add(n)}}),{deletedCells:a,warningCells:u}}(m,K,t,c,s,d),e=n.deletedCells,r=n.warningCells;e.size>0&&(T(e),setTimeout(function(){return T(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800))}},[m,K,t,c,s,d]),Q=l(function(n,e){for(var r=new Set,o=Math.min(n.rowIndex,e.rowIndex),i=Math.max(n.rowIndex,e.rowIndex),a=Math.min(n.colIndex,e.colIndex),u=Math.max(n.colIndex,e.colIndex),l=o;i>=l;l++)for(var s=a;u>=s;s++)if(l>=0&&t.length>l){if(w&&0===s)continue;var d=j({row:t[l].row,rowIdAccessor:c});r.add(Y({colIndex:s,rowIndex:l,rowId:d}))}x(new Set),N(null),g(r),k(e),setTimeout(function(){return X(e,v)},0)},[t,c,v,w]),nn=l(function(n){if(n.rowIndex>=0&&t.length>n.rowIndex&&n.colIndex>=0&&(w?K.length:K.length-1)>=n.colIndex){var e=Y(n);x(new Set),N(null),g(new Set([e])),k(n),setTimeout(function(){return X(n,v)},0)}},[K.length,t.length,v,w]),en=l(function(n,e){void 0===e&&(e=!1),g(new Set),k(null),x(function(r){var t=new Set(e?r:[]);return n.forEach(function(n){return t.add(n)}),t}),n.length>0&&N(n[n.length-1])},[]);!function(n){var e=n.selectableCells,r=n.initialFocusedCell,t=n.tableRows,i=n.leafHeaders,a=n.rowIdAccessor,u=n.selectSingleCell,l=n.selectCellRange,c=n.setSelectedCells,s=n.setSelectedColumns,d=n.setLastSelectedColumnIndex,f=n.copyToClipboard,v=n.pasteFromClipboard,h=n.deleteSelectedCells,w=n.startCell,p=n.enableRowSelection,m=void 0!==p&&p;o(function(){var n=function(n){var u;if(e&&r){var l=r.rowIndex,R=r.colIndex,S=r.rowId;if(!n.ctrlKey&&!n.metaKey||"c"!==n.key){if((n.ctrlKey||n.metaKey)&&"v"===n.key)return n.preventDefault(),void v();if((n.ctrlKey||n.metaKey)&&"a"===n.key){n.preventDefault();for(var N=new Set,A=0;t.length>A;A++)for(var M=0;i.length>M;M++){var k=m?M+1:M,E=j({row:t[A].row,rowIdAccessor:a});N.add("".concat(A,"-").concat(k,"-").concat(E))}return c(N),s(new Set),void d(null)}if("Delete"===n.key||"Backspace"===n.key)return n.preventDefault(),void h();if(j({row:null===(u=t[l])||void 0===u?void 0:u.row,rowIdAccessor:a})!==S){var H=t.findIndex(function(n){return j({row:n.row,rowIdAccessor:a})===S});if(-1===H)return;l=H}var T=function(n,e,r){var o=n,a=e;return"up"===r?o=0:"down"===r?o=t.length-1:"left"===r?a=m?1:0:"right"===r&&(a=m?i.length:i.length-1),{rowIndex:o,colIndex:a}};"ArrowUp"===n.key?(n.preventDefault(),o(n,l,R,T)):"ArrowDown"===n.key?(n.preventDefault(),p(n,l,R,T)):"ArrowLeft"===n.key||"Tab"===n.key&&n.shiftKey?(n.preventDefault(),g(n,l,R,T)):"ArrowRight"===n.key||"Tab"===n.key?(n.preventDefault(),b(n,l,R,T)):"Home"===n.key?(n.preventDefault(),I(n,l)):"End"===n.key?(n.preventDefault(),x(n,l)):"PageUp"===n.key?(n.preventDefault(),C(n,l,R)):"PageDown"===n.key?(n.preventDefault(),y(n,l,R)):"Escape"===n.key&&(c(new Set),s(new Set),d(null),w.current=null)}else f()}},o=function(n,e,o,i){if(n.shiftKey){w.current||(w.current=r);var c=e-1;if((n.ctrlKey||n.metaKey)&&(c=i(e,o,"up").rowIndex),c>=0){var s=j({row:t[c].row,rowIdAccessor:a});l(w.current,{rowIndex:c,colIndex:o,rowId:s})}}else e>0&&(c=e-1,(n.ctrlKey||n.metaKey)&&(c=i(e,o,"up").rowIndex),s=j({row:t[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:o,rowId:s}),w.current=null)},p=function(n,e,o,i){if(n.shiftKey){w.current||(w.current=r);var c=e+1;if((n.ctrlKey||n.metaKey)&&(c=i(e,o,"down").rowIndex),t.length>c){var s=j({row:t[c].row,rowIdAccessor:a});l(w.current,{rowIndex:c,colIndex:o,rowId:s})}}else t.length-1>e&&(c=e+1,(n.ctrlKey||n.metaKey)&&(c=i(e,o,"down").rowIndex),s=j({row:t[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:o,rowId:s}),w.current=null)},g=function(n,e,o,i){if(n.shiftKey&&"ArrowLeft"===n.key){w.current||(w.current=r);var c=o-1;if(n.ctrlKey||n.metaKey)c=i(e,o,"left").colIndex;else if(m&&0===c)return;if(c>=0){var s=j({row:t[e].row,rowIdAccessor:a});l(w.current,{rowIndex:e,colIndex:c,rowId:s})}}else if(o>0){if(c=o-1,(n.ctrlKey||n.metaKey)&&"ArrowLeft"===n.key)c=i(e,o,"left").colIndex;else if(m&&0===c)return;0>c||(s=j({row:t[e].row,rowIdAccessor:a}),u({rowIndex:e,colIndex:c,rowId:s}),w.current=null)}},b=function(n,e,o,c){var s=m?i.length:i.length-1;if(n.shiftKey&&"ArrowRight"===n.key){w.current||(w.current=r);var d=o+1;if((n.ctrlKey||n.metaKey)&&(d=c(e,o,"right").colIndex),s>=d){var f=j({row:t[e].row,rowIdAccessor:a});l(w.current,{rowIndex:e,colIndex:d,rowId:f})}}else s>o&&(d=o+1,(n.ctrlKey||n.metaKey)&&"ArrowRight"===n.key&&(d=c(e,o,"right").colIndex),d>s||(f=j({row:t[e].row,rowIdAccessor:a}),u({rowIndex:e,colIndex:d,rowId:f}),w.current=null))},I=function(n,e,o){if(n.shiftKey){w.current||(w.current=r);var i=e,c=m?1:0;(n.ctrlKey||n.metaKey)&&(i=0);var s=j({row:t[i].row,rowIdAccessor:a});l(w.current,{rowIndex:i,colIndex:c,rowId:s})}else i=e,c=m?1:0,(n.ctrlKey||n.metaKey)&&(i=0),s=j({row:t[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:c,rowId:s}),w.current=null},x=function(n,e,o){if(n.shiftKey){w.current||(w.current=r);var c=e,s=m?i.length:i.length-1;(n.ctrlKey||n.metaKey)&&(c=t.length-1);var d=j({row:t[c].row,rowIdAccessor:a});l(w.current,{rowIndex:c,colIndex:s,rowId:d})}else c=e,s=m?i.length:i.length-1,(n.ctrlKey||n.metaKey)&&(c=t.length-1),d=j({row:t[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:s,rowId:d}),w.current=null},C=function(n,e,o){var i=Math.max(0,e-10);if(n.shiftKey){w.current||(w.current=r);var c=j({row:t[i].row,rowIdAccessor:a});l(w.current,{rowIndex:i,colIndex:o,rowId:c})}else c=j({row:t[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:o,rowId:c}),w.current=null},y=function(n,e,o){var i=Math.min(t.length-1,e+10);if(n.shiftKey){w.current||(w.current=r);var c=j({row:t[i].row,rowIdAccessor:a});l(w.current,{rowIndex:i,colIndex:o,rowId:c})}else c=j({row:t[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:o,rowId:c}),w.current=null};return document.addEventListener("keydown",n),function(){document.removeEventListener("keydown",n)}},[e,r,t,i,a,u,l,c,s,d,f,v,h,w,m])}({selectableCells:e,initialFocusedCell:M,tableRows:t,leafHeaders:K,rowIdAccessor:c,selectSingleCell:nn,selectCellRange:Q,setSelectedCells:g,setSelectedColumns:x,setLastSelectedColumnIndex:N,copyToClipboard:J,pasteFromClipboard:$,deleteSelectedCells:Z,startCell:U,enableRowSelection:w});var rn=l(function(n,e){var r=new Set,o=new Map;t.forEach(function(n,e){var r=j({row:n.row,rowIdAccessor:c});o.set(r+"",e)});for(var i=o.get(n.rowId+""),a=o.get(e.rowId+""),u=void 0!==i?i:n.rowIndex,l=void 0!==a?a:e.rowIndex,s=Math.min(u,l),d=Math.max(u,l),f=Math.min(n.colIndex,e.colIndex),v=Math.max(n.colIndex,e.colIndex),h=s;d>=h;h++)for(var p=f;v>=p;p++)if(h>=0&&t.length>h){if(w&&0===p)continue;var m=j({row:t[h].row,rowIdAccessor:c});r.add(Y({colIndex:p,rowIndex:h,rowId:m}))}g(r)},[t,c,w]),tn=l(function(n,e){var r=document.querySelector(".st-body-container");if(!r)return null;var t=r.getBoundingClientRect(),o=Array.from(document.querySelectorAll(".st-cell[data-row-index][data-col-index]:not(.st-selection-cell)"));if(0===o.length)return null;var i=Math.max(t.left,Math.min(t.right,n)),a=Math.max(t.top,Math.min(t.bottom,e)),u=null,l=1/0;if(o.forEach(function(n){if(n instanceof HTMLElement){var e=n,r=e.getBoundingClientRect(),t=r.top+r.height/2,o=Math.sqrt(Math.pow(r.left+r.width/2-i,2)+Math.pow(t-a,2));l>o&&(l=o,u=e)}}),null!==u){var c=u,s=parseInt(c.getAttribute("data-row-index")||"-1",10),d=parseInt(c.getAttribute("data-col-index")||"-1",10),f=c.getAttribute("data-row-id");if(s>=0&&d>=0&&null!==f)return{rowIndex:s,colIndex:d,rowId:f}}return null},[]),on=l(function(n,e){var r=document.elementFromPoint(n,e);if(!r)return null;var t=r.closest(".st-cell");if(t instanceof HTMLElement){var o=parseInt(t.getAttribute("data-row-index")||"-1",10),i=parseInt(t.getAttribute("data-col-index")||"-1",10),a=t.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return tn(n,e)},[tn]),an=l(function(n,e){var r=document.querySelector(".st-body-container");if(r){var t=r.getBoundingClientRect();t.top+50>e?r.scrollTop-=10*Math.min(3,1+Math.max(0,t.top-e)/100):e>t.bottom-50&&(r.scrollTop+=10*Math.min(3,1+Math.max(0,e-t.bottom)/100));var o=document.querySelector(".st-body-main");o&&(t.left+50>n?o.scrollLeft-=10*Math.min(3,1+Math.max(0,t.left-n)/100):n>t.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,n-t.right)/100)))}},[]),un=l(function(n){var e=n.colIndex,r=Y({colIndex:e,rowIndex:n.rowIndex,rowId:n.rowId}),t=m.has(r),o=I.has(e);return t||o},[m,I]),ln=l(function(n){var e=n.colIndex,r=n.rowIndex,o=n.rowId;if(B)return"";var i=[],a=t[r-1]?j({row:t[r-1].row,rowIdAccessor:c}):null,u=t[r+1]?j({row:t[r+1].row,rowIdAccessor:c}):null,l=null!==a?{colIndex:e,rowIndex:r-1,rowId:a}:null,s=null!==u?{colIndex:e,rowIndex:r+1,rowId:u}:null,d={colIndex:e-1,rowIndex:r,rowId:o},f={colIndex:e+1,rowIndex:r,rowId:o};return(!l||!un(l)||I.has(e)&&0===r)&&i.push("st-selected-top-border"),(!s||!un(s)||I.has(e)&&r===t.length-1)&&i.push("st-selected-bottom-border"),un(d)||i.push("st-selected-left-border"),un(f)||i.push("st-selected-right-border"),i.join(" ")},[B,un,t,I,c]),cn=u(function(){return M?function(n){return n.rowIndex===M.rowIndex&&n.colIndex===M.colIndex&&n.rowId===M.rowId}:function(){return!1}},[M]),sn=l(function(n){var e=Y({colIndex:n.colIndex,rowIndex:n.rowIndex,rowId:n.rowId});return H.has(e)},[H]),dn=l(function(n){var e=Y({colIndex:n.colIndex,rowIndex:n.rowIndex,rowId:n.rowId});return D.has(e)},[D]);return{getBorderClass:ln,handleMouseDown:function(n){var r=n.colIndex,t=n.rowIndex,o=n.rowId;if(e){_.current=!0,z(!0),U.current={rowIndex:t,colIndex:r,rowId:o},setTimeout(function(){x(new Set),N(null);var n=Y({colIndex:r,rowIndex:t,rowId:o});g(new Set([n])),k({rowIndex:t,colIndex:r,rowId:o})},0);var i=null,a=null,u=null,l=0,c=function(){if(_.current&&U.current){if(null!==i&&null!==a){an(i,a);var n=Date.now();if(n-l>=16){var e=on(i,a);e&&rn(U.current,e),l=n}}u=requestAnimationFrame(c)}else null!==u&&(cancelAnimationFrame(u),u=null)},s=function(n){_.current&&U.current&&(i=n.clientX,a=n.clientY)},d=function(){_.current=!1,z(!1),null!==u&&(cancelAnimationFrame(u),u=null),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),u=requestAnimationFrame(c)}},handleMouseOver:function(n){e&&_.current&&U.current&&rn(U.current,{colIndex:n.colIndex,rowIndex:n.rowIndex,rowId:n.rowId})},isCopyFlashing:sn,isWarningFlashing:dn,isInitialFocusedCell:cn,isSelected:un,lastSelectedColumnIndex:S,pasteFromClipboard:$,selectColumns:en,selectedCells:m,selectedColumns:I,setInitialFocusedCell:k,setSelectedCells:g,setSelectedColumns:x,deleteSelectedCells:Z,columnsWithSelectedCells:G,rowsWithSelectedCells:V}}({selectableCells:le,headers:rr,tableRows:at,rowIdAccessor:ee,onCellEdit:Ln,cellRegistry:dt.current,collapsedHeaders:wr,rowHeight:ne,enableRowSelection:Q}),ht=vt.getBorderClass,wt=vt.handleMouseDown,pt=vt.handleMouseOver,mt=vt.isCopyFlashing,gt=vt.isInitialFocusedCell,bt=vt.isSelected,It=vt.isWarningFlashing,xt=vt.selectColumns,Ct=vt.selectedCells,yt=vt.selectedColumns,Rt=vt.setInitialFocusedCell,St=vt.setSelectedCells,Nt=vt.setSelectedColumns,At=vt.columnsWithSelectedCells,Mt=vt.rowsWithSelectedCells,kt=l(function(n){ct(n),setTimeout(function(){ot(n)},0)},[ct,ot]),Et=l(function(n){tr(n)},[]);!function(n){var e=n.selectableColumns,r=n.selectedCells,t=n.selectedColumns,i=n.setSelectedCells,a=n.setSelectedColumns,u=n.activeHeaderDropdown,l=n.setActiveHeaderDropdown;o(function(){var n=function(n){var o=n.target;o.closest(".editable-cell-input")&&o.closest(".st-header-cell")||(u&&l&&(o.closest(".st-header-cell")||o.closest(".dropdown-content")||l(null)),o.closest(".st-cell")||e&&(o.classList.contains("st-header-cell")||o.classList.contains("st-header-label")||o.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),t.size>0&&a(new Set)))};return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n)}},[e,r,t,i,a,u,l])}({selectableColumns:se,selectedCells:Ct,selectedColumns:yt,setSelectedCells:St,setSelectedColumns:Nt,activeHeaderDropdown:dr,setActiveHeaderDropdown:fr}),function(n){var e=n.forceUpdate,r=n.tableBodyContainerRef,t=n.setScrollbarWidth;g(function(){var n=function(){e(),r.current&&t(r.current.offsetWidth-r.current.clientWidth)};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}},[e,r,t])}({forceUpdate:$e,tableBodyContainerRef:Ue,setScrollbarWidth:Je}),function(n){var e=n.onGridReady;o(function(){null==e||e()},[e])}({onGridReady:zn}),function(n){var e=n.cellRegistryRef,r=n.currentTableRows,t=n.headerRegistryRef,i=n.headers,a=n.rowIdAccessor,u=n.rows,l=n.tableRef,c=n.visibleRows;o(function(){l&&(l.current={updateData:function(n){var r=n.accessor,t=n.newValue,o=null==u?void 0:u[n.rowIndex];if(o){var i=j({row:o,rowIdAccessor:a}),l=D({rowId:i,accessor:r}),c=e.current.get(l);c&&c.updateContent(t),void 0!==W(o,r)&&q(o,r,t)}},setHeaderRename:function(n){var e=t.current.get(n.accessor+"");e&&e.setEditing(!0)},getVisibleRows:function(){return c},exportToCSV:function(n){!function(n,e,r){var t=function(n,e){var r=function(n){var e=[],r=function(n){for(var t=0,o=n;o.length>t;t++){var i=o[t];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?r(i.children):e.push(i))}};return r(n),e}(e);return R([r.map(function(n){return qe(n.label)}).join(",")],n.map(function(n,e){var t=n.row;return r.map(function(n,r){var o=W(t,n.accessor);if(n.exportValueGetter){var i=n.valueFormatter?n.valueFormatter({accessor:n.accessor,colIndex:r,row:t,rowIndex:e,value:o}):void 0,a=n.exportValueGetter({accessor:n.accessor,colIndex:r,row:t,rowIndex:e,value:o,formattedValue:i});return qe(a)}return!1!==n.useFormattedValueForCSV&&n.valueFormatter?(i=n.valueFormatter({accessor:n.accessor,colIndex:r,row:t,rowIndex:e,value:o}),qe(i)):qe(o)}).join(",")}),!0).join("\n")}(n,e);!function(n,e){void 0===e&&(e="table-export.csv");var r=new Blob([n],{type:"text/csv;charset=utf-8;"}),t=document.createElement("a"),o=URL.createObjectURL(r);t.setAttribute("href",o),t.setAttribute("download",e),t.style.visibility="hidden",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(o)}(t,r)}(r,i,(void 0===n?{}:n).filename)}})},[e,r,t,i,a,u,l,c])}({cellRegistryRef:dt,currentTableRows:at,headerRegistryRef:ft,headers:Mr,rowIdAccessor:ee,rows:Ye,tableRef:be,visibleRows:ut}),function(n){var e=n.filters,r=n.onFilterChange;o(function(){null==r||r(e)},[e,r])}({filters:Yr,onFilterChange:qn}),function(n){var e=n.sort,r=n.onSortChange,t=Dn(e);o(function(){!e||(null==t?void 0:t.key.accessor)===e.key.accessor&&(null==t?void 0:t.direction)===e.direction?!e&&t&&(null==r||r(null)):null==r||r(e)},[e,t,r])}({sort:rt,onSortChange:Jn});var Ht=l(function(n){lt(n),setTimeout(function(){$r(n)},0)},[lt,$r]);return n(Z,I({value:{allowAnimations:c,areAllRowsSelected:xr,cellRegistry:dt.current,cellUpdateFlash:d,clearSelection:Ar,collapsedHeaders:wr,columnBorders:h,columnReordering:M,columnResizing:T,draggedHeaderRef:Fe,editColumns:B,enableHeaderEditing:J,enableRowSelection:Q,expandAll:on,expandIcon:sn,filterIcon:mn,filters:Yr,forceUpdate:$e,getBorderClass:ht,handleApplyFilter:Ht,handleClearAllFilters:Qr,handleClearFilter:Zr,handleMouseDown:wt,handleMouseOver:pt,handleRowSelect:Rr,handleSelectAll:Sr,handleToggleRow:Nr,headerCollapseIcon:In,headerContainerRef:Ge,headerDropdown:yn,headerExpandIcon:Cn,headerRegistry:ft.current,headers:Mr,hoveredHeaderRef:De,isAnimating:st,isCopyFlashing:mt,isInitialFocusedCell:gt,isLoading:Tn,isResizing:ir,isRowSelected:Ir,isScrolling:lr,isSelected:bt,isWarningFlashing:It,mainBodyRef:Oe,nextIcon:On,onCellEdit:Ln,onCellClick:Pn,onColumnOrderChange:Bn,onColumnSelect:Wn,onLoadMore:_n,onRowGroupExpand:Vn,onSort:kt,onTableHeaderDragEnd:Et,pinnedLeftRef:ze,pinnedRightRef:_e,prevIcon:Yn,rowButtons:$n,rowGrouping:Zn,rowHeight:ne,headerHeight:null!=Rn?Rn:ne,rowIdAccessor:ee,scrollbarWidth:Ke,selectColumns:xt,selectableColumns:se,selectedColumns:yt,columnsWithSelectedCells:At,rowsWithSelectedCells:Mt,selectedRows:gr,selectedRowCount:Cr,selectedRowsData:yr,setCollapsedHeaders:pr,setHeaders:tr,setInitialFocusedCell:Rt,setIsResizing:ar,setIsScrolling:cr,setSelectedCells:St,setSelectedColumns:Nt,setSelectedRows:br,setUnexpandedRows:Pr,shouldPaginate:he,sortDownIcon:pe,sortUpIcon:ge,tableBodyContainerRef:Ue,tableRows:at,theme:xe,unexpandedRows:Lr,useHoverRowBackground:Re,useOddColumnBackground:Te,useOddEvenRowBackground:Me,activeHeaderDropdown:dr,setActiveHeaderDropdown:fr,onHeaderEdit:jn}},{children:n("div",I({className:"simple-table-root st-wrapper theme-".concat(xe," ").concat(null!=f?f:""," ").concat(h?"st-column-borders":""),style:Sn?{height:Sn}:{}},{children:n(Pe,{children:r("div",I({className:"st-wrapper-container"},{children:[r("div",I({className:"st-content-wrapper"},{children:[n(Ne,{pinnedLeftWidth:_r,pinnedRightWidth:Ur,setScrollTop:Hr,setScrollDirection:Dr,sort:rt,tableRows:at,rowsToRender:ut}),n(Le,{columnEditorText:x,editColumns:B,editColumnsInitOpen:V,headers:rr,position:p})]})),n(Ae,{mainBodyRef:Oe,mainBodyWidth:jr,pinnedLeftWidth:_r,pinnedRightWidth:Ur,pinnedLeftContentWidth:Gr,pinnedRightContentWidth:Vr,tableBodyContainerRef:Ue}),n(nn,{currentPage:Qe,footerRenderer:gn,hideFooter:An,onPageChange:nr,onNextPage:Un,onUserPageChange:Gn,rowsPerPage:ae,shouldPaginate:he,totalPages:Math.ceil((null!=Ce?Ce:tt.length)/ae),totalRows:null!=Ce?Ce:tt.length})]}))})}))}))},Xe=function(e){var t=e.data,o=e.width,i=void 0===o?"100%":o,a=e.height,u=void 0===a?30:a,l=e.color,c=e.fillColor,s=e.fillOpacity,d=void 0===s?.2:s,f=e.strokeWidth,v=void 0===f?2:f,h=e.className,w=void 0===h?"":h,p=e.min,m=e.max;if(!t||0===t.length)return null;var g=void 0!==p?p:Math.min.apply(Math,t),b=(void 0!==m?m:Math.max.apply(Math,t))-g||1,x=u,C=t.map(function(n,e){return{x:e/(t.length-1)*100,y:x-(n-g)/b*x}}).map(function(n,e){return"".concat(0===e?"M":"L"," ").concat(n.x,",").concat(n.y)}).join(" "),y="\n ".concat(C,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return r("svg",I({width:i,height:u,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(w),style:{display:"block"}},{children:[n("path",{d:y,fill:c||"var(--st-chart-fill-color)",fillOpacity:d,stroke:"none",vectorEffect:"non-scaling-stroke"}),n("path",{d:C,fill:"none",stroke:l||"var(--st-chart-color)",strokeWidth:v,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}))},Ye=Object.freeze({__proto__:null,default:Xe}),$e=function(e){var r=e.data,t=e.width,o=void 0===t?"100%":t,i=e.height,a=void 0===i?30:i,u=e.color,l=e.gap,c=void 0===l?2:l,s=e.className,d=void 0===s?"":s,f=e.min,v=e.max;if(!r||0===r.length)return null;var h=void 0!==f?f:Math.min.apply(Math,r),w=void 0!==v?v:Math.max.apply(Math,r),p=w-h||1,m=a,g=(100-c*(r.length-1))/r.length,b=0>h,x=b?m*(w/p):m;return n("svg",I({width:o,height:a,viewBox:"0 0 100 ".concat(m),preserveAspectRatio:"none",className:"st-bar-chart ".concat(d),style:{display:"block"}},{children:r.map(function(e,r){var t=r*(g+c),o=(e-h)/p*m,i=m-o,a=o;return b&&(0>e?(a=Math.abs(e)/p*m,i=x):i=x-(a=e/p*m)),n("rect",{x:t,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:1},r)})}))},Ze=Object.freeze({__proto__:null,default:$e});export{je as A,$e as B,un as C,ln as D,cn as F,Xe as L,S as R,Ke as S,x as _,Dn as a,I as b,N as c,Ve as d,en as e,Ge as f,rn as g,tn as h,on as i,an as j,sn as k,Q as u};
2
+ //# sourceMappingURL=index-76da1a62.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-76da1a62.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ import EnumOption from "./types/EnumOption";
11
11
  import HeaderObject, { Accessor, ChartOptions, ColumnType, Comparator, ComparatorProps, ExportValueGetter, ExportValueProps, ShowWhen, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps } from "./types/HeaderObject";
12
12
  import { AggregationConfig, AggregationType } from "./types/AggregationTypes";
13
13
  import OnSortProps from "./types/OnSortProps";
14
+ import OnRowGroupExpandProps from "./types/OnRowGroupExpandProps";
14
15
  import Row from "./types/Row";
15
16
  import SharedTableProps from "./types/SharedTableProps";
16
17
  import SortColumn from "./types/SortColumn";
@@ -30,4 +31,4 @@ import { RowButtonProps } from "./types/RowButton";
30
31
  import FooterRendererProps from "./types/FooterRendererProps";
31
32
  export { SimpleTable, LineAreaChart, BarChart };
32
33
  export * from "./icons";
33
- export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorPosition, ColumnType, Comparator, ComparatorProps, DragHandlerProps, EnumOption, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, OnSortProps, Row, RowButtonProps, RowSelectionChangeProps, SetHeaderRenameProps, SharedTableProps, ShowWhen, SortColumn, TableCellProps, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
34
+ export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorPosition, ColumnType, Comparator, ComparatorProps, DragHandlerProps, EnumOption, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, OnRowGroupExpandProps, OnSortProps, Row, RowButtonProps, RowSelectionChangeProps, SetHeaderRenameProps, SharedTableProps, ShowWhen, SortColumn, TableCellProps, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- export{e as AngleDownIcon,g as AngleLeftIcon,h as AngleRightIcon,i as AngleUpIcon,j as AscIcon,B as BarChart,C as CheckIcon,D as DescIcon,F as FilterIcon,L as LineAreaChart,k as SelectIcon,S as SimpleTable}from"./index-168b7d60.js";import"react/jsx-runtime";import"react";
1
+ export{e as AngleDownIcon,g as AngleLeftIcon,h as AngleRightIcon,i as AngleUpIcon,j as AscIcon,B as BarChart,C as CheckIcon,D as DescIcon,F as FilterIcon,L as LineAreaChart,k as SelectIcon,S as SimpleTable}from"./index-76da1a62.js";import"react/jsx-runtime";import"react";
2
2
  //# sourceMappingURL=index.es.js.map
@@ -0,0 +1,12 @@
1
+ import { MouseEvent } from "react";
2
+ import Row from "./Row";
3
+ interface OnRowGroupExpandProps {
4
+ row: Row;
5
+ rowIndex: number;
6
+ depth: number;
7
+ event: MouseEvent;
8
+ rowId: string | number;
9
+ groupingKey?: string;
10
+ isExpanded: boolean;
11
+ }
12
+ export default OnRowGroupExpandProps;
@@ -32,6 +32,14 @@ export declare const getNestedRows: (row: Row, groupingKey: string) => Row[];
32
32
  * Check if a row has nested rows for a given grouping key
33
33
  */
34
34
  export declare const hasNestedRows: (row: Row, groupingKey?: string) => boolean;
35
+ /**
36
+ * Determine if a row is expanded based on expandAll setting and unexpandedRows set
37
+ * @param rowId - The ID of the row to check
38
+ * @param expandAll - Whether all rows are expanded by default
39
+ * @param unexpandedRows - Set of row IDs that are in the opposite state of expandAll
40
+ * @returns true if the row is expanded, false otherwise
41
+ */
42
+ export declare const isRowExpanded: (rowId: string | number, expandAll: boolean, unexpandedRows: Set<string>) => boolean;
35
43
  /**
36
44
  * Flatten rows recursively based on row grouping configuration
37
45
  * Now calculates ALL properties including position and isLastGroupRow
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.8",
2
+ "version": "1.8.9",
3
3
  "main": "dist/cjs/index.js",
4
4
  "module": "dist/index.es.js",
5
5
  "types": "dist/index.d.ts",
@@ -1 +0,0 @@
1
- {"version":3,"file":"Animate-0fec37fc.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePicker-3baedbf0.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Animate-b13abc6f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePicker-1565e4c0.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}