simple-table-core 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{Animate-a00b8653.js → Animate-167eaf0d.js} +2 -2
  2. package/dist/Animate-167eaf0d.js.map +1 -0
  3. package/dist/DatePicker-b003d0e6.js +2 -0
  4. package/dist/DatePicker-b003d0e6.js.map +1 -0
  5. package/dist/cjs/{Animate-b6372d93.js → Animate-7ca2a47a.js} +2 -2
  6. package/dist/cjs/Animate-7ca2a47a.js.map +1 -0
  7. package/dist/cjs/DatePicker-53f14590.js +2 -0
  8. package/dist/cjs/DatePicker-53f14590.js.map +1 -0
  9. package/dist/cjs/context/TableContext.d.ts +2 -9
  10. package/dist/cjs/hooks/useQuickFilter.d.ts +14 -0
  11. package/dist/cjs/hooks/useTableAPI.d.ts +3 -1
  12. package/dist/cjs/index-f301a9e9.js +2 -0
  13. package/dist/cjs/index-f301a9e9.js.map +1 -0
  14. package/dist/cjs/index.d.ts +2 -1
  15. package/dist/cjs/index.js +1 -1
  16. package/dist/cjs/types/HeaderObject.d.ts +3 -0
  17. package/dist/cjs/types/QuickFilterTypes.d.ts +21 -0
  18. package/dist/cjs/types/SimpleTableProps.d.ts +2 -0
  19. package/dist/cjs/types/TableRefType.d.ts +2 -0
  20. package/dist/cjs/types/TableRow.d.ts +1 -0
  21. package/dist/cjs/utils/quickFilterUtils.d.ts +14 -0
  22. package/dist/cjs/utils/rowUtils.d.ts +27 -0
  23. package/dist/context/TableContext.d.ts +2 -9
  24. package/dist/hooks/useQuickFilter.d.ts +14 -0
  25. package/dist/hooks/useTableAPI.d.ts +3 -1
  26. package/dist/index-4950c0c9.js +2 -0
  27. package/dist/index-4950c0c9.js.map +1 -0
  28. package/dist/index.d.ts +2 -1
  29. package/dist/index.es.js +1 -1
  30. package/dist/types/HeaderObject.d.ts +3 -0
  31. package/dist/types/QuickFilterTypes.d.ts +21 -0
  32. package/dist/types/SimpleTableProps.d.ts +2 -0
  33. package/dist/types/TableRefType.d.ts +2 -0
  34. package/dist/types/TableRow.d.ts +1 -0
  35. package/dist/utils/quickFilterUtils.d.ts +14 -0
  36. package/dist/utils/rowUtils.d.ts +27 -0
  37. package/package.json +4 -1
  38. package/dist/Animate-a00b8653.js.map +0 -1
  39. package/dist/DatePicker-91f87634.js +0 -2
  40. package/dist/DatePicker-91f87634.js.map +0 -1
  41. package/dist/cjs/Animate-b6372d93.js.map +0 -1
  42. package/dist/cjs/DatePicker-7bfd609b.js +0 -2
  43. package/dist/cjs/DatePicker-7bfd609b.js.map +0 -1
  44. package/dist/cjs/index-e0379c0f.js +0 -2
  45. package/dist/cjs/index-e0379c0f.js.map +0 -1
  46. package/dist/index-fe1a2c58.js +0 -2
  47. package/dist/index-fe1a2c58.js.map +0 -1
@@ -0,0 +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=30,d=function(e){return 480>e?.3:768>e?.4:.8},f="parentExpanded",v=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},p=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,p(e.children)),n})},h=function(e){return void 0===e&&(e=0),e?e+1:0},w=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},m=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||n.excludeFromRender||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&function(e,n,t){var r=function(e,n){for(var t=0,r=p(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}(n,e.accessor);if(r){var o=t.has(r.accessor),i=e.showWhen||f;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,r,o))||null},g=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},x=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){var n=e.showWhen||f;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return x(e,n)}):e.children.filter(function(e){var n=e.showWhen||f;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return x(e,n)}):[e]},b=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(w({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},y=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(w({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){y(e)})},I=function(e){return"number"==typeof e.minWidth?e.minWidth:40},C=function(e,n){var t=[];return e.forEach(function(e){e.hide||t.push.apply(t,x(e,n))}),t},R=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)},S=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},M=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},N=function(e,n){var t=n+"";return t.includes(".")||t.includes("[")?t.split(".").reduce(function(e,n){if(null!=e){var t=M(n),r=t.index,o=e[t.key];return null!==r&&Array.isArray(o)&&(o=o[r]),o}},e):e[n]},H=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=M(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=M(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=M(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},E=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},T=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},k=function(e){return e.join("-")},P=function(e,n){var t=e[n];return E(t)?t:[]},A=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},D=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,y=e.headerHeight,I=e.customTheme,C=[],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,N=s;return e.forEach(function(i,s){var c,H,E=a[n],D=u(u([],f,!0),[s],!1),F=u(u([],p,!0),[s],!1),O=T({row:i,getRowId:l,depth:n,index:s,rowPath:D,rowIndexPath:F,groupingKey:E}),L=C.length,W={row:i,depth:n,displayPosition:N,groupingKey:E,position:g,isLastGroupRow:0===n&&s===e.length-1,rowId:O,rowPath:D,rowIndexPath:F,absoluteRowIndex:g,parentIndices:w.length>0?u([],w,!0):void 0};C.push(W),g++,N++;var B=k(O);if(A(B,n,t,r,o)&&a.length>n){var q=null==d?void 0:d.get(B),z=P(i,E),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===(H=G.nestedTable.customTheme)||void 0===H?void 0:H.headerHeight)||y,K=R({childRowCount:z.length,rowHeight:V,headerHeight:j,customTheme:I}),U=S({calculatedHeight:K,customHeight:G.nestedTable.height,customTheme:I}),_=u(u([],D,!0),[E],!1);C.push({row:{},depth:n+1,displayPosition:N,groupingKey:E,position:g,isLastGroupRow:!1,rowId:_,rowPath:_,rowIndexPath:F,nestedTable:{parentRow:i,expandableHeader:G,childAccessor:E,calculatedHeight:U},absoluteRowIndex:g}),g++,N++}else if(q&&(q.loading||q.error||q.isEmpty)){if(q.loading&&v||q.error&&h||q.isEmpty&&m){var J=u(u([],D,!0),[E],!1);C.push({row:{},depth:n+1,displayPosition:N,groupingKey:E,position:g,isLastGroupRow:!1,rowId:J,rowPath:J,rowIndexPath:F,stateIndicator:{parentRowId:B,parentRow:i,state:q},absoluteRowIndex:g,parentIndices:u(u([],w,!0),[L],!1)}),g++,N++}else if(q.loading&&!v){var Y=u(u([],D,!0),[E,"loading-skeleton"],!1);C.push({row:{},depth:n+1,displayPosition:N,groupingKey:E,position:g,isLastGroupRow:!1,rowId:Y,rowPath:Y,rowIndexPath:F,isLoadingSkeleton:!0,absoluteRowIndex:g,parentIndices:u(u([],w,!0),[L],!1)}),g++,N++}}else if(z.length>0){var X=u(u([],D,!0),[E],!1),$=u([],F,!0);g=M(z,n+1,g,N,X,$,u(u([],w,!0),[L],!1))}}}),g};return M(e.rows,void 0===n?0:n,0,c,[],[],[]),C},F=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},L=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=F(Math.max(0,r-C),u),N=F(S,u)+1;N=Math.min(o.length,N);var H=r,E=r+t,T=F(H,u);H>y[T]&&(T=Math.min(T+1,o.length));var k=F(E,u);k=Math.min(o.length,k);var P=r+t,A=F(r,u),D=F(P,u)+1;return D=Math.min(o.length,D),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:T,endIndex:k,rows:o.slice(T,k)},partiallyVisible:{startIndex:A,endIndex:D,rows:o.slice(A,D)}}},W=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+O(n,e.heightOffsets)},B=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},q=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 k(e.rowId)===k(t.rowId)})||(u.push(t),c++)}},f=0,v=s.parentIndices;v.length>f&&"break"!==d(v[f]);f++);if(u.length>0){B(s,n)&&(u.push(s),c++);var p=o[i+=c];p&&(s=p)}}else if(B(s,n))return u.push(s),i++,q({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l});return B(s,n)?q({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l}):{stickyParents:u,regularRows:t}},z=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)}},G=function(e,n,t,r){var o=document.querySelector(".st-body-container"),i=document.querySelector(".st-body-main");if(o){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=L({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 z(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&&z(n,o,i)},100);z(u,o,i)}},V=function(e){var n=e.colIndex,t=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(t)},j=n.createContext(void 0),K=function(n){return e.jsx(j.Provider,exports.__assign({value:n.value},{children:n.children}))},U=function(){var e=n.useContext(j);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},_=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=U().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}))]}))]}))},J=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"})}))},Y=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"})}))},X=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"})}))},$=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"})}))},Q=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"})}))},Z=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"})]}))},ee=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"})}))},ne=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"})}))},te=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=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[t,r]),{isMainSectionScrollable:a}},re=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=U().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},oe=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}))},ie=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(re,exports.__assign({open:i,onClose:function(){r()},setOpen:a,width:120},{children:[e.jsx(oe,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(oe,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},ae=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()}})},ue=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()}})},le=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-7ca2a47a.js")})}),se=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-53f14590.js")})}),ce=n.lazy(function(){return Promise.resolve().then(function(){return nt})}),de=n.lazy(function(){return Promise.resolve().then(function(){return rt})}),fe=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(le,exports.__assign({},t))}))},ve=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(se,exports.__assign({},t))}))},pe=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(ce,exports.__assign({},t))}))},he=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(de,exports.__assign({},t))}))},we=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)},me=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},ge=function(e){if(!e)return new Date;if("string"==typeof e)return we(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:me(n)}return e instanceof Date?me(e):new Date},xe=function(e){return e?we(""+e):new Date},be=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(re,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(ve,{value:xe(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),r()},onClose:l})}))},ye=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(re,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(oe,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)})}))}))},Ie=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(ie,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(be,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(ye,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(ue,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(ae,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},Ce=0,Re=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();0!==Ce&&r>o-Ce||(Ce=o,n(t))}},Se=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},Me=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(Me);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Me(e[t]));return n},Ne=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},He=Date.now(),Ee={screenX:0,screenY:0},Te=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=Te(o.children,n,u(u([],t,!0),[r],!1));if(i)return i}}return null},ke=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function Pe(e,n,t){var r,o,i=Me(e),a=!1;try{var u=ke(t),l=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===l||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var c=i.splice(l,1)[0],d=(r=u,o=exports.__assign({},c),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o);i.splice(s,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var Ae=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=U().setHeaders,l=Se(t);return{handleDragStart:function(e){n.current=e,He=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,c=o.screenY,d=Math.sqrt(Math.pow(s-Ee.screenX,2)+Math.pow(c-Ee.screenY,2));r.current=a;var f,v,p,h=n.current,w=!1;if(ke(h)!==ke(a))f=(R=Pe(t,h,a)).newHeaders,w=R.emergencyBreak;else{var m=t,g=Te(m,h.accessor),x=Te(m,a.accessor);if(!g||!x)return;var b=g.length,y=x.length,I=x;if(b!==y){var C=y-b;C>0&&(I=x.slice(0,-C))}if((v=g).length!==(p=I).length||1!==v.length&&!v.slice(0,-1).every(function(e,n){return e===p[n]}))return;var R=function(e,n,t){var r=Me(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}}(m,g,I);f=R.newHeaders,w=R.emergencyBreak}if(!(u||a.accessor===h.accessor||10>d||JSON.stringify(f)===JSON.stringify(t)||w)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>S-He||40>d)||(He=S,Ee={screenX:s,screenY:c},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(t)},10)}}},De=function(n){var t=n.checked,r=void 0!==t&&t,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){i&&i(!r)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":n.ariaLabel,"aria-checked":r}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(r?"st-checked":""),"aria-hidden":"true"},{children:r&&e.jsx($,{className:"st-checkbox-checkmark"})})),o]}))},Fe=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(pe,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(he,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)?ge(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):r},Oe=r.default.memo(function(t){var r=t.borderClass,o=t.colIndex,i=t.displayRowNumber,a=t.header,u=t.isHighlighted,l=t.isInitialFocused,s=t.nestedIndex,c=t.parentHeader,d=t.rowIndex,f=t.tableRow,v=U(),p=v.canExpandRowGroup,h=v.cellRegistry,m=v.cellUpdateFlash,x=v.collapsedRows,b=v.columnBorders,y=v.draggedHeaderRef,I=v.enableRowSelection,C=v.expandedDepths,R=v.expandedRows,S=v.handleMouseDown,M=v.handleMouseOver,T=v.handleRowSelect,P=v.headers,D=v.hoveredHeaderRef,F=v.icons,O=v.isCopyFlashing,L=v.isLoading,W=v.isRowSelected,B=v.isWarningFlashing,q=v.onCellEdit,z=v.onCellClick,G=v.onRowGroupExpand,V=v.onTableHeaderDragEnd,j=v.rowButtons,K=v.rowGrouping,_=v.setCollapsedRows,J=v.setExpandedRows,Y=v.setRowStateMap,X=v.rowsWithSelectedCells,$=v.selectedColumns,Q=v.tableBodyContainerRef,Z=v.theme,ee=v.useOddColumnBackground,ne=f.depth,te=f.row,re=f.rowPath,oe=f.rowIndexPath,ie=f.absoluteRowIndex,ae=f.rowId,ue=n.useState(N(te,a.accessor)),le=ue[0],se=ue[1],ce=n.useState(!1),de=ce[0],ve=ce[1],pe=n.useState(!1),he=pe[0],we=pe[1],me=n.useState(!1),ge=me[0],xe=me[1],be=n.useRef(null),ye=k(ae),Ce=K&&K[ne],Se=!!Ce&&function(e,n){return!!n&&E(e[n])}(te,Ce),Me=K&&K.length>ne,Ne=!p||p(te),He=!!a.nestedTable,Ee=A(ye,ne,C,R,x),Te=O({rowIndex:d,colIndex:o,rowId:ye}),ke=B({rowIndex:d,colIndex:o,rowId:ye}),Pe=n.useMemo(function(){var e,n,t;if(!b)return!1;var r=P.filter(function(e){return"left"===e.pinned}),o=P.filter(function(e){return!e.pinned}),i=P.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[b,P,a.accessor,a.pinned]),Oe=Ae({draggedHeaderRef:y,headers:P,hoveredHeaderRef:D,onTableHeaderDragEnd:V}).handleDragOver,Le=Re(),We=w({accessor:a.accessor,rowId:ye}),Be=g({rowId:ye,accessor:a.accessor}),qe=a.isSelectionColumn&&I;n.useEffect(function(){if(h){var e="".concat(ye,"-").concat(a.accessor);return h.set(e,{updateContent:function(e){le!==e?(se(e),m&&(we(!0),be.current&&clearTimeout(be.current),be.current=setTimeout(function(){we(!1)},800))):se(e)}}),function(){h.delete(e),be.current&&clearTimeout(be.current)}}},[h,m,ye,a.accessor,le]),n.useEffect(function(){if(he){var e=setTimeout(function(){we(!1)},850);return function(){return clearTimeout(e)}}},[he]),n.useEffect(function(){se(N(te,a.accessor))},[te,a.accessor]);var ze="boolean"===a.type||"date"===a.type||"enum"===a.type,Ge=!!(null==a?void 0:a.isEditable),Ve=$.has(o),je=u&&!Ve,Ke=n.useMemo(function(){return!!qe&&X.has(ye+"")},[qe,X,ye]),Ue=null==c?void 0:c.singleRowChildren,_e="st-cell ".concat(ne>0&&a.expandable?"st-cell-depth-".concat(ne):""," ").concat(je?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Ve?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ge?"clickable":""," ").concat(he?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(Te?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ke?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(ee?s%2==0?"even-column":"odd-column":""," ").concat(qe?"st-selection-cell":""," ").concat(Ke?"st-selection-has-highlighted-cell":""," ").concat(Pe?"st-last-column":""," ").concat(Ue?"st-sub-cell":""," ").concat(ge?"hovered":""),Je=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),se(e),H(te,a.accessor,e),null==q||q({accessor:a.accessor,newValue:e,row:te,rowIndex:d})},[a.accessor,a.type,q,te,d]),Ye=n.useCallback(function(e){e.stopPropagation();var n=A(ye,ne,C,R,x),t=ye+"";if(n?(_(function(e){var n=new Map(e);return n.set(t,ne),n}),J(function(e){var n=new Map(e);return n.delete(t),n})):(J(function(e){var n=new Map(e);return n.set(t,ne),n}),_(function(e){var n=new Map(e);return n.delete(t),n})),n&&Y(function(e){var n=new Map(e);return n.delete(ye),n}),G){var r=a.pinned;G({depth:ne,event:e,groupingKey:Ce,groupingKeys:K||[],isExpanded:!n,row:te,rowIndexPath:oe||[],rowIdPath:re,setEmpty:function(e,n){Y(function(t){var o=new Map(t),i=o.get(ye)||{};return o.set(ye,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:r})),o})},setError:function(e){Y(function(n){var t=new Map(n),o=t.get(ye)||{};return t.set(ye,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:r})),t})},setLoading:function(e){e?Y(function(e){var n=new Map(e),t=n.get(ye)||{};return n.set(ye,exports.__assign(exports.__assign({},t),{loading:!0,error:null,isEmpty:!1,triggerSection:r})),n}):setTimeout(function(){Y(function(e){var n=new Map(e),t=n.get(ye)||{};return n.set(ye,exports.__assign(exports.__assign({},t),{loading:!1,error:null,isEmpty:!1,triggerSection:r})),n})},0)}})}},[x,Ce,ne,C,R,a.pinned,G,te,K,ye,oe,re,_,J,Y]);return L||f.isLoadingSkeleton?e.jsx("div",exports.__assign({className:_e},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!de||ze||qe?e.jsxs(fe,exports.__assign({className:_e,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ye,"data-row-index":d,"aria-colindex":o+1,id:We,onClick:function(){z&&!qe&&z({accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:le})},onDoubleClick:function(){return a.isEditable&&!qe&&ve(!0)},onDragOver:function(e){qe||Le({callback:Oe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){de||qe||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||de||(e.preventDefault(),ve(!0))},onMouseDown:function(){de||qe||S({rowIndex:d,colIndex:o,rowId:ye})},onMouseEnter:function(){xe(!0)},onMouseLeave:function(){xe(!1)},onMouseOver:function(){de||qe||M({rowIndex:d,colIndex:o,rowId:ye})},parentRef:Q,tableRow:f},{children:[a.expandable&&Me?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Ne&&(Se||G||He)?Ee?"expanded":"collapsed":"placeholder"),onClick:Ne&&(Se||G||He)?function(e){return Ye(e)}:void 0,role:Ne&&(Se||G||He)?"button":"presentation",tabIndex:Ne&&(Se||G||He)?0:-1,"aria-label":Ne&&(Se||G||He)?"".concat(Ee?"Collapse":"Expand"," row group"):void 0,"aria-expanded":Ne&&(Se||G||He)?Ee:void 0,"aria-hidden":!(Ne&&(Se||G||He)),onKeyDown:Ne&&(Se||G||He)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ye(e))}:void 0},{children:F.expand})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:L||f.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:qe?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ge||W&&W(ye+"")?e.jsx(De,{checked:!!W&&W(ye+""),onChange:function(e){T&&T(ye+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!j||!qe||0===j.length)return null;if(!(ge||W&&W(ye+"")))return null;var n={row:te,rowIndex:i};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:j.map(function(t,r){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?function(){var e;return a.cellRenderer({accessor:a.accessor,colIndex:o,row:te,rowIndex:ie,rowPath:re,theme:Z,value:le,formattedValue:null===(e=null==a?void 0:a.valueFormatter)||void 0===e?void 0:e.call(a,{accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:le})})}():Fe({content:le,header:a,colIndex:o,row:te,rowIndex:d})})})),!L&&!f.isLoadingSkeleton&&de&&ze&&!qe&&e.jsx(Ie,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:ve,type:a.type,value:le})]}),Be):e.jsx("div",exports.__assign({className:"st-cell-editing",id:w({accessor:a.accessor,rowId:ye}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(Ie,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:ve,type:a.type,value:le})}))},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}),Le=function(t){var r=t.columnIndices,o=t.displayRowNumber,i=t.header,a=t.headers,u=t.nestedIndex,l=t.parentHeader,s=t.pinned,c=t.rowIndex,d=t.rowIndices,f=t.tableRow,v=r[i.accessor],p=U(),h=p.getBorderClass,g=p.isSelected,x=p.isInitialFocusedCell,b=p.collapsedHeaders,y=k(f.rowId);if(i.children&&i.children.length>0){var I=i.children.filter(function(e){return m({header:e,pinned:s,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var C={rowIndex:c,colIndex:v,rowId:y},R=h(C),S=g(C),M=x(C),N=w({accessor:i.accessor,rowId:y});return e.jsxs(n.Fragment,{children:[e.jsx(Oe,{borderClass:R,colIndex:v,displayRowNumber:o,header:i,isHighlighted:S,isInitialFocused:M,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},N),I.map(function(n){var t=w({accessor:n.accessor,rowId:y});return e.jsx(Le,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},t)})]})}return e.jsx(n.Fragment,{children:I.map(function(n){var t=w({accessor:n.accessor,rowId:y});return e.jsx(Le,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},t)})})}var H={rowIndex:c,colIndex:v,rowId:y},E=h(H),T=g(H),P=x(H),A=w({accessor:i.accessor,rowId:y});return e.jsx(Oe,{borderClass:E,colIndex:v,displayRowNumber:o,header:i,isHighlighted:T,isInitialFocused:P,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},A)},We=r.default.memo(function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,s=n.tableRow,c=U().collapsedHeaders,d=o.filter(function(e){return m({header:e,pinned:i,headers:o,collapsedHeaders:c})});return e.jsx(e.Fragment,{children:d.map(function(n,c){var d=k(s.rowId),f=w({accessor:n.accessor,rowId:d});return e.jsx(Le,{columnIndices:r,displayRowNumber:u,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:s},f)})})},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.rowIndices===n.rowIndices}),Be=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},qe=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=U(),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=N(u,r),y=Array.isArray(b)?b:[],I=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,C=x.customTheme?exports.__assign(exports.__assign({},p),x.customTheme):p,R=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}),M=S({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(W({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(M,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx(Qn,exports.__assign({},x,{rows:y,theme:c,customTheme:C,height:R,rowGrouping:I,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,icons:g}))}))},ze=r.default.memo(function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,s=n.rowIndices,c=n.setHoveredIndex,d=n.tableRow,f=n.isSticky,v=void 0!==f&&f,p=n.stickyIndex,h=void 0===p?0:p,w=n.stickyOffset,m=void 0===w?0:w,g=n.stickyZIndex,x=U(),b=x.customTheme,y=x.emptyStateRenderer,I=x.errorStateRenderer,C=x.heightOffsets,R=x.isAnimating,S=x.isRowSelected,M=x.loadingStateRenderer,N=x.maxHeaderDepth,H=x.useHoverRowBackground,E=x.useOddEvenRowBackground,T=d.position,P=d.displayPosition,A=d.stateIndicator,D=d.nestedTable;if(D)return u?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(W({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(D.calculatedHeight,"px")}}):e.jsx(qe,{calculatedHeight:D.calculatedHeight,childAccessor:D.childAccessor,depth:d.depth-1,expandableHeader:D.expandableHeader,index:a,parentRow:D.parentRow,position:T});if(A)return e.jsx("div",A.state.triggerSection===u&&(A.state.loading&&M||A.state.error&&I||A.state.isEmpty&&y)?exports.__assign({className:"st-row st-state-row","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(W({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Be,{parentRow:A.parentRow,rowState:A.state,gridTemplateColumns:o,loadingStateRenderer:M,errorStateRenderer:I,emptyStateRenderer:y})}):{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(W({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}});var F=T%2==0,O=k(d.rowId),L=!!S&&S(O),B=v?{gridTemplateColumns:o,transform:"translateY(".concat(h*(l+1)+m,"px)"),height:"".concat(l,"px"),position:"absolute",top:0,left:0,right:0,zIndex:g}:{gridTemplateColumns:o,top:W({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),height:"".concat(l,"px")};return e.jsx("div",exports.__assign({className:"st-row ".concat(v?"st-sticky-parent":""," ").concat(E?F?"even":"odd":""," ").concat(L?"selected":""),"data-index":a,"aria-rowindex":T+N+1,onMouseEnter:function(){!R&&H&&c(a)},style:B},{children:e.jsx(We,{columnIndexStart:r,columnIndices:t,displayRowNumber:P,headers:i,pinned:u,rowIndex:T,rowIndices:s,tableRow:d},O)}))},function(e,n){return 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.rowIndices===n.rowIndices&&e.columnIndexStart===n.columnIndexStart}),Ge=function(t){var r=t.displayStrongBorder,o=t.position,i=t.rowHeight,a=t.templateColumns,u=t.isSticky,l=void 0!==u&&u,s=U(),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,right: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){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"}})}))},Ve=n.createContext(void 0),je=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(Ve);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}})},Ke=n.forwardRef(function(t,r){var o=t.columnIndexStart,i=t.columnIndices,a=t.headers,u=t.pinned,l=t.rowHeight,s=t.rowIndices,c=t.setHoveredIndex,d=t.templateColumns,f=t.totalHeight,v=t.width,p=t.regularRows,h=u?"st-body-pinned-".concat(u):"st-body-main",w=n.useRef(null);return n.useImperativeHandle(r,function(){return w.current},[]),n.useMemo(function(){return Ne(a,u)},[a,u])?e.jsx(je,exports.__assign({childRef:w,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:h,ref:w,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:v},!u&&{flexGrow:1})},{children:p.map(function(t,r){var f=t.stateIndicator?"state-".concat(t.stateIndicator.parentRowId,"-").concat(t.position):k(t.rowId);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(Ge,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:l,templateColumns:d}),e.jsx(ze,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:r,pinned:u,rowHeight:l,rowIndices:s,setHoveredIndex:c,tableRow:t})]},f)})}))})):null});function Ue(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){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return m({header:e,headers:l,collapsedHeaders:o})}).forEach(function(n,t){s(n,!e.singleRowChildren&&0===t)})};return t.forEach(function(e,n){s(e,0===n)}),n.filter(function(e){return!e.pinned&&m({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){s(e,0===n&&0===t.length)}),r.forEach(function(e){s(e,!1)}),i}Ke.displayName="TableSection";var _e=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=U(),b=x.collapsedHeaders,y=x.customTheme,I=x.editColumns,C=x.headers,R=x.rowHeight,S=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]),M=S.treeTransitionOffset,N=S.offsetStartIndex,H=n.useMemo(function(){return Ue({headers:C,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:b})},[C,a,c,b]),E=o.length>0?o.length*(R+1)+M:0;if(0===o.length)return null;var T=function(t,r,i,a,u){return void 0===u&&(u=0),e.jsx("div",exports.__assign({className:i?"st-sticky-section-".concat(i):"st-sticky-section-main",style:{position:"relative",height:"".concat(E,"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(k(a.rowId)),c=-1!==N&&l>=N,d=c?M:0,f=(l+1)*(R+1)-1+d;return e.jsxs(n.Fragment,{children:[e.jsx(ze,{columnIndexStart:u,columnIndices:H,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(Ge,{displayStrongBorder:!1,position:f,rowHeight:R,templateColumns:t,isSticky:!0})]},s)})}))},P=C.filter(function(e){return!e.pinned}),A="calc(100% - ".concat(h,"px - ").concat(I?"".concat(s,"px"):"0px",")");return e.jsxs("div",exports.__assign({className:"st-sticky-top",style:{height:"".concat(E,"px"),width:A,top:"".concat(r,"px")}},{children:[a.length>0&&T(u,a,"left",l,0),T(i,P,void 0,void 0,a.length),c.length>0&&T(d,c,"right",f,a.length+P.length)]}))},Je=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=U(),y=b.collapsedHeaders,I=b.headerContainerRef,C=b.headers,R=b.heightOffsets,S=b.isAnimating,M=b.mainBodyRef,N=b.onLoadMore,H=b.rowHeight,E=b.scrollbarWidth,T=b.setIsScrolling,P=b.shouldPaginate,A=b.tableBodyContainerRef,D=b.tableEmptyStateRenderer,F=b.customTheme,O=n.useState(!1),L=O[0],W=O[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&&A.current){var n=A.current;n.querySelectorAll('.st-row[data-index="'.concat(e,'"]:not(.st-nested-grid-row)')).forEach(function(e){var t=e;t.closest(".st-body-container")===n&&(t.classList.add("hovered"),G.current.add(t))})}},[A]);n.useEffect(function(){S&&V(null)},[S,V]),te({headerContainerRef:I,mainSectionRef:A,scrollbarWidth:E}),n.useEffect(function(){return function(){K.current&&clearTimeout(K.current)}},[]);var j=n.useRef(null),K=n.useRef(null),_=n.useRef(0),J=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)}(J,H,R,F)},[J,H,R,F]),X=n.useMemo(function(){return Ue({headers:C,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:y})},[C,i,l,y]),$=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=k(n.rowId);e[r]=t}),e},[d]),Q=n.useCallback(function(e,n){!N||P||L||200>=e.scrollHeight-(n+e.clientHeight)&&n>_.current&&(W(!0),N(),setTimeout(function(){W(!1)},1e3))},[N,P,L]),Z={columnIndices:X,headerContainerRef:I,headers:C,rowHeight:H,rowIndices:$,rowsToRender:d,setHoveredIndex:V,regularRows:m};return e.jsxs(e.Fragment,{children:[!p&&e.jsx(_e,{calculatedHeaderHeight:r,heightMap:x,mainTemplateColumns:o,partiallyVisibleRows:g,pinnedLeftColumns:i,pinnedLeftTemplateColumns:a,pinnedLeftWidth:u,pinnedRightColumns:l,pinnedRightTemplateColumns:s,pinnedRightWidth:c,rowIndices:$,scrollTop:q,scrollbarWidth:E,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;T(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(function(){T(!1)},150),j.current&&cancelAnimationFrame(j.current),j.current=requestAnimationFrame(function(){var e=_.current,r=t>e?"down":e>t?"up":"none";f(t),v(r),z(t),Q(n,t),_.current=t})},ref:A},{children:p?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:D})):e.jsxs(e.Fragment,{children:[e.jsx(Ke,exports.__assign({},Z,{pinned:"left",templateColumns:a,totalHeight:Y,width:u})),e.jsx(Ke,exports.__assign({},Z,{columnIndexStart:i.length,ref:M,templateColumns:o,totalHeight:Y})),e.jsx(Ke,exports.__assign({},Z,{columnIndexStart:i.length+o.length,pinned:"right",templateColumns:s,totalHeight:Y,width:c}))]})}))]})},Ye=function(e){var n=e.event,t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.tableBodyContainerRef,l=e.startWidth,s=e.collapsedHeaders,c=e.autoExpandColumns,f=void 0!==c&&c,v=e.reverse,p=void 0!==v&&v;n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,w="touches"in n;if(t&&!t.hide){i(!0);var m,g=I(t);if(t.children&&t.children.length>0){var R=x(t,s);m=R.length>0?R:[t]}else m=[t];var S=new Map,M=0;if(f){var N=r.filter(function(e){return e.pinned===t.pinned});if(C(N,s).forEach(function(e){var n="number"==typeof e.width?e.width:"string"==typeof e.width&&e.width.endsWith("px")?parseFloat(e.width):100;S.set(e.accessor,n)}),a.current){var H=a.current.clientWidth,E=$e({headers:r,containerWidth:H,collapsedHeaders:s}),T=E.leftWidth,k=E.rightWidth;M="left"===t.pinned?T:"right"===t.pinned?k:Math.max(0,H-T-k)}}var P=function(e){var n="right"===t.pinned?h-e:e-h;if(f){var i=r.filter(function(e){return e.pinned===t.pinned});Ze({delta:n,startWidth:l,resizedHeader:m.length>0?m[0]:t,sectionHeaders:i,reverse:p,collapsedHeaders:s,initialWidthsMap:S,sectionWidth:M,isParentResize:m.length>1,childrenToResize:m})}else{var a=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=d(window.innerWidth);if(!n.pinned)return 1/0;var u=i*a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+x(n,r).reduce(function(e,n){return e+b(n)},0)},0),l=I(n);return l>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):u}({header:t,headers:r,collapsedHeaders:s});m.length>1?Xe({delta:n,leafHeaders:m,minWidth:g,startWidth:l,maxWidth:a}):m[0].width=Math.max(Math.min(l+n,a),g),r.forEach(function(e){y(e)})}var c=u([],r,!0);o(c)};if(w){var A=function(e){P(e.touches[0].clientX)},D=function(){document.removeEventListener("touchmove",A),document.removeEventListener("touchend",D),i(!1)};document.addEventListener("touchmove",A),document.addEventListener("touchend",D)}else{var F=function(e){P(e.clientX)},O=function(){document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",O),i(!1)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",O)}}},Xe=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,I(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)})},$e=function(e){var n=e.containerWidth,t=e.maxPinnedWidthPercent,r=void 0===t?.8:t,o=e.collapsedHeaders,i=0,a=0,u=0;e.headers.forEach(function(e){if(!e.hide){var n=x(e,o).reduce(function(e,n){return e+b(n)},0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:u+=n}});var l=i,s=a;if(n&&n>0){var c=n*r;i>c&&(i=c),a>c&&(a=c)}return{leftWidth:h(i),rightWidth:h(a),mainWidth:u,leftContentWidth:l,rightContentWidth:s}},Qe=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-30),initialWidth:n,minWidth:30}}),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>c});if(0>=l.length)return"break";var s=a,d=s/l.length,f=0;l.forEach(function(e,n){var t=e.minWidth-c,r=Math.min(d,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,c),f+=r}),a-=f}};a>.5&&"break"!==u(););},Ze=function(e){var n=e.delta,t=e.startWidth,r=e.resizedHeader,o=e.sectionHeaders,i=e.reverse,a=e.collapsedHeaders,u=e.initialWidthsMap,l=e.sectionWidth,s=e.isParentResize,d=e.childrenToResize,f=void 0===d?[]:d;if(void 0!==s&&s&&f.length>1){var v=C(o,a),p=v.findIndex(function(e){return e.accessor===f[0].accessor}),h=v.findIndex(function(e){return e.accessor===f[f.length-1].accessor});if(-1===p||-1===h)return;var w,m=h===v.length-1;w=0===p?v.slice(h+1):m||i?v.slice(0,p):v.slice(h+1);var g=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){var x=n,b=!1;if(g+n>l){b=!0;var y=w.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-c)},0);x=Math.min(n,y)}var I=(R=t+x)/(S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0));f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*I,30)}),b&&x>0&&w.length>0&&Qe({columnsToShrink:w,totalCompensation:x,initialWidthsMap:u})}else{var R,S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0),M=(R=Math.max(t+n,c*f.length))/S;f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*M,30)}),(D=t-R)>0&&w.length>0&&Qe({columnsToShrink:w,totalCompensation:-D,initialWidthsMap:u})}}else{var N=C(o,a),H=N.findIndex(function(e){return e.accessor===r.accessor});if(-1!==H){var E,T=H===N.length-1;if(0!==(E=0===H?N.slice(H+1):T||i?N.slice(0,H):N.slice(H+1)).length){var k=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){if(l>=k+n)return void(r.width=t+n);y=E.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-c)},0);var P=Math.min(n,y);r.width=t+P,P>0&&Qe({columnsToShrink:E,totalCompensation:P,initialWidthsMap:u})}else{var A=Math.max(t+n,30),D=t-A;r.width=A,D>0&&Qe({columnsToShrink:E,totalCompensation:-D,initialWidthsMap:u})}}else r.width=Math.max(t+n,30)}}},en={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"},nn=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"]}},tn=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},rn=function(e){return["between","notBetween","in","notIn"].includes(e)},on=function(e){return["isEmpty","isNotEmpty"].includes(e)},an=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},un=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(ne,{})]})),e.jsx(re,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)})}))}))]}))},ln=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:en[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(un,{value:t,onChange:function(e){r(e)},options:o})}))},sn=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()})},cn=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}))},dn=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"}))]}))},fn=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=nn("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},tn(l)&&{value:d});i(e)},h=on(l)||d.trim();return e.jsxs(an,{children:[e.jsx(ln,{value:l,onChange:s,operators:v}),tn(l)&&e.jsx(cn,{children:e.jsx(sn,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(dn,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},vn=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=nn("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};tn(c)?e.value=parseFloat(v):rn(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(an,{children:[e.jsx(ln,{value:c,onChange:d,operators:y}),tn(c)&&e.jsx(cn,{children:e.jsx(sn,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:I})}),rn(c)&&e.jsxs(cn,{children:[e.jsx(sn,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:I}),e.jsx(sn,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:I})]}),e.jsx(dn,{onApply:I,onClear:l,canApply:!!on(c)||(tn(c)?""!==v.trim():!!rn(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},pn=function(n){var t=n.className;return e.jsx(un,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===t?"":t,placeholder:n.placeholder})},hn=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=nn("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=on(l)||""!==d;return e.jsxs(an,{children:[e.jsx(ln,{value:l,onChange:s,operators:v}),tn(l)&&e.jsx(cn,{children:e.jsx(pn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(dn,{onApply:function(){var e={accessor:r.accessor,operator:l};tn(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},wn=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=nn("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=ge(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?ge(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(re,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(ve,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(an,{children:[e.jsx(ln,{value:c,onChange:d,operators:y}),tn(c)&&e.jsx(cn,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),rn(c)&&e.jsxs(cn,{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(dn,{onApply:function(){var e={accessor:i.accessor,operator:c};tn(c)?e.value=v:rn(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!on(c)||(tn(c)?""!==v.trim():!!rn(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},mn=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(an,{children:[e.jsx(cn,{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(De,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(sn,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,t){return e.jsx(De,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(dn,{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})]})},gn=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(vn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(hn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(wn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(mn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(fn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},xn=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}))]})},bn=function(t){var r,o,i=t.colIndex,a=t.gridColumnEnd,l=t.gridColumnStart,s=t.gridRowEnd,c=t.gridRowStart,d=t.header,p=t.parentHeader,h=t.reverse,m=t.sort,g=n.useState(!1),x=g[0],b=g[1],y=n.useState(!1),I=y[0],C=y[1],R=n.useState(d.label||""),S=R[0],M=R[1],N=U(),H=N.activeHeaderDropdown,E=N.areAllRowsSelected,T=N.autoExpandColumns,k=N.collapsedHeaders,P=N.columnBorders,A=N.columnReordering,D=N.columnResizing,F=N.columnsWithSelectedCells,O=N.draggedHeaderRef,L=N.enableHeaderEditing,W=N.handleApplyFilter,B=N.handleClearFilter,q=N.handleSelectAll,z=N.headerDropdown,G=N.headerRegistry,V=N.icons,j=N.headers,K=N.hoveredHeaderRef,_=N.onColumnOrderChange,J=N.onColumnSelect,Y=N.onHeaderEdit,X=N.onSort,$=N.onTableHeaderDragEnd,Q=N.headerHeight,Z=N.selectColumns,ee=N.selectableColumns,ne=N.selectedColumns,te=N.setActiveHeaderDropdown,oe=N.setCollapsedHeaders,ie=N.setHeaders,ue=N.setInitialFocusedCell,le=N.setIsResizing,se=N.setSelectedCells,ce=N.setSelectedColumns,de=N.tableBodyContainerRef,ve=!!(null==d?void 0:d.isSortable),pe=!!(null==d?void 0:d.filterable),he=N.filters[d.accessor],we=(null==H?void 0:H.accessor)===d.accessor,me=d.isSelectionColumn&&N.enableRowSelection,ge=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(d),xe=k.has(d.accessor),be=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:we,estimatedHeight:200,estimatedWidth:250,margin:4}),ye=be.triggerRef,Ie=be.position,Ce=n.useMemo(function(){var e,n,t;if(!P)return!1;var r=j.filter(function(e){return"left"===e.pinned}),o=j.filter(function(e){return!e.pinned}),i=j.filter(function(e){return"right"===e.pinned});return"left"===d.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===d.accessor:"right"===d.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===d.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===d.accessor},[P,j,d.accessor,d.pinned]),Se=n.useMemo(function(){return!(!ee||me)&&v(d,i).some(function(e){return ne.has(e)})},[ee,me,d,i,ne]),Me=n.useMemo(function(){return!me&&v(d,i).some(function(e){return F.has(e)})},[me,d,i,F]),Ne=n.useMemo(function(){return!(!d.children||0===d.children.length)&&(!xe||d.children.some(function(e){var n=e.showWhen||f;return"parentCollapsed"===n||"always"===n}))},[d.children,xe]),He=null==p?void 0:p.singleRowChildren,Ee=Ne&&!d.singleRowChildren,Te="st-header-cell ".concat(d.accessor===(null===(r=K.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(o=O.current)||void 0===o?void 0:o.accessor)===d.accessor?"st-dragging":""," ").concat(ve?"clickable":""," ").concat(A&&!ve?"columnReordering":""," ").concat(Ee?"parent":""," ").concat(He?"st-sub-header":""," ").concat(Ce?"st-last-column":""," ").concat(L&&!me?"st-header-editable":""," ").concat(Se?"st-header-selected":""," ").concat(Me&&!Se?"st-header-has-highlighted-cell":""),ke=Ae({draggedHeaderRef:O,headers:j,hoveredHeaderRef:K,onColumnOrderChange:_,onTableHeaderDragEnd:$}),Pe=ke.handleDragStart,Fe=ke.handleDragEnd,Oe=ke.handleDragOver,Le=Re();n.useEffect(function(){if(G&&!d.isSelectionColumn){var e=d.accessor+"";return G.set(e,{setEditing:function(e){C(e)}}),function(){G.delete(e)}}},[G,d.accessor,d.isSelectionColumn]),n.useEffect(function(){M(d.label||"")},[d.label]);var We=function(e){b(!x)},Be=n.useCallback(function(e){M(e);var n=j.map(function(n){return n.accessor===d.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});ie(n),Y&&Y(d,e)},[j,ie,Y,d]),qe=n.useCallback(function(){te&&te(null)},[te]),ze=n.useCallback(function(e){e.stopPropagation(),oe(function(e){var n=new Set(e);return xe?n.delete(d.accessor):n.add(d.accessor),n})},[oe,xe,d.accessor]),Ge=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ee){var r=v(t,i),o=r.some(function(e){return ne.has(e)});if(L&&o&&!n.shiftKey)return z&&we&&qe(),void C(!0);n.shiftKey&&Z?ce(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))}):Z&&Z(r),se(new Set),ue(null)}J&&J(t),!ee&&t.isSortable&&X(t.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!d)return null;var Ve=D&&!me&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(d.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,t=null===(n=document.getElementById(w({accessor:d.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Le({callback:Ye,callbackProps:{event:e.nativeEvent,header:d,headers:j,setHeaders:ie,setIsResizing:le,tableBodyContainerRef:de,startWidth:t,collapsedHeaders:k,autoExpandColumns:T,reverse:h},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(w({accessor:d.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Le({callback:Ye,callbackProps:{event:e,header:d,headers:j,setHeaders:ie,setIsResizing:le,tableBodyContainerRef:de,startWidth:t,collapsedHeaders:k,autoExpandColumns:T,reverse:h},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),je=m&&m.key.accessor===d.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return Ge({event:e,header:d})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||X(d.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(d.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&V.sortUp&&V.sortUp,"desc"===m.direction&&V.sortDown&&V.sortDown]})),Ke=pe&&V.filter&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:We,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(),We()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(d.label),"aria-expanded":x,"aria-haspopup":"dialog"},{children:[n.cloneElement(V.filter,{style:{fill:he?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(re,exports.__assign({open:x,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(gn,{header:d,currentFilter:he,onApplyFilter:function(e){W(e),b(!1)},onClearFilter:function(){B(d.accessor),b(!1)}})}))]})),Ue=ge&&!me&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return ze(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ze(e))},tabIndex:0,role:"button","aria-label":"".concat(xe?"Expand":"Collapse"," ").concat(d.label," column"),"aria-expanded":!xe},{children:xe?V.headerCollapse:V.headerExpand})),_e=e.jsx(xn,exports.__assign({content:d.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===d.align?"right-aligned":"center"===d.align?"center-aligned":"left-aligned")},{children:me?e.jsx(De,{checked:!!E&&E(),onChange:function(e){q&&q(e)},ariaLabel:"Select all rows"}):I?e.jsx(ae,{defaultValue:S,onBlur:function(){return C(!1)},onChange:Be}):S||(null==d?void 0:d.label)}))})),Je="header-desc-".concat(d.accessor),Xe=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(", ")}(d,pe);return e.jsxs(fe,exports.__assign({className:Te,id:w({accessor:d.accessor,rowId:"header"}),"aria-sort":function(){if(d.isSortable)return(null==m?void 0:m.key.accessor)===d.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"aria-describedby":Xe?Je:void 0,onDragOver:function(e){me||Le({callback:Oe,callbackProps:{event:e,hoveredHeader:d},limit:50})},style:exports.__assign({gridRowStart:c,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-c>1?{}:{height:Q})},{children:[h&&Ve,!d.headerRenderer&&"right"===d.align&&Ue,!d.headerRenderer&&"right"===d.align&&Ke,!d.headerRenderer&&"right"===d.align&&je,e.jsx("div",exports.__assign({ref:ye,className:"st-header-label",draggable:A&&!d.disableReorder&&!me,onClick:function(e){me||Ge({event:e,header:d})},onDoubleClick:function(e){me||function(e){var n=e.header;n.isSelectionColumn||ee&&n.isSortable&&X(n.accessor)}({event:e,header:d})},onDragEnd:me?void 0:function(e){e.preventDefault(),Fe()},onDragStart:me?void 0:function(e){A&&d&&function(e){Pe(e)}(d)}},{children:d.headerRenderer?d.headerRenderer({accessor:d.accessor,colIndex:i,header:d,components:{sortIcon:je||void 0,filterIcon:Ke||void 0,collapseIcon:Ue||void 0,labelContent:_e}}):_e})),!d.headerRenderer&&"right"!==d.align&&je,!d.headerRenderer&&"right"!==d.align&&Ke,!d.headerRenderer&&"right"!==d.align&&Ue,!h&&Ve,z&&!me&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:z({accessor:d.accessor,colIndex:i,header:d,isOpen:we,onClose:qe,position:Ie})})),Xe&&e.jsx("span",exports.__assign({id:Je,className:"st-sr-only"},{children:Xe}))]}))},yn=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=U().collapsedHeaders,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,s,c){var d,v;if(void 0===s&&(s=!1),!m({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;s||n++;var p,h,w=null!==(v=null===(d=o.children)||void 0===d?void 0:d.filter(function(e){return m({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==v?v:0,g=n;if(o.singleRowChildren&&w>0?(p=g+1,h=u+1):w>0?(p=g+w,h=i+1):(p=g+1,h=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:p,gridRowStart:i,gridRowEnd:h,colIndex:r[o.accessor],parentHeader:c}),o.children&&o.children.length>0){var x=o.singleRowChildren?i:i+1,b=!o.singleRowChildren;o.children.forEach(function(e){m({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(t(e,x,b,o),b=!1)})}return p-g},o=a.filter(function(e){return m({header:e,pinned:l,headers:a,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[a,u,l,r,f]);return e.jsx(je,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:v.map(function(n){return e.jsx(bn,{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},n.header.accessor)})})}))}))},In=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,a=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,l=t.pinnedRightColumns,s=t.pinnedRightTemplateColumns,c=t.sort,d=t.pinnedLeftWidth,f=t.pinnedRightWidth,v=U(),p=v.headerContainerRef,h=v.pinnedLeftRef,w=v.pinnedRightRef,m=v.collapsedHeaders,g=v.tableRows,x=v.maxHeaderDepth,b=n.useMemo(function(){return Ue({headers:o,pinnedLeftColumns:a,pinnedRightColumns:l,collapsedHeaders:m})},[o,a,l,m]),y=n.useMemo(function(){return Object.keys(b).length},[b]);return e.jsxs("div",exports.__assign({className:"st-header-container",ref:p,"aria-rowcount":g.length+x,"aria-colcount":y},{children:[Ne(o,"left")&&e.jsx(yn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:x,pinned:"left",sectionRef:h,sort:c,width:d}),e.jsx(yn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:x,sectionRef:r,sort:c}),Ne(o,"right")&&e.jsx(yn,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:x,pinned:"right",sectionRef:w,sort:c,width:f})]}))},Cn=function(e){var n=e.collapsedHeaders,t=e.autoExpandColumns,r=function(e){var t=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||f;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&t.push(e),o.length>0?r({headers:o,flattenedHeaders:t}):e.singleRowChildren||t.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||f;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&t.push(e),r({headers:i,flattenedHeaders:t})}else t.push(e)}),t},o=r({headers:e.headers,flattenedHeaders:[]});return"".concat(o.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,t)}).join(" "))},Rn=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=U(),g=m.columnResizing,x=m.editColumns,b=m.headers,y=m.collapsedHeaders,I=m.autoExpandColumns,C=n.useRef(null),R=b.filter(function(e){return!e.pinned}),S=b.filter(function(e){return"left"===e.pinned}),M=b.filter(function(e){return"right"===e.pinned}),N=n.useMemo(function(){return Cn({headers:S,collapsedHeaders:y,autoExpandColumns:I})},[S,y,I]),H=n.useMemo(function(){return Cn({headers:R,collapsedHeaders:y,autoExpandColumns:I})},[R,y,I]),E=n.useMemo(function(){return Cn({headers:M,collapsedHeaders:y,autoExpandColumns:I})},[M,y,I]),T={centerHeaderRef:C,headers:b,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedRightColumns:M,pinnedRightTemplateColumns:E,sort:c,pinnedLeftWidth:i,pinnedRightWidth:a},k={calculatedHeaderHeight:r,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedLeftWidth:i,pinnedRightColumns:M,pinnedRightTemplateColumns:E,pinnedRightWidth:a,rowsToRender:f,stickyParents:v,regularRows:p,partiallyVisibleRows:h,heightMap:w,setScrollDirection:l,setScrollTop:u,shouldShowEmptyState:s,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(In,exports.__assign({},T)),e.jsx(Je,exports.__assign({},k))]}))},Sn=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=U().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(je,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(je,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(je,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},Mn={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 Mn.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?Mn.string(e,n,t):"number"==typeof e&&"number"==typeof n?Mn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Mn.boolean(e,n,t):Mn.string(e+"",n+"",t)}},Nn=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=N(e,l),u=N(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 Mn.number(i,a,r)}return"date"===t?Mn.date(e+"",n+"",r):"boolean"===t?Mn.boolean(!!e,!!n,r):"enum"===t?Mn.enum(e+"",n+"",r):Mn.string(e+"",n+"",r)}(r,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Hn=function(e){return n.useMemo(function(){var n=p(e),t=new Map;return n.forEach(function(e){t.set(e.accessor,e)}),t},[e])},En=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}):Nn({headers:o,rows:n,sortColumn:t}):n},Tn=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(Tn([c],n,t),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},kn=function(e){return e.every(function(e){return e.hide})},Pn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Pn(e.children),kn(e.children)&&(e.hide=!0))})},An=function(n){var t=n.allHeaders,r=n.depth,o=void 0===r?0:r,i=n.doesAnyHeaderHaveChildren,a=n.draggingRow,l=n.expandedHeaders,s=n.flattenedHeaders,c=n.forceExpanded,d=void 0!==c&&c,f=n.header,v=n.hoveredSeparatorIndex,p=n.isCheckedOverride,h=n.rowIndex,w=n.setDraggingRow,m=n.setExpandedHeaders,g=n.setHoveredSeparatorIndex,x=U(),b=x.headers,y=x.icons,I=x.setHeaders,C=x.onColumnVisibilityChange,R=x.onColumnOrderChange,S="".concat(16*o,"px"),M=f.children&&f.children.length>0,N=null!=p?p:!(f.hide||M&&f.children&&kn(f.children)),H=l.has(f.accessor),E=d||H;return e.jsxs(e.Fragment,{children:[0===h&&e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:-1===v?1:0}}),e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:S},draggable:!0,onDragStart:function(e){e.dataTransfer.effectAllowed="move",void 0!==h&&w(s[h])},onDragEnter:function(e){e.preventDefault()},onDragOver:function(e){if(e.preventDefault(),void 0!==h&&a){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.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:s,draggingRow:a,hoveredRowIndex:h,isTopHalfOfRow:n.top+n.height/2>e.clientY});g(t)}},onDragEnd:function(){var e,n=function(){w(null),g(null)};if(a&&null!==v){var t=s[v>a.visualIndex?v:v+1];if(t)if(a.header.accessor!==(null===(e=s[v])||void 0===e?void 0:e.header.accessor)){var r=Pe(b,a.header,t.header),o=r.newHeaders;r.emergencyBreak||(null==R||R(o),I(o)),n()}else n();else n()}else n()}},{children:[i&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:M?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(E?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),function(){if(!d){var e=new Set(l);H?e.delete(f.accessor):e.add(f.accessor),m(e)}}()}},{children:y.expand})):null})),e.jsx(De,{checked:N,onChange:function(e){f.hide=!e,e?(Tn(t,f.accessor),M&&f.children&&f.children.length>0&&f.children.every(function(e){return!0===e.hide})&&f.children[0]&&(f.children[0].hide=!1,Tn(t,f.children[0].accessor))):Pn(t);var n=u([],b,!0);if(I(n),C){var r=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);C(r)}}}),e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:y.drag})),e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:f.label}))]})),e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:v===h?1:0}})]})},Dn=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 Dn(e,n)})},Fn=function(t){var r=t.headers,o=t.open,i=t.searchEnabled,a=t.searchPlaceholder,u=t.searchFunction,l=n.useState(""),s=l[0],c=l[1],d=n.useState(null),f=d[0],v=d[1],p=n.useState(null),h=p[0],w=p[1],m=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}),g=m[0],x=m[1],b=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]),y=n.useMemo(function(){return i?function(e,n,t){if(!n.trim())return e;var r=t||Dn;return e.filter(function(e){return!e.isSelectionColumn&&!e.excludeFromRender&&r(e,n)})}(r,s,u):r},[r,s,i,u]),I=n.useMemo(function(){var e=[],n=i&&s.trim().length>0,t=function(r,o,i){void 0===o&&(o=0),void 0===i&&(i=null),r.forEach(function(r){if(!r.isSelectionColumn&&!r.excludeFromRender){e.push({header:r,visualIndex:e.length,depth:o,parent:i});var a=r.children&&r.children.length>0,u=n||g.has(r.accessor);a&&u&&r.children&&t(r.children,o+1,r)}})};return t(y),e},[y,g,i,s]);return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""),onClick:function(e){return e.stopPropagation()}},{children:e.jsxs("div",exports.__assign({className:"st-column-editor-popout-content"},{children:[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:s,onChange:function(e){return c(e.target.value)},placeholder:a,className:"st-filter-input",onClick:function(e){return e.stopPropagation()}})}))})),e.jsx("div",exports.__assign({className:"st-column-editor-list"},{children:I.map(function(n){return e.jsx(An,{doesAnyHeaderHaveChildren:b,header:n.header,allHeaders:r,depth:n.depth,forceExpanded:i&&s.trim().length>0,rowIndex:n.visualIndex,draggingRow:f,setDraggingRow:v,hoveredSeparatorIndex:h,setHoveredSeparatorIndex:w,expandedHeaders:g,setExpandedHeaders:x,flattenedHeaders:I},"".concat(n.header.accessor,"-").concat(n.visualIndex))})}))]}))}))},On=function(n){var t=n.columnEditorText,r=n.headers,o=n.open,i=n.searchEnabled,a=n.searchPlaceholder,u=n.searchFunction,l=n.setOpen;return n.editColumns?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(o?"open":""),onClick:function(){l(!o)},style:{width:s}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:t})),e.jsx(Fn,{headers:r,open:o,searchEnabled:i,searchPlaceholder:a,searchFunction:u})]})):null},Ln=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(Ve.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:r.default.Children.only(o)}))},Wn=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=ge(e),v=ge((r||"")+""),p=me(f),h=me(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 me(ge((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 me(ge((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}}(N(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},Bn=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},qn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;if(r&&t&&E(t))i(t);else{var a=N(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}},zn=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},Gn=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)})}},Vn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},jn={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}},Kn=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")},Un=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(){Kn(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},_n=function(e){var t=e.rows,r=e.rowGrouping,o=void 0===r?[]: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:T({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,y=function(e,t,I,C,M){void 0===I&&(I=[]),void 0===C&&(C=[]),void 0===M&&(M=[]),e.forEach(function(e,N){var H,E,D=o[t],F=n.length,O=u(u([],I,!0),[N],!1),L=u(u([],C,!0),[N],!1),W=T({row:e,getRowId:i,depth:t,index:N,rowPath:O,rowIndexPath:L,groupingKey:D}),B=n.length,q={row:e,depth:t,displayPosition:b,groupingKey:D,position:F,isLastGroupRow:0===t,rowId:W,rowPath:O,rowIndexPath:L,absoluteRowIndex:F,parentIndices:M.length>0?u([],M,!0):void 0};n.push(q),r.push(q),b++;var z=k(W);if(A(z,t,s,a,l)&&o.length>t){var G=null==c?void 0:c.get(z),V=P(e,D),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===(H=j.nestedTable.customTheme)||void 0===H?void 0:H.rowHeight)||h,_=(null===(E=j.nestedTable.customTheme)||void 0===E?void 0:E.headerHeight)||w,J=R({childRowCount:V.length,rowHeight:U,headerHeight:_,customTheme:m}),Y=S({calculatedHeight:J,customHeight:j.nestedTable.height,customTheme:m});g.push([K,Y-h]);var X=u(u([],O,!0),[D],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:D,position:K,isLastGroupRow:!1,rowId:X,rowPath:X,rowIndexPath:L,nestedTable:{parentRow:e,expandableHeader:j,childAccessor:D,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([],O,!0),[D],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:D,position:$,isLastGroupRow:!1,rowId:Q,rowPath:Q,rowIndexPath:L,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([],O,!0),[D,"loading-skeleton"],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:D,position:Z,isLastGroupRow:!1,rowId:ee,rowPath:ee,rowIndexPath:L,isLoadingSkeleton:!0,absoluteRowIndex:Z,parentIndices:u(u([],M,!0),[B],!1)})}}else if(V.length>0){var ne=u(u([],O,!0),[D],!1),te=u([],L,!0);y(V,t+1,ne,te,u(u([],M,!0),[B],!1))}}0===t&&x.push(n.length)})};return y(t,0,[],[],[]),{flattenedRows:n,heightOffsets:g,paginatableRows:r,parentEndPositions:x}},[t,o,i,a,l,s,c,d,f,v,p,h,w,m])},Jn=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},Yn={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},Xn={text:"Columns",searchEnabled:!0,searchPlaceholder:"Search columns..."},$n=[{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."}],Qn=function(t){var r=n.useState(!1),o=r[0],i=r[1];return n.useEffect(function(){!function(e){"production"!==process.env.NODE_ENV&&$n.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(Zn,exports.__assign({},t)):null},Zn=function(t){var r=t.allowAnimations,o=void 0!==r&&r,s=t.autoExpandColumns,c=void 0!==s&&s,f=t.canExpandRowGroup,v=t.cellUpdateFlash,h=void 0!==v&&v,w=t.className,m=t.columnBorders,b=void 0!==m&&m,y=t.columnEditorConfig,I=void 0===y?Xn:y,C=t.columnEditorText,R=t.columnReordering,S=void 0!==R&&R,M=t.columnResizing,P=void 0!==M&&M,A=t.copyHeadersToClipboard,F=void 0!==A&&A,O=t.customTheme,W=t.defaultHeaders,B=t.editColumns,z=void 0!==B&&B,j=t.editColumnsInitOpen,U=void 0!==j&&j,$=t.emptyStateRenderer,ne=t.enableHeaderEditing,re=void 0!==ne&&ne,oe=t.enableRowSelection,ie=void 0!==oe&&oe,ae=t.enableStickyParents,ue=void 0!==ae&&ae,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,Me=void 0!==Re&&Re,Ne=t.icons,He=t.includeHeadersInCSVExport,Ee=void 0===He||He,Te=t.initialSortColumn,ke=t.initialSortDirection,Pe=void 0===ke?"asc":ke,Ae=t.isLoading,De=void 0!==Ae&&Ae,Fe=t.loadingStateRenderer,Oe=t.maxHeight,Le=t.nextIcon,We=t.onCellClick,Be=t.onCellEdit,qe=t.onColumnOrderChange,ze=t.onColumnSelect,Ge=t.onColumnVisibilityChange,Ve=t.onFilterChange,je=t.onGridReady,Ke=t.onHeaderEdit,Ue=t.onLoadMore,_e=t.onNextPage,Je=t.onPageChange,Ye=t.onRowGroupExpand,Xe=t.onRowSelectionChange,Qe=t.onSortChange,Ze=t.prevIcon,en=t.quickFilter,nn=t.rowButtons,tn=t.rowGrouping,rn=t.getRowId,on=t.rows,an=t.rowsPerPage,un=void 0===an?10:an,ln=t.selectableCells,sn=void 0!==ln&&ln,cn=t.selectableColumns,dn=void 0!==cn&&cn,fn=t.serverSidePagination,vn=void 0!==fn&&fn,pn=t.shouldPaginate,hn=void 0!==pn&&pn,wn=t.sortDownIcon,mn=t.sortUpIcon,gn=t.tableEmptyStateRenderer,xn=void 0===gn?e.jsx(Jn,{}):gn,bn=t.tableRef,yn=t.theme,In=void 0===yn?"light":yn,Cn=t.totalRowCount,Mn=t.useHoverRowBackground,Tn=void 0===Mn||Mn,kn=t.useOddColumnBackground,Pn=void 0!==kn&&kn,An=t.useOddEvenRowBackground,Dn=void 0!==An&&An,Fn=n.useMemo(function(){var n,t,r,o,i,a,u,l,s,c,d,f,v,p,h,w,m,g={drag:e.jsx(Z,{className:"st-drag-icon"}),expand:e.jsx(Y,{className:"st-expand-icon"}),filter:e.jsx(ee,{className:"st-header-icon"}),headerCollapse:e.jsx(Y,{className:"st-header-icon"}),headerExpand:e.jsx(J,{className:"st-header-icon"}),next:e.jsx(Y,{className:"st-next-prev-icon"}),prev:e.jsx(J,{className:"st-next-prev-icon"}),sortDown:e.jsx(Q,{className:"st-header-icon"}),sortUp:e.jsx(X,{className:"st-header-icon"})};return{drag:null!==(n=null==Ne?void 0:Ne.drag)&&void 0!==n?n:g.drag,expand:null!==(r=null!==(t=null==Ne?void 0:Ne.expand)&&void 0!==t?t:de)&&void 0!==r?r:g.expand,filter:null!==(i=null!==(o=null==Ne?void 0:Ne.filter)&&void 0!==o?o:we)&&void 0!==i?i:g.filter,headerCollapse:null!==(u=null!==(a=null==Ne?void 0:Ne.headerCollapse)&&void 0!==a?a:ge)&&void 0!==u?u:g.headerCollapse,headerExpand:null!==(s=null!==(l=null==Ne?void 0:Ne.headerExpand)&&void 0!==l?l:be)&&void 0!==s?s:g.headerExpand,next:null!==(d=null!==(c=null==Ne?void 0:Ne.next)&&void 0!==c?c:Le)&&void 0!==d?d:g.next,prev:null!==(v=null!==(f=null==Ne?void 0:Ne.prev)&&void 0!==f?f:Ze)&&void 0!==v?v:g.prev,sortDown:null!==(h=null!==(p=null==Ne?void 0:Ne.sortDown)&&void 0!==p?p:wn)&&void 0!==h?h:g.sortDown,sortUp:null!==(m=null!==(w=null==Ne?void 0:Ne.sortUp)&&void 0!==w?w:mn)&&void 0!==m?m:g.sortUp}},[Ne,de,we,ge,be,Le,Ze,wn,mn]),Vn=n.useMemo(function(){return exports.__assign(exports.__assign({},Yn),O)},[O]),Kn=n.useMemo(function(){var e,n,t,r;return{text:null!==(n=null!==(e=null==I?void 0:I.text)&&void 0!==e?e:C)&&void 0!==n?n:Xn.text,searchEnabled:null!==(t=null==I?void 0:I.searchEnabled)&&void 0!==t?t:Xn.searchEnabled,searchPlaceholder:null!==(r=null==I?void 0:I.searchPlaceholder)&&void 0!==r?r:Xn.searchPlaceholder,searchFunction:null==I?void 0:I.searchFunction}},[I,C]),Un=Vn.rowHeight,$n=Vn.headerHeight,Qn=Vn.footerHeight,Zn=Vn.selectionColumnWidth;Pn&&(Dn=!1),b&&(Tn=!1);var et=n.useRef(null),nt=n.useRef(null),tt=n.useRef(null),rt=n.useRef(null),ot=n.useRef(null),it=n.useRef(null),at=n.useRef(null),ut=n.useReducer(function(e){return e+1},0)[1],lt=n.useState(new Map),st=lt[0],ct=lt[1],dt=n.useState(on),ft=dt[0],vt=dt[1],pt=n.useState(De),ht=pt[0],wt=pt[1],mt=n.useRef(De),gt=n.useRef(new Map);n.useEffect(function(){vt(on);var e=new Map;on.forEach(function(n,t){var r=T({row:n,getRowId:rn,depth:0,index:t,rowPath:[t],rowIndexPath:[t]}),o=k(r);e.set(o,t)}),gt.current=e},[on,rn]),n.useEffect(function(){var e=mt.current,n=De;n&&!e?wt(!0):!n&&e&&setTimeout(function(){wt(!1)},0),mt.current=De},[De]);var xt,bt,yt,It,Ct,Rt,St,Mt,Nt,Ht,Et=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:it}),Tt=Et.scrollbarWidth,kt=Et.setScrollbarWidth,Pt=te({headerContainerRef:at,mainSectionRef:it,scrollbarWidth:Tt}).isMainSectionScrollable,At=n.useMemo(function(){if(ht&&0===ft.length){var e=hn?un:10;return Pt&&(e+=1),Array.from({length:e},function(e,n){return{}})}return ft},[ht,ft,un,Pt,hn]),Dt=n.useState(1),Ft=Dt[0],Ot=Dt[1],Lt=n.useState(W),Wt=Lt[0],Bt=Lt[1],qt=n.useState(!1),zt=qt[0],Gt=qt[1],Vt=n.useState(!1),jt=Vt[0],Kt=Vt[1],Ut=n.useState(null),_t=Ut[0],Jt=Ut[1],Yt=n.useState(U),Xt=Yt[0],$t=Yt[1],Qt=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(W),e},[W]),Zt=n.useState(Qt),er=Zt[0],nr=Zt[1];n.useEffect(function(){Bt(W)},[W]);var tr=n.useMemo(function(){var e,n=u([],Wt,!0);return ie&&!(null===(e=null==Wt?void 0:Wt[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},[ie,Wt,Zn]),rr=n.useState(0),or=rr[0],ir=rr[1],ar=n.useState("none"),ur=ar[0],lr=ar[1],sr=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,tn),cr=sr.expandedDepths,dr=sr.setExpandedDepths,fr=n.useState(new Map),vr=fr[0],pr=fr[1],hr=n.useState(new Map),wr=hr[0],mr=hr[1],gr=function(){var e=n.useState(""),t=e[0],r=e[1],o=n.useRef(null);return n.useEffect(function(){return t&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){r("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[t]),{announcement:t,announce:function(e){r(e)}}}(),xr=gr.announcement,br=gr.announce,yr=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(){i.current&&l(i.current.clientWidth)};e();var n=null;return i.current&&(n=new ResizeObserver(e)).observe(i.current),function(){n&&n.disconnect()}},[i]),{containerWidth:u,calculatedHeaderHeight:d,maxHeaderDepth:c}}({effectiveHeaders:tr,headerHeight:$n,rowHeight:Un,tableBodyContainerRef:it}),Ir=yr.containerWidth,Cr=yr.calculatedHeaderHeight,Rr=yr.maxHeaderDepth,Sr=n.useRef(0),Mr=n.useRef(0),Nr=n.useMemo(function(){var e=d(window.innerWidth),n=$e({headers:tr,containerWidth:Ir,maxPinnedWidthPercent:e,collapsedHeaders:er});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[tr,Ir,er]),Hr=Nr.mainBodyWidth,Er=Nr.pinnedLeftWidth,Tr=Nr.pinnedRightWidth,kr=Nr.pinnedLeftContentWidth,Pr=Nr.pinnedRightContentWidth;n.useEffect(function(){if(c&&0!==Ir&&!zt){var e,n=function(e){var t=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?t.push.apply(t,n(e.children)):t.push(e))}),t};if((e=tt.current?tt.current.clientWidth:Math.max(0,Ir-Er-Tr))>0){var t=Wt.filter(function(e){return!e.pinned});n(t).length===Mr.current&&10>Math.abs(e-Sr.current)||Bt(function(t){var r=t.filter(function(e){return!e.pinned}),o=n(r),i=o.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===i)return t;var a=e/i;if(.01>Math.abs(a-1))return t;Sr.current=e,Mr.current=o.length;var u=new Map,l=0;o.forEach(function(n,t){if(!n.pinned){var r,i="number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150;t===o.length-1?r=e-l:l+=r=Math.round(i*a),u.set(n.accessor,r)}});var s=function(e){var n;if(e.hide)return e;var t=null===(n=e.children)||void 0===n?void 0:n.map(s);if(!e.children||0===e.children.length){if(e.pinned)return exports.__assign(exports.__assign({},e),{children:t});var r=u.get(e.accessor);if(void 0!==r)return exports.__assign(exports.__assign({},e),{width:r,children:t});var o="number"==typeof e.width?e.width:"string"==typeof e.width&&e.width.endsWith("px")?parseFloat(e.width):150;return exports.__assign(exports.__assign({},e),{width:Math.round(o*a),children:t})}return exports.__assign(exports.__assign({},e),{children:t})};return t.map(s)})}}},[c,Ir,zt,Wt,Er,Tr]);var Ar=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 p(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&&E(u)){var l=i(u,t+1),s=exports.__assign({},n);return s[r]=l,e.forEach(function(e){var n=qn(l,e.accessor,e.aggregation,a);void 0!==n&&H(s,e.accessor,n)}),s}return n})};return i(n)},[t,r,o])}({rows:At,headers:Wt,rowGrouping:tn}),Dr=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=N(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=N(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:Ar,headers:tr,quickFilter:en}),Fr=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=Hn(r),d=n.useMemo(function(){return Wn({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 Wn({externalFilterHandling:o,tableRows:t,filterState:r})},[l,t,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Dr,headers:tr,externalFilterHandling:ve,onFilterChange:Ve,announce:br}),Or=Fr.filters,Lr=Fr.updateFilter,Wr=Fr.clearFilter,Br=Fr.clearAllFilters,qr=Fr.computeFilteredRowsPreview,zr=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=Hn(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=Nn({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(E(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 En({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 En({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:Wt,tableRows:Fr.filteredRows,externalSortHandling:he,onSortChange:Qe,rowGrouping:tn,initialSortColumn:Te,initialSortDirection:Pe,announce:br}),Gr=zr.sort,Vr=zr.updateSort,jr=zr.computeSortedRowsPreview,Kr=_n({rows:zr.sortedRows,rowGrouping:tn,getRowId:rn,expandedRows:vr,collapsedRows:wr,expandedDepths:cr,rowStateMap:st,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!$,headers:tr,rowHeight:Un,headerHeight:$n,customTheme:Vn}),Ur=Kr.flattenedRows,_r=Kr.heightOffsets,Jr=Kr.paginatableRows,Yr=Kr.parentEndPositions,Xr=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(k(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(k(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 k(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 k(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 k(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 k(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:Ur,onRowSelectionChange:Xe,enableRowSelection:ie});xt=Xr.selectedRows,bt=Xr.setSelectedRows,yt=Xr.isRowSelected,It=Xr.areAllRowsSelected,Ct=Xr.selectedRowCount,Rt=Xr.selectedRowsData,St=Xr.handleRowSelect,Mt=Xr.handleSelectAll,Nt=Xr.handleToggleRow,Ht=Xr.clearSelection;var $r=_n({rows:Ar,rowGrouping:tn,getRowId:rn,expandedRows:vr,collapsedRows:wr,expandedDepths:cr,rowStateMap:st,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!$,headers:tr,rowHeight:Un,headerHeight:$n,customTheme:Vn}).flattenedRows,Qr=n.useCallback(function(e){var n=qr(e);return tn&&0!==tn.length?D({rows:n,rowGrouping:tn,getRowId:rn,expandedRows:vr,collapsedRows:wr,expandedDepths:cr,rowStateMap:st,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!$,headers:tr,rowHeight:Un,headerHeight:$n,customTheme:Vn}):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}})},[qr,tn,rn,vr,wr,cr,st,Fe,le,$,tr,Un,$n,Vn]),Zr=n.useCallback(function(e){var n=jr(e);return tn&&0!==tn.length?D({rows:n,rowGrouping:tn,getRowId:rn,expandedRows:vr,collapsedRows:wr,expandedDepths:cr,rowStateMap:st,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!$,headers:tr,rowHeight:Un,headerHeight:$n,customTheme:Vn}):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}})},[jr,tn,rn,vr,wr,cr,st,Fe,le,$,tr,Un,$n,Vn]),eo=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=Bn(r);if(0===e)return;var n=a||o;if(e>=n+i*o+(u||0)||20>i)return;return Math.max(0,e-n)}if(t){var l=Bn(t);if(0!==l)return Math.max(0,l-o)}},[t,r,o,i,a,u])}({height:ye,maxHeight:Oe,rowHeight:Un,shouldPaginate:hn,rowsPerPage:un,totalRowCount:null!=Cn?Cn:Jr.length,headerHeight:Cr,footerHeight:hn&&!Ce?Qn:void 0}),no=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],H=M[1],E=n.useRef([]),T=n.useRef([]),P=n.useMemo(function(){return l(h)},[h]),A=n.useRef(new Map),D=n.useRef(null),F=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=k(n.rowId);e.set(r,t)}),A.current=e}},[v]);var O=n.useMemo(function(){return F(d,p)},[d,p,F]),W=n.useMemo(function(){if(!f||0===f.length||!y||b)return f;var e=new Map;return O.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,O,y,b]),B=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}}(O.length,h,W,s)},[O.length,h,W,s]),z=n.useMemo(function(){return void 0===i?O:L({bufferRowCount:P,contentHeight:i,tableRows:O,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:B}).rendered.rows},[O,i,h,x,g,P,B]),G=n.useMemo(function(){if(!c||void 0===i)return{stickyParents:[],regularRows:z,partiallyVisibleRows:[]};var e=L({bufferRowCount:P,contentHeight:i,tableRows:O,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:B}),n=I?function(e,n,t,r,o){return q({allTableRows:e,renderedRows:n,fullyVisibleRows:t,partiallyVisibleRows:r,partiallyVisibleRowIndex:0,recursionDepth:0,stickyParents:[],rowGrouping:o})}(O,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,O,c,B,I,h,g,x,z]),V=G.stickyParents,j=G.regularRows,K=G.partiallyVisibleRows,U=n.useCallback(function(e,n){var t=new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return k(e.rowId)})),r=new Set(n.filter(function(e){return e&&e.rowId}).map(function(e){return k(e.rowId)}));return{staying:n.filter(function(e){var n=k(e.rowId);return t.has(n)}),entering:n.filter(function(e){var n=k(e.rowId);return!t.has(n)}),leaving:e.filter(function(e){var n=k(e.rowId);return!r.has(n)})}},[]),_=n.useMemo(function(){if(0===E.current.length)return!1;var e=O.filter(function(e){return e&&e.rowId}).map(function(e){return k(e.rowId)}),n=E.current.filter(function(e){return e&&e.rowId}).map(function(e){return k(e.rowId)});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[O]);n.useLayoutEffect(function(){if(!R){var e=function(){N.length>0&&H([])};if(!t||y)return e(),E.current=O,void(T.current=z);if(0===E.current.length)return e(),E.current=O,void(T.current=z);if(!_)return e(),E.current=O,void(T.current=z);D.current={tableRows:O,visibleRows:z},S(!0)}},[t,O,N.length,_,R,y,z]),n.useLayoutEffect(function(){if(R&&D.current&&N.length>0){var e=setTimeout(function(){var e=D.current;S(!1),H([]),E.current=e.tableRows,T.current=e.visibleRows,D.current=null},jn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[R,N.length]);var J=n.useMemo(function(){if(!t||y)return z;if(N.length>0){var e=new Map,n=new Map;return O.forEach(function(t){var r=k(t.rowId);e.set(r,t.position),n.set(r,t.displayPosition)}),N.map(function(t){var r=k(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 z},[z,N,O,t,y]),Y=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=r(e),o=F(n,[]),a=L({bufferRowCount:P,contentHeight:i,tableRows:o,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:B}),l=U(z,a.rendered.rows).entering.map(function(e){var n=k(e.rowId)+"";return O.find(function(e){return k(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&H(u(u([],z,!0),l,!0))}},[t,y,r,F,i,h,x,g,U,O,z,P,B]),X=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=o(e),r=F(n,[]),a=L({bufferRowCount:P,contentHeight:i,tableRows:r,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:B}),l=U(z,a.rendered.rows).entering.map(function(e){var n=k(e.rowId)+"";return O.find(function(e){return k(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&H(u(u([],z,!0),l,!0))}},[t,y,o,F,i,h,x,g,U,O,z,P,B]);return{currentTableRows:O,currentVisibleRows:z,isAnimating:R,prepareForFilterChange:Y,prepareForSortChange:X,rowsToRender:J,stickyParents:V,regularRows:j,partiallyVisibleRows:K,paginatedHeightOffsets:W,heightMap:B}}({allowAnimations:o,computeFilteredRowsPreview:Qr,computeSortedRowsPreview:Zr,contentHeight:eo,currentPage:Ft,customTheme:Vn,enableStickyParents:ue,flattenedRows:Ur,heightOffsets:_r,originalFlattenedRows:$r,paginatableRows:Jr,parentEndPositions:Yr,rowGrouping:tn,rowHeight:Un,rowsPerPage:un,scrollDirection:ur,scrollTop:or,serverSidePagination:vn,shouldPaginate:hn}),to=no.currentTableRows,ro=no.rowsToRender,oo=no.prepareForFilterChange,io=no.prepareForSortChange,ao=no.isAnimating,uo=no.stickyParents,lo=no.regularRows,so=no.partiallyVisibleRows,co=no.paginatedHeightOffsets,fo=no.heightMap,vo=n.useRef(new Map),po=n.useRef(new Map),ho=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],b=n.useState(new Set),y=b[0],I=b[1],C=n.useState(null),R=C[0],S=C[1],M=n.useState(null),E=M[0],T=M[1],P=n.useState(new Set),A=P[0],D=P[1],F=n.useState(new Set),O=F[0],L=F[1],W=n.useState(!1),B=W[0],q=W[1],z=n.useRef(!1),j=n.useRef(null),K=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)}}),y.forEach(function(n){e.add(n)}),e},[m,y]),U=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)}}),y.size>0&&o.forEach(function(n){var t=k(n.rowId);e.add(t)}),e},[m,y,o]),_=n.useMemo(function(){return r.flatMap(function(e){return x(e,s)})},[r,s]),J=n.useCallback(function(){if(0!==m.size){var e=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=N(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}(m,_,o,p);navigator.clipboard.writeText(e),D(new Set(m)),setTimeout(function(){return D(new Set)},800)}},[m,_,o,p]),Y=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i;return a(this,function(a){switch(a.label){case 0:if(!E)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,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=k(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(H(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}}(e,E,_,o,u,l),r=n.warningCells,(t=n.updatedCells).size>0&&(D(t),setTimeout(function(){return D(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[E,_,o,u,l]),X=n.useCallback(function(){if(0!==m.size){var e=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=k(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(N(c.row,d.accessor))?[]:""),H(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}}(m,_,o,u,l),n=e.deletedCells,t=e.warningCells;n.size>0&&(D(n),setTimeout(function(){return D(new Set)},800)),t.size>0&&(L(t),setTimeout(function(){return L(new Set)},800))}},[m,_,o,u,l]),$=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=k(o[l].rowId);t.add(V({colIndex:s,rowIndex:l,rowId:d}))}I(new Set),S(null),g(t),T(n),setTimeout(function(){return G(n,c,h)},0)},[o,c,f,h]),Q=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?_.length:_.length-1)>=e.colIndex){var n=V(e);I(new Set),S(null),g(new Set([n])),T(e),setTimeout(function(){return G(e,c,h)},0)}},[_.length,o.length,c,f,h]),Z=n.useCallback(function(e,n){void 0===n&&(n=!1),g(new Set),T(null),I(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&S(e[e.length-1])},[]);!function(e){var t=e.copyToClipboard,r=e.deleteSelectedCells,o=e.enableRowSelection,i=void 0!==o&&o,a=e.initialFocusedCell,u=e.leafHeaders,l=e.pasteFromClipboard,s=e.selectCellRange,c=e.selectSingleCell,d=e.selectableCells,f=e.selectedCells,v=e.setLastSelectedColumnIndex,p=e.setSelectedCells,h=e.setSelectedColumns,w=e.startCell,m=e.tableRows;n.useEffect(function(){var e=function(e){if(d&&a&&0!==f.size){var s=document.activeElement;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement||"true"===(null==s?void 0:s.getAttribute("contenteditable")))){var c=a.rowIndex,R=a.colIndex,S=a.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 M=new Set,N=0;m.length>N;N++)for(var H=0;u.length>H;H++){var E=i?H+1:H,T=k(m[N].rowId);M.add("".concat(N,"-").concat(E,"-").concat(T))}return p(M),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void r();var P=m[c];if((P?k(P.rowId):null)!==S){var A=m.findIndex(function(e){return k(e.rowId)===S});if(-1===A)return;c=A}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}};"ArrowUp"===e.key?(e.preventDefault(),n(e,c,R,D)):"ArrowDown"===e.key?(e.preventDefault(),o(e,c,R,D)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,c,R,D)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,c,R,D)):"Home"===e.key?(e.preventDefault(),b(e,c)):"End"===e.key?(e.preventDefault(),y(e,c)):"PageUp"===e.key?(e.preventDefault(),I(e,c,R)):"PageDown"===e.key?(e.preventDefault(),C(e,c,R)):"Escape"===e.key&&(p(new Set),h(new Set),v(null),w.current=null)}else t()}}},n=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),o>=0){var i=k(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=k(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);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),m.length>o){var i=k(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=k(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);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=k(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=k(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);var l=t+1;if((e.ctrlKey||e.metaKey)&&(l=r(n,t,"right").colIndex),o>=l){var d=k(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=k(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);var r=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(r=0);var u=k(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=k(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);var r=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(r=m.length-1);var l=k(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=k(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);var o=k(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=k(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);var o=k(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=k(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,m,u,c,s,f,p,h,v,t,l,r,w,i])}({selectableCells:t,initialFocusedCell:E,tableRows:o,leafHeaders:_,selectSingleCell:Q,selectCellRange:$,selectedCells:m,setSelectedCells:g,setSelectedColumns:I,setLastSelectedColumnIndex:S,copyToClipboard:J,pasteFromClipboard:Y,deleteSelectedCells:X,startCell:j,enableRowSelection:f});var ee=n.useCallback(function(e,n){var t=new Set,r=new Map;o.forEach(function(e,n){var t=k(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=k(o[p].rowId);t.add(V({colIndex:h,rowIndex:p,rowId:w}))}g(t)},[o,f]),ne=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},[]),te=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 ne(e,n)},[ne]),re=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)))}},[]),oe=n.useCallback(function(e){var n=e.colIndex,t=V({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),r=m.has(t),o=y.has(n);return r||o},[m,y]),ie=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?k(a.rowId):null,l=o[t+1],s=l?k(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||!oe(c)||y.has(n)&&0===t)&&i.push("st-selected-top-border"),(!d||!oe(d)||y.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),oe(f)||i.push("st-selected-left-border"),oe(v)||i.push("st-selected-right-border"),i.join(" ")},[B,oe,o,y]),ae=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),ue=n.useCallback(function(e){var n=V({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return A.has(n)},[A]),le=n.useCallback(function(e){var n=V({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return O.has(n)},[O]);return{getBorderClass:ie,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){z.current=!0,q(!0),j.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){I(new Set),S(null);var e=V({colIndex:n,rowIndex:r,rowId:o});g(new Set([e])),T({rowIndex:r,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,s=function(){if(z.current&&j.current){if(null!==i&&null!==a){re(i,a);var e=Date.now();if(e-l>=16){var n=te(i,a);n&&ee(j.current,n),l=e}}u=requestAnimationFrame(s)}else null!==u&&(cancelAnimationFrame(u),u=null)},c=function(e){z.current&&j.current&&(i=e.clientX,a=e.clientY)},d=function(){z.current=!1,q(!1),null!==u&&(cancelAnimationFrame(u),u=null),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",d),u=requestAnimationFrame(s)}},handleMouseOver:function(e){t&&z.current&&j.current&&ee(j.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ue,isWarningFlashing:le,isInitialFocusedCell:ae,isSelected:oe,lastSelectedColumnIndex:R,pasteFromClipboard:Y,selectColumns:Z,selectedCells:m,selectedColumns:y,setInitialFocusedCell:T,setSelectedCells:g,setSelectedColumns:I,deleteSelectedCells:X,columnsWithSelectedCells:K,rowsWithSelectedCells:U,startCell:j}}({selectableCells:sn,headers:tr,tableRows:to,onCellEdit:Be,cellRegistry:vo.current,collapsedHeaders:er,rowHeight:Un,enableRowSelection:ie,copyHeadersToClipboard:F,customTheme:Vn}),wo=ho.getBorderClass,mo=ho.handleMouseDown,go=ho.handleMouseOver,xo=ho.isCopyFlashing,bo=ho.isInitialFocusedCell,yo=ho.isSelected,Io=ho.isWarningFlashing,Co=ho.selectColumns,Ro=ho.selectedCells,So=ho.selectedColumns,Mo=ho.setInitialFocusedCell,No=ho.setSelectedCells,Ho=ho.setSelectedColumns,Eo=ho.columnsWithSelectedCells,To=ho.rowsWithSelectedCells,ko=ho.startCell,Po=n.useCallback(function(e){io(e),setTimeout(function(){Vr({accessor:e})},0)},[io,Vr]),Ao=n.useCallback(function(e){Bt(e)},[]);!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:dn,selectedCells:Ro,selectedColumns:So,setSelectedCells:No,setSelectedColumns:Ho,activeHeaderDropdown:_t,setActiveHeaderDropdown:Jt,startCell:ko}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){t(),r.current&&o(r.current.offsetWidth-r.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:ut,tableBodyContainerRef:it,setScrollbarWidth:kt}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:je}),function(e){var t=e.cellRegistryRef,r=e.clearAllFilters,o=e.clearFilter,l=e.currentPage,s=e.editColumns,c=e.expandedDepths,d=e.filters,f=e.flattenedRows,v=e.headerRegistryRef,p=e.headers,h=e.includeHeadersInCSVExport,w=e.onColumnVisibilityChange,m=e.onPageChange,x=e.paginatableRows,b=e.quickFilter,y=e.rowGrouping,I=e.rows,C=e.rowsPerPage,R=e.setCollapsedRows,S=e.setColumnEditorOpen,M=e.setCurrentPage,E=e.setExpandedDepths,T=e.setExpandedRows,P=e.setHeaders,A=e.sort,D=e.tableRef,F=e.totalRowCount,O=e.updateFilter,L=e.updateSort,W=e.visibleRows;n.useEffect(function(){D&&(D.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==I?void 0:I[r];if(i){var a=f.find(function(e){return e.absoluteRowIndex===r});if(a){var u=k(a.rowId),l=g({rowId:u,accessor:n}),s=t.current.get(l);s&&s.updateContent(o)}void 0!==N(i,n)&&H(i,n,o)}},setHeaderRename:function(e){var n=v.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return W},getAllRows:function(){return f},getHeaders:function(){return p},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 zn(e.label)}).join(","),i=e.map(function(e,n){var t=e.row;return r.map(function(e,r){var o=N(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 zn(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}),zn(i)):zn(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)}(f,p,(void 0===e?{}:e).filename,h)},getSortState:function(){return A},applySortState:Gn(L),getFilterState:function(){return d},applyFilter:Gn(O),clearFilter:Gn(o),clearAllFilters:Gn(r),getCurrentPage:function(){return l},getTotalPages:function(){return Math.ceil((null!=F?F:x.length)/C)},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!=F?F:x.length)/C),1>e||e>n?[3,2]:(M(e),m?[4,m(e)]:[3,2]);case 1:t.sent(),t.label=2;case 2:return[2]}})})},expandAll:function(){var e=Array.from({length:(null==y?void 0:y.length)||0},function(e,n){return n});E(new Set(e)),T(new Map),R(new Map)},collapseAll:function(){E(new Set),T(new Map),R(new Map)},expandDepth:function(e){E(function(n){for(var t=new Set(n),r=0;e>=r;r++)t.add(r);return 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}),R(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){E(function(n){var t=new Set(n);return t.delete(e),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}),R(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){E(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),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}),R(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){E(e)},getExpandedDepths:function(){return c},getGroupingProperty:function(e){return null==y?void 0:y[e]},getGroupingDepth:function(e){var n;return null!==(n=null==y?void 0:y.indexOf(e))&&void 0!==n?n:-1},toggleColumnEditor:function(e){s&&S(void 0!==e?e:function(e){return!e})},applyColumnVisibility:Gn(function(e){var n=function(t){return t.map(function(t){var r=t.accessor+"",o=r in e;return exports.__assign(exports.__assign({},t),{hide:o?!e[r]:t.hide,children:t.children?n(t.children):t.children})})};P(function(e){return n(e)}),w&&w(e)}),setQuickFilter:function(e){(null==b?void 0:b.onChange)&&b.onChange(e)}})},[t,r,o,l,s,c,d,f,v,p,h,w,m,x,b,y,e.rowIndexMap,I,C,e.serverSidePagination,R,S,M,E,T,P,e.setRows,e.shouldPaginate,A,D,F,O,L,W])}({cellRegistryRef:vo,clearAllFilters:Br,clearFilter:Wr,currentPage:Ft,editColumns:z,expandedDepths:cr,filters:Or,flattenedRows:Ur,headerRegistryRef:po,headers:tr,includeHeadersInCSVExport:Ee,onColumnVisibilityChange:Ge,onPageChange:Je,paginatableRows:Jr,quickFilter:en,rowGrouping:tn,rowIndexMap:gt,rows:At,rowsPerPage:un,serverSidePagination:vn,setCollapsedRows:mr,setColumnEditorOpen:$t,setCurrentPage:Ot,setExpandedDepths:dr,setExpandedRows:pr,setHeaders:Bt,setRows:vt,shouldPaginate:hn,sort:Gr,tableRef:bn,totalRowCount:Cn,updateFilter:Lr,updateSort:Vr,visibleRows:ro}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:Or,onFilterChange:Ve}),function(e){var t=e.sort,r=e.onSortChange,o=Se(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:Gr,onSortChange:Qe});var Do=n.useCallback(function(e){oo(e),setTimeout(function(){Lr(e)},0)},[oo,Lr]),Fo=!ht&&0===to.length;return e.jsx(K,exports.__assign({value:{activeHeaderDropdown:_t,allowAnimations:o,areAllRowsSelected:It,autoExpandColumns:c,canExpandRowGroup:f,cellRegistry:vo.current,cellUpdateFlash:h,clearSelection:Ht,collapsedHeaders:er,columnBorders:b,columnReordering:S,columnResizing:P,columnsWithSelectedCells:Eo,copyHeadersToClipboard:F,draggedHeaderRef:et,editColumns:z,emptyStateRenderer:$,enableHeaderEditing:re,enableRowSelection:ie,errorStateRenderer:le,expandedDepths:cr,filters:Or,icons:Fn,forceUpdate:ut,getBorderClass:wo,handleApplyFilter:Do,handleClearAllFilters:Br,handleClearFilter:Wr,handleMouseDown:mo,handleMouseOver:go,handleRowSelect:St,handleSelectAll:Mt,handleToggleRow:Nt,headerContainerRef:at,headerDropdown:xe,headerHeight:$n,headerRegistry:po.current,headers:tr,heightOffsets:co,hoveredHeaderRef:nt,includeHeadersInCSVExport:Ee,isAnimating:ao,isCopyFlashing:xo,isInitialFocusedCell:bo,isLoading:ht,isResizing:zt,isRowSelected:yt,isScrolling:jt,isSelected:yo,isWarningFlashing:Io,loadingStateRenderer:Fe,mainBodyRef:tt,maxHeaderDepth:Rr,onCellClick:We,onCellEdit:Be,onColumnOrderChange:qe,onColumnSelect:ze,onColumnVisibilityChange:Ge,onHeaderEdit:Ke,onLoadMore:Ue,onRowGroupExpand:Ye,onSort:Po,onTableHeaderDragEnd:Ao,pinnedLeftRef:rt,pinnedRightRef:ot,rowButtons:nn,rowGrouping:tn,rowHeight:Un,rowStateMap:st,rows:ft,rowsWithSelectedCells:To,scrollbarWidth:Tt,selectColumns:Co,selectableColumns:dn,selectedColumns:So,selectedRowCount:Ct,selectedRows:xt,selectedRowsData:Rt,setActiveHeaderDropdown:Jt,setCollapsedHeaders:nr,setHeaders:Bt,setInitialFocusedCell:Mo,setIsResizing:Gt,setIsScrolling:Kt,setRowStateMap:ct,setSelectedCells:No,setSelectedColumns:Ho,setSelectedRows:bt,setExpandedDepths:dr,setExpandedRows:pr,setCollapsedRows:mr,shouldPaginate:hn,tableBodyContainerRef:it,tableEmptyStateRenderer:xn,tableRows:to,theme:In,customTheme:Vn,expandedRows:vr,collapsedRows:wr,useHoverRowBackground:Tn,useOddColumnBackground:Pn,useOddEvenRowBackground:Dn}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(In," ").concat(null!=w?w:""," ").concat(b?"st-column-borders":""),style:Oe?{maxHeight:Oe,height:void 0===eo?"auto":Oe}:ye?{height:ye}:{}},{children:[e.jsx(Ln,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(Rn,{calculatedHeaderHeight:Cr,hideHeader:Me,pinnedLeftWidth:Er,pinnedRightWidth:Tr,setScrollTop:ir,setScrollDirection:lr,shouldShowEmptyState:Fo,sort:Gr,tableRows:to,rowsToRender:ro,stickyParents:uo,regularRows:lo,partiallyVisibleRows:so,heightMap:fo}),e.jsx(On,{columnEditorText:Kn.text,editColumns:z,headers:Wt,open:Xt,searchEnabled:Kn.searchEnabled,searchPlaceholder:Kn.searchPlaceholder,searchFunction:Kn.searchFunction,setOpen:$t})]})),!Fo&&e.jsx(Sn,{mainBodyRef:tt,mainBodyWidth:Hr,pinnedLeftWidth:Er,pinnedRightWidth:Tr,pinnedLeftContentWidth:kr,pinnedRightContentWidth:Pr,tableBodyContainerRef:it}),!Fo&&e.jsx(_,{currentPage:Ft,footerRenderer:me,hideFooter:Ce,onPageChange:Ot,onNextPage:_e,onUserPageChange:Je,rowsPerPage:un,shouldPaginate:hn,totalPages:Math.ceil((null!=Cn?Cn:Jr.length)/un),totalRows:null!=Cn?Cn:Jr.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:xr}))]}))}))},et=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?.2:s,d=n.strokeWidth,f=void 0===d?2: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"}},{children:[e.jsx("path",{d:y,fill:l||"var(--st-chart-fill-color)",fillOpacity:c,stroke:"none",vectorEffect:"non-scaling-stroke"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}))},nt=Object.freeze({__proto__:null,default:et}),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.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"}},{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:1},t)})}))},rt=Object.freeze({__proto__:null,default:tt});exports.ANIMATION_CONFIGS=jn,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=J,exports.AngleRightIcon=Y,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=X,exports.BarChart=tt,exports.CheckIcon=$,exports.DEFAULT_COLUMN_EDITOR_CONFIG=Xn,exports.DEFAULT_CUSTOM_THEME=Yn,exports.DefaultEmptyState=Jn,exports.DescIcon=Q,exports.DragIcon=Z,exports.FilterIcon=ee,exports.LineAreaChart=et,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=ne,exports.SimpleTable=Qn,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,Vn()&&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||Vn()&&!1!==t.respectReducedMotion?[2]:(u=t,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=Vn()?exports.__assign(exports.__assign({},jn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},jn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},jn.ROW_REORDER),u),Kn(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,Un(n,i,t)]);case 1:return a.sent(),[2]}var u,l})})},exports.rowIdToString=k,exports.usePrevious=Se,exports.useTableContext=U;
2
+ //# sourceMappingURL=index-f301a9e9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-f301a9e9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -23,6 +23,7 @@ import TableRowProps from "./types/TableRowProps";
23
23
  import Theme from "./types/Theme";
24
24
  import UpdateDataProps from "./types/UpdateCellProps";
25
25
  import { FilterCondition, TableFilterState } from "./types/FilterTypes";
26
+ import { QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode } from "./types/QuickFilterTypes";
26
27
  import { ColumnVisibilityState } from "./types/ColumnVisibilityTypes";
27
28
  import RowSelectionChangeProps from "./types/RowSelectionChangeProps";
28
29
  import CellClickProps from "./types/CellClickProps";
@@ -39,4 +40,4 @@ import { GetRowId, GetRowIdParams } from "./types/GetRowId";
39
40
  import { rowIdToString } from "./utils/rowUtils";
40
41
  export { SimpleTable, LineAreaChart, BarChart, DefaultEmptyState, DEFAULT_CUSTOM_THEME, DEFAULT_COLUMN_EDITOR_CONFIG, rowIdToString, };
41
42
  export * from "./icons";
42
- export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, Row, RowButtonProps, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SortColumn, TableCellProps, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
43
+ export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SortColumn, TableCellProps, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-e0379c0f.js");require("react/jsx-runtime"),require("react"),exports.AngleDownIcon=e.AngleDownIcon,exports.AngleLeftIcon=e.AngleLeftIcon,exports.AngleRightIcon=e.AngleRightIcon,exports.AngleUpIcon=e.AngleUpIcon,exports.AscIcon=e.AscIcon,exports.BarChart=e.BarChart,exports.CheckIcon=e.CheckIcon,exports.DEFAULT_COLUMN_EDITOR_CONFIG=e.DEFAULT_COLUMN_EDITOR_CONFIG,exports.DEFAULT_CUSTOM_THEME=e.DEFAULT_CUSTOM_THEME,exports.DefaultEmptyState=e.DefaultEmptyState,exports.DescIcon=e.DescIcon,exports.DragIcon=e.DragIcon,exports.FilterIcon=e.FilterIcon,exports.LineAreaChart=e.LineAreaChart,exports.SelectIcon=e.SelectIcon,exports.SimpleTable=e.SimpleTable,exports.rowIdToString=e.rowIdToString;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-f301a9e9.js");require("react/jsx-runtime"),require("react"),exports.AngleDownIcon=e.AngleDownIcon,exports.AngleLeftIcon=e.AngleLeftIcon,exports.AngleRightIcon=e.AngleRightIcon,exports.AngleUpIcon=e.AngleUpIcon,exports.AscIcon=e.AscIcon,exports.BarChart=e.BarChart,exports.CheckIcon=e.CheckIcon,exports.DEFAULT_COLUMN_EDITOR_CONFIG=e.DEFAULT_COLUMN_EDITOR_CONFIG,exports.DEFAULT_CUSTOM_THEME=e.DEFAULT_CUSTOM_THEME,exports.DefaultEmptyState=e.DefaultEmptyState,exports.DescIcon=e.DescIcon,exports.DragIcon=e.DragIcon,exports.FilterIcon=e.FilterIcon,exports.LineAreaChart=e.LineAreaChart,exports.SelectIcon=e.SelectIcon,exports.SimpleTable=e.SimpleTable,exports.rowIdToString=e.rowIdToString;
2
2
  //# sourceMappingURL=index.js.map
@@ -6,6 +6,7 @@ import { CellRenderer } from "./CellRendererProps";
6
6
  import { HeaderRenderer } from "./HeaderRendererProps";
7
7
  import CellValue from "./CellValue";
8
8
  import { SimpleTableProps } from "./SimpleTableProps";
9
+ import { QuickFilterGetter } from "./QuickFilterTypes";
9
10
  export type Accessor = keyof Row | string;
10
11
  export type ColumnType = "string" | "number" | "boolean" | "date" | "enum" | "lineAreaChart" | "barChart" | "other";
11
12
  export type ShowWhen = "parentCollapsed" | "parentExpanded" | "always";
@@ -79,6 +80,8 @@ type HeaderObject = {
79
80
  sortingOrder?: ("asc" | "desc" | null)[];
80
81
  nestedTable?: Omit<SimpleTableProps, "rows" | "loadingStateRenderer" | "errorStateRenderer" | "emptyStateRenderer" | "tableEmptyStateRenderer" | "expandIcon" | "filterIcon" | "sortUpIcon" | "sortDownIcon" | "nextIcon" | "prevIcon" | "headerCollapseIcon" | "headerExpandIcon">;
81
82
  pinned?: Pinned;
83
+ quickFilterable?: boolean;
84
+ quickFilterGetter?: QuickFilterGetter;
82
85
  singleRowChildren?: boolean;
83
86
  tooltip?: string;
84
87
  type?: ColumnType;
@@ -0,0 +1,21 @@
1
+ import { Accessor } from "./HeaderObject";
2
+ import Row from "./Row";
3
+ export type QuickFilterMode = "simple" | "smart";
4
+ export interface QuickFilterConfig {
5
+ text: string;
6
+ columns?: Accessor[];
7
+ caseSensitive?: boolean;
8
+ mode?: QuickFilterMode;
9
+ useFormattedValue?: boolean;
10
+ onChange?: (text: string) => void;
11
+ }
12
+ export interface QuickFilterGetterProps {
13
+ row: Row;
14
+ accessor: Accessor;
15
+ }
16
+ export type QuickFilterGetter = (props: QuickFilterGetterProps) => string;
17
+ export interface SmartFilterToken {
18
+ type: "word" | "phrase" | "negation" | "columnSpecific";
19
+ value: string;
20
+ column?: Accessor;
21
+ }
@@ -19,6 +19,7 @@ import { CustomThemeProps } from "./CustomTheme";
19
19
  import { GetRowId } from "./GetRowId";
20
20
  import { ColumnEditorConfig } from "./ColumnEditorConfig";
21
21
  import { IconsConfig } from "./IconsConfig";
22
+ import { QuickFilterConfig } from "./QuickFilterTypes";
22
23
  export interface SimpleTableProps {
23
24
  allowAnimations?: boolean;
24
25
  autoExpandColumns?: boolean;
@@ -75,6 +76,7 @@ export interface SimpleTableProps {
75
76
  onRowSelectionChange?: (props: RowSelectionChangeProps) => void;
76
77
  onSortChange?: (sort: SortColumn | null) => void;
77
78
  prevIcon?: ReactNode;
79
+ quickFilter?: QuickFilterConfig;
78
80
  rowButtons?: RowButton[];
79
81
  rowGrouping?: Accessor[];
80
82
  getRowId?: GetRowId;
@@ -64,6 +64,8 @@ type TableRefType = {
64
64
  applyColumnVisibility: (visibility: {
65
65
  [accessor: string]: boolean;
66
66
  }) => Promise<void>;
67
+ /** Set the quick filter text programmatically. Triggers the onChange callback if provided in quickFilter config. */
68
+ setQuickFilter: (text: string) => void;
67
69
  };
68
70
  export default TableRefType;
69
71
  export type { SetHeaderRenameProps, ExportToCSVProps };
@@ -13,6 +13,7 @@ type TableRow = {
13
13
  rowIndexPath?: number[];
14
14
  stateIndicator?: {
15
15
  parentRowId: string | number;
16
+ parentRow: Row;
16
17
  state: RowState;
17
18
  };
18
19
  isLoadingSkeleton?: boolean;
@@ -0,0 +1,14 @@
1
+ import { SmartFilterToken } from "../types/QuickFilterTypes";
2
+ /**
3
+ * Parses a smart filter query into tokens
4
+ * Supports:
5
+ * - Multi-word: "john engineer" → matches rows containing both "john" AND "engineer"
6
+ * - Phrase: "john doe" → matches exact phrase
7
+ * - Negation: -inactive → excludes rows containing "inactive"
8
+ * - Column-specific: name:john → searches only in name column
9
+ */
10
+ export declare const parseSmartFilter: (query: string) => SmartFilterToken[];
11
+ /**
12
+ * Checks if a value matches a simple filter (case-insensitive contains)
13
+ */
14
+ export declare const matchesSimpleFilter: (value: string, filterText: string, caseSensitive: boolean) => boolean;
@@ -20,6 +20,33 @@ export declare const calculateNestedGridHeight: ({ childRowCount, rowHeight, hea
20
20
  headerHeight: number;
21
21
  customTheme: CustomTheme;
22
22
  }) => number;
23
+ /**
24
+ * Calculate the final wrapper height for a nested grid, accounting for custom heights
25
+ *
26
+ * @param calculatedHeight - The default calculated height based on child rows
27
+ * @param customHeight - Optional custom height from nestedTable config (e.g., "200px" or 200)
28
+ * @param customTheme - Custom theme configuration for padding
29
+ * @returns Final height in pixels for the wrapper (includes padding)
30
+ */
31
+ export declare const calculateFinalNestedGridHeight: ({ calculatedHeight, customHeight, customTheme, }: {
32
+ calculatedHeight: number;
33
+ customHeight?: string | number | undefined;
34
+ customTheme: CustomTheme;
35
+ }) => number;
36
+ /**
37
+ * Calculate the inner height for a nested SimpleTable component
38
+ * This accounts for the padding that's applied to the wrapper
39
+ *
40
+ * @param calculatedHeight - The total height of the nested grid row (from calculateNestedGridHeight)
41
+ * @param customHeight - Optional custom height from nestedTable config (e.g., "200px")
42
+ * @param customTheme - Custom theme configuration for padding
43
+ * @returns Height value to pass to the nested SimpleTable (string with units)
44
+ */
45
+ export declare const calculateNestedTableHeight: ({ calculatedHeight, customHeight, customTheme, }: {
46
+ calculatedHeight: number;
47
+ customHeight?: string | number | undefined;
48
+ customTheme: CustomTheme;
49
+ }) => string;
23
50
  /**
24
51
  * Get a nested property value from an object using dot notation and array bracket notation
25
52
  * Examples: