simple-table-core 1.7.2 → 1.7.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.
@@ -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 480>e?.3:768>e?.4:.8},c=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},s=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,s(e.children)),n})},d=function(e){return void 0===e&&(e=0),e?e+1:0},f=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},v=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=s(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);return!!t&&(r.has(t.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)}(n,t,o))||null},h=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},p=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return p(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return p(e,n)}):[e]},w=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(f({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},m=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(f({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){m(e)})},g=function(e){return"number"==typeof e.minWidth?e.minWidth:40},x=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},b=function(e){return e.row[e.rowIdAccessor]},I=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)}},C=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&&I(n,r,t)},100);I(i,r,t)}},y=function(e){var n=e.colIndex,r=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(r)},R=n.createContext(void 0),S=function(n){return e.jsx(R.Provider,exports.__assign({value:n.value},{children:n.children}))},N=function(){var e=n.useContext(R);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},A=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=N(),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),A=!I,M=!C&&!c||!x&&y,E=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]}})})},T=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:T,onPrevPage:E,hasNextPage:!M,hasPrevPage:!A,nextIcon:w,prevIcon:m})});var k=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:[k.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(A?"disabled":""),onClick:E,disabled:A},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(M?"disabled":""),onClick:T,disabled:M},{children:w}))]}))]}))},M=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"})}))},E=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"})}))},T=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"})}))},H=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"})}))},k=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"})}))},F=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"})}))},D=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"})}))},O=function(e){var n=e.bufferRowCount,r=e.scrollTop,t=e.tableRows,o=e.rowHeight+1,i=r+e.contentHeight+o*n;return t.slice(Math.max(0,Math.floor(Math.max(0,r-o*n)/o)),Math.min(t.length,Math.ceil(i/o)))},P=function(e){return e.position*(e.rowHeight+1)-1},B=function(e){return e.position*(e.rowHeight+1)},L=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=N().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},W=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}))},q=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(L,exports.__assign({open:i,onClose:function(){t()},setOpen:a,width:120},{children:[e.jsx(W,exports.__assign({isSelected:!0===l,onClick:function(){return s(!0)}},{children:"True"})),e.jsx(W,exports.__assign({isSelected:!1===l,onClick:function(){return s(!1)}},{children:"False"}))]}))},z=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()}})},U=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-ca0431cb.js")})}),G=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-106e00e9.js")})}),K=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(U,exports.__assign({},r))}))},J=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(G,exports.__assign({},r))}))},V=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)},_=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},X=function(e){if(!e)return new Date;if("string"==typeof e)return V(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:_(n)}return e instanceof Date?_(e):new Date},Y=function(e){return e?V(""+e):new Date},$=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(L,exports.__assign({open:i,onClose:l,setOpen:a,width:280},{children:e.jsx(J,{value:Y(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),t()},onClose:l})}))},Q=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(L,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(W,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)})}))}))},Z=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(q,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx($,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(Q,{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(z,{defaultValue:null==l?"":l+"",onBlur:c,onChange:o})},ee=0,ne=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();0!==ee&&t>o-ee||(ee=o,n(r))}},re=function(e){var r=n.useRef(e);return n.useEffect(function(){JSON.stringify(r.current)!==JSON.stringify(e)&&(r.current=e)},[e]),r.current},te=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(te);var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=te(e[r]));return n},oe=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ie=Date.now(),ae={screenX:0,screenY:0},ue=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=ue(o.children,n,u(u([],r,!0),[t],!1));if(i)return i}}return null},le=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};var ce=function(e){var n=e.draggedHeaderRef,r=e.headers,t=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=N().setHeaders,l=re(r);return{handleDragStart:function(e){n.current=e,ie=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-ae.screenX,2)+Math.pow(s-ae.screenY,2));t.current=a;var f,v=n.current,h=!1;if(le(v)!==le(a))f=(C=function(e,n,r){var t,o,i=te(e),a=!1;try{var u=le(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=ue(p,v.accessor),m=ue(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=te(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-ie||40>d)||(ie=y,ae={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)}}},se=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(H,{className:"st-checkbox-checkmark"})})),o]}))},de=function(e){var n=e.content,r=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===r.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?X(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},fe=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.rowIndex,d=r.tableRow,v=N(),p=v.cellRegistry,w=v.cellUpdateFlash,m=v.columnBorders,g=v.draggedHeaderRef,I=v.enableRowSelection,C=v.expandIcon,y=v.handleMouseDown,R=v.handleMouseOver,S=v.handleRowSelect,A=v.headers,M=v.hoveredHeaderRef,E=v.isCopyFlashing,T=v.isLoading,H=v.isRowSelected,k=v.isWarningFlashing,F=v.onCellEdit,D=v.onCellClick,O=v.onTableHeaderDragEnd,P=v.rowButtons,B=v.rowGrouping,L=v.rowIdAccessor,W=v.rowsWithSelectedCells,q=v.selectedColumns,z=v.setUnexpandedRows,j=v.tableBodyContainerRef,U=v.theme,G=v.unexpandedRows,J=v.useOddColumnBackground,V=d.depth,_=d.row,X=n.useState(_[a.accessor]),Y=X[0],$=X[1],Q=n.useState(!1),ee=Q[0],re=Q[1],te=n.useState(!1),oe=te[0],ie=te[1],ae=n.useState(!1),ue=ae[0],le=ae[1],fe=n.useRef(null),ve=b({row:_,rowIdAccessor:L}),he=B&&B[V],pe=!!he&&function(e,n){return!!n&&x(e[n])}(_,he),we=!G.has(ve+""),me=E({rowIndex:s,colIndex:o,rowId:ve}),ge=k({rowIndex:s,colIndex:o,rowId:ve}),xe=n.useMemo(function(){var e,n,r;if(!m)return!1;var t=A.filter(function(e){return"left"===e.pinned}),o=A.filter(function(e){return!e.pinned}),i=A.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},[m,A,a.accessor,a.pinned]),be=ce({draggedHeaderRef:g,headers:A,hoveredHeaderRef:M,onTableHeaderDragEnd:O}).handleDragOver,Ie=ne(),Ce=f({accessor:a.accessor,rowId:ve}),ye=h({rowId:ve,accessor:a.accessor}),Re=a.isSelectionColumn&&I;n.useEffect(function(){if(p){var e="".concat(ve,"-").concat(a.accessor);return p.set(e,{updateContent:function(e){Y!==e?($(e),w&&(ie(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){ie(!1)},800))):$(e)}}),function(){p.delete(e),fe.current&&clearTimeout(fe.current)}}},[p,w,ve,a.accessor,Y]),n.useEffect(function(){if(oe){var e=setTimeout(function(){ie(!1)},850);return function(){return clearTimeout(e)}}},[oe]),n.useEffect(function(){$(_[a.accessor])},[_,a.accessor]);var Se="boolean"===a.type||"date"===a.type||"enum"===a.type,Ne=!!(null==a?void 0:a.isEditable),Ae=q.has(o),Me=u&&!Ae,Ee=n.useMemo(function(){return!!Re&&W.has(ve+"")},[Re,W,ve]),Te="st-cell ".concat(V>0&&a.expandable?"st-cell-depth-".concat(V):""," ").concat(Me?l?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").concat(Ae?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ne?"clickable":""," ").concat(oe?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ge?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(J?c%2==0?"even-column":"odd-column":""," ").concat(Re?"st-selection-cell":""," ").concat(Ee?"st-selection-has-highlighted-cell":""," ").concat(xe?"st-last-column":""),He=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),$(e),_[a.accessor]=e,null==F||F({accessor:a.accessor,newValue:e,row:_,rowIndex:s})},[a.accessor,a.type,F,_,s]),ke=n.useCallback(function(){z(function(e){var n=new Set(e),r=ve+"";return n.has(r)?n.delete(r):n.add(r),n})},[ve,z]);return!ee||Se||Re?e.jsxs(K,exports.__assign({className:Te,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ve,"data-row-index":s,id:Ce,onClick:function(){D&&!Re&&D({accessor:a.accessor,colIndex:o,row:_,rowId:ve,rowIndex:s,value:Y})},onDoubleClick:function(){return a.isEditable&&!Re&&re(!0)},onDragOver:function(e){Re||Ie({callback:be,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){ee||Re||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||ee||(e.preventDefault(),re(!0))},onMouseDown:function(){ee||Re||y({rowIndex:s,colIndex:o,rowId:ve})},onMouseEnter:function(){le(!0)},onMouseLeave:function(){le(!1)},onMouseOver:function(){ee||Re||R({rowIndex:s,colIndex:o,rowId:ve})},parentRef:j,tableRow:d},{children:[a.expandable&&pe?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:ke},{children:C})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:T?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx("span",{children:Re?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ue||H&&H(ve+"")?e.jsx(se,{checked:!!H&&H(ve+""),onChange:function(e){S&&S(ve+"",e)}}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!P||!Re||0===P.length)return null;if(!(ue||H&&H(ve+"")))return null;var n={row:_};return e.jsx("div",exports.__assign({className:"st-row-buttons"},{children:P.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:_,theme:U}):de({content:Y,header:a})})})),!T&&ee&&Se&&!Re&&e.jsx(Z,{enumOptions:a.enumOptions,onChange:He,setIsEditing:re,type:a.type,value:Y})]}),ye):e.jsx("div",exports.__assign({className:"st-cell-editing",id:f({accessor:a.accessor,rowId:ve}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(Z,{enumOptions:a.enumOptions,onChange:He,setIsEditing:re,type:a.type,value:Y})}))},ve=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=N(),d=s.rowIdAccessor,h=s.collapsedHeaders,p=o.filter(function(e){return v({header:e,pinned:i,headers:o,collapsedHeaders:h})});return e.jsx(e.Fragment,{children:p.map(function(n,s){var v=b({row:c.row,rowIdAccessor:d}),h=f({accessor:n.accessor,rowId:v});return e.jsx(he,{columnIndices:t,displayRowNumber:u,header:n,headers:o,nestedIndex:s+(null!=r?r:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:c},h)})})},he=function(r){var t=r.columnIndices,o=r.displayRowNumber,i=r.header,a=r.headers,u=r.nestedIndex,l=r.pinned,c=r.rowIndex,s=r.rowIndices,d=r.tableRow,h=t[i.accessor],p=N(),w=p.getBorderClass,m=p.isSelected,g=p.isInitialFocusedCell,x=p.collapsedHeaders,I=b({row:d.row,rowIdAccessor:p.rowIdAccessor});if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return v({header:e,pinned:l,headers:a,collapsedHeaders:x})});return e.jsx(n.Fragment,{children:C.map(function(n){var r=f({accessor:n.accessor,rowId:I});return e.jsx(he,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,pinned:l,rowIndex:c,rowIndices:s,tableRow:d},r)})})}var y={rowIndex:c,colIndex:h,rowId:I},R=w(y),S=m(y),A=g(y),M=f({accessor:i.accessor,rowId:I});return e.jsx(fe,{borderClass:R,colIndex:h,displayRowNumber:o,header:i,isHighlighted:S,isInitialFocused:A,nestedIndex:u,rowIndex:c,tableRow:d},M)},pe=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=N(),v=f.useHoverRowBackground,h=f.isAnimating,p=f.isRowSelected,w=f.useOddEvenRowBackground,m=d.position,g=d.displayPosition,x=m%2==0,I=b({row:d.row,rowIdAccessor:f.rowIdAccessor}),C=!!p&&p(I+"");return e.jsx("div",exports.__assign({className:"st-row ".concat(w?x?"even":"odd":""," ").concat(C?"selected":""),"data-index":a,onMouseEnter:function(){!h&&v&&s(a)},style:{gridTemplateColumns:o,top:B({position:m,rowHeight:l}),height:"".concat(l,"px")}},{children:e.jsx(ve,{columnIndexStart:t,columnIndices:r,displayRowNumber:g,headers:i,pinned:u,rowIndex:m,rowIndices:c,tableRow:d},I)}))},we=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,top:P({position:o,rowHeight:i})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},me=n.createContext(void 0),ge=function(e){var r=e.childRef,t=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(me);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}})},xe=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=N().rowIdAccessor,m=n.useRef(null);return n.useImperativeHandle(t,function(){return m.current},[]),n.useMemo(function(){return oe(a,u)},[a,u])?e.jsx(ge,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=b({row:r.row,rowIdAccessor:w});return e.jsxs(n.Fragment,{children:[0!==t&&e.jsx(we,{displayStrongBorder:r.isLastGroupRow,position:r.position,rowHeight:l,templateColumns:d,rowIndex:t-1}),e.jsx(pe,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:t,pinned:u,rowHeight:l,rowIndices:c,setHoveredIndex:s,tableRow:r},f)]},f)})}))})):null});function be(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 v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return r.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n&&0===r.length)}),t.forEach(function(e){c(e,!1)}),i}xe.displayName="TableSection";var Ie=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.tableRows,v=N(),h=v.collapsedHeaders,p=v.headerContainerRef,w=v.headers,m=v.isAnimating,g=v.mainBodyRef,x=v.onLoadMore,I=v.rowHeight,C=v.rowIdAccessor,y=v.scrollbarWidth,R=v.setIsScrolling,S=v.shouldPaginate,A=v.tableBodyContainerRef,M=n.useState(!1),E=M[0],T=M[1],H=n.useRef(new Set),k=n.useCallback(function(e){H.current.forEach(function(e){return e.classList.remove("hovered")}),H.current.clear(),null!==e&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),H.current.add(e)})},[]);n.useEffect(function(){m&&k(null)},[m,k]),function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];n.useEffect(function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[r,a,o]),n.useEffect(function(){var e=null==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])}({headerContainerRef:p,mainSectionRef:A,scrollbarWidth:y}),n.useEffect(function(){return function(){D.current&&clearTimeout(D.current)}},[]);var F=n.useRef(null),D=n.useRef(null),O=n.useRef(0),P=function(e){return e.length}(f),B=P*(I+1)-1,L=n.useMemo(function(){return be({headers:w,pinnedLeftColumns:o,pinnedRightColumns:u,collapsedHeaders:h})},[w,o,u,h]),W=n.useMemo(function(){var e={};return s.forEach(function(n,r){var t=b({row:n.row,rowIdAccessor:C})+"";e[t]=r}),e},[s,C]),q=n.useCallback(function(e,n){!x||S||E||200>=e.scrollHeight-(n+e.clientHeight)&&n>O.current&&(T(!0),x(),setTimeout(function(){T(!1)},1e3))},[x,S,E]),z={columnIndices:L,headerContainerRef:p,headers:w,rowHeight:I,rowIndices:W,rowsToRender:s,setHoveredIndex:k};return e.jsxs("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return k(null)},onScroll:function(e){var n=e.currentTarget,r=n.scrollTop;R(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(function(){R(!1)},150),F.current&&cancelAnimationFrame(F.current),F.current=requestAnimationFrame(function(){d(r),q(n,r),O.current=r})},ref:A},{children:[e.jsx(xe,exports.__assign({},z,{pinned:"left",templateColumns:i,totalHeight:B,width:a})),e.jsx(xe,exports.__assign({},z,{columnIndexStart:o.length,ref:g,templateColumns:t,totalHeight:B})),e.jsx(xe,exports.__assign({},z,{columnIndexStart:o.length+t.length,pinned:"right",templateColumns:l,totalHeight:B,width:c}))]}))},Ce=function(e){var n=e.event,r=e.header,t=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,c=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=g(r);if(r.children&&r.children.length>0){var h=p(r,c);f=h.length>0?h:[r]}else f=[r];var x=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*l(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+p(n,t).reduce(function(e,n){return e+w(n)},0)},0),c=g(n);return c>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):u}({header:r,headers:t,collapsedHeaders:c});f.length>1?ye({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){m(e)});var d=u([],t,!0);o(d)};if(d){var b=function(e){x(e.touches[0].clientX)},I=function(){document.removeEventListener("touchmove",b),document.removeEventListener("touchend",I),i(!1)};document.addEventListener("touchmove",b),document.addEventListener("touchend",I)}else{var C=function(e){x(e.clientX)},y=function(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",y),i(!1)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",y)}}},ye=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,g(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)})},Re={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Se=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"]}},Ne=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ae=function(e){return["between","notBetween","in","notIn"].includes(e)},Me=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ee=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},Te=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(D,{})]})),e.jsx(L,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)})}))}))]}))},He=function(n){var r=n.value,t=n.onChange,o=n.operators.map(function(e){return{value:e,label:Re[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(Te,{value:r,onChange:function(e){t(e)},options:o})}))},ke=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()})},Fe=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}))},De=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"}))]}))},Oe=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=Se("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},Ne(l)&&{value:d});i(e)},p=Me(l)||d.trim();return e.jsxs(Ee,{children:[e.jsx(He,{value:l,onChange:c,operators:v}),Ne(l)&&e.jsx(Fe,{children:e.jsx(ke,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:h})}),e.jsx(De,{onApply:h,onClear:a,canApply:!!p,showClear:!!o})]})},Pe=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=Se("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};Ne(s)?e.value=parseFloat(v):Ae(s)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(Ee,{children:[e.jsx(He,{value:s,onChange:d,operators:I}),Ne(s)&&e.jsx(Fe,{children:e.jsx(ke,{type:"number",value:v,onChange:h,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Ae(s)&&e.jsxs(Fe,{children:[e.jsx(ke,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(ke,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(De,{onApply:C,onClear:l,canApply:!!Me(s)||(Ne(s)?""!==v.trim():!!Ae(s)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},Be=function(n){var r=n.className;return e.jsx(Te,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===r?"":r,placeholder:n.placeholder})},Le=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=Se("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?o.value+"":"true")):(c("equals"),f("true"))},[o]);var h=Me(l)||""!==d;return e.jsxs(Ee,{children:[e.jsx(He,{value:l,onChange:c,operators:v}),Ne(l)&&e.jsx(Fe,{children:e.jsx(Be,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(De,{onApply:function(){var e={accessor:t.accessor,operator:l};Ne(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:h,showClear:!!o})]})},We=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=Se("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=X(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?X(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(L,exports.__assign({open:c,setOpen:s,onClose:function(){s(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(J,{value:p,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),s(!1)},onClose:function(){return s(!1)}})}))]}))};return e.jsxs(Ee,{children:[e.jsx(He,{value:s,onChange:d,operators:I}),Ne(s)&&e.jsx(Fe,{children:e.jsx(C,{value:v,onChange:h,placeholder:"Select date...",autoFocus:!0})}),Ae(s)&&e.jsxs(Fe,{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(De,{onApply:function(){var e={accessor:i.accessor,operator:s};Ne(s)?e.value=v:Ae(s)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!Me(s)||(Ne(s)?""!==v.trim():!!Ae(s)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},qe=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(Ee,{children:[e.jsx(Fe,{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(se,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(ke,{type:"text",value:h,onChange:p,placeholder:"Search..."})})),w.map(function(n,r){return e.jsx(se,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(De,{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})]})},ze=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(Pe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Le,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(We,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(qe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Oe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i})}}()})},je=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}))]})},Ue=function(r){var t,o,i=r.colIndex,a=r.gridColumnEnd,l=r.gridColumnStart,s=r.gridRowEnd,d=r.gridRowStart,v=r.header,h=r.reverse,p=r.sort,w=n.useState(!1),m=w[0],g=w[1],x=n.useState(!1),b=x[0],I=x[1],C=n.useState(v.label||""),y=C[0],R=C[1],S=N(),A=S.activeHeaderDropdown,M=S.areAllRowsSelected,E=S.collapsedHeaders,T=S.columnBorders,H=S.columnReordering,k=S.columnResizing,F=S.columnsWithSelectedCells,D=S.draggedHeaderRef,O=S.enableHeaderEditing,P=S.filterIcon,B=S.handleApplyFilter,W=S.handleClearFilter,q=S.handleSelectAll,j=S.headerCollapseIcon,U=S.headerDropdown,G=S.headerExpandIcon,J=S.headerRegistry,V=S.headers,_=S.hoveredHeaderRef,X=S.onColumnOrderChange,Y=S.onColumnSelect,$=S.onHeaderEdit,Q=S.onSort,Z=S.onTableHeaderDragEnd,ee=S.headerHeight,re=S.selectColumns,te=S.selectableColumns,oe=S.selectedColumns,ie=S.setActiveHeaderDropdown,ae=S.setCollapsedHeaders,ue=S.setHeaders,le=S.setInitialFocusedCell,de=S.setIsResizing,fe=S.setSelectedCells,ve=S.setSelectedColumns,he=S.sortDownIcon,pe=S.sortUpIcon,we=!!(null==v?void 0:v.isSortable),me=!!(null==v?void 0:v.filterable),ge=S.filters[v.accessor],xe=(null==A?void 0:A.accessor)===v.accessor,be=v.isSelectionColumn&&S.enableRowSelection,Ie=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(v),ye=E.has(v.accessor),Re=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:xe,estimatedHeight:200,estimatedWidth:250,margin:4}),Se=Re.triggerRef,Ne=Re.position,Ae=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]),Me=n.useMemo(function(){return!(!te||be)&&c(v,i).some(function(e){return oe.has(e)})},[te,be,v,i,oe]),Ee=n.useMemo(function(){return!be&&c(v,i).some(function(e){return F.has(e)})},[be,v,i,F]),Te=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!ye||v.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[v.children,ye]),He="st-header-cell ".concat(v.accessor===(null===(t=_.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(o=D.current)||void 0===o?void 0:o.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(H&&!we?"columnReordering":""," ").concat(Te?"parent":""," ").concat(Ae?"st-last-column":""," ").concat(O&&!be?"st-header-editable":""," ").concat(Me?"st-header-selected":""," ").concat(Ee&&!Me?"st-header-has-highlighted-cell":""),ke=ce({draggedHeaderRef:D,headers:V,hoveredHeaderRef:_,onColumnOrderChange:X,onTableHeaderDragEnd:Z}),Fe=ke.handleDragStart,De=ke.handleDragEnd,Oe=ke.handleDragOver,Pe=ne();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=v.accessor+"";return J.set(e,{setEditing:function(e){I(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){R(v.label||"")},[v.label]);var Be=n.useCallback(function(e){R(e);var n=V.map(function(n){return n.accessor===v.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});ue(n),$&&$(v,e)},[V,ue,$,v]),Le=n.useCallback(function(){ie&&ie(null)},[ie]),We=n.useCallback(function(e){e.stopPropagation(),ae(function(e){var n=new Set(e);return ye?n.delete(v.accessor):n.add(v.accessor),n})},[ae,ye,v.accessor]),qe=function(e){var n=e.event,r=e.header;if(!r.isSelectionColumn){if(te){var t=c(r,i),o=t.some(function(e){return oe.has(e)});if(O&&o&&!n.shiftKey)return U&&xe&&Le(),void I(!0);n.shiftKey&&re?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))}):re&&re(t),fe(new Set),le(null)}Y&&Y(r),!te&&r.isSortable&&Q(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 Ue=k&&!be&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,r=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Pe({callback:Ce,callbackProps:{event:e.nativeEvent,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:ue,setIsResizing:de,startWidth:r,collapsedHeaders:E},limit:10})},onTouchStart:function(e){var n,r=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Pe({callback:Ce,callbackProps:{event:e,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:ue,setIsResizing:de,startWidth:r,collapsedHeaders:E},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ge=p&&p.key.accessor===v.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return qe({event:e,header:v})}},{children:["ascending"===p.direction&&pe&&pe,"descending"===p.direction&&he&&he]})),Ke=me&&P&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){e.stopPropagation(),g(!m)}},{children:[n.cloneElement(P,{style:{fill:ge?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(L,exports.__assign({open:m,overflow:"visible",setOpen:g,onClose:function(){return g(!1)}},{children:e.jsx(ze,{header:v,currentFilter:ge,onApplyFilter:function(e){B(e),g(!1)},onClearFilter:function(){W(v.accessor),g(!1)}})}))]})),Je=Ie&&!be&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:We},{children:ye?j:G}));return e.jsxs(K,exports.__assign({className:He,id:f({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){be||Pe({callback:Oe,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:exports.__assign({gridRowStart:d,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-d>1?{}:{height:ee})},{children:[h&&Ue,"right"===v.align&&Je,"right"===v.align&&Ke,"right"===v.align&&Ge,e.jsx("div",exports.__assign({ref:Se,className:"st-header-label",draggable:H&&!v.disableReorder&&!be,onClick:function(e){be||qe({event:e,header:v})},onDoubleClick:function(e){be||function(e){var n=e.header;n.isSelectionColumn||te&&n.isSortable&&Q(n.accessor)}({event:e,header:v})},onDragEnd:be?void 0:function(e){e.preventDefault(),De()},onDragStart:be?void 0:function(e){H&&v&&function(e){Fe(e)}(v)}},{children:e.jsx(je,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:be?e.jsx(se,{checked:!!M&&M(),onChange:function(e){q&&q(e)}}):b?e.jsx(z,{defaultValue:y,onBlur:function(){return I(!1)},onChange:Be}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:i,header:v}):y||(null==v?void 0:v.label)}))}))})),"right"!==v.align&&Ge,"right"!==v.align&&Ke,"right"!==v.align&&Je,!h&&Ue,U&&!be&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:U({accessor:v.accessor,colIndex:i,header:v,isOpen:xe,onClose:Le,position:Ne})}))]}))},Ge=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=N().collapsedHeaders,h=n.useMemo(function(){var e=[],n=1,r=function(o,i,c){var s,d;if(void 0===c&&(c=!1),!v({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;c||n++;var h=null!==(d=null===(s=o.children)||void 0===s?void 0:s.filter(function(e){return v({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==d?d:0,p=n,w=h>0?p+h:p+1;if(e.push({header:o,gridColumnStart:p,gridColumnEnd:w,gridRowStart:i,gridRowEnd:h>0?i+1:u+1,colIndex:t[o.accessor]}),o.children&&o.children.length>0){var m=!0;o.children.forEach(function(e){v({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(r(e,i+1,m),m=!1)})}return w-p},o=a.filter(function(e){return v({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(ge,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:h.map(function(n){return e.jsx(Ue,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===l,sort:s},n.header.accessor)})})}))}))},Ke=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ke)):1},Je=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,h=r.pinnedRightWidth,p=N(),w=p.headerContainerRef,m=p.pinnedLeftRef,g=p.pinnedRightRef,x=p.collapsedHeaders,b=n.useMemo(function(){return be({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(v({header:r,headers:n,collapsedHeaders:x})){var t=Ke(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:[oe(o,"left")&&e.jsx(Ge,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headers:o,maxDepth:I,pinned:"left",sectionRef:m,sort:d,width:f}),e.jsx(Ge,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:I,sectionRef:t,sort:d}),oe(o,"right")&&e.jsx(Ge,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:I,pinned:"right",sectionRef:g,sort:d,width:h})]}))},Ve=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){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});o.length>0?r({headers:o,flattenedHeaders:t}):t.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});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(" "))},_e=function(r){var t=r.pinnedLeftWidth,o=r.pinnedRightWidth,i=r.setScrollTop,a=r.sort,u=r.tableRows,l=r.rowsToRender,c=N(),s=c.columnResizing,d=c.editColumns,f=c.headers,v=c.collapsedHeaders,h=n.useRef(null),p=f.filter(function(e){return!e.pinned}),w=f.filter(function(e){return"left"===e.pinned}),m=f.filter(function(e){return"right"===e.pinned}),g=n.useMemo(function(){return Ve({headers:w,collapsedHeaders:v})},[w,v]),x=n.useMemo(function(){return Ve({headers:p,collapsedHeaders:v})},[p,v]),b=n.useMemo(function(){return Ve({headers:m,collapsedHeaders:v})},[m,v]),I={centerHeaderRef:h,headers:f,mainTemplateColumns:x,pinnedLeftColumns:w,pinnedLeftTemplateColumns:g,pinnedRightColumns:m,pinnedRightTemplateColumns:b,sort:a,pinnedLeftWidth:t,pinnedRightWidth:o},C={tableRows:u,mainTemplateColumns:x,pinnedLeftColumns:w,pinnedLeftTemplateColumns:g,pinnedLeftWidth:t,pinnedRightColumns:m,pinnedRightTemplateColumns:b,pinnedRightWidth:o,setScrollTop:i,rowsToRender:l};return e.jsxs("div",exports.__assign({className:"st-content ".concat(s?"st-resizeable":"st-not-resizeable"),style:{width:d?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Je,exports.__assign({},I)),e.jsx(Ie,exports.__assign({},C))]}))},Xe=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=N().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(ge,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(ge,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(ge,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},Ye={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 Ye.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?Ye.string(e,n,r):"number"==typeof e&&"number"==typeof n?Ye.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?Ye.boolean(e,n,r):Ye.string(e+"",n+"",r)}},$e=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 Ye.number(i,a,t)}return"date"===r?Ye.date(e+"",n+"",t):"boolean"===r?Ye.boolean(!!e,!!n,t):"enum"===r?Ye.enum(e+"",n+"",t):Ye.string(e+"",n+"",t)}(e[t],n[t],i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Qe=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}):$e({headers:o,rows:n,sortColumn:r}):n},Ze=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(Ze([s],n,r),!1===s.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},en=function(e){return e.every(function(e){return e.hide})},nn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(nn(e.children),en(e.children)&&(e.hide=!0))})},rn=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=N(),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&&en(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(se,exports.__assign({checked:x,onChange:function(e){l.hide=e,e?nn(t):(Ze(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,Ze(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(rn,{allHeaders:t,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!x||void 0},"".concat(n.accessor,"-").concat(r))})}))]})},tn=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(rn,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},on=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(tn,{headers:i,open:c,position:u})]})):null},an=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(me.Provider,exports.__assign({value:{registerPane:s,unregisterPane:d}},{children:t.default.Children.only(o)}))},un=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=X(e),v=X((t||"")+""),h=_(f),p=_(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 _(X((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 _(X((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}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},ln=function(e,n,r,t){var o=[],i=function(e){e.forEach(function(e){var r=t?e[t]:void 0;t&&r&&x(r)?i(r):null!=e[n]&&o.push(e[n])})};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}},cn=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},sn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},dn={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}},fn=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")},vn=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(){fn(e),e.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},hn=function(r){var t=r.allowAnimations,o=void 0!==t&&t,c=r.cellUpdateFlash,f=void 0!==c&&c,v=r.className,m=r.columnBorders,g=void 0!==m&&m,I=r.columnEditorPosition,R=void 0===I?"right":I,N=r.columnEditorText,H=void 0===N?"Columns":N,D=r.columnReordering,P=void 0!==D&&D,B=r.columnResizing,L=void 0!==B&&B,W=r.defaultHeaders,q=r.editColumns,z=void 0!==q&&q,j=r.editColumnsInitOpen,U=void 0!==j&&j,G=r.enableHeaderEditing,K=void 0!==G&&G,J=r.enableRowSelection,V=void 0!==J&&J,_=r.expandAll,X=void 0===_||_,Y=r.expandIcon,$=void 0===Y?e.jsx(E,{className:"st-expand-icon"}):Y,Q=r.externalFilterHandling,Z=void 0!==Q&&Q,ee=r.externalSortHandling,ne=void 0!==ee&&ee,te=r.filterIcon,oe=void 0===te?e.jsx(F,{className:"st-header-icon"}):te,ie=r.footerRenderer,ae=r.headerCollapseIcon,ue=void 0===ae?e.jsx(E,{className:"st-header-icon"}):ae,le=r.headerExpandIcon,ce=void 0===le?e.jsx(M,{className:"st-header-icon"}):le,se=r.headerDropdown,de=r.headerHeight,fe=r.height,ve=r.hideFooter,he=void 0!==ve&&ve,pe=r.isLoading,we=void 0!==pe&&pe,me=r.nextIcon,ge=void 0===me?e.jsx(E,{className:"st-next-prev-icon"}):me,xe=r.onCellEdit,be=r.onCellClick,Ie=r.onColumnOrderChange,Ce=r.onColumnSelect,ye=r.onFilterChange,Re=r.onGridReady,Se=r.onHeaderEdit,Ne=r.onLoadMore,Ae=r.onNextPage,Me=r.onPageChange,Ee=r.onRowSelectionChange,Te=r.onSortChange,He=r.prevIcon,ke=void 0===He?e.jsx(M,{className:"st-next-prev-icon"}):He,Fe=r.rowButtons,De=r.rowGrouping,Oe=r.rowHeight,Pe=void 0===Oe?32:Oe,Be=r.rowIdAccessor,Le=r.rows,We=r.selectionColumnWidth,qe=void 0===We?42:We,ze=r.rowsPerPage,je=void 0===ze?10:ze,Ue=r.selectableCells,Ge=void 0!==Ue&&Ue,Ke=r.selectableColumns,Je=void 0!==Ke&&Ke,Ve=r.serverSidePagination,Ye=void 0!==Ve&&Ve,Ze=r.shouldPaginate,en=void 0!==Ze&&Ze,nn=r.sortDownIcon,rn=void 0===nn?e.jsx(k,{className:"st-header-icon"}):nn,tn=r.sortUpIcon,sn=void 0===tn?e.jsx(T,{className:"st-header-icon"}):tn,fn=r.tableRef,vn=r.theme,hn=void 0===vn?"light":vn,pn=r.totalRowCount,wn=r.useHoverRowBackground,mn=void 0===wn||wn,gn=r.useOddEvenRowBackground,xn=void 0!==gn&&gn,bn=r.useOddColumnBackground,In=void 0!==bn&&bn;In&&(xn=!1),g&&(mn=!1);var Cn=n.useReducer(function(e){return e+1},0)[1],yn=n.useRef(null),Rn=n.useRef(null),Sn=n.useRef(null),Nn=n.useRef(null),An=n.useRef(null),Mn=n.useRef(null),En=n.useRef(null),Tn=n.useState(1),Hn=Tn[0],kn=Tn[1],Fn=n.useState(W),Dn=Fn[0],On=Fn[1],Pn=n.useState(!1),Bn=Pn[0],Ln=Pn[1],Wn=n.useState(!1),qn=Wn[0],zn=Wn[1],jn=n.useState(null),Un=jn[0],Gn=jn[1],Kn=n.useState(new Set),Jn=Kn[0],Vn=Kn[1];n.useEffect(function(){On(W)},[W]);var _n=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:Le,rowIdAccessor:Be,onRowSelectionChange:Ee,enableRowSelection:V}),Xn=_n.selectedRows,Yn=_n.setSelectedRows,$n=_n.isRowSelected,Qn=_n.areAllRowsSelected,Zn=_n.selectedRowCount,er=_n.selectedRowsData,nr=_n.handleRowSelect,rr=_n.handleSelectAll,tr=_n.handleToggleRow,or=_n.clearSelection,ir=n.useMemo(function(){var e,n=u([],Dn,!0);return V&&!(null===(e=null==Dn?void 0:Dn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:qe,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[V,Dn,qe]),ar=n.useState(0),ur=ar[0],lr=ar[1],cr=n.useState(new Set),sr=cr[0],dr=cr[1],fr=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:Mn}),vr=fr.scrollbarWidth,hr=fr.setScrollbarWidth,pr=n.useState(0),wr=pr[0],mr=pr[1];n.useLayoutEffect(function(){var e=function(){Mn.current&&mr(Mn.current.clientWidth)};e();var n=null;return Mn.current&&(n=new ResizeObserver(e)).observe(Mn.current),function(){n&&n.disconnect()}},[]);var gr=n.useMemo(function(){var e=l(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=p(e,o).reduce(function(e,n){return e+w(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:d(i),rightWidth:d(a),mainWidth:u,leftContentWidth:l,rightContentWidth:c}}({headers:ir,containerWidth:wr,maxPinnedWidthPercent:e,collapsedHeaders:Jn});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[ir,wr,Jn]),xr=gr.mainBodyWidth,br=gr.pinnedLeftWidth,Ir=gr.pinnedRightWidth,Cr=gr.pinnedLeftContentWidth,yr=gr.pinnedRightContentWidth,Rr=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:fe,rowHeight:Pe,shouldPaginate:en,rowsPerPage:je}),Sr=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 s(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&&x(u)){var l=i(u,r+1),c=exports.__assign({},n);return c[t]=l,e.forEach(function(e){var n=ln(l,e.accessor,e.aggregation,a);void 0!==n&&(c[e.accessor]=n)}),c}return n})};return i(n)},[r,t,o])}({rows:Le,headers:Dn,rowGrouping:De}),Nr=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 un({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 un({externalFilterHandling:t,tableRows:r,filterState:o})},[a,r,t]);return{filteredRows:l,updateFilter:c,clearFilter:s,clearAllFilters:d,filters:a,computeFilteredRowsPreview:f}}({rows:Sr,externalFilterHandling:Z,onFilterChange:ye}),Ar=Nr.filters,Mr=Nr.updateFilter,Er=Nr.clearFilter,Tr=Nr.clearAllFilters,Hr=Nr.computeFilteredRowsPreview,kr=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=$e({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(x(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 Qe({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"},Qe({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:Dn,tableRows:Nr.filteredRows,externalSortHandling:ne,onSortChange:Te,rowGrouping:De}),Fr=kr.sort,Dr=kr.sortedRows,Or=kr.updateSort,Pr=function(e){var r=e.allowAnimations,t=e.sortedRows,o=e.originalRows,i=e.currentPage,a=e.rowsPerPage,l=e.shouldPaginate,c=e.serverSidePagination,s=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,v=e.expandAll,h=e.contentHeight,p=e.rowHeight,w=e.scrollTop,m=e.computeFilteredRowsPreview,g=e.computeSortedRowsPreview,I=n.useState(!1),C=I[0],y=I[1],R=n.useState([]),S=R[0],N=R[1],A=n.useRef([]),M=n.useRef([]),E=n.useRef(new Map),T=n.useRef(null),H=n.useCallback(function(e){var n=l&&!c?e.slice((i-1)*a,i*a):e,r=l?(i-1)*a:0;return s&&0!==s.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=b({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 x(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:s,rowIdAccessor:d,unexpandedRows:f,expandAll:v,displayPositionOffset:r}):n.map(function(e,n){return{row:e,depth:0,displayPosition:r+n,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[i,a,l,c,s,d,f,v]);n.useMemo(function(){if(0===E.current.size){var e=H(o),n=new Map;e.forEach(function(e){var r=b({row:e.row,rowIdAccessor:d})+"";n.set(r,e.position)}),E.current=n}},[o,H,d]);var k=n.useMemo(function(){return H(t)},[t,H]),F=n.useMemo(function(){return O({bufferRowCount:5,contentHeight:h,tableRows:k,rowHeight:p,scrollTop:w})},[k,h,p,w]),D=n.useCallback(function(e,n){var r=new Set(e.map(function(e){return b({row:e.row,rowIdAccessor:d})+""})),t=new Set(n.map(function(e){return b({row:e.row,rowIdAccessor:d})+""}));return{staying:n.filter(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return r.has(n)}),entering:n.filter(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return!r.has(n)}),leaving:e.filter(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return!t.has(n)})}},[d]),P=n.useMemo(function(){if(0===A.current.length)return!1;var e=k.map(function(e){return b({row:e.row,rowIdAccessor:d})+""}),n=A.current.map(function(e){return b({row:e.row,rowIdAccessor:d})+""});return e.length!==n.length||!e.every(function(e,r){return e===n[r]})},[k,d]);n.useLayoutEffect(function(){if(!C){if(!r||l)return N([]),A.current=k,void(M.current=F);if(0===A.current.length)return N([]),A.current=k,void(M.current=F);if(!P)return N([]),A.current=k,void(M.current=F);T.current={tableRows:k,visibleRows:F},y(!0)}},[r,k,P,C,l,F]),n.useLayoutEffect(function(){if(C&&T.current&&S.length>0){var e=setTimeout(function(){var e=T.current;y(!1),N([]),A.current=e.tableRows,M.current=e.visibleRows,T.current=null},dn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[C,S.length]);var B=n.useMemo(function(){if(!r||l)return F;if(S.length>0){var e=new Map,n=new Map;return k.forEach(function(r){var t=b({row:r.row,rowIdAccessor:d})+"";e.set(t,r.position),n.set(t,r.displayPosition)}),S.map(function(r){var t=b({row:r.row,rowIdAccessor:d})+"",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 F},[F,S,k,r,l,d]),L=n.useCallback(function(e){if(r&&!l){var n=m(e),t=H(n),o=O({bufferRowCount:5,contentHeight:h,tableRows:t,rowHeight:p,scrollTop:w}),i=D(F,o).entering.map(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return k.find(function(e){return b({row:e.row,rowIdAccessor:d})+""===n})||e}).filter(Boolean);i.length>0&&N(u(u([],F,!0),i,!0))}},[r,l,m,H,h,p,w,D,k,F,d]),W=n.useCallback(function(e){if(r&&!l){var n=g(e),t=H(n),o=O({bufferRowCount:5,contentHeight:h,tableRows:t,rowHeight:p,scrollTop:w}),i=D(F,o).entering.map(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return k.find(function(e){return b({row:e.row,rowIdAccessor:d})+""===n})||e}).filter(Boolean);i.length>0&&N(u(u([],F,!0),i,!0))}},[r,l,g,H,h,p,w,D,k,F,d]);return{currentTableRows:k,currentVisibleRows:F,isAnimating:C,prepareForFilterChange:L,prepareForSortChange:W,rowsToRender:B}}({allowAnimations:o,sortedRows:Dr,originalRows:Sr,currentPage:Hn,rowsPerPage:je,shouldPaginate:en,serverSidePagination:Ye,rowGrouping:De,rowIdAccessor:Be,unexpandedRows:sr,expandAll:X,contentHeight:Rr,rowHeight:Pe,scrollTop:ur,computeFilteredRowsPreview:Hr,computeSortedRowsPreview:kr.computeSortedRowsPreview}),Br=Pr.currentTableRows,Lr=Pr.rowsToRender,Wr=Pr.prepareForFilterChange,qr=Pr.prepareForSortChange,zr=Pr.isAnimating,jr=n.useRef(new Map),Ur=n.useRef(new Map),Gr=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),w=h[0],m=h[1],g=n.useState(new Set),x=g[0],I=g[1],R=n.useState(null),S=R[0],N=R[1],A=n.useState(null),M=A[0],E=A[1],T=n.useState(new Set),H=T[0],k=T[1],F=n.useState(new Set),D=F[0],O=F[1],P=n.useState(!1),B=P[0],L=P[1],W=n.useRef(!1),q=n.useRef(null),z=n.useMemo(function(){var e=new Set;return w.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},[w,x]),j=n.useMemo(function(){var e=new Set;return w.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=b({row:n.row,rowIdAccessor:u});e.add(r+"")}),e},[w,x,o,u]),U=n.useMemo(function(){return t.flatMap(function(e){return p(e,s)})},[t,s]),G=n.useCallback(function(){if(0!==w.size){var e=function(e,n,r){var t=n.filter(function(e){return!e.hide}),o=new Map;t.forEach(function(e,n){o.set(n,e.accessor)});var i=Array.from(e).reduce(function(e,n){var t,i=n.split("-").map(Number),a=i[0],u=i[1];e[a]||(e[a]=[]);var l=o.get(u);return e[a][u]=l&&(null===(t=r[a])||void 0===t?void 0:t.row)?r[a].row[l]:"",e},{});return Object.values(i).map(function(e){return Object.values(e).join("\t")}).join("\n")}(w,U,o);navigator.clipboard.writeText(e),k(new Set(w)),setTimeout(function(){return k(new Set)},800)}},[w,U,o]),K=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(!M)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=b({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)}if(h.row[p.accessor]=m,a){var I="".concat(w,"-").concat(p.accessor),C=a.get(I);C&&C.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 R="".concat(c,"-").concat(v,"-").concat(w);l.add(R)}}})}),{updatedCells:u,warningCells:l}}(e,M,U,o,u,l,c),t=n.warningCells,(r=n.updatedCells).size>0&&(k(r),setTimeout(function(){return k(new Set)},800)),t.size>0&&(O(t),setTimeout(function(){return O(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[M,U,o,u,l,c]),J=n.useCallback(function(){if(0!==w.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=b({row:d.row,rowIdAccessor:t});if(null==f?void 0:f.isEditable){var h;if(d.row[f.accessor]=h="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),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}}(w,U,o,u,l,c),n=e.deletedCells,r=e.warningCells;n.size>0&&(k(n),setTimeout(function(){return k(new Set)},800)),r.size>0&&(O(r),setTimeout(function(){return O(new Set)},800))}},[w,U,o,u,l,c]),V=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=b({row:o[c].row,rowIdAccessor:u});r.add(y({colIndex:s,rowIndex:c,rowId:f}))}I(new Set),N(null),m(r),E(n),setTimeout(function(){return C(n,d)},0)},[o,u,d,v]),_=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(v?U.length:U.length-1)>=e.colIndex){var n=y(e);I(new Set),N(null),m(new Set([n])),E(e),setTimeout(function(){return C(e,d)},0)}},[U.length,o.length,d,v]),X=n.useCallback(function(e,n){void 0===n&&(n=!1),m(new Set),E(null),I(function(r){var t=new Set(n?r:[]);return e.forEach(function(e){return t.add(e)}),t}),e.length>0&&N(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 E=0;i.length>E;E++){var T=m?E+1:E,H=b({row:o[M].row,rowIdAccessor:a});A.add("".concat(M,"-").concat(T,"-").concat(H))}return c(A),s(new Set),void d(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void h();if(b({row:null===(u=o[l])||void 0===u?void 0:u.row,rowIdAccessor:a})!==N){var k=o.findIndex(function(e){return b({row:e.row,rowIdAccessor:a})===N});if(-1===k)return;l=k}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(),I(e,l)):"End"===e.key?(e.preventDefault(),C(e,l)):"PageUp"===e.key?(e.preventDefault(),y(e,l,S)):"PageDown"===e.key?(e.preventDefault(),R(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=b({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=b({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=b({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=b({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=b({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=b({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=b({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=b({row:o[n].row,rowIdAccessor:a}),u({rowIndex:n,colIndex:d,rowId:f}),p.current=null))},I=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=b({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=b({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:c,rowId:s}),p.current=null},C=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=b({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=b({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:s,rowId:d}),p.current=null},y=function(e,n,r){var i=Math.max(0,n-10);if(e.shiftKey){p.current||(p.current=t);var c=b({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=b({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:r,rowId:c}),p.current=null},R=function(e,n,r){var i=Math.min(o.length-1,n+10);if(e.shiftKey){p.current||(p.current=t);var c=b({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=b({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:M,tableRows:o,leafHeaders:U,rowIdAccessor:u,selectSingleCell:_,selectCellRange:V,setSelectedCells:m,setSelectedColumns:I,setLastSelectedColumnIndex:N,copyToClipboard:G,pasteFromClipboard:K,deleteSelectedCells:J,startCell:q,enableRowSelection:v});var Y=n.useCallback(function(e,n){var r=new Set,t=new Map;o.forEach(function(e,n){var r=b({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 w=f;h>=w;w++)if(p>=0&&o.length>p){if(v&&0===w)continue;var g=b({row:o[p].row,rowIdAccessor:u});r.add(y({colIndex:w,rowIndex:p,rowId:g}))}m(r)},[o,u,v]),$=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},[]),Q=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 $(e,n)},[$]),Z=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)))}},[]),ee=n.useCallback(function(e){var n=e.colIndex,r=y({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),t=w.has(r),o=x.has(n);return t||o},[w,x]),ne=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId;if(B)return"";var i=[],a=o[r-1]?b({row:o[r-1].row,rowIdAccessor:u}):null,l=o[r+1]?b({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||!ee(c)||x.has(n)&&0===r)&&i.push("st-selected-top-border"),(!s||!ee(s)||x.has(n)&&r===o.length-1)&&i.push("st-selected-bottom-border"),ee(d)||i.push("st-selected-left-border"),ee(f)||i.push("st-selected-right-border"),i.join(" ")},[B,ee,o,x,u]),re=n.useMemo(function(){return M?function(e){return e.rowIndex===M.rowIndex&&e.colIndex===M.colIndex&&e.rowId===M.rowId}:function(){return!1}},[M]),te=n.useCallback(function(e){var n=y({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return H.has(n)},[H]),oe=n.useCallback(function(e){var n=y({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return D.has(n)},[D]);return{getBorderClass:ne,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){W.current=!0,L(!0),q.current={rowIndex:t,colIndex:n,rowId:o},setTimeout(function(){I(new Set),N(null);var e=y({colIndex:n,rowIndex:t,rowId:o});m(new Set([e])),E({rowIndex:t,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,c=function(){if(W.current&&q.current){if(null!==i&&null!==a){Z(i,a);var e=Date.now();if(e-l>=16){var n=Q(i,a);n&&Y(q.current,n),l=e}}u=requestAnimationFrame(c)}else null!==u&&(cancelAnimationFrame(u),u=null)},s=function(e){W.current&&q.current&&(i=e.clientX,a=e.clientY)},d=function(){W.current=!1,L(!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&&W.current&&q.current&&Y(q.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:te,isWarningFlashing:oe,isInitialFocusedCell:re,isSelected:ee,lastSelectedColumnIndex:S,pasteFromClipboard:K,selectColumns:X,selectedCells:w,selectedColumns:x,setInitialFocusedCell:E,setSelectedCells:m,setSelectedColumns:I,deleteSelectedCells:J,columnsWithSelectedCells:z,rowsWithSelectedCells:j}}({selectableCells:Ge,headers:Dn,tableRows:Br,rowIdAccessor:Be,onCellEdit:xe,cellRegistry:jr.current,collapsedHeaders:Jn,rowHeight:Pe,enableRowSelection:V}),Kr=Gr.getBorderClass,Jr=Gr.handleMouseDown,Vr=Gr.handleMouseOver,_r=Gr.isCopyFlashing,Xr=Gr.isInitialFocusedCell,Yr=Gr.isSelected,$r=Gr.isWarningFlashing,Qr=Gr.selectColumns,Zr=Gr.selectedCells,et=Gr.selectedColumns,nt=Gr.setInitialFocusedCell,rt=Gr.setSelectedCells,tt=Gr.setSelectedColumns,ot=Gr.columnsWithSelectedCells,it=Gr.rowsWithSelectedCells,at=n.useCallback(function(e){qr(e),setTimeout(function(){Or(e)},0)},[qr,Or]),ut=n.useCallback(function(e){On(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:Je,selectedCells:Zr,selectedColumns:et,setSelectedCells:rt,setSelectedColumns:tt,activeHeaderDropdown:Un,setActiveHeaderDropdown:Gn}),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:Cn,tableBodyContainerRef:Mn,setScrollbarWidth:hr}),function(e){var r=e.onGridReady;n.useEffect(function(){null==r||r()},[r])}({onGridReady:Re}),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=b({row:o,rowIdAccessor:a}),u=h({rowId:i,accessor:n}),c=r.current.get(u);c&&c.updateContent(t),void 0!==o[n]&&(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 cn(e.label)}).join(",")],e.map(function(e){var n=e.row;return r.map(function(e){return cn(n[e.accessor])}).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:jr,currentTableRows:Br,headerRegistryRef:Ur,headers:ir,rowIdAccessor:Be,rows:Le,tableRef:fn,visibleRows:Lr}),function(e){var r=e.filters,t=e.onFilterChange;n.useEffect(function(){null==t||t(r)},[r,t])}({filters:Ar,onFilterChange:ye}),function(e){var r=e.sort,t=e.onSortChange,o=re(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:Fr,onSortChange:Te});var lt=n.useCallback(function(e){Wr(e),setTimeout(function(){Mr(e)},0)},[Wr,Mr]);return e.jsx(S,exports.__assign({value:{allowAnimations:o,areAllRowsSelected:Qn,cellRegistry:jr.current,cellUpdateFlash:f,clearSelection:or,collapsedHeaders:Jn,columnBorders:g,columnReordering:P,columnResizing:L,draggedHeaderRef:yn,editColumns:z,enableHeaderEditing:K,enableRowSelection:V,expandIcon:$,filterIcon:oe,filters:Ar,forceUpdate:Cn,getBorderClass:Kr,handleApplyFilter:lt,handleClearAllFilters:Tr,handleClearFilter:Er,handleMouseDown:Jr,handleMouseOver:Vr,handleRowSelect:nr,handleSelectAll:rr,handleToggleRow:tr,headerCollapseIcon:ue,headerContainerRef:En,headerDropdown:se,headerExpandIcon:ce,headerRegistry:Ur.current,headers:ir,hoveredHeaderRef:Rn,isAnimating:zr,isCopyFlashing:_r,isInitialFocusedCell:Xr,isLoading:we,isResizing:Bn,isRowSelected:$n,isScrolling:qn,isSelected:Yr,isWarningFlashing:$r,mainBodyRef:Sn,nextIcon:ge,onCellEdit:xe,onCellClick:be,onColumnOrderChange:Ie,onColumnSelect:Ce,onLoadMore:Ne,onSort:at,onTableHeaderDragEnd:ut,pinnedLeftRef:Nn,pinnedRightRef:An,prevIcon:ke,rowButtons:Fe,rowGrouping:De,rowHeight:Pe,headerHeight:null!=de?de:Pe,rowIdAccessor:Be,scrollbarWidth:vr,selectColumns:Qr,selectableColumns:Je,selectedColumns:et,columnsWithSelectedCells:ot,rowsWithSelectedCells:it,selectedRows:Xn,selectedRowCount:Zn,selectedRowsData:er,setCollapsedHeaders:Vn,setHeaders:On,setInitialFocusedCell:nt,setIsResizing:Ln,setIsScrolling:zn,setSelectedCells:rt,setSelectedColumns:tt,setSelectedRows:Yn,setUnexpandedRows:dr,shouldPaginate:en,sortDownIcon:rn,sortUpIcon:sn,tableBodyContainerRef:Mn,tableRows:Br,theme:hn,unexpandedRows:sr,useHoverRowBackground:mn,useOddColumnBackground:In,useOddEvenRowBackground:xn,activeHeaderDropdown:Un,setActiveHeaderDropdown:Gn,onHeaderEdit:Se}},{children:e.jsx("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(hn," ").concat(null!=v?v:""," ").concat(g?"st-column-borders":""),style:fe?{height:fe}:{}},{children:e.jsx(an,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(_e,{pinnedLeftWidth:br,pinnedRightWidth:Ir,setScrollTop:lr,sort:Fr,tableRows:Br,rowsToRender:Lr}),e.jsx(on,{columnEditorText:H,editColumns:z,editColumnsInitOpen:U,headers:Dn,position:R})]})),e.jsx(Xe,{mainBodyRef:Sn,mainBodyWidth:xr,pinnedLeftWidth:br,pinnedRightWidth:Ir,pinnedLeftContentWidth:Cr,pinnedRightContentWidth:yr,tableBodyContainerRef:Mn}),e.jsx(A,{currentPage:Hn,footerRenderer:ie,hideFooter:he,onPageChange:kn,onNextPage:Ae,onUserPageChange:Me,rowsPerPage:je,shouldPaginate:en,totalPages:Math.ceil((null!=pn?pn:Dr.length)/je),totalRows:null!=pn?pn:Dr.length})]}))})}))}))};exports.ANIMATION_CONFIGS=dn,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=M,exports.AngleRightIcon=E,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=T,exports.BUFFER_ROW_COUNT=5,exports.CheckIcon=H,exports.DescIcon=k,exports.FilterIcon=F,exports.SelectIcon=D,exports.SimpleTable=function(r){var t=n.useState(!1),o=t[0],i=t[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(hn,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,sn()&&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.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||sn()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=sn()?exports.__assign(exports.__assign({},dn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},dn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},dn.ROW_REORDER),u),fn(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,vn(n,i,r)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=re,exports.useTableContext=N;
2
- //# sourceMappingURL=index-20423ac1.js.map
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 480>e?.3:768>e?.4:.8},c=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},s=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,s(e.children)),n})},d=function(e){return void 0===e&&(e=0),e?e+1:0},f=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},v=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=s(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);return!!t&&(r.has(t.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)}(n,t,o))||null},h=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},p=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return p(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return p(e,n)}):[e]},w=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(f({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},m=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(f({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){m(e)})},g=function(e){return"number"==typeof e.minWidth?e.minWidth:40},x=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},b=function(e){return e.row[e.rowIdAccessor]},I=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)}},C=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&&I(n,r,t)},100);I(i,r,t)}},y=function(e){var n=e.colIndex,r=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(r)},R=n.createContext(void 0),S=function(n){return e.jsx(R.Provider,exports.__assign({value:n.value},{children:n.children}))},N=function(){var e=n.useContext(R);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},A=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=N(),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),A=!I,M=!C&&!c||!x&&y,E=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]}})})},T=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:T,onPrevPage:E,hasNextPage:!M,hasPrevPage:!A,nextIcon:w,prevIcon:m})});var k=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:[k.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(A?"disabled":""),onClick:E,disabled:A},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(M?"disabled":""),onClick:T,disabled:M},{children:w}))]}))]}))},M=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"})}))},E=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"})}))},T=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"})}))},H=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"})}))},k=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"})}))},F=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"})}))},D=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"})}))},O=function(e){var n=e.bufferRowCount,r=e.scrollTop,t=e.tableRows,o=e.rowHeight+1,i=r+e.contentHeight+o*n;return t.slice(Math.max(0,Math.floor(Math.max(0,r-o*n)/o)),Math.min(t.length,Math.ceil(i/o)))},P=function(e){return e.position*(e.rowHeight+1)-1},B=function(e){return e.position*(e.rowHeight+1)},L=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=N().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},W=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}))},q=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(L,exports.__assign({open:i,onClose:function(){t()},setOpen:a,width:120},{children:[e.jsx(W,exports.__assign({isSelected:!0===l,onClick:function(){return s(!0)}},{children:"True"})),e.jsx(W,exports.__assign({isSelected:!1===l,onClick:function(){return s(!1)}},{children:"False"}))]}))},z=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()}})},U=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-4e38eac4.js")})}),G=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-845e2188.js")})}),K=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(U,exports.__assign({},r))}))},J=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(G,exports.__assign({},r))}))},V=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)},_=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},X=function(e){if(!e)return new Date;if("string"==typeof e)return V(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:_(n)}return e instanceof Date?_(e):new Date},Y=function(e){return e?V(""+e):new Date},$=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(L,exports.__assign({open:i,onClose:l,setOpen:a,width:280},{children:e.jsx(J,{value:Y(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),t()},onClose:l})}))},Q=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(L,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(W,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)})}))}))},Z=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(q,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx($,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(Q,{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(z,{defaultValue:null==l?"":l+"",onBlur:c,onChange:o})},ee=0,ne=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();0!==ee&&t>o-ee||(ee=o,n(r))}},re=function(e){var r=n.useRef(e);return n.useEffect(function(){JSON.stringify(r.current)!==JSON.stringify(e)&&(r.current=e)},[e]),r.current},te=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(te);var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=te(e[r]));return n},oe=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ie=Date.now(),ae={screenX:0,screenY:0},ue=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=ue(o.children,n,u(u([],r,!0),[t],!1));if(i)return i}}return null},le=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};var ce=function(e){var n=e.draggedHeaderRef,r=e.headers,t=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=N().setHeaders,l=re(r);return{handleDragStart:function(e){n.current=e,ie=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-ae.screenX,2)+Math.pow(s-ae.screenY,2));t.current=a;var f,v=n.current,h=!1;if(le(v)!==le(a))f=(C=function(e,n,r){var t,o,i=te(e),a=!1;try{var u=le(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=ue(p,v.accessor),m=ue(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=te(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-ie||40>d)||(ie=y,ae={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)}}},se=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(H,{className:"st-checkbox-checkmark"})})),o]}))},de=function(e){var n=e.content,r=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===r.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?X(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},fe=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.rowIndex,d=r.tableRow,v=N(),p=v.cellRegistry,w=v.cellUpdateFlash,m=v.columnBorders,g=v.draggedHeaderRef,I=v.enableRowSelection,C=v.expandIcon,y=v.handleMouseDown,R=v.handleMouseOver,S=v.handleRowSelect,A=v.headers,M=v.hoveredHeaderRef,E=v.isCopyFlashing,T=v.isLoading,H=v.isRowSelected,k=v.isWarningFlashing,F=v.onCellEdit,D=v.onCellClick,O=v.onTableHeaderDragEnd,P=v.rowButtons,B=v.rowGrouping,L=v.rowIdAccessor,W=v.rowsWithSelectedCells,q=v.selectedColumns,z=v.setUnexpandedRows,j=v.tableBodyContainerRef,U=v.theme,G=v.unexpandedRows,J=v.useOddColumnBackground,V=d.depth,_=d.row,X=n.useState(_[a.accessor]),Y=X[0],$=X[1],Q=n.useState(!1),ee=Q[0],re=Q[1],te=n.useState(!1),oe=te[0],ie=te[1],ae=n.useState(!1),ue=ae[0],le=ae[1],fe=n.useRef(null),ve=b({row:_,rowIdAccessor:L}),he=B&&B[V],pe=!!he&&function(e,n){return!!n&&x(e[n])}(_,he),we=!G.has(ve+""),me=E({rowIndex:s,colIndex:o,rowId:ve}),ge=k({rowIndex:s,colIndex:o,rowId:ve}),xe=n.useMemo(function(){var e,n,r;if(!m)return!1;var t=A.filter(function(e){return"left"===e.pinned}),o=A.filter(function(e){return!e.pinned}),i=A.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},[m,A,a.accessor,a.pinned]),be=ce({draggedHeaderRef:g,headers:A,hoveredHeaderRef:M,onTableHeaderDragEnd:O}).handleDragOver,Ie=ne(),Ce=f({accessor:a.accessor,rowId:ve}),ye=h({rowId:ve,accessor:a.accessor}),Re=a.isSelectionColumn&&I;n.useEffect(function(){if(p){var e="".concat(ve,"-").concat(a.accessor);return p.set(e,{updateContent:function(e){Y!==e?($(e),w&&(ie(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){ie(!1)},800))):$(e)}}),function(){p.delete(e),fe.current&&clearTimeout(fe.current)}}},[p,w,ve,a.accessor,Y]),n.useEffect(function(){if(oe){var e=setTimeout(function(){ie(!1)},850);return function(){return clearTimeout(e)}}},[oe]),n.useEffect(function(){$(_[a.accessor])},[_,a.accessor]);var Se="boolean"===a.type||"date"===a.type||"enum"===a.type,Ne=!!(null==a?void 0:a.isEditable),Ae=q.has(o),Me=u&&!Ae,Ee=n.useMemo(function(){return!!Re&&W.has(ve+"")},[Re,W,ve]),Te="st-cell ".concat(V>0&&a.expandable?"st-cell-depth-".concat(V):""," ").concat(Me?l?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").concat(Ae?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ne?"clickable":""," ").concat(oe?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ge?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(J?c%2==0?"even-column":"odd-column":""," ").concat(Re?"st-selection-cell":""," ").concat(Ee?"st-selection-has-highlighted-cell":""," ").concat(xe?"st-last-column":""),He=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),$(e),_[a.accessor]=e,null==F||F({accessor:a.accessor,newValue:e,row:_,rowIndex:s})},[a.accessor,a.type,F,_,s]),ke=n.useCallback(function(){z(function(e){var n=new Set(e),r=ve+"";return n.has(r)?n.delete(r):n.add(r),n})},[ve,z]);return!ee||Se||Re?e.jsxs(K,exports.__assign({className:Te,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ve,"data-row-index":s,id:Ce,onClick:function(){D&&!Re&&D({accessor:a.accessor,colIndex:o,row:_,rowId:ve,rowIndex:s,value:Y})},onDoubleClick:function(){return a.isEditable&&!Re&&re(!0)},onDragOver:function(e){Re||Ie({callback:be,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){ee||Re||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||ee||(e.preventDefault(),re(!0))},onMouseDown:function(){ee||Re||y({rowIndex:s,colIndex:o,rowId:ve})},onMouseEnter:function(){le(!0)},onMouseLeave:function(){le(!1)},onMouseOver:function(){ee||Re||R({rowIndex:s,colIndex:o,rowId:ve})},parentRef:j,tableRow:d},{children:[a.expandable&&pe?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:ke},{children:C})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:T?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx("span",{children:Re?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ue||H&&H(ve+"")?e.jsx(se,{checked:!!H&&H(ve+""),onChange:function(e){S&&S(ve+"",e)}}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!P||!Re||0===P.length)return null;if(!(ue||H&&H(ve+"")))return null;var n={row:_};return e.jsx("div",exports.__assign({className:"st-row-buttons"},{children:P.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:_,theme:U}):de({content:Y,header:a})})})),!T&&ee&&Se&&!Re&&e.jsx(Z,{enumOptions:a.enumOptions,onChange:He,setIsEditing:re,type:a.type,value:Y})]}),ye):e.jsx("div",exports.__assign({className:"st-cell-editing",id:f({accessor:a.accessor,rowId:ve}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(Z,{enumOptions:a.enumOptions,onChange:He,setIsEditing:re,type:a.type,value:Y})}))},ve=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=N(),d=s.rowIdAccessor,h=s.collapsedHeaders,p=o.filter(function(e){return v({header:e,pinned:i,headers:o,collapsedHeaders:h})});return e.jsx(e.Fragment,{children:p.map(function(n,s){var v=b({row:c.row,rowIdAccessor:d}),h=f({accessor:n.accessor,rowId:v});return e.jsx(he,{columnIndices:t,displayRowNumber:u,header:n,headers:o,nestedIndex:s+(null!=r?r:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:c},h)})})},he=function(r){var t=r.columnIndices,o=r.displayRowNumber,i=r.header,a=r.headers,u=r.nestedIndex,l=r.pinned,c=r.rowIndex,s=r.rowIndices,d=r.tableRow,h=t[i.accessor],p=N(),w=p.getBorderClass,m=p.isSelected,g=p.isInitialFocusedCell,x=p.collapsedHeaders,I=b({row:d.row,rowIdAccessor:p.rowIdAccessor});if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return v({header:e,pinned:l,headers:a,collapsedHeaders:x})});return e.jsx(n.Fragment,{children:C.map(function(n){var r=f({accessor:n.accessor,rowId:I});return e.jsx(he,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,pinned:l,rowIndex:c,rowIndices:s,tableRow:d},r)})})}var y={rowIndex:c,colIndex:h,rowId:I},R=w(y),S=m(y),A=g(y),M=f({accessor:i.accessor,rowId:I});return e.jsx(fe,{borderClass:R,colIndex:h,displayRowNumber:o,header:i,isHighlighted:S,isInitialFocused:A,nestedIndex:u,rowIndex:c,tableRow:d},M)},pe=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=N(),v=f.useHoverRowBackground,h=f.isAnimating,p=f.isRowSelected,w=f.useOddEvenRowBackground,m=d.position,g=d.displayPosition,x=m%2==0,I=b({row:d.row,rowIdAccessor:f.rowIdAccessor}),C=!!p&&p(I+"");return e.jsx("div",exports.__assign({className:"st-row ".concat(w?x?"even":"odd":""," ").concat(C?"selected":""),"data-index":a,onMouseEnter:function(){!h&&v&&s(a)},style:{gridTemplateColumns:o,top:B({position:m,rowHeight:l}),height:"".concat(l,"px")}},{children:e.jsx(ve,{columnIndexStart:t,columnIndices:r,displayRowNumber:g,headers:i,pinned:u,rowIndex:m,rowIndices:c,tableRow:d},I)}))},we=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,top:P({position:o,rowHeight:i})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},me=n.createContext(void 0),ge=function(e){var r=e.childRef,t=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(me);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}})},xe=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=N().rowIdAccessor,m=n.useRef(null);return n.useImperativeHandle(t,function(){return m.current},[]),n.useMemo(function(){return oe(a,u)},[a,u])?e.jsx(ge,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=b({row:r.row,rowIdAccessor:w});return e.jsxs(n.Fragment,{children:[0!==t&&e.jsx(we,{displayStrongBorder:r.isLastGroupRow,position:r.position,rowHeight:l,templateColumns:d,rowIndex:t-1}),e.jsx(pe,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:t,pinned:u,rowHeight:l,rowIndices:c,setHoveredIndex:s,tableRow:r},f)]},f)})}))})):null});function be(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 v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return r.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&v({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n&&0===r.length)}),t.forEach(function(e){c(e,!1)}),i}xe.displayName="TableSection";var Ie=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.tableRows,v=N(),h=v.collapsedHeaders,p=v.headerContainerRef,w=v.headers,m=v.isAnimating,g=v.mainBodyRef,x=v.onLoadMore,I=v.rowHeight,C=v.rowIdAccessor,y=v.scrollbarWidth,R=v.setIsScrolling,S=v.shouldPaginate,A=v.tableBodyContainerRef,M=n.useState(!1),E=M[0],T=M[1],H=n.useRef(new Set),k=n.useCallback(function(e){H.current.forEach(function(e){return e.classList.remove("hovered")}),H.current.clear(),null!==e&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),H.current.add(e)})},[]);n.useEffect(function(){m&&k(null)},[m,k]),function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];n.useEffect(function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[r,a,o]),n.useEffect(function(){var e=null==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])}({headerContainerRef:p,mainSectionRef:A,scrollbarWidth:y}),n.useEffect(function(){return function(){D.current&&clearTimeout(D.current)}},[]);var F=n.useRef(null),D=n.useRef(null),O=n.useRef(0),P=function(e){return e.length}(f),B=P*(I+1)-1,L=n.useMemo(function(){return be({headers:w,pinnedLeftColumns:o,pinnedRightColumns:u,collapsedHeaders:h})},[w,o,u,h]),W=n.useMemo(function(){var e={};return s.forEach(function(n,r){var t=b({row:n.row,rowIdAccessor:C})+"";e[t]=r}),e},[s,C]),q=n.useCallback(function(e,n){!x||S||E||200>=e.scrollHeight-(n+e.clientHeight)&&n>O.current&&(T(!0),x(),setTimeout(function(){T(!1)},1e3))},[x,S,E]),z={columnIndices:L,headerContainerRef:p,headers:w,rowHeight:I,rowIndices:W,rowsToRender:s,setHoveredIndex:k};return e.jsxs("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return k(null)},onScroll:function(e){var n=e.currentTarget,r=n.scrollTop;R(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(function(){R(!1)},150),F.current&&cancelAnimationFrame(F.current),F.current=requestAnimationFrame(function(){d(r),q(n,r),O.current=r})},ref:A},{children:[e.jsx(xe,exports.__assign({},z,{pinned:"left",templateColumns:i,totalHeight:B,width:a})),e.jsx(xe,exports.__assign({},z,{columnIndexStart:o.length,ref:g,templateColumns:t,totalHeight:B})),e.jsx(xe,exports.__assign({},z,{columnIndexStart:o.length+t.length,pinned:"right",templateColumns:l,totalHeight:B,width:c}))]}))},Ce=function(e){var n=e.event,r=e.header,t=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,c=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=g(r);if(r.children&&r.children.length>0){var h=p(r,c);f=h.length>0?h:[r]}else f=[r];var x=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*l(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+p(n,t).reduce(function(e,n){return e+w(n)},0)},0),c=g(n);return c>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):u}({header:r,headers:t,collapsedHeaders:c});f.length>1?ye({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){m(e)});var d=u([],t,!0);o(d)};if(d){var b=function(e){x(e.touches[0].clientX)},I=function(){document.removeEventListener("touchmove",b),document.removeEventListener("touchend",I),i(!1)};document.addEventListener("touchmove",b),document.addEventListener("touchend",I)}else{var C=function(e){x(e.clientX)},y=function(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",y),i(!1)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",y)}}},ye=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,g(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)})},Re={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Se=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"]}},Ne=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ae=function(e){return["between","notBetween","in","notIn"].includes(e)},Me=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ee=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},Te=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(D,{})]})),e.jsx(L,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)})}))}))]}))},He=function(n){var r=n.value,t=n.onChange,o=n.operators.map(function(e){return{value:e,label:Re[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(Te,{value:r,onChange:function(e){t(e)},options:o})}))},ke=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()})},Fe=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}))},De=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"}))]}))},Oe=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=Se("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},Ne(l)&&{value:d});i(e)},p=Me(l)||d.trim();return e.jsxs(Ee,{children:[e.jsx(He,{value:l,onChange:c,operators:v}),Ne(l)&&e.jsx(Fe,{children:e.jsx(ke,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:h})}),e.jsx(De,{onApply:h,onClear:a,canApply:!!p,showClear:!!o})]})},Pe=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=Se("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};Ne(s)?e.value=parseFloat(v):Ae(s)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(Ee,{children:[e.jsx(He,{value:s,onChange:d,operators:I}),Ne(s)&&e.jsx(Fe,{children:e.jsx(ke,{type:"number",value:v,onChange:h,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Ae(s)&&e.jsxs(Fe,{children:[e.jsx(ke,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(ke,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(De,{onApply:C,onClear:l,canApply:!!Me(s)||(Ne(s)?""!==v.trim():!!Ae(s)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},Be=function(n){var r=n.className;return e.jsx(Te,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===r?"":r,placeholder:n.placeholder})},Le=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=Se("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?o.value+"":"true")):(c("equals"),f("true"))},[o]);var h=Me(l)||""!==d;return e.jsxs(Ee,{children:[e.jsx(He,{value:l,onChange:c,operators:v}),Ne(l)&&e.jsx(Fe,{children:e.jsx(Be,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(De,{onApply:function(){var e={accessor:t.accessor,operator:l};Ne(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:h,showClear:!!o})]})},We=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=Se("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=X(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?X(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(L,exports.__assign({open:c,setOpen:s,onClose:function(){s(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(J,{value:p,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),s(!1)},onClose:function(){return s(!1)}})}))]}))};return e.jsxs(Ee,{children:[e.jsx(He,{value:s,onChange:d,operators:I}),Ne(s)&&e.jsx(Fe,{children:e.jsx(C,{value:v,onChange:h,placeholder:"Select date...",autoFocus:!0})}),Ae(s)&&e.jsxs(Fe,{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(De,{onApply:function(){var e={accessor:i.accessor,operator:s};Ne(s)?e.value=v:Ae(s)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!Me(s)||(Ne(s)?""!==v.trim():!!Ae(s)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},qe=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(Ee,{children:[e.jsx(Fe,{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(se,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(ke,{type:"text",value:h,onChange:p,placeholder:"Search..."})})),w.map(function(n,r){return e.jsx(se,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(De,{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})]})},ze=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(Pe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Le,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(We,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(qe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Oe,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i})}}()})},je=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}))]})},Ue=function(r){var t,o,i=r.colIndex,a=r.gridColumnEnd,l=r.gridColumnStart,s=r.gridRowEnd,d=r.gridRowStart,v=r.header,h=r.reverse,p=r.sort,w=n.useState(!1),m=w[0],g=w[1],x=n.useState(!1),b=x[0],I=x[1],C=n.useState(v.label||""),y=C[0],R=C[1],S=N(),A=S.activeHeaderDropdown,M=S.areAllRowsSelected,E=S.collapsedHeaders,T=S.columnBorders,H=S.columnReordering,k=S.columnResizing,F=S.columnsWithSelectedCells,D=S.draggedHeaderRef,O=S.enableHeaderEditing,P=S.filterIcon,B=S.handleApplyFilter,W=S.handleClearFilter,q=S.handleSelectAll,j=S.headerCollapseIcon,U=S.headerDropdown,G=S.headerExpandIcon,J=S.headerRegistry,V=S.headers,_=S.hoveredHeaderRef,X=S.onColumnOrderChange,Y=S.onColumnSelect,$=S.onHeaderEdit,Q=S.onSort,Z=S.onTableHeaderDragEnd,ee=S.headerHeight,re=S.selectColumns,te=S.selectableColumns,oe=S.selectedColumns,ie=S.setActiveHeaderDropdown,ae=S.setCollapsedHeaders,ue=S.setHeaders,le=S.setInitialFocusedCell,de=S.setIsResizing,fe=S.setSelectedCells,ve=S.setSelectedColumns,he=S.sortDownIcon,pe=S.sortUpIcon,we=!!(null==v?void 0:v.isSortable),me=!!(null==v?void 0:v.filterable),ge=S.filters[v.accessor],xe=(null==A?void 0:A.accessor)===v.accessor,be=v.isSelectionColumn&&S.enableRowSelection,Ie=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(v),ye=E.has(v.accessor),Re=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:xe,estimatedHeight:200,estimatedWidth:250,margin:4}),Se=Re.triggerRef,Ne=Re.position,Ae=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]),Me=n.useMemo(function(){return!(!te||be)&&c(v,i).some(function(e){return oe.has(e)})},[te,be,v,i,oe]),Ee=n.useMemo(function(){return!be&&c(v,i).some(function(e){return F.has(e)})},[be,v,i,F]),Te=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!ye||v.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[v.children,ye]),He="st-header-cell ".concat(v.accessor===(null===(t=_.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(o=D.current)||void 0===o?void 0:o.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(H&&!we?"columnReordering":""," ").concat(Te?"parent":""," ").concat(Ae?"st-last-column":""," ").concat(O&&!be?"st-header-editable":""," ").concat(Me?"st-header-selected":""," ").concat(Ee&&!Me?"st-header-has-highlighted-cell":""),ke=ce({draggedHeaderRef:D,headers:V,hoveredHeaderRef:_,onColumnOrderChange:X,onTableHeaderDragEnd:Z}),Fe=ke.handleDragStart,De=ke.handleDragEnd,Oe=ke.handleDragOver,Pe=ne();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=v.accessor+"";return J.set(e,{setEditing:function(e){I(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){R(v.label||"")},[v.label]);var Be=n.useCallback(function(e){R(e);var n=V.map(function(n){return n.accessor===v.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});ue(n),$&&$(v,e)},[V,ue,$,v]),Le=n.useCallback(function(){ie&&ie(null)},[ie]),We=n.useCallback(function(e){e.stopPropagation(),ae(function(e){var n=new Set(e);return ye?n.delete(v.accessor):n.add(v.accessor),n})},[ae,ye,v.accessor]),qe=function(e){var n=e.event,r=e.header;if(!r.isSelectionColumn){if(te){var t=c(r,i),o=t.some(function(e){return oe.has(e)});if(O&&o&&!n.shiftKey)return U&&xe&&Le(),void I(!0);n.shiftKey&&re?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))}):re&&re(t),fe(new Set),le(null)}Y&&Y(r),!te&&r.isSortable&&Q(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 Ue=k&&!be&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,r=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Pe({callback:Ce,callbackProps:{event:e.nativeEvent,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:ue,setIsResizing:de,startWidth:r,collapsedHeaders:E},limit:10})},onTouchStart:function(e){var n,r=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Pe({callback:Ce,callbackProps:{event:e,gridColumnEnd:a,gridColumnStart:l,header:v,headers:V,setHeaders:ue,setIsResizing:de,startWidth:r,collapsedHeaders:E},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ge=p&&p.key.accessor===v.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return qe({event:e,header:v})}},{children:["ascending"===p.direction&&pe&&pe,"descending"===p.direction&&he&&he]})),Ke=me&&P&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){e.stopPropagation(),g(!m)}},{children:[n.cloneElement(P,{style:{fill:ge?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(L,exports.__assign({open:m,overflow:"visible",setOpen:g,onClose:function(){return g(!1)}},{children:e.jsx(ze,{header:v,currentFilter:ge,onApplyFilter:function(e){B(e),g(!1)},onClearFilter:function(){W(v.accessor),g(!1)}})}))]})),Je=Ie&&!be&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:We},{children:ye?j:G}));return e.jsxs(K,exports.__assign({className:He,id:f({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){be||Pe({callback:Oe,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:exports.__assign({gridRowStart:d,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-d>1?{}:{height:ee})},{children:[h&&Ue,"right"===v.align&&Je,"right"===v.align&&Ke,"right"===v.align&&Ge,e.jsx("div",exports.__assign({ref:Se,className:"st-header-label",draggable:H&&!v.disableReorder&&!be,onClick:function(e){be||qe({event:e,header:v})},onDoubleClick:function(e){be||function(e){var n=e.header;n.isSelectionColumn||te&&n.isSortable&&Q(n.accessor)}({event:e,header:v})},onDragEnd:be?void 0:function(e){e.preventDefault(),De()},onDragStart:be?void 0:function(e){H&&v&&function(e){Fe(e)}(v)}},{children:e.jsx(je,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:be?e.jsx(se,{checked:!!M&&M(),onChange:function(e){q&&q(e)}}):b?e.jsx(z,{defaultValue:y,onBlur:function(){return I(!1)},onChange:Be}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:i,header:v}):y||(null==v?void 0:v.label)}))}))})),"right"!==v.align&&Ge,"right"!==v.align&&Ke,"right"!==v.align&&Je,!h&&Ue,U&&!be&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:U({accessor:v.accessor,colIndex:i,header:v,isOpen:xe,onClose:Le,position:Ne})}))]}))},Ge=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=N().collapsedHeaders,h=n.useMemo(function(){var e=[],n=1,r=function(o,i,c){var s,d;if(void 0===c&&(c=!1),!v({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;c||n++;var h=null!==(d=null===(s=o.children)||void 0===s?void 0:s.filter(function(e){return v({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==d?d:0,p=n,w=h>0?p+h:p+1;if(e.push({header:o,gridColumnStart:p,gridColumnEnd:w,gridRowStart:i,gridRowEnd:h>0?i+1:u+1,colIndex:t[o.accessor]}),o.children&&o.children.length>0){var m=!0;o.children.forEach(function(e){v({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(r(e,i+1,m),m=!1)})}return w-p},o=a.filter(function(e){return v({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(ge,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:h.map(function(n){return e.jsx(Ue,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===l,sort:s},n.header.accessor)})})}))}))},Ke=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ke)):1},Je=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,h=r.pinnedRightWidth,p=N(),w=p.headerContainerRef,m=p.pinnedLeftRef,g=p.pinnedRightRef,x=p.collapsedHeaders,b=n.useMemo(function(){return be({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(v({header:r,headers:n,collapsedHeaders:x})){var t=Ke(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:[oe(o,"left")&&e.jsx(Ge,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headers:o,maxDepth:I,pinned:"left",sectionRef:m,sort:d,width:f}),e.jsx(Ge,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:I,sectionRef:t,sort:d}),oe(o,"right")&&e.jsx(Ge,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:I,pinned:"right",sectionRef:g,sort:d,width:h})]}))},Ve=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){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});o.length>0?r({headers:o,flattenedHeaders:t}):t.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});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(" "))},_e=function(r){var t=r.pinnedLeftWidth,o=r.pinnedRightWidth,i=r.setScrollTop,a=r.sort,u=r.tableRows,l=r.rowsToRender,c=N(),s=c.columnResizing,d=c.editColumns,f=c.headers,v=c.collapsedHeaders,h=n.useRef(null),p=f.filter(function(e){return!e.pinned}),w=f.filter(function(e){return"left"===e.pinned}),m=f.filter(function(e){return"right"===e.pinned}),g=n.useMemo(function(){return Ve({headers:w,collapsedHeaders:v})},[w,v]),x=n.useMemo(function(){return Ve({headers:p,collapsedHeaders:v})},[p,v]),b=n.useMemo(function(){return Ve({headers:m,collapsedHeaders:v})},[m,v]),I={centerHeaderRef:h,headers:f,mainTemplateColumns:x,pinnedLeftColumns:w,pinnedLeftTemplateColumns:g,pinnedRightColumns:m,pinnedRightTemplateColumns:b,sort:a,pinnedLeftWidth:t,pinnedRightWidth:o},C={tableRows:u,mainTemplateColumns:x,pinnedLeftColumns:w,pinnedLeftTemplateColumns:g,pinnedLeftWidth:t,pinnedRightColumns:m,pinnedRightTemplateColumns:b,pinnedRightWidth:o,setScrollTop:i,rowsToRender:l};return e.jsxs("div",exports.__assign({className:"st-content ".concat(s?"st-resizeable":"st-not-resizeable"),style:{width:d?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Je,exports.__assign({},I)),e.jsx(Ie,exports.__assign({},C))]}))},Xe=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=N().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(ge,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(ge,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(ge,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},Ye={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 Ye.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?Ye.string(e,n,r):"number"==typeof e&&"number"==typeof n?Ye.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?Ye.boolean(e,n,r):Ye.string(e+"",n+"",r)}},$e=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 Ye.number(i,a,t)}return"date"===r?Ye.date(e+"",n+"",t):"boolean"===r?Ye.boolean(!!e,!!n,t):"enum"===r?Ye.enum(e+"",n+"",t):Ye.string(e+"",n+"",t)}(e[t],n[t],i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Qe=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}):$e({headers:o,rows:n,sortColumn:r}):n},Ze=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(Ze([s],n,r),!1===s.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},en=function(e){return e.every(function(e){return e.hide})},nn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(nn(e.children),en(e.children)&&(e.hide=!0))})},rn=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=N(),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&&en(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(se,exports.__assign({checked:x,onChange:function(e){l.hide=e,e?nn(t):(Ze(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,Ze(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(rn,{allHeaders:t,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!x||void 0},"".concat(n.accessor,"-").concat(r))})}))]})},tn=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(rn,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},on=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(tn,{headers:i,open:c,position:u})]})):null},an=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(me.Provider,exports.__assign({value:{registerPane:s,unregisterPane:d}},{children:t.default.Children.only(o)}))},un=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=X(e),v=X((t||"")+""),h=_(f),p=_(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 _(X((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 _(X((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}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},ln=function(e,n,r,t){var o=[],i=function(e){e.forEach(function(e){var r=t?e[t]:void 0;t&&r&&x(r)?i(r):null!=e[n]&&o.push(e[n])})};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}},cn=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},sn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},dn={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}},fn=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")},vn=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(){fn(e),e.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},hn=function(r){var t=r.allowAnimations,o=void 0!==t&&t,c=r.cellUpdateFlash,f=void 0!==c&&c,v=r.className,m=r.columnBorders,g=void 0!==m&&m,I=r.columnEditorPosition,R=void 0===I?"right":I,N=r.columnEditorText,H=void 0===N?"Columns":N,D=r.columnReordering,P=void 0!==D&&D,B=r.columnResizing,L=void 0!==B&&B,W=r.defaultHeaders,q=r.editColumns,z=void 0!==q&&q,j=r.editColumnsInitOpen,U=void 0!==j&&j,G=r.enableHeaderEditing,K=void 0!==G&&G,J=r.enableRowSelection,V=void 0!==J&&J,_=r.expandAll,X=void 0===_||_,Y=r.expandIcon,$=void 0===Y?e.jsx(E,{className:"st-expand-icon"}):Y,Q=r.externalFilterHandling,Z=void 0!==Q&&Q,ee=r.externalSortHandling,ne=void 0!==ee&&ee,te=r.filterIcon,oe=void 0===te?e.jsx(F,{className:"st-header-icon"}):te,ie=r.footerRenderer,ae=r.headerCollapseIcon,ue=void 0===ae?e.jsx(E,{className:"st-header-icon"}):ae,le=r.headerExpandIcon,ce=void 0===le?e.jsx(M,{className:"st-header-icon"}):le,se=r.headerDropdown,de=r.headerHeight,fe=r.height,ve=r.hideFooter,he=void 0!==ve&&ve,pe=r.isLoading,we=void 0!==pe&&pe,me=r.nextIcon,ge=void 0===me?e.jsx(E,{className:"st-next-prev-icon"}):me,xe=r.onCellEdit,be=r.onCellClick,Ie=r.onColumnOrderChange,Ce=r.onColumnSelect,ye=r.onFilterChange,Re=r.onGridReady,Se=r.onHeaderEdit,Ne=r.onLoadMore,Ae=r.onNextPage,Me=r.onPageChange,Ee=r.onRowSelectionChange,Te=r.onSortChange,He=r.prevIcon,ke=void 0===He?e.jsx(M,{className:"st-next-prev-icon"}):He,Fe=r.rowButtons,De=r.rowGrouping,Oe=r.rowHeight,Pe=void 0===Oe?32:Oe,Be=r.rowIdAccessor,Le=r.rows,We=r.selectionColumnWidth,qe=void 0===We?42:We,ze=r.rowsPerPage,je=void 0===ze?10:ze,Ue=r.selectableCells,Ge=void 0!==Ue&&Ue,Ke=r.selectableColumns,Je=void 0!==Ke&&Ke,Ve=r.serverSidePagination,Ye=void 0!==Ve&&Ve,Ze=r.shouldPaginate,en=void 0!==Ze&&Ze,nn=r.sortDownIcon,rn=void 0===nn?e.jsx(k,{className:"st-header-icon"}):nn,tn=r.sortUpIcon,sn=void 0===tn?e.jsx(T,{className:"st-header-icon"}):tn,fn=r.tableRef,vn=r.theme,hn=void 0===vn?"light":vn,pn=r.totalRowCount,wn=r.useHoverRowBackground,mn=void 0===wn||wn,gn=r.useOddEvenRowBackground,xn=void 0!==gn&&gn,bn=r.useOddColumnBackground,In=void 0!==bn&&bn;In&&(xn=!1),g&&(mn=!1);var Cn=n.useReducer(function(e){return e+1},0)[1],yn=n.useRef(null),Rn=n.useRef(null),Sn=n.useRef(null),Nn=n.useRef(null),An=n.useRef(null),Mn=n.useRef(null),En=n.useRef(null),Tn=n.useState(1),Hn=Tn[0],kn=Tn[1],Fn=n.useState(W),Dn=Fn[0],On=Fn[1],Pn=n.useState(!1),Bn=Pn[0],Ln=Pn[1],Wn=n.useState(!1),qn=Wn[0],zn=Wn[1],jn=n.useState(null),Un=jn[0],Gn=jn[1],Kn=n.useState(new Set),Jn=Kn[0],Vn=Kn[1];n.useEffect(function(){On(W)},[W]);var _n=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:Le,rowIdAccessor:Be,onRowSelectionChange:Ee,enableRowSelection:V}),Xn=_n.selectedRows,Yn=_n.setSelectedRows,$n=_n.isRowSelected,Qn=_n.areAllRowsSelected,Zn=_n.selectedRowCount,er=_n.selectedRowsData,nr=_n.handleRowSelect,rr=_n.handleSelectAll,tr=_n.handleToggleRow,or=_n.clearSelection,ir=n.useMemo(function(){var e,n=u([],Dn,!0);return V&&!(null===(e=null==Dn?void 0:Dn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:qe,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[V,Dn,qe]),ar=n.useState(0),ur=ar[0],lr=ar[1],cr=n.useState(new Set),sr=cr[0],dr=cr[1],fr=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:Mn}),vr=fr.scrollbarWidth,hr=fr.setScrollbarWidth,pr=n.useState(0),wr=pr[0],mr=pr[1];n.useLayoutEffect(function(){var e=function(){Mn.current&&mr(Mn.current.clientWidth)};e();var n=null;return Mn.current&&(n=new ResizeObserver(e)).observe(Mn.current),function(){n&&n.disconnect()}},[]);var gr=n.useMemo(function(){var e=l(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=p(e,o).reduce(function(e,n){return e+w(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:d(i),rightWidth:d(a),mainWidth:u,leftContentWidth:l,rightContentWidth:c}}({headers:ir,containerWidth:wr,maxPinnedWidthPercent:e,collapsedHeaders:Jn});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[ir,wr,Jn]),xr=gr.mainBodyWidth,br=gr.pinnedLeftWidth,Ir=gr.pinnedRightWidth,Cr=gr.pinnedLeftContentWidth,yr=gr.pinnedRightContentWidth,Rr=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:fe,rowHeight:Pe,shouldPaginate:en,rowsPerPage:je}),Sr=n.useMemo(function(){return we&&0===Le.length?Array.from({length:en?je:Math.max(Math.floor(Rr/Pe),5)},function(e,n){var r,t=((r={})[Be]="loading-".concat(n),r);return ir.forEach(function(e){e.isSelectionColumn||(t[e.accessor]="")}),t}):Le},[we,Le,Be,ir,en,je,Rr,Pe]),Nr=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 s(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&&x(u)){var l=i(u,r+1),c=exports.__assign({},n);return c[t]=l,e.forEach(function(e){var n=ln(l,e.accessor,e.aggregation,a);void 0!==n&&(c[e.accessor]=n)}),c}return n})};return i(n)},[r,t,o])}({rows:Sr,headers:Dn,rowGrouping:De}),Ar=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 un({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 un({externalFilterHandling:t,tableRows:r,filterState:o})},[a,r,t]);return{filteredRows:l,updateFilter:c,clearFilter:s,clearAllFilters:d,filters:a,computeFilteredRowsPreview:f}}({rows:Nr,externalFilterHandling:Z,onFilterChange:ye}),Mr=Ar.filters,Er=Ar.updateFilter,Tr=Ar.clearFilter,Hr=Ar.clearAllFilters,kr=Ar.computeFilteredRowsPreview,Fr=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=$e({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(x(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 Qe({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"},Qe({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:Dn,tableRows:Ar.filteredRows,externalSortHandling:ne,onSortChange:Te,rowGrouping:De}),Dr=Fr.sort,Or=Fr.sortedRows,Pr=Fr.updateSort,Br=function(e){var r=e.allowAnimations,t=e.sortedRows,o=e.originalRows,i=e.currentPage,a=e.rowsPerPage,l=e.shouldPaginate,c=e.serverSidePagination,s=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,v=e.expandAll,h=e.contentHeight,p=e.rowHeight,w=e.scrollTop,m=e.computeFilteredRowsPreview,g=e.computeSortedRowsPreview,I=n.useState(!1),C=I[0],y=I[1],R=n.useState([]),S=R[0],N=R[1],A=n.useRef([]),M=n.useRef([]),E=n.useRef(new Map),T=n.useRef(null),H=n.useCallback(function(e){var n=l&&!c?e.slice((i-1)*a,i*a):e,r=l?(i-1)*a:0;return s&&0!==s.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=b({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 x(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:s,rowIdAccessor:d,unexpandedRows:f,expandAll:v,displayPositionOffset:r}):n.map(function(e,n){return{row:e,depth:0,displayPosition:r+n,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[i,a,l,c,s,d,f,v]);n.useMemo(function(){if(0===E.current.size){var e=H(o),n=new Map;e.forEach(function(e){var r=b({row:e.row,rowIdAccessor:d})+"";n.set(r,e.position)}),E.current=n}},[o,H,d]);var k=n.useMemo(function(){return H(t)},[t,H]),F=n.useMemo(function(){return O({bufferRowCount:5,contentHeight:h,tableRows:k,rowHeight:p,scrollTop:w})},[k,h,p,w]),D=n.useCallback(function(e,n){var r=new Set(e.map(function(e){return b({row:e.row,rowIdAccessor:d})+""})),t=new Set(n.map(function(e){return b({row:e.row,rowIdAccessor:d})+""}));return{staying:n.filter(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return r.has(n)}),entering:n.filter(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return!r.has(n)}),leaving:e.filter(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return!t.has(n)})}},[d]),P=n.useMemo(function(){if(0===A.current.length)return!1;var e=k.map(function(e){return b({row:e.row,rowIdAccessor:d})+""}),n=A.current.map(function(e){return b({row:e.row,rowIdAccessor:d})+""});return e.length!==n.length||!e.every(function(e,r){return e===n[r]})},[k,d]);n.useLayoutEffect(function(){if(!C){if(!r||l)return N([]),A.current=k,void(M.current=F);if(0===A.current.length)return N([]),A.current=k,void(M.current=F);if(!P)return N([]),A.current=k,void(M.current=F);T.current={tableRows:k,visibleRows:F},y(!0)}},[r,k,P,C,l,F]),n.useLayoutEffect(function(){if(C&&T.current&&S.length>0){var e=setTimeout(function(){var e=T.current;y(!1),N([]),A.current=e.tableRows,M.current=e.visibleRows,T.current=null},dn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[C,S.length]);var B=n.useMemo(function(){if(!r||l)return F;if(S.length>0){var e=new Map,n=new Map;return k.forEach(function(r){var t=b({row:r.row,rowIdAccessor:d})+"";e.set(t,r.position),n.set(t,r.displayPosition)}),S.map(function(r){var t=b({row:r.row,rowIdAccessor:d})+"",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 F},[F,S,k,r,l,d]),L=n.useCallback(function(e){if(r&&!l){var n=m(e),t=H(n),o=O({bufferRowCount:5,contentHeight:h,tableRows:t,rowHeight:p,scrollTop:w}),i=D(F,o).entering.map(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return k.find(function(e){return b({row:e.row,rowIdAccessor:d})+""===n})||e}).filter(Boolean);i.length>0&&N(u(u([],F,!0),i,!0))}},[r,l,m,H,h,p,w,D,k,F,d]),W=n.useCallback(function(e){if(r&&!l){var n=g(e),t=H(n),o=O({bufferRowCount:5,contentHeight:h,tableRows:t,rowHeight:p,scrollTop:w}),i=D(F,o).entering.map(function(e){var n=b({row:e.row,rowIdAccessor:d})+"";return k.find(function(e){return b({row:e.row,rowIdAccessor:d})+""===n})||e}).filter(Boolean);i.length>0&&N(u(u([],F,!0),i,!0))}},[r,l,g,H,h,p,w,D,k,F,d]);return{currentTableRows:k,currentVisibleRows:F,isAnimating:C,prepareForFilterChange:L,prepareForSortChange:W,rowsToRender:B}}({allowAnimations:o,sortedRows:Or,originalRows:Nr,currentPage:Hn,rowsPerPage:je,shouldPaginate:en,serverSidePagination:Ye,rowGrouping:De,rowIdAccessor:Be,unexpandedRows:sr,expandAll:X,contentHeight:Rr,rowHeight:Pe,scrollTop:ur,computeFilteredRowsPreview:kr,computeSortedRowsPreview:Fr.computeSortedRowsPreview}),Lr=Br.currentTableRows,Wr=Br.rowsToRender,qr=Br.prepareForFilterChange,zr=Br.prepareForSortChange,jr=Br.isAnimating,Ur=n.useRef(new Map),Gr=n.useRef(new Map),Kr=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),w=h[0],m=h[1],g=n.useState(new Set),x=g[0],I=g[1],R=n.useState(null),S=R[0],N=R[1],A=n.useState(null),M=A[0],E=A[1],T=n.useState(new Set),H=T[0],k=T[1],F=n.useState(new Set),D=F[0],O=F[1],P=n.useState(!1),B=P[0],L=P[1],W=n.useRef(!1),q=n.useRef(null),z=n.useMemo(function(){var e=new Set;return w.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},[w,x]),j=n.useMemo(function(){var e=new Set;return w.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=b({row:n.row,rowIdAccessor:u});e.add(r+"")}),e},[w,x,o,u]),U=n.useMemo(function(){return t.flatMap(function(e){return p(e,s)})},[t,s]),G=n.useCallback(function(){if(0!==w.size){var e=function(e,n,r){var t=n.filter(function(e){return!e.hide}),o=new Map;t.forEach(function(e,n){o.set(n,e.accessor)});var i=Array.from(e).reduce(function(e,n){var t,i=n.split("-").map(Number),a=i[0],u=i[1];e[a]||(e[a]=[]);var l=o.get(u);return e[a][u]=l&&(null===(t=r[a])||void 0===t?void 0:t.row)?r[a].row[l]:"",e},{});return Object.values(i).map(function(e){return Object.values(e).join("\t")}).join("\n")}(w,U,o);navigator.clipboard.writeText(e),k(new Set(w)),setTimeout(function(){return k(new Set)},800)}},[w,U,o]),K=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(!M)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=b({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)}if(h.row[p.accessor]=m,a){var I="".concat(w,"-").concat(p.accessor),C=a.get(I);C&&C.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 R="".concat(c,"-").concat(v,"-").concat(w);l.add(R)}}})}),{updatedCells:u,warningCells:l}}(e,M,U,o,u,l,c),t=n.warningCells,(r=n.updatedCells).size>0&&(k(r),setTimeout(function(){return k(new Set)},800)),t.size>0&&(O(t),setTimeout(function(){return O(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[M,U,o,u,l,c]),J=n.useCallback(function(){if(0!==w.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=b({row:d.row,rowIdAccessor:t});if(null==f?void 0:f.isEditable){var h;if(d.row[f.accessor]=h="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),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}}(w,U,o,u,l,c),n=e.deletedCells,r=e.warningCells;n.size>0&&(k(n),setTimeout(function(){return k(new Set)},800)),r.size>0&&(O(r),setTimeout(function(){return O(new Set)},800))}},[w,U,o,u,l,c]),V=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=b({row:o[c].row,rowIdAccessor:u});r.add(y({colIndex:s,rowIndex:c,rowId:f}))}I(new Set),N(null),m(r),E(n),setTimeout(function(){return C(n,d)},0)},[o,u,d,v]),_=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(v?U.length:U.length-1)>=e.colIndex){var n=y(e);I(new Set),N(null),m(new Set([n])),E(e),setTimeout(function(){return C(e,d)},0)}},[U.length,o.length,d,v]),X=n.useCallback(function(e,n){void 0===n&&(n=!1),m(new Set),E(null),I(function(r){var t=new Set(n?r:[]);return e.forEach(function(e){return t.add(e)}),t}),e.length>0&&N(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 E=0;i.length>E;E++){var T=m?E+1:E,H=b({row:o[M].row,rowIdAccessor:a});A.add("".concat(M,"-").concat(T,"-").concat(H))}return c(A),s(new Set),void d(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void h();if(b({row:null===(u=o[l])||void 0===u?void 0:u.row,rowIdAccessor:a})!==N){var k=o.findIndex(function(e){return b({row:e.row,rowIdAccessor:a})===N});if(-1===k)return;l=k}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(),I(e,l)):"End"===e.key?(e.preventDefault(),C(e,l)):"PageUp"===e.key?(e.preventDefault(),y(e,l,S)):"PageDown"===e.key?(e.preventDefault(),R(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=b({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=b({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=b({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=b({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=b({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=b({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=b({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=b({row:o[n].row,rowIdAccessor:a}),u({rowIndex:n,colIndex:d,rowId:f}),p.current=null))},I=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=b({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=b({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:c,rowId:s}),p.current=null},C=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=b({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=b({row:o[c].row,rowIdAccessor:a}),u({rowIndex:c,colIndex:s,rowId:d}),p.current=null},y=function(e,n,r){var i=Math.max(0,n-10);if(e.shiftKey){p.current||(p.current=t);var c=b({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=b({row:o[i].row,rowIdAccessor:a}),u({rowIndex:i,colIndex:r,rowId:c}),p.current=null},R=function(e,n,r){var i=Math.min(o.length-1,n+10);if(e.shiftKey){p.current||(p.current=t);var c=b({row:o[i].row,rowIdAccessor:a});l(p.current,{rowIndex:i,colIndex:r,rowId:c})}else c=b({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:M,tableRows:o,leafHeaders:U,rowIdAccessor:u,selectSingleCell:_,selectCellRange:V,setSelectedCells:m,setSelectedColumns:I,setLastSelectedColumnIndex:N,copyToClipboard:G,pasteFromClipboard:K,deleteSelectedCells:J,startCell:q,enableRowSelection:v});var Y=n.useCallback(function(e,n){var r=new Set,t=new Map;o.forEach(function(e,n){var r=b({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 w=f;h>=w;w++)if(p>=0&&o.length>p){if(v&&0===w)continue;var g=b({row:o[p].row,rowIdAccessor:u});r.add(y({colIndex:w,rowIndex:p,rowId:g}))}m(r)},[o,u,v]),$=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},[]),Q=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 $(e,n)},[$]),Z=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)))}},[]),ee=n.useCallback(function(e){var n=e.colIndex,r=y({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),t=w.has(r),o=x.has(n);return t||o},[w,x]),ne=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId;if(B)return"";var i=[],a=o[r-1]?b({row:o[r-1].row,rowIdAccessor:u}):null,l=o[r+1]?b({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||!ee(c)||x.has(n)&&0===r)&&i.push("st-selected-top-border"),(!s||!ee(s)||x.has(n)&&r===o.length-1)&&i.push("st-selected-bottom-border"),ee(d)||i.push("st-selected-left-border"),ee(f)||i.push("st-selected-right-border"),i.join(" ")},[B,ee,o,x,u]),re=n.useMemo(function(){return M?function(e){return e.rowIndex===M.rowIndex&&e.colIndex===M.colIndex&&e.rowId===M.rowId}:function(){return!1}},[M]),te=n.useCallback(function(e){var n=y({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return H.has(n)},[H]),oe=n.useCallback(function(e){var n=y({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return D.has(n)},[D]);return{getBorderClass:ne,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){W.current=!0,L(!0),q.current={rowIndex:t,colIndex:n,rowId:o},setTimeout(function(){I(new Set),N(null);var e=y({colIndex:n,rowIndex:t,rowId:o});m(new Set([e])),E({rowIndex:t,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,c=function(){if(W.current&&q.current){if(null!==i&&null!==a){Z(i,a);var e=Date.now();if(e-l>=16){var n=Q(i,a);n&&Y(q.current,n),l=e}}u=requestAnimationFrame(c)}else null!==u&&(cancelAnimationFrame(u),u=null)},s=function(e){W.current&&q.current&&(i=e.clientX,a=e.clientY)},d=function(){W.current=!1,L(!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&&W.current&&q.current&&Y(q.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:te,isWarningFlashing:oe,isInitialFocusedCell:re,isSelected:ee,lastSelectedColumnIndex:S,pasteFromClipboard:K,selectColumns:X,selectedCells:w,selectedColumns:x,setInitialFocusedCell:E,setSelectedCells:m,setSelectedColumns:I,deleteSelectedCells:J,columnsWithSelectedCells:z,rowsWithSelectedCells:j}}({selectableCells:Ge,headers:Dn,tableRows:Lr,rowIdAccessor:Be,onCellEdit:xe,cellRegistry:Ur.current,collapsedHeaders:Jn,rowHeight:Pe,enableRowSelection:V}),Jr=Kr.getBorderClass,Vr=Kr.handleMouseDown,_r=Kr.handleMouseOver,Xr=Kr.isCopyFlashing,Yr=Kr.isInitialFocusedCell,$r=Kr.isSelected,Qr=Kr.isWarningFlashing,Zr=Kr.selectColumns,et=Kr.selectedCells,nt=Kr.selectedColumns,rt=Kr.setInitialFocusedCell,tt=Kr.setSelectedCells,ot=Kr.setSelectedColumns,it=Kr.columnsWithSelectedCells,at=Kr.rowsWithSelectedCells,ut=n.useCallback(function(e){zr(e),setTimeout(function(){Pr(e)},0)},[zr,Pr]),lt=n.useCallback(function(e){On(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:Je,selectedCells:et,selectedColumns:nt,setSelectedCells:tt,setSelectedColumns:ot,activeHeaderDropdown:Un,setActiveHeaderDropdown:Gn}),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:Cn,tableBodyContainerRef:Mn,setScrollbarWidth:hr}),function(e){var r=e.onGridReady;n.useEffect(function(){null==r||r()},[r])}({onGridReady:Re}),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=b({row:o,rowIdAccessor:a}),u=h({rowId:i,accessor:n}),c=r.current.get(u);c&&c.updateContent(t),void 0!==o[n]&&(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 cn(e.label)}).join(",")],e.map(function(e){var n=e.row;return r.map(function(e){return cn(n[e.accessor])}).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:Ur,currentTableRows:Lr,headerRegistryRef:Gr,headers:ir,rowIdAccessor:Be,rows:Le,tableRef:fn,visibleRows:Wr}),function(e){var r=e.filters,t=e.onFilterChange;n.useEffect(function(){null==t||t(r)},[r,t])}({filters:Mr,onFilterChange:ye}),function(e){var r=e.sort,t=e.onSortChange,o=re(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:Dr,onSortChange:Te});var ct=n.useCallback(function(e){qr(e),setTimeout(function(){Er(e)},0)},[qr,Er]);return e.jsx(S,exports.__assign({value:{allowAnimations:o,areAllRowsSelected:Qn,cellRegistry:Ur.current,cellUpdateFlash:f,clearSelection:or,collapsedHeaders:Jn,columnBorders:g,columnReordering:P,columnResizing:L,draggedHeaderRef:yn,editColumns:z,enableHeaderEditing:K,enableRowSelection:V,expandIcon:$,filterIcon:oe,filters:Mr,forceUpdate:Cn,getBorderClass:Jr,handleApplyFilter:ct,handleClearAllFilters:Hr,handleClearFilter:Tr,handleMouseDown:Vr,handleMouseOver:_r,handleRowSelect:nr,handleSelectAll:rr,handleToggleRow:tr,headerCollapseIcon:ue,headerContainerRef:En,headerDropdown:se,headerExpandIcon:ce,headerRegistry:Gr.current,headers:ir,hoveredHeaderRef:Rn,isAnimating:jr,isCopyFlashing:Xr,isInitialFocusedCell:Yr,isLoading:we,isResizing:Bn,isRowSelected:$n,isScrolling:qn,isSelected:$r,isWarningFlashing:Qr,mainBodyRef:Sn,nextIcon:ge,onCellEdit:xe,onCellClick:be,onColumnOrderChange:Ie,onColumnSelect:Ce,onLoadMore:Ne,onSort:ut,onTableHeaderDragEnd:lt,pinnedLeftRef:Nn,pinnedRightRef:An,prevIcon:ke,rowButtons:Fe,rowGrouping:De,rowHeight:Pe,headerHeight:null!=de?de:Pe,rowIdAccessor:Be,scrollbarWidth:vr,selectColumns:Zr,selectableColumns:Je,selectedColumns:nt,columnsWithSelectedCells:it,rowsWithSelectedCells:at,selectedRows:Xn,selectedRowCount:Zn,selectedRowsData:er,setCollapsedHeaders:Vn,setHeaders:On,setInitialFocusedCell:rt,setIsResizing:Ln,setIsScrolling:zn,setSelectedCells:tt,setSelectedColumns:ot,setSelectedRows:Yn,setUnexpandedRows:dr,shouldPaginate:en,sortDownIcon:rn,sortUpIcon:sn,tableBodyContainerRef:Mn,tableRows:Lr,theme:hn,unexpandedRows:sr,useHoverRowBackground:mn,useOddColumnBackground:In,useOddEvenRowBackground:xn,activeHeaderDropdown:Un,setActiveHeaderDropdown:Gn,onHeaderEdit:Se}},{children:e.jsx("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(hn," ").concat(null!=v?v:""," ").concat(g?"st-column-borders":""),style:fe?{height:fe}:{}},{children:e.jsx(an,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(_e,{pinnedLeftWidth:br,pinnedRightWidth:Ir,setScrollTop:lr,sort:Dr,tableRows:Lr,rowsToRender:Wr}),e.jsx(on,{columnEditorText:H,editColumns:z,editColumnsInitOpen:U,headers:Dn,position:R})]})),e.jsx(Xe,{mainBodyRef:Sn,mainBodyWidth:xr,pinnedLeftWidth:br,pinnedRightWidth:Ir,pinnedLeftContentWidth:Cr,pinnedRightContentWidth:yr,tableBodyContainerRef:Mn}),e.jsx(A,{currentPage:Hn,footerRenderer:ie,hideFooter:he,onPageChange:kn,onNextPage:Ae,onUserPageChange:Me,rowsPerPage:je,shouldPaginate:en,totalPages:Math.ceil((null!=pn?pn:Or.length)/je),totalRows:null!=pn?pn:Or.length})]}))})}))}))};exports.ANIMATION_CONFIGS=dn,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=M,exports.AngleRightIcon=E,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=T,exports.BUFFER_ROW_COUNT=5,exports.CheckIcon=H,exports.DescIcon=k,exports.FilterIcon=F,exports.SelectIcon=D,exports.SimpleTable=function(r){var t=n.useState(!1),o=t[0],i=t[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(hn,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,sn()&&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.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||sn()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=sn()?exports.__assign(exports.__assign({},dn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},dn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},dn.ROW_REORDER),u),fn(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,vn(n,i,r)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=re,exports.useTableContext=N;
2
+ //# sourceMappingURL=index-6295f627.js.map