react-virtuoso 4.18.11 → 4.18.12

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),b=require("react"),po=require("react-dom"),Ce=0,Gt=1,Yt=2,Fn=4;function dn(t){return()=>t}function ho(t){t()}function ne(t,e){return n=>t(e(n))}function fn(t,e){return()=>t(e)}function go(t,e){return n=>t(e,n)}function Me(t){return t!==void 0}function xo(...t){return()=>{t.map(ho)}}function Zt(){}function we(t,e){return e(t),t}function Io(t,e){return e(t)}function rt(...t){return t}function Y(t,e){return t(Gt,e)}function A(t,e){t(Ce,e)}function Ae(t){t(Yt)}function it(t){return t(Fn)}function z(t,e){return Y(t,go(e,Ce))}function yt(t,e){const n=t(Gt,o=>{n(),e(o)});return n}function mn(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function Vn(t,e){return t===e}function nt(t=Vn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function P(t){return e=>n=>{t(n)&&e(n)}}function B(t){return e=>ne(e,t)}function Bt(t){return e=>()=>{e(t)}}function S(t,...e){const n=So(...e);return((o,r)=>{switch(o){case Yt:Ae(t);return;case Gt:return Y(t,n(r))}})}function Ot(t,e){return n=>o=>{n(e=t(e,o))}}function Nt(t){return e=>n=>{t>0?t--:e(n)}}function zt(t){let e=null,n;return o=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,o(e)},t))}}function D(...t){const e=Array.from({length:t.length});let n=0,o=null;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{const d=n;n|=l,e[i]=c,d!==r&&n===r&&o&&(o(),o=null)})}),s=>i=>{const l=()=>{s([i].concat(e))};n===r?l():o=l}}function So(...t){return e=>t.reduceRight(Io,e)}function vo(t){let e,n;const o=()=>e?.();return function(r,s){switch(r){case Gt:return s?n===s?void 0:(o(),n=s,e=Y(t,s),e):(o(),Zt);case Yt:o(),n=null;return}}}function T(t){let e=t;const n=$();return((o,r)=>{switch(o){case Ce:e=r;break;case Gt:{r(e);break}case Fn:return e}return n(o,r)})}function ht(t,e){return we(T(e),n=>z(t,n))}function $(){const t=[];return((e,n)=>{switch(e){case Ce:t.slice().forEach(o=>{o(n)});return;case Yt:t.splice(0);return;case Gt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}})}function Tt(t){return we($(),e=>z(t,e))}const To={singleton:!0};function K(t,e=[],n=To){const{singleton:o}=n;return{constructor:t,dependencies:e,id:Co(),singleton:o}}const Co=()=>Symbol("id");function wo(t){const e=new Map,n=({constructor:o,dependencies:r,id:s,singleton:i})=>{if(i&&e.has(s))return e.get(s);const l=o(r.map(c=>n(c)));return i&&e.set(s,l),l};return n(t)}function at(...t){const e=$(),n=Array.from({length:t.length});let o=0;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{n[i]=c,o|=l,o===r&&A(e,n)})}),function(s,i){switch(s){case Yt:{Ae(e);return}case Gt:return o===r&&i(n),Y(e,i)}}}function G(t,e=Vn){return S(t,nt(e))}function Le(...t){return function(e,n){switch(e){case Yt:return;case Gt:return xo(...t.map(o=>Y(o,n)))}}}const dt={DEBUG:0,INFO:1,WARN:2,ERROR:3},yo={[dt.DEBUG]:"debug",[dt.ERROR]:"error",[dt.INFO]:"log",[dt.WARN]:"warn"},bo=()=>typeof globalThis>"u"?window:globalThis,Pt=K(()=>{const t=T(dt.ERROR);return{log:T((n,o,r=dt.INFO)=>{const s=bo().VIRTUOSO_LOG_LEVEL??it(t);r>=s&&console[yo[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function Ro(t){return"self"in t?t.document.documentElement:t}function Wn(t){const e=Ro(t);return e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl"}function jt(t,e){return Wn(t)?-e:e}function pn(t,e){return Wn(t)?-e:e}function kt(t,e,n){return je(t,e,n).callbackRef}function je(t,e,n){const o=b.useRef(null);let r=i=>{};const s=b.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};n?l():requestAnimationFrame(l)}):null,[t,n]);return r=i=>{i&&e?(s?.observe(i),o.current=i):(o.current&&s?.unobserve(o.current),o.current=null)},{callbackRef:r,ref:o}}function Gn(t,e,n,o,r,s,i,l,c){const d=b.useCallback(m=>{const v=Eo(m.children,e,l?"offsetWidth":"offsetHeight",r);let p=m.parentElement;for(;p.dataset.virtuosoScroller===void 0;)p=p.parentElement;const x=p.lastElementChild?.dataset.viewportType==="window";let w;x&&(w=p.ownerDocument.defaultView);const E=i?l?i.scrollWidth:i.scrollHeight:x?l?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:l?p.scrollWidth:p.scrollHeight,h=i?l?i.offsetWidth:i.offsetHeight:x?l?w.innerWidth:w.innerHeight:l?p.offsetWidth:p.offsetHeight,f=i?l?jt(i,i.scrollLeft):i.scrollTop:x?l?jt(w,w.scrollX||w.document.documentElement.scrollLeft):w.scrollY||w.document.documentElement.scrollTop:l?jt(p,p.scrollLeft):p.scrollTop;o({scrollHeight:E,scrollTop:Math.max(f,0),viewportHeight:h}),s?.(l?hn("column-gap",getComputedStyle(m).columnGap,r):hn("row-gap",getComputedStyle(m).rowGap,r)),v!==null&&t(v)},[t,e,r,s,i,o,l]);return je(d,n,c)}function Eo(t,e,n,o){const r=t.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const l=t.item(i);if(l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index,10),d=parseFloat(l.dataset.knownSize),m=e(l,n);if(m===0&&o("Zero-sized element, this should not happen",{child:l},dt.ERROR),m===d)continue;const v=s[s.length-1];s.length===0||v.size!==m||v.endIndex!==c-1?s.push({endIndex:c,size:m,startIndex:c}):s[s.length-1].endIndex++}return s}function hn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}function _e(t,e,n){const o=b.useRef(null),r=b.useCallback(c=>{if(!c?.offsetParent)return;const d=c.getBoundingClientRect(),m=d.width;let v,p;if(e){const x=e.getBoundingClientRect(),w=d.top-x.top;p=x.height-Math.max(0,w),v=w+e.scrollTop}else{const x=i.current.ownerDocument.defaultView;p=x.innerHeight-Math.max(0,d.top),v=d.top+x.scrollY}o.current={listHeight:d.height,offsetTop:v,visibleHeight:p,visibleWidth:m},t(o.current)},[t,e]),{callbackRef:s,ref:i}=je(r,!0,n),l=b.useCallback(()=>{r(i.current)},[r,i]);return b.useEffect(()=>{if(e){e.addEventListener("scroll",l);const d=new ResizeObserver(()=>{requestAnimationFrame(l)});return d.observe(e),()=>{e.removeEventListener("scroll",l),d.unobserve(e)}}const c=i.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",l),c?.addEventListener("resize",l),()=>{c?.removeEventListener("scroll",l),c?.removeEventListener("resize",l)}},[l,e,i]),s}const xt=K(()=>{const t=$(),e=$(),n=T(0),o=$(),r=T(0),s=$(),i=$(),l=T(0),c=T(0),d=T(0),m=T(0),v=$(),p=$(),x=T(!1),w=T(!1),E=T(!1);return z(S(t,B(({scrollTop:h})=>h)),e),z(S(t,B(({scrollHeight:h})=>h)),i),z(e,r),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:w,scrollBy:p,scrollContainerState:t,scrollHeight:i,scrollingInProgress:x,scrollTo:v,scrollTop:e,skipAnimationFrameInResizeObserver:E,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),oe={lvl:0};function Pn(t,e){const n=t.length;if(n===0)return[];let{index:o,value:r}=e(t[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:c}=e(t[i]);s.push({end:l-1,start:o,value:r}),o=l,r=c}return s.push({end:1/0,start:o,value:r}),s}function J(t){return t===oe}function re(t,e){if(!J(t))return e===t.k?t.v:e<t.k?re(t.l,e):re(t.r,e)}function Rt(t,e,n="k"){if(J(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const o=Rt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return Rt(t.l,e,n)}function vt(t,e,n){return J(t)?jn(e,n,1):e===t.k?ft(t,{k:e,v:n}):e<t.k?gn(ft(t,{l:vt(t.l,e,n)})):gn(ft(t,{r:vt(t.r,e,n)}))}function Kt(){return oe}function qt(t,e,n){if(J(t))return[];const o=Rt(t,e)[0];return Ho(Fe(t,o,n))}function ze(t,e){if(J(t))return oe;const{k:n,l:o,r}=t;if(e===n){if(J(o))return r;if(J(r))return o;const[s,i]=An(o);return Ie(ft(t,{k:s,l:Mn(o),v:i}))}return e<n?Ie(ft(t,{l:ze(o,e)})):Ie(ft(t,{r:ze(r,e)}))}function _t(t){return J(t)?[]:[..._t(t.l),{k:t.k,v:t.v},..._t(t.r)]}function Fe(t,e,n){if(J(t))return[];const{k:o,l:r,r:s,v:i}=t;let l=[];return o>e&&(l=l.concat(Fe(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(Fe(s,e,n))),l}function Ie(t){const{l:e,lvl:n,r:o}=t;if(o.lvl>=n-1&&e.lvl>=n-1)return t;if(n>o.lvl+1){if(Ee(e))return _n(ft(t,{lvl:n-1}));if(!J(e)&&!J(e.r))return ft(e.r,{l:ft(e,{r:e.r.l}),lvl:n,r:ft(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Ee(t))return Ve(ft(t,{lvl:n-1}));if(!J(o)&&!J(o.l)){const r=o.l,s=Ee(r)?o.lvl-1:o.lvl;return ft(r,{l:ft(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Ve(ft(o,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function ft(t,e){return jn(e.k===void 0?t.k:e.k,e.v===void 0?t.v:e.v,e.lvl===void 0?t.lvl:e.lvl,e.l===void 0?t.l:e.l,e.r===void 0?t.r:e.r)}function Mn(t){return J(t.r)?t.l:Ie(ft(t,{r:Mn(t.r)}))}function Ee(t){return J(t)||t.lvl>t.r.lvl}function An(t){return J(t.r)?[t.k,t.v]:An(t.r)}function jn(t,e,n,o=oe,r=oe){return{k:t,l:o,lvl:n,r,v:e}}function gn(t){return Ve(_n(t))}function _n(t){const{l:e}=t;return!J(e)&&e.lvl===t.lvl?ft(e,{r:ft(t,{l:e.r})}):t}function Ve(t){const{lvl:e,r:n}=t;return!J(n)&&!J(n.r)&&n.lvl===e&&n.r.lvl===e?ft(n,{l:ft(t,{r:n.l}),lvl:e+1}):t}function Ho(t){return Pn(t,({k:e,v:n})=>({index:e,value:n}))}function Nn(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function se(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const Ne=K(()=>({recalcInProgress:T(!1)}),[],{singleton:!0});function Dn(t,e,n){return t[ve(t,e,n)]}function ve(t,e,n,o=0){let r=t.length-1;for(;o<=r;){const s=Math.floor((o+r)/2),i=t[s],l=n(i,e);if(l===0)return s;if(l===-1){if(r-o<2)return s-1;r=s-1}else{if(r===o)return s;o=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function Bo(t,e,n,o){const r=ve(t,e,o),s=ve(t,n,o,r);return t.slice(r,s+1)}function Et(t,e){return Math.round(t.getBoundingClientRect()[e])}function ye(t){return!J(t.groupOffsetTree)}function De({index:t},e){return e===t?0:e<t?-1:1}function Oo(){return{groupIndices:[],groupOffsetTree:Kt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Kt()}}function ko(t,e){let n=J(t)?0:1/0;for(const o of e){const{endIndex:r,size:s,startIndex:i}=o;if(n=Math.min(n,i),J(t)){t=vt(t,0,s);continue}const l=qt(t,i-1,r+1);if(l.some(Po(o)))continue;let c=!1,d=!1;for(const{end:m,start:v,value:p}of l)c?(r>=v||s===p)&&(t=ze(t,v)):(d=p!==s,c=!0),m>r&&r>=v&&p!==s&&(t=vt(t,r+1,p));d&&(t=vt(t,i,s))}return[t,n]}function Lo(t){return t.groupIndex!==void 0}function zo({offset:t},e){return e===t?0:e<t?-1:1}function ie(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=Dn(e,t,De),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function $n(t,e){if(!ye(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function Un(t,e,n){if(Lo(t))return e.groupIndices[t.groupIndex]+1;const o=t.index==="LAST"?n:t.index;let r=$n(o,e);return r=Math.max(0,Math.min(n,r)),r}function Fo(t,e,n,o=0){return o>0&&(e=Math.max(e,Dn(t,o,De).offset)),Pn(Bo(t,e,n,zo),Go)}function Vo(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,dt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&J(s)&&e.length===2){const p=e[0].size,x=e[1].size;i=n.reduce((w,E)=>vt(vt(w,E,p),E+1,x),i)}else[i,l]=ko(i,e);if(i===s)return t;const{lastIndex:c,lastOffset:d,lastSize:m,offsetTree:v}=We(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((p,x)=>vt(p,x,ie(x,v,r)),Kt()),lastIndex:c,lastOffset:d,lastSize:m,offsetTree:v,sizeTree:i}}function Wo(t){return _t(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s===void 0?1/0:s.k-1,size:n,startIndex:e}})}function xn(t,e){let n=0,o=0;for(;n<t;)n+=e[o+1]-e[o]-1,o++;return o-(n===t?0:1)}function We(t,e,n,o){let r=t,s=0,i=0,l=0,c=0;if(e===0)r=[];else{c=ve(r,e-1,De),l=r[c].offset;const m=Rt(n,e-1);s=m[0],i=m[1],r.length&&r[c].size===Rt(n,e)[1]&&(c-=1),r=r.slice(0,c+1)}for(const{start:d,value:m}of qt(n,e,1/0)){const v=d-s,p=v*i+l+v*o;r.push({index:d,offset:p,size:m}),s=d,l=p,i=m}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function Go(t){return{index:t.index,value:t}}function Po(t){const{endIndex:e,size:n,startIndex:o}=t;return r=>r.start===o&&(r.end===e||r.end===1/0)&&r.value===n}const Mo={offsetHeight:"height",offsetWidth:"width"},Lt=K(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=ht(o,0),s=$(),i=$(),l=T(0),c=T([]),d=T(void 0),m=T(void 0),v=T(void 0),p=T(void 0),x=T((u,g)=>Et(u,Mo[g])),w=T(void 0),E=T(0),h=Oo(),f=ht(S(n,D(c,t,E),Ot(Vo,h),nt()),h),a=ht(S(c,nt(),Ot((u,g)=>({current:g,prev:u.current}),{current:[],prev:[]}),B(({prev:u})=>u)),[]);z(S(c,P(u=>u.length>0),D(f,E),B(([u,g,C])=>{const L=u.reduce((O,W,_)=>vt(O,W,ie(W,g.offsetTree,C)||_),Kt());return{...g,groupIndices:u,groupOffsetTree:L}})),f),z(S(o,D(f),P(([u,{lastIndex:g}])=>u<g),B(([u,{lastIndex:g,lastSize:C}])=>[{endIndex:g,size:C,startIndex:u}])),n),z(d,m);const I=ht(S(d,B(u=>u===void 0)),!0);z(S(m,P(u=>u!==void 0&&J(it(f).sizeTree)),B(u=>{const g=it(v),C=it(c).length>0;return g!==void 0&&g!==0?C?[{endIndex:0,size:g,startIndex:0},{endIndex:1,size:u,startIndex:1}]:[]:[{endIndex:0,size:u,startIndex:0}]})),n),z(S(p,P(u=>u!==void 0&&u.length>0&&J(it(f).sizeTree)),B(u=>{const g=[];let C=u[0],L=0;for(let O=1;O<u.length;O++){const W=u[O];W!==C&&(g.push({endIndex:O-1,size:C,startIndex:L}),C=W,L=O)}return g.push({endIndex:u.length-1,size:C,startIndex:L}),g})),n),z(S(c,D(v,m),P(([,u,g])=>u!==void 0&&g!==void 0),B(([u,g,C])=>{const L=[];for(let O=0;O<u.length;O++){const W=u[O],_=u[O+1];L.push({startIndex:W,endIndex:W,size:g}),_!==void 0&&L.push({startIndex:W+1,endIndex:_-1,size:C})}return L})),n);const H=Tt(S(n,D(f),Ot(({sizes:u},[g,C])=>({changed:C!==u,sizes:C}),{changed:!1,sizes:h}),B(u=>u.changed)));Y(S(l,Ot((u,g)=>({diff:u.prev-g,prev:g}),{diff:0,prev:0}),B(u=>u.diff)),u=>{const{groupIndices:g}=it(f);if(u>0)A(e,!0),A(s,u+xn(u,g));else if(u<0){const C=it(a);C.length>0&&(u-=xn(-u,C)),A(i,u)}}),Y(S(l,D(t)),([u,g])=>{u<0&&g("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},dt.ERROR)});const y=Tt(s);z(S(s,D(f),B(([u,g])=>{const C=g.groupIndices.length>0,L=[],O=g.lastSize;if(C){const W=re(g.sizeTree,0);let _=0,Z=0;for(;_<u;){const q=g.groupIndices[Z],Q=g.groupIndices.length===Z+1?1/0:g.groupIndices[Z+1]-q-1;L.push({endIndex:q,size:W,startIndex:q}),L.push({endIndex:q+1+Q-1,size:O,startIndex:q+1}),Z++,_+=Q+1}const F=_t(g.sizeTree);return _!==u&&F.shift(),F.reduce((q,{k:Q,v:gt})=>{let lt=q.ranges;return q.prevSize!==0&&(lt=[...q.ranges,{endIndex:Q+u-1,size:q.prevSize,startIndex:q.prevIndex}]),{prevIndex:Q+u,prevSize:gt,ranges:lt}},{prevIndex:u,prevSize:0,ranges:L}).ranges}return _t(g.sizeTree).reduce((W,{k:_,v:Z})=>({prevIndex:_+u,prevSize:Z,ranges:[...W.ranges,{endIndex:_+u-1,size:W.prevSize,startIndex:W.prevIndex}]}),{prevIndex:0,prevSize:O,ranges:[]}).ranges})),n);const k=Tt(S(i,D(f,E),B(([u,{offsetTree:g},C])=>{const L=-u;return ie(L,g,C)})));return z(S(i,D(f,E),B(([u,g,C])=>{if(g.groupIndices.length>0){if(J(g.sizeTree))return g;let W=Kt();const _=it(a);let Z=0,F=0,mt=0;for(;Z<-u;){mt=_[F];const Q=_[F+1]-mt-1;F++,Z+=Q+1}if(W=_t(g.sizeTree).reduce((Q,{k:gt,v:lt})=>vt(Q,Math.max(0,gt+u),lt),W),Z!==-u){const Q=re(g.sizeTree,mt);W=vt(W,0,Q);const gt=Rt(g.sizeTree,-u+1)[1];W=vt(W,1,gt)}return{...g,sizeTree:W,...We(g.offsetTree,0,W,C)}}const O=_t(g.sizeTree).reduce((W,{k:_,v:Z})=>vt(W,Math.max(0,_+u),Z),Kt());return{...g,sizeTree:O,...We(g.offsetTree,0,O,C)}})),f),{beforeUnshiftWith:y,data:w,defaultItemSize:m,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:v,gap:E,groupIndices:c,heightEstimates:p,itemSize:x,listRefresh:H,shiftWith:i,shiftWithOffset:k,sizeRanges:n,sizes:f,statefulTotalCount:r,totalCount:o,trackItemSizes:I,unshiftWith:s}},rt(Pt,Ne),{singleton:!0});function Ao(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Kn=K(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const s=$(),i=$(),l=Tt(S(s,B(Ao)));return z(S(l,B(c=>c.totalCount)),n),z(S(l,B(c=>c.groupIndices)),t),z(S(at(r,e,o),P(([c,d])=>ye(d)),B(([c,d,m])=>Rt(d.groupOffsetTree,Math.max(c-m,0),"v")[0]),nt(),B(c=>[c])),i),{groupCounts:s,topItemsIndexes:i}},rt(Lt,xt)),Mt=K(([{log:t}])=>{const e=T(!1),n=Tt(S(e,P(o=>o),nt()));return Y(e,o=>{o&&it(t)("props updated",{},dt.DEBUG)}),{didMount:n,propsReady:e}},rt(Pt),{singleton:!0}),jo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function qn(t){const e=typeof t=="number"?{index:t}:{...t};return e.align||(e.align="start"),(!e.behavior||!jo)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const ae=K(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:d,smoothScrollTargetReached:m,viewportHeight:v},{log:p}])=>{const x=$(),w=$(),E=T(0);let h=null,f=null,a=null;function I(){h!==null&&(h(),h=null),a!==null&&(a(),a=null),f&&(clearTimeout(f),f=null),A(c,!1)}return z(S(x,D(n,v,o,E,l,i,p),D(t,s,r),B(([[H,y,k,u,g,C,L,O],W,_,Z])=>{const F=qn(H),{align:mt,behavior:q,offset:Q}=F,gt=u-1,lt=Un(F,y,gt);let It=ie(lt,y.offsetTree,W)+C;mt==="end"?(It+=_+Rt(y.sizeTree,lt)[1]-k+Z,lt===gt&&(It+=L)):mt==="center"?It+=(_+Rt(y.sizeTree,lt)[1]-k+Z)/2:It-=g,Q!==void 0&&Q!==0&&(It+=Q);const Ft=pt=>{I(),pt?(O("retrying to scroll to",{location:H},dt.DEBUG),A(x,H)):(A(w,!0),O("list did not change, scroll successful",{},dt.DEBUG))};if(I(),q==="smooth"){let pt=!1;a=Y(e,$t=>{pt=pt||$t}),h=yt(m,()=>{Ft(pt)})}else h=yt(S(e,_o(150)),Ft);return f=setTimeout(()=>{I()},1200),A(c,!0),O("scrolling from index to",{behavior:q,index:lt,top:It},dt.DEBUG),{behavior:q,top:It}})),d),{scrollTargetReached:w,scrollToIndex:x,topListHeight:E}},rt(Lt,xt,Pt),{singleton:!0});function _o(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function $e(t,e){t===0?e():requestAnimationFrame(()=>{$e(t-1,e)})}function Ue(t,e){if(t===void 0)return 0;const n=e-1,o=typeof t=="number"?t:t.index==="LAST"?n:t.index;return Math.max(0,Math.min(o,n))}function Ge(t){return t===void 0?!0:typeof t=="number"?t===0:t.index===0&&(t.align===void 0||t.align==="start")&&(t.offset===void 0||t.offset===0)}const de=K(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=T(!0),c=T(0),d=T(!0);return z(S(i,D(c),P(([m,v])=>!Ge(v)),Bt(!1)),l),z(S(i,D(c),P(([m,v])=>!Ge(v)),Bt(!1)),d),Y(S(at(e,i),D(l,n,t,d),P(([[,m],v,{sizeTree:p},x,w])=>m&&(!J(p)||Me(x))&&!v&&!w),D(c)),([,m])=>{if(m===void 0){A(l,!0),A(d,!0);return}yt(r,()=>{A(d,!0)}),$e(4,()=>{yt(o,()=>{A(l,!0)}),A(s,m)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:l}},rt(Lt,xt,ae,Mt),{singleton:!0});function Yn(t,e){return Math.abs(t-e)<1.01}const le="up",te="down",No="none",Do={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},$o=0,fe=K(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=T(!1),l=T(!0),c=$(),d=$(),m=T(4),v=T($o),p=ht(S(Le(S(G(r),Nt(1),Bt(!0)),S(G(r),Nt(1),Bt(!1),mn(100))),nt()),!1),x=ht(S(Le(S(n,Bt(!0)),S(n,Bt(!1),mn(200))),nt()),!1);z(S(at(G(r),G(v)),B(([a,I])=>a<=I),nt()),l),z(S(l,zt(50)),d);const w=Tt(S(at(o,G(s),G(e),G(t),G(m)),Ot((a,[{scrollHeight:I,scrollTop:H},y,k,u,g])=>{const C=H+y-I>-g,L={scrollHeight:I,scrollTop:H,viewportHeight:y};if(C){let W,_;return H>a.state.scrollTop?(W="SCROLLED_DOWN",_=a.state.scrollTop-H):(W="SIZE_DECREASED",_=a.state.scrollTop-H||a.scrollTopDelta),{atBottom:!0,atBottomBecause:W,scrollTopDelta:_,state:L}}let O;return L.scrollHeight>a.state.scrollHeight?O="SIZE_INCREASED":y<a.state.viewportHeight?O="VIEWPORT_HEIGHT_DECREASING":H<a.state.scrollTop?O="SCROLLING_UPWARDS":O="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:O,state:L}},Do),nt((a,I)=>a!==void 0&&a.atBottom===I.atBottom))),E=ht(S(o,Ot((a,{scrollHeight:I,scrollTop:H,viewportHeight:y})=>{if(!Yn(a.scrollHeight,I)){const k=I-(H+y)<1;return a.scrollTop!==H&&k?{changed:!0,jump:a.scrollTop-H,scrollHeight:I,scrollTop:H}:{changed:!0,jump:0,scrollHeight:I,scrollTop:H}}return{changed:!1,jump:0,scrollHeight:I,scrollTop:H}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(a=>a.changed),B(a=>a.jump)),0);z(S(w,B(a=>a.atBottom)),i),z(S(i,zt(50)),c);const h=T(te);z(S(o,B(({scrollTop:a})=>a),nt(),Ot((a,I)=>it(x)?{direction:a.direction,prevScrollTop:I}:{direction:I<a.prevScrollTop?le:te,prevScrollTop:I},{direction:te,prevScrollTop:0}),B(a=>a.direction)),h),z(S(o,zt(50),Bt(No)),h);const f=T(0);return z(S(p,P(a=>!a),Bt(0)),f),z(S(r,zt(100),D(p),P(([a,I])=>I),Ot(([a,I],[H])=>[I,H],[0,0]),B(([a,I])=>I-a)),f),{atBottomState:w,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:d,atTopThreshold:v,isAtBottom:i,isAtTop:l,isScrolling:p,lastJumpDueToItemResize:E,scrollDirection:h,scrollVelocity:f}},rt(xt)),ce="top",ue="bottom",In="none";function Sn(t,e,n){return typeof t=="number"?n===le&&e===ce||n===te&&e===ue?t:0:n===le?e===ce?t.main:t.reverse:e===ue?t.main:t.reverse}function vn(t,e){return typeof t=="number"?t:t[e]??0}const Ke=K(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=T(0),l=T(0),c=T(0),d=ht(S(at(G(o),G(r),G(n),G(s,se),G(c),G(i),G(e),G(t),G(l)),B(([m,v,p,[x,w],E,h,f,a,I])=>{const H=m-a,y=h+f,k=Math.max(p-H,0);let u=In;const g=vn(I,ce),C=vn(I,ue);return x-=a,x+=p+f,w+=p+f,w-=a,x>m+y-g&&(u=le),w<m-k+v+C&&(u=te),u!==In?[Math.max(H-p-Sn(E,ce,u)-g,0),H-k-f+v+Sn(E,ue,u)+C]:null}),P(m=>m!==null),nt(se)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:c,topListHeight:i,visibleRange:d}},rt(xt),{singleton:!0});function Uo(t,e,n){if(ye(e)){const o=$n(t,e);return[{index:Rt(e.groupOffsetTree,o)[0],offset:0,size:0},{data:n?.[0],index:o,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const He={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Se(t,e,n,o,r,s){const{lastIndex:i,lastOffset:l,lastSize:c}=r;let d=0,m=0;if(t.length>0){d=t[0].offset;const E=t[t.length-1];m=E.offset+E.size}const v=n-i,p=l+v*c+(v-1)*o,x=d,w=p-m;return{bottom:m,firstItemIndex:s,items:Tn(t,r,s),offsetBottom:w,offsetTop:d,top:x,topItems:Tn(e,r,s),topListHeight:e.reduce((E,h)=>h.size+E,0),totalCount:n}}function Zn(t,e,n,o,r,s){let i=0;if(n.groupIndices.length>0)for(const m of n.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=Ue(e,l),d=Array.from({length:l}).map((m,v)=>({data:s[v+c],index:v+c,offset:0,size:0}));return Se(d,[],l,r,n,o)}function Tn(t,e,n){if(t.length===0)return[];if(!ye(e))return t.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const o=t[0].index,r=t[t.length-1].index,s=[],i=qt(e.groupOffsetTree,o,r);let l,c=0;for(const d of t){(!l||l.end<d.index)&&(l=i.shift(),c=e.groupIndices.indexOf(l.start));let m;d.index===l.start?m={index:c,type:"group"}:m={groupIndex:c,index:d.index-(c+1)+n},s.push({...m,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function Cn(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Dt=K(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:d,scrolledToInitialItem:m},{topListHeight:v},p,{didMount:x},{recalcInProgress:w}])=>{const E=T([]),h=T(0),f=$(),a=T(0);z(s.topItemsIndexes,E);const I=ht(S(at(x,w,G(c,se),G(r),G(o),G(d),m,G(E),G(e),G(n),G(a),t),P(([u,g,,C,,,,,,,,L])=>{const O=L!==void 0&&L.length!==C;return u&&!g&&!O}),B(([,,[u,g],C,L,O,W,_,Z,F,mt,q])=>{const Q=L,{offsetTree:gt,sizeTree:lt}=Q,It=it(h);if(C===0)return{...He,totalCount:C};if(u===0&&g===0)return It===0?{...He,totalCount:C}:Zn(It,O,L,Z,F,q||[]);if(J(lt))return It>0?null:Se(Uo(Ue(O,C),Q,q),[],C,F,Q,Z);const Ft=[];if(_.length>0){const N=_[0],U=_[_.length-1];let st=0;for(const tt of qt(lt,N,U)){const X=tt.value,ct=Math.max(tt.start,N),St=Math.min(tt.end,U);for(let ut=ct;ut<=St;ut++)Ft.push({data:q?.[ut],index:ut,offset:st,size:X}),st+=X}}if(!W)return Se([],Ft,C,F,Q,Z);const pt=_.length>0?_[_.length-1]+1:0,$t=Fo(gt,u,g,pt);if($t.length===0)return null;const Xt=C-1,Ht=we([],N=>{for(const U of $t){const st=U.value;let tt=st.offset,X=U.start;const ct=st.size;if(st.offset<u){X+=Math.floor((u-st.offset+F)/(ct+F));const ut=X-U.start;tt+=ut*ct+ut*F}X<pt&&(tt+=(pt-X)*ct,X=pt);const St=Math.min(U.end,Xt);for(let ut=X;ut<=St&&!(tt>=g);ut++)N.push({data:q?.[ut],index:ut,offset:tt,size:ct}),tt+=ct+F}}),Jt=Cn(mt,ce),R=Cn(mt,ue);if(Ht.length>0&&(Jt>0||R>0)){const N=Ht[0],U=Ht[Ht.length-1];if(Jt>0&&N.index>pt){const st=Math.min(Jt,N.index-pt),tt=[];let X=N.offset;for(let ct=N.index-1;ct>=N.index-st;ct--){const ut=qt(lt,ct,ct)[0]?.value??N.size;X-=ut+F,tt.unshift({data:q?.[ct],index:ct,offset:X,size:ut})}Ht.unshift(...tt)}if(R>0&&U.index<Xt){const st=Math.min(R,Xt-U.index);let tt=U.offset+U.size+F;for(let X=U.index+1;X<=U.index+st;X++){const St=qt(lt,X,X)[0]?.value??U.size;Ht.push({data:q?.[X],index:X,offset:tt,size:St}),tt+=St+F}}}return Se(Ht,Ft,C,F,Q,Z)}),P(u=>u!==null),nt()),He);z(S(t,P(Me),B(u=>u?.length)),r),z(S(I,B(u=>u.topListHeight)),v),z(v,l),z(S(I,B(u=>[u.top,u.bottom])),i),z(S(I,B(u=>u.items)),f);const H=Tt(S(I,P(({items:u})=>u.length>0),D(r,t),P(([{items:u},g])=>u[u.length-1].originalIndex===g-1),B(([,u,g])=>[u-1,g]),nt(se),B(([u])=>u))),y=Tt(S(I,zt(200),P(({items:u,topItems:g})=>u.length>0&&u[0].originalIndex===g.length),B(({items:u})=>u[0].index),nt())),k=Tt(S(I,P(({items:u})=>u.length>0),B(({items:u})=>{let g=0,C=u.length-1;for(;u[g].type==="group"&&g<C;)g++;for(;u[C].type==="group"&&C>g;)C--;return{endIndex:u[C].index,startIndex:u[g].index}}),nt(Nn)));return{endReached:H,initialItemCount:h,itemsRendered:f,listState:I,minOverscanItemCount:a,rangeChanged:k,startReached:y,topItemsIndexes:E,...p}},rt(Lt,Kn,Ke,de,ae,fe,Mt,Ne),{singleton:!0}),Xn=K(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=ht(S(at(n,t,o,e,r),B(([l,c,d,m,v])=>l+c+d+m+v.offsetBottom+v.bottom)),0);return z(G(i),s),{totalListHeight:i,totalListHeightChanged:s}},rt(xt,Dt),{singleton:!0}),Ko=K(([{viewportHeight:t},{totalListHeight:e}])=>{const n=T(!1),o=ht(S(at(n,t,e),P(([r])=>r),B(([,r,s])=>Math.max(0,r-s)),zt(0),nt()),0);return{alignToBottom:n,paddingTopAddition:o}},rt(xt,Xn),{singleton:!0}),Jn=K(()=>({context:T(null)})),qo=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:o,...r},viewportBottom:s,viewportTop:i})=>e<i?{...r,align:n??"start",...o===void 0?{}:{behavior:o}}:t>s?{...r,align:n??"end",...o===void 0?{}:{behavior:o}}:null,Qn=K(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:d}])=>{const m=$();return z(S(m,D(e,c,n,s,r,o,l),D(t),B(([[v,p,x,w,E,h,f,a],I])=>{const{calculateViewLocation:H=qo,done:y,...k}=v,u=Un(v,p,w-1),g=ie(u,p.offsetTree,I)+E+h,C=g+Rt(p.sizeTree,u)[1],L=a+h,O=a+x-f,W=H({itemBottom:C,itemTop:g,locationParams:k,viewportBottom:O,viewportTop:L});return W===null?y?.():y&&yt(S(i,P(_=>!_),Nt(it(i)?1:2)),y),W}),P(v=>v!==null)),d),{scrollIntoView:m}},rt(Lt,xt,ae,Dt,Pt),{singleton:!0});function wn(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const Yo=(t,e)=>typeof t=="function"?wn(t(e)):e&&wn(t),Zo=K(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:d},{log:m},{scrollingInProgress:v},{context:p},{scrollIntoView:x}])=>{const w=T(!1),E=$();let h=null;function f(y){A(i,{align:"end",behavior:y,index:"LAST"})}Y(S(at(S(G(e),Nt(1)),c),D(G(w),s,l,v),B(([[y,k],u,g,C,L])=>{let O=k&&C,W="auto";return O&&(W=Yo(u,g||L),O=O&&W!==!1),{followOutputBehavior:W,shouldFollow:O,totalCount:y}}),P(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:k})=>{h!==null&&(h(),h=null),it(n)===void 0?h=yt(t,()=>{it(m)("following output to ",{totalCount:k},dt.DEBUG),f(y),h=null}):requestAnimationFrame(()=>{it(m)("following output to ",{totalCount:k},dt.DEBUG),f(y)})});function a(y){const k=yt(r,u=>{y&&!u.atBottom&&u.notAtBottomBecause==="SIZE_INCREASED"&&h===null&&(it(m)("scrolling to bottom due to increased size",{},dt.DEBUG),f("auto"))});setTimeout(k,100)}Y(S(at(G(w),e,d),P(([y,,k])=>y!==!1&&k),Ot(({value:y},[,k])=>({refreshed:y===k,value:k}),{refreshed:!1,value:0}),P(({refreshed:y})=>y),D(w,e)),([,y])=>{it(l)&&a(y!==!1)}),Y(E,()=>{a(it(w)!==!1)}),Y(at(G(w),r),([y,k])=>{y!==!1&&!k.atBottom&&k.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const I=T(null),H=$();return z(Le(S(G(o),B(y=>y?.length??0)),S(G(e))),H),Y(S(at(S(H,Nt(1)),c),D(G(I),l,v,p),B(([[y,k],u,g,C,L])=>k&&g&&u?.({context:L,totalCount:y,scrollingInProgress:C})),P(y=>!!y),zt(0)),y=>{h!==null&&(h(),h=null),it(n)===void 0?h=yt(t,()=>{it(m)("scrolling into view",{}),A(x,y),h=null}):requestAnimationFrame(()=>{it(m)("scrolling into view",{}),A(x,y)})}),{autoscrollToBottom:E,followOutput:w,scrollIntoViewOnChange:I}},rt(Lt,fe,ae,de,Mt,Pt,xt,Jn,Qn)),Xo=K(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(z(S(l,D(s),P(([,c])=>c!==0),D(r,o,e,n,t),B(([[,c],d,m,v,p,x=[]])=>Zn(c,d,m,v,p,x))),i),{}),rt(Lt,de,Dt,Mt),{singleton:!0}),Jo=K(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=T(0);return Y(S(t,D(o),P(([,r])=>r!==0),B(([,r])=>({top:r}))),r=>{yt(S(n,Nt(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{A(e,r)})})}),{initialScrollTop:o}},rt(Mt,xt,Dt),{singleton:!0}),to=K(([{scrollVelocity:t}])=>{const e=T(!1),n=$(),o=T(!1);return z(S(t,D(o,e,n),P(([r,s])=>s!==!1&&s!==void 0),B(([r,s,i,l])=>{const{enter:c,exit:d}=s;if(i){if(d(r,l))return!1}else if(c(r,l))return!0;return i}),nt()),e),Y(S(at(e,t,n),D(o)),([[r,s,i],l])=>{r&&l!==!1&&l!==void 0&&l.change&&l.change(s,i)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:t}},rt(fe),{singleton:!0}),qe=K(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=T(!1),i=T(void 0);return z(S(at(n,o),B(([{scrollTop:l,viewportHeight:c},{offsetTop:d,listHeight:m}])=>({scrollHeight:m,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),z(S(e,D(o),B(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},rt(xt)),Qo=K(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const d=$(),m=T(void 0),v=T(null),p=T(null);return z(l,v),z(c,p),Y(S(d,D(e,o,i,v,p,n)),([x,w,E,h,f,a,I])=>{const H=Wo(w.sizeTree);h&&f!==null&&a!==null&&(E=f.scrollTop-a.offsetTop),E-=I,x({ranges:H,scrollTop:E})}),z(S(m,P(Me),B(tr)),r),z(S(s,D(m),P(([,x])=>x!==void 0),nt(),B(([,x])=>x.ranges)),t),{getState:d,restoreStateFrom:m}},rt(Lt,xt,de,Mt,qe));function tr(t){return{align:"start",index:0,offset:t.scrollTop}}const er=K(([{topItemsIndexes:t}])=>{const e=T(0);return z(S(e,P(n=>n>=0),B(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},rt(Dt));function eo(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const nr=eo(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),or=K(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:d,gap:m,shiftWithOffset:v,sizes:p},{log:x},{recalcInProgress:w}])=>{const E=Tt(S(c,D(i),Ot(([,f,a,I],[{bottom:H,items:y,offsetBottom:k,totalCount:u},g])=>{const C=H+k;let L=0;return a===u&&f.length>0&&y.length>0&&(y[0].originalIndex===0&&f[0].originalIndex===0||(L=C-I,L!==0&&(L+=g))),[L,y,u,C]},[0,[],0,0]),P(([f])=>f!==0),D(o,l,n,r,x,w),P(([,f,a,I,,,H])=>!H&&!I&&f!==0&&a===le),B(([[f],,,,,a])=>(a("Upward scrolling compensation",{amount:f},dt.DEBUG),f))));function h(f){f>0?(A(e,{behavior:"auto",top:-f}),A(t,0)):(A(t,0),A(e,{behavior:"auto",top:-f}))}return Y(S(E,D(t,s)),([f,a,I])=>{I&&nr()?A(t,a-f):h(-f)}),Y(S(at(ht(s,!1),t,w),P(([f,a,I])=>!f&&!I&&a!==0),B(([f,a])=>a),zt(1)),h),z(S(v,B(f=>({top:-f}))),e),Y(S(d,D(p,m),B(([f,{groupIndices:a,lastSize:I,sizeTree:H},y])=>{function k(O){return O*(I+y)}if(a.length===0)return k(f);let u=0;const g=re(H,0);let C=0,L=0;for(;C<f;){C++,u+=g;let O=a.length===L+1?1/0:a[L+1]-a[L]-1;C+O>f&&(u-=g,O=f-C+1),C+=O,u+=k(O),L++}return u})),f=>{A(t,f),requestAnimationFrame(()=>{A(e,{top:f}),requestAnimationFrame(()=>{A(t,0),A(w,!1)})})}),{deviation:t}},rt(xt,fe,Dt,Lt,Pt,Ne)),rr=K(([t,e,n,o,r,s,i,l,c,d,m])=>({...t,...e,...n,...o,...r,...s,...i,...l,...c,...d,...m}),rt(Ke,Xo,Mt,to,Xn,Jo,Ko,qe,Qn,Pt,Jn)),no=K(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:c,sizeRanges:d,sizes:m,statefulTotalCount:v,totalCount:p,trackItemSizes:x},{initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h},f,a,I,H,{scrollToIndex:y},k,{topItemCount:u},{groupCounts:g},C])=>{const{listState:L,minOverscanItemCount:O,topItemsIndexes:W,rangeChanged:_,...Z}=H;return z(_,C.scrollSeekRangeChanged),z(S(C.windowViewportRect,B(F=>F.visibleHeight)),f.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:g,heightEstimates:l,initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h,sizeRanges:d,topItemCount:u,topItemsIndexes:W,totalCount:p,...I,groupIndices:i,itemSize:c,listState:L,minOverscanItemCount:O,scrollToIndex:y,statefulTotalCount:v,trackItemSizes:x,rangeChanged:_,...Z,...C,...f,sizes:m,...a}},rt(Lt,de,xt,Qo,Zo,Dt,ae,or,er,Kn,rr));function sr(t,e){const n={},o={};let r=0;const s=t.length;for(;r<s;)o[t[r]]=1,r+=1;for(const i in e)Object.hasOwn(o,i)||(n[i]=e[i]);return n}const ge=typeof document>"u"?b.useEffect:b.useLayoutEffect;function Ye(t,e,n){const o=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),i=Object.keys(e.events||{}),l=b.createContext({});function c(f,a){f.propsReady!==void 0&&A(f.propsReady,!1);for(const I of o){const H=f[e.required[I]];A(H,a[I])}for(const I of r)if(I in a){const H=f[e.optional[I]];A(H,a[I])}f.propsReady!==void 0&&A(f.propsReady,!0)}function d(f){return s.reduce((a,I)=>(a[I]=H=>{const y=f[e.methods[I]];A(y,H)},a),{})}function m(f){return i.reduce((a,I)=>(a[I]=vo(f[e.events[I]]),a),{})}const v=b.forwardRef(function(a,I){const{children:H,...y}=a,[k]=b.useState(()=>we(wo(t),C=>{c(C,y)})),[u]=b.useState(fn(m,k));ge(()=>{for(const C of i)C in y&&Y(u[C],y[C]);return()=>{Object.values(u).map(Ae)}},[y,u,k]),ge(()=>{c(k,y)}),b.useImperativeHandle(I,dn(d(k)));const g=n;return V.jsx(l.Provider,{value:k,children:n===void 0?H:V.jsx(g,{...sr([...o,...r,...i],y),children:H})})}),p=f=>{const a=b.useContext(l);return b.useCallback(I=>{A(a[f],I)},[a,f])},x=f=>{const I=b.useContext(l)[f],H=b.useCallback(y=>Y(I,y),[I]);return b.useSyncExternalStore(H,()=>it(I),()=>it(I))},w=f=>{const I=b.useContext(l)[f],[H,y]=b.useState(fn(it,I));return ge(()=>Y(I,k=>{k!==H&&y(dn(k))}),[I,H]),H},E=parseInt(b.version,10)>=18?x:w;return{Component:v,useEmitter:(f,a)=>{const H=b.useContext(l)[f];ge(()=>Y(H,a),[a,H])},useEmitterValue:E,usePublisher:p}}const me=b.createContext(void 0),Ze=b.createContext(void 0),Be="-webkit-sticky",yn="sticky",Xe=eo(()=>{if(typeof document>"u")return yn;const t=document.createElement("div");return t.style.position=Be,t.style.position===Be?Be:yn}),oo=typeof document>"u"?b.useEffect:b.useLayoutEffect;function Oe(t){return"self"in t}function ir(t){return"body"in t}function ro(t,e,n,o=Zt,r,s){const i=b.useRef(null),l=b.useRef(null),c=b.useRef(null),d=b.useCallback(p=>{let x,w,E;const h=p.target;if(ir(h)||Oe(h)){const a=Oe(h)?h:h.defaultView;E=s===!0?jt(a,a.scrollX):a.scrollY,x=s===!0?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight,w=s===!0?a.innerWidth:a.innerHeight}else E=s===!0?jt(h,h.scrollLeft):h.scrollTop,x=s===!0?h.scrollWidth:h.scrollHeight,w=s===!0?h.offsetWidth:h.offsetHeight;const f=()=>{t({scrollHeight:x,scrollTop:Math.max(E,0),viewportHeight:w})};p.suppressFlushSync===!0?f():po.flushSync(f),l.current!==null&&(E===l.current||E<=0||E===x-w)&&(l.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);b.useEffect(()=>{const p=r??i.current;return o(r??i.current),d({suppressFlushSync:!0,target:p}),p.addEventListener("scroll",d,{passive:!0}),()=>{o(null),p.removeEventListener("scroll",d)}},[i,d,n,o,r]);function m(p){const x=i.current;if(!x||(s===!0?"offsetWidth"in x&&x.offsetWidth===0:"offsetHeight"in x&&x.offsetHeight===0))return;const w=p.behavior==="smooth";let E,h,f;Oe(x)?(h=Math.max(Et(x.document.documentElement,s===!0?"width":"height"),s===!0?x.document.documentElement.scrollWidth:x.document.documentElement.scrollHeight),E=s===!0?x.innerWidth:x.innerHeight,f=s===!0?jt(x,x.scrollX):x.scrollY):(h=x[s===!0?"scrollWidth":"scrollHeight"],E=Et(x,s===!0?"width":"height"),f=s===!0?jt(x,x.scrollLeft):x.scrollTop);const a=h-E;if(p.top===void 0){x.scrollTo(p);return}const I=Math.ceil(Math.max(Math.min(a,p.top),0));if(p.top=I,Yn(E,h)||I===f){t({scrollHeight:h,scrollTop:f,viewportHeight:E}),w&&e(!0);return}w?(l.current=I,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,e(!0)},1e3)):l.current=null,s===!0&&(p={...p.behavior===void 0?{}:{behavior:p.behavior},left:pn(x,I)}),x.scrollTo(p)}function v(p){s===!0&&(p={...p.behavior===void 0?{}:{behavior:p.behavior},...p.top===void 0?{}:{left:pn(i.current,p.top)}}),i.current.scrollBy(p)}return{scrollByCallback:v,scrollerRef:i,scrollToCallback:m}}function Je(t){return t}const lr=K(()=>{const t=T(l=>`Item ${l}`),e=T(l=>`Group ${l}`),n=T({}),o=T(Je),r=T("div"),s=T(Zt),i=(l,c=null)=>ht(S(n,B(d=>d[l]),nt()),c);return{components:n,computeItemKey:o,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:e,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),cr=K(([t,e])=>({...t,...e}),rt(no,lr)),ur=({height:t})=>V.jsx("div",{style:{height:t}}),ar={overflowAnchor:"none",position:Xe(),zIndex:1},so={overflowAnchor:"none"},dr={...so,display:"inline-block",height:"100%"},bn=b.memo(function({showTopList:e=!1}){const n=M("listState"),o=Ct("sizeRanges"),r=M("useWindowScroll"),s=M("customScrollParent"),i=Ct("windowScrollContainerState"),l=Ct("scrollContainerState"),c=s||r?i:l,d=M("itemContent"),m=M("context"),v=M("groupContent"),p=M("trackItemSizes"),x=M("itemSize"),w=M("log"),E=Ct("gap"),h=M("horizontalDirection"),{callbackRef:f}=Gn(o,x,p,e?Zt:c,w,E,s,h,M("skipAnimationFrameInResizeObserver")),[a,I]=b.useState(0);nn("deviation",F=>{a!==F&&I(F)});const H=M("EmptyPlaceholder"),y=M("ScrollSeekPlaceholder")??ur,k=M("ListComponent"),u=M("ItemComponent"),g=M("GroupComponent"),C=M("computeItemKey"),L=M("isSeeking"),O=M("groupIndices").length>0,W=M("alignToBottom"),_=M("initialItemFinalLocationReached"),Z=e?{}:{boxSizing:"border-box",...h?{display:"inline-block",height:"100%",marginInlineStart:a===0?W?"auto":0:a,paddingInlineEnd:n.offsetBottom,paddingInlineStart:n.offsetTop,whiteSpace:"nowrap"}:{marginTop:a===0?W?"auto":0:a,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},..._?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&H!==null&&H!==void 0?V.jsx(H,{...ot(H,m)}):V.jsx(k,{...ot(k,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:f,style:Z,children:(e?n.topItems:n.items).map(F=>{const mt=F.originalIndex,q=C(mt+n.firstItemIndex,F.data,m);return L?b.createElement(y,{...ot(y,m),height:F.size,index:F.index,key:q,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?b.createElement(g,{...ot(g,m),"data-index":mt,"data-item-index":F.index,"data-known-size":F.size,key:q,style:ar},v(F.index,m)):b.createElement(u,{...ot(u,m),...io(u,F.data),"data-index":mt,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:q,style:h?dr:so},O?d(F.index,F.groupIndex,F.data,m):d(F.index,F.data,m))})})}),fr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},mr={outline:"none",overflowX:"auto",position:"relative"},be=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),Qe=(t,e,n=0)=>({...be(t),position:e?"relative":"absolute",top:e?-n:0}),pr={position:Xe(),top:0,width:"100%",zIndex:1};function ot(t,e){if(typeof t!="string")return{context:e}}function io(t,e){return{item:typeof t=="string"?void 0:e}}const hr=b.memo(function(){const e=M("HeaderComponent"),n=Ct("headerHeight"),o=M("HeaderFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,M("skipAnimationFrameInResizeObserver")),s=M("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null}),gr=b.memo(function(){const e=M("FooterComponent"),n=Ct("footerHeight"),o=M("HeaderFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,M("skipAnimationFrameInResizeObserver")),s=M("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null});function tn({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("scrollContainerState"),m=e("ScrollerComponent"),v=n("smoothScrollTargetReached"),p=e("scrollerRef"),x=e("horizontalDirection")||!1,{scrollByCallback:w,scrollerRef:E,scrollToCallback:h}=ro(d,v,m,p,void 0,x);t("scrollTo",h),t("scrollBy",w);const f=x?mr:fr;return V.jsx(m,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:E,style:{...f,...i},tabIndex:0,...c,...ot(m,l),children:s})})}function en({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("windowScrollContainerState"),m=e("ScrollerComponent"),v=n("smoothScrollTargetReached"),p=e("totalListHeight"),x=e("deviation"),w=e("customScrollParent"),E=b.useRef(null),h=e("scrollerRef"),{scrollByCallback:f,scrollerRef:a,scrollToCallback:I}=ro(d,v,m,h,w);return oo(()=>(a.current=w??E.current?.ownerDocument.defaultView,()=>{a.current=null}),[a,w]),t("windowScrollTo",I),t("scrollBy",f),V.jsx(m,{ref:E,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...p===0?void 0:{height:p+x}},...c,...ot(m,l),children:s})})}const xr=({children:t})=>{const e=b.useContext(me),n=Ct("viewportHeight"),o=Ct("fixedItemHeight"),r=M("alignToBottom"),s=M("horizontalDirection"),i=b.useMemo(()=>ne(n,c=>Et(c,s?"width":"height")),[n,s]),l=kt(i,!0,M("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:l,style:be(r),children:t})},Ir=({children:t})=>{const e=b.useContext(me),n=Ct("windowViewportRect"),o=Ct("fixedItemHeight"),r=M("customScrollParent"),s=M("useWindowScroll"),i=M("topListHeight"),l=_e(n,r,M("skipAnimationFrameInResizeObserver")),c=M("alignToBottom");return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:l,style:Qe(c,s,i),children:t})},Sr=({children:t})=>{const e=M("TopItemListComponent")??"div",n=M("headerHeight"),o={...pr,marginTop:`${n}px`},r=M("context");return V.jsx(e,{style:o,...ot(e,r),children:t})},vr=b.memo(function(e){const n=M("useWindowScroll"),o=M("topItemsIndexes").length>0,r=M("customScrollParent"),s=M("context"),i=r||n?Cr:Tr,l=r||n?Ir:xr;return V.jsxs(i,{...e,context:s,children:[o&&V.jsx(Sr,{children:V.jsx(bn,{showTopList:!0})}),V.jsxs(l,{children:[V.jsx(hr,{}),V.jsx(bn,{}),V.jsx(gr,{})]})]})}),{Component:lo,useEmitter:nn,useEmitterValue:M,usePublisher:Ct}=Ye(cr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},vr),Tr=tn({useEmitter:nn,useEmitterValue:M,usePublisher:Ct}),Cr=en({useEmitter:nn,useEmitterValue:M,usePublisher:Ct}),wr=lo,yr=lo,br=K(()=>{const t=T(d=>V.jsxs("td",{children:["Item $",d]})),e=T(null),n=T(d=>V.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=T(null),r=T(null),s=T({}),i=T(Je),l=T(Zt),c=(d,m=null)=>ht(S(s,B(v=>v[d]),nt()),m);return{components:s,computeItemKey:i,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}}),Rr=K(([t,e])=>({...t,...e}),rt(no,br)),Er=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{height:t}})}),Hr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{border:0,height:t,padding:0}})}),Br={overflowAnchor:"none"},Rn={position:Xe(),zIndex:2,overflowAnchor:"none"},En=b.memo(function({showTopList:e=!1}){const n=j("listState"),o=j("computeItemKey"),r=j("firstItemIndex"),s=j("context"),i=j("isSeeking"),l=j("fixedHeaderHeight"),c=j("groupIndices").length>0,d=j("itemContent"),m=j("groupContent"),v=j("ScrollSeekPlaceholder")??Er,p=j("GroupComponent"),x=j("TableRowComponent"),w=(e?n.topItems:[]).reduce((h,f,a)=>(a===0?h.push(f.size):h.push(h[a-1]+f.size),h),[]);return(e?n.topItems:n.items).map(h=>{const f=h.originalIndex,a=o(f+r,h.data,s),I=e?f===0?0:w[f-1]:0;return i?b.createElement(v,{...ot(v,s),height:h.size,index:h.index,key:a,type:h.type||"item"}):h.type==="group"?b.createElement(p,{...ot(p,s),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,key:a,style:{...Rn,top:l}},m(h.index,s)):b.createElement(x,{...ot(x,s),...io(x,h.data),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,"data-item-group-index":h.groupIndex,key:a,style:e?{...Rn,top:l+I}:Br},c?d(h.index,h.groupIndex,h.data,s):d(h.index,h.data,s))})}),Or=b.memo(function(){const e=j("listState"),n=j("topItemsIndexes").length>0,o=bt("sizeRanges"),r=j("useWindowScroll"),s=j("customScrollParent"),i=bt("windowScrollContainerState"),l=bt("scrollContainerState"),c=s||r?i:l,d=j("trackItemSizes"),m=j("itemSize"),v=j("log"),{callbackRef:p,ref:x}=Gn(o,m,d,c,v,void 0,s,!1,j("skipAnimationFrameInResizeObserver")),[w,E]=b.useState(0);on("deviation",O=>{w!==O&&(x.current.style.marginTop=`${O}px`,E(O))});const h=j("EmptyPlaceholder"),f=j("FillerRow")??Hr,a=j("TableBodyComponent"),I=j("paddingTopAddition"),H=j("statefulTotalCount"),y=j("context");if(H===0&&h!==null&&h!==void 0)return V.jsx(h,{...ot(h,y)});const k=(n?e.topItems:[]).reduce((O,W)=>O+W.size,0),u=e.offsetTop+I+w-k,g=e.offsetBottom,C=u>0?V.jsx(f,{context:y,height:u},"padding-top"):null,L=g>0?V.jsx(f,{context:y,height:g},"padding-bottom"):null;return V.jsxs(a,{"data-testid":"virtuoso-item-list",ref:p,...ot(a,y),children:[C,n&&V.jsx(En,{showTopList:!0}),V.jsx(En,{}),L]})}),kr=({children:t})=>{const e=b.useContext(me),n=bt("viewportHeight"),o=bt("fixedItemHeight"),r=kt(b.useMemo(()=>ne(n,s=>Et(s,"height")),[n]),!0,j("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:r,style:be(!1),children:t})},Lr=({children:t})=>{const e=b.useContext(me),n=bt("windowViewportRect"),o=bt("fixedItemHeight"),r=j("customScrollParent"),s=j("useWindowScroll"),i=_e(n,r,j("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:i,style:Qe(!1,s),children:t})},zr=b.memo(function(e){const n=j("useWindowScroll"),o=j("customScrollParent"),r=bt("fixedHeaderHeight"),s=bt("fixedFooterHeight"),i=j("fixedHeaderContent"),l=j("fixedFooterContent"),c=j("context"),d=kt(b.useMemo(()=>ne(r,a=>Et(a,"height")),[r]),!0,j("skipAnimationFrameInResizeObserver")),m=kt(b.useMemo(()=>ne(s,a=>Et(a,"height")),[s]),!0,j("skipAnimationFrameInResizeObserver")),v=o||n?Vr:Fr,p=o||n?Lr:kr,x=j("TableComponent"),w=j("TableHeadComponent"),E=j("TableFooterComponent"),h=i?V.jsx(w,{ref:d,style:{position:"sticky",top:0,zIndex:2},...ot(w,c),children:i()},"TableHead"):null,f=l?V.jsx(E,{ref:m,style:{bottom:0,position:"sticky",zIndex:1},...ot(E,c),children:l()},"TableFoot"):null;return V.jsx(v,{...e,...ot(v,c),children:V.jsx(p,{children:V.jsxs(x,{style:{borderSpacing:0,overflowAnchor:"none"},...ot(x,c),children:[h,V.jsx(Or,{},"TableBody"),f]})})})}),{Component:co,useEmitter:on,useEmitterValue:j,usePublisher:bt}=Ye(Rr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},zr),Fr=tn({useEmitter:on,useEmitterValue:j,usePublisher:bt}),Vr=en({useEmitter:on,useEmitterValue:j,usePublisher:bt}),Wr=co,Gr=co,Hn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Pr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Bn,floor:Te,max:ee,min:ke,round:On}=Math;function kn(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Mr(t){return{...Pr,items:t}}function xe(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function Ar(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const jr=K(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:d,smoothScrollTargetReached:m,viewportHeight:v},p,x,{didMount:w,propsReady:E},{customScrollParent:h,useWindowScroll:f,windowScrollContainerState:a,windowScrollTo:I,windowViewportRect:H},y])=>{const k=T(0),u=T(0),g=T(Hn),C=T({height:0,width:0}),L=T({height:0,width:0}),O=$(),W=$(),_=T(0),Z=T(null),F=T({column:0,row:0}),mt=$(),q=$(),Q=T(!1),gt=T(0),lt=T(!0),It=T(!1),Ft=T(!1);Y(S(w,D(gt),P(([R,N])=>!Ge(N))),()=>{A(lt,!1)}),Y(S(at(w,lt,L,C,gt,It),P(([R,N,U,st,,tt])=>R&&!N&&U.height!==0&&st.height!==0&&!tt)),([,,,,R])=>{if(R===void 0){A(lt,!0);return}A(It,!0),$e(1,()=>{A(O,R)}),yt(S(d),()=>{A(e,[0,0]),A(lt,!0)})}),z(S(q,P(R=>R!=null&&R.scrollTop>0),Bt(0)),u),Y(S(w,D(q),P(([,R])=>R!=null)),([,R])=>{R&&(A(C,R.viewport),A(L,R.item),A(F,R.gap),R.scrollTop>0&&(A(Q,!0),yt(S(d,Nt(1)),N=>{A(Q,!1)}),A(c,{top:R.scrollTop})))}),z(S(C,B(({height:R})=>R)),v),z(S(at(G(C,xe),G(L,xe),G(F,(R,N)=>R!==void 0&&R.column===N.column&&R.row===N.row),G(d)),B(([R,N,U,st])=>({gap:U,item:N,scrollTop:st,viewport:R}))),mt),z(S(at(G(k),o,G(F,Ar),G(L,xe),G(C,xe),G(Z),G(u),G(Q),G(lt),G(gt)),P(([,,,,,,,R])=>!R),B(([R,[N,U],st,tt,X,ct,St,,ut,Vt])=>{const{column:Wt,row:Qt}=st,{height:pe,width:Re}=tt,{width:rn}=X;if(St===0&&(R===0||rn===0))return Hn;if(Re===0){const an=Ue(Vt,R),mo=an+Math.max(St-1,0);return Mr(kn(an,mo,ct))}const he=uo(rn,Re,Wt);let Ut,At;ut?N===0&&U===0&&St>0?(Ut=0,At=St-1):(Ut=he*Te((N+Qt)/(pe+Qt)),At=he*Bn((U+Qt)/(pe+Qt))-1,At=ke(R-1,ee(At,he-1)),Ut=ke(At,ee(0,Ut))):(Ut=0,At=-1);const sn=kn(Ut,At,ct),{bottom:ln,top:cn}=Ln(X,st,tt,sn),un=Bn(R/he),fo=un*pe+(un-1)*Qt-ln;return{bottom:ln,itemHeight:pe,items:sn,itemWidth:Re,offsetBottom:fo,offsetTop:cn,top:cn}})),g),z(S(Z,P(R=>R!==null),B(R=>R.length)),k),z(S(at(C,L,g,F),P(([R,N,{items:U}])=>U.length>0&&N.height!==0&&R.height!==0),B(([R,N,{items:U},st])=>{const{bottom:tt,top:X}=Ln(R,st,N,U);return[X,tt]}),nt(se)),e);const pt=T(!1);z(S(d,D(pt),B(([R,N])=>N||R!==0)),pt);const $t=Tt(S(at(g,k),P(([{items:R}])=>R.length>0),D(pt),P(([[R,N],U])=>{const tt=R.items[R.items.length-1].index===N-1;return(U||R.bottom>0&&R.itemHeight>0&&R.offsetBottom===0&&R.items.length===N)&&tt}),B(([[,R]])=>R-1),nt())),Xt=Tt(S(G(g),P(({items:R})=>R.length>0&&R[0].index===0),Bt(0),nt())),Ht=Tt(S(G(g),D(Q),P(([{items:R},N])=>R.length>0&&!N),B(([{items:R}])=>({endIndex:R[R.length-1].index,startIndex:R[0].index})),nt(Nn),zt(0)));z(Ht,x.scrollSeekRangeChanged),z(S(O,D(C,L,k,F),B(([R,N,U,st,tt])=>{const X=qn(R),{align:ct,behavior:St,offset:ut}=X;let Vt=X.index;Vt==="LAST"&&(Vt=st-1),Vt=ee(0,Vt,ke(st-1,Vt));let Wt=Pe(N,tt,U,Vt);return ct==="end"?Wt=On(Wt-N.height+U.height):ct==="center"&&(Wt=On(Wt-N.height/2+U.height/2)),ut!==void 0&&ut!==0&&(Wt+=ut),{behavior:St,top:Wt}})),c);const Jt=ht(S(g,B(R=>R.offsetBottom+R.bottom)),0);return z(S(H,B(R=>({height:R.visibleHeight,width:R.visibleWidth}))),C),{customScrollParent:h,data:Z,deviation:_,footerHeight:r,gap:F,headerHeight:s,increaseViewportBy:t,initialItemCount:u,itemDimensions:L,overscan:n,restoreStateFrom:q,scrollBy:i,scrollContainerState:l,scrollHeight:W,scrollTo:c,scrollToIndex:O,scrollTop:d,smoothScrollTargetReached:m,totalCount:k,useWindowScroll:f,viewportDimensions:C,windowScrollContainerState:a,windowScrollTo:I,windowViewportRect:H,...x,gridState:g,horizontalDirection:Ft,initialTopMostItemIndex:gt,totalListHeight:Jt,...p,endReached:$t,propsReady:E,rangeChanged:Ht,startReached:Xt,stateChanged:mt,stateRestoreInProgress:Q,...y}},rt(Ke,xt,fe,to,Mt,qe,Pt));function uo(t,e,n){return ee(1,Te((t+n)/(Te(e)+n)))}function Ln(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Pe(t,e,n,o[0].index);return{bottom:Pe(t,e,n,o[o.length-1].index)+r,top:s}}function Pe(t,e,n,o){const r=uo(t.width,n.width,e.column),s=Te(o/r),i=s*n.height+ee(0,s-1)*e.row;return i>0?i+e.row:i}const _r=K(()=>{const t=T(v=>`Item ${v}`),e=T({}),n=T(null),o=T("virtuoso-grid-item"),r=T("virtuoso-grid-list"),s=T(Je),i=T("div"),l=T(Zt),c=(v,p=null)=>ht(S(e,B(x=>x[v]),nt()),p),d=T(!1),m=T(!1);return z(G(m),d),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:o,ItemComponent:c("Item","div"),itemContent:t,listClassName:r,ListComponent:c("List","div"),readyStateChanged:d,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Nr=K(([t,e])=>({...t,...e}),rt(jr,_r)),Dr=b.memo(function(){const e=et("gridState"),n=et("listClassName"),o=et("itemClassName"),r=et("itemContent"),s=et("computeItemKey"),i=et("isSeeking"),l=wt("scrollHeight"),c=et("ItemComponent"),d=et("ListComponent"),m=et("ScrollSeekPlaceholder"),v=et("context"),p=wt("itemDimensions"),x=wt("gap"),w=et("log"),E=et("stateRestoreInProgress"),h=wt("reportReadyState"),f=kt(b.useMemo(()=>a=>{const I=a.parentElement.parentElement.scrollHeight;l(I);const H=a.firstChild;if(H!==null){const{height:y,width:k}=H.getBoundingClientRect();p({height:y,width:k})}x({column:zn("column-gap",getComputedStyle(a).columnGap,w),row:zn("row-gap",getComputedStyle(a).rowGap,w)})},[l,p,x,w]),!0,!1);return oo(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),E?null:V.jsx(d,{className:n,ref:f,...ot(d,v),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(a=>{const I=s(a.index,a.data,v);return i?V.jsx(m,{...ot(m,v),height:e.itemHeight,index:a.index,width:e.itemWidth},I):b.createElement(c,{...ot(c,v),className:o,"data-index":a.index,key:I},r(a.index,a.data,v))})})}),$r=b.memo(function(){const e=et("HeaderComponent"),n=wt("headerHeight"),o=et("headerFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=et("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null}),Ur=b.memo(function(){const e=et("FooterComponent"),n=wt("footerHeight"),o=et("headerFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=et("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null}),Kr=({children:t})=>{const e=b.useContext(Ze),n=wt("itemDimensions"),o=wt("viewportDimensions"),r=kt(b.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return b.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,o,n]),V.jsx("div",{ref:r,style:be(!1),children:t})},qr=({children:t})=>{const e=b.useContext(Ze),n=wt("windowViewportRect"),o=wt("itemDimensions"),r=et("customScrollParent"),s=et("useWindowScroll"),i=_e(n,r,!1);return b.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),V.jsx("div",{ref:i,style:Qe(!1,s),children:t})},Yr=b.memo(function({...e}){const n=et("useWindowScroll"),o=et("customScrollParent"),r=o||n?Jr:Xr,s=o||n?qr:Kr,i=et("context");return V.jsx(r,{...e,...ot(r,i),children:V.jsxs(s,{children:[V.jsx($r,{}),V.jsx(Dr,{}),V.jsx(Ur,{})]})})}),{Component:Zr,useEmitter:ao,useEmitterValue:et,usePublisher:wt}=Ye(Nr,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Yr),Xr=tn({useEmitter:ao,useEmitterValue:et,usePublisher:wt}),Jr=en({useEmitter:ao,useEmitterValue:et,usePublisher:wt});function zn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}const Qr=Zr;exports.GroupedTableVirtuoso=Gr;exports.GroupedVirtuoso=yr;exports.LogLevel=dt;exports.TableVirtuoso=Wr;exports.Virtuoso=wr;exports.VirtuosoGrid=Qr;exports.VirtuosoGridMockContext=Ze;exports.VirtuosoMockContext=me;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),b=require("react"),po=require("react-dom"),Ce=0,Gt=1,Yt=2,Fn=4;function dn(t){return()=>t}function ho(t){t()}function ne(t,e){return n=>t(e(n))}function fn(t,e){return()=>t(e)}function go(t,e){return n=>t(e,n)}function Me(t){return t!==void 0}function xo(...t){return()=>{t.map(ho)}}function Zt(){}function we(t,e){return e(t),t}function Io(t,e){return e(t)}function rt(...t){return t}function Y(t,e){return t(Gt,e)}function A(t,e){t(Ce,e)}function Ae(t){t(Yt)}function it(t){return t(Fn)}function z(t,e){return Y(t,go(e,Ce))}function yt(t,e){const n=t(Gt,o=>{n(),e(o)});return n}function mn(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function Vn(t,e){return t===e}function nt(t=Vn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function P(t){return e=>n=>{t(n)&&e(n)}}function B(t){return e=>ne(e,t)}function Bt(t){return e=>()=>{e(t)}}function S(t,...e){const n=So(...e);return((o,r)=>{switch(o){case Yt:Ae(t);return;case Gt:return Y(t,n(r))}})}function kt(t,e){return n=>o=>{n(e=t(e,o))}}function Nt(t){return e=>n=>{t>0?t--:e(n)}}function zt(t){let e=null,n;return o=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,o(e)},t))}}function D(...t){const e=Array.from({length:t.length});let n=0,o=null;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{const d=n;n|=l,e[i]=c,d!==r&&n===r&&o&&(o(),o=null)})}),s=>i=>{const l=()=>{s([i].concat(e))};n===r?l():o=l}}function So(...t){return e=>t.reduceRight(Io,e)}function vo(t){let e,n;const o=()=>e?.();return function(r,s){switch(r){case Gt:return s?n===s?void 0:(o(),n=s,e=Y(t,s),e):(o(),Zt);case Yt:o(),n=null;return}}}function T(t){let e=t;const n=$();return((o,r)=>{switch(o){case Ce:e=r;break;case Gt:{r(e);break}case Fn:return e}return n(o,r)})}function ht(t,e){return we(T(e),n=>z(t,n))}function $(){const t=[];return((e,n)=>{switch(e){case Ce:t.slice().forEach(o=>{o(n)});return;case Yt:t.splice(0);return;case Gt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}})}function Tt(t){return we($(),e=>z(t,e))}const To={singleton:!0};function q(t,e=[],n=To){const{singleton:o}=n;return{constructor:t,dependencies:e,id:Co(),singleton:o}}const Co=()=>Symbol("id");function wo(t){const e=new Map,n=({constructor:o,dependencies:r,id:s,singleton:i})=>{if(i&&e.has(s))return e.get(s);const l=o(r.map(c=>n(c)));return i&&e.set(s,l),l};return n(t)}function at(...t){const e=$(),n=Array.from({length:t.length});let o=0;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{n[i]=c,o|=l,o===r&&A(e,n)})}),function(s,i){switch(s){case Yt:{Ae(e);return}case Gt:return o===r&&i(n),Y(e,i)}}}function G(t,e=Vn){return S(t,nt(e))}function Oe(...t){return function(e,n){switch(e){case Yt:return;case Gt:return xo(...t.map(o=>Y(o,n)))}}}const dt={DEBUG:0,INFO:1,WARN:2,ERROR:3},yo={[dt.DEBUG]:"debug",[dt.ERROR]:"error",[dt.INFO]:"log",[dt.WARN]:"warn"},bo=()=>typeof globalThis>"u"?window:globalThis,Pt=q(()=>{const t=T(dt.ERROR);return{log:T((n,o,r=dt.INFO)=>{const s=bo().VIRTUOSO_LOG_LEVEL??it(t);r>=s&&console[yo[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function Ro(t){return"self"in t?t.document.documentElement:t}function Wn(t){const e=Ro(t);return e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl"}function jt(t,e){return Wn(t)?-e:e}function pn(t,e){return Wn(t)?-e:e}function Lt(t,e,n){return je(t,e,n).callbackRef}function je(t,e,n){const o=b.useRef(null);let r=i=>{};const s=b.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};n?l():requestAnimationFrame(l)}):null,[t,n]);return r=i=>{i&&e?(s?.observe(i),o.current=i):(o.current&&s?.unobserve(o.current),o.current=null)},{callbackRef:r,ref:o}}function Gn(t,e,n,o,r,s,i,l,c){const d=b.useCallback(m=>{const v=Eo(m.children,e,l?"offsetWidth":"offsetHeight",r);let p=m.parentElement;for(;p.dataset.virtuosoScroller===void 0;)p=p.parentElement;const x=p.lastElementChild?.dataset.viewportType==="window";let w;x&&(w=p.ownerDocument.defaultView);const E=i?l?i.scrollWidth:i.scrollHeight:x?l?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:l?p.scrollWidth:p.scrollHeight,h=i?l?i.offsetWidth:i.offsetHeight:x?l?w.innerWidth:w.innerHeight:l?p.offsetWidth:p.offsetHeight,f=i?l?jt(i,i.scrollLeft):i.scrollTop:x?l?jt(w,w.scrollX||w.document.documentElement.scrollLeft):w.scrollY||w.document.documentElement.scrollTop:l?jt(p,p.scrollLeft):p.scrollTop;o({scrollHeight:E,scrollTop:Math.max(f,0),viewportHeight:h}),s?.(l?hn("column-gap",getComputedStyle(m).columnGap,r):hn("row-gap",getComputedStyle(m).rowGap,r)),v!==null&&t(v)},[t,e,r,s,i,o,l]);return je(d,n,c)}function Eo(t,e,n,o){const r=t.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const l=t.item(i);if(l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index,10),d=parseFloat(l.dataset.knownSize),m=e(l,n);if(m===0&&o("Zero-sized element, this should not happen",{child:l},dt.ERROR),m===d)continue;const v=s[s.length-1];s.length===0||v.size!==m||v.endIndex!==c-1?s.push({endIndex:c,size:m,startIndex:c}):s[s.length-1].endIndex++}return s}function hn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}function _e(t,e,n){const o=b.useRef(null),r=b.useCallback(c=>{if(!c?.offsetParent)return;const d=c.getBoundingClientRect(),m=d.width;let v,p;if(e){const x=e.getBoundingClientRect(),w=d.top-x.top;p=x.height-Math.max(0,w),v=w+e.scrollTop}else{const x=i.current.ownerDocument.defaultView;p=x.innerHeight-Math.max(0,d.top),v=d.top+x.scrollY}o.current={listHeight:d.height,offsetTop:v,visibleHeight:p,visibleWidth:m},t(o.current)},[t,e]),{callbackRef:s,ref:i}=je(r,!0,n),l=b.useCallback(()=>{r(i.current)},[r,i]);return b.useEffect(()=>{if(e){e.addEventListener("scroll",l);const d=new ResizeObserver(()=>{requestAnimationFrame(l)});return d.observe(e),()=>{e.removeEventListener("scroll",l),d.unobserve(e)}}const c=i.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",l),c?.addEventListener("resize",l),()=>{c?.removeEventListener("scroll",l),c?.removeEventListener("resize",l)}},[l,e,i]),s}const xt=q(()=>{const t=$(),e=$(),n=T(0),o=$(),r=T(0),s=$(),i=$(),l=T(0),c=T(0),d=T(0),m=T(0),v=$(),p=$(),x=T(!1),w=T(!1),E=T(!1);return z(S(t,B(({scrollTop:h})=>h)),e),z(S(t,B(({scrollHeight:h})=>h)),i),z(e,r),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:w,scrollBy:p,scrollContainerState:t,scrollHeight:i,scrollingInProgress:x,scrollTo:v,scrollTop:e,skipAnimationFrameInResizeObserver:E,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),oe={lvl:0};function Pn(t,e){const n=t.length;if(n===0)return[];let{index:o,value:r}=e(t[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:c}=e(t[i]);s.push({end:l-1,start:o,value:r}),o=l,r=c}return s.push({end:1/0,start:o,value:r}),s}function J(t){return t===oe}function re(t,e){if(!J(t))return e===t.k?t.v:e<t.k?re(t.l,e):re(t.r,e)}function Rt(t,e,n="k"){if(J(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const o=Rt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return Rt(t.l,e,n)}function vt(t,e,n){return J(t)?jn(e,n,1):e===t.k?mt(t,{k:e,v:n}):e<t.k?gn(mt(t,{l:vt(t.l,e,n)})):gn(mt(t,{r:vt(t.r,e,n)}))}function Kt(){return oe}function qt(t,e,n){if(J(t))return[];const o=Rt(t,e)[0];return Ho(Fe(t,o,n))}function ze(t,e){if(J(t))return oe;const{k:n,l:o,r}=t;if(e===n){if(J(o))return r;if(J(r))return o;const[s,i]=An(o);return Ie(mt(t,{k:s,l:Mn(o),v:i}))}return e<n?Ie(mt(t,{l:ze(o,e)})):Ie(mt(t,{r:ze(r,e)}))}function _t(t){return J(t)?[]:[..._t(t.l),{k:t.k,v:t.v},..._t(t.r)]}function Fe(t,e,n){if(J(t))return[];const{k:o,l:r,r:s,v:i}=t;let l=[];return o>e&&(l=l.concat(Fe(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(Fe(s,e,n))),l}function Ie(t){const{l:e,lvl:n,r:o}=t;if(o.lvl>=n-1&&e.lvl>=n-1)return t;if(n>o.lvl+1){if(Ee(e))return _n(mt(t,{lvl:n-1}));if(!J(e)&&!J(e.r))return mt(e.r,{l:mt(e,{r:e.r.l}),lvl:n,r:mt(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Ee(t))return Ve(mt(t,{lvl:n-1}));if(!J(o)&&!J(o.l)){const r=o.l,s=Ee(r)?o.lvl-1:o.lvl;return mt(r,{l:mt(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Ve(mt(o,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function mt(t,e){return jn(e.k===void 0?t.k:e.k,e.v===void 0?t.v:e.v,e.lvl===void 0?t.lvl:e.lvl,e.l===void 0?t.l:e.l,e.r===void 0?t.r:e.r)}function Mn(t){return J(t.r)?t.l:Ie(mt(t,{r:Mn(t.r)}))}function Ee(t){return J(t)||t.lvl>t.r.lvl}function An(t){return J(t.r)?[t.k,t.v]:An(t.r)}function jn(t,e,n,o=oe,r=oe){return{k:t,l:o,lvl:n,r,v:e}}function gn(t){return Ve(_n(t))}function _n(t){const{l:e}=t;return!J(e)&&e.lvl===t.lvl?mt(e,{r:mt(t,{l:e.r})}):t}function Ve(t){const{lvl:e,r:n}=t;return!J(n)&&!J(n.r)&&n.lvl===e&&n.r.lvl===e?mt(n,{l:mt(t,{r:n.l}),lvl:e+1}):t}function Ho(t){return Pn(t,({k:e,v:n})=>({index:e,value:n}))}function Nn(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function se(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const Ne=q(()=>({recalcInProgress:T(!1)}),[],{singleton:!0});function Dn(t,e,n){return t[ve(t,e,n)]}function ve(t,e,n,o=0){let r=t.length-1;for(;o<=r;){const s=Math.floor((o+r)/2),i=t[s],l=n(i,e);if(l===0)return s;if(l===-1){if(r-o<2)return s-1;r=s-1}else{if(r===o)return s;o=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function Bo(t,e,n,o){const r=ve(t,e,o),s=ve(t,n,o,r);return t.slice(r,s+1)}function Et(t,e){return Math.round(t.getBoundingClientRect()[e])}function ye(t){return!J(t.groupOffsetTree)}function De({index:t},e){return e===t?0:e<t?-1:1}function ko(){return{groupIndices:[],groupOffsetTree:Kt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Kt()}}function Lo(t,e){let n=J(t)?0:1/0;for(const o of e){const{endIndex:r,size:s,startIndex:i}=o;if(n=Math.min(n,i),J(t)){t=vt(t,0,s);continue}const l=qt(t,i-1,r+1);if(l.some(Po(o)))continue;let c=!1,d=!1;for(const{end:m,start:v,value:p}of l)c?(r>=v||s===p)&&(t=ze(t,v)):(d=p!==s,c=!0),m>r&&r>=v&&p!==s&&(t=vt(t,r+1,p));d&&(t=vt(t,i,s))}return[t,n]}function Oo(t){return t.groupIndex!==void 0}function zo({offset:t},e){return e===t?0:e<t?-1:1}function ie(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=Dn(e,t,De),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function $n(t,e){if(!ye(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function Un(t,e,n){if(Oo(t))return e.groupIndices[t.groupIndex]+1;const o=t.index==="LAST"?n:t.index;let r=$n(o,e);return r=Math.max(0,Math.min(n,r)),r}function Fo(t,e,n,o=0){return o>0&&(e=Math.max(e,Dn(t,o,De).offset)),Pn(Bo(t,e,n,zo),Go)}function Vo(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,dt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&J(s)&&e.length===2){const p=e[0].size,x=e[1].size;i=n.reduce((w,E)=>vt(vt(w,E,p),E+1,x),i)}else[i,l]=Lo(i,e);if(i===s)return t;const{lastIndex:c,lastOffset:d,lastSize:m,offsetTree:v}=We(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((p,x)=>vt(p,x,ie(x,v,r)),Kt()),lastIndex:c,lastOffset:d,lastSize:m,offsetTree:v,sizeTree:i}}function Wo(t){return _t(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s===void 0?1/0:s.k-1,size:n,startIndex:e}})}function xn(t,e){let n=0,o=0;for(;n<t;)n+=e[o+1]-e[o]-1,o++;return o-(n===t?0:1)}function We(t,e,n,o){let r=t,s=0,i=0,l=0,c=0;if(e===0)r=[];else{c=ve(r,e-1,De),l=r[c].offset;const m=Rt(n,e-1);s=m[0],i=m[1],r.length&&r[c].size===Rt(n,e)[1]&&(c-=1),r=r.slice(0,c+1)}for(const{start:d,value:m}of qt(n,e,1/0)){const v=d-s,p=v*i+l+v*o;r.push({index:d,offset:p,size:m}),s=d,l=p,i=m}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function Go(t){return{index:t.index,value:t}}function Po(t){const{endIndex:e,size:n,startIndex:o}=t;return r=>r.start===o&&(r.end===e||r.end===1/0)&&r.value===n}const Mo={offsetHeight:"height",offsetWidth:"width"},Ot=q(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=ht(o,0),s=$(),i=$(),l=T(0),c=T([]),d=T(void 0),m=T(void 0),v=T(void 0),p=T(void 0),x=T((u,g)=>Et(u,Mo[g])),w=T(void 0),E=T(0),h=ko(),f=ht(S(n,D(c,t,E),kt(Vo,h),nt()),h),a=ht(S(c,nt(),kt((u,g)=>({current:g,prev:u.current}),{current:[],prev:[]}),B(({prev:u})=>u)),[]);z(S(c,P(u=>u.length>0),D(f,E),B(([u,g,C])=>{const O=u.reduce((k,W,_)=>vt(k,W,ie(W,g.offsetTree,C)||_),Kt());return{...g,groupIndices:u,groupOffsetTree:O}})),f),z(S(o,D(f),P(([u,{lastIndex:g}])=>u<g),B(([u,{lastIndex:g,lastSize:C}])=>[{endIndex:g,size:C,startIndex:u}])),n),z(d,m);const I=ht(S(d,B(u=>u===void 0)),!0);z(S(m,P(u=>u!==void 0&&J(it(f).sizeTree)),B(u=>{const g=it(v),C=it(c).length>0;return g!==void 0&&g!==0?C?[{endIndex:0,size:g,startIndex:0},{endIndex:1,size:u,startIndex:1}]:[]:[{endIndex:0,size:u,startIndex:0}]})),n),z(S(p,P(u=>u!==void 0&&u.length>0&&J(it(f).sizeTree)),B(u=>{const g=[];let C=u[0],O=0;for(let k=1;k<u.length;k++){const W=u[k];W!==C&&(g.push({endIndex:k-1,size:C,startIndex:O}),C=W,O=k)}return g.push({endIndex:u.length-1,size:C,startIndex:O}),g})),n),z(S(c,D(v,m),P(([,u,g])=>u!==void 0&&g!==void 0),B(([u,g,C])=>{const O=[];for(let k=0;k<u.length;k++){const W=u[k],_=u[k+1];O.push({startIndex:W,endIndex:W,size:g}),_!==void 0&&O.push({startIndex:W+1,endIndex:_-1,size:C})}return O})),n);const H=Tt(S(n,D(f),kt(({sizes:u},[g,C])=>({changed:C!==u,sizes:C}),{changed:!1,sizes:h}),B(u=>u.changed)));Y(S(l,kt((u,g)=>({diff:u.prev-g,prev:g}),{diff:0,prev:0}),B(u=>u.diff)),u=>{const{groupIndices:g}=it(f);if(u>0)A(e,!0),A(s,u+xn(u,g));else if(u<0){const C=it(a);C.length>0&&(u-=xn(-u,C)),A(i,u)}}),Y(S(l,D(t)),([u,g])=>{u<0&&g("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},dt.ERROR)});const y=Tt(s);z(S(s,D(f),B(([u,g])=>{const C=g.groupIndices.length>0,O=[],k=g.lastSize;if(C){const W=re(g.sizeTree,0);let _=0,Z=0;for(;_<u;){const U=g.groupIndices[Z],Q=g.groupIndices.length===Z+1?1/0:g.groupIndices[Z+1]-U-1;O.push({endIndex:U,size:W,startIndex:U}),O.push({endIndex:U+1+Q-1,size:k,startIndex:U+1}),Z++,_+=Q+1}const F=_t(g.sizeTree);return _!==u&&F.shift(),F.reduce((U,{k:Q,v:gt})=>{let lt=U.ranges;return U.prevSize!==0&&(lt=[...U.ranges,{endIndex:Q+u-1,size:U.prevSize,startIndex:U.prevIndex}]),{prevIndex:Q+u,prevSize:gt,ranges:lt}},{prevIndex:u,prevSize:0,ranges:O}).ranges}return _t(g.sizeTree).reduce((W,{k:_,v:Z})=>({prevIndex:_+u,prevSize:Z,ranges:[...W.ranges,{endIndex:_+u-1,size:W.prevSize,startIndex:W.prevIndex}]}),{prevIndex:0,prevSize:k,ranges:[]}).ranges})),n);const L=Tt(S(i,D(f,E),B(([u,{offsetTree:g},C])=>{const O=-u;return ie(O,g,C)})));return z(S(i,D(f,E),B(([u,g,C])=>{if(g.groupIndices.length>0){if(J(g.sizeTree))return g;let W=Kt();const _=it(a);let Z=0,F=0,ft=0;for(;Z<-u;){ft=_[F];const Q=_[F+1]-ft-1;F++,Z+=Q+1}if(W=_t(g.sizeTree).reduce((Q,{k:gt,v:lt})=>vt(Q,Math.max(0,gt+u),lt),W),Z!==-u){const Q=re(g.sizeTree,ft);W=vt(W,0,Q);const gt=Rt(g.sizeTree,-u+1)[1];W=vt(W,1,gt)}return{...g,sizeTree:W,...We(g.offsetTree,0,W,C)}}const k=_t(g.sizeTree).reduce((W,{k:_,v:Z})=>vt(W,Math.max(0,_+u),Z),Kt());return{...g,sizeTree:k,...We(g.offsetTree,0,k,C)}})),f),{beforeUnshiftWith:y,data:w,defaultItemSize:m,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:v,gap:E,groupIndices:c,heightEstimates:p,itemSize:x,listRefresh:H,shiftWith:i,shiftWithOffset:L,sizeRanges:n,sizes:f,statefulTotalCount:r,totalCount:o,trackItemSizes:I,unshiftWith:s}},rt(Pt,Ne),{singleton:!0});function Ao(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Kn=q(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const s=$(),i=$(),l=Tt(S(s,B(Ao)));return z(S(l,B(c=>c.totalCount)),n),z(S(l,B(c=>c.groupIndices)),t),z(S(at(r,e,o),P(([c,d])=>ye(d)),B(([c,d,m])=>Rt(d.groupOffsetTree,Math.max(c-m,0),"v")[0]),nt(),B(c=>[c])),i),{groupCounts:s,topItemsIndexes:i}},rt(Ot,xt)),Mt=q(([{log:t}])=>{const e=T(!1),n=Tt(S(e,P(o=>o),nt()));return Y(e,o=>{o&&it(t)("props updated",{},dt.DEBUG)}),{didMount:n,propsReady:e}},rt(Pt),{singleton:!0}),jo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function qn(t){const e=typeof t=="number"?{index:t}:{...t};return e.align||(e.align="start"),(!e.behavior||!jo)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const ae=q(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:d,smoothScrollTargetReached:m,viewportHeight:v},{log:p}])=>{const x=$(),w=$(),E=T(0);let h=null,f=null,a=null;function I(){h!==null&&(h(),h=null),a!==null&&(a(),a=null),f&&(clearTimeout(f),f=null),A(c,!1)}return z(S(x,D(n,v,o,E,l,i,p),D(t,s,r),B(([[H,y,L,u,g,C,O,k],W,_,Z])=>{const F=qn(H),{align:ft,behavior:U,offset:Q}=F,gt=u-1,lt=Un(F,y,gt);let It=ie(lt,y.offsetTree,W)+C;ft==="end"?(It+=_+Rt(y.sizeTree,lt)[1]-L+Z,lt===gt&&(It+=O)):ft==="center"?It+=(_+Rt(y.sizeTree,lt)[1]-L+Z)/2:It-=g,Q!==void 0&&Q!==0&&(It+=Q);const Ft=pt=>{I(),pt?(k("retrying to scroll to",{location:H},dt.DEBUG),A(x,H)):(A(w,!0),k("list did not change, scroll successful",{},dt.DEBUG))};if(I(),U==="smooth"){let pt=!1;a=Y(e,$t=>{pt=pt||$t}),h=yt(m,()=>{Ft(pt)})}else h=yt(S(e,_o(150)),Ft);return f=setTimeout(()=>{I()},1200),A(c,!0),k("scrolling from index to",{behavior:U,index:lt,top:It},dt.DEBUG),{behavior:U,top:It}})),d),{scrollTargetReached:w,scrollToIndex:x,topListHeight:E}},rt(Ot,xt,Pt),{singleton:!0});function _o(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function $e(t,e){t===0?e():requestAnimationFrame(()=>{$e(t-1,e)})}function Ue(t,e){if(t===void 0)return 0;const n=e-1,o=typeof t=="number"?t:t.index==="LAST"?n:t.index;return Math.max(0,Math.min(o,n))}function Ge(t){return t===void 0?!0:typeof t=="number"?t===0:t.index===0&&(t.align===void 0||t.align==="start")&&(t.offset===void 0||t.offset===0)}const de=q(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=T(!0),c=T(0),d=T(!0);return z(S(i,D(c),P(([m,v])=>!Ge(v)),Bt(!1)),l),z(S(i,D(c),P(([m,v])=>!Ge(v)),Bt(!1)),d),Y(S(at(e,i),D(l,n,t,d),P(([[,m],v,{sizeTree:p},x,w])=>m&&(!J(p)||Me(x))&&!v&&!w),D(c)),([,m])=>{if(m===void 0){A(l,!0),A(d,!0);return}yt(r,()=>{A(d,!0)}),$e(4,()=>{yt(o,()=>{A(l,!0)}),A(s,m)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:l}},rt(Ot,xt,ae,Mt),{singleton:!0});function Yn(t,e){return Math.abs(t-e)<1.01}const le="up",te="down",No="none",Do={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},$o=0,fe=q(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=T(!1),l=T(!0),c=$(),d=$(),m=T(4),v=T($o),p=ht(S(Oe(S(G(r),Nt(1),Bt(!0)),S(G(r),Nt(1),Bt(!1),mn(100))),nt()),!1),x=ht(S(Oe(S(n,Bt(!0)),S(n,Bt(!1),mn(200))),nt()),!1);z(S(at(G(r),G(v)),B(([a,I])=>a<=I),nt()),l),z(S(l,zt(50)),d);const w=Tt(S(at(o,G(s),G(e),G(t),G(m)),kt((a,[{scrollHeight:I,scrollTop:H},y,L,u,g])=>{const C=H+y-I>-g,O={scrollHeight:I,scrollTop:H,viewportHeight:y};if(C){let W,_;return H>a.state.scrollTop?(W="SCROLLED_DOWN",_=a.state.scrollTop-H):(W="SIZE_DECREASED",_=a.state.scrollTop-H||a.scrollTopDelta),{atBottom:!0,atBottomBecause:W,scrollTopDelta:_,state:O}}let k;return O.scrollHeight>a.state.scrollHeight?k="SIZE_INCREASED":y<a.state.viewportHeight?k="VIEWPORT_HEIGHT_DECREASING":H<a.state.scrollTop?k="SCROLLING_UPWARDS":k="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:k,state:O}},Do),nt((a,I)=>a!==void 0&&a.atBottom===I.atBottom))),E=ht(S(o,kt((a,{scrollHeight:I,scrollTop:H,viewportHeight:y})=>{if(!Yn(a.scrollHeight,I)){const L=I-(H+y)<1;return a.scrollTop!==H&&L?{changed:!0,jump:a.scrollTop-H,scrollHeight:I,scrollTop:H}:{changed:!0,jump:0,scrollHeight:I,scrollTop:H}}return{changed:!1,jump:0,scrollHeight:I,scrollTop:H}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(a=>a.changed),B(a=>a.jump)),0);z(S(w,B(a=>a.atBottom)),i),z(S(i,zt(50)),c);const h=T(te);z(S(o,B(({scrollTop:a})=>a),nt(),kt((a,I)=>it(x)?{direction:a.direction,prevScrollTop:I}:{direction:I<a.prevScrollTop?le:te,prevScrollTop:I},{direction:te,prevScrollTop:0}),B(a=>a.direction)),h),z(S(o,zt(50),Bt(No)),h);const f=T(0);return z(S(p,P(a=>!a),Bt(0)),f),z(S(r,zt(100),D(p),P(([a,I])=>I),kt(([a,I],[H])=>[I,H],[0,0]),B(([a,I])=>I-a)),f),{atBottomState:w,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:d,atTopThreshold:v,isAtBottom:i,isAtTop:l,isScrolling:p,lastJumpDueToItemResize:E,scrollDirection:h,scrollVelocity:f}},rt(xt)),ce="top",ue="bottom",In="none";function Sn(t,e,n){return typeof t=="number"?n===le&&e===ce||n===te&&e===ue?t:0:n===le?e===ce?t.main:t.reverse:e===ue?t.main:t.reverse}function vn(t,e){return typeof t=="number"?t:t[e]??0}const Ke=q(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=T(0),l=T(0),c=T(0),d=ht(S(at(G(o),G(r),G(n),G(s,se),G(c),G(i),G(e),G(t),G(l)),B(([m,v,p,[x,w],E,h,f,a,I])=>{const H=m-a,y=h+f,L=Math.max(p-H,0);let u=In;const g=vn(I,ce),C=vn(I,ue);return x-=a,x+=p+f,w+=p+f,w-=a,x>m+y-g&&(u=le),w<m-L+v+C&&(u=te),u!==In?[Math.max(H-p-Sn(E,ce,u)-g,0),H-L-f+v+Sn(E,ue,u)+C]:null}),P(m=>m!==null),nt(se)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:c,topListHeight:i,visibleRange:d}},rt(xt),{singleton:!0});function Uo(t,e,n){if(ye(e)){const o=$n(t,e);return[{index:Rt(e.groupOffsetTree,o)[0],offset:0,size:0},{data:n?.[0],index:o,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const He={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Se(t,e,n,o,r,s){const{lastIndex:i,lastOffset:l,lastSize:c}=r;let d=0,m=0;if(t.length>0){d=t[0].offset;const E=t[t.length-1];m=E.offset+E.size}const v=n-i,p=l+v*c+(v-1)*o,x=d,w=p-m;return{bottom:m,firstItemIndex:s,items:Tn(t,r,s),offsetBottom:w,offsetTop:d,top:x,topItems:Tn(e,r,s),topListHeight:e.reduce((E,h)=>h.size+E,0),totalCount:n}}function Zn(t,e,n,o,r,s){let i=0;if(n.groupIndices.length>0)for(const m of n.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=Ue(e,l),d=Array.from({length:l}).map((m,v)=>({data:s[v+c],index:v+c,offset:0,size:0}));return Se(d,[],l,r,n,o)}function Tn(t,e,n){if(t.length===0)return[];if(!ye(e))return t.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const o=t[0].index,r=t[t.length-1].index,s=[],i=qt(e.groupOffsetTree,o,r);let l,c=0;for(const d of t){(!l||l.end<d.index)&&(l=i.shift(),c=e.groupIndices.indexOf(l.start));let m;d.index===l.start?m={index:c,type:"group"}:m={groupIndex:c,index:d.index-(c+1)+n},s.push({...m,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function Cn(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Dt=q(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:d,scrolledToInitialItem:m},{topListHeight:v},p,{didMount:x},{recalcInProgress:w}])=>{const E=T([]),h=T(0),f=$(),a=T(0);z(s.topItemsIndexes,E);const I=ht(S(at(x,w,G(c,se),G(r),G(o),G(d),m,G(E),G(e),G(n),G(a),t),P(([u,g,,C,,,,,,,,O])=>{const k=O!==void 0&&O.length!==C;return u&&!g&&!k}),B(([,,[u,g],C,O,k,W,_,Z,F,ft,U])=>{const Q=O,{offsetTree:gt,sizeTree:lt}=Q,It=it(h);if(C===0)return{...He,totalCount:C};if(u===0&&g===0)return It===0?{...He,totalCount:C}:Zn(It,k,O,Z,F,U||[]);if(J(lt))return It>0?null:Se(Uo(Ue(k,C),Q,U),[],C,F,Q,Z);const Ft=[];if(_.length>0){const N=_[0],K=_[_.length-1];let st=0;for(const tt of qt(lt,N,K)){const X=tt.value,ct=Math.max(tt.start,N),St=Math.min(tt.end,K);for(let ut=ct;ut<=St;ut++)Ft.push({data:U?.[ut],index:ut,offset:st,size:X}),st+=X}}if(!W)return Se([],Ft,C,F,Q,Z);const pt=_.length>0?_[_.length-1]+1:0,$t=Fo(gt,u,g,pt);if($t.length===0)return null;const Xt=C-1,Ht=we([],N=>{for(const K of $t){const st=K.value;let tt=st.offset,X=K.start;const ct=st.size;if(st.offset<u){X+=Math.floor((u-st.offset+F)/(ct+F));const ut=X-K.start;tt+=ut*ct+ut*F}X<pt&&(tt+=(pt-X)*ct,X=pt);const St=Math.min(K.end,Xt);for(let ut=X;ut<=St&&!(tt>=g);ut++)N.push({data:U?.[ut],index:ut,offset:tt,size:ct}),tt+=ct+F}}),Jt=Cn(ft,ce),R=Cn(ft,ue);if(Ht.length>0&&(Jt>0||R>0)){const N=Ht[0],K=Ht[Ht.length-1];if(Jt>0&&N.index>pt){const st=Math.min(Jt,N.index-pt),tt=[];let X=N.offset;for(let ct=N.index-1;ct>=N.index-st;ct--){const ut=qt(lt,ct,ct)[0]?.value??N.size;X-=ut+F,tt.unshift({data:U?.[ct],index:ct,offset:X,size:ut})}Ht.unshift(...tt)}if(R>0&&K.index<Xt){const st=Math.min(R,Xt-K.index);let tt=K.offset+K.size+F;for(let X=K.index+1;X<=K.index+st;X++){const St=qt(lt,X,X)[0]?.value??K.size;Ht.push({data:U?.[X],index:X,offset:tt,size:St}),tt+=St+F}}}return Se(Ht,Ft,C,F,Q,Z)}),P(u=>u!==null),nt()),He);z(S(t,P(Me),B(u=>u?.length)),r),z(S(I,B(u=>u.topListHeight)),v),z(v,l),z(S(I,B(u=>[u.top,u.bottom])),i),z(S(I,B(u=>u.items)),f);const H=Tt(S(I,P(({items:u})=>u.length>0),D(r,t),P(([{items:u},g])=>u[u.length-1].originalIndex===g-1),B(([,u,g])=>[u-1,g]),nt(se),B(([u])=>u))),y=Tt(S(I,zt(200),P(({items:u,topItems:g})=>u.length>0&&u[0].originalIndex===g.length),B(({items:u})=>u[0].index),nt())),L=Tt(S(I,P(({items:u})=>u.length>0),B(({items:u})=>{let g=0,C=u.length-1;for(;u[g].type==="group"&&g<C;)g++;for(;u[C].type==="group"&&C>g;)C--;return{endIndex:u[C].index,startIndex:u[g].index}}),nt(Nn)));return{endReached:H,initialItemCount:h,itemsRendered:f,listState:I,minOverscanItemCount:a,rangeChanged:L,startReached:y,topItemsIndexes:E,...p}},rt(Ot,Kn,Ke,de,ae,fe,Mt,Ne),{singleton:!0}),Xn=q(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=ht(S(at(n,t,o,e,r),B(([l,c,d,m,v])=>l+c+d+m+v.offsetBottom+v.bottom)),0);return z(G(i),s),{totalListHeight:i,totalListHeightChanged:s}},rt(xt,Dt),{singleton:!0}),Ko=q(([{viewportHeight:t},{totalListHeight:e}])=>{const n=T(!1),o=ht(S(at(n,t,e),P(([r])=>r),B(([,r,s])=>Math.max(0,r-s)),zt(0),nt()),0);return{alignToBottom:n,paddingTopAddition:o}},rt(xt,Xn),{singleton:!0}),Jn=q(()=>({context:T(null)})),qo=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:o,...r},viewportBottom:s,viewportTop:i})=>e<i?{...r,align:n??"start",...o===void 0?{}:{behavior:o}}:t>s?{...r,align:n??"end",...o===void 0?{}:{behavior:o}}:null,Qn=q(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:d}])=>{const m=$();return z(S(m,D(e,c,n,s,r,o,l),D(t),B(([[v,p,x,w,E,h,f,a],I])=>{const{calculateViewLocation:H=qo,done:y,...L}=v,u=Un(v,p,w-1),g=ie(u,p.offsetTree,I)+E+h,C=g+Rt(p.sizeTree,u)[1],O=a+h,k=a+x-f,W=H({itemBottom:C,itemTop:g,locationParams:L,viewportBottom:k,viewportTop:O});return W===null?y?.():y&&yt(S(i,P(_=>!_),Nt(it(i)?1:2)),y),W}),P(v=>v!==null)),d),{scrollIntoView:m}},rt(Ot,xt,ae,Dt,Pt),{singleton:!0});function wn(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const Yo=(t,e)=>typeof t=="function"?wn(t(e)):e&&wn(t),Zo=q(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:d},{log:m},{scrollingInProgress:v},{context:p},{scrollIntoView:x}])=>{const w=T(!1),E=$();let h=null;function f(y){A(i,{align:"end",behavior:y,index:"LAST"})}Y(S(at(S(G(e),Nt(1)),c),D(G(w),s,l,v),B(([[y,L],u,g,C,O])=>{let k=L&&C,W="auto";return k&&(W=Yo(u,g||O),k=k&&W!==!1),{followOutputBehavior:W,shouldFollow:k,totalCount:y}}),P(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:L})=>{h!==null&&(h(),h=null),it(n)===void 0?h=yt(t,()=>{it(m)("following output to ",{totalCount:L},dt.DEBUG),f(y),h=null}):requestAnimationFrame(()=>{it(m)("following output to ",{totalCount:L},dt.DEBUG),f(y)})});function a(y){const L=yt(r,u=>{y&&!u.atBottom&&u.notAtBottomBecause==="SIZE_INCREASED"&&h===null&&(it(m)("scrolling to bottom due to increased size",{},dt.DEBUG),f("auto"))});setTimeout(L,100)}Y(S(at(G(w),e,d),P(([y,,L])=>y!==!1&&L),kt(({value:y},[,L])=>({refreshed:y===L,value:L}),{refreshed:!1,value:0}),P(({refreshed:y})=>y),D(w,e)),([,y])=>{it(l)&&a(y!==!1)}),Y(E,()=>{a(it(w)!==!1)}),Y(at(G(w),r),([y,L])=>{y!==!1&&!L.atBottom&&L.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const I=T(null),H=$();return z(Oe(S(G(o),B(y=>y?.length??0)),S(G(e))),H),Y(S(at(S(H,Nt(1)),c),D(G(I),l,v,p),B(([[y,L],u,g,C,O])=>L&&g&&u?.({context:O,totalCount:y,scrollingInProgress:C})),P(y=>!!y),zt(0)),y=>{h!==null&&(h(),h=null),it(n)===void 0?h=yt(t,()=>{it(m)("scrolling into view",{}),A(x,y),h=null}):requestAnimationFrame(()=>{it(m)("scrolling into view",{}),A(x,y)})}),{autoscrollToBottom:E,followOutput:w,scrollIntoViewOnChange:I}},rt(Ot,fe,ae,de,Mt,Pt,xt,Jn,Qn)),Xo=q(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(z(S(l,D(s),P(([,c])=>c!==0),D(r,o,e,n,t),B(([[,c],d,m,v,p,x=[]])=>Zn(c,d,m,v,p,x))),i),{}),rt(Ot,de,Dt,Mt),{singleton:!0}),Jo=q(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=T(0);return Y(S(t,D(o),P(([,r])=>r!==0),B(([,r])=>({top:r}))),r=>{yt(S(n,Nt(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{A(e,r)})})}),{initialScrollTop:o}},rt(Mt,xt,Dt),{singleton:!0}),to=q(([{scrollVelocity:t}])=>{const e=T(!1),n=$(),o=T(!1);return z(S(t,D(o,e,n),P(([r,s])=>s!==!1&&s!==void 0),B(([r,s,i,l])=>{const{enter:c,exit:d}=s;if(i){if(d(r,l))return!1}else if(c(r,l))return!0;return i}),nt()),e),Y(S(at(e,t,n),D(o)),([[r,s,i],l])=>{r&&l!==!1&&l!==void 0&&l.change&&l.change(s,i)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:t}},rt(fe),{singleton:!0}),qe=q(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=T(!1),i=T(void 0);return z(S(at(n,o),B(([{scrollTop:l,viewportHeight:c},{offsetTop:d,listHeight:m}])=>({scrollHeight:m,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),z(S(e,D(o),B(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},rt(xt)),Qo=q(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const d=$(),m=T(void 0),v=T(null),p=T(null);return z(l,v),z(c,p),Y(S(d,D(e,o,i,v,p,n)),([x,w,E,h,f,a,I])=>{const H=Wo(w.sizeTree);h&&f!==null&&a!==null&&(E=f.scrollTop-a.offsetTop),E-=I,x({ranges:H,scrollTop:E})}),z(S(m,P(Me),B(tr)),r),z(S(s,D(m),P(([,x])=>x!==void 0),nt(),B(([,x])=>x.ranges)),t),{getState:d,restoreStateFrom:m}},rt(Ot,xt,de,Mt,qe));function tr(t){return{align:"start",index:0,offset:t.scrollTop}}const er=q(([{topItemsIndexes:t}])=>{const e=T(0);return z(S(e,P(n=>n>=0),B(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},rt(Dt));function eo(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const nr=eo(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),or=q(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:d,gap:m,shiftWithOffset:v,sizes:p},{log:x},{recalcInProgress:w}])=>{const E=Tt(S(c,D(i),kt(([,f,a,I],[{bottom:H,items:y,offsetBottom:L,totalCount:u},g])=>{const C=H+L;let O=0;return a===u&&f.length>0&&y.length>0&&(y[0].originalIndex===0&&f[0].originalIndex===0||(O=C-I,O!==0&&(O+=g))),[O,y,u,C]},[0,[],0,0]),P(([f])=>f!==0),D(o,l,n,r,x,w),P(([,f,a,I,,,H])=>!H&&!I&&f!==0&&a===le),B(([[f],,,,,a])=>(a("Upward scrolling compensation",{amount:f},dt.DEBUG),f))));function h(f){f>0?(A(e,{behavior:"auto",top:-f}),A(t,0)):(A(t,0),A(e,{behavior:"auto",top:-f}))}return Y(S(E,D(t,s)),([f,a,I])=>{I&&nr()?A(t,a-f):h(-f)}),Y(S(at(ht(s,!1),t,w),P(([f,a,I])=>!f&&!I&&a!==0),B(([f,a])=>a),zt(1)),h),z(S(v,B(f=>({top:-f}))),e),Y(S(d,D(p,m),B(([f,{groupIndices:a,lastSize:I,sizeTree:H},y])=>{function L(k){return k*(I+y)}if(a.length===0)return L(f);let u=0;const g=re(H,0);let C=0,O=0;for(;C<f;){C++,u+=g;let k=a.length===O+1?1/0:a[O+1]-a[O]-1;C+k>f&&(u-=g,k=f-C+1),C+=k,u+=L(k),O++}return u})),f=>{A(t,f),requestAnimationFrame(()=>{A(e,{top:f}),requestAnimationFrame(()=>{A(t,0),A(w,!1)})})}),{deviation:t}},rt(xt,fe,Dt,Ot,Pt,Ne)),rr=q(([t,e,n,o,r,s,i,l,c,d,m])=>({...t,...e,...n,...o,...r,...s,...i,...l,...c,...d,...m}),rt(Ke,Xo,Mt,to,Xn,Jo,Ko,qe,Qn,Pt,Jn)),no=q(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:c,sizeRanges:d,sizes:m,statefulTotalCount:v,totalCount:p,trackItemSizes:x},{initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h},f,a,I,H,{scrollToIndex:y},L,{topItemCount:u},{groupCounts:g},C])=>{const{listState:O,minOverscanItemCount:k,topItemsIndexes:W,rangeChanged:_,...Z}=H;return z(_,C.scrollSeekRangeChanged),z(S(at(C.windowViewportRect,f.headerHeight,f.fixedHeaderHeight),B(([F,ft,U])=>Math.max(ft+U+1,F.visibleHeight))),f.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:g,heightEstimates:l,initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h,sizeRanges:d,topItemCount:u,topItemsIndexes:W,totalCount:p,...I,groupIndices:i,itemSize:c,listState:O,minOverscanItemCount:k,scrollToIndex:y,statefulTotalCount:v,trackItemSizes:x,rangeChanged:_,...Z,...C,...f,sizes:m,...a}},rt(Ot,de,xt,Qo,Zo,Dt,ae,or,er,Kn,rr));function sr(t,e){const n={},o={};let r=0;const s=t.length;for(;r<s;)o[t[r]]=1,r+=1;for(const i in e)Object.hasOwn(o,i)||(n[i]=e[i]);return n}const ge=typeof document>"u"?b.useEffect:b.useLayoutEffect;function Ye(t,e,n){const o=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),i=Object.keys(e.events||{}),l=b.createContext({});function c(f,a){f.propsReady!==void 0&&A(f.propsReady,!1);for(const I of o){const H=f[e.required[I]];A(H,a[I])}for(const I of r)if(I in a){const H=f[e.optional[I]];A(H,a[I])}f.propsReady!==void 0&&A(f.propsReady,!0)}function d(f){return s.reduce((a,I)=>(a[I]=H=>{const y=f[e.methods[I]];A(y,H)},a),{})}function m(f){return i.reduce((a,I)=>(a[I]=vo(f[e.events[I]]),a),{})}const v=b.forwardRef(function(a,I){const{children:H,...y}=a,[L]=b.useState(()=>we(wo(t),C=>{c(C,y)})),[u]=b.useState(fn(m,L));ge(()=>{for(const C of i)C in y&&Y(u[C],y[C]);return()=>{Object.values(u).map(Ae)}},[y,u,L]),ge(()=>{c(L,y)}),b.useImperativeHandle(I,dn(d(L)));const g=n;return V.jsx(l.Provider,{value:L,children:n===void 0?H:V.jsx(g,{...sr([...o,...r,...i],y),children:H})})}),p=f=>{const a=b.useContext(l);return b.useCallback(I=>{A(a[f],I)},[a,f])},x=f=>{const I=b.useContext(l)[f],H=b.useCallback(y=>Y(I,y),[I]);return b.useSyncExternalStore(H,()=>it(I),()=>it(I))},w=f=>{const I=b.useContext(l)[f],[H,y]=b.useState(fn(it,I));return ge(()=>Y(I,L=>{L!==H&&y(dn(L))}),[I,H]),H},E=parseInt(b.version,10)>=18?x:w;return{Component:v,useEmitter:(f,a)=>{const H=b.useContext(l)[f];ge(()=>Y(H,a),[a,H])},useEmitterValue:E,usePublisher:p}}const me=b.createContext(void 0),Ze=b.createContext(void 0),Be="-webkit-sticky",yn="sticky",Xe=eo(()=>{if(typeof document>"u")return yn;const t=document.createElement("div");return t.style.position=Be,t.style.position===Be?Be:yn}),oo=typeof document>"u"?b.useEffect:b.useLayoutEffect;function ke(t){return"self"in t}function ir(t){return"body"in t}function ro(t,e,n,o=Zt,r,s){const i=b.useRef(null),l=b.useRef(null),c=b.useRef(null),d=b.useCallback(p=>{let x,w,E;const h=p.target;if(ir(h)||ke(h)){const a=ke(h)?h:h.defaultView;E=s===!0?jt(a,a.scrollX):a.scrollY,x=s===!0?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight,w=s===!0?a.innerWidth:a.innerHeight}else E=s===!0?jt(h,h.scrollLeft):h.scrollTop,x=s===!0?h.scrollWidth:h.scrollHeight,w=s===!0?h.offsetWidth:h.offsetHeight;const f=()=>{t({scrollHeight:x,scrollTop:Math.max(E,0),viewportHeight:w})};p.suppressFlushSync===!0?f():po.flushSync(f),l.current!==null&&(E===l.current||E<=0||E===x-w)&&(l.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);b.useEffect(()=>{const p=r??i.current;return o(r??i.current),d({suppressFlushSync:!0,target:p}),p.addEventListener("scroll",d,{passive:!0}),()=>{o(null),p.removeEventListener("scroll",d)}},[i,d,n,o,r]);function m(p){const x=i.current;if(!x||(s===!0?"offsetWidth"in x&&x.offsetWidth===0:"offsetHeight"in x&&x.offsetHeight===0))return;const w=p.behavior==="smooth";let E,h,f;ke(x)?(h=Math.max(Et(x.document.documentElement,s===!0?"width":"height"),s===!0?x.document.documentElement.scrollWidth:x.document.documentElement.scrollHeight),E=s===!0?x.innerWidth:x.innerHeight,f=s===!0?jt(x,x.scrollX):x.scrollY):(h=x[s===!0?"scrollWidth":"scrollHeight"],E=Et(x,s===!0?"width":"height"),f=s===!0?jt(x,x.scrollLeft):x.scrollTop);const a=h-E;if(p.top===void 0){x.scrollTo(p);return}const I=Math.ceil(Math.max(Math.min(a,p.top),0));if(p.top=I,Yn(E,h)||I===f){t({scrollHeight:h,scrollTop:f,viewportHeight:E}),w&&e(!0);return}w?(l.current=I,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,e(!0)},1e3)):l.current=null,s===!0&&(p={...p.behavior===void 0?{}:{behavior:p.behavior},left:pn(x,I)}),x.scrollTo(p)}function v(p){s===!0&&(p={...p.behavior===void 0?{}:{behavior:p.behavior},...p.top===void 0?{}:{left:pn(i.current,p.top)}}),i.current.scrollBy(p)}return{scrollByCallback:v,scrollerRef:i,scrollToCallback:m}}function Je(t){return t}const lr=q(()=>{const t=T(l=>`Item ${l}`),e=T(l=>`Group ${l}`),n=T({}),o=T(Je),r=T("div"),s=T(Zt),i=(l,c=null)=>ht(S(n,B(d=>d[l]),nt()),c);return{components:n,computeItemKey:o,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:e,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),cr=q(([t,e])=>({...t,...e}),rt(no,lr)),ur=({height:t})=>V.jsx("div",{style:{height:t}}),ar={overflowAnchor:"none",position:Xe(),zIndex:1},so={overflowAnchor:"none"},dr={...so,display:"inline-block",height:"100%"},bn=b.memo(function({showTopList:e=!1}){const n=M("listState"),o=Ct("sizeRanges"),r=M("useWindowScroll"),s=M("customScrollParent"),i=Ct("windowScrollContainerState"),l=Ct("scrollContainerState"),c=s||r?i:l,d=M("itemContent"),m=M("context"),v=M("groupContent"),p=M("trackItemSizes"),x=M("itemSize"),w=M("log"),E=Ct("gap"),h=M("horizontalDirection"),{callbackRef:f}=Gn(o,x,p,e?Zt:c,w,E,s,h,M("skipAnimationFrameInResizeObserver")),[a,I]=b.useState(0);nn("deviation",F=>{a!==F&&I(F)});const H=M("EmptyPlaceholder"),y=M("ScrollSeekPlaceholder")??ur,L=M("ListComponent"),u=M("ItemComponent"),g=M("GroupComponent"),C=M("computeItemKey"),O=M("isSeeking"),k=M("groupIndices").length>0,W=M("alignToBottom"),_=M("initialItemFinalLocationReached"),Z=e?{}:{boxSizing:"border-box",...h?{display:"inline-block",height:"100%",marginInlineStart:a===0?W?"auto":0:a,paddingInlineEnd:n.offsetBottom,paddingInlineStart:n.offsetTop,whiteSpace:"nowrap"}:{marginTop:a===0?W?"auto":0:a,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},..._?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&H!==null&&H!==void 0?V.jsx(H,{...ot(H,m)}):V.jsx(L,{...ot(L,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:f,style:Z,children:(e?n.topItems:n.items).map(F=>{const ft=F.originalIndex,U=C(ft+n.firstItemIndex,F.data,m);return O?b.createElement(y,{...ot(y,m),height:F.size,index:F.index,key:U,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?b.createElement(g,{...ot(g,m),"data-index":ft,"data-item-index":F.index,"data-known-size":F.size,key:U,style:ar},v(F.index,m)):b.createElement(u,{...ot(u,m),...io(u,F.data),"data-index":ft,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:U,style:h?dr:so},k?d(F.index,F.groupIndex,F.data,m):d(F.index,F.data,m))})})}),fr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},mr={outline:"none",overflowX:"auto",position:"relative"},be=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),Qe=(t,e,n=0)=>({...be(t),position:e?"relative":"absolute",top:e?-n:0}),pr={position:Xe(),top:0,width:"100%",zIndex:1};function ot(t,e){if(typeof t!="string")return{context:e}}function io(t,e){return{item:typeof t=="string"?void 0:e}}const hr=b.memo(function(){const e=M("HeaderComponent"),n=Ct("headerHeight"),o=M("HeaderFooterTag"),r=Lt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,M("skipAnimationFrameInResizeObserver")),s=M("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null}),gr=b.memo(function(){const e=M("FooterComponent"),n=Ct("footerHeight"),o=M("HeaderFooterTag"),r=Lt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,M("skipAnimationFrameInResizeObserver")),s=M("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null});function tn({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("scrollContainerState"),m=e("ScrollerComponent"),v=n("smoothScrollTargetReached"),p=e("scrollerRef"),x=e("horizontalDirection")||!1,{scrollByCallback:w,scrollerRef:E,scrollToCallback:h}=ro(d,v,m,p,void 0,x);t("scrollTo",h),t("scrollBy",w);const f=x?mr:fr;return V.jsx(m,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:E,style:{...f,...i},tabIndex:0,...c,...ot(m,l),children:s})})}function en({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("windowScrollContainerState"),m=e("ScrollerComponent"),v=n("smoothScrollTargetReached"),p=e("totalListHeight"),x=e("deviation"),w=e("customScrollParent"),E=b.useRef(null),h=e("scrollerRef"),{scrollByCallback:f,scrollerRef:a,scrollToCallback:I}=ro(d,v,m,h,w);return oo(()=>(a.current=w??E.current?.ownerDocument.defaultView,()=>{a.current=null}),[a,w]),t("windowScrollTo",I),t("scrollBy",f),V.jsx(m,{ref:E,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...p===0?void 0:{height:p+x}},...c,...ot(m,l),children:s})})}const xr=({children:t})=>{const e=b.useContext(me),n=Ct("viewportHeight"),o=Ct("fixedItemHeight"),r=M("alignToBottom"),s=M("horizontalDirection"),i=b.useMemo(()=>ne(n,c=>Et(c,s?"width":"height")),[n,s]),l=Lt(i,!0,M("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:l,style:be(r),children:t})},Ir=({children:t})=>{const e=b.useContext(me),n=Ct("windowViewportRect"),o=Ct("fixedItemHeight"),r=M("customScrollParent"),s=M("useWindowScroll"),i=M("topListHeight"),l=_e(n,r,M("skipAnimationFrameInResizeObserver")),c=M("alignToBottom");return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:l,style:Qe(c,s,i),children:t})},Sr=({children:t})=>{const e=M("TopItemListComponent")??"div",n=M("headerHeight"),o={...pr,marginTop:`${n}px`},r=M("context");return V.jsx(e,{style:o,...ot(e,r),children:t})},vr=b.memo(function(e){const n=M("useWindowScroll"),o=M("topItemsIndexes").length>0,r=M("customScrollParent"),s=M("context"),i=r||n?Cr:Tr,l=r||n?Ir:xr;return V.jsxs(i,{...e,context:s,children:[o&&V.jsx(Sr,{children:V.jsx(bn,{showTopList:!0})}),V.jsxs(l,{children:[V.jsx(hr,{}),V.jsx(bn,{}),V.jsx(gr,{})]})]})}),{Component:lo,useEmitter:nn,useEmitterValue:M,usePublisher:Ct}=Ye(cr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},vr),Tr=tn({useEmitter:nn,useEmitterValue:M,usePublisher:Ct}),Cr=en({useEmitter:nn,useEmitterValue:M,usePublisher:Ct}),wr=lo,yr=lo,br=q(()=>{const t=T(d=>V.jsxs("td",{children:["Item $",d]})),e=T(null),n=T(d=>V.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=T(null),r=T(null),s=T({}),i=T(Je),l=T(Zt),c=(d,m=null)=>ht(S(s,B(v=>v[d]),nt()),m);return{components:s,computeItemKey:i,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}}),Rr=q(([t,e])=>({...t,...e}),rt(no,br)),Er=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{height:t}})}),Hr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{border:0,height:t,padding:0}})}),Br={overflowAnchor:"none"},Rn={position:Xe(),zIndex:2,overflowAnchor:"none"},En=b.memo(function({showTopList:e=!1}){const n=j("listState"),o=j("computeItemKey"),r=j("firstItemIndex"),s=j("context"),i=j("isSeeking"),l=j("fixedHeaderHeight"),c=j("groupIndices").length>0,d=j("itemContent"),m=j("groupContent"),v=j("ScrollSeekPlaceholder")??Er,p=j("GroupComponent"),x=j("TableRowComponent"),w=(e?n.topItems:[]).reduce((h,f,a)=>(a===0?h.push(f.size):h.push(h[a-1]+f.size),h),[]);return(e?n.topItems:n.items).map(h=>{const f=h.originalIndex,a=o(f+r,h.data,s),I=e?f===0?0:w[f-1]:0;return i?b.createElement(v,{...ot(v,s),height:h.size,index:h.index,key:a,type:h.type||"item"}):h.type==="group"?b.createElement(p,{...ot(p,s),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,key:a,style:{...Rn,top:l}},m(h.index,s)):b.createElement(x,{...ot(x,s),...io(x,h.data),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,"data-item-group-index":h.groupIndex,key:a,style:e?{...Rn,top:l+I}:Br},c?d(h.index,h.groupIndex,h.data,s):d(h.index,h.data,s))})}),kr=b.memo(function(){const e=j("listState"),n=j("topItemsIndexes").length>0,o=bt("sizeRanges"),r=j("useWindowScroll"),s=j("customScrollParent"),i=bt("windowScrollContainerState"),l=bt("scrollContainerState"),c=s||r?i:l,d=j("trackItemSizes"),m=j("itemSize"),v=j("log"),{callbackRef:p,ref:x}=Gn(o,m,d,c,v,void 0,s,!1,j("skipAnimationFrameInResizeObserver")),[w,E]=b.useState(0);on("deviation",k=>{w!==k&&(x.current.style.marginTop=`${k}px`,E(k))});const h=j("EmptyPlaceholder"),f=j("FillerRow")??Hr,a=j("TableBodyComponent"),I=j("paddingTopAddition"),H=j("statefulTotalCount"),y=j("context");if(H===0&&h!==null&&h!==void 0)return V.jsx(h,{...ot(h,y)});const L=(n?e.topItems:[]).reduce((k,W)=>k+W.size,0),u=e.offsetTop+I+w-L,g=e.offsetBottom,C=u>0?V.jsx(f,{context:y,height:u},"padding-top"):null,O=g>0?V.jsx(f,{context:y,height:g},"padding-bottom"):null;return V.jsxs(a,{"data-testid":"virtuoso-item-list",ref:p,...ot(a,y),children:[C,n&&V.jsx(En,{showTopList:!0}),V.jsx(En,{}),O]})}),Lr=({children:t})=>{const e=b.useContext(me),n=bt("viewportHeight"),o=bt("fixedItemHeight"),r=Lt(b.useMemo(()=>ne(n,s=>Et(s,"height")),[n]),!0,j("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:r,style:be(!1),children:t})},Or=({children:t})=>{const e=b.useContext(me),n=bt("windowViewportRect"),o=bt("fixedItemHeight"),r=j("customScrollParent"),s=j("useWindowScroll"),i=_e(n,r,j("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:i,style:Qe(!1,s),children:t})},zr=b.memo(function(e){const n=j("useWindowScroll"),o=j("customScrollParent"),r=bt("fixedHeaderHeight"),s=bt("fixedFooterHeight"),i=j("fixedHeaderContent"),l=j("fixedFooterContent"),c=j("context"),d=Lt(b.useMemo(()=>ne(r,a=>Et(a,"height")),[r]),!0,j("skipAnimationFrameInResizeObserver")),m=Lt(b.useMemo(()=>ne(s,a=>Et(a,"height")),[s]),!0,j("skipAnimationFrameInResizeObserver")),v=o||n?Vr:Fr,p=o||n?Or:Lr,x=j("TableComponent"),w=j("TableHeadComponent"),E=j("TableFooterComponent"),h=i?V.jsx(w,{ref:d,style:{position:"sticky",top:0,zIndex:2},...ot(w,c),children:i()},"TableHead"):null,f=l?V.jsx(E,{ref:m,style:{bottom:0,position:"sticky",zIndex:1},...ot(E,c),children:l()},"TableFoot"):null;return V.jsx(v,{...e,...ot(v,c),children:V.jsx(p,{children:V.jsxs(x,{style:{borderSpacing:0,overflowAnchor:"none"},...ot(x,c),children:[h,V.jsx(kr,{},"TableBody"),f]})})})}),{Component:co,useEmitter:on,useEmitterValue:j,usePublisher:bt}=Ye(Rr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},zr),Fr=tn({useEmitter:on,useEmitterValue:j,usePublisher:bt}),Vr=en({useEmitter:on,useEmitterValue:j,usePublisher:bt}),Wr=co,Gr=co,Hn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Pr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Bn,floor:Te,max:ee,min:Le,round:kn}=Math;function Ln(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Mr(t){return{...Pr,items:t}}function xe(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function Ar(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const jr=q(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:d,smoothScrollTargetReached:m,viewportHeight:v},p,x,{didMount:w,propsReady:E},{customScrollParent:h,useWindowScroll:f,windowScrollContainerState:a,windowScrollTo:I,windowViewportRect:H},y])=>{const L=T(0),u=T(0),g=T(Hn),C=T({height:0,width:0}),O=T({height:0,width:0}),k=$(),W=$(),_=T(0),Z=T(null),F=T({column:0,row:0}),ft=$(),U=$(),Q=T(!1),gt=T(0),lt=T(!0),It=T(!1),Ft=T(!1);Y(S(w,D(gt),P(([R,N])=>!Ge(N))),()=>{A(lt,!1)}),Y(S(at(w,lt,O,C,gt,It),P(([R,N,K,st,,tt])=>R&&!N&&K.height!==0&&st.height!==0&&!tt)),([,,,,R])=>{if(R===void 0){A(lt,!0);return}A(It,!0),$e(1,()=>{A(k,R)}),yt(S(d),()=>{A(e,[0,0]),A(lt,!0)})}),z(S(U,P(R=>R!=null&&R.scrollTop>0),Bt(0)),u),Y(S(w,D(U),P(([,R])=>R!=null)),([,R])=>{R&&(A(C,R.viewport),A(O,R.item),A(F,R.gap),R.scrollTop>0&&(A(Q,!0),yt(S(d,Nt(1)),N=>{A(Q,!1)}),A(c,{top:R.scrollTop})))}),z(S(C,B(({height:R})=>R)),v),z(S(at(G(C,xe),G(O,xe),G(F,(R,N)=>R!==void 0&&R.column===N.column&&R.row===N.row),G(d)),B(([R,N,K,st])=>({gap:K,item:N,scrollTop:st,viewport:R}))),ft),z(S(at(G(L),o,G(F,Ar),G(O,xe),G(C,xe),G(Z),G(u),G(Q),G(lt),G(gt)),P(([,,,,,,,R])=>!R),B(([R,[N,K],st,tt,X,ct,St,,ut,Vt])=>{const{column:Wt,row:Qt}=st,{height:pe,width:Re}=tt,{width:rn}=X;if(St===0&&(R===0||rn===0))return Hn;if(Re===0){const an=Ue(Vt,R),mo=an+Math.max(St-1,0);return Mr(Ln(an,mo,ct))}const he=uo(rn,Re,Wt);let Ut,At;ut?N===0&&K===0&&St>0?(Ut=0,At=St-1):(Ut=he*Te((N+Qt)/(pe+Qt)),At=he*Bn((K+Qt)/(pe+Qt))-1,At=Le(R-1,ee(At,he-1)),Ut=Le(At,ee(0,Ut))):(Ut=0,At=-1);const sn=Ln(Ut,At,ct),{bottom:ln,top:cn}=On(X,st,tt,sn),un=Bn(R/he),fo=un*pe+(un-1)*Qt-ln;return{bottom:ln,itemHeight:pe,items:sn,itemWidth:Re,offsetBottom:fo,offsetTop:cn,top:cn}})),g),z(S(Z,P(R=>R!==null),B(R=>R.length)),L),z(S(at(C,O,g,F),P(([R,N,{items:K}])=>K.length>0&&N.height!==0&&R.height!==0),B(([R,N,{items:K},st])=>{const{bottom:tt,top:X}=On(R,st,N,K);return[X,tt]}),nt(se)),e);const pt=T(!1);z(S(d,D(pt),B(([R,N])=>N||R!==0)),pt);const $t=Tt(S(at(g,L),P(([{items:R}])=>R.length>0),D(pt),P(([[R,N],K])=>{const tt=R.items[R.items.length-1].index===N-1;return(K||R.bottom>0&&R.itemHeight>0&&R.offsetBottom===0&&R.items.length===N)&&tt}),B(([[,R]])=>R-1),nt())),Xt=Tt(S(G(g),P(({items:R})=>R.length>0&&R[0].index===0),Bt(0),nt())),Ht=Tt(S(G(g),D(Q),P(([{items:R},N])=>R.length>0&&!N),B(([{items:R}])=>({endIndex:R[R.length-1].index,startIndex:R[0].index})),nt(Nn),zt(0)));z(Ht,x.scrollSeekRangeChanged),z(S(k,D(C,O,L,F),B(([R,N,K,st,tt])=>{const X=qn(R),{align:ct,behavior:St,offset:ut}=X;let Vt=X.index;Vt==="LAST"&&(Vt=st-1),Vt=ee(0,Vt,Le(st-1,Vt));let Wt=Pe(N,tt,K,Vt);return ct==="end"?Wt=kn(Wt-N.height+K.height):ct==="center"&&(Wt=kn(Wt-N.height/2+K.height/2)),ut!==void 0&&ut!==0&&(Wt+=ut),{behavior:St,top:Wt}})),c);const Jt=ht(S(g,B(R=>R.offsetBottom+R.bottom)),0);return z(S(H,B(R=>({height:R.visibleHeight,width:R.visibleWidth}))),C),{customScrollParent:h,data:Z,deviation:_,footerHeight:r,gap:F,headerHeight:s,increaseViewportBy:t,initialItemCount:u,itemDimensions:O,overscan:n,restoreStateFrom:U,scrollBy:i,scrollContainerState:l,scrollHeight:W,scrollTo:c,scrollToIndex:k,scrollTop:d,smoothScrollTargetReached:m,totalCount:L,useWindowScroll:f,viewportDimensions:C,windowScrollContainerState:a,windowScrollTo:I,windowViewportRect:H,...x,gridState:g,horizontalDirection:Ft,initialTopMostItemIndex:gt,totalListHeight:Jt,...p,endReached:$t,propsReady:E,rangeChanged:Ht,startReached:Xt,stateChanged:ft,stateRestoreInProgress:Q,...y}},rt(Ke,xt,fe,to,Mt,qe,Pt));function uo(t,e,n){return ee(1,Te((t+n)/(Te(e)+n)))}function On(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Pe(t,e,n,o[0].index);return{bottom:Pe(t,e,n,o[o.length-1].index)+r,top:s}}function Pe(t,e,n,o){const r=uo(t.width,n.width,e.column),s=Te(o/r),i=s*n.height+ee(0,s-1)*e.row;return i>0?i+e.row:i}const _r=q(()=>{const t=T(v=>`Item ${v}`),e=T({}),n=T(null),o=T("virtuoso-grid-item"),r=T("virtuoso-grid-list"),s=T(Je),i=T("div"),l=T(Zt),c=(v,p=null)=>ht(S(e,B(x=>x[v]),nt()),p),d=T(!1),m=T(!1);return z(G(m),d),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:o,ItemComponent:c("Item","div"),itemContent:t,listClassName:r,ListComponent:c("List","div"),readyStateChanged:d,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Nr=q(([t,e])=>({...t,...e}),rt(jr,_r)),Dr=b.memo(function(){const e=et("gridState"),n=et("listClassName"),o=et("itemClassName"),r=et("itemContent"),s=et("computeItemKey"),i=et("isSeeking"),l=wt("scrollHeight"),c=et("ItemComponent"),d=et("ListComponent"),m=et("ScrollSeekPlaceholder"),v=et("context"),p=wt("itemDimensions"),x=wt("gap"),w=et("log"),E=et("stateRestoreInProgress"),h=wt("reportReadyState"),f=Lt(b.useMemo(()=>a=>{const I=a.parentElement.parentElement.scrollHeight;l(I);const H=a.firstChild;if(H!==null){const{height:y,width:L}=H.getBoundingClientRect();p({height:y,width:L})}x({column:zn("column-gap",getComputedStyle(a).columnGap,w),row:zn("row-gap",getComputedStyle(a).rowGap,w)})},[l,p,x,w]),!0,!1);return oo(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),E?null:V.jsx(d,{className:n,ref:f,...ot(d,v),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(a=>{const I=s(a.index,a.data,v);return i?V.jsx(m,{...ot(m,v),height:e.itemHeight,index:a.index,width:e.itemWidth},I):b.createElement(c,{...ot(c,v),className:o,"data-index":a.index,key:I},r(a.index,a.data,v))})})}),$r=b.memo(function(){const e=et("HeaderComponent"),n=wt("headerHeight"),o=et("headerFooterTag"),r=Lt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=et("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null}),Ur=b.memo(function(){const e=et("FooterComponent"),n=wt("footerHeight"),o=et("headerFooterTag"),r=Lt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=et("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...ot(e,s)})}):null}),Kr=({children:t})=>{const e=b.useContext(Ze),n=wt("itemDimensions"),o=wt("viewportDimensions"),r=Lt(b.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return b.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,o,n]),V.jsx("div",{ref:r,style:be(!1),children:t})},qr=({children:t})=>{const e=b.useContext(Ze),n=wt("windowViewportRect"),o=wt("itemDimensions"),r=et("customScrollParent"),s=et("useWindowScroll"),i=_e(n,r,!1);return b.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),V.jsx("div",{ref:i,style:Qe(!1,s),children:t})},Yr=b.memo(function({...e}){const n=et("useWindowScroll"),o=et("customScrollParent"),r=o||n?Jr:Xr,s=o||n?qr:Kr,i=et("context");return V.jsx(r,{...e,...ot(r,i),children:V.jsxs(s,{children:[V.jsx($r,{}),V.jsx(Dr,{}),V.jsx(Ur,{})]})})}),{Component:Zr,useEmitter:ao,useEmitterValue:et,usePublisher:wt}=Ye(Nr,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Yr),Xr=tn({useEmitter:ao,useEmitterValue:et,usePublisher:wt}),Jr=en({useEmitter:ao,useEmitterValue:et,usePublisher:wt});function zn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}const Qr=Zr;exports.GroupedTableVirtuoso=Gr;exports.GroupedVirtuoso=yr;exports.LogLevel=dt;exports.TableVirtuoso=Wr;exports.Virtuoso=wr;exports.VirtuosoGrid=Qr;exports.VirtuosoGridMockContext=Ze;exports.VirtuosoMockContext=me;
package/dist/index.mjs CHANGED
@@ -195,7 +195,7 @@ function Tt(t) {
195
195
  return ye(U(), (e) => z(t, e));
196
196
  }
197
197
  const wo = { singleton: !0 };
198
- function j(t, e = [], n = wo) {
198
+ function q(t, e = [], n = wo) {
199
199
  const { singleton: o } = n;
200
200
  return {
201
201
  constructor: t,
@@ -247,7 +247,7 @@ function Fe(...t) {
247
247
  }
248
248
  };
249
249
  }
250
- const ft = {
250
+ const mt = {
251
251
  /** Detailed debugging information including item measurements */
252
252
  DEBUG: 0,
253
253
  /** General informational messages */
@@ -257,15 +257,15 @@ const ft = {
257
257
  /** Error messages for failures (default level) */
258
258
  ERROR: 3
259
259
  }, Ro = {
260
- [ft.DEBUG]: "debug",
261
- [ft.ERROR]: "error",
262
- [ft.INFO]: "log",
263
- [ft.WARN]: "warn"
264
- }, Ho = () => typeof globalThis > "u" ? window : globalThis, Gt = j(
260
+ [mt.DEBUG]: "debug",
261
+ [mt.ERROR]: "error",
262
+ [mt.INFO]: "log",
263
+ [mt.WARN]: "warn"
264
+ }, Ho = () => typeof globalThis > "u" ? window : globalThis, Gt = q(
265
265
  () => {
266
- const t = T(ft.ERROR);
266
+ const t = T(mt.ERROR);
267
267
  return {
268
- log: T((n, o, r = ft.INFO) => {
268
+ log: T((n, o, r = mt.INFO) => {
269
269
  const s = Ho().VIRTUOSO_LOG_LEVEL ?? it(t);
270
270
  r >= s && console[Ro[r]](
271
271
  "%creact-virtuoso: %c%s %o",
@@ -345,7 +345,7 @@ function Bo(t, e, n, o) {
345
345
  if (l.dataset.index === void 0)
346
346
  continue;
347
347
  const c = parseInt(l.dataset.index, 10), d = parseFloat(l.dataset.knownSize), m = e(l, n);
348
- if (m === 0 && o("Zero-sized element, this should not happen", { child: l }, ft.ERROR), m === d)
348
+ if (m === 0 && o("Zero-sized element, this should not happen", { child: l }, mt.ERROR), m === d)
349
349
  continue;
350
350
  const v = s[s.length - 1];
351
351
  s.length === 0 || v.size !== m || v.endIndex !== c - 1 ? s.push({ endIndex: c, size: m, startIndex: c }) : s[s.length - 1].endIndex++;
@@ -353,7 +353,7 @@ function Bo(t, e, n, o) {
353
353
  return s;
354
354
  }
355
355
  function gn(t, e, n) {
356
- return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ft.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
356
+ return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
357
357
  }
358
358
  function $e(t, e, n) {
359
359
  const o = E.useRef(null), r = E.useCallback(
@@ -397,7 +397,7 @@ function $e(t, e, n) {
397
397
  };
398
398
  }, [l, e, i]), s;
399
399
  }
400
- const It = j(
400
+ const It = q(
401
401
  () => {
402
402
  const t = U(), e = U(), n = T(0), o = U(), r = T(0), s = U(), i = U(), l = T(0), c = T(0), d = T(0), m = T(0), v = U(), p = U(), I = T(!1), w = T(!1), R = T(!1);
403
403
  return z(
@@ -468,7 +468,7 @@ function Rt(t, e, n = "k") {
468
468
  return Rt(t.l, e, n);
469
469
  }
470
470
  function vt(t, e, n) {
471
- return J(t) ? Nn(e, n, 1) : e === t.k ? dt(t, { k: e, v: n }) : e < t.k ? In(dt(t, { l: vt(t.l, e, n) })) : In(dt(t, { r: vt(t.r, e, n) }));
471
+ return J(t) ? Nn(e, n, 1) : e === t.k ? ft(t, { k: e, v: n }) : e < t.k ? In(ft(t, { l: vt(t.l, e, n) })) : In(ft(t, { r: vt(t.r, e, n) }));
472
472
  }
473
473
  function Yt() {
474
474
  return se;
@@ -489,9 +489,9 @@ function Ve(t, e) {
489
489
  if (J(r))
490
490
  return o;
491
491
  const [s, i] = _n(o);
492
- return xe(dt(t, { k: s, l: Mn(o), v: i }));
492
+ return xe(ft(t, { k: s, l: Mn(o), v: i }));
493
493
  }
494
- return e < n ? xe(dt(t, { l: Ve(o, e) })) : xe(dt(t, { r: Ve(r, e) }));
494
+ return e < n ? xe(ft(t, { l: Ve(o, e) })) : xe(ft(t, { r: Ve(r, e) }));
495
495
  }
496
496
  function Nt(t) {
497
497
  return J(t) ? [] : [...Nt(t.l), { k: t.k, v: t.v }, ...Nt(t.r)];
@@ -509,12 +509,12 @@ function xe(t) {
509
509
  return t;
510
510
  if (n > o.lvl + 1) {
511
511
  if (Be(e))
512
- return Dn(dt(t, { lvl: n - 1 }));
512
+ return Dn(ft(t, { lvl: n - 1 }));
513
513
  if (!J(e) && !J(e.r))
514
- return dt(e.r, {
515
- l: dt(e, { r: e.r.l }),
514
+ return ft(e.r, {
515
+ l: ft(e, { r: e.r.l }),
516
516
  lvl: n,
517
- r: dt(t, {
517
+ r: ft(t, {
518
518
  l: e.r.r,
519
519
  lvl: n - 1
520
520
  })
@@ -522,21 +522,21 @@ function xe(t) {
522
522
  throw new Error("Unexpected empty nodes");
523
523
  }
524
524
  if (Be(t))
525
- return Pe(dt(t, { lvl: n - 1 }));
525
+ return Pe(ft(t, { lvl: n - 1 }));
526
526
  if (!J(o) && !J(o.l)) {
527
527
  const r = o.l, s = Be(r) ? o.lvl - 1 : o.lvl;
528
- return dt(r, {
529
- l: dt(t, {
528
+ return ft(r, {
529
+ l: ft(t, {
530
530
  lvl: n - 1,
531
531
  r: r.l
532
532
  }),
533
533
  lvl: r.lvl + 1,
534
- r: Pe(dt(o, { l: r.r, lvl: s }))
534
+ r: Pe(ft(o, { l: r.r, lvl: s }))
535
535
  });
536
536
  }
537
537
  throw new Error("Unexpected empty nodes");
538
538
  }
539
- function dt(t, e) {
539
+ function ft(t, e) {
540
540
  return Nn(
541
541
  e.k === void 0 ? t.k : e.k,
542
542
  e.v === void 0 ? t.v : e.v,
@@ -546,7 +546,7 @@ function dt(t, e) {
546
546
  );
547
547
  }
548
548
  function Mn(t) {
549
- return J(t.r) ? t.l : xe(dt(t, { r: Mn(t.r) }));
549
+ return J(t.r) ? t.l : xe(ft(t, { r: Mn(t.r) }));
550
550
  }
551
551
  function Be(t) {
552
552
  return J(t) || t.lvl > t.r.lvl;
@@ -562,11 +562,11 @@ function In(t) {
562
562
  }
563
563
  function Dn(t) {
564
564
  const { l: e } = t;
565
- return !J(e) && e.lvl === t.lvl ? dt(e, { r: dt(t, { l: e.r }) }) : t;
565
+ return !J(e) && e.lvl === t.lvl ? ft(e, { r: ft(t, { l: e.r }) }) : t;
566
566
  }
567
567
  function Pe(t) {
568
568
  const { lvl: e, r: n } = t;
569
- return !J(n) && !J(n.r) && n.lvl === e && n.r.lvl === e ? dt(n, { l: dt(t, { r: n.l }), lvl: e + 1 }) : t;
569
+ return !J(n) && !J(n.r) && n.lvl === e && n.r.lvl === e ? ft(n, { l: ft(t, { r: n.l }), lvl: e + 1 }) : t;
570
570
  }
571
571
  function Oo(t) {
572
572
  return An(t, ({ k: e, v: n }) => ({ index: e, value: n }));
@@ -577,7 +577,7 @@ function $n(t, e) {
577
577
  function le(t, e) {
578
578
  return !!(t && t[0] === e[0] && t[1] === e[1]);
579
579
  }
580
- const Ue = j(
580
+ const Ue = q(
581
581
  () => ({ recalcInProgress: T(!1) }),
582
582
  [],
583
583
  { singleton: !0 }
@@ -676,7 +676,7 @@ function Wo(t, e, n, o = 0) {
676
676
  return o > 0 && (e = Math.max(e, Un(t, o, Ke).offset)), An(ko(t, e, n, Vo), Ao);
677
677
  }
678
678
  function Po(t, [e, n, o, r]) {
679
- e.length > 0 && o("received item sizes", e, ft.DEBUG);
679
+ e.length > 0 && o("received item sizes", e, mt.DEBUG);
680
680
  const s = t.sizeTree;
681
681
  let i = s, l = 0;
682
682
  if (n.length > 0 && J(s) && e.length === 2) {
@@ -743,7 +743,7 @@ function Mo(t) {
743
743
  const _o = {
744
744
  offsetHeight: "height",
745
745
  offsetWidth: "width"
746
- }, Lt = j(
746
+ }, Lt = q(
747
747
  ([{ log: t }, { recalcInProgress: e }]) => {
748
748
  const n = U(), o = U(), r = ht(o, 0), s = U(), i = U(), l = T(0), c = T([]), d = T(void 0), m = T(void 0), v = T(void 0), p = T(void 0), I = T((u, g) => Ht(u, _o[g])), w = T(void 0), R = T(0), h = Lo(), f = ht(
749
749
  x(n, $(c, t, R), Ot(Po, h), nt()),
@@ -893,7 +893,7 @@ const _o = {
893
893
  u < 0 && g(
894
894
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
895
895
  { firstItemIndex: l },
896
- ft.ERROR
896
+ mt.ERROR
897
897
  );
898
898
  });
899
899
  const y = Tt(s);
@@ -907,27 +907,27 @@ const _o = {
907
907
  const V = ie(g.sizeTree, 0);
908
908
  let N = 0, Z = 0;
909
909
  for (; N < u; ) {
910
- const q = g.groupIndices[Z], Q = g.groupIndices.length === Z + 1 ? 1 / 0 : g.groupIndices[Z + 1] - q - 1;
910
+ const K = g.groupIndices[Z], Q = g.groupIndices.length === Z + 1 ? 1 / 0 : g.groupIndices[Z + 1] - K - 1;
911
911
  L.push({
912
- endIndex: q,
912
+ endIndex: K,
913
913
  size: V,
914
- startIndex: q
914
+ startIndex: K
915
915
  }), L.push({
916
- endIndex: q + 1 + Q - 1,
916
+ endIndex: K + 1 + Q - 1,
917
917
  size: O,
918
- startIndex: q + 1
918
+ startIndex: K + 1
919
919
  }), Z++, N += Q + 1;
920
920
  }
921
921
  const F = Nt(g.sizeTree);
922
922
  return N !== u && F.shift(), F.reduce(
923
- (q, { k: Q, v: gt }) => {
924
- let lt = q.ranges;
925
- return q.prevSize !== 0 && (lt = [
926
- ...q.ranges,
923
+ (K, { k: Q, v: gt }) => {
924
+ let lt = K.ranges;
925
+ return K.prevSize !== 0 && (lt = [
926
+ ...K.ranges,
927
927
  {
928
928
  endIndex: Q + u - 1,
929
- size: q.prevSize,
930
- startIndex: q.prevIndex
929
+ size: K.prevSize,
930
+ startIndex: K.prevIndex
931
931
  }
932
932
  ]), {
933
933
  prevIndex: Q + u,
@@ -978,14 +978,14 @@ const _o = {
978
978
  return g;
979
979
  let V = Yt();
980
980
  const N = it(a);
981
- let Z = 0, F = 0, mt = 0;
981
+ let Z = 0, F = 0, dt = 0;
982
982
  for (; Z < -u; ) {
983
- mt = N[F];
984
- const Q = N[F + 1] - mt - 1;
983
+ dt = N[F];
984
+ const Q = N[F + 1] - dt - 1;
985
985
  F++, Z += Q + 1;
986
986
  }
987
987
  if (V = Nt(g.sizeTree).reduce((Q, { k: gt, v: lt }) => vt(Q, Math.max(0, gt + u), lt), V), Z !== -u) {
988
- const Q = ie(g.sizeTree, mt);
988
+ const Q = ie(g.sizeTree, dt);
989
989
  V = vt(V, 0, Q);
990
990
  const gt = Rt(g.sizeTree, -u + 1)[1];
991
991
  V = vt(V, 1, gt);
@@ -1041,7 +1041,7 @@ function No(t) {
1041
1041
  }
1042
1042
  );
1043
1043
  }
1044
- const qn = j(
1044
+ const qn = q(
1045
1045
  ([{ groupIndices: t, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r }]) => {
1046
1046
  const s = U(), i = U(), l = Tt(x(s, B(No)));
1047
1047
  return z(
@@ -1068,7 +1068,7 @@ const qn = j(
1068
1068
  ), { groupCounts: s, topItemsIndexes: i };
1069
1069
  },
1070
1070
  rt(Lt, It)
1071
- ), At = j(
1071
+ ), At = q(
1072
1072
  ([{ log: t }]) => {
1073
1073
  const e = T(!1), n = Tt(
1074
1074
  x(
@@ -1078,7 +1078,7 @@ const qn = j(
1078
1078
  )
1079
1079
  );
1080
1080
  return Y(e, (o) => {
1081
- o && it(t)("props updated", {}, ft.DEBUG);
1081
+ o && it(t)("props updated", {}, mt.DEBUG);
1082
1082
  }), { didMount: n, propsReady: e };
1083
1083
  },
1084
1084
  rt(Gt),
@@ -1088,7 +1088,7 @@ function Yn(t) {
1088
1088
  const e = typeof t == "number" ? { index: t } : { ...t };
1089
1089
  return e.align || (e.align = "start"), (!e.behavior || !Do) && (e.behavior = "auto"), e.offset === void 0 && (e.offset = 0), e;
1090
1090
  }
1091
- const fe = j(
1091
+ const fe = q(
1092
1092
  ([
1093
1093
  { gap: t, listRefresh: e, sizes: n, totalCount: o },
1094
1094
  {
@@ -1120,13 +1120,13 @@ const fe = j(
1120
1120
  N,
1121
1121
  Z
1122
1122
  ]) => {
1123
- const F = Yn(H), { align: mt, behavior: q, offset: Q } = F, gt = u - 1, lt = jn(F, y, gt);
1123
+ const F = Yn(H), { align: dt, behavior: K, offset: Q } = F, gt = u - 1, lt = jn(F, y, gt);
1124
1124
  let St = ce(lt, y.offsetTree, V) + C;
1125
- mt === "end" ? (St += N + Rt(y.sizeTree, lt)[1] - k + Z, lt === gt && (St += L)) : mt === "center" ? St += (N + Rt(y.sizeTree, lt)[1] - k + Z) / 2 : St -= g, Q !== void 0 && Q !== 0 && (St += Q);
1125
+ dt === "end" ? (St += N + Rt(y.sizeTree, lt)[1] - k + Z, lt === gt && (St += L)) : dt === "center" ? St += (N + Rt(y.sizeTree, lt)[1] - k + Z) / 2 : St -= g, Q !== void 0 && Q !== 0 && (St += Q);
1126
1126
  const Ft = (pt) => {
1127
- S(), pt ? (O("retrying to scroll to", { location: H }, ft.DEBUG), M(I, H)) : (M(w, !0), O("list did not change, scroll successful", {}, ft.DEBUG));
1127
+ S(), pt ? (O("retrying to scroll to", { location: H }, mt.DEBUG), M(I, H)) : (M(w, !0), O("list did not change, scroll successful", {}, mt.DEBUG));
1128
1128
  };
1129
- if (S(), q === "smooth") {
1129
+ if (S(), K === "smooth") {
1130
1130
  let pt = !1;
1131
1131
  a = Y(e, (jt) => {
1132
1132
  pt = pt || jt;
@@ -1137,7 +1137,7 @@ const fe = j(
1137
1137
  h = yt(x(e, $o(150)), Ft);
1138
1138
  return f = setTimeout(() => {
1139
1139
  S();
1140
- }, 1200), M(c, !0), O("scrolling from index to", { behavior: q, index: lt, top: St }, ft.DEBUG), { behavior: q, top: St };
1140
+ }, 1200), M(c, !0), O("scrolling from index to", { behavior: K, index: lt, top: St }, mt.DEBUG), { behavior: K, top: St };
1141
1141
  }
1142
1142
  )
1143
1143
  ),
@@ -1175,7 +1175,7 @@ function qe(t, e) {
1175
1175
  function Ae(t) {
1176
1176
  return t === void 0 ? !0 : typeof t == "number" ? t === 0 : t.index === 0 && (t.align === void 0 || t.align === "start") && (t.offset === void 0 || t.offset === 0);
1177
1177
  }
1178
- const me = j(
1178
+ const me = q(
1179
1179
  ([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
1180
1180
  const l = T(!0), c = T(0), d = T(!0);
1181
1181
  return z(
@@ -1235,7 +1235,7 @@ const ue = "up", ne = "down", Uo = "none", Ko = {
1235
1235
  scrollTop: 0,
1236
1236
  viewportHeight: 0
1237
1237
  }
1238
- }, jo = 0, pe = j(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
1238
+ }, jo = 0, pe = q(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
1239
1239
  const i = T(!1), l = T(!0), c = U(), d = U(), m = T(4), v = T(jo), p = ht(
1240
1240
  x(
1241
1241
  Fe(x(W(r), Ut(1), Bt(!0)), x(W(r), Ut(1), Bt(!1), pn(100))),
@@ -1373,7 +1373,7 @@ function vn(t, e, n) {
1373
1373
  function Tn(t, e) {
1374
1374
  return typeof t == "number" ? t : t[e] ?? 0;
1375
1375
  }
1376
- const Ye = j(
1376
+ const Ye = q(
1377
1377
  ([{ deviation: t, fixedHeaderHeight: e, headerHeight: n, scrollTop: o, viewportHeight: r }]) => {
1378
1378
  const s = U(), i = T(0), l = T(0), c = T(0), d = ht(
1379
1379
  x(
@@ -1514,7 +1514,7 @@ function Cn(t, e, n) {
1514
1514
  function wn(t, e) {
1515
1515
  return t === void 0 ? 0 : typeof t == "number" ? t : t[e] ?? 0;
1516
1516
  }
1517
- const Kt = j(
1517
+ const Kt = q(
1518
1518
  ([
1519
1519
  { data: t, firstItemIndex: e, gap: n, sizes: o, totalCount: r },
1520
1520
  s,
@@ -1559,17 +1559,17 @@ const Kt = j(
1559
1559
  N,
1560
1560
  Z,
1561
1561
  F,
1562
- mt,
1563
- q
1562
+ dt,
1563
+ K
1564
1564
  ]) => {
1565
1565
  const Q = L, { offsetTree: gt, sizeTree: lt } = Q, St = it(h);
1566
1566
  if (C === 0)
1567
1567
  return { ...Oe, totalCount: C };
1568
1568
  if (u === 0 && g === 0)
1569
- return St === 0 ? { ...Oe, totalCount: C } : Xn(St, O, L, Z, F, q || []);
1569
+ return St === 0 ? { ...Oe, totalCount: C } : Xn(St, O, L, Z, F, K || []);
1570
1570
  if (J(lt))
1571
1571
  return St > 0 ? null : ve(
1572
- qo(qe(O, C), Q, q),
1572
+ qo(qe(O, C), Q, K),
1573
1573
  [],
1574
1574
  C,
1575
1575
  F,
@@ -1578,12 +1578,12 @@ const Kt = j(
1578
1578
  );
1579
1579
  const Ft = [];
1580
1580
  if (N.length > 0) {
1581
- const D = N[0], K = N[N.length - 1];
1581
+ const D = N[0], j = N[N.length - 1];
1582
1582
  let st = 0;
1583
- for (const tt of Zt(lt, D, K)) {
1584
- const X = tt.value, ct = Math.max(tt.start, D), xt = Math.min(tt.end, K);
1583
+ for (const tt of Zt(lt, D, j)) {
1584
+ const X = tt.value, ct = Math.max(tt.start, D), xt = Math.min(tt.end, j);
1585
1585
  for (let ut = ct; ut <= xt; ut++)
1586
- Ft.push({ data: q?.[ut], index: ut, offset: st, size: X }), st += X;
1586
+ Ft.push({ data: K?.[ut], index: ut, offset: st, size: X }), st += X;
1587
1587
  }
1588
1588
  }
1589
1589
  if (!V)
@@ -1592,38 +1592,38 @@ const Kt = j(
1592
1592
  if (jt.length === 0)
1593
1593
  return null;
1594
1594
  const Qt = C - 1, Et = ye([], (D) => {
1595
- for (const K of jt) {
1596
- const st = K.value;
1597
- let tt = st.offset, X = K.start;
1595
+ for (const j of jt) {
1596
+ const st = j.value;
1597
+ let tt = st.offset, X = j.start;
1598
1598
  const ct = st.size;
1599
1599
  if (st.offset < u) {
1600
1600
  X += Math.floor((u - st.offset + F) / (ct + F));
1601
- const ut = X - K.start;
1601
+ const ut = X - j.start;
1602
1602
  tt += ut * ct + ut * F;
1603
1603
  }
1604
1604
  X < pt && (tt += (pt - X) * ct, X = pt);
1605
- const xt = Math.min(K.end, Qt);
1605
+ const xt = Math.min(j.end, Qt);
1606
1606
  for (let ut = X; ut <= xt && !(tt >= g); ut++)
1607
- D.push({ data: q?.[ut], index: ut, offset: tt, size: ct }), tt += ct + F;
1607
+ D.push({ data: K?.[ut], index: ut, offset: tt, size: ct }), tt += ct + F;
1608
1608
  }
1609
- }), te = wn(mt, ae), b = wn(mt, de);
1609
+ }), te = wn(dt, ae), b = wn(dt, de);
1610
1610
  if (Et.length > 0 && (te > 0 || b > 0)) {
1611
- const D = Et[0], K = Et[Et.length - 1];
1611
+ const D = Et[0], j = Et[Et.length - 1];
1612
1612
  if (te > 0 && D.index > pt) {
1613
1613
  const st = Math.min(te, D.index - pt), tt = [];
1614
1614
  let X = D.offset;
1615
1615
  for (let ct = D.index - 1; ct >= D.index - st; ct--) {
1616
1616
  const ut = Zt(lt, ct, ct)[0]?.value ?? D.size;
1617
- X -= ut + F, tt.unshift({ data: q?.[ct], index: ct, offset: X, size: ut });
1617
+ X -= ut + F, tt.unshift({ data: K?.[ct], index: ct, offset: X, size: ut });
1618
1618
  }
1619
1619
  Et.unshift(...tt);
1620
1620
  }
1621
- if (b > 0 && K.index < Qt) {
1622
- const st = Math.min(b, Qt - K.index);
1623
- let tt = K.offset + K.size + F;
1624
- for (let X = K.index + 1; X <= K.index + st; X++) {
1625
- const xt = Zt(lt, X, X)[0]?.value ?? K.size;
1626
- Et.push({ data: q?.[X], index: X, offset: tt, size: xt }), tt += xt + F;
1621
+ if (b > 0 && j.index < Qt) {
1622
+ const st = Math.min(b, Qt - j.index);
1623
+ let tt = j.offset + j.size + F;
1624
+ for (let X = j.index + 1; X <= j.index + st; X++) {
1625
+ const xt = Zt(lt, X, X)[0]?.value ?? j.size;
1626
+ Et.push({ data: K?.[X], index: X, offset: tt, size: xt }), tt += xt + F;
1627
1627
  }
1628
1628
  }
1629
1629
  }
@@ -1722,7 +1722,7 @@ const Kt = j(
1722
1722
  Ue
1723
1723
  ),
1724
1724
  { singleton: !0 }
1725
- ), Jn = j(
1725
+ ), Jn = q(
1726
1726
  ([{ fixedFooterHeight: t, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r }]) => {
1727
1727
  const s = U(), i = ht(
1728
1728
  x(
@@ -1735,7 +1735,7 @@ const Kt = j(
1735
1735
  },
1736
1736
  rt(It, Kt),
1737
1737
  { singleton: !0 }
1738
- ), Yo = j(
1738
+ ), Yo = q(
1739
1739
  ([{ viewportHeight: t }, { totalListHeight: e }]) => {
1740
1740
  const n = T(!1), o = ht(
1741
1741
  x(
@@ -1751,7 +1751,7 @@ const Kt = j(
1751
1751
  },
1752
1752
  rt(It, Jn),
1753
1753
  { singleton: !0 }
1754
- ), Qn = j(() => ({
1754
+ ), Qn = q(() => ({
1755
1755
  context: T(null)
1756
1756
  })), Zo = ({
1757
1757
  itemBottom: t,
@@ -1759,7 +1759,7 @@ const Kt = j(
1759
1759
  locationParams: { align: n, behavior: o, ...r },
1760
1760
  viewportBottom: s,
1761
1761
  viewportTop: i
1762
- }) => e < i ? { ...r, align: n ?? "start", ...o === void 0 ? {} : { behavior: o } } : t > s ? { ...r, align: n ?? "end", ...o === void 0 ? {} : { behavior: o } } : null, to = j(
1762
+ }) => e < i ? { ...r, align: n ?? "start", ...o === void 0 ? {} : { behavior: o } } : t > s ? { ...r, align: n ?? "end", ...o === void 0 ? {} : { behavior: o } } : null, to = q(
1763
1763
  ([
1764
1764
  { gap: t, sizes: e, totalCount: n },
1765
1765
  { fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: c },
@@ -1803,7 +1803,7 @@ const Kt = j(
1803
1803
  function yn(t) {
1804
1804
  return t === !1 ? !1 : t === "smooth" ? "smooth" : "auto";
1805
1805
  }
1806
- const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1806
+ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = q(
1807
1807
  ([
1808
1808
  { listRefresh: t, totalCount: e, fixedItemSize: n, data: o },
1809
1809
  { atBottomState: r, isAtBottom: s },
@@ -1836,15 +1836,15 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1836
1836
  ),
1837
1837
  ({ followOutputBehavior: y, totalCount: k }) => {
1838
1838
  h !== null && (h(), h = null), it(n) === void 0 ? h = yt(t, () => {
1839
- it(m)("following output to ", { totalCount: k }, ft.DEBUG), f(y), h = null;
1839
+ it(m)("following output to ", { totalCount: k }, mt.DEBUG), f(y), h = null;
1840
1840
  }) : requestAnimationFrame(() => {
1841
- it(m)("following output to ", { totalCount: k }, ft.DEBUG), f(y);
1841
+ it(m)("following output to ", { totalCount: k }, mt.DEBUG), f(y);
1842
1842
  });
1843
1843
  }
1844
1844
  );
1845
1845
  function a(y) {
1846
1846
  const k = yt(r, (u) => {
1847
- y && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && h === null && (it(m)("scrolling to bottom due to increased size", {}, ft.DEBUG), f("auto"));
1847
+ y && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && h === null && (it(m)("scrolling to bottom due to increased size", {}, mt.DEBUG), f("auto"));
1848
1848
  });
1849
1849
  setTimeout(k, 100);
1850
1850
  }
@@ -1905,7 +1905,7 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1905
1905
  Qn,
1906
1906
  to
1907
1907
  )
1908
- ), Qo = j(
1908
+ ), Qo = q(
1909
1909
  ([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (z(
1910
1910
  x(
1911
1911
  l,
@@ -1918,7 +1918,7 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1918
1918
  ), {}),
1919
1919
  rt(Lt, me, Kt, At),
1920
1920
  { singleton: !0 }
1921
- ), tr = j(
1921
+ ), tr = q(
1922
1922
  ([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
1923
1923
  const o = T(0);
1924
1924
  return Y(
@@ -1948,7 +1948,7 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1948
1948
  },
1949
1949
  rt(At, It, Kt),
1950
1950
  { singleton: !0 }
1951
- ), eo = j(
1951
+ ), eo = q(
1952
1952
  ([{ scrollVelocity: t }]) => {
1953
1953
  const e = T(!1), n = U(), o = T(!1);
1954
1954
  return z(
@@ -1977,7 +1977,7 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1977
1977
  },
1978
1978
  rt(pe),
1979
1979
  { singleton: !0 }
1980
- ), Ze = j(([{ scrollContainerState: t, scrollTo: e }]) => {
1980
+ ), Ze = q(([{ scrollContainerState: t, scrollTo: e }]) => {
1981
1981
  const n = U(), o = U(), r = U(), s = T(!1), i = T(void 0);
1982
1982
  return z(
1983
1983
  x(
@@ -2009,7 +2009,7 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
2009
2009
  windowScrollTo: r,
2010
2010
  windowViewportRect: o
2011
2011
  };
2012
- }, rt(It)), er = j(
2012
+ }, rt(It)), er = q(
2013
2013
  ([
2014
2014
  { sizeRanges: t, sizes: e },
2015
2015
  { headerHeight: n, scrollTop: o },
@@ -2046,7 +2046,7 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
2046
2046
  function nr(t) {
2047
2047
  return { align: "start", index: 0, offset: t.scrollTop };
2048
2048
  }
2049
- const or = j(([{ topItemsIndexes: t }]) => {
2049
+ const or = q(([{ topItemsIndexes: t }]) => {
2050
2050
  const e = T(0);
2051
2051
  return z(
2052
2052
  x(
@@ -2061,7 +2061,7 @@ function no(t) {
2061
2061
  let e = !1, n;
2062
2062
  return (() => (e || (e = !0, n = t()), n));
2063
2063
  }
2064
- const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), sr = j(
2064
+ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), sr = q(
2065
2065
  ([
2066
2066
  { deviation: t, scrollBy: e, scrollingInProgress: n, scrollTop: o },
2067
2067
  { isAtBottom: r, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: l },
@@ -2085,7 +2085,7 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2085
2085
  P(([f]) => f !== 0),
2086
2086
  $(o, l, n, r, I, w),
2087
2087
  P(([, f, a, S, , , H]) => !H && !S && f !== 0 && a === ue),
2088
- B(([[f], , , , , a]) => (a("Upward scrolling compensation", { amount: f }, ft.DEBUG), f))
2088
+ B(([[f], , , , , a]) => (a("Upward scrolling compensation", { amount: f }, mt.DEBUG), f))
2089
2089
  )
2090
2090
  );
2091
2091
  function h(f) {
@@ -2138,7 +2138,7 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2138
2138
  ), { deviation: t };
2139
2139
  },
2140
2140
  rt(It, pe, Kt, Lt, Gt, Ue)
2141
- ), ir = j(
2141
+ ), ir = q(
2142
2142
  ([
2143
2143
  t,
2144
2144
  e,
@@ -2177,7 +2177,7 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2177
2177
  Gt,
2178
2178
  Qn
2179
2179
  )
2180
- ), oo = j(
2180
+ ), oo = q(
2181
2181
  ([
2182
2182
  {
2183
2183
  data: t,
@@ -2209,8 +2209,10 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2209
2209
  const { listState: L, minOverscanItemCount: O, topItemsIndexes: V, rangeChanged: N, ...Z } = H;
2210
2210
  return z(N, C.scrollSeekRangeChanged), z(
2211
2211
  x(
2212
- C.windowViewportRect,
2213
- B((F) => F.visibleHeight)
2212
+ at(C.windowViewportRect, f.headerHeight, f.fixedHeaderHeight),
2213
+ // Keep a measurement range active when a window-scrolling list starts below the viewport.
2214
+ // One content pixel beyond the headers is enough to render the probe item and estimate the full list height.
2215
+ B(([F, dt, K]) => Math.max(dt + K + 1, F.visibleHeight))
2214
2216
  ),
2215
2217
  f.viewportHeight
2216
2218
  ), {
@@ -2427,7 +2429,7 @@ function io(t, e, n, o = Jt, r, s) {
2427
2429
  function Qe(t) {
2428
2430
  return t;
2429
2431
  }
2430
- const ur = /* @__PURE__ */ j(() => {
2432
+ const ur = /* @__PURE__ */ q(() => {
2431
2433
  const t = T((l) => `Item ${l}`), e = T((l) => `Group ${l}`), n = T({}), o = T(Qe), r = T("div"), s = T(Jt), i = (l, c = null) => ht(
2432
2434
  x(
2433
2435
  n,
@@ -2453,7 +2455,7 @@ const ur = /* @__PURE__ */ j(() => {
2453
2455
  ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
2454
2456
  TopItemListComponent: i("TopItemList")
2455
2457
  };
2456
- }), ar = /* @__PURE__ */ j(
2458
+ }), ar = /* @__PURE__ */ q(
2457
2459
  ([t, e]) => ({ ...t, ...e }),
2458
2460
  rt(oo, ur)
2459
2461
  ), dr = ({ height: t }) => /* @__PURE__ */ G("div", { style: { height: t } }), fr = { overflowAnchor: "none", position: Je(), zIndex: 1 }, lo = { overflowAnchor: "none" }, mr = { ...lo, display: "inline-block", height: "100%" }, Rn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
@@ -2495,14 +2497,14 @@ const ur = /* @__PURE__ */ j(() => {
2495
2497
  ref: f,
2496
2498
  style: Z,
2497
2499
  children: (e ? n.topItems : n.items).map((F) => {
2498
- const mt = F.originalIndex, q = C(mt + n.firstItemIndex, F.data, m);
2500
+ const dt = F.originalIndex, K = C(dt + n.firstItemIndex, F.data, m);
2499
2501
  return L ? /* @__PURE__ */ Dt(
2500
2502
  y,
2501
2503
  {
2502
2504
  ...ot(y, m),
2503
2505
  height: F.size,
2504
2506
  index: F.index,
2505
- key: q,
2507
+ key: K,
2506
2508
  type: F.type || "item",
2507
2509
  ...F.type === "group" ? {} : { groupIndex: F.groupIndex }
2508
2510
  }
@@ -2510,10 +2512,10 @@ const ur = /* @__PURE__ */ j(() => {
2510
2512
  g,
2511
2513
  {
2512
2514
  ...ot(g, m),
2513
- "data-index": mt,
2515
+ "data-index": dt,
2514
2516
  "data-item-index": F.index,
2515
2517
  "data-known-size": F.size,
2516
- key: q,
2518
+ key: K,
2517
2519
  style: fr
2518
2520
  },
2519
2521
  v(F.index, m)
@@ -2522,11 +2524,11 @@ const ur = /* @__PURE__ */ j(() => {
2522
2524
  {
2523
2525
  ...ot(u, m),
2524
2526
  ...co(u, F.data),
2525
- "data-index": mt,
2527
+ "data-index": dt,
2526
2528
  "data-item-group-index": F.groupIndex,
2527
2529
  "data-item-index": F.index,
2528
2530
  "data-known-size": F.size,
2529
- key: q,
2531
+ key: K,
2530
2532
  style: h ? mr : lo
2531
2533
  },
2532
2534
  O ? d(F.index, F.groupIndex, F.data, m) : d(F.index, F.data, m)
@@ -2738,7 +2740,7 @@ const xr = ({ children: t }) => {
2738
2740
  }
2739
2741
  },
2740
2742
  Cr
2741
- ), wr = /* @__PURE__ */ en({ useEmitter: on, useEmitterValue: A, usePublisher: Ct }), yr = /* @__PURE__ */ nn({ useEmitter: on, useEmitterValue: A, usePublisher: Ct }), es = uo, ns = uo, br = /* @__PURE__ */ j(() => {
2743
+ ), wr = /* @__PURE__ */ en({ useEmitter: on, useEmitterValue: A, usePublisher: Ct }), yr = /* @__PURE__ */ nn({ useEmitter: on, useEmitterValue: A, usePublisher: Ct }), es = uo, ns = uo, br = /* @__PURE__ */ q(() => {
2742
2744
  const t = T((d) => /* @__PURE__ */ $t("td", { children: [
2743
2745
  "Item $",
2744
2746
  d
@@ -2773,7 +2775,7 @@ const xr = ({ children: t }) => {
2773
2775
  TableRowComponent: c("TableRow", "tr"),
2774
2776
  GroupComponent: c("Group", "tr")
2775
2777
  };
2776
- }), Rr = /* @__PURE__ */ j(
2778
+ }), Rr = /* @__PURE__ */ q(
2777
2779
  ([t, e]) => ({ ...t, ...e }),
2778
2780
  rt(oo, br)
2779
2781
  ), Hr = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { height: t } }) }), Er = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { border: 0, height: t, padding: 0 } }) }), Br = { overflowAnchor: "none" }, Hn = { position: Je(), zIndex: 2, overflowAnchor: "none" }, En = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
@@ -2989,7 +2991,7 @@ function Se(t, e) {
2989
2991
  function Gr(t, e) {
2990
2992
  return t !== void 0 && t.column === e.column && t.row === e.row;
2991
2993
  }
2992
- const Ar = /* @__PURE__ */ j(
2994
+ const Ar = /* @__PURE__ */ q(
2993
2995
  ([
2994
2996
  { increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
2995
2997
  { footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: d, smoothScrollTargetReached: m, viewportHeight: v },
@@ -2999,7 +3001,7 @@ const Ar = /* @__PURE__ */ j(
2999
3001
  { customScrollParent: h, useWindowScroll: f, windowScrollContainerState: a, windowScrollTo: S, windowViewportRect: H },
3000
3002
  y
3001
3003
  ]) => {
3002
- const k = T(0), u = T(0), g = T(Bn), C = T({ height: 0, width: 0 }), L = T({ height: 0, width: 0 }), O = U(), V = U(), N = T(0), Z = T(null), F = T({ column: 0, row: 0 }), mt = U(), q = U(), Q = T(!1), gt = T(0), lt = T(!0), St = T(!1), Ft = T(!1);
3004
+ const k = T(0), u = T(0), g = T(Bn), C = T({ height: 0, width: 0 }), L = T({ height: 0, width: 0 }), O = U(), V = U(), N = T(0), Z = T(null), F = T({ column: 0, row: 0 }), dt = U(), K = U(), Q = T(!1), gt = T(0), lt = T(!0), St = T(!1), Ft = T(!1);
3003
3005
  Y(
3004
3006
  x(
3005
3007
  w,
@@ -3012,7 +3014,7 @@ const Ar = /* @__PURE__ */ j(
3012
3014
  ), Y(
3013
3015
  x(
3014
3016
  at(w, lt, L, C, gt, St),
3015
- P(([b, D, K, st, , tt]) => b && !D && K.height !== 0 && st.height !== 0 && !tt)
3017
+ P(([b, D, j, st, , tt]) => b && !D && j.height !== 0 && st.height !== 0 && !tt)
3016
3018
  ),
3017
3019
  ([, , , , b]) => {
3018
3020
  if (b === void 0) {
@@ -3027,7 +3029,7 @@ const Ar = /* @__PURE__ */ j(
3027
3029
  }
3028
3030
  ), z(
3029
3031
  x(
3030
- q,
3032
+ K,
3031
3033
  P((b) => b != null && b.scrollTop > 0),
3032
3034
  Bt(0)
3033
3035
  ),
@@ -3035,7 +3037,7 @@ const Ar = /* @__PURE__ */ j(
3035
3037
  ), Y(
3036
3038
  x(
3037
3039
  w,
3038
- $(q),
3040
+ $(K),
3039
3041
  P(([, b]) => b != null)
3040
3042
  ),
3041
3043
  ([, b]) => {
@@ -3057,14 +3059,14 @@ const Ar = /* @__PURE__ */ j(
3057
3059
  W(F, (b, D) => b !== void 0 && b.column === D.column && b.row === D.row),
3058
3060
  W(d)
3059
3061
  ),
3060
- B(([b, D, K, st]) => ({
3061
- gap: K,
3062
+ B(([b, D, j, st]) => ({
3063
+ gap: j,
3062
3064
  item: D,
3063
3065
  scrollTop: st,
3064
3066
  viewport: b
3065
3067
  }))
3066
3068
  ),
3067
- mt
3069
+ dt
3068
3070
  ), z(
3069
3071
  x(
3070
3072
  at(
@@ -3083,7 +3085,7 @@ const Ar = /* @__PURE__ */ j(
3083
3085
  B(
3084
3086
  ([
3085
3087
  b,
3086
- [D, K],
3088
+ [D, j],
3087
3089
  st,
3088
3090
  tt,
3089
3091
  X,
@@ -3102,7 +3104,7 @@ const Ar = /* @__PURE__ */ j(
3102
3104
  }
3103
3105
  const ge = fo(sn, Ee, Wt);
3104
3106
  let qt, Mt;
3105
- ut ? D === 0 && K === 0 && xt > 0 ? (qt = 0, Mt = xt - 1) : (qt = ge * Ce((D + ee) / (he + ee)), Mt = ge * On((K + ee) / (he + ee)) - 1, Mt = ze(b - 1, oe(Mt, ge - 1)), qt = ze(Mt, oe(0, qt))) : (qt = 0, Mt = -1);
3107
+ ut ? D === 0 && j === 0 && xt > 0 ? (qt = 0, Mt = xt - 1) : (qt = ge * Ce((D + ee) / (he + ee)), Mt = ge * On((j + ee) / (he + ee)) - 1, Mt = ze(b - 1, oe(Mt, ge - 1)), qt = ze(Mt, oe(0, qt))) : (qt = 0, Mt = -1);
3106
3108
  const ln = Ln(qt, Mt, ct), { bottom: cn, top: un } = zn(X, st, tt, ln), an = On(b / ge), po = an * he + (an - 1) * ee - cn;
3107
3109
  return { bottom: cn, itemHeight: he, items: ln, itemWidth: Ee, offsetBottom: po, offsetTop: un, top: un };
3108
3110
  }
@@ -3119,9 +3121,9 @@ const Ar = /* @__PURE__ */ j(
3119
3121
  ), z(
3120
3122
  x(
3121
3123
  at(C, L, g, F),
3122
- P(([b, D, { items: K }]) => K.length > 0 && D.height !== 0 && b.height !== 0),
3123
- B(([b, D, { items: K }, st]) => {
3124
- const { bottom: tt, top: X } = zn(b, st, D, K);
3124
+ P(([b, D, { items: j }]) => j.length > 0 && D.height !== 0 && b.height !== 0),
3125
+ B(([b, D, { items: j }, st]) => {
3126
+ const { bottom: tt, top: X } = zn(b, st, D, j);
3125
3127
  return [X, tt];
3126
3128
  }),
3127
3129
  nt(le)
@@ -3142,9 +3144,9 @@ const Ar = /* @__PURE__ */ j(
3142
3144
  at(g, k),
3143
3145
  P(([{ items: b }]) => b.length > 0),
3144
3146
  $(pt),
3145
- P(([[b, D], K]) => {
3147
+ P(([[b, D], j]) => {
3146
3148
  const tt = b.items[b.items.length - 1].index === D - 1;
3147
- return (K || b.bottom > 0 && b.itemHeight > 0 && b.offsetBottom === 0 && b.items.length === D) && tt;
3149
+ return (j || b.bottom > 0 && b.itemHeight > 0 && b.offsetBottom === 0 && b.items.length === D) && tt;
3148
3150
  }),
3149
3151
  B(([[, b]]) => b - 1),
3150
3152
  nt()
@@ -3173,12 +3175,12 @@ const Ar = /* @__PURE__ */ j(
3173
3175
  x(
3174
3176
  O,
3175
3177
  $(C, L, k, F),
3176
- B(([b, D, K, st, tt]) => {
3178
+ B(([b, D, j, st, tt]) => {
3177
3179
  const X = Yn(b), { align: ct, behavior: xt, offset: ut } = X;
3178
3180
  let Vt = X.index;
3179
3181
  Vt === "LAST" && (Vt = st - 1), Vt = oe(0, Vt, ze(st - 1, Vt));
3180
- let Wt = Me(D, tt, K, Vt);
3181
- return ct === "end" ? Wt = kn(Wt - D.height + K.height) : ct === "center" && (Wt = kn(Wt - D.height / 2 + K.height / 2)), ut !== void 0 && ut !== 0 && (Wt += ut), { behavior: xt, top: Wt };
3182
+ let Wt = Me(D, tt, j, Vt);
3183
+ return ct === "end" ? Wt = kn(Wt - D.height + j.height) : ct === "center" && (Wt = kn(Wt - D.height / 2 + j.height / 2)), ut !== void 0 && ut !== 0 && (Wt += ut), { behavior: xt, top: Wt };
3182
3184
  })
3183
3185
  ),
3184
3186
  c
@@ -3208,7 +3210,7 @@ const Ar = /* @__PURE__ */ j(
3208
3210
  initialItemCount: u,
3209
3211
  itemDimensions: L,
3210
3212
  overscan: n,
3211
- restoreStateFrom: q,
3213
+ restoreStateFrom: K,
3212
3214
  scrollBy: i,
3213
3215
  scrollContainerState: l,
3214
3216
  scrollHeight: V,
@@ -3233,7 +3235,7 @@ const Ar = /* @__PURE__ */ j(
3233
3235
  propsReady: R,
3234
3236
  rangeChanged: Et,
3235
3237
  startReached: Qt,
3236
- stateChanged: mt,
3238
+ stateChanged: dt,
3237
3239
  stateRestoreInProgress: Q,
3238
3240
  ...y
3239
3241
  };
@@ -3254,7 +3256,7 @@ function Me(t, e, n, o) {
3254
3256
  const r = fo(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + oe(0, s - 1) * e.row;
3255
3257
  return i > 0 ? i + e.row : i;
3256
3258
  }
3257
- const Mr = /* @__PURE__ */ j(() => {
3259
+ const Mr = /* @__PURE__ */ q(() => {
3258
3260
  const t = T((v) => `Item ${v}`), e = T({}), n = T(null), o = T("virtuoso-grid-item"), r = T("virtuoso-grid-list"), s = T(Qe), i = T("div"), l = T(Jt), c = (v, p = null) => ht(
3259
3261
  x(
3260
3262
  e,
@@ -3281,7 +3283,7 @@ const Mr = /* @__PURE__ */ j(() => {
3281
3283
  scrollerRef: l,
3282
3284
  ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
3283
3285
  };
3284
- }), _r = /* @__PURE__ */ j(
3286
+ }), _r = /* @__PURE__ */ q(
3285
3287
  ([t, e]) => ({ ...t, ...e }),
3286
3288
  rt(Ar, Mr)
3287
3289
  ), Nr = /* @__PURE__ */ E.memo(function() {
@@ -3437,13 +3439,13 @@ const Mr = /* @__PURE__ */ j(() => {
3437
3439
  jr
3438
3440
  ), Yr = /* @__PURE__ */ en({ useEmitter: mo, useEmitterValue: et, usePublisher: wt }), Zr = /* @__PURE__ */ nn({ useEmitter: mo, useEmitterValue: et, usePublisher: wt });
3439
3441
  function Fn(t, e, n) {
3440
- return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ft.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
3442
+ return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
3441
3443
  }
3442
3444
  const ss = qr;
3443
3445
  export {
3444
3446
  rs as GroupedTableVirtuoso,
3445
3447
  ns as GroupedVirtuoso,
3446
- ft as LogLevel,
3448
+ mt as LogLevel,
3447
3449
  os as TableVirtuoso,
3448
3450
  es as Virtuoso,
3449
3451
  ss as VirtuosoGrid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-virtuoso",
3
- "version": "4.18.11",
3
+ "version": "4.18.12",
4
4
  "description": "A virtual scroll React component for efficiently rendering large scrollable lists, grids, tables, and feeds",
5
5
  "keywords": [
6
6
  "chat",