simple-table-core 1.8.2 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animate-28770202.js → Animate-15cc96cd.js} +2 -2
- package/dist/Animate-15cc96cd.js.map +1 -0
- package/dist/{DatePicker-6a5ad6bd.js → DatePicker-204b9e2a.js} +2 -2
- package/dist/DatePicker-204b9e2a.js.map +1 -0
- package/dist/cjs/Animate-3fd679bc.js +2 -0
- package/dist/cjs/Animate-3fd679bc.js.map +1 -0
- package/dist/cjs/{DatePicker-ffaf94ca.js → DatePicker-8eb04cb7.js} +2 -2
- package/dist/cjs/DatePicker-8eb04cb7.js.map +1 -0
- package/dist/cjs/{index-ceedbfa9.js → index-9bed7b6d.js} +2 -2
- package/dist/cjs/index-9bed7b6d.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/{index-005b88d6.js → index-a1824055.js} +2 -2
- package/dist/index-a1824055.js.map +1 -0
- package/dist/index.es.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/base.css +10 -0
- package/src/styles/themes/sky.css +2 -2
- package/dist/Animate-28770202.js.map +0 -1
- package/dist/DatePicker-6a5ad6bd.js.map +0 -1
- package/dist/cjs/Animate-3e4c050e.js +0 -2
- package/dist/cjs/Animate-3e4c050e.js.map +0 -1
- package/dist/cjs/DatePicker-ffaf94ca.js.map +0 -1
- package/dist/cjs/index-ceedbfa9.js.map +0 -1
- package/dist/index-005b88d6.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),n=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(n);function o(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);t.length>o;o++)0>n.indexOf(t[o])&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function i(e,n,r,t){return new(r||(r=Promise))(function(o,i){function a(e){try{l(t.next(e))}catch(e){i(e)}}function u(e){try{l(t.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(a,u)}l((t=t.apply(e,n||[])).next())})}function a(e,n){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=n.call(e,i)}catch(e){u=[6,e],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 u(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;i>o;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;t>r;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},c=function(e){return 480>e?.3:768>e?.4:.8},s="parentExpanded",d=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=t(a[i],o);return o};return t(e,n),r},f=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,f(e.children)),n})},v=function(e){return void 0===e&&(e=0),e?e+1:0},h=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},p=function(e){var n=e.header,r=e.pinned,t=e.headers,o=e.collapsedHeaders;return n.hide||(r||n.pinned)&&n.pinned!==r?null:!(t&&o&&function(e,n,r){var t=function(e,n){for(var r=0,t=f(e);t.length>r;r++){var o=t[r];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);if(t){var o=r.has(t.accessor),i=e.showWhen||s;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,t,o))||null},w=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},m=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){var n=e.showWhen||s;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return m(e,n)}):e.children.filter(function(e){var n=e.showWhen||s;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return m(e,n)}):[e]},g=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(h({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},x=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(h({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){x(e)})},b=function(e){return"number"==typeof e.minWidth?e.minWidth:40},I=function(e,n){return n.includes(".")?(n+"").split(".").reduce(function(e,n){return null==e?void 0:e[n]},e):e[n]},C=function(e,n,r){if("string"!=typeof n||n.includes(".")){for(var t=(n+"").split("."),o=e,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 e[n]=r},y=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},R=function(e){return e.row[e.rowIdAccessor]},S=function(e,n,r){var t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>t.top?n.scrollTop-=o.top-t.top+i:t.bottom>o.bottom-i&&(n.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)}},N=function(e,n){var r=document.querySelector(".st-body-container"),t=document.querySelector(".st-body-main");if(r){var o=n+1,i=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(!i)return r.scrollTop=Math.max(0,e.rowIndex*o-r.clientHeight/3),void setTimeout(function(){var n=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));n&&S(n,r,t)},100);S(i,r,t)}},A=function(e){var n=e.colIndex,r=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(r)},M=n.createContext(void 0),k=function(n){return e.jsx(M.Provider,exports.__assign({value:n.value},{children:n.children}))},E=function(){var e=n.useContext(M);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},H=function(r){var t=r.currentPage,o=r.footerRenderer,u=r.hideFooter,l=r.onPageChange,c=r.onNextPage,s=r.onUserPageChange,d=r.rowsPerPage,f=r.shouldPaginate,v=r.totalPages,h=r.totalRows,p=E(),w=p.nextIcon,m=p.prevIcon,g=n.useState(!0),x=g[0],b=g[1],I=t>1,C=v>t,y=t===v,R=Math.min((t-1)*d+1,h),S=Math.min(t*d,h),N=!I,A=!C&&!c||!x&&y,M=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=t-1)?[3,2]:(l(e),s?[4,s(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},k=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(r){switch(r.label){case 0:return e=t===v,n=t+1,c&&e?[4,c(t)]:[3,2];case 1:if(!r.sent())return b(!1),[2];r.label=2;case 2:return n>v&&!c?[3,4]:(l(n),s?[4,s(n)]:[3,4]);case 3:r.sent(),r.label=4;case 4:return[2]}})})},H=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return 1>e||e>v?[3,2]:(l(e),s?[4,s(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})};if(u||!f)return null;if(o)return e.jsx(e.Fragment,{children:o({currentPage:t,totalPages:v,rowsPerPage:d,totalRows:h,startRow:R,endRow:S,onPageChange:H,onNextPage:k,onPrevPage:M,hasNextPage:!A,hasPrevPage:!N,nextIcon:w,prevIcon:m})});var T=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,r=[];t>8?v-7>t?(e=t-7,n=t+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14);for(var o=e;n>=o;o++)r.push(o);return v-1>n&&(r.push(-1),r.push(v)),r}();return e.jsxs("div",exports.__assign({className:"st-footer"},{children:[e.jsx("div",exports.__assign({className:"st-footer-info"},{children:e.jsxs("span",exports.__assign({className:"st-footer-results-text"},{children:["Showing ",R," to ",S," of ",h.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[T.map(function(n,r){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),r):e.jsx("button",exports.__assign({onClick:function(){return H(n)},className:"st-page-btn ".concat(t===n?"active":"")},{children:n}),r)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(N?"disabled":""),onClick:M,disabled:N},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(A?"disabled":""),onClick:k,disabled:A},{children:w}))]}))]}))},T=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},F=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},D=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},O=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:n.className,style:exports.__assign({height:"10px"},n.style)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},P=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},L=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:n.className,style:exports.__assign({height:"1em"},n.style)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},B=function(){return e.jsx("svg",exports.__assign({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},W=function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[r,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current;if(e&&(null==r?void 0:r.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[r,t]),{isMainSectionScrollable:a}},q=function(e){var n=e.contentHeight,r=e.scrollTop,t=e.tableRows,o=e.scrollDirection,i=e.rowHeight+1,a=e.bufferRowCount*i,u=a,l=a;"down"===o?(u=Math.max(i,.1*a),l=.9*a):"up"===o&&(u=.9*a,l=Math.max(i,.1*a));var c=r+n+l;return t.slice(Math.max(0,Math.floor(Math.max(0,r-u)/i)),Math.min(t.length,Math.ceil(c/i)))},z=function(e){return e.position*(e.rowHeight+1)-1},j=function(e){return e.position*(e.rowHeight+1)},U=function(r){var t=r.children,o=r.onClose,i=r.open,a=r.overflow,u=void 0===a?"auto":a,l=r.setOpen,c=r.width,s=r.containerRef,d=r.positioning,f=void 0===d?"fixed":d,v=E().mainBodyRef,h=n.useRef(null),p=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],I=x[1],C=n.useState(!1),y=C[0],R=C[1];return n.useEffect(function(){i&&h.current?(R(!1),!p.current&&h.current.parentElement&&(p.current=h.current.parentElement),requestAnimationFrame(function(){if(h.current&&p.current){var e,n=h.current,r=p.current.getBoundingClientRect(),t=n.offsetHeight,o=c||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-r.bottom,a=r.top-e.top,u="bottom",l={};(t>i&&a>=t||t>i&&a>i)&&(u="top");var d="left";o>e.right-r.right+r.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=r.bottom+4:l.bottom=window.innerHeight-r.top+4,"left"===d?l.left=r.left:l.right=window.innerWidth-r.right):("bottom"===u?l.top=r.height+4:l.bottom=r.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),I(l),R(!0)}})):i||R(!1)},[i,c,s,v,f]),n.useEffect(function(){var e=function(e){i&&h.current&&h.current&&!h.current.contains(e.target)&&(l(!1),null==o||o())};return i&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[i,o,l]),n.useEffect(function(){var e=function(e){if(h.current&&!h.current.contains(e.target)){var n=h.current.parentElement;n&&!n.contains(e.target)&&(l(!1),null==o||o())}};return i&&document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}},[o,i,l]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&i&&(l(!1),null==o||o())};return i&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[o,i,l]),i?e.jsx("div",exports.__assign({ref:h,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:c?"".concat(c,"px"):"auto",visibility:y?"visible":"hidden"},b),{overflow:u})},{children:t})):null},_=function(n){var r=n.children,t=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,c=void 0===l?"":l;return e.jsx("div",exports.__assign({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}))},G=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=n.useState(r.value),l=u[0],c=u[1],s=function(e){c(e),o(e),a(!1),t()};return e.jsxs(U,exports.__assign({open:i,onClose:function(){t()},setOpen:a,width:120},{children:[e.jsx(_,exports.__assign({isSelected:!0===l,onClick:function(){return s(!0)}},{children:"True"})),e.jsx(_,exports.__assign({isSelected:!1===l,onClick:function(){return s(!1)}},{children:"False"}))]}))},K=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},J=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+t,onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},V=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-3e4c050e.js")})}),X=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-ffaf94ca.js")})}),Y=n.lazy(function(){return Promise.resolve().then(function(){return Sn})}),$=n.lazy(function(){return Promise.resolve().then(function(){return An})}),Z=function(r){var t=o(r,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},t))},{children:e.jsx(V,exports.__assign({},r))}))},Q=function(r){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(X,exports.__assign({},r))}))},ee=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(Y,exports.__assign({},r))}))},ne=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx($,exports.__assign({},r))}))},re=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number);return new Date(n[0],n[1]-1,n[2],12,0,0)}var r=new Date(e);return isNaN(r.getTime())?new Date:new Date(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0)},te=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},oe=function(e){if(!e)return new Date;if("string"==typeof e)return re(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:te(n)}return e instanceof Date?te(e):new Date},ie=function(e){return e?re(""+e):new Date},ae=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=r.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e.jsx(U,exports.__assign({open:i,onClose:l,setOpen:a,width:280},{children:e.jsx(Q,{value:ie(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),t()},onClose:l})}))},ue=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.options,u=r.setOpen,l=n.useState(r.value||""),c=l[0],s=l[1];return e.jsx(U,exports.__assign({open:i,onClose:function(){t()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(_,exports.__assign({isSelected:c===n.value,onClick:function(){return s(e=n.value),o(e),u(!1),void t();var e}},{children:n.label}),n.value)})}))}))},le=function(n){var r=n.enumOptions,t=void 0===r?[]:r,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,c=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(G,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(ae,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(ue,{onBlur:c,onChange:o,open:!0,options:t,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(J,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(K,{defaultValue:null==l?"":l+"",onBlur:c,onChange:o})},ce=0,se=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();0!==ce&&t>o-ce||(ce=o,n(r))}},de=function(e){var r=n.useRef(e);return n.useEffect(function(){JSON.stringify(r.current)!==JSON.stringify(e)&&(r.current=e)},[e]),r.current},fe=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(fe);var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=fe(e[r]));return n},ve=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},he=Date.now(),pe={screenX:0,screenY:0},we=function(e,n,r){void 0===r&&(r=[]);for(var t=0;e.length>t;t++){var o=e[t];if(o.accessor===n)return u(u([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=we(o.children,n,u(u([],r,!0),[t],!1));if(i)return i}}return null},me=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};var ge=function(e){var n=e.draggedHeaderRef,r=e.headers,t=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=E().setHeaders,l=de(r);return{handleDragStart:function(e){n.current=e,he=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),r&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,s=o.screenY,d=Math.sqrt(Math.pow(c-pe.screenX,2)+Math.pow(s-pe.screenY,2));t.current=a;var f,v=n.current,h=!1;if(me(v)!==me(a))f=(C=function(e,n,r){var t,o,i=fe(e),a=!1;try{var u=me(r),l=i.findIndex(function(e){return e.accessor===n.accessor}),c=i.findIndex(function(e){return e.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=exports.__assign({},s),"left"===t?o.pinned="left":"right"===t?o.pinned="right":delete o.pinned,o);i.splice(c,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}(r,v,a)).newHeaders,h=C.emergencyBreak;else{var p=r,w=we(p,v.accessor),m=we(p,a.accessor);if(!w||!m)return;var g=w.length,x=m.length,b=m;if(g!==x){var I=x-g;I>0&&(b=m.slice(0,-I))}var C=function(e,n,r){var t=fe(e),o=!1;function i(e,n){for(var r=e,t=0;n.length-1>t;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;n.length-1>i;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var u=i(t,n);return a(t,n,i(t,r)),a(t,r,u),{newHeaders:t,emergencyBreak:o}}(p,w,b);f=C.newHeaders,h=C.emergencyBreak}if(!(u||a.accessor===v.accessor||10>d||JSON.stringify(f)===JSON.stringify(r)||h)){var y=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>y-he||40>d)||(he=y,pe={screenX:c,screenY:s},i(f))}}},handleDragEnd:function(){n.current=null,t.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(r)},10)}}},xe=function(n){var r=n.checked,t=void 0!==r&&r,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:t,className:"st-checkbox-input",onChange:function(){i&&i(!t)},type:"checkbox"}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(t?"st-checked":"")},{children:t&&e.jsx(O,{className:"st-checkbox-checkmark"})})),o]}))},be=function(n){var r,t=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:t}):"lineAreaChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ee,exports.__assign({data:r},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ne,exports.__assign({data:r},o.chartOptions)):null:"boolean"==typeof t?t?"True":"False":Array.isArray(t)?0===t.length?"[]":t.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==t&&("string"==typeof t||"number"==typeof t||"object"==typeof t&&t instanceof Date)?oe(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):t},Ie=function(r){var t=r.borderClass,o=r.colIndex,i=r.displayRowNumber,a=r.header,u=r.isHighlighted,l=r.isInitialFocused,c=r.nestedIndex,s=r.parentHeader,d=r.rowIndex,f=r.tableRow,v=E(),p=v.cellRegistry,m=v.cellUpdateFlash,g=v.columnBorders,x=v.draggedHeaderRef,b=v.enableRowSelection,S=v.expandIcon,N=v.handleMouseDown,A=v.handleMouseOver,M=v.handleRowSelect,k=v.headers,H=v.hoveredHeaderRef,T=v.isCopyFlashing,F=v.isLoading,D=v.isRowSelected,O=v.isWarningFlashing,P=v.onCellEdit,L=v.onCellClick,B=v.onTableHeaderDragEnd,W=v.rowButtons,q=v.rowGrouping,z=v.rowIdAccessor,j=v.rowsWithSelectedCells,U=v.selectedColumns,_=v.setUnexpandedRows,G=v.tableBodyContainerRef,K=v.theme,J=v.unexpandedRows,V=v.useOddColumnBackground,X=f.depth,Y=f.row,$=n.useState(I(Y,a.accessor)),Q=$[0],ee=$[1],ne=n.useState(!1),re=ne[0],te=ne[1],oe=n.useState(!1),ie=oe[0],ae=oe[1],ue=n.useState(!1),ce=ue[0],de=ue[1],fe=n.useRef(null),ve=R({row:Y,rowIdAccessor:z}),he=q&&q[X],pe=!!he&&function(e,n){return!!n&&y(e[n])}(Y,he),we=!J.has(ve+""),me=T({rowIndex:d,colIndex:o,rowId:ve}),Ie=O({rowIndex:d,colIndex:o,rowId:ve}),Ce=n.useMemo(function(){var e,n,r;if(!g)return!1;var t=k.filter(function(e){return"left"===e.pinned}),o=k.filter(function(e){return!e.pinned}),i=k.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===a.accessor},[g,k,a.accessor,a.pinned]),ye=ge({draggedHeaderRef:x,headers:k,hoveredHeaderRef:H,onTableHeaderDragEnd:B}).handleDragOver,Re=se(),Se=h({accessor:a.accessor,rowId:ve}),Ne=w({rowId:ve,accessor:a.accessor}),Ae=a.isSelectionColumn&&b;n.useEffect(function(){if(p){var e="".concat(ve,"-").concat(a.accessor);return p.set(e,{updateContent:function(e){Q!==e?(ee(e),m&&(ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){ae(!1)},800))):ee(e)}}),function(){p.delete(e),fe.current&&clearTimeout(fe.current)}}},[p,m,ve,a.accessor,Q]),n.useEffect(function(){if(ie){var e=setTimeout(function(){ae(!1)},850);return function(){return clearTimeout(e)}}},[ie]),n.useEffect(function(){ee(I(Y,a.accessor))},[Y,a.accessor]);var Me="boolean"===a.type||"date"===a.type||"enum"===a.type,ke=!!(null==a?void 0:a.isEditable),Ee=U.has(o),He=u&&!Ee,Te=n.useMemo(function(){return!!Ae&&j.has(ve+"")},[Ae,j,ve]),Fe=null==s?void 0:s.singleRowChildren,De="st-cell ".concat(X>0&&a.expandable?"st-cell-depth-".concat(X):""," ").concat(He?l?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").concat(Ee?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(ke?"clickable":""," ").concat(ie?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Ie?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(V?c%2==0?"even-column":"odd-column":""," ").concat(Ae?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(Ce?"st-last-column":""," ").concat(Fe?"st-sub-cell":""),Oe=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),ee(e),C(Y,a.accessor,e),null==P||P({accessor:a.accessor,newValue:e,row:Y,rowIndex:d})},[a.accessor,a.type,P,Y,d]),Pe=n.useCallback(function(){_(function(e){var n=new Set(e),r=ve+"";return n.has(r)?n.delete(r):n.add(r),n})},[ve,_]);return F?e.jsx("div",exports.__assign({className:De},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!re||Me||Ae?e.jsxs(Z,exports.__assign({className:De,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ve,"data-row-index":d,id:Se,onClick:function(){L&&!Ae&&L({accessor:a.accessor,colIndex:o,row:Y,rowId:ve,rowIndex:d,value:Q})},onDoubleClick:function(){return a.isEditable&&!Ae&&te(!0)},onDragOver:function(e){Ae||Re({callback:ye,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){re||Ae||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||re||(e.preventDefault(),te(!0))},onMouseDown:function(){re||Ae||N({rowIndex:d,colIndex:o,rowId:ve})},onMouseEnter:function(){de(!0)},onMouseLeave:function(){de(!1)},onMouseOver:function(){re||Ae||A({rowIndex:d,colIndex:o,rowId:ve})},parentRef:G,tableRow:f},{children:[a.expandable&&pe?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:Pe},{children:S})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:F?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx("span",{children:Ae?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ce||D&&D(ve+"")?e.jsx(xe,{checked:!!D&&D(ve+""),onChange:function(e){M&&M(ve+"",e)}}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!W||!Ae||0===W.length)return null;if(!(ce||D&&D(ve+"")))return null;var n={row:Y};return e.jsx("div",exports.__assign({className:"st-row-buttons"},{children:W.map(function(r,t){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:r(n)}),t)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:o,row:Y,theme:K}):be({content:Q,header:a,colIndex:o,row:Y,rowIndex:d})})})),!F&&re&&Me&&!Ae&&e.jsx(le,{enumOptions:a.enumOptions,onChange:Oe,setIsEditing:te,type:a.type,value:Q})]}),Ne):e.jsx("div",exports.__assign({className:"st-cell-editing",id:h({accessor:a.accessor,rowId:ve}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(le,{enumOptions:a.enumOptions,onChange:Oe,setIsEditing:te,type:a.type,value:Q})}))},Ce=function(n){var r=n.columnIndexStart,t=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,c=n.tableRow,s=E(),d=s.rowIdAccessor,f=s.collapsedHeaders,v=o.filter(function(e){return p({header:e,pinned:i,headers:o,collapsedHeaders:f})});return e.jsx(e.Fragment,{children:v.map(function(n,s){var f=R({row:c.row,rowIdAccessor:d}),v=h({accessor:n.accessor,rowId:f});return e.jsx(ye,{columnIndices:t,displayRowNumber:u,header:n,headers:o,nestedIndex:s+(null!=r?r:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:c},v)})})},ye=function(r){var t=r.columnIndices,o=r.displayRowNumber,i=r.header,a=r.headers,u=r.nestedIndex,l=r.parentHeader,c=r.pinned,s=r.rowIndex,d=r.rowIndices,f=r.tableRow,v=t[i.accessor],w=E(),m=w.getBorderClass,g=w.isSelected,x=w.isInitialFocusedCell,b=w.collapsedHeaders,I=R({row:f.row,rowIdAccessor:w.rowIdAccessor});if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return p({header:e,pinned:c,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var y={rowIndex:s,colIndex:v,rowId:I},S=m(y),N=g(y),A=x(y),M=h({accessor:i.accessor,rowId:I});return e.jsxs(n.Fragment,{children:[e.jsx(Ie,{borderClass:S,colIndex:v,displayRowNumber:o,header:i,isHighlighted:N,isInitialFocused:A,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},M),C.map(function(n){var r=h({accessor:n.accessor,rowId:I});return e.jsx(ye,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},r)})]})}return e.jsx(n.Fragment,{children:C.map(function(n){var r=h({accessor:n.accessor,rowId:I});return e.jsx(ye,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},r)})})}var k={rowIndex:s,colIndex:v,rowId:I},H=m(k),T=g(k),F=x(k),D=h({accessor:i.accessor,rowId:I});return e.jsx(Ie,{borderClass:H,colIndex:v,displayRowNumber:o,header:i,isHighlighted:T,isInitialFocused:F,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},D)},Re=function(n){var r=n.columnIndices,t=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,c=n.rowIndices,s=n.setHoveredIndex,d=n.tableRow,f=E(),v=f.useHoverRowBackground,h=f.isAnimating,p=f.isRowSelected,w=f.useOddEvenRowBackground,m=d.position,g=d.displayPosition,x=m%2==0,b=R({row:d.row,rowIdAccessor:f.rowIdAccessor}),I=!!p&&p(b+"");return e.jsx("div",exports.__assign({className:"st-row ".concat(w?x?"even":"odd":""," ").concat(I?"selected":""),"data-index":a,onMouseEnter:function(){!h&&v&&s(a)},style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(j({position:m,rowHeight:l}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Ce,{columnIndexStart:t,columnIndices:r,displayRowNumber:g,headers:i,pinned:u,rowIndex:m,rowIndices:c,tableRow:d},b)}))},Se=function(r){var t=r.displayStrongBorder,o=r.position,i=r.rowHeight,a=r.templateColumns,u=n.useRef(null);return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,r=n.style.pointerEvents;n.style.pointerEvents="none";var t=document.elementFromPoint(e.clientX,e.clientY);if(n.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:e.clientX,clientY:i.top+i.height/2});o.dispatchEvent(a)}}},onMouseUp:function(e){if(u.current){var n=u.current.getBoundingClientRect(),r=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});u.current.dispatchEvent(r),u.current=null}},style:{gridTemplateColumns:a,transform:"translate3d(0, ".concat(z({position:o,rowHeight:i}),"px, 0)")}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},Ne=n.createContext(void 0),Ae=function(e){var r=e.childRef,t=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(Ne);if(!e)throw Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),u=a.registerPane,l=a.unregisterPane;return n.useEffect(function(){var e=[i];return r.current&&u(r.current,e),function(){r.current&&l(r.current,e)}},[r,u,l,i]),n.cloneElement(t,{ref:function(e){r.current=e}})},Me=n.forwardRef(function(r,t){var o=r.columnIndexStart,i=r.columnIndices,a=r.headers,u=r.pinned,l=r.rowHeight,c=r.rowIndices,s=r.setHoveredIndex,d=r.templateColumns,f=r.totalHeight,v=r.rowsToRender,h=r.width,p=u?"st-body-pinned-".concat(u):"st-body-main",w=E().rowIdAccessor,m=n.useRef(null);return n.useImperativeHandle(t,function(){return m.current},[]),n.useMemo(function(){return ve(a,u)},[a,u])?e.jsx(Ae,exports.__assign({childRef:m,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:p,ref:m,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:h},!u&&{flexGrow:1})},{children:v.map(function(r,t){var f=R({row:r.row,rowIdAccessor:w});return e.jsxs(n.Fragment,{children:[0!==t&&e.jsx(Se,{displayStrongBorder:r.isLastGroupRow,position:r.position,rowHeight:l,templateColumns:d,rowIndex:t-1}),e.jsx(Re,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:t,pinned:u,rowHeight:l,rowIndices:c,setHoveredIndex:s,tableRow:r},f)]},f)})}))})):null});function ke(e){var n=e.headers,r=e.pinnedLeftColumns,t=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],r,!0),n,!0),t,!0),c=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return p({header:e,headers:l,collapsedHeaders:o})}).forEach(function(n,r){c(n,!e.singleRowChildren&&0===r)})};return r.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&p({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n&&0===r.length)}),t.forEach(function(e){c(e,!1)}),i}Me.displayName="TableSection";var Ee=function(r){var t=r.mainTemplateColumns,o=r.pinnedLeftColumns,i=r.pinnedLeftTemplateColumns,a=r.pinnedLeftWidth,u=r.pinnedRightColumns,l=r.pinnedRightTemplateColumns,c=r.pinnedRightWidth,s=r.rowsToRender,d=r.setScrollTop,f=r.setScrollDirection,v=r.tableRows,h=E(),p=h.collapsedHeaders,w=h.headerContainerRef,m=h.headers,g=h.isAnimating,x=h.mainBodyRef,b=h.onLoadMore,I=h.rowHeight,C=h.rowIdAccessor,y=h.scrollbarWidth,S=h.setIsScrolling,N=h.shouldPaginate,A=h.tableBodyContainerRef,M=n.useState(!1),k=M[0],H=M[1],T=n.useRef(new Set),F=n.useCallback(function(e){T.current.forEach(function(e){return e.classList.remove("hovered")}),T.current.clear(),null!==e&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),T.current.add(e)})},[]);n.useEffect(function(){g&&F(null)},[g,F]),W({headerContainerRef:w,mainSectionRef:A,scrollbarWidth:y}),n.useEffect(function(){return function(){O.current&&clearTimeout(O.current)}},[]);var D=n.useRef(null),O=n.useRef(null),P=n.useRef(0),L=function(e){return e.length}(v),B=L*(I+1)-1,q=n.useMemo(function(){return ke({headers:m,pinnedLeftColumns:o,pinnedRightColumns:u,collapsedHeaders:p})},[m,o,u,p]),z=n.useMemo(function(){var e={};return s.forEach(function(n,r){var t=R({row:n.row,rowIdAccessor:C})+"";e[t]=r}),e},[s,C]),j=n.useCallback(function(e,n){!b||N||k||200>=e.scrollHeight-(n+e.clientHeight)&&n>P.current&&(H(!0),b(),setTimeout(function(){H(!1)},1e3))},[b,N,k]),U={columnIndices:q,headerContainerRef:w,headers:m,rowHeight:I,rowIndices:z,rowsToRender:s,setHoveredIndex:F};return e.jsxs("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,r=n.scrollTop;S(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(function(){S(!1)},150),D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){var e=P.current,t=r>e?"down":e>r?"up":"none";d(r),f(t),j(n,r),P.current=r})},ref:A},{children:[e.jsx(Me,exports.__assign({},U,{pinned:"left",templateColumns:i,totalHeight:B,width:a})),e.jsx(Me,exports.__assign({},U,{columnIndexStart:o.length,ref:x,templateColumns:t,totalHeight:B})),e.jsx(Me,exports.__assign({},U,{columnIndexStart:o.length+t.length,pinned:"right",templateColumns:l,totalHeight:B,width:c}))]}))},He=function(e){var n=e.event,r=e.header,t=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var s="clientX"in n?n.clientX:n.touches[0].clientX,d="touches"in n;if(r&&!r.hide){i(!0);var f,v=b(r);if(r.children&&r.children.length>0){var h=m(r,l);f=h.length>0?h:[r]}else f=[r];var p=function(e){var n="right"===r.pinned?s-e:e-s,i=function(e){var n=e.header,r=e.headers,t=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=i*c(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var u=a-r.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+m(n,t).reduce(function(e,n){return e+g(n)},0)},0),l=b(n);return l>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):u}({header:r,headers:t,collapsedHeaders:l});f.length>1?Te({delta:n,leafHeaders:f,minWidth:v,startWidth:a,maxWidth:i}):f[0].width=Math.max(Math.min(a+n,i),v),t.forEach(function(e){x(e)});var d=u([],t,!0);o(d)};if(d){var w=function(e){p(e.touches[0].clientX)},I=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",I),i(!1)};document.addEventListener("touchmove",w),document.addEventListener("touchend",I)}else{var C=function(e){p(e.clientX)},y=function(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",y),i(!1)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",y)}}},Te=function(e){var n=e.delta,r=e.leafHeaders,t=e.minWidth,o=e.startWidth,i=e.maxWidth,a=r.reduce(function(e,n){return Math.min(e,b(n))},40),u=r.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;r.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),t)})},Fe={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"},De=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Oe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Pe=function(e){return["between","notBetween","in","notIn"].includes(e)},Le=function(e){return["isEmpty","isNotEmpty"].includes(e)},Be=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},We=function(r){var t=r.value,o=r.onChange,i=r.options,a=r.placeholder,u=void 0===a?"Select...":a,l=r.className,c=void 0===l?"":l,s=r.disabled,d=void 0!==s&&s,f=n.useState(!1),v=f[0],h=f[1],p=n.useState(-1),w=p[0],m=p[1],g=n.useRef(null),x=i.find(function(e){return e.value===t});return n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),m(function(e){return i.length-1>e?e+1:0});break;case"ArrowUp":e.preventDefault(),m(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),0>w||(o(i[w].value),h(!1),m(-1));break;case"Escape":e.preventDefault(),h(!1),m(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,w,i,o]),e.jsxs("div",exports.__assign({ref:g,className:"st-custom-select ".concat(c," ").concat(d?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",exports.__assign({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!d)if(h(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===t});m(0>e?0:e)}},disabled:d,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",exports.__assign({className:"st-custom-select-value"},{children:x?x.label:u})),e.jsx(B,{})]})),e.jsx(U,exports.__assign({open:v,setOpen:h,onClose:function(){h(!1),m(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",exports.__assign({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,r){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===t?"st-custom-select-option-selected":""," ").concat(r===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===t,onClick:function(){return o(n.value),h(!1),void m(-1)}},{children:n.label}),r)})}))}))]}))},qe=function(n){var r=n.value,t=n.onChange,o=n.operators.map(function(e){return{value:e,label:Fe[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(We,{value:r,onChange:function(e){t(e)},options:o})}))},ze=function(n){var r=n.type,t=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===r?"text":r,value:n.value,onChange:function(e){return t(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&a&&a()},placeholder:n.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},je=function(n){var r=n.children,t=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===t?"":t).trim()},{children:r}))},Ue=function(n){var r=n.onClear,t=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!t,className:"st-filter-button st-filter-button-apply ".concat(t?"":"st-filter-button-disabled")},{children:"Apply"})),o&&r&&e.jsx("button",exports.__assign({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},_e=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],c=u[1],s=n.useState(((null==o?void 0:o.value)||"")+""),d=s[0],f=s[1],v=De("string");n.useEffect(function(){o?(c(o.operator),f((o.value||"")+"")):(c("contains"),f(""))},[o]);var h=function(){var e=exports.__assign({accessor:t.accessor,operator:l},Oe(l)&&{value:d});i(e)},p=Le(l)||d.trim();return e.jsxs(Be,{children:[e.jsx(qe,{value:l,onChange:c,operators:v}),Oe(l)&&e.jsx(je,{children:e.jsx(ze,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:h})}),e.jsx(Ue,{onApply:h,onClear:a,canApply:!!p,showClear:!!o})]})},Ge=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),s=c[0],d=c[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],h=f[1],p=n.useState(((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])||"")+""),w=p[0],m=p[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],I=De("number");n.useEffect(function(){var e,n;a?(d(a.operator),h((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),h(""),m(""),b(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:s};Oe(s)?e.value=parseFloat(v):Pe(s)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(Be,{children:[e.jsx(qe,{value:s,onChange:d,operators:I}),Oe(s)&&e.jsx(je,{children:e.jsx(ze,{type:"number",value:v,onChange:h,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Pe(s)&&e.jsxs(je,{children:[e.jsx(ze,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(ze,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(Ue,{onApply:C,onClear:l,canApply:!!Le(s)||(Oe(s)?""!==v.trim():!!Pe(s)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},Ke=function(n){var r=n.className;return e.jsx(We,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===r?"":r,placeholder:n.placeholder})},Je=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],c=u[1],s=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=s[0],f=s[1],v=De("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?o.value+"":"true")):(c("equals"),f("true"))},[o]);var h=Le(l)||""!==d;return e.jsxs(Be,{children:[e.jsx(qe,{value:l,onChange:c,operators:v}),Oe(l)&&e.jsx(je,{children:e.jsx(Ke,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Ue,{onApply:function(){var e={accessor:t.accessor,operator:l};Oe(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:h,showClear:!!o})]})},Ve=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),s=c[0],d=c[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],h=f[1],p=n.useState((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])?a.values[0]+"":""),w=p[0],m=p[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],I=De("date");n.useEffect(function(){var e,n;a?(d(a.operator),h((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),h(""),m(""),b(""))},[a]);var C=function(r){var t=r.value,o=r.onChange,i=r.placeholder,a=r.autoFocus,u=r.className,l=n.useState(!1),c=l[0],s=l[1],d=n.useState(""),f=d[0],v=d[1],h=n.useRef(null);n.useEffect(function(){if(t){var e=oe(t);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[t]),n.useEffect(function(){a&&h.current&&h.current.focus()},[a]);var p=t?oe(t):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:h,type:"text",value:f,placeholder:i,onClick:function(){s(!c)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),s(!c)):"Escape"===e.key&&s(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(U,exports.__assign({open:c,setOpen:s,onClose:function(){s(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(Q,{value:p,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),s(!1)},onClose:function(){return s(!1)}})}))]}))};return e.jsxs(Be,{children:[e.jsx(qe,{value:s,onChange:d,operators:I}),Oe(s)&&e.jsx(je,{children:e.jsx(C,{value:v,onChange:h,placeholder:"Select date...",autoFocus:!0})}),Pe(s)&&e.jsxs(je,{children:[e.jsx(C,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(C,{value:x,onChange:b,placeholder:"To date..."})]}),e.jsx(Ue,{onApply:function(){var e={accessor:i.accessor,operator:s};Oe(s)?e.value=v:Pe(s)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!Le(s)||(Oe(s)?""!==v.trim():!!Pe(s)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},Xe=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,l=n.useMemo(function(){return t.enumOptions||[]},[t.enumOptions]),c=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),s=n.useState((null==o?void 0:o.values)?o.values.map(String):c),d=s[0],f=s[1],v=n.useState(""),h=v[0],p=v[1],w=n.useMemo(function(){if(!h)return l;var e=h.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,h]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:c)},[o,c]);var m=l.length>10;return e.jsxs(Be,{children:[e.jsx(je,{children:e.jsxs("div",exports.__assign({className:"st-enum-filter-options"},{children:[e.jsx("div",exports.__assign({className:"st-enum-select-all"},{children:e.jsx(xe,exports.__assign({checked:d.length===c.length,onChange:function(e){f(e?c:[])}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),m&&e.jsx("div",exports.__assign({className:"st-enum-search"},{children:e.jsx(ze,{type:"text",value:h,onChange:p,placeholder:"Search..."})})),w.map(function(n,r){return e.jsx(xe,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),r)}),h&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(Ue,{onApply:function(){d.length!==c.length?i({accessor:t.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==c.length,showClear:!!o})]})},Ye=function(n){var r=n.header,t=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(r.type){case"number":return e.jsx(Ge,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Je,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Ve,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(Xe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});default:return e.jsx(_e,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i})}}()})},$e=function(r){var t=r.content,o=r.children,i=r.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],c=u[1],s=n.useState({top:0,left:0}),d=s[0],f=s[1],v=n.useRef(null),h=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!t||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var p=n.cloneElement(o,{ref:h,onMouseEnter:function(){v.current=setTimeout(function(){if(h.current&&t.trim()){var e=h.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,r=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),r+40>window.innerHeight-8&&(r=e.top-40-8),f({top:r,left:n}),c(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),c(!1)}});return e.jsxs(e.Fragment,{children:[p,l&&e.jsx("div",exports.__assign({className:"st-tooltip",style:{position:"fixed",top:"".concat(d.top,"px"),left:"".concat(d.left,"px"),zIndex:1e4}},{children:t}))]})},Ze=function(r){var t,o,i=r.colIndex,a=r.gridColumnEnd,l=r.gridColumnStart,c=r.gridRowEnd,f=r.gridRowStart,v=r.header,p=r.parentHeader,w=r.reverse,m=r.sort,g=n.useState(!1),x=g[0],b=g[1],I=n.useState(!1),C=I[0],y=I[1],R=n.useState(v.label||""),S=R[0],N=R[1],A=E(),M=A.activeHeaderDropdown,k=A.areAllRowsSelected,H=A.collapsedHeaders,T=A.columnBorders,F=A.columnReordering,D=A.columnResizing,O=A.columnsWithSelectedCells,P=A.draggedHeaderRef,L=A.enableHeaderEditing,B=A.filterIcon,W=A.handleApplyFilter,q=A.handleClearFilter,z=A.handleSelectAll,j=A.headerCollapseIcon,_=A.headerDropdown,G=A.headerExpandIcon,J=A.headerRegistry,V=A.headers,X=A.hoveredHeaderRef,Y=A.onColumnOrderChange,$=A.onColumnSelect,Q=A.onHeaderEdit,ee=A.onSort,ne=A.onTableHeaderDragEnd,re=A.headerHeight,te=A.selectColumns,oe=A.selectableColumns,ie=A.selectedColumns,ae=A.setActiveHeaderDropdown,ue=A.setCollapsedHeaders,le=A.setHeaders,ce=A.setInitialFocusedCell,de=A.setIsResizing,fe=A.setSelectedCells,ve=A.setSelectedColumns,he=A.sortDownIcon,pe=A.sortUpIcon,we=!!(null==v?void 0:v.isSortable),me=!!(null==v?void 0:v.filterable),be=A.filters[v.accessor],Ie=(null==M?void 0:M.accessor)===v.accessor,Ce=v.isSelectionColumn&&A.enableRowSelection,ye=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(v),Re=H.has(v.accessor),Se=function(e){var r=e.isOpen,t=e.estimatedHeight,o=void 0===t?200:t,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,c=n.useRef(null),s=n.useState({}),d=s[0],f=s[1];return n.useEffect(function(){if(r&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,r=window.innerWidth-e.right,t="bottom",i={};o>n&&e.top>=o&&(t="top");var u="left";a>r+e.width&&(u="right"),"bottom"===t?i.top=e.bottom+l:i.bottom=window.innerHeight-e.top+l,"left"===u?i.left=e.left:i.right=window.innerWidth-e.right,f(i)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},t=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",t,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",t,!0)}}f({})},[r,o,a,l]),{triggerRef:c,position:d}}({isOpen:Ie,estimatedHeight:200,estimatedWidth:250,margin:4}),Ne=Se.triggerRef,Ae=Se.position,Me=n.useMemo(function(){var e,n,r;if(!T)return!1;var t=V.filter(function(e){return"left"===e.pinned}),o=V.filter(function(e){return!e.pinned}),i=V.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===v.accessor},[T,V,v.accessor,v.pinned]),ke=n.useMemo(function(){return!(!oe||Ce)&&d(v,i).some(function(e){return ie.has(e)})},[oe,Ce,v,i,ie]),Ee=n.useMemo(function(){return!Ce&&d(v,i).some(function(e){return O.has(e)})},[Ce,v,i,O]),Te=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!Re||v.children.some(function(e){var n=e.showWhen||s;return"parentCollapsed"===n||"always"===n}))},[v.children,Re]),Fe=null==p?void 0:p.singleRowChildren,De=Te&&!v.singleRowChildren,Oe="st-header-cell ".concat(v.accessor===(null===(t=X.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(o=P.current)||void 0===o?void 0:o.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(F&&!we?"columnReordering":""," ").concat(De?"parent":""," ").concat(Fe?"st-sub-header":""," ").concat(Me?"st-last-column":""," ").concat(L&&!Ce?"st-header-editable":""," ").concat(ke?"st-header-selected":""," ").concat(Ee&&!ke?"st-header-has-highlighted-cell":""),Pe=ge({draggedHeaderRef:P,headers:V,hoveredHeaderRef:X,onColumnOrderChange:Y,onTableHeaderDragEnd:ne}),Le=Pe.handleDragStart,Be=Pe.handleDragEnd,We=Pe.handleDragOver,qe=se();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=v.accessor+"";return J.set(e,{setEditing:function(e){y(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){N(v.label||"")},[v.label]);var ze=n.useCallback(function(e){N(e);var n=V.map(function(n){return n.accessor===v.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});le(n),Q&&Q(v,e)},[V,le,Q,v]),je=n.useCallback(function(){ae&&ae(null)},[ae]),Ue=n.useCallback(function(e){e.stopPropagation(),ue(function(e){var n=new Set(e);return Re?n.delete(v.accessor):n.add(v.accessor),n})},[ue,Re,v.accessor]),_e=function(e){var n=e.event,r=e.header;if(!r.isSelectionColumn){if(oe){var t=d(r,i),o=t.some(function(e){return ie.has(e)});if(L&&o&&!n.shiftKey)return _&&Ie&&je(),void y(!0);n.shiftKey&&te?ve(function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort(function(e,n){return e-n}),o=r[0],i=Math.abs(n-o);r.forEach(function(e){var r=Math.abs(n-e);i>r&&(i=r,o=e)});var a,l,c,s=u(u([],(c=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-c+1},function(e,n){return c+n})),!0),t,!0);return new Set(u(u([],Array.from(e),!0),s,!0))}):te&&te(t),fe(new Set),ce(null)}$&&$(r),!oe&&r.isSortable&&ee(r.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!v)return null;var Ge=D&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,r=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;qe({callback:He,callbackProps:{event:e.nativeEvent,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:le,setIsResizing:de,startWidth:r,collapsedHeaders:H},limit:10})},onTouchStart:function(e){var n,r=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;qe({callback:He,callbackProps:{event:e,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:le,setIsResizing:de,startWidth:r,collapsedHeaders:H},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ke=m&&m.key.accessor===v.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return _e({event:e,header:v})}},{children:["ascending"===m.direction&&pe&&pe,"descending"===m.direction&&he&&he]})),Je=me&&B&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){e.stopPropagation(),b(!x)}},{children:[n.cloneElement(B,{style:{fill:be?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(U,exports.__assign({open:x,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(Ye,{header:v,currentFilter:be,onApplyFilter:function(e){W(e),b(!1)},onClearFilter:function(){q(v.accessor),b(!1)}})}))]})),Ve=ye&&!Ce&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:Ue},{children:Re?j:G}));return e.jsxs(Z,exports.__assign({className:Oe,id:h({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){Ce||qe({callback:We,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:exports.__assign({gridRowStart:f,gridRowEnd:c,gridColumnStart:l,gridColumnEnd:a},c-f>1?{}:{height:re})},{children:[w&&Ge,"right"===v.align&&Ve,"right"===v.align&&Je,"right"===v.align&&Ke,e.jsx("div",exports.__assign({ref:Ne,className:"st-header-label",draggable:F&&!v.disableReorder&&!Ce,onClick:function(e){Ce||_e({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){var n=e.header;n.isSelectionColumn||oe&&n.isSortable&&ee(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),Be()},onDragStart:Ce?void 0:function(e){F&&v&&function(e){Le(e)}(v)}},{children:e.jsx($e,exports.__assign({content:v.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(xe,{checked:!!k&&k(),onChange:function(e){z&&z(e)}}):C?e.jsx(K,{defaultValue:S,onBlur:function(){return y(!1)},onChange:ze}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:i,header:v}):S||(null==v?void 0:v.label)}))}))})),"right"!==v.align&&Ke,"right"!==v.align&&Je,"right"!==v.align&&Ve,!w&&Ge,_&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:_({accessor:v.accessor,colIndex:i,header:v,isOpen:Ie,onClose:je,position:Ae})}))]}))},Qe=function(r){var t=r.columnIndices,o=r.gridTemplateColumns,i=r.handleScroll,a=r.headers,u=r.maxDepth,l=r.pinned,c=r.sectionRef,s=r.sort,d=r.width,f=E().collapsedHeaders,v=n.useMemo(function(){var e=[],n=1,r=function(o,i,c,s){var d,v;if(void 0===c&&(c=!1),!p({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;c||n++;var h,w,m=null!==(v=null===(d=o.children)||void 0===d?void 0:d.filter(function(e){return p({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==v?v:0,g=n;if(o.singleRowChildren&&m>0?(h=g+1,w=u+1):m>0?(h=g+m,w=i+1):(h=g+1,w=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:h,gridRowStart:i,gridRowEnd:w,colIndex:t[o.accessor],parentHeader:s}),o.children&&o.children.length>0){var x=o.singleRowChildren?i:i+1,b=!o.singleRowChildren;o.children.forEach(function(e){p({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(r(e,x,b,o),b=!1)})}return h-g},o=a.filter(function(e){return p({header:e,pinned:l,headers:a,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){r(e,1,i),i=!1}),e},[a,u,l,t,f]);return e.jsx(Ae,exports.__assign({childRef:c,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:"st-header-".concat(l?"pinned-".concat(l):"main")},i&&{onScroll:i},{ref:c,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(Ze,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:s},n.header.accessor)})})}))}))},en=function(e){var n,r;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(r=e.children)||void 0===r?void 0:r.length)?1+Math.max.apply(Math,e.children.map(en)):1},nn=function(r){var t=r.centerHeaderRef,o=r.headers,i=r.mainTemplateColumns,a=r.pinnedLeftColumns,l=r.pinnedLeftTemplateColumns,c=r.pinnedRightColumns,s=r.pinnedRightTemplateColumns,d=r.sort,f=r.pinnedLeftWidth,v=r.pinnedRightWidth,h=E(),w=h.headerContainerRef,m=h.pinnedLeftRef,g=h.pinnedRightRef,x=h.collapsedHeaders,b=n.useMemo(function(){return ke({headers:o,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:x})},[o,a,c,x]),I=n.useMemo(function(){var e=0,n=u(u(u([],a,!0),o,!0),c,!0);return o.forEach(function(r){if(p({header:r,headers:n,collapsedHeaders:x})){var t=en(r);e=Math.max(e,t)}}),{maxDepth:e}},[o,a,c,x]).maxDepth;return e.jsxs("div",exports.__assign({className:"st-header-container",ref:w},{children:[ve(o,"left")&&e.jsx(Qe,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headers:o,maxDepth:I,pinned:"left",sectionRef:m,sort:d,width:f}),e.jsx(Qe,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:I,sectionRef:t,sort:d}),ve(o,"right")&&e.jsx(Qe,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:I,pinned:"right",sectionRef:g,sort:d,width:v})]}))},rn=function(e){var n=e.collapsedHeaders,r=function(e){var t=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||s;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&t.push(e),o.length>0?r({headers:o,flattenedHeaders:t}):e.singleRowChildren||t.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||s;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&t.push(e),r({headers:i,flattenedHeaders:t})}else t.push(e)}),t},t=r({headers:e.headers,flattenedHeaders:[]});return"".concat(t.map(function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)}).join(" "))},tn=function(r){var t=r.pinnedLeftWidth,o=r.pinnedRightWidth,i=r.setScrollTop,a=r.setScrollDirection,u=r.sort,l=r.tableRows,c=r.rowsToRender,s=E(),d=s.columnResizing,f=s.editColumns,v=s.headers,h=s.collapsedHeaders,p=n.useRef(null),w=v.filter(function(e){return!e.pinned}),m=v.filter(function(e){return"left"===e.pinned}),g=v.filter(function(e){return"right"===e.pinned}),x=n.useMemo(function(){return rn({headers:m,collapsedHeaders:h})},[m,h]),b=n.useMemo(function(){return rn({headers:w,collapsedHeaders:h})},[w,h]),I=n.useMemo(function(){return rn({headers:g,collapsedHeaders:h})},[g,h]),C={centerHeaderRef:p,headers:v,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedRightColumns:g,pinnedRightTemplateColumns:I,sort:u,pinnedLeftWidth:t,pinnedRightWidth:o},y={tableRows:l,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedLeftWidth:t,pinnedRightColumns:g,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:i,setScrollDirection:a,rowsToRender:c};return e.jsxs("div",exports.__assign({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(nn,exports.__assign({},C)),e.jsx(Ee,exports.__assign({},y))]}))},on=function(r){var t=r.mainBodyWidth,o=r.mainBodyRef,i=r.pinnedLeftWidth,a=r.pinnedRightWidth,u=r.pinnedLeftContentWidth,l=r.pinnedRightContentWidth,c=r.tableBodyContainerRef,s=E().editColumns,d=n.useState(!1),f=d[0],v=d[1],h=n.useRef(null),p=n.useRef(null),w=n.useRef(null),m=s?28:0,g=(s?a+1:a)+(c.current&&c.current&&c.current.scrollHeight>c.current.clientHeight?c.current.offsetWidth-c.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){o.current&&v(t>o.current.clientWidth)},1)},[o,t]),f?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(Ae,exports.__assign({childRef:p,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:p,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),t>0&&e.jsx(Ae,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:t}})}))})),a>0&&e.jsx(Ae,exports.__assign({childRef:w,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:w,style:{width:g}},{children:e.jsx("div",{style:{width:l}})}))})),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},an={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return an.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?an.string(e,n,r):"number"==typeof e&&"number"==typeof n?an.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?an.boolean(e,n,r):an.string(e+"",n+"",r)}},un=function(e){return function(e){var n=e.rows,r=e.sortColumn,t=function(e,n){for(var r=0,o=e;o.length>r;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children,n);if(a)return a}}},o=t(e.headers,r.key.accessor),i=(null==o?void 0:o.type)||"string",a=r.direction;return u([],n,!0).sort(function(e,n){var t=r.key.accessor;return function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=e+"";if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return an.number(i,a,t)}return"date"===r?an.date(e+"",n+"",t):"boolean"===r?an.boolean(!!e,!!n,t):"enum"===r?an.enum(e+"",n+"",t):an.string(e+"",n+"",t)}(I(e,t),I(n,t),i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},ln=function(e){var n=e.tableRows,r=e.sortColumn,t=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:r?t&&t.length>0?(0,e.sortNestedRows)({groupingKeys:t,headers:o,rows:n,sortColumn:r}):un({headers:o,rows:n,sortColumn:r}):n},cn=function(e,n,r){void 0===r&&(r=new Set);for(var t=0,o=e;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(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,c=i.children;c.length>l;l++){var s=c[l];if(cn([s],n,r),!1===s.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},sn=function(e){return e.every(function(e){return e.hide})},dn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(dn(e.children),sn(e.children)&&(e.hide=!0))})},fn=function(r){var t=r.allHeaders,o=r.depth,i=void 0===o?0:o,a=r.doesAnyHeaderHaveChildren,l=r.header,c=r.isCheckedOverride,s=n.useState(!0),d=s[0],f=s[1],v=E(),h=v.expandIcon,p=v.headers,w=v.setHeaders,m=a?"".concat(16*i,"px"):"8px",g=l.children&&l.children.length>0,x=null!=c?c:l.hide||g&&l.children&&sn(l.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:m}},{children:[a&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:g?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(d?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!d)}},{children:h})):null})),e.jsx(xe,exports.__assign({checked:x,onChange:function(e){l.hide=e,e?dn(t):(cn(t,l.accessor),g&&l.children&&l.children.length>0&&l.children.every(function(e){return!0===e.hide})&&l.children[0]&&(l.children[0].hide=!1,cn(t,l.children[0].accessor))),w(u([],p,!0))}},{children:l.label}))]})),g&&d&&l.children&&e.jsx("div",exports.__assign({className:"st-nested-headers"},{children:l.children.map(function(n,r){return e.jsx(fn,{allHeaders:t,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!x||void 0},"".concat(n.accessor,"-").concat(r))})}))]})},vn=function(r){var t=r.headers,o=r.open,i="left"===r.position?"left":"",a=n.useMemo(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e.jsx(fn,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},hn=function(r){var t=r.columnEditorText,o=r.editColumns,i=r.headers,a=r.position,u=void 0===a?"right":a,l=n.useState(r.editColumnsInitOpen),c=l[0],s=l[1];return o?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(c?"open":""," ").concat(u),onClick:function(){return function(e){s(e)}(!c)},style:{width:28}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:t})),e.jsx(vn,{headers:i,open:c,position:u})]})):null},pn=function(r){var o=r.children,i=n.useRef({}),a=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),u=n.useCallback(function(e,n){e.scrollWidth-e.clientWidth>0&&(n.scrollLeft=e.scrollLeft)},[]),l=n.useCallback(function(e){e.onscroll=null},[]),c=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var r;null===(r=i.current[n])||void 0===r||r.forEach(function(n){e!==n&&(l(n),u(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});c(n,e)}))})})})}},[l,u]),s=n.useCallback(function(e,n){n.forEach(function(n){i.current[n]||(i.current[n]=[]),a(e,n)||(i.current[n].length>0&&u(i.current[n][0],e),i.current[n].push(e))}),c(e,n)},[a,u,c]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var r=i.current[n].indexOf(e);-1!==r&&i.current[n].splice(r,1)}})},[a,l]);return e.jsx(Ne.Provider,exports.__assign({value:{registerPane:s,unregisterPane:d}},{children:t.default.Children.only(o)}))},wn=function(e){var n=e.tableRows,r=e.filterState;return e.externalFilterHandling?n:r&&0!==Object.keys(r).length?n.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var r=n.operator,t=n.value,o=n.values;if(null==e)return"isEmpty"===r;if("isEmpty"===r)return!e||""===(e+"").trim();if("isNotEmpty"===r)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===r||"notContains"===r||"startsWith"===r||"endsWith"===r){var i=(e+"").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 e||!isNaN(+e)){var u=+e,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(e instanceof Date||!isNaN(Date.parse(e))){var f=oe(e),v=oe((t||"")+""),h=te(f),p=te(v);switch(r){case"equals":return h.getTime()===p.getTime();case"notEquals":return h.getTime()!==p.getTime();case"before":return p>h;case"after":return h>p;case"between":if(o&&2===o.length){var w=o.map(function(e){return te(oe((e||"")+""))}),m=w[1];return h>=w[0]&&m>=h}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(e){return te(oe((e||"")+""))});return m=g[1],g[0]>h||h>m}return!0}}if("boolean"==typeof e&&"equals"===r)return e===!!t;if(Array.isArray(e)){var x=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", ");e=x}if("in"===r||"notIn"===r){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===r?b:!b}return!1}var I=(e+"").toLowerCase(),C=t?(t+"").toLowerCase():"";switch(r){case"equals":return I===C;case"notEquals":return I!==C;default:return!0}}(I(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},mn=function(e,n,r,t){var o=[],i=function(e){e.forEach(function(e){var r=t?e[t]:void 0;if(t&&r&&y(r))i(r);else{var a=I(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===r.type&&r.customFn)return r.customFn(o);var a,u=r.parseValue?o.map(r.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===r.type?o.length:void 0;switch(r.type){case"sum":a=u.reduce(function(e,n){return e+n},0);break;case"average":a=u.reduce(function(e,n){return e+n},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}},gn=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var r=n.replace(/"/g,'""');return'"'.concat(r,'"')}return n},xn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},bn={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}},In=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},Cn=function(e,n,r,t){return void 0===r&&(r={}),new Promise(function(t){e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){In(e),e.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},yn=function(r){var t=r.allowAnimations,o=void 0!==t&&t,s=r.cellUpdateFlash,d=void 0!==s&&s,h=r.className,p=r.columnBorders,x=void 0!==p&&p,b=r.columnEditorPosition,S=void 0===b?"right":b,M=r.columnEditorText,E=void 0===M?"Columns":M,O=r.columnReordering,B=void 0!==O&&O,z=r.columnResizing,j=void 0!==z&&z,U=r.defaultHeaders,_=r.editColumns,G=void 0!==_&&_,K=r.editColumnsInitOpen,J=void 0!==K&&K,V=r.enableHeaderEditing,X=void 0!==V&&V,Y=r.enableRowSelection,$=void 0!==Y&&Y,Z=r.expandAll,Q=void 0===Z||Z,ee=r.expandIcon,ne=void 0===ee?e.jsx(F,{className:"st-expand-icon"}):ee,re=r.externalFilterHandling,te=void 0!==re&&re,oe=r.externalSortHandling,ie=void 0!==oe&&oe,ae=r.filterIcon,ue=void 0===ae?e.jsx(L,{className:"st-header-icon"}):ae,le=r.footerRenderer,ce=r.headerCollapseIcon,se=void 0===ce?e.jsx(F,{className:"st-header-icon"}):ce,fe=r.headerExpandIcon,ve=void 0===fe?e.jsx(T,{className:"st-header-icon"}):fe,he=r.headerDropdown,pe=r.headerHeight,we=r.height,me=r.hideFooter,ge=void 0!==me&&me,xe=r.isLoading,be=void 0!==xe&&xe,Ie=r.nextIcon,Ce=void 0===Ie?e.jsx(F,{className:"st-next-prev-icon"}):Ie,ye=r.onCellEdit,Re=r.onCellClick,Se=r.onColumnOrderChange,Ne=r.onColumnSelect,Ae=r.onFilterChange,Me=r.onGridReady,ke=r.onHeaderEdit,Ee=r.onLoadMore,He=r.onNextPage,Te=r.onPageChange,Fe=r.onRowSelectionChange,De=r.onSortChange,Oe=r.prevIcon,Pe=void 0===Oe?e.jsx(T,{className:"st-next-prev-icon"}):Oe,Le=r.rowButtons,Be=r.rowGrouping,We=r.rowHeight,qe=void 0===We?32:We,ze=r.rowIdAccessor,je=r.rows,Ue=r.selectionColumnWidth,_e=void 0===Ue?42:Ue,Ge=r.rowsPerPage,Ke=void 0===Ge?10:Ge,Je=r.selectableCells,Ve=void 0!==Je&&Je,Xe=r.selectableColumns,Ye=void 0!==Xe&&Xe,$e=r.serverSidePagination,Ze=void 0!==$e&&$e,Qe=r.shouldPaginate,en=void 0!==Qe&&Qe,nn=r.sortDownIcon,rn=void 0===nn?e.jsx(P,{className:"st-header-icon"}):nn,an=r.sortUpIcon,cn=void 0===an?e.jsx(D,{className:"st-header-icon"}):an,sn=r.tableRef,dn=r.theme,fn=void 0===dn?"light":dn,vn=r.totalRowCount,xn=r.useHoverRowBackground,In=void 0===xn||xn,Cn=r.useOddEvenRowBackground,yn=void 0!==Cn&&Cn,Rn=r.useOddColumnBackground,Sn=void 0!==Rn&&Rn;Sn&&(yn=!1),x&&(In=!1);var Nn=n.useRef(null),An=n.useRef(null),Mn=n.useRef(null),kn=n.useRef(null),En=n.useRef(null),Hn=n.useRef(null),Tn=n.useRef(null),Fn=function(e){var r=e.tableBodyContainerRef,t=n.useState(0),o=t[0],i=t[1];return n.useLayoutEffect(function(){r.current&&i(r.current.offsetWidth-r.current.clientWidth)},[r]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:r}}({tableBodyContainerRef:Hn}),Dn=Fn.scrollbarWidth,On=Fn.setScrollbarWidth,Pn=W({headerContainerRef:Tn,mainSectionRef:Hn,scrollbarWidth:Dn}).isMainSectionScrollable,Ln=n.useMemo(function(){if(be&&0===je.length){var e=en?Ke:10;Pn&&(e+=1);var n=Array.from({length:e},function(e,n){var r;return(r={})[ze]="loading-".concat(n),r});return n}return je},[be,je,ze,Ke,Pn,en]),Bn=n.useReducer(function(e){return e+1},0)[1],Wn=n.useState(1),qn=Wn[0],zn=Wn[1],jn=n.useState(U),Un=jn[0],_n=jn[1],Gn=n.useState(!1),Kn=Gn[0],Jn=Gn[1],Vn=n.useState(!1),Xn=Vn[0],Yn=Vn[1],$n=n.useState(null),Zn=$n[0],Qn=$n[1],er=n.useState(new Set),nr=er[0],rr=er[1];n.useEffect(function(){_n(U)},[U]);var tr=function(e){var r=e.rows,t=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,u=n.useState(new Set),l=u[0],c=u[1],s=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,r){return 0!==e.length&&e.every(function(e){return r.has(e[n]+"")})}(r,t,l)},[r,t,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),v=n.useMemo(function(){return a?function(e,n,r){return e.filter(function(e){return r.has(e[n]+"")})}(r,t,l):[]},[r,t,l,a]),h=n.useCallback(function(e,n){if(a){var i=function(e,n){var r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r}(e,l);if(c(i),o){var u=r.find(function(n){return n[t]+""===e});u&&o({row:u,isSelected:n,selectedRows:i})}}},[l,r,t,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return e[n]+""}))}(r,t),o&&r.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=r.find(function(n){return n[t]+""===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[r,t,o,l,a]),w=n.useCallback(function(e){if(a){var n=s(e);h(e,!n)}},[s,h,a]),m=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=r.find(function(e){return e[t]+""===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,r,t,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:s,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:v,handleRowSelect:h,handleSelectAll:p,handleToggleRow:w,clearSelection:m}}({rows:Ln,rowIdAccessor:ze,onRowSelectionChange:Fe,enableRowSelection:$}),or=tr.selectedRows,ir=tr.setSelectedRows,ar=tr.isRowSelected,ur=tr.areAllRowsSelected,lr=tr.selectedRowCount,cr=tr.selectedRowsData,sr=tr.handleRowSelect,dr=tr.handleSelectAll,fr=tr.handleToggleRow,vr=tr.clearSelection,hr=n.useMemo(function(){var e,n=u([],Un,!0);return $&&!(null===(e=null==Un?void 0:Un[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:_e,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[$,Un,_e]),pr=n.useState(0),wr=pr[0],mr=pr[1],gr=n.useState("none"),xr=gr[0],br=gr[1],Ir=n.useState(new Set),Cr=Ir[0],yr=Ir[1],Rr=n.useState(0),Sr=Rr[0],Nr=Rr[1];n.useLayoutEffect(function(){var e=function(){Hn.current&&Nr(Hn.current.clientWidth)};e();var n=null;return Hn.current&&(n=new ResizeObserver(e)).observe(Hn.current),function(){n&&n.disconnect()}},[]);var Ar=n.useMemo(function(){var e=c(window.innerWidth),n=function(e){var n=e.containerWidth,r=e.maxPinnedWidthPercent,t=void 0===r?.8:r,o=e.collapsedHeaders,i=0,a=0,u=0;e.headers.forEach(function(e){if(!e.hide){var n=m(e,o).reduce(function(e,n){return e+g(n)},0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:u+=n}});var l=i,c=a;if(n&&n>0){var s=n*t;i>s&&(i=s),a>s&&(a=s)}return{leftWidth:v(i),rightWidth:v(a),mainWidth:u,leftContentWidth:l,rightContentWidth:c}}({headers:hr,containerWidth:Sr,maxPinnedWidthPercent:e,collapsedHeaders:nr});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[hr,Sr,nr]),Mr=Ar.mainBodyWidth,kr=Ar.pinnedLeftWidth,Er=Ar.pinnedRightWidth,Hr=Ar.pinnedLeftContentWidth,Tr=Ar.pinnedRightContentWidth,Fr=function(e){var r=e.height,t=e.rowHeight,o=e.shouldPaginate,i=e.rowsPerPage;return n.useMemo(function(){var e;if(!r&&o&&i)return t*(i+1);if(!r)return window.innerHeight-t;var n,a=document.querySelector(".simple-table-root");return n="string"==typeof r?r.endsWith("px")?parseInt(r,10):r.endsWith("vh")?window.innerHeight*parseInt(r,10)/100:r.endsWith("%")?((null===(e=null==a?void 0:a.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*parseInt(r,10)/100:window.innerHeight:r,Math.max(0,n-t)},[r,t,o,i])}({height:we,rowHeight:qe,shouldPaginate:en,rowsPerPage:Ke}),Dr=function(e){var r=e.rows,t=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return r;var e=function(e){return f(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return r;var n=JSON.parse(JSON.stringify(r)),i=function(n,r){return void 0===r&&(r=0),n.map(function(n){var t=o[r],a=o[r+1],u=n[t];if(u&&y(u)){var l=i(u,r+1),c=exports.__assign({},n);return c[t]=l,e.forEach(function(e){var n=mn(l,e.accessor,e.aggregation,a);void 0!==n&&C(c,e.accessor,n)}),c}return n})};return i(n)},[r,t,o])}({rows:Ln,headers:Un,rowGrouping:Be}),Or=function(e){var r=e.rows,t=e.externalFilterHandling,o=e.onFilterChange,i=n.useState({}),a=i[0],u=i[1],l=n.useMemo(function(){return wn({externalFilterHandling:t,tableRows:r,filterState:a})},[r,a,t]),c=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},a),((n={})[e.accessor]=e,n));u(r),null==o||o(r)},[a,o]),s=n.useCallback(function(e){var n=exports.__assign({},a);delete n[e],u(n),null==o||o(n)},[a,o]),d=n.useCallback(function(){u({}),null==o||o({})},[o]),f=n.useCallback(function(e){var n,o=exports.__assign(exports.__assign({},a),((n={})[e.accessor]=e,n));return wn({externalFilterHandling:t,tableRows:r,filterState:o})},[a,r,t]);return{filteredRows:l,updateFilter:c,clearFilter:s,clearAllFilters:d,filters:a,computeFilteredRowsPreview:f}}({rows:Dr,externalFilterHandling:te,onFilterChange:Ae}),Pr=Or.filters,Lr=Or.updateFilter,Br=Or.clearFilter,Wr=Or.clearAllFilters,qr=Or.computeFilteredRowsPreview,zr=function(e){var r=e.headers,t=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=n.useState(null),l=u[0],c=u[1],s=n.useCallback(function(e){var n=e.groupingKeys,r=e.headers,t=e.sortColumn,o=un({headers:r,rows:e.rows,sortColumn:t});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(y(a)){var u=s({rows:a,sortColumn:t,headers:r,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),d=n.useMemo(function(){return ln({externalSortHandling:o,tableRows:t,sortColumn:l,rowGrouping:a,headers:r,sortNestedRows:s})},[t,l,r,o,a,s]),f=n.useCallback(function(e){var n=function(r){for(var t=0,o=r;o.length>t;t++){var i=o[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},t=n(r);if(t){var o=null;l&&l.key.accessor===e?"ascending"===l.direction&&(o={key:t,direction:"descending"}):o={key:t,direction:"ascending"},c(o),null==i||i(o)}},[l,r,i]),v=n.useCallback(function(e){var n=function(r){for(var t=0,o=r;o.length>t;t++){var i=o[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(r);if(!i)return t;var u=null;return l&&l.key.accessor===e?"ascending"===l.direction&&(u={key:i,direction:"descending"}):u={key:i,direction:"ascending"},ln({externalSortHandling:o,tableRows:t,sortColumn:u,rowGrouping:a,headers:r,sortNestedRows:s})},[l,r,t,o,a,s]);return{sort:l,sortedRows:d,updateSort:f,computeSortedRowsPreview:v}}({headers:Un,tableRows:Or.filteredRows,externalSortHandling:ie,onSortChange:De,rowGrouping:Be}),jr=zr.sort,Ur=zr.sortedRows,_r=zr.updateSort,Gr=function(e){var r=e.allowAnimations,t=e.sortedRows,o=e.originalRows,i=e.currentPage,a=e.rowsPerPage,c=e.shouldPaginate,s=e.serverSidePagination,d=e.rowGrouping,f=e.rowIdAccessor,v=e.unexpandedRows,h=e.expandAll,p=e.contentHeight,w=e.rowHeight,m=e.scrollTop,g=e.scrollDirection,x=void 0===g?"none":g,b=e.computeFilteredRowsPreview,I=e.computeSortedRowsPreview,C=n.useState(!1),S=C[0],N=C[1],A=n.useState([]),M=A[0],k=A[1],E=n.useRef([]),H=n.useRef([]),T=n.useMemo(function(){return l(w)},[w]),F=n.useRef(new Map),D=n.useRef(null),O=n.useCallback(function(e){var n=c&&!s?e.slice((i-1)*a,i*a):e,r=c?(i-1)*a:0;return d&&0!==d.length?function(e){var n=e.depth,r=e.expandAll,t=void 0!==r&&r,o=e.unexpandedRows,i=e.rowGrouping,a=void 0===i?[]:i,u=e.rowIdAccessor,l=e.displayPositionOffset,c=void 0===l?0:l,s=[],d=function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=c);var l=r,f=i;return e.forEach(function(r,i){var c=R({row:r,rowIdAccessor:u}),v=a[n];s.push({row:r,depth:n,displayPosition:f,groupingKey:v,position:l,isLastGroupRow:0===n&&i===e.length-1}),l++,f++;var h=c+"";if((t?!o.has(h):o.has(h))&&a.length>n){var p=function(e,n){var r=e[n];return y(r)?r:[]}(r,v);p.length>0&&(l=d(p,n+1,l,f))}}),l};return d(e.rows,void 0===n?0:n,0,c),s}({rows:n,rowGrouping:d,rowIdAccessor:f,unexpandedRows:v,expandAll:h,displayPositionOffset:r}):n.map(function(e,n){return{row:e,depth:0,displayPosition:r+n,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[i,a,c,s,d,f,v,h]);n.useMemo(function(){if(0===F.current.size){var e=O(o),n=new Map;e.forEach(function(e){var r=R({row:e.row,rowIdAccessor:f})+"";n.set(r,e.position)}),F.current=n}},[o,O,f]);var P=n.useMemo(function(){return O(t)},[t,O]),L=n.useMemo(function(){return q({bufferRowCount:T,contentHeight:p,tableRows:P,rowHeight:w,scrollTop:m,scrollDirection:x})},[P,p,w,m,x,T]),B=n.useCallback(function(e,n){var r=new Set(e.map(function(e){return R({row:e.row,rowIdAccessor:f})+""})),t=new Set(n.map(function(e){return R({row:e.row,rowIdAccessor:f})+""}));return{staying:n.filter(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return r.has(n)}),entering:n.filter(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return!r.has(n)}),leaving:e.filter(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return!t.has(n)})}},[f]),W=n.useMemo(function(){if(0===E.current.length)return!1;var e=P.map(function(e){return R({row:e.row,rowIdAccessor:f})+""}),n=E.current.map(function(e){return R({row:e.row,rowIdAccessor:f})+""});return e.length!==n.length||!e.every(function(e,r){return e===n[r]})},[P,f]);n.useLayoutEffect(function(){if(!S){if(!r||c)return k([]),E.current=P,void(H.current=L);if(0===E.current.length)return k([]),E.current=P,void(H.current=L);if(!W)return k([]),E.current=P,void(H.current=L);D.current={tableRows:P,visibleRows:L},N(!0)}},[r,P,W,S,c,L]),n.useLayoutEffect(function(){if(S&&D.current&&M.length>0){var e=setTimeout(function(){var e=D.current;N(!1),k([]),E.current=e.tableRows,H.current=e.visibleRows,D.current=null},bn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[S,M.length]);var z=n.useMemo(function(){if(!r||c)return L;if(M.length>0){var e=new Map,n=new Map;return P.forEach(function(r){var t=R({row:r.row,rowIdAccessor:f})+"";e.set(t,r.position),n.set(t,r.displayPosition)}),M.map(function(r){var t=R({row:r.row,rowIdAccessor:f})+"",o=e.get(t),i=n.get(t);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},r),{position:o,displayPosition:i}):r})}return L},[L,M,P,r,c,f]),j=n.useCallback(function(e){if(r&&!c){var n=b(e),t=O(n),o=q({bufferRowCount:T,contentHeight:p,tableRows:t,rowHeight:w,scrollTop:m,scrollDirection:x}),i=B(L,o).entering.map(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return P.find(function(e){return R({row:e.row,rowIdAccessor:f})+""===n})||e}).filter(Boolean);i.length>0&&k(u(u([],L,!0),i,!0))}},[r,c,b,O,p,w,m,x,B,P,L,f,T]),U=n.useCallback(function(e){if(r&&!c){var n=I(e),t=O(n),o=q({bufferRowCount:T,contentHeight:p,tableRows:t,rowHeight:w,scrollTop:m,scrollDirection:x}),i=B(L,o).entering.map(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return P.find(function(e){return R({row:e.row,rowIdAccessor:f})+""===n})||e}).filter(Boolean);i.length>0&&k(u(u([],L,!0),i,!0))}},[r,c,I,O,p,w,m,x,B,P,L,f,T]);return{currentTableRows:P,currentVisibleRows:L,isAnimating:S,prepareForFilterChange:j,prepareForSortChange:U,rowsToRender:z}}({allowAnimations:o,sortedRows:Ur,originalRows:Dr,currentPage:qn,rowsPerPage:Ke,shouldPaginate:en,serverSidePagination:Ze,rowGrouping:Be,rowIdAccessor:ze,unexpandedRows:Cr,expandAll:Q,contentHeight:Fr,rowHeight:qe,scrollTop:wr,scrollDirection:xr,computeFilteredRowsPreview:qr,computeSortedRowsPreview:zr.computeSortedRowsPreview}),Kr=Gr.currentTableRows,Jr=Gr.rowsToRender,Vr=Gr.prepareForFilterChange,Xr=Gr.prepareForSortChange,Yr=Gr.isAnimating,$r=n.useRef(new Map),Zr=n.useRef(new Map),Qr=function(e){var r=e.selectableCells,t=e.headers,o=e.tableRows,u=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,s=e.collapsedHeaders,d=e.rowHeight,f=e.enableRowSelection,v=void 0!==f&&f,h=n.useState(new Set),p=h[0],w=h[1],g=n.useState(new Set),x=g[0],b=g[1],y=n.useState(null),S=y[0],M=y[1],k=n.useState(null),E=k[0],H=k[1],T=n.useState(new Set),F=T[0],D=T[1],O=n.useState(new Set),P=O[0],L=O[1],B=n.useState(!1),W=B[0],q=B[1],z=n.useRef(!1),j=n.useRef(null),U=n.useMemo(function(){var e=new Set;return p.forEach(function(n){var r=n.split("-");if(r.length>=2){var t=parseInt(r[1],10);isNaN(t)||e.add(t)}}),x.forEach(function(n){e.add(n)}),e},[p,x]),_=n.useMemo(function(){var e=new Set;return p.forEach(function(n){var r=n.split("-");if(r.length>=3){var t=r.slice(2).join("-");e.add(t)}}),x.size>0&&o.forEach(function(n){var r=R({row:n.row,rowIdAccessor:u});e.add(r+"")}),e},[p,x,o,u]),G=n.useMemo(function(){return t.flatMap(function(e){return m(e,s)})},[t,s]),K=n.useCallback(function(){if(0!==p.size){var e=function(e,n,r){var t=n.filter(function(e){return!e.hide}),o=new Map,i=new Map;t.forEach(function(e,n){o.set(n,e.accessor),i.set(n,e)});var a=Array.from(e).reduce(function(e,n){var t,a=n.split("-").map(Number),u=a[0],l=a[1];e[u]||(e[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=I(r[u].row,c);e[u][l]=!s||"lineAreaChart"!==s.type&&"barChart"!==s.type?d:Array.isArray(d)?d.join(", "):""}else e[u][l]="";return e},{});return Object.values(a).map(function(e){return Object.values(e).join("\t")}).join("\n")}(p,G,o);navigator.clipboard.writeText(e),D(new Set(p)),setTimeout(function(){return D(new Set)},800)}},[p,G,o]),J=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,r,t,i;return a(this,function(a){switch(a.label){case 0:if(!E)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,r,t,o,i,a){var u=new Set,l=new Set,c=e.split("\n").filter(function(e){return e.length>0});if(0===c.length)return{updatedCells:u,warningCells:l};var s=r.filter(function(e){return!e.hide}),d=n.rowIndex,f=n.colIndex;return c.forEach(function(e,n){e.split("\t").forEach(function(e,r){var c=d+n,v=f+r;if(t.length>c&&s.length>v){var h=t[c],p=s[v],w=R({row:h.row,rowIdAccessor:o});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var g=+e;isNaN(g)||(m=g)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var x=new Date(e);isNaN(x.getTime())||(m=x)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(m=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(C(h.row,p.accessor,m),a){var b="".concat(w,"-").concat(p.accessor),I=a.get(b);I&&I.updateContent(m)}null==i||i({accessor:p.accessor,newValue:m,row:h.row,rowIndex:c});var y="".concat(c,"-").concat(v,"-").concat(w);u.add(y)}else{var S="".concat(c,"-").concat(v,"-").concat(w);l.add(S)}}})}),{updatedCells:u,warningCells:l}}(e,E,G,o,u,l,c),t=n.warningCells,(r=n.updatedCells).size>0&&(D(r),setTimeout(function(){return D(new Set)},800)),t.size>0&&(L(t),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]}})})},[E,G,o,u,l,c]),V=n.useCallback(function(){if(0!==p.size){var e=function(e,n,r,t,o,i){var a=new Set,u=new Set,l=n.filter(function(e){return!e.hide}),c=new Map;return l.forEach(function(e,n){c.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),c=n[0],s=n[1];if(r.length>c&&l.length>s){var d=r[c],f=l[s],v=R({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(I(d.row,f.accessor))?[]:""),C(d.row,f.accessor,h),i){var p="".concat(v,"-").concat(f.accessor),w=i.get(p);w&&w.updateContent(h)}null==o||o({accessor:f.accessor,newValue:h,row:d.row,rowIndex:c}),a.add(e)}else u.add(e)}}),{deletedCells:a,warningCells:u}}(p,G,o,u,l,c),n=e.deletedCells,r=e.warningCells;n.size>0&&(D(n),setTimeout(function(){return D(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800))}},[p,G,o,u,l,c]),X=n.useCallback(function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=t;i>=c;c++)for(var s=a;l>=s;s++)if(c>=0&&o.length>c){if(v&&0===s)continue;var f=R({row:o[c].row,rowIdAccessor:u});r.add(A({colIndex:s,rowIndex:c,rowId:f}))}b(new Set),M(null),w(r),H(n),setTimeout(function(){return N(n,d)},0)},[o,u,d,v]),Y=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(v?G.length:G.length-1)>=e.colIndex){var n=A(e);b(new Set),M(null),w(new Set([n])),H(e),setTimeout(function(){return N(e,d)},0)}},[G.length,o.length,d,v]),$=n.useCallback(function(e,n){void 0===n&&(n=!1),w(new Set),H(null),b(function(r){var t=new Set(n?r:[]);return e.forEach(function(e){return t.add(e)}),t}),e.length>0&&M(e[e.length-1])},[]);!function(e){var r=e.selectableCells,t=e.initialFocusedCell,o=e.tableRows,i=e.leafHeaders,a=e.rowIdAccessor,u=e.selectSingleCell,l=e.selectCellRange,c=e.setSelectedCells,s=e.setSelectedColumns,d=e.setLastSelectedColumnIndex,f=e.copyToClipboard,v=e.pasteFromClipboard,h=e.deleteSelectedCells,p=e.startCell,w=e.enableRowSelection,m=void 0!==w&&w;n.useEffect(function(){var e=function(e){var u;if(r&&t){var l=t.rowIndex,S=t.colIndex,N=t.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void v();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var A=new Set,M=0;o.length>M;M++)for(var k=0;i.length>k;k++){var E=m?k+1:k,H=R({row:o[M].row,rowIdAccessor:a});A.add("".concat(M,"-").concat(E,"-").concat(H))}return c(A),s(new Set),void d(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void h();if(R({row:null===(u=o[l])||void 0===u?void 0:u.row,rowIdAccessor:a})!==N){var T=o.findIndex(function(e){return R({row:e.row,rowIdAccessor:a})===N});if(-1===T)return;l=T}var F=function(e,n,r){var t=e,a=n;return"up"===r?t=0:"down"===r?t=o.length-1:"left"===r?a=m?1:0:"right"===r&&(a=m?i.length:i.length-1),{rowIndex:t,colIndex:a}};"ArrowUp"===e.key?(e.preventDefault(),n(e,l,S,F)):"ArrowDown"===e.key?(e.preventDefault(),w(e,l,S,F)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,l,S,F)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,l,S,F)):"Home"===e.key?(e.preventDefault(),b(e,l)):"End"===e.key?(e.preventDefault(),I(e,l)):"PageUp"===e.key?(e.preventDefault(),C(e,l,S)):"PageDown"===e.key?(e.preventDefault(),y(e,l,S)):"Escape"===e.key&&(c(new Set),s(new Set),d(null),p.current=null)}else f()}},n=function(e,n,r,i){if(e.shiftKey){p.current||(p.current=t);var c=n-1;if((e.ctrlKey||e.metaKey)&&(c=i(n,r,"up").rowIndex),c>=0){var s=R({row:o[c].row,rowIdAccessor:a});l(p.current,{rowIndex:c,colIndex:r,rowId:s})}}else n>0&&(c=n-1,(e.ctrlKey||e.metaKey)&&(c=i(n,r,"up").rowIndex),s=R({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:r,rowId:s}),p.current=null)},w=function(e,n,r,i){if(e.shiftKey){p.current||(p.current=t);var c=n+1;if((e.ctrlKey||e.metaKey)&&(c=i(n,r,"down").rowIndex),o.length>c){var s=R({row:o[c].row,rowIdAccessor:a});l(p.current,{rowIndex:c,colIndex:r,rowId:s})}}else o.length-1>n&&(c=n+1,(e.ctrlKey||e.metaKey)&&(c=i(n,r,"down").rowIndex),s=R({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:r,rowId:s}),p.current=null)},g=function(e,n,r,i){if(e.shiftKey&&"ArrowLeft"===e.key){p.current||(p.current=t);var c=r-1;if(e.ctrlKey||e.metaKey)c=i(n,r,"left").colIndex;else if(m&&0===c)return;if(c>=0){var s=R({row:o[n].row,rowIdAccessor:a});l(p.current,{rowIndex:n,colIndex:c,rowId:s})}}else if(r>0){if(c=r-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)c=i(n,r,"left").colIndex;else if(m&&0===c)return;0>c||(s=R({row:o[n].row,rowIdAccessor:a}),u({rowIndex:n,colIndex:c,rowId:s}),p.current=null)}},x=function(e,n,r,c){var s=m?i.length:i.length-1;if(e.shiftKey&&"ArrowRight"===e.key){p.current||(p.current=t);var d=r+1;if((e.ctrlKey||e.metaKey)&&(d=c(n,r,"right").colIndex),s>=d){var f=R({row:o[n].row,rowIdAccessor:a});l(p.current,{rowIndex:n,colIndex:d,rowId:f})}}else s>r&&(d=r+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(d=c(n,r,"right").colIndex),d>s||(f=R({row:o[n].row,rowIdAccessor:a}),u({rowIndex:n,colIndex:d,rowId:f}),p.current=null))},b=function(e,n,r){if(e.shiftKey){p.current||(p.current=t);var i=n,c=m?1:0;(e.ctrlKey||e.metaKey)&&(i=0);var s=R({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:c,rowId:s})}else i=n,c=m?1:0,(e.ctrlKey||e.metaKey)&&(i=0),s=R({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:c,rowId:s}),p.current=null},I=function(e,n,r){if(e.shiftKey){p.current||(p.current=t);var c=n,s=m?i.length:i.length-1;(e.ctrlKey||e.metaKey)&&(c=o.length-1);var d=R({row:o[c].row,rowIdAccessor:a});l(p.current,{rowIndex:c,colIndex:s,rowId:d})}else c=n,s=m?i.length:i.length-1,(e.ctrlKey||e.metaKey)&&(c=o.length-1),d=R({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:s,rowId:d}),p.current=null},C=function(e,n,r){var i=Math.max(0,n-10);if(e.shiftKey){p.current||(p.current=t);var c=R({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=R({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:r,rowId:c}),p.current=null},y=function(e,n,r){var i=Math.min(o.length-1,n+10);if(e.shiftKey){p.current||(p.current=t);var c=R({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=R({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:r,rowId:c}),p.current=null};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,t,o,i,a,u,l,c,s,d,f,v,h,p,m])}({selectableCells:r,initialFocusedCell:E,tableRows:o,leafHeaders:G,rowIdAccessor:u,selectSingleCell:Y,selectCellRange:X,setSelectedCells:w,setSelectedColumns:b,setLastSelectedColumnIndex:M,copyToClipboard:K,pasteFromClipboard:J,deleteSelectedCells:V,startCell:j,enableRowSelection:v});var Z=n.useCallback(function(e,n){var r=new Set,t=new Map;o.forEach(function(e,n){var r=R({row:e.row,rowIdAccessor:u});t.set(r+"",n)});for(var i=t.get(e.rowId+""),a=t.get(n.rowId+""),l=void 0!==i?i:e.rowIndex,c=void 0!==a?a:n.rowIndex,s=Math.min(l,c),d=Math.max(l,c),f=Math.min(e.colIndex,n.colIndex),h=Math.max(e.colIndex,n.colIndex),p=s;d>=p;p++)for(var m=f;h>=m;m++)if(p>=0&&o.length>p){if(v&&0===m)continue;var g=R({row:o[p].row,rowIdAccessor:u});r.add(A({colIndex:m,rowIndex:p,rowId:g}))}w(r)},[o,u,v]),Q=n.useCallback(function(e,n){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,e)),a=Math.max(t.top,Math.min(t.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,r=n.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=n)}}),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},[]),ee=n.useCallback(function(e,n){var r=document.elementFromPoint(e,n);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 Q(e,n)},[Q]),ne=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(r){var t=r.getBoundingClientRect();t.top+50>n?r.scrollTop-=10*Math.min(3,1+Math.max(0,t.top-n)/100):n>t.bottom-50&&(r.scrollTop+=10*Math.min(3,1+Math.max(0,n-t.bottom)/100));var o=document.querySelector(".st-body-main");o&&(t.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,t.left-e)/100):e>t.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-t.right)/100)))}},[]),re=n.useCallback(function(e){var n=e.colIndex,r=A({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),t=p.has(r),o=x.has(n);return t||o},[p,x]),te=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId;if(W)return"";var i=[],a=o[r-1]?R({row:o[r-1].row,rowIdAccessor:u}):null,l=o[r+1]?R({row:o[r+1].row,rowIdAccessor:u}):null,c=null!==a?{colIndex:n,rowIndex:r-1,rowId:a}:null,s=null!==l?{colIndex:n,rowIndex:r+1,rowId:l}:null,d={colIndex:n-1,rowIndex:r,rowId:t},f={colIndex:n+1,rowIndex:r,rowId:t};return(!c||!re(c)||x.has(n)&&0===r)&&i.push("st-selected-top-border"),(!s||!re(s)||x.has(n)&&r===o.length-1)&&i.push("st-selected-bottom-border"),re(d)||i.push("st-selected-left-border"),re(f)||i.push("st-selected-right-border"),i.join(" ")},[W,re,o,x,u]),oe=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),ie=n.useCallback(function(e){var n=A({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return F.has(n)},[F]),ae=n.useCallback(function(e){var n=A({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return P.has(n)},[P]);return{getBorderClass:te,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){z.current=!0,q(!0),j.current={rowIndex:t,colIndex:n,rowId:o},setTimeout(function(){b(new Set),M(null);var e=A({colIndex:n,rowIndex:t,rowId:o});w(new Set([e])),H({rowIndex:t,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,c=function(){if(z.current&&j.current){if(null!==i&&null!==a){ne(i,a);var e=Date.now();if(e-l>=16){var n=ee(i,a);n&&Z(j.current,n),l=e}}u=requestAnimationFrame(c)}else null!==u&&(cancelAnimationFrame(u),u=null)},s=function(e){z.current&&j.current&&(i=e.clientX,a=e.clientY)},d=function(){z.current=!1,q(!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(e){r&&z.current&&j.current&&Z(j.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ie,isWarningFlashing:ae,isInitialFocusedCell:oe,isSelected:re,lastSelectedColumnIndex:S,pasteFromClipboard:J,selectColumns:$,selectedCells:p,selectedColumns:x,setInitialFocusedCell:H,setSelectedCells:w,setSelectedColumns:b,deleteSelectedCells:V,columnsWithSelectedCells:U,rowsWithSelectedCells:_}}({selectableCells:Ve,headers:Un,tableRows:Kr,rowIdAccessor:ze,onCellEdit:ye,cellRegistry:$r.current,collapsedHeaders:nr,rowHeight:qe,enableRowSelection:$}),et=Qr.getBorderClass,nt=Qr.handleMouseDown,rt=Qr.handleMouseOver,tt=Qr.isCopyFlashing,ot=Qr.isInitialFocusedCell,it=Qr.isSelected,at=Qr.isWarningFlashing,ut=Qr.selectColumns,lt=Qr.selectedCells,ct=Qr.selectedColumns,st=Qr.setInitialFocusedCell,dt=Qr.setSelectedCells,ft=Qr.setSelectedColumns,vt=Qr.columnsWithSelectedCells,ht=Qr.rowsWithSelectedCells,pt=n.useCallback(function(e){Xr(e),setTimeout(function(){_r(e)},0)},[Xr,_r]),wt=n.useCallback(function(e){_n(e)},[]);!function(e){var r=e.selectableColumns,t=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(u&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||r&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(t.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,t,o,i,a,u,l])}({selectableColumns:Ye,selectedCells:lt,selectedColumns:ct,setSelectedCells:dt,setSelectedColumns:ft,activeHeaderDropdown:Zn,setActiveHeaderDropdown:Qn}),function(e){var r=e.forceUpdate,t=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){r(),t.current&&o(t.current.offsetWidth-t.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[r,t,o])}({forceUpdate:Bn,tableBodyContainerRef:Hn,setScrollbarWidth:On}),function(e){var r=e.onGridReady;n.useEffect(function(){null==r||r()},[r])}({onGridReady:Me}),function(e){var r=e.cellRegistryRef,t=e.currentTableRows,o=e.headerRegistryRef,i=e.headers,a=e.rowIdAccessor,l=e.rows,c=e.tableRef,s=e.visibleRows;n.useEffect(function(){c&&(c.current={updateData:function(e){var n=e.accessor,t=e.newValue,o=null==l?void 0:l[e.rowIndex];if(o){var i=R({row:o,rowIdAccessor:a}),u=w({rowId:i,accessor:n}),c=r.current.get(u);c&&c.updateContent(t),void 0!==I(o,n)&&C(o,n,t)}},setHeaderRename:function(e){var n=o.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return s},exportToCSV:function(e){!function(e,n,r){var t=function(e,n){var r=function(e){var n=[],r=function(e){for(var t=0,o=e;o.length>t;t++){var i=o[t];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?r(i.children):n.push(i))}};return r(e),n}(n);return u([r.map(function(e){return gn(e.label)}).join(",")],e.map(function(e){var n=e.row;return r.map(function(e){var r=I(n,e.accessor);return gn(r)}).join(",")}),!0).join("\n")}(e,n);!function(e,n){void 0===n&&(n="table-export.csv");var r=new Blob([e],{type:"text/csv;charset=utf-8;"}),t=document.createElement("a"),o=URL.createObjectURL(r);t.setAttribute("href",o),t.setAttribute("download",n),t.style.visibility="hidden",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(o)}(t,r)}(t,i,(void 0===e?{}:e).filename)}})},[r,t,o,i,a,l,c,s])}({cellRegistryRef:$r,currentTableRows:Kr,headerRegistryRef:Zr,headers:hr,rowIdAccessor:ze,rows:Ln,tableRef:sn,visibleRows:Jr}),function(e){var r=e.filters,t=e.onFilterChange;n.useEffect(function(){null==t||t(r)},[r,t])}({filters:Pr,onFilterChange:Ae}),function(e){var r=e.sort,t=e.onSortChange,o=de(r);n.useEffect(function(){!r||(null==o?void 0:o.key.accessor)===r.key.accessor&&(null==o?void 0:o.direction)===r.direction?!r&&o&&(null==t||t(null)):null==t||t(r)},[r,o,t])}({sort:jr,onSortChange:De});var mt=n.useCallback(function(e){Vr(e),setTimeout(function(){Lr(e)},0)},[Vr,Lr]);return e.jsx(k,exports.__assign({value:{allowAnimations:o,areAllRowsSelected:ur,cellRegistry:$r.current,cellUpdateFlash:d,clearSelection:vr,collapsedHeaders:nr,columnBorders:x,columnReordering:B,columnResizing:j,draggedHeaderRef:Nn,editColumns:G,enableHeaderEditing:X,enableRowSelection:$,expandIcon:ne,filterIcon:ue,filters:Pr,forceUpdate:Bn,getBorderClass:et,handleApplyFilter:mt,handleClearAllFilters:Wr,handleClearFilter:Br,handleMouseDown:nt,handleMouseOver:rt,handleRowSelect:sr,handleSelectAll:dr,handleToggleRow:fr,headerCollapseIcon:se,headerContainerRef:Tn,headerDropdown:he,headerExpandIcon:ve,headerRegistry:Zr.current,headers:hr,hoveredHeaderRef:An,isAnimating:Yr,isCopyFlashing:tt,isInitialFocusedCell:ot,isLoading:be,isResizing:Kn,isRowSelected:ar,isScrolling:Xn,isSelected:it,isWarningFlashing:at,mainBodyRef:Mn,nextIcon:Ce,onCellEdit:ye,onCellClick:Re,onColumnOrderChange:Se,onColumnSelect:Ne,onLoadMore:Ee,onSort:pt,onTableHeaderDragEnd:wt,pinnedLeftRef:kn,pinnedRightRef:En,prevIcon:Pe,rowButtons:Le,rowGrouping:Be,rowHeight:qe,headerHeight:null!=pe?pe:qe,rowIdAccessor:ze,scrollbarWidth:Dn,selectColumns:ut,selectableColumns:Ye,selectedColumns:ct,columnsWithSelectedCells:vt,rowsWithSelectedCells:ht,selectedRows:or,selectedRowCount:lr,selectedRowsData:cr,setCollapsedHeaders:rr,setHeaders:_n,setInitialFocusedCell:st,setIsResizing:Jn,setIsScrolling:Yn,setSelectedCells:dt,setSelectedColumns:ft,setSelectedRows:ir,setUnexpandedRows:yr,shouldPaginate:en,sortDownIcon:rn,sortUpIcon:cn,tableBodyContainerRef:Hn,tableRows:Kr,theme:fn,unexpandedRows:Cr,useHoverRowBackground:In,useOddColumnBackground:Sn,useOddEvenRowBackground:yn,activeHeaderDropdown:Zn,setActiveHeaderDropdown:Qn,onHeaderEdit:ke}},{children:e.jsx("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(fn," ").concat(null!=h?h:""," ").concat(x?"st-column-borders":""),style:we?{height:we}:{}},{children:e.jsx(pn,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(tn,{pinnedLeftWidth:kr,pinnedRightWidth:Er,setScrollTop:mr,setScrollDirection:br,sort:jr,tableRows:Kr,rowsToRender:Jr}),e.jsx(hn,{columnEditorText:E,editColumns:G,editColumnsInitOpen:J,headers:Un,position:S})]})),e.jsx(on,{mainBodyRef:Mn,mainBodyWidth:Mr,pinnedLeftWidth:kr,pinnedRightWidth:Er,pinnedLeftContentWidth:Hr,pinnedRightContentWidth:Tr,tableBodyContainerRef:Hn}),e.jsx(H,{currentPage:qn,footerRenderer:le,hideFooter:ge,onPageChange:zn,onNextPage:He,onUserPageChange:Te,rowsPerPage:Ke,shouldPaginate:en,totalPages:Math.ceil((null!=vn?vn:Ur.length)/Ke),totalRows:null!=vn?vn:Ur.length})]}))})}))}))},Rn=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,c=n.fillOpacity,s=void 0===c?.2:c,d=n.strokeWidth,f=void 0===d?2:d,v=n.className,h=void 0===v?"":v,p=n.min,w=n.max;if(!r||0===r.length)return null;var m=void 0!==p?p:Math.min.apply(Math,r),g=(void 0!==w?w:Math.max.apply(Math,r))-m||1,x=a,b=r.map(function(e,n){return{x:n/(r.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),I="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(h),style:{display:"block"}},{children:[e.jsx("path",{d:I,fill:l||"var(--st-chart-fill-color)",fillOpacity:s,stroke:"none",vectorEffect:"non-scaling-stroke"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}))},Sn=Object.freeze({__proto__:null,default:Rn}),Nn=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,c=void 0===l?2:l,s=n.className,d=void 0===s?"":s,f=n.min,v=n.max;if(!r||0===r.length)return null;var h=void 0!==f?f:Math.min.apply(Math,r),p=void 0!==v?v:Math.max.apply(Math,r),w=p-h||1,m=a,g=(100-c*(r.length-1))/r.length,x=0>h,b=x?m*(p/w):m;return e.jsx("svg",exports.__assign({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(n,r){var t=r*(g+c),o=(n-h)/w*m,i=m-o,a=o;return x&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:t,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:1},r)})}))},An=Object.freeze({__proto__:null,default:Nn});exports.ANIMATION_CONFIGS=bn,exports.AngleDownIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},exports.AngleLeftIcon=T,exports.AngleRightIcon=F,exports.AngleUpIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},exports.AscIcon=D,exports.BarChart=Nn,exports.CheckIcon=O,exports.DescIcon=P,exports.FilterIcon=L,exports.LineAreaChart=Rn,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=B,exports.SimpleTable=function(r){var t=n.useState(!1),o=t[0],i=t[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(yn,exports.__assign({},r)):null},exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,r=e.options;return i(void 0,void 0,void 0,function(){var e,t,o,i,u,l,c,s,d,f,v,h,p,w,m,g;return a(this,function(a){return e=r.startY,t=r.endY,o=r.finalY,u=void 0===(i=r.duration)?300:i,c=void 0===(l=r.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(s=r.delay)?0:s,f=r.onComplete,h=void 0===(v=r.respectReducedMotion)||v,xn()&&h?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),m=e-(w=p.top),g=t-w,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.style.transition="transform ".concat(u,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"px, 0)");var r=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",r),f&&f(),e()};n.addEventListener("transitionend",r),setTimeout(r,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,r=e.finalConfig,t=e.fromBounds,o=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){return{x:("x"in e?e.x:e.left)-n.x,y:("y"in e?e.y:e.top)-n.y}}(t,o),0===e.x&&0===e.y||xn()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=xn()?exports.__assign(exports.__assign({},bn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},bn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},bn.ROW_REORDER),u),In(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,Cn(n,i,r)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=de,exports.useTableContext=E;
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),n=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(n);function o(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);t.length>o;o++)0>n.indexOf(t[o])&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function i(e,n,r,t){return new(r||(r=Promise))(function(o,i){function a(e){try{l(t.next(e))}catch(e){i(e)}}function u(e){try{l(t.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(a,u)}l((t=t.apply(e,n||[])).next())})}function a(e,n){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=n.call(e,i)}catch(e){u=[6,e],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 u(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;i>o;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;t>r;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},c=function(e){return 480>e?.3:768>e?.4:.8},s="parentExpanded",d=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=t(a[i],o);return o};return t(e,n),r},f=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,f(e.children)),n})},v=function(e){return void 0===e&&(e=0),e?e+1:0},h=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},p=function(e){var n=e.header,r=e.pinned,t=e.headers,o=e.collapsedHeaders;return n.hide||(r||n.pinned)&&n.pinned!==r?null:!(t&&o&&function(e,n,r){var t=function(e,n){for(var r=0,t=f(e);t.length>r;r++){var o=t[r];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);if(t){var o=r.has(t.accessor),i=e.showWhen||s;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,t,o))||null},w=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},m=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){var n=e.showWhen||s;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return m(e,n)}):e.children.filter(function(e){var n=e.showWhen||s;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return m(e,n)}):[e]},g=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(h({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},x=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(h({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){x(e)})},b=function(e){return"number"==typeof e.minWidth?e.minWidth:40},I=function(e,n){return n.includes(".")?(n+"").split(".").reduce(function(e,n){return null==e?void 0:e[n]},e):e[n]},C=function(e,n,r){if("string"!=typeof n||n.includes(".")){for(var t=(n+"").split("."),o=e,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 e[n]=r},y=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},R=function(e){return e.row[e.rowIdAccessor]},S=function(e,n,r){var t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>t.top?n.scrollTop-=o.top-t.top+i:t.bottom>o.bottom-i&&(n.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)}},N=function(e,n){var r=document.querySelector(".st-body-container"),t=document.querySelector(".st-body-main");if(r){var o=n+1,i=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(!i)return r.scrollTop=Math.max(0,e.rowIndex*o-r.clientHeight/3),void setTimeout(function(){var n=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));n&&S(n,r,t)},100);S(i,r,t)}},A=function(e){var n=e.colIndex,r=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(r)},M=n.createContext(void 0),k=function(n){return e.jsx(M.Provider,exports.__assign({value:n.value},{children:n.children}))},E=function(){var e=n.useContext(M);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},H=function(r){var t=r.currentPage,o=r.footerRenderer,u=r.hideFooter,l=r.onPageChange,c=r.onNextPage,s=r.onUserPageChange,d=r.rowsPerPage,f=r.shouldPaginate,v=r.totalPages,h=r.totalRows,p=E(),w=p.nextIcon,m=p.prevIcon,g=n.useState(!0),x=g[0],b=g[1],I=t>1,C=v>t,y=t===v,R=Math.min((t-1)*d+1,h),S=Math.min(t*d,h),N=!I,A=!C&&!c||!x&&y,M=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=t-1)?[3,2]:(l(e),s?[4,s(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},k=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(r){switch(r.label){case 0:return e=t===v,n=t+1,c&&e?[4,c(t)]:[3,2];case 1:if(!r.sent())return b(!1),[2];r.label=2;case 2:return n>v&&!c?[3,4]:(l(n),s?[4,s(n)]:[3,4]);case 3:r.sent(),r.label=4;case 4:return[2]}})})},H=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return 1>e||e>v?[3,2]:(l(e),s?[4,s(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})};if(u||!f)return null;if(o)return e.jsx(e.Fragment,{children:o({currentPage:t,totalPages:v,rowsPerPage:d,totalRows:h,startRow:R,endRow:S,onPageChange:H,onNextPage:k,onPrevPage:M,hasNextPage:!A,hasPrevPage:!N,nextIcon:w,prevIcon:m})});var T=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,r=[];t>8?v-7>t?(e=t-7,n=t+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14);for(var o=e;n>=o;o++)r.push(o);return v-1>n&&(r.push(-1),r.push(v)),r}();return e.jsxs("div",exports.__assign({className:"st-footer"},{children:[e.jsx("div",exports.__assign({className:"st-footer-info"},{children:e.jsxs("span",exports.__assign({className:"st-footer-results-text"},{children:["Showing ",R," to ",S," of ",h.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[T.map(function(n,r){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),r):e.jsx("button",exports.__assign({onClick:function(){return H(n)},className:"st-page-btn ".concat(t===n?"active":"")},{children:n}),r)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(N?"disabled":""),onClick:M,disabled:N},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(A?"disabled":""),onClick:k,disabled:A},{children:w}))]}))]}))},T=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},F=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},D=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},O=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:n.className,style:exports.__assign({height:"10px"},n.style)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},P=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},L=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:n.className,style:exports.__assign({height:"1em"},n.style)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},B=function(){return e.jsx("svg",exports.__assign({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},W=function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[r,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current;if(e&&(null==r?void 0:r.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[r,t]),{isMainSectionScrollable:a}},q=function(e){var n=e.contentHeight,r=e.scrollTop,t=e.tableRows,o=e.scrollDirection,i=e.rowHeight+1,a=e.bufferRowCount*i,u=a,l=a;"down"===o?(u=Math.max(i,.1*a),l=.9*a):"up"===o&&(u=.9*a,l=Math.max(i,.1*a));var c=r+n+l;return t.slice(Math.max(0,Math.floor(Math.max(0,r-u)/i)),Math.min(t.length,Math.ceil(c/i)))},z=function(e){return e.position*(e.rowHeight+1)-1},j=function(e){return e.position*(e.rowHeight+1)},U=function(r){var t=r.children,o=r.onClose,i=r.open,a=r.overflow,u=void 0===a?"auto":a,l=r.setOpen,c=r.width,s=r.containerRef,d=r.positioning,f=void 0===d?"fixed":d,v=E().mainBodyRef,h=n.useRef(null),p=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],I=x[1],C=n.useState(!1),y=C[0],R=C[1];return n.useEffect(function(){i&&h.current?(R(!1),!p.current&&h.current.parentElement&&(p.current=h.current.parentElement),requestAnimationFrame(function(){if(h.current&&p.current){var e,n=h.current,r=p.current.getBoundingClientRect(),t=n.offsetHeight,o=c||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-r.bottom,a=r.top-e.top,u="bottom",l={};(t>i&&a>=t||t>i&&a>i)&&(u="top");var d="left";o>e.right-r.right+r.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=r.bottom+4:l.bottom=window.innerHeight-r.top+4,"left"===d?l.left=r.left:l.right=window.innerWidth-r.right):("bottom"===u?l.top=r.height+4:l.bottom=r.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),I(l),R(!0)}})):i||R(!1)},[i,c,s,v,f]),n.useEffect(function(){var e=function(e){i&&h.current&&h.current&&!h.current.contains(e.target)&&(l(!1),null==o||o())};return i&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[i,o,l]),n.useEffect(function(){var e=function(e){if(h.current&&!h.current.contains(e.target)){var n=h.current.parentElement;n&&!n.contains(e.target)&&(l(!1),null==o||o())}};return i&&document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}},[o,i,l]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&i&&(l(!1),null==o||o())};return i&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[o,i,l]),i?e.jsx("div",exports.__assign({ref:h,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:c?"".concat(c,"px"):"auto",visibility:y?"visible":"hidden"},b),{overflow:u})},{children:t})):null},_=function(n){var r=n.children,t=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,c=void 0===l?"":l;return e.jsx("div",exports.__assign({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}))},G=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=n.useState(r.value),l=u[0],c=u[1],s=function(e){c(e),o(e),a(!1),t()};return e.jsxs(U,exports.__assign({open:i,onClose:function(){t()},setOpen:a,width:120},{children:[e.jsx(_,exports.__assign({isSelected:!0===l,onClick:function(){return s(!0)}},{children:"True"})),e.jsx(_,exports.__assign({isSelected:!1===l,onClick:function(){return s(!1)}},{children:"False"}))]}))},K=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},J=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+t,onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},V=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-3fd679bc.js")})}),X=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-8eb04cb7.js")})}),Y=n.lazy(function(){return Promise.resolve().then(function(){return Sn})}),$=n.lazy(function(){return Promise.resolve().then(function(){return An})}),Z=function(r){var t=o(r,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},t))},{children:e.jsx(V,exports.__assign({},r))}))},Q=function(r){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(X,exports.__assign({},r))}))},ee=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(Y,exports.__assign({},r))}))},ne=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx($,exports.__assign({},r))}))},re=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number);return new Date(n[0],n[1]-1,n[2],12,0,0)}var r=new Date(e);return isNaN(r.getTime())?new Date:new Date(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0)},te=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},oe=function(e){if(!e)return new Date;if("string"==typeof e)return re(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:te(n)}return e instanceof Date?te(e):new Date},ie=function(e){return e?re(""+e):new Date},ae=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=r.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e.jsx(U,exports.__assign({open:i,onClose:l,setOpen:a,width:280},{children:e.jsx(Q,{value:ie(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),t()},onClose:l})}))},ue=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.options,u=r.setOpen,l=n.useState(r.value||""),c=l[0],s=l[1];return e.jsx(U,exports.__assign({open:i,onClose:function(){t()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(_,exports.__assign({isSelected:c===n.value,onClick:function(){return s(e=n.value),o(e),u(!1),void t();var e}},{children:n.label}),n.value)})}))}))},le=function(n){var r=n.enumOptions,t=void 0===r?[]:r,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,c=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(G,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(ae,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(ue,{onBlur:c,onChange:o,open:!0,options:t,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(J,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(K,{defaultValue:null==l?"":l+"",onBlur:c,onChange:o})},ce=0,se=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();0!==ce&&t>o-ce||(ce=o,n(r))}},de=function(e){var r=n.useRef(e);return n.useEffect(function(){JSON.stringify(r.current)!==JSON.stringify(e)&&(r.current=e)},[e]),r.current},fe=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(fe);var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=fe(e[r]));return n},ve=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},he=Date.now(),pe={screenX:0,screenY:0},we=function(e,n,r){void 0===r&&(r=[]);for(var t=0;e.length>t;t++){var o=e[t];if(o.accessor===n)return u(u([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=we(o.children,n,u(u([],r,!0),[t],!1));if(i)return i}}return null},me=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};var ge=function(e){var n=e.draggedHeaderRef,r=e.headers,t=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=E().setHeaders,l=de(r);return{handleDragStart:function(e){n.current=e,he=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),r&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,s=o.screenY,d=Math.sqrt(Math.pow(c-pe.screenX,2)+Math.pow(s-pe.screenY,2));t.current=a;var f,v=n.current,h=!1;if(me(v)!==me(a))f=(C=function(e,n,r){var t,o,i=fe(e),a=!1;try{var u=me(r),l=i.findIndex(function(e){return e.accessor===n.accessor}),c=i.findIndex(function(e){return e.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=exports.__assign({},s),"left"===t?o.pinned="left":"right"===t?o.pinned="right":delete o.pinned,o);i.splice(c,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}(r,v,a)).newHeaders,h=C.emergencyBreak;else{var p=r,w=we(p,v.accessor),m=we(p,a.accessor);if(!w||!m)return;var g=w.length,x=m.length,b=m;if(g!==x){var I=x-g;I>0&&(b=m.slice(0,-I))}var C=function(e,n,r){var t=fe(e),o=!1;function i(e,n){for(var r=e,t=0;n.length-1>t;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;n.length-1>i;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var u=i(t,n);return a(t,n,i(t,r)),a(t,r,u),{newHeaders:t,emergencyBreak:o}}(p,w,b);f=C.newHeaders,h=C.emergencyBreak}if(!(u||a.accessor===v.accessor||10>d||JSON.stringify(f)===JSON.stringify(r)||h)){var y=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>y-he||40>d)||(he=y,pe={screenX:c,screenY:s},i(f))}}},handleDragEnd:function(){n.current=null,t.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(r)},10)}}},xe=function(n){var r=n.checked,t=void 0!==r&&r,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:t,className:"st-checkbox-input",onChange:function(){i&&i(!t)},type:"checkbox"}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(t?"st-checked":"")},{children:t&&e.jsx(O,{className:"st-checkbox-checkmark"})})),o]}))},be=function(n){var r,t=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:t}):"lineAreaChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ee,exports.__assign({data:r},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ne,exports.__assign({data:r},o.chartOptions)):null:"boolean"==typeof t?t?"True":"False":Array.isArray(t)?0===t.length?"[]":t.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==t&&("string"==typeof t||"number"==typeof t||"object"==typeof t&&t instanceof Date)?oe(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):t},Ie=function(r){var t=r.borderClass,o=r.colIndex,i=r.displayRowNumber,a=r.header,u=r.isHighlighted,l=r.isInitialFocused,c=r.nestedIndex,s=r.parentHeader,d=r.rowIndex,f=r.tableRow,v=E(),p=v.cellRegistry,m=v.cellUpdateFlash,g=v.columnBorders,x=v.draggedHeaderRef,b=v.enableRowSelection,S=v.expandIcon,N=v.handleMouseDown,A=v.handleMouseOver,M=v.handleRowSelect,k=v.headers,H=v.hoveredHeaderRef,T=v.isCopyFlashing,F=v.isLoading,D=v.isRowSelected,O=v.isWarningFlashing,P=v.onCellEdit,L=v.onCellClick,B=v.onTableHeaderDragEnd,W=v.rowButtons,q=v.rowGrouping,z=v.rowIdAccessor,j=v.rowsWithSelectedCells,U=v.selectedColumns,_=v.setUnexpandedRows,G=v.tableBodyContainerRef,K=v.theme,J=v.unexpandedRows,V=v.useOddColumnBackground,X=f.depth,Y=f.row,$=n.useState(I(Y,a.accessor)),Q=$[0],ee=$[1],ne=n.useState(!1),re=ne[0],te=ne[1],oe=n.useState(!1),ie=oe[0],ae=oe[1],ue=n.useState(!1),ce=ue[0],de=ue[1],fe=n.useRef(null),ve=R({row:Y,rowIdAccessor:z}),he=q&&q[X],pe=!!he&&function(e,n){return!!n&&y(e[n])}(Y,he),we=!J.has(ve+""),me=T({rowIndex:d,colIndex:o,rowId:ve}),Ie=O({rowIndex:d,colIndex:o,rowId:ve}),Ce=n.useMemo(function(){var e,n,r;if(!g)return!1;var t=k.filter(function(e){return"left"===e.pinned}),o=k.filter(function(e){return!e.pinned}),i=k.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===a.accessor},[g,k,a.accessor,a.pinned]),ye=ge({draggedHeaderRef:x,headers:k,hoveredHeaderRef:H,onTableHeaderDragEnd:B}).handleDragOver,Re=se(),Se=h({accessor:a.accessor,rowId:ve}),Ne=w({rowId:ve,accessor:a.accessor}),Ae=a.isSelectionColumn&&b;n.useEffect(function(){if(p){var e="".concat(ve,"-").concat(a.accessor);return p.set(e,{updateContent:function(e){Q!==e?(ee(e),m&&(ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){ae(!1)},800))):ee(e)}}),function(){p.delete(e),fe.current&&clearTimeout(fe.current)}}},[p,m,ve,a.accessor,Q]),n.useEffect(function(){if(ie){var e=setTimeout(function(){ae(!1)},850);return function(){return clearTimeout(e)}}},[ie]),n.useEffect(function(){ee(I(Y,a.accessor))},[Y,a.accessor]);var Me="boolean"===a.type||"date"===a.type||"enum"===a.type,ke=!!(null==a?void 0:a.isEditable),Ee=U.has(o),He=u&&!Ee,Te=n.useMemo(function(){return!!Ae&&j.has(ve+"")},[Ae,j,ve]),Fe=null==s?void 0:s.singleRowChildren,De="st-cell ".concat(X>0&&a.expandable?"st-cell-depth-".concat(X):""," ").concat(He?l?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").concat(Ee?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(ke?"clickable":""," ").concat(ie?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Ie?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(V?c%2==0?"even-column":"odd-column":""," ").concat(Ae?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(Ce?"st-last-column":""," ").concat(Fe?"st-sub-cell":""),Oe=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),ee(e),C(Y,a.accessor,e),null==P||P({accessor:a.accessor,newValue:e,row:Y,rowIndex:d})},[a.accessor,a.type,P,Y,d]),Pe=n.useCallback(function(){_(function(e){var n=new Set(e),r=ve+"";return n.has(r)?n.delete(r):n.add(r),n})},[ve,_]);return F?e.jsx("div",exports.__assign({className:De},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!re||Me||Ae?e.jsxs(Z,exports.__assign({className:De,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ve,"data-row-index":d,id:Se,onClick:function(){L&&!Ae&&L({accessor:a.accessor,colIndex:o,row:Y,rowId:ve,rowIndex:d,value:Q})},onDoubleClick:function(){return a.isEditable&&!Ae&&te(!0)},onDragOver:function(e){Ae||Re({callback:ye,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){re||Ae||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||re||(e.preventDefault(),te(!0))},onMouseDown:function(){re||Ae||N({rowIndex:d,colIndex:o,rowId:ve})},onMouseEnter:function(){de(!0)},onMouseLeave:function(){de(!1)},onMouseOver:function(){re||Ae||A({rowIndex:d,colIndex:o,rowId:ve})},parentRef:G,tableRow:f},{children:[a.expandable&&pe?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:Pe},{children:S})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:F?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx("span",{children:Ae?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ce||D&&D(ve+"")?e.jsx(xe,{checked:!!D&&D(ve+""),onChange:function(e){M&&M(ve+"",e)}}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!W||!Ae||0===W.length)return null;if(!(ce||D&&D(ve+"")))return null;var n={row:Y};return e.jsx("div",exports.__assign({className:"st-row-buttons"},{children:W.map(function(r,t){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:r(n)}),t)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:o,row:Y,theme:K}):be({content:Q,header:a,colIndex:o,row:Y,rowIndex:d})})})),!F&&re&&Me&&!Ae&&e.jsx(le,{enumOptions:a.enumOptions,onChange:Oe,setIsEditing:te,type:a.type,value:Q})]}),Ne):e.jsx("div",exports.__assign({className:"st-cell-editing",id:h({accessor:a.accessor,rowId:ve}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(le,{enumOptions:a.enumOptions,onChange:Oe,setIsEditing:te,type:a.type,value:Q})}))},Ce=function(n){var r=n.columnIndexStart,t=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,c=n.tableRow,s=E(),d=s.rowIdAccessor,f=s.collapsedHeaders,v=o.filter(function(e){return p({header:e,pinned:i,headers:o,collapsedHeaders:f})});return e.jsx(e.Fragment,{children:v.map(function(n,s){var f=R({row:c.row,rowIdAccessor:d}),v=h({accessor:n.accessor,rowId:f});return e.jsx(ye,{columnIndices:t,displayRowNumber:u,header:n,headers:o,nestedIndex:s+(null!=r?r:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:c},v)})})},ye=function(r){var t=r.columnIndices,o=r.displayRowNumber,i=r.header,a=r.headers,u=r.nestedIndex,l=r.parentHeader,c=r.pinned,s=r.rowIndex,d=r.rowIndices,f=r.tableRow,v=t[i.accessor],w=E(),m=w.getBorderClass,g=w.isSelected,x=w.isInitialFocusedCell,b=w.collapsedHeaders,I=R({row:f.row,rowIdAccessor:w.rowIdAccessor});if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return p({header:e,pinned:c,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var y={rowIndex:s,colIndex:v,rowId:I},S=m(y),N=g(y),A=x(y),M=h({accessor:i.accessor,rowId:I});return e.jsxs(n.Fragment,{children:[e.jsx(Ie,{borderClass:S,colIndex:v,displayRowNumber:o,header:i,isHighlighted:N,isInitialFocused:A,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},M),C.map(function(n){var r=h({accessor:n.accessor,rowId:I});return e.jsx(ye,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},r)})]})}return e.jsx(n.Fragment,{children:C.map(function(n){var r=h({accessor:n.accessor,rowId:I});return e.jsx(ye,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},r)})})}var k={rowIndex:s,colIndex:v,rowId:I},H=m(k),T=g(k),F=x(k),D=h({accessor:i.accessor,rowId:I});return e.jsx(Ie,{borderClass:H,colIndex:v,displayRowNumber:o,header:i,isHighlighted:T,isInitialFocused:F,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},D)},Re=function(n){var r=n.columnIndices,t=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,c=n.rowIndices,s=n.setHoveredIndex,d=n.tableRow,f=E(),v=f.useHoverRowBackground,h=f.isAnimating,p=f.isRowSelected,w=f.useOddEvenRowBackground,m=d.position,g=d.displayPosition,x=m%2==0,b=R({row:d.row,rowIdAccessor:f.rowIdAccessor}),I=!!p&&p(b+"");return e.jsx("div",exports.__assign({className:"st-row ".concat(w?x?"even":"odd":""," ").concat(I?"selected":""),"data-index":a,onMouseEnter:function(){!h&&v&&s(a)},style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(j({position:m,rowHeight:l}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Ce,{columnIndexStart:t,columnIndices:r,displayRowNumber:g,headers:i,pinned:u,rowIndex:m,rowIndices:c,tableRow:d},b)}))},Se=function(r){var t=r.displayStrongBorder,o=r.position,i=r.rowHeight,a=r.templateColumns,u=n.useRef(null);return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,r=n.style.pointerEvents;n.style.pointerEvents="none";var t=document.elementFromPoint(e.clientX,e.clientY);if(n.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:e.clientX,clientY:i.top+i.height/2});o.dispatchEvent(a)}}},onMouseUp:function(e){if(u.current){var n=u.current.getBoundingClientRect(),r=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});u.current.dispatchEvent(r),u.current=null}},style:{gridTemplateColumns:a,transform:"translate3d(0, ".concat(z({position:o,rowHeight:i}),"px, 0)")}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},Ne=n.createContext(void 0),Ae=function(e){var r=e.childRef,t=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(Ne);if(!e)throw Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),u=a.registerPane,l=a.unregisterPane;return n.useEffect(function(){var e=[i];return r.current&&u(r.current,e),function(){r.current&&l(r.current,e)}},[r,u,l,i]),n.cloneElement(t,{ref:function(e){r.current=e}})},Me=n.forwardRef(function(r,t){var o=r.columnIndexStart,i=r.columnIndices,a=r.headers,u=r.pinned,l=r.rowHeight,c=r.rowIndices,s=r.setHoveredIndex,d=r.templateColumns,f=r.totalHeight,v=r.rowsToRender,h=r.width,p=u?"st-body-pinned-".concat(u):"st-body-main",w=E().rowIdAccessor,m=n.useRef(null);return n.useImperativeHandle(t,function(){return m.current},[]),n.useMemo(function(){return ve(a,u)},[a,u])?e.jsx(Ae,exports.__assign({childRef:m,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:p,ref:m,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:h},!u&&{flexGrow:1})},{children:v.map(function(r,t){var f=R({row:r.row,rowIdAccessor:w});return e.jsxs(n.Fragment,{children:[0!==t&&e.jsx(Se,{displayStrongBorder:r.isLastGroupRow,position:r.position,rowHeight:l,templateColumns:d,rowIndex:t-1}),e.jsx(Re,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:t,pinned:u,rowHeight:l,rowIndices:c,setHoveredIndex:s,tableRow:r},f)]},f)})}))})):null});function ke(e){var n=e.headers,r=e.pinnedLeftColumns,t=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],r,!0),n,!0),t,!0),c=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return p({header:e,headers:l,collapsedHeaders:o})}).forEach(function(n,r){c(n,!e.singleRowChildren&&0===r)})};return r.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&p({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n&&0===r.length)}),t.forEach(function(e){c(e,!1)}),i}Me.displayName="TableSection";var Ee=function(r){var t=r.mainTemplateColumns,o=r.pinnedLeftColumns,i=r.pinnedLeftTemplateColumns,a=r.pinnedLeftWidth,u=r.pinnedRightColumns,l=r.pinnedRightTemplateColumns,c=r.pinnedRightWidth,s=r.rowsToRender,d=r.setScrollTop,f=r.setScrollDirection,v=r.tableRows,h=E(),p=h.collapsedHeaders,w=h.headerContainerRef,m=h.headers,g=h.isAnimating,x=h.mainBodyRef,b=h.onLoadMore,I=h.rowHeight,C=h.rowIdAccessor,y=h.scrollbarWidth,S=h.setIsScrolling,N=h.shouldPaginate,A=h.tableBodyContainerRef,M=n.useState(!1),k=M[0],H=M[1],T=n.useRef(new Set),F=n.useCallback(function(e){T.current.forEach(function(e){return e.classList.remove("hovered")}),T.current.clear(),null!==e&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),T.current.add(e)})},[]);n.useEffect(function(){g&&F(null)},[g,F]),W({headerContainerRef:w,mainSectionRef:A,scrollbarWidth:y}),n.useEffect(function(){return function(){O.current&&clearTimeout(O.current)}},[]);var D=n.useRef(null),O=n.useRef(null),P=n.useRef(0),L=function(e){return e.length}(v),B=L*(I+1)-1,q=n.useMemo(function(){return ke({headers:m,pinnedLeftColumns:o,pinnedRightColumns:u,collapsedHeaders:p})},[m,o,u,p]),z=n.useMemo(function(){var e={};return s.forEach(function(n,r){var t=R({row:n.row,rowIdAccessor:C})+"";e[t]=r}),e},[s,C]),j=n.useCallback(function(e,n){!b||N||k||200>=e.scrollHeight-(n+e.clientHeight)&&n>P.current&&(H(!0),b(),setTimeout(function(){H(!1)},1e3))},[b,N,k]),U={columnIndices:q,headerContainerRef:w,headers:m,rowHeight:I,rowIndices:z,rowsToRender:s,setHoveredIndex:F};return e.jsxs("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,r=n.scrollTop;S(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(function(){S(!1)},150),D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){var e=P.current,t=r>e?"down":e>r?"up":"none";d(r),f(t),j(n,r),P.current=r})},ref:A},{children:[e.jsx(Me,exports.__assign({},U,{pinned:"left",templateColumns:i,totalHeight:B,width:a})),e.jsx(Me,exports.__assign({},U,{columnIndexStart:o.length,ref:x,templateColumns:t,totalHeight:B})),e.jsx(Me,exports.__assign({},U,{columnIndexStart:o.length+t.length,pinned:"right",templateColumns:l,totalHeight:B,width:c}))]}))},He=function(e){var n=e.event,r=e.header,t=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var s="clientX"in n?n.clientX:n.touches[0].clientX,d="touches"in n;if(r&&!r.hide){i(!0);var f,v=b(r);if(r.children&&r.children.length>0){var h=m(r,l);f=h.length>0?h:[r]}else f=[r];var p=function(e){var n="right"===r.pinned?s-e:e-s,i=function(e){var n=e.header,r=e.headers,t=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=i*c(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var u=a-r.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+m(n,t).reduce(function(e,n){return e+g(n)},0)},0),l=b(n);return l>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):u}({header:r,headers:t,collapsedHeaders:l});f.length>1?Te({delta:n,leafHeaders:f,minWidth:v,startWidth:a,maxWidth:i}):f[0].width=Math.max(Math.min(a+n,i),v),t.forEach(function(e){x(e)});var d=u([],t,!0);o(d)};if(d){var w=function(e){p(e.touches[0].clientX)},I=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",I),i(!1)};document.addEventListener("touchmove",w),document.addEventListener("touchend",I)}else{var C=function(e){p(e.clientX)},y=function(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",y),i(!1)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",y)}}},Te=function(e){var n=e.delta,r=e.leafHeaders,t=e.minWidth,o=e.startWidth,i=e.maxWidth,a=r.reduce(function(e,n){return Math.min(e,b(n))},40),u=r.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;r.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),t)})},Fe={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"},De=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Oe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Pe=function(e){return["between","notBetween","in","notIn"].includes(e)},Le=function(e){return["isEmpty","isNotEmpty"].includes(e)},Be=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},We=function(r){var t=r.value,o=r.onChange,i=r.options,a=r.placeholder,u=void 0===a?"Select...":a,l=r.className,c=void 0===l?"":l,s=r.disabled,d=void 0!==s&&s,f=n.useState(!1),v=f[0],h=f[1],p=n.useState(-1),w=p[0],m=p[1],g=n.useRef(null),x=i.find(function(e){return e.value===t});return n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),m(function(e){return i.length-1>e?e+1:0});break;case"ArrowUp":e.preventDefault(),m(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),0>w||(o(i[w].value),h(!1),m(-1));break;case"Escape":e.preventDefault(),h(!1),m(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,w,i,o]),e.jsxs("div",exports.__assign({ref:g,className:"st-custom-select ".concat(c," ").concat(d?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",exports.__assign({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!d)if(h(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===t});m(0>e?0:e)}},disabled:d,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",exports.__assign({className:"st-custom-select-value"},{children:x?x.label:u})),e.jsx(B,{})]})),e.jsx(U,exports.__assign({open:v,setOpen:h,onClose:function(){h(!1),m(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",exports.__assign({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,r){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===t?"st-custom-select-option-selected":""," ").concat(r===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===t,onClick:function(){return o(n.value),h(!1),void m(-1)}},{children:n.label}),r)})}))}))]}))},qe=function(n){var r=n.value,t=n.onChange,o=n.operators.map(function(e){return{value:e,label:Fe[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(We,{value:r,onChange:function(e){t(e)},options:o})}))},ze=function(n){var r=n.type,t=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===r?"text":r,value:n.value,onChange:function(e){return t(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&a&&a()},placeholder:n.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},je=function(n){var r=n.children,t=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===t?"":t).trim()},{children:r}))},Ue=function(n){var r=n.onClear,t=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!t,className:"st-filter-button st-filter-button-apply ".concat(t?"":"st-filter-button-disabled")},{children:"Apply"})),o&&r&&e.jsx("button",exports.__assign({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},_e=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],c=u[1],s=n.useState(((null==o?void 0:o.value)||"")+""),d=s[0],f=s[1],v=De("string");n.useEffect(function(){o?(c(o.operator),f((o.value||"")+"")):(c("contains"),f(""))},[o]);var h=function(){var e=exports.__assign({accessor:t.accessor,operator:l},Oe(l)&&{value:d});i(e)},p=Le(l)||d.trim();return e.jsxs(Be,{children:[e.jsx(qe,{value:l,onChange:c,operators:v}),Oe(l)&&e.jsx(je,{children:e.jsx(ze,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:h})}),e.jsx(Ue,{onApply:h,onClear:a,canApply:!!p,showClear:!!o})]})},Ge=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),s=c[0],d=c[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],h=f[1],p=n.useState(((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])||"")+""),w=p[0],m=p[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],I=De("number");n.useEffect(function(){var e,n;a?(d(a.operator),h((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),h(""),m(""),b(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:s};Oe(s)?e.value=parseFloat(v):Pe(s)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(Be,{children:[e.jsx(qe,{value:s,onChange:d,operators:I}),Oe(s)&&e.jsx(je,{children:e.jsx(ze,{type:"number",value:v,onChange:h,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Pe(s)&&e.jsxs(je,{children:[e.jsx(ze,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(ze,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(Ue,{onApply:C,onClear:l,canApply:!!Le(s)||(Oe(s)?""!==v.trim():!!Pe(s)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},Ke=function(n){var r=n.className;return e.jsx(We,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===r?"":r,placeholder:n.placeholder})},Je=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],c=u[1],s=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=s[0],f=s[1],v=De("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?o.value+"":"true")):(c("equals"),f("true"))},[o]);var h=Le(l)||""!==d;return e.jsxs(Be,{children:[e.jsx(qe,{value:l,onChange:c,operators:v}),Oe(l)&&e.jsx(je,{children:e.jsx(Ke,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Ue,{onApply:function(){var e={accessor:t.accessor,operator:l};Oe(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:h,showClear:!!o})]})},Ve=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),s=c[0],d=c[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],h=f[1],p=n.useState((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])?a.values[0]+"":""),w=p[0],m=p[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],I=De("date");n.useEffect(function(){var e,n;a?(d(a.operator),h((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),h(""),m(""),b(""))},[a]);var C=function(r){var t=r.value,o=r.onChange,i=r.placeholder,a=r.autoFocus,u=r.className,l=n.useState(!1),c=l[0],s=l[1],d=n.useState(""),f=d[0],v=d[1],h=n.useRef(null);n.useEffect(function(){if(t){var e=oe(t);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[t]),n.useEffect(function(){a&&h.current&&h.current.focus()},[a]);var p=t?oe(t):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:h,type:"text",value:f,placeholder:i,onClick:function(){s(!c)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),s(!c)):"Escape"===e.key&&s(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(U,exports.__assign({open:c,setOpen:s,onClose:function(){s(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(Q,{value:p,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),s(!1)},onClose:function(){return s(!1)}})}))]}))};return e.jsxs(Be,{children:[e.jsx(qe,{value:s,onChange:d,operators:I}),Oe(s)&&e.jsx(je,{children:e.jsx(C,{value:v,onChange:h,placeholder:"Select date...",autoFocus:!0})}),Pe(s)&&e.jsxs(je,{children:[e.jsx(C,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(C,{value:x,onChange:b,placeholder:"To date..."})]}),e.jsx(Ue,{onApply:function(){var e={accessor:i.accessor,operator:s};Oe(s)?e.value=v:Pe(s)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!Le(s)||(Oe(s)?""!==v.trim():!!Pe(s)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},Xe=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,l=n.useMemo(function(){return t.enumOptions||[]},[t.enumOptions]),c=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),s=n.useState((null==o?void 0:o.values)?o.values.map(String):c),d=s[0],f=s[1],v=n.useState(""),h=v[0],p=v[1],w=n.useMemo(function(){if(!h)return l;var e=h.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,h]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:c)},[o,c]);var m=l.length>10;return e.jsxs(Be,{children:[e.jsx(je,{children:e.jsxs("div",exports.__assign({className:"st-enum-filter-options"},{children:[e.jsx("div",exports.__assign({className:"st-enum-select-all"},{children:e.jsx(xe,exports.__assign({checked:d.length===c.length,onChange:function(e){f(e?c:[])}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),m&&e.jsx("div",exports.__assign({className:"st-enum-search"},{children:e.jsx(ze,{type:"text",value:h,onChange:p,placeholder:"Search..."})})),w.map(function(n,r){return e.jsx(xe,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),r)}),h&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(Ue,{onApply:function(){d.length!==c.length?i({accessor:t.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==c.length,showClear:!!o})]})},Ye=function(n){var r=n.header,t=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(r.type){case"number":return e.jsx(Ge,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Je,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Ve,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(Xe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});default:return e.jsx(_e,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i})}}()})},$e=function(r){var t=r.content,o=r.children,i=r.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],c=u[1],s=n.useState({top:0,left:0}),d=s[0],f=s[1],v=n.useRef(null),h=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!t||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var p=n.cloneElement(o,{ref:h,onMouseEnter:function(){v.current=setTimeout(function(){if(h.current&&t.trim()){var e=h.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,r=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),r+40>window.innerHeight-8&&(r=e.top-40-8),f({top:r,left:n}),c(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),c(!1)}});return e.jsxs(e.Fragment,{children:[p,l&&e.jsx("div",exports.__assign({className:"st-tooltip",style:{position:"fixed",top:"".concat(d.top,"px"),left:"".concat(d.left,"px"),zIndex:1e4}},{children:t}))]})},Ze=function(r){var t,o,i=r.colIndex,a=r.gridColumnEnd,l=r.gridColumnStart,c=r.gridRowEnd,f=r.gridRowStart,v=r.header,p=r.parentHeader,w=r.reverse,m=r.sort,g=n.useState(!1),x=g[0],b=g[1],I=n.useState(!1),C=I[0],y=I[1],R=n.useState(v.label||""),S=R[0],N=R[1],A=E(),M=A.activeHeaderDropdown,k=A.areAllRowsSelected,H=A.collapsedHeaders,T=A.columnBorders,F=A.columnReordering,D=A.columnResizing,O=A.columnsWithSelectedCells,P=A.draggedHeaderRef,L=A.enableHeaderEditing,B=A.filterIcon,W=A.handleApplyFilter,q=A.handleClearFilter,z=A.handleSelectAll,j=A.headerCollapseIcon,_=A.headerDropdown,G=A.headerExpandIcon,J=A.headerRegistry,V=A.headers,X=A.hoveredHeaderRef,Y=A.onColumnOrderChange,$=A.onColumnSelect,Q=A.onHeaderEdit,ee=A.onSort,ne=A.onTableHeaderDragEnd,re=A.headerHeight,te=A.selectColumns,oe=A.selectableColumns,ie=A.selectedColumns,ae=A.setActiveHeaderDropdown,ue=A.setCollapsedHeaders,le=A.setHeaders,ce=A.setInitialFocusedCell,de=A.setIsResizing,fe=A.setSelectedCells,ve=A.setSelectedColumns,he=A.sortDownIcon,pe=A.sortUpIcon,we=!!(null==v?void 0:v.isSortable),me=!!(null==v?void 0:v.filterable),be=A.filters[v.accessor],Ie=(null==M?void 0:M.accessor)===v.accessor,Ce=v.isSelectionColumn&&A.enableRowSelection,ye=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(v),Re=H.has(v.accessor),Se=function(e){var r=e.isOpen,t=e.estimatedHeight,o=void 0===t?200:t,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,c=n.useRef(null),s=n.useState({}),d=s[0],f=s[1];return n.useEffect(function(){if(r&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,r=window.innerWidth-e.right,t="bottom",i={};o>n&&e.top>=o&&(t="top");var u="left";a>r+e.width&&(u="right"),"bottom"===t?i.top=e.bottom+l:i.bottom=window.innerHeight-e.top+l,"left"===u?i.left=e.left:i.right=window.innerWidth-e.right,f(i)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},t=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",t,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",t,!0)}}f({})},[r,o,a,l]),{triggerRef:c,position:d}}({isOpen:Ie,estimatedHeight:200,estimatedWidth:250,margin:4}),Ne=Se.triggerRef,Ae=Se.position,Me=n.useMemo(function(){var e,n,r;if(!T)return!1;var t=V.filter(function(e){return"left"===e.pinned}),o=V.filter(function(e){return!e.pinned}),i=V.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===v.accessor},[T,V,v.accessor,v.pinned]),ke=n.useMemo(function(){return!(!oe||Ce)&&d(v,i).some(function(e){return ie.has(e)})},[oe,Ce,v,i,ie]),Ee=n.useMemo(function(){return!Ce&&d(v,i).some(function(e){return O.has(e)})},[Ce,v,i,O]),Te=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!Re||v.children.some(function(e){var n=e.showWhen||s;return"parentCollapsed"===n||"always"===n}))},[v.children,Re]),Fe=null==p?void 0:p.singleRowChildren,De=Te&&!v.singleRowChildren,Oe="st-header-cell ".concat(v.accessor===(null===(t=X.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(o=P.current)||void 0===o?void 0:o.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(F&&!we?"columnReordering":""," ").concat(De?"parent":""," ").concat(Fe?"st-sub-header":""," ").concat(Me?"st-last-column":""," ").concat(L&&!Ce?"st-header-editable":""," ").concat(ke?"st-header-selected":""," ").concat(Ee&&!ke?"st-header-has-highlighted-cell":""),Pe=ge({draggedHeaderRef:P,headers:V,hoveredHeaderRef:X,onColumnOrderChange:Y,onTableHeaderDragEnd:ne}),Le=Pe.handleDragStart,Be=Pe.handleDragEnd,We=Pe.handleDragOver,qe=se();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=v.accessor+"";return J.set(e,{setEditing:function(e){y(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){N(v.label||"")},[v.label]);var ze=n.useCallback(function(e){N(e);var n=V.map(function(n){return n.accessor===v.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});le(n),Q&&Q(v,e)},[V,le,Q,v]),je=n.useCallback(function(){ae&&ae(null)},[ae]),Ue=n.useCallback(function(e){e.stopPropagation(),ue(function(e){var n=new Set(e);return Re?n.delete(v.accessor):n.add(v.accessor),n})},[ue,Re,v.accessor]),_e=function(e){var n=e.event,r=e.header;if(!r.isSelectionColumn){if(oe){var t=d(r,i),o=t.some(function(e){return ie.has(e)});if(L&&o&&!n.shiftKey)return _&&Ie&&je(),void y(!0);n.shiftKey&&te?ve(function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort(function(e,n){return e-n}),o=r[0],i=Math.abs(n-o);r.forEach(function(e){var r=Math.abs(n-e);i>r&&(i=r,o=e)});var a,l,c,s=u(u([],(c=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-c+1},function(e,n){return c+n})),!0),t,!0);return new Set(u(u([],Array.from(e),!0),s,!0))}):te&&te(t),fe(new Set),ce(null)}$&&$(r),!oe&&r.isSortable&&ee(r.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!v)return null;var Ge=D&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,r=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;qe({callback:He,callbackProps:{event:e.nativeEvent,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:le,setIsResizing:de,startWidth:r,collapsedHeaders:H},limit:10})},onTouchStart:function(e){var n,r=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;qe({callback:He,callbackProps:{event:e,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:le,setIsResizing:de,startWidth:r,collapsedHeaders:H},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ke=m&&m.key.accessor===v.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return _e({event:e,header:v})}},{children:["ascending"===m.direction&&pe&&pe,"descending"===m.direction&&he&&he]})),Je=me&&B&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){e.stopPropagation(),b(!x)}},{children:[n.cloneElement(B,{style:{fill:be?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(U,exports.__assign({open:x,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(Ye,{header:v,currentFilter:be,onApplyFilter:function(e){W(e),b(!1)},onClearFilter:function(){q(v.accessor),b(!1)}})}))]})),Ve=ye&&!Ce&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:Ue},{children:Re?j:G}));return e.jsxs(Z,exports.__assign({className:Oe,id:h({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){Ce||qe({callback:We,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:exports.__assign({gridRowStart:f,gridRowEnd:c,gridColumnStart:l,gridColumnEnd:a},c-f>1?{}:{height:re})},{children:[w&&Ge,"right"===v.align&&Ve,"right"===v.align&&Je,"right"===v.align&&Ke,e.jsx("div",exports.__assign({ref:Ne,className:"st-header-label",draggable:F&&!v.disableReorder&&!Ce,onClick:function(e){Ce||_e({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){var n=e.header;n.isSelectionColumn||oe&&n.isSortable&&ee(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),Be()},onDragStart:Ce?void 0:function(e){F&&v&&function(e){Le(e)}(v)}},{children:e.jsx($e,exports.__assign({content:v.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(xe,{checked:!!k&&k(),onChange:function(e){z&&z(e)}}):C?e.jsx(K,{defaultValue:S,onBlur:function(){return y(!1)},onChange:ze}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:i,header:v}):S||(null==v?void 0:v.label)}))}))})),"right"!==v.align&&Ke,"right"!==v.align&&Je,"right"!==v.align&&Ve,!w&&Ge,_&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:_({accessor:v.accessor,colIndex:i,header:v,isOpen:Ie,onClose:je,position:Ae})}))]}))},Qe=function(r){var t=r.columnIndices,o=r.gridTemplateColumns,i=r.handleScroll,a=r.headers,u=r.maxDepth,l=r.pinned,c=r.sectionRef,s=r.sort,d=r.width,f=E().collapsedHeaders,v=n.useMemo(function(){var e=[],n=1,r=function(o,i,c,s){var d,v;if(void 0===c&&(c=!1),!p({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;c||n++;var h,w,m=null!==(v=null===(d=o.children)||void 0===d?void 0:d.filter(function(e){return p({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==v?v:0,g=n;if(o.singleRowChildren&&m>0?(h=g+1,w=u+1):m>0?(h=g+m,w=i+1):(h=g+1,w=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:h,gridRowStart:i,gridRowEnd:w,colIndex:t[o.accessor],parentHeader:s}),o.children&&o.children.length>0){var x=o.singleRowChildren?i:i+1,b=!o.singleRowChildren;o.children.forEach(function(e){p({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(r(e,x,b,o),b=!1)})}return h-g},o=a.filter(function(e){return p({header:e,pinned:l,headers:a,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){r(e,1,i),i=!1}),e},[a,u,l,t,f]);return e.jsx(Ae,exports.__assign({childRef:c,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:"st-header-".concat(l?"pinned-".concat(l):"main")},i&&{onScroll:i},{ref:c,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(Ze,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:s},n.header.accessor)})})}))}))},en=function(e){var n,r;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(r=e.children)||void 0===r?void 0:r.length)?1+Math.max.apply(Math,e.children.map(en)):1},nn=function(r){var t=r.centerHeaderRef,o=r.headers,i=r.mainTemplateColumns,a=r.pinnedLeftColumns,l=r.pinnedLeftTemplateColumns,c=r.pinnedRightColumns,s=r.pinnedRightTemplateColumns,d=r.sort,f=r.pinnedLeftWidth,v=r.pinnedRightWidth,h=E(),w=h.headerContainerRef,m=h.pinnedLeftRef,g=h.pinnedRightRef,x=h.collapsedHeaders,b=n.useMemo(function(){return ke({headers:o,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:x})},[o,a,c,x]),I=n.useMemo(function(){var e=0,n=u(u(u([],a,!0),o,!0),c,!0);return o.forEach(function(r){if(p({header:r,headers:n,collapsedHeaders:x})){var t=en(r);e=Math.max(e,t)}}),{maxDepth:e}},[o,a,c,x]).maxDepth;return e.jsxs("div",exports.__assign({className:"st-header-container",ref:w},{children:[ve(o,"left")&&e.jsx(Qe,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headers:o,maxDepth:I,pinned:"left",sectionRef:m,sort:d,width:f}),e.jsx(Qe,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:I,sectionRef:t,sort:d}),ve(o,"right")&&e.jsx(Qe,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:I,pinned:"right",sectionRef:g,sort:d,width:v})]}))},rn=function(e){var n=e.collapsedHeaders,r=function(e){var t=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||s;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&t.push(e),o.length>0?r({headers:o,flattenedHeaders:t}):e.singleRowChildren||t.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||s;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&t.push(e),r({headers:i,flattenedHeaders:t})}else t.push(e)}),t},t=r({headers:e.headers,flattenedHeaders:[]});return"".concat(t.map(function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)}).join(" "))},tn=function(r){var t=r.pinnedLeftWidth,o=r.pinnedRightWidth,i=r.setScrollTop,a=r.setScrollDirection,u=r.sort,l=r.tableRows,c=r.rowsToRender,s=E(),d=s.columnResizing,f=s.editColumns,v=s.headers,h=s.collapsedHeaders,p=n.useRef(null),w=v.filter(function(e){return!e.pinned}),m=v.filter(function(e){return"left"===e.pinned}),g=v.filter(function(e){return"right"===e.pinned}),x=n.useMemo(function(){return rn({headers:m,collapsedHeaders:h})},[m,h]),b=n.useMemo(function(){return rn({headers:w,collapsedHeaders:h})},[w,h]),I=n.useMemo(function(){return rn({headers:g,collapsedHeaders:h})},[g,h]),C={centerHeaderRef:p,headers:v,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedRightColumns:g,pinnedRightTemplateColumns:I,sort:u,pinnedLeftWidth:t,pinnedRightWidth:o},y={tableRows:l,mainTemplateColumns:b,pinnedLeftColumns:m,pinnedLeftTemplateColumns:x,pinnedLeftWidth:t,pinnedRightColumns:g,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:i,setScrollDirection:a,rowsToRender:c};return e.jsxs("div",exports.__assign({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(nn,exports.__assign({},C)),e.jsx(Ee,exports.__assign({},y))]}))},on=function(r){var t=r.mainBodyWidth,o=r.mainBodyRef,i=r.pinnedLeftWidth,a=r.pinnedRightWidth,u=r.pinnedLeftContentWidth,l=r.pinnedRightContentWidth,c=r.tableBodyContainerRef,s=E().editColumns,d=n.useState(!1),f=d[0],v=d[1],h=n.useRef(null),p=n.useRef(null),w=n.useRef(null),m=s?28:0,g=(s?a+1:a)+(c.current&&c.current&&c.current.scrollHeight>c.current.clientHeight?c.current.offsetWidth-c.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){o.current&&v(t>o.current.clientWidth)},1)},[o,t]),f?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(Ae,exports.__assign({childRef:p,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:p,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),t>0&&e.jsx(Ae,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:t}})}))})),a>0&&e.jsx(Ae,exports.__assign({childRef:w,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:w,style:{width:g}},{children:e.jsx("div",{style:{width:l}})}))})),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},an={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return an.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?an.string(e,n,r):"number"==typeof e&&"number"==typeof n?an.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?an.boolean(e,n,r):an.string(e+"",n+"",r)}},un=function(e){return function(e){var n=e.rows,r=e.sortColumn,t=function(e,n){for(var r=0,o=e;o.length>r;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children,n);if(a)return a}}},o=t(e.headers,r.key.accessor),i=(null==o?void 0:o.type)||"string",a=r.direction;return u([],n,!0).sort(function(e,n){var t=r.key.accessor;return function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=e+"";if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return an.number(i,a,t)}return"date"===r?an.date(e+"",n+"",t):"boolean"===r?an.boolean(!!e,!!n,t):"enum"===r?an.enum(e+"",n+"",t):an.string(e+"",n+"",t)}(I(e,t),I(n,t),i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},ln=function(e){var n=e.tableRows,r=e.sortColumn,t=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:r?t&&t.length>0?(0,e.sortNestedRows)({groupingKeys:t,headers:o,rows:n,sortColumn:r}):un({headers:o,rows:n,sortColumn:r}):n},cn=function(e,n,r){void 0===r&&(r=new Set);for(var t=0,o=e;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(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,c=i.children;c.length>l;l++){var s=c[l];if(cn([s],n,r),!1===s.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},sn=function(e){return e.every(function(e){return e.hide})},dn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(dn(e.children),sn(e.children)&&(e.hide=!0))})},fn=function(r){var t=r.allHeaders,o=r.depth,i=void 0===o?0:o,a=r.doesAnyHeaderHaveChildren,l=r.header,c=r.isCheckedOverride,s=n.useState(!0),d=s[0],f=s[1],v=E(),h=v.expandIcon,p=v.headers,w=v.setHeaders,m=a?"".concat(16*i,"px"):"8px",g=l.children&&l.children.length>0,x=null!=c?c:l.hide||g&&l.children&&sn(l.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:m}},{children:[a&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:g?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(d?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!d)}},{children:h})):null})),e.jsx(xe,exports.__assign({checked:x,onChange:function(e){l.hide=e,e?dn(t):(cn(t,l.accessor),g&&l.children&&l.children.length>0&&l.children.every(function(e){return!0===e.hide})&&l.children[0]&&(l.children[0].hide=!1,cn(t,l.children[0].accessor))),w(u([],p,!0))}},{children:l.label}))]})),g&&d&&l.children&&e.jsx("div",exports.__assign({className:"st-nested-headers"},{children:l.children.map(function(n,r){return e.jsx(fn,{allHeaders:t,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!x||void 0},"".concat(n.accessor,"-").concat(r))})}))]})},vn=function(r){var t=r.headers,o=r.open,i="left"===r.position?"left":"",a=n.useMemo(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e.jsx(fn,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},hn=function(r){var t=r.columnEditorText,o=r.editColumns,i=r.headers,a=r.position,u=void 0===a?"right":a,l=n.useState(r.editColumnsInitOpen),c=l[0],s=l[1];return o?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(c?"open":""," ").concat(u),onClick:function(){return function(e){s(e)}(!c)},style:{width:28}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:t})),e.jsx(vn,{headers:i,open:c,position:u})]})):null},pn=function(r){var o=r.children,i=n.useRef({}),a=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),u=n.useCallback(function(e,n){e.scrollWidth-e.clientWidth>0&&(n.scrollLeft=e.scrollLeft)},[]),l=n.useCallback(function(e){e.onscroll=null},[]),c=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var r;null===(r=i.current[n])||void 0===r||r.forEach(function(n){e!==n&&(l(n),u(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});c(n,e)}))})})})}},[l,u]),s=n.useCallback(function(e,n){n.forEach(function(n){i.current[n]||(i.current[n]=[]),a(e,n)||(i.current[n].length>0&&u(i.current[n][0],e),i.current[n].push(e))}),c(e,n)},[a,u,c]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var r=i.current[n].indexOf(e);-1!==r&&i.current[n].splice(r,1)}})},[a,l]);return e.jsx(Ne.Provider,exports.__assign({value:{registerPane:s,unregisterPane:d}},{children:t.default.Children.only(o)}))},wn=function(e){var n=e.tableRows,r=e.filterState;return e.externalFilterHandling?n:r&&0!==Object.keys(r).length?n.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var r=n.operator,t=n.value,o=n.values;if(null==e)return"isEmpty"===r;if("isEmpty"===r)return!e||""===(e+"").trim();if("isNotEmpty"===r)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===r||"notContains"===r||"startsWith"===r||"endsWith"===r){var i=(e+"").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 e||!isNaN(+e)){var u=+e,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(e instanceof Date||!isNaN(Date.parse(e))){var f=oe(e),v=oe((t||"")+""),h=te(f),p=te(v);switch(r){case"equals":return h.getTime()===p.getTime();case"notEquals":return h.getTime()!==p.getTime();case"before":return p>h;case"after":return h>p;case"between":if(o&&2===o.length){var w=o.map(function(e){return te(oe((e||"")+""))}),m=w[1];return h>=w[0]&&m>=h}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(e){return te(oe((e||"")+""))});return m=g[1],g[0]>h||h>m}return!0}}if("boolean"==typeof e&&"equals"===r)return e===!!t;if(Array.isArray(e)){var x=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", ");e=x}if("in"===r||"notIn"===r){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===r?b:!b}return!1}var I=(e+"").toLowerCase(),C=t?(t+"").toLowerCase():"";switch(r){case"equals":return I===C;case"notEquals":return I!==C;default:return!0}}(I(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},mn=function(e,n,r,t){var o=[],i=function(e){e.forEach(function(e){var r=t?e[t]:void 0;if(t&&r&&y(r))i(r);else{var a=I(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===r.type&&r.customFn)return r.customFn(o);var a,u=r.parseValue?o.map(r.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===r.type?o.length:void 0;switch(r.type){case"sum":a=u.reduce(function(e,n){return e+n},0);break;case"average":a=u.reduce(function(e,n){return e+n},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}},gn=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var r=n.replace(/"/g,'""');return'"'.concat(r,'"')}return n},xn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},bn={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}},In=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},Cn=function(e,n,r,t){return void 0===r&&(r={}),new Promise(function(t){e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){In(e),e.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},yn=function(r){var t=r.allowAnimations,o=void 0!==t&&t,s=r.cellUpdateFlash,d=void 0!==s&&s,h=r.className,p=r.columnBorders,x=void 0!==p&&p,b=r.columnEditorPosition,S=void 0===b?"right":b,M=r.columnEditorText,E=void 0===M?"Columns":M,O=r.columnReordering,B=void 0!==O&&O,z=r.columnResizing,j=void 0!==z&&z,U=r.defaultHeaders,_=r.editColumns,G=void 0!==_&&_,K=r.editColumnsInitOpen,J=void 0!==K&&K,V=r.enableHeaderEditing,X=void 0!==V&&V,Y=r.enableRowSelection,$=void 0!==Y&&Y,Z=r.expandAll,Q=void 0===Z||Z,ee=r.expandIcon,ne=void 0===ee?e.jsx(F,{className:"st-expand-icon"}):ee,re=r.externalFilterHandling,te=void 0!==re&&re,oe=r.externalSortHandling,ie=void 0!==oe&&oe,ae=r.filterIcon,ue=void 0===ae?e.jsx(L,{className:"st-header-icon"}):ae,le=r.footerRenderer,ce=r.headerCollapseIcon,se=void 0===ce?e.jsx(F,{className:"st-header-icon"}):ce,fe=r.headerExpandIcon,ve=void 0===fe?e.jsx(T,{className:"st-header-icon"}):fe,he=r.headerDropdown,pe=r.headerHeight,we=r.height,me=r.hideFooter,ge=void 0!==me&&me,xe=r.isLoading,be=void 0!==xe&&xe,Ie=r.nextIcon,Ce=void 0===Ie?e.jsx(F,{className:"st-next-prev-icon"}):Ie,ye=r.onCellEdit,Re=r.onCellClick,Se=r.onColumnOrderChange,Ne=r.onColumnSelect,Ae=r.onFilterChange,Me=r.onGridReady,ke=r.onHeaderEdit,Ee=r.onLoadMore,He=r.onNextPage,Te=r.onPageChange,Fe=r.onRowSelectionChange,De=r.onSortChange,Oe=r.prevIcon,Pe=void 0===Oe?e.jsx(T,{className:"st-next-prev-icon"}):Oe,Le=r.rowButtons,Be=r.rowGrouping,We=r.rowHeight,qe=void 0===We?32:We,ze=r.rowIdAccessor,je=r.rows,Ue=r.selectionColumnWidth,_e=void 0===Ue?42:Ue,Ge=r.rowsPerPage,Ke=void 0===Ge?10:Ge,Je=r.selectableCells,Ve=void 0!==Je&&Je,Xe=r.selectableColumns,Ye=void 0!==Xe&&Xe,$e=r.serverSidePagination,Ze=void 0!==$e&&$e,Qe=r.shouldPaginate,en=void 0!==Qe&&Qe,nn=r.sortDownIcon,rn=void 0===nn?e.jsx(P,{className:"st-header-icon"}):nn,an=r.sortUpIcon,cn=void 0===an?e.jsx(D,{className:"st-header-icon"}):an,sn=r.tableRef,dn=r.theme,fn=void 0===dn?"light":dn,vn=r.totalRowCount,xn=r.useHoverRowBackground,In=void 0===xn||xn,Cn=r.useOddEvenRowBackground,yn=void 0!==Cn&&Cn,Rn=r.useOddColumnBackground,Sn=void 0!==Rn&&Rn;Sn&&(yn=!1),x&&(In=!1);var Nn=n.useRef(null),An=n.useRef(null),Mn=n.useRef(null),kn=n.useRef(null),En=n.useRef(null),Hn=n.useRef(null),Tn=n.useRef(null),Fn=function(e){var r=e.tableBodyContainerRef,t=n.useState(0),o=t[0],i=t[1];return n.useLayoutEffect(function(){r.current&&i(r.current.offsetWidth-r.current.clientWidth)},[r]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:r}}({tableBodyContainerRef:Hn}),Dn=Fn.scrollbarWidth,On=Fn.setScrollbarWidth,Pn=W({headerContainerRef:Tn,mainSectionRef:Hn,scrollbarWidth:Dn}).isMainSectionScrollable,Ln=n.useMemo(function(){if(be&&0===je.length){var e=en?Ke:10;Pn&&(e+=1);var n=Array.from({length:e},function(e,n){var r;return(r={})[ze]="loading-".concat(n),r});return n}return je},[be,je,ze,Ke,Pn,en]),Bn=n.useReducer(function(e){return e+1},0)[1],Wn=n.useState(1),qn=Wn[0],zn=Wn[1],jn=n.useState(U),Un=jn[0],_n=jn[1],Gn=n.useState(!1),Kn=Gn[0],Jn=Gn[1],Vn=n.useState(!1),Xn=Vn[0],Yn=Vn[1],$n=n.useState(null),Zn=$n[0],Qn=$n[1],er=n.useState(new Set),nr=er[0],rr=er[1];n.useEffect(function(){_n(U)},[U]);var tr=function(e){var r=e.rows,t=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,u=n.useState(new Set),l=u[0],c=u[1],s=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,r){return 0!==e.length&&e.every(function(e){return r.has(e[n]+"")})}(r,t,l)},[r,t,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),v=n.useMemo(function(){return a?function(e,n,r){return e.filter(function(e){return r.has(e[n]+"")})}(r,t,l):[]},[r,t,l,a]),h=n.useCallback(function(e,n){if(a){var i=function(e,n){var r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r}(e,l);if(c(i),o){var u=r.find(function(n){return n[t]+""===e});u&&o({row:u,isSelected:n,selectedRows:i})}}},[l,r,t,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return e[n]+""}))}(r,t),o&&r.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=r.find(function(n){return n[t]+""===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[r,t,o,l,a]),w=n.useCallback(function(e){if(a){var n=s(e);h(e,!n)}},[s,h,a]),m=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=r.find(function(e){return e[t]+""===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,r,t,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:s,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:v,handleRowSelect:h,handleSelectAll:p,handleToggleRow:w,clearSelection:m}}({rows:Ln,rowIdAccessor:ze,onRowSelectionChange:Fe,enableRowSelection:$}),or=tr.selectedRows,ir=tr.setSelectedRows,ar=tr.isRowSelected,ur=tr.areAllRowsSelected,lr=tr.selectedRowCount,cr=tr.selectedRowsData,sr=tr.handleRowSelect,dr=tr.handleSelectAll,fr=tr.handleToggleRow,vr=tr.clearSelection,hr=n.useMemo(function(){var e,n=u([],Un,!0);return $&&!(null===(e=null==Un?void 0:Un[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:_e,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[$,Un,_e]),pr=n.useState(0),wr=pr[0],mr=pr[1],gr=n.useState("none"),xr=gr[0],br=gr[1],Ir=n.useState(new Set),Cr=Ir[0],yr=Ir[1],Rr=n.useState(0),Sr=Rr[0],Nr=Rr[1];n.useLayoutEffect(function(){var e=function(){Hn.current&&Nr(Hn.current.clientWidth)};e();var n=null;return Hn.current&&(n=new ResizeObserver(e)).observe(Hn.current),function(){n&&n.disconnect()}},[]);var Ar=n.useMemo(function(){var e=c(window.innerWidth),n=function(e){var n=e.containerWidth,r=e.maxPinnedWidthPercent,t=void 0===r?.8:r,o=e.collapsedHeaders,i=0,a=0,u=0;e.headers.forEach(function(e){if(!e.hide){var n=m(e,o).reduce(function(e,n){return e+g(n)},0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:u+=n}});var l=i,c=a;if(n&&n>0){var s=n*t;i>s&&(i=s),a>s&&(a=s)}return{leftWidth:v(i),rightWidth:v(a),mainWidth:u,leftContentWidth:l,rightContentWidth:c}}({headers:hr,containerWidth:Sr,maxPinnedWidthPercent:e,collapsedHeaders:nr});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[hr,Sr,nr]),Mr=Ar.mainBodyWidth,kr=Ar.pinnedLeftWidth,Er=Ar.pinnedRightWidth,Hr=Ar.pinnedLeftContentWidth,Tr=Ar.pinnedRightContentWidth,Fr=function(e){var r=e.height,t=e.rowHeight,o=e.shouldPaginate,i=e.rowsPerPage;return n.useMemo(function(){var e;if(!r&&o&&i)return t*(i+1);if(!r)return window.innerHeight-t;var n,a=document.querySelector(".simple-table-root");return n="string"==typeof r?r.endsWith("px")?parseInt(r,10):r.endsWith("vh")?window.innerHeight*parseInt(r,10)/100:r.endsWith("%")?((null===(e=null==a?void 0:a.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*parseInt(r,10)/100:window.innerHeight:r,Math.max(0,n-t)},[r,t,o,i])}({height:we,rowHeight:qe,shouldPaginate:en,rowsPerPage:Ke}),Dr=function(e){var r=e.rows,t=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return r;var e=function(e){return f(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return r;var n=JSON.parse(JSON.stringify(r)),i=function(n,r){return void 0===r&&(r=0),n.map(function(n){var t=o[r],a=o[r+1],u=n[t];if(u&&y(u)){var l=i(u,r+1),c=exports.__assign({},n);return c[t]=l,e.forEach(function(e){var n=mn(l,e.accessor,e.aggregation,a);void 0!==n&&C(c,e.accessor,n)}),c}return n})};return i(n)},[r,t,o])}({rows:Ln,headers:Un,rowGrouping:Be}),Or=function(e){var r=e.rows,t=e.externalFilterHandling,o=e.onFilterChange,i=n.useState({}),a=i[0],u=i[1],l=n.useMemo(function(){return wn({externalFilterHandling:t,tableRows:r,filterState:a})},[r,a,t]),c=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},a),((n={})[e.accessor]=e,n));u(r),null==o||o(r)},[a,o]),s=n.useCallback(function(e){var n=exports.__assign({},a);delete n[e],u(n),null==o||o(n)},[a,o]),d=n.useCallback(function(){u({}),null==o||o({})},[o]),f=n.useCallback(function(e){var n,o=exports.__assign(exports.__assign({},a),((n={})[e.accessor]=e,n));return wn({externalFilterHandling:t,tableRows:r,filterState:o})},[a,r,t]);return{filteredRows:l,updateFilter:c,clearFilter:s,clearAllFilters:d,filters:a,computeFilteredRowsPreview:f}}({rows:Dr,externalFilterHandling:te,onFilterChange:Ae}),Pr=Or.filters,Lr=Or.updateFilter,Br=Or.clearFilter,Wr=Or.clearAllFilters,qr=Or.computeFilteredRowsPreview,zr=function(e){var r=e.headers,t=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=n.useState(null),l=u[0],c=u[1],s=n.useCallback(function(e){var n=e.groupingKeys,r=e.headers,t=e.sortColumn,o=un({headers:r,rows:e.rows,sortColumn:t});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(y(a)){var u=s({rows:a,sortColumn:t,headers:r,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),d=n.useMemo(function(){return ln({externalSortHandling:o,tableRows:t,sortColumn:l,rowGrouping:a,headers:r,sortNestedRows:s})},[t,l,r,o,a,s]),f=n.useCallback(function(e){var n=function(r){for(var t=0,o=r;o.length>t;t++){var i=o[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},t=n(r);if(t){var o=null;l&&l.key.accessor===e?"ascending"===l.direction&&(o={key:t,direction:"descending"}):o={key:t,direction:"ascending"},c(o),null==i||i(o)}},[l,r,i]),v=n.useCallback(function(e){var n=function(r){for(var t=0,o=r;o.length>t;t++){var i=o[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(r);if(!i)return t;var u=null;return l&&l.key.accessor===e?"ascending"===l.direction&&(u={key:i,direction:"descending"}):u={key:i,direction:"ascending"},ln({externalSortHandling:o,tableRows:t,sortColumn:u,rowGrouping:a,headers:r,sortNestedRows:s})},[l,r,t,o,a,s]);return{sort:l,sortedRows:d,updateSort:f,computeSortedRowsPreview:v}}({headers:Un,tableRows:Or.filteredRows,externalSortHandling:ie,onSortChange:De,rowGrouping:Be}),jr=zr.sort,Ur=zr.sortedRows,_r=zr.updateSort,Gr=function(e){var r=e.allowAnimations,t=e.sortedRows,o=e.originalRows,i=e.currentPage,a=e.rowsPerPage,c=e.shouldPaginate,s=e.serverSidePagination,d=e.rowGrouping,f=e.rowIdAccessor,v=e.unexpandedRows,h=e.expandAll,p=e.contentHeight,w=e.rowHeight,m=e.scrollTop,g=e.scrollDirection,x=void 0===g?"none":g,b=e.computeFilteredRowsPreview,I=e.computeSortedRowsPreview,C=n.useState(!1),S=C[0],N=C[1],A=n.useState([]),M=A[0],k=A[1],E=n.useRef([]),H=n.useRef([]),T=n.useMemo(function(){return l(w)},[w]),F=n.useRef(new Map),D=n.useRef(null),O=n.useCallback(function(e){var n=c&&!s?e.slice((i-1)*a,i*a):e,r=c?(i-1)*a:0;return d&&0!==d.length?function(e){var n=e.depth,r=e.expandAll,t=void 0!==r&&r,o=e.unexpandedRows,i=e.rowGrouping,a=void 0===i?[]:i,u=e.rowIdAccessor,l=e.displayPositionOffset,c=void 0===l?0:l,s=[],d=function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=c);var l=r,f=i;return e.forEach(function(r,i){var c=R({row:r,rowIdAccessor:u}),v=a[n];s.push({row:r,depth:n,displayPosition:f,groupingKey:v,position:l,isLastGroupRow:0===n&&i===e.length-1}),l++,f++;var h=c+"";if((t?!o.has(h):o.has(h))&&a.length>n){var p=function(e,n){var r=e[n];return y(r)?r:[]}(r,v);p.length>0&&(l=d(p,n+1,l,f))}}),l};return d(e.rows,void 0===n?0:n,0,c),s}({rows:n,rowGrouping:d,rowIdAccessor:f,unexpandedRows:v,expandAll:h,displayPositionOffset:r}):n.map(function(e,n){return{row:e,depth:0,displayPosition:r+n,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[i,a,c,s,d,f,v,h]);n.useMemo(function(){if(0===F.current.size){var e=O(o),n=new Map;e.forEach(function(e){var r=R({row:e.row,rowIdAccessor:f})+"";n.set(r,e.position)}),F.current=n}},[o,O,f]);var P=n.useMemo(function(){return O(t)},[t,O]),L=n.useMemo(function(){return q({bufferRowCount:T,contentHeight:p,tableRows:P,rowHeight:w,scrollTop:m,scrollDirection:x})},[P,p,w,m,x,T]),B=n.useCallback(function(e,n){var r=new Set(e.map(function(e){return R({row:e.row,rowIdAccessor:f})+""})),t=new Set(n.map(function(e){return R({row:e.row,rowIdAccessor:f})+""}));return{staying:n.filter(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return r.has(n)}),entering:n.filter(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return!r.has(n)}),leaving:e.filter(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return!t.has(n)})}},[f]),W=n.useMemo(function(){if(0===E.current.length)return!1;var e=P.map(function(e){return R({row:e.row,rowIdAccessor:f})+""}),n=E.current.map(function(e){return R({row:e.row,rowIdAccessor:f})+""});return e.length!==n.length||!e.every(function(e,r){return e===n[r]})},[P,f]);n.useLayoutEffect(function(){if(!S){if(!r||c)return k([]),E.current=P,void(H.current=L);if(0===E.current.length)return k([]),E.current=P,void(H.current=L);if(!W)return k([]),E.current=P,void(H.current=L);D.current={tableRows:P,visibleRows:L},N(!0)}},[r,P,W,S,c,L]),n.useLayoutEffect(function(){if(S&&D.current&&M.length>0){var e=setTimeout(function(){var e=D.current;N(!1),k([]),E.current=e.tableRows,H.current=e.visibleRows,D.current=null},bn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[S,M.length]);var z=n.useMemo(function(){if(!r||c)return L;if(M.length>0){var e=new Map,n=new Map;return P.forEach(function(r){var t=R({row:r.row,rowIdAccessor:f})+"";e.set(t,r.position),n.set(t,r.displayPosition)}),M.map(function(r){var t=R({row:r.row,rowIdAccessor:f})+"",o=e.get(t),i=n.get(t);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},r),{position:o,displayPosition:i}):r})}return L},[L,M,P,r,c,f]),j=n.useCallback(function(e){if(r&&!c){var n=b(e),t=O(n),o=q({bufferRowCount:T,contentHeight:p,tableRows:t,rowHeight:w,scrollTop:m,scrollDirection:x}),i=B(L,o).entering.map(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return P.find(function(e){return R({row:e.row,rowIdAccessor:f})+""===n})||e}).filter(Boolean);i.length>0&&k(u(u([],L,!0),i,!0))}},[r,c,b,O,p,w,m,x,B,P,L,f,T]),U=n.useCallback(function(e){if(r&&!c){var n=I(e),t=O(n),o=q({bufferRowCount:T,contentHeight:p,tableRows:t,rowHeight:w,scrollTop:m,scrollDirection:x}),i=B(L,o).entering.map(function(e){var n=R({row:e.row,rowIdAccessor:f})+"";return P.find(function(e){return R({row:e.row,rowIdAccessor:f})+""===n})||e}).filter(Boolean);i.length>0&&k(u(u([],L,!0),i,!0))}},[r,c,I,O,p,w,m,x,B,P,L,f,T]);return{currentTableRows:P,currentVisibleRows:L,isAnimating:S,prepareForFilterChange:j,prepareForSortChange:U,rowsToRender:z}}({allowAnimations:o,sortedRows:Ur,originalRows:Dr,currentPage:qn,rowsPerPage:Ke,shouldPaginate:en,serverSidePagination:Ze,rowGrouping:Be,rowIdAccessor:ze,unexpandedRows:Cr,expandAll:Q,contentHeight:Fr,rowHeight:qe,scrollTop:wr,scrollDirection:xr,computeFilteredRowsPreview:qr,computeSortedRowsPreview:zr.computeSortedRowsPreview}),Kr=Gr.currentTableRows,Jr=Gr.rowsToRender,Vr=Gr.prepareForFilterChange,Xr=Gr.prepareForSortChange,Yr=Gr.isAnimating,$r=n.useRef(new Map),Zr=n.useRef(new Map),Qr=function(e){var r=e.selectableCells,t=e.headers,o=e.tableRows,u=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,s=e.collapsedHeaders,d=e.rowHeight,f=e.enableRowSelection,v=void 0!==f&&f,h=n.useState(new Set),p=h[0],w=h[1],g=n.useState(new Set),x=g[0],b=g[1],y=n.useState(null),S=y[0],M=y[1],k=n.useState(null),E=k[0],H=k[1],T=n.useState(new Set),F=T[0],D=T[1],O=n.useState(new Set),P=O[0],L=O[1],B=n.useState(!1),W=B[0],q=B[1],z=n.useRef(!1),j=n.useRef(null),U=n.useMemo(function(){var e=new Set;return p.forEach(function(n){var r=n.split("-");if(r.length>=2){var t=parseInt(r[1],10);isNaN(t)||e.add(t)}}),x.forEach(function(n){e.add(n)}),e},[p,x]),_=n.useMemo(function(){var e=new Set;return p.forEach(function(n){var r=n.split("-");if(r.length>=3){var t=r.slice(2).join("-");e.add(t)}}),x.size>0&&o.forEach(function(n){var r=R({row:n.row,rowIdAccessor:u});e.add(r+"")}),e},[p,x,o,u]),G=n.useMemo(function(){return t.flatMap(function(e){return m(e,s)})},[t,s]),K=n.useCallback(function(){if(0!==p.size){var e=function(e,n,r){var t=n.filter(function(e){return!e.hide}),o=new Map,i=new Map;t.forEach(function(e,n){o.set(n,e.accessor),i.set(n,e)});var a=Array.from(e).reduce(function(e,n){var t,a=n.split("-").map(Number),u=a[0],l=a[1];e[u]||(e[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=I(r[u].row,c);e[u][l]=!s||"lineAreaChart"!==s.type&&"barChart"!==s.type?d:Array.isArray(d)?d.join(", "):""}else e[u][l]="";return e},{});return Object.values(a).map(function(e){return Object.values(e).join("\t")}).join("\n")}(p,G,o);navigator.clipboard.writeText(e),D(new Set(p)),setTimeout(function(){return D(new Set)},800)}},[p,G,o]),J=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,r,t,i;return a(this,function(a){switch(a.label){case 0:if(!E)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,r,t,o,i,a){var u=new Set,l=new Set,c=e.split("\n").filter(function(e){return e.length>0});if(0===c.length)return{updatedCells:u,warningCells:l};var s=r.filter(function(e){return!e.hide}),d=n.rowIndex,f=n.colIndex;return c.forEach(function(e,n){e.split("\t").forEach(function(e,r){var c=d+n,v=f+r;if(t.length>c&&s.length>v){var h=t[c],p=s[v],w=R({row:h.row,rowIdAccessor:o});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var g=+e;isNaN(g)||(m=g)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var x=new Date(e);isNaN(x.getTime())||(m=x)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(m=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(C(h.row,p.accessor,m),a){var b="".concat(w,"-").concat(p.accessor),I=a.get(b);I&&I.updateContent(m)}null==i||i({accessor:p.accessor,newValue:m,row:h.row,rowIndex:c});var y="".concat(c,"-").concat(v,"-").concat(w);u.add(y)}else{var S="".concat(c,"-").concat(v,"-").concat(w);l.add(S)}}})}),{updatedCells:u,warningCells:l}}(e,E,G,o,u,l,c),t=n.warningCells,(r=n.updatedCells).size>0&&(D(r),setTimeout(function(){return D(new Set)},800)),t.size>0&&(L(t),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]}})})},[E,G,o,u,l,c]),V=n.useCallback(function(){if(0!==p.size){var e=function(e,n,r,t,o,i){var a=new Set,u=new Set,l=n.filter(function(e){return!e.hide}),c=new Map;return l.forEach(function(e,n){c.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),c=n[0],s=n[1];if(r.length>c&&l.length>s){var d=r[c],f=l[s],v=R({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(I(d.row,f.accessor))?[]:""),C(d.row,f.accessor,h),i){var p="".concat(v,"-").concat(f.accessor),w=i.get(p);w&&w.updateContent(h)}null==o||o({accessor:f.accessor,newValue:h,row:d.row,rowIndex:c}),a.add(e)}else u.add(e)}}),{deletedCells:a,warningCells:u}}(p,G,o,u,l,c),n=e.deletedCells,r=e.warningCells;n.size>0&&(D(n),setTimeout(function(){return D(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800))}},[p,G,o,u,l,c]),X=n.useCallback(function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=t;i>=c;c++)for(var s=a;l>=s;s++)if(c>=0&&o.length>c){if(v&&0===s)continue;var f=R({row:o[c].row,rowIdAccessor:u});r.add(A({colIndex:s,rowIndex:c,rowId:f}))}b(new Set),M(null),w(r),H(n),setTimeout(function(){return N(n,d)},0)},[o,u,d,v]),Y=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(v?G.length:G.length-1)>=e.colIndex){var n=A(e);b(new Set),M(null),w(new Set([n])),H(e),setTimeout(function(){return N(e,d)},0)}},[G.length,o.length,d,v]),$=n.useCallback(function(e,n){void 0===n&&(n=!1),w(new Set),H(null),b(function(r){var t=new Set(n?r:[]);return e.forEach(function(e){return t.add(e)}),t}),e.length>0&&M(e[e.length-1])},[]);!function(e){var r=e.selectableCells,t=e.initialFocusedCell,o=e.tableRows,i=e.leafHeaders,a=e.rowIdAccessor,u=e.selectSingleCell,l=e.selectCellRange,c=e.setSelectedCells,s=e.setSelectedColumns,d=e.setLastSelectedColumnIndex,f=e.copyToClipboard,v=e.pasteFromClipboard,h=e.deleteSelectedCells,p=e.startCell,w=e.enableRowSelection,m=void 0!==w&&w;n.useEffect(function(){var e=function(e){var u;if(r&&t){var l=t.rowIndex,S=t.colIndex,N=t.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void v();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var A=new Set,M=0;o.length>M;M++)for(var k=0;i.length>k;k++){var E=m?k+1:k,H=R({row:o[M].row,rowIdAccessor:a});A.add("".concat(M,"-").concat(E,"-").concat(H))}return c(A),s(new Set),void d(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void h();if(R({row:null===(u=o[l])||void 0===u?void 0:u.row,rowIdAccessor:a})!==N){var T=o.findIndex(function(e){return R({row:e.row,rowIdAccessor:a})===N});if(-1===T)return;l=T}var F=function(e,n,r){var t=e,a=n;return"up"===r?t=0:"down"===r?t=o.length-1:"left"===r?a=m?1:0:"right"===r&&(a=m?i.length:i.length-1),{rowIndex:t,colIndex:a}};"ArrowUp"===e.key?(e.preventDefault(),n(e,l,S,F)):"ArrowDown"===e.key?(e.preventDefault(),w(e,l,S,F)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,l,S,F)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,l,S,F)):"Home"===e.key?(e.preventDefault(),b(e,l)):"End"===e.key?(e.preventDefault(),I(e,l)):"PageUp"===e.key?(e.preventDefault(),C(e,l,S)):"PageDown"===e.key?(e.preventDefault(),y(e,l,S)):"Escape"===e.key&&(c(new Set),s(new Set),d(null),p.current=null)}else f()}},n=function(e,n,r,i){if(e.shiftKey){p.current||(p.current=t);var c=n-1;if((e.ctrlKey||e.metaKey)&&(c=i(n,r,"up").rowIndex),c>=0){var s=R({row:o[c].row,rowIdAccessor:a});l(p.current,{rowIndex:c,colIndex:r,rowId:s})}}else n>0&&(c=n-1,(e.ctrlKey||e.metaKey)&&(c=i(n,r,"up").rowIndex),s=R({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:r,rowId:s}),p.current=null)},w=function(e,n,r,i){if(e.shiftKey){p.current||(p.current=t);var c=n+1;if((e.ctrlKey||e.metaKey)&&(c=i(n,r,"down").rowIndex),o.length>c){var s=R({row:o[c].row,rowIdAccessor:a});l(p.current,{rowIndex:c,colIndex:r,rowId:s})}}else o.length-1>n&&(c=n+1,(e.ctrlKey||e.metaKey)&&(c=i(n,r,"down").rowIndex),s=R({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:r,rowId:s}),p.current=null)},g=function(e,n,r,i){if(e.shiftKey&&"ArrowLeft"===e.key){p.current||(p.current=t);var c=r-1;if(e.ctrlKey||e.metaKey)c=i(n,r,"left").colIndex;else if(m&&0===c)return;if(c>=0){var s=R({row:o[n].row,rowIdAccessor:a});l(p.current,{rowIndex:n,colIndex:c,rowId:s})}}else if(r>0){if(c=r-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)c=i(n,r,"left").colIndex;else if(m&&0===c)return;0>c||(s=R({row:o[n].row,rowIdAccessor:a}),u({rowIndex:n,colIndex:c,rowId:s}),p.current=null)}},x=function(e,n,r,c){var s=m?i.length:i.length-1;if(e.shiftKey&&"ArrowRight"===e.key){p.current||(p.current=t);var d=r+1;if((e.ctrlKey||e.metaKey)&&(d=c(n,r,"right").colIndex),s>=d){var f=R({row:o[n].row,rowIdAccessor:a});l(p.current,{rowIndex:n,colIndex:d,rowId:f})}}else s>r&&(d=r+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(d=c(n,r,"right").colIndex),d>s||(f=R({row:o[n].row,rowIdAccessor:a}),u({rowIndex:n,colIndex:d,rowId:f}),p.current=null))},b=function(e,n,r){if(e.shiftKey){p.current||(p.current=t);var i=n,c=m?1:0;(e.ctrlKey||e.metaKey)&&(i=0);var s=R({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:c,rowId:s})}else i=n,c=m?1:0,(e.ctrlKey||e.metaKey)&&(i=0),s=R({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:c,rowId:s}),p.current=null},I=function(e,n,r){if(e.shiftKey){p.current||(p.current=t);var c=n,s=m?i.length:i.length-1;(e.ctrlKey||e.metaKey)&&(c=o.length-1);var d=R({row:o[c].row,rowIdAccessor:a});l(p.current,{rowIndex:c,colIndex:s,rowId:d})}else c=n,s=m?i.length:i.length-1,(e.ctrlKey||e.metaKey)&&(c=o.length-1),d=R({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:s,rowId:d}),p.current=null},C=function(e,n,r){var i=Math.max(0,n-10);if(e.shiftKey){p.current||(p.current=t);var c=R({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=R({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:r,rowId:c}),p.current=null},y=function(e,n,r){var i=Math.min(o.length-1,n+10);if(e.shiftKey){p.current||(p.current=t);var c=R({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=R({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:r,rowId:c}),p.current=null};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,t,o,i,a,u,l,c,s,d,f,v,h,p,m])}({selectableCells:r,initialFocusedCell:E,tableRows:o,leafHeaders:G,rowIdAccessor:u,selectSingleCell:Y,selectCellRange:X,setSelectedCells:w,setSelectedColumns:b,setLastSelectedColumnIndex:M,copyToClipboard:K,pasteFromClipboard:J,deleteSelectedCells:V,startCell:j,enableRowSelection:v});var Z=n.useCallback(function(e,n){var r=new Set,t=new Map;o.forEach(function(e,n){var r=R({row:e.row,rowIdAccessor:u});t.set(r+"",n)});for(var i=t.get(e.rowId+""),a=t.get(n.rowId+""),l=void 0!==i?i:e.rowIndex,c=void 0!==a?a:n.rowIndex,s=Math.min(l,c),d=Math.max(l,c),f=Math.min(e.colIndex,n.colIndex),h=Math.max(e.colIndex,n.colIndex),p=s;d>=p;p++)for(var m=f;h>=m;m++)if(p>=0&&o.length>p){if(v&&0===m)continue;var g=R({row:o[p].row,rowIdAccessor:u});r.add(A({colIndex:m,rowIndex:p,rowId:g}))}w(r)},[o,u,v]),Q=n.useCallback(function(e,n){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,e)),a=Math.max(t.top,Math.min(t.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,r=n.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=n)}}),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},[]),ee=n.useCallback(function(e,n){var r=document.elementFromPoint(e,n);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 Q(e,n)},[Q]),ne=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(r){var t=r.getBoundingClientRect();t.top+50>n?r.scrollTop-=10*Math.min(3,1+Math.max(0,t.top-n)/100):n>t.bottom-50&&(r.scrollTop+=10*Math.min(3,1+Math.max(0,n-t.bottom)/100));var o=document.querySelector(".st-body-main");o&&(t.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,t.left-e)/100):e>t.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-t.right)/100)))}},[]),re=n.useCallback(function(e){var n=e.colIndex,r=A({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),t=p.has(r),o=x.has(n);return t||o},[p,x]),te=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId;if(W)return"";var i=[],a=o[r-1]?R({row:o[r-1].row,rowIdAccessor:u}):null,l=o[r+1]?R({row:o[r+1].row,rowIdAccessor:u}):null,c=null!==a?{colIndex:n,rowIndex:r-1,rowId:a}:null,s=null!==l?{colIndex:n,rowIndex:r+1,rowId:l}:null,d={colIndex:n-1,rowIndex:r,rowId:t},f={colIndex:n+1,rowIndex:r,rowId:t};return(!c||!re(c)||x.has(n)&&0===r)&&i.push("st-selected-top-border"),(!s||!re(s)||x.has(n)&&r===o.length-1)&&i.push("st-selected-bottom-border"),re(d)||i.push("st-selected-left-border"),re(f)||i.push("st-selected-right-border"),i.join(" ")},[W,re,o,x,u]),oe=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),ie=n.useCallback(function(e){var n=A({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return F.has(n)},[F]),ae=n.useCallback(function(e){var n=A({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return P.has(n)},[P]);return{getBorderClass:te,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){z.current=!0,q(!0),j.current={rowIndex:t,colIndex:n,rowId:o},setTimeout(function(){b(new Set),M(null);var e=A({colIndex:n,rowIndex:t,rowId:o});w(new Set([e])),H({rowIndex:t,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,c=function(){if(z.current&&j.current){if(null!==i&&null!==a){ne(i,a);var e=Date.now();if(e-l>=16){var n=ee(i,a);n&&Z(j.current,n),l=e}}u=requestAnimationFrame(c)}else null!==u&&(cancelAnimationFrame(u),u=null)},s=function(e){z.current&&j.current&&(i=e.clientX,a=e.clientY)},d=function(){z.current=!1,q(!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(e){r&&z.current&&j.current&&Z(j.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ie,isWarningFlashing:ae,isInitialFocusedCell:oe,isSelected:re,lastSelectedColumnIndex:S,pasteFromClipboard:J,selectColumns:$,selectedCells:p,selectedColumns:x,setInitialFocusedCell:H,setSelectedCells:w,setSelectedColumns:b,deleteSelectedCells:V,columnsWithSelectedCells:U,rowsWithSelectedCells:_}}({selectableCells:Ve,headers:Un,tableRows:Kr,rowIdAccessor:ze,onCellEdit:ye,cellRegistry:$r.current,collapsedHeaders:nr,rowHeight:qe,enableRowSelection:$}),et=Qr.getBorderClass,nt=Qr.handleMouseDown,rt=Qr.handleMouseOver,tt=Qr.isCopyFlashing,ot=Qr.isInitialFocusedCell,it=Qr.isSelected,at=Qr.isWarningFlashing,ut=Qr.selectColumns,lt=Qr.selectedCells,ct=Qr.selectedColumns,st=Qr.setInitialFocusedCell,dt=Qr.setSelectedCells,ft=Qr.setSelectedColumns,vt=Qr.columnsWithSelectedCells,ht=Qr.rowsWithSelectedCells,pt=n.useCallback(function(e){Xr(e),setTimeout(function(){_r(e)},0)},[Xr,_r]),wt=n.useCallback(function(e){_n(e)},[]);!function(e){var r=e.selectableColumns,t=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(u&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||r&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(t.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,t,o,i,a,u,l])}({selectableColumns:Ye,selectedCells:lt,selectedColumns:ct,setSelectedCells:dt,setSelectedColumns:ft,activeHeaderDropdown:Zn,setActiveHeaderDropdown:Qn}),function(e){var r=e.forceUpdate,t=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){r(),t.current&&o(t.current.offsetWidth-t.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[r,t,o])}({forceUpdate:Bn,tableBodyContainerRef:Hn,setScrollbarWidth:On}),function(e){var r=e.onGridReady;n.useEffect(function(){null==r||r()},[r])}({onGridReady:Me}),function(e){var r=e.cellRegistryRef,t=e.currentTableRows,o=e.headerRegistryRef,i=e.headers,a=e.rowIdAccessor,l=e.rows,c=e.tableRef,s=e.visibleRows;n.useEffect(function(){c&&(c.current={updateData:function(e){var n=e.accessor,t=e.newValue,o=null==l?void 0:l[e.rowIndex];if(o){var i=R({row:o,rowIdAccessor:a}),u=w({rowId:i,accessor:n}),c=r.current.get(u);c&&c.updateContent(t),void 0!==I(o,n)&&C(o,n,t)}},setHeaderRename:function(e){var n=o.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return s},exportToCSV:function(e){!function(e,n,r){var t=function(e,n){var r=function(e){var n=[],r=function(e){for(var t=0,o=e;o.length>t;t++){var i=o[t];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?r(i.children):n.push(i))}};return r(e),n}(n);return u([r.map(function(e){return gn(e.label)}).join(",")],e.map(function(e){var n=e.row;return r.map(function(e){var r=I(n,e.accessor);return gn(r)}).join(",")}),!0).join("\n")}(e,n);!function(e,n){void 0===n&&(n="table-export.csv");var r=new Blob([e],{type:"text/csv;charset=utf-8;"}),t=document.createElement("a"),o=URL.createObjectURL(r);t.setAttribute("href",o),t.setAttribute("download",n),t.style.visibility="hidden",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(o)}(t,r)}(t,i,(void 0===e?{}:e).filename)}})},[r,t,o,i,a,l,c,s])}({cellRegistryRef:$r,currentTableRows:Kr,headerRegistryRef:Zr,headers:hr,rowIdAccessor:ze,rows:Ln,tableRef:sn,visibleRows:Jr}),function(e){var r=e.filters,t=e.onFilterChange;n.useEffect(function(){null==t||t(r)},[r,t])}({filters:Pr,onFilterChange:Ae}),function(e){var r=e.sort,t=e.onSortChange,o=de(r);n.useEffect(function(){!r||(null==o?void 0:o.key.accessor)===r.key.accessor&&(null==o?void 0:o.direction)===r.direction?!r&&o&&(null==t||t(null)):null==t||t(r)},[r,o,t])}({sort:jr,onSortChange:De});var mt=n.useCallback(function(e){Vr(e),setTimeout(function(){Lr(e)},0)},[Vr,Lr]);return e.jsx(k,exports.__assign({value:{allowAnimations:o,areAllRowsSelected:ur,cellRegistry:$r.current,cellUpdateFlash:d,clearSelection:vr,collapsedHeaders:nr,columnBorders:x,columnReordering:B,columnResizing:j,draggedHeaderRef:Nn,editColumns:G,enableHeaderEditing:X,enableRowSelection:$,expandIcon:ne,filterIcon:ue,filters:Pr,forceUpdate:Bn,getBorderClass:et,handleApplyFilter:mt,handleClearAllFilters:Wr,handleClearFilter:Br,handleMouseDown:nt,handleMouseOver:rt,handleRowSelect:sr,handleSelectAll:dr,handleToggleRow:fr,headerCollapseIcon:se,headerContainerRef:Tn,headerDropdown:he,headerExpandIcon:ve,headerRegistry:Zr.current,headers:hr,hoveredHeaderRef:An,isAnimating:Yr,isCopyFlashing:tt,isInitialFocusedCell:ot,isLoading:be,isResizing:Kn,isRowSelected:ar,isScrolling:Xn,isSelected:it,isWarningFlashing:at,mainBodyRef:Mn,nextIcon:Ce,onCellEdit:ye,onCellClick:Re,onColumnOrderChange:Se,onColumnSelect:Ne,onLoadMore:Ee,onSort:pt,onTableHeaderDragEnd:wt,pinnedLeftRef:kn,pinnedRightRef:En,prevIcon:Pe,rowButtons:Le,rowGrouping:Be,rowHeight:qe,headerHeight:null!=pe?pe:qe,rowIdAccessor:ze,scrollbarWidth:Dn,selectColumns:ut,selectableColumns:Ye,selectedColumns:ct,columnsWithSelectedCells:vt,rowsWithSelectedCells:ht,selectedRows:or,selectedRowCount:lr,selectedRowsData:cr,setCollapsedHeaders:rr,setHeaders:_n,setInitialFocusedCell:st,setIsResizing:Jn,setIsScrolling:Yn,setSelectedCells:dt,setSelectedColumns:ft,setSelectedRows:ir,setUnexpandedRows:yr,shouldPaginate:en,sortDownIcon:rn,sortUpIcon:cn,tableBodyContainerRef:Hn,tableRows:Kr,theme:fn,unexpandedRows:Cr,useHoverRowBackground:In,useOddColumnBackground:Sn,useOddEvenRowBackground:yn,activeHeaderDropdown:Zn,setActiveHeaderDropdown:Qn,onHeaderEdit:ke}},{children:e.jsx("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(fn," ").concat(null!=h?h:""," ").concat(x?"st-column-borders":""),style:we?{height:we}:{}},{children:e.jsx(pn,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(tn,{pinnedLeftWidth:kr,pinnedRightWidth:Er,setScrollTop:mr,setScrollDirection:br,sort:jr,tableRows:Kr,rowsToRender:Jr}),e.jsx(hn,{columnEditorText:E,editColumns:G,editColumnsInitOpen:J,headers:Un,position:S})]})),e.jsx(on,{mainBodyRef:Mn,mainBodyWidth:Mr,pinnedLeftWidth:kr,pinnedRightWidth:Er,pinnedLeftContentWidth:Hr,pinnedRightContentWidth:Tr,tableBodyContainerRef:Hn}),e.jsx(H,{currentPage:qn,footerRenderer:le,hideFooter:ge,onPageChange:zn,onNextPage:He,onUserPageChange:Te,rowsPerPage:Ke,shouldPaginate:en,totalPages:Math.ceil((null!=vn?vn:Ur.length)/Ke),totalRows:null!=vn?vn:Ur.length})]}))})}))}))},Rn=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,c=n.fillOpacity,s=void 0===c?.2:c,d=n.strokeWidth,f=void 0===d?2:d,v=n.className,h=void 0===v?"":v,p=n.min,w=n.max;if(!r||0===r.length)return null;var m=void 0!==p?p:Math.min.apply(Math,r),g=(void 0!==w?w:Math.max.apply(Math,r))-m||1,x=a,b=r.map(function(e,n){return{x:n/(r.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),I="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(h),style:{display:"block"}},{children:[e.jsx("path",{d:I,fill:l||"var(--st-chart-fill-color)",fillOpacity:s,stroke:"none",vectorEffect:"non-scaling-stroke"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}))},Sn=Object.freeze({__proto__:null,default:Rn}),Nn=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,c=void 0===l?2:l,s=n.className,d=void 0===s?"":s,f=n.min,v=n.max;if(!r||0===r.length)return null;var h=void 0!==f?f:Math.min.apply(Math,r),p=void 0!==v?v:Math.max.apply(Math,r),w=p-h||1,m=a,g=(100-c*(r.length-1))/r.length,x=0>h,b=x?m*(p/w):m;return e.jsx("svg",exports.__assign({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(n,r){var t=r*(g+c),o=(n-h)/w*m,i=m-o,a=o;return x&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:t,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:1},r)})}))},An=Object.freeze({__proto__:null,default:Nn});exports.ANIMATION_CONFIGS=bn,exports.AngleDownIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},exports.AngleLeftIcon=T,exports.AngleRightIcon=F,exports.AngleUpIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},exports.AscIcon=D,exports.BarChart=Nn,exports.CheckIcon=O,exports.DescIcon=P,exports.FilterIcon=L,exports.LineAreaChart=Rn,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=B,exports.SimpleTable=function(r){var t=n.useState(!1),o=t[0],i=t[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(yn,exports.__assign({},r)):null},exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,r=e.options;return i(void 0,void 0,void 0,function(){var e,t,o,i,u,l,c,s,d,f,v,h,p,w,m,g;return a(this,function(a){return e=r.startY,t=r.endY,o=r.finalY,u=void 0===(i=r.duration)?300:i,c=void 0===(l=r.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(s=r.delay)?0:s,f=r.onComplete,h=void 0===(v=r.respectReducedMotion)||v,xn()&&h?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),m=e-(w=p.top),g=t-w,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.style.transition="transform ".concat(u,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"px, 0)");var r=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",r),f&&f(),e()};n.addEventListener("transitionend",r),setTimeout(r,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,r=e.finalConfig,t=e.fromBounds,o=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){return{x:("x"in e?e.x:e.left)-n.x,y:("y"in e?e.y:e.top)-n.y}}(t,o),0===e.x&&0===e.y||xn()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=xn()?exports.__assign(exports.__assign({},bn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},bn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},bn.ROW_REORDER),u),In(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,Cn(n,i,r)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=de,exports.useTableContext=E;
|
|
2
|
+
//# sourceMappingURL=index-9bed7b6d.js.map
|