simple-table-core 2.4.8 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Animate-78104f65.js +2 -0
- package/dist/Animate-78104f65.js.map +1 -0
- package/dist/{DatePicker-102b9376.js → DatePicker-7353507b.js} +2 -2
- package/dist/DatePicker-7353507b.js.map +1 -0
- package/dist/cjs/{Animate-21c6dc8a.js → Animate-9232b9f5.js} +2 -2
- package/dist/cjs/Animate-9232b9f5.js.map +1 -0
- package/dist/cjs/{DatePicker-c0e6c37b.js → DatePicker-7995d91f.js} +2 -2
- package/dist/cjs/DatePicker-7995d91f.js.map +1 -0
- package/dist/cjs/components/simple-table/TableSection.d.ts +1 -1
- package/dist/cjs/consts/column-constraints.d.ts +58 -0
- package/dist/cjs/consts/general-consts.d.ts +2 -9
- package/dist/cjs/context/TableContext.d.ts +1 -0
- package/dist/cjs/hooks/useAutoScaleMainSection.d.ts +28 -0
- package/dist/cjs/index-7da7745f.js +2 -0
- package/dist/cjs/index-7da7745f.js.map +1 -0
- package/dist/cjs/index.d.ts +3 -5
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/types/HandleResizeStartProps.d.ts +7 -7
- package/dist/cjs/utils/cellUtils.d.ts +2 -1
- package/dist/cjs/utils/resizeUtils.d.ts +13 -10
- package/dist/components/simple-table/TableSection.d.ts +1 -1
- package/dist/consts/column-constraints.d.ts +58 -0
- package/dist/consts/general-consts.d.ts +2 -9
- package/dist/context/TableContext.d.ts +1 -0
- package/dist/hooks/useAutoScaleMainSection.d.ts +28 -0
- package/dist/index-2602acfc.js +2 -0
- package/dist/index-2602acfc.js.map +1 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.es.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/HandleResizeStartProps.d.ts +7 -7
- package/dist/utils/cellUtils.d.ts +2 -1
- package/dist/utils/resizeUtils.d.ts +13 -10
- package/package.json +1 -1
- package/src/styles/base.css +1 -0
- package/dist/Animate-b1367c4b.js +0 -2
- package/dist/Animate-b1367c4b.js.map +0 -1
- package/dist/DatePicker-102b9376.js.map +0 -1
- package/dist/cjs/Animate-21c6dc8a.js.map +0 -1
- package/dist/cjs/DatePicker-c0e6c37b.js.map +0 -1
- package/dist/cjs/index-f3eb81f4.js +0 -2
- package/dist/cjs/index-f3eb81f4.js.map +0 -1
- package/dist/index-97bee1ae.js +0 -2
- package/dist/index-97bee1ae.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),n=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(n);function o(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);t.length>o;o++)0>n.indexOf(t[o])&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function i(e,n,r,t){return new(r||(r=Promise))(function(o,i){function a(e){try{l(t.next(e))}catch(e){i(e)}}function u(e){try{l(t.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(a,u)}l((t=t.apply(e,n||[])).next())})}function a(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&u[0]?t.return:u[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,u[1])).done)return o;switch(t=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,t=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&o[3]>u[1])){i.label=u[1];break}if(6===u[0]&&o[1]>i.label){i.label=o[1],o=u;break}if(o&&o[2]>i.label){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(e){u=[6,e],t=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}function u(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;i>o;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;t>r;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},s=29.5,c=["lineAreaChart","barChart"],d=40,f=function(e,n,r){return n&&r?480>e?.25:768>e?.3:.4:function(e){return 480>e?.4:768>e?.5:.6}(e)},v="parentExpanded",p=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=t(a[i],o);return o};return t(e,n),r},h=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,h(e.children)),n})},w=function(e){return void 0===e&&(e=0),e?e+1:0},m=function(e,n){for(var r=0,t=h(e);t.length>r;r++){var o=t[r];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null},g=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},x=function(e){var n=e.header,r=e.headers,t=e.collapsedHeaders;return n.hide||n.excludeFromRender||e.rootPinned!==e.pinned?null:!(r&&t&&function(e,n,r){var t=m(n,e.accessor);if(t){var o=r.has(t.accessor),i=e.showWhen||v;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,r,t))||null},b=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},y=function(e){var n=e.customTheme;return Math.min(e.headerHeight+n.rowSeparatorWidth+e.childRowCount*(e.rowHeight+n.rowSeparatorWidth)+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth,n.nestedGridMaxHeight+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth)},I=function(e){var n=e.calculatedHeight,r=e.customHeight,t=e.customTheme;return r?("string"==typeof r?parseFloat(r):r)+t.nestedGridPaddingTop+t.nestedGridPaddingBottom:n},C=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},R=function(e,n){var r=n+"";return r.includes(".")||r.includes("[")?r.split(".").reduce(function(e,n){if(null!=e){var r=C(n),t=r.index,o=e[r.key];return null!==t&&Array.isArray(o)&&(o=o[t]),o}},e):e[n]},S=function(e,n,r){var t=n+"";if(t.includes(".")||t.includes("[")){for(var o=t.split("."),i=e,a=0;o.length-1>a;a++){var u=C(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=C(o[a+1]);i[l]=null!==c.index?[]:{}}if(i=i[l],null!==s){if(!Array.isArray(i))throw Error("Expected array at ".concat(o.slice(0,a+1).join("."),", but found ").concat(typeof i));for(;s>=i.length;)i.push(null);null==i[s]&&(i[s]={}),i=i[s]}}var d=C(o[o.length-1]),f=d.key,v=d.index;if(null!==v){for(Array.isArray(i[f])||(i[f]=[]);v>=i[f].length;)i[f].push(null);i[f][v]=r}else i[f]=r}else e[n]=r},M=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},N=function(e){var n=e.getRowId,r=u([],e.rowPath,!0);if(n){var t=n({row:e.row,depth:e.depth,index:e.index,rowPath:e.rowPath,rowIndexPath:e.rowIndexPath,groupingKey:e.groupingKey});r.push(t)}return r},H=function(e){return e.join("-")},E=function(e,n){var r=e[n];return M(r)?r:[]},T=function(e,n,r,t,o){var i=e+"",a=t.has(i)&&t.get(i)===n,u=o.has(i)&&o.get(i)===n;return r.has(n)?!u:a},k=function(e){var n=e.depth,r=e.expandedDepths,t=e.expandedRows,o=e.collapsedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.getRowId,s=e.displayPositionOffset,c=void 0===s?0:s,d=e.rowStateMap,f=e.hasLoadingRenderer,v=void 0!==f&&f,p=e.hasErrorRenderer,h=void 0!==p&&p,w=e.hasEmptyRenderer,m=void 0!==w&&w,g=e.headers,x=void 0===g?[]:g,b=e.rowHeight,C=e.headerHeight,R=e.customTheme,S=[],M=function(e,n,i,s,f,p,w){void 0===i&&(i=0),void 0===s&&(s=c),void 0===f&&(f=[]),void 0===p&&(p=[]),void 0===w&&(w=[]);var g=i,k=s;return e.forEach(function(i,s){var c,P,A=a[n],D=u(u([],f,!0),[s],!1),F=u(u([],p,!0),[s],!1),O=N({row:i,getRowId:l,depth:n,index:s,rowPath:D,rowIndexPath:F,groupingKey:A}),L=S.length,W={row:i,depth:n,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:0===n&&s===e.length-1,rowId:O,rowPath:D,rowIndexPath:F,absoluteRowIndex:g,parentIndices:w.length>0?u([],w,!0):void 0};S.push(W),g++,k++;var B=H(O);if(T(B,n,r,t,o)&&a.length>n){var z=null==d?void 0:d.get(B),q=E(i,A),G=x.find(function(e){return e.expandable&&e.nestedTable});if((null==G?void 0:G.nestedTable)&&q.length>0){var V=(null===(c=G.nestedTable.customTheme)||void 0===c?void 0:c.rowHeight)||b,j=(null===(P=G.nestedTable.customTheme)||void 0===P?void 0:P.headerHeight)||C,K=y({childRowCount:q.length,rowHeight:V,headerHeight:j,customTheme:R}),U=I({calculatedHeight:K,customHeight:G.nestedTable.height,customTheme:R}),_=u(u([],D,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:_,rowPath:_,rowIndexPath:F,nestedTable:{parentRow:i,expandableHeader:G,childAccessor:A,calculatedHeight:U},absoluteRowIndex:g}),g++,k++}else if(z&&(z.loading||z.error||z.isEmpty)){if(z.loading&&v||z.error&&h||z.isEmpty&&m){var J=u(u([],D,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:J,rowPath:J,rowIndexPath:F,stateIndicator:{parentRowId:B,parentRow:i,state:z},absoluteRowIndex:g,parentIndices:u(u([],w,!0),[L],!1)}),g++,k++}else if(z.loading&&!v){var Y=u(u([],D,!0),[A,"loading-skeleton"],!1);S.push({row:{},depth:n+1,displayPosition:k,groupingKey:A,position:g,isLastGroupRow:!1,rowId:Y,rowPath:Y,rowIndexPath:F,isLoadingSkeleton:!0,absoluteRowIndex:g,parentIndices:u(u([],w,!0),[L],!1)}),g++,k++}}else if(q.length>0){var X=u(u([],D,!0),[A],!1),$=u([],F,!0);g=M(q,n+1,g,k,X,$,u(u([],w,!0),[L],!1))}}}),g};return M(e.rows,void 0===n?0:n,0,c,[],[],[]),S},P=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||v;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return P(e,n)}):e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return P(e,n)}):[e]},A=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(g({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},D=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(g({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){D(e)})},F=function(e){return"number"==typeof e.minWidth?e.minWidth:d},O=function(e,n){var r=[];return e.forEach(function(e){e.hide||r.push.apply(r,P(e,n))}),r},L=function(e,n){var r=n.rowTopPositions;if(0===r.length)return 0;if(0>=e)return 0;if(e>=n.totalHeight)return r.length-1;for(var t=0,o=r.length-1;o>t;){var i=Math.floor((t+o+1)/2);r[i]>e?o=i-1:t=i}return t},W=function(e,n){if(!n||0===n.length)return 0;for(var r=0,t=0,o=n.length;o>t;){var i=Math.floor((t+o)/2);e>n[i][0]?t=i+1:o=i}for(var a=0;t>a;a++)r+=n[a][1];return r},B=function(e){var n=e.bufferRowCount,r=e.contentHeight,t=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=t+r+d,v=Math.max(0,Math.floor(Math.max(0,t-c)/l)),p=Math.min(o.length,Math.ceil(f/l)),h=t+r,w=Math.max(0,Math.ceil(t/l)),m=Math.min(o.length,Math.floor(h/l)),g=t+r,x=Math.max(0,Math.floor(t/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=t+r+R,M=L(Math.max(0,t-C),u),N=L(S,u)+1;N=Math.min(o.length,N);var H=t,E=t+r,T=L(H,u);H>y[T]&&(T=Math.min(T+1,o.length));var k=L(E,u);k=Math.min(o.length,k);var P=t+r,A=L(t,u),D=L(P,u)+1;return D=Math.min(o.length,D),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:T,endIndex:k,rows:o.slice(T,k)},partiallyVisible:{startIndex:A,endIndex:D,rows:o.slice(A,D)}}},z=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+W(n,e.heightOffsets)},q=function(e,n){var r,t,o=e.position,i=n[o+1];return null!==(t=null===(r=null==i?void 0:i.parentIndices)||void 0===r?void 0:r.includes(o))&&void 0!==t&&t},G=function(e){var n=e.allTableRows,r=e.renderedRows,t=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:r};var c=0;if(s.parentIndices&&s.parentIndices.length>0){for(var d=function(e){var r=n[e];if(r){var o=t.some(function(e){return e.position===r.position});if(s.rowIndexPath&&s.rowIndexPath.length>0){var i=n[s.parentIndices[s.parentIndices.length-1]],a=i.row[l[i.depth]];if(u.length>=(Array.isArray(a)?a:[]).length-s.rowIndexPath[s.rowIndexPath.length-1])return"break"}o||u.some(function(e){return H(e.rowId)===H(r.rowId)})||(u.push(r),c++)}},f=0,v=s.parentIndices;v.length>f&&"break"!==d(v[f]);f++);if(u.length>0){q(s,n)&&(u.push(s),c++);var p=o[i+=c];p&&(s=p)}}else if(q(s,n))return u.push(s),i++,G({allTableRows:n,renderedRows:r,fullyVisibleRows:t,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l});return q(s,n)?G({allTableRows:n,renderedRows:r,fullyVisibleRows:t,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l}):{stickyParents:u,regularRows:r}},V=function(e,n,r){var t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>t.top?n.scrollTop-=o.top-t.top+i:t.bottom>o.bottom-i&&(n.scrollTop+=t.bottom-o.bottom+i),r){var a=r.getBoundingClientRect();a.left+i>t.left?r.scrollLeft-=a.left-t.left+i:t.right>a.right-i&&(r.scrollLeft+=t.right-a.right+i)}},j=function(e,n,r,t){var o=document.querySelector(".st-body-container"),i=document.querySelector(".st-body-main");if(o){var a=n+r.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&&t){var l=function(e,n,r,t){var o=B({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:r,scrollTop:n.scrollTop,tableRows:t,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,o,n,t);if(l)return void V(u,o,i)}if(!u)return o.scrollTop=Math.max(0,e.rowIndex*a-o.clientHeight/3),void setTimeout(function(){var n=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));n&&V(n,o,i)},100);V(u,o,i)}},K=function(e){var n=e.colIndex,r=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(r)},U=n.createContext(void 0),_=function(n){return e.jsx(U.Provider,exports.__assign({value:n.value},{children:n.children}))},J=function(){var e=n.useContext(U);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},Y=function(r){var t=r.currentPage,o=r.footerRenderer,u=r.hideFooter,l=r.onPageChange,s=r.onNextPage,c=r.onUserPageChange,d=r.rowsPerPage,f=r.shouldPaginate,v=r.totalPages,p=r.totalRows,h=J().icons,w=n.useState(!0),m=w[0],g=w[1],x=t>1,b=v>t,y=t===v,I=Math.min((t-1)*d+1,p),C=Math.min(t*d,p),R=!x,S=!b&&!s||!m&&y,M=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=t-1)?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},N=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(r){switch(r.label){case 0:return e=t===v,n=t+1,s&&e?[4,s(t)]:[3,2];case 1:if(!r.sent())return g(!1),[2];r.label=2;case 2:return n>v&&!s?[3,4]:(l(n),c?[4,c(n)]:[3,4]);case 3:r.sent(),r.label=4;case 4:return[2]}})})},H=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return 1>e||e>v?[3,2]:(l(e),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:t,totalPages:v,rowsPerPage:d,totalRows:p,startRow:I,endRow:C,onPageChange:H,onNextPage:N,onPrevPage:M,hasNextPage:!S,hasPrevPage:!R,nextIcon:h.next,prevIcon:h.prev})});var E=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,r=[];t>8?v-7>t?(e=t-7,n=t+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14),e>2?(r.push(1),r.push(-1)):2===e&&r.push(1);for(var o=e;n>=o;o++)r.push(o);return v-1>n?(r.push(-2),r.push(v)):n===v-1&&r.push(v),r}();return e.jsxs("div",exports.__assign({className:"st-footer"},{children:[e.jsx("div",exports.__assign({className:"st-footer-info"},{children:e.jsxs("span",exports.__assign({className:"st-footer-results-text"},{children:["Showing ",I," to ",C," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[E.map(function(n,r){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),r):e.jsx("button",exports.__assign({onClick:function(){return H(n)},className:"st-page-btn ".concat(t===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":t===n?"page":void 0},{children:n}),r)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(R?"disabled":""),onClick:M,disabled:R,"aria-label":"Go to previous page"},{children:h.prev})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(S?"disabled":""),onClick:N,disabled:S,"aria-label":"Go to next page"},{children:h.next}))]}))]}))},X=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"})}))},$=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"})}))},Q=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"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"})}))},Z=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"})}))},ee=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"})}))},ne=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"})]}))},re=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"})}))},te=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"})}))},oe=function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[r,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current;if(e&&(null==r?void 0:r.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[r,t]),{isMainSectionScrollable:a}},ie=function(r){var t=r.children,o=r.onClose,i=r.open,a=r.overflow,u=void 0===a?"auto":a,l=r.setOpen,s=r.width,c=r.containerRef,d=r.positioning,f=void 0===d?"fixed":d,v=J().mainBodyRef,p=n.useRef(null),h=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],y=x[1],I=n.useState(!1),C=I[0],R=I[1];return n.useEffect(function(){i&&p.current?(R(!1),!h.current&&p.current.parentElement&&(h.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&h.current){var e,n=p.current,r=h.current.getBoundingClientRect(),t=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-r.bottom,a=r.top-e.top,u="bottom",l={};(t>i&&a>=t||t>i&&a>i)&&(u="top");var d="left";o>e.right-r.right+r.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=r.bottom+4:l.bottom=window.innerHeight-r.top+4,"left"===d?l.left=r.left:l.right=window.innerWidth-r.right):("bottom"===u?l.top=r.height+4:l.bottom=r.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),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:t})):null},ae=function(n){var r=n.children,t=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,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&&t&&t()},role:"option","aria-selected":i,"aria-disabled":u},{children:r}))},ue=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=n.useState(r.value),l=u[0],s=u[1],c=function(e){s(e),o(e),a(!1),t()};return e.jsxs(ie,exports.__assign({open:i,onClose:function(){t()},setOpen:a,width:120},{children:[e.jsx(ae,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(ae,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},le=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},se=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+t,onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},ce=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-9232b9f5.js")})}),de=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-7995d91f.js")})}),fe=n.lazy(function(){return Promise.resolve().then(function(){return cr})}),ve=n.lazy(function(){return Promise.resolve().then(function(){return fr})}),pe=function(r){var t=o(r,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},t))},{children:e.jsx(ce,exports.__assign({},r))}))},he=function(r){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(de,exports.__assign({},r))}))},we=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(fe,exports.__assign({},r))}))},me=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(ve,exports.__assign({},r))}))},ge=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number);return new Date(n[0],n[1]-1,n[2],12,0,0)}var r=new Date(e);return isNaN(r.getTime())?new Date:new Date(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0)},xe=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},be=function(e){if(!e)return new Date;if("string"==typeof e)return ge(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:xe(n)}return e instanceof Date?xe(e):new Date},ye=function(e){return e?ge(""+e):new Date},Ie=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=r.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e.jsx(ie,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(he,{value:ye(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),t()},onClose:l})}))},Ce=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.options,u=r.setOpen,l=n.useState(r.value||""),s=l[0],c=l[1];return e.jsx(ie,exports.__assign({open:i,onClose:function(){t()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(ae,exports.__assign({isSelected:s===n.value,onClick:function(){return c(e=n.value),o(e),u(!1),void t();var e}},{children:n.label}),n.value)})}))}))},Re=function(n){var r=n.enumOptions,t=void 0===r?[]:r,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,s=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(ue,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(Ie,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(Ce,{onBlur:s,onChange:o,open:!0,options:t,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(se,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(le,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},Se=0,Me=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();0!==Se&&t>o-Se||(Se=o,n(r))}},Ne=function(e){var r=n.useRef(e);return n.useEffect(function(){JSON.stringify(r.current)!==JSON.stringify(e)&&(r.current=e)},[e]),r.current},He=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(He);var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=He(e[r]));return n},Ee=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Te=Date.now(),ke={screenX:0,screenY:0},Pe=function(e,n,r){void 0===r&&(r=[]);for(var t=0;e.length>t;t++){var o=e[t];if(o.accessor===n)return u(u([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=Pe(o.children,n,u(u([],r,!0),[t],!1));if(i)return i}}return null},Ae=function(e,n){for(var r=e,t=0;n.length-1>t;t++)r=r[n[t]].children;return r},De=function(e,n,r){if(1===n.length)return r;for(var t=e,o=0;n.length-2>o;o++)t=t[n[o]].children;return t[n[n.length-2]].children=r,e},Fe=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function Oe(e){var n,r,t=e.draggedHeader,o=e.hoveredHeader,i=He(e.headers),a=!1;try{var u=Fe(o),l=i.findIndex(function(e){return e.accessor===t.accessor}),s=i.findIndex(function(e){return e.accessor===o.accessor});if(-1===l||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var c=i.splice(l,1)[0],d=(n=u,r=exports.__assign({},c),"left"===n?r.pinned="left":"right"===n?r.pinned="right":delete r.pinned,r);i.splice(s,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var Le=function(e){var n=e.draggedHeaderRef,r=e.headers,t=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=J().setHeaders,l=Ne(r);return{handleDragStart:function(e){n.current=e,Te=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),r&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,c=o.screenY,d=Math.sqrt(Math.pow(s-ke.screenX,2)+Math.pow(c-ke.screenY,2));t.current=a;var f,v,p,h=n.current,w=!1;if(Fe(h)!==Fe(a))f=(R=Oe({headers:r,draggedHeader:h,hoveredHeader:a})).newHeaders,w=R.emergencyBreak;else{var m=r,g=Pe(m,h.accessor),x=Pe(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,r){var t=He(e),o=!1;function i(e,n){for(var r=e,t=0;n.length-1>t;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;n.length-1>i;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var u=i(t,n);return a(t,n,i(t,r)),a(t,r,u),{newHeaders:t,emergencyBreak:o}}(m,g,I);f=R.newHeaders,w=R.emergencyBreak}if(!(u||a.accessor===h.accessor||10>d||JSON.stringify(f)===JSON.stringify(r)||w)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>S-Te||40>d)||(Te=S,ke={screenX:s,screenY:c},i(f))}}},handleDragEnd:function(){n.current=null,t.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(r)},10)}}},We=function(n){var r=n.checked,t=void 0!==r&&r,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:t,className:"st-checkbox-input",onChange:function(){i&&i(!t)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":n.ariaLabel,"aria-checked":t}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(t?"st-checked":""),"aria-hidden":"true"},{children:t&&e.jsx(Z,{className:"st-checkbox-checkmark"})})),o]}))},Be=function(n){var r,t=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:t}):"lineAreaChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(we,exports.__assign({data:r},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(me,exports.__assign({data:r},o.chartOptions)):null:"boolean"==typeof t?t?"True":"False":Array.isArray(t)?0===t.length?"[]":t.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==t&&("string"==typeof t||"number"==typeof t||"object"==typeof t&&t instanceof Date)?be(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):t},ze=t.default.memo(function(r){var t=r.borderClass,o=r.colIndex,i=r.displayRowNumber,a=r.header,u=r.isHighlighted,l=r.isInitialFocused,s=r.nestedIndex,c=r.parentHeader,d=r.rowIndex,f=r.tableRow,v=J(),p=v.canExpandRowGroup,h=v.cellRegistry,w=v.cellUpdateFlash,m=v.collapsedRows,x=v.columnBorders,y=v.draggedHeaderRef,I=v.enableRowSelection,C=v.expandedDepths,N=v.expandedRows,E=v.handleMouseDown,k=v.handleMouseOver,P=v.handleRowSelect,A=v.headers,D=v.hoveredHeaderRef,F=v.icons,O=v.isCopyFlashing,L=v.isLoading,W=v.isRowSelected,B=v.isWarningFlashing,z=v.onCellEdit,q=v.onCellClick,G=v.onRowGroupExpand,V=v.onTableHeaderDragEnd,j=v.rowButtons,K=v.rowGrouping,U=v.setCollapsedRows,_=v.setExpandedRows,Y=v.setRowStateMap,X=v.rowsWithSelectedCells,$=v.selectedColumns,Q=v.tableBodyContainerRef,Z=v.theme,ee=v.useOddColumnBackground,ne=f.depth,re=f.row,te=f.rowPath,oe=f.rowIndexPath,ie=f.absoluteRowIndex,ae=f.rowId,ue=n.useState(R(re,a.accessor)),le=ue[0],se=ue[1],ce=n.useState(!1),de=ce[0],fe=ce[1],ve=n.useState(!1),he=ve[0],we=ve[1],me=n.useState(!1),ge=me[0],xe=me[1],be=n.useRef(null),ye=H(ae),Ie=K&&K[ne],Ce=!!Ie&&function(e,n){return!!n&&M(e[n])}(re,Ie),Se=K&&K.length>ne,Ne=!p||p(re),He=!!a.nestedTable,Ee=T(ye,ne,C,N,m),Te=O({rowIndex:d,colIndex:o,rowId:ye}),ke=B({rowIndex:d,colIndex:o,rowId:ye}),Pe=n.useMemo(function(){var e,n,r;if(!x)return!1;var t=A.filter(function(e){return"left"===e.pinned}),o=A.filter(function(e){return!e.pinned}),i=A.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===a.accessor},[x,A,a.accessor,a.pinned]),Ae=Le({draggedHeaderRef:y,headers:A,hoveredHeaderRef:D,onTableHeaderDragEnd:V}).handleDragOver,De=Me(),Fe=g({accessor:a.accessor,rowId:ye}),Oe=b({rowId:ye,accessor:a.accessor}),ze=a.isSelectionColumn&&I;n.useEffect(function(){if(h){var e="".concat(ye,"-").concat(a.accessor);return h.set(e,{updateContent:function(e){le!==e?(se(e),w&&(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,w,ye,a.accessor,le]),n.useEffect(function(){if(he){var e=setTimeout(function(){we(!1)},850);return function(){return clearTimeout(e)}}},[he]),n.useEffect(function(){se(R(re,a.accessor))},[re,a.accessor]);var qe="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!!ze&&X.has(ye+"")},[ze,X,ye]),Ue=null==c?void 0:c.singleRowChildren,_e="st-cell ".concat(ne>0&&a.expandable?"st-cell-depth-".concat(ne):""," ").concat(je?l?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").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(ze?"st-selection-cell":""," ").concat(Ke?"st-selection-has-highlighted-cell":""," ").concat(Pe?"st-last-column":""," ").concat(Ue?"st-sub-cell":""," ").concat(ge?"hovered":""),Je=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),se(e),S(re,a.accessor,e),null==z||z({accessor:a.accessor,newValue:e,row:re,rowIndex:d})},[a.accessor,a.type,z,re,d]),Ye=n.useCallback(function(e){e.stopPropagation();var n=T(ye,ne,C,N,m),r=ye+"";if(n?(U(function(e){var n=new Map(e);return n.set(r,ne),n}),_(function(e){var n=new Map(e);return n.delete(r),n})):(_(function(e){var n=new Map(e);return n.set(r,ne),n}),U(function(e){var n=new Map(e);return n.delete(r),n})),n&&Y(function(e){var n=new Map(e);return n.delete(ye),n}),G){var t=a.pinned;G({depth:ne,event:e,groupingKey:Ie,groupingKeys:K||[],isExpanded:!n,row:re,rowIndexPath:oe||[],rowIdPath:te,setEmpty:function(e,n){Y(function(r){var o=new Map(r),i=o.get(ye)||{};return o.set(ye,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:t})),o})},setError:function(e){Y(function(n){var r=new Map(n),o=r.get(ye)||{};return r.set(ye,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:t})),r})},setLoading:function(e){e?Y(function(e){var n=new Map(e),r=n.get(ye)||{};return n.set(ye,exports.__assign(exports.__assign({},r),{loading:!0,error:null,isEmpty:!1,triggerSection:t})),n}):setTimeout(function(){Y(function(e){var n=new Map(e),r=n.get(ye)||{};return n.set(ye,exports.__assign(exports.__assign({},r),{loading:!1,error:null,isEmpty:!1,triggerSection:t})),n})},0)}})}},[m,Ie,ne,C,N,a.pinned,G,re,K,ye,oe,te,U,_,Y]);return L||f.isLoadingSkeleton?e.jsx("div",exports.__assign({className:_e},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!de||qe||ze?e.jsxs(pe,exports.__assign({className:_e,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ye,"data-row-index":d,role:"gridcell","aria-colindex":o+1,id:Fe,onClick:function(){q&&!ze&&q({accessor:a.accessor,colIndex:o,row:re,rowIndex:d,value:le})},onDoubleClick:function(){return a.isEditable&&!ze&&fe(!0)},onDragOver:function(e){ze||De({callback:Ae,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){de||ze||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||de||(e.preventDefault(),fe(!0))},onMouseDown:function(){de||ze||E({rowIndex:d,colIndex:o,rowId:ye})},onMouseEnter:function(){xe(!0)},onMouseLeave:function(){xe(!1)},onMouseOver:function(){de||ze||k({rowIndex:d,colIndex:o,rowId:ye})},parentRef:Q,tableRow:f},{children:[a.expandable&&Se?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Ne&&(Ce||G||He)?Ee?"expanded":"collapsed":"placeholder"),onClick:Ne&&(Ce||G||He)?function(e){return Ye(e)}:void 0,role:Ne&&(Ce||G||He)?"button":"presentation",tabIndex:Ne&&(Ce||G||He)?0:-1,"aria-label":Ne&&(Ce||G||He)?"".concat(Ee?"Collapse":"Expand"," row group"):void 0,"aria-expanded":Ne&&(Ce||G||He)?Ee:void 0,"aria-hidden":!(Ne&&(Ce||G||He)),onKeyDown:Ne&&(Ce||G||He)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ye(e))}:void 0},{children:F.expand})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:L||f.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:ze?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ge||W&&W(ye+"")?e.jsx(We,{checked:!!W&&W(ye+""),onChange:function(e){P&&P(ye+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!j||!ze||0===j.length)return null;if(!(ge||W&&W(ye+"")))return null;var n={row:re,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(r,t){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:r(n)}),t)})}))}()]})):a.cellRenderer?function(){var e;return a.cellRenderer({accessor:a.accessor,colIndex:o,row:re,rowIndex:ie,rowPath:te,theme:Z,value:le,formattedValue:null===(e=null==a?void 0:a.valueFormatter)||void 0===e?void 0:e.call(a,{accessor:a.accessor,colIndex:o,row:re,rowIndex:d,value:le})})}():Be({content:le,header:a,colIndex:o,row:re,rowIndex:d})})})),!L&&!f.isLoadingSkeleton&&de&&qe&&!ze&&e.jsx(Re,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:fe,type:a.type,value:le})]}),Oe):e.jsx("div",exports.__assign({className:"st-cell-editing",id:g({accessor:a.accessor,rowId:ye}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(Re,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:fe,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}),qe=function(r){var t=r.columnIndices,o=r.displayRowNumber,i=r.header,a=r.headers,u=r.nestedIndex,l=r.parentHeader,s=r.pinned,c=r.rootPinned,d=r.rowIndex,f=r.rowIndices,v=r.tableRow,p=t[i.accessor],h=J(),w=h.getBorderClass,m=h.isSelected,b=h.isInitialFocusedCell,y=h.collapsedHeaders,I=H(v.rowId);if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return x({header:e,pinned:s,headers:a,collapsedHeaders:y,rootPinned:c})});if(i.singleRowChildren){var R={rowIndex:d,colIndex:p,rowId:I},S=w(R),M=m(R),N=b(R),E=g({accessor:i.accessor,rowId:I});return e.jsxs(n.Fragment,{children:[e.jsx(ze,{borderClass:S,colIndex:p,displayRowNumber:o,header:i,isHighlighted:M,isInitialFocused:N,nestedIndex:u,parentHeader:l,rowIndex:d,tableRow:v},E),C.map(function(n){var r=g({accessor:n.accessor,rowId:I});return e.jsx(qe,{columnIndices:t,displayRowNumber:o,rootPinned:c,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:d,rowIndices:f,tableRow:v},r)})]})}return e.jsx(n.Fragment,{children:C.map(function(n){var r=g({accessor:n.accessor,rowId:I});return e.jsx(qe,{columnIndices:t,displayRowNumber:o,rootPinned:c,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:d,rowIndices:f,tableRow:v},r)})})}var T={rowIndex:d,colIndex:p,rowId:I},k=w(T),P=m(T),A=b(T),D=g({accessor:i.accessor,rowId:I});return e.jsx(ze,{borderClass:k,colIndex:p,displayRowNumber:o,header:i,isHighlighted:P,isInitialFocused:A,nestedIndex:u,parentHeader:l,rowIndex:d,tableRow:v},D)},Ge=t.default.memo(function(n){var r=n.columnIndexStart,t=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,s=n.tableRow,c=J().collapsedHeaders,d=o.filter(function(e){return x({header:e,pinned:i,headers:o,collapsedHeaders:c,rootPinned:e.pinned})});return e.jsx(e.Fragment,{children:d.map(function(n,c){var d=H(s.rowId),f=g({accessor:n.accessor,rowId:d});return e.jsx(qe,{columnIndices:t,displayRowNumber:u,rootPinned:n.pinned,header:n,headers:o,nestedIndex:c+(null!=r?r: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}),Ve=function(n){var r=n.rowState,t=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return r.loading&&t?a=t:r.error&&o?a=o:r.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},je=function(n){var r=n.calculatedHeight,t=n.childAccessor,o=n.depth,i=n.expandableHeader,a=n.index,u=n.parentRow,l=n.position,s=J(),c=s.theme,d=s.rowGrouping,f=s.rowHeight,v=s.heightOffsets,p=s.customTheme,h=s.loadingStateRenderer,w=s.errorStateRenderer,m=s.emptyStateRenderer,g=s.icons,x=i.nestedTable;if(!x)return null;var b=R(u,t),y=Array.isArray(b)?b:[],C=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,S=x.customTheme?exports.__assign(exports.__assign({},p),x.customTheme):p,M=function(e){var n=e.calculatedHeight,r=e.customHeight,t=e.customTheme;return r?"string"==typeof r?r:"".concat(r,"px"):"".concat(n-t.nestedGridPaddingTop-t.nestedGridPaddingBottom,"px")}({calculatedHeight:r,customHeight:x.height,customTheme:p}),N=I({calculatedHeight:r,customHeight:x.height,customTheme:p});return e.jsx("div",exports.__assign({className:"st-row st-nested-grid-row","data-index":a,style:{transform:"translate3d(0, ".concat(z({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(N,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx(ur,exports.__assign({},x,{rows:y,theme:c,customTheme:S,height:M,rowGrouping:C,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,icons:g}))}))},Ke=t.default.memo(function(n){var r=n.columnIndices,t=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=J(),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.useHoverRowBackground,T=x.useOddEvenRowBackground,k=d.position,P=d.displayPosition,A=d.stateIndicator,D=d.nestedTable;if(D)return u?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(z({position:k,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(D.calculatedHeight,"px")}}):e.jsx(je,{calculatedHeight:D.calculatedHeight,childAccessor:D.childAccessor,depth:d.depth-1,expandableHeader:D.expandableHeader,index:a,parentRow:D.parentRow,position:k});if(A)return e.jsx("div",A.state.triggerSection===u&&(A.state.loading&&M||A.state.error&&I||A.state.isEmpty&&y)?exports.__assign({className:"st-row st-state-row","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(z({position:k,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Ve,{parentRow:A.parentRow,rowState:A.state,gridTemplateColumns:o,loadingStateRenderer:M,errorStateRenderer:I,emptyStateRenderer:y})}):{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(z({position:k,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}});var F=k%2==0,O=H(d.rowId),L=!!S&&S(O),W=v?{gridTemplateColumns:o,transform:"translateY(".concat(h*(l+1)+m,"px)"),height:"".concat(l,"px"),position:"absolute",top:0,left:0,zIndex:g}:{gridTemplateColumns:o,top:z({position:k,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(T?F?"even":"odd":""," ").concat(L?"selected":""),"data-index":k,role:"row","aria-rowindex":k+N+1,onMouseEnter:function(){!R&&E&&c(k)},style:W},{children:e.jsx(Ge,{columnIndexStart:t,columnIndices:r,displayRowNumber:P,headers:i,pinned:u,rowIndex:k,rowIndices:s,tableRow:d},O)}))},function(e,n){return e.index===n.index&&e.tableRow.position===n.tableRow.position&&e.tableRow.displayPosition===n.tableRow.displayPosition&&e.tableRow.row===n.tableRow.row&&e.tableRow.stateIndicator===n.tableRow.stateIndicator&&e.rowHeight===n.rowHeight&&e.gridTemplateColumns===n.gridTemplateColumns&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.rowIndices===n.rowIndices&&e.columnIndexStart===n.columnIndexStart}),Ue=function(r){var t=r.displayStrongBorder,o=r.position,i=r.rowHeight,a=r.templateColumns,u=r.isSticky,l=void 0!==u&&u,s=J(),c=s.heightOffsets,d=s.customTheme,f=n.useRef(null),v=l?o:function(e){var n=e.position,r=e.customTheme;return n*(e.rowHeight+r.rowSeparatorWidth)-r.rowSeparatorWidth+W(n,e.heightOffsets)}({position:o,rowHeight:i,heightOffsets:c,customTheme:d}),p=l?{position:"absolute",top:0,left:0,transform:"translateY(".concat(v,"px)")}:{transform:"translate3d(0, ".concat(v,"px, 0)")};return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,r=n.style.pointerEvents;n.style.pointerEvents="none";var t=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=r,t){var o=t.closest(".st-cell");if(o instanceof HTMLElement){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(),r=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});f.current.dispatchEvent(r),f.current=null}},style:exports.__assign({gridTemplateColumns:a},p)},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},_e=n.createContext(void 0),Je=function(e){var r=e.childRef,t=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(_e);if(!e)throw Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),u=a.registerPane,l=a.unregisterPane;return n.useEffect(function(){var e=[i];return r.current&&u(r.current,e),function(){r.current&&l(r.current,e)}},[r,u,l,i]),n.cloneElement(t,{ref:function(e){r.current=e}})},Ye=n.forwardRef(function(r,t){var o=r.columnIndexStart,i=r.columnIndices,a=r.headers,u=r.pinned,l=r.rowHeight,s=r.rowIndices,c=r.setHoveredIndex,d=r.templateColumns,f=r.totalHeight,v=r.width,p=r.regularRows,h=u?"st-body-pinned-".concat(u):"st-body-main",w=n.useRef(null);return n.useImperativeHandle(t,function(){return w.current},[]),n.useMemo(function(){return Ee(a,u)},[a,u])?e.jsx(Je,exports.__assign({childRef:w,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:h,ref:w,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:v},!u&&{flexGrow:1})},{children:p.map(function(r,t){var f=r.stateIndicator?"state-".concat(r.stateIndicator.parentRowId,"-").concat(r.position):H(r.rowId);return e.jsxs(n.Fragment,{children:[0!==t&&e.jsx(Ue,{displayStrongBorder:r.isLastGroupRow,position:r.position,rowHeight:l,templateColumns:d}),e.jsx(Ke,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:t,pinned:u,rowHeight:l,rowIndices:s,setHoveredIndex:c,tableRow:r})]},f)})}))})):null});function Xe(e){var n=e.headers,r=e.pinnedLeftColumns,t=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],r,!0),n,!0),t,!0),s=function(e,n,r){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return x({header:e,pinned:r,headers:l,collapsedHeaders:o,rootPinned:r})}).forEach(function(n,t){s(n,!e.singleRowChildren&&0===t,r)})};return r.forEach(function(e,n){s(e,0===n,e.pinned)}),n.filter(function(e){return!e.pinned&&x({header:e,pinned:void 0,headers:l,collapsedHeaders:o,rootPinned:e.pinned})}).forEach(function(e,n){s(e,0===n&&0===r.length,e.pinned)}),t.forEach(function(e){s(e,!1,e.pinned)}),i}Ye.displayName="TableSection";var $e=function(r){var t=r.calculatedHeaderHeight,o=r.stickyParents,i=r.mainTemplateColumns,a=r.pinnedLeftColumns,u=r.pinnedLeftTemplateColumns,l=r.pinnedLeftWidth,c=r.pinnedRightColumns,d=r.pinnedRightTemplateColumns,f=r.pinnedRightWidth,v=r.setHoveredIndex,p=r.rowIndices,h=r.scrollbarWidth,w=r.scrollTop,m=r.heightMap,g=r.partiallyVisibleRows,x=J(),b=x.collapsedHeaders,y=x.customTheme,I=x.editColumns,C=x.headers,R=x.rowHeight,S=n.useRef(null),M=n.useRef(null),N=n.useRef(null),E=n.useMemo(function(){var e,n;if(0===o.length)return{treeTransitionOffset:0,offsetStartIndex:-1};var r,t=g[0];if((null==t?void 0:t.parentIndices)&&t.parentIndices.length>0)for(var i=function(e){var n=t.parentIndices[e];if(o.some(function(e){return e.position===n}))return r=n,"break"},a=t.parentIndices.length-1;a>=0&&"break"!==i(a);a--);var u=void 0!==r?o.findIndex(function(e){return e.position===r}):-1,l=-1,s=function(e){var n=o[e],r=o[e+1];return r?r.depth===n.depth?(l=e,"break"):n.depth>r.depth?(l=o.findIndex(function(e){return e.depth===n.depth}),"break"):void 0:"break"};for(a=0;o.length>a&&"break"!==s(a);a++);if(-1===l)return{treeTransitionOffset:0,offsetStartIndex:u};var c=null===(e=o[l])||void 0===e?void 0:e.position;if(void 0===c)return{treeTransitionOffset:0,offsetStartIndex:u};for(var d=0,f=0,v=g;v.length>f&&(null===(n=v[f].parentIndices)||void 0===n?void 0:n.includes(c));f++)d++;if(0===d)return{treeTransitionOffset:0,offsetStartIndex:u};var p=g[0];return{treeTransitionOffset:-((l+1-d)*R+Math.max(0,w-(m?m.rowTopPositions[p.position]:p.position*(R+y.rowSeparatorWidth)))),offsetStartIndex:u}},[y,m,g,R,w,o]),T=E.treeTransitionOffset,k=E.offsetStartIndex,P=n.useMemo(function(){return Xe({headers:C,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:b})},[C,a,c,b]),A=o.length>0?o.length*(R+1)+T:0;if(0===o.length)return null;var D=function(r,t,i,a,u,l){return void 0===u&&(u=0),e.jsx("div",exports.__assign({className:i?"st-sticky-section-".concat(i):"st-sticky-section-main",ref:l,style:{position:"relative",height:"".concat(A,"px"),width:i?"".concat(a,"px"):void 0,flexGrow:i?0:1,flexShrink:i?0:void 0}},{children:o.map(function(a,l){var s=a.stateIndicator?"sticky-state-".concat(a.stateIndicator.parentRowId,"-").concat(a.position):"sticky-".concat(H(a.rowId)),c=-1!==k&&l>=k,d=c?T:0,f=(l+1)*(R+1)-1+d;return e.jsxs(n.Fragment,{children:[e.jsx(Ke,{columnIndexStart:u,columnIndices:P,gridTemplateColumns:r,headers:t,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(Ue,{displayStrongBorder:!1,position:f,rowHeight:R,templateColumns:r,isSticky:!0})]},s)})}))},F=C.filter(function(e){return!e.pinned}),O="calc(100% - ".concat(h,"px - ").concat(I?"".concat(s,"px"):"0px",")");return e.jsxs("div",exports.__assign({className:"st-sticky-top",style:{height:"".concat(A,"px"),width:O,top:"".concat(t,"px")}},{children:[a.length>0&&e.jsx(Je,exports.__assign({childRef:S,group:"pinned-left"},{children:D(u,a,"left",l,0,S)})),e.jsx(Je,exports.__assign({childRef:M,group:"default"},{children:D(i,F,void 0,void 0,a.length,M)})),c.length>0&&e.jsx(Je,exports.__assign({childRef:N,group:"pinned-right"},{children:D(d,c,"right",f,a.length+F.length,N)}))]}))},Qe=function(r){var t=r.calculatedHeaderHeight,o=r.mainTemplateColumns,i=r.pinnedLeftColumns,a=r.pinnedLeftTemplateColumns,u=r.pinnedLeftWidth,l=r.pinnedRightColumns,s=r.pinnedRightTemplateColumns,c=r.pinnedRightWidth,d=r.rowsToRender,f=r.setScrollTop,v=r.setScrollDirection,p=r.shouldShowEmptyState,h=r.tableRows,w=r.stickyParents,m=r.regularRows,g=r.partiallyVisibleRows,x=r.heightMap,b=J(),y=b.collapsedHeaders,I=b.headerContainerRef,C=b.headers,R=b.heightOffsets,S=b.isAnimating,M=b.mainBodyRef,N=b.onLoadMore,E=b.rowHeight,T=b.scrollbarWidth,k=b.setIsScrolling,P=b.shouldPaginate,A=b.tableBodyContainerRef,D=b.tableEmptyStateRenderer,F=b.customTheme,O=n.useState(!1),L=O[0],W=O[1],B=n.useState(0),z=B[0],q=B[1],G=n.useRef(new Set),V=n.useCallback(function(e){if(document.querySelectorAll(".st-row.hovered").forEach(function(e){e.classList.remove("hovered")}),G.current.clear(),null!==e&&A.current){var n=A.current,r='.st-row[data-index="'.concat(e,'"]:not(.st-nested-grid-row)');n.querySelectorAll(r).forEach(function(e){var r=e;r.closest(".st-body-container")===n&&(r.classList.add("hovered"),G.current.add(r))});var t=n.previousElementSibling;t&&t.classList.contains("st-sticky-top")&&t.querySelectorAll(r).forEach(function(e){var n=e;n.classList.add("hovered"),G.current.add(n)})}},[A]);n.useEffect(function(){S&&V(null)},[S,V]),oe({headerContainerRef:I,mainSectionRef:A,scrollbarWidth:T}),n.useEffect(function(){return function(){K.current&&clearTimeout(K.current)}},[]);var j=n.useRef(null),K=n.useRef(null),U=n.useRef(0),_=function(e){return e.length}(h),Y=n.useMemo(function(){return function(e,n,r,t){return e*(n+t.rowSeparatorWidth)-t.rowSeparatorWidth+((null==r?void 0:r.reduce(function(e,n){return e+n[1]},0))||0)}(_,E,R,F)},[_,E,R,F]),X=n.useMemo(function(){return Xe({headers:C,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:y})},[C,i,l,y]),$=n.useMemo(function(){var e={};return d.forEach(function(n,r){var t=H(n.rowId);e[t]=r}),e},[d]),Q=n.useCallback(function(e,n){!N||P||L||200>=e.scrollHeight-(n+e.clientHeight)&&n>U.current&&(W(!0),N(),setTimeout(function(){W(!1)},1e3))},[N,P,L]),Z={columnIndices:X,headerContainerRef:I,headers:C,rowHeight:E,rowIndices:$,rowsToRender:d,setHoveredIndex:V,regularRows:m};return e.jsxs(e.Fragment,{children:[!p&&e.jsx($e,{calculatedHeaderHeight:t,heightMap:x,mainTemplateColumns:o,partiallyVisibleRows:g,pinnedLeftColumns:i,pinnedLeftTemplateColumns:a,pinnedLeftWidth:u,pinnedRightColumns:l,pinnedRightTemplateColumns:s,pinnedRightWidth:c,rowIndices:$,scrollTop:z,scrollbarWidth:T,setHoveredIndex:V,stickyParents:w}),e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return V(null)},onScroll:function(e){var n=e.currentTarget,r=n.scrollTop;k(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(function(){k(!1)},150),j.current&&cancelAnimationFrame(j.current),j.current=requestAnimationFrame(function(){var e=U.current,t=r>e?"down":e>r?"up":"none";f(r),v(t),q(r),Q(n,r),U.current=r})},ref:A},{children:p?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:D})):e.jsxs(e.Fragment,{children:[e.jsx(Ye,exports.__assign({},Z,{pinned:"left",templateColumns:a,totalHeight:Y,width:u})),e.jsx(Ye,exports.__assign({},Z,{columnIndexStart:i.length,ref:M,templateColumns:o,totalHeight:Y})),e.jsx(Ye,exports.__assign({},Z,{columnIndexStart:i.length+o.length,pinned:"right",templateColumns:s,totalHeight:Y,width:c}))]})}))]})},Ze=function(e,n){if(e.pinned)return e.pinned;var r=m(n,e.accessor);return r?Ze(r,n):void 0},en=function(e){var n=e.autoExpandColumns,r=e.collapsedHeaders,t=e.containerWidth,o=e.event,i=e.header,a=e.headers,l=e.onColumnWidthChange,s=e.reverse,c=void 0!==s&&s,d=e.setHeaders,v=e.setIsResizing,p=e.startWidth;o.preventDefault();var h="clientX"in o?o.clientX:o.touches[0].clientX,w="touches"in o;if(i&&!i.hide){v(!0);var m,g=Ze(i,a),x=F(i);if(i.children&&i.children.length>0){var b=P(i,r);m=b.length>0?b:[i]}else m=[i];var y=new Map,I=0;if(n){var C=a.filter(function(e){return e.pinned===g});if(O(C,r).forEach(function(e){var n=A(e);y.set(e.accessor,n)}),t>0){var R=rn({headers:a,containerWidth:t,collapsedHeaders:r}),S=R.leftWidth,M=R.rightWidth;I="left"===g?S:"right"===g?M:Math.max(0,t-S-M)}}var N=function(e){var o="right"===g?h-e:e-h;if(n){var l=a.filter(function(e){return e.pinned===g});on({delta:o,startWidth:p,resizedHeader:m.length>0?m[m.length-1]:i,sectionHeaders:l,rootPinned:g,reverse:c,collapsedHeaders:r,initialWidthsMap:y,sectionWidth:I,isParentResize:m.length>1,childrenToResize:m,headers:a,containerWidth:t})}else{var s=function(e){var n=e.header,r=e.headers,t=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth;if(!n.pinned)return 1/0;var a=r.some(function(e){return"left"===e.pinned&&!e.hide}),u=r.some(function(e){return"right"===e.pinned&&!e.hide}),l=i*f(i,a,u)-r.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+P(n,t).reduce(function(e,n){return e+A(n)},0)},0),s=F(n);return s>l?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),s):l}({header:i,headers:a,collapsedHeaders:r});m.length>1?nn({delta:o,leafHeaders:m,minWidth:x,startWidth:p,maxWidth:s}):m[0].width=Math.max(Math.min(p+o,s),x),a.forEach(function(e){D(e)})}var v=u([],a,!0);d(v)};if(w){var H=function(e){N(e.touches[0].clientX)},E=function(){document.removeEventListener("touchmove",H),document.removeEventListener("touchend",E),v(!1),l&&l(u([],a,!0))};document.addEventListener("touchmove",H),document.addEventListener("touchend",E)}else{var T=function(e){N(e.clientX)},k=function(){document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",k),v(!1),l&&l(u([],a,!0))};document.addEventListener("mousemove",T),document.addEventListener("mouseup",k)}}},nn=function(e){var n=e.delta,r=e.leafHeaders,t=e.minWidth,o=e.startWidth,i=e.maxWidth,a=r.reduce(function(e,n){return Math.min(e,F(n))},40),u=r.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;r.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),t)})},rn=function(e){var n=e.containerWidth,r=e.collapsedHeaders,t=0,o=0,i=0;e.headers.forEach(function(e){if(!e.hide){var n=P(e,r).reduce(function(e,n){return e+A(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?o+=n:i+=n}});var a=t,u=o;if(n&&n>0){var l=n*f(n,t>0,o>0);t>l&&(t=l),o>l&&(o=l)}return{leftWidth:w(t),rightWidth:w(o),mainWidth:i,leftContentWidth:a,rightContentWidth:u}},tn=function(e){var n=e.columnsToShrink,r=e.totalCompensation,t=e.initialWidthsMap;if(0>r){var o=Math.abs(r),i=n.reduce(function(e,n){return e+(t.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,r){var a=t.get(e.accessor)||100,u=o*(a/i);if(r===n.length-1){var l=n.slice(0,r).reduce(function(e,n){var r=t.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-r)},0);u=o-l}e.width=a+u})}else for(var a=r,u=function(){var e=n.map(function(e){var n=t.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-40),initialWidth:n,minWidth:40}}),r=e.filter(function(e){return e.headroom>0});if(r.length>0){var o=r.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;r.forEach(function(e,n){var t=u*(e.headroom/o);t=Math.min(t,e.headroom),n===r.length-1&&(t=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-t,i+=t}),a-=i}else{var l=e.filter(function(e){return e.minWidth>d});if(0>=l.length)return"break";var s=a,c=s/l.length,f=0;l.forEach(function(e,n){var r=e.minWidth-d,t=Math.min(c,r);n===l.length-1&&(t=Math.min(s-f,r));var o=e.initialWidth-t;e.column.width=o,e.column.minWidth=Math.max(o,d),f+=t}),a-=f}};a>.5&&"break"!==u(););},on=function(e){var n=e.childrenToResize,r=void 0===n?[]:n,t=e.collapsedHeaders,o=e.delta,i=e.initialWidthsMap,a=e.isParentResize,u=void 0!==a&&a,l=e.resizedHeader,s=e.reverse,c=e.rootPinned,v=e.sectionHeaders,p=e.sectionWidth,h=e.startWidth,w=e.headers,m=e.containerWidth,g=o;if(c&&m>0){var x=function(e,n,r){return e*f(e,n,r)}(m,w.some(function(e){return"left"===e.pinned&&!e.hide}),w.some(function(e){return"right"===e.pinned&&!e.hide})),b=Array.from(i.values()).reduce(function(e,n){return e+n},0);o>0&&b+o>x&&(g=Math.max(0,x-b))}if(o=g,u&&r.length>1){var y=O(v,t),I=y.findIndex(function(e){return e.accessor===r[0].accessor}),C=y.findIndex(function(e){return e.accessor===r[r.length-1].accessor});if(-1===I||-1===C)return;var R,S=0===I,M=C===y.length-1;R="left"===c&&M||"right"===c&&S?[]:S?y.slice(C+1):M||s?y.slice(0,I):y.slice(C+1);var N=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){var H=o,E=!1;if(R.length>0&&N+o>p){E=!0;var T=R.reduce(function(e,n){var r=i.get(n.accessor)||100;return e+Math.max(0,r-d)},0);H=Math.min(o,T)}var k=(P=h+H)/(A=r.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0));r.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*k,40)}),E&&H>0&&R.length>0&&tn({columnsToShrink:R,totalCompensation:H,initialWidthsMap:i})}else{var P,A=r.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0),D=(P=Math.max(h+o,d*r.length))/A;r.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*D,40)}),(j=h-P)>0&&R.length>0&&tn({columnsToShrink:R,totalCompensation:-j,initialWidthsMap:i})}}else{var F=O(v,t),L=F.findIndex(function(e){return e.accessor===l.accessor});if(-1!==L){var W,B=0===L,z=L===F.length-1;if(0!==(W="left"===c&&z||"right"===c&&B?[]:B?F.slice(L+1):z||s?F.slice(0,L):F.slice(L+1)).length){var q=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){if(p>=q+o)return void(l.width=h+o);T=W.reduce(function(e,n){var r=i.get(n.accessor)||100;return e+Math.max(0,r-d)},0);var G=Math.min(o,T);l.width=h+G,G>0&&tn({columnsToShrink:W,totalCompensation:G,initialWidthsMap:i})}else{var V=Math.max(h+o,40),j=h-V;l.width=V,j>0&&tn({columnsToShrink:W,totalCompensation:-j,initialWidthsMap:i})}}else l.width=Math.max(h+o,40)}}},an={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"},un=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"]}},ln=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},sn=function(e){return["between","notBetween","in","notIn"].includes(e)},cn=function(e){return["isEmpty","isNotEmpty"].includes(e)},dn=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},fn=function(r){var t=r.value,o=r.onChange,i=r.options,a=r.placeholder,u=void 0===a?"Select...":a,l=r.className,s=void 0===l?"":l,c=r.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===t});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===t});m(0>e?0:e)}},disabled:d,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",exports.__assign({className:"st-custom-select-value"},{children:x?x.label:u})),e.jsx(te,{})]})),e.jsx(ie,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,r){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===t?"st-custom-select-option-selected":""," ").concat(r===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===t,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),r)})}))}))]}))},vn=function(n){var r=n.value,t=n.onChange,o=n.operators.map(function(e){return{value:e,label:an[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(fn,{value:r,onChange:function(e){t(e)},options:o})}))},pn=function(n){var r=n.type,t=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===r?"text":r,value:n.value,onChange:function(e){return t(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&a&&a()},placeholder:n.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},hn=function(n){var r=n.children,t=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===t?"":t).trim()},{children:r}))},wn=function(n){var r=n.onClear,t=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!t,className:"st-filter-button st-filter-button-apply ".concat(t?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&r&&e.jsx("button",exports.__assign({onClick:r,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},mn=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=un("string");n.useEffect(function(){o?(s(o.operator),f((o.value||"")+"")):(s("contains"),f(""))},[o]);var p=function(){var e=exports.__assign({accessor:t.accessor,operator:l},ln(l)&&{value:d});i(e)},h=cn(l)||d.trim();return e.jsxs(dn,{children:[e.jsx(vn,{value:l,onChange:s,operators:v}),ln(l)&&e.jsx(hn,{children:e.jsx(pn,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(wn,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},gn=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.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===(t=null==a?void 0:a.values)||void 0===t?void 0:t[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=un("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};ln(c)?e.value=parseFloat(v):sn(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(dn,{children:[e.jsx(vn,{value:c,onChange:d,operators:y}),ln(c)&&e.jsx(hn,{children:e.jsx(pn,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:I})}),sn(c)&&e.jsxs(hn,{children:[e.jsx(pn,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:I}),e.jsx(pn,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:I})]}),e.jsx(wn,{onApply:I,onClear:l,canApply:!!cn(c)||(ln(c)?""!==v.trim():!!sn(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},xn=function(n){var r=n.className;return e.jsx(fn,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===r?"":r,placeholder:n.placeholder})},bn=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],s=u[1],c=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=c[0],f=c[1],v=un("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=cn(l)||""!==d;return e.jsxs(dn,{children:[e.jsx(vn,{value:l,onChange:s,operators:v}),ln(l)&&e.jsx(hn,{children:e.jsx(xn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(wn,{onApply:function(){var e={accessor:t.accessor,operator:l};ln(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},yn=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.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===(t=null==a?void 0:a.values)||void 0===t?void 0:t[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=un("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(r){var t=r.value,o=r.onChange,i=r.placeholder,a=r.autoFocus,u=r.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(t){var e=be(t);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[t]),n.useEffect(function(){a&&p.current&&p.current.focus()},[a]);var h=t?be(t):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(ie,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(he,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(dn,{children:[e.jsx(vn,{value:c,onChange:d,operators:y}),ln(c)&&e.jsx(hn,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),sn(c)&&e.jsxs(hn,{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(wn,{onApply:function(){var e={accessor:i.accessor,operator:c};ln(c)?e.value=v:sn(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!cn(c)||(ln(c)?""!==v.trim():!!sn(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},In=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,l=n.useMemo(function(){return t.enumOptions||[]},[t.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(dn,{children:[e.jsx(hn,{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(We,exports.__assign({checked:d.length===s.length,onChange:function(e){f(e?s:[])}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),m&&e.jsx("div",exports.__assign({className:"st-enum-search"},{children:e.jsx(pn,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,r){return e.jsx(We,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),r)}),p&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(wn,{onApply:function(){d.length!==s.length?i({accessor:t.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==s.length,showClear:!!o})]})},Cn=function(n){var r=n.header,t=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(r.type){case"number":return e.jsx(gn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(bn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(yn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(In,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});default:return e.jsx(mn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i})}}()})},Rn=function(r){var t=r.content,o=r.children,i=r.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],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)}},[]),!t||!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&&t.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,r=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),r+40>window.innerHeight-8&&(r=e.top-40-8),f({top:r,left:n}),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:t}))]})},Sn=function(r){var t,o,i=r.colIndex,a=r.gridColumnEnd,l=r.gridColumnStart,s=r.gridRowEnd,d=r.gridRowStart,f=r.header,h=r.parentHeader,w=r.reverse,m=r.sort,x=r.isLastHeader,b=void 0!==x&&x,y=n.useState(!1),I=y[0],C=y[1],S=n.useState(!1),M=S[0],N=S[1],H=n.useState(f.label||""),E=H[0],T=H[1],k=J(),P=k.activeHeaderDropdown,A=k.areAllRowsSelected,D=k.autoExpandColumns,F=k.collapsedHeaders,O=k.columnBorders,L=k.columnReordering,W=k.columnResizing,B=k.containerWidth,z=k.columnsWithSelectedCells,q=k.draggedHeaderRef,G=k.enableHeaderEditing,V=k.handleApplyFilter,j=k.handleClearFilter,K=k.handleSelectAll,U=k.headerDropdown,_=k.headerRegistry,Y=k.icons,X=k.headers,$=k.hoveredHeaderRef,Q=k.onColumnOrderChange,Z=k.onColumnSelect,ee=k.onColumnWidthChange,ne=k.onHeaderEdit,re=k.onSort,te=k.onTableHeaderDragEnd,oe=k.headerHeight,ae=k.rows,ue=k.selectColumns,se=k.selectableColumns,ce=k.selectedColumns,de=k.setActiveHeaderDropdown,fe=k.setCollapsedHeaders,ve=k.setHeaders,he=k.setInitialFocusedCell,we=k.setIsResizing,me=k.setSelectedCells,ge=k.setSelectedColumns,xe=!!(null==f?void 0:f.isSortable),be=!!(null==f?void 0:f.filterable),ye=k.filters[f.accessor],Ie=(null==P?void 0:P.accessor)===f.accessor,Ce=f.isSelectionColumn&&k.enableRowSelection,Re=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(f),Se=F.has(f.accessor),Ne=function(e){var r=e.isOpen,t=e.estimatedHeight,o=void 0===t?200:t,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,s=n.useRef(null),c=n.useState({}),d=c[0],f=c[1];return n.useEffect(function(){if(r&&s.current){var e=function(){if(s.current){var e=s.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,r=window.innerWidth-e.right,t="bottom",i={};o>n&&e.top>=o&&(t="top");var u="left";a>r+e.width&&(u="right"),"bottom"===t?i.top=e.bottom+l:i.bottom=window.innerHeight-e.top+l,"left"===u?i.left=e.left:i.right=window.innerWidth-e.right,f(i)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},t=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",t,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",t,!0)}}f({})},[r,o,a,l]),{triggerRef:s,position:d}}({isOpen:Ie,estimatedHeight:200,estimatedWidth:250,margin:4}),He=Ne.triggerRef,Ee=Ne.position,Te=n.useMemo(function(){var e,n,r;if(!O)return!1;var t=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===f.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===f.accessor:"right"===f.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===f.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===f.accessor},[O,X,f.accessor,f.pinned]),ke=n.useMemo(function(){return!(!se||Ce)&&p(f,i).some(function(e){return ce.has(e)})},[se,Ce,f,i,ce]),Fe=n.useMemo(function(){return!Ce&&p(f,i).some(function(e){return z.has(e)})},[Ce,f,i,z]),Oe=n.useMemo(function(){return!(!f.children||0===f.children.length)&&(!Se||f.children.some(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n}))},[f.children,Se]),Be=null==h?void 0:h.singleRowChildren,ze=Oe&&!f.singleRowChildren,qe="st-header-cell ".concat(f.accessor===(null===(t=$.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(o=q.current)||void 0===o?void 0:o.accessor)===f.accessor?"st-dragging":""," ").concat(xe?"clickable":""," ").concat(L&&!xe?"columnReordering":""," ").concat(ze?"parent":""," ").concat(Be?"st-sub-header":""," ").concat(Te?"st-last-column":""," ").concat(G&&!Ce?"st-header-editable":""," ").concat(ke?"st-header-selected":""," ").concat(Fe&&!ke?"st-header-has-highlighted-cell":""," ").concat(b?"st-no-resize":""),Ge=Le({draggedHeaderRef:q,headers:X,hoveredHeaderRef:$,onColumnOrderChange:Q,onTableHeaderDragEnd:te}),Ve=Ge.handleDragStart,je=Ge.handleDragEnd,Ke=Ge.handleDragOver,Ue=Me();n.useEffect(function(){if(_&&!f.isSelectionColumn){var e=f.accessor+"";return _.set(e,{setEditing:function(e){N(e)}}),function(){_.delete(e)}}},[_,f.accessor,f.isSelectionColumn]),n.useEffect(function(){T(f.label||"")},[f.label]);var _e=function(e){C(!I)},Je=n.useCallback(function(e){T(e);var n=X.map(function(n){return n.accessor===f.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});ve(n),ne&&ne(f,e)},[X,ve,ne,f]),Ye=n.useCallback(function(){de&&de(null)},[de]),Xe=n.useCallback(function(e){e.stopPropagation(),fe(function(e){var n=new Set(e);return Se?n.delete(f.accessor):n.add(f.accessor),n})},[fe,Se,f.accessor]),$e=function(e){var n=e.event,r=e.header;if(!r.isSelectionColumn){if(se){var t=p(r,i),o=t.some(function(e){return ce.has(e)});if(G&&o&&!n.shiftKey)return U&&Ie&&Ye(),void N(!0);n.shiftKey&&ue?ge(function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort(function(e,n){return e-n}),o=r[0],i=Math.abs(n-o);r.forEach(function(e){var r=Math.abs(n-e);i>r&&(i=r,o=e)});var a,l,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),t,!0);return new Set(u(u([],Array.from(e),!0),c,!0))}):ue&&ue(t),me(new Set),he(null)}Z&&Z(r),!se&&r.isSortable&&re(r.accessor)}};n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]);var Qe=n.useCallback(function(){var e=function(e,n){var r=n||{},t=r.rows,o=r.header,i=r.maxWidth,a=void 0===i?500:i,u=r.sampleSize,l=void 0===u?50:u,s=document.getElementById(g({accessor:e,rowId:"header"}));if(!s)return 150;var d=window.getComputedStyle(s),f=parseFloat(d.paddingLeft)||0,v=parseFloat(d.paddingRight)||0,p=parseFloat(d.gap)||0,h=f+v,w=s.querySelector(".st-header-label");if(w){var m=w.querySelector(".st-header-label-text");if(m){var x=document.createElement("span");x.style.visibility="hidden",x.style.position="absolute",x.style.whiteSpace="nowrap",x.style.width="auto";var b=window.getComputedStyle(m);x.style.font=b.font,x.style.fontSize=b.fontSize,x.style.fontWeight=b.fontWeight,x.style.fontFamily=b.fontFamily,x.style.letterSpacing=b.letterSpacing,x.style.padding=b.padding,x.textContent=m.textContent,document.body.appendChild(x);var y=x.offsetWidth;document.body.removeChild(x),h+=y}}for(var I=Array.from(s.children),C=1,S=0;I.length>S;S++){var M=I[S];if(!M.classList.contains("st-header-label")&&!M.classList.contains("st-sr-only")){var N=window.getComputedStyle(M);"none"!==N.display&&(h+=(M.offsetWidth||0)+(parseFloat(N.marginLeft)||0)+(parseFloat(N.marginRight)||0),C++)}}p>0&&C>1&&(h+=p*(C-1));var H=0,E=o&&o.type&&c.includes(o.type);if(t&&t.length>0&&!E){var T=Math.min(t.length,l),k=document.createElement("div");k.style.visibility="hidden",k.style.position="absolute",k.style.whiteSpace="nowrap",k.style.width="auto";var P=0,A=0,D=document.querySelector(".st-cell-content");if(D){var F=window.getComputedStyle(D);k.style.font=F.font,k.style.fontSize=F.fontSize,k.style.fontFamily=F.fontFamily,P=parseFloat(F.paddingLeft)||0,A=parseFloat(F.paddingRight)||0}for(document.body.appendChild(k),S=0;T>S;S++){var O,L=t[S],W=O=(null==o?void 0:o.valueGetter)?o.valueGetter({accessor:e,row:L,rowIndex:S}):R(L,e);(null==o?void 0:o.valueFormatter)&&null!=O&&(W=o.valueFormatter({accessor:e,colIndex:0,row:L,rowIndex:S,value:O})),k.textContent=null!=W?W+"":"";var B=k.offsetWidth+P+A;B>H&&(H=B)}document.body.removeChild(k)}var z=Math.max(h,H);return E&&(z=Math.max(z,150)),z>a&&(z=a),z+2}(f.accessor,{rows:ae,header:f,maxWidth:500,sampleSize:50}),n=Pe(X,f.accessor);if(n){var r=Ae(X,n),t=n[n.length-1],o=r.map(function(n,r){return r===t?exports.__assign(exports.__assign({},n),{width:e}):n}),i=De(X,n,o);ve(i),ee&&ee(i)}},[f,X,ae,ve,ee]);if(!f)return null;var Ze=W&&!Ce&&!b&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(f.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,r=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ue({callback:en,callbackProps:{autoExpandColumns:D,collapsedHeaders:F,containerWidth:B,event:e.nativeEvent,header:f,headers:X,onColumnWidthChange:ee,reverse:w,setHeaders:ve,setIsResizing:we,startWidth:r},limit:10})},onTouchStart:function(e){var n,r=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ue({callback:en,callbackProps:{autoExpandColumns:D,collapsedHeaders:F,containerWidth:B,event:e,header:f,headers:X,onColumnWidthChange:ee,reverse:w,setHeaders:ve,setIsResizing:we,startWidth:r},limit:10})},onDoubleClick:Qe},{children:e.jsx("div",{className:"st-header-resize-handle"})})),nn=m&&m.key.accessor===f.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return $e({event:e,header:f})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||re(f.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(f.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&Y.sortUp&&Y.sortUp,"desc"===m.direction&&Y.sortDown&&Y.sortDown]})),rn=be&&Y.filter&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:_e,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.target===e.currentTarget||e.currentTarget.contains(e.target))&&(e.target.closest(".st-dropdown-content")||(e.preventDefault(),_e()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(f.label),"aria-expanded":I,"aria-haspopup":"dialog"},{children:[n.cloneElement(Y.filter,{style:{fill:ye?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(ie,exports.__assign({open:I,overflow:"visible",setOpen:C,onClose:function(){return C(!1)}},{children:e.jsx(Cn,{header:f,currentFilter:ye,onApplyFilter:function(e){V(e),C(!1)},onClearFilter:function(){j(f.accessor),C(!1)}})}))]})),tn=Re&&!Ce&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return Xe(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Xe(e))},tabIndex:0,role:"button","aria-label":"".concat(Se?"Expand":"Collapse"," ").concat(f.label," column"),"aria-expanded":!Se},{children:Se?Y.headerCollapse:Y.headerExpand})),on=e.jsx(Rn,exports.__assign({content:f.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(We,{checked:!!A&&A(),onChange:function(e){K&&K(e)},ariaLabel:"Select all rows"}):M?e.jsx(le,{defaultValue:E,onBlur:function(){return N(!1)},onChange:Je}):E||(null==f?void 0:f.label)}))})),an="header-desc-".concat(f.accessor),un=function(e,n){var r=[];return e.type&&"other"!==e.type&&r.push("".concat(e.type," column")),e.isSortable&&r.push("sortable"),n&&r.push("filterable"),e.tooltip&&r.push(e.tooltip),r.join(", ")}(f,be);return e.jsxs(pe,exports.__assign({className:qe,id:g({accessor:f.accessor,rowId:"header"}),role:"columnheader","aria-sort":function(){if(f.isSortable)return(null==m?void 0:m.key.accessor)===f.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"aria-describedby":un?an:void 0,onDragOver:function(e){Ce||Ue({callback:Ke,callbackProps:{event:e,hoveredHeader:f},limit:50})},style:exports.__assign({gridRowStart:d,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-d>1?{}:{height:oe})},{children:[w&&Ze,!f.headerRenderer&&"right"===f.align&&tn,!f.headerRenderer&&"right"===f.align&&rn,!f.headerRenderer&&"right"===f.align&&nn,e.jsx("div",exports.__assign({ref:He,className:"st-header-label",draggable:L&&!f.disableReorder&&!Ce,onClick:function(e){Ce||$e({event:e,header:f})},onDoubleClick:function(e){Ce||function(e){var n=e.header;n.isSelectionColumn||se&&n.isSortable&&re(n.accessor)}({event:e,header:f})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),je()},onDragStart:Ce?void 0:function(e){L&&f&&function(e){Ve(e)}(f)}},{children:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:i,header:f,components:{sortIcon:nn||void 0,filterIcon:rn||void 0,collapseIcon:tn||void 0,labelContent:on}}):on})),!f.headerRenderer&&"right"!==f.align&&nn,!f.headerRenderer&&"right"!==f.align&&rn,!f.headerRenderer&&"right"!==f.align&&tn,!w&&Ze,U&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:U({accessor:f.accessor,colIndex:i,header:f,isOpen:Ie,onClose:Ye,position:Ee})})),un&&e.jsx("span",exports.__assign({id:an,className:"st-sr-only"},{children:un}))]}))},Mn=function(r){var t=r.columnIndices,o=r.gridTemplateColumns,i=r.handleScroll,a=r.headers,u=r.maxDepth,l=r.pinned,s=r.sectionRef,c=r.sort,d=r.width,f=J(),v=f.collapsedHeaders,p=f.autoExpandColumns,h=n.useMemo(function(){var e=function(n,r){return x({header:n,pinned:l,headers:a,collapsedHeaders:v,rootPinned:r})?n.children&&0!==n.children.length?n.children.flatMap(function(n){return e(n,r)}):[n]:[]},n=a.flatMap(function(n){return e(n,n.pinned)});return 0===n.length?-1:t[n[n.length-1].accessor]},[a,l,v,t]),w=n.useMemo(function(){var e=[],n=1,r=function(o,i,s,c,d){var f,p;if(void 0===s&&(s=!1),!x({header:o,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d}))return 0;s||n++;var h,w,m=null!==(p=null===(f=o.children)||void 0===f?void 0:f.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})}).length)&&void 0!==p?p:0,g=n;if(o.singleRowChildren&&m>0?(h=g+1,w=u+1):m>0?(h=g+m,w=i+1):(h=g+1,w=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:h,gridRowStart:i,gridRowEnd:w,colIndex:t[o.accessor],parentHeader:c}),o.children&&o.children.length>0){var b=o.singleRowChildren?i:i+1,y=!o.singleRowChildren;o.children.forEach(function(e){x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})&&(r(e,b,y,o,d),y=!1)})}return h-g},o=a.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:e.pinned})}),i=!0;return o.forEach(function(e){r(e,1,i,void 0,e.pinned),i=!1}),e},[a,u,l,t,v]);return e.jsx(Je,exports.__assign({childRef:s,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:"st-header-".concat(l?"pinned-".concat(l):"main")},i&&{onScroll:i},{ref:s,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:w.map(function(n){return e.jsx(Sn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:c,isLastHeader:p&&!l&&n.colIndex===h},n.header.accessor)})})}))}))},Nn=function(r){var t=r.centerHeaderRef,o=r.headers,i=r.mainTemplateColumns,a=r.pinnedLeftColumns,u=r.pinnedLeftTemplateColumns,l=r.pinnedRightColumns,s=r.pinnedRightTemplateColumns,c=r.sort,d=r.pinnedLeftWidth,f=r.pinnedRightWidth,v=J(),p=v.headerContainerRef,h=v.pinnedLeftRef,w=v.pinnedRightRef,m=v.collapsedHeaders,g=v.tableRows,x=v.maxHeaderDepth,b=n.useMemo(function(){return Xe({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:[Ee(o,"left")&&e.jsx(Mn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:x,pinned:"left",sectionRef:h,sort:c,width:d}),e.jsx(Mn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:x,sectionRef:t,sort:c}),Ee(o,"right")&&e.jsx(Mn,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:x,pinned:"right",sectionRef:w,sort:c,width:f})]}))},Hn=function(e){var n=e.collapsedHeaders,r=e.autoExpandColumns,t=function(e){var r=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide&&!e.excludeFromRender)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&r.push(e),o.length>0?t({headers:o,flattenedHeaders:r}):e.singleRowChildren||r.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&r.push(e),t({headers:i,flattenedHeaders:r})}else r.push(e)}),r},o=t({headers:e.headers,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e,n){var r=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),r&&"number"==typeof r&&(r="".concat(r,"px")),void 0===r||n?t:"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(r,", ").concat(t,")"):"max(".concat(r,", ").concat(t,")")}(e,r)}).join(" "))},En=function(r){var t=r.calculatedHeaderHeight,o=r.hideHeader,i=r.pinnedLeftWidth,a=r.pinnedRightWidth,u=r.setScrollTop,l=r.setScrollDirection,s=r.shouldShowEmptyState,c=r.sort,d=r.tableRows,f=r.rowsToRender,v=r.stickyParents,p=r.regularRows,h=r.partiallyVisibleRows,w=r.heightMap,m=J(),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 Hn({headers:S,collapsedHeaders:y,autoExpandColumns:I})},[S,y,I]),H=n.useMemo(function(){return Hn({headers:R,collapsedHeaders:y,autoExpandColumns:I})},[R,y,I]),E=n.useMemo(function(){return Hn({headers:M,collapsedHeaders:y,autoExpandColumns:I})},[M,y,I]),T={centerHeaderRef:C,headers:b,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedRightColumns:M,pinnedRightTemplateColumns:E,sort:c,pinnedLeftWidth:i,pinnedRightWidth:a},k={calculatedHeaderHeight:t,heightMap:w,mainTemplateColumns:H,partiallyVisibleRows:h,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedLeftWidth:i,pinnedRightColumns:M,pinnedRightTemplateColumns:E,pinnedRightWidth:a,regularRows:p,rowsToRender:f,setScrollDirection:l,setScrollTop:u,shouldShowEmptyState:s,stickyParents:v,tableRows:d};return e.jsxs("div",exports.__assign({className:"st-content ".concat(g?"st-resizeable":"st-not-resizeable"),style:{width:x?"calc(100% - 29.5px)":"100%"}},{children:[!o&&e.jsx(Nn,exports.__assign({},T)),e.jsx(Qe,exports.__assign({},k))]}))},Tn=function(r){var t=r.mainBodyWidth,o=r.mainBodyRef,i=r.pinnedLeftWidth,a=r.pinnedRightWidth,u=r.pinnedLeftContentWidth,l=r.pinnedRightContentWidth,c=r.tableBodyContainerRef,d=J().editColumns,f=n.useState(!1),v=f[0],p=f[1],h=n.useRef(null),w=n.useRef(null),m=n.useRef(null),g=d?s:0,x=(d?a+1:a)+(c.current&&c.current&&c.current.scrollHeight>c.current.clientHeight?c.current.offsetWidth-c.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){o.current&&p(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,t]),v?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(Je,exports.__assign({childRef:w,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:w,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),t>0&&e.jsx(Je,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:t}})}))})),a>0&&e.jsx(Je,exports.__assign({childRef:m,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:m,style:{width:x}},{children:e.jsx("div",{style:{width:l}})}))})),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},kn={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"asc"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"asc"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"asc"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"asc"===r?i:-i},enum:function(e,n,r){return kn.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"asc"===r?-1:1:null==n?"asc"===r?1:-1:"string"==typeof e&&"string"==typeof n?kn.string(e,n,r):"number"==typeof e&&"number"==typeof n?kn.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?kn.boolean(e,n,r):kn.string(e+"",n+"",r)}},Pn=function(e){return function(e){var n=e.rows,r=e.sortColumn,t=function(e,n){for(var r=0,o=e;o.length>r;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children,n);if(a)return a}}},o=t(e.headers,r.key.accessor),i=(null==o?void 0:o.type)||"string",a=r.direction,l=r.key.accessor;return u([],n,!0).sort(function(e,r){var t,u;if(null==o?void 0:o.valueGetter){var s=n.indexOf(e),c=n.indexOf(r);t=o.valueGetter({accessor:l,row:e,rowIndex:s}),u=o.valueGetter({accessor:l,row:r,rowIndex:c})}else t=R(e,l),u=R(r,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:r,valueA:t,valueB:u,direction:a}):function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"asc"===t?-1:1;if(null==n||""===n)return"asc"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=e+"";if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return kn.number(i,a,t)}return"date"===r?kn.date(e+"",n+"",t):"boolean"===r?kn.boolean(!!e,!!n,t):"enum"===r?kn.enum(e+"",n+"",t):kn.string(e+"",n+"",t)}(t,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},An=function(e){return n.useMemo(function(){var n=h(e),r=new Map;return n.forEach(function(e){r.set(e.accessor,e)}),r},[e])},Dn=function(e){var n=e.tableRows,r=e.sortColumn,t=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:r?t&&t.length>0?(0,e.sortNestedRows)({groupingKeys:t,headers:o,rows:n,sortColumn:r}):Pn({headers:o,rows:n,sortColumn:r}):n},Fn=function(e,n,r){void 0===r&&(r=new Set);for(var t=0,o=e;o.length>t;t++){var i=o[t];if(!r.has(i.accessor)&&(r.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,s=i.children;s.length>l;l++){var c=s[l];if(Fn([c],n,r),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},On=function(e){return e.every(function(e){return e.hide})},Ln=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Ln(e.children),On(e.children)&&(e.hide=!0))})},Wn=function(n){var r=n.allHeaders,t=n.depth,o=void 0===t?0:t,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=J(),b=x.headers,y=x.icons,I=x.setHeaders,C=x.onColumnVisibilityChange,R=x.onColumnOrderChange,S="".concat(16*o,"px"),M=f.children&&f.children.length>0,N=null!=p?p:!(f.hide||M&&f.children&&On(f.children)),H=l.has(f.accessor),E=d||H;return e.jsxs(e.Fragment,{children:[0===h&&e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:-1===v?1:0}}),e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:S},draggable:!0,onDragStart:function(e){e.dataTransfer.effectAllowed="move",void 0!==h&&w(s[h])},onDragEnter:function(e){e.preventDefault()},onDragOver:function(e){if(e.preventDefault(),void 0!==h&&a){var n=e.currentTarget.getBoundingClientRect(),r=function(e){var n,r,t=e.flattenedHeaders,o=e.draggingRow,i=e.hoveredRowIndex,a=e.isTopHalfOfRow,u=t[i];if(u.depth===o.depth)return(null===(n=u.parent)||void 0===n?void 0:n.accessor)!==(null===(r=o.parent)||void 0===r?void 0:r.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=t.findIndex(function(n){return n.header.accessor===e});if(-1===n)return"break";l=t[n],s=n};l.parent&&l.depth>o.depth&&"break"!==c(););for(var d=s,f=s,v=s+1;t.length>v&&t[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(r)}},onDragEnd:function(){var e=function(){w(null),g(null)};if(a&&null!==v){var n=s[v>a.visualIndex?v:v+1];if(n){if(n.depth>a.depth&&n.parent){var r=s.findIndex(function(e){return e.header.accessor===n.parent.accessor});-1!==r&&(n=s[r])}if(a.header.accessor!==n.header.accessor){var t=Oe({headers:Ae(b,a.indexPath),draggedHeader:a.header,hoveredHeader:n.header}),o=t.newHeaders;if(t.emergencyBreak)e();else{var i=De(He(b),a.indexPath,o);null==R||R(i),I(i),e()}}else e()}else e()}else e()}},{children:[i&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:M?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(E?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),function(){if(!d){var e=new Set(l);H?e.delete(f.accessor):e.add(f.accessor),m(e)}}()}},{children:y.expand})):null})),e.jsx(We,{checked:N,onChange:function(e){f.hide=!e,e?(Fn(r,f.accessor),M&&f.children&&f.children.length>0&&f.children.every(function(e){return!0===e.hide})&&f.children[0]&&(f.children[0].hide=!1,Fn(r,f.children[0].accessor))):Ln(r);var n=u([],b,!0);if(I(n),C){var t=function(e){var n={},r=function(e){n[e.accessor]=!e.hide,e.children&&e.children.length>0&&e.children.forEach(r)};return e.forEach(r),n}(n);C(t)}}}),e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:y.drag})),e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:f.label}))]})),e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:v===h?1:0}})]})},Bn=function(e,n){var r=n.toLowerCase();return!!e.label.toLowerCase().includes(r)||!(!e.children||0>=e.children.length)&&e.children.some(function(e){return Bn(e,n)})},zn=function(r){var t=r.headers,o=r.open,i=r.searchEnabled,a=r.searchPlaceholder,l=r.searchFunction,s=n.useState(""),c=s[0],d=s[1],f=n.useState(null),v=f[0],p=f[1],h=n.useState(null),w=h[0],m=h[1],g=n.useState(function(){var e=new Set,n=function(r){r.forEach(function(r){r.children&&r.children.length>0&&(e.add(r.accessor),n(r.children))})};return n(t),e}),x=g[0],b=g[1],y=n.useMemo(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]),I=n.useMemo(function(){return i?function(e,n,r){if(!n.trim())return e;var t=r||Bn;return e.filter(function(e){return!e.isSelectionColumn&&!e.excludeFromRender&&t(e,n)})}(t,c,l):t},[t,c,i,l]),C=n.useMemo(function(){var e=[],n=i&&c.trim().length>0,r=function(t){var o=t.depth,i=void 0===o?0:o,a=t.parent,l=void 0===a?null:a,s=t.currentPath,c=void 0===s?[]:s;t.headers.forEach(function(t,o){if(!t.isSelectionColumn&&!t.excludeFromRender){var a=e.length,s=u(u([],c,!0),[o],!1);e.push({header:t,visualIndex:a,depth:i,parent:l,indexPath:s});var d=t.children&&t.children.length>0,f=n||x.has(t.accessor);d&&f&&t.children&&r({headers:t.children,depth:i+1,parent:t,currentPath:s})}})};return r({headers:I,depth:0,parent:null,currentPath:[]}),e},[I,x,i,c]);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:c,onChange:function(e){return d(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:C.map(function(n){return e.jsx(Wn,{doesAnyHeaderHaveChildren:y,header:n.header,allHeaders:t,depth:n.depth,forceExpanded:i&&c.trim().length>0,rowIndex:n.visualIndex,draggingRow:v,setDraggingRow:p,hoveredSeparatorIndex:w,setHoveredSeparatorIndex:m,expandedHeaders:x,setExpandedHeaders:b,flattenedHeaders:C},"".concat(n.header.accessor,"-").concat(n.visualIndex))})}))]}))}))},qn=function(n){var r=n.columnEditorText,t=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:r})),e.jsx(zn,{headers:t,open:o,searchEnabled:i,searchPlaceholder:a,searchFunction:u})]})):null},Gn=function(r){var o=r.children,i=n.useRef({}),a=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),u=n.useCallback(function(e,n){e.scrollWidth-e.clientWidth>0&&(n.scrollLeft=e.scrollLeft)},[]),l=n.useCallback(function(e){e.onscroll=null},[]),s=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var r;null===(r=i.current[n])||void 0===r||r.forEach(function(n){e!==n&&(l(n),u(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});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 r=i.current[n].indexOf(e);-1!==r&&i.current[n].splice(r,1)}})},[a,l]);return e.jsx(_e.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:t.default.Children.only(o)}))},Vn=function(e){var n=e.tableRows,r=e.filterState;return e.externalFilterHandling?n:r&&0!==Object.keys(r).length?n.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var r=n.operator,t=n.value,o=n.values;if(null==e)return"isEmpty"===r;if("isEmpty"===r)return!e||""===(e+"").trim();if("isNotEmpty"===r)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===r||"notContains"===r||"startsWith"===r||"endsWith"===r){var i=(e+"").toLowerCase(),a=t?(t+"").toLowerCase():"";switch(r){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(+e)){var u=+e,l=+t;switch(r){case"equals":return u===l;case"notEquals":return u!==l;case"greaterThan":return u>l;case"lessThan":return l>u;case"greaterThanOrEqual":return u>=l;case"lessThanOrEqual":return l>=u;case"between":if(o&&2===o.length){var 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=be(e),v=be((t||"")+""),p=xe(f),h=xe(v);switch(r){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 xe(be((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 xe(be((e||"")+""))});return m=g[1],g[0]>p||p>m}return!0}}if("boolean"==typeof e&&"equals"===r)return e===!!t;if(Array.isArray(e)){var x=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", ");e=x}if("in"===r||"notIn"===r){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===r?b:!b}return!1}var y=(e+"").toLowerCase(),I=t?(t+"").toLowerCase():"";switch(r){case"equals":return y===I;case"notEquals":return y!==I;default:return!0}}(R(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},jn=function(e){var n,r=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 t=null===(n=null==r?void 0:r.parentElement)||void 0===n?void 0:n.clientHeight;return!t||50>t?0:t*parseInt(e,10)/100}return window.innerHeight}return e},Kn=function(e,n,r,t){var o=[],i=function(e){e.forEach(function(e){var r=t?e[t]:void 0;if(t&&r&&M(r))i(r);else{var a=R(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===r.type&&r.customFn)return r.customFn(o);var a,u=r.parseValue?o.map(r.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===r.type?o.length:void 0;switch(r.type){case"sum":a=u.reduce(function(e,n){return e+n},0);break;case"average":a=u.reduce(function(e,n){return e+n},0)/u.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,u);break;case"max":a=Math.max.apply(Math,u);break;default:return}return r.formatResult?r.formatResult(a):a}},Un=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var r=n.replace(/"/g,'""');return'"'.concat(r,'"')}return n},_n=function(e){return function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return new Promise(function(r){e.apply(void 0,n),setTimeout(function(){return r()},0)})}},Jn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},Yn={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}},Xn=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")},$n=function(e,n,r,t){return void 0===r&&(r={}),new Promise(function(t){e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){Xn(e),e.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Qn=function(e){var r=e.rows,t=e.rowGrouping,o=void 0===t?[]:t,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=r.map(function(e,n){var r=[n],t=[n];return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowId:N({row:e,getRowId:i,depth:0,index:n,rowPath:r,rowIndexPath:t,groupingKey:void 0}),rowPath:r,rowIndexPath:t,absoluteRowIndex:n,isLastGroupRow:!1}});return{flattenedRows:e,heightOffsets:[],paginatableRows:e,parentEndPositions:r.map(function(e,n){return n+1})}}var n=[],t=[],g=[],x=[],b=0,C=function(e,r,R,S,M){void 0===R&&(R=[]),void 0===S&&(S=[]),void 0===M&&(M=[]),e.forEach(function(e,k){var P,A,D=o[r],F=n.length,O=u(u([],R,!0),[k],!1),L=u(u([],S,!0),[k],!1),W=N({row:e,getRowId:i,depth:r,index:k,rowPath:O,rowIndexPath:L,groupingKey:D}),B=n.length,z={row:e,depth:r,displayPosition:b,groupingKey:D,position:F,isLastGroupRow:0===r,rowId:W,rowPath:O,rowIndexPath:L,absoluteRowIndex:F,parentIndices:M.length>0?u([],M,!0):void 0};n.push(z),t.push(z),b++;var q=H(W);if(T(q,r,s,a,l)&&o.length>r){var G=null==c?void 0:c.get(q),V=E(e,D),j=p.find(function(e){return e.expandable&&e.nestedTable});if((null==j?void 0:j.nestedTable)&&V.length>0){var K=n.length,U=(null===(P=j.nestedTable.customTheme)||void 0===P?void 0:P.rowHeight)||h,_=(null===(A=j.nestedTable.customTheme)||void 0===A?void 0:A.headerHeight)||w,J=y({childRowCount:V.length,rowHeight:U,headerHeight:_,customTheme:m}),Y=I({calculatedHeight:J,customHeight:j.nestedTable.height,customTheme:m});g.push([K,Y-h]);var X=u(u([],O,!0),[D],!1);n.push({row:{},depth:r+1,displayPosition:b-1,groupingKey:D,position:K,isLastGroupRow:!1,rowId:X,rowPath:X,rowIndexPath:L,nestedTable:{parentRow:e,expandableHeader:j,childAccessor:D,calculatedHeight:Y},absoluteRowIndex:K})}else if(G&&(G.loading||G.error||G.isEmpty)){if(G.loading&&d||G.error&&f||G.isEmpty&&v){var $=n.length,Q=u(u([],O,!0),[D],!1);n.push({row:{},depth:r+1,displayPosition:b-1,groupingKey:D,position:$,isLastGroupRow:!1,rowId:Q,rowPath:Q,rowIndexPath:L,stateIndicator:{parentRowId:q,parentRow:e,state:G},absoluteRowIndex:$,parentIndices:u(u([],M,!0),[B],!1)})}else if(G.loading&&!d){var Z=n.length,ee=u(u([],O,!0),[D,"loading-skeleton"],!1);n.push({row:{},depth:r+1,displayPosition:b-1,groupingKey:D,position:Z,isLastGroupRow:!1,rowId:ee,rowPath:ee,rowIndexPath:L,isLoadingSkeleton:!0,absoluteRowIndex:Z,parentIndices:u(u([],M,!0),[B],!1)})}}else if(V.length>0){var ne=u(u([],O,!0),[D],!1),re=u([],L,!0);C(V,r+1,ne,re,u(u([],M,!0),[B],!1))}}0===r&&x.push(n.length)})};return C(r,0,[],[],[]),{flattenedRows:n,heightOffsets:g,paginatableRows:t,parentEndPositions:x}},[r,o,i,a,l,s,c,d,f,v,p,h,w,m])},Zn=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},er={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},nr={text:"Columns",searchEnabled:!0,searchPlaceholder:"Search columns..."},rr=[{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."}],tr=function(e,n){var r=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?r.push.apply(r,tr(e.children,null!=n?n:e.pinned)):r.push(e))}),r},or=function(e,n){return n>=e.reduce(function(e,n){return e+F(n)},0)},ir=function(e,n){var r=new Map,t=e.reduce(function(e,n){return e+("number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150)},0);if(0===t)return r;var o=n/t;if(.01>Math.abs(o-1))return r;var i=0;return e.forEach(function(t,a){var u,l="number"==typeof t.width?t.width:"string"==typeof t.width&&t.width.endsWith("px")?parseFloat(t.width):150;a===e.length-1?u=n-i:i+=u=Math.round(l*o),r.set(t.accessor,u)}),r},ar=function(e,n){var r,t=n.containerWidth,o=n.pinnedLeftWidth,i=n.pinnedRightWidth,a=n.mainBodyRef;if(!n.autoExpandColumns||0===t||n.isResizing)return e;r=a.current?a.current.clientWidth:Math.max(0,t-o-i);var u=e.filter(function(e){return"left"===e.pinned}),l=e.filter(function(e){return"right"===e.pinned}),s=e.filter(function(e){return!e.pinned}),c=tr(u,"left"),d=tr(l,"right"),f=tr(s,void 0),v=c.length>0&&or(c,o),p=d.length>0&&or(d,i),h=f.length>0&&r>0&&or(f,r),w=new Map;if(v&&ir(c,o).forEach(function(e,n){return w.set(n,e)}),p&&ir(d,i).forEach(function(e,n){return w.set(n,e)}),h&&ir(f,r).forEach(function(e,n){return w.set(n,e)}),0===w.size)return e;var m=function(e,n){var r;if(e.hide)return e;var t=null!=n?n:e.pinned,o=null===(r=e.children)||void 0===r?void 0:r.map(function(e){return m(e,t)});if(!e.children||0===e.children.length){var i=w.get(e.accessor);return void 0!==i?exports.__assign(exports.__assign({},e),{width:i,children:o}):exports.__assign(exports.__assign({},e),{children:o})}return exports.__assign(exports.__assign({},e),{children:o})};return e.map(function(e){return m(e,e.pinned)})},ur=function(r){var t=n.useState(!1),o=t[0],i=t[1];return n.useEffect(function(){!function(e){"production"!==process.env.NODE_ENV&&rr.forEach(function(n){var r=n.propName,t=n.replacement,o=n.message;if(void 0!==e[r]){var i='SimpleTable: The "'.concat(r,'" prop is deprecated and will be removed in a future version.'),a='Please use "'.concat(t,'" instead.'),u=o?"\n".concat(o):"",l=t.split("."),s=l[0],c=l[1],d="string"==typeof e[r]?JSON.stringify(e[r]):"<YourIcon />";console.error("".concat(i,"\n").concat(a).concat(u,"\n\nExample:\n<SimpleTable\n ").concat(s,"={{\n ").concat(c,": ").concat(d,"\n }}\n/>"))}})}(r)},[]),n.useEffect(function(){i(!0)},[]),o?e.jsx(lr,exports.__assign({},r)):null},lr=function(r){var t=r.allowAnimations,o=void 0!==t&&t,s=r.autoExpandColumns,c=void 0!==s&&s,d=r.canExpandRowGroup,f=r.cellUpdateFlash,v=void 0!==f&&f,p=r.className,w=r.columnBorders,m=void 0!==w&&w,g=r.columnEditorConfig,x=void 0===g?nr:g,y=r.columnEditorText,I=r.columnReordering,C=void 0!==I&&I,E=r.columnResizing,T=void 0!==E&&E,A=r.copyHeadersToClipboard,D=void 0!==A&&A,F=r.customTheme,O=r.defaultHeaders,L=r.editColumns,W=void 0!==L&&L,z=r.editColumnsInitOpen,q=void 0!==z&&z,V=r.emptyStateRenderer,U=r.enableHeaderEditing,J=void 0!==U&&U,Z=r.enableRowSelection,te=void 0!==Z&&Z,ie=r.enableStickyParents,ae=void 0!==ie&&ie,ue=r.errorStateRenderer,le=r.expandAll,se=void 0===le||le,ce=r.expandIcon,de=r.externalFilterHandling,fe=void 0!==de&&de,ve=r.externalSortHandling,pe=void 0!==ve&&ve,he=r.filterIcon,we=r.footerRenderer,me=r.headerCollapseIcon,ge=r.headerDropdown,xe=r.headerExpandIcon,be=r.height,ye=r.hideFooter,Ie=void 0!==ye&&ye,Ce=r.hideHeader,Re=void 0!==Ce&&Ce,Se=r.icons,Me=r.includeHeadersInCSVExport,He=void 0===Me||Me,Ee=r.initialSortColumn,Te=r.initialSortDirection,ke=void 0===Te?"asc":Te,Pe=r.isLoading,Ae=void 0!==Pe&&Pe,De=r.loadingStateRenderer,Fe=r.maxHeight,Oe=r.nextIcon,Le=r.onCellClick,We=r.onCellEdit,Be=r.onColumnOrderChange,ze=r.onColumnSelect,qe=r.onColumnVisibilityChange,Ge=r.onColumnWidthChange,Ve=r.onFilterChange,je=r.onGridReady,Ke=r.onHeaderEdit,Ue=r.onLoadMore,_e=r.onNextPage,Je=r.onPageChange,Ye=r.onRowGroupExpand,Xe=r.onRowSelectionChange,$e=r.onSortChange,Qe=r.prevIcon,Ze=r.quickFilter,en=r.rowButtons,nn=r.rowGrouping,tn=r.getRowId,on=r.rows,an=r.rowsPerPage,un=void 0===an?10:an,ln=r.selectableCells,sn=void 0!==ln&&ln,cn=r.selectableColumns,dn=void 0!==cn&&cn,fn=r.serverSidePagination,vn=void 0!==fn&&fn,pn=r.shouldPaginate,hn=void 0!==pn&&pn,wn=r.sortDownIcon,mn=r.sortUpIcon,gn=r.tableEmptyStateRenderer,xn=void 0===gn?e.jsx(Zn,{}):gn,bn=r.tableRef,yn=r.theme,In=void 0===yn?"modern-light":yn,Cn=r.totalRowCount,Rn=r.useHoverRowBackground,Sn=void 0===Rn||Rn,Mn=r.useOddColumnBackground,Nn=void 0!==Mn&&Mn,Hn=r.useOddEvenRowBackground,kn=void 0!==Hn&&Hn,Fn=n.useMemo(function(){var n,r,t,o,i,a,u,l,s,c,d,f,v,p,h,w,m,g={drag:e.jsx(ne,{className:"st-drag-icon"}),expand:e.jsx($,{className:"st-expand-icon"}),filter:e.jsx(re,{className:"st-header-icon"}),headerCollapse:e.jsx($,{className:"st-header-icon"}),headerExpand:e.jsx(X,{className:"st-header-icon"}),next:e.jsx($,{className:"st-next-prev-icon"}),prev:e.jsx(X,{className:"st-next-prev-icon"}),sortDown:e.jsx(ee,{className:"st-header-icon"}),sortUp:e.jsx(Q,{className:"st-header-icon"})};return{drag:null!==(n=null==Se?void 0:Se.drag)&&void 0!==n?n:g.drag,expand:null!==(t=null!==(r=null==Se?void 0:Se.expand)&&void 0!==r?r:ce)&&void 0!==t?t:g.expand,filter:null!==(i=null!==(o=null==Se?void 0:Se.filter)&&void 0!==o?o:he)&&void 0!==i?i:g.filter,headerCollapse:null!==(u=null!==(a=null==Se?void 0:Se.headerCollapse)&&void 0!==a?a:me)&&void 0!==u?u:g.headerCollapse,headerExpand:null!==(s=null!==(l=null==Se?void 0:Se.headerExpand)&&void 0!==l?l:xe)&&void 0!==s?s:g.headerExpand,next:null!==(d=null!==(c=null==Se?void 0:Se.next)&&void 0!==c?c:Oe)&&void 0!==d?d:g.next,prev:null!==(v=null!==(f=null==Se?void 0:Se.prev)&&void 0!==f?f:Qe)&&void 0!==v?v:g.prev,sortDown:null!==(h=null!==(p=null==Se?void 0:Se.sortDown)&&void 0!==p?p:wn)&&void 0!==h?h:g.sortDown,sortUp:null!==(m=null!==(w=null==Se?void 0:Se.sortUp)&&void 0!==w?w:mn)&&void 0!==m?m:g.sortUp}},[Se,ce,he,me,xe,Oe,Qe,wn,mn]),On=n.useMemo(function(){return exports.__assign(exports.__assign({},er),F)},[F]),Ln=n.useMemo(function(){var e,n,r,t;return{text:null!==(n=null!==(e=null==x?void 0:x.text)&&void 0!==e?e:y)&&void 0!==n?n:nr.text,searchEnabled:null!==(r=null==x?void 0:x.searchEnabled)&&void 0!==r?r:nr.searchEnabled,searchPlaceholder:null!==(t=null==x?void 0:x.searchPlaceholder)&&void 0!==t?t:nr.searchPlaceholder,searchFunction:null==x?void 0:x.searchFunction}},[x,y]),Wn=On.rowHeight,Bn=On.headerHeight,zn=On.footerHeight,Jn=On.selectionColumnWidth;Nn&&(kn=!1),m&&(Sn=!1);var Xn=n.useRef(null),$n=n.useRef(null),rr=n.useRef(null),tr=n.useRef(null),or=n.useRef(null),ir=n.useRef(null),ur=n.useRef(null),lr=n.useReducer(function(e){return e+1},0)[1],sr=n.useState(new Map),cr=sr[0],dr=sr[1],fr=n.useState(on),vr=fr[0],pr=fr[1],hr=n.useState(Ae),wr=hr[0],mr=hr[1],gr=n.useRef(Ae),xr=n.useRef(new Map);n.useEffect(function(){pr(on);var e=new Map;on.forEach(function(n,r){var t=N({row:n,getRowId:tn,depth:0,index:r,rowPath:[r],rowIndexPath:[r]}),o=H(t);e.set(o,r)}),xr.current=e},[on,tn]),n.useEffect(function(){var e=gr.current,n=Ae;n&&!e?mr(!0):!n&&e&&setTimeout(function(){mr(!1)},0),gr.current=Ae},[Ae]);var br,yr,Ir,Cr,Rr,Sr,Mr,Nr,Hr,Er,Tr=function(e){var r=e.tableBodyContainerRef,t=n.useState(0),o=t[0],i=t[1];return n.useLayoutEffect(function(){r.current&&i(r.current.offsetWidth-r.current.clientWidth)},[r]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:r}}({tableBodyContainerRef:ir}),kr=Tr.scrollbarWidth,Pr=Tr.setScrollbarWidth,Ar=oe({headerContainerRef:ur,mainSectionRef:ir,scrollbarWidth:kr}).isMainSectionScrollable,Dr=n.useMemo(function(){if(wr&&0===vr.length){var e=hn?un:10;return Ar&&(e+=1),Array.from({length:e},function(e,n){return{}})}return vr},[wr,vr,un,Ar,hn]),Fr=n.useState(1),Or=Fr[0],Lr=Fr[1],Wr=n.useState(O),Br=Wr[0],zr=Wr[1],qr=n.useState(!1),Gr=qr[0],Vr=qr[1],jr=n.useState(!1),Kr=jr[0],Ur=jr[1],_r=n.useState(null),Jr=_r[0],Yr=_r[1],Xr=n.useState(q),$r=Xr[0],Qr=Xr[1],Zr=n.useCallback(function(){var e=new Set,n=function(r){r.forEach(function(r){r.collapseDefault&&r.collapsible&&e.add(r.accessor),r.children&&n(r.children)})};return n(O),e},[O]),et=n.useState(Zr),nt=et[0],rt=et[1];n.useEffect(function(){zr(O)},[O]);var tt=n.useMemo(function(){var e,n=u([],Br,!0);return te&&!(null===(e=null==Br?void 0:Br[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:Jn,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[te,Br,Jn]),ot=n.useState(0),it=ot[0],at=ot[1],ut=n.useState("none"),lt=ut[0],st=ut[1],ct=function(e,r){var t=n.useState(function(){return function(e,n){if(!n||0===n.length)return new Set;if(e){var r=Array.from({length:n.length},function(e,n){return n});return new Set(r)}return new Set}(e,r)}),o=t[0],i=t[1];return n.useEffect(function(){i(r&&0!==r.length?function(e){var n=r.length,t=Array.from(e).filter(function(e){return n>e});return new Set(t)}:new Set)},[r]),{expandedDepths:o,setExpandedDepths:i}}(se,nn),dt=ct.expandedDepths,ft=ct.setExpandedDepths,vt=n.useState(new Map),pt=vt[0],ht=vt[1],wt=n.useState(new Map),mt=wt[0],gt=wt[1],xt=function(){var e=n.useState(""),r=e[0],t=e[1],o=n.useRef(null);return n.useEffect(function(){return r&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){t("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[r]),{announcement:r,announce:function(e){t(e)}}}(),bt=xt.announcement,yt=xt.announce,It=function(e){var r=e.effectiveHeaders,t=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,r;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(r=e.children)||void 0===r?void 0:r.length)?1+Math.max.apply(Math,e.children.map(s)):1},[]),c=n.useMemo(function(){var e=0;return r.forEach(function(n){var r=s(n);e=Math.max(e,r)}),e},[r,s]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,r=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(r){var i=parseFloat(r);isNaN(i)||(e=i)}}return c*(null!=t?t:o)+e},[c,t,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:tt,headerHeight:Bn,rowHeight:Wn,tableBodyContainerRef:ir}),Ct=It.containerWidth,Rt=It.calculatedHeaderHeight,St=It.maxHeaderDepth,Mt=n.useMemo(function(){var e=rn({headers:tt,containerWidth:Ct,collapsedHeaders:nt});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth,pinnedLeftContentWidth:e.leftContentWidth,pinnedRightContentWidth:e.rightContentWidth}},[tt,Ct,nt]),Nt=Mt.mainBodyWidth,Ht=Mt.pinnedLeftWidth,Et=Mt.pinnedRightWidth,Tt=Mt.pinnedLeftContentWidth,kt=Mt.pinnedRightContentWidth,Pt=function(e){var r=e.autoExpandColumns,t=e.containerWidth,o=e.pinnedLeftWidth,i=e.pinnedRightWidth,a=e.mainBodyRef,u=e.isResizing,l=e.setHeaders,s=n.useRef({autoExpandColumns:r,containerWidth:t,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u});s.current={autoExpandColumns:r,containerWidth:t,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u};var c=n.useCallback(function(e){l(function(n){var r="function"==typeof e?e(n):e;return ar(r,s.current)})},[l]),d=n.useRef(u);n.useEffect(function(){d.current&&!u&&r&&l(function(e){return ar(e,s.current)}),d.current=u},[u,r,l]);var f=n.useRef(t);return n.useEffect(function(){Math.abs(t-f.current)>10&&!u&&r&&l(function(e){return ar(e,s.current)}),f.current=t},[t,u,r,l]),c}({autoExpandColumns:c,containerWidth:Ct,pinnedLeftWidth:Ht,pinnedRightWidth:Et,mainBodyRef:rr,isResizing:Gr,setHeaders:zr}),At=function(e){var r=e.rows,t=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return r;var e=function(e){return h(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return r;var n=JSON.parse(JSON.stringify(r)),i=function(n,r){return void 0===r&&(r=0),n.map(function(n){var t=o[r],a=o[r+1],u=n[t];if(u&&M(u)){var l=i(u,r+1),s=exports.__assign({},n);return s[t]=l,e.forEach(function(e){var n=Kn(l,e.accessor,e.aggregation,a);void 0!==n&&S(s,e.accessor,n)}),s}return n})};return i(n)},[r,t,o])}({rows:Dr,headers:Br,rowGrouping:nn}),Dt=function(e){var r=e.rows,t=e.headers,o=e.quickFilter;return n.useMemo(function(){if(!o||!o.text||""===o.text.trim())return r;var e=o.text,n=o.columns,i=o.caseSensitive,a=void 0!==i&&i,u=o.mode,l=void 0===u?"simple":u,s=o.useFormattedValue,c=void 0===s||s,d=t.filter(function(e){return!e.hide&&!e.excludeFromRender&&(n&&n.length>0?n.includes(e.accessor):!1!==e.quickFilterable)}),f="smart"===l?function(e){for(var n=[],r=0;e.length>r;){for(;e.length>r&&/\s/.test(e[r]);)r++;if(r>=e.length)break;if("-"!==e[r])if('"'!==e[r]){for(var t=r;e.length>r&&!/[\s:]/.test(e[r]);)r++;var o=e.substring(t,r);if(e.length>r&&":"===e[r]){for(var i=++r;e.length>r&&!/\s/.test(e[r]);)r++;(l=e.substring(i,r))&&n.push({type:"columnSpecific",value:l,column:o})}else o&&n.push({type:"word",value:o})}else{for(var a=++r;e.length>r&&'"'!==e[r];)r++;(l=e.substring(a,r))&&n.push({type:"phrase",value:l}),e.length>r&&'"'===e[r]&&r++}else{for(var u=++r;e.length>r&&!/\s/.test(e[r]);)r++;var l;(l=e.substring(u,r))&&n.push({type:"negation",value:l})}}return n}(e):null;return r.filter(function(n){if("smart"===l&&f){var r=new Set,t=new Map;f.forEach(function(e,n){"columnSpecific"===e.type&&e.column&&(t.has(e.column)||t.set(e.column,[]),t.get(e.column).push(n))});var o=[];d.forEach(function(e){try{var i;if(e.quickFilterGetter)i=e.quickFilterGetter({row:n,accessor:e.accessor});else{var u=R(n,e.accessor);if(c&&e.valueFormatter){var l=e.valueFormatter({accessor:e.accessor,colIndex:0,row:n,rowIndex:0,value:u});i=Array.isArray(l)?l.join(" "):l+""}else i=null==u?"":Array.isArray(u)?u.join(" "):u+""}o.push(i);var s=t.get(e.accessor);s&&s.forEach(function(e){var n=f[e],t=a?i:i.toLowerCase(),o=a?n.value:n.value.toLowerCase();t.includes(o)&&r.add(e)})}catch(n){console.warn("Quick filter error for column ".concat(e.accessor,":"),n)}});var i=a?o.join(" "):o.join(" ").toLowerCase();return f.forEach(function(e,n){if("columnSpecific"!==e.type){var t=a?e.value:e.value.toLowerCase();switch(e.type){case"word":case"phrase":i.includes(t)&&r.add(n);break;case"negation":i.includes(t)||r.add(n)}}}),r.size===f.length}return d.some(function(r){try{var t=void 0;if(r.quickFilterGetter)t=r.quickFilterGetter({row:n,accessor:r.accessor});else{var o=R(n,r.accessor);if(c&&r.valueFormatter){var i=r.valueFormatter({accessor:r.accessor,colIndex:0,row:n,rowIndex:0,value:o});t=Array.isArray(i)?i.join(" "):i+""}else t=null==o?"":Array.isArray(o)?o.join(" "):o+""}return function(e,n,r){if(!n)return!0;var t=r?e:e.toLowerCase(),o=r?n:n.toLowerCase();return t.includes(o)}(t,e,a)}catch(e){return console.warn("Quick filter error for column ".concat(r.accessor,":"),e),!1}})})},[r,t,o])}({rows:At,headers:tt,quickFilter:Ze}),Ft=function(e){var r=e.rows,t=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],s=u[1],c=An(t),d=n.useMemo(function(){return Vn({externalFilterHandling:o,tableRows:r,filterState:l})},[r,l,o]),f=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(s(r),null==i||i(r),a){var t=c.get(e.accessor);t&&a("Filter applied to ".concat(t.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 r=c.get(e);r&&a("Filter removed from ".concat(r.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,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return Vn({externalFilterHandling:o,tableRows:r,filterState:t})},[l,r,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Dt,headers:tt,externalFilterHandling:fe,onFilterChange:Ve,announce:yt}),Ot=Ft.filters,Lt=Ft.updateFilter,Wt=Ft.clearFilter,Bt=Ft.clearAllFilters,zt=Ft.computeFilteredRowsPreview,qt=function(e){var r=e.headers,t=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,s=e.announce,c=An(r),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,r=e.headers,t=e.sortColumn,o=Pn({headers:r,rows:e.rows,sortColumn:t});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(M(a)){var u=h({rows:a,sortColumn:t,headers:r,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return Dn({externalSortHandling:o,tableRows:t,sortColumn:v,rowGrouping:a,headers:r,sortNestedRows:h})},[t,v,r,o,a,h]),m=n.useCallback(function(e){if(!e)return p(null),void(null==i||i(null));var n=e.accessor,r=e.direction,t=c.get(n);if(t){var o=null;if(r)o={key:t,direction:r};else{var a=t.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:t,direction:l}}if(p(o),null==i||i(o),s)if(o){var d="asc"===o.direction?"ascending":"descending";s("Sorted by ".concat(t.label,", ").concat(d))}else s("Sort removed from ".concat(t.label))}},[v,c,i,s]),g=n.useCallback(function(e){var n=function(r){for(var t=0,o=r;o.length>t;t++){var i=o[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(r);if(!i)return t;var u=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 Dn({externalSortHandling:o,tableRows:t,sortColumn:null===s?null:{key:i,direction:s},rowGrouping:a,headers:r,sortNestedRows:h})},[v,r,t,o,a,h]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:g}}({headers:Br,tableRows:Ft.filteredRows,externalSortHandling:pe,onSortChange:$e,rowGrouping:nn,initialSortColumn:Ee,initialSortDirection:ke,announce:yt}),Gt=qt.sort,Vt=qt.updateSort,jt=qt.computeSortedRowsPreview,Kt=Qn({rows:qt.sortedRows,rowGrouping:nn,getRowId:tn,expandedRows:pt,collapsedRows:mt,expandedDepths:dt,rowStateMap:cr,hasLoadingRenderer:!!De,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:tt,rowHeight:Wn,headerHeight:Bn,customTheme:On}),Ut=Kt.flattenedRows,_t=Kt.heightOffsets,Jt=Kt.paginatableRows,Yt=Kt.parentEndPositions,Xt=function(e){var r=e.tableRows,t=e.onRowSelectionChange,o=e.enableRowSelection,i=void 0!==o&&o,a=n.useState(new Set),u=a[0],l=a[1],s=n.useCallback(function(e){return!!i&&function(e,n){return n.has(e)}(e,u)},[u,i]),c=n.useCallback(function(){return!!i&&function(e,n){return 0!==e.length&&e.filter(function(e){return e&&e.rowId}).every(function(e){return n.has(H(e.rowId))})}(r,u)},[r,u,i]),d=n.useMemo(function(){return i?function(e){return e.size}(u):0},[u,i]),f=n.useMemo(function(){return i?function(e,n){return e.filter(function(e){return!(!e||!e.rowId)&&n.has(H(e.rowId))}).map(function(e){return e.row})}(r,u):[]},[r,u,i]),v=n.useCallback(function(e,n){if(i){var o=function(e,n){var r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r}(e,u);if(l(o),t){var a=r.find(function(n){return H(n.rowId)===e});a&&t({row:a.row,isSelected:n,selectedRows:o})}}},[u,r,t,i]),p=n.useCallback(function(e){var n;i&&(e?(n=function(e){return new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}))}(r),t&&r.forEach(function(e){return t({row:e.row,isSelected:!0,selectedRows:n})})):(n=new Set,t&&u.forEach(function(e){var o=r.find(function(n){return H(n.rowId)===e});o&&t({row:o.row,isSelected:!1,selectedRows:n})})),l(n))},[r,t,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(t){var e=new Set;u.forEach(function(n){var o=r.find(function(e){return H(e.rowId)===n});o&&t({row:o.row,isSelected:!1,selectedRows:e})})}l(new Set)}},[u,r,t,i]);return{selectedRows:u,setSelectedRows:l,isRowSelected:s,areAllRowsSelected:c,selectedRowCount:d,selectedRowsData:f,handleRowSelect:v,handleSelectAll:p,handleToggleRow:h,clearSelection:w}}({tableRows:Ut,onRowSelectionChange:Xe,enableRowSelection:te});br=Xt.selectedRows,yr=Xt.setSelectedRows,Ir=Xt.isRowSelected,Cr=Xt.areAllRowsSelected,Rr=Xt.selectedRowCount,Sr=Xt.selectedRowsData,Mr=Xt.handleRowSelect,Nr=Xt.handleSelectAll,Hr=Xt.handleToggleRow,Er=Xt.clearSelection;var $t=Qn({rows:At,rowGrouping:nn,getRowId:tn,expandedRows:pt,collapsedRows:mt,expandedDepths:dt,rowStateMap:cr,hasLoadingRenderer:!!De,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:tt,rowHeight:Wn,headerHeight:Bn,customTheme:On}).flattenedRows,Qt=n.useCallback(function(e){var n=zt(e);return nn&&0!==nn.length?k({rows:n,rowGrouping:nn,getRowId:tn,expandedRows:pt,collapsedRows:mt,expandedDepths:dt,rowStateMap:cr,hasLoadingRenderer:!!De,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:tt,rowHeight:Wn,headerHeight:Bn,customTheme:On}):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}})},[zt,nn,tn,pt,mt,dt,cr,De,ue,V,tt,Wn,Bn,On]),Zt=n.useCallback(function(e){var n=jt(e);return nn&&0!==nn.length?k({rows:n,rowGrouping:nn,getRowId:tn,expandedRows:pt,collapsedRows:mt,expandedDepths:dt,rowStateMap:cr,hasLoadingRenderer:!!De,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:tt,rowHeight:Wn,headerHeight:Bn,customTheme:On}):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}})},[jt,nn,tn,pt,mt,dt,cr,De,ue,V,tt,Wn,Bn,On]),eo=function(e){var r=e.height,t=e.maxHeight,o=e.rowHeight,i=e.totalRowCount,a=e.headerHeight,u=e.footerHeight;return n.useMemo(function(){if(t){var e=jn(t);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(r){var l=jn(r);if(0!==l)return Math.max(0,l-o)}},[r,t,o,i,a,u])}({height:be,maxHeight:Fe,rowHeight:Wn,shouldPaginate:hn,rowsPerPage:un,totalRowCount:null!=Cn?Cn:Jt.length,headerHeight:Rt,footerHeight:hn&&!Ie?zn:void 0}),no=function(e){var r=e.allowAnimations,t=e.computeFilteredRowsPreview,o=e.computeSortedRowsPreview,i=e.contentHeight,a=e.currentPage,s=e.customTheme,c=e.enableStickyParents,d=e.flattenedRows,f=e.heightOffsets,v=e.originalFlattenedRows,p=e.parentEndPositions,h=e.rowHeight,w=e.rowsPerPage,m=e.scrollDirection,g=void 0===m?"none":m,x=e.scrollTop,b=e.serverSidePagination,y=e.shouldPaginate,I=e.rowGrouping,C=n.useState(!1),R=C[0],S=C[1],M=n.useState([]),N=M[0],E=M[1],T=n.useRef([]),k=n.useRef([]),P=n.useMemo(function(){return l(h)},[h]),A=n.useRef(new Map),D=n.useRef(null),F=n.useCallback(function(e,n){if(!y||b)return e.map(function(e,n){return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:n})});var r=(a-1)*w,t=a*w,o=0===r?0:n[r-1];return e.slice(o,t>n.length?e.length:n[t-1]).map(function(e,n){var r=e.nestedTable?e.absoluteRowIndex:y&&!b?o+n:n;return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:r})})},[a,w,b,y]);n.useMemo(function(){if(0===A.current.size&&v.length>0){var e=new Map;v.forEach(function(n,r){var t=H(n.rowId);e.set(t,r)}),A.current=e}},[v]);var O=n.useMemo(function(){return F(d,p)},[d,p,F]),L=n.useMemo(function(){if(!f||0===f.length||!y||b)return f;var e=new Map;return O.forEach(function(n){n.nestedTable&&e.set(n.absoluteRowIndex,n.position)}),f.filter(function(n){return e.has(n[0])}).map(function(n){var r=n[1];return[e.get(n[0]),r]})},[f,O,y,b]),W=n.useMemo(function(){if(L&&0!==L.length)return function(e,n,r,t){var o=n+t.rowSeparatorWidth,i=Array(e),a=new Map;r&&r.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-t.rowSeparatorWidth}}(O.length,h,L,s)},[O.length,h,L,s]),z=n.useMemo(function(){return void 0===i?O:B({bufferRowCount:P,contentHeight:i,tableRows:O,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}).rendered.rows},[O,i,h,x,g,P,W]),q=n.useMemo(function(){if(!c||void 0===i)return{stickyParents:[],regularRows:z,partiallyVisibleRows:[]};var e=B({bufferRowCount:P,contentHeight:i,tableRows:O,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}),n=I?function(e,n,r,t,o){return G({allTableRows:e,renderedRows:n,fullyVisibleRows:r,partiallyVisibleRows:t,partiallyVisibleRowIndex:0,recursionDepth:0,stickyParents:[],rowGrouping:o})}(O,e.rendered.rows,e.fullyVisible.rows,e.partiallyVisible.rows,I):{stickyParents:[],regularRows:e.rendered.rows,partiallyVisibleRows:[]};return exports.__assign(exports.__assign({},n),{partiallyVisibleRows:e.partiallyVisible.rows})},[P,i,O,c,W,I,h,g,x,z]),V=q.stickyParents,j=q.regularRows,K=q.partiallyVisibleRows,U=n.useCallback(function(e,n){var r=new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)})),t=new Set(n.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}));return{staying:n.filter(function(e){var n=H(e.rowId);return r.has(n)}),entering:n.filter(function(e){var n=H(e.rowId);return!r.has(n)}),leaving:e.filter(function(e){var n=H(e.rowId);return!t.has(n)})}},[]),_=n.useMemo(function(){if(0===T.current.length)return!1;var e=O.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}),n=T.current.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)});return e.length!==n.length||!e.every(function(e,r){return e===n[r]})},[O]);n.useLayoutEffect(function(){if(!R){var e=function(){N.length>0&&E([])};if(!r||y)return e(),T.current=O,void(k.current=z);if(0===T.current.length)return e(),T.current=O,void(k.current=z);if(!_)return e(),T.current=O,void(k.current=z);D.current={tableRows:O,visibleRows:z},S(!0)}},[r,O,N.length,_,R,y,z]),n.useLayoutEffect(function(){if(R&&D.current&&N.length>0){var e=setTimeout(function(){var e=D.current;S(!1),E([]),T.current=e.tableRows,k.current=e.visibleRows,D.current=null},Yn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[R,N.length]);var J=n.useMemo(function(){if(!r||y)return z;if(N.length>0){var e=new Map,n=new Map;return O.forEach(function(r){var t=H(r.rowId);e.set(t,r.position),n.set(t,r.displayPosition)}),N.map(function(r){var t=H(r.rowId),o=e.get(t),i=n.get(t);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},r),{position:o,displayPosition:i}):r})}return z},[z,N,O,r,y]),Y=n.useCallback(function(e){if(r&&!y&&void 0!==i){var n=t(e),o=F(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:o,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}),l=U(z,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return O.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],z,!0),l,!0))}},[r,y,t,F,i,h,x,g,U,O,z,P,W]),X=n.useCallback(function(e){if(r&&!y&&void 0!==i){var n=o(e),t=F(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:t,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}),l=U(z,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return O.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],z,!0),l,!0))}},[r,y,o,F,i,h,x,g,U,O,z,P,W]);return{currentTableRows:O,currentVisibleRows:z,isAnimating:R,prepareForFilterChange:Y,prepareForSortChange:X,rowsToRender:J,stickyParents:V,regularRows:j,partiallyVisibleRows:K,paginatedHeightOffsets:L,heightMap:W}}({allowAnimations:o,computeFilteredRowsPreview:Qt,computeSortedRowsPreview:Zt,contentHeight:eo,currentPage:Or,customTheme:On,enableStickyParents:ae,flattenedRows:Ut,heightOffsets:_t,originalFlattenedRows:$t,paginatableRows:Jt,parentEndPositions:Yt,rowGrouping:nn,rowHeight:Wn,rowsPerPage:un,scrollDirection:lt,scrollTop:it,serverSidePagination:vn,shouldPaginate:hn}),ro=no.currentTableRows,to=no.rowsToRender,oo=no.prepareForFilterChange,io=no.prepareForSortChange,ao=no.isAnimating,uo=no.stickyParents,lo=no.regularRows,so=no.partiallyVisibleRows,co=no.paginatedHeightOffsets,fo=no.heightMap,vo=n.useRef(new Map),po=n.useRef(new Map),ho=function(e){var r=e.selectableCells,t=e.headers,o=e.tableRows,u=e.onCellEdit,l=e.cellRegistry,s=e.collapsedHeaders,c=e.rowHeight,d=e.enableRowSelection,f=void 0!==d&&d,v=e.copyHeadersToClipboard,p=void 0!==v&&v,h=e.customTheme,w=n.useState(new Set),m=w[0],g=w[1],x=n.useState(new Set),b=x[0],y=x[1],I=n.useState(null),C=I[0],M=I[1],N=n.useState(null),E=N[0],T=N[1],k=n.useState(new Set),A=k[0],D=k[1],F=n.useState(new Set),O=F[0],L=F[1],W=n.useState(!1),B=W[0],z=W[1],q=n.useRef(!1),G=n.useRef(null),V=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var r=n.split("-");if(r.length>=2){var t=parseInt(r[1],10);isNaN(t)||e.add(t)}}),b.forEach(function(n){e.add(n)}),e},[m,b]),U=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var r=n.split("-");if(r.length>=3){var t=r.slice(2).join("-");e.add(t)}}),b.size>0&&o.forEach(function(n){var r=H(n.rowId);e.add(r)}),e},[m,b,o]),_=n.useMemo(function(){return t.flatMap(function(e){return P(e,s)})},[t,s]),J=n.useCallback(function(){if(0!==m.size){var e=function(e,n,r,t){void 0===t&&(t=!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 t,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===(t=r[u])||void 0===t?void 0:t.row)){var d=r[u].row,f=R(d,s);if(!1!==(null==c?void 0:c.useFormattedValueForClipboard)&&(null==c?void 0:c.valueFormatter)){var v=c.valueFormatter({accessor:s,colIndex:l,row:d,rowIndex:u,value:f});e[u][l]=v}else e[u][l]=!c||"lineAreaChart"!==c.type&&"barChart"!==c.type?f:Array.isArray(f)?f.join(", "):""}else e[u][l]="";return e},{}),l=new Set;t&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var s="";t&&l.size>0&&(s=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,r=a.get(e);return null!==(n=null==r?void 0:r.label)&&void 0!==n?n:""}).join("\t"));var c=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return t&&s?"".concat(s,"\n").concat(c):c}(m,_,o,p);navigator.clipboard.writeText(e),D(new Set(m)),setTimeout(function(){return D(new Set)},800)}},[m,_,o,p]),Y=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,r,t,i;return a(this,function(a){switch(a.label){case 0:if(!E)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,r,t,o,i){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=r.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,r){var l=c+n,f=d+r;if(t.length>l&&s.length>f){var v=t[l],p=s[f],h=H(v.rowId);if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=+e;isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var g=new Date(e);isNaN(g.getTime())||(w=g)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(w=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(S(v.row,p.accessor,w),i){var x="".concat(h,"-").concat(p.accessor),b=i.get(x);b&&b.updateContent(w)}null==o||o({accessor:p.accessor,newValue:w,row:v.row,rowIndex:l});var y="".concat(l,"-").concat(f,"-").concat(h);a.add(y)}else{var I="".concat(l,"-").concat(f,"-").concat(h);u.add(I)}}})}),{updatedCells:a,warningCells:u}}(e,E,_,o,u,l),t=n.warningCells,(r=n.updatedCells).size>0&&(D(r),setTimeout(function(){return D(new Set)},800)),t.size>0&&(L(t),setTimeout(function(){return L(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[E,_,o,u,l]),X=n.useCallback(function(){if(0!==m.size){var e=function(e,n,r,t,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(r.length>l&&u.length>s){var c=r[l],d=u[s],f=H(c.rowId);if(null==d?void 0:d.isEditable){var v;if(v="string"===d.type?"":"number"===d.type?null:"boolean"!==d.type&&("date"===d.type?null:"lineAreaChart"===d.type||"barChart"===d.type||Array.isArray(R(c.row,d.accessor))?[]:""),S(c.row,d.accessor,v),o){var p="".concat(f,"-").concat(d.accessor),h=o.get(p);h&&h.updateContent(v)}null==t||t({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,r=e.warningCells;n.size>0&&(D(n),setTimeout(function(){return D(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800))}},[m,_,o,u,l]),$=n.useCallback(function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),u=Math.max(e.colIndex,n.colIndex),l=t;i>=l;l++)for(var s=a;u>=s;s++)if(l>=0&&o.length>l){if(f&&0===s)continue;var d=H(o[l].rowId);r.add(K({colIndex:s,rowIndex:l,rowId:d}))}y(new Set),M(null),g(r),T(n),setTimeout(function(){return j(n,c,h)},0)},[o,c,f,h]),Q=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?_.length:_.length-1)>=e.colIndex){var n=K(e);y(new Set),M(null),g(new Set([n])),T(e),setTimeout(function(){return j(e,c,h)},0)}},[_.length,o.length,c,f,h]),Z=n.useCallback(function(e,n){void 0===n&&(n=!1),g(new Set),T(null),y(function(r){var t=new Set(n?r:[]);return e.forEach(function(e){return t.add(e)}),t}),e.length>0&&M(e[e.length-1])},[]);!function(e){var r=e.copyToClipboard,t=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 T=i?E+1:E,k=H(m[N].rowId);M.add("".concat(N,"-").concat(T,"-").concat(k))}return p(M),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void t();var P=m[c];if((P?H(P.rowId):null)!==S){var A=m.findIndex(function(e){return H(e.rowId)===S});if(-1===A)return;c=A}var D=function(e,n,r){var t=e,o=n;return"up"===r?t=0:"down"===r?t=m.length-1:"left"===r?o=i?1:0:"right"===r&&(o=i?u.length:u.length-1),{rowIndex:t,colIndex:o}};"ArrowUp"===e.key?(e.preventDefault(),n(e,c,R,D)):"ArrowDown"===e.key?(e.preventDefault(),o(e,c,R,D)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,c,R,D)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,c,R,D)):"Home"===e.key?(e.preventDefault(),b(e,c)):"End"===e.key?(e.preventDefault(),y(e,c)):"PageUp"===e.key?(e.preventDefault(),I(e,c,R)):"PageDown"===e.key?(e.preventDefault(),C(e,c,R)):"Escape"===e.key&&(p(new Set),h(new Set),v(null),w.current=null)}else r()}}},n=function(e,n,r,t){if(e.shiftKey){w.current||(w.current=a);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=t(n,r,"up").rowIndex),o>=0){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:r,rowId:i})}}else n>0&&(o=n-1,(e.ctrlKey||e.metaKey)&&(o=t(n,r,"up").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:r,rowId:i}),w.current=null)},o=function(e,n,r,t){if(e.shiftKey){w.current||(w.current=a);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=t(n,r,"down").rowIndex),m.length>o){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:r,rowId:i})}}else m.length-1>n&&(o=n+1,(e.ctrlKey||e.metaKey)&&(o=t(n,r,"down").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:r,rowId:i}),w.current=null)},g=function(e,n,r,t){if(e.shiftKey&&"ArrowLeft"===e.key){w.current||(w.current=a);var o=r-1;if(e.ctrlKey||e.metaKey)o=t(n,r,"left").colIndex;else if(i&&0===o)return;if(o>=0){var u=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:o,rowId:u})}}else if(r>0){if(o=r-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)o=t(n,r,"left").colIndex;else if(i&&0===o)return;0>o||(u=H(m[n].rowId),c({rowIndex:n,colIndex:o,rowId:u}),w.current=null)}},x=function(e,n,r,t){var o=i?u.length:u.length-1;if(e.shiftKey&&"ArrowRight"===e.key){w.current||(w.current=a);var l=r+1;if((e.ctrlKey||e.metaKey)&&(l=t(n,r,"right").colIndex),o>=l){var d=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:l,rowId:d})}}else o>r&&(l=r+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(l=t(n,r,"right").colIndex),l>o||(d=H(m[n].rowId),c({rowIndex:n,colIndex:l,rowId:d}),w.current=null))},b=function(e,n,r){if(e.shiftKey){w.current||(w.current=a);var t=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(t=0);var u=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:o,rowId:u})}else t=n,o=i?1:0,(e.ctrlKey||e.metaKey)&&(t=0),u=H(m[t].rowId),c({rowIndex:t,colIndex:o,rowId:u}),w.current=null},y=function(e,n,r){if(e.shiftKey){w.current||(w.current=a);var t=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(t=m.length-1);var l=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:o,rowId:l})}else t=n,o=i?u.length:u.length-1,(e.ctrlKey||e.metaKey)&&(t=m.length-1),l=H(m[t].rowId),c({rowIndex:t,colIndex:o,rowId:l}),w.current=null},I=function(e,n,r){var t=Math.max(0,n-10);if(e.shiftKey){w.current||(w.current=a);var o=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:r,rowId:o})}else o=H(m[t].rowId),c({rowIndex:t,colIndex:r,rowId:o}),w.current=null},C=function(e,n,r){var t=Math.min(m.length-1,n+10);if(e.shiftKey){w.current||(w.current=a);var o=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:r,rowId:o})}else o=H(m[t].rowId),c({rowIndex:t,colIndex:r,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,r,l,t,w,i])}({selectableCells:r,initialFocusedCell:E,tableRows:o,leafHeaders:_,selectSingleCell:Q,selectCellRange:$,selectedCells:m,setSelectedCells:g,setSelectedColumns:y,setLastSelectedColumnIndex:M,copyToClipboard:J,pasteFromClipboard:Y,deleteSelectedCells:X,startCell:G,enableRowSelection:f});var ee=n.useCallback(function(e,n){var r=new Set,t=new Map;o.forEach(function(e,n){var r=H(e.rowId);t.set(r,n)});for(var i=t.get(e.rowId+""),a=t.get(n.rowId+""),u=void 0!==i?i:e.rowIndex,l=void 0!==a?a:n.rowIndex,s=Math.min(u,l),c=Math.max(u,l),d=Math.min(e.colIndex,n.colIndex),v=Math.max(e.colIndex,n.colIndex),p=s;c>=p;p++)for(var h=d;v>=h;h++)if(p>=0&&o.length>p){if(f&&0===h)continue;var w=H(o[p].rowId);r.add(K({colIndex:h,rowIndex:p,rowId:w}))}g(r)},[o,f]),ne=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(!r)return null;var t=r.getBoundingClientRect(),o=Array.from(document.querySelectorAll(".st-cell[data-row-index][data-col-index]:not(.st-selection-cell)"));if(0===o.length)return null;var i=Math.max(t.left,Math.min(t.right,e)),a=Math.max(t.top,Math.min(t.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,r=n.getBoundingClientRect(),t=r.top+r.height/2,o=Math.sqrt(Math.pow(r.left+r.width/2-i,2)+Math.pow(t-a,2));l>o&&(l=o,u=n)}}),null!==u){var 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},[]),re=n.useCallback(function(e,n){var r=document.elementFromPoint(e,n);if(!r)return null;var t=r.closest(".st-cell");if(t instanceof HTMLElement){var o=parseInt(t.getAttribute("data-row-index")||"-1",10),i=parseInt(t.getAttribute("data-col-index")||"-1",10),a=t.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return ne(e,n)},[ne]),te=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(r){var t=r.getBoundingClientRect();t.top+50>n?r.scrollTop-=10*Math.min(3,1+Math.max(0,t.top-n)/100):n>t.bottom-50&&(r.scrollTop+=10*Math.min(3,1+Math.max(0,n-t.bottom)/100));var o=document.querySelector(".st-body-main");o&&(t.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,t.left-e)/100):e>t.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-t.right)/100)))}},[]),oe=n.useCallback(function(e){var n=e.colIndex,r=K({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),t=m.has(r),o=b.has(n);return t||o},[m,b]),ie=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId;if(B)return"";var i=[],a=o[r-1],u=a?H(a.rowId):null,l=o[r+1],s=l?H(l.rowId):null,c=null!==u?{colIndex:n,rowIndex:r-1,rowId:u}:null,d=null!==s?{colIndex:n,rowIndex:r+1,rowId:s}:null,f={colIndex:n-1,rowIndex:r,rowId:t},v={colIndex:n+1,rowIndex:r,rowId:t};return(!c||!oe(c)||b.has(n)&&0===r)&&i.push("st-selected-top-border"),(!d||!oe(d)||b.has(n)&&r===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,b]),ae=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),ue=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return A.has(n)},[A]),le=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return O.has(n)},[O]);return{getBorderClass:ie,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){q.current=!0,z(!0),G.current={rowIndex:t,colIndex:n,rowId:o},setTimeout(function(){y(new Set),M(null);var e=K({colIndex:n,rowIndex:t,rowId:o});g(new Set([e])),T({rowIndex:t,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,s=function(){if(q.current&&G.current){if(null!==i&&null!==a){te(i,a);var e=Date.now();if(e-l>=16){var n=re(i,a);n&&ee(G.current,n),l=e}}u=requestAnimationFrame(s)}else null!==u&&(cancelAnimationFrame(u),u=null)},c=function(e){q.current&&G.current&&(i=e.clientX,a=e.clientY)},d=function(){q.current=!1,z(!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){r&&q.current&&G.current&&ee(G.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ue,isWarningFlashing:le,isInitialFocusedCell:ae,isSelected:oe,lastSelectedColumnIndex:C,pasteFromClipboard:Y,selectColumns:Z,selectedCells:m,selectedColumns:b,setInitialFocusedCell:T,setSelectedCells:g,setSelectedColumns:y,deleteSelectedCells:X,columnsWithSelectedCells:V,rowsWithSelectedCells:U,startCell:G}}({selectableCells:sn,headers:tt,tableRows:ro,onCellEdit:We,cellRegistry:vo.current,collapsedHeaders:nt,rowHeight:Wn,enableRowSelection:te,copyHeadersToClipboard:D,customTheme:On}),wo=ho.getBorderClass,mo=ho.handleMouseDown,go=ho.handleMouseOver,xo=ho.isCopyFlashing,bo=ho.isInitialFocusedCell,yo=ho.isSelected,Io=ho.isWarningFlashing,Co=ho.selectColumns,Ro=ho.selectedCells,So=ho.selectedColumns,Mo=ho.setInitialFocusedCell,No=ho.setSelectedCells,Ho=ho.setSelectedColumns,Eo=ho.columnsWithSelectedCells,To=ho.rowsWithSelectedCells,ko=ho.startCell,Po=n.useCallback(function(e){io(e),setTimeout(function(){Vt({accessor:e})},0)},[io,Vt]),Ao=n.useCallback(function(e){Pt(e)},[Pt]);!function(e){var r=e.selectableColumns,t=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")||r&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(t.size>0&&i(new Set),o.size>0&&a(new Set),s&&(s.current=null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,t,o,i,a,u,l,s])}({selectableColumns:dn,selectedCells:Ro,selectedColumns:So,setSelectedCells:No,setSelectedColumns:Ho,activeHeaderDropdown:Jr,setActiveHeaderDropdown:Yr,startCell:ko}),function(e){var r=e.forceUpdate,t=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){r(),t.current&&o(t.current.offsetWidth-t.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[r,t,o])}({forceUpdate:lr,tableBodyContainerRef:ir,setScrollbarWidth:Pr}),function(e){var r=e.onGridReady;n.useEffect(function(){null==r||r()},[r])}({onGridReady:je}),function(e){var r=e.cellRegistryRef,t=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,g=e.paginatableRows,x=e.quickFilter,y=e.rowGrouping,I=e.rows,C=e.rowsPerPage,M=e.setCollapsedRows,N=e.setColumnEditorOpen,E=e.setCurrentPage,T=e.setExpandedDepths,k=e.setExpandedRows,P=e.setHeaders,A=e.sort,D=e.tableRef,F=e.totalRowCount,O=e.updateFilter,L=e.updateSort,W=e.visibleRows;n.useEffect(function(){D&&(D.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,o=e.newValue,i=null==I?void 0:I[t];if(i){var a=f.find(function(e){return e.absoluteRowIndex===t});if(a){var u=H(a.rowId),l=b({rowId:u,accessor:n}),s=r.current.get(l);s&&s.updateContent(o)}void 0!==R(i,n)&&S(i,n,o)}},setHeaderRename:function(e){var n=v.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return W},getAllRows:function(){return f},getHeaders:function(){return p},exportToCSV:function(e){!function(e,n,r,t){void 0===t&&(t=!0);var o=function(e,n,r){void 0===r&&(r=!0);var t=function(e){var n=[],r=function(e){for(var t=0,o=e;o.length>t;t++){var i=o[t];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),r(i.children)):n.push(i))}};return r(e),n}(n),o=t.map(function(e){return Un(e.label)}).join(","),i=e.map(function(e,n){var r=e.row;return t.map(function(e,t){var o=R(r,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o,formattedValue:i});return Un(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o}),Un(i)):Un(o)}).join(",")});return(r?u([o],i,!0):i).join("\n")}(e,n,t);!function(e,n){void 0===n&&(n="table-export.csv");var r=new Blob([e],{type:"text/csv;charset=utf-8;"}),t=document.createElement("a"),o=URL.createObjectURL(r);t.setAttribute("href",o),t.setAttribute("download",n),t.style.visibility="hidden",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(o)}(o,r)}(f,p,(void 0===e?{}:e).filename,h)},getSortState:function(){return A},applySortState:_n(L),getFilterState:function(){return d},applyFilter:_n(O),clearFilter:_n(o),clearAllFilters:_n(t),getCurrentPage:function(){return l},getTotalPages:function(){return Math.ceil((null!=F?F:g.length)/C)},setPage:function(e){return i(void 0,void 0,void 0,function(){var n;return a(this,function(r){switch(r.label){case 0:return n=Math.ceil((null!=F?F:g.length)/C),1>e||e>n?[3,2]:(E(e),m?[4,m(e)]:[3,2]);case 1:r.sent(),r.label=2;case 2:return[2]}})})},expandAll:function(){var e=Array.from({length:(null==y?void 0:y.length)||0},function(e,n){return n});T(new Set(e)),k(new Map),M(new Map)},collapseAll:function(){T(new Set),k(new Map),M(new Map)},expandDepth:function(e){T(function(n){for(var r=new Set(n),t=0;e>=t;t++)r.add(t);return r}),k(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r}),M(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r})},collapseDepth:function(e){T(function(n){var r=new Set(n);return r.delete(e),r}),k(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r}),M(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r})},toggleDepth:function(e){T(function(n){var r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r}),k(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r}),M(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r})},setExpandedDepths:function(e){T(e)},getExpandedDepths:function(){return c},getGroupingProperty:function(e){return null==y?void 0:y[e]},getGroupingDepth:function(e){var n;return null!==(n=null==y?void 0:y.indexOf(e))&&void 0!==n?n:-1},toggleColumnEditor:function(e){s&&N(void 0!==e?e:function(e){return!e})},applyColumnVisibility:_n(function(e){var n=function(r){return r.map(function(r){var t=r.accessor+"",o=t in e;return exports.__assign(exports.__assign({},r),{hide:o?!e[t]:r.hide,children:r.children?n(r.children):r.children})})};P(function(e){return n(e)}),w&&w(e)}),setQuickFilter:function(e){(null==x?void 0:x.onChange)&&x.onChange(e)}})},[r,t,o,l,s,c,d,f,v,p,h,w,m,g,x,y,e.rowIndexMap,I,C,e.serverSidePagination,M,N,E,T,k,P,e.setRows,e.shouldPaginate,A,D,F,O,L,W])}({cellRegistryRef:vo,clearAllFilters:Bt,clearFilter:Wt,currentPage:Or,editColumns:W,expandedDepths:dt,filters:Ot,flattenedRows:Ut,headerRegistryRef:po,headers:tt,includeHeadersInCSVExport:He,onColumnVisibilityChange:qe,onPageChange:Je,paginatableRows:Jt,quickFilter:Ze,rowGrouping:nn,rowIndexMap:xr,rows:Dr,rowsPerPage:un,serverSidePagination:vn,setCollapsedRows:gt,setColumnEditorOpen:Qr,setCurrentPage:Lr,setExpandedDepths:ft,setExpandedRows:ht,setHeaders:Pt,setRows:pr,shouldPaginate:hn,sort:Gt,tableRef:bn,totalRowCount:Cn,updateFilter:Lt,updateSort:Vt,visibleRows:to}),function(e){var r=e.filters,t=e.onFilterChange;n.useEffect(function(){null==t||t(r)},[r,t])}({filters:Ot,onFilterChange:Ve}),function(e){var r=e.sort,t=e.onSortChange,o=Ne(r);n.useEffect(function(){!r||(null==o?void 0:o.key.accessor)===r.key.accessor&&(null==o?void 0:o.direction)===r.direction?!r&&o&&(null==t||t(null)):null==t||t(r)},[r,o,t])}({sort:Gt,onSortChange:$e});var Do=n.useCallback(function(e){oo(e),setTimeout(function(){Lt(e)},0)},[oo,Lt]),Fo=!wr&&0===ro.length;return e.jsx(_,exports.__assign({value:{activeHeaderDropdown:Jr,allowAnimations:o,areAllRowsSelected:Cr,autoExpandColumns:c,canExpandRowGroup:d,cellRegistry:vo.current,cellUpdateFlash:v,clearSelection:Er,collapsedHeaders:nt,columnBorders:m,columnReordering:C,columnResizing:T,containerWidth:Ct,columnsWithSelectedCells:Eo,copyHeadersToClipboard:D,draggedHeaderRef:Xn,editColumns:W,emptyStateRenderer:V,enableHeaderEditing:J,enableRowSelection:te,errorStateRenderer:ue,expandedDepths:dt,filters:Ot,icons:Fn,forceUpdate:lr,getBorderClass:wo,handleApplyFilter:Do,handleClearAllFilters:Bt,handleClearFilter:Wt,handleMouseDown:mo,handleMouseOver:go,handleRowSelect:Mr,handleSelectAll:Nr,handleToggleRow:Hr,headerContainerRef:ur,headerDropdown:ge,headerHeight:Bn,headerRegistry:po.current,headers:tt,heightOffsets:co,hoveredHeaderRef:$n,includeHeadersInCSVExport:He,isAnimating:ao,isCopyFlashing:xo,isInitialFocusedCell:bo,isLoading:wr,isResizing:Gr,isRowSelected:Ir,isScrolling:Kr,isSelected:yo,isWarningFlashing:Io,loadingStateRenderer:De,mainBodyRef:rr,maxHeaderDepth:St,onCellClick:Le,onCellEdit:We,onColumnOrderChange:Be,onColumnSelect:ze,onColumnVisibilityChange:qe,onColumnWidthChange:Ge,onHeaderEdit:Ke,onLoadMore:Ue,onRowGroupExpand:Ye,onSort:Po,onTableHeaderDragEnd:Ao,pinnedLeftRef:tr,pinnedRightRef:or,rowButtons:en,rowGrouping:nn,rowHeight:Wn,rowStateMap:cr,rows:vr,rowsWithSelectedCells:To,scrollbarWidth:kr,selectColumns:Co,selectableColumns:dn,selectedColumns:So,selectedRowCount:Rr,selectedRows:br,selectedRowsData:Sr,setActiveHeaderDropdown:Yr,setCollapsedHeaders:rt,setHeaders:Pt,setInitialFocusedCell:Mo,setIsResizing:Vr,setIsScrolling:Ur,setRowStateMap:dr,setSelectedCells:No,setSelectedColumns:Ho,setSelectedRows:yr,setExpandedDepths:ft,setExpandedRows:ht,setCollapsedRows:gt,shouldPaginate:hn,tableBodyContainerRef:ir,tableEmptyStateRenderer:xn,tableRows:ro,theme:In,customTheme:On,expandedRows:pt,collapsedRows:mt,useHoverRowBackground:Sn,useOddColumnBackground:Nn,useOddEvenRowBackground:kn}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(In," ").concat(null!=p?p:""," ").concat(m?"st-column-borders":""),role:"grid",style:Fe?{maxHeight:Fe,height:void 0===eo?"auto":Fe}:be?{height:be}:{}},{children:[e.jsx(Gn,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(En,{calculatedHeaderHeight:Rt,hideHeader:Re,pinnedLeftWidth:Ht,pinnedRightWidth:Et,setScrollTop:at,setScrollDirection:st,shouldShowEmptyState:Fo,sort:Gt,tableRows:ro,rowsToRender:to,stickyParents:uo,regularRows:lo,partiallyVisibleRows:so,heightMap:fo}),e.jsx(qn,{columnEditorText:Ln.text,editColumns:W,headers:Br,open:$r,searchEnabled:Ln.searchEnabled,searchPlaceholder:Ln.searchPlaceholder,searchFunction:Ln.searchFunction,setOpen:Qr})]})),!Fo&&e.jsx(Tn,{mainBodyRef:rr,mainBodyWidth:Nt,pinnedLeftWidth:Ht,pinnedRightWidth:Et,pinnedLeftContentWidth:Tt,pinnedRightContentWidth:kt,tableBodyContainerRef:ir}),!Fo&&e.jsx(Y,{currentPage:Or,footerRenderer:we,hideFooter:Ie,onPageChange:Lr,onNextPage:_e,onUserPageChange:Je,rowsPerPage:un,shouldPaginate:hn,totalPages:Math.ceil((null!=Cn?Cn:Jt.length)/un),totalRows:null!=Cn?Cn:Jt.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:bt}))]}))}))},sr=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,s=n.fillOpacity,c=void 0===s?.25:s,d=n.strokeWidth,f=void 0===d?1.5:d,v=n.className,p=void 0===v?"":v,h=n.min,w=n.max;if(!r||0===r.length)return null;var m=void 0!==h?h:Math.min.apply(Math,r),g=(void 0!==w?w:Math.max.apply(Math,r))-m||1,x=a,b=r.map(function(e,n){return{x:n/(r.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),y="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(p),style:{display:"block"},shapeRendering:"geometricPrecision"},{children:[e.jsx("path",{d:y,fill:l||"var(--st-chart-fill-color)",fillOpacity:c,stroke:"none"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round"})]}))},cr=Object.freeze({__proto__:null,default:sr}),dr=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,s=void 0===l?2:l,c=n.className,d=void 0===c?"":c,f=n.min,v=n.max;if(!r||0===r.length)return null;var p=void 0!==f?f:Math.min.apply(Math,r),h=void 0!==v?v:Math.max.apply(Math,r),w=h-p||1,m=a,g=(100-s*(r.length-1))/r.length,x=0>p,b=x?m*(h/w):m;return e.jsx("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(m),preserveAspectRatio:"none",className:"st-bar-chart ".concat(d),style:{display:"block"},shapeRendering:"crispEdges"},{children:r.map(function(n,r){var t=r*(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:t,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:.5},r)})}))},fr=Object.freeze({__proto__:null,default:dr});exports.ANIMATION_CONFIGS=Yn,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=X,exports.AngleRightIcon=$,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=Q,exports.BarChart=dr,exports.CheckIcon=Z,exports.DescIcon=ee,exports.DragIcon=ne,exports.FilterIcon=re,exports.LineAreaChart=sr,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=te,exports.SimpleTable=ur,exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,r=e.options;return i(void 0,void 0,void 0,function(){var e,t,o,i,u,l,s,c,d,f,v,p,h,w,m,g;return a(this,function(a){return e=r.startY,t=r.endY,o=r.finalY,u=void 0===(i=r.duration)?300:i,s=void 0===(l=r.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(c=r.delay)?0:c,f=r.onComplete,p=void 0===(v=r.respectReducedMotion)||v,Jn()&&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=t-w,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.style.transition="transform ".concat(u,"ms ").concat(s),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"px, 0)");var r=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",r),f&&f(),e()};n.addEventListener("transitionend",r),setTimeout(r,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,r=e.finalConfig,t=e.fromBounds,o=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){return{x:("x"in e?e.x:e.left)-n.x,y:("y"in e?e.y:e.top)-n.y}}(t,o),0===e.x&&0===e.y||Jn()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=Jn()?exports.__assign(exports.__assign({},Yn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},Yn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},Yn.ROW_REORDER),u),Xn(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,$n(n,i,r)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=Ne,exports.useTableContext=J;
|
|
2
|
+
//# sourceMappingURL=index-7da7745f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-7da7745f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import SimpleTable from "./components/simple-table/SimpleTable";
|
|
2
2
|
import LineAreaChart from "./components/charts/LineAreaChart";
|
|
3
3
|
import BarChart from "./components/charts/BarChart";
|
|
4
|
-
import DefaultEmptyState from "./components/empty-state/DefaultEmptyState";
|
|
5
4
|
import BoundingBox from "./types/BoundingBox";
|
|
6
5
|
import Cell from "./types/Cell";
|
|
7
6
|
import CellChangeProps from "./types/CellChangeProps";
|
|
@@ -33,11 +32,10 @@ import HeaderDropdownProps, { HeaderDropdown } from "./types/HeaderDropdownProps
|
|
|
33
32
|
import { RowButtonProps } from "./types/RowButton";
|
|
34
33
|
import FooterRendererProps from "./types/FooterRendererProps";
|
|
35
34
|
import { LoadingStateRenderer, ErrorStateRenderer, EmptyStateRenderer, LoadingStateRendererProps, ErrorStateRendererProps, EmptyStateRendererProps } from "./types/RowStateRendererProps";
|
|
36
|
-
import { CustomTheme
|
|
37
|
-
import { ColumnEditorConfig, ColumnEditorSearchFunction
|
|
35
|
+
import { CustomTheme } from "./types/CustomTheme";
|
|
36
|
+
import { ColumnEditorConfig, ColumnEditorSearchFunction } from "./types/ColumnEditorConfig";
|
|
38
37
|
import { IconsConfig } from "./types/IconsConfig";
|
|
39
38
|
import { GetRowId, GetRowIdParams } from "./types/GetRowId";
|
|
40
|
-
|
|
41
|
-
export { SimpleTable, LineAreaChart, BarChart, DefaultEmptyState, DEFAULT_CUSTOM_THEME, DEFAULT_COLUMN_EDITOR_CONFIG, rowIdToString, };
|
|
39
|
+
export { SimpleTable, LineAreaChart, BarChart };
|
|
42
40
|
export * from "./icons";
|
|
43
41
|
export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SortColumn, TableCellProps, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-7da7745f.js");require("react/jsx-runtime"),require("react"),exports.AngleDownIcon=e.AngleDownIcon,exports.AngleLeftIcon=e.AngleLeftIcon,exports.AngleRightIcon=e.AngleRightIcon,exports.AngleUpIcon=e.AngleUpIcon,exports.AscIcon=e.AscIcon,exports.BarChart=e.BarChart,exports.CheckIcon=e.CheckIcon,exports.DescIcon=e.DescIcon,exports.DragIcon=e.DragIcon,exports.FilterIcon=e.FilterIcon,exports.LineAreaChart=e.LineAreaChart,exports.SelectIcon=e.SelectIcon,exports.SimpleTable=e.SimpleTable;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|