simple-table-core 2.4.2 → 2.4.4

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 (51) hide show
  1. package/dist/{Animate-a00b8653.js → Animate-85a426a3.js} +2 -2
  2. package/dist/Animate-85a426a3.js.map +1 -0
  3. package/dist/DatePicker-9d5825ee.js +2 -0
  4. package/dist/DatePicker-9d5825ee.js.map +1 -0
  5. package/dist/cjs/{Animate-b6372d93.js → Animate-18759d53.js} +2 -2
  6. package/dist/cjs/Animate-18759d53.js.map +1 -0
  7. package/dist/cjs/DatePicker-3d0a5721.js +2 -0
  8. package/dist/cjs/DatePicker-3d0a5721.js.map +1 -0
  9. package/dist/cjs/components/simple-table/table-column-editor/columnEditorUtils.d.ts +1 -0
  10. package/dist/cjs/context/TableContext.d.ts +2 -9
  11. package/dist/cjs/hooks/useDragHandler.d.ts +5 -1
  12. package/dist/cjs/hooks/useQuickFilter.d.ts +14 -0
  13. package/dist/cjs/hooks/useTableAPI.d.ts +3 -1
  14. package/dist/cjs/index-63f4ad95.js +2 -0
  15. package/dist/cjs/index-63f4ad95.js.map +1 -0
  16. package/dist/cjs/index.d.ts +2 -1
  17. package/dist/cjs/index.js +1 -1
  18. package/dist/cjs/types/HeaderObject.d.ts +3 -0
  19. package/dist/cjs/types/QuickFilterTypes.d.ts +21 -0
  20. package/dist/cjs/types/SimpleTableProps.d.ts +2 -0
  21. package/dist/cjs/types/TableRefType.d.ts +2 -0
  22. package/dist/cjs/types/TableRow.d.ts +1 -0
  23. package/dist/cjs/utils/quickFilterUtils.d.ts +14 -0
  24. package/dist/cjs/utils/rowUtils.d.ts +27 -0
  25. package/dist/components/simple-table/table-column-editor/columnEditorUtils.d.ts +1 -0
  26. package/dist/context/TableContext.d.ts +2 -9
  27. package/dist/hooks/useDragHandler.d.ts +5 -1
  28. package/dist/hooks/useQuickFilter.d.ts +14 -0
  29. package/dist/hooks/useTableAPI.d.ts +3 -1
  30. package/dist/index-57a11501.js +2 -0
  31. package/dist/index-57a11501.js.map +1 -0
  32. package/dist/index.d.ts +2 -1
  33. package/dist/index.es.js +1 -1
  34. package/dist/types/HeaderObject.d.ts +3 -0
  35. package/dist/types/QuickFilterTypes.d.ts +21 -0
  36. package/dist/types/SimpleTableProps.d.ts +2 -0
  37. package/dist/types/TableRefType.d.ts +2 -0
  38. package/dist/types/TableRow.d.ts +1 -0
  39. package/dist/utils/quickFilterUtils.d.ts +14 -0
  40. package/dist/utils/rowUtils.d.ts +27 -0
  41. package/package.json +4 -1
  42. package/dist/Animate-a00b8653.js.map +0 -1
  43. package/dist/DatePicker-91f87634.js +0 -2
  44. package/dist/DatePicker-91f87634.js.map +0 -1
  45. package/dist/cjs/Animate-b6372d93.js.map +0 -1
  46. package/dist/cjs/DatePicker-7bfd609b.js +0 -2
  47. package/dist/cjs/DatePicker-7bfd609b.js.map +0 -1
  48. package/dist/cjs/index-e0379c0f.js +0 -2
  49. package/dist/cjs/index-e0379c0f.js.map +0 -1
  50. package/dist/index-fe1a2c58.js +0 -2
  51. package/dist/index-fe1a2c58.js.map +0 -1
@@ -1,2 +0,0 @@
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.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},M=function(e,n){var t=n+"";return t.includes(".")||t.includes("[")?t.split(".").reduce(function(e,n){if(null!=e){var t=S(n),r=t.index,o=e[t.key];return null!==r&&Array.isArray(o)&&(o=o[r]),o}},e):e[n]},N=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=S(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=S(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=S(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]},H=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},T=function(e){return e.join("-")},k=function(e,n){var t=e[n];return E(t)?t:[]},P=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=[],S=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,M=s;return e.forEach(function(i,s){var c,N,E=a[n],D=u(u([],f,!0),[s],!1),A=u(u([],p,!0),[s],!1),F=H({row:i,getRowId:l,depth:n,index:s,rowPath:D,rowIndexPath:A,groupingKey:E}),O=C.length,L={row:i,depth:n,displayPosition:M,groupingKey:E,position:g,isLastGroupRow:0===n&&s===e.length-1,rowId:F,rowPath:D,rowIndexPath:A,absoluteRowIndex:g,parentIndices:w.length>0?u([],w,!0):void 0};C.push(L),g++,M++;var W=T(F);if(P(W,n,t,r,o)&&a.length>n){var B=null==d?void 0:d.get(W),q=k(i,E),z=x.find(function(e){return e.expandable&&e.nestedTable});if((null==z?void 0:z.nestedTable)&&q.length>0){var G=(null===(c=z.nestedTable.customTheme)||void 0===c?void 0:c.rowHeight)||b,V=(null===(N=z.nestedTable.customTheme)||void 0===N?void 0:N.headerHeight)||y,j=R({childRowCount:q.length,rowHeight:G,headerHeight:V,customTheme:I}),K=u(u([],D,!0),[E],!1);C.push({row:{},depth:n+1,displayPosition:M,groupingKey:E,position:g,isLastGroupRow:!1,rowId:K,rowPath:K,rowIndexPath:A,nestedTable:{parentRow:i,expandableHeader:z,childAccessor:E,calculatedHeight:j},absoluteRowIndex:g}),g++,M++}else if(B&&(B.loading||B.error||B.isEmpty)){if(B.loading&&v||B.error&&h||B.isEmpty&&m){var U=u(u([],D,!0),[E],!1);C.push({row:{},depth:n+1,displayPosition:M,groupingKey:E,position:g,isLastGroupRow:!1,rowId:U,rowPath:U,rowIndexPath:A,stateIndicator:{parentRowId:W,state:B},absoluteRowIndex:g,parentIndices:u(u([],w,!0),[O],!1)}),g++,M++}else if(B.loading&&!v){var _=u(u([],D,!0),[E,"loading-skeleton"],!1);C.push({row:{},depth:n+1,displayPosition:M,groupingKey:E,position:g,isLastGroupRow:!1,rowId:_,rowPath:_,rowIndexPath:A,isLoadingSkeleton:!0,absoluteRowIndex:g,parentIndices:u(u([],w,!0),[O],!1)}),g++,M++}}else if(q.length>0){var J=u(u([],D,!0),[E],!1),Y=u([],A,!0);g=S(q,n+1,g,M,J,Y,u(u([],w,!0),[O],!1))}}}),g};return S(e.rows,void 0===n?0:n,0,c,[],[],[]),C},A=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},F=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},O=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=A(Math.max(0,r-C),u),N=A(S,u)+1;N=Math.min(o.length,N);var E=r,H=r+t,T=A(E,u);E>y[T]&&(T=Math.min(T+1,o.length));var k=A(H,u);k=Math.min(o.length,k);var P=r+t,D=A(r,u),F=A(P,u)+1;return F=Math.min(o.length,F),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:T,endIndex:k,rows:o.slice(T,k)},partiallyVisible:{startIndex:D,endIndex:F,rows:o.slice(D,F)}}},L=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+F(n,e.heightOffsets)},W=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},B=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 T(e.rowId)===T(t.rowId)})||(u.push(t),c++)}},f=0,v=s.parentIndices;v.length>f&&"break"!==d(v[f]);f++);if(u.length>0){W(s,n)&&(u.push(s),c++);var p=o[i+=c];p&&(s=p)}}else if(W(s,n))return u.push(s),i++,B({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l});return W(s,n)?B({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l}):{stickyParents:u,regularRows:t}},q=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)}},z=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=O({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 q(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&&q(n,o,i)},100);q(u,o,i)}},G=function(e){var n=e.colIndex,t=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(t)},V=n.createContext(void 0),j=function(n){return e.jsx(V.Provider,exports.__assign({value:n.value},{children:n.children}))},K=function(){var e=n.useContext(V);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},U=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=K(),w=h.nextIcon,m=h.prevIcon,g=n.useState(!0),x=g[0],b=g[1],y=r>1,I=v>r,C=r===v,R=Math.min((r-1)*d+1,p),S=Math.min(r*d,p),M=!y,N=!I&&!s||!x&&C,E=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=r-1)?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},H=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 b(!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]}})})},T=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:R,endRow:S,onPageChange:T,onNextPage:H,onPrevPage:E,hasNextPage:!N,hasPrevPage:!M,nextIcon:w,prevIcon:m})});var k=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 ",R," to ",S," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[k.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 T(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(M?"disabled":""),onClick:E,disabled:M,"aria-label":"Go to previous page"},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(N?"disabled":""),onClick:H,disabled:N,"aria-label":"Go to next page"},{children:w}))]}))]}))},_=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"})}))},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:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},Y=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"})}))},X=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"})}))},$=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"})]}))},Q=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"})}))},ee=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"})}))},ne=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}},te=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=K().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},re=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}))},oe=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(te,exports.__assign({open:i,onClose:function(){r()},setOpen:a,width:120},{children:[e.jsx(re,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(re,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},ie=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()}})},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,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()}})},ue=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-b6372d93.js")})}),le=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-7bfd609b.js")})}),se=n.lazy(function(){return Promise.resolve().then(function(){return et})}),ce=n.lazy(function(){return Promise.resolve().then(function(){return tt})}),de=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(ue,exports.__assign({},t))}))},fe=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(le,exports.__assign({},t))}))},ve=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(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(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)},we=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},me=function(e){if(!e)return new Date;if("string"==typeof e)return he(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:we(n)}return e instanceof Date?we(e):new Date},ge=function(e){return e?he(""+e):new Date},xe=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(te,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(fe,{value:ge(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),r()},onClose:l})}))},be=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(te,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(re,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)})}))}))},ye=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(oe,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(xe,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(be,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(ae,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(ie,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},Ie=0,Ce=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();0!==Ie&&r>o-Ie||(Ie=o,n(t))}},Re=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},Se=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(Se);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Se(e[t]));return n},Me=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Ne=Date.now(),Ee={screenX:0,screenY:0},He=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=He(o.children,n,u(u([],t,!0),[r],!1));if(i)return i}}return null},Te=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ke(e,n,t){var r,o,i=Se(e),a=!1;try{var u=Te(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 Pe=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=K().setHeaders,l=Re(t);return{handleDragStart:function(e){n.current=e,Ne=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(Te(h)!==Te(a))f=(R=ke(t,h,a)).newHeaders,w=R.emergencyBreak;else{var m=t,g=He(m,h.accessor),x=He(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=Se(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-Ne||40>d)||(Ne=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(X,{className:"st-checkbox-checkmark"})})),o]}))},Ae=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(ve,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(pe,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)?me(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):r},Fe=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=K(),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.expandIcon,H=v.handleMouseDown,k=v.handleMouseOver,D=v.handleRowSelect,A=v.headers,F=v.hoveredHeaderRef,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,U=v.rowGrouping,_=v.setCollapsedRows,J=v.setExpandedRows,Y=v.setRowStateMap,X=v.rowsWithSelectedCells,$=v.selectedColumns,Z=v.tableBodyContainerRef,Q=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(M(te,a.accessor)),le=ue[0],se=ue[1],ce=n.useState(!1),fe=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),Ie=T(ae),Re=U&&U[ne],Se=!!Re&&function(e,n){return!!n&&E(e[n])}(te,Re),Me=U&&U.length>ne,Ne=!p||p(te),Ee=!!a.nestedTable,He=P(Ie,ne,C,R,x),Te=O({rowIndex:d,colIndex:o,rowId:Ie}),ke=B({rowIndex:d,colIndex:o,rowId:Ie}),Fe=n.useMemo(function(){var e,n,t;if(!b)return!1;var r=A.filter(function(e){return"left"===e.pinned}),o=A.filter(function(e){return!e.pinned}),i=A.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=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,A,a.accessor,a.pinned]),Oe=Pe({draggedHeaderRef:y,headers:A,hoveredHeaderRef:F,onTableHeaderDragEnd:V}).handleDragOver,Le=Ce(),We=w({accessor:a.accessor,rowId:Ie}),Be=g({rowId:Ie,accessor:a.accessor}),qe=a.isSelectionColumn&&I;n.useEffect(function(){if(h){var e="".concat(Ie,"-").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,Ie,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(M(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(Ie+"")},[qe,X,Ie]),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(Fe?"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),N(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=P(Ie,ne,C,R,x),t=Ie+"";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(Ie),n}),G){var r=a.pinned;G({depth:ne,event:e,groupingKey:Re,groupingKeys:U||[],isExpanded:!n,row:te,rowIndexPath:oe||[],rowIdPath:re,setEmpty:function(e,n){Y(function(t){var o=new Map(t),i=o.get(Ie)||{};return o.set(Ie,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(Ie)||{};return t.set(Ie,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(Ie)||{};return n.set(Ie,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(Ie)||{};return n.set(Ie,exports.__assign(exports.__assign({},t),{loading:!1,error:null,isEmpty:!1,triggerSection:r})),n})},0)}})}},[x,Re,ne,C,R,a.pinned,G,te,U,Ie,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"})}))})):!fe||ze||qe?e.jsxs(de,exports.__assign({className:_e,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":Ie,"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){fe||qe||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||fe||(e.preventDefault(),ve(!0))},onMouseDown:function(){fe||qe||H({rowIndex:d,colIndex:o,rowId:Ie})},onMouseEnter:function(){xe(!0)},onMouseLeave:function(){xe(!1)},onMouseOver:function(){fe||qe||k({rowIndex:d,colIndex:o,rowId:Ie})},parentRef:Z,tableRow:f},{children:[a.expandable&&Me?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Ne&&(Se||G||Ee)?He?"expanded":"collapsed":"placeholder"),onClick:Ne&&(Se||G||Ee)?function(e){return Ye(e)}:void 0,role:Ne&&(Se||G||Ee)?"button":"presentation",tabIndex:Ne&&(Se||G||Ee)?0:-1,"aria-label":Ne&&(Se||G||Ee)?"".concat(He?"Collapse":"Expand"," row group"):void 0,"aria-expanded":Ne&&(Se||G||Ee)?He:void 0,"aria-hidden":!(Ne&&(Se||G||Ee)),onKeyDown:Ne&&(Se||G||Ee)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ye(e))}:void 0},{children:S})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children: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(Ie+"")?e.jsx(De,{checked:!!W&&W(Ie+""),onChange:function(e){D&&D(Ie+"",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(Ie+"")))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:Q,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})})}():Ae({content:le,header:a,colIndex:o,row:te,rowIndex:d})})})),!L&&!f.isLoadingSkeleton&&fe&&ze&&!qe&&e.jsx(ye,{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:Ie}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(ye,{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}),Oe=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=K(),h=p.getBorderClass,g=p.isSelected,x=p.isInitialFocusedCell,b=p.collapsedHeaders,y=T(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(Fe,{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(Oe,{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(Oe,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},t)})})}var E={rowIndex:c,colIndex:v,rowId:y},H=h(E),k=g(E),P=x(E),D=w({accessor:i.accessor,rowId:y});return e.jsx(Fe,{borderClass:H,colIndex:v,displayRowNumber:o,header:i,isHighlighted:k,isInitialFocused:P,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},D)},Le=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=K().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=T(s.rowId),f=w({accessor:n.accessor,rowId:d});return e.jsx(Oe,{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}),We=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},Be=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=K(),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.expandIcon,x=s.filterIcon,b=s.sortUpIcon,y=s.sortDownIcon,I=s.nextIcon,C=s.prevIcon,R=s.headerCollapseIcon,S=s.headerExpandIcon,N=i.nestedTable;if(!N)return null;var E=M(u,r),H=Array.isArray(E)?E:[],T=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,k=t-p.nestedGridPaddingTop-p.nestedGridPaddingBottom,P=N.customTheme?exports.__assign(exports.__assign({},p),N.customTheme):p;return e.jsx("div",exports.__assign({className:"st-row st-nested-grid-row","data-index":a,style:{transform:"translate3d(0, ".concat(L({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(t,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx($n,exports.__assign({},N,{rows:H,theme:c,customTheme:P,height:"".concat(k,"px"),rowGrouping:T,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,expandIcon:g,filterIcon:x,sortUpIcon:b,sortDownIcon:y,nextIcon:I,prevIcon:C,headerCollapseIcon:R,headerExpandIcon:S}))}))},qe=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=K(),b=x.customTheme,y=x.emptyStateRenderer,I=x.errorStateRenderer,C=x.heightOffsets,R=x.isAnimating,S=x.isRowSelected,M=x.loadingStateRenderer,N=x.maxHeaderDepth,E=x.rows,H=x.useHoverRowBackground,k=x.useOddEvenRowBackground,P=d.position,D=d.displayPosition,A=d.stateIndicator,F=d.nestedTable;if(F)return u?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(F.calculatedHeight,"px")}}):e.jsx(Be,{calculatedHeight:F.calculatedHeight,childAccessor:F.childAccessor,depth:d.depth-1,expandableHeader:F.expandableHeader,index:a,parentRow:F.parentRow,position:P});if(A){if(A.state.triggerSection===u){if(!(A.state.loading&&M||A.state.error&&I||A.state.isEmpty&&y))return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}});var O=E.find(function(e,n){return T([n])===A.parentRowId});return e.jsx("div",exports.__assign({className:"st-row st-state-row","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(We,{parentRow:O||{},rowState:A.state,gridTemplateColumns:o,loadingStateRenderer:M,errorStateRenderer:I,emptyStateRenderer:y})}))}return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}})}var W=P%2==0,B=T(d.rowId),q=!!S&&S(B),z=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:L({position:P,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(k?W?"even":"odd":""," ").concat(q?"selected":""),"data-index":a,"aria-rowindex":P+N+1,onMouseEnter:function(){!R&&H&&c(a)},style:z},{children:e.jsx(Le,{columnIndexStart:r,columnIndices:t,displayRowNumber:D,headers:i,pinned:u,rowIndex:P,rowIndices:s,tableRow:d},B)}))},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}),ze=function(t){var r=t.displayStrongBorder,o=t.position,i=t.rowHeight,a=t.templateColumns,u=t.isSticky,l=void 0!==u&&u,s=K(),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+F(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"}})}))},Ge=n.createContext(void 0),Ve=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(Ge);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}})},je=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 Me(a,u)},[a,u])?e.jsx(Ve,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):T(t.rowId);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(ze,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:l,templateColumns:d}),e.jsx(qe,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:r,pinned:u,rowHeight:l,rowIndices:s,setHoveredIndex:c,tableRow:t})]},f)})}))})):null});function Ke(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}je.displayName="TableSection";var Ue=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=K(),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,E=n.useMemo(function(){return Ke({headers:C,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:b})},[C,a,c,b]),H=o.length>0?o.length*(R+1)+M:0;if(0===o.length)return null;var k=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(H,"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(T(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(qe,{columnIndexStart:u,columnIndices:E,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(ze,{displayStrongBorder:!1,position:f,rowHeight:R,templateColumns:t,isSticky:!0})]},s)})}))},P=C.filter(function(e){return!e.pinned}),D="calc(100% - ".concat(h,"px - ").concat(I?"".concat(s,"px"):"0px",")");return e.jsxs("div",exports.__assign({className:"st-sticky-top",style:{height:"".concat(H,"px"),width:D,top:"".concat(r,"px")}},{children:[a.length>0&&k(u,a,"left",l,0),k(i,P,void 0,void 0,a.length),c.length>0&&k(d,c,"right",f,a.length+P.length)]}))},_e=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=K(),y=b.collapsedHeaders,I=b.headerContainerRef,C=b.headers,R=b.heightOffsets,S=b.isAnimating,M=b.mainBodyRef,N=b.onLoadMore,E=b.rowHeight,H=b.scrollbarWidth,k=b.setIsScrolling,P=b.shouldPaginate,D=b.tableBodyContainerRef,A=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&&D.current){var n=D.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))})}},[D]);n.useEffect(function(){S&&V(null)},[S,V]),ne({headerContainerRef:I,mainSectionRef:D,scrollbarWidth:H}),n.useEffect(function(){return function(){U.current&&clearTimeout(U.current)}},[]);var j=n.useRef(null),U=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,E,R,F)},[J,E,R,F]),X=n.useMemo(function(){return Ke({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=T(n.rowId);e[r]=t}),e},[d]),Z=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]),Q={columnIndices:X,headerContainerRef:I,headers:C,rowHeight:E,rowIndices:$,rowsToRender:d,setHoveredIndex:V,regularRows:m};return e.jsxs(e.Fragment,{children:[!p&&e.jsx(Ue,{calculatedHeaderHeight:r,heightMap:x,mainTemplateColumns:o,partiallyVisibleRows:g,pinnedLeftColumns:i,pinnedLeftTemplateColumns:a,pinnedLeftWidth:u,pinnedRightColumns:l,pinnedRightTemplateColumns:s,pinnedRightWidth:c,rowIndices:$,scrollTop:q,scrollbarWidth:H,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;k(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){k(!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),Z(n,t),_.current=t})},ref:D},{children:p?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:A})):e.jsxs(e.Fragment,{children:[e.jsx(je,exports.__assign({},Q,{pinned:"left",templateColumns:a,totalHeight:Y,width:u})),e.jsx(je,exports.__assign({},Q,{columnIndexStart:i.length,ref:M,templateColumns:o,totalHeight:Y})),e.jsx(je,exports.__assign({},Q,{columnIndexStart:i.length+o.length,pinned:"right",templateColumns:s,totalHeight:Y,width:c}))]})}))]})},Je=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 E=a.current.clientWidth,H=Xe({headers:r,containerWidth:E,collapsedHeaders:s}),T=H.leftWidth,k=H.rightWidth;M="left"===t.pinned?T:"right"===t.pinned?k:Math.max(0,E-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?Ye({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 D=function(e){P(e.touches[0].clientX)},A=function(){document.removeEventListener("touchmove",D),document.removeEventListener("touchend",A),i(!1)};document.addEventListener("touchmove",D),document.addEventListener("touchend",A)}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)}}},Ye=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)})},Xe=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}},$e=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&&$e({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)}),(A=t-R)>0&&w.length>0&&$e({columnsToShrink:w,totalCompensation:-A,initialWidthsMap:u})}}else{var N=C(o,a),E=N.findIndex(function(e){return e.accessor===r.accessor});if(-1!==E){var H,T=E===N.length-1;if(0!==(H=0===E?N.slice(E+1):T||i?N.slice(0,E):N.slice(E+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=H.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&&$e({columnsToShrink:H,totalCompensation:P,initialWidthsMap:u})}else{var D=Math.max(t+n,30),A=t-D;r.width=D,A>0&&$e({columnsToShrink:H,totalCompensation:-A,initialWidthsMap:u})}}else r.width=Math.max(t+n,30)}}},Qe={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"},en=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"]}},nn=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},tn=function(e){return["between","notBetween","in","notIn"].includes(e)},rn=function(e){return["isEmpty","isNotEmpty"].includes(e)},on=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},an=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(ee,{})]})),e.jsx(te,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)})}))}))]}))},un=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Qe[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(an,{value:t,onChange:function(e){r(e)},options:o})}))},ln=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()})},sn=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}))},cn=function(n){var t=n.onClear,r=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!r,className:"st-filter-button st-filter-button-apply ".concat(r?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&t&&e.jsx("button",exports.__assign({onClick:t,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},dn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=en("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},nn(l)&&{value:d});i(e)},h=rn(l)||d.trim();return e.jsxs(on,{children:[e.jsx(un,{value:l,onChange:s,operators:v}),nn(l)&&e.jsx(sn,{children:e.jsx(ln,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(cn,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},fn=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=en("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};nn(c)?e.value=parseFloat(v):tn(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(on,{children:[e.jsx(un,{value:c,onChange:d,operators:y}),nn(c)&&e.jsx(sn,{children:e.jsx(ln,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:I})}),tn(c)&&e.jsxs(sn,{children:[e.jsx(ln,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:I}),e.jsx(ln,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:I})]}),e.jsx(cn,{onApply:I,onClear:l,canApply:!!rn(c)||(nn(c)?""!==v.trim():!!tn(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},vn=function(n){var t=n.className;return e.jsx(an,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===t?"":t,placeholder:n.placeholder})},pn=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=en("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=rn(l)||""!==d;return e.jsxs(on,{children:[e.jsx(un,{value:l,onChange:s,operators:v}),nn(l)&&e.jsx(sn,{children:e.jsx(vn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(cn,{onApply:function(){var e={accessor:r.accessor,operator:l};nn(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},hn=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=en("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=me(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?me(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(te,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(fe,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(on,{children:[e.jsx(un,{value:c,onChange:d,operators:y}),nn(c)&&e.jsx(sn,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),tn(c)&&e.jsxs(sn,{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(cn,{onApply:function(){var e={accessor:i.accessor,operator:c};nn(c)?e.value=v:tn(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!rn(c)||(nn(c)?""!==v.trim():!!tn(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},wn=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(on,{children:[e.jsx(sn,{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(ln,{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(cn,{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})]})},mn=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(fn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(pn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(hn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(wn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(dn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},gn=function(t){var r=t.content,o=t.children,i=t.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],s=u[1],c=n.useState({top:0,left:0}),d=c[0],f=c[1],v=n.useRef(null),p=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!r||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var h=n.cloneElement(o,{ref:p,onMouseEnter:function(){v.current=setTimeout(function(){if(p.current&&r.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),f({top:t,left:n}),s(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),s(!1)}});return e.jsxs(e.Fragment,{children:[h,l&&e.jsx("div",exports.__assign({className:"st-tooltip",style:{position:"fixed",top:"".concat(d.top,"px"),left:"".concat(d.left,"px"),zIndex:1e4}},{children:r}))]})},xn=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=K(),E=N.activeHeaderDropdown,H=N.areAllRowsSelected,T=N.autoExpandColumns,k=N.collapsedHeaders,P=N.columnBorders,D=N.columnReordering,A=N.columnResizing,F=N.columnsWithSelectedCells,O=N.draggedHeaderRef,L=N.enableHeaderEditing,W=N.filterIcon,B=N.handleApplyFilter,q=N.handleClearFilter,z=N.handleSelectAll,G=N.headerCollapseIcon,V=N.headerDropdown,j=N.headerExpandIcon,U=N.headerRegistry,_=N.headers,J=N.hoveredHeaderRef,Y=N.onColumnOrderChange,X=N.onColumnSelect,$=N.onHeaderEdit,Z=N.onSort,Q=N.onTableHeaderDragEnd,ee=N.headerHeight,ne=N.selectColumns,re=N.selectableColumns,oe=N.selectedColumns,ae=N.setActiveHeaderDropdown,ue=N.setCollapsedHeaders,le=N.setHeaders,se=N.setInitialFocusedCell,ce=N.setIsResizing,fe=N.setSelectedCells,ve=N.setSelectedColumns,pe=N.sortDownIcon,he=N.sortUpIcon,we=N.tableBodyContainerRef,me=!!(null==d?void 0:d.isSortable),ge=!!(null==d?void 0:d.filterable),xe=N.filters[d.accessor],be=(null==E?void 0:E.accessor)===d.accessor,ye=d.isSelectionColumn&&N.enableRowSelection,Ie=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(d),Re=k.has(d.accessor),Se=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:be,estimatedHeight:200,estimatedWidth:250,margin:4}),Me=Se.triggerRef,Ne=Se.position,Ee=n.useMemo(function(){var e,n,t;if(!P)return!1;var r=_.filter(function(e){return"left"===e.pinned}),o=_.filter(function(e){return!e.pinned}),i=_.filter(function(e){return"right"===e.pinned});return"left"===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,_,d.accessor,d.pinned]),He=n.useMemo(function(){return!(!re||ye)&&v(d,i).some(function(e){return oe.has(e)})},[re,ye,d,i,oe]),Te=n.useMemo(function(){return!ye&&v(d,i).some(function(e){return F.has(e)})},[ye,d,i,F]),ke=n.useMemo(function(){return!(!d.children||0===d.children.length)&&(!Re||d.children.some(function(e){var n=e.showWhen||f;return"parentCollapsed"===n||"always"===n}))},[d.children,Re]),Ae=null==p?void 0:p.singleRowChildren,Fe=ke&&!d.singleRowChildren,Oe="st-header-cell ".concat(d.accessor===(null===(r=J.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(me?"clickable":""," ").concat(D&&!me?"columnReordering":""," ").concat(Fe?"parent":""," ").concat(Ae?"st-sub-header":""," ").concat(Ee?"st-last-column":""," ").concat(L&&!ye?"st-header-editable":""," ").concat(He?"st-header-selected":""," ").concat(Te&&!He?"st-header-has-highlighted-cell":""),Le=Pe({draggedHeaderRef:O,headers:_,hoveredHeaderRef:J,onColumnOrderChange:Y,onTableHeaderDragEnd:Q}),We=Le.handleDragStart,Be=Le.handleDragEnd,qe=Le.handleDragOver,ze=Ce();n.useEffect(function(){if(U&&!d.isSelectionColumn){var e=d.accessor+"";return U.set(e,{setEditing:function(e){C(e)}}),function(){U.delete(e)}}},[U,d.accessor,d.isSelectionColumn]),n.useEffect(function(){M(d.label||"")},[d.label]);var Ge=function(e){b(!x)},Ve=n.useCallback(function(e){M(e);var n=_.map(function(n){return n.accessor===d.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});le(n),$&&$(d,e)},[_,le,$,d]),je=n.useCallback(function(){ae&&ae(null)},[ae]),Ke=n.useCallback(function(e){e.stopPropagation(),ue(function(e){var n=new Set(e);return Re?n.delete(d.accessor):n.add(d.accessor),n})},[ue,Re,d.accessor]),Ue=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(re){var r=v(t,i),o=r.some(function(e){return oe.has(e)});if(L&&o&&!n.shiftKey)return V&&be&&je(),void C(!0);n.shiftKey&&ne?ve(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))}):ne&&ne(r),fe(new Set),se(null)}X&&X(t),!re&&t.isSortable&&Z(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 _e=A&&!ye&&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;ze({callback:Je,callbackProps:{event:e.nativeEvent,header:d,headers:_,setHeaders:le,setIsResizing:ce,tableBodyContainerRef:we,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;ze({callback:Je,callbackProps:{event:e,header:d,headers:_,setHeaders:le,setIsResizing:ce,tableBodyContainerRef:we,startWidth:t,collapsedHeaders:k,autoExpandColumns:T,reverse:h},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ye=m&&m.key.accessor===d.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return Ue({event:e,header:d})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Z(d.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(d.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&he&&he,"desc"===m.direction&&pe&&pe]})),Xe=ge&&W&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:Ge,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(),Ge()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(d.label),"aria-expanded":x,"aria-haspopup":"dialog"},{children:[n.cloneElement(W,{style:{fill:xe?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(te,exports.__assign({open:x,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(mn,{header:d,currentFilter:xe,onApplyFilter:function(e){B(e),b(!1)},onClearFilter:function(){q(d.accessor),b(!1)}})}))]})),$e=Ie&&!ye&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return Ke(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ke(e))},tabIndex:0,role:"button","aria-label":"".concat(Re?"Expand":"Collapse"," ").concat(d.label," column"),"aria-expanded":!Re},{children:Re?G:j})),Ze=e.jsx(gn,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:ye?e.jsx(De,{checked:!!H&&H(),onChange:function(e){z&&z(e)},ariaLabel:"Select all rows"}):I?e.jsx(ie,{defaultValue:S,onBlur:function(){return C(!1)},onChange:Ve}):S||(null==d?void 0:d.label)}))})),Qe="header-desc-".concat(d.accessor),en=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,ge);return e.jsxs(de,exports.__assign({className:Oe,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":en?Qe:void 0,onDragOver:function(e){ye||ze({callback:qe,callbackProps:{event:e,hoveredHeader:d},limit:50})},style:exports.__assign({gridRowStart:c,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-c>1?{}:{height:ee})},{children:[h&&_e,!d.headerRenderer&&"right"===d.align&&$e,!d.headerRenderer&&"right"===d.align&&Xe,!d.headerRenderer&&"right"===d.align&&Ye,e.jsx("div",exports.__assign({ref:Me,className:"st-header-label",draggable:D&&!d.disableReorder&&!ye,onClick:function(e){ye||Ue({event:e,header:d})},onDoubleClick:function(e){ye||function(e){var n=e.header;n.isSelectionColumn||re&&n.isSortable&&Z(n.accessor)}({event:e,header:d})},onDragEnd:ye?void 0:function(e){e.preventDefault(),Be()},onDragStart:ye?void 0:function(e){D&&d&&function(e){We(e)}(d)}},{children:d.headerRenderer?d.headerRenderer({accessor:d.accessor,colIndex:i,header:d,components:{sortIcon:Ye||void 0,filterIcon:Xe||void 0,collapseIcon:$e||void 0,labelContent:Ze}}):Ze})),!d.headerRenderer&&"right"!==d.align&&Ye,!d.headerRenderer&&"right"!==d.align&&Xe,!d.headerRenderer&&"right"!==d.align&&$e,!h&&_e,V&&!ye&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:V({accessor:d.accessor,colIndex:i,header:d,isOpen:be,onClose:je,position:Ne})})),en&&e.jsx("span",exports.__assign({id:Qe,className:"st-sr-only"},{children:en}))]}))},bn=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=K().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(Ve,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(xn,{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)})})}))}))},yn=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=K(),p=v.headerContainerRef,h=v.pinnedLeftRef,w=v.pinnedRightRef,m=v.collapsedHeaders,g=v.tableRows,x=v.maxHeaderDepth,b=n.useMemo(function(){return Ke({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:[Me(o,"left")&&e.jsx(bn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:x,pinned:"left",sectionRef:h,sort:c,width:d}),e.jsx(bn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:x,sectionRef:r,sort:c}),Me(o,"right")&&e.jsx(bn,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:x,pinned:"right",sectionRef:w,sort:c,width:f})]}))},In=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(" "))},Cn=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=K(),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 In({headers:S,collapsedHeaders:y,autoExpandColumns:I})},[S,y,I]),E=n.useMemo(function(){return In({headers:R,collapsedHeaders:y,autoExpandColumns:I})},[R,y,I]),H=n.useMemo(function(){return In({headers:M,collapsedHeaders:y,autoExpandColumns:I})},[M,y,I]),T={centerHeaderRef:C,headers:b,mainTemplateColumns:E,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedRightColumns:M,pinnedRightTemplateColumns:H,sort:c,pinnedLeftWidth:i,pinnedRightWidth:a},k={calculatedHeaderHeight:r,mainTemplateColumns:E,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedLeftWidth:i,pinnedRightColumns:M,pinnedRightTemplateColumns:H,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(yn,exports.__assign({},T)),e.jsx(_e,exports.__assign({},k))]}))},Rn=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=K().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(Ve,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(Ve,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(Ve,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},Sn={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 Sn.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?Sn.string(e,n,t):"number"==typeof e&&"number"==typeof n?Sn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Sn.boolean(e,n,t):Sn.string(e+"",n+"",t)}},Mn=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=M(e,l),u=M(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 Sn.number(i,a,r)}return"date"===t?Sn.date(e+"",n+"",r):"boolean"===t?Sn.boolean(!!e,!!n,r):"enum"===t?Sn.enum(e+"",n+"",r):Sn.string(e+"",n+"",r)}(r,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Nn=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}):Mn({headers:o,rows:n,sortColumn:t}):n},Hn=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(Hn([c],n,t),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},Tn=function(e){return e.every(function(e){return e.hide})},kn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(kn(e.children),Tn(e.children)&&(e.hide=!0))})},Pn=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=K(),b=x.dragIcon,y=x.expandIcon,I=x.headers,C=x.setHeaders,R=x.onColumnVisibilityChange,S=x.onColumnOrderChange,M="".concat(16*o,"px"),N=f.children&&f.children.length>0,E=null!=p?p:!(f.hide||N&&f.children&&Tn(f.children)),H=l.has(f.accessor),T=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:M},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=ke(I,a.header,t.header),o=r.newHeaders;r.emergencyBreak||(null==S||S(o),C(o)),n()}else n();else n()}else n()}},{children:[i&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:N?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(T?"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})):null})),e.jsx(De,{checked:E,onChange:function(e){f.hide=!e,e?(Hn(t,f.accessor),N&&f.children&&f.children.length>0&&f.children.every(function(e){return!0===e.hide})&&f.children[0]&&(f.children[0].hide=!1,Hn(t,f.children[0].accessor))):kn(t);var n=u([],I,!0);if(C(n),R){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);R(r)}}}),e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:b})),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)})},An=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(Pn,{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))})}))]}))}))},Fn=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(An,{headers:r,open:o,searchEnabled:i,searchPlaceholder:a,searchFunction:u})]})):null},On=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(Ge.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:r.default.Children.only(o)}))},Ln=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=me(e),v=me((r||"")+""),p=we(f),h=we(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 we(me((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 we(me((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}}(M(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},Wn=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},Bn=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=M(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}},qn=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},zn=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)})}},Gn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},Vn={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}},jn=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")},Kn=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(){jn(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Un=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:H({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,S){void 0===I&&(I=[]),void 0===C&&(C=[]),void 0===S&&(S=[]),e.forEach(function(e,M){var N,E,D=o[t],A=n.length,F=u(u([],I,!0),[M],!1),O=u(u([],C,!0),[M],!1),L=H({row:e,getRowId:i,depth:t,index:M,rowPath:F,rowIndexPath:O,groupingKey:D}),W=n.length,B={row:e,depth:t,displayPosition:b,groupingKey:D,position:A,isLastGroupRow:0===t,rowId:L,rowPath:F,rowIndexPath:O,absoluteRowIndex:A,parentIndices:S.length>0?u([],S,!0):void 0};n.push(B),r.push(B),b++;var q=T(L);if(P(q,t,s,a,l)&&o.length>t){var z=null==c?void 0:c.get(q),G=k(e,D),V=p.find(function(e){return e.expandable&&e.nestedTable});if((null==V?void 0:V.nestedTable)&&G.length>0){var j=n.length,K=(null===(N=V.nestedTable.customTheme)||void 0===N?void 0:N.rowHeight)||h,U=(null===(E=V.nestedTable.customTheme)||void 0===E?void 0:E.headerHeight)||w,_=R({childRowCount:G.length,rowHeight:K,headerHeight:U,customTheme:m});g.push([j,_-h]);var J=u(u([],F,!0),[D],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:D,position:j,isLastGroupRow:!1,rowId:J,rowPath:J,rowIndexPath:O,nestedTable:{parentRow:e,expandableHeader:V,childAccessor:D,calculatedHeight:_},absoluteRowIndex:j})}else if(z&&(z.loading||z.error||z.isEmpty)){if(z.loading&&d||z.error&&f||z.isEmpty&&v){var Y=n.length,X=u(u([],F,!0),[D],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:D,position:Y,isLastGroupRow:!1,rowId:X,rowPath:X,rowIndexPath:O,stateIndicator:{parentRowId:q,state:z},absoluteRowIndex:Y,parentIndices:u(u([],S,!0),[W],!1)})}else if(z.loading&&!d){var $=n.length,Z=u(u([],F,!0),[D,"loading-skeleton"],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:D,position:$,isLastGroupRow:!1,rowId:Z,rowPath:Z,rowIndexPath:O,isLoadingSkeleton:!0,absoluteRowIndex:$,parentIndices:u(u([],S,!0),[W],!1)})}}else if(G.length>0){var Q=u(u([],F,!0),[D],!1),ee=u([],O,!0);y(G,t+1,Q,ee,u(u([],S,!0),[W],!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])},_n=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},Jn={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},Yn={text:"Columns",searchEnabled:!0,searchPlaceholder:"Search columns..."},Xn=[{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."}],$n=function(t){var r=n.useState(!1),o=r[0],i=r[1];return n.useEffect(function(){!function(e){"production"!==process.env.NODE_ENV&&Xn.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?Yn:y,C=t.columnEditorText,R=t.columnReordering,S=void 0!==R&&R,k=t.columnResizing,P=void 0!==k&&k,A=t.copyHeadersToClipboard,F=void 0!==A&&A,L=t.customTheme,W=t.defaultHeaders,q=t.editColumns,V=void 0!==q&&q,K=t.editColumnsInitOpen,X=void 0!==K&&K,ee=t.emptyStateRenderer,te=t.enableHeaderEditing,re=void 0!==te&&te,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,Se=t.hideHeader,Me=void 0!==Se&&Se,Ne=t.icons,Ee=t.includeHeadersInCSVExport,He=void 0===Ee||Ee,Te=t.initialSortColumn,ke=t.initialSortDirection,Pe=void 0===ke?"asc":ke,De=t.isLoading,Ae=void 0!==De&&De,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,$e=t.onRowSelectionChange,Ze=t.onSortChange,Qe=t.prevIcon,en=t.rowButtons,nn=t.rowGrouping,tn=t.getRowId,rn=t.rows,on=t.rowsPerPage,an=void 0===on?10:on,un=t.selectableCells,ln=void 0!==un&&un,sn=t.selectableColumns,cn=void 0!==sn&&sn,dn=t.serverSidePagination,fn=void 0!==dn&&dn,vn=t.shouldPaginate,pn=void 0!==vn&&vn,hn=t.sortDownIcon,wn=t.sortUpIcon,mn=t.tableEmptyStateRenderer,gn=void 0===mn?e.jsx(_n,{}):mn,xn=t.tableRef,bn=t.theme,yn=void 0===bn?"light":bn,In=t.totalRowCount,Sn=t.useHoverRowBackground,Hn=void 0===Sn||Sn,Tn=t.useOddColumnBackground,kn=void 0!==Tn&&Tn,Pn=t.useOddEvenRowBackground,Dn=void 0!==Pn&&Pn,An=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(J,{className:"st-expand-icon"}),filter:e.jsx(Q,{className:"st-header-icon"}),headerCollapse:e.jsx(J,{className:"st-header-icon"}),headerExpand:e.jsx(_,{className:"st-header-icon"}),next:e.jsx(J,{className:"st-next-prev-icon"}),prev:e.jsx(_,{className:"st-next-prev-icon"}),sortDown:e.jsx($,{className:"st-header-icon"}),sortUp:e.jsx(Y,{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:Qe)&&void 0!==v?v:g.prev,sortDown:null!==(h=null!==(p=null==Ne?void 0:Ne.sortDown)&&void 0!==p?p:hn)&&void 0!==h?h:g.sortDown,sortUp:null!==(m=null!==(w=null==Ne?void 0:Ne.sortUp)&&void 0!==w?w:wn)&&void 0!==m?m:g.sortUp}},[Ne,de,we,ge,be,Le,Qe,hn,wn]),Gn=n.useMemo(function(){return exports.__assign(exports.__assign({},Jn),L)},[L]),jn=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:Yn.text,searchEnabled:null!==(t=null==I?void 0:I.searchEnabled)&&void 0!==t?t:Yn.searchEnabled,searchPlaceholder:null!==(r=null==I?void 0:I.searchPlaceholder)&&void 0!==r?r:Yn.searchPlaceholder,searchFunction:null==I?void 0:I.searchFunction}},[I,C]),Kn=Gn.rowHeight,Xn=Gn.headerHeight,$n=Gn.footerHeight,Zn=Gn.selectionColumnWidth;kn&&(Dn=!1),b&&(Hn=!1);var Qn=n.useRef(null),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.useReducer(function(e){return e+1},0)[1],ut=n.useState(new Map),lt=ut[0],st=ut[1],ct=n.useState(rn),dt=ct[0],ft=ct[1],vt=n.useState(Ae),pt=vt[0],ht=vt[1],wt=n.useRef(Ae),mt=n.useRef(new Map);n.useEffect(function(){ft(rn);var e=new Map;rn.forEach(function(n,t){var r=H({row:n,getRowId:tn,depth:0,index:t,rowPath:[t],rowIndexPath:[t]}),o=T(r);e.set(o,t)}),mt.current=e},[rn,tn]),n.useEffect(function(){var e=wt.current,n=Ae;n&&!e?ht(!0):!n&&e&&setTimeout(function(){ht(!1)},0),wt.current=Ae},[Ae]);var gt,xt,bt,yt,It,Ct,Rt,St,Mt,Nt,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:ot}),Ht=Et.scrollbarWidth,Tt=Et.setScrollbarWidth,kt=ne({headerContainerRef:it,mainSectionRef:ot,scrollbarWidth:Ht}).isMainSectionScrollable,Pt=n.useMemo(function(){if(pt&&0===dt.length){var e=pn?an:10;return kt&&(e+=1),Array.from({length:e},function(e,n){return{}})}return dt},[pt,dt,an,kt,pn]),Dt=n.useState(1),At=Dt[0],Ft=Dt[1],Ot=n.useState(W),Lt=Ot[0],Wt=Ot[1],Bt=n.useState(!1),qt=Bt[0],zt=Bt[1],Gt=n.useState(!1),Vt=Gt[0],jt=Gt[1],Kt=n.useState(null),Ut=Kt[0],_t=Kt[1],Jt=n.useState(X),Yt=Jt[0],Xt=Jt[1],$t=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($t),Qt=Zt[0],er=Zt[1];n.useEffect(function(){Wt(W)},[W]);var nr=n.useMemo(function(){var e,n=u([],Lt,!0);return ie&&!(null===(e=null==Lt?void 0:Lt[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,Lt,Zn]),tr=n.useState(0),rr=tr[0],or=tr[1],ir=n.useState("none"),ar=ir[0],ur=ir[1],lr=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,nn),sr=lr.expandedDepths,cr=lr.setExpandedDepths,dr=n.useState(new Map),fr=dr[0],vr=dr[1],pr=n.useState(new Map),hr=pr[0],wr=pr[1],mr=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)}}}(),gr=mr.announcement,xr=mr.announce,br=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:nr,headerHeight:Xn,rowHeight:Kn,tableBodyContainerRef:ot}),yr=br.containerWidth,Ir=br.calculatedHeaderHeight,Cr=br.maxHeaderDepth,Rr=n.useRef(0),Sr=n.useRef(0),Mr=n.useMemo(function(){var e=d(window.innerWidth),n=Xe({headers:nr,containerWidth:yr,maxPinnedWidthPercent:e,collapsedHeaders:Qt});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[nr,yr,Qt]),Nr=Mr.mainBodyWidth,Er=Mr.pinnedLeftWidth,Hr=Mr.pinnedRightWidth,Tr=Mr.pinnedLeftContentWidth,kr=Mr.pinnedRightContentWidth;n.useEffect(function(){if(c&&0!==yr&&!qt){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=nt.current?nt.current.clientWidth:Math.max(0,yr-Er-Hr))>0){var t=Lt.filter(function(e){return!e.pinned});n(t).length===Sr.current&&10>Math.abs(e-Rr.current)||Wt(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;Rr.current=e,Sr.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,yr,qt,Lt,Er,Hr]);var Pr=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=Bn(l,e.accessor,e.aggregation,a);void 0!==n&&N(s,e.accessor,n)}),s}return n})};return i(n)},[t,r,o])}({rows:Pt,headers:Lt,rowGrouping:nn}),Dr=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=Nn(r),d=n.useMemo(function(){return Ln({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 Ln({externalFilterHandling:o,tableRows:t,filterState:r})},[l,t,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Pr,headers:nr,externalFilterHandling:ve,onFilterChange:Ve,announce:xr}),Ar=Dr.filters,Fr=Dr.updateFilter,Or=Dr.clearFilter,Lr=Dr.clearAllFilters,Wr=Dr.computeFilteredRowsPreview,Br=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=Nn(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=Mn({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:Lt,tableRows:Dr.filteredRows,externalSortHandling:he,onSortChange:Ze,rowGrouping:nn,initialSortColumn:Te,initialSortDirection:Pe,announce:xr}),qr=Br.sort,zr=Br.updateSort,Gr=Br.computeSortedRowsPreview,Vr=Un({rows:Br.sortedRows,rowGrouping:nn,getRowId:tn,expandedRows:fr,collapsedRows:hr,expandedDepths:sr,rowStateMap:lt,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!ee,headers:nr,rowHeight:Kn,headerHeight:Xn,customTheme:Gn}),jr=Vr.flattenedRows,Kr=Vr.heightOffsets,Ur=Vr.paginatableRows,_r=Vr.parentEndPositions,Jr=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(T(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(T(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 T(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 T(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 T(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 T(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:jr,onRowSelectionChange:$e,enableRowSelection:ie});gt=Jr.selectedRows,xt=Jr.setSelectedRows,bt=Jr.isRowSelected,yt=Jr.areAllRowsSelected,It=Jr.selectedRowCount,Ct=Jr.selectedRowsData,Rt=Jr.handleRowSelect,St=Jr.handleSelectAll,Mt=Jr.handleToggleRow,Nt=Jr.clearSelection;var Yr=Un({rows:Pr,rowGrouping:nn,getRowId:tn,expandedRows:fr,collapsedRows:hr,expandedDepths:sr,rowStateMap:lt,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!ee,headers:nr,rowHeight:Kn,headerHeight:Xn,customTheme:Gn}).flattenedRows,Xr=n.useCallback(function(e){var n=Wr(e);return nn&&0!==nn.length?D({rows:n,rowGrouping:nn,getRowId:tn,expandedRows:fr,collapsedRows:hr,expandedDepths:sr,rowStateMap:lt,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!ee,headers:nr,rowHeight:Kn,headerHeight:Xn,customTheme:Gn}):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}})},[Wr,nn,tn,fr,hr,sr,lt,Fe,le,ee,nr,Kn,Xn,Gn]),$r=n.useCallback(function(e){var n=Gr(e);return nn&&0!==nn.length?D({rows:n,rowGrouping:nn,getRowId:tn,expandedRows:fr,collapsedRows:hr,expandedDepths:sr,rowStateMap:lt,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!le,hasEmptyRenderer:!!ee,headers:nr,rowHeight:Kn,headerHeight:Xn,customTheme:Gn}):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}})},[Gr,nn,tn,fr,hr,sr,lt,Fe,le,ee,nr,Kn,Xn,Gn]),Zr=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=Wn(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=Wn(t);if(0!==l)return Math.max(0,l-o)}},[t,r,o,i,a,u])}({height:ye,maxHeight:Oe,rowHeight:Kn,shouldPaginate:pn,rowsPerPage:an,totalRowCount:null!=In?In:Ur.length,headerHeight:Ir,footerHeight:pn&&!Ce?$n:void 0}),Qr=function(e){var t=e.allowAnimations,r=e.computeFilteredRowsPreview,o=e.computeSortedRowsPreview,i=e.contentHeight,a=e.currentPage,s=e.customTheme,c=e.enableStickyParents,d=e.flattenedRows,f=e.heightOffsets,v=e.originalFlattenedRows,p=e.parentEndPositions,h=e.rowHeight,w=e.rowsPerPage,m=e.scrollDirection,g=void 0===m?"none":m,x=e.scrollTop,b=e.serverSidePagination,y=e.shouldPaginate,I=e.rowGrouping,C=n.useState(!1),R=C[0],S=C[1],M=n.useState([]),N=M[0],E=M[1],H=n.useRef([]),k=n.useRef([]),P=n.useMemo(function(){return l(h)},[h]),D=n.useRef(new Map),A=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===D.current.size&&v.length>0){var e=new Map;v.forEach(function(n,t){var r=T(n.rowId);e.set(r,t)}),D.current=e}},[v]);var L=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 L.forEach(function(n){n.nestedTable&&e.set(n.absoluteRowIndex,n.position)}),f.filter(function(n){return e.has(n[0])}).map(function(n){var t=n[1];return[e.get(n[0]),t]})},[f,L,y,b]),q=n.useMemo(function(){if(W&&0!==W.length)return function(e,n,t,r){var o=n+r.rowSeparatorWidth,i=Array(e),a=new Map;t&&t.forEach(function(e){a.set(e[0],e[1])});for(var u=0,l=0;e>l;l++){i[l]=u,u+=o;var s=a.get(l);void 0!==s&&(u+=s)}return{rowTopPositions:i,totalHeight:u-r.rowSeparatorWidth}}(L.length,h,W,s)},[L.length,h,W,s]),z=n.useMemo(function(){return void 0===i?L:O({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}).rendered.rows},[L,i,h,x,g,P,q]),G=n.useMemo(function(){if(!c||void 0===i)return{stickyParents:[],regularRows:z,partiallyVisibleRows:[]};var e=O({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}),n=I?function(e,n,t,r,o){return B({allTableRows:e,renderedRows:n,fullyVisibleRows:t,partiallyVisibleRows:r,partiallyVisibleRowIndex:0,recursionDepth:0,stickyParents:[],rowGrouping:o})}(L,e.rendered.rows,e.fullyVisible.rows,e.partiallyVisible.rows,I):{stickyParents:[],regularRows:e.rendered.rows,partiallyVisibleRows:[]};return exports.__assign(exports.__assign({},n),{partiallyVisibleRows:e.partiallyVisible.rows})},[P,i,L,c,q,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 T(e.rowId)})),r=new Set(n.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)}));return{staying:n.filter(function(e){var n=T(e.rowId);return t.has(n)}),entering:n.filter(function(e){var n=T(e.rowId);return!t.has(n)}),leaving:e.filter(function(e){var n=T(e.rowId);return!r.has(n)})}},[]),_=n.useMemo(function(){if(0===H.current.length)return!1;var e=L.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)}),n=H.current.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L]);n.useLayoutEffect(function(){if(!R){var e=function(){N.length>0&&E([])};if(!t||y)return e(),H.current=L,void(k.current=z);if(0===H.current.length)return e(),H.current=L,void(k.current=z);if(!_)return e(),H.current=L,void(k.current=z);A.current={tableRows:L,visibleRows:z},S(!0)}},[t,L,N.length,_,R,y,z]),n.useLayoutEffect(function(){if(R&&A.current&&N.length>0){var e=setTimeout(function(){var e=A.current;S(!1),E([]),H.current=e.tableRows,k.current=e.visibleRows,A.current=null},Vn.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 L.forEach(function(t){var r=T(t.rowId);e.set(r,t.position),n.set(r,t.displayPosition)}),N.map(function(t){var r=T(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,L,t,y]),Y=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=r(e),o=F(n,[]),a=O({bufferRowCount:P,contentHeight:i,tableRows:o,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}),l=U(z,a.rendered.rows).entering.map(function(e){var n=T(e.rowId)+"";return L.find(function(e){return T(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],z,!0),l,!0))}},[t,y,r,F,i,h,x,g,U,L,z,P,q]),X=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=o(e),r=F(n,[]),a=O({bufferRowCount:P,contentHeight:i,tableRows:r,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}),l=U(z,a.rendered.rows).entering.map(function(e){var n=T(e.rowId)+"";return L.find(function(e){return T(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],z,!0),l,!0))}},[t,y,o,F,i,h,x,g,U,L,z,P,q]);return{currentTableRows:L,currentVisibleRows:z,isAnimating:R,prepareForFilterChange:Y,prepareForSortChange:X,rowsToRender:J,stickyParents:V,regularRows:j,partiallyVisibleRows:K,paginatedHeightOffsets:W,heightMap:q}}({allowAnimations:o,computeFilteredRowsPreview:Xr,computeSortedRowsPreview:$r,contentHeight:Zr,currentPage:At,customTheme:Gn,enableStickyParents:ue,flattenedRows:jr,heightOffsets:Kr,originalFlattenedRows:Yr,paginatableRows:Ur,parentEndPositions:_r,rowGrouping:nn,rowHeight:Kn,rowsPerPage:an,scrollDirection:ar,scrollTop:rr,serverSidePagination:fn,shouldPaginate:pn}),eo=Qr.currentTableRows,no=Qr.rowsToRender,to=Qr.prepareForFilterChange,ro=Qr.prepareForSortChange,oo=Qr.isAnimating,io=Qr.stickyParents,ao=Qr.regularRows,uo=Qr.partiallyVisibleRows,lo=Qr.paginatedHeightOffsets,so=Qr.heightMap,co=n.useRef(new Map),fo=n.useRef(new Map),vo=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],E=n.useState(null),H=E[0],k=E[1],P=n.useState(new Set),D=P[0],A=P[1],F=n.useState(new Set),O=F[0],L=F[1],W=n.useState(!1),B=W[0],q=W[1],V=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=T(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=M(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),A(new Set(m)),setTimeout(function(){return A(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(!H)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=T(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(N(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,H,_,o,u,l),r=n.warningCells,(t=n.updatedCells).size>0&&(A(t),setTimeout(function(){return A(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]}})})},[H,_,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=T(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(M(c.row,d.accessor))?[]:""),N(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&&(A(n),setTimeout(function(){return A(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=T(o[l].rowId);t.add(G({colIndex:s,rowIndex:l,rowId:d}))}I(new Set),S(null),g(t),k(n),setTimeout(function(){return z(n,c,h)},0)},[o,c,f,h]),Z=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?_.length:_.length-1)>=e.colIndex){var n=G(e);I(new Set),S(null),g(new Set([n])),k(e),setTimeout(function(){return z(e,c,h)},0)}},[_.length,o.length,c,f,h]),Q=n.useCallback(function(e,n){void 0===n&&(n=!1),g(new Set),k(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 E=0;u.length>E;E++){var H=i?E+1:E,k=T(m[N].rowId);M.add("".concat(N,"-").concat(H,"-").concat(k))}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?T(P.rowId):null)!==S){var D=m.findIndex(function(e){return T(e.rowId)===S});if(-1===D)return;c=D}var A=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,A)):"ArrowDown"===e.key?(e.preventDefault(),o(e,c,R,A)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,c,R,A)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,c,R,A)):"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=T(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=T(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=T(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=T(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=T(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=T(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=T(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=T(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=T(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=T(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=T(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=T(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=T(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=T(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=T(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=T(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:H,tableRows:o,leafHeaders:_,selectSingleCell:Z,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=T(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=T(o[p].rowId);t.add(G({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=G({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?T(a.rowId):null,l=o[t+1],s=l?T(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 H?function(e){return e.rowIndex===H.rowIndex&&e.colIndex===H.colIndex&&e.rowId===H.rowId}:function(){return!1}},[H]),ue=n.useCallback(function(e){var n=G({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return D.has(n)},[D]),le=n.useCallback(function(e){var n=G({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){V.current=!0,q(!0),j.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){I(new Set),S(null);var e=G({colIndex:n,rowIndex:r,rowId:o});g(new Set([e])),k({rowIndex:r,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,s=function(){if(V.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){V.current&&j.current&&(i=e.clientX,a=e.clientY)},d=function(){V.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&&V.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:Q,selectedCells:m,selectedColumns:y,setInitialFocusedCell:k,setSelectedCells:g,setSelectedColumns:I,deleteSelectedCells:X,columnsWithSelectedCells:K,rowsWithSelectedCells:U,startCell:j}}({selectableCells:ln,headers:nr,tableRows:eo,onCellEdit:Be,cellRegistry:co.current,collapsedHeaders:Qt,rowHeight:Kn,enableRowSelection:ie,copyHeadersToClipboard:F,customTheme:Gn}),po=vo.getBorderClass,ho=vo.handleMouseDown,wo=vo.handleMouseOver,mo=vo.isCopyFlashing,go=vo.isInitialFocusedCell,xo=vo.isSelected,bo=vo.isWarningFlashing,yo=vo.selectColumns,Io=vo.selectedCells,Co=vo.selectedColumns,Ro=vo.setInitialFocusedCell,So=vo.setSelectedCells,Mo=vo.setSelectedColumns,No=vo.columnsWithSelectedCells,Eo=vo.rowsWithSelectedCells,Ho=vo.startCell,To=n.useCallback(function(e){ro(e),setTimeout(function(){zr({accessor:e})},0)},[ro,zr]),ko=n.useCallback(function(e){Wt(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:cn,selectedCells:Io,selectedColumns:Co,setSelectedCells:So,setSelectedColumns:Mo,activeHeaderDropdown:Ut,setActiveHeaderDropdown:_t,startCell:Ho}),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:at,tableBodyContainerRef:ot,setScrollbarWidth:Tt}),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.rowGrouping,y=e.rows,I=e.rowsPerPage,C=e.setCollapsedRows,R=e.setColumnEditorOpen,S=e.setCurrentPage,E=e.setExpandedDepths,H=e.setExpandedRows,k=e.setHeaders,P=e.sort,D=e.tableRef,A=e.totalRowCount,F=e.updateFilter,O=e.updateSort,L=e.visibleRows;n.useEffect(function(){D&&(D.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==y?void 0:y[r];if(i){var a=T([r]),u=g({rowId:a,accessor:n}),l=t.current.get(u);l&&l.updateContent(o),void 0!==M(i,n)&&N(i,n,o)}},setHeaderRename:function(e){var n=v.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return L},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 qn(e.label)}).join(","),i=e.map(function(e,n){var t=e.row;return r.map(function(e,r){var o=M(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 qn(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}),qn(i)):qn(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 P},applySortState:zn(O),getFilterState:function(){return d},applyFilter:zn(F),clearFilter:zn(o),clearAllFilters:zn(r),getCurrentPage:function(){return l},getTotalPages:function(){return Math.ceil((null!=A?A:x.length)/I)},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!=A?A:x.length)/I),1>e||e>n?[3,2]:(S(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==b?void 0:b.length)||0},function(e,n){return n});E(new Set(e)),H(new Map),C(new Map)},collapseAll:function(){E(new Set),H(new Map),C(new Map)},expandDepth:function(e){E(function(n){for(var t=new Set(n),r=0;e>=r;r++)t.add(r);return t}),H(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),C(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}),H(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),C(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}),H(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),C(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==b?void 0:b[e]},getGroupingDepth:function(e){var n;return null!==(n=null==b?void 0:b.indexOf(e))&&void 0!==n?n:-1},toggleColumnEditor:function(e){s&&R(void 0!==e?e:function(e){return!e})},applyColumnVisibility:zn(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})})};k(function(e){return n(e)}),w&&w(e)})})},[t,r,o,l,s,c,d,f,v,p,h,w,m,x,b,e.rowIndexMap,y,I,e.serverSidePagination,C,R,S,E,H,k,e.setRows,e.shouldPaginate,P,D,A,F,O,L])}({cellRegistryRef:co,clearAllFilters:Lr,clearFilter:Or,currentPage:At,editColumns:V,expandedDepths:sr,filters:Ar,flattenedRows:jr,headerRegistryRef:fo,headers:nr,includeHeadersInCSVExport:He,onColumnVisibilityChange:Ge,onPageChange:Je,paginatableRows:Ur,rowGrouping:nn,rowIndexMap:mt,rows:Pt,rowsPerPage:an,serverSidePagination:fn,setCollapsedRows:wr,setColumnEditorOpen:Xt,setCurrentPage:Ft,setExpandedDepths:cr,setExpandedRows:vr,setHeaders:Wt,setRows:ft,shouldPaginate:pn,sort:qr,tableRef:xn,totalRowCount:In,updateFilter:Fr,updateSort:zr,visibleRows:no}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:Ar,onFilterChange:Ve}),function(e){var t=e.sort,r=e.onSortChange,o=Re(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:qr,onSortChange:Ze});var Po=n.useCallback(function(e){to(e),setTimeout(function(){Fr(e)},0)},[to,Fr]),Do=!pt&&0===eo.length;return e.jsx(j,exports.__assign({value:{activeHeaderDropdown:Ut,allowAnimations:o,areAllRowsSelected:yt,autoExpandColumns:c,canExpandRowGroup:f,cellRegistry:co.current,cellUpdateFlash:h,clearSelection:Nt,collapsedHeaders:Qt,columnBorders:b,columnReordering:S,columnResizing:P,columnsWithSelectedCells:No,copyHeadersToClipboard:F,draggedHeaderRef:Qn,dragIcon:An.drag,editColumns:V,emptyStateRenderer:ee,enableHeaderEditing:re,enableRowSelection:ie,errorStateRenderer:le,expandedDepths:sr,expandIcon:An.expand,filterIcon:An.filter,filters:Ar,forceUpdate:at,getBorderClass:po,handleApplyFilter:Po,handleClearAllFilters:Lr,handleClearFilter:Or,handleMouseDown:ho,handleMouseOver:wo,handleRowSelect:Rt,handleSelectAll:St,handleToggleRow:Mt,headerCollapseIcon:An.headerCollapse,headerContainerRef:it,headerDropdown:xe,headerExpandIcon:An.headerExpand,headerHeight:Xn,headerRegistry:fo.current,headers:nr,heightOffsets:lo,hoveredHeaderRef:et,includeHeadersInCSVExport:He,isAnimating:oo,isCopyFlashing:mo,isInitialFocusedCell:go,isLoading:pt,isResizing:qt,isRowSelected:bt,isScrolling:Vt,isSelected:xo,isWarningFlashing:bo,loadingStateRenderer:Fe,mainBodyRef:nt,maxHeaderDepth:Cr,nextIcon:An.next,onCellClick:We,onCellEdit:Be,onColumnOrderChange:qe,onColumnSelect:ze,onColumnVisibilityChange:Ge,onHeaderEdit:Ke,onLoadMore:Ue,onRowGroupExpand:Ye,onSort:To,onTableHeaderDragEnd:ko,pinnedLeftRef:tt,pinnedRightRef:rt,prevIcon:An.prev,rowButtons:en,rowGrouping:nn,rowHeight:Kn,rowStateMap:lt,rows:dt,rowsWithSelectedCells:Eo,scrollbarWidth:Ht,selectColumns:yo,selectableColumns:cn,selectedColumns:Co,selectedRowCount:It,selectedRows:gt,selectedRowsData:Ct,setActiveHeaderDropdown:_t,setCollapsedHeaders:er,setHeaders:Wt,setInitialFocusedCell:Ro,setIsResizing:zt,setIsScrolling:jt,setRowStateMap:st,setSelectedCells:So,setSelectedColumns:Mo,setSelectedRows:xt,setExpandedDepths:cr,setExpandedRows:vr,setCollapsedRows:wr,shouldPaginate:pn,sortDownIcon:An.sortDown,sortUpIcon:An.sortUp,tableBodyContainerRef:ot,tableEmptyStateRenderer:gn,tableRows:eo,theme:yn,customTheme:Gn,expandedRows:fr,collapsedRows:hr,useHoverRowBackground:Hn,useOddColumnBackground:kn,useOddEvenRowBackground:Dn}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(yn," ").concat(null!=w?w:""," ").concat(b?"st-column-borders":""),style:Oe?{maxHeight:Oe,height:void 0===Zr?"auto":Oe}:ye?{height:ye}:{}},{children:[e.jsx(On,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(Cn,{calculatedHeaderHeight:Ir,hideHeader:Me,pinnedLeftWidth:Er,pinnedRightWidth:Hr,setScrollTop:or,setScrollDirection:ur,shouldShowEmptyState:Do,sort:qr,tableRows:eo,rowsToRender:no,stickyParents:io,regularRows:ao,partiallyVisibleRows:uo,heightMap:so}),e.jsx(Fn,{columnEditorText:jn.text,editColumns:V,headers:Lt,open:Yt,searchEnabled:jn.searchEnabled,searchPlaceholder:jn.searchPlaceholder,searchFunction:jn.searchFunction,setOpen:Xt})]})),!Do&&e.jsx(Rn,{mainBodyRef:nt,mainBodyWidth:Nr,pinnedLeftWidth:Er,pinnedRightWidth:Hr,pinnedLeftContentWidth:Tr,pinnedRightContentWidth:kr,tableBodyContainerRef:ot}),!Do&&e.jsx(U,{currentPage:At,footerRenderer:me,hideFooter:Ce,onPageChange:Ft,onNextPage:_e,onUserPageChange:Je,rowsPerPage:an,shouldPaginate:pn,totalPages:Math.ceil((null!=In?In:Ur.length)/an),totalRows:null!=In?In:Ur.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:gr}))]}))}))},Qn=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"})]}))},et=Object.freeze({__proto__:null,default:Qn}),nt=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)})}))},tt=Object.freeze({__proto__:null,default:nt});exports.ANIMATION_CONFIGS=Vn,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=_,exports.AngleRightIcon=J,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=Y,exports.BarChart=nt,exports.CheckIcon=X,exports.DEFAULT_COLUMN_EDITOR_CONFIG=Yn,exports.DEFAULT_CUSTOM_THEME=Jn,exports.DefaultEmptyState=_n,exports.DescIcon=$,exports.DragIcon=Z,exports.FilterIcon=Q,exports.LineAreaChart=Qn,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=ee,exports.SimpleTable=$n,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,Gn()&&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||Gn()&&!1!==t.respectReducedMotion?[2]:(u=t,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=Gn()?exports.__assign(exports.__assign({},Vn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},Vn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},Vn.ROW_REORDER),u),jn(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,Kn(n,i,t)]);case 1:return a.sent(),[2]}var u,l})})},exports.rowIdToString=T,exports.usePrevious=Re,exports.useTableContext=K;
2
- //# sourceMappingURL=index-e0379c0f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-e0379c0f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}