simple-table-core 2.6.7 → 2.6.8

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 t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n);function o(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);r.length>o;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,u)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=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++,r=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],r=0}finally{t=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,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;i>o;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;r>t;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},s=29.5,c=["lineAreaChart","barChart"],d=40,f=function(e,n,t){return n&&t?480>e?.25:768>e?.3:.4:function(e){return 480>e?.4:768>e?.5:.6}(e)},v="parentExpanded",p=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=r(a[i],o);return o};return r(e,n),t},h=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,h(e.children)),n})},w=function(e){return void 0===e&&(e=0),e?e+1:0},m=function(e,n){for(var t=0,r=h(e);r.length>t;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null},g=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},x=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders;return n.hide||n.excludeFromRender||e.rootPinned!==e.pinned?null:!(t&&r&&function(e,n,t){var r=m(n,e.accessor);if(r){var o=t.has(r.accessor),i=e.showWhen||v;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,t,r))||null},b=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},y=function(e){var n=e.customTheme;return Math.min(e.headerHeight+n.rowSeparatorWidth+e.childRowCount*(e.rowHeight+n.rowSeparatorWidth)+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth,n.nestedGridMaxHeight+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth)},I=function(e){var n=e.calculatedHeight,t=e.customHeight,r=e.customTheme;return t?("string"==typeof t?parseFloat(t):t)+r.nestedGridPaddingTop+r.nestedGridPaddingBottom:n},C=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},R=function(e,n){var t=n+"";return t.includes(".")||t.includes("[")?t.split(".").reduce(function(e,n){if(null!=e){var t=C(n),r=t.index,o=e[t.key];return null!==r&&Array.isArray(o)&&(o=o[r]),o}},e):e[n]},S=function(e,n,t){var r=n+"";if(r.includes(".")||r.includes("[")){for(var o=r.split("."),i=e,a=0;o.length-1>a;a++){var u=C(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=C(o[a+1]);i[l]=null!==c.index?[]:{}}if(i=i[l],null!==s){if(!Array.isArray(i))throw Error("Expected array at ".concat(o.slice(0,a+1).join("."),", but found ").concat(typeof i));for(;s>=i.length;)i.push(null);null==i[s]&&(i[s]={}),i=i[s]}}var d=C(o[o.length-1]),f=d.key,v=d.index;if(null!==v){for(Array.isArray(i[f])||(i[f]=[]);v>=i[f].length;)i[f].push(null);i[f][v]=t}else i[f]=t}else e[n]=t},M=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},N=function(e){var n=e.getRowId,t=u([],e.rowPath,!0);if(n){var r=n({row:e.row,depth:e.depth,index:e.index,rowPath:e.rowPath,rowIndexPath:e.rowIndexPath,groupingKey:e.groupingKey});t.push(r)}return t},H=function(e){return e.join("-")},E=function(e,n){var t=e[n];return M(t)?t:[]},T=function(e,n,t,r,o){var i=e+"",a=r.has(i)&&r.get(i)===n,u=o.has(i)&&o.get(i)===n;return t.has(n)?!u:a},k=function(e){var n=e.depth,t=e.expandedDepths,r=e.expandedRows,o=e.collapsedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.getRowId,s=e.displayPositionOffset,c=void 0===s?0:s,d=e.rowStateMap,f=e.hasLoadingRenderer,v=void 0!==f&&f,p=e.hasErrorRenderer,h=void 0!==p&&p,w=e.hasEmptyRenderer,m=void 0!==w&&w,g=e.headers,x=void 0===g?[]:g,b=e.rowHeight,C=e.headerHeight,R=e.customTheme,S=[],M=function(e,n,i,s,f,p,w){void 0===i&&(i=0),void 0===s&&(s=c),void 0===f&&(f=[]),void 0===p&&(p=[]),void 0===w&&(w=[]);var g=i,k=s;return e.forEach(function(i,s){var c,P,A=a[n],F=u(u([],f,!0),[s],!1),D=u(u([],p,!0),[s],!1),L=N({row:i,getRowId:l,depth:n,index:s,rowPath:F,rowIndexPath:D,groupingKey:A}),W=S.length,O={row:i,depth:n,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:0===n&&s===e.length-1,rowId:L,rowPath:F,rowIndexPath:D,absoluteRowIndex:g,parentIndices:w.length>0?u([],w,!0):void 0};S.push(O),g++,k++;var B=H(L);if(T(B,n,t,r,o)&&a.length>n){var q=null==d?void 0:d.get(B),z=E(i,A),G=x.find(function(e){return e.expandable&&e.nestedTable});if((null==G?void 0:G.nestedTable)&&z.length>0){var V=(null===(c=G.nestedTable.customTheme)||void 0===c?void 0:c.rowHeight)||b,j=(null===(P=G.nestedTable.customTheme)||void 0===P?void 0:P.headerHeight)||C,K=y({childRowCount:z.length,rowHeight:V,headerHeight:j,customTheme:R}),U=I({calculatedHeight:K,customHeight:G.nestedTable.height,customTheme:R}),_=u(u([],F,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:_,rowPath:_,rowIndexPath:D,nestedTable:{parentRow:i,expandableHeader:G,childAccessor:A,calculatedHeight:U},absoluteRowIndex:g}),g++,k++}else if(q&&(q.loading||q.error||q.isEmpty)){if(q.loading&&v||q.error&&h||q.isEmpty&&m){var J=u(u([],F,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:J,rowPath:J,rowIndexPath:D,stateIndicator:{parentRowId:B,parentRow:i,state:q},absoluteRowIndex:g,parentIndices:u(u([],w,!0),[W],!1)}),g++,k++}else if(q.loading&&!v){var Y=u(u([],F,!0),[A,"loading-skeleton"],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:Y,rowPath:Y,rowIndexPath:D,isLoadingSkeleton:!0,absoluteRowIndex:g,parentIndices:u(u([],w,!0),[W],!1)}),g++,k++}}else if(z.length>0){var X=u(u([],F,!0),[A],!1),$=u([],D,!0);g=M(z,n+1,g,k,X,$,u(u([],w,!0),[W],!1))}}}),g};return M(e.rows,void 0===n?0:n,0,c,[],[],[]),S},P=function(e,n){if(e.hide)return[];if(!e.children||0===e.children.length)return[e];if(n&&n.has(e.accessor)){var t=e.children.filter(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return P(e,n)});return e.singleRowChildren?u([e],t,!0):t}var r=e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return P(e,n)});return e.singleRowChildren?u([e],r,!0):r},A=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(g({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},F=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(g({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){F(e)})},D=function(e){return"number"==typeof e.minWidth?e.minWidth:d},L=function(e,n){var t=[];return e.forEach(function(e){e.hide||t.push.apply(t,P(e,n))}),t},W=function(e,n){var t=n.rowTopPositions;if(0===t.length)return 0;if(0>=e)return 0;if(e>=n.totalHeight)return t.length-1;for(var r=0,o=t.length-1;o>r;){var i=Math.floor((r+o+1)/2);t[i]>e?o=i-1:r=i}return r},O=function(e,n){if(!n||0===n.length)return 0;for(var t=0,r=0,o=n.length;o>r;){var i=Math.floor((r+o)/2);e>n[i][0]?r=i+1:o=i}for(var a=0;r>a;a++)t+=n[a][1];return t},B=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.scrollTop,o=e.tableRows,i=e.scrollDirection,a=void 0===i?"none":i,u=e.heightMap,l=e.rowHeight+1;if(!u){var s=n*l,c=s,d=s;"down"===a?(c=Math.max(l,.1*s),d=.9*s):"up"===a&&(c=.9*s,d=Math.max(l,.1*s));var f=r+t+d,v=Math.max(0,Math.floor(Math.max(0,r-c)/l)),p=Math.min(o.length,Math.ceil(f/l)),h=r+t,w=Math.max(0,Math.ceil(r/l)),m=Math.min(o.length,Math.floor(h/l)),g=r+t,x=Math.max(0,Math.floor(r/l)),b=Math.min(o.length,Math.ceil(g/l));return{rendered:{startIndex:v,endIndex:p,rows:o.slice(v,p)},fullyVisible:{startIndex:w,endIndex:m,rows:o.slice(w,m)},partiallyVisible:{startIndex:x,endIndex:b,rows:o.slice(x,b)}}}var y=u.rowTopPositions,I=n*l,C=I,R=I;"down"===a?(C=Math.max(l,.1*I),R=.9*I):"up"===a&&(C=.9*I,R=Math.max(l,.1*I));var S=r+t+R,M=W(Math.max(0,r-C),u),N=W(S,u)+1;N=Math.min(o.length,N);var H=r,E=r+t,T=W(H,u);H>y[T]&&(T=Math.min(T+1,o.length));var k=W(E,u);k=Math.min(o.length,k);var P=r+t,A=W(r,u),F=W(P,u)+1;return F=Math.min(o.length,F),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:T,endIndex:k,rows:o.slice(T,k)},partiallyVisible:{startIndex:A,endIndex:F,rows:o.slice(A,F)}}},q=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+O(n,e.heightOffsets)},z=function(e,n){var t,r,o=e.position,i=n[o+1];return null!==(r=null===(t=null==i?void 0:i.parentIndices)||void 0===t?void 0:t.includes(o))&&void 0!==r&&r},G=function(e){var n=e.allTableRows,t=e.renderedRows,r=e.fullyVisibleRows,o=e.partiallyVisibleRows,i=e.partiallyVisibleRowIndex,a=e.recursionDepth,u=e.stickyParents,l=e.rowGrouping,s=o[i];if(!s||a>10)return{stickyParents:u,regularRows:t};var c=0;if(s.parentIndices&&s.parentIndices.length>0){for(var d=function(e){var t=n[e];if(t){var o=r.some(function(e){return e.position===t.position});if(s.rowIndexPath&&s.rowIndexPath.length>0){var i=n[s.parentIndices[s.parentIndices.length-1]],a=i.row[l[i.depth]];if(u.length>=(Array.isArray(a)?a:[]).length-s.rowIndexPath[s.rowIndexPath.length-1])return"break"}o||u.some(function(e){return H(e.rowId)===H(t.rowId)})||(u.push(t),c++)}},f=0,v=s.parentIndices;v.length>f&&"break"!==d(v[f]);f++);if(u.length>0){z(s,n)&&(u.push(s),c++);var p=o[i+=c];p&&(s=p)}}else if(z(s,n))return u.push(s),i++,G({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l});return z(s,n)?G({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l}):{stickyParents:u,regularRows:t}},V=function(e,n,t){var r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>r.top?n.scrollTop-=o.top-r.top+i:r.bottom>o.bottom-i&&(n.scrollTop+=r.bottom-o.bottom+i),t){var a=t.getBoundingClientRect();a.left+i>r.left?t.scrollLeft-=a.left-r.left+i:r.right>a.right-i&&(t.scrollLeft+=r.right-a.right+i)}},j=function(e,n,t,r){var o=document.querySelector(".st-body-container"),i=document.querySelector(".st-body-main");if(o){!function(e,n){if(n){var t=document.querySelector('.st-header-main [data-col-index="'.concat(e,'"]'));if(t){var r=t.getBoundingClientRect(),o=n.getBoundingClientRect();o.left+10>r.left?n.scrollLeft-=o.left-r.left+10:r.right>o.right-10&&(n.scrollLeft+=r.right-o.right+10)}}}(e.colIndex,i);var a=n+t.rowSeparatorWidth,u=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(u&&r){var l=function(e,n,t,r){var o=B({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:t,scrollTop:n.scrollTop,tableRows:r,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,o,n,r);if(l)return void V(u,o,i)}if(!u)return o.scrollTop=Math.max(0,e.rowIndex*a-o.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&&V(n,o,i)},100);V(u,o,i)}},K=function(e){var n=e.colIndex,t=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(t)},U=n.createContext(void 0),_=function(n){return e.jsx(U.Provider,exports.__assign({value:n.value},{children:n.children}))},J=function(){var e=n.useContext(U);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},Y=n.createContext(void 0),X=function(t){var r=t.children,o=n.useState(!1),i=o[0],a=o[1],u=n.useMemo(function(){return{isScrolling:i,setIsScrolling:a}},[i]);return e.jsx(Y.Provider,exports.__assign({value:u},{children:r}))},$=function(){var e=n.useContext(Y);if(void 0===e)throw Error("useScrollState must be used within a ScrollStateProvider");return e},Q=function(t){var r=t.currentPage,o=t.footerRenderer,u=t.hideFooter,l=t.onPageChange,s=t.onNextPage,c=t.onUserPageChange,d=t.rowsPerPage,f=t.shouldPaginate,v=t.totalPages,p=t.totalRows,h=J().icons,w=n.useState(!0),m=w[0],g=w[1],x=r>1,b=v>r,y=r===v,I=Math.min((r-1)*d+1,p),C=Math.min(r*d,p),R=!x,S=!b&&!s||!m&&y,M=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=r-1)?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},N=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(t){switch(t.label){case 0:return e=r===v,n=r+1,s&&e?[4,s(r)]:[3,2];case 1:if(!t.sent())return g(!1),[2];t.label=2;case 2:return n>v&&!s?[3,4]:(l(n),c?[4,c(n)]:[3,4]);case 3:t.sent(),t.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),c?[4,c(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:r,totalPages:v,rowsPerPage:d,totalRows:p,startRow:I,endRow:C,onPageChange:H,onNextPage:N,onPrevPage:M,hasNextPage:!S,hasPrevPage:!R,nextIcon:h.next,prevIcon:h.prev})});var E=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,t=[];r>8?v-7>r?(e=r-7,n=r+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14),e>2?(t.push(1),t.push(-1)):2===e&&t.push(1);for(var o=e;n>=o;o++)t.push(o);return v-1>n?(t.push(-2),t.push(v)):n===v-1&&t.push(v),t}();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 ",I," to ",C," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[E.map(function(n,t){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),t):e.jsx("button",exports.__assign({onClick:function(){return H(n)},className:"st-page-btn ".concat(r===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":r===n?"page":void 0},{children:n}),t)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(R?"disabled":""),onClick:M,disabled:R,"aria-label":"Go to previous page"},{children:h.prev})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(S?"disabled":""),onClick:N,disabled:S,"aria-label":"Go to next page"},{children:h.next}))]}))]}))},Z=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"})}))},ee=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"})}))},ne=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"})}))},te=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"})}))},re=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"})}))},oe=function(n){return e.jsxs("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 10",className:n.className,style:exports.__assign({height:"10px",width:"16px"},n.style)},{children:[e.jsx("circle",{cx:"3",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"13",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"3",cy:"7",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"7",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"13",cy:"7",r:"1.5",fill:"currentColor"})]}))},ie=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"})}))},ae=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"})}))},ue=function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[t,a,o]),n.useEffect(function(){var e=null==r?void 0:r.current;if(e&&(null==t?void 0:t.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=null,i=new ResizeObserver(function(){null!==o&&cancelAnimationFrame(o),o=requestAnimationFrame(function(){o=null,n()})});return i.observe(e),function(){null!==o&&(cancelAnimationFrame(o),o=null),e&&i.unobserve(e)}}},[t,r]),{isMainSectionScrollable:a}},le=function(t){var r=t.children,o=t.onClose,i=t.open,a=t.overflow,u=void 0===a?"auto":a,l=t.setOpen,s=t.width,c=t.containerRef,d=t.positioning,f=void 0===d?"fixed":d,v=J().mainBodyRef,p=n.useRef(null),h=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],y=x[1],I=n.useState(!1),C=I[0],R=I[1];return n.useEffect(function(){i&&p.current?(R(!1),!h.current&&p.current.parentElement&&(h.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&h.current){var e,n=p.current,t=h.current.getBoundingClientRect(),r=n.offsetHeight,o=s||n.offsetWidth,i=(e=(null==c?void 0:c.current)?c.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,u="bottom",l={};(r>i&&a>=r||r>i&&a>i)&&(u="top");var d="left";o>e.right-t.right+t.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===d?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===u?l.top=t.height+4:l.bottom=t.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),y(l),R(!0)}})):i||R(!1)},[i,s,c,v,f]),n.useEffect(function(){var e=function(e){i&&p.current&&p.current&&!p.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(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(l(!1),null==o||o())}},n=function(n){"Enter"===n.key&&e(n)};return i&&(document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",n,!0)),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",n,!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:p,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()},onTouchStart:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:s?"".concat(s,"px"):"auto",visibility:C?"visible":"hidden"},b),{overflow:u})},{children:r})):null},se=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,s=void 0===l?"":l;return e.jsx("div",exports.__assign({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(u?"disabled":""," ").concat(s),onClick:function(){!u&&r&&r()},role:"option","aria-selected":i,"aria-disabled":u},{children:t}))},ce=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=n.useState(t.value),l=u[0],s=u[1],c=function(e){s(e),o(e),a(!1),r()};return e.jsxs(le,exports.__assign({open:i,onClose:function(){r()},setOpen:a,width:120},{children:[e.jsx(se,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(se,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},de=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},fe=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+r,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()}})},ve=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-a380c5a3.js")})}),pe=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-8df3046a.js")})}),he=n.lazy(function(){return Promise.resolve().then(function(){return kt})}),we=n.lazy(function(){return Promise.resolve().then(function(){return At})}),me=function(t){var r=o(t,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},r))},{children:e.jsx(ve,exports.__assign({},t))}))},ge=function(t){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(pe,exports.__assign({},t))}))},xe=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(he,exports.__assign({},t))}))},be=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(we,exports.__assign({},t))}))},ye=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 t=new Date(e);return isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0)},Ie=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},Ce=function(e){if(!e)return new Date;if("string"==typeof e)return ye(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:Ie(n)}return e instanceof Date?Ie(e):new Date},Re=function(e){return e?ye(""+e):new Date},Se=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){r()};return e.jsx(le,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(ge,{value:Re(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),r()},onClose:l})}))},Me=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.options,u=t.setOpen,l=n.useState(t.value||""),s=l[0],c=l[1];return e.jsx(le,exports.__assign({open:i,onClose:function(){r()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(se,exports.__assign({isSelected:s===n.value,onClick:function(){return c(e=n.value),o(e),u(!1),void r();var e}},{children:n.label}),n.value)})}))}))},Ne=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,s=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(ce,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(Se,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(Me,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(fe,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(de,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},He=0,Ee=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();0!==He&&r>o-He||(He=o,n(t))}},Te=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},ke=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ke);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=ke(e[t]));return n},Pe=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide&&!e.excludeFromRender})};function Ae(e){return{pinnedLeft:e.filter(function(e){return"left"===e.pinned}),unpinned:e.filter(function(e){return!e.pinned}),pinnedRight:e.filter(function(e){return"right"===e.pinned})}}function Fe(e,n){return!0===e.isEssential||n.has(e.accessor+"")}function De(e,n){for(var t=!1,r=0,o=e;o.length>r;r++){var i=o[r];if(!i.isSelectionColumn&&!i.excludeFromRender){var a=Fe(i,n);if(a&&t)return!1;a||(t=!0)}}return!0}function Le(e,n){var t,r=Ae(e),o=r.unpinned,i=r.pinnedRight;if(!De(r.pinnedLeft,n))return!1;if(!De(o,n))return!1;if(!De(i,n))return!1;for(var a=0,u=e;u.length>a;a++){var l=u[a];if((null===(t=l.children)||void 0===t?void 0:t.length)&&!We(l.children,n))return!1}return!0}function We(e,n){var t;if(!De(e,n))return!1;for(var r=0,o=e;o.length>r;r++){var i=o[r];if((null===(t=i.children)||void 0===t?void 0:t.length)&&!We(i.children,n))return!1}return!0}function Oe(e){var n=Ae(e),t=n.unpinned,r=n.pinnedRight;return{left:n.pinnedLeft.map(function(e){return e.accessor}),main:t.map(function(e){return e.accessor}),right:r.map(function(e){return e.accessor})}}function Be(e,n,t){var r=e.filter(function(e){return Fe(n.get(e+""),t)}),o=e.filter(function(e){return!Fe(n.get(e+""),t)});return u(u([],r,!0),o,!0)}function qe(e,n,t){var r=new Set(e.map(function(e){return e.accessor+""})),o=u(u(u([],n.left,!0),n.main,!0),n.right,!0);if(o.length!==r.size)return null;for(var i=0,a=o;a.length>i;i++)if(!r.has(a[i]+""))return null;var l=new Map(e.map(function(e){return[e.accessor+"",e]})),s=Be(n.left,l,t),c=Be(n.main,l,t),d=Be(n.right,l,t),f=function(e,n){var t=exports.__assign({},e);return"left"===n?t.pinned="left":"right"===n?t.pinned="right":delete t.pinned,t};return u(u(u([],s.map(function(e){return f(l.get(e+""),"left")}),!0),c.map(function(e){return f(l.get(e+""),void 0)}),!0),d.map(function(e){return f(l.get(e+""),"right")}),!0)}function ze(e,n,t,r){var o=n+"",i=Oe(e),a=i.left.filter(function(e){return e+""!==o}),u=i.main.filter(function(e){return e+""!==o}),l=i.right.filter(function(e){return e+""!==o}),s=e.find(function(e){return e.accessor+""===o});return s&&(!Fe(s,r)||"main"!==t||"left"!==s.pinned&&"right"!==s.pinned)?("left"===t?a.push(n):"right"===t?l.push(n):u.push(n),qe(e,{left:a,main:u,right:l},r)):null}var Ge=Date.now(),Ve={screenX:0,screenY:0},je=function(e,n,t){void 0===t&&(t=[]);for(var r=0;e.length>r;r++){var o=e[r];if(o.accessor===n)return u(u([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=je(o.children,n,u(u([],t,!0),[r],!1));if(i)return i}}return null},Ke=function(e,n){for(var t=e,r=0;n.length-1>r;r++)t=t[n[r]].children;return t},Ue=function(e,n,t){if(1===n.length)return t;for(var r=e,o=0;n.length-2>o;o++)r=r[n[o]].children;return r[n[n.length-2]].children=t,e},_e=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function Je(e,n,t){var r=ke(e),o=!1;function i(e,n){for(var t=e,r=0;n.length-1>r;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;n.length-1>i;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var u=i(r,n);return a(r,n,i(r,t)),a(r,t,u),{newHeaders:r,emergencyBreak:o}}var Ye=function(e){var n=e.draggedHeaderRef,t=e.essentialAccessors,r=e.headers,o=e.hoveredHeaderRef,i=e.onColumnOrderChange,a=e.onTableHeaderDragEnd,l=J().setHeaders,s=Te(r);return{handleDragStart:function(e){n.current=e,Ge=Date.now()},handleDragOver:function(e){var i=e.event,u=e.hoveredHeader;if(i.preventDefault(),r&&n.current){var l=i.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=i.screenX,d=i.screenY,f=Math.sqrt(Math.pow(c-Ve.screenX,2)+Math.pow(d-Ve.screenY,2));o.current=u;var v,p=n.current,h=!1;if(_e(p)===_e(u)){var w=r,m=je(w,p.accessor),g=je(w,u.accessor);if(m&&g){var x=m.length,b=g.length,y=g;if(x!==b){var I=b-x;I>0&&(y=g.slice(0,-I))}if((C=m).length===(R=y).length&&(1===C.length||C.slice(0,-1).every(function(e,n){return e===R[n]}))){var C,R,S=Je(w,m,y);v=S.newHeaders,h=S.emergencyBreak;var M=null!=t?t:new Set;if((0>=M.size||h||Le(v,M))&&!(l||u.accessor===p.accessor||10>f||JSON.stringify(v)===JSON.stringify(r)||h)){var N=Date.now();JSON.stringify(v)===JSON.stringify(s)&&(1500>N-Ge||40>f)||(Ge=N,Ve={screenX:c,screenY:d},a(v))}}}}}},handleDragEnd:function(){n.current=null,o.current=null,setTimeout(function(){l(function(e){return u([],e,!0)}),null==i||i(r)},10)}}},Xe=function(n){var t=n.checked,r=void 0!==t&&t,o=n.children,i=n.disabled,a=void 0!==i&&i,u=n.onChange,l=n.ariaLabel;return e.jsxs("label",exports.__assign({className:"st-checkbox-label".concat(a?" st-checkbox-disabled":"")},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",disabled:a,onChange:function(){!a&&u&&u(!r)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":l,"aria-checked":r}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(r?"st-checked":""),"aria-hidden":"true"},{children:r&&e.jsx(te,{className:"st-checkbox-checkmark"})})),o]}))},$e=function(n){var t,r=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:r}):"lineAreaChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(xe,exports.__assign({data:t},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(be,exports.__assign({data:t},o.chartOptions)):null:"boolean"==typeof r?r?"True":"False":Array.isArray(r)?0===r.length?"[]":r.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==r&&("string"==typeof r||"number"==typeof r||"object"==typeof r&&r instanceof Date)?Ce(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):r},Qe=r.default.memo(function(t){var r=t.borderClass,o=t.colIndex,i=t.displayRowNumber,a=t.gridColumnStart,u=t.header,l=t.isHighlighted,s=t.isInitialFocused,c=t.nestedIndex,d=t.parentHeader,f=t.rowIndex,v=t.tableRow,p=J(),h=p.canExpandRowGroup,w=p.cellRegistry,m=p.cellUpdateFlash,x=p.collapsedRows,y=p.columnBorders,I=p.draggedHeaderRef,C=p.enableRowSelection,N=p.essentialAccessors,E=p.expandedDepths,k=p.expandedRows,P=p.handleMouseDown,A=p.handleMouseOver,F=p.handleRowSelect,D=p.headers,L=p.hoveredHeaderRef,W=p.icons,O=p.isCopyFlashing,B=p.isLoading,q=p.isRowSelected,z=p.isWarningFlashing,G=p.onCellEdit,V=p.onCellClick,j=p.onRowGroupExpand,K=p.onTableHeaderDragEnd,U=p.rowButtons,_=p.rowGrouping,Y=p.setCollapsedRows,X=p.setExpandedRows,$=p.setRowStateMap,Q=p.rowsWithSelectedCells,Z=p.selectedColumns,ee=p.tableBodyContainerRef,ne=p.theme,te=p.useOddColumnBackground,re=v.depth,oe=v.row,ie=v.rowPath,ae=v.rowIndexPath,ue=v.absoluteRowIndex,le=v.rowId,se=n.useState(R(oe,u.accessor)),ce=se[0],de=se[1],fe=n.useState(!1),ve=fe[0],pe=fe[1],he=n.useState(!1),we=he[0],ge=he[1],xe=n.useState(!1),be=xe[0],ye=xe[1],Ie=n.useRef(null),Ce=H(le),Re=_&&_[re],Se=!!Re&&function(e,n){return!!n&&M(e[n])}(oe,Re),Me=_&&_.length>re,He=!h||h(oe),Te=!!u.nestedTable,ke=T(Ce,re,E,k,x),Pe=O({rowIndex:f,colIndex:o,rowId:Ce}),Ae=z({rowIndex:f,colIndex:o,rowId:Ce}),Fe=n.useMemo(function(){var e,n,t;if(!y)return!1;var r=D.filter(function(e){return"left"===e.pinned}),o=D.filter(function(e){return!e.pinned}),i=D.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[y,D,u.accessor,u.pinned]),De=Ye({draggedHeaderRef:I,essentialAccessors:N,headers:D,hoveredHeaderRef:L,onTableHeaderDragEnd:K}).handleDragOver,Le=Ee(),We=g({accessor:u.accessor,rowId:Ce}),Oe=b({rowId:Ce,accessor:u.accessor}),Be=u.isSelectionColumn&&C;n.useEffect(function(){if(w){var e="".concat(Ce,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){ce!==e?(de(e),m&&(ge(!0),Ie.current&&clearTimeout(Ie.current),Ie.current=setTimeout(function(){ge(!1)},800))):de(e)}}),function(){w.delete(e),Ie.current&&clearTimeout(Ie.current)}}},[w,m,Ce,u.accessor,ce]),n.useEffect(function(){if(we){var e=setTimeout(function(){ge(!1)},850);return function(){return clearTimeout(e)}}},[we]),n.useEffect(function(){de(R(oe,u.accessor))},[oe,u.accessor]);var qe="boolean"===u.type||"date"===u.type||"enum"===u.type,ze=!!(null==u?void 0:u.isEditable)||!(!V||Be),Ge=Z.has(o),Ve=l&&!Ge,je=n.useMemo(function(){return!!Be&&Q.has(Ce+"")},[Be,Q,Ce]),Ke=null==d?void 0:d.singleRowChildren,Ue="st-cell ".concat(re>0&&u.expandable?"st-cell-depth-".concat(re):""," ").concat(Ve?s?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Ge?s?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(ze?"clickable":""," ").concat(we?s?"st-cell-updating-first":"st-cell-updating":""," ").concat(Pe?s?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Ae?s?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(te?c%2==0?"even-column":"odd-column":""," ").concat(Be?"st-selection-cell":""," ").concat(je?"st-selection-has-highlighted-cell":""," ").concat(Fe?"st-last-column":""," ").concat(Ke?"st-sub-cell":""," ").concat(be?"hovered":""),_e=null!=a?{gridColumn:a}:void 0,Je=n.useCallback(function(e){null==e&&(e="number"===u.type?0:"boolean"!==u.type&&""),de(e),S(oe,u.accessor,e),null==G||G({accessor:u.accessor,newValue:e,row:oe,rowIndex:f})},[u.accessor,u.type,G,oe,f]),Qe=n.useCallback(function(e){e.stopPropagation();var n=T(Ce,re,E,k,x),t=Ce+"";if(n?(Y(function(e){var n=new Map(e);return n.set(t,re),n}),X(function(e){var n=new Map(e);return n.delete(t),n})):(X(function(e){var n=new Map(e);return n.set(t,re),n}),Y(function(e){var n=new Map(e);return n.delete(t),n})),n&&$(function(e){var n=new Map(e);return n.delete(Ce),n}),j){var r=u.pinned;j({depth:re,event:e,groupingKey:Re,groupingKeys:_||[],isExpanded:!n,row:oe,rowIndexPath:ae||[],rowIdPath:ie,setEmpty:function(e,n){$(function(t){var o=new Map(t),i=o.get(Ce)||{};return o.set(Ce,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:r})),o})},setError:function(e){$(function(n){var t=new Map(n),o=t.get(Ce)||{};return t.set(Ce,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:r})),t})},setLoading:function(e){e?$(function(e){var n=new Map(e),t=n.get(Ce)||{};return n.set(Ce,exports.__assign(exports.__assign({},t),{loading:!0,error:null,isEmpty:!1,triggerSection:r})),n}):setTimeout(function(){$(function(e){var n=new Map(e),t=n.get(Ce)||{};return n.set(Ce,exports.__assign(exports.__assign({},t),{loading:!1,error:null,isEmpty:!1,triggerSection:r})),n})},0)}})}},[x,Re,re,E,k,u.pinned,j,oe,_,Ce,ae,ie,Y,X,$]);return B||v.isLoadingSkeleton?e.jsx("div",exports.__assign({className:Ue,style:_e},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!ve||qe||Be?e.jsxs(me,exports.__assign({className:Ue,"data-accessor":u.accessor,"data-col-index":o,"data-row-id":Ce,"data-row-index":f,role:"gridcell","aria-colindex":o+1,id:We,onClick:function(){V&&!Be&&V({accessor:u.accessor,colIndex:o,row:oe,rowIndex:f,value:ce})},onDoubleClick:function(){return u.isEditable&&!Be&&pe(!0)},onDragOver:function(e){Be||Le({callback:De,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){ve||Be||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||ve||(e.preventDefault(),pe(!0))},onMouseDown:function(e){ve||Be||(e.preventDefault(),P({rowIndex:f,colIndex:o,rowId:Ce}))},onMouseEnter:function(){ye(!0)},onMouseLeave:function(){ye(!1)},onMouseOver:function(){ve||Be||A({rowIndex:f,colIndex:o,rowId:Ce})},parentRef:ee,style:_e,tableRow:v},{children:[u.expandable&&Me?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(He&&(Se||j||Te)?ke?"expanded":"collapsed":"placeholder"),onClick:He&&(Se||j||Te)?function(e){return Qe(e)}:void 0,role:He&&(Se||j||Te)?"button":"presentation",tabIndex:He&&(Se||j||Te)?0:-1,"aria-label":He&&(Se||j||Te)?"".concat(ke?"Collapse":"Expand"," row group"):void 0,"aria-expanded":He&&(Se||j||Te)?ke:void 0,"aria-hidden":!(He&&(Se||j||Te)),onKeyDown:He&&(Se||j||Te)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Qe(e))}:void 0},{children:W.expand})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:B||v.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:Be?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:be||q&&q(Ce+"")?e.jsx(Xe,{checked:!!q&&q(Ce+""),onChange:function(e){F&&F(Ce+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!U||!Be||0===U.length)return null;if(!(be||q&&q(Ce+"")))return null;var n={row:oe,rowIndex:i};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:U.map(function(t,r){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?function(){var e;return u.cellRenderer({accessor:u.accessor,colIndex:o,row:oe,rowIndex:ue,rowPath:ie,theme:ne,value:ce,formattedValue:null===(e=null==u?void 0:u.valueFormatter)||void 0===e?void 0:e.call(u,{accessor:u.accessor,colIndex:o,row:oe,rowIndex:f,value:ce})})}():$e({content:ce,header:u,colIndex:o,row:oe,rowIndex:f})})})),!B&&!v.isLoadingSkeleton&&ve&&qe&&!Be&&e.jsx(Ne,{enumOptions:u.enumOptions,onChange:Je,setIsEditing:pe,type:u.type,value:ce})]}),Oe):e.jsx("div",exports.__assign({className:"st-cell-editing",id:g({accessor:u.accessor,rowId:Ce}),style:_e,onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(Ne,{enumOptions:u.enumOptions,onChange:Je,setIsEditing:pe,type:u.type,value:ce})}))},function(e,n){if(e.rowIndex!==n.rowIndex||e.colIndex!==n.colIndex||e.isHighlighted!==n.isHighlighted||e.isInitialFocused!==n.isInitialFocused||e.borderClass!==n.borderClass)return!1;if(e.tableRow!==n.tableRow){if(e.tableRow.row!==n.tableRow.row)return!1;if(e.tableRow.position!==n.tableRow.position||e.tableRow.displayPosition!==n.tableRow.displayPosition)return!1}return(e.header===n.header||e.header.accessor===n.header.accessor&&e.header.isEditable===n.header.isEditable&&e.header.type===n.header.type&&e.header.cellRenderer===n.header.cellRenderer&&e.header.valueFormatter===n.header.valueFormatter)&&e.parentHeader===n.parentHeader&&e.displayRowNumber===n.displayRowNumber&&e.nestedIndex===n.nestedIndex&&e.gridColumnStart===n.gridColumnStart}),Ze=function(e,n){return!e||e.visibleAccessors.has(n)},en=function(e,n){if(e){var t=e.trackIndexByAccessor.get(n);return void 0===t?void 0:t+1}},nn=function(t){var r=t.columnIndices,o=t.columnWindow,i=t.displayRowNumber,a=t.header,u=t.headers,l=t.nestedIndex,s=t.parentHeader,c=t.pinned,d=t.rootPinned,f=t.rowIndex,v=t.rowIndices,p=t.tableRow,h=r[a.accessor],w=J(),m=w.getBorderClass,b=w.isSelected,y=w.isInitialFocusedCell,I=w.collapsedHeaders,C=H(p.rowId);if(a.children&&a.children.length>0){var R=a.children.filter(function(e){return x({header:e,pinned:c,headers:u,collapsedHeaders:I,rootPinned:d})});if(a.singleRowChildren){var S=Ze(o,a.accessor),M={rowIndex:f,colIndex:h,rowId:C},N=m(M),E=b(M),T=y(M),k=g({accessor:a.accessor,rowId:C});return e.jsxs(n.Fragment,{children:[S&&e.jsx(Qe,{borderClass:N,colIndex:h,displayRowNumber:i,gridColumnStart:en(o,a.accessor),header:a,isHighlighted:E,isInitialFocused:T,nestedIndex:l,parentHeader:s,rowIndex:f,tableRow:p},k),R.map(function(n){var t=g({accessor:n.accessor,rowId:C});return e.jsx(nn,{columnIndices:r,columnWindow:o,displayRowNumber:i,rootPinned:d,header:n,headers:u,nestedIndex:l,parentHeader:a,pinned:c,rowIndex:f,rowIndices:v,tableRow:p},t)})]})}return e.jsx(n.Fragment,{children:R.map(function(n){var t=g({accessor:n.accessor,rowId:C});return e.jsx(nn,{columnIndices:r,columnWindow:o,displayRowNumber:i,rootPinned:d,header:n,headers:u,nestedIndex:l,parentHeader:a,pinned:c,rowIndex:f,rowIndices:v,tableRow:p},t)})})}if(!Ze(o,a.accessor))return null;var P={rowIndex:f,colIndex:h,rowId:C},A=m(P),F=b(P),D=y(P),L=g({accessor:a.accessor,rowId:C});return e.jsx(Qe,{borderClass:A,colIndex:h,displayRowNumber:i,gridColumnStart:en(o,a.accessor),header:a,isHighlighted:F,isInitialFocused:D,nestedIndex:l,parentHeader:s,rowIndex:f,tableRow:p},L)},tn=r.default.memo(function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.columnWindow,i=n.headers,a=n.pinned,u=n.rowIndex,l=n.displayRowNumber,s=n.rowIndices,c=n.tableRow,d=J().collapsedHeaders,f=i.filter(function(e){return x({header:e,pinned:a,headers:i,collapsedHeaders:d,rootPinned:e.pinned})});return e.jsx(e.Fragment,{children:f.map(function(n,d){var f=d+(null!=t?t:0);if(o&&!function(e){return!(!e.children||0>=e.children.length)}(n)&&!Ze(o,n.accessor))return null;var v=H(c.rowId),p=g({accessor:n.accessor,rowId:v});return e.jsx(nn,{columnIndices:r,columnWindow:o,displayRowNumber:l,rootPinned:n.pinned,header:n,headers:i,nestedIndex:f,pinned:a,rowIndex:u,rowIndices:s,tableRow:c},p)})})},function(e,n){return e.rowIndex===n.rowIndex&&e.displayRowNumber===n.displayRowNumber&&e.columnIndexStart===n.columnIndexStart&&(e.tableRow===n.tableRow||e.tableRow.row===n.tableRow.row)&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.columnWindow===n.columnWindow}),rn=function(n){var t=n.rowState,r=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return t.loading&&r?a=r:t.error&&o?a=o:t.isEmpty&&i&&(a=i),a?e.jsx("div",exports.__assign({className:"st-cell st-state-row-cell",style:{gridColumn:"1 / -1",padding:0}},{children:a})):null},on=function(n){var t=n.calculatedHeight,r=n.childAccessor,o=n.depth,i=n.expandableHeader,a=n.index,u=n.parentRow,l=n.position,s=J(),c=s.theme,d=s.rowGrouping,f=s.rowHeight,v=s.heightOffsets,p=s.customTheme,h=s.loadingStateRenderer,w=s.errorStateRenderer,m=s.emptyStateRenderer,g=s.icons,x=i.nestedTable;if(!x)return null;var b=R(u,r),y=Array.isArray(b)?b:[],C=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,S=x.customTheme?exports.__assign(exports.__assign({},p),x.customTheme):p,M=function(e){var n=e.calculatedHeight,t=e.customHeight,r=e.customTheme;return t?"string"==typeof t?t:"".concat(t,"px"):"".concat(n-r.nestedGridPaddingTop-r.nestedGridPaddingBottom,"px")}({calculatedHeight:t,customHeight:x.height,customTheme:p}),N=I({calculatedHeight:t,customHeight:x.height,customTheme:p});return e.jsx("div",exports.__assign({className:"st-row st-nested-grid-row","data-index":a,style:{transform:"translate3d(0, ".concat(q({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(N,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx(Ht,exports.__assign({},x,{rows:y,theme:c,customTheme:S,height:M,rowGrouping:C,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,icons:g}))}))},an=r.default.memo(function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.columnWindow,i=n.gridTemplateColumns,a=n.headers,u=n.index,l=n.pinned,s=n.rowHeight,c=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,v=n.isSticky,p=void 0!==v&&v,h=n.stickyIndex,w=void 0===h?0:h,m=n.stickyOffset,g=void 0===m?0:m,x=n.stickyZIndex,b=J(),y=b.customTheme,I=b.emptyStateRenderer,C=b.errorStateRenderer,R=b.heightOffsets,S=b.isAnimating,M=b.isRowSelected,N=b.loadingStateRenderer,E=b.maxHeaderDepth,T=b.useHoverRowBackground,k=b.useOddEvenRowBackground,P=f.position,A=f.displayPosition,F=f.stateIndicator,D=f.nestedTable;if(D)return l?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":u,style:{gridTemplateColumns:i,transform:"translate3d(0, ".concat(q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),"px, 0)"),height:"".concat(D.calculatedHeight,"px")}}):e.jsx(on,{calculatedHeight:D.calculatedHeight,childAccessor:D.childAccessor,depth:f.depth-1,expandableHeader:D.expandableHeader,index:u,parentRow:D.parentRow,position:P});if(F)return e.jsx("div",F.state.triggerSection===l&&(F.state.loading&&N||F.state.error&&C||F.state.isEmpty&&I)?exports.__assign({className:"st-row st-state-row","data-index":u,style:{gridTemplateColumns:i,transform:"translate3d(0, ".concat(q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),"px, 0)"),height:"".concat(s,"px")}},{children:e.jsx(rn,{parentRow:F.parentRow,rowState:F.state,gridTemplateColumns:i,loadingStateRenderer:N,errorStateRenderer:C,emptyStateRenderer:I})}):{className:"st-row st-state-row-spacer","data-index":u,style:{gridTemplateColumns:i,transform:"translate3d(0, ".concat(q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),"px, 0)"),height:"".concat(s,"px")}});var L=P%2==0,W=H(f.rowId),O=!!M&&M(W),B=p?{gridTemplateColumns:i,transform:"translateY(".concat(w*(s+1)+g,"px)"),height:"".concat(s,"px"),position:"absolute",top:0,left:0,zIndex:x}:{gridTemplateColumns:i,top:q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),height:"".concat(s,"px")};return e.jsx("div",exports.__assign({className:"st-row ".concat(p?"st-sticky-parent":""," ").concat(k?L?"even":"odd":""," ").concat(O?"selected":""),"data-index":P,role:"row","aria-rowindex":P+E+1,onMouseEnter:function(){!S&&T&&d(P)},style:B},{children:e.jsx(tn,{columnIndexStart:r,columnIndices:t,columnWindow:o,displayRowNumber:A,headers:a,pinned:l,rowIndex:P,rowIndices:c,tableRow:f},W)}))},function(e,n){return!((n.tableRow.nestedTable||n.tableRow.stateIndicator)&&e.index!==n.index)&&e.tableRow.position===n.tableRow.position&&e.tableRow.displayPosition===n.tableRow.displayPosition&&e.tableRow.row===n.tableRow.row&&e.tableRow.stateIndicator===n.tableRow.stateIndicator&&e.rowHeight===n.rowHeight&&e.gridTemplateColumns===n.gridTemplateColumns&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.columnWindow===n.columnWindow&&e.columnIndexStart===n.columnIndexStart}),un=function(t){var r=t.displayStrongBorder,o=t.position,i=t.rowHeight,a=t.templateColumns,u=t.isSticky,l=void 0!==u&&u,s=J(),c=s.heightOffsets,d=s.customTheme,f=n.useRef(null),v=l?o:function(e){var n=e.position,t=e.customTheme;return n*(e.rowHeight+t.rowSeparatorWidth)-t.rowSeparatorWidth+O(n,e.heightOffsets)}({position:o,rowHeight:i,heightOffsets:c,customTheme:d}),p=l?{position:"absolute",top:0,left:0,transform:"translateY(".concat(v,"px)")}:{transform:"translate3d(0, ".concat(v,"px, 0)")};return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){e.preventDefault();var n=e.currentTarget,t=n.style.pointerEvents;n.style.pointerEvents="none";var r=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=t,r){var o=r.closest(".st-cell");if(o instanceof HTMLElement){f.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(f.current){var n=f.current.getBoundingClientRect(),t=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});f.current.dispatchEvent(t),f.current=null}},style:exports.__assign({gridTemplateColumns:a},p)},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},ln=n.createContext(void 0),sn=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(ln);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 t.current&&u(t.current,e),function(){t.current&&l(t.current,e)}},[t,u,l,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},cn=n.forwardRef(function(t,r){var o=t.columnIndexStart,i=t.columnIndices,a=t.columnWindow,u=t.headers,l=t.pinned,s=t.rowHeight,c=t.rowIndices,d=t.setHoveredIndex,f=t.templateColumns,v=t.totalHeight,p=t.width,h=t.regularRows,w=l?"st-body-pinned-".concat(l):"st-body-main",m=n.useRef(null);return n.useImperativeHandle(r,function(){return m.current},[]),n.useMemo(function(){return Pe(u,l)},[u,l])?e.jsx(sn,exports.__assign({childRef:m,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:w,ref:m,style:exports.__assign({position:"relative",height:"".concat(v,"px"),width:p},!l&&{flexGrow:1})},{children:h.map(function(t,r){var v=t.stateIndicator?"state-".concat(t.stateIndicator.parentRowId,"-").concat(t.position):H(t.rowId);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(un,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:s,templateColumns:f}),e.jsx(an,{columnIndexStart:o,columnIndices:i,columnWindow:a,gridTemplateColumns:f,headers:u,index:r,pinned:l,rowHeight:s,rowIndices:c,setHoveredIndex:d,tableRow:t})]},v)})}))})):null});function dn(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],t,!0),n,!0),r,!0),s=function(e,n,t){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return x({header:e,pinned:t,headers:l,collapsedHeaders:o,rootPinned:t})}).forEach(function(n,r){s(n,!e.singleRowChildren&&0===r,t)})};return t.forEach(function(e,n){s(e,0===n,e.pinned)}),n.filter(function(e){return!e.pinned&&x({header:e,pinned:void 0,headers:l,collapsedHeaders:o,rootPinned:e.pinned})}).forEach(function(e,n){s(e,0===n&&0===t.length,e.pinned)}),r.forEach(function(e){s(e,!1,e.pinned)}),i}cn.displayName="TableSection";var fn=function(t){var r=t.calculatedHeaderHeight,o=t.stickyParents,i=t.mainTemplateColumns,a=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,l=t.pinnedLeftWidth,c=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.pinnedRightWidth,v=t.setHoveredIndex,p=t.rowIndices,h=t.scrollbarWidth,w=t.scrollTop,m=t.heightMap,g=t.partiallyVisibleRows,x=J(),b=x.collapsedHeaders,y=x.customTheme,I=x.editColumns,C=x.headers,R=x.rowHeight,S=n.useRef(null),M=n.useRef(null),N=n.useRef(null),E=n.useMemo(function(){var e,n;if(0===o.length)return{treeTransitionOffset:0,offsetStartIndex:-1};var t,r=g[0];if((null==r?void 0:r.parentIndices)&&r.parentIndices.length>0)for(var i=function(e){var n=r.parentIndices[e];if(o.some(function(e){return e.position===n}))return t=n,"break"},a=r.parentIndices.length-1;a>=0&&"break"!==i(a);a--);var u=void 0!==t?o.findIndex(function(e){return e.position===t}):-1,l=-1,s=function(e){var n=o[e],t=o[e+1];return t?t.depth===n.depth?(l=e,"break"):n.depth>t.depth?(l=o.findIndex(function(e){return e.depth===n.depth}),"break"):void 0:"break"};for(a=0;o.length>a&&"break"!==s(a);a++);if(-1===l)return{treeTransitionOffset:0,offsetStartIndex:u};var c=null===(e=o[l])||void 0===e?void 0:e.position;if(void 0===c)return{treeTransitionOffset:0,offsetStartIndex:u};for(var d=0,f=0,v=g;v.length>f&&(null===(n=v[f].parentIndices)||void 0===n?void 0:n.includes(c));f++)d++;if(0===d)return{treeTransitionOffset:0,offsetStartIndex:u};var p=g[0];return{treeTransitionOffset:-((l+1-d)*R+Math.max(0,w-(m?m.rowTopPositions[p.position]:p.position*(R+y.rowSeparatorWidth)))),offsetStartIndex:u}},[y,m,g,R,w,o]),T=E.treeTransitionOffset,k=E.offsetStartIndex,P=n.useMemo(function(){return dn({headers:C,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:b})},[C,a,c,b]),A=o.length>0?o.length*(R+1)+T:0;if(0===o.length)return null;var F=function(t,r,i,a,u,l){return void 0===u&&(u=0),e.jsx("div",exports.__assign({className:i?"st-sticky-section-".concat(i):"st-sticky-section-main",ref:l,style:{position:"relative",height:"".concat(A,"px"),width:i?"".concat(a,"px"):void 0,flexGrow:i?0:1,flexShrink:i?0:void 0}},{children:o.map(function(a,l){var s=a.stateIndicator?"sticky-state-".concat(a.stateIndicator.parentRowId,"-").concat(a.position):"sticky-".concat(H(a.rowId)),c=-1!==k&&l>=k,d=c?T:0,f=(l+1)*(R+1)-1+d;return e.jsxs(n.Fragment,{children:[e.jsx(an,{columnIndexStart:u,columnIndices:P,gridTemplateColumns:t,headers:r,index:a.position,pinned:i,rowHeight:R,rowIndices:p,setHoveredIndex:v,tableRow:a,isSticky:!0,stickyIndex:l,stickyOffset:d,stickyZIndex:c?l:o.length-l}),e.jsx(un,{displayStrongBorder:!1,position:f,rowHeight:R,templateColumns:t,isSticky:!0})]},s)})}))},D=C.filter(function(e){return!e.pinned}),L="calc(100% - ".concat(h,"px - ").concat(I?"".concat(s,"px"):"0px",")");return e.jsxs("div",exports.__assign({className:"st-sticky-top",style:{height:"".concat(A,"px"),width:L,top:"".concat(r,"px")}},{children:[a.length>0&&e.jsx(sn,exports.__assign({childRef:S,group:"pinned-left"},{children:F(u,a,"left",l,0,S)})),e.jsx(sn,exports.__assign({childRef:M,group:"default"},{children:F(i,D,void 0,void 0,a.length,M)})),c.length>0&&e.jsx(sn,exports.__assign({childRef:N,group:"pinned-right"},{children:F(d,c,"right",f,a.length+D.length,N)}))]}))},vn=function(e){var n=e.collapsedHeaders,t=function(e){var r=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide&&!e.excludeFromRender)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&r.push(e),o.length>0?t({headers:o,flattenedHeaders:r}):e.singleRowChildren||r.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&r.push(e),t({headers:i,flattenedHeaders:r})}else r.push(e)}),r};return t({headers:e.headers,flattenedHeaders:[]})},pn=function(e){var n=e.autoExpandColumns,t=vn({headers:e.headers,collapsedHeaders:e.collapsedHeaders});return"".concat(t.map(function(e){return function(e,n){var t=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),t&&"number"==typeof t&&(t="".concat(t,"px")),void 0===t||n?r:"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(t,", ").concat(r,")"):"max(".concat(t,", ").concat(r,")")}(e,n)}).join(" "))},hn=function(e){var n=e.width,t=e.minWidth;if("number"==typeof n)return n;if("string"==typeof n){var r,o=n.trim();if(o.endsWith("px")&&!Number.isNaN(r=parseFloat(o)))return r}return"number"==typeof t?t:"string"==typeof t&&t.trim().endsWith("px")&&!Number.isNaN(r=parseFloat(t))?r:150},wn=function(e,n){var t=n.columnLeftPositions;if(0===t.length)return 0;if(0>=e)return 0;if(e>=n.totalWidth)return t.length-1;for(var r=0,o=t.length-1;o>r;){var i=Math.floor((r+o+1)/2);t[i]>e?o=i-1:r=i}return r},mn=function(t){var r=t.calculatedHeaderHeight,o=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,u=t.pinnedLeftWidth,l=t.pinnedRightColumns,s=t.pinnedRightTemplateColumns,c=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,v=t.setScrollDirection,p=t.shouldShowEmptyState,h=t.tableRows,w=t.stickyParents,m=t.regularRows,g=t.partiallyVisibleRows,x=t.heightMap,b=J(),y=b.collapsedHeaders,I=b.headerContainerRef,C=b.headers,R=b.heightOffsets,S=b.isAnimating,M=b.mainBodyRef,N=b.onLoadMore,E=b.rowHeight,T=b.scrollbarWidth,k=b.shouldPaginate,P=b.tableBodyContainerRef,A=b.tableEmptyStateRenderer,F=b.customTheme,D=$().setIsScrolling,L=n.useState(!1),W=L[0],O=L[1],B=n.useState(0),q=B[0],z=B[1],G=n.useRef(new Set),V=n.useCallback(function(e){if(document.querySelectorAll(".st-row.hovered").forEach(function(e){e.classList.remove("hovered")}),G.current.clear(),null!==e&&P.current){var n=P.current,t='.st-row[data-index="'.concat(e,'"]:not(.st-nested-grid-row)');n.querySelectorAll(t).forEach(function(e){var t=e;t.closest(".st-body-container")===n&&(t.classList.add("hovered"),G.current.add(t))});var r=n.previousElementSibling;r&&r.classList.contains("st-sticky-top")&&r.querySelectorAll(t).forEach(function(e){var n=e;n.classList.add("hovered"),G.current.add(n)})}},[P]);n.useEffect(function(){S&&V(null)},[S,V]),ue({headerContainerRef:I,mainSectionRef:P,scrollbarWidth:T}),n.useEffect(function(){return function(){K.current&&clearTimeout(K.current)}},[]);var j=n.useRef(null),K=n.useRef(null),U=n.useRef(0),_=function(e){return e.length}(h),Y=n.useMemo(function(){return function(e,n,t,r){return e*(n+r.rowSeparatorWidth)-r.rowSeparatorWidth+((null==t?void 0:t.reduce(function(e,n){return e+n[1]},0))||0)}(_,E,R,F)},[_,E,R,F]),X=n.useMemo(function(){return dn({headers:C,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:y})},[C,i,l,y]),Q=n.useMemo(function(){return Pe(C,"left")||Pe(C,void 0)||Pe(C,"right")},[C]),Z=n.useMemo(function(){return Q?void 0:{minHeight:Y}},[Q,Y]),ee=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=H(n.rowId);e[r]=t}),e},[d]),ne=n.useMemo(function(){return C.filter(function(e){return!e.pinned})},[C]),te=n.useState({scrollLeft:0,width:0,direction:"none"}),re=te[0],oe=te[1],ie=n.useRef(null),ae=n.useRef(null),le=n.useRef(0);n.useLayoutEffect(function(){var e=M.current;if(e){var n=function(n){var t=e.scrollLeft,r=e.clientWidth,o=le.current,i=t>o?"right":o>t?"left":"none";le.current=t,oe(function(e){var o=n?r:e.width;return e.scrollLeft===t&&e.width===o&&e.direction===i?e:{scrollLeft:t,width:o,direction:i}})};n(!0);var t=function(){null===ie.current&&(ie.current=requestAnimationFrame(function(){ie.current=null,n(!0)}))};e.addEventListener("scroll",t,{passive:!0});var r="undefined"!=typeof ResizeObserver?new ResizeObserver(function(){null===ie.current&&(ie.current=requestAnimationFrame(function(){ie.current=null,n(!1),null!==ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){ae.current=null,n(!0)},150)}))}):null;return null==r||r.observe(e),function(){e.removeEventListener("scroll",t),null==r||r.disconnect(),null!==ie.current&&(cancelAnimationFrame(ie.current),ie.current=null),null!==ae.current&&(clearTimeout(ae.current),ae.current=null)}}},[M,p]);var se=n.useMemo(function(){return function(e){var n=e.scrollLeft,t=e.viewportWidth,r=e.bufferColumnCount,o=e.scrollDirection;if(e.pinned)return null;var i=function(e){for(var n=vn({headers:e.headers,collapsedHeaders:e.collapsedHeaders}),t=Array(n.length),r=0,o=0;n.length>o;o++)t[o]=r,r+=hn(n[o]);return{columnLeftPositions:t,totalWidth:r,leafHeaders:n}}({headers:e.headers,collapsedHeaders:e.collapsedHeaders}),a=new Map;if(i.leafHeaders.forEach(function(e,n){a.set(e.accessor,n)}),0>=t)return{visibleAccessors:new Set(i.leafHeaders.map(function(e){return e.accessor})),trackIndexByAccessor:a};var u=function(e){var n=e.scrollLeft,t=e.viewportWidth,r=e.scrollDirection,o=void 0===r?"none":r,i=e.widthMap,a=i.leafHeaders;if(0===a.length)return{startIndex:0,endIndex:0,columns:[]};var u=a.length>0?i.totalWidth/a.length:150,l=e.bufferColumnCount*u,s=l,c=l;"right"===o?(s=Math.max(u,.1*l),c=.9*l):"left"===o&&(s=.9*l,c=Math.max(u,.1*l));var d=n+t+c,f=wn(Math.max(0,n-s),i),v=wn(d,i)+1;return{startIndex:f,endIndex:v=Math.min(a.length,v),columns:a.slice(f,v)}}({scrollLeft:n,viewportWidth:t,bufferColumnCount:r,scrollDirection:o,widthMap:i}).columns;return{visibleAccessors:new Set(u.map(function(e){return e.accessor})),trackIndexByAccessor:a}}({headers:ne,collapsedHeaders:y,scrollLeft:re.scrollLeft,viewportWidth:re.width,bufferColumnCount:3,scrollDirection:re.direction,pinned:void 0})},[ne,y,re]),ce=n.useCallback(function(e,n){!N||k||W||200>=e.scrollHeight-(n+e.clientHeight)&&n>U.current&&(O(!0),N(),setTimeout(function(){O(!1)},1e3))},[N,k,W]),de={columnIndices:X,headerContainerRef:I,headers:C,rowHeight:E,rowIndices:ee,rowsToRender:d,setHoveredIndex:V,regularRows:m};return e.jsxs(e.Fragment,{children:[!p&&e.jsx(fn,{calculatedHeaderHeight:r,heightMap:x,mainTemplateColumns:o,partiallyVisibleRows:g,pinnedLeftColumns:i,pinnedLeftTemplateColumns:a,pinnedLeftWidth:u,pinnedRightColumns:l,pinnedRightTemplateColumns:s,pinnedRightWidth:c,rowIndices:ee,scrollTop:q,scrollbarWidth:T,setHoveredIndex:V,stickyParents:w}),e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return V(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;D(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(function(){D(!1)},150),j.current&&cancelAnimationFrame(j.current),j.current=requestAnimationFrame(function(){var e=U.current,r=t>e?"down":e>t?"up":"none";f(t),v(r),z(t),ce(n,t),U.current=t})},ref:P,style:Z},{children:p?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:A})):e.jsxs(e.Fragment,{children:[e.jsx(cn,exports.__assign({},de,{pinned:"left",templateColumns:a,totalHeight:Y,width:u})),e.jsx(cn,exports.__assign({},de,{columnIndexStart:i.length,columnWindow:se,ref:M,templateColumns:o,totalHeight:Y})),e.jsx(cn,exports.__assign({},de,{columnIndexStart:i.length+o.length,pinned:"right",templateColumns:s,totalHeight:Y,width:c}))]})}))]})},gn=function(e,n){if(e.pinned)return e.pinned;var t=m(n,e.accessor);return t?gn(t,n):void 0},xn=function(e){var n=e.autoExpandColumns,t=e.collapsedHeaders,r=e.containerWidth,o=e.event,i=e.header,a=e.headers,l=e.onColumnWidthChange,s=e.reverse,c=void 0!==s&&s,d=e.setHeaders,v=e.setIsResizing,p=e.startWidth;o.preventDefault();var h="clientX"in o?o.clientX:o.touches[0].clientX,w="touches"in o;if(i&&!i.hide){v(!0);var m,g=gn(i,a),x=D(i);if(i.children&&i.children.length>0){var b=P(i,t);m=b.length>0?b:[i]}else m=[i];var y=new Map,I=0;if(n){var C=a.filter(function(e){return e.pinned===g});if(L(C,t).forEach(function(e){var n=A(e);y.set(e.accessor,n)}),r>0){var R=yn({headers:a,containerWidth:r,collapsedHeaders:t}),S=R.leftWidth,M=R.rightWidth;I="left"===g?S:"right"===g?M:Math.max(0,r-S-M)}}var N=function(e){var o="right"===g?h-e:e-h;if(n){var l=a.filter(function(e){return e.pinned===g});Cn({delta:o,startWidth:p,resizedHeader:m.length>0?m[m.length-1]:i,sectionHeaders:l,rootPinned:g,reverse:c,collapsedHeaders:t,initialWidthsMap:y,sectionWidth:I,isParentResize:m.length>1,childrenToResize:m,headers:a,containerWidth:r})}else{var s=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth;if(!n.pinned)return 1/0;var a=t.some(function(e){return"left"===e.pinned&&!e.hide}),u=t.some(function(e){return"right"===e.pinned&&!e.hide}),l=i*f(i,a,u)-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+P(n,r).reduce(function(e,n){return e+A(n)},0)},0),s=D(n);return s>l?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),s):l}({header:i,headers:a,collapsedHeaders:t});m.length>1?bn({delta:o,leafHeaders:m,minWidth:x,startWidth:p,maxWidth:s}):m[0].width=Math.max(Math.min(p+o,s),x),a.forEach(function(e){F(e)})}var v=u([],a,!0);d(v)};if(w){var H=function(e){N(e.touches[0].clientX)},E=function(){document.removeEventListener("touchmove",H),document.removeEventListener("touchend",E),v(!1),l&&l(u([],a,!0))};document.addEventListener("touchmove",H),document.addEventListener("touchend",E)}else{var T=function(e){N(e.clientX)},k=function(){document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",k),v(!1),l&&l(u([],a,!0))};document.addEventListener("mousemove",T),document.addEventListener("mouseup",k)}}},bn=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,D(n))},40),u=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;t.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),r)})},yn=function(e){var n=e.containerWidth,t=e.collapsedHeaders,r=0,o=0,i=0;e.headers.forEach(function(e){if(!e.hide){var n=P(e,t).reduce(function(e,n){return e+A(n)},0);"left"===e.pinned?r+=n:"right"===e.pinned?o+=n:i+=n}});var a=r,u=o;if(n&&n>0){var l=n*f(n,r>0,o>0);r>l&&(r=l),o>l&&(o=l)}return{leftWidth:w(r),rightWidth:w(o),mainWidth:i,leftContentWidth:a,rightContentWidth:u}},In=function(e){var n=e.columnsToShrink,t=e.totalCompensation,r=e.initialWidthsMap;if(0>t){var o=Math.abs(t),i=n.reduce(function(e,n){return e+(r.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,t){var a=r.get(e.accessor)||100,u=o*(a/i);if(t===n.length-1){var l=n.slice(0,t).reduce(function(e,n){var t=r.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-t)},0);u=o-l}e.width=a+u})}else for(var a=t,u=function(){var e=n.map(function(e){var n=r.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-40),initialWidth:n,minWidth:40}}),t=e.filter(function(e){return e.headroom>0});if(t.length>0){var o=t.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;t.forEach(function(e,n){var r=u*(e.headroom/o);r=Math.min(r,e.headroom),n===t.length-1&&(r=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-r,i+=r}),a-=i}else{var l=e.filter(function(e){return e.minWidth>d});if(0>=l.length)return"break";var s=a,c=s/l.length,f=0;l.forEach(function(e,n){var t=e.minWidth-d,r=Math.min(c,t);n===l.length-1&&(r=Math.min(s-f,t));var o=e.initialWidth-r;e.column.width=o,e.column.minWidth=Math.max(o,d),f+=r}),a-=f}};a>.5&&"break"!==u(););},Cn=function(e){var n=e.childrenToResize,t=void 0===n?[]:n,r=e.collapsedHeaders,o=e.delta,i=e.initialWidthsMap,a=e.isParentResize,u=void 0!==a&&a,l=e.resizedHeader,s=e.reverse,c=e.rootPinned,v=e.sectionHeaders,p=e.sectionWidth,h=e.startWidth,w=e.headers,m=e.containerWidth,g=o;if(c&&m>0){var x=function(e,n,t){return e*f(e,n,t)}(m,w.some(function(e){return"left"===e.pinned&&!e.hide}),w.some(function(e){return"right"===e.pinned&&!e.hide})),b=Array.from(i.values()).reduce(function(e,n){return e+n},0);o>0&&b+o>x&&(g=Math.max(0,x-b))}if(o=g,u&&t.length>1){var y=L(v,r),I=y.findIndex(function(e){return e.accessor===t[0].accessor}),C=y.findIndex(function(e){return e.accessor===t[t.length-1].accessor});if(-1===I||-1===C)return;var R,S=0===I,M=C===y.length-1;R="left"===c&&M||"right"===c&&S?[]:S?y.slice(C+1):M||s?y.slice(0,I):y.slice(C+1);var N=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){var H=o,E=!1;if(R.length>0&&N+o>p){E=!0;var T=R.reduce(function(e,n){var t=i.get(n.accessor)||100;return e+Math.max(0,t-d)},0);H=Math.min(o,T)}var k=(P=h+H)/(A=t.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0));t.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*k,40)}),E&&H>0&&R.length>0&&In({columnsToShrink:R,totalCompensation:H,initialWidthsMap:i})}else{var P,A=t.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0),F=(P=Math.max(h+o,d*t.length))/A;t.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*F,40)}),(j=h-P)>0&&R.length>0&&In({columnsToShrink:R,totalCompensation:-j,initialWidthsMap:i})}}else{var D=L(v,r),W=D.findIndex(function(e){return e.accessor===l.accessor});if(-1!==W){var O,B=0===W,q=W===D.length-1;if(0!==(O="left"===c&&q||"right"===c&&B?[]:B?D.slice(W+1):q||s?D.slice(0,W):D.slice(W+1)).length){var z=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){if(p>=z+o)return void(l.width=h+o);T=O.reduce(function(e,n){var t=i.get(n.accessor)||100;return e+Math.max(0,t-d)},0);var G=Math.min(o,T);l.width=h+G,G>0&&In({columnsToShrink:O,totalCompensation:G,initialWidthsMap:i})}else{var V=Math.max(h+o,40),j=h-V;l.width=V,j>0&&In({columnsToShrink:O,totalCompensation:-j,initialWidthsMap:i})}}else l.width=Math.max(h+o,40)}}},Rn={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"},Sn=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"]}},Mn=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Nn=function(e){return["between","notBetween","in","notIn"].includes(e)},Hn=function(e){return["isEmpty","isNotEmpty"].includes(e)},En=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},Tn=function(t){var r=t.value,o=t.onChange,i=t.options,a=t.placeholder,u=void 0===a?"Select...":a,l=t.className,s=void 0===l?"":l,c=t.disabled,d=void 0!==c&&c,f=n.useState(!1),v=f[0],p=f[1],h=n.useState(-1),w=h[0],m=h[1],g=n.useRef(null),x=i.find(function(e){return e.value===r});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),p(!1),m(-1));break;case"Escape":e.preventDefault(),p(!1),m(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,w,i,o]);var b=function(e){o(e),p(!1),m(-1)};return e.jsxs("div",exports.__assign({ref:g,className:"st-custom-select ".concat(s," ").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(p(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===r});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(ae,{})]})),e.jsx(le,exports.__assign({open:v,setOpen:p,onClose:function(){p(!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,t){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),t)})}))}))]}))},kn=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Rn[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(Tn,{value:t,onChange:function(e){r(e)},options:o})}))},Pn=function(n){var t=n.type,r=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===t?"text":t,value:n.value,onChange:function(e){return r(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()})},An=function(n){var t=n.children,r=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Fn=function(n){var t=n.onClear,r=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:!r,className:"st-filter-button st-filter-button-apply ".concat(r?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&t&&e.jsx("button",exports.__assign({onClick:t,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},Dn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=Sn("string");n.useEffect(function(){o?(s(o.operator),f((o.value||"")+"")):(s("contains"),f(""))},[o]);var p=function(){var e=exports.__assign({accessor:r.accessor,operator:l},Mn(l)&&{value:d});i(e)},h=Hn(l)||d.trim();return e.jsxs(En,{children:[e.jsx(kn,{value:l,onChange:s,operators:v}),Mn(l)&&e.jsx(An,{children:e.jsx(Pn,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(Fn,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},Ln=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],p=f[1],h=n.useState(((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")+""),w=h[0],m=h[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],y=Sn("number");n.useEffect(function(){var e,n;a?(d(a.operator),p((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"),p(""),m(""),b(""))},[a]);var I=function(){var e={accessor:i.accessor,operator:c};Mn(c)?e.value=parseFloat(v):Nn(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(En,{children:[e.jsx(kn,{value:c,onChange:d,operators:y}),Mn(c)&&e.jsx(An,{children:e.jsx(Pn,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:I})}),Nn(c)&&e.jsxs(An,{children:[e.jsx(Pn,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:I}),e.jsx(Pn,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:I})]}),e.jsx(Fn,{onApply:I,onClear:l,canApply:!!Hn(c)||(Mn(c)?""!==v.trim():!!Nn(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},Wn=function(n){var t=n.className;return e.jsx(Tn,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===t?"":t,placeholder:n.placeholder})},On=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],s=u[1],c=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=c[0],f=c[1],v=Sn("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=Hn(l)||""!==d;return e.jsxs(En,{children:[e.jsx(kn,{value:l,onChange:s,operators:v}),Mn(l)&&e.jsx(An,{children:e.jsx(Wn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Fn,{onApply:function(){var e={accessor:r.accessor,operator:l};Mn(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},Bn=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],p=f[1],h=n.useState((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])?a.values[0]+"":""),w=h[0],m=h[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],y=Sn("date");n.useEffect(function(){var e,n;a?(d(a.operator),p((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"),p(""),m(""),b(""))},[a]);var I=function(t){var r=t.value,o=t.onChange,i=t.placeholder,a=t.autoFocus,u=t.className,l=n.useState(!1),s=l[0],c=l[1],d=n.useState(""),f=d[0],v=d[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=Ce(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){a&&p.current&&p.current.focus()},[a]);var h=r?Ce(r):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:f,placeholder:i,onClick:function(){c(!s)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),c(!s)):"Escape"===e.key&&c(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(le,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(ge,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(En,{children:[e.jsx(kn,{value:c,onChange:d,operators:y}),Mn(c)&&e.jsx(An,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Nn(c)&&e.jsxs(An,{children:[e.jsx(I,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:x,onChange:b,placeholder:"To date..."})]}),e.jsx(Fn,{onApply:function(){var e={accessor:i.accessor,operator:c};Mn(c)?e.value=v:Nn(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!Hn(c)||(Mn(c)?""!==v.trim():!!Nn(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},qn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,l=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),s=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),c=n.useState((null==o?void 0:o.values)?o.values.map(String):s),d=c[0],f=c[1],v=n.useState(""),p=v[0],h=v[1],w=n.useMemo(function(){if(!p)return l;var e=p.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,p]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:s)},[o,s]);var m=l.length>10;return e.jsxs(En,{children:[e.jsx(An,{children:e.jsxs("div",exports.__assign({className:"st-enum-filter-options"},{children:[e.jsx("div",exports.__assign({className:"st-enum-select-all"},{children:e.jsx(Xe,exports.__assign({checked:d.length===s.length,onChange:function(e){f(e?s:[])}},{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(Pn,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,t){return e.jsx(Xe,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(Fn,{onApply:function(){d.length!==s.length?i({accessor:r.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==s.length,showClear:!!o})]})},zn=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(Ln,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(On,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Bn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(qn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Dn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Gn=function(t){var r=t.content,o=t.children,i=t.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],s=u[1],c=n.useState({top:0,left:0}),d=c[0],f=c[1],v=n.useRef(null),p=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!r||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var h=n.cloneElement(o,{ref:p,onMouseEnter:function(){v.current=setTimeout(function(){if(p.current&&r.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),f({top:t,left:n}),s(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),s(!1)}});return e.jsxs(e.Fragment,{children:[h,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:r}))]})},Vn=function(t){var r,o,i=t.colIndex,a=t.gridColumnEnd,l=t.gridColumnStart,s=t.gridRowEnd,d=t.gridRowStart,f=t.header,h=t.parentHeader,w=t.reverse,m=t.sort,x=t.isLastHeader,b=void 0!==x&&x,y=n.useState(!1),I=y[0],C=y[1],S=n.useState(!1),M=S[0],N=S[1],H=n.useState(f.label||""),E=H[0],T=H[1],k=J(),P=k.activeHeaderDropdown,A=k.areAllRowsSelected,F=k.autoExpandColumns,D=k.collapsedHeaders,L=k.columnBorders,W=k.columnReordering,O=k.columnResizing,B=k.containerWidth,q=k.columnsWithSelectedCells,z=k.draggedHeaderRef,G=k.enableHeaderEditing,V=k.essentialAccessors,j=k.handleApplyFilter,K=k.handleClearFilter,U=k.handleSelectAll,_=k.headerDropdown,Y=k.headerRegistry,X=k.icons,$=k.headers,Q=k.hoveredHeaderRef,Z=k.onColumnOrderChange,ee=k.onColumnSelect,ne=k.onColumnWidthChange,te=k.onHeaderEdit,re=k.onSort,oe=k.onTableHeaderDragEnd,ie=k.headerHeight,ae=k.rows,ue=k.selectColumns,se=k.selectableColumns,ce=k.selectedColumns,fe=k.setActiveHeaderDropdown,ve=k.setCollapsedHeaders,pe=k.setHeaders,he=k.setInitialFocusedCell,we=k.setIsResizing,ge=k.setSelectedCells,xe=k.setSelectedColumns,be=!!(null==f?void 0:f.isSortable),ye=!!(null==f?void 0:f.filterable),Ie=k.filters[f.accessor],Ce=(null==P?void 0:P.accessor)===f.accessor,Re=f.isSelectionColumn&&k.enableRowSelection,Se=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(f),Me=D.has(f.accessor),Ne=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,s=n.useRef(null),c=n.useState({}),d=c[0],f=c[1];return n.useEffect(function(){if(t&&s.current){var e=function(){if(s.current){var e=s.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=window.innerWidth-e.right,r="bottom",i={};o>n&&e.top>=o&&(r="top");var u="left";a>t+e.width&&(u="right"),"bottom"===r?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)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:s,position:d}}({isOpen:Ce,estimatedHeight:200,estimatedWidth:250,margin:4}),He=Ne.triggerRef,Te=Ne.position,ke=n.useMemo(function(){var e,n,t;if(!L)return!1;var r=$.filter(function(e){return"left"===e.pinned}),o=$.filter(function(e){return!e.pinned}),i=$.filter(function(e){return"right"===e.pinned});return"left"===f.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===f.accessor:"right"===f.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===f.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===f.accessor},[L,$,f.accessor,f.pinned]),Pe=n.useMemo(function(){return!(!se||Re)&&p(f,i).some(function(e){return ce.has(e)})},[se,Re,f,i,ce]),Ae=n.useMemo(function(){return!Re&&p(f,i).some(function(e){return q.has(e)})},[Re,f,i,q]),De=n.useMemo(function(){return!(!f.children||0===f.children.length)&&(!Me||f.children.some(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n}))},[f.children,Me]),Le=null==h?void 0:h.singleRowChildren,We=De&&!f.singleRowChildren,Oe="st-header-cell ".concat(f.accessor===(null===(r=Q.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(o=z.current)||void 0===o?void 0:o.accessor)===f.accessor?"st-dragging":""," ").concat(be?"clickable":""," ").concat(W&&!be?"columnReordering":""," ").concat(We?"parent":""," ").concat(Le?"st-sub-header":""," ").concat(ke?"st-last-column":""," ").concat(G&&!Re?"st-header-editable":""," ").concat(Pe?"st-header-selected":""," ").concat(Ae&&!Pe?"st-header-has-highlighted-cell":""," ").concat(b?"st-no-resize":""),Be=Ye({draggedHeaderRef:z,essentialAccessors:V,headers:$,hoveredHeaderRef:Q,onColumnOrderChange:Z,onTableHeaderDragEnd:oe}),qe=Be.handleDragStart,ze=Be.handleDragEnd,Ge=Be.handleDragOver,Ve=Ee();n.useEffect(function(){if(Y&&!f.isSelectionColumn){var e=f.accessor+"";return Y.set(e,{setEditing:function(e){N(e)}}),function(){Y.delete(e)}}},[Y,f.accessor,f.isSelectionColumn]),n.useEffect(function(){T(f.label||"")},[f.label]);var _e=function(e){C(!I)},Je=n.useCallback(function(e){T(e);var n=$.map(function(n){return n.accessor===f.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});pe(n),te&&te(f,e)},[$,pe,te,f]),$e=n.useCallback(function(){fe&&fe(null)},[fe]),Qe=n.useCallback(function(e){e.stopPropagation(),ve(function(e){var n=new Set(e);return Me?n.delete(f.accessor):n.add(f.accessor),n})},[ve,Me,f.accessor]),Ze=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(se){var r=p(t,i),o=r.some(function(e){return ce.has(e)});if(G&&o&&!n.shiftKey)return _&&Ce&&$e(),void N(!0);n.shiftKey&&ue?xe(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);i>t&&(i=t,o=e)});var a,l,s,c=u(u([],(s=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-s+1},function(e,n){return s+n})),!0),r,!0);return new Set(u(u([],Array.from(e),!0),c,!0))}):ue&&ue(r),ge(new Set),he(null)}ee&&ee(t),!se&&t.isSortable&&re(t.accessor)}};n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]);var en=n.useCallback(function(){var e=function(e,n){var t=n||{},r=t.rows,o=t.header,i=t.maxWidth,a=void 0===i?500:i,u=t.sampleSize,l=void 0===u?50:u,s=document.getElementById(g({accessor:e,rowId:"header"}));if(!s)return 150;var d=window.getComputedStyle(s),f=parseFloat(d.paddingLeft)||0,v=parseFloat(d.paddingRight)||0,p=parseFloat(d.gap)||0,h=f+v,w=s.querySelector(".st-header-label");if(w){var m=w.querySelector(".st-header-label-text");if(m){var x=document.createElement("span");x.style.visibility="hidden",x.style.position="absolute",x.style.whiteSpace="nowrap",x.style.width="auto";var b=window.getComputedStyle(m);x.style.font=b.font,x.style.fontSize=b.fontSize,x.style.fontWeight=b.fontWeight,x.style.fontFamily=b.fontFamily,x.style.letterSpacing=b.letterSpacing,x.style.padding=b.padding,x.textContent=m.textContent,document.body.appendChild(x);var y=x.offsetWidth;document.body.removeChild(x),h+=y}}for(var I=Array.from(s.children),C=1,S=0;I.length>S;S++){var M=I[S];if(!M.classList.contains("st-header-label")&&!M.classList.contains("st-sr-only")){var N=window.getComputedStyle(M);"none"!==N.display&&(h+=(M.offsetWidth||0)+(parseFloat(N.marginLeft)||0)+(parseFloat(N.marginRight)||0),C++)}}p>0&&C>1&&(h+=p*(C-1));var H=0,E=o&&o.type&&c.includes(o.type);if(r&&r.length>0&&!E){var T=Math.min(r.length,l),k=document.createElement("div");k.style.visibility="hidden",k.style.position="absolute",k.style.whiteSpace="nowrap",k.style.width="auto";var P=0,A=0,F=document.querySelector(".st-cell-content");if(F){var D=window.getComputedStyle(F);k.style.font=D.font,k.style.fontSize=D.fontSize,k.style.fontFamily=D.fontFamily,P=parseFloat(D.paddingLeft)||0,A=parseFloat(D.paddingRight)||0}for(document.body.appendChild(k),S=0;T>S;S++){var L,W=r[S],O=L=(null==o?void 0:o.valueGetter)?o.valueGetter({accessor:e,row:W,rowIndex:S}):R(W,e);(null==o?void 0:o.valueFormatter)&&null!=L&&(O=o.valueFormatter({accessor:e,colIndex:0,row:W,rowIndex:S,value:L})),k.textContent=null!=O?O+"":"";var B=k.offsetWidth+P+A;B>H&&(H=B)}document.body.removeChild(k)}var q=Math.max(h,H);return E&&(q=Math.max(q,150)),q>a&&(q=a),q+2}(f.accessor,{rows:ae,header:f,maxWidth:500,sampleSize:50}),n=je($,f.accessor);if(n){var t=Ke($,n),r=n[n.length-1],o=t.map(function(n,t){return t===r?exports.__assign(exports.__assign({},n),{width:e}):n}),i=Ue($,n,o);pe(i),ne&&ne(i)}},[f,$,ae,pe,ne]);if(!f)return null;var nn=O&&!Re&&!b&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(f.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,t=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ve({callback:xn,callbackProps:{autoExpandColumns:F,collapsedHeaders:D,containerWidth:B,event:e.nativeEvent,header:f,headers:$,onColumnWidthChange:ne,reverse:w,setHeaders:pe,setIsResizing:we,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ve({callback:xn,callbackProps:{autoExpandColumns:F,collapsedHeaders:D,containerWidth:B,event:e,header:f,headers:$,onColumnWidthChange:ne,reverse:w,setHeaders:pe,setIsResizing:we,startWidth:t},limit:10})},onDoubleClick:en},{children:e.jsx("div",{className:"st-header-resize-handle"})})),tn=m&&m.key.accessor===f.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return Ze({event:e,header:f})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||re(f.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(f.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&X.sortUp&&X.sortUp,"desc"===m.direction&&X.sortDown&&X.sortDown]})),rn=ye&&X.filter&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:_e,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.target===e.currentTarget||e.currentTarget.contains(e.target))&&(e.target.closest(".st-dropdown-content")||(e.preventDefault(),_e()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(f.label),"aria-expanded":I,"aria-haspopup":"dialog"},{children:[n.cloneElement(X.filter,{style:{fill:Ie?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(le,exports.__assign({open:I,overflow:"visible",setOpen:C,onClose:function(){return C(!1)}},{children:e.jsx(zn,{header:f,currentFilter:Ie,onApplyFilter:function(e){j(e),C(!1)},onClearFilter:function(){K(f.accessor),C(!1)}})}))]})),on=Se&&!Re&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return Qe(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Qe(e))},tabIndex:0,role:"button","aria-label":"".concat(Me?"Expand":"Collapse"," ").concat(f.label," column"),"aria-expanded":!Me},{children:Me?X.headerCollapse:X.headerExpand})),an=e.jsx(Gn,exports.__assign({content:f.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:Re?e.jsx(Xe,{checked:!!A&&A(),onChange:function(e){U&&U(e)},ariaLabel:"Select all rows"}):M?e.jsx(de,{defaultValue:E,onBlur:function(){return N(!1)},onChange:Je}):E||(null==f?void 0:f.label)}))})),un="header-desc-".concat(f.accessor),ln=function(e,n){var t=[];return e.type&&"other"!==e.type&&t.push("".concat(e.type," column")),e.isSortable&&t.push("sortable"),n&&t.push("filterable"),e.tooltip&&t.push(e.tooltip),t.join(", ")}(f,ye);return e.jsxs(me,exports.__assign({className:Oe,id:g({accessor:f.accessor,rowId:"header"}),role:"columnheader","aria-sort":function(){if(f.isSortable)return(null==m?void 0:m.key.accessor)===f.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"data-col-index":i,"aria-describedby":ln?un:void 0,onDragOver:function(e){Re||Ve({callback:Ge,callbackProps:{event:e,hoveredHeader:f},limit:50})},style:exports.__assign({gridRowStart:d,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-d>1?{}:{height:ie})},{children:[w&&nn,!f.headerRenderer&&"right"===f.align&&on,!f.headerRenderer&&"right"===f.align&&rn,!f.headerRenderer&&"right"===f.align&&tn,e.jsx("div",exports.__assign({ref:He,className:"st-header-label",draggable:W&&!f.disableReorder&&!Re&&!Fe(f,V),onClick:function(e){Re||Ze({event:e,header:f})},onDoubleClick:function(e){Re||function(e){var n=e.header;n.isSelectionColumn||se&&n.isSortable&&re(n.accessor)}({event:e,header:f})},onDragEnd:Re?void 0:function(e){e.preventDefault(),ze()},onDragStart:Re?void 0:function(e){W&&f&&function(e){qe(e)}(f)}},{children:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:i,header:f,components:{sortIcon:tn||void 0,filterIcon:rn||void 0,collapseIcon:on||void 0,labelContent:an}}):an})),!f.headerRenderer&&"right"!==f.align&&tn,!f.headerRenderer&&"right"!==f.align&&rn,!f.headerRenderer&&"right"!==f.align&&on,!w&&nn,_&&!Re&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:_({accessor:f.accessor,colIndex:i,header:f,isOpen:Ce,onClose:$e,position:Te})})),ln&&e.jsx("span",exports.__assign({id:un,className:"st-sr-only"},{children:ln}))]}))},jn=function(t){var r=t.columnIndices,o=t.gridTemplateColumns,i=t.handleScroll,a=t.headers,u=t.maxDepth,l=t.pinned,s=t.sectionRef,c=t.sort,d=t.width,f=J(),v=f.collapsedHeaders,p=f.autoExpandColumns,h=n.useMemo(function(){var e=function(n,t){return x({header:n,pinned:l,headers:a,collapsedHeaders:v,rootPinned:t})?n.children&&0!==n.children.length?n.children.flatMap(function(n){return e(n,t)}):[n]:[]},n=a.flatMap(function(n){return e(n,n.pinned)});return 0===n.length?-1:r[n[n.length-1].accessor]},[a,l,v,r]),w=n.useMemo(function(){var e=[],n=1,t=function(o,i,s,c,d){var f,p;if(void 0===s&&(s=!1),!x({header:o,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d}))return 0;s||n++;var h,w,m=null!==(p=null===(f=o.children)||void 0===f?void 0:f.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})}).length)&&void 0!==p?p:0,g=n;if(o.singleRowChildren&&m>0?(h=g+1,w=u+1):m>0?(h=g+m,w=i+1):(h=g+1,w=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:h,gridRowStart:i,gridRowEnd:w,colIndex:r[o.accessor],parentHeader:c}),o.children&&o.children.length>0){var b=o.singleRowChildren?i:i+1,y=!o.singleRowChildren;o.children.forEach(function(e){x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})&&(t(e,b,y,o,d),y=!1)})}return h-g},o=a.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:e.pinned})}),i=!0;return o.forEach(function(e){t(e,1,i,void 0,e.pinned),i=!1}),e},[a,u,l,r,v]);return e.jsx(sn,exports.__assign({childRef:s,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:s,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:w.map(function(n){return e.jsx(Vn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:c,isLastHeader:p&&!l&&n.colIndex===h},n.header.accessor)})})}))}))},Kn=function(t){var r=t.calculatedHeaderHeight,o=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,u=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,d=t.sort,f=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=J(),h=p.headerContainerRef,w=p.pinnedLeftRef,m=p.pinnedRightRef,g=p.collapsedHeaders,x=p.tableRows,b=p.maxHeaderDepth,y=n.useMemo(function(){return Pe(i,"left")||Pe(i,void 0)||Pe(i,"right")},[i]),I=n.useMemo(function(){return y?void 0:{minHeight:r}},[y,r]),C=n.useMemo(function(){return dn({headers:i,pinnedLeftColumns:u,pinnedRightColumns:s,collapsedHeaders:g})},[i,u,s,g]),R=n.useMemo(function(){return Object.keys(C).length},[C]);return e.jsxs("div",exports.__assign({className:"st-header-container",ref:h,style:I,"aria-rowcount":x.length+b,"aria-colcount":R},{children:[Pe(i,"left")&&e.jsx(jn,{columnIndices:C,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:b,pinned:"left",sectionRef:w,sort:d,width:f}),e.jsx(jn,{columnIndices:C,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:b,sectionRef:o,sort:d}),Pe(i,"right")&&e.jsx(jn,{columnIndices:C,gridTemplateColumns:c,handleScroll:void 0,headers:i,maxDepth:b,pinned:"right",sectionRef:m,sort:d,width:v})]}))},Un=function(t){var r=t.calculatedHeaderHeight,o=t.hideHeader,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.setScrollTop,l=t.setScrollDirection,s=t.shouldShowEmptyState,c=t.sort,d=t.tableRows,f=t.rowsToRender,v=t.stickyParents,p=t.regularRows,h=t.partiallyVisibleRows,w=t.heightMap,m=J(),g=m.columnResizing,x=m.editColumns,b=m.headers,y=m.collapsedHeaders,I=m.autoExpandColumns,C=n.useRef(null),R=n.useMemo(function(){return b.filter(function(e){return!e.pinned})},[b]),S=n.useMemo(function(){return b.filter(function(e){return"left"===e.pinned})},[b]),M=n.useMemo(function(){return b.filter(function(e){return"right"===e.pinned})},[b]),N=n.useMemo(function(){return pn({headers:S,collapsedHeaders:y,autoExpandColumns:I})},[S,y,I]),H=n.useMemo(function(){return pn({headers:R,collapsedHeaders:y,autoExpandColumns:I})},[R,y,I]),E=n.useMemo(function(){return pn({headers:M,collapsedHeaders:y,autoExpandColumns:I})},[M,y,I]),T={calculatedHeaderHeight:r,centerHeaderRef:C,headers:b,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedRightColumns:M,pinnedRightTemplateColumns:E,sort:c,pinnedLeftWidth:i,pinnedRightWidth:a},k={calculatedHeaderHeight:r,heightMap:w,mainTemplateColumns:H,partiallyVisibleRows:h,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedLeftWidth:i,pinnedRightColumns:M,pinnedRightTemplateColumns:E,pinnedRightWidth:a,regularRows:p,rowsToRender:f,setScrollDirection:l,setScrollTop:u,shouldShowEmptyState:s,stickyParents:v,tableRows:d};return e.jsxs("div",exports.__assign({className:"st-content ".concat(g?"st-resizeable":"st-not-resizeable"),style:{width:x?"calc(100% - 29.5px)":"100%"}},{children:[!o&&e.jsx(Kn,exports.__assign({},T)),e.jsx(mn,exports.__assign({},k))]}))},_n=function(t){var r=t.mainBodyWidth,o=t.mainBodyRef,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.pinnedLeftContentWidth,l=t.pinnedRightContentWidth,c=t.tableBodyContainerRef,d=J().editColumns,f=n.useState(!1),v=f[0],p=f[1],h=n.useRef(null),w=n.useRef(null),m=n.useRef(null),g=d?s:0,x=(d?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&&p(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,r]),v?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(sn,exports.__assign({childRef:w,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:w,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),r>0&&e.jsx(sn,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:r}})}))})),a>0&&e.jsx(sn,exports.__assign({childRef:m,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:m,style:{width:x}},{children:e.jsx("div",{style:{width:l}})}))})),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},Jn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"asc"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"asc"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"asc"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"asc"===t?i:-i},enum:function(e,n,t){return Jn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"asc"===t?-1:1:null==n?"asc"===t?1:-1:"string"==typeof e&&"string"==typeof n?Jn.string(e,n,t):"number"==typeof e&&"number"==typeof n?Jn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Jn.boolean(e,n,t):Jn.string(e+"",n+"",t)}},Yn=function(e){return function(e){var n=e.rows,t=e.sortColumn,r=function(e,n){for(var t=0,o=e;o.length>t;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children,n);if(a)return a}}},o=r(e.headers,t.key.accessor),i=(null==o?void 0:o.type)||"string",a=t.direction,l=t.key.accessor;return u([],n,!0).sort(function(e,t){var r,u;if(null==o?void 0:o.valueGetter){var s=n.indexOf(e),c=n.indexOf(t);r=o.valueGetter({accessor:l,row:e,rowIndex:s}),u=o.valueGetter({accessor:l,row:t,rowIndex:c})}else r=R(e,l),u=R(t,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:t,valueA:r,valueB:u,direction:a}):function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"asc"===r?-1:1;if(null==n||""===n)return"asc"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=e+"";if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return Jn.number(i,a,r)}return"date"===t?Jn.date(e+"",n+"",r):"boolean"===t?Jn.boolean(!!e,!!n,r):"enum"===t?Jn.enum(e+"",n+"",r):Jn.string(e+"",n+"",r)}(r,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Xn=function(e){return n.useMemo(function(){var n=h(e),t=new Map;return n.forEach(function(e){t.set(e.accessor,e)}),t},[e])},$n=function(e){var n=e.tableRows,t=e.sortColumn,r=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:t?r&&r.length>0?(0,e.sortNestedRows)({groupingKeys:r,headers:o,rows:n,sortColumn:t}):Yn({headers:o,rows:n,sortColumn:t}):n},Qn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;o.length>r;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,s=i.children;s.length>l;l++){var c=s[l];if(Qn([c],n,t),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},Zn=function(e){return e.every(function(e){return e.hide})},et=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(et(e.children),Zn(e.children)&&(e.hide=!0))})};function nt(e){var n=e.fullRootHeaders,t=e.panelSection,r=e.expandedHeaders,o=e.forceExpanded,i=[],a=function(e,n,l,s){if(!e.isSelectionColumn&&!e.excludeFromRender){i.push({header:e,visualIndex:i.length,depth:n,parent:l,indexPath:s,panelSection:t});var c=e.children&&e.children.length>0,d=o||r.has(e.accessor);c&&d&&e.children&&e.children.forEach(function(t,r){a(t,n+1,e,u(u([],s,!0),[r],!1))})}};return e.sectionRoots.forEach(function(e){var t=n.findIndex(function(n){return n.accessor===e.accessor});-1!==t&&a(e,0,null,[t])}),i}var tt=function(t){var r=t.allHeaders,o=t.clearHoverSeparator,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,s=t.draggingRow,c=t.expandedHeaders,d=t.flattenedHeaders,f=t.forceExpanded,v=void 0!==f&&f,p=t.header,h=t.hoveredSeparatorIndex,w=t.isCheckedOverride,m=t.panelSection,g=t.rowIndex,x=t.setDraggingRow,b=t.setExpandedHeaders,y=t.setHoveredSeparatorIndex,I=J(),C=I.columnEditorConfig,R=I.essentialAccessors,S=I.headers,M=I.icons,N=I.setHeaders,H=I.onColumnVisibilityChange,E=I.onColumnOrderChange,T=!1!==C.allowColumnPinning,k="".concat(16*a,"px"),P=p.children&&p.children.length>0,A=Fe(p,R),F=!A,D=null!=w?w:!(p.hide||P&&p.children&&Zn(p.children)),L=c.has(p.accessor),W=v||L,O=function(){if(!v){var e=new Set(c);L?e.delete(p.accessor):e.add(p.accessor),b(e)}},B=n.useCallback(function(e){return!(R.size>0&&!Le(e,R)||(null==E||E(e),N(e),0))},[R,E,N]),q=n.useCallback(function(){var e=ze(S,p.accessor,"left",R);e&&B(e)},[B,R,p.accessor,S]),z=n.useCallback(function(){var e=ze(S,p.accessor,"right",R);e&&B(e)},[B,R,p.accessor,S]),G=n.useCallback(function(){var e=ze(S,p.accessor,"main",R);e&&B(e)},[B,R,p.accessor,S]),V="left"===p.pinned||"right"===p.pinned?p.pinned:null,j=!!V&&!A,K=!V&&"main"===m,U=!V&&"main"===m,_=function(e){if(F){p.hide=!e,e?(Qn(r,p.accessor),P&&p.children&&p.children.length>0&&p.children.every(function(e){return!0===e.hide})&&p.children[0]&&(p.children[0].hide=!1,Qn(r,p.children[0].accessor))):et(r);var n=u([],S,!0);if(N(n),H){var t=function(e){var n={},t=function(e){n[e.accessor]=!e.hide,e.children&&e.children.length>0&&e.children.forEach(t)};return e.forEach(t),n}(n);H(t)}}},Y=l&&P&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(W?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),O()}},{children:M.expand}))})),X=e.jsx(Xe,{checked:D,disabled:!F,onChange:_}),$=e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:M.drag})),Q={pinnedSide:V,canPinLeft:K,canPinRight:U,canUnpin:j,pinLeft:q,pinRight:z,unpin:G},Z="left"===V?M.pinnedLeftIcon:"right"===V?M.pinnedRightIcon:null,ee=T&&0===a?null!==V&&null!==Z?j?e.jsx("button",exports.__assign({type:"button",className:"st-column-pin-btn st-column-pin-side st-column-pin-pinned-mark st-column-pin-pinned-active","aria-label":"Unpin column",title:"Unpin",onClick:function(e){e.stopPropagation(),G()}},{children:Z})):e.jsx("span",exports.__assign({className:"st-column-pin-pinned-mark st-column-pin-side st-column-pin-pinned-essential st-column-pin-pinned-active","aria-hidden":!0,title:"Pinned (essential)"},{children:Z})):"main"===m&&(K||U)?e.jsxs("div",exports.__assign({className:"st-column-pin-side-group"},{children:[K?e.jsx("button",exports.__assign({type:"button",className:"st-column-pin-btn st-column-pin-side st-column-pin-side-option","aria-label":"Pin column to left",title:"Pin to left",onClick:function(e){e.stopPropagation(),q()}},{children:M.pinnedLeftIcon})):null,U?e.jsx("button",exports.__assign({type:"button",className:"st-column-pin-btn st-column-pin-side st-column-pin-side-option","aria-label":"Pin column to right",title:"Pin to right",onClick:function(e){e.stopPropagation(),z()}},{children:M.pinnedRightIcon})):null]})):null:null,ne=e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:p.label})),te=void 0!==g&&!p.disableReorder&&!Fe(p,R);return e.jsxs(e.Fragment,{children:[0===g&&e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:-1===h?1:0}}),e.jsx("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:k},draggable:te,onDragStart:function(e){e.dataTransfer.effectAllowed="move",void 0!==g&&(null==o||o(),x(d[g]))},onDragEnter:function(e){e.preventDefault()},onDragOver:function(e){if(e.preventDefault(),void 0!==g&&s&&s.panelSection===m){var n=e.currentTarget.getBoundingClientRect(),t=function(e){var n,t,r=e.flattenedHeaders,o=e.draggingRow,i=e.hoveredRowIndex,a=e.isTopHalfOfRow,u=r[i];if(u.panelSection!==o.panelSection)return null;if(u.depth===o.depth)return(null===(n=u.parent)||void 0===n?void 0:n.accessor)!==(null===(t=o.parent)||void 0===t?void 0:t.accessor)?null:a||u.header.children?i-1:i;if(u.depth>o.depth){for(var l=u,s=i,c=function(){var e=l.parent.accessor,n=r.findIndex(function(n){return n.header.accessor===e});if(-1===n)return"break";l=r[n],s=n};l.parent&&l.depth>o.depth&&"break"!==c(););for(var d=s,f=s,v=s+1;r.length>v&&r[v].depth>l.depth;v++)f=v;var p=f-d+1,h=i-d,w=p/2>h;return p%2==1&&h===Math.floor(p/2)&&(w=a),w?s-1:f}return null}({flattenedHeaders:d,draggingRow:s,hoveredRowIndex:g,isTopHalfOfRow:n.top+n.height/2>e.clientY});y(t)}},onDragEnd:function(){var e=function(){x(null),y(null)};if(s&&null!==h&&s.panelSection===m){var n=d[h>s.visualIndex?h:h+1];if(n){if(n.depth>s.depth&&n.parent){var t=d.findIndex(function(e){return e.header.accessor===n.parent.accessor});-1!==t&&(n=d[t])}if(s.header.accessor!==n.header.accessor)if(s.indexPath.length!==n.indexPath.length||1!==s.indexPath.length&&!s.indexPath.slice(0,-1).every(function(e,t){return e===n.indexPath[t]}))e();else{var r;if(1===s.indexPath.length){var o=Je(S,s.indexPath,n.indexPath),i=o.newHeaders;if(o.emergencyBreak)return void e();r=i}else{var a=Je(Ke(S,s.indexPath),[s.indexPath[s.indexPath.length-1]],[n.indexPath[n.indexPath.length-1]]);if(i=a.newHeaders,a.emergencyBreak)return void e();r=Ue(ke(S),s.indexPath,i)}B(r),e()}else e()}else e()}else e()}},{children:C.rowRenderer?C.rowRenderer({accessor:p.accessor,header:p,panelSection:m,isEssential:A,canToggleVisibility:F,allowColumnPinning:T,pinControl:Q,components:{expandIcon:Y||void 0,checkbox:X,dragIcon:$,labelContent:ne,pinIcon:T&&null!=ee?ee:void 0}}):e.jsxs(e.Fragment,{children:[l&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:P?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(W?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),O()}},{children:M.expand})):null})),e.jsx(Xe,{checked:D,disabled:!F,onChange:_}),ee,e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:M.drag})),e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:p.label}))]})})),e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:h===g?1:0}})]})},rt=function(e,n){var t=n.toLowerCase();return!!e.label.toLowerCase().includes(t)||!(!e.children||0>=e.children.length)&&e.children.some(function(e){return rt(e,n)})};function ot(n){var t=n.panelSection,r=n.doesAnyHeaderHaveChildren,o=n.allHeaders,i=n.expandedHeaders,a=n.setExpandedHeaders,u=n.forceExpanded,l=n.draggingRow,s=n.setDraggingRow,c=n.hoverSep,d=n.setHoverSep,f=n.flattenedForSection,v=(null==c?void 0:c.section)===t?c.index:null,p=function(e){d(null===e?null:{section:t,index:e})};return e.jsxs("div",exports.__assign({className:"st-column-editor-section","data-panel-section":t},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-section-label"},{children:n.title})),e.jsx("div",exports.__assign({className:"st-column-editor-list st-column-editor-list-section"},{children:f.map(function(n){return e.jsx(tt,{allHeaders:o,clearHoverSeparator:function(){return d(null)},doesAnyHeaderHaveChildren:r,depth:n.depth,draggingRow:l,expandedHeaders:i,flattenedHeaders:f,forceExpanded:u,header:n.header,hoveredSeparatorIndex:v,panelSection:t,rowIndex:n.visualIndex,setDraggingRow:s,setExpandedHeaders:a,setHoveredSeparatorIndex:p},"".concat(t,"-").concat(n.header.accessor,"-").concat(n.visualIndex))})}))]}))}var it=function(t){var r=t.headers,o=t.open,i=t.searchEnabled,a=t.searchPlaceholder,l=t.searchFunction,s=t.customRenderer,c=J().resetColumns,d=n.useState(""),f=d[0],v=d[1],p=n.useState(null),h=p[0],w=p[1],m=n.useState(null),g=m[0],x=m[1],b=n.useState(function(){var e=new Set,n=function(t){t.forEach(function(t){t.children&&t.children.length>0&&(e.add(t.accessor),n(t.children))})};return n(r),e}),y=b[0],I=b[1],C=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]),R=n.useMemo(function(){return i?function(e,n,t){if(!n.trim())return e;var r=t||rt;return e.filter(function(e){return!e.isSelectionColumn&&!e.excludeFromRender&&r(e,n)})}(r,f,l):r},[r,f,i,l]),S=n.useMemo(function(){return Ae(R)},[R]),M=S.pinnedLeft,N=S.unpinned,H=S.pinnedRight,E=i&&f.trim().length>0,T=n.useMemo(function(){return nt({sectionRoots:M,fullRootHeaders:r,panelSection:"left",expandedHeaders:y,forceExpanded:E})},[M,r,y,E]),k=n.useMemo(function(){return nt({sectionRoots:N,fullRootHeaders:r,panelSection:"main",expandedHeaders:y,forceExpanded:E})},[N,r,y,E]),P=n.useMemo(function(){return nt({sectionRoots:H,fullRootHeaders:r,panelSection:"right",expandedHeaders:y,forceExpanded:E})},[H,r,y,E]),A=n.useMemo(function(){return u(u(u([],T,!0),k,!0),P,!0)},[T,k,P]),F=i?e.jsx("div",exports.__assign({className:"st-column-editor-search-wrapper"},{children:e.jsx("div",exports.__assign({className:"st-column-editor-search"},{children:e.jsx("input",{type:"text",value:f,onChange:function(e){return v(e.target.value)},placeholder:a,className:"st-filter-input",onClick:function(e){return e.stopPropagation()}})}))})):null,D=M.length>0?ot({title:"Pinned left",panelSection:"left",doesAnyHeaderHaveChildren:C,allHeaders:r,expandedHeaders:y,setExpandedHeaders:I,forceExpanded:E,draggingRow:h,setDraggingRow:w,hoverSep:g,setHoverSep:x,flattenedForSection:T}):null,L=ot({title:"Columns",panelSection:"main",doesAnyHeaderHaveChildren:C,allHeaders:r,expandedHeaders:y,setExpandedHeaders:I,forceExpanded:E,draggingRow:h,setDraggingRow:w,hoverSep:g,setHoverSep:x,flattenedForSection:k}),W=H.length>0?ot({title:"Pinned right",panelSection:"right",doesAnyHeaderHaveChildren:C,allHeaders:r,expandedHeaders:y,setExpandedHeaders:I,forceExpanded:E,draggingRow:h,setDraggingRow:w,hoverSep:g,setHoverSep:x,flattenedForSection:P}):null,O=e.jsxs("div",exports.__assign({className:"st-column-editor-lists"},{children:[D,L,W]})),B=s?s({searchSection:F,listSection:O,pinnedLeftList:D,unpinnedList:L,pinnedRightList:W,flattenedHeaders:A,searchTerm:f,setSearchTerm:v,searchEnabled:i,searchPlaceholder:a,headers:r,resetColumns:c}):e.jsxs(e.Fragment,{children:[F,O]});return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:B}))}))},at=function(n){var t=n.columnEditorConfig,r=n.headers,o=n.open,i=n.setOpen,a=t.text,u=t.searchEnabled,l=t.searchPlaceholder,c=t.searchFunction,d=t.customRenderer;return n.editColumns?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(o?"open":""),onClick:function(){i(!o)},style:{width:s}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:a})),e.jsx(it,{headers:r,open:o,searchEnabled:u,searchPlaceholder:l,searchFunction:c,customRenderer:d})]})):null},ut=function(t){var o=t.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},[]),s=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=i.current[n])||void 0===t||t.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)});s(n,e)}))})})})}},[l,u]),c=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))}),s(e,n)},[a,u,s]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var t=i.current[n].indexOf(e);-1!==t&&i.current[n].splice(t,1)}})},[a,l]);return e.jsx(ln.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:r.default.Children.only(o)}))},lt=function(e){var n=e.tableRows,t=e.filterState;return e.externalFilterHandling?n:t&&0!==Object.keys(t).length?n.filter(function(e){return Object.values(t).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===(e+"").trim();if("isNotEmpty"===t)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=(e+"").toLowerCase(),a=r?(r+"").toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(+e)){var u=+e,l=+r;switch(t){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 s=o.map(Number),c=s[1];return u>=s[0]&&c>=u}return!1;case"notBetween":if(o&&2===o.length){var d=o.map(Number);return c=d[1],d[0]>u||u>c}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=Ce(e),v=Ce((r||"")+""),p=Ie(f),h=Ie(v);switch(t){case"equals":return p.getTime()===h.getTime();case"notEquals":return p.getTime()!==h.getTime();case"before":return h>p;case"after":return p>h;case"between":if(o&&2===o.length){var w=o.map(function(e){return Ie(Ce((e||"")+""))}),m=w[1];return p>=w[0]&&m>=p}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(e){return Ie(Ce((e||"")+""))});return m=g[1],g[0]>p||p>m}return!0}}if("boolean"==typeof e&&"equals"===t)return e===!!r;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"===t||"notIn"===t){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===t?b:!b}return!1}var y=(e+"").toLowerCase(),I=r?(r+"").toLowerCase():"";switch(t){case"equals":return y===I;case"notEquals":return y!==I;default:return!0}}(R(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},st=function(e){var n,t=document.querySelector(".simple-table-root");if("string"==typeof e){if(e.endsWith("px"))return parseInt(e,10);if(e.endsWith("vh"))return window.innerHeight*parseInt(e,10)/100;if(e.endsWith("%")){var r=null===(n=null==t?void 0:t.parentElement)||void 0===n?void 0:n.clientHeight;return!r||50>r?0:r*parseInt(e,10)/100}return window.innerHeight}return e},ct=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;if(r&&t&&M(t))i(t);else{var a=R(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,u=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===t.type?o.length:void 0;switch(t.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 t.formatResult?t.formatResult(a):a}},dt=function(e){var t=e.effectiveHeaders,r=e.headerHeight,o=e.rowHeight,i=e.tableBodyContainerRef,a=n.useState(0),u=a[0],l=a[1],s=n.useCallback(function(e){var n,t;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(t=e.children)||void 0===t?void 0:t.length)?1+Math.max.apply(Math,e.children.map(s)):1},[]),c=n.useMemo(function(){var e=0;return t.forEach(function(n){var t=s(n);e=Math.max(e,t)}),e},[t,s]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,t=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(t){var i=parseFloat(t);isNaN(i)||(e=i)}}return c*(null!=r?r:o)+e},[c,r,o]);return n.useLayoutEffect(function(){var e=function(e,n){void 0===n&&(n=150);var t=null,r=null,o=null,i=function(){null!==r&&clearTimeout(r),r=setTimeout(function(){r=null,function(){if(null!==t){var n=t;t=null,e(n)}}()},n)};return{notify:function(e){t=e,i()},notifyFromObserver:function(e){null!==o&&cancelAnimationFrame(o),o=requestAnimationFrame(function(){o=null,t=e(),i()})},publishImmediately:function(n){null!==r&&(clearTimeout(r),r=null),t=null,e(n)},destroy:function(){null!==r&&(clearTimeout(r),r=null),null!==o&&(cancelAnimationFrame(o),o=null),t=null}}}(function(e){l(function(n){return n===e?n:(function(){var e,n=window.__containerResizePerf;n&&(n.containerWidthStateUpdates=(null!==(e=n.containerWidthStateUpdates)&&void 0!==e?e:0)+1,window.dispatchEvent(new CustomEvent("st-container-width-update")))}(),e)})}),n=function(){var e,n;return null!==(n=null===(e=i.current)||void 0===e?void 0:e.clientWidth)&&void 0!==n?n:0},t=n();t>0&&e.publishImmediately(t);var r=null,o=i.current;return o&&"undefined"!=typeof ResizeObserver&&(r=new ResizeObserver(function(){e.notifyFromObserver(n)})).observe(o),function(){null==r||r.disconnect(),e.destroy()}},[i]),{containerWidth:u,calculatedHeaderHeight:d,maxHeaderDepth:c}},ft=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},vt=function(e){return function(){for(var n=[],t=0;arguments.length>t;t++)n[t]=arguments[t];return new Promise(function(t){e.apply(void 0,n),setTimeout(function(){return t()},0)})}},pt=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},ht={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}},wt=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")},mt=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){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(){wt(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},gt=[],xt=function(e){var t=e.rows,r=e.rowGrouping,o=void 0===r?gt:r,i=e.getRowId,a=e.expandedRows,l=e.collapsedRows,s=e.expandedDepths,c=e.rowStateMap,d=e.hasLoadingRenderer,f=e.hasErrorRenderer,v=e.hasEmptyRenderer,p=e.headers,h=e.rowHeight,w=e.headerHeight,m=e.customTheme;return n.useMemo(function(){if(!o||0===o.length){var e=t.map(function(e,n){var t=[n],r=[n];return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowId:N({row:e,getRowId:i,depth:0,index:n,rowPath:t,rowIndexPath:r,groupingKey:void 0}),rowPath:t,rowIndexPath:r,absoluteRowIndex:n,isLastGroupRow:!1}});return{flattenedRows:e,heightOffsets:[],paginatableRows:e,parentEndPositions:t.map(function(e,n){return n+1})}}var n=[],r=[],g=[],x=[],b=0,C=function(e,t,R,S,M){void 0===R&&(R=[]),void 0===S&&(S=[]),void 0===M&&(M=[]),e.forEach(function(e,k){var P,A,F=o[t],D=n.length,L=u(u([],R,!0),[k],!1),W=u(u([],S,!0),[k],!1),O=N({row:e,getRowId:i,depth:t,index:k,rowPath:L,rowIndexPath:W,groupingKey:F}),B=n.length,q={row:e,depth:t,displayPosition:b,groupingKey:F,position:D,isLastGroupRow:0===t,rowId:O,rowPath:L,rowIndexPath:W,absoluteRowIndex:D,parentIndices:M.length>0?u([],M,!0):void 0};n.push(q),r.push(q),b++;var z=H(O);if(T(z,t,s,a,l)&&o.length>t){var G=null==c?void 0:c.get(z),V=E(e,F),j=p.find(function(e){return e.expandable&&e.nestedTable});if((null==j?void 0:j.nestedTable)&&V.length>0){var K=n.length,U=(null===(P=j.nestedTable.customTheme)||void 0===P?void 0:P.rowHeight)||h,_=(null===(A=j.nestedTable.customTheme)||void 0===A?void 0:A.headerHeight)||w,J=y({childRowCount:V.length,rowHeight:U,headerHeight:_,customTheme:m}),Y=I({calculatedHeight:J,customHeight:j.nestedTable.height,customTheme:m});g.push([K,Y-h]);var X=u(u([],L,!0),[F],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:F,position:K,isLastGroupRow:!1,rowId:X,rowPath:X,rowIndexPath:W,nestedTable:{parentRow:e,expandableHeader:j,childAccessor:F,calculatedHeight:Y},absoluteRowIndex:K})}else if(G&&(G.loading||G.error||G.isEmpty)){if(G.loading&&d||G.error&&f||G.isEmpty&&v){var $=n.length,Q=u(u([],L,!0),[F],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:F,position:$,isLastGroupRow:!1,rowId:Q,rowPath:Q,rowIndexPath:W,stateIndicator:{parentRowId:z,parentRow:e,state:G},absoluteRowIndex:$,parentIndices:u(u([],M,!0),[B],!1)})}else if(G.loading&&!d){var Z=n.length,ee=u(u([],L,!0),[F,"loading-skeleton"],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:F,position:Z,isLastGroupRow:!1,rowId:ee,rowPath:ee,rowIndexPath:W,isLoadingSkeleton:!0,absoluteRowIndex:Z,parentIndices:u(u([],M,!0),[B],!1)})}}else if(V.length>0){var ne=u(u([],L,!0),[F],!1),te=u([],W,!0);C(V,t+1,ne,te,u(u([],M,!0),[B],!1))}}0===t&&x.push(n.length)})};return C(t,0,[],[],[]),{flattenedRows:n,heightOffsets:g,paginatableRows:r,parentEndPositions:x}},[t,o,i,a,l,s,c,d,f,v,p,h,w,m])},bt={rowHeight:32,headerHeight:32,footerHeight:49,rowSeparatorWidth:1,borderWidth:1,pinnedBorderWidth:1,nestedGridBorderWidth:2,nestedGridPaddingTop:8,nestedGridPaddingBottom:8,nestedGridPaddingLeft:8,nestedGridPaddingRight:8,nestedGridMaxHeight:400,selectionColumnWidth:42},yt={text:"Columns",searchEnabled:!0,searchPlaceholder:"Search columns...",allowColumnPinning:!0},It=[{propName:"columnEditorText",replacement:"columnEditorConfig.text",message:"Use the columnEditorConfig object instead for better organization of column editor settings."},{propName:"expandIcon",replacement:"icons.expand",message:"Use the icons object instead for better organization of icon settings."},{propName:"filterIcon",replacement:"icons.filter",message:"Use the icons object instead for better organization of icon settings."},{propName:"headerCollapseIcon",replacement:"icons.headerCollapse",message:"Use the icons object instead for better organization of icon settings."},{propName:"headerExpandIcon",replacement:"icons.headerExpand",message:"Use the icons object instead for better organization of icon settings."},{propName:"nextIcon",replacement:"icons.next",message:"Use the icons object instead for better organization of icon settings."},{propName:"prevIcon",replacement:"icons.prev",message:"Use the icons object instead for better organization of icon settings."},{propName:"sortDownIcon",replacement:"icons.sortDown",message:"Use the icons object instead for better organization of icon settings."},{propName:"sortUpIcon",replacement:"icons.sortUp",message:"Use the icons object instead for better organization of icon settings."}],Ct=function(e,n){var t=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?t.push.apply(t,Ct(e.children,null!=n?n:e.pinned)):t.push(e))}),t},Rt=function(e,n){return n>=e.reduce(function(e,n){return e+D(n)},0)},St=function(e,n){var t=new Map,r=e.reduce(function(e,n){return e+("number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150)},0);if(0===r)return t;var o=n/r;if(.01>Math.abs(o-1))return t;var i=0;return e.forEach(function(r,a){var u,l="number"==typeof r.width?r.width:"string"==typeof r.width&&r.width.endsWith("px")?parseFloat(r.width):150;a===e.length-1?u=n-i:i+=u=Math.round(l*o),t.set(r.accessor,u)}),t},Mt=function(e,n){var t,r=n.containerWidth,o=n.pinnedLeftWidth,i=n.pinnedRightWidth,a=n.mainBodyRef;if(!n.autoExpandColumns||0===r||n.isResizing)return e;t=a.current?a.current.clientWidth:Math.max(0,r-o-i);var u=e.filter(function(e){return"left"===e.pinned}),l=e.filter(function(e){return"right"===e.pinned}),s=e.filter(function(e){return!e.pinned}),c=Ct(u,"left"),d=Ct(l,"right"),f=Ct(s,void 0),v=c.length>0&&Rt(c,o),p=d.length>0&&Rt(d,i),h=f.length>0&&t>0&&Rt(f,t),w=new Map;if(v&&St(c,o).forEach(function(e,n){return w.set(n,e)}),p&&St(d,i).forEach(function(e,n){return w.set(n,e)}),h&&St(f,t).forEach(function(e,n){return w.set(n,e)}),0===w.size)return e;var m=function(e,n){var t;if(e.hide)return e;var r=null!=n?n:e.pinned,o=null===(t=e.children)||void 0===t?void 0:t.map(function(e){return m(e,r)});if(!e.children||0===e.children.length){var i=w.get(e.accessor);return void 0!==i?exports.__assign(exports.__assign({},e),{width:i,children:o}):exports.__assign(exports.__assign({},e),{children:o})}return exports.__assign(exports.__assign({},e),{children:o})};return e.map(function(e){return m(e,e.pinned)})},Nt=e.jsx(function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},{}),Ht=function(t){var r=n.useState(!1),o=r[0],i=r[1];return n.useEffect(function(){!function(e){"production"!==process.env.NODE_ENV&&It.forEach(function(n){var t=n.propName,r=n.replacement,o=n.message;if(void 0!==e[t]){var i='SimpleTable: The "'.concat(t,'" prop is deprecated and will be removed in a future version.'),a='Please use "'.concat(r,'" instead.'),u=o?"\n".concat(o):"",l=r.split("."),s=l[0],c=l[1],d="string"==typeof e[t]?JSON.stringify(e[t]):"<YourIcon />";console.error("".concat(i,"\n").concat(a).concat(u,"\n\nExample:\n<SimpleTable\n ").concat(s,"={{\n ").concat(c,": ").concat(d,"\n }}\n/>"))}})}(t)},[]),n.useEffect(function(){i(!0)},[]),o?e.jsx(Et,exports.__assign({},t)):null},Et=function(t){var r=t.allowAnimations,o=void 0!==r&&r,s=t.autoExpandColumns,c=void 0!==s&&s,d=t.canExpandRowGroup,f=t.cellUpdateFlash,v=void 0!==f&&f,p=t.className,w=t.columnBorders,m=void 0!==w&&w,g=t.columnEditorConfig,x=void 0===g?yt:g,y=t.columnEditorText,I=t.columnReordering,C=void 0!==I&&I,E=t.columnResizing,T=void 0!==E&&E,A=t.copyHeadersToClipboard,F=void 0!==A&&A,D=t.customTheme,L=t.defaultHeaders,W=t.editColumns,O=void 0!==W&&W,q=t.editColumnsInitOpen,z=void 0!==q&&q,V=t.emptyStateRenderer,U=t.enableHeaderEditing,J=void 0!==U&&U,Y=t.enableRowSelection,$=void 0!==Y&&Y,te=t.enableStickyParents,ae=void 0!==te&&te,le=t.errorStateRenderer,se=t.expandAll,ce=void 0===se||se,de=t.expandIcon,fe=t.externalFilterHandling,ve=void 0!==fe&&fe,pe=t.externalSortHandling,he=void 0!==pe&&pe,we=t.filterIcon,me=t.footerRenderer,ge=t.headerCollapseIcon,xe=t.headerDropdown,be=t.headerExpandIcon,ye=t.height,Ie=t.hideFooter,Ce=void 0!==Ie&&Ie,Re=t.hideHeader,Se=void 0!==Re&&Re,Me=t.icons,Ne=t.includeHeadersInCSVExport,He=void 0===Ne||Ne,Ee=t.initialSortColumn,Pe=t.initialSortDirection,Ae=void 0===Pe?"asc":Pe,De=t.isLoading,Le=void 0!==De&&De,We=t.loadingStateRenderer,Be=t.maxHeight,ze=t.nextIcon,Ge=t.onCellClick,Ve=t.onCellEdit,je=t.onColumnOrderChange,Ke=t.onColumnSelect,Ue=t.onColumnVisibilityChange,_e=t.onColumnWidthChange,Je=t.onFilterChange,Ye=t.onGridReady,Xe=t.onHeaderEdit,$e=t.onLoadMore,Qe=t.onNextPage,Ze=t.onPageChange,en=t.onRowGroupExpand,nn=t.onRowSelectionChange,tn=t.onSortChange,rn=t.prevIcon,on=t.quickFilter,an=t.rowButtons,un=t.rowGrouping,ln=t.getRowId,sn=t.rows,cn=t.rowsPerPage,dn=void 0===cn?10:cn,fn=t.selectableCells,vn=void 0!==fn&&fn,pn=t.selectableColumns,hn=void 0!==pn&&pn,wn=t.serverSidePagination,mn=void 0!==wn&&wn,gn=t.shouldPaginate,xn=void 0!==gn&&gn,bn=t.sortDownIcon,In=t.sortUpIcon,Cn=t.tableEmptyStateRenderer,Rn=void 0===Cn?Nt:Cn,Sn=t.tableRef,Mn=t.theme,Nn=void 0===Mn?"modern-light":Mn,Hn=t.totalRowCount,En=t.useHoverRowBackground,Tn=void 0===En||En,kn=t.useOddColumnBackground,Pn=void 0!==kn&&kn,An=t.useOddEvenRowBackground,Fn=void 0!==An&&An,Dn=n.useMemo(function(){var n,t,r,o,i,a,u,l,s,c,d,f,v,p,h,w,m,g,x,b={drag:e.jsx(oe,{className:"st-drag-icon"}),expand:e.jsx(ee,{className:"st-expand-icon"}),filter:e.jsx(ie,{className:"st-header-icon"}),headerCollapse:e.jsx(ee,{className:"st-header-icon"}),headerExpand:e.jsx(Z,{className:"st-header-icon"}),next:e.jsx(ee,{className:"st-next-prev-icon"}),prev:e.jsx(Z,{className:"st-next-prev-icon"}),sortDown:e.jsx(re,{className:"st-header-icon"}),sortUp:e.jsx(ne,{className:"st-header-icon"}),pinnedLeftIcon:e.jsx("div",{children:"L"}),pinnedRightIcon:e.jsx("div",{children:"R"})};return{drag:null!==(n=null==Me?void 0:Me.drag)&&void 0!==n?n:b.drag,expand:null!==(r=null!==(t=null==Me?void 0:Me.expand)&&void 0!==t?t:de)&&void 0!==r?r:b.expand,filter:null!==(i=null!==(o=null==Me?void 0:Me.filter)&&void 0!==o?o:we)&&void 0!==i?i:b.filter,headerCollapse:null!==(u=null!==(a=null==Me?void 0:Me.headerCollapse)&&void 0!==a?a:ge)&&void 0!==u?u:b.headerCollapse,headerExpand:null!==(s=null!==(l=null==Me?void 0:Me.headerExpand)&&void 0!==l?l:be)&&void 0!==s?s:b.headerExpand,next:null!==(d=null!==(c=null==Me?void 0:Me.next)&&void 0!==c?c:ze)&&void 0!==d?d:b.next,prev:null!==(v=null!==(f=null==Me?void 0:Me.prev)&&void 0!==f?f:rn)&&void 0!==v?v:b.prev,sortDown:null!==(h=null!==(p=null==Me?void 0:Me.sortDown)&&void 0!==p?p:bn)&&void 0!==h?h:b.sortDown,sortUp:null!==(m=null!==(w=null==Me?void 0:Me.sortUp)&&void 0!==w?w:In)&&void 0!==m?m:b.sortUp,pinnedLeftIcon:null!==(g=null==Me?void 0:Me.pinnedLeftIcon)&&void 0!==g?g:b.pinnedLeftIcon,pinnedRightIcon:null!==(x=null==Me?void 0:Me.pinnedRightIcon)&&void 0!==x?x:b.pinnedRightIcon}},[Me,de,we,ge,be,ze,rn,bn,In]),Ln=n.useMemo(function(){return exports.__assign(exports.__assign({},bt),D)},[D]),Wn=n.useMemo(function(){var e,n,t,r,o;return{text:null!==(n=null!==(e=null==x?void 0:x.text)&&void 0!==e?e:y)&&void 0!==n?n:yt.text,searchEnabled:null!==(t=null==x?void 0:x.searchEnabled)&&void 0!==t?t:yt.searchEnabled,searchPlaceholder:null!==(r=null==x?void 0:x.searchPlaceholder)&&void 0!==r?r:yt.searchPlaceholder,allowColumnPinning:null!==(o=null==x?void 0:x.allowColumnPinning)&&void 0!==o?o:yt.allowColumnPinning,searchFunction:null==x?void 0:x.searchFunction,rowRenderer:null==x?void 0:x.rowRenderer,customRenderer:null==x?void 0:x.customRenderer}},[x,y]),On=Ln.rowHeight,Bn=Ln.headerHeight,qn=Ln.footerHeight,zn=Ln.selectionColumnWidth;Pn&&(Fn=!1),m&&(Tn=!1);var Gn=n.useRef(null),Vn=n.useRef(null),jn=n.useRef(null),Kn=n.useRef(null),Jn=n.useRef(null),Qn=n.useRef(null),Zn=n.useRef(null),et=n.useReducer(function(e){return e+1},0)[1],nt=n.useState(new Map),tt=nt[0],rt=nt[1],ot=n.useState(sn),it=ot[0],pt=ot[1],wt=n.useState(Le),mt=wt[0],gt=wt[1],It=n.useRef(Le),Ct=n.useRef(new Map);n.useEffect(function(){pt(sn);var e=new Map;sn.forEach(function(n,t){var r=N({row:n,getRowId:ln,depth:0,index:t,rowPath:[t],rowIndexPath:[t]}),o=H(r);e.set(o,t)}),Ct.current=e},[sn,ln]),n.useEffect(function(){var e=It.current,n=Le;n&&!e?gt(!0):!n&&e&&setTimeout(function(){gt(!1)},0),It.current=Le},[Le]);var Rt,St,Ht,Et,Tt,kt,Pt,At,Ft,Dt,Lt=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){t.current&&i(t.current.offsetWidth-t.current.clientWidth)},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:Qn}),Wt=Lt.scrollbarWidth,Ot=Lt.setScrollbarWidth,Bt=ue({headerContainerRef:Zn,mainSectionRef:Qn,scrollbarWidth:Wt}).isMainSectionScrollable,qt=n.useMemo(function(){if(mt&&0===it.length){var e=xn?dn:10;return Bt&&(e+=1),Array.from({length:e},function(e,n){return{}})}return it},[mt,it,dn,Bt,xn]),zt=n.useMemo(function(){return ke(L)},[L]),Gt=n.useState(1),Vt=Gt[0],jt=Gt[1],Kt=n.useState(zt),Ut=Kt[0],_t=Kt[1],Jt=n.useState(!1),Yt=Jt[0],Xt=Jt[1],$t=n.useState(null),Qt=$t[0],Zt=$t[1],er=n.useState(z),nr=er[0],tr=er[1],rr=n.useCallback(function(){var e=new Set,n=function(t){t.forEach(function(t){t.collapseDefault&&t.collapsible&&e.add(t.accessor),t.children&&n(t.children)})};return n(zt),e},[zt]),or=n.useState(rr),ir=or[0],ar=or[1];n.useEffect(function(){_t(zt)},[zt]);var ur=n.useMemo(function(){var e,n=u([],Ut,!0);return $&&!(null===(e=null==Ut?void 0:Ut[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:zn,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[$,Ut,zn]),lr=n.useMemo(function(){return function(e){var n=new Set,t=function(e){for(var r,o=0,i=e;i.length>o;o++){var a=i[o];a.isEssential&&n.add(a.accessor+""),(null===(r=a.children)||void 0===r?void 0:r.length)&&t(a.children)}};return t(e),n}(ur)},[ur]),sr=n.useState(0),cr=sr[0],dr=sr[1],fr=n.useState("none"),vr=fr[0],pr=fr[1],hr=function(e,t){var r=n.useState(function(){return function(e,n){if(!n||0===n.length)return new Set;if(e){var t=Array.from({length:n.length},function(e,n){return n});return new Set(t)}return new Set}(e,t)}),o=r[0],i=r[1];return n.useEffect(function(){i(t&&0!==t.length?function(e){var n=t.length,r=Array.from(e).filter(function(e){return n>e});return new Set(r)}:new Set)},[t]),{expandedDepths:o,setExpandedDepths:i}}(ce,un),wr=hr.expandedDepths,mr=hr.setExpandedDepths,gr=n.useState(new Map),xr=gr[0],br=gr[1],yr=n.useState(new Map),Ir=yr[0],Cr=yr[1],Rr=function(){var e=n.useState(""),t=e[0],r=e[1],o=n.useRef(null);n.useEffect(function(){return t&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){r("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[t]);var i=n.useCallback(function(e){r(e)},[]);return{announcement:t,announce:i}}(),Sr=Rr.announcement,Mr=Rr.announce,Nr=dt({effectiveHeaders:ur,headerHeight:Bn,rowHeight:On,tableBodyContainerRef:Qn}),Hr=Nr.containerWidth,Er=Nr.calculatedHeaderHeight,Tr=Nr.maxHeaderDepth,kr=n.useMemo(function(){var e=yn({headers:ur,containerWidth:Hr,collapsedHeaders:ir});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth,pinnedLeftContentWidth:e.leftContentWidth,pinnedRightContentWidth:e.rightContentWidth}},[ur,Hr,ir]),Pr=kr.mainBodyWidth,Ar=kr.pinnedLeftWidth,Fr=kr.pinnedRightWidth,Dr=kr.pinnedLeftContentWidth,Lr=kr.pinnedRightContentWidth,Wr=function(e){var t=e.autoExpandColumns,r=e.containerWidth,o=e.pinnedLeftWidth,i=e.pinnedRightWidth,a=e.mainBodyRef,u=e.isResizing,l=e.setHeaders,s=n.useRef({autoExpandColumns:t,containerWidth:r,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u});s.current={autoExpandColumns:t,containerWidth:r,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u};var c=n.useCallback(function(e){l(function(n){var t="function"==typeof e?e(n):e;return Mt(t,s.current)})},[l]),d=n.useRef(u);n.useEffect(function(){d.current&&!u&&t&&l(function(e){return Mt(e,s.current)}),d.current=u},[u,t,l]);var f=n.useRef(r);return n.useEffect(function(){r>0&&r!==f.current&&!u&&t&&l(function(e){return Mt(e,s.current)}),f.current=r},[r,u,t,l]),c}({autoExpandColumns:c,containerWidth:Hr,pinnedLeftWidth:Ar,pinnedRightWidth:Fr,mainBodyRef:jn,isResizing:Yt,setHeaders:_t}),Or=function(e){var t=e.rows,r=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return t;var e=function(e){return h(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=o[t],a=o[t+1],u=n[r];if(u&&M(u)){var l=i(u,t+1),s=exports.__assign({},n);return s[r]=l,e.forEach(function(e){var n=ct(l,e.accessor,e.aggregation,a);void 0!==n&&S(s,e.accessor,n)}),s}return n})};return i(n)},[t,r,o])}({rows:qt,headers:Ut,rowGrouping:un}),Br=function(e){var t=e.rows,r=e.headers,o=e.quickFilter;return n.useMemo(function(){if(!o||!o.text||""===o.text.trim())return t;var e=o.text,n=o.columns,i=o.caseSensitive,a=void 0!==i&&i,u=o.mode,l=void 0===u?"simple":u,s=o.useFormattedValue,c=void 0===s||s,d=r.filter(function(e){return!e.hide&&!e.excludeFromRender&&(n&&n.length>0?n.includes(e.accessor):!1!==e.quickFilterable)}),f="smart"===l?function(e){for(var n=[],t=0;e.length>t;){for(;e.length>t&&/\s/.test(e[t]);)t++;if(t>=e.length)break;if("-"!==e[t])if('"'!==e[t]){for(var r=t;e.length>t&&!/[\s:]/.test(e[t]);)t++;var o=e.substring(r,t);if(e.length>t&&":"===e[t]){for(var i=++t;e.length>t&&!/\s/.test(e[t]);)t++;(l=e.substring(i,t))&&n.push({type:"columnSpecific",value:l,column:o})}else o&&n.push({type:"word",value:o})}else{for(var a=++t;e.length>t&&'"'!==e[t];)t++;(l=e.substring(a,t))&&n.push({type:"phrase",value:l}),e.length>t&&'"'===e[t]&&t++}else{for(var u=++t;e.length>t&&!/\s/.test(e[t]);)t++;var l;(l=e.substring(u,t))&&n.push({type:"negation",value:l})}}return n}(e):null;return t.filter(function(n){if("smart"===l&&f){var t=new Set,r=new Map;f.forEach(function(e,n){"columnSpecific"===e.type&&e.column&&(r.has(e.column)||r.set(e.column,[]),r.get(e.column).push(n))});var o=[];d.forEach(function(e){try{var i;if(e.quickFilterGetter)i=e.quickFilterGetter({row:n,accessor:e.accessor});else{var u=R(n,e.accessor);if(c&&e.valueFormatter){var l=e.valueFormatter({accessor:e.accessor,colIndex:0,row:n,rowIndex:0,value:u});i=Array.isArray(l)?l.join(" "):l+""}else i=null==u?"":Array.isArray(u)?u.join(" "):u+""}o.push(i);var s=r.get(e.accessor);s&&s.forEach(function(e){var n=f[e],r=a?i:i.toLowerCase(),o=a?n.value:n.value.toLowerCase();r.includes(o)&&t.add(e)})}catch(n){console.warn("Quick filter error for column ".concat(e.accessor,":"),n)}});var i=a?o.join(" "):o.join(" ").toLowerCase();return f.forEach(function(e,n){if("columnSpecific"!==e.type){var r=a?e.value:e.value.toLowerCase();switch(e.type){case"word":case"phrase":i.includes(r)&&t.add(n);break;case"negation":i.includes(r)||t.add(n)}}}),t.size===f.length}return d.some(function(t){try{var r=void 0;if(t.quickFilterGetter)r=t.quickFilterGetter({row:n,accessor:t.accessor});else{var o=R(n,t.accessor);if(c&&t.valueFormatter){var i=t.valueFormatter({accessor:t.accessor,colIndex:0,row:n,rowIndex:0,value:o});r=Array.isArray(i)?i.join(" "):i+""}else r=null==o?"":Array.isArray(o)?o.join(" "):o+""}return function(e,n,t){if(!n)return!0;var r=t?e:e.toLowerCase(),o=t?n:n.toLowerCase();return r.includes(o)}(r,e,a)}catch(e){return console.warn("Quick filter error for column ".concat(t.accessor,":"),e),!1}})})},[t,r,o])}({rows:Or,headers:ur,quickFilter:on}),qr=function(e){var t=e.rows,r=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],s=u[1],c=Xn(r),d=n.useMemo(function(){return lt({externalFilterHandling:o,tableRows:t,filterState:l})},[t,l,o]),f=n.useCallback(function(e){var n,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(s(t),null==i||i(t),a){var r=c.get(e.accessor);r&&a("Filter applied to ".concat(r.label))}},[l,i,a,c]),v=n.useCallback(function(e){var n=exports.__assign({},l);if(delete n[e],s(n),null==i||i(n),a){var t=c.get(e);t&&a("Filter removed from ".concat(t.label))}},[l,i,a,c]),p=n.useCallback(function(){s({}),null==i||i({}),a&&a("All filters cleared")},[i,a]),h=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return lt({externalFilterHandling:o,tableRows:t,filterState:r})},[l,t,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Br,headers:ur,externalFilterHandling:ve,onFilterChange:Je,announce:Mr}),zr=qr.filters,Gr=qr.updateFilter,Vr=qr.clearFilter,jr=qr.clearAllFilters,Kr=qr.computeFilteredRowsPreview,Ur=function(e){var t=e.headers,r=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,s=e.announce,c=Xn(t),d=n.useCallback(function(){if(!u)return null;var e=c.get(u);return e?{key:e,direction:l||"asc"}:null},[c,u,l]),f=n.useState(d),v=f[0],p=f[1],h=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.sortColumn,o=Yn({headers:t,rows:e.rows,sortColumn:r});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(M(a)){var u=h({rows:a,sortColumn:r,headers:t,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return $n({externalSortHandling:o,tableRows:r,sortColumn:v,rowGrouping:a,headers:t,sortNestedRows:h})},[r,v,t,o,a,h]),m=n.useCallback(function(e){if(!e)return p(null),void(null==i||i(null));var n=e.accessor,t=e.direction,r=c.get(n);if(r){var o=null;if(t)o={key:r,direction:t};else{var a=r.sortingOrder||["asc","desc",null],u=-1;v&&v.key.accessor===n&&(u=a.indexOf(v.direction));var l=a[(u+1)%a.length];o=null===l?null:{key:r,direction:l}}if(p(o),null==i||i(o),s)if(o){var d="asc"===o.direction?"ascending":"descending";s("Sorted by ".concat(r.label,", ").concat(d))}else s("Sort removed from ".concat(r.label))}},[v,c,i,s]),g=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;o.length>r;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(t);if(!i)return r;var u=i.sortingOrder||["asc","desc",null],l=-1;v&&v.key.accessor===e&&(l=u.indexOf(v.direction));var s=u[(l+1)%u.length];return $n({externalSortHandling:o,tableRows:r,sortColumn:null===s?null:{key:i,direction:s},rowGrouping:a,headers:t,sortNestedRows:h})},[v,t,r,o,a,h]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:g}}({headers:Ut,tableRows:qr.filteredRows,externalSortHandling:he,onSortChange:tn,rowGrouping:un,initialSortColumn:Ee,initialSortDirection:Ae,announce:Mr}),_r=Ur.sort,Jr=Ur.updateSort,Yr=Ur.computeSortedRowsPreview,Xr=xt({rows:Ur.sortedRows,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}),$r=Xr.flattenedRows,Qr=Xr.heightOffsets,Zr=Xr.paginatableRows,eo=Xr.parentEndPositions,no=function(e){var t=e.tableRows,r=e.onRowSelectionChange,o=e.enableRowSelection,i=void 0!==o&&o,a=n.useState(new Set),u=a[0],l=a[1],s=n.useCallback(function(e){return!!i&&function(e,n){return n.has(e)}(e,u)},[u,i]),c=n.useCallback(function(){return!!i&&function(e,n){return 0!==e.length&&e.filter(function(e){return e&&e.rowId}).every(function(e){return n.has(H(e.rowId))})}(t,u)},[t,u,i]),d=n.useMemo(function(){return i?function(e){return e.size}(u):0},[u,i]),f=n.useMemo(function(){return i?function(e,n){return e.filter(function(e){return!(!e||!e.rowId)&&n.has(H(e.rowId))}).map(function(e){return e.row})}(t,u):[]},[t,u,i]),v=n.useCallback(function(e,n){if(i){var o=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(l(o),r){var a=t.find(function(n){return H(n.rowId)===e});a&&r({row:a.row,isSelected:n,selectedRows:o})}}},[u,t,r,i]),p=n.useCallback(function(e){var n;i&&(e?(n=function(e){return new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}))}(t),r&&t.forEach(function(e){return r({row:e.row,isSelected:!0,selectedRows:n})})):(n=new Set,r&&u.forEach(function(e){var o=t.find(function(n){return H(n.rowId)===e});o&&r({row:o.row,isSelected:!1,selectedRows:n})})),l(n))},[t,r,u,i]),h=n.useCallback(function(e){if(i){var n=s(e);v(e,!n)}},[s,v,i]),w=n.useCallback(function(){if(i){if(r){var e=new Set;u.forEach(function(n){var o=t.find(function(e){return H(e.rowId)===n});o&&r({row:o.row,isSelected:!1,selectedRows:e})})}l(new Set)}},[u,t,r,i]);return{selectedRows:u,setSelectedRows:l,isRowSelected:s,areAllRowsSelected:c,selectedRowCount:d,selectedRowsData:f,handleRowSelect:v,handleSelectAll:p,handleToggleRow:h,clearSelection:w}}({tableRows:$r,onRowSelectionChange:nn,enableRowSelection:$});Rt=no.selectedRows,St=no.setSelectedRows,Ht=no.isRowSelected,Et=no.areAllRowsSelected,Tt=no.selectedRowCount,kt=no.selectedRowsData,Pt=no.handleRowSelect,At=no.handleSelectAll,Ft=no.handleToggleRow,Dt=no.clearSelection;var to=xt({rows:Or,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}).flattenedRows,ro=n.useCallback(function(e){var n=Kr(e);return un&&0!==un.length?k({rows:n,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Kr,un,ln,xr,Ir,wr,tt,We,le,V,ur,On,Bn,Ln]),oo=n.useCallback(function(e){var n=Yr(e);return un&&0!==un.length?k({rows:n,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Yr,un,ln,xr,Ir,wr,tt,We,le,V,ur,On,Bn,Ln]),io=function(e){var t=e.height,r=e.maxHeight,o=e.rowHeight,i=e.totalRowCount,a=e.headerHeight,u=e.footerHeight;return n.useMemo(function(){if(r){var e=st(r);if(0===e)return;var n=a||o;if(e>=n+i*o+(u||0))return;return Math.max(0,e-n)}if(t){var l=st(t);if(0!==l)return Math.max(0,l-o)}},[t,r,o,i,a,u])}({height:ye,maxHeight:Be,rowHeight:On,shouldPaginate:xn,rowsPerPage:dn,totalRowCount:null!=Hn?Hn:Zr.length,headerHeight:Er,footerHeight:xn&&!Ce?qn:void 0}),ao=function(e){var t=e.allowAnimations,r=e.computeFilteredRowsPreview,o=e.computeSortedRowsPreview,i=e.contentHeight,a=e.currentPage,s=e.customTheme,c=e.enableStickyParents,d=e.flattenedRows,f=e.heightOffsets,v=e.originalFlattenedRows,p=e.parentEndPositions,h=e.rowHeight,w=e.rowsPerPage,m=e.scrollDirection,g=void 0===m?"none":m,x=e.scrollTop,b=e.serverSidePagination,y=e.shouldPaginate,I=e.rowGrouping,C=n.useState(!1),R=C[0],S=C[1],M=n.useState([]),N=M[0],E=M[1],T=n.useRef([]),k=n.useRef([]),P=n.useMemo(function(){return l(h)},[h]),A=n.useRef(new Map),F=n.useRef(null),D=n.useCallback(function(e,n){if(!y||b)return e.map(function(e,n){return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:n})});var t=(a-1)*w,r=a*w,o=0===t?0:n[t-1];return e.slice(o,r>n.length?e.length:n[r-1]).map(function(e,n){var t=e.nestedTable?e.absoluteRowIndex:y&&!b?o+n:n;return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:t})})},[a,w,b,y]);n.useMemo(function(){if(0===A.current.size&&v.length>0){var e=new Map;v.forEach(function(n,t){var r=H(n.rowId);e.set(r,t)}),A.current=e}},[v]);var L=n.useMemo(function(){return D(d,p)},[d,p,D]),W=n.useMemo(function(){if(!f||0===f.length||!y||b)return f;var e=new Map;return L.forEach(function(n){n.nestedTable&&e.set(n.absoluteRowIndex,n.position)}),f.filter(function(n){return e.has(n[0])}).map(function(n){var t=n[1];return[e.get(n[0]),t]})},[f,L,y,b]),O=n.useMemo(function(){if(W&&0!==W.length)return function(e,n,t,r){var o=n+r.rowSeparatorWidth,i=Array(e),a=new Map;t&&t.forEach(function(e){a.set(e[0],e[1])});for(var u=0,l=0;e>l;l++){i[l]=u,u+=o;var s=a.get(l);void 0!==s&&(u+=s)}return{rowTopPositions:i,totalHeight:u-r.rowSeparatorWidth}}(L.length,h,W,s)},[L.length,h,W,s]),q=n.useMemo(function(){return void 0===i?L:B({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}).rendered.rows},[L,i,h,x,g,P,O]),z=n.useMemo(function(){if(!c||void 0===i)return{stickyParents:[],regularRows:q,partiallyVisibleRows:[]};var e=B({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}),n=I?function(e,n,t,r,o){return G({allTableRows:e,renderedRows:n,fullyVisibleRows:t,partiallyVisibleRows:r,partiallyVisibleRowIndex:0,recursionDepth:0,stickyParents:[],rowGrouping:o})}(L,e.rendered.rows,e.fullyVisible.rows,e.partiallyVisible.rows,I):{stickyParents:[],regularRows:e.rendered.rows,partiallyVisibleRows:[]};return exports.__assign(exports.__assign({},n),{partiallyVisibleRows:e.partiallyVisible.rows})},[P,i,L,c,O,I,h,g,x,q]),V=z.stickyParents,j=z.regularRows,K=z.partiallyVisibleRows,U=n.useCallback(function(e,n){var t=new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)})),r=new Set(n.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}));return{staying:n.filter(function(e){var n=H(e.rowId);return t.has(n)}),entering:n.filter(function(e){var n=H(e.rowId);return!t.has(n)}),leaving:e.filter(function(e){var n=H(e.rowId);return!r.has(n)})}},[]),_=n.useMemo(function(){if(0===T.current.length)return!1;var e=L.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}),n=T.current.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L]);n.useLayoutEffect(function(){if(!R){var e=function(){N.length>0&&E([])};if(!t||y)return e(),T.current=L,void(k.current=q);if(0===T.current.length)return e(),T.current=L,void(k.current=q);if(!_)return e(),T.current=L,void(k.current=q);F.current={tableRows:L,visibleRows:q},S(!0)}},[t,L,N.length,_,R,y,q]),n.useLayoutEffect(function(){if(R&&F.current&&N.length>0){var e=setTimeout(function(){var e=F.current;S(!1),E([]),T.current=e.tableRows,k.current=e.visibleRows,F.current=null},ht.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[R,N.length]);var J=n.useMemo(function(){if(!t||y)return q;if(N.length>0){var e=new Map,n=new Map;return L.forEach(function(t){var r=H(t.rowId);e.set(r,t.position),n.set(r,t.displayPosition)}),N.map(function(t){var r=H(t.rowId),o=e.get(r),i=n.get(r);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},t),{position:o,displayPosition:i}):t})}return q},[q,N,L,t,y]),Y=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=r(e),o=D(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:o,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}),l=U(q,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return L.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],q,!0),l,!0))}},[t,y,r,D,i,h,x,g,U,L,q,P,O]),X=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=o(e),r=D(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:r,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}),l=U(q,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return L.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],q,!0),l,!0))}},[t,y,o,D,i,h,x,g,U,L,q,P,O]);return{currentTableRows:L,currentVisibleRows:q,isAnimating:R,prepareForFilterChange:Y,prepareForSortChange:X,rowsToRender:J,stickyParents:V,regularRows:j,partiallyVisibleRows:K,paginatedHeightOffsets:W,heightMap:O}}({allowAnimations:o,computeFilteredRowsPreview:ro,computeSortedRowsPreview:oo,contentHeight:io,currentPage:Vt,customTheme:Ln,enableStickyParents:ae,flattenedRows:$r,heightOffsets:Qr,originalFlattenedRows:to,paginatableRows:Zr,parentEndPositions:eo,rowGrouping:un,rowHeight:On,rowsPerPage:dn,scrollDirection:vr,scrollTop:cr,serverSidePagination:mn,shouldPaginate:xn}),uo=ao.currentTableRows,lo=ao.rowsToRender,so=ao.prepareForFilterChange,co=ao.prepareForSortChange,fo=ao.isAnimating,vo=ao.stickyParents,po=ao.regularRows,ho=ao.partiallyVisibleRows,wo=ao.paginatedHeightOffsets,mo=ao.heightMap,go=n.useRef(new Map),xo=n.useRef(new Map),bo=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,u=e.onCellEdit,l=e.cellRegistry,s=e.collapsedHeaders,c=e.rowHeight,d=e.enableRowSelection,f=void 0!==d&&d,v=e.copyHeadersToClipboard,p=void 0!==v&&v,h=e.customTheme,w=n.useState(new Set),m=w[0],g=w[1],x=n.useState(new Set),b=x[0],y=x[1],I=n.useState(null),C=I[0],M=I[1],N=n.useState(null),E=N[0],T=N[1],k=n.useState(new Set),A=k[0],F=k[1],D=n.useState(new Set),L=D[0],W=D[1],O=n.useState(!1),B=O[0],q=O[1],z=n.useRef(!1),G=n.useRef(null),V=n.useRef(null),U=n.useRef(new Set);V.current=E,U.current=m;var _=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),b.forEach(function(n){e.add(n)}),e},[m,b]),J=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),b.size>0&&o.forEach(function(n){var t=H(n.rowId);e.add(t)}),e},[m,b,o]),Y=n.useMemo(function(){return r.flatMap(function(e){return P(e,s)})},[r,s]),X=n.useCallback(function(){var e=U.current;if(0!==e.size){var n=function(e,n,t,r){void 0===r&&(r=!1);var o=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),i=new Map,a=new Map;o.forEach(function(e,n){i.set(n,e.accessor),a.set(n,e)});var u=Array.from(e).reduce(function(e,n){var r,o=n.split("-").map(Number),u=o[0],l=o[1];e[u]||(e[u]=[]);var s=i.get(l),c=a.get(l);if(s&&(null===(r=t[u])||void 0===r?void 0:r.row)){var d=t[u].row,f=R(d,s);if(!1!==(null==c?void 0:c.useFormattedValueForClipboard)&&(null==c?void 0:c.valueFormatter)){var v=c.valueFormatter({accessor:s,colIndex:l,row:d,rowIndex:u,value:f});e[u][l]=v}else e[u][l]=!c||"lineAreaChart"!==c.type&&"barChart"!==c.type?f:Array.isArray(f)?f.join(", "):""}else e[u][l]="";return e},{}),l=new Set;r&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var s="";r&&l.size>0&&(s=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,t=a.get(e);return null!==(n=null==t?void 0:t.label)&&void 0!==n?n:""}).join("\t"));var c=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return r&&s?"".concat(s,"\n").concat(c):c}(e,Y,o,p);navigator.clipboard.writeText(n),F(new Set(e)),setTimeout(function(){return F(new Set)},800)}},[Y,o,p]),$=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,s;return a(this,function(a){switch(a.label){case 0:if(!(e=V.current))return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(n=a.sent())?(t=function(e,n,t,r,o,i){var a=new Set,u=new Set,l=e.split("\n").filter(function(e){return e.length>0});if(0===l.length)return{updatedCells:a,warningCells:u};var s=t.filter(function(e){return!e.hide&&!e.excludeFromRender}),c=n.rowIndex,d=n.colIndex;return l.forEach(function(e,n){e.split("\t").forEach(function(e,t){var l=c+n,f=d+t;if(r.length>l&&s.length>f){var v=r[l],p=s[f],h=H(v.rowId);if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=+e;isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var g=new Date(e);isNaN(g.getTime())||(w=g)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(w=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(S(v.row,p.accessor,w),i){var x="".concat(h,"-").concat(p.accessor),b=i.get(x);b&&b.updateContent(w)}null==o||o({accessor:p.accessor,newValue:w,row:v.row,rowIndex:l});var y="".concat(l,"-").concat(f,"-").concat(h);a.add(y)}else{var I="".concat(l,"-").concat(f,"-").concat(h);u.add(I)}}})}),{updatedCells:a,warningCells:u}}(n,e,Y,o,u,l),i=t.warningCells,(r=t.updatedCells).size>0&&(F(r),setTimeout(function(){return F(new Set)},800)),i.size>0&&(W(i),setTimeout(function(){return W(new Set)},800)),[3,4]):[2];case 3:return s=a.sent(),console.warn("Failed to paste from clipboard:",s),[3,4];case 4:return[2]}})})},[Y,o,u,l]),Q=n.useCallback(function(){var e=U.current;if(0!==e.size){var n=function(e,n,t,r,o){var i=new Set,a=new Set,u=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),l=new Map;return u.forEach(function(e,n){l.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),l=n[0],s=n[1];if(t.length>l&&u.length>s){var c=t[l],d=u[s],f=H(c.rowId);if(null==d?void 0:d.isEditable){var v;if(v="string"===d.type?"":"number"===d.type?null:"boolean"!==d.type&&("date"===d.type?null:"lineAreaChart"===d.type||"barChart"===d.type||Array.isArray(R(c.row,d.accessor))?[]:""),S(c.row,d.accessor,v),o){var p="".concat(f,"-").concat(d.accessor),h=o.get(p);h&&h.updateContent(v)}null==r||r({accessor:d.accessor,newValue:v,row:c.row,rowIndex:l}),i.add(e)}else a.add(e)}}),{deletedCells:i,warningCells:a}}(e,Y,o,u,l),t=n.deletedCells,r=n.warningCells;t.size>0&&(F(t),setTimeout(function(){return F(new Set)},800)),r.size>0&&(W(r),setTimeout(function(){return W(new Set)},800))}},[Y,o,u,l]),Z=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),u=Math.max(e.colIndex,n.colIndex),l=r;i>=l;l++)for(var s=a;u>=s;s++)if(l>=0&&o.length>l){if(f&&0===s)continue;var d=H(o[l].rowId);t.add(K({colIndex:s,rowIndex:l,rowId:d}))}y(new Set),M(null),U.current=t,V.current=n,g(t),T(n),setTimeout(function(){return j(n,c,h)},0)},[o,c,f,h]),ee=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?Y.length:Y.length-1)>=e.colIndex){var n=K(e);y(new Set),M(null);var t=new Set([n]);U.current=t,V.current=e,g(t),T(e),setTimeout(function(){return j(e,c,h)},0)}},[Y.length,o.length,c,f,h]),ne=n.useCallback(function(e,n){void 0===n&&(n=!1),U.current=new Set,V.current=null,g(new Set),T(null),y(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&M(e[e.length-1])},[]);!function(e){var t=e.copyToClipboard,r=e.deleteSelectedCells,o=e.enableRowSelection,i=void 0!==o&&o,a=e.initialFocusedCellRef,u=e.leafHeaders,l=e.pasteFromClipboard,s=e.selectCellRange,c=e.selectSingleCell,d=e.selectableCells,f=e.selectedCellsRef,v=e.setLastSelectedColumnIndex,p=e.setSelectedCells,h=e.setSelectedColumns,w=e.startCell,m=e.tableRows;n.useEffect(function(){var e=function(e){if(d){var s=a.current;if(s&&0!==f.current.size){var c=document.activeElement;if(!(c instanceof HTMLInputElement||c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement||"true"===(null==c?void 0:c.getAttribute("contenteditable")))){var R=s.rowIndex,S=s.colIndex,M=s.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void l();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var N=new Set,E=0;m.length>E;E++)for(var T=0;u.length>T;T++){var k=i?T+1:T,P=H(m[E].rowId);N.add("".concat(E,"-").concat(k,"-").concat(P))}return f.current=N,p(N),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void r();var A=m[R];if((A?H(A.rowId):null)!==M){var F=m.findIndex(function(e){return H(e.rowId)===M});if(-1===F)return;R=F}var D=function(e,n,t){var r=e,o=n;return"up"===t?r=0:"down"===t?r=m.length-1:"left"===t?o=i?1:0:"right"===t&&(o=i?u.length:u.length-1),{rowIndex:r,colIndex:o}};if("ArrowUp"===e.key)e.preventDefault(),n(e,R,S,D);else if("ArrowDown"===e.key)e.preventDefault(),o(e,R,S,D);else if("ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey)e.preventDefault(),g(e,R,S,D);else if("ArrowRight"===e.key||"Tab"===e.key)e.preventDefault(),x(e,R,S,D);else if("Home"===e.key)e.preventDefault(),b(e,R);else if("End"===e.key)e.preventDefault(),y(e,R);else if("PageUp"===e.key)e.preventDefault(),I(e,R,S);else if("PageDown"===e.key)e.preventDefault(),C(e,R,S);else if("Escape"===e.key){var L=new Set;f.current=L,p(L),h(new Set),v(null),w.current=null}}else t()}}}},n=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a.current);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),o>=0){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else n>0&&(o=n-1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null)},o=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a.current);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),m.length>o){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else m.length-1>n&&(o=n+1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null)},g=function(e,n,t,r){if(e.shiftKey&&"ArrowLeft"===e.key){w.current||(w.current=a.current);var o=t-1;if(e.ctrlKey||e.metaKey)o=r(n,t,"left").colIndex;else if(i&&0===o)return;if(o>=0){var u=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:o,rowId:u})}}else if(t>0){if(o=t-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)o=r(n,t,"left").colIndex;else if(i&&0===o)return;0>o||(u=H(m[n].rowId),c({rowIndex:n,colIndex:o,rowId:u}),w.current=null)}},x=function(e,n,t,r){var o=i?u.length:u.length-1;if(e.shiftKey&&"ArrowRight"===e.key){w.current||(w.current=a.current);var l=t+1;if((e.ctrlKey||e.metaKey)&&(l=r(n,t,"right").colIndex),o>=l){var d=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:l,rowId:d})}}else o>t&&(l=t+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(l=r(n,t,"right").colIndex),l>o||(d=H(m[n].rowId),c({rowIndex:n,colIndex:l,rowId:d}),w.current=null))},b=function(e,n,t){if(e.shiftKey){w.current||(w.current=a.current);var r=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(r=0);var u=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:o,rowId:u})}else r=n,o=i?1:0,(e.ctrlKey||e.metaKey)&&(r=0),u=H(m[r].rowId),c({rowIndex:r,colIndex:o,rowId:u}),w.current=null},y=function(e,n,t){if(e.shiftKey){w.current||(w.current=a.current);var r=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(r=m.length-1);var l=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:o,rowId:l})}else r=n,o=i?u.length:u.length-1,(e.ctrlKey||e.metaKey)&&(r=m.length-1),l=H(m[r].rowId),c({rowIndex:r,colIndex:o,rowId:l}),w.current=null},I=function(e,n,t){var r=Math.max(0,n-10);if(e.shiftKey){w.current||(w.current=a.current);var o=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=H(m[r].rowId),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null},C=function(e,n,t){var r=Math.min(m.length-1,n+10);if(e.shiftKey){w.current||(w.current=a.current);var o=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=H(m[r].rowId),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[d,a,f,m,u,c,s,p,h,v,t,l,r,w,i])}({selectableCells:t,initialFocusedCellRef:V,selectedCellsRef:U,tableRows:o,leafHeaders:Y,selectSingleCell:ee,selectCellRange:Z,setSelectedCells:g,setSelectedColumns:y,setLastSelectedColumnIndex:M,copyToClipboard:X,pasteFromClipboard:$,deleteSelectedCells:Q,startCell:G,enableRowSelection:f});var te=n.useCallback(function(e,n){var t=new Set,r=new Map;o.forEach(function(e,n){var t=H(e.rowId);r.set(t,n)});for(var i=r.get(e.rowId+""),a=r.get(n.rowId+""),u=void 0!==i?i:e.rowIndex,l=void 0!==a?a:n.rowIndex,s=Math.min(u,l),c=Math.max(u,l),d=Math.min(e.colIndex,n.colIndex),v=Math.max(e.colIndex,n.colIndex),p=s;c>=p;p++)for(var h=d;v>=h;h++)if(p>=0&&o.length>p){if(f&&0===h)continue;var w=H(o[p].rowId);t.add(K({colIndex:h,rowIndex:p,rowId:w}))}U.current=t,g(t)},[o,f]),re=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(!t)return null;var r=t.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(r.left,Math.min(r.right,e)),a=Math.max(r.top,Math.min(r.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,t=n.getBoundingClientRect(),r=t.top+t.height/2,o=Math.sqrt(Math.pow(t.left+t.width/2-i,2)+Math.pow(r-a,2));l>o&&(l=o,u=n)}}),null!==u){var s=u,c=parseInt(s.getAttribute("data-row-index")||"-1",10),d=parseInt(s.getAttribute("data-col-index")||"-1",10),f=s.getAttribute("data-row-id");if(c>=0&&d>=0&&null!==f)return{rowIndex:c,colIndex:d,rowId:f}}return null},[]),oe=n.useCallback(function(e,n){var t=document.elementFromPoint(e,n);if(!t)return null;var r=t.closest(".st-cell");if(r instanceof HTMLElement){var o=parseInt(r.getAttribute("data-row-index")||"-1",10),i=parseInt(r.getAttribute("data-col-index")||"-1",10),a=r.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return re(e,n)},[re]),ie=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(t){var r=t.getBoundingClientRect();r.top+50>n?t.scrollTop-=10*Math.min(3,1+Math.max(0,r.top-n)/100):n>r.bottom-50&&(t.scrollTop+=10*Math.min(3,1+Math.max(0,n-r.bottom)/100));var o=document.querySelector(".st-body-main");o&&(r.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,r.left-e)/100):e>r.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-r.right)/100)))}},[]),ae=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){z.current=!0,q(!0),G.current={rowIndex:r,colIndex:n,rowId:o};var i=K({colIndex:n,rowIndex:r,rowId:o}),a=new Set([i]),u={rowIndex:r,colIndex:n,rowId:o};U.current=a,V.current=u,setTimeout(function(){y(new Set),M(null),g(a),T(u)},0);var l=null,s=null,c=null,d=0,f=function(){if(z.current&&G.current){if(null!==l&&null!==s){ie(l,s);var e=Date.now();if(e-d>=16){var n=oe(l,s);n&&te(G.current,n),d=e}}c=requestAnimationFrame(f)}else null!==c&&(cancelAnimationFrame(c),c=null)},v=function(e){z.current&&G.current&&(l=e.clientX,s=e.clientY)},p=function(){z.current=!1,q(!1),null!==c&&(cancelAnimationFrame(c),c=null),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",p),c=requestAnimationFrame(f)}},[t,ie,oe,te]),ue=n.useCallback(function(e){t&&z.current&&G.current&&te(G.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},[t,te]),le=n.useCallback(function(e){var n=e.colIndex,t=K({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),r=m.has(t),o=b.has(n);return r||o},[m,b]),se=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId;if(B)return"";var i=[],a=o[t-1],u=a?H(a.rowId):null,l=o[t+1],s=l?H(l.rowId):null,c=null!==u?{colIndex:n,rowIndex:t-1,rowId:u}:null,d=null!==s?{colIndex:n,rowIndex:t+1,rowId:s}:null,f={colIndex:n-1,rowIndex:t,rowId:r},v={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!le(c)||b.has(n)&&0===t)&&i.push("st-selected-top-border"),(!d||!le(d)||b.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),le(f)||i.push("st-selected-left-border"),le(v)||i.push("st-selected-right-border"),i.join(" ")},[B,le,o,b]),ce=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),de=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return A.has(n)},[A]),fe=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return L.has(n)},[L]);return{getBorderClass:se,handleMouseDown:ae,handleMouseOver:ue,isCopyFlashing:de,isWarningFlashing:fe,isInitialFocusedCell:ce,isSelected:le,lastSelectedColumnIndex:C,pasteFromClipboard:$,selectColumns:ne,selectedCells:m,selectedColumns:b,setInitialFocusedCell:T,setSelectedCells:g,setSelectedColumns:y,deleteSelectedCells:Q,columnsWithSelectedCells:_,rowsWithSelectedCells:J,startCell:G}}({selectableCells:vn,headers:ur,tableRows:uo,onCellEdit:Ve,cellRegistry:go.current,collapsedHeaders:ir,rowHeight:On,enableRowSelection:$,copyHeadersToClipboard:F,customTheme:Ln}),yo=bo.getBorderClass,Io=bo.handleMouseDown,Co=bo.handleMouseOver,Ro=bo.isCopyFlashing,So=bo.isInitialFocusedCell,Mo=bo.isSelected,No=bo.isWarningFlashing,Ho=bo.selectColumns,Eo=bo.selectedCells,To=bo.selectedColumns,ko=bo.setInitialFocusedCell,Po=bo.setSelectedCells,Ao=bo.setSelectedColumns,Fo=bo.columnsWithSelectedCells,Do=bo.rowsWithSelectedCells,Lo=bo.startCell,Wo=n.useRef(co);Wo.current=co;var Oo=n.useRef(so);Oo.current=so;var Bo=n.useCallback(function(e){Wo.current(e),setTimeout(function(){Jr({accessor:e})},0)},[Jr]),qo=n.useCallback(function(e){Wr(e)},[Wr]),zo=n.useCallback(function(){Wr(L)},[L,Wr]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown,s=e.startCell;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")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set),s&&(s.current=null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,u,l,s])}({selectableColumns:hn,selectedCells:Eo,selectedColumns:To,setSelectedCells:Po,setSelectedColumns:Ao,activeHeaderDropdown:Qt,setActiveHeaderDropdown:Zt,startCell:Lo}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth,i=n.useRef(null);n.useLayoutEffect(function(){var e=function(){null!==i.current&&clearTimeout(i.current),i.current=setTimeout(function(){i.current=null,t(),r.current&&o(r.current.offsetWidth-r.current.clientWidth)},150)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null!==i.current&&(clearTimeout(i.current),i.current=null)}},[t,r,o])}({forceUpdate:et,tableBodyContainerRef:Qn,setScrollbarWidth:Ot}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:Ye}),function(e){var t=e.cellRegistryRef,r=e.clearAllFilters,o=e.clearFilter,l=e.currentPage,s=e.resetColumns,c=e.editColumns,d=e.essentialAccessors,f=e.expandedDepths,v=e.filters,p=e.flattenedRows,h=e.headerRegistryRef,w=e.headers,m=e.includeHeadersInCSVExport,g=e.onColumnOrderChange,x=e.onColumnVisibilityChange,y=e.onPageChange,I=e.paginatableRows,C=e.quickFilter,M=e.rowGrouping,N=e.rows,E=e.rowsPerPage,T=e.setCollapsedRows,k=e.setColumnEditorOpen,P=e.setCurrentPage,A=e.setExpandedDepths,F=e.setExpandedRows,D=e.setHeaders,L=e.sort,W=e.tableRef,O=e.totalRowCount,B=e.updateFilter,q=e.updateSort,z=e.visibleRows;n.useEffect(function(){W&&(W.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==N?void 0:N[r];if(i){var a=p.find(function(e){return e.absoluteRowIndex===r});if(a){var u=H(a.rowId),l=b({rowId:u,accessor:n}),s=t.current.get(l);s&&s.updateContent(o)}void 0!==R(i,n)&&S(i,n,o)}},setHeaderRename:function(e){var n=h.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return z},getAllRows:function(){return p},getHeaders:function(){return w},exportToCSV:function(e){!function(e,n,t,r){void 0===r&&(r=!0);var o=function(e,n,t){void 0===t&&(t=!0);var r=function(e){var n=[],t=function(e){for(var r=0,o=e;o.length>r;r++){var i=o[r];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),t(i.children)):n.push(i))}};return t(e),n}(n),o=r.map(function(e){return ft(e.label)}).join(","),i=e.map(function(e,n){var t=e.row;return r.map(function(e,r){var o=R(t,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o,formattedValue:i});return ft(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}),ft(i)):ft(o)}).join(",")});return(t?u([o],i,!0):i).join("\n")}(e,n,r);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(o,t)}(p,w,(void 0===e?{}:e).filename,m)},getSortState:function(){return L},applySortState:vt(q),getPinnedState:function(){return Oe(w)},applyPinnedState:vt(function(e){D(function(n){var t=qe(n,e,d);return t?(null==g||g(t),t):(console.warn("applyPinnedState: left, main, and right accessor lists must include each root column exactly once."),n)})}),getFilterState:function(){return v},applyFilter:vt(B),clearFilter:vt(o),clearAllFilters:vt(r),getCurrentPage:function(){return l},getTotalPages:function(){return Math.ceil((null!=O?O:I.length)/E)},setPage:function(e){return i(void 0,void 0,void 0,function(){var n;return a(this,function(t){switch(t.label){case 0:return n=Math.ceil((null!=O?O:I.length)/E),1>e||e>n?[3,2]:(P(e),y?[4,y(e)]:[3,2]);case 1:t.sent(),t.label=2;case 2:return[2]}})})},expandAll:function(){var e=Array.from({length:(null==M?void 0:M.length)||0},function(e,n){return n});A(new Set(e)),F(new Map),T(new Map)},collapseAll:function(){A(new Set),F(new Map),T(new Map)},expandDepth:function(e){A(function(n){for(var t=new Set(n),r=0;e>=r;r++)t.add(r);return t}),F(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),T(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},collapseDepth:function(e){A(function(n){var t=new Set(n);return t.delete(e),t}),F(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),T(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},toggleDepth:function(e){A(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),F(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),T(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},setExpandedDepths:function(e){A(e)},getExpandedDepths:function(){return f},getGroupingProperty:function(e){return null==M?void 0:M[e]},getGroupingDepth:function(e){var n;return null!==(n=null==M?void 0:M.indexOf(e))&&void 0!==n?n:-1},toggleColumnEditor:function(e){c&&k(void 0!==e?e:function(e){return!e})},applyColumnVisibility:vt(function(e){var n=function(t){return t.map(function(t){var r=t.accessor+"",o=r in e?!e[r]:t.hide;return Fe(t,d)&&(o=!1),exports.__assign(exports.__assign({},t),{hide:o,children:t.children?n(t.children):t.children})})};D(function(e){return n(e)}),x&&x(e)}),resetColumns:s,setQuickFilter:function(e){(null==C?void 0:C.onChange)&&C.onChange(e)}})},[t,r,o,l,s,c,d,f,v,p,h,w,m,g,x,y,I,C,M,e.rowIndexMap,N,E,e.serverSidePagination,T,k,P,A,F,D,e.setRows,e.shouldPaginate,L,W,O,B,q,z])}({cellRegistryRef:go,clearAllFilters:jr,clearFilter:Vr,currentPage:Vt,resetColumns:zo,editColumns:O,essentialAccessors:lr,expandedDepths:wr,filters:zr,flattenedRows:$r,headerRegistryRef:xo,headers:ur,includeHeadersInCSVExport:He,onColumnOrderChange:je,onColumnVisibilityChange:Ue,onPageChange:Ze,paginatableRows:Zr,quickFilter:on,rowGrouping:un,rowIndexMap:Ct,rows:qt,rowsPerPage:dn,serverSidePagination:mn,setCollapsedRows:Cr,setColumnEditorOpen:tr,setCurrentPage:jt,setExpandedDepths:mr,setExpandedRows:br,setHeaders:Wr,setRows:pt,shouldPaginate:xn,sort:_r,tableRef:Sn,totalRowCount:Hn,updateFilter:Gr,updateSort:Jr,visibleRows:lo}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:zr,onFilterChange:Je}),function(e){var t=e.sort,r=e.onSortChange,o=Te(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:_r,onSortChange:tn});var Go=n.useCallback(function(e){Oo.current(e),setTimeout(function(){Gr(e)},0)},[Gr]),Vo=!mt&&0===uo.length,jo=n.useMemo(function(){return{activeHeaderDropdown:Qt,allowAnimations:o,areAllRowsSelected:Et,autoExpandColumns:c,canExpandRowGroup:d,cellRegistry:go.current,cellUpdateFlash:v,clearSelection:Dt,collapsedHeaders:ir,columnBorders:m,columnEditorConfig:Wn,columnReordering:C,columnResizing:T,containerWidth:Hr,columnsWithSelectedCells:Fo,copyHeadersToClipboard:F,draggedHeaderRef:Gn,editColumns:O,emptyStateRenderer:V,essentialAccessors:lr,enableHeaderEditing:J,enableRowSelection:$,errorStateRenderer:le,expandedDepths:wr,filters:zr,icons:Dn,forceUpdate:et,getBorderClass:yo,handleApplyFilter:Go,handleClearAllFilters:jr,handleClearFilter:Vr,handleMouseDown:Io,handleMouseOver:Co,handleRowSelect:Pt,handleSelectAll:At,handleToggleRow:Ft,headerContainerRef:Zn,headerDropdown:xe,headerHeight:Bn,headerRegistry:xo.current,headers:ur,heightOffsets:wo,hoveredHeaderRef:Vn,includeHeadersInCSVExport:He,isAnimating:fo,isCopyFlashing:Ro,isInitialFocusedCell:So,isLoading:mt,isResizing:Yt,isRowSelected:Ht,isSelected:Mo,isWarningFlashing:No,loadingStateRenderer:We,mainBodyRef:jn,maxHeaderDepth:Tr,onCellClick:Ge,onCellEdit:Ve,onColumnOrderChange:je,onColumnSelect:Ke,onColumnVisibilityChange:Ue,onColumnWidthChange:_e,onHeaderEdit:Xe,onLoadMore:$e,onRowGroupExpand:en,onSort:Bo,onTableHeaderDragEnd:qo,resetColumns:zo,pinnedLeftRef:Kn,pinnedRightRef:Jn,rowButtons:an,rowGrouping:un,rowHeight:On,rowStateMap:tt,rows:it,rowsWithSelectedCells:Do,scrollbarWidth:Wt,selectColumns:Ho,selectableColumns:hn,selectedColumns:To,selectedRowCount:Tt,selectedRows:Rt,selectedRowsData:kt,setActiveHeaderDropdown:Zt,setCollapsedHeaders:ar,setHeaders:Wr,setInitialFocusedCell:ko,setIsResizing:Xt,setRowStateMap:rt,setSelectedCells:Po,setSelectedColumns:Ao,setSelectedRows:St,setExpandedDepths:mr,setExpandedRows:br,setCollapsedRows:Cr,shouldPaginate:xn,tableBodyContainerRef:Qn,tableEmptyStateRenderer:Rn,tableRows:uo,theme:Nn,customTheme:Ln,expandedRows:xr,collapsedRows:Ir,useHoverRowBackground:Tn,useOddColumnBackground:Pn,useOddEvenRowBackground:Fn}},[Qt,o,Et,c,d,v,Dt,ir,m,Wn,C,T,Hr,Fo,F,Gn,O,V,lr,J,$,le,wr,zr,Dn,et,yo,Go,jr,Vr,Io,Co,Pt,At,Ft,Zn,xe,Bn,ur,wo,Vn,He,fo,Ro,So,mt,Yt,Ht,Mo,No,We,jn,Tr,Ge,Ve,je,Ke,Ue,_e,Xe,$e,en,Bo,qo,zo,Kn,Jn,an,un,On,tt,it,Do,Wt,Ho,hn,To,Tt,Rt,kt,Zt,ar,Wr,ko,Xt,rt,Po,Ao,St,mr,br,Cr,xn,Qn,Rn,uo,Nn,Ln,xr,Ir,Tn,Pn,Fn]);return e.jsx(_,exports.__assign({value:jo},{children:e.jsx(X,{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(Nn," ").concat(null!=p?p:""," ").concat(m?"st-column-borders":""),role:"grid",style:Be?{maxHeight:Be,height:void 0===io?"auto":Be}:ye?{height:ye}:{}},{children:[e.jsx(ut,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(Un,{calculatedHeaderHeight:Er,hideHeader:Se,pinnedLeftWidth:Ar,pinnedRightWidth:Fr,setScrollTop:dr,setScrollDirection:pr,shouldShowEmptyState:Vo,sort:_r,tableRows:uo,rowsToRender:lo,stickyParents:vo,regularRows:po,partiallyVisibleRows:ho,heightMap:mo}),e.jsx(at,{columnEditorConfig:Wn,editColumns:O,headers:Ut,open:nr,setOpen:tr})]})),!Vo&&e.jsx(_n,{mainBodyRef:jn,mainBodyWidth:Pr,pinnedLeftWidth:Ar,pinnedRightWidth:Fr,pinnedLeftContentWidth:Dr,pinnedRightContentWidth:Lr,tableBodyContainerRef:Qn}),!Vo&&e.jsx(Q,{currentPage:Vt,footerRenderer:me,hideFooter:Ce,onPageChange:jt,onNextPage:Qe,onUserPageChange:Ze,rowsPerPage:dn,shouldPaginate:xn,totalPages:Math.ceil((null!=Hn?Hn:Zr.length)/dn),totalRows:null!=Hn?Hn:Zr.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:Sr}))]}))})}))},Tt=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,s=n.fillOpacity,c=void 0===s?.25:s,d=n.strokeWidth,f=void 0===d?1.5:d,v=n.className,p=void 0===v?"":v,h=n.min,w=n.max;if(!t||0===t.length)return null;var m=void 0!==h?h:Math.min.apply(Math,t),g=(void 0!==w?w:Math.max.apply(Math,t))-m||1,x=a,b=t.map(function(e,n){return{x:n/(t.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),y="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(p),style:{display:"block"},shapeRendering:"geometricPrecision"},{children:[e.jsx("path",{d:y,fill:l||"var(--st-chart-fill-color)",fillOpacity:c,stroke:"none"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round"})]}))},kt=Object.freeze({__proto__:null,default:Tt}),Pt=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,s=void 0===l?2:l,c=n.className,d=void 0===c?"":c,f=n.min,v=n.max;if(!t||0===t.length)return null;var p=void 0!==f?f:Math.min.apply(Math,t),h=void 0!==v?v:Math.max.apply(Math,t),w=h-p||1,m=a,g=(100-s*(t.length-1))/t.length,x=0>p,b=x?m*(h/w):m;return e.jsx("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(m),preserveAspectRatio:"none",className:"st-bar-chart ".concat(d),style:{display:"block"},shapeRendering:"crispEdges"},{children:t.map(function(n,t){var r=t*(g+s),o=(n-p)/w*m,i=m-o,a=o;return x&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:r,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:.5},t)})}))},At=Object.freeze({__proto__:null,default:Pt});exports.ANIMATION_CONFIGS=ht,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=Z,exports.AngleRightIcon=ee,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=ne,exports.BarChart=Pt,exports.CheckIcon=te,exports.DescIcon=re,exports.DragIcon=oe,exports.FilterIcon=ie,exports.LineAreaChart=Tt,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=ae,exports.SimpleTable=Ht,exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,u,l,s,c,d,f,v,p,h,w,m,g;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,u=void 0===(i=t.duration)?300:i,s=void 0===(l=t.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(c=t.delay)?0:c,f=t.onComplete,p=void 0===(v=t.respectReducedMotion)||v,pt()&&p?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(h=n.getBoundingClientRect(),m=e-(w=h.top),g=r-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(s),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,t=e.finalConfig,r=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}}(r,o),0===e.x&&0===e.y||pt()&&!1!==t.respectReducedMotion?[2]:(u=t,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=pt()?exports.__assign(exports.__assign({},ht.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},ht.COLUMN_REORDER),u):exports.__assign(exports.__assign({},ht.ROW_REORDER),u),wt(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,mt(n,i,t)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=Te,exports.useScrollState=$,exports.useTableContext=J;
2
- //# sourceMappingURL=index-3314cbd8.js.map
1
+ "use strict";var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n);function o(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);r.length>o;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,u)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=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++,r=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],r=0}finally{t=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,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;i>o;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;r>t;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},s=29.5,c=["lineAreaChart","barChart"],d=40,f=function(e,n,t){return n&&t?480>e?.25:768>e?.3:.4:function(e){return 480>e?.4:768>e?.5:.6}(e)},v="parentExpanded",p=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=r(a[i],o);return o};return r(e,n),t},h=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,h(e.children)),n})},w=function(e){return void 0===e&&(e=0),e?e+1:0},m=function(e,n){for(var t=0,r=h(e);r.length>t;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null},g=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},x=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders;return n.hide||n.excludeFromRender||e.rootPinned!==e.pinned?null:!(t&&r&&function(e,n,t){var r=m(n,e.accessor);if(r){var o=t.has(r.accessor),i=e.showWhen||v;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,t,r))||null},b=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},y=function(e){var n=e.customTheme;return Math.min(e.headerHeight+n.rowSeparatorWidth+e.childRowCount*(e.rowHeight+n.rowSeparatorWidth)+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth,n.nestedGridMaxHeight+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth)},I=function(e){var n=e.calculatedHeight,t=e.customHeight,r=e.customTheme;return t?("string"==typeof t?parseFloat(t):t)+r.nestedGridPaddingTop+r.nestedGridPaddingBottom:n},C=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},R=function(e,n){var t=n+"";return t.includes(".")||t.includes("[")?t.split(".").reduce(function(e,n){if(null!=e){var t=C(n),r=t.index,o=e[t.key];return null!==r&&Array.isArray(o)&&(o=o[r]),o}},e):e[n]},S=function(e,n,t){var r=n+"";if(r.includes(".")||r.includes("[")){for(var o=r.split("."),i=e,a=0;o.length-1>a;a++){var u=C(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=C(o[a+1]);i[l]=null!==c.index?[]:{}}if(i=i[l],null!==s){if(!Array.isArray(i))throw Error("Expected array at ".concat(o.slice(0,a+1).join("."),", but found ").concat(typeof i));for(;s>=i.length;)i.push(null);null==i[s]&&(i[s]={}),i=i[s]}}var d=C(o[o.length-1]),f=d.key,v=d.index;if(null!==v){for(Array.isArray(i[f])||(i[f]=[]);v>=i[f].length;)i[f].push(null);i[f][v]=t}else i[f]=t}else e[n]=t},M=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},N=function(e){var n=e.getRowId,t=u([],e.rowPath,!0);if(n){var r=n({row:e.row,depth:e.depth,index:e.index,rowPath:e.rowPath,rowIndexPath:e.rowIndexPath,groupingKey:e.groupingKey});t.push(r)}return t},H=function(e){return e.join("-")},E=function(e,n){var t=e[n];return M(t)?t:[]},T=function(e,n,t,r,o){var i=e+"",a=r.has(i)&&r.get(i)===n,u=o.has(i)&&o.get(i)===n;return t.has(n)?!u:a},k=function(e){var n=e.depth,t=e.expandedDepths,r=e.expandedRows,o=e.collapsedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.getRowId,s=e.displayPositionOffset,c=void 0===s?0:s,d=e.rowStateMap,f=e.hasLoadingRenderer,v=void 0!==f&&f,p=e.hasErrorRenderer,h=void 0!==p&&p,w=e.hasEmptyRenderer,m=void 0!==w&&w,g=e.headers,x=void 0===g?[]:g,b=e.rowHeight,C=e.headerHeight,R=e.customTheme,S=[],M=function(e,n,i,s,f,p,w){void 0===i&&(i=0),void 0===s&&(s=c),void 0===f&&(f=[]),void 0===p&&(p=[]),void 0===w&&(w=[]);var g=i,k=s;return e.forEach(function(i,s){var c,P,A=a[n],F=u(u([],f,!0),[s],!1),D=u(u([],p,!0),[s],!1),L=N({row:i,getRowId:l,depth:n,index:s,rowPath:F,rowIndexPath:D,groupingKey:A}),W=S.length,O={row:i,depth:n,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:0===n&&s===e.length-1,rowId:L,rowPath:F,rowIndexPath:D,absoluteRowIndex:g,parentIndices:w.length>0?u([],w,!0):void 0};S.push(O),g++,k++;var B=H(L);if(T(B,n,t,r,o)&&a.length>n){var q=null==d?void 0:d.get(B),z=E(i,A),G=x.find(function(e){return e.expandable&&e.nestedTable});if((null==G?void 0:G.nestedTable)&&z.length>0){var V=(null===(c=G.nestedTable.customTheme)||void 0===c?void 0:c.rowHeight)||b,j=(null===(P=G.nestedTable.customTheme)||void 0===P?void 0:P.headerHeight)||C,K=y({childRowCount:z.length,rowHeight:V,headerHeight:j,customTheme:R}),U=I({calculatedHeight:K,customHeight:G.nestedTable.height,customTheme:R}),_=u(u([],F,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:_,rowPath:_,rowIndexPath:D,nestedTable:{parentRow:i,expandableHeader:G,childAccessor:A,calculatedHeight:U},absoluteRowIndex:g}),g++,k++}else if(q&&(q.loading||q.error||q.isEmpty)){if(q.loading&&v||q.error&&h||q.isEmpty&&m){var J=u(u([],F,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:J,rowPath:J,rowIndexPath:D,stateIndicator:{parentRowId:B,parentRow:i,state:q},absoluteRowIndex:g,parentIndices:u(u([],w,!0),[W],!1)}),g++,k++}else if(q.loading&&!v){var Y=u(u([],F,!0),[A,"loading-skeleton"],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:Y,rowPath:Y,rowIndexPath:D,isLoadingSkeleton:!0,absoluteRowIndex:g,parentIndices:u(u([],w,!0),[W],!1)}),g++,k++}}else if(z.length>0){var X=u(u([],F,!0),[A],!1),$=u([],D,!0);g=M(z,n+1,g,k,X,$,u(u([],w,!0),[W],!1))}}}),g};return M(e.rows,void 0===n?0:n,0,c,[],[],[]),S},P=function(e,n){if(e.hide)return[];if(!e.children||0===e.children.length)return[e];if(n&&n.has(e.accessor)){var t=e.children.filter(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return P(e,n)});return e.singleRowChildren?u([e],t,!0):t}var r=e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return P(e,n)});return e.singleRowChildren?u([e],r,!0):r},A=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(g({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},F=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(g({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){F(e)})},D=function(e){return"number"==typeof e.minWidth?e.minWidth:d},L=function(e,n){var t=[];return e.forEach(function(e){e.hide||t.push.apply(t,P(e,n))}),t},W=function(e,n){var t=n.rowTopPositions;if(0===t.length)return 0;if(0>=e)return 0;if(e>=n.totalHeight)return t.length-1;for(var r=0,o=t.length-1;o>r;){var i=Math.floor((r+o+1)/2);t[i]>e?o=i-1:r=i}return r},O=function(e,n){if(!n||0===n.length)return 0;for(var t=0,r=0,o=n.length;o>r;){var i=Math.floor((r+o)/2);e>n[i][0]?r=i+1:o=i}for(var a=0;r>a;a++)t+=n[a][1];return t},B=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.scrollTop,o=e.tableRows,i=e.scrollDirection,a=void 0===i?"none":i,u=e.heightMap,l=e.rowHeight+1;if(!u){var s=n*l,c=s,d=s;"down"===a?(c=Math.max(l,.1*s),d=.9*s):"up"===a&&(c=.9*s,d=Math.max(l,.1*s));var f=r+t+d,v=Math.max(0,Math.floor(Math.max(0,r-c)/l)),p=Math.min(o.length,Math.ceil(f/l)),h=r+t,w=Math.max(0,Math.ceil(r/l)),m=Math.min(o.length,Math.floor(h/l)),g=r+t,x=Math.max(0,Math.floor(r/l)),b=Math.min(o.length,Math.ceil(g/l));return{rendered:{startIndex:v,endIndex:p,rows:o.slice(v,p)},fullyVisible:{startIndex:w,endIndex:m,rows:o.slice(w,m)},partiallyVisible:{startIndex:x,endIndex:b,rows:o.slice(x,b)}}}var y=u.rowTopPositions,I=n*l,C=I,R=I;"down"===a?(C=Math.max(l,.1*I),R=.9*I):"up"===a&&(C=.9*I,R=Math.max(l,.1*I));var S=r+t+R,M=W(Math.max(0,r-C),u),N=W(S,u)+1;N=Math.min(o.length,N);var H=r,E=r+t,T=W(H,u);H>y[T]&&(T=Math.min(T+1,o.length));var k=W(E,u);k=Math.min(o.length,k);var P=r+t,A=W(r,u),F=W(P,u)+1;return F=Math.min(o.length,F),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:T,endIndex:k,rows:o.slice(T,k)},partiallyVisible:{startIndex:A,endIndex:F,rows:o.slice(A,F)}}},q=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+O(n,e.heightOffsets)},z=function(e,n){var t,r,o=e.position,i=n[o+1];return null!==(r=null===(t=null==i?void 0:i.parentIndices)||void 0===t?void 0:t.includes(o))&&void 0!==r&&r},G=function(e){var n=e.allTableRows,t=e.renderedRows,r=e.fullyVisibleRows,o=e.partiallyVisibleRows,i=e.partiallyVisibleRowIndex,a=e.recursionDepth,u=e.stickyParents,l=e.rowGrouping,s=o[i];if(!s||a>10)return{stickyParents:u,regularRows:t};var c=0;if(s.parentIndices&&s.parentIndices.length>0){for(var d=function(e){var t=n[e];if(t){var o=r.some(function(e){return e.position===t.position});if(s.rowIndexPath&&s.rowIndexPath.length>0){var i=n[s.parentIndices[s.parentIndices.length-1]],a=i.row[l[i.depth]];if(u.length>=(Array.isArray(a)?a:[]).length-s.rowIndexPath[s.rowIndexPath.length-1])return"break"}o||u.some(function(e){return H(e.rowId)===H(t.rowId)})||(u.push(t),c++)}},f=0,v=s.parentIndices;v.length>f&&"break"!==d(v[f]);f++);if(u.length>0){z(s,n)&&(u.push(s),c++);var p=o[i+=c];p&&(s=p)}}else if(z(s,n))return u.push(s),i++,G({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l});return z(s,n)?G({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l}):{stickyParents:u,regularRows:t}},V=function(e,n,t){var r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>r.top?n.scrollTop-=o.top-r.top+i:r.bottom>o.bottom-i&&(n.scrollTop+=r.bottom-o.bottom+i),t){var a=t.getBoundingClientRect();a.left+i>r.left?t.scrollLeft-=a.left-r.left+i:r.right>a.right-i&&(t.scrollLeft+=r.right-a.right+i)}},j=function(e,n,t,r){var o=document.querySelector(".st-body-container"),i=document.querySelector(".st-body-main");if(o){!function(e,n){if(n){var t=document.querySelector('.st-header-main [data-col-index="'.concat(e,'"]'));if(t){var r=t.getBoundingClientRect(),o=n.getBoundingClientRect();o.left+10>r.left?n.scrollLeft-=o.left-r.left+10:r.right>o.right-10&&(n.scrollLeft+=r.right-o.right+10)}}}(e.colIndex,i);var a=n+t.rowSeparatorWidth,u=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(u&&r){var l=function(e,n,t,r){var o=B({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:t,scrollTop:n.scrollTop,tableRows:r,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,o,n,r);if(l)return void V(u,o,i)}if(!u)return o.scrollTop=Math.max(0,e.rowIndex*a-o.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&&V(n,o,i)},100);V(u,o,i)}},K=function(e){var n=e.colIndex,t=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(t)},U=n.createContext(void 0),_=function(n){return e.jsx(U.Provider,exports.__assign({value:n.value},{children:n.children}))},J=function(){var e=n.useContext(U);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},Y=n.createContext(void 0),X=function(t){var r=t.children,o=n.useState(!1),i=o[0],a=o[1],u=n.useMemo(function(){return{isScrolling:i,setIsScrolling:a}},[i]);return e.jsx(Y.Provider,exports.__assign({value:u},{children:r}))},$=function(){var e=n.useContext(Y);if(void 0===e)throw Error("useScrollState must be used within a ScrollStateProvider");return e},Q=function(t){var r=t.currentPage,o=t.footerRenderer,u=t.hideFooter,l=t.onPageChange,s=t.onNextPage,c=t.onUserPageChange,d=t.rowsPerPage,f=t.shouldPaginate,v=t.totalPages,p=t.totalRows,h=J().icons,w=n.useState(!0),m=w[0],g=w[1],x=r>1,b=v>r,y=r===v,I=Math.min((r-1)*d+1,p),C=Math.min(r*d,p),R=!x,S=!b&&!s||!m&&y,M=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=r-1)?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},N=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(t){switch(t.label){case 0:return e=r===v,n=r+1,s&&e?[4,s(r)]:[3,2];case 1:if(!t.sent())return g(!1),[2];t.label=2;case 2:return n>v&&!s?[3,4]:(l(n),c?[4,c(n)]:[3,4]);case 3:t.sent(),t.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),c?[4,c(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:r,totalPages:v,rowsPerPage:d,totalRows:p,startRow:I,endRow:C,onPageChange:H,onNextPage:N,onPrevPage:M,hasNextPage:!S,hasPrevPage:!R,nextIcon:h.next,prevIcon:h.prev})});var E=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,t=[];r>8?v-7>r?(e=r-7,n=r+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14),e>2?(t.push(1),t.push(-1)):2===e&&t.push(1);for(var o=e;n>=o;o++)t.push(o);return v-1>n?(t.push(-2),t.push(v)):n===v-1&&t.push(v),t}();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 ",I," to ",C," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[E.map(function(n,t){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),t):e.jsx("button",exports.__assign({onClick:function(){return H(n)},className:"st-page-btn ".concat(r===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":r===n?"page":void 0},{children:n}),t)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(R?"disabled":""),onClick:M,disabled:R,"aria-label":"Go to previous page"},{children:h.prev})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(S?"disabled":""),onClick:N,disabled:S,"aria-label":"Go to next page"},{children:h.next}))]}))]}))},Z=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"})}))},ee=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"})}))},ne=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"})}))},te=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"})}))},re=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"})}))},oe=function(n){return e.jsxs("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 10",className:n.className,style:exports.__assign({height:"10px",width:"16px"},n.style)},{children:[e.jsx("circle",{cx:"3",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"13",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"3",cy:"7",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"7",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"13",cy:"7",r:"1.5",fill:"currentColor"})]}))},ie=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"})}))},ae=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"})}))},ue=function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[t,a,o]),n.useEffect(function(){var e=null==r?void 0:r.current;if(e&&(null==t?void 0:t.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=null,i=new ResizeObserver(function(){null!==o&&cancelAnimationFrame(o),o=requestAnimationFrame(function(){o=null,n()})});return i.observe(e),function(){null!==o&&(cancelAnimationFrame(o),o=null),e&&i.unobserve(e)}}},[t,r]),{isMainSectionScrollable:a}},le=function(t){var r=t.children,o=t.onClose,i=t.open,a=t.overflow,u=void 0===a?"auto":a,l=t.setOpen,s=t.width,c=t.containerRef,d=t.positioning,f=void 0===d?"fixed":d,v=J().mainBodyRef,p=n.useRef(null),h=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],y=x[1],I=n.useState(!1),C=I[0],R=I[1];return n.useEffect(function(){i&&p.current?(R(!1),!h.current&&p.current.parentElement&&(h.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&h.current){var e,n=p.current,t=h.current.getBoundingClientRect(),r=n.offsetHeight,o=s||n.offsetWidth,i=(e=(null==c?void 0:c.current)?c.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,u="bottom",l={};(r>i&&a>=r||r>i&&a>i)&&(u="top");var d="left";o>e.right-t.right+t.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===d?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===u?l.top=t.height+4:l.bottom=t.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),y(l),R(!0)}})):i||R(!1)},[i,s,c,v,f]),n.useEffect(function(){var e=function(e){i&&p.current&&p.current&&!p.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(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(l(!1),null==o||o())}},n=function(n){"Enter"===n.key&&e(n)};return i&&(document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",n,!0)),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",n,!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:p,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()},onTouchStart:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:s?"".concat(s,"px"):"auto",visibility:C?"visible":"hidden"},b),{overflow:u})},{children:r})):null},se=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,s=void 0===l?"":l;return e.jsx("div",exports.__assign({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(u?"disabled":""," ").concat(s),onClick:function(){!u&&r&&r()},role:"option","aria-selected":i,"aria-disabled":u},{children:t}))},ce=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=n.useState(t.value),l=u[0],s=u[1],c=function(e){s(e),o(e),a(!1),r()};return e.jsxs(le,exports.__assign({open:i,onClose:function(){r()},setOpen:a,width:120},{children:[e.jsx(se,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(se,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},de=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},fe=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+r,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()}})},ve=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-64b55230.js")})}),pe=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-608690b6.js")})}),he=n.lazy(function(){return Promise.resolve().then(function(){return kt})}),we=n.lazy(function(){return Promise.resolve().then(function(){return At})}),me=function(t){var r=o(t,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},r))},{children:e.jsx(ve,exports.__assign({},t))}))},ge=function(t){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(pe,exports.__assign({},t))}))},xe=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(he,exports.__assign({},t))}))},be=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(we,exports.__assign({},t))}))},ye=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 t=new Date(e);return isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0)},Ie=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},Ce=function(e){if(!e)return new Date;if("string"==typeof e)return ye(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:Ie(n)}return e instanceof Date?Ie(e):new Date},Re=function(e){return e?ye(""+e):new Date},Se=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){r()};return e.jsx(le,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(ge,{value:Re(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),r()},onClose:l})}))},Me=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.options,u=t.setOpen,l=n.useState(t.value||""),s=l[0],c=l[1];return e.jsx(le,exports.__assign({open:i,onClose:function(){r()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(se,exports.__assign({isSelected:s===n.value,onClick:function(){return c(e=n.value),o(e),u(!1),void r();var e}},{children:n.label}),n.value)})}))}))},Ne=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,s=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(ce,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(Se,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(Me,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(fe,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(de,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},He=0,Ee=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();0!==He&&r>o-He||(He=o,n(t))}},Te=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},ke=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ke);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=ke(e[t]));return n},Pe=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide&&!e.excludeFromRender})};function Ae(e){return{pinnedLeft:e.filter(function(e){return"left"===e.pinned}),unpinned:e.filter(function(e){return!e.pinned}),pinnedRight:e.filter(function(e){return"right"===e.pinned})}}function Fe(e,n){return!0===e.isEssential||n.has(e.accessor+"")}function De(e,n){for(var t=!1,r=0,o=e;o.length>r;r++){var i=o[r];if(!i.isSelectionColumn&&!i.excludeFromRender){var a=Fe(i,n);if(a&&t)return!1;a||(t=!0)}}return!0}function Le(e,n){var t,r=Ae(e),o=r.unpinned,i=r.pinnedRight;if(!De(r.pinnedLeft,n))return!1;if(!De(o,n))return!1;if(!De(i,n))return!1;for(var a=0,u=e;u.length>a;a++){var l=u[a];if((null===(t=l.children)||void 0===t?void 0:t.length)&&!We(l.children,n))return!1}return!0}function We(e,n){var t;if(!De(e,n))return!1;for(var r=0,o=e;o.length>r;r++){var i=o[r];if((null===(t=i.children)||void 0===t?void 0:t.length)&&!We(i.children,n))return!1}return!0}function Oe(e){var n=Ae(e),t=n.unpinned,r=n.pinnedRight;return{left:n.pinnedLeft.map(function(e){return e.accessor}),main:t.map(function(e){return e.accessor}),right:r.map(function(e){return e.accessor})}}function Be(e,n,t){var r=e.filter(function(e){return Fe(n.get(e+""),t)}),o=e.filter(function(e){return!Fe(n.get(e+""),t)});return u(u([],r,!0),o,!0)}function qe(e,n,t){var r=new Set(e.map(function(e){return e.accessor+""})),o=u(u(u([],n.left,!0),n.main,!0),n.right,!0);if(o.length!==r.size)return null;for(var i=0,a=o;a.length>i;i++)if(!r.has(a[i]+""))return null;var l=new Map(e.map(function(e){return[e.accessor+"",e]})),s=Be(n.left,l,t),c=Be(n.main,l,t),d=Be(n.right,l,t),f=function(e,n){var t=exports.__assign({},e);return"left"===n?t.pinned="left":"right"===n?t.pinned="right":delete t.pinned,t};return u(u(u([],s.map(function(e){return f(l.get(e+""),"left")}),!0),c.map(function(e){return f(l.get(e+""),void 0)}),!0),d.map(function(e){return f(l.get(e+""),"right")}),!0)}function ze(e,n,t,r){var o=n+"",i=Oe(e),a=i.left.filter(function(e){return e+""!==o}),u=i.main.filter(function(e){return e+""!==o}),l=i.right.filter(function(e){return e+""!==o}),s=e.find(function(e){return e.accessor+""===o});return s&&(!Fe(s,r)||"main"!==t||"left"!==s.pinned&&"right"!==s.pinned)?("left"===t?a.push(n):"right"===t?l.push(n):u.push(n),qe(e,{left:a,main:u,right:l},r)):null}var Ge=Date.now(),Ve={screenX:0,screenY:0},je=function(e,n,t){void 0===t&&(t=[]);for(var r=0;e.length>r;r++){var o=e[r];if(o.accessor===n)return u(u([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=je(o.children,n,u(u([],t,!0),[r],!1));if(i)return i}}return null},Ke=function(e,n){for(var t=e,r=0;n.length-1>r;r++)t=t[n[r]].children;return t},Ue=function(e,n,t){if(1===n.length)return t;for(var r=e,o=0;n.length-2>o;o++)r=r[n[o]].children;return r[n[n.length-2]].children=t,e},_e=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function Je(e,n,t){var r=ke(e),o=!1;function i(e,n){for(var t=e,r=0;n.length-1>r;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;n.length-1>i;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var u=i(r,n);return a(r,n,i(r,t)),a(r,t,u),{newHeaders:r,emergencyBreak:o}}var Ye=function(e){var n=e.draggedHeaderRef,t=e.essentialAccessors,r=e.headers,o=e.hoveredHeaderRef,i=e.onColumnOrderChange,a=e.onTableHeaderDragEnd,l=J().setHeaders,s=Te(r);return{handleDragStart:function(e){n.current=e,Ge=Date.now()},handleDragOver:function(e){var i=e.event,u=e.hoveredHeader;if(i.preventDefault(),r&&n.current){var l=i.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=i.screenX,d=i.screenY,f=Math.sqrt(Math.pow(c-Ve.screenX,2)+Math.pow(d-Ve.screenY,2));o.current=u;var v,p=n.current,h=!1;if(_e(p)===_e(u)){var w=r,m=je(w,p.accessor),g=je(w,u.accessor);if(m&&g){var x=m.length,b=g.length,y=g;if(x!==b){var I=b-x;I>0&&(y=g.slice(0,-I))}if((C=m).length===(R=y).length&&(1===C.length||C.slice(0,-1).every(function(e,n){return e===R[n]}))){var C,R,S=Je(w,m,y);v=S.newHeaders,h=S.emergencyBreak;var M=null!=t?t:new Set;if((0>=M.size||h||Le(v,M))&&!(l||u.accessor===p.accessor||10>f||JSON.stringify(v)===JSON.stringify(r)||h)){var N=Date.now();JSON.stringify(v)===JSON.stringify(s)&&(1500>N-Ge||40>f)||(Ge=N,Ve={screenX:c,screenY:d},a(v))}}}}}},handleDragEnd:function(){n.current=null,o.current=null,setTimeout(function(){l(function(e){return u([],e,!0)}),null==i||i(r)},10)}}},Xe=function(n){var t=n.checked,r=void 0!==t&&t,o=n.children,i=n.disabled,a=void 0!==i&&i,u=n.onChange,l=n.ariaLabel;return e.jsxs("label",exports.__assign({className:"st-checkbox-label".concat(a?" st-checkbox-disabled":"")},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",disabled:a,onChange:function(){!a&&u&&u(!r)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":l,"aria-checked":r}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(r?"st-checked":""),"aria-hidden":"true"},{children:r&&e.jsx(te,{className:"st-checkbox-checkmark"})})),o]}))},$e=function(n){var t,r=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:r}):"lineAreaChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(xe,exports.__assign({data:t},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(be,exports.__assign({data:t},o.chartOptions)):null:"boolean"==typeof r?r?"True":"False":Array.isArray(r)?0===r.length?"[]":r.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==r&&("string"==typeof r||"number"==typeof r||"object"==typeof r&&r instanceof Date)?Ce(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):r},Qe=r.default.memo(function(t){var r=t.borderClass,o=t.colIndex,i=t.displayRowNumber,a=t.gridColumnStart,u=t.header,l=t.isHighlighted,s=t.isInitialFocused,c=t.nestedIndex,d=t.parentHeader,f=t.rowIndex,v=t.tableRow,p=J(),h=p.canExpandRowGroup,w=p.cellRegistry,m=p.cellUpdateFlash,x=p.collapsedRows,y=p.columnBorders,I=p.draggedHeaderRef,C=p.enableRowSelection,N=p.essentialAccessors,E=p.expandedDepths,k=p.expandedRows,P=p.handleMouseDown,A=p.handleMouseOver,F=p.handleRowSelect,D=p.headers,L=p.hoveredHeaderRef,W=p.icons,O=p.isCopyFlashing,B=p.isLoading,q=p.isRowSelected,z=p.isWarningFlashing,G=p.onCellEdit,V=p.onCellClick,j=p.onRowGroupExpand,K=p.onTableHeaderDragEnd,U=p.rowButtons,_=p.rowGrouping,Y=p.setCollapsedRows,X=p.setExpandedRows,$=p.setRowStateMap,Q=p.rowsWithSelectedCells,Z=p.selectedColumns,ee=p.tableBodyContainerRef,ne=p.theme,te=p.useOddColumnBackground,re=v.depth,oe=v.row,ie=v.rowPath,ae=v.rowIndexPath,ue=v.absoluteRowIndex,le=v.rowId,se=n.useState(R(oe,u.accessor)),ce=se[0],de=se[1],fe=n.useState(!1),ve=fe[0],pe=fe[1],he=n.useState(!1),we=he[0],ge=he[1],xe=n.useState(!1),be=xe[0],ye=xe[1],Ie=n.useRef(null),Ce=H(le),Re=_&&_[re],Se=!!Re&&function(e,n){return!!n&&M(e[n])}(oe,Re),Me=_&&_.length>re,He=!h||h(oe),Te=!!u.nestedTable,ke=T(Ce,re,E,k,x),Pe=O({rowIndex:f,colIndex:o,rowId:Ce}),Ae=z({rowIndex:f,colIndex:o,rowId:Ce}),Fe=n.useMemo(function(){var e,n,t;if(!y)return!1;var r=D.filter(function(e){return"left"===e.pinned}),o=D.filter(function(e){return!e.pinned}),i=D.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[y,D,u.accessor,u.pinned]),De=Ye({draggedHeaderRef:I,essentialAccessors:N,headers:D,hoveredHeaderRef:L,onTableHeaderDragEnd:K}).handleDragOver,Le=Ee(),We=g({accessor:u.accessor,rowId:Ce}),Oe=b({rowId:Ce,accessor:u.accessor}),Be=u.isSelectionColumn&&C;n.useEffect(function(){if(w){var e="".concat(Ce,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){ce!==e?(de(e),m&&(ge(!0),Ie.current&&clearTimeout(Ie.current),Ie.current=setTimeout(function(){ge(!1)},800))):de(e)}}),function(){w.delete(e),Ie.current&&clearTimeout(Ie.current)}}},[w,m,Ce,u.accessor,ce]),n.useEffect(function(){if(we){var e=setTimeout(function(){ge(!1)},850);return function(){return clearTimeout(e)}}},[we]),n.useEffect(function(){de(R(oe,u.accessor))},[oe,u.accessor]);var qe="boolean"===u.type||"date"===u.type||"enum"===u.type,ze=!!(null==u?void 0:u.isEditable)||!(!V||Be),Ge=Z.has(o),Ve=l&&!Ge,je=n.useMemo(function(){return!!Be&&Q.has(Ce+"")},[Be,Q,Ce]),Ke=null==d?void 0:d.singleRowChildren,Ue="st-cell ".concat(re>0&&u.expandable?"st-cell-depth-".concat(re):""," ").concat(Ve?s?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Ge?s?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(ze?"clickable":""," ").concat(we?s?"st-cell-updating-first":"st-cell-updating":""," ").concat(Pe?s?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Ae?s?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(te?c%2==0?"even-column":"odd-column":""," ").concat(Be?"st-selection-cell":""," ").concat(je?"st-selection-has-highlighted-cell":""," ").concat(Fe?"st-last-column":""," ").concat(Ke?"st-sub-cell":""," ").concat(be?"hovered":""),_e=null!=a?{gridColumn:a}:void 0,Je=n.useCallback(function(e){null==e&&(e="number"===u.type?0:"boolean"!==u.type&&""),de(e),S(oe,u.accessor,e),null==G||G({accessor:u.accessor,newValue:e,row:oe,rowIndex:f})},[u.accessor,u.type,G,oe,f]),Qe=n.useCallback(function(e){e.stopPropagation();var n=T(Ce,re,E,k,x),t=Ce+"";if(n?(Y(function(e){var n=new Map(e);return n.set(t,re),n}),X(function(e){var n=new Map(e);return n.delete(t),n})):(X(function(e){var n=new Map(e);return n.set(t,re),n}),Y(function(e){var n=new Map(e);return n.delete(t),n})),n&&$(function(e){var n=new Map(e);return n.delete(Ce),n}),j){var r=u.pinned;j({depth:re,event:e,groupingKey:Re,groupingKeys:_||[],isExpanded:!n,row:oe,rowIndexPath:ae||[],rowIdPath:ie,setEmpty:function(e,n){$(function(t){var o=new Map(t),i=o.get(Ce)||{};return o.set(Ce,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:r})),o})},setError:function(e){$(function(n){var t=new Map(n),o=t.get(Ce)||{};return t.set(Ce,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:r})),t})},setLoading:function(e){e?$(function(e){var n=new Map(e),t=n.get(Ce)||{};return n.set(Ce,exports.__assign(exports.__assign({},t),{loading:!0,error:null,isEmpty:!1,triggerSection:r})),n}):setTimeout(function(){$(function(e){var n=new Map(e),t=n.get(Ce)||{};return n.set(Ce,exports.__assign(exports.__assign({},t),{loading:!1,error:null,isEmpty:!1,triggerSection:r})),n})},0)}})}},[x,Re,re,E,k,u.pinned,j,oe,_,Ce,ae,ie,Y,X,$]);return B||v.isLoadingSkeleton?e.jsx("div",exports.__assign({className:Ue,style:_e},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!ve||qe||Be?e.jsxs(me,exports.__assign({className:Ue,"data-accessor":u.accessor,"data-col-index":o,"data-row-id":Ce,"data-row-index":f,role:"gridcell","aria-colindex":o+1,id:We,onClick:function(){V&&!Be&&V({accessor:u.accessor,colIndex:o,row:oe,rowIndex:f,value:ce})},onDoubleClick:function(){return u.isEditable&&!Be&&pe(!0)},onDragOver:function(e){Be||Le({callback:De,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){ve||Be||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||ve||(e.preventDefault(),pe(!0))},onMouseDown:function(e){ve||Be||(e.preventDefault(),P({rowIndex:f,colIndex:o,rowId:Ce}))},onMouseEnter:function(){ye(!0)},onMouseLeave:function(){ye(!1)},onMouseOver:function(){ve||Be||A({rowIndex:f,colIndex:o,rowId:Ce})},parentRef:ee,style:_e,tableRow:v},{children:[u.expandable&&Me?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(He&&(Se||j||Te)?ke?"expanded":"collapsed":"placeholder"),onClick:He&&(Se||j||Te)?function(e){return Qe(e)}:void 0,role:He&&(Se||j||Te)?"button":"presentation",tabIndex:He&&(Se||j||Te)?0:-1,"aria-label":He&&(Se||j||Te)?"".concat(ke?"Collapse":"Expand"," row group"):void 0,"aria-expanded":He&&(Se||j||Te)?ke:void 0,"aria-hidden":!(He&&(Se||j||Te)),onKeyDown:He&&(Se||j||Te)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Qe(e))}:void 0},{children:W.expand})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:B||v.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:Be?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:be||q&&q(Ce+"")?e.jsx(Xe,{checked:!!q&&q(Ce+""),onChange:function(e){F&&F(Ce+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!U||!Be||0===U.length)return null;if(!(be||q&&q(Ce+"")))return null;var n={row:oe,rowIndex:i};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:U.map(function(t,r){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?function(){var e;return u.cellRenderer({accessor:u.accessor,colIndex:o,row:oe,rowIndex:ue,rowPath:ie,theme:ne,value:ce,formattedValue:null===(e=null==u?void 0:u.valueFormatter)||void 0===e?void 0:e.call(u,{accessor:u.accessor,colIndex:o,row:oe,rowIndex:f,value:ce})})}():$e({content:ce,header:u,colIndex:o,row:oe,rowIndex:f})})})),!B&&!v.isLoadingSkeleton&&ve&&qe&&!Be&&e.jsx(Ne,{enumOptions:u.enumOptions,onChange:Je,setIsEditing:pe,type:u.type,value:ce})]}),Oe):e.jsx("div",exports.__assign({className:"st-cell-editing",id:g({accessor:u.accessor,rowId:Ce}),style:_e,onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(Ne,{enumOptions:u.enumOptions,onChange:Je,setIsEditing:pe,type:u.type,value:ce})}))},function(e,n){if(e.rowIndex!==n.rowIndex||e.colIndex!==n.colIndex||e.isHighlighted!==n.isHighlighted||e.isInitialFocused!==n.isInitialFocused||e.borderClass!==n.borderClass)return!1;if(e.tableRow!==n.tableRow){if(e.tableRow.row!==n.tableRow.row)return!1;if(e.tableRow.position!==n.tableRow.position||e.tableRow.displayPosition!==n.tableRow.displayPosition)return!1}return(e.header===n.header||e.header.accessor===n.header.accessor&&e.header.isEditable===n.header.isEditable&&e.header.type===n.header.type&&e.header.cellRenderer===n.header.cellRenderer&&e.header.valueFormatter===n.header.valueFormatter)&&e.parentHeader===n.parentHeader&&e.displayRowNumber===n.displayRowNumber&&e.nestedIndex===n.nestedIndex&&e.gridColumnStart===n.gridColumnStart}),Ze=function(e,n){return!e||e.visibleAccessors.has(n)},en=function(e,n){if(e){var t=e.trackIndexByAccessor.get(n);return void 0===t?void 0:t+1}},nn=function(t){var r=t.columnIndices,o=t.columnWindow,i=t.displayRowNumber,a=t.header,u=t.headers,l=t.nestedIndex,s=t.parentHeader,c=t.pinned,d=t.rootPinned,f=t.rowIndex,v=t.rowIndices,p=t.tableRow,h=r[a.accessor],w=J(),m=w.getBorderClass,b=w.isSelected,y=w.isInitialFocusedCell,I=w.collapsedHeaders,C=H(p.rowId);if(a.children&&a.children.length>0){var R=a.children.filter(function(e){return x({header:e,pinned:c,headers:u,collapsedHeaders:I,rootPinned:d})});if(a.singleRowChildren){var S=Ze(o,a.accessor),M={rowIndex:f,colIndex:h,rowId:C},N=m(M),E=b(M),T=y(M),k=g({accessor:a.accessor,rowId:C});return e.jsxs(n.Fragment,{children:[S&&e.jsx(Qe,{borderClass:N,colIndex:h,displayRowNumber:i,gridColumnStart:en(o,a.accessor),header:a,isHighlighted:E,isInitialFocused:T,nestedIndex:l,parentHeader:s,rowIndex:f,tableRow:p},k),R.map(function(n){var t=g({accessor:n.accessor,rowId:C});return e.jsx(nn,{columnIndices:r,columnWindow:o,displayRowNumber:i,rootPinned:d,header:n,headers:u,nestedIndex:l,parentHeader:a,pinned:c,rowIndex:f,rowIndices:v,tableRow:p},t)})]})}return e.jsx(n.Fragment,{children:R.map(function(n){var t=g({accessor:n.accessor,rowId:C});return e.jsx(nn,{columnIndices:r,columnWindow:o,displayRowNumber:i,rootPinned:d,header:n,headers:u,nestedIndex:l,parentHeader:a,pinned:c,rowIndex:f,rowIndices:v,tableRow:p},t)})})}if(!Ze(o,a.accessor))return null;var P={rowIndex:f,colIndex:h,rowId:C},A=m(P),F=b(P),D=y(P),L=g({accessor:a.accessor,rowId:C});return e.jsx(Qe,{borderClass:A,colIndex:h,displayRowNumber:i,gridColumnStart:en(o,a.accessor),header:a,isHighlighted:F,isInitialFocused:D,nestedIndex:l,parentHeader:s,rowIndex:f,tableRow:p},L)},tn=r.default.memo(function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.columnWindow,i=n.headers,a=n.pinned,u=n.rowIndex,l=n.displayRowNumber,s=n.rowIndices,c=n.tableRow,d=J().collapsedHeaders,f=i.filter(function(e){return x({header:e,pinned:a,headers:i,collapsedHeaders:d,rootPinned:e.pinned})});return e.jsx(e.Fragment,{children:f.map(function(n,d){var f=d+(null!=t?t:0);if(o&&!function(e){return!(!e.children||0>=e.children.length)}(n)&&!Ze(o,n.accessor))return null;var v=H(c.rowId),p=g({accessor:n.accessor,rowId:v});return e.jsx(nn,{columnIndices:r,columnWindow:o,displayRowNumber:l,rootPinned:n.pinned,header:n,headers:i,nestedIndex:f,pinned:a,rowIndex:u,rowIndices:s,tableRow:c},p)})})},function(e,n){return e.rowIndex===n.rowIndex&&e.displayRowNumber===n.displayRowNumber&&e.columnIndexStart===n.columnIndexStart&&(e.tableRow===n.tableRow||e.tableRow.row===n.tableRow.row)&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.columnWindow===n.columnWindow}),rn=function(n){var t=n.rowState,r=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return t.loading&&r?a=r:t.error&&o?a=o:t.isEmpty&&i&&(a=i),a?e.jsx("div",exports.__assign({className:"st-cell st-state-row-cell",style:{gridColumn:"1 / -1",padding:0}},{children:a})):null},on=function(n){var t=n.calculatedHeight,r=n.childAccessor,o=n.depth,i=n.expandableHeader,a=n.index,u=n.parentRow,l=n.position,s=J(),c=s.theme,d=s.rowGrouping,f=s.rowHeight,v=s.heightOffsets,p=s.customTheme,h=s.loadingStateRenderer,w=s.errorStateRenderer,m=s.emptyStateRenderer,g=s.icons,x=i.nestedTable;if(!x)return null;var b=R(u,r),y=Array.isArray(b)?b:[],C=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,S=x.customTheme?exports.__assign(exports.__assign({},p),x.customTheme):p,M=function(e){var n=e.calculatedHeight,t=e.customHeight,r=e.customTheme;return t?"string"==typeof t?t:"".concat(t,"px"):"".concat(n-r.nestedGridPaddingTop-r.nestedGridPaddingBottom,"px")}({calculatedHeight:t,customHeight:x.height,customTheme:p}),N=I({calculatedHeight:t,customHeight:x.height,customTheme:p});return e.jsx("div",exports.__assign({className:"st-row st-nested-grid-row","data-index":a,style:{transform:"translate3d(0, ".concat(q({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(N,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx(Ht,exports.__assign({},x,{rows:y,theme:c,customTheme:S,height:M,rowGrouping:C,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,icons:g}))}))},an=r.default.memo(function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.columnWindow,i=n.gridTemplateColumns,a=n.headers,u=n.index,l=n.pinned,s=n.rowHeight,c=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,v=n.isSticky,p=void 0!==v&&v,h=n.stickyIndex,w=void 0===h?0:h,m=n.stickyOffset,g=void 0===m?0:m,x=n.stickyZIndex,b=J(),y=b.customTheme,I=b.emptyStateRenderer,C=b.errorStateRenderer,R=b.heightOffsets,S=b.isAnimating,M=b.isRowSelected,N=b.loadingStateRenderer,E=b.maxHeaderDepth,T=b.useHoverRowBackground,k=b.useOddEvenRowBackground,P=f.position,A=f.displayPosition,F=f.stateIndicator,D=f.nestedTable;if(D)return l?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":u,style:{gridTemplateColumns:i,transform:"translate3d(0, ".concat(q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),"px, 0)"),height:"".concat(D.calculatedHeight,"px")}}):e.jsx(on,{calculatedHeight:D.calculatedHeight,childAccessor:D.childAccessor,depth:f.depth-1,expandableHeader:D.expandableHeader,index:u,parentRow:D.parentRow,position:P});if(F)return e.jsx("div",F.state.triggerSection===l&&(F.state.loading&&N||F.state.error&&C||F.state.isEmpty&&I)?exports.__assign({className:"st-row st-state-row","data-index":u,style:{gridTemplateColumns:i,transform:"translate3d(0, ".concat(q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),"px, 0)"),height:"".concat(s,"px")}},{children:e.jsx(rn,{parentRow:F.parentRow,rowState:F.state,gridTemplateColumns:i,loadingStateRenderer:N,errorStateRenderer:C,emptyStateRenderer:I})}):{className:"st-row st-state-row-spacer","data-index":u,style:{gridTemplateColumns:i,transform:"translate3d(0, ".concat(q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),"px, 0)"),height:"".concat(s,"px")}});var L=P%2==0,W=H(f.rowId),O=!!M&&M(W),B=p?{gridTemplateColumns:i,transform:"translateY(".concat(w*(s+1)+g,"px)"),height:"".concat(s,"px"),position:"absolute",top:0,left:0,zIndex:x}:{gridTemplateColumns:i,top:q({position:P,rowHeight:s,heightOffsets:R,customTheme:y}),height:"".concat(s,"px")};return e.jsx("div",exports.__assign({className:"st-row ".concat(p?"st-sticky-parent":""," ").concat(k?L?"even":"odd":""," ").concat(O?"selected":""),"data-index":P,role:"row","aria-rowindex":P+E+1,onMouseEnter:function(){!S&&T&&d(P)},style:B},{children:e.jsx(tn,{columnIndexStart:r,columnIndices:t,columnWindow:o,displayRowNumber:A,headers:a,pinned:l,rowIndex:P,rowIndices:c,tableRow:f},W)}))},function(e,n){return!((n.tableRow.nestedTable||n.tableRow.stateIndicator)&&e.index!==n.index)&&e.tableRow.position===n.tableRow.position&&e.tableRow.displayPosition===n.tableRow.displayPosition&&e.tableRow.row===n.tableRow.row&&e.tableRow.stateIndicator===n.tableRow.stateIndicator&&e.rowHeight===n.rowHeight&&e.gridTemplateColumns===n.gridTemplateColumns&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.columnWindow===n.columnWindow&&e.columnIndexStart===n.columnIndexStart}),un=function(t){var r=t.displayStrongBorder,o=t.position,i=t.rowHeight,a=t.templateColumns,u=t.isSticky,l=void 0!==u&&u,s=J(),c=s.heightOffsets,d=s.customTheme,f=n.useRef(null),v=l?o:function(e){var n=e.position,t=e.customTheme;return n*(e.rowHeight+t.rowSeparatorWidth)-t.rowSeparatorWidth+O(n,e.heightOffsets)}({position:o,rowHeight:i,heightOffsets:c,customTheme:d}),p=l?{position:"absolute",top:0,left:0,transform:"translateY(".concat(v,"px)")}:{transform:"translate3d(0, ".concat(v,"px, 0)")};return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){e.preventDefault();var n=e.currentTarget,t=n.style.pointerEvents;n.style.pointerEvents="none";var r=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=t,r){var o=r.closest(".st-cell");if(o instanceof HTMLElement){f.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(f.current){var n=f.current.getBoundingClientRect(),t=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});f.current.dispatchEvent(t),f.current=null}},style:exports.__assign({gridTemplateColumns:a},p)},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},ln=n.createContext(void 0),sn=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(ln);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 t.current&&u(t.current,e),function(){t.current&&l(t.current,e)}},[t,u,l,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},cn=n.forwardRef(function(t,r){var o=t.columnIndexStart,i=t.columnIndices,a=t.columnWindow,u=t.headers,l=t.pinned,s=t.rowHeight,c=t.rowIndices,d=t.setHoveredIndex,f=t.templateColumns,v=t.totalHeight,p=t.width,h=t.regularRows,w=l?"st-body-pinned-".concat(l):"st-body-main",m=n.useRef(null);return n.useImperativeHandle(r,function(){return m.current},[]),n.useMemo(function(){return Pe(u,l)},[u,l])?e.jsx(sn,exports.__assign({childRef:m,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:w,ref:m,style:exports.__assign({position:"relative",height:"".concat(v,"px"),width:p},!l&&{flexGrow:1})},{children:h.map(function(t,r){var v=t.stateIndicator?"state-".concat(t.stateIndicator.parentRowId,"-").concat(t.position):H(t.rowId);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(un,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:s,templateColumns:f}),e.jsx(an,{columnIndexStart:o,columnIndices:i,columnWindow:a,gridTemplateColumns:f,headers:u,index:r,pinned:l,rowHeight:s,rowIndices:c,setHoveredIndex:d,tableRow:t})]},v)})}))})):null});function dn(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],t,!0),n,!0),r,!0),s=function(e,n,t){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return x({header:e,pinned:t,headers:l,collapsedHeaders:o,rootPinned:t})}).forEach(function(n,r){s(n,!e.singleRowChildren&&0===r,t)})};return t.forEach(function(e,n){s(e,0===n,e.pinned)}),n.filter(function(e){return!e.pinned&&x({header:e,pinned:void 0,headers:l,collapsedHeaders:o,rootPinned:e.pinned})}).forEach(function(e,n){s(e,0===n&&0===t.length,e.pinned)}),r.forEach(function(e){s(e,!1,e.pinned)}),i}cn.displayName="TableSection";var fn=function(t){var r=t.calculatedHeaderHeight,o=t.stickyParents,i=t.mainTemplateColumns,a=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,l=t.pinnedLeftWidth,c=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.pinnedRightWidth,v=t.setHoveredIndex,p=t.rowIndices,h=t.scrollbarWidth,w=t.scrollTop,m=t.heightMap,g=t.partiallyVisibleRows,x=J(),b=x.collapsedHeaders,y=x.customTheme,I=x.editColumns,C=x.headers,R=x.rowHeight,S=n.useRef(null),M=n.useRef(null),N=n.useRef(null),E=n.useMemo(function(){var e,n;if(0===o.length)return{treeTransitionOffset:0,offsetStartIndex:-1};var t,r=g[0];if((null==r?void 0:r.parentIndices)&&r.parentIndices.length>0)for(var i=function(e){var n=r.parentIndices[e];if(o.some(function(e){return e.position===n}))return t=n,"break"},a=r.parentIndices.length-1;a>=0&&"break"!==i(a);a--);var u=void 0!==t?o.findIndex(function(e){return e.position===t}):-1,l=-1,s=function(e){var n=o[e],t=o[e+1];return t?t.depth===n.depth?(l=e,"break"):n.depth>t.depth?(l=o.findIndex(function(e){return e.depth===n.depth}),"break"):void 0:"break"};for(a=0;o.length>a&&"break"!==s(a);a++);if(-1===l)return{treeTransitionOffset:0,offsetStartIndex:u};var c=null===(e=o[l])||void 0===e?void 0:e.position;if(void 0===c)return{treeTransitionOffset:0,offsetStartIndex:u};for(var d=0,f=0,v=g;v.length>f&&(null===(n=v[f].parentIndices)||void 0===n?void 0:n.includes(c));f++)d++;if(0===d)return{treeTransitionOffset:0,offsetStartIndex:u};var p=g[0];return{treeTransitionOffset:-((l+1-d)*R+Math.max(0,w-(m?m.rowTopPositions[p.position]:p.position*(R+y.rowSeparatorWidth)))),offsetStartIndex:u}},[y,m,g,R,w,o]),T=E.treeTransitionOffset,k=E.offsetStartIndex,P=n.useMemo(function(){return dn({headers:C,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:b})},[C,a,c,b]),A=o.length>0?o.length*(R+1)+T:0;if(0===o.length)return null;var F=function(t,r,i,a,u,l){return void 0===u&&(u=0),e.jsx("div",exports.__assign({className:i?"st-sticky-section-".concat(i):"st-sticky-section-main",ref:l,style:{position:"relative",height:"".concat(A,"px"),width:i?"".concat(a,"px"):void 0,flexGrow:i?0:1,flexShrink:i?0:void 0}},{children:o.map(function(a,l){var s=a.stateIndicator?"sticky-state-".concat(a.stateIndicator.parentRowId,"-").concat(a.position):"sticky-".concat(H(a.rowId)),c=-1!==k&&l>=k,d=c?T:0,f=(l+1)*(R+1)-1+d;return e.jsxs(n.Fragment,{children:[e.jsx(an,{columnIndexStart:u,columnIndices:P,gridTemplateColumns:t,headers:r,index:a.position,pinned:i,rowHeight:R,rowIndices:p,setHoveredIndex:v,tableRow:a,isSticky:!0,stickyIndex:l,stickyOffset:d,stickyZIndex:c?l:o.length-l}),e.jsx(un,{displayStrongBorder:!1,position:f,rowHeight:R,templateColumns:t,isSticky:!0})]},s)})}))},D=C.filter(function(e){return!e.pinned}),L="calc(100% - ".concat(h,"px - ").concat(I?"".concat(s,"px"):"0px",")");return e.jsxs("div",exports.__assign({className:"st-sticky-top",style:{height:"".concat(A,"px"),width:L,top:"".concat(r,"px")}},{children:[a.length>0&&e.jsx(sn,exports.__assign({childRef:S,group:"pinned-left"},{children:F(u,a,"left",l,0,S)})),e.jsx(sn,exports.__assign({childRef:M,group:"default"},{children:F(i,D,void 0,void 0,a.length,M)})),c.length>0&&e.jsx(sn,exports.__assign({childRef:N,group:"pinned-right"},{children:F(d,c,"right",f,a.length+D.length,N)}))]}))},vn=function(e){var n=e.collapsedHeaders,t=function(e){var r=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide&&!e.excludeFromRender)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&r.push(e),o.length>0?t({headers:o,flattenedHeaders:r}):e.singleRowChildren||r.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&r.push(e),t({headers:i,flattenedHeaders:r})}else r.push(e)}),r};return t({headers:e.headers,flattenedHeaders:[]})},pn=function(e){var n=e.autoExpandColumns,t=vn({headers:e.headers,collapsedHeaders:e.collapsedHeaders});return"".concat(t.map(function(e){return function(e,n){var t=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),t&&"number"==typeof t&&(t="".concat(t,"px")),void 0===t||n?r:"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(t,", ").concat(r,")"):"max(".concat(t,", ").concat(r,")")}(e,n)}).join(" "))},hn=function(e){var n=e.width,t=e.minWidth;if("number"==typeof n)return n;if("string"==typeof n){var r,o=n.trim();if(o.endsWith("px")&&!Number.isNaN(r=parseFloat(o)))return r}return"number"==typeof t?t:"string"==typeof t&&t.trim().endsWith("px")&&!Number.isNaN(r=parseFloat(t))?r:150},wn=function(e,n){var t=n.columnLeftPositions;if(0===t.length)return 0;if(0>=e)return 0;if(e>=n.totalWidth)return t.length-1;for(var r=0,o=t.length-1;o>r;){var i=Math.floor((r+o+1)/2);t[i]>e?o=i-1:r=i}return r},mn=function(t){var r=t.calculatedHeaderHeight,o=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,u=t.pinnedLeftWidth,l=t.pinnedRightColumns,s=t.pinnedRightTemplateColumns,c=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,v=t.setScrollDirection,p=t.shouldShowEmptyState,h=t.tableRows,w=t.stickyParents,m=t.regularRows,g=t.partiallyVisibleRows,x=t.heightMap,b=J(),y=b.collapsedHeaders,I=b.headerContainerRef,C=b.headers,R=b.heightOffsets,S=b.isAnimating,M=b.mainBodyRef,N=b.onLoadMore,E=b.rowHeight,T=b.scrollbarWidth,k=b.shouldPaginate,P=b.tableBodyContainerRef,A=b.tableEmptyStateRenderer,F=b.customTheme,D=$().setIsScrolling,L=n.useState(!1),W=L[0],O=L[1],B=n.useState(0),q=B[0],z=B[1],G=n.useRef(new Set),V=n.useCallback(function(e){if(document.querySelectorAll(".st-row.hovered").forEach(function(e){e.classList.remove("hovered")}),G.current.clear(),null!==e&&P.current){var n=P.current,t='.st-row[data-index="'.concat(e,'"]:not(.st-nested-grid-row)');n.querySelectorAll(t).forEach(function(e){var t=e;t.closest(".st-body-container")===n&&(t.classList.add("hovered"),G.current.add(t))});var r=n.previousElementSibling;r&&r.classList.contains("st-sticky-top")&&r.querySelectorAll(t).forEach(function(e){var n=e;n.classList.add("hovered"),G.current.add(n)})}},[P]);n.useEffect(function(){S&&V(null)},[S,V]),ue({headerContainerRef:I,mainSectionRef:P,scrollbarWidth:T}),n.useEffect(function(){return function(){K.current&&clearTimeout(K.current)}},[]);var j=n.useRef(null),K=n.useRef(null),U=n.useRef(0),_=function(e){return e.length}(h),Y=n.useMemo(function(){return function(e,n,t,r){return e*(n+r.rowSeparatorWidth)-r.rowSeparatorWidth+((null==t?void 0:t.reduce(function(e,n){return e+n[1]},0))||0)}(_,E,R,F)},[_,E,R,F]),X=n.useMemo(function(){return dn({headers:C,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:y})},[C,i,l,y]),Q=n.useMemo(function(){return Pe(C,"left")||Pe(C,void 0)||Pe(C,"right")},[C]),Z=n.useMemo(function(){return Q?void 0:{minHeight:Y}},[Q,Y]),ee=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=H(n.rowId);e[r]=t}),e},[d]),ne=n.useMemo(function(){return C.filter(function(e){return!e.pinned})},[C]),te=n.useState({scrollLeft:0,width:0,direction:"none"}),re=te[0],oe=te[1],ie=n.useRef(null),ae=n.useRef(null),le=n.useRef(0);n.useLayoutEffect(function(){var e=M.current;if(e){var n=function(n){var t=e.scrollLeft,r=e.clientWidth,o=le.current,i=t>o?"right":o>t?"left":"none";le.current=t,oe(function(e){var o=n?r:e.width;return e.scrollLeft===t&&e.width===o&&e.direction===i?e:{scrollLeft:t,width:o,direction:i}})};n(!0);var t=function(){null===ie.current&&(ie.current=requestAnimationFrame(function(){ie.current=null,n(!0)}))};e.addEventListener("scroll",t,{passive:!0});var r="undefined"!=typeof ResizeObserver?new ResizeObserver(function(){null!==ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){ae.current=null,n(!0)},150),null===ie.current&&(ie.current=requestAnimationFrame(function(){ie.current=null,n(!1)}))}):null;return null==r||r.observe(e),function(){e.removeEventListener("scroll",t),null==r||r.disconnect(),null!==ie.current&&(cancelAnimationFrame(ie.current),ie.current=null),null!==ae.current&&(clearTimeout(ae.current),ae.current=null)}}},[M,p]);var se=n.useMemo(function(){return function(e){var n=e.scrollLeft,t=e.viewportWidth,r=e.bufferColumnCount,o=e.scrollDirection;if(e.pinned)return null;var i=function(e){for(var n=vn({headers:e.headers,collapsedHeaders:e.collapsedHeaders}),t=Array(n.length),r=0,o=0;n.length>o;o++)t[o]=r,r+=hn(n[o]);return{columnLeftPositions:t,totalWidth:r,leafHeaders:n}}({headers:e.headers,collapsedHeaders:e.collapsedHeaders}),a=new Map;if(i.leafHeaders.forEach(function(e,n){a.set(e.accessor,n)}),0>=t)return{visibleAccessors:new Set(i.leafHeaders.map(function(e){return e.accessor})),trackIndexByAccessor:a};var u=function(e){var n=e.scrollLeft,t=e.viewportWidth,r=e.scrollDirection,o=void 0===r?"none":r,i=e.widthMap,a=i.leafHeaders;if(0===a.length)return{startIndex:0,endIndex:0,columns:[]};var u=a.length>0?i.totalWidth/a.length:150,l=e.bufferColumnCount*u,s=l,c=l;"right"===o?(s=Math.max(u,.1*l),c=.9*l):"left"===o&&(s=.9*l,c=Math.max(u,.1*l));var d=n+t+c,f=wn(Math.max(0,n-s),i),v=wn(d,i)+1;return{startIndex:f,endIndex:v=Math.min(a.length,v),columns:a.slice(f,v)}}({scrollLeft:n,viewportWidth:t,bufferColumnCount:r,scrollDirection:o,widthMap:i}).columns;return{visibleAccessors:new Set(u.map(function(e){return e.accessor})),trackIndexByAccessor:a}}({headers:ne,collapsedHeaders:y,scrollLeft:re.scrollLeft,viewportWidth:re.width,bufferColumnCount:3,scrollDirection:re.direction,pinned:void 0})},[ne,y,re]),ce=n.useCallback(function(e,n){!N||k||W||200>=e.scrollHeight-(n+e.clientHeight)&&n>U.current&&(O(!0),N(),setTimeout(function(){O(!1)},1e3))},[N,k,W]),de={columnIndices:X,headerContainerRef:I,headers:C,rowHeight:E,rowIndices:ee,rowsToRender:d,setHoveredIndex:V,regularRows:m};return e.jsxs(e.Fragment,{children:[!p&&e.jsx(fn,{calculatedHeaderHeight:r,heightMap:x,mainTemplateColumns:o,partiallyVisibleRows:g,pinnedLeftColumns:i,pinnedLeftTemplateColumns:a,pinnedLeftWidth:u,pinnedRightColumns:l,pinnedRightTemplateColumns:s,pinnedRightWidth:c,rowIndices:ee,scrollTop:q,scrollbarWidth:T,setHoveredIndex:V,stickyParents:w}),e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return V(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;D(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(function(){D(!1)},150),j.current&&cancelAnimationFrame(j.current),j.current=requestAnimationFrame(function(){var e=U.current,r=t>e?"down":e>t?"up":"none";f(t),v(r),z(t),ce(n,t),U.current=t})},ref:P,style:Z},{children:p?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:A})):e.jsxs(e.Fragment,{children:[e.jsx(cn,exports.__assign({},de,{pinned:"left",templateColumns:a,totalHeight:Y,width:u})),e.jsx(cn,exports.__assign({},de,{columnIndexStart:i.length,columnWindow:se,ref:M,templateColumns:o,totalHeight:Y})),e.jsx(cn,exports.__assign({},de,{columnIndexStart:i.length+o.length,pinned:"right",templateColumns:s,totalHeight:Y,width:c}))]})}))]})},gn=function(e,n){if(e.pinned)return e.pinned;var t=m(n,e.accessor);return t?gn(t,n):void 0},xn=function(e){var n=e.autoExpandColumns,t=e.collapsedHeaders,r=e.containerWidth,o=e.event,i=e.header,a=e.headers,l=e.onColumnWidthChange,s=e.reverse,c=void 0!==s&&s,d=e.setHeaders,v=e.setIsResizing,p=e.startWidth;o.preventDefault();var h="clientX"in o?o.clientX:o.touches[0].clientX,w="touches"in o;if(i&&!i.hide){v(!0);var m,g=gn(i,a),x=D(i);if(i.children&&i.children.length>0){var b=P(i,t);m=b.length>0?b:[i]}else m=[i];var y=new Map,I=0;if(n){var C=a.filter(function(e){return e.pinned===g});if(L(C,t).forEach(function(e){var n=A(e);y.set(e.accessor,n)}),r>0){var R=yn({headers:a,containerWidth:r,collapsedHeaders:t}),S=R.leftWidth,M=R.rightWidth;I="left"===g?S:"right"===g?M:Math.max(0,r-S-M)}}var N=function(e){var o="right"===g?h-e:e-h;if(n){var l=a.filter(function(e){return e.pinned===g});Cn({delta:o,startWidth:p,resizedHeader:m.length>0?m[m.length-1]:i,sectionHeaders:l,rootPinned:g,reverse:c,collapsedHeaders:t,initialWidthsMap:y,sectionWidth:I,isParentResize:m.length>1,childrenToResize:m,headers:a,containerWidth:r})}else{var s=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth;if(!n.pinned)return 1/0;var a=t.some(function(e){return"left"===e.pinned&&!e.hide}),u=t.some(function(e){return"right"===e.pinned&&!e.hide}),l=i*f(i,a,u)-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+P(n,r).reduce(function(e,n){return e+A(n)},0)},0),s=D(n);return s>l?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),s):l}({header:i,headers:a,collapsedHeaders:t});m.length>1?bn({delta:o,leafHeaders:m,minWidth:x,startWidth:p,maxWidth:s}):m[0].width=Math.max(Math.min(p+o,s),x),a.forEach(function(e){F(e)})}var v=u([],a,!0);d(v)};if(w){var H=function(e){N(e.touches[0].clientX)},E=function(){document.removeEventListener("touchmove",H),document.removeEventListener("touchend",E),v(!1),l&&l(u([],a,!0))};document.addEventListener("touchmove",H),document.addEventListener("touchend",E)}else{var T=function(e){N(e.clientX)},k=function(){document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",k),v(!1),l&&l(u([],a,!0))};document.addEventListener("mousemove",T),document.addEventListener("mouseup",k)}}},bn=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,D(n))},40),u=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;t.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),r)})},yn=function(e){var n=e.containerWidth,t=e.collapsedHeaders,r=0,o=0,i=0;e.headers.forEach(function(e){if(!e.hide){var n=P(e,t).reduce(function(e,n){return e+A(n)},0);"left"===e.pinned?r+=n:"right"===e.pinned?o+=n:i+=n}});var a=r,u=o;if(n&&n>0){var l=n*f(n,r>0,o>0);r>l&&(r=l),o>l&&(o=l)}return{leftWidth:w(r),rightWidth:w(o),mainWidth:i,leftContentWidth:a,rightContentWidth:u}},In=function(e){var n=e.columnsToShrink,t=e.totalCompensation,r=e.initialWidthsMap;if(0>t){var o=Math.abs(t),i=n.reduce(function(e,n){return e+(r.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,t){var a=r.get(e.accessor)||100,u=o*(a/i);if(t===n.length-1){var l=n.slice(0,t).reduce(function(e,n){var t=r.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-t)},0);u=o-l}e.width=a+u})}else for(var a=t,u=function(){var e=n.map(function(e){var n=r.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-40),initialWidth:n,minWidth:40}}),t=e.filter(function(e){return e.headroom>0});if(t.length>0){var o=t.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;t.forEach(function(e,n){var r=u*(e.headroom/o);r=Math.min(r,e.headroom),n===t.length-1&&(r=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-r,i+=r}),a-=i}else{var l=e.filter(function(e){return e.minWidth>d});if(0>=l.length)return"break";var s=a,c=s/l.length,f=0;l.forEach(function(e,n){var t=e.minWidth-d,r=Math.min(c,t);n===l.length-1&&(r=Math.min(s-f,t));var o=e.initialWidth-r;e.column.width=o,e.column.minWidth=Math.max(o,d),f+=r}),a-=f}};a>.5&&"break"!==u(););},Cn=function(e){var n=e.childrenToResize,t=void 0===n?[]:n,r=e.collapsedHeaders,o=e.delta,i=e.initialWidthsMap,a=e.isParentResize,u=void 0!==a&&a,l=e.resizedHeader,s=e.reverse,c=e.rootPinned,v=e.sectionHeaders,p=e.sectionWidth,h=e.startWidth,w=e.headers,m=e.containerWidth,g=o;if(c&&m>0){var x=function(e,n,t){return e*f(e,n,t)}(m,w.some(function(e){return"left"===e.pinned&&!e.hide}),w.some(function(e){return"right"===e.pinned&&!e.hide})),b=Array.from(i.values()).reduce(function(e,n){return e+n},0);o>0&&b+o>x&&(g=Math.max(0,x-b))}if(o=g,u&&t.length>1){var y=L(v,r),I=y.findIndex(function(e){return e.accessor===t[0].accessor}),C=y.findIndex(function(e){return e.accessor===t[t.length-1].accessor});if(-1===I||-1===C)return;var R,S=0===I,M=C===y.length-1;R="left"===c&&M||"right"===c&&S?[]:S?y.slice(C+1):M||s?y.slice(0,I):y.slice(C+1);var N=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){var H=o,E=!1;if(R.length>0&&N+o>p){E=!0;var T=R.reduce(function(e,n){var t=i.get(n.accessor)||100;return e+Math.max(0,t-d)},0);H=Math.min(o,T)}var k=(P=h+H)/(A=t.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0));t.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*k,40)}),E&&H>0&&R.length>0&&In({columnsToShrink:R,totalCompensation:H,initialWidthsMap:i})}else{var P,A=t.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0),F=(P=Math.max(h+o,d*t.length))/A;t.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*F,40)}),(j=h-P)>0&&R.length>0&&In({columnsToShrink:R,totalCompensation:-j,initialWidthsMap:i})}}else{var D=L(v,r),W=D.findIndex(function(e){return e.accessor===l.accessor});if(-1!==W){var O,B=0===W,q=W===D.length-1;if(0!==(O="left"===c&&q||"right"===c&&B?[]:B?D.slice(W+1):q||s?D.slice(0,W):D.slice(W+1)).length){var z=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){if(p>=z+o)return void(l.width=h+o);T=O.reduce(function(e,n){var t=i.get(n.accessor)||100;return e+Math.max(0,t-d)},0);var G=Math.min(o,T);l.width=h+G,G>0&&In({columnsToShrink:O,totalCompensation:G,initialWidthsMap:i})}else{var V=Math.max(h+o,40),j=h-V;l.width=V,j>0&&In({columnsToShrink:O,totalCompensation:-j,initialWidthsMap:i})}}else l.width=Math.max(h+o,40)}}},Rn={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"},Sn=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"]}},Mn=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Nn=function(e){return["between","notBetween","in","notIn"].includes(e)},Hn=function(e){return["isEmpty","isNotEmpty"].includes(e)},En=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},Tn=function(t){var r=t.value,o=t.onChange,i=t.options,a=t.placeholder,u=void 0===a?"Select...":a,l=t.className,s=void 0===l?"":l,c=t.disabled,d=void 0!==c&&c,f=n.useState(!1),v=f[0],p=f[1],h=n.useState(-1),w=h[0],m=h[1],g=n.useRef(null),x=i.find(function(e){return e.value===r});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),p(!1),m(-1));break;case"Escape":e.preventDefault(),p(!1),m(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,w,i,o]);var b=function(e){o(e),p(!1),m(-1)};return e.jsxs("div",exports.__assign({ref:g,className:"st-custom-select ".concat(s," ").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(p(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===r});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(ae,{})]})),e.jsx(le,exports.__assign({open:v,setOpen:p,onClose:function(){p(!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,t){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),t)})}))}))]}))},kn=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Rn[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(Tn,{value:t,onChange:function(e){r(e)},options:o})}))},Pn=function(n){var t=n.type,r=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===t?"text":t,value:n.value,onChange:function(e){return r(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()})},An=function(n){var t=n.children,r=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Fn=function(n){var t=n.onClear,r=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:!r,className:"st-filter-button st-filter-button-apply ".concat(r?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&t&&e.jsx("button",exports.__assign({onClick:t,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},Dn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=Sn("string");n.useEffect(function(){o?(s(o.operator),f((o.value||"")+"")):(s("contains"),f(""))},[o]);var p=function(){var e=exports.__assign({accessor:r.accessor,operator:l},Mn(l)&&{value:d});i(e)},h=Hn(l)||d.trim();return e.jsxs(En,{children:[e.jsx(kn,{value:l,onChange:s,operators:v}),Mn(l)&&e.jsx(An,{children:e.jsx(Pn,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(Fn,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},Ln=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],p=f[1],h=n.useState(((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")+""),w=h[0],m=h[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],y=Sn("number");n.useEffect(function(){var e,n;a?(d(a.operator),p((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"),p(""),m(""),b(""))},[a]);var I=function(){var e={accessor:i.accessor,operator:c};Mn(c)?e.value=parseFloat(v):Nn(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(En,{children:[e.jsx(kn,{value:c,onChange:d,operators:y}),Mn(c)&&e.jsx(An,{children:e.jsx(Pn,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:I})}),Nn(c)&&e.jsxs(An,{children:[e.jsx(Pn,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:I}),e.jsx(Pn,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:I})]}),e.jsx(Fn,{onApply:I,onClear:l,canApply:!!Hn(c)||(Mn(c)?""!==v.trim():!!Nn(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},Wn=function(n){var t=n.className;return e.jsx(Tn,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===t?"":t,placeholder:n.placeholder})},On=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],s=u[1],c=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=c[0],f=c[1],v=Sn("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=Hn(l)||""!==d;return e.jsxs(En,{children:[e.jsx(kn,{value:l,onChange:s,operators:v}),Mn(l)&&e.jsx(An,{children:e.jsx(Wn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Fn,{onApply:function(){var e={accessor:r.accessor,operator:l};Mn(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},Bn=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],p=f[1],h=n.useState((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])?a.values[0]+"":""),w=h[0],m=h[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],y=Sn("date");n.useEffect(function(){var e,n;a?(d(a.operator),p((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"),p(""),m(""),b(""))},[a]);var I=function(t){var r=t.value,o=t.onChange,i=t.placeholder,a=t.autoFocus,u=t.className,l=n.useState(!1),s=l[0],c=l[1],d=n.useState(""),f=d[0],v=d[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=Ce(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){a&&p.current&&p.current.focus()},[a]);var h=r?Ce(r):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:f,placeholder:i,onClick:function(){c(!s)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),c(!s)):"Escape"===e.key&&c(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(le,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(ge,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(En,{children:[e.jsx(kn,{value:c,onChange:d,operators:y}),Mn(c)&&e.jsx(An,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Nn(c)&&e.jsxs(An,{children:[e.jsx(I,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:x,onChange:b,placeholder:"To date..."})]}),e.jsx(Fn,{onApply:function(){var e={accessor:i.accessor,operator:c};Mn(c)?e.value=v:Nn(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!Hn(c)||(Mn(c)?""!==v.trim():!!Nn(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},qn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,l=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),s=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),c=n.useState((null==o?void 0:o.values)?o.values.map(String):s),d=c[0],f=c[1],v=n.useState(""),p=v[0],h=v[1],w=n.useMemo(function(){if(!p)return l;var e=p.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,p]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:s)},[o,s]);var m=l.length>10;return e.jsxs(En,{children:[e.jsx(An,{children:e.jsxs("div",exports.__assign({className:"st-enum-filter-options"},{children:[e.jsx("div",exports.__assign({className:"st-enum-select-all"},{children:e.jsx(Xe,exports.__assign({checked:d.length===s.length,onChange:function(e){f(e?s:[])}},{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(Pn,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,t){return e.jsx(Xe,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(Fn,{onApply:function(){d.length!==s.length?i({accessor:r.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==s.length,showClear:!!o})]})},zn=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(Ln,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(On,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Bn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(qn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Dn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Gn=function(t){var r=t.content,o=t.children,i=t.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],s=u[1],c=n.useState({top:0,left:0}),d=c[0],f=c[1],v=n.useRef(null),p=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!r||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var h=n.cloneElement(o,{ref:p,onMouseEnter:function(){v.current=setTimeout(function(){if(p.current&&r.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),f({top:t,left:n}),s(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),s(!1)}});return e.jsxs(e.Fragment,{children:[h,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:r}))]})},Vn=function(t){var r,o,i=t.colIndex,a=t.gridColumnEnd,l=t.gridColumnStart,s=t.gridRowEnd,d=t.gridRowStart,f=t.header,h=t.parentHeader,w=t.reverse,m=t.sort,x=t.isLastHeader,b=void 0!==x&&x,y=n.useState(!1),I=y[0],C=y[1],S=n.useState(!1),M=S[0],N=S[1],H=n.useState(f.label||""),E=H[0],T=H[1],k=J(),P=k.activeHeaderDropdown,A=k.areAllRowsSelected,F=k.autoExpandColumns,D=k.collapsedHeaders,L=k.columnBorders,W=k.columnReordering,O=k.columnResizing,B=k.containerWidth,q=k.columnsWithSelectedCells,z=k.draggedHeaderRef,G=k.enableHeaderEditing,V=k.essentialAccessors,j=k.handleApplyFilter,K=k.handleClearFilter,U=k.handleSelectAll,_=k.headerDropdown,Y=k.headerRegistry,X=k.icons,$=k.headers,Q=k.hoveredHeaderRef,Z=k.onColumnOrderChange,ee=k.onColumnSelect,ne=k.onColumnWidthChange,te=k.onHeaderEdit,re=k.onSort,oe=k.onTableHeaderDragEnd,ie=k.headerHeight,ae=k.rows,ue=k.selectColumns,se=k.selectableColumns,ce=k.selectedColumns,fe=k.setActiveHeaderDropdown,ve=k.setCollapsedHeaders,pe=k.setHeaders,he=k.setInitialFocusedCell,we=k.setIsResizing,ge=k.setSelectedCells,xe=k.setSelectedColumns,be=!!(null==f?void 0:f.isSortable),ye=!!(null==f?void 0:f.filterable),Ie=k.filters[f.accessor],Ce=(null==P?void 0:P.accessor)===f.accessor,Re=f.isSelectionColumn&&k.enableRowSelection,Se=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(f),Me=D.has(f.accessor),Ne=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,s=n.useRef(null),c=n.useState({}),d=c[0],f=c[1];return n.useEffect(function(){if(t&&s.current){var e=function(){if(s.current){var e=s.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=window.innerWidth-e.right,r="bottom",i={};o>n&&e.top>=o&&(r="top");var u="left";a>t+e.width&&(u="right"),"bottom"===r?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)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:s,position:d}}({isOpen:Ce,estimatedHeight:200,estimatedWidth:250,margin:4}),He=Ne.triggerRef,Te=Ne.position,ke=n.useMemo(function(){var e,n,t;if(!L)return!1;var r=$.filter(function(e){return"left"===e.pinned}),o=$.filter(function(e){return!e.pinned}),i=$.filter(function(e){return"right"===e.pinned});return"left"===f.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===f.accessor:"right"===f.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===f.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===f.accessor},[L,$,f.accessor,f.pinned]),Pe=n.useMemo(function(){return!(!se||Re)&&p(f,i).some(function(e){return ce.has(e)})},[se,Re,f,i,ce]),Ae=n.useMemo(function(){return!Re&&p(f,i).some(function(e){return q.has(e)})},[Re,f,i,q]),De=n.useMemo(function(){return!(!f.children||0===f.children.length)&&(!Me||f.children.some(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n}))},[f.children,Me]),Le=null==h?void 0:h.singleRowChildren,We=De&&!f.singleRowChildren,Oe="st-header-cell ".concat(f.accessor===(null===(r=Q.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(o=z.current)||void 0===o?void 0:o.accessor)===f.accessor?"st-dragging":""," ").concat(be?"clickable":""," ").concat(W&&!be?"columnReordering":""," ").concat(We?"parent":""," ").concat(Le?"st-sub-header":""," ").concat(ke?"st-last-column":""," ").concat(G&&!Re?"st-header-editable":""," ").concat(Pe?"st-header-selected":""," ").concat(Ae&&!Pe?"st-header-has-highlighted-cell":""," ").concat(b?"st-no-resize":""),Be=Ye({draggedHeaderRef:z,essentialAccessors:V,headers:$,hoveredHeaderRef:Q,onColumnOrderChange:Z,onTableHeaderDragEnd:oe}),qe=Be.handleDragStart,ze=Be.handleDragEnd,Ge=Be.handleDragOver,Ve=Ee();n.useEffect(function(){if(Y&&!f.isSelectionColumn){var e=f.accessor+"";return Y.set(e,{setEditing:function(e){N(e)}}),function(){Y.delete(e)}}},[Y,f.accessor,f.isSelectionColumn]),n.useEffect(function(){T(f.label||"")},[f.label]);var _e=function(e){C(!I)},Je=n.useCallback(function(e){T(e);var n=$.map(function(n){return n.accessor===f.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});pe(n),te&&te(f,e)},[$,pe,te,f]),$e=n.useCallback(function(){fe&&fe(null)},[fe]),Qe=n.useCallback(function(e){e.stopPropagation(),ve(function(e){var n=new Set(e);return Me?n.delete(f.accessor):n.add(f.accessor),n})},[ve,Me,f.accessor]),Ze=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(se){var r=p(t,i),o=r.some(function(e){return ce.has(e)});if(G&&o&&!n.shiftKey)return _&&Ce&&$e(),void N(!0);n.shiftKey&&ue?xe(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);i>t&&(i=t,o=e)});var a,l,s,c=u(u([],(s=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-s+1},function(e,n){return s+n})),!0),r,!0);return new Set(u(u([],Array.from(e),!0),c,!0))}):ue&&ue(r),ge(new Set),he(null)}ee&&ee(t),!se&&t.isSortable&&re(t.accessor)}};n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]);var en=n.useCallback(function(){var e=function(e,n){var t=n||{},r=t.rows,o=t.header,i=t.maxWidth,a=void 0===i?500:i,u=t.sampleSize,l=void 0===u?50:u,s=document.getElementById(g({accessor:e,rowId:"header"}));if(!s)return 150;var d=window.getComputedStyle(s),f=parseFloat(d.paddingLeft)||0,v=parseFloat(d.paddingRight)||0,p=parseFloat(d.gap)||0,h=f+v,w=s.querySelector(".st-header-label");if(w){var m=w.querySelector(".st-header-label-text");if(m){var x=document.createElement("span");x.style.visibility="hidden",x.style.position="absolute",x.style.whiteSpace="nowrap",x.style.width="auto";var b=window.getComputedStyle(m);x.style.font=b.font,x.style.fontSize=b.fontSize,x.style.fontWeight=b.fontWeight,x.style.fontFamily=b.fontFamily,x.style.letterSpacing=b.letterSpacing,x.style.padding=b.padding,x.textContent=m.textContent,document.body.appendChild(x);var y=x.offsetWidth;document.body.removeChild(x),h+=y}}for(var I=Array.from(s.children),C=1,S=0;I.length>S;S++){var M=I[S];if(!M.classList.contains("st-header-label")&&!M.classList.contains("st-sr-only")){var N=window.getComputedStyle(M);"none"!==N.display&&(h+=(M.offsetWidth||0)+(parseFloat(N.marginLeft)||0)+(parseFloat(N.marginRight)||0),C++)}}p>0&&C>1&&(h+=p*(C-1));var H=0,E=o&&o.type&&c.includes(o.type);if(r&&r.length>0&&!E){var T=Math.min(r.length,l),k=document.createElement("div");k.style.visibility="hidden",k.style.position="absolute",k.style.whiteSpace="nowrap",k.style.width="auto";var P=0,A=0,F=document.querySelector(".st-cell-content");if(F){var D=window.getComputedStyle(F);k.style.font=D.font,k.style.fontSize=D.fontSize,k.style.fontFamily=D.fontFamily,P=parseFloat(D.paddingLeft)||0,A=parseFloat(D.paddingRight)||0}for(document.body.appendChild(k),S=0;T>S;S++){var L,W=r[S],O=L=(null==o?void 0:o.valueGetter)?o.valueGetter({accessor:e,row:W,rowIndex:S}):R(W,e);(null==o?void 0:o.valueFormatter)&&null!=L&&(O=o.valueFormatter({accessor:e,colIndex:0,row:W,rowIndex:S,value:L})),k.textContent=null!=O?O+"":"";var B=k.offsetWidth+P+A;B>H&&(H=B)}document.body.removeChild(k)}var q=Math.max(h,H);return E&&(q=Math.max(q,150)),q>a&&(q=a),q+2}(f.accessor,{rows:ae,header:f,maxWidth:500,sampleSize:50}),n=je($,f.accessor);if(n){var t=Ke($,n),r=n[n.length-1],o=t.map(function(n,t){return t===r?exports.__assign(exports.__assign({},n),{width:e}):n}),i=Ue($,n,o);pe(i),ne&&ne(i)}},[f,$,ae,pe,ne]);if(!f)return null;var nn=O&&!Re&&!b&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(f.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,t=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ve({callback:xn,callbackProps:{autoExpandColumns:F,collapsedHeaders:D,containerWidth:B,event:e.nativeEvent,header:f,headers:$,onColumnWidthChange:ne,reverse:w,setHeaders:pe,setIsResizing:we,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ve({callback:xn,callbackProps:{autoExpandColumns:F,collapsedHeaders:D,containerWidth:B,event:e,header:f,headers:$,onColumnWidthChange:ne,reverse:w,setHeaders:pe,setIsResizing:we,startWidth:t},limit:10})},onDoubleClick:en},{children:e.jsx("div",{className:"st-header-resize-handle"})})),tn=m&&m.key.accessor===f.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return Ze({event:e,header:f})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||re(f.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(f.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&X.sortUp&&X.sortUp,"desc"===m.direction&&X.sortDown&&X.sortDown]})),rn=ye&&X.filter&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:_e,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.target===e.currentTarget||e.currentTarget.contains(e.target))&&(e.target.closest(".st-dropdown-content")||(e.preventDefault(),_e()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(f.label),"aria-expanded":I,"aria-haspopup":"dialog"},{children:[n.cloneElement(X.filter,{style:{fill:Ie?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(le,exports.__assign({open:I,overflow:"visible",setOpen:C,onClose:function(){return C(!1)}},{children:e.jsx(zn,{header:f,currentFilter:Ie,onApplyFilter:function(e){j(e),C(!1)},onClearFilter:function(){K(f.accessor),C(!1)}})}))]})),on=Se&&!Re&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return Qe(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Qe(e))},tabIndex:0,role:"button","aria-label":"".concat(Me?"Expand":"Collapse"," ").concat(f.label," column"),"aria-expanded":!Me},{children:Me?X.headerCollapse:X.headerExpand})),an=e.jsx(Gn,exports.__assign({content:f.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:Re?e.jsx(Xe,{checked:!!A&&A(),onChange:function(e){U&&U(e)},ariaLabel:"Select all rows"}):M?e.jsx(de,{defaultValue:E,onBlur:function(){return N(!1)},onChange:Je}):E||(null==f?void 0:f.label)}))})),un="header-desc-".concat(f.accessor),ln=function(e,n){var t=[];return e.type&&"other"!==e.type&&t.push("".concat(e.type," column")),e.isSortable&&t.push("sortable"),n&&t.push("filterable"),e.tooltip&&t.push(e.tooltip),t.join(", ")}(f,ye);return e.jsxs(me,exports.__assign({className:Oe,id:g({accessor:f.accessor,rowId:"header"}),role:"columnheader","aria-sort":function(){if(f.isSortable)return(null==m?void 0:m.key.accessor)===f.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"data-col-index":i,"aria-describedby":ln?un:void 0,onDragOver:function(e){Re||Ve({callback:Ge,callbackProps:{event:e,hoveredHeader:f},limit:50})},style:exports.__assign({gridRowStart:d,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-d>1?{}:{height:ie})},{children:[w&&nn,!f.headerRenderer&&"right"===f.align&&on,!f.headerRenderer&&"right"===f.align&&rn,!f.headerRenderer&&"right"===f.align&&tn,e.jsx("div",exports.__assign({ref:He,className:"st-header-label",draggable:W&&!f.disableReorder&&!Re&&!Fe(f,V),onClick:function(e){Re||Ze({event:e,header:f})},onDoubleClick:function(e){Re||function(e){var n=e.header;n.isSelectionColumn||se&&n.isSortable&&re(n.accessor)}({event:e,header:f})},onDragEnd:Re?void 0:function(e){e.preventDefault(),ze()},onDragStart:Re?void 0:function(e){W&&f&&function(e){qe(e)}(f)}},{children:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:i,header:f,components:{sortIcon:tn||void 0,filterIcon:rn||void 0,collapseIcon:on||void 0,labelContent:an}}):an})),!f.headerRenderer&&"right"!==f.align&&tn,!f.headerRenderer&&"right"!==f.align&&rn,!f.headerRenderer&&"right"!==f.align&&on,!w&&nn,_&&!Re&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:_({accessor:f.accessor,colIndex:i,header:f,isOpen:Ce,onClose:$e,position:Te})})),ln&&e.jsx("span",exports.__assign({id:un,className:"st-sr-only"},{children:ln}))]}))},jn=function(t){var r=t.columnIndices,o=t.gridTemplateColumns,i=t.handleScroll,a=t.headers,u=t.maxDepth,l=t.pinned,s=t.sectionRef,c=t.sort,d=t.width,f=J(),v=f.collapsedHeaders,p=f.autoExpandColumns,h=n.useMemo(function(){var e=function(n,t){return x({header:n,pinned:l,headers:a,collapsedHeaders:v,rootPinned:t})?n.children&&0!==n.children.length?n.children.flatMap(function(n){return e(n,t)}):[n]:[]},n=a.flatMap(function(n){return e(n,n.pinned)});return 0===n.length?-1:r[n[n.length-1].accessor]},[a,l,v,r]),w=n.useMemo(function(){var e=[],n=1,t=function(o,i,s,c,d){var f,p;if(void 0===s&&(s=!1),!x({header:o,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d}))return 0;s||n++;var h,w,m=null!==(p=null===(f=o.children)||void 0===f?void 0:f.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})}).length)&&void 0!==p?p:0,g=n;if(o.singleRowChildren&&m>0?(h=g+1,w=u+1):m>0?(h=g+m,w=i+1):(h=g+1,w=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:h,gridRowStart:i,gridRowEnd:w,colIndex:r[o.accessor],parentHeader:c}),o.children&&o.children.length>0){var b=o.singleRowChildren?i:i+1,y=!o.singleRowChildren;o.children.forEach(function(e){x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})&&(t(e,b,y,o,d),y=!1)})}return h-g},o=a.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:e.pinned})}),i=!0;return o.forEach(function(e){t(e,1,i,void 0,e.pinned),i=!1}),e},[a,u,l,r,v]);return e.jsx(sn,exports.__assign({childRef:s,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:s,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:w.map(function(n){return e.jsx(Vn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:c,isLastHeader:p&&!l&&n.colIndex===h},n.header.accessor)})})}))}))},Kn=function(t){var r=t.calculatedHeaderHeight,o=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,u=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,d=t.sort,f=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=J(),h=p.headerContainerRef,w=p.pinnedLeftRef,m=p.pinnedRightRef,g=p.collapsedHeaders,x=p.tableRows,b=p.maxHeaderDepth,y=n.useMemo(function(){return Pe(i,"left")||Pe(i,void 0)||Pe(i,"right")},[i]),I=n.useMemo(function(){return y?void 0:{minHeight:r}},[y,r]),C=n.useMemo(function(){return dn({headers:i,pinnedLeftColumns:u,pinnedRightColumns:s,collapsedHeaders:g})},[i,u,s,g]),R=n.useMemo(function(){return Object.keys(C).length},[C]);return e.jsxs("div",exports.__assign({className:"st-header-container",ref:h,style:I,"aria-rowcount":x.length+b,"aria-colcount":R},{children:[Pe(i,"left")&&e.jsx(jn,{columnIndices:C,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:b,pinned:"left",sectionRef:w,sort:d,width:f}),e.jsx(jn,{columnIndices:C,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:b,sectionRef:o,sort:d}),Pe(i,"right")&&e.jsx(jn,{columnIndices:C,gridTemplateColumns:c,handleScroll:void 0,headers:i,maxDepth:b,pinned:"right",sectionRef:m,sort:d,width:v})]}))},Un=function(t){var r=t.calculatedHeaderHeight,o=t.hideHeader,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.setScrollTop,l=t.setScrollDirection,s=t.shouldShowEmptyState,c=t.sort,d=t.tableRows,f=t.rowsToRender,v=t.stickyParents,p=t.regularRows,h=t.partiallyVisibleRows,w=t.heightMap,m=J(),g=m.columnResizing,x=m.editColumns,b=m.headers,y=m.collapsedHeaders,I=m.autoExpandColumns,C=n.useRef(null),R=n.useMemo(function(){return b.filter(function(e){return!e.pinned})},[b]),S=n.useMemo(function(){return b.filter(function(e){return"left"===e.pinned})},[b]),M=n.useMemo(function(){return b.filter(function(e){return"right"===e.pinned})},[b]),N=n.useMemo(function(){return pn({headers:S,collapsedHeaders:y,autoExpandColumns:I})},[S,y,I]),H=n.useMemo(function(){return pn({headers:R,collapsedHeaders:y,autoExpandColumns:I})},[R,y,I]),E=n.useMemo(function(){return pn({headers:M,collapsedHeaders:y,autoExpandColumns:I})},[M,y,I]),T={calculatedHeaderHeight:r,centerHeaderRef:C,headers:b,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedRightColumns:M,pinnedRightTemplateColumns:E,sort:c,pinnedLeftWidth:i,pinnedRightWidth:a},k={calculatedHeaderHeight:r,heightMap:w,mainTemplateColumns:H,partiallyVisibleRows:h,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedLeftWidth:i,pinnedRightColumns:M,pinnedRightTemplateColumns:E,pinnedRightWidth:a,regularRows:p,rowsToRender:f,setScrollDirection:l,setScrollTop:u,shouldShowEmptyState:s,stickyParents:v,tableRows:d};return e.jsxs("div",exports.__assign({className:"st-content ".concat(g?"st-resizeable":"st-not-resizeable"),style:{width:x?"calc(100% - 29.5px)":"100%"}},{children:[!o&&e.jsx(Kn,exports.__assign({},T)),e.jsx(mn,exports.__assign({},k))]}))},_n=function(t){var r=t.mainBodyWidth,o=t.mainBodyRef,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.pinnedLeftContentWidth,l=t.pinnedRightContentWidth,c=t.tableBodyContainerRef,d=J().editColumns,f=n.useState(!1),v=f[0],p=f[1],h=n.useRef(null),w=n.useRef(null),m=n.useRef(null),g=d?s:0,x=(d?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&&p(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,r]),v?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(sn,exports.__assign({childRef:w,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:w,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),r>0&&e.jsx(sn,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:r}})}))})),a>0&&e.jsx(sn,exports.__assign({childRef:m,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:m,style:{width:x}},{children:e.jsx("div",{style:{width:l}})}))})),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},Jn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"asc"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"asc"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"asc"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"asc"===t?i:-i},enum:function(e,n,t){return Jn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"asc"===t?-1:1:null==n?"asc"===t?1:-1:"string"==typeof e&&"string"==typeof n?Jn.string(e,n,t):"number"==typeof e&&"number"==typeof n?Jn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Jn.boolean(e,n,t):Jn.string(e+"",n+"",t)}},Yn=function(e){return function(e){var n=e.rows,t=e.sortColumn,r=function(e,n){for(var t=0,o=e;o.length>t;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children,n);if(a)return a}}},o=r(e.headers,t.key.accessor),i=(null==o?void 0:o.type)||"string",a=t.direction,l=t.key.accessor;return u([],n,!0).sort(function(e,t){var r,u;if(null==o?void 0:o.valueGetter){var s=n.indexOf(e),c=n.indexOf(t);r=o.valueGetter({accessor:l,row:e,rowIndex:s}),u=o.valueGetter({accessor:l,row:t,rowIndex:c})}else r=R(e,l),u=R(t,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:t,valueA:r,valueB:u,direction:a}):function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"asc"===r?-1:1;if(null==n||""===n)return"asc"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=e+"";if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return Jn.number(i,a,r)}return"date"===t?Jn.date(e+"",n+"",r):"boolean"===t?Jn.boolean(!!e,!!n,r):"enum"===t?Jn.enum(e+"",n+"",r):Jn.string(e+"",n+"",r)}(r,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Xn=function(e){return n.useMemo(function(){var n=h(e),t=new Map;return n.forEach(function(e){t.set(e.accessor,e)}),t},[e])},$n=function(e){var n=e.tableRows,t=e.sortColumn,r=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:t?r&&r.length>0?(0,e.sortNestedRows)({groupingKeys:r,headers:o,rows:n,sortColumn:t}):Yn({headers:o,rows:n,sortColumn:t}):n},Qn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;o.length>r;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,s=i.children;s.length>l;l++){var c=s[l];if(Qn([c],n,t),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},Zn=function(e){return e.every(function(e){return e.hide})},et=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(et(e.children),Zn(e.children)&&(e.hide=!0))})};function nt(e){var n=e.fullRootHeaders,t=e.panelSection,r=e.expandedHeaders,o=e.forceExpanded,i=[],a=function(e,n,l,s){if(!e.isSelectionColumn&&!e.excludeFromRender){i.push({header:e,visualIndex:i.length,depth:n,parent:l,indexPath:s,panelSection:t});var c=e.children&&e.children.length>0,d=o||r.has(e.accessor);c&&d&&e.children&&e.children.forEach(function(t,r){a(t,n+1,e,u(u([],s,!0),[r],!1))})}};return e.sectionRoots.forEach(function(e){var t=n.findIndex(function(n){return n.accessor===e.accessor});-1!==t&&a(e,0,null,[t])}),i}var tt=function(t){var r=t.allHeaders,o=t.clearHoverSeparator,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,s=t.draggingRow,c=t.expandedHeaders,d=t.flattenedHeaders,f=t.forceExpanded,v=void 0!==f&&f,p=t.header,h=t.hoveredSeparatorIndex,w=t.isCheckedOverride,m=t.panelSection,g=t.rowIndex,x=t.setDraggingRow,b=t.setExpandedHeaders,y=t.setHoveredSeparatorIndex,I=J(),C=I.columnEditorConfig,R=I.essentialAccessors,S=I.headers,M=I.icons,N=I.setHeaders,H=I.onColumnVisibilityChange,E=I.onColumnOrderChange,T=!1!==C.allowColumnPinning,k="".concat(16*a,"px"),P=p.children&&p.children.length>0,A=Fe(p,R),F=!A,D=null!=w?w:!(p.hide||P&&p.children&&Zn(p.children)),L=c.has(p.accessor),W=v||L,O=function(){if(!v){var e=new Set(c);L?e.delete(p.accessor):e.add(p.accessor),b(e)}},B=n.useCallback(function(e){return!(R.size>0&&!Le(e,R)||(null==E||E(e),N(e),0))},[R,E,N]),q=n.useCallback(function(){var e=ze(S,p.accessor,"left",R);e&&B(e)},[B,R,p.accessor,S]),z=n.useCallback(function(){var e=ze(S,p.accessor,"right",R);e&&B(e)},[B,R,p.accessor,S]),G=n.useCallback(function(){var e=ze(S,p.accessor,"main",R);e&&B(e)},[B,R,p.accessor,S]),V="left"===p.pinned||"right"===p.pinned?p.pinned:null,j=!!V&&!A,K=!V&&"main"===m,U=!V&&"main"===m,_=function(e){if(F){p.hide=!e,e?(Qn(r,p.accessor),P&&p.children&&p.children.length>0&&p.children.every(function(e){return!0===e.hide})&&p.children[0]&&(p.children[0].hide=!1,Qn(r,p.children[0].accessor))):et(r);var n=u([],S,!0);if(N(n),H){var t=function(e){var n={},t=function(e){n[e.accessor]=!e.hide,e.children&&e.children.length>0&&e.children.forEach(t)};return e.forEach(t),n}(n);H(t)}}},Y=l&&P&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(W?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),O()}},{children:M.expand}))})),X=e.jsx(Xe,{checked:D,disabled:!F,onChange:_}),$=e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:M.drag})),Q={pinnedSide:V,canPinLeft:K,canPinRight:U,canUnpin:j,pinLeft:q,pinRight:z,unpin:G},Z="left"===V?M.pinnedLeftIcon:"right"===V?M.pinnedRightIcon:null,ee=T&&0===a?null!==V&&null!==Z?j?e.jsx("button",exports.__assign({type:"button",className:"st-column-pin-btn st-column-pin-side st-column-pin-pinned-mark st-column-pin-pinned-active","aria-label":"Unpin column",title:"Unpin",onClick:function(e){e.stopPropagation(),G()}},{children:Z})):e.jsx("span",exports.__assign({className:"st-column-pin-pinned-mark st-column-pin-side st-column-pin-pinned-essential st-column-pin-pinned-active","aria-hidden":!0,title:"Pinned (essential)"},{children:Z})):"main"===m&&(K||U)?e.jsxs("div",exports.__assign({className:"st-column-pin-side-group"},{children:[K?e.jsx("button",exports.__assign({type:"button",className:"st-column-pin-btn st-column-pin-side st-column-pin-side-option","aria-label":"Pin column to left",title:"Pin to left",onClick:function(e){e.stopPropagation(),q()}},{children:M.pinnedLeftIcon})):null,U?e.jsx("button",exports.__assign({type:"button",className:"st-column-pin-btn st-column-pin-side st-column-pin-side-option","aria-label":"Pin column to right",title:"Pin to right",onClick:function(e){e.stopPropagation(),z()}},{children:M.pinnedRightIcon})):null]})):null:null,ne=e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:p.label})),te=void 0!==g&&!p.disableReorder&&!Fe(p,R);return e.jsxs(e.Fragment,{children:[0===g&&e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:-1===h?1:0}}),e.jsx("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:k},draggable:te,onDragStart:function(e){e.dataTransfer.effectAllowed="move",void 0!==g&&(null==o||o(),x(d[g]))},onDragEnter:function(e){e.preventDefault()},onDragOver:function(e){if(e.preventDefault(),void 0!==g&&s&&s.panelSection===m){var n=e.currentTarget.getBoundingClientRect(),t=function(e){var n,t,r=e.flattenedHeaders,o=e.draggingRow,i=e.hoveredRowIndex,a=e.isTopHalfOfRow,u=r[i];if(u.panelSection!==o.panelSection)return null;if(u.depth===o.depth)return(null===(n=u.parent)||void 0===n?void 0:n.accessor)!==(null===(t=o.parent)||void 0===t?void 0:t.accessor)?null:a||u.header.children?i-1:i;if(u.depth>o.depth){for(var l=u,s=i,c=function(){var e=l.parent.accessor,n=r.findIndex(function(n){return n.header.accessor===e});if(-1===n)return"break";l=r[n],s=n};l.parent&&l.depth>o.depth&&"break"!==c(););for(var d=s,f=s,v=s+1;r.length>v&&r[v].depth>l.depth;v++)f=v;var p=f-d+1,h=i-d,w=p/2>h;return p%2==1&&h===Math.floor(p/2)&&(w=a),w?s-1:f}return null}({flattenedHeaders:d,draggingRow:s,hoveredRowIndex:g,isTopHalfOfRow:n.top+n.height/2>e.clientY});y(t)}},onDragEnd:function(){var e=function(){x(null),y(null)};if(s&&null!==h&&s.panelSection===m){var n=d[h>s.visualIndex?h:h+1];if(n){if(n.depth>s.depth&&n.parent){var t=d.findIndex(function(e){return e.header.accessor===n.parent.accessor});-1!==t&&(n=d[t])}if(s.header.accessor!==n.header.accessor)if(s.indexPath.length!==n.indexPath.length||1!==s.indexPath.length&&!s.indexPath.slice(0,-1).every(function(e,t){return e===n.indexPath[t]}))e();else{var r;if(1===s.indexPath.length){var o=Je(S,s.indexPath,n.indexPath),i=o.newHeaders;if(o.emergencyBreak)return void e();r=i}else{var a=Je(Ke(S,s.indexPath),[s.indexPath[s.indexPath.length-1]],[n.indexPath[n.indexPath.length-1]]);if(i=a.newHeaders,a.emergencyBreak)return void e();r=Ue(ke(S),s.indexPath,i)}B(r),e()}else e()}else e()}else e()}},{children:C.rowRenderer?C.rowRenderer({accessor:p.accessor,header:p,panelSection:m,isEssential:A,canToggleVisibility:F,allowColumnPinning:T,pinControl:Q,components:{expandIcon:Y||void 0,checkbox:X,dragIcon:$,labelContent:ne,pinIcon:T&&null!=ee?ee:void 0}}):e.jsxs(e.Fragment,{children:[l&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:P?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(W?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),O()}},{children:M.expand})):null})),e.jsx(Xe,{checked:D,disabled:!F,onChange:_}),ee,e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:M.drag})),e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:p.label}))]})})),e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:h===g?1:0}})]})},rt=function(e,n){var t=n.toLowerCase();return!!e.label.toLowerCase().includes(t)||!(!e.children||0>=e.children.length)&&e.children.some(function(e){return rt(e,n)})};function ot(n){var t=n.panelSection,r=n.doesAnyHeaderHaveChildren,o=n.allHeaders,i=n.expandedHeaders,a=n.setExpandedHeaders,u=n.forceExpanded,l=n.draggingRow,s=n.setDraggingRow,c=n.hoverSep,d=n.setHoverSep,f=n.flattenedForSection,v=(null==c?void 0:c.section)===t?c.index:null,p=function(e){d(null===e?null:{section:t,index:e})};return e.jsxs("div",exports.__assign({className:"st-column-editor-section","data-panel-section":t},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-section-label"},{children:n.title})),e.jsx("div",exports.__assign({className:"st-column-editor-list st-column-editor-list-section"},{children:f.map(function(n){return e.jsx(tt,{allHeaders:o,clearHoverSeparator:function(){return d(null)},doesAnyHeaderHaveChildren:r,depth:n.depth,draggingRow:l,expandedHeaders:i,flattenedHeaders:f,forceExpanded:u,header:n.header,hoveredSeparatorIndex:v,panelSection:t,rowIndex:n.visualIndex,setDraggingRow:s,setExpandedHeaders:a,setHoveredSeparatorIndex:p},"".concat(t,"-").concat(n.header.accessor,"-").concat(n.visualIndex))})}))]}))}var it=function(t){var r=t.headers,o=t.open,i=t.searchEnabled,a=t.searchPlaceholder,l=t.searchFunction,s=t.customRenderer,c=J().resetColumns,d=n.useState(""),f=d[0],v=d[1],p=n.useState(null),h=p[0],w=p[1],m=n.useState(null),g=m[0],x=m[1],b=n.useState(function(){var e=new Set,n=function(t){t.forEach(function(t){t.children&&t.children.length>0&&(e.add(t.accessor),n(t.children))})};return n(r),e}),y=b[0],I=b[1],C=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]),R=n.useMemo(function(){return i?function(e,n,t){if(!n.trim())return e;var r=t||rt;return e.filter(function(e){return!e.isSelectionColumn&&!e.excludeFromRender&&r(e,n)})}(r,f,l):r},[r,f,i,l]),S=n.useMemo(function(){return Ae(R)},[R]),M=S.pinnedLeft,N=S.unpinned,H=S.pinnedRight,E=i&&f.trim().length>0,T=n.useMemo(function(){return nt({sectionRoots:M,fullRootHeaders:r,panelSection:"left",expandedHeaders:y,forceExpanded:E})},[M,r,y,E]),k=n.useMemo(function(){return nt({sectionRoots:N,fullRootHeaders:r,panelSection:"main",expandedHeaders:y,forceExpanded:E})},[N,r,y,E]),P=n.useMemo(function(){return nt({sectionRoots:H,fullRootHeaders:r,panelSection:"right",expandedHeaders:y,forceExpanded:E})},[H,r,y,E]),A=n.useMemo(function(){return u(u(u([],T,!0),k,!0),P,!0)},[T,k,P]),F=i?e.jsx("div",exports.__assign({className:"st-column-editor-search-wrapper"},{children:e.jsx("div",exports.__assign({className:"st-column-editor-search"},{children:e.jsx("input",{type:"text",value:f,onChange:function(e){return v(e.target.value)},placeholder:a,className:"st-filter-input",onClick:function(e){return e.stopPropagation()}})}))})):null,D=M.length>0?ot({title:"Pinned left",panelSection:"left",doesAnyHeaderHaveChildren:C,allHeaders:r,expandedHeaders:y,setExpandedHeaders:I,forceExpanded:E,draggingRow:h,setDraggingRow:w,hoverSep:g,setHoverSep:x,flattenedForSection:T}):null,L=ot({title:"Columns",panelSection:"main",doesAnyHeaderHaveChildren:C,allHeaders:r,expandedHeaders:y,setExpandedHeaders:I,forceExpanded:E,draggingRow:h,setDraggingRow:w,hoverSep:g,setHoverSep:x,flattenedForSection:k}),W=H.length>0?ot({title:"Pinned right",panelSection:"right",doesAnyHeaderHaveChildren:C,allHeaders:r,expandedHeaders:y,setExpandedHeaders:I,forceExpanded:E,draggingRow:h,setDraggingRow:w,hoverSep:g,setHoverSep:x,flattenedForSection:P}):null,O=e.jsxs("div",exports.__assign({className:"st-column-editor-lists"},{children:[D,L,W]})),B=s?s({searchSection:F,listSection:O,pinnedLeftList:D,unpinnedList:L,pinnedRightList:W,flattenedHeaders:A,searchTerm:f,setSearchTerm:v,searchEnabled:i,searchPlaceholder:a,headers:r,resetColumns:c}):e.jsxs(e.Fragment,{children:[F,O]});return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:B}))}))},at=function(n){var t=n.columnEditorConfig,r=n.headers,o=n.open,i=n.setOpen,a=t.text,u=t.searchEnabled,l=t.searchPlaceholder,c=t.searchFunction,d=t.customRenderer;return n.editColumns?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(o?"open":""),onClick:function(){i(!o)},style:{width:s}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:a})),e.jsx(it,{headers:r,open:o,searchEnabled:u,searchPlaceholder:l,searchFunction:c,customRenderer:d})]})):null},ut=function(t){var o=t.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},[]),s=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=i.current[n])||void 0===t||t.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)});s(n,e)}))})})})}},[l,u]),c=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))}),s(e,n)},[a,u,s]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var t=i.current[n].indexOf(e);-1!==t&&i.current[n].splice(t,1)}})},[a,l]);return e.jsx(ln.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:r.default.Children.only(o)}))},lt=function(e){var n=e.tableRows,t=e.filterState;return e.externalFilterHandling?n:t&&0!==Object.keys(t).length?n.filter(function(e){return Object.values(t).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===(e+"").trim();if("isNotEmpty"===t)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=(e+"").toLowerCase(),a=r?(r+"").toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(+e)){var u=+e,l=+r;switch(t){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 s=o.map(Number),c=s[1];return u>=s[0]&&c>=u}return!1;case"notBetween":if(o&&2===o.length){var d=o.map(Number);return c=d[1],d[0]>u||u>c}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=Ce(e),v=Ce((r||"")+""),p=Ie(f),h=Ie(v);switch(t){case"equals":return p.getTime()===h.getTime();case"notEquals":return p.getTime()!==h.getTime();case"before":return h>p;case"after":return p>h;case"between":if(o&&2===o.length){var w=o.map(function(e){return Ie(Ce((e||"")+""))}),m=w[1];return p>=w[0]&&m>=p}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(e){return Ie(Ce((e||"")+""))});return m=g[1],g[0]>p||p>m}return!0}}if("boolean"==typeof e&&"equals"===t)return e===!!r;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"===t||"notIn"===t){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===t?b:!b}return!1}var y=(e+"").toLowerCase(),I=r?(r+"").toLowerCase():"";switch(t){case"equals":return y===I;case"notEquals":return y!==I;default:return!0}}(R(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},st=function(e){var n,t=document.querySelector(".simple-table-root");if("string"==typeof e){if(e.endsWith("px"))return parseInt(e,10);if(e.endsWith("vh"))return window.innerHeight*parseInt(e,10)/100;if(e.endsWith("%")){var r=null===(n=null==t?void 0:t.parentElement)||void 0===n?void 0:n.clientHeight;return!r||50>r?0:r*parseInt(e,10)/100}return window.innerHeight}return e},ct=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;if(r&&t&&M(t))i(t);else{var a=R(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,u=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===t.type?o.length:void 0;switch(t.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 t.formatResult?t.formatResult(a):a}},dt=function(e){var t=e.effectiveHeaders,r=e.headerHeight,o=e.rowHeight,i=e.tableBodyContainerRef,a=n.useState(0),u=a[0],l=a[1],s=n.useCallback(function(e){var n,t;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(t=e.children)||void 0===t?void 0:t.length)?1+Math.max.apply(Math,e.children.map(s)):1},[]),c=n.useMemo(function(){var e=0;return t.forEach(function(n){var t=s(n);e=Math.max(e,t)}),e},[t,s]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,t=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(t){var i=parseFloat(t);isNaN(i)||(e=i)}}return c*(null!=r?r:o)+e},[c,r,o]);return n.useLayoutEffect(function(){var e=function(e,n){void 0===n&&(n=150);var t=null,r=null,o=null,i=function(){null!==r&&clearTimeout(r),r=setTimeout(function(){r=null,function(){if(null!==t){var n=t;t=null,e(n)}}()},n)};return{notify:function(e){t=e,i()},notifyFromObserver:function(e){null!==o&&cancelAnimationFrame(o),o=requestAnimationFrame(function(){o=null,t=e(),i()})},publishImmediately:function(n){null!==r&&(clearTimeout(r),r=null),t=null,e(n)},destroy:function(){null!==r&&(clearTimeout(r),r=null),null!==o&&(cancelAnimationFrame(o),o=null),t=null}}}(function(e){l(function(n){return n===e?n:(function(){var e,n=window.__containerResizePerf;n&&(n.containerWidthStateUpdates=(null!==(e=n.containerWidthStateUpdates)&&void 0!==e?e:0)+1,window.dispatchEvent(new CustomEvent("st-container-width-update")))}(),e)})}),n=function(){var e,n;return null!==(n=null===(e=i.current)||void 0===e?void 0:e.clientWidth)&&void 0!==n?n:0},t=n();t>0&&e.publishImmediately(t);var r=null,o=i.current;return o&&"undefined"!=typeof ResizeObserver&&(r=new ResizeObserver(function(){e.notifyFromObserver(n)})).observe(o),function(){null==r||r.disconnect(),e.destroy()}},[i]),{containerWidth:u,calculatedHeaderHeight:d,maxHeaderDepth:c}},ft=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},vt=function(e){return function(){for(var n=[],t=0;arguments.length>t;t++)n[t]=arguments[t];return new Promise(function(t){e.apply(void 0,n),setTimeout(function(){return t()},0)})}},pt=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},ht={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}},wt=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")},mt=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){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(){wt(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},gt=[],xt=function(e){var t=e.rows,r=e.rowGrouping,o=void 0===r?gt:r,i=e.getRowId,a=e.expandedRows,l=e.collapsedRows,s=e.expandedDepths,c=e.rowStateMap,d=e.hasLoadingRenderer,f=e.hasErrorRenderer,v=e.hasEmptyRenderer,p=e.headers,h=e.rowHeight,w=e.headerHeight,m=e.customTheme;return n.useMemo(function(){if(!o||0===o.length){var e=t.map(function(e,n){var t=[n],r=[n];return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowId:N({row:e,getRowId:i,depth:0,index:n,rowPath:t,rowIndexPath:r,groupingKey:void 0}),rowPath:t,rowIndexPath:r,absoluteRowIndex:n,isLastGroupRow:!1}});return{flattenedRows:e,heightOffsets:[],paginatableRows:e,parentEndPositions:t.map(function(e,n){return n+1})}}var n=[],r=[],g=[],x=[],b=0,C=function(e,t,R,S,M){void 0===R&&(R=[]),void 0===S&&(S=[]),void 0===M&&(M=[]),e.forEach(function(e,k){var P,A,F=o[t],D=n.length,L=u(u([],R,!0),[k],!1),W=u(u([],S,!0),[k],!1),O=N({row:e,getRowId:i,depth:t,index:k,rowPath:L,rowIndexPath:W,groupingKey:F}),B=n.length,q={row:e,depth:t,displayPosition:b,groupingKey:F,position:D,isLastGroupRow:0===t,rowId:O,rowPath:L,rowIndexPath:W,absoluteRowIndex:D,parentIndices:M.length>0?u([],M,!0):void 0};n.push(q),r.push(q),b++;var z=H(O);if(T(z,t,s,a,l)&&o.length>t){var G=null==c?void 0:c.get(z),V=E(e,F),j=p.find(function(e){return e.expandable&&e.nestedTable});if((null==j?void 0:j.nestedTable)&&V.length>0){var K=n.length,U=(null===(P=j.nestedTable.customTheme)||void 0===P?void 0:P.rowHeight)||h,_=(null===(A=j.nestedTable.customTheme)||void 0===A?void 0:A.headerHeight)||w,J=y({childRowCount:V.length,rowHeight:U,headerHeight:_,customTheme:m}),Y=I({calculatedHeight:J,customHeight:j.nestedTable.height,customTheme:m});g.push([K,Y-h]);var X=u(u([],L,!0),[F],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:F,position:K,isLastGroupRow:!1,rowId:X,rowPath:X,rowIndexPath:W,nestedTable:{parentRow:e,expandableHeader:j,childAccessor:F,calculatedHeight:Y},absoluteRowIndex:K})}else if(G&&(G.loading||G.error||G.isEmpty)){if(G.loading&&d||G.error&&f||G.isEmpty&&v){var $=n.length,Q=u(u([],L,!0),[F],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:F,position:$,isLastGroupRow:!1,rowId:Q,rowPath:Q,rowIndexPath:W,stateIndicator:{parentRowId:z,parentRow:e,state:G},absoluteRowIndex:$,parentIndices:u(u([],M,!0),[B],!1)})}else if(G.loading&&!d){var Z=n.length,ee=u(u([],L,!0),[F,"loading-skeleton"],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:F,position:Z,isLastGroupRow:!1,rowId:ee,rowPath:ee,rowIndexPath:W,isLoadingSkeleton:!0,absoluteRowIndex:Z,parentIndices:u(u([],M,!0),[B],!1)})}}else if(V.length>0){var ne=u(u([],L,!0),[F],!1),te=u([],W,!0);C(V,t+1,ne,te,u(u([],M,!0),[B],!1))}}0===t&&x.push(n.length)})};return C(t,0,[],[],[]),{flattenedRows:n,heightOffsets:g,paginatableRows:r,parentEndPositions:x}},[t,o,i,a,l,s,c,d,f,v,p,h,w,m])},bt={rowHeight:32,headerHeight:32,footerHeight:49,rowSeparatorWidth:1,borderWidth:1,pinnedBorderWidth:1,nestedGridBorderWidth:2,nestedGridPaddingTop:8,nestedGridPaddingBottom:8,nestedGridPaddingLeft:8,nestedGridPaddingRight:8,nestedGridMaxHeight:400,selectionColumnWidth:42},yt={text:"Columns",searchEnabled:!0,searchPlaceholder:"Search columns...",allowColumnPinning:!0},It=[{propName:"columnEditorText",replacement:"columnEditorConfig.text",message:"Use the columnEditorConfig object instead for better organization of column editor settings."},{propName:"expandIcon",replacement:"icons.expand",message:"Use the icons object instead for better organization of icon settings."},{propName:"filterIcon",replacement:"icons.filter",message:"Use the icons object instead for better organization of icon settings."},{propName:"headerCollapseIcon",replacement:"icons.headerCollapse",message:"Use the icons object instead for better organization of icon settings."},{propName:"headerExpandIcon",replacement:"icons.headerExpand",message:"Use the icons object instead for better organization of icon settings."},{propName:"nextIcon",replacement:"icons.next",message:"Use the icons object instead for better organization of icon settings."},{propName:"prevIcon",replacement:"icons.prev",message:"Use the icons object instead for better organization of icon settings."},{propName:"sortDownIcon",replacement:"icons.sortDown",message:"Use the icons object instead for better organization of icon settings."},{propName:"sortUpIcon",replacement:"icons.sortUp",message:"Use the icons object instead for better organization of icon settings."}],Ct=function(e,n){var t=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?t.push.apply(t,Ct(e.children,null!=n?n:e.pinned)):t.push(e))}),t},Rt=function(e,n){return n>=e.reduce(function(e,n){return e+D(n)},0)},St=function(e,n){var t=new Map,r=e.reduce(function(e,n){return e+("number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150)},0);if(0===r)return t;var o=n/r;if(.01>Math.abs(o-1))return t;var i=0;return e.forEach(function(r,a){var u,l="number"==typeof r.width?r.width:"string"==typeof r.width&&r.width.endsWith("px")?parseFloat(r.width):150;a===e.length-1?u=n-i:i+=u=Math.round(l*o),t.set(r.accessor,u)}),t},Mt=function(e,n){var t,r=n.containerWidth,o=n.pinnedLeftWidth,i=n.pinnedRightWidth,a=n.mainBodyRef;if(!n.autoExpandColumns||0===r||n.isResizing)return e;t=a.current?a.current.clientWidth:Math.max(0,r-o-i);var u=e.filter(function(e){return"left"===e.pinned}),l=e.filter(function(e){return"right"===e.pinned}),s=e.filter(function(e){return!e.pinned}),c=Ct(u,"left"),d=Ct(l,"right"),f=Ct(s,void 0),v=c.length>0&&Rt(c,o),p=d.length>0&&Rt(d,i),h=f.length>0&&t>0&&Rt(f,t),w=new Map;if(v&&St(c,o).forEach(function(e,n){return w.set(n,e)}),p&&St(d,i).forEach(function(e,n){return w.set(n,e)}),h&&St(f,t).forEach(function(e,n){return w.set(n,e)}),0===w.size)return e;var m=function(e,n){var t;if(e.hide)return e;var r=null!=n?n:e.pinned,o=null===(t=e.children)||void 0===t?void 0:t.map(function(e){return m(e,r)});if(!e.children||0===e.children.length){var i=w.get(e.accessor);return void 0!==i?exports.__assign(exports.__assign({},e),{width:i,children:o}):exports.__assign(exports.__assign({},e),{children:o})}return exports.__assign(exports.__assign({},e),{children:o})};return e.map(function(e){return m(e,e.pinned)})},Nt=e.jsx(function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},{}),Ht=function(t){var r=n.useState(!1),o=r[0],i=r[1];return n.useEffect(function(){!function(e){"production"!==process.env.NODE_ENV&&It.forEach(function(n){var t=n.propName,r=n.replacement,o=n.message;if(void 0!==e[t]){var i='SimpleTable: The "'.concat(t,'" prop is deprecated and will be removed in a future version.'),a='Please use "'.concat(r,'" instead.'),u=o?"\n".concat(o):"",l=r.split("."),s=l[0],c=l[1],d="string"==typeof e[t]?JSON.stringify(e[t]):"<YourIcon />";console.error("".concat(i,"\n").concat(a).concat(u,"\n\nExample:\n<SimpleTable\n ").concat(s,"={{\n ").concat(c,": ").concat(d,"\n }}\n/>"))}})}(t)},[]),n.useEffect(function(){i(!0)},[]),o?e.jsx(Et,exports.__assign({},t)):null},Et=function(t){var r=t.allowAnimations,o=void 0!==r&&r,s=t.autoExpandColumns,c=void 0!==s&&s,d=t.canExpandRowGroup,f=t.cellUpdateFlash,v=void 0!==f&&f,p=t.className,w=t.columnBorders,m=void 0!==w&&w,g=t.columnEditorConfig,x=void 0===g?yt:g,y=t.columnEditorText,I=t.columnReordering,C=void 0!==I&&I,E=t.columnResizing,T=void 0!==E&&E,A=t.copyHeadersToClipboard,F=void 0!==A&&A,D=t.customTheme,L=t.defaultHeaders,W=t.editColumns,O=void 0!==W&&W,q=t.editColumnsInitOpen,z=void 0!==q&&q,V=t.emptyStateRenderer,U=t.enableHeaderEditing,J=void 0!==U&&U,Y=t.enableRowSelection,$=void 0!==Y&&Y,te=t.enableStickyParents,ae=void 0!==te&&te,le=t.errorStateRenderer,se=t.expandAll,ce=void 0===se||se,de=t.expandIcon,fe=t.externalFilterHandling,ve=void 0!==fe&&fe,pe=t.externalSortHandling,he=void 0!==pe&&pe,we=t.filterIcon,me=t.footerRenderer,ge=t.headerCollapseIcon,xe=t.headerDropdown,be=t.headerExpandIcon,ye=t.height,Ie=t.hideFooter,Ce=void 0!==Ie&&Ie,Re=t.hideHeader,Se=void 0!==Re&&Re,Me=t.icons,Ne=t.includeHeadersInCSVExport,He=void 0===Ne||Ne,Ee=t.initialSortColumn,Pe=t.initialSortDirection,Ae=void 0===Pe?"asc":Pe,De=t.isLoading,Le=void 0!==De&&De,We=t.loadingStateRenderer,Be=t.maxHeight,ze=t.nextIcon,Ge=t.onCellClick,Ve=t.onCellEdit,je=t.onColumnOrderChange,Ke=t.onColumnSelect,Ue=t.onColumnVisibilityChange,_e=t.onColumnWidthChange,Je=t.onFilterChange,Ye=t.onGridReady,Xe=t.onHeaderEdit,$e=t.onLoadMore,Qe=t.onNextPage,Ze=t.onPageChange,en=t.onRowGroupExpand,nn=t.onRowSelectionChange,tn=t.onSortChange,rn=t.prevIcon,on=t.quickFilter,an=t.rowButtons,un=t.rowGrouping,ln=t.getRowId,sn=t.rows,cn=t.rowsPerPage,dn=void 0===cn?10:cn,fn=t.selectableCells,vn=void 0!==fn&&fn,pn=t.selectableColumns,hn=void 0!==pn&&pn,wn=t.serverSidePagination,mn=void 0!==wn&&wn,gn=t.shouldPaginate,xn=void 0!==gn&&gn,bn=t.sortDownIcon,In=t.sortUpIcon,Cn=t.tableEmptyStateRenderer,Rn=void 0===Cn?Nt:Cn,Sn=t.tableRef,Mn=t.theme,Nn=void 0===Mn?"modern-light":Mn,Hn=t.totalRowCount,En=t.useHoverRowBackground,Tn=void 0===En||En,kn=t.useOddColumnBackground,Pn=void 0!==kn&&kn,An=t.useOddEvenRowBackground,Fn=void 0!==An&&An,Dn=n.useMemo(function(){var n,t,r,o,i,a,u,l,s,c,d,f,v,p,h,w,m,g,x,b={drag:e.jsx(oe,{className:"st-drag-icon"}),expand:e.jsx(ee,{className:"st-expand-icon"}),filter:e.jsx(ie,{className:"st-header-icon"}),headerCollapse:e.jsx(ee,{className:"st-header-icon"}),headerExpand:e.jsx(Z,{className:"st-header-icon"}),next:e.jsx(ee,{className:"st-next-prev-icon"}),prev:e.jsx(Z,{className:"st-next-prev-icon"}),sortDown:e.jsx(re,{className:"st-header-icon"}),sortUp:e.jsx(ne,{className:"st-header-icon"}),pinnedLeftIcon:e.jsx("div",{children:"L"}),pinnedRightIcon:e.jsx("div",{children:"R"})};return{drag:null!==(n=null==Me?void 0:Me.drag)&&void 0!==n?n:b.drag,expand:null!==(r=null!==(t=null==Me?void 0:Me.expand)&&void 0!==t?t:de)&&void 0!==r?r:b.expand,filter:null!==(i=null!==(o=null==Me?void 0:Me.filter)&&void 0!==o?o:we)&&void 0!==i?i:b.filter,headerCollapse:null!==(u=null!==(a=null==Me?void 0:Me.headerCollapse)&&void 0!==a?a:ge)&&void 0!==u?u:b.headerCollapse,headerExpand:null!==(s=null!==(l=null==Me?void 0:Me.headerExpand)&&void 0!==l?l:be)&&void 0!==s?s:b.headerExpand,next:null!==(d=null!==(c=null==Me?void 0:Me.next)&&void 0!==c?c:ze)&&void 0!==d?d:b.next,prev:null!==(v=null!==(f=null==Me?void 0:Me.prev)&&void 0!==f?f:rn)&&void 0!==v?v:b.prev,sortDown:null!==(h=null!==(p=null==Me?void 0:Me.sortDown)&&void 0!==p?p:bn)&&void 0!==h?h:b.sortDown,sortUp:null!==(m=null!==(w=null==Me?void 0:Me.sortUp)&&void 0!==w?w:In)&&void 0!==m?m:b.sortUp,pinnedLeftIcon:null!==(g=null==Me?void 0:Me.pinnedLeftIcon)&&void 0!==g?g:b.pinnedLeftIcon,pinnedRightIcon:null!==(x=null==Me?void 0:Me.pinnedRightIcon)&&void 0!==x?x:b.pinnedRightIcon}},[Me,de,we,ge,be,ze,rn,bn,In]),Ln=n.useMemo(function(){return exports.__assign(exports.__assign({},bt),D)},[D]),Wn=n.useMemo(function(){var e,n,t,r,o;return{text:null!==(n=null!==(e=null==x?void 0:x.text)&&void 0!==e?e:y)&&void 0!==n?n:yt.text,searchEnabled:null!==(t=null==x?void 0:x.searchEnabled)&&void 0!==t?t:yt.searchEnabled,searchPlaceholder:null!==(r=null==x?void 0:x.searchPlaceholder)&&void 0!==r?r:yt.searchPlaceholder,allowColumnPinning:null!==(o=null==x?void 0:x.allowColumnPinning)&&void 0!==o?o:yt.allowColumnPinning,searchFunction:null==x?void 0:x.searchFunction,rowRenderer:null==x?void 0:x.rowRenderer,customRenderer:null==x?void 0:x.customRenderer}},[x,y]),On=Ln.rowHeight,Bn=Ln.headerHeight,qn=Ln.footerHeight,zn=Ln.selectionColumnWidth;Pn&&(Fn=!1),m&&(Tn=!1);var Gn=n.useRef(null),Vn=n.useRef(null),jn=n.useRef(null),Kn=n.useRef(null),Jn=n.useRef(null),Qn=n.useRef(null),Zn=n.useRef(null),et=n.useReducer(function(e){return e+1},0)[1],nt=n.useState(new Map),tt=nt[0],rt=nt[1],ot=n.useState(sn),it=ot[0],pt=ot[1],wt=n.useState(Le),mt=wt[0],gt=wt[1],It=n.useRef(Le),Ct=n.useRef(new Map);n.useEffect(function(){pt(sn);var e=new Map;sn.forEach(function(n,t){var r=N({row:n,getRowId:ln,depth:0,index:t,rowPath:[t],rowIndexPath:[t]}),o=H(r);e.set(o,t)}),Ct.current=e},[sn,ln]),n.useEffect(function(){var e=It.current,n=Le;n&&!e?gt(!0):!n&&e&&setTimeout(function(){gt(!1)},0),It.current=Le},[Le]);var Rt,St,Ht,Et,Tt,kt,Pt,At,Ft,Dt,Lt=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){t.current&&i(t.current.offsetWidth-t.current.clientWidth)},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:Qn}),Wt=Lt.scrollbarWidth,Ot=Lt.setScrollbarWidth,Bt=ue({headerContainerRef:Zn,mainSectionRef:Qn,scrollbarWidth:Wt}).isMainSectionScrollable,qt=n.useMemo(function(){if(mt&&0===it.length){var e=xn?dn:10;return Bt&&(e+=1),Array.from({length:e},function(e,n){return{}})}return it},[mt,it,dn,Bt,xn]),zt=n.useMemo(function(){return ke(L)},[L]),Gt=n.useState(1),Vt=Gt[0],jt=Gt[1],Kt=n.useState(zt),Ut=Kt[0],_t=Kt[1],Jt=n.useState(!1),Yt=Jt[0],Xt=Jt[1],$t=n.useState(null),Qt=$t[0],Zt=$t[1],er=n.useState(z),nr=er[0],tr=er[1],rr=n.useCallback(function(){var e=new Set,n=function(t){t.forEach(function(t){t.collapseDefault&&t.collapsible&&e.add(t.accessor),t.children&&n(t.children)})};return n(zt),e},[zt]),or=n.useState(rr),ir=or[0],ar=or[1];n.useEffect(function(){_t(zt)},[zt]);var ur=n.useMemo(function(){var e,n=u([],Ut,!0);return $&&!(null===(e=null==Ut?void 0:Ut[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:zn,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[$,Ut,zn]),lr=n.useMemo(function(){return function(e){var n=new Set,t=function(e){for(var r,o=0,i=e;i.length>o;o++){var a=i[o];a.isEssential&&n.add(a.accessor+""),(null===(r=a.children)||void 0===r?void 0:r.length)&&t(a.children)}};return t(e),n}(ur)},[ur]),sr=n.useState(0),cr=sr[0],dr=sr[1],fr=n.useState("none"),vr=fr[0],pr=fr[1],hr=function(e,t){var r=n.useState(function(){return function(e,n){if(!n||0===n.length)return new Set;if(e){var t=Array.from({length:n.length},function(e,n){return n});return new Set(t)}return new Set}(e,t)}),o=r[0],i=r[1];return n.useEffect(function(){i(t&&0!==t.length?function(e){var n=t.length,r=Array.from(e).filter(function(e){return n>e});return new Set(r)}:new Set)},[t]),{expandedDepths:o,setExpandedDepths:i}}(ce,un),wr=hr.expandedDepths,mr=hr.setExpandedDepths,gr=n.useState(new Map),xr=gr[0],br=gr[1],yr=n.useState(new Map),Ir=yr[0],Cr=yr[1],Rr=function(){var e=n.useState(""),t=e[0],r=e[1],o=n.useRef(null);n.useEffect(function(){return t&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){r("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[t]);var i=n.useCallback(function(e){r(e)},[]);return{announcement:t,announce:i}}(),Sr=Rr.announcement,Mr=Rr.announce,Nr=dt({effectiveHeaders:ur,headerHeight:Bn,rowHeight:On,tableBodyContainerRef:Qn}),Hr=Nr.containerWidth,Er=Nr.calculatedHeaderHeight,Tr=Nr.maxHeaderDepth,kr=n.useMemo(function(){var e=yn({headers:ur,containerWidth:Hr,collapsedHeaders:ir});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth,pinnedLeftContentWidth:e.leftContentWidth,pinnedRightContentWidth:e.rightContentWidth}},[ur,Hr,ir]),Pr=kr.mainBodyWidth,Ar=kr.pinnedLeftWidth,Fr=kr.pinnedRightWidth,Dr=kr.pinnedLeftContentWidth,Lr=kr.pinnedRightContentWidth,Wr=function(e){var t=e.autoExpandColumns,r=e.containerWidth,o=e.pinnedLeftWidth,i=e.pinnedRightWidth,a=e.mainBodyRef,u=e.isResizing,l=e.setHeaders,s=n.useRef({autoExpandColumns:t,containerWidth:r,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u});s.current={autoExpandColumns:t,containerWidth:r,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u};var c=n.useCallback(function(e){l(function(n){var t="function"==typeof e?e(n):e;return Mt(t,s.current)})},[l]),d=n.useRef(u);n.useEffect(function(){d.current&&!u&&t&&l(function(e){return Mt(e,s.current)}),d.current=u},[u,t,l]);var f=n.useRef(r);return n.useEffect(function(){r>0&&r!==f.current&&!u&&t&&l(function(e){return Mt(e,s.current)}),f.current=r},[r,u,t,l]),c}({autoExpandColumns:c,containerWidth:Hr,pinnedLeftWidth:Ar,pinnedRightWidth:Fr,mainBodyRef:jn,isResizing:Yt,setHeaders:_t}),Or=function(e){var t=e.rows,r=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return t;var e=function(e){return h(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=o[t],a=o[t+1],u=n[r];if(u&&M(u)){var l=i(u,t+1),s=exports.__assign({},n);return s[r]=l,e.forEach(function(e){var n=ct(l,e.accessor,e.aggregation,a);void 0!==n&&S(s,e.accessor,n)}),s}return n})};return i(n)},[t,r,o])}({rows:qt,headers:Ut,rowGrouping:un}),Br=function(e){var t=e.rows,r=e.headers,o=e.quickFilter;return n.useMemo(function(){if(!o||!o.text||""===o.text.trim())return t;var e=o.text,n=o.columns,i=o.caseSensitive,a=void 0!==i&&i,u=o.mode,l=void 0===u?"simple":u,s=o.useFormattedValue,c=void 0===s||s,d=r.filter(function(e){return!e.hide&&!e.excludeFromRender&&(n&&n.length>0?n.includes(e.accessor):!1!==e.quickFilterable)}),f="smart"===l?function(e){for(var n=[],t=0;e.length>t;){for(;e.length>t&&/\s/.test(e[t]);)t++;if(t>=e.length)break;if("-"!==e[t])if('"'!==e[t]){for(var r=t;e.length>t&&!/[\s:]/.test(e[t]);)t++;var o=e.substring(r,t);if(e.length>t&&":"===e[t]){for(var i=++t;e.length>t&&!/\s/.test(e[t]);)t++;(l=e.substring(i,t))&&n.push({type:"columnSpecific",value:l,column:o})}else o&&n.push({type:"word",value:o})}else{for(var a=++t;e.length>t&&'"'!==e[t];)t++;(l=e.substring(a,t))&&n.push({type:"phrase",value:l}),e.length>t&&'"'===e[t]&&t++}else{for(var u=++t;e.length>t&&!/\s/.test(e[t]);)t++;var l;(l=e.substring(u,t))&&n.push({type:"negation",value:l})}}return n}(e):null;return t.filter(function(n){if("smart"===l&&f){var t=new Set,r=new Map;f.forEach(function(e,n){"columnSpecific"===e.type&&e.column&&(r.has(e.column)||r.set(e.column,[]),r.get(e.column).push(n))});var o=[];d.forEach(function(e){try{var i;if(e.quickFilterGetter)i=e.quickFilterGetter({row:n,accessor:e.accessor});else{var u=R(n,e.accessor);if(c&&e.valueFormatter){var l=e.valueFormatter({accessor:e.accessor,colIndex:0,row:n,rowIndex:0,value:u});i=Array.isArray(l)?l.join(" "):l+""}else i=null==u?"":Array.isArray(u)?u.join(" "):u+""}o.push(i);var s=r.get(e.accessor);s&&s.forEach(function(e){var n=f[e],r=a?i:i.toLowerCase(),o=a?n.value:n.value.toLowerCase();r.includes(o)&&t.add(e)})}catch(n){console.warn("Quick filter error for column ".concat(e.accessor,":"),n)}});var i=a?o.join(" "):o.join(" ").toLowerCase();return f.forEach(function(e,n){if("columnSpecific"!==e.type){var r=a?e.value:e.value.toLowerCase();switch(e.type){case"word":case"phrase":i.includes(r)&&t.add(n);break;case"negation":i.includes(r)||t.add(n)}}}),t.size===f.length}return d.some(function(t){try{var r=void 0;if(t.quickFilterGetter)r=t.quickFilterGetter({row:n,accessor:t.accessor});else{var o=R(n,t.accessor);if(c&&t.valueFormatter){var i=t.valueFormatter({accessor:t.accessor,colIndex:0,row:n,rowIndex:0,value:o});r=Array.isArray(i)?i.join(" "):i+""}else r=null==o?"":Array.isArray(o)?o.join(" "):o+""}return function(e,n,t){if(!n)return!0;var r=t?e:e.toLowerCase(),o=t?n:n.toLowerCase();return r.includes(o)}(r,e,a)}catch(e){return console.warn("Quick filter error for column ".concat(t.accessor,":"),e),!1}})})},[t,r,o])}({rows:Or,headers:ur,quickFilter:on}),qr=function(e){var t=e.rows,r=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],s=u[1],c=Xn(r),d=n.useMemo(function(){return lt({externalFilterHandling:o,tableRows:t,filterState:l})},[t,l,o]),f=n.useCallback(function(e){var n,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(s(t),null==i||i(t),a){var r=c.get(e.accessor);r&&a("Filter applied to ".concat(r.label))}},[l,i,a,c]),v=n.useCallback(function(e){var n=exports.__assign({},l);if(delete n[e],s(n),null==i||i(n),a){var t=c.get(e);t&&a("Filter removed from ".concat(t.label))}},[l,i,a,c]),p=n.useCallback(function(){s({}),null==i||i({}),a&&a("All filters cleared")},[i,a]),h=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return lt({externalFilterHandling:o,tableRows:t,filterState:r})},[l,t,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Br,headers:ur,externalFilterHandling:ve,onFilterChange:Je,announce:Mr}),zr=qr.filters,Gr=qr.updateFilter,Vr=qr.clearFilter,jr=qr.clearAllFilters,Kr=qr.computeFilteredRowsPreview,Ur=function(e){var t=e.headers,r=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,s=e.announce,c=Xn(t),d=n.useCallback(function(){if(!u)return null;var e=c.get(u);return e?{key:e,direction:l||"asc"}:null},[c,u,l]),f=n.useState(d),v=f[0],p=f[1],h=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.sortColumn,o=Yn({headers:t,rows:e.rows,sortColumn:r});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(M(a)){var u=h({rows:a,sortColumn:r,headers:t,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return $n({externalSortHandling:o,tableRows:r,sortColumn:v,rowGrouping:a,headers:t,sortNestedRows:h})},[r,v,t,o,a,h]),m=n.useCallback(function(e){if(!e)return p(null),void(null==i||i(null));var n=e.accessor,t=e.direction,r=c.get(n);if(r){var o=null;if(t)o={key:r,direction:t};else{var a=r.sortingOrder||["asc","desc",null],u=-1;v&&v.key.accessor===n&&(u=a.indexOf(v.direction));var l=a[(u+1)%a.length];o=null===l?null:{key:r,direction:l}}if(p(o),null==i||i(o),s)if(o){var d="asc"===o.direction?"ascending":"descending";s("Sorted by ".concat(r.label,", ").concat(d))}else s("Sort removed from ".concat(r.label))}},[v,c,i,s]),g=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;o.length>r;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(t);if(!i)return r;var u=i.sortingOrder||["asc","desc",null],l=-1;v&&v.key.accessor===e&&(l=u.indexOf(v.direction));var s=u[(l+1)%u.length];return $n({externalSortHandling:o,tableRows:r,sortColumn:null===s?null:{key:i,direction:s},rowGrouping:a,headers:t,sortNestedRows:h})},[v,t,r,o,a,h]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:g}}({headers:Ut,tableRows:qr.filteredRows,externalSortHandling:he,onSortChange:tn,rowGrouping:un,initialSortColumn:Ee,initialSortDirection:Ae,announce:Mr}),_r=Ur.sort,Jr=Ur.updateSort,Yr=Ur.computeSortedRowsPreview,Xr=xt({rows:Ur.sortedRows,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}),$r=Xr.flattenedRows,Qr=Xr.heightOffsets,Zr=Xr.paginatableRows,eo=Xr.parentEndPositions,no=function(e){var t=e.tableRows,r=e.onRowSelectionChange,o=e.enableRowSelection,i=void 0!==o&&o,a=n.useState(new Set),u=a[0],l=a[1],s=n.useCallback(function(e){return!!i&&function(e,n){return n.has(e)}(e,u)},[u,i]),c=n.useCallback(function(){return!!i&&function(e,n){return 0!==e.length&&e.filter(function(e){return e&&e.rowId}).every(function(e){return n.has(H(e.rowId))})}(t,u)},[t,u,i]),d=n.useMemo(function(){return i?function(e){return e.size}(u):0},[u,i]),f=n.useMemo(function(){return i?function(e,n){return e.filter(function(e){return!(!e||!e.rowId)&&n.has(H(e.rowId))}).map(function(e){return e.row})}(t,u):[]},[t,u,i]),v=n.useCallback(function(e,n){if(i){var o=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(l(o),r){var a=t.find(function(n){return H(n.rowId)===e});a&&r({row:a.row,isSelected:n,selectedRows:o})}}},[u,t,r,i]),p=n.useCallback(function(e){var n;i&&(e?(n=function(e){return new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}))}(t),r&&t.forEach(function(e){return r({row:e.row,isSelected:!0,selectedRows:n})})):(n=new Set,r&&u.forEach(function(e){var o=t.find(function(n){return H(n.rowId)===e});o&&r({row:o.row,isSelected:!1,selectedRows:n})})),l(n))},[t,r,u,i]),h=n.useCallback(function(e){if(i){var n=s(e);v(e,!n)}},[s,v,i]),w=n.useCallback(function(){if(i){if(r){var e=new Set;u.forEach(function(n){var o=t.find(function(e){return H(e.rowId)===n});o&&r({row:o.row,isSelected:!1,selectedRows:e})})}l(new Set)}},[u,t,r,i]);return{selectedRows:u,setSelectedRows:l,isRowSelected:s,areAllRowsSelected:c,selectedRowCount:d,selectedRowsData:f,handleRowSelect:v,handleSelectAll:p,handleToggleRow:h,clearSelection:w}}({tableRows:$r,onRowSelectionChange:nn,enableRowSelection:$});Rt=no.selectedRows,St=no.setSelectedRows,Ht=no.isRowSelected,Et=no.areAllRowsSelected,Tt=no.selectedRowCount,kt=no.selectedRowsData,Pt=no.handleRowSelect,At=no.handleSelectAll,Ft=no.handleToggleRow,Dt=no.clearSelection;var to=xt({rows:Or,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}).flattenedRows,ro=n.useCallback(function(e){var n=Kr(e);return un&&0!==un.length?k({rows:n,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Kr,un,ln,xr,Ir,wr,tt,We,le,V,ur,On,Bn,Ln]),oo=n.useCallback(function(e){var n=Yr(e);return un&&0!==un.length?k({rows:n,rowGrouping:un,getRowId:ln,expandedRows:xr,collapsedRows:Ir,expandedDepths:wr,rowStateMap:tt,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!V,headers:ur,rowHeight:On,headerHeight:Bn,customTheme:Ln}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Yr,un,ln,xr,Ir,wr,tt,We,le,V,ur,On,Bn,Ln]),io=function(e){var t=e.height,r=e.maxHeight,o=e.rowHeight,i=e.totalRowCount,a=e.headerHeight,u=e.footerHeight;return n.useMemo(function(){if(r){var e=st(r);if(0===e)return;var n=a||o;if(e>=n+i*o+(u||0))return;return Math.max(0,e-n)}if(t){var l=st(t);if(0!==l)return Math.max(0,l-o)}},[t,r,o,i,a,u])}({height:ye,maxHeight:Be,rowHeight:On,shouldPaginate:xn,rowsPerPage:dn,totalRowCount:null!=Hn?Hn:Zr.length,headerHeight:Er,footerHeight:xn&&!Ce?qn:void 0}),ao=function(e){var t=e.allowAnimations,r=e.computeFilteredRowsPreview,o=e.computeSortedRowsPreview,i=e.contentHeight,a=e.currentPage,s=e.customTheme,c=e.enableStickyParents,d=e.flattenedRows,f=e.heightOffsets,v=e.originalFlattenedRows,p=e.parentEndPositions,h=e.rowHeight,w=e.rowsPerPage,m=e.scrollDirection,g=void 0===m?"none":m,x=e.scrollTop,b=e.serverSidePagination,y=e.shouldPaginate,I=e.rowGrouping,C=n.useState(!1),R=C[0],S=C[1],M=n.useState([]),N=M[0],E=M[1],T=n.useRef([]),k=n.useRef([]),P=n.useMemo(function(){return l(h)},[h]),A=n.useRef(new Map),F=n.useRef(null),D=n.useCallback(function(e,n){if(!y||b)return e.map(function(e,n){return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:n})});var t=(a-1)*w,r=a*w,o=0===t?0:n[t-1];return e.slice(o,r>n.length?e.length:n[r-1]).map(function(e,n){var t=e.nestedTable?e.absoluteRowIndex:y&&!b?o+n:n;return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:t})})},[a,w,b,y]);n.useMemo(function(){if(0===A.current.size&&v.length>0){var e=new Map;v.forEach(function(n,t){var r=H(n.rowId);e.set(r,t)}),A.current=e}},[v]);var L=n.useMemo(function(){return D(d,p)},[d,p,D]),W=n.useMemo(function(){if(!f||0===f.length||!y||b)return f;var e=new Map;return L.forEach(function(n){n.nestedTable&&e.set(n.absoluteRowIndex,n.position)}),f.filter(function(n){return e.has(n[0])}).map(function(n){var t=n[1];return[e.get(n[0]),t]})},[f,L,y,b]),O=n.useMemo(function(){if(W&&0!==W.length)return function(e,n,t,r){var o=n+r.rowSeparatorWidth,i=Array(e),a=new Map;t&&t.forEach(function(e){a.set(e[0],e[1])});for(var u=0,l=0;e>l;l++){i[l]=u,u+=o;var s=a.get(l);void 0!==s&&(u+=s)}return{rowTopPositions:i,totalHeight:u-r.rowSeparatorWidth}}(L.length,h,W,s)},[L.length,h,W,s]),q=n.useMemo(function(){return void 0===i?L:B({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}).rendered.rows},[L,i,h,x,g,P,O]),z=n.useMemo(function(){if(!c||void 0===i)return{stickyParents:[],regularRows:q,partiallyVisibleRows:[]};var e=B({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}),n=I?function(e,n,t,r,o){return G({allTableRows:e,renderedRows:n,fullyVisibleRows:t,partiallyVisibleRows:r,partiallyVisibleRowIndex:0,recursionDepth:0,stickyParents:[],rowGrouping:o})}(L,e.rendered.rows,e.fullyVisible.rows,e.partiallyVisible.rows,I):{stickyParents:[],regularRows:e.rendered.rows,partiallyVisibleRows:[]};return exports.__assign(exports.__assign({},n),{partiallyVisibleRows:e.partiallyVisible.rows})},[P,i,L,c,O,I,h,g,x,q]),V=z.stickyParents,j=z.regularRows,K=z.partiallyVisibleRows,U=n.useCallback(function(e,n){var t=new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)})),r=new Set(n.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}));return{staying:n.filter(function(e){var n=H(e.rowId);return t.has(n)}),entering:n.filter(function(e){var n=H(e.rowId);return!t.has(n)}),leaving:e.filter(function(e){var n=H(e.rowId);return!r.has(n)})}},[]),_=n.useMemo(function(){if(0===T.current.length)return!1;var e=L.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}),n=T.current.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L]);n.useLayoutEffect(function(){if(!R){var e=function(){N.length>0&&E([])};if(!t||y)return e(),T.current=L,void(k.current=q);if(0===T.current.length)return e(),T.current=L,void(k.current=q);if(!_)return e(),T.current=L,void(k.current=q);F.current={tableRows:L,visibleRows:q},S(!0)}},[t,L,N.length,_,R,y,q]),n.useLayoutEffect(function(){if(R&&F.current&&N.length>0){var e=setTimeout(function(){var e=F.current;S(!1),E([]),T.current=e.tableRows,k.current=e.visibleRows,F.current=null},ht.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[R,N.length]);var J=n.useMemo(function(){if(!t||y)return q;if(N.length>0){var e=new Map,n=new Map;return L.forEach(function(t){var r=H(t.rowId);e.set(r,t.position),n.set(r,t.displayPosition)}),N.map(function(t){var r=H(t.rowId),o=e.get(r),i=n.get(r);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},t),{position:o,displayPosition:i}):t})}return q},[q,N,L,t,y]),Y=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=r(e),o=D(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:o,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}),l=U(q,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return L.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],q,!0),l,!0))}},[t,y,r,D,i,h,x,g,U,L,q,P,O]),X=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=o(e),r=D(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:r,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:O}),l=U(q,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return L.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],q,!0),l,!0))}},[t,y,o,D,i,h,x,g,U,L,q,P,O]);return{currentTableRows:L,currentVisibleRows:q,isAnimating:R,prepareForFilterChange:Y,prepareForSortChange:X,rowsToRender:J,stickyParents:V,regularRows:j,partiallyVisibleRows:K,paginatedHeightOffsets:W,heightMap:O}}({allowAnimations:o,computeFilteredRowsPreview:ro,computeSortedRowsPreview:oo,contentHeight:io,currentPage:Vt,customTheme:Ln,enableStickyParents:ae,flattenedRows:$r,heightOffsets:Qr,originalFlattenedRows:to,paginatableRows:Zr,parentEndPositions:eo,rowGrouping:un,rowHeight:On,rowsPerPage:dn,scrollDirection:vr,scrollTop:cr,serverSidePagination:mn,shouldPaginate:xn}),uo=ao.currentTableRows,lo=ao.rowsToRender,so=ao.prepareForFilterChange,co=ao.prepareForSortChange,fo=ao.isAnimating,vo=ao.stickyParents,po=ao.regularRows,ho=ao.partiallyVisibleRows,wo=ao.paginatedHeightOffsets,mo=ao.heightMap,go=n.useRef(new Map),xo=n.useRef(new Map),bo=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,u=e.onCellEdit,l=e.cellRegistry,s=e.collapsedHeaders,c=e.rowHeight,d=e.enableRowSelection,f=void 0!==d&&d,v=e.copyHeadersToClipboard,p=void 0!==v&&v,h=e.customTheme,w=n.useState(new Set),m=w[0],g=w[1],x=n.useState(new Set),b=x[0],y=x[1],I=n.useState(null),C=I[0],M=I[1],N=n.useState(null),E=N[0],T=N[1],k=n.useState(new Set),A=k[0],F=k[1],D=n.useState(new Set),L=D[0],W=D[1],O=n.useState(!1),B=O[0],q=O[1],z=n.useRef(!1),G=n.useRef(null),V=n.useRef(null),U=n.useRef(new Set);V.current=E,U.current=m;var _=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),b.forEach(function(n){e.add(n)}),e},[m,b]),J=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),b.size>0&&o.forEach(function(n){var t=H(n.rowId);e.add(t)}),e},[m,b,o]),Y=n.useMemo(function(){return r.flatMap(function(e){return P(e,s)})},[r,s]),X=n.useCallback(function(){var e=U.current;if(0!==e.size){var n=function(e,n,t,r){void 0===r&&(r=!1);var o=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),i=new Map,a=new Map;o.forEach(function(e,n){i.set(n,e.accessor),a.set(n,e)});var u=Array.from(e).reduce(function(e,n){var r,o=n.split("-").map(Number),u=o[0],l=o[1];e[u]||(e[u]=[]);var s=i.get(l),c=a.get(l);if(s&&(null===(r=t[u])||void 0===r?void 0:r.row)){var d=t[u].row,f=R(d,s);if(!1!==(null==c?void 0:c.useFormattedValueForClipboard)&&(null==c?void 0:c.valueFormatter)){var v=c.valueFormatter({accessor:s,colIndex:l,row:d,rowIndex:u,value:f});e[u][l]=v}else e[u][l]=!c||"lineAreaChart"!==c.type&&"barChart"!==c.type?f:Array.isArray(f)?f.join(", "):""}else e[u][l]="";return e},{}),l=new Set;r&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var s="";r&&l.size>0&&(s=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,t=a.get(e);return null!==(n=null==t?void 0:t.label)&&void 0!==n?n:""}).join("\t"));var c=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return r&&s?"".concat(s,"\n").concat(c):c}(e,Y,o,p);navigator.clipboard.writeText(n),F(new Set(e)),setTimeout(function(){return F(new Set)},800)}},[Y,o,p]),$=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,s;return a(this,function(a){switch(a.label){case 0:if(!(e=V.current))return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(n=a.sent())?(t=function(e,n,t,r,o,i){var a=new Set,u=new Set,l=e.split("\n").filter(function(e){return e.length>0});if(0===l.length)return{updatedCells:a,warningCells:u};var s=t.filter(function(e){return!e.hide&&!e.excludeFromRender}),c=n.rowIndex,d=n.colIndex;return l.forEach(function(e,n){e.split("\t").forEach(function(e,t){var l=c+n,f=d+t;if(r.length>l&&s.length>f){var v=r[l],p=s[f],h=H(v.rowId);if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=+e;isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var g=new Date(e);isNaN(g.getTime())||(w=g)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(w=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(S(v.row,p.accessor,w),i){var x="".concat(h,"-").concat(p.accessor),b=i.get(x);b&&b.updateContent(w)}null==o||o({accessor:p.accessor,newValue:w,row:v.row,rowIndex:l});var y="".concat(l,"-").concat(f,"-").concat(h);a.add(y)}else{var I="".concat(l,"-").concat(f,"-").concat(h);u.add(I)}}})}),{updatedCells:a,warningCells:u}}(n,e,Y,o,u,l),i=t.warningCells,(r=t.updatedCells).size>0&&(F(r),setTimeout(function(){return F(new Set)},800)),i.size>0&&(W(i),setTimeout(function(){return W(new Set)},800)),[3,4]):[2];case 3:return s=a.sent(),console.warn("Failed to paste from clipboard:",s),[3,4];case 4:return[2]}})})},[Y,o,u,l]),Q=n.useCallback(function(){var e=U.current;if(0!==e.size){var n=function(e,n,t,r,o){var i=new Set,a=new Set,u=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),l=new Map;return u.forEach(function(e,n){l.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),l=n[0],s=n[1];if(t.length>l&&u.length>s){var c=t[l],d=u[s],f=H(c.rowId);if(null==d?void 0:d.isEditable){var v;if(v="string"===d.type?"":"number"===d.type?null:"boolean"!==d.type&&("date"===d.type?null:"lineAreaChart"===d.type||"barChart"===d.type||Array.isArray(R(c.row,d.accessor))?[]:""),S(c.row,d.accessor,v),o){var p="".concat(f,"-").concat(d.accessor),h=o.get(p);h&&h.updateContent(v)}null==r||r({accessor:d.accessor,newValue:v,row:c.row,rowIndex:l}),i.add(e)}else a.add(e)}}),{deletedCells:i,warningCells:a}}(e,Y,o,u,l),t=n.deletedCells,r=n.warningCells;t.size>0&&(F(t),setTimeout(function(){return F(new Set)},800)),r.size>0&&(W(r),setTimeout(function(){return W(new Set)},800))}},[Y,o,u,l]),Z=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),u=Math.max(e.colIndex,n.colIndex),l=r;i>=l;l++)for(var s=a;u>=s;s++)if(l>=0&&o.length>l){if(f&&0===s)continue;var d=H(o[l].rowId);t.add(K({colIndex:s,rowIndex:l,rowId:d}))}y(new Set),M(null),U.current=t,V.current=n,g(t),T(n),setTimeout(function(){return j(n,c,h)},0)},[o,c,f,h]),ee=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?Y.length:Y.length-1)>=e.colIndex){var n=K(e);y(new Set),M(null);var t=new Set([n]);U.current=t,V.current=e,g(t),T(e),setTimeout(function(){return j(e,c,h)},0)}},[Y.length,o.length,c,f,h]),ne=n.useCallback(function(e,n){void 0===n&&(n=!1),U.current=new Set,V.current=null,g(new Set),T(null),y(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&M(e[e.length-1])},[]);!function(e){var t=e.copyToClipboard,r=e.deleteSelectedCells,o=e.enableRowSelection,i=void 0!==o&&o,a=e.initialFocusedCellRef,u=e.leafHeaders,l=e.pasteFromClipboard,s=e.selectCellRange,c=e.selectSingleCell,d=e.selectableCells,f=e.selectedCellsRef,v=e.setLastSelectedColumnIndex,p=e.setSelectedCells,h=e.setSelectedColumns,w=e.startCell,m=e.tableRows;n.useEffect(function(){var e=function(e){if(d){var s=a.current;if(s&&0!==f.current.size){var c=document.activeElement;if(!(c instanceof HTMLInputElement||c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement||"true"===(null==c?void 0:c.getAttribute("contenteditable")))){var R=s.rowIndex,S=s.colIndex,M=s.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void l();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var N=new Set,E=0;m.length>E;E++)for(var T=0;u.length>T;T++){var k=i?T+1:T,P=H(m[E].rowId);N.add("".concat(E,"-").concat(k,"-").concat(P))}return f.current=N,p(N),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void r();var A=m[R];if((A?H(A.rowId):null)!==M){var F=m.findIndex(function(e){return H(e.rowId)===M});if(-1===F)return;R=F}var D=function(e,n,t){var r=e,o=n;return"up"===t?r=0:"down"===t?r=m.length-1:"left"===t?o=i?1:0:"right"===t&&(o=i?u.length:u.length-1),{rowIndex:r,colIndex:o}};if("ArrowUp"===e.key)e.preventDefault(),n(e,R,S,D);else if("ArrowDown"===e.key)e.preventDefault(),o(e,R,S,D);else if("ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey)e.preventDefault(),g(e,R,S,D);else if("ArrowRight"===e.key||"Tab"===e.key)e.preventDefault(),x(e,R,S,D);else if("Home"===e.key)e.preventDefault(),b(e,R);else if("End"===e.key)e.preventDefault(),y(e,R);else if("PageUp"===e.key)e.preventDefault(),I(e,R,S);else if("PageDown"===e.key)e.preventDefault(),C(e,R,S);else if("Escape"===e.key){var L=new Set;f.current=L,p(L),h(new Set),v(null),w.current=null}}else t()}}}},n=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a.current);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),o>=0){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else n>0&&(o=n-1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null)},o=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a.current);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),m.length>o){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else m.length-1>n&&(o=n+1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null)},g=function(e,n,t,r){if(e.shiftKey&&"ArrowLeft"===e.key){w.current||(w.current=a.current);var o=t-1;if(e.ctrlKey||e.metaKey)o=r(n,t,"left").colIndex;else if(i&&0===o)return;if(o>=0){var u=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:o,rowId:u})}}else if(t>0){if(o=t-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)o=r(n,t,"left").colIndex;else if(i&&0===o)return;0>o||(u=H(m[n].rowId),c({rowIndex:n,colIndex:o,rowId:u}),w.current=null)}},x=function(e,n,t,r){var o=i?u.length:u.length-1;if(e.shiftKey&&"ArrowRight"===e.key){w.current||(w.current=a.current);var l=t+1;if((e.ctrlKey||e.metaKey)&&(l=r(n,t,"right").colIndex),o>=l){var d=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:l,rowId:d})}}else o>t&&(l=t+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(l=r(n,t,"right").colIndex),l>o||(d=H(m[n].rowId),c({rowIndex:n,colIndex:l,rowId:d}),w.current=null))},b=function(e,n,t){if(e.shiftKey){w.current||(w.current=a.current);var r=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(r=0);var u=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:o,rowId:u})}else r=n,o=i?1:0,(e.ctrlKey||e.metaKey)&&(r=0),u=H(m[r].rowId),c({rowIndex:r,colIndex:o,rowId:u}),w.current=null},y=function(e,n,t){if(e.shiftKey){w.current||(w.current=a.current);var r=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(r=m.length-1);var l=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:o,rowId:l})}else r=n,o=i?u.length:u.length-1,(e.ctrlKey||e.metaKey)&&(r=m.length-1),l=H(m[r].rowId),c({rowIndex:r,colIndex:o,rowId:l}),w.current=null},I=function(e,n,t){var r=Math.max(0,n-10);if(e.shiftKey){w.current||(w.current=a.current);var o=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=H(m[r].rowId),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null},C=function(e,n,t){var r=Math.min(m.length-1,n+10);if(e.shiftKey){w.current||(w.current=a.current);var o=H(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=H(m[r].rowId),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[d,a,f,m,u,c,s,p,h,v,t,l,r,w,i])}({selectableCells:t,initialFocusedCellRef:V,selectedCellsRef:U,tableRows:o,leafHeaders:Y,selectSingleCell:ee,selectCellRange:Z,setSelectedCells:g,setSelectedColumns:y,setLastSelectedColumnIndex:M,copyToClipboard:X,pasteFromClipboard:$,deleteSelectedCells:Q,startCell:G,enableRowSelection:f});var te=n.useCallback(function(e,n){var t=new Set,r=new Map;o.forEach(function(e,n){var t=H(e.rowId);r.set(t,n)});for(var i=r.get(e.rowId+""),a=r.get(n.rowId+""),u=void 0!==i?i:e.rowIndex,l=void 0!==a?a:n.rowIndex,s=Math.min(u,l),c=Math.max(u,l),d=Math.min(e.colIndex,n.colIndex),v=Math.max(e.colIndex,n.colIndex),p=s;c>=p;p++)for(var h=d;v>=h;h++)if(p>=0&&o.length>p){if(f&&0===h)continue;var w=H(o[p].rowId);t.add(K({colIndex:h,rowIndex:p,rowId:w}))}U.current=t,g(t)},[o,f]),re=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(!t)return null;var r=t.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(r.left,Math.min(r.right,e)),a=Math.max(r.top,Math.min(r.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,t=n.getBoundingClientRect(),r=t.top+t.height/2,o=Math.sqrt(Math.pow(t.left+t.width/2-i,2)+Math.pow(r-a,2));l>o&&(l=o,u=n)}}),null!==u){var s=u,c=parseInt(s.getAttribute("data-row-index")||"-1",10),d=parseInt(s.getAttribute("data-col-index")||"-1",10),f=s.getAttribute("data-row-id");if(c>=0&&d>=0&&null!==f)return{rowIndex:c,colIndex:d,rowId:f}}return null},[]),oe=n.useCallback(function(e,n){var t=document.elementFromPoint(e,n);if(!t)return null;var r=t.closest(".st-cell");if(r instanceof HTMLElement){var o=parseInt(r.getAttribute("data-row-index")||"-1",10),i=parseInt(r.getAttribute("data-col-index")||"-1",10),a=r.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return re(e,n)},[re]),ie=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(t){var r=t.getBoundingClientRect();r.top+50>n?t.scrollTop-=10*Math.min(3,1+Math.max(0,r.top-n)/100):n>r.bottom-50&&(t.scrollTop+=10*Math.min(3,1+Math.max(0,n-r.bottom)/100));var o=document.querySelector(".st-body-main");o&&(r.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,r.left-e)/100):e>r.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-r.right)/100)))}},[]),ae=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){z.current=!0,q(!0),G.current={rowIndex:r,colIndex:n,rowId:o};var i=K({colIndex:n,rowIndex:r,rowId:o}),a=new Set([i]),u={rowIndex:r,colIndex:n,rowId:o};U.current=a,V.current=u,setTimeout(function(){y(new Set),M(null),g(a),T(u)},0);var l=null,s=null,c=null,d=0,f=function(){if(z.current&&G.current){if(null!==l&&null!==s){ie(l,s);var e=Date.now();if(e-d>=16){var n=oe(l,s);n&&te(G.current,n),d=e}}c=requestAnimationFrame(f)}else null!==c&&(cancelAnimationFrame(c),c=null)},v=function(e){z.current&&G.current&&(l=e.clientX,s=e.clientY)},p=function(){z.current=!1,q(!1),null!==c&&(cancelAnimationFrame(c),c=null),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",p),c=requestAnimationFrame(f)}},[t,ie,oe,te]),ue=n.useCallback(function(e){t&&z.current&&G.current&&te(G.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},[t,te]),le=n.useCallback(function(e){var n=e.colIndex,t=K({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),r=m.has(t),o=b.has(n);return r||o},[m,b]),se=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId;if(B)return"";var i=[],a=o[t-1],u=a?H(a.rowId):null,l=o[t+1],s=l?H(l.rowId):null,c=null!==u?{colIndex:n,rowIndex:t-1,rowId:u}:null,d=null!==s?{colIndex:n,rowIndex:t+1,rowId:s}:null,f={colIndex:n-1,rowIndex:t,rowId:r},v={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!le(c)||b.has(n)&&0===t)&&i.push("st-selected-top-border"),(!d||!le(d)||b.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),le(f)||i.push("st-selected-left-border"),le(v)||i.push("st-selected-right-border"),i.join(" ")},[B,le,o,b]),ce=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),de=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return A.has(n)},[A]),fe=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return L.has(n)},[L]);return{getBorderClass:se,handleMouseDown:ae,handleMouseOver:ue,isCopyFlashing:de,isWarningFlashing:fe,isInitialFocusedCell:ce,isSelected:le,lastSelectedColumnIndex:C,pasteFromClipboard:$,selectColumns:ne,selectedCells:m,selectedColumns:b,setInitialFocusedCell:T,setSelectedCells:g,setSelectedColumns:y,deleteSelectedCells:Q,columnsWithSelectedCells:_,rowsWithSelectedCells:J,startCell:G}}({selectableCells:vn,headers:ur,tableRows:uo,onCellEdit:Ve,cellRegistry:go.current,collapsedHeaders:ir,rowHeight:On,enableRowSelection:$,copyHeadersToClipboard:F,customTheme:Ln}),yo=bo.getBorderClass,Io=bo.handleMouseDown,Co=bo.handleMouseOver,Ro=bo.isCopyFlashing,So=bo.isInitialFocusedCell,Mo=bo.isSelected,No=bo.isWarningFlashing,Ho=bo.selectColumns,Eo=bo.selectedCells,To=bo.selectedColumns,ko=bo.setInitialFocusedCell,Po=bo.setSelectedCells,Ao=bo.setSelectedColumns,Fo=bo.columnsWithSelectedCells,Do=bo.rowsWithSelectedCells,Lo=bo.startCell,Wo=n.useRef(co);Wo.current=co;var Oo=n.useRef(so);Oo.current=so;var Bo=n.useCallback(function(e){Wo.current(e),setTimeout(function(){Jr({accessor:e})},0)},[Jr]),qo=n.useCallback(function(e){Wr(e)},[Wr]),zo=n.useCallback(function(){Wr(L)},[L,Wr]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown,s=e.startCell;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")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set),s&&(s.current=null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,u,l,s])}({selectableColumns:hn,selectedCells:Eo,selectedColumns:To,setSelectedCells:Po,setSelectedColumns:Ao,activeHeaderDropdown:Qt,setActiveHeaderDropdown:Zt,startCell:Lo}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth,i=n.useRef(null);n.useLayoutEffect(function(){var e=function(){null!==i.current&&clearTimeout(i.current),i.current=setTimeout(function(){i.current=null,t(),r.current&&o(r.current.offsetWidth-r.current.clientWidth)},150)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null!==i.current&&(clearTimeout(i.current),i.current=null)}},[t,r,o])}({forceUpdate:et,tableBodyContainerRef:Qn,setScrollbarWidth:Ot}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:Ye}),function(e){var t=e.cellRegistryRef,r=e.clearAllFilters,o=e.clearFilter,l=e.currentPage,s=e.resetColumns,c=e.editColumns,d=e.essentialAccessors,f=e.expandedDepths,v=e.filters,p=e.flattenedRows,h=e.headerRegistryRef,w=e.headers,m=e.includeHeadersInCSVExport,g=e.onColumnOrderChange,x=e.onColumnVisibilityChange,y=e.onPageChange,I=e.paginatableRows,C=e.quickFilter,M=e.rowGrouping,N=e.rows,E=e.rowsPerPage,T=e.setCollapsedRows,k=e.setColumnEditorOpen,P=e.setCurrentPage,A=e.setExpandedDepths,F=e.setExpandedRows,D=e.setHeaders,L=e.sort,W=e.tableRef,O=e.totalRowCount,B=e.updateFilter,q=e.updateSort,z=e.visibleRows;n.useEffect(function(){W&&(W.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==N?void 0:N[r];if(i){var a=p.find(function(e){return e.absoluteRowIndex===r});if(a){var u=H(a.rowId),l=b({rowId:u,accessor:n}),s=t.current.get(l);s&&s.updateContent(o)}void 0!==R(i,n)&&S(i,n,o)}},setHeaderRename:function(e){var n=h.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return z},getAllRows:function(){return p},getHeaders:function(){return w},exportToCSV:function(e){!function(e,n,t,r){void 0===r&&(r=!0);var o=function(e,n,t){void 0===t&&(t=!0);var r=function(e){var n=[],t=function(e){for(var r=0,o=e;o.length>r;r++){var i=o[r];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),t(i.children)):n.push(i))}};return t(e),n}(n),o=r.map(function(e){return ft(e.label)}).join(","),i=e.map(function(e,n){var t=e.row;return r.map(function(e,r){var o=R(t,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o,formattedValue:i});return ft(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}),ft(i)):ft(o)}).join(",")});return(t?u([o],i,!0):i).join("\n")}(e,n,r);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(o,t)}(p,w,(void 0===e?{}:e).filename,m)},getSortState:function(){return L},applySortState:vt(q),getPinnedState:function(){return Oe(w)},applyPinnedState:vt(function(e){D(function(n){var t=qe(n,e,d);return t?(null==g||g(t),t):(console.warn("applyPinnedState: left, main, and right accessor lists must include each root column exactly once."),n)})}),getFilterState:function(){return v},applyFilter:vt(B),clearFilter:vt(o),clearAllFilters:vt(r),getCurrentPage:function(){return l},getTotalPages:function(){return Math.ceil((null!=O?O:I.length)/E)},setPage:function(e){return i(void 0,void 0,void 0,function(){var n;return a(this,function(t){switch(t.label){case 0:return n=Math.ceil((null!=O?O:I.length)/E),1>e||e>n?[3,2]:(P(e),y?[4,y(e)]:[3,2]);case 1:t.sent(),t.label=2;case 2:return[2]}})})},expandAll:function(){var e=Array.from({length:(null==M?void 0:M.length)||0},function(e,n){return n});A(new Set(e)),F(new Map),T(new Map)},collapseAll:function(){A(new Set),F(new Map),T(new Map)},expandDepth:function(e){A(function(n){for(var t=new Set(n),r=0;e>=r;r++)t.add(r);return t}),F(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),T(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},collapseDepth:function(e){A(function(n){var t=new Set(n);return t.delete(e),t}),F(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),T(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},toggleDepth:function(e){A(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),F(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),T(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},setExpandedDepths:function(e){A(e)},getExpandedDepths:function(){return f},getGroupingProperty:function(e){return null==M?void 0:M[e]},getGroupingDepth:function(e){var n;return null!==(n=null==M?void 0:M.indexOf(e))&&void 0!==n?n:-1},toggleColumnEditor:function(e){c&&k(void 0!==e?e:function(e){return!e})},applyColumnVisibility:vt(function(e){var n=function(t){return t.map(function(t){var r=t.accessor+"",o=r in e?!e[r]:t.hide;return Fe(t,d)&&(o=!1),exports.__assign(exports.__assign({},t),{hide:o,children:t.children?n(t.children):t.children})})};D(function(e){return n(e)}),x&&x(e)}),resetColumns:s,setQuickFilter:function(e){(null==C?void 0:C.onChange)&&C.onChange(e)}})},[t,r,o,l,s,c,d,f,v,p,h,w,m,g,x,y,I,C,M,e.rowIndexMap,N,E,e.serverSidePagination,T,k,P,A,F,D,e.setRows,e.shouldPaginate,L,W,O,B,q,z])}({cellRegistryRef:go,clearAllFilters:jr,clearFilter:Vr,currentPage:Vt,resetColumns:zo,editColumns:O,essentialAccessors:lr,expandedDepths:wr,filters:zr,flattenedRows:$r,headerRegistryRef:xo,headers:ur,includeHeadersInCSVExport:He,onColumnOrderChange:je,onColumnVisibilityChange:Ue,onPageChange:Ze,paginatableRows:Zr,quickFilter:on,rowGrouping:un,rowIndexMap:Ct,rows:qt,rowsPerPage:dn,serverSidePagination:mn,setCollapsedRows:Cr,setColumnEditorOpen:tr,setCurrentPage:jt,setExpandedDepths:mr,setExpandedRows:br,setHeaders:Wr,setRows:pt,shouldPaginate:xn,sort:_r,tableRef:Sn,totalRowCount:Hn,updateFilter:Gr,updateSort:Jr,visibleRows:lo}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:zr,onFilterChange:Je}),function(e){var t=e.sort,r=e.onSortChange,o=Te(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:_r,onSortChange:tn});var Go=n.useCallback(function(e){Oo.current(e),setTimeout(function(){Gr(e)},0)},[Gr]),Vo=!mt&&0===uo.length,jo=n.useMemo(function(){return{activeHeaderDropdown:Qt,allowAnimations:o,areAllRowsSelected:Et,autoExpandColumns:c,canExpandRowGroup:d,cellRegistry:go.current,cellUpdateFlash:v,clearSelection:Dt,collapsedHeaders:ir,columnBorders:m,columnEditorConfig:Wn,columnReordering:C,columnResizing:T,containerWidth:Hr,columnsWithSelectedCells:Fo,copyHeadersToClipboard:F,draggedHeaderRef:Gn,editColumns:O,emptyStateRenderer:V,essentialAccessors:lr,enableHeaderEditing:J,enableRowSelection:$,errorStateRenderer:le,expandedDepths:wr,filters:zr,icons:Dn,forceUpdate:et,getBorderClass:yo,handleApplyFilter:Go,handleClearAllFilters:jr,handleClearFilter:Vr,handleMouseDown:Io,handleMouseOver:Co,handleRowSelect:Pt,handleSelectAll:At,handleToggleRow:Ft,headerContainerRef:Zn,headerDropdown:xe,headerHeight:Bn,headerRegistry:xo.current,headers:ur,heightOffsets:wo,hoveredHeaderRef:Vn,includeHeadersInCSVExport:He,isAnimating:fo,isCopyFlashing:Ro,isInitialFocusedCell:So,isLoading:mt,isResizing:Yt,isRowSelected:Ht,isSelected:Mo,isWarningFlashing:No,loadingStateRenderer:We,mainBodyRef:jn,maxHeaderDepth:Tr,onCellClick:Ge,onCellEdit:Ve,onColumnOrderChange:je,onColumnSelect:Ke,onColumnVisibilityChange:Ue,onColumnWidthChange:_e,onHeaderEdit:Xe,onLoadMore:$e,onRowGroupExpand:en,onSort:Bo,onTableHeaderDragEnd:qo,resetColumns:zo,pinnedLeftRef:Kn,pinnedRightRef:Jn,rowButtons:an,rowGrouping:un,rowHeight:On,rowStateMap:tt,rows:it,rowsWithSelectedCells:Do,scrollbarWidth:Wt,selectColumns:Ho,selectableColumns:hn,selectedColumns:To,selectedRowCount:Tt,selectedRows:Rt,selectedRowsData:kt,setActiveHeaderDropdown:Zt,setCollapsedHeaders:ar,setHeaders:Wr,setInitialFocusedCell:ko,setIsResizing:Xt,setRowStateMap:rt,setSelectedCells:Po,setSelectedColumns:Ao,setSelectedRows:St,setExpandedDepths:mr,setExpandedRows:br,setCollapsedRows:Cr,shouldPaginate:xn,tableBodyContainerRef:Qn,tableEmptyStateRenderer:Rn,tableRows:uo,theme:Nn,customTheme:Ln,expandedRows:xr,collapsedRows:Ir,useHoverRowBackground:Tn,useOddColumnBackground:Pn,useOddEvenRowBackground:Fn}},[Qt,o,Et,c,d,v,Dt,ir,m,Wn,C,T,Hr,Fo,F,Gn,O,V,lr,J,$,le,wr,zr,Dn,et,yo,Go,jr,Vr,Io,Co,Pt,At,Ft,Zn,xe,Bn,ur,wo,Vn,He,fo,Ro,So,mt,Yt,Ht,Mo,No,We,jn,Tr,Ge,Ve,je,Ke,Ue,_e,Xe,$e,en,Bo,qo,zo,Kn,Jn,an,un,On,tt,it,Do,Wt,Ho,hn,To,Tt,Rt,kt,Zt,ar,Wr,ko,Xt,rt,Po,Ao,St,mr,br,Cr,xn,Qn,Rn,uo,Nn,Ln,xr,Ir,Tn,Pn,Fn]);return e.jsx(_,exports.__assign({value:jo},{children:e.jsx(X,{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(Nn," ").concat(null!=p?p:""," ").concat(m?"st-column-borders":""),role:"grid",style:Be?{maxHeight:Be,height:void 0===io?"auto":Be}:ye?{height:ye}:{}},{children:[e.jsx(ut,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(Un,{calculatedHeaderHeight:Er,hideHeader:Se,pinnedLeftWidth:Ar,pinnedRightWidth:Fr,setScrollTop:dr,setScrollDirection:pr,shouldShowEmptyState:Vo,sort:_r,tableRows:uo,rowsToRender:lo,stickyParents:vo,regularRows:po,partiallyVisibleRows:ho,heightMap:mo}),e.jsx(at,{columnEditorConfig:Wn,editColumns:O,headers:Ut,open:nr,setOpen:tr})]})),!Vo&&e.jsx(_n,{mainBodyRef:jn,mainBodyWidth:Pr,pinnedLeftWidth:Ar,pinnedRightWidth:Fr,pinnedLeftContentWidth:Dr,pinnedRightContentWidth:Lr,tableBodyContainerRef:Qn}),!Vo&&e.jsx(Q,{currentPage:Vt,footerRenderer:me,hideFooter:Ce,onPageChange:jt,onNextPage:Qe,onUserPageChange:Ze,rowsPerPage:dn,shouldPaginate:xn,totalPages:Math.ceil((null!=Hn?Hn:Zr.length)/dn),totalRows:null!=Hn?Hn:Zr.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:Sr}))]}))})}))},Tt=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,s=n.fillOpacity,c=void 0===s?.25:s,d=n.strokeWidth,f=void 0===d?1.5:d,v=n.className,p=void 0===v?"":v,h=n.min,w=n.max;if(!t||0===t.length)return null;var m=void 0!==h?h:Math.min.apply(Math,t),g=(void 0!==w?w:Math.max.apply(Math,t))-m||1,x=a,b=t.map(function(e,n){return{x:n/(t.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),y="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(p),style:{display:"block"},shapeRendering:"geometricPrecision"},{children:[e.jsx("path",{d:y,fill:l||"var(--st-chart-fill-color)",fillOpacity:c,stroke:"none"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round"})]}))},kt=Object.freeze({__proto__:null,default:Tt}),Pt=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,s=void 0===l?2:l,c=n.className,d=void 0===c?"":c,f=n.min,v=n.max;if(!t||0===t.length)return null;var p=void 0!==f?f:Math.min.apply(Math,t),h=void 0!==v?v:Math.max.apply(Math,t),w=h-p||1,m=a,g=(100-s*(t.length-1))/t.length,x=0>p,b=x?m*(h/w):m;return e.jsx("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(m),preserveAspectRatio:"none",className:"st-bar-chart ".concat(d),style:{display:"block"},shapeRendering:"crispEdges"},{children:t.map(function(n,t){var r=t*(g+s),o=(n-p)/w*m,i=m-o,a=o;return x&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:r,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:.5},t)})}))},At=Object.freeze({__proto__:null,default:Pt});exports.ANIMATION_CONFIGS=ht,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=Z,exports.AngleRightIcon=ee,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=ne,exports.BarChart=Pt,exports.CheckIcon=te,exports.DescIcon=re,exports.DragIcon=oe,exports.FilterIcon=ie,exports.LineAreaChart=Tt,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=ae,exports.SimpleTable=Ht,exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,u,l,s,c,d,f,v,p,h,w,m,g;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,u=void 0===(i=t.duration)?300:i,s=void 0===(l=t.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(c=t.delay)?0:c,f=t.onComplete,p=void 0===(v=t.respectReducedMotion)||v,pt()&&p?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(h=n.getBoundingClientRect(),m=e-(w=h.top),g=r-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(s),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,t=e.finalConfig,r=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}}(r,o),0===e.x&&0===e.y||pt()&&!1!==t.respectReducedMotion?[2]:(u=t,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=pt()?exports.__assign(exports.__assign({},ht.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},ht.COLUMN_REORDER),u):exports.__assign(exports.__assign({},ht.ROW_REORDER),u),wt(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,mt(n,i,t)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=Te,exports.useScrollState=$,exports.useTableContext=J;
2
+ //# sourceMappingURL=index-3a7273fd.js.map