import{aI as o,ao as l,bk as v}from"./app-k0jcl5PQ.js";const S=o.forwardRef((t,u)=>{const[w,d]=o.useState(t.containerHeight||0),[f,m]=o.useState(0),i=o.useRef(null);o.useEffect(()=>{var e;t.containerHeight||d(((e=i.current)==null?void 0:e.clientHeight)??0)},[i.current]);const r=t.items.length,h=Math.ceil(w/t.rowHeight),s=t.rowHeight*r,a=Math.max(0,Math.floor(f/t.rowHeight)-h),H=Math.min(r,a+h*3);function x(e){m(e.currentTarget.scrollTop)}function b(){var g;const e=((g=i.current)==null?void 0:g.getBoundingClientRect().top)??0,n=window.scrollY+e+(t.tableHeightOffset||30);return{height:t.containerHeight||`calc(100vh - ${n}px)`,minHeight:`${t.rowHeight*5}px`,overflow:"auto"}}function R(){const e=[];let n=a;for(;n<H;){const c=t.items[n];c&&e.push(t.getComponent(c,n)),n++}return e}return l.jsx("div",{style:b(),ref:i,children:l.jsx(v.Scrollbars,{onScroll:x,autoHeightMin:s,autoHeightMax:s,ref:u,children:l.jsx("div",{style:{height:s,paddingTop:a*t.rowHeight},children:l.jsxs("ul",{className:"w-100 position-relative d-table striped-list list-unstyled no-full-width",children:[!!t.staticComponentAboveRows&&t.staticComponentAboveRows,R(),!!t.staticComponentBelowRows&&t.staticComponentBelowRows]})})})})});export{S as W};
//# sourceMappingURL=2FvGdRks.chunk.js.map
