react-fluid-table
Version:
A React table inspired by @tanstack/react-virtual
4 lines (3 loc) • 38.9 kB
JavaScript
"use strict";var e=require("react"),t=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(e);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,l,"next",e)}function l(e){o(s,r,i,a,l,"throw",e)}a(void 0)}))}}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,u=Object.create(l.prototype);return f(u,"_invoke",function(n,r,i){var o,a,l,u=0,c=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&u&&!i&&t<c.length;t++){var i,o=c[t],f=d.p,m=o[2];n>3?(i=m===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<m&&(i=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,c,m){if(u>1)throw TypeError("Generator is already running");for(h&&1===c&&f(c,m),a=c,l=m;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(u=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{u=1}}return{value:t,done:h}}}(n,i,o),!0),u}var s={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(f(t={},r,(function(){return this})),t),h=u.prototype=a.prototype=Object.create(c);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,f(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=u,f(h,"constructor",u),f(u,"constructor",l),l.displayName="GeneratorFunction",f(u,i,"GeneratorFunction"),f(h),f(h,i,"Generator"),f(h,r,(function(){return this})),f(h,"toString",(function(){return"[object Generator]"})),(d=function(){return{w:o,m:m}})()}function f(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}f=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function o(t,n){f(e,t,(function(e){return this._invoke(t,n,e)}))}o("next",0),o("throw",1),o("return",2)}},f(e,t,n,r)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v,g,p,b,y,w,x,E,O,S,C,M,z,T,k,j,I,R,H,N,W,_,D,P,A,F,V,L,B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function K(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $(){if(g)return v;return g=1,v=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function G(){if(w)return y;w=1;var e=function(){if(b)return p;b=1;var e="object"==typeof B&&B&&B.Object===Object&&B;return p=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return y=n}function q(){if(M)return C;M=1;var e=function(){if(S)return O;S=1;var e=/\s/;return O=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}}(),t=/^\s+/;return C=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n}}function U(){if(T)return z;T=1;var e=G().Symbol;return z=e}function Y(){if(N)return H;N=1;var e=U(),t=function(){if(j)return k;j=1;var e=U(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;return k=function(e){var t=n.call(e,i),o=e[i];try{e[i]=void 0;var s=!0}catch(e){}var a=r.call(e);return s&&(t?e[i]=o:delete e[i]),a}}(),n=function(){if(R)return I;R=1;var e=Object.prototype.toString;return I=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return H=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function J(){if(P)return D;P=1;var e=Y(),t=_?W:(_=1,W=function(e){return null!=e&&"object"==typeof e});return D=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}function Q(){if(L)return V;L=1;var e=$(),t=function(){if(E)return x;E=1;var e=G();return x=function(){return e.Date.now()}}(),n=function(){if(F)return A;F=1;var e=q(),t=$(),n=J(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;return A=function(a){if("number"==typeof a)return a;if(n(a))return NaN;if(t(a)){var l="function"==typeof a.valueOf?a.valueOf():a;a=t(l)?l+"":l}if("string"!=typeof a)return 0===a?a:+a;a=e(a);var u=i.test(a);return u||o.test(a)?s(a.slice(2),u?2:8):r.test(a)?NaN:+a}}(),r=Math.max,i=Math.min;return V=function(o,s,a){var l,u,c,h,d,f,m=0,v=!1,g=!1,p=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function b(e){var t=l,n=u;return l=u=void 0,m=e,h=o.apply(n,t)}function y(e){var t=e-f;return void 0===f||t>=s||t<0||g&&e-m>=c}function w(){var e=t();if(y(e))return x(e);d=setTimeout(w,function(e){var t=s-(e-f);return g?i(t,c-(e-m)):t}(e))}function x(e){return d=void 0,p&&l?b(e):(l=u=void 0,h)}function E(){var e=t(),n=y(e);if(l=arguments,u=this,f=e,n){if(void 0===d)return function(e){return m=e,d=setTimeout(w,s),v?b(e):h}(f);if(g)return clearTimeout(d),d=setTimeout(w,s),b(f)}return void 0===d&&(d=setTimeout(w,s)),h}return s=n(s)||0,e(a)&&(v=!!a.leading,c=(g="maxWait"in a)?r(n(a.maxWait)||0,s):c,p="trailing"in a?!!a.trailing:p),E.cancel=function(){void 0!==d&&clearTimeout(d),m=0,l=f=u=d=void 0},E.flush=function(){return void 0===d?h:x(t())},E},V}var X,Z,ee=K(Q());var te=function(){if(Z)return X;Z=1;var e=Q(),t=$();return X=function(n,r,i){var o=!0,s=!0;if("function"!=typeof n)throw new TypeError("Expected a function");return t(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),e(n,r,{leading:o,maxWait:r,trailing:s})}}(),ne=K(te);function re({skipOnMount:t=!1,refreshMode:n,refreshRate:i=1e3,refreshOptions:o,handleWidth:s=!0,handleHeight:a=!0,targetRef:l,observerOptions:u,onResize:c}={}){const h=e.useRef(t),d=(e=>{const t=r.useRef(e);return r.useEffect((()=>{t.current=e})),r.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])})(c),[f,m]=e.useState({width:void 0,height:void 0}),{refProxy:v,refElement:g}=(e=>{const[t,n]=r.useState((null==e?void 0:e.current)||null);return e&&setTimeout((()=>{e.current!==t&&n(e.current)}),0),{refProxy:r.useMemo((()=>new Proxy((e=>{e!==t&&n(e)}),{get:(e,n)=>"current"===n?t:e[n],set:(e,t,r)=>("current"===t?n(r):e[t]=r,!0)})),[t]),refElement:t,setRefElement:n}})(l),{box:p}=u||{},b=e.useCallback((e=>{if(!s&&!a)return;if(h.current)return void(h.current=!1);e.forEach((e=>{const t=((e,t)=>{var n,r;const i=null===(n=e.borderBoxSize)||void 0===n?void 0:n[0],o=null===(r=e.contentBoxSize)||void 0===r?void 0:r[0];return"border-box"===t&&i?{width:i.inlineSize,height:i.blockSize}:"content-box"===t&&o?{width:o.inlineSize,height:o.blockSize}:{width:e.contentRect.width,height:e.contentRect.height}})(e,p);m((n=>((e,t)=>s&&e.width!==t.width||a&&e.height!==t.height)(n,t)?(null==d||d({width:t.width,height:t.height,entry:e}),t):n))}))}),[s,a,h,p]),y=e.useCallback(((e,t,n,r)=>{switch(t){case"debounce":return ee(e,n,r);case"throttle":return ne(e,n,r);default:return e}})(b,n,i,o),[b,n,i,o]);return e.useEffect((()=>{let e;if(g)try{e=new window.ResizeObserver(y),e.observe(g,u)}catch(e){console.warn("ResizeObserver not supported or failed to initialize:",e)}else(f.width||f.height)&&(null==d||d({width:null,height:null,entry:null}),m({width:void 0,height:void 0}));return()=>{var t,n,r;null===(t=null==e?void 0:e.disconnect)||void 0===t||t.call(e),null===(r=(n=y).cancel)||void 0===r||r.call(n)}}),[y,g]),Object.assign({ref:v},f)}var ie=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.flat().filter((function(e){return!!e})).map((function(e){return e.toString().trim()})).join(" ")},oe=function(e){return document.querySelector(e)},se=function(e,t,n){var r;return t>0?t:null!==(r=null==e?void 0:e.offsetHeight)&&void 0!==r?r:n},ae=function(e,t,n,r,i){var o=Math.max(t,1),s=n,a=Math.max(e-s,0),l=Math.max(r,Math.floor(a/o));return i.map((function(t){if(t.width)return t.width;if(t.maxWidth&&l-t.maxWidth>0)return o=Math.max(o-1,1),s+=t.maxWidth,a=Math.max(e-s,0),l=Math.max(r,Math.floor(a/o)),t.maxWidth;if(t.minWidth&&t.minWidth-l>0)return o=Math.max(o-1,1),s+=t.minWidth,a=Math.max(e-s,0),l=Math.max(r,Math.floor(a/o)),t.minWidth;return l}))},le=function(e){return e.reduce((function(e,t){return{fixedWidth:e.fixedWidth+(t.width||0),remainingCols:e.remainingCols+(void 0===t.width?1:0)}}),{fixedWidth:0,remainingCols:0})},ue=function(e,t,n,r){var i=r.estimatedRow,o=r.estimatedHeader,s=r.estimatedFooter,a=r.maxHeight,l=function(e){return oe("[data-header-key='".concat(e,"-header']"))}(e),u=se(l,o,37),c=n?se(function(e){return oe("[data-footer-key='".concat(e,"-footer']"))}(e),s,37):0,h=null==l?void 0:l.parentElement,d=h?h.offsetHeight-h.clientHeight:0,f=i||37,m=u+(a>0?t:Math.min(t||10,10)+1)*f+2*d+c;return a>0?Math.min(a,m):m},ce=function(t){var n=t.uuid,r=t.hasFooter,i=t.numRows,o=t.dimensions,s=t.children,a=re(),l=a.ref,u=a.width,c=void 0===u?0:u,h=a.height,d=void 0===h?0:h,f=o.rowHeight,m=o.tableWidth,v=o.tableHeight,g=o.footerHeight,p=o.headerHeight,b=o.minTableHeight,y=o.maxTableHeight,w=o.estimatedRowHeight,x=e.useMemo((function(){if(v>0)return v;var e=ue(n,i,r,{estimatedRow:f||w,estimatedHeader:p||37,estimatedFooter:g||37,maxHeight:y});return b>0||y>0?Math.min(Math.max(b,e),y):d||e}),[n,i,r,f,w,p,g,d,v,b,y]),E=m>0?m:c;return e.createElement("div",{ref:l,className:"rft-sizer"},x&&E?s({height:x,width:E}):null)};function he(e,t,n){let r,i=n.initialDeps??[];function o(){var o,s,a,l;let u;n.key&&(null==(o=n.debug)?void 0:o.call(n))&&(u=Date.now());const c=e();if(!(c.length!==i.length||c.some(((e,t)=>i[t]!==e))))return r;let h;if(i=c,n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(h=Date.now()),r=t(...c),n.key&&(null==(a=n.debug)?void 0:a.call(n))){const e=Math.round(100*(Date.now()-u))/100,t=Math.round(100*(Date.now()-h))/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(l=null==n?void 0:n.onChange)||l.call(n,r),r}return o.updateDeps=e=>{i=e},o}function de(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const fe=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,i)),n)}},me=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ve=e=>e,ge=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},pe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(me(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver((t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void i({width:t.inlineSize,height:t.blockSize})}i(me(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()}));return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},be={passive:!0},ye="undefined"==typeof window||"onscrollend"in window,we=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&ye?()=>{}:fe(r,(()=>{t(i,!1)}),e.options.isScrollingResetDelay),s=r=>()=>{const{horizontal:s,isRtl:a}=e.options;i=s?n.scrollLeft*(a?-1:1):n.scrollTop,o(),t(i,r)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,be);const u=e.options.useScrollendEvent&&ye;return u&&n.addEventListener("scrollend",l,be),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",l)}},xe=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Ee=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const s=e+t;null==(o=null==(i=r.scrollElement)?void 0:i.scrollTo)||o.call(i,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Oe{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()}))})):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ve,rangeExtractor:ge,onChange:()=>{},measureElement:xe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=he((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"production"!==process.env.NODE_ENV&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(n.has(t.lane))continue;const o=r.get(t.lane);if(null==o||t.end>o.end?r.set(t.lane,t):t.end<o.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=he((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i})),{key:!1}),this.getMeasurements=he((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const a=this.measurementsCache.slice(0,s);for(let i=s;i<e;i++){const e=r(i),s=1===this.options.lanes?a[i-1]:this.getFurthestMeasurement(a,i),l=s?s.end+this.options.gap:t+n,u=o.get(e),c="number"==typeof u?u:this.options.estimateSize(i),h=l+c,d=s?s.lane:i%this.options.lanes;a[i]={index:i,start:l,size:c,end:h,key:e,lane:d}}return this.measurementsCache=a,a}),{key:"production"!==process.env.NODE_ENV&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=he((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes]),((e,t,n,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const i=e.length-1,o=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let s=Se(0,i,o,n),a=s;if(1===r)for(;a<i&&e[a].end<n+t;)a++;else if(r>1){const o=Array(r).fill(0);for(;a<i&&o.some((e=>e<n+t));){const t=e[a];o[t.lane]=t.end,a++}const l=Array(r).fill(n+t);for(;s>=0&&l.some((e=>e>=n));){const t=e[s];l[t.lane]=t.start,s--}s=Math.max(0,s-s%r),a=Math.min(i,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null),{key:"production"!==process.env.NODE_ENV&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=he((()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,n,r,i)=>null===r||null===i?[]:e({startIndex:r,endIndex:i,overscan:t,count:n})),{key:"production"!==process.env.NODE_ENV&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const i=r.key,o=this.elementsCache.get(i);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):"backward"===this.scrollDirection&&n.start<this.getScrollOffset()+this.scrollAdjustments)&&("production"!==process.env.NODE_ENV&&this.options.debug&&console.info("correction",r),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=he((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];n.push(i)}return n}),{key:"production"!==process.env.NODE_ENV&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return de(t[Se(0,t.length-1,(e=>de(t[e]).start),e)])},this.getOffsetForAlignment=(e,t,n=0)=>{const r=this.getSize(),i=this.getScrollOffset();"auto"===t&&(t=e>=i+r?"end":"start"),"center"===t?e+=(n-r)/2:"end"===t&&(e-=r);const o=this.getTotalSize()-r;return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),i=this.getScrollOffset();if("auto"===t)if(n.end>=i+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=i+this.options.scrollPaddingStart))return[i,t];t="start"}const o="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(e,t);if(!r)return;const[i,o]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const i=this.getOffsetForIndex(e,o);if(!i)return;const[s]=i,a=this.getScrollOffset();t=s,r=a,Math.abs(t-r)<=1||this.scrollToIndex(e,{align:o,behavior:n})}else this.scrollToIndex(e,{align:o,behavior:n});var t,r})))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some((e=>null===e));){const n=t[r];null===e[n.lane]&&(e[n.lane]=n.end),r--}n=Math.max(...e.filter((e=>null!==e)))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const Se=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else{if(!(o>r))return i;t=i-1}}return e>0?e-1:0};const Ce="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function Me(e){return function(e){const n=r.useReducer((()=>({})),{})[1],i={...e,onChange:(r,i)=>{var o;i?t.flushSync(n):n(),null==(o=e.onChange)||o.call(e,r,i)}},[o]=r.useState((()=>new Oe(i)));return o.setOptions(i),Ce((()=>o._didMount()),[]),Ce((()=>o._willUpdate())),o}({observeElementRect:pe,observeElementOffset:we,scrollToFn:Ee,...e})}var ze=["prevWidth"];function Te(t){var n=t.prevWidth,r=h(t,ze),i=r.width,o=r.column,s={width:i||void 0,minWidth:i||void 0,padding:o.footer?void 0:0,left:o.frozen?n:void 0};return e.createElement("div",{className:ie("cell",o.frozen&&"frozen"),style:s},!!o.footer&&e.createElement(o.footer,r))}var ke=e.memo(Te);function je(t,n){var r=t.uuid,i=t.rows,o=t.columns,s=t.pixelWidths,a=t.sticky,l=t.className,u=t.style,h=void 0===u?{}:u,d=t.component,f=!!d||o.some((function(e){return!!e.footer})),m=c({minWidth:a?void 0:s.reduce((function(e,t){return e+t}),0)},h);if(f||(m.width=0,m.minWidth=0),!d){var v=o.some((function(e){return!!e.footer}));return e.createElement("div",{ref:n,style:c({border:v?void 0:"none"},m),"data-footer-key":"".concat(r,"-footer"),className:ie("rft-footer",a&&"sticky",l)},e.createElement("div",{className:"rft-row"},o.map((function(t,n){return e.createElement(ke,{key:t.key,column:t,rows:i,width:s[n],prevWidth:t.frozen?s.slice(0,n).reduce((function(e,t){return e+t}),0):0})}))))}return e.createElement("div",{ref:n,style:m,"data-footer-key":"".concat(r,"-footer"),className:ie("rft-footer",a&&"sticky",l)},e.createElement(d,{rows:i,widths:s}))}ke.displayName="FooterCell";var Ie=e.forwardRef(je);function Re(t){var n=t.column,r=t.width,i=t.prevWidth,o=t.sortedCol,s=t.sortedDir,a=t.onHeaderClick,l=n.key,u=n.sortable,h=n.frozen,d={cursor:u?"pointer":void 0,width:r||void 0,minWidth:r||void 0,left:h?i:void 0};if(!n.header||"string"==typeof n.header){var f=n.headerStyle,m=void 0===f?{}:f,v=n.headerClassname;return e.createElement("div",{style:c(c({},m),d),onClick:function(){return a(n)},className:ie("rft-header-cell",h&&"frozen",v)},n.header?e.createElement("div",{className:"rft-header-cell-text"},n.header):null,l!==o?null:e.createElement("div",{className:ie("rft-header-cell-arrow",null==s?void 0:s.toLowerCase())}))}var g=l===o&&s||null,p=h?{position:"sticky",zIndex:1}:{};return e.createElement(n.header,{onClick:function(){return a(n)},sortDirection:g,style:c(c({},d),p)})}Ie.displayName="Footer";var He=e.memo(Re);function Ne(t,n){var r=t.uuid,i=t.columns,o=t.pixelWidths,s=t.className,a=t.style,l=t.sortColumn,u=t.sortDirection,c=t.onSort,h=m(e.useState(l),2),d=h[0],f=h[1],v=m(e.useState(u),2),g=v[0],p=v[1],b=e.useCallback((function(e){if(e.sortable){var t="ASC";d===e.key&&(t=g?"ASC"===g?"DESC":null:"ASC"),null==c||c(e.key,t),f(e.key),p(t)}}),[d,g]);return e.useEffect((function(){f(l),p(u)}),[l,u]),e.createElement("div",{ref:n,style:a,"data-header-key":"".concat(r,"-header"),className:ie("rft-header",s)},e.createElement("div",{className:"rft-header-row"},i.map((function(t,n){return e.createElement(He,{key:t.key,width:o[n],sortedCol:d,sortedDir:g,column:t,onHeaderClick:b,prevWidth:t.frozen?o.slice(0,n).reduce((function(e,t){return e+t}),0):0})}))))}He.displayName="HeaderCell";var We,_e=e.forwardRef(Ne);function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(null,arguments)}_e.displayName="Header";var Pe,Ae=function(e){return r.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"minus-circle_svg__svg-inline--fa minus-circle_svg__fa-minus-circle minus-circle_svg__fa-w-16","data-icon":"minus-circle","data-prefix":"fas",viewBox:"0 0 512 512"},e),We||(We=r.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8M124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12z"})))};function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fe.apply(null,arguments)}var Ve=function(e){return r.createElement("svg",Fe({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"plus-circle_svg__svg-inline--fa plus-circle_svg__fa-plus-circle plus-circle_svg__fa-w-16","data-icon":"plus-circle","data-prefix":"fas",viewBox:"0 0 512 512"},e),Pe||(Pe=r.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8m144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12z"})))};function Le(t){var n=t.row,r=t.index,i=t.width,o=t.column,s=t.isExpanded,a=t.prevWidth,l=t.onExpanderClick,u=o.frozen,h=o.contentClassname,d=o.contentStyle,f={width:i||void 0,minWidth:i||void 0,left:u?a:void 0};if(o.expander){var m="function"==typeof h?h({row:n,index:r}):h;if("boolean"==typeof o.expander){var v=s?Ae:Ve,g=("function"==typeof d?d({row:n,index:r}):d)||{};return e.createElement("div",{className:ie("rft-cell",u&&"frozen",m),style:c(c({},g),f)},e.createElement(v,{className:"rft-expander",onClick:l}))}var p=u?{position:"sticky",zIndex:2}:{};return e.createElement(o.expander,{row:n,index:r,isExpanded:s,onClick:l,style:c(c({},f),p)})}if(!o.cell){var b="function"==typeof h?h({row:n,index:r}):h,y=("function"==typeof d?d({row:n,index:r}):d)||{},w=n[o.key]||null;return o.content&&(w="string"==typeof o.content||"number"==typeof o.content?o.content:e.createElement(o.content,{row:n,index:r})),e.createElement("div",{className:ie("rft-cell",u&&"frozen",b),style:c(c({},y),f)},w)}var x=o.frozen?{position:"sticky",zIndex:2}:{};return e.createElement(o.cell,{row:n,index:r,style:c(c({},f),x)})}var Be=e.memo(Le);function Ke(t,n){var r=t.uuid,i=t.index,o=t.offset,s=t.row,a=t.rowKey,l=t.columns,u=t.pixelWidths,h=t.isExpanded,d=t.onExpand,f=t.onRowClick,m=t.className,v=t.style,g=void 0===v?{}:v,p=t.subComponent;return e.createElement("div",{ref:n,"data-index":i,"data-row-key":"".concat(r,"-").concat(a),className:ie("rft-row",m),style:c({transform:"translateY(".concat(o,"px)")},g),onClick:function(e){return null==f?void 0:f({row:s,index:i,event:e})}},l.map((function(t,n){return e.createElement(Be,{key:"".concat(r,"-").concat(a,"-").concat(n),row:s,column:t,index:i,width:u[n],isExpanded:h,onExpanderClick:function(e){return d(s,i,a,e)},prevWidth:t.frozen?u.slice(0,n).reduce((function(e,t){return e+t}),0):0})})),!!p&&e.createElement("div",{className:ie("rft-sub-component",!h&&"rft-hidden")},e.createElement(p,{row:s,index:i,isExpanded:h})))}Be.displayName="TableCell";var $e=e.forwardRef(Ke);function Ge(t,n){var r=t.id,i=t.uuid,o=t.width,l=t.data,u=t.columns,h=t.rowHeight,f=t.headerStyle,v=t.headerClassname,g=t.itemKey,p=t.onSort,b=t.sortColumn,y=t.sortDirection,w=t.expandedRows,x=t.onRowClick,E=t.onLoadRows,O=t.onExpandRow,S=t.subComponent,C=t.className,M=t.rowClassname,z=t.rowStyle,T=t.footerStyle,k=t.footerClassname,j=t.footerComponent,I=t.stickyFooter,R=t.tableHeight,H=t.maxTableHeight,N=t.estimatedRowHeight,W=t.style,_=void 0===W?{}:W,D=t.hasMoreData,P=t.asyncOverscan,A=void 0===P?1:P,F=t.minColumnWidth,V=void 0===F?80:F,L=t.endComponent,B=t.height,K=t.headerHeight,$=t.footerHeight,G=e.useRef(null),q=e.useRef(null),U=e.useRef(null),Y=m(e.useState(!1),2),J=Y[0],Q=Y[1],X=e.useRef(null!=h?h:N),Z=m(e.useState(null==D||D),2),ee=Z[0],te=Z[1],ne=m(e.useState(le(u)),2),re=ne[0],oe=ne[1],ue=e.useState((function(){var e=re.fixedWidth,t=re.remainingCols;return ae(o,t,e,V,u)})),ce=m(ue,2),he=ce[0],de=ce[1],fe=m(e.useState({}),2),me=fe[0],ve=fe[1],ge=e.useCallback((function(e,t){var n;return null!==(n=null==g?void 0:g(e))&&void 0!==n?n:t}),[g]),pe=Me({count:l.length+(L?1:0),getScrollElement:function(){return G.current},estimateSize:function(){var e;return null!==(e=null!=h?h:N)&&void 0!==e?e:37},getItemKey:function(e){return ge(l[e],e)}}),be=pe.getVirtualItems(),ye=null!=D?D:ee,we=pe.measure,xe=pe.measurementsCache,Ee=re.fixedWidth,Oe=re.remainingCols,Se=e.useMemo((function(){if(R>0||H<=0)return null;for(var e=0,t=0;t<xe.length;t++)if((e+=xe[t].size)>=H){e=H;break}return e}),[H,xe,R]),Ce=e.useMemo((function(){if(R>0)return R;if(H>0){var e,t=null===(e=G.current)||void 0===e?void 0:e.parentElement,n=t?t.offsetHeight-t.clientHeight:0,r=se(q.current,K,37),i=se(U.current,$,37);return Math.min(r+Se+i+2*n,H)+2}return B}),[Se,B,$,K,H,R]),ze="function"==typeof w?w:void 0,Te=e.useCallback((function(e,t,n,r){var i=!me[n];null==O||O({row:e,index:t,isExpanded:i,event:r}),O||ve((function(e){return c(c({},e),{},a({},n,i))}))}),[me]),ke=be.length?be[be.length-1].index:null,je=e.useCallback(s(d().m((function e(){var t;return d().w((function(e){for(;;)switch(e.n){case 0:if(E&&null!=ke){e.n=1;break}return e.a(2);case 1:if(!(ye&&ke>=l.length-A)||J){e.n=5;break}return Q(!0),e.p=2,e.n=3,E();case 3:t=e.v,null==D&&te(t);case 4:return e.p=4,Q(!1),e.f(4);case 5:return e.a(2)}}),e,null,[[2,,4,5]])}))),[ke,l.length,J,A,ye,D]);return e.useLayoutEffect((function(){var e,t,n=ae(null!==(e=null===(t=G.current)||void 0===t?void 0:t.clientWidth)&&void 0!==e?e:o,Oe,Ee,V,u);de((function(e){return function(e,t){if(null==e&&null==t)return!0;if(null!=e&&null!=t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}(n,e)?e:n}))}),[o,Oe,Ee,V,u]),e.useLayoutEffect((function(){var e=null!=h?h:N;X.current!==e&&we(),X.current=e}),[N,h,we]),e.useEffect((function(){return oe(le(u))}),[u]),e.useEffect((function(){w&&"function"!=typeof w&&ve(w)}),[w]),e.useEffect((function(){je()}),[je]),e.useImperativeHandle(n,(function(){return{scrollTo:function(e){return pe.scrollToOffset(e)},scrollToItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto";return pe.scrollToIndex(e,{align:t})}}})),e.createElement("div",{id:r,ref:G,"data-table-key":i,className:ie("rft",C),style:c(c({},_),{},{height:Ce,width:o})},e.createElement(_e,{uuid:i,ref:q,pixelWidths:he,columns:u,className:v,style:f,onSort:p,sortColumn:b,sortDirection:y}),e.createElement("div",{className:"rft-body",style:{height:pe.getTotalSize()}},be.map((function(t){var n,r=t.index,o=t.start;if(r>l.length-1&&L){var s="".concat(i,"-end");return e.createElement("div",{key:s,ref:pe.measureElement,className:"rft-end","data-index":r,"data-row-key":s,style:{transform:"translateY(".concat(o,"px)")}},e.createElement(L,{isLoading:J,hasMoreData:ye}))}var a=l[r],c={row:a,index:r},h=ge(a,r),d=null!==(n=null==ze?void 0:ze(c))&&void 0!==n?n:!!me[h],f="function"==typeof M?M(c):M,m="function"==typeof z?z(c):z;return e.createElement($e,{ref:pe.measureElement,key:h,row:a,uuid:i,rowKey:h,style:m,offset:o,className:f,isExpanded:d,onRowClick:x,onExpand:Te,index:r,columns:u,pixelWidths:he,subComponent:S})}))),e.createElement(Ie,{uuid:i,rows:l,ref:U,sticky:I,columns:u,pixelWidths:he,className:k,style:T,component:j}))}$e.displayName="Row";var qe=e.forwardRef(Ge);qe.displayName="List";var Ue=["id","rowHeight","tableWidth","tableHeight","footerHeight","headerHeight","minTableHeight","maxTableHeight","estimatedRowHeight"];function Ye(t,n){var r=t.id,i=t.rowHeight,o=t.tableWidth,s=void 0===o?0:o,a=t.tableHeight,u=void 0===a?0:a,c=t.footerHeight,d=void 0===c?0:c,f=t.headerHeight,v=void 0===f?0:f,g=t.minTableHeight,p=void 0===g?0:g,b=t.maxTableHeight,y=void 0===b?0:b,w=t.estimatedRowHeight,x=h(t,Ue),E=m(e.useState("".concat(r||"data-table","-").concat(function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(62*Math.random()));return t}(5))),1)[0],O=e.useMemo((function(){return p>0&&y<=0?(console.warn("maxTableHeight was either not present, or is <= 0, but you provided a minTableHeight of ".concat(p,"px. As a result, the maxTableHeight will be set to ").concat(p+400,"px. To avoid this warning, please specify a maxTableHeight.")),p+400):y}),[p,y]),S={rowHeight:i||0,tableWidth:s,tableHeight:u,footerHeight:d,headerHeight:v,minTableHeight:p,estimatedRowHeight:w||0,maxTableHeight:O};return e.createElement(ce,{uuid:E,dimensions:S,numRows:x.data.length,hasFooter:!!x.footerComponent||x.columns.some((function(e){return!!e.footer}))},(function(t){var r=t.height,o=t.width;return e.createElement(qe,l({ref:n,uuid:E,width:o,height:r,rowHeight:i,tableHeight:u,maxTableHeight:O,headerHeight:v,footerHeight:d,estimatedRowHeight:w},x))}))}var Je=e.forwardRef(Ye);Je.displayName="Table",exports.Table=Je;