react-virtuoso 2.13.1 → 2.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.m.js CHANGED
@@ -1,2 +1,2 @@
1
- import{systemToComponent as t}from"@virtuoso.dev/react-urx";import*as e from"@virtuoso.dev/urx";import*as n from"react";import{useLayoutEffect as r,useEffect as o,useRef as i,useCallback as a,createElement as l}from"react";function s(){return s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s.apply(this,arguments)}function u(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function m(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d,f,p="undefined"!=typeof document?r:o;!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR"}(f||(f={}));var h=((d={})[f.DEBUG]="debug",d[f.INFO]="log",d[f.WARN]="warn",d[f.ERROR]="error",d),g=e.system(function(){var t=e.statefulStream(f.ERROR);return{log:e.statefulStream(function(n,r,o){var i;void 0===o&&(o=f.INFO),o>=(null!=(i=("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL)?i:e.getValue(t))&&console[h[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:t}},[],{singleton:!0});function v(t,e){void 0===e&&(e=!0);var n=i(null),r=function(t){};if("undefined"!=typeof ResizeObserver){var o=new ResizeObserver(function(e){var n=e[0].target;null!==n.offsetParent&&t(n)});r=function(t){t&&e?(o.observe(t),n.current=t):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function S(t,e){return void 0===e&&(e=!0),v(t,e).callbackRef}function I(t,e,n,r,o,i){return v(function(n){for(var a=function(t,e,n,r){var o=t.length;if(0===o)return null;for(var i=[],a=0;a<o;a++){var l=t.item(a);if(l&&void 0!==l.dataset.index){var s=parseInt(l.dataset.index),u=parseFloat(l.dataset.knownSize),c=e(l,"offsetHeight");if(0===c&&r("Zero-sized element, this should not happen",{child:l},f.ERROR),c!==u){var m=i[i.length-1];0===i.length||m.size!==c||m.endIndex!==s-1?i.push({startIndex:s,endIndex:s,size:c}):i[i.length-1].endIndex++}}}return i}(n.children,e,0,o),l=n.parentElement;!l.dataset.virtuosoScroller;)l=l.parentElement;var s=i?i.scrollTop:"window"===l.firstElementChild.dataset.viewportType?window.pageYOffset||document.documentElement.scrollTop:l.scrollTop;r({scrollTop:Math.max(s,0),scrollHeight:(null!=i?i:l).scrollHeight,viewportHeight:(null!=i?i:l).offsetHeight}),null!==a&&t(a)},n)}function C(t,e){return Math.round(t.getBoundingClientRect()[e])}function T(t,n,r,l,s){void 0===l&&(l=e.noop);var u=i(null),c=i(null),m=i(null),d=a(function(e){var r=e.target,o=r===window||r===document?window.pageYOffset||document.documentElement.scrollTop:r.scrollTop,i=r===window?document.documentElement.scrollHeight:r.scrollHeight,a=r===window?window.innerHeight:r.offsetHeight;t({scrollTop:Math.max(o,0),scrollHeight:i,viewportHeight:a}),null!==c.current&&(o===c.current||o<=0||o===r.scrollHeight-C(r,"height"))&&(c.current=null,n(!0),m.current&&(clearTimeout(m.current),m.current=null))},[t,n]);return o(function(){var t=s||u.current;return l(s||u.current),d({target:t}),t.addEventListener("scroll",d,{passive:!0}),function(){l(null),t.removeEventListener("scroll",d)}},[u,d,r,l,s]),{scrollerRef:u,scrollByCallback:function(t){u.current.scrollBy(t)},scrollToCallback:function(e){var r=u.current;if(r&&(!("offsetHeight"in r)||0!==r.offsetHeight)){var o,i,a,l="smooth"===e.behavior;if(r===window?(i=Math.max(C(document.documentElement,"height"),document.documentElement.scrollHeight),o=window.innerHeight,a=document.documentElement.scrollTop):(i=r.scrollHeight,o=C(r,"height"),a=r.scrollTop),e.top=Math.ceil(Math.max(Math.min(i-o,e.top),0)),Math.abs(o-i)<1.01||e.top===a)return t({scrollTop:a,scrollHeight:i,viewportHeight:o}),void(l&&n(!0));l?(c.current=e.top,m.current&&clearTimeout(m.current),m.current=setTimeout(function(){m.current=null,c.current=null,n(!0)},1e3)):c.current=null,r.scrollTo(e)}}}}var w=e.system(function(){var t=e.stream(),n=e.stream(),r=e.statefulStream(0),o=e.stream(),i=e.statefulStream(0),a=e.stream(),l=e.stream(),s=e.statefulStream(0),u=e.statefulStream(0),c=e.statefulStream(0),m=e.stream(),d=e.stream(),f=e.statefulStream(!1),p=e.statefulStream(!1);return e.connect(e.pipe(t,e.map(function(t){return t.scrollTop})),n),e.connect(e.pipe(t,e.map(function(t){return t.scrollHeight})),l),e.connect(n,i),{scrollContainerState:t,scrollTop:n,viewportHeight:a,headerHeight:s,fixedHeaderHeight:u,footerHeight:c,scrollHeight:l,smoothScrollTargetReached:o,react18ConcurrentRendering:p,scrollTo:m,scrollBy:d,statefulScrollTop:i,deviation:r,scrollingInProgress:f}},[],{singleton:!0}),x={lvl:0};function y(t,e,n,r,o){return void 0===r&&(r=x),void 0===o&&(o=x),{k:t,v:e,lvl:n,l:r,r:o}}function b(t){return t===x}function E(){return x}function H(t,e){if(b(t))return x;var n=t.k,r=t.l,o=t.r;if(e===n){if(b(r))return o;if(b(o))return r;var i=B(r);return M(P(t,{k:i[0],v:i[1],l:F(r)}))}return M(P(t,e<n?{l:H(r,e)}:{r:H(o,e)}))}function R(t,e,n){if(void 0===n&&(n="k"),b(t))return[-Infinity,void 0];if(t[n]===e)return[t.k,t.v];if(t[n]<e){var r=R(t.r,e,n);return-Infinity===r[0]?[t.k,t.v]:r}return R(t.l,e,n)}function L(t,e,n){return b(t)?y(e,n,1):e===t.k?P(t,{k:e,v:n}):function(t){return A(W(t))}(P(t,e<t.k?{l:L(t.l,e,n)}:{r:L(t.r,e,n)}))}function k(t,e,n){if(b(t))return[];var r=t.k,o=t.v,i=t.r,a=[];return r>e&&(a=a.concat(k(t.l,e,n))),r>=e&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(k(i,e,n))),a}function z(t){return b(t)?[]:[].concat(z(t.l),[{k:t.k,v:t.v}],z(t.r))}function B(t){return b(t.r)?[t.k,t.v]:B(t.r)}function F(t){return b(t.r)?t.l:M(P(t,{r:F(t.r)}))}function P(t,e){return y(void 0!==e.k?e.k:t.k,void 0!==e.v?e.v:t.v,void 0!==e.lvl?e.lvl:t.lvl,void 0!==e.l?e.l:t.l,void 0!==e.r?e.r:t.r)}function O(t){return b(t)||t.lvl>t.r.lvl}function M(t){var e=t.l,n=t.r,r=t.lvl;if(n.lvl>=r-1&&e.lvl>=r-1)return t;if(r>n.lvl+1){if(O(e))return W(P(t,{lvl:r-1}));if(b(e)||b(e.r))throw new Error("Unexpected empty nodes");return P(e.r,{l:P(e,{r:e.r.l}),r:P(t,{l:e.r.r,lvl:r-1}),lvl:r})}if(O(t))return A(P(t,{lvl:r-1}));if(b(n)||b(n.l))throw new Error("Unexpected empty nodes");var o=n.l,i=O(o)?n.lvl-1:n.lvl;return P(o,{l:P(t,{r:o.l,lvl:r-1}),r:A(P(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}function U(t,e,n){return b(t)?[]:V(k(t,R(t,e)[0],n),function(t){return{index:t.k,value:t.v}})}function V(t,e){var n=t.length;if(0===n)return[];for(var r=e(t[0]),o=r.index,i=r.value,a=[],l=1;l<n;l++){var s=e(t[l]),u=s.index,c=s.value;a.push({start:o,end:u-1,value:i}),o=u,i=c}return a.push({start:o,end:Infinity,value:i}),a}function A(t){var e=t.r,n=t.lvl;return b(e)||b(e.r)||e.lvl!==n||e.r.lvl!==n?t:P(e,{l:P(t,{r:e.l}),lvl:n+1})}function W(t){var e=t.l;return b(e)||e.lvl!==t.lvl?t:P(e,{r:P(t,{l:e.r})})}function N(t,e,n,r){void 0===r&&(r=0);for(var o=t.length-1;r<=o;){var i=Math.floor((r+o)/2),a=n(t[i],e);if(0===a)return i;if(-1===a){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error("Failed binary finding record in array - "+t.join(",")+", searched for "+e)}function D(t,e,n){return t[N(t,e,n)]}function G(t){var e=t.size,n=t.startIndex,r=t.endIndex;return function(t){return t.start===n&&(t.end===r||Infinity===t.end)&&t.value===e}}function _(t,e){var n=t.index;return e===n?0:e<n?-1:1}function j(t,e){var n=t.offset;return e===n?0:e<n?-1:1}function K(t){return{index:t.index,value:t}}function Y(t,e,n){var r=t,o=0,i=0,a=0,l=0;if(0!==e){a=r[l=N(r,e-1,_)].offset;var s=R(n,e-1);o=s[0],i=s[1],r.length&&r[l].size===R(n,e)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(var u,c=m(U(n,e,Infinity));!(u=c()).done;){var d=u.value,f=d.start,p=d.value,h=(f-o)*i+a;r.push({offset:h,size:p,index:f}),o=f,a=h,i=p}return{offsetTree:r,lastIndex:o,lastOffset:a,lastSize:i}}function Z(t,e){var n=e[0],r=e[1];n.length>0&&(0,e[2])("received item sizes",n,f.DEBUG);var o=t.sizeTree,i=o,a=0;if(r.length>0&&b(o)&&2===n.length){var l=n[0].size,s=n[1].size;i=r.reduce(function(t,e){return L(L(t,e,l),e+1,s)},i)}else{var u=function(t,e){for(var n,r=b(t)?0:Infinity,o=m(e);!(n=o()).done;){var i=n.value,a=i.size,l=i.startIndex,s=i.endIndex;if(r=Math.min(r,l),b(t))t=L(t,0,a);else{var u=U(t,l-1,s+1);if(!u.some(G(i))){for(var c,d=!1,f=!1,p=m(u);!(c=p()).done;){var h=c.value,g=h.start,v=h.end,S=h.value;d?(s>=g||a===S)&&(t=H(t,g)):(f=S!==a,d=!0),v>s&&s>=g&&S!==a&&(t=L(t,s+1,S))}f&&(t=L(t,l,a))}}}return[t,r]}(i,n);i=u[0],a=u[1]}if(i===o)return t;var c=Y(t.offsetTree,a,i),d=c.offsetTree;return{sizeTree:i,offsetTree:d,lastIndex:c.lastIndex,lastOffset:c.lastOffset,lastSize:c.lastSize,groupOffsetTree:r.reduce(function(t,e){return L(t,e,q(e,d))},E()),groupIndices:r}}function q(t,e){if(0===e.length)return 0;var n=D(e,t,_);return n.size*(t-n.index)+n.offset}function J(t,e,n){if(function(t){return void 0!==t.groupIndex}(t))return e.groupIndices[t.groupIndex]+1;var r=$("LAST"===t.index?n:t.index,e);return Math.max(0,r,Math.min(n,r))}function $(t,e){if(!Q(e))return t;for(var n=0;e.groupIndices[n]<=t+n;)n++;return t+n}function Q(t){return!b(t.groupOffsetTree)}var X={offsetHeight:"height",offsetWidth:"width"},tt=e.system(function(t){var n=t[0].log,r=e.stream(),o=e.stream(),i=e.statefulStreamFromEmitter(o,0),a=e.stream(),l=e.stream(),u=e.statefulStream(0),c=e.statefulStream([]),m=e.statefulStream(void 0),d=e.statefulStream(void 0),p=e.statefulStream(function(t,e){return C(t,X[e])}),h=e.statefulStream(void 0),g={offsetTree:[],sizeTree:E(),groupOffsetTree:E(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},v=e.statefulStream(!1),S=e.statefulStreamFromEmitter(e.pipe(r,e.withLatestFrom(c,n),e.scan(Z,g),e.distinctUntilChanged()),g);e.connect(e.pipe(c,e.filter(function(t){return t.length>0}),e.withLatestFrom(S),e.map(function(t){var e=t[0],n=t[1],r=e.reduce(function(t,e,r){return L(t,e,q(e,n.offsetTree)||r)},E());return s({},n,{groupIndices:e,groupOffsetTree:r})})),S),e.connect(e.pipe(o,e.withLatestFrom(S),e.filter(function(t){return t[0]<t[1].lastIndex}),e.map(function(t){var e=t[1];return[{startIndex:t[0],endIndex:e.lastIndex,size:e.lastSize}]})),r),e.connect(m,d);var I=e.statefulStreamFromEmitter(e.pipe(m,e.map(function(t){return void 0===t})),!0);e.connect(e.pipe(d,e.filter(function(t){return void 0!==t&&b(e.getValue(S).sizeTree)}),e.map(function(t){return[{startIndex:0,endIndex:0,size:t}]})),r);var T=e.streamFromEmitter(e.pipe(r,e.withLatestFrom(S),e.scan(function(t,e){var n=e[1];return{changed:n!==t.sizes,sizes:n}},{changed:!1,sizes:g}),e.map(function(t){return t.changed})));e.subscribe(e.pipe(u,e.scan(function(t,e){return{diff:t.prev-e,prev:e}},{diff:0,prev:0}),e.map(function(t){return t.diff})),function(t){t>0?(e.publish(v,!0),e.publish(a,t)):t<0&&e.publish(l,t)}),e.subscribe(e.pipe(u,e.withLatestFrom(n)),function(t){t[0]<0&&(0,t[1])("`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:u},f.ERROR)});var w=e.streamFromEmitter(a);e.connect(e.pipe(a,e.withLatestFrom(S),e.map(function(t){var e=t[0],n=t[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: prepending items does not work with groups");return z(n.sizeTree).reduce(function(t,n){var r=n.k,o=n.v;return{ranges:[].concat(t.ranges,[{startIndex:t.prevIndex,endIndex:r+e-1,size:t.prevSize}]),prevIndex:r+e,prevSize:o}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),r);var x=e.streamFromEmitter(e.pipe(l,e.withLatestFrom(S),e.map(function(t){return q(-t[0],t[1].offsetTree)})));return e.connect(e.pipe(l,e.withLatestFrom(S),e.map(function(t){var e=t[0],n=t[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: shifting items does not work with groups");var r=z(n.sizeTree).reduce(function(t,n){var r=n.v;return L(t,Math.max(0,n.k+e),r)},E());return s({},n,{sizeTree:r},Y(n.offsetTree,0,r))})),S),{data:h,totalCount:o,sizeRanges:r,groupIndices:c,defaultItemSize:d,fixedItemSize:m,unshiftWith:a,shiftWith:l,shiftWithOffset:x,beforeUnshiftWith:w,firstItemIndex:u,sizes:S,listRefresh:T,statefulTotalCount:i,trackItemSizes:I,itemSize:p,recalcInProgress:v}},e.tup(g),{singleton:!0}),et="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function nt(t){var e="number"==typeof t?{index:t}:t;return e.align||(e.align="start"),e.behavior&&et||(e.behavior="auto"),e.offset||(e.offset=0),e}var rt=e.system(function(t){var n=t[0],r=n.sizes,o=n.totalCount,i=n.listRefresh,a=t[1],l=a.scrollingInProgress,s=a.viewportHeight,u=a.scrollTo,c=a.smoothScrollTargetReached,m=a.headerHeight,d=a.footerHeight,p=t[2].log,h=e.stream(),g=e.statefulStream(0),v=null,S=null,I=null;function C(){v&&(v(),v=null),I&&(I(),I=null),S&&(clearTimeout(S),S=null),e.publish(l,!1)}return e.connect(e.pipe(h,e.withLatestFrom(r,s,o,g,m,d,p),e.map(function(t){var n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],m=t[6],d=t[7],p=nt(n),g=p.align,T=p.behavior,w=p.offset,x=a-1,y=J(p,r,x),b=q(y,r.offsetTree)+u;"end"===g?(b=b-o+R(r.sizeTree,y)[1],y===x&&(b+=m)):"center"===g?b=b-o/2+R(r.sizeTree,y)[1]/2:b-=s,w&&(b+=w);var E=function(t){C(),t?(d("retrying to scroll to",{location:n},f.DEBUG),e.publish(h,n)):d("list did not change, scroll successful",{},f.DEBUG)};if(C(),"smooth"===T){var H=!1;I=e.subscribe(i,function(t){H=H||t}),v=e.handleNext(c,function(){E(H)})}else v=e.handleNext(e.pipe(i,function(t){var e=setTimeout(function(){t(!1)},50);return function(n){n&&(t(!0),clearTimeout(e))}}),E);return S=setTimeout(function(){C()},1200),e.publish(l,!0),d("scrolling from index to",{index:y,top:b,behavior:T},f.DEBUG),{top:b,behavior:T}})),u),{scrollToIndex:h,topListHeight:g}},e.tup(tt,w,g),{singleton:!0}),ot="up",it={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},at=e.system(function(t){var n=t[0],r=n.scrollContainerState,o=n.scrollTop,i=n.viewportHeight,a=n.headerHeight,l=n.footerHeight,s=n.scrollBy,u=e.statefulStream(!1),c=e.statefulStream(!0),m=e.stream(),d=e.stream(),f=e.statefulStream(4),p=e.statefulStream(0),h=e.streamFromEmitter(e.pipe(e.merge(e.pipe(e.duc(o),e.skip(1),e.mapTo(!0)),e.pipe(e.duc(o),e.skip(1),e.mapTo(!1),e.debounceTime(100))),e.distinctUntilChanged())),g=e.statefulStreamFromEmitter(e.pipe(e.merge(e.pipe(s,e.mapTo(!0)),e.pipe(s,e.mapTo(!1),e.debounceTime(200))),e.distinctUntilChanged()),!1);e.connect(e.pipe(e.combineLatest(e.duc(o),e.duc(p)),e.map(function(t){return t[0]<=t[1]}),e.distinctUntilChanged()),c),e.connect(e.pipe(c,e.throttleTime(50)),d);var v=e.streamFromEmitter(e.pipe(e.combineLatest(r,e.duc(i),e.duc(a),e.duc(l),e.duc(f)),e.scan(function(t,e){var n,r,o=e[0],i=o.scrollTop,a=o.scrollHeight,l=e[1],s={viewportHeight:l,scrollTop:i,scrollHeight:a};return i+l-a>-e[4]?(i>t.state.scrollTop?(n="SCROLLED_DOWN",r=t.state.scrollTop-i):(n="SIZE_DECREASED",r=t.state.scrollTop-i||t.scrollTopDelta),{atBottom:!0,state:s,atBottomBecause:n,scrollTopDelta:r}):{atBottom:!1,notAtBottomBecause:s.scrollHeight>t.state.scrollHeight?"SIZE_INCREASED":l<t.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<t.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},it),e.distinctUntilChanged(function(t,e){return t&&t.atBottom===e.atBottom}))),S=e.statefulStreamFromEmitter(e.pipe(r,e.scan(function(t,e){var n=e.scrollTop,r=e.scrollHeight;return t.scrollHeight!==r?t.scrollTop!==n&&n===r-e.viewportHeight?{scrollHeight:r,scrollTop:n,jump:t.scrollTop-n,changed:!0}:{scrollHeight:r,scrollTop:n,jump:0,changed:!0}:{scrollTop:n,scrollHeight:r,jump:0,changed:!1}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),e.filter(function(t){return t.changed}),e.map(function(t){return t.jump})),0);e.connect(e.pipe(v,e.map(function(t){return t.atBottom})),u),e.connect(e.pipe(u,e.throttleTime(50)),m);var I=e.statefulStream("down");e.connect(e.pipe(r,e.map(function(t){return t.scrollTop}),e.distinctUntilChanged(),e.scan(function(t,n){return e.getValue(g)?{direction:t.direction,prevScrollTop:n}:{direction:n<t.prevScrollTop?ot:"down",prevScrollTop:n}},{direction:"down",prevScrollTop:0}),e.map(function(t){return t.direction})),I),e.connect(e.pipe(r,e.throttleTime(50),e.mapTo("none")),I);var C=e.statefulStream(0);return e.connect(e.pipe(h,e.filter(function(t){return!t}),e.mapTo(0)),C),e.connect(e.pipe(o,e.throttleTime(100),e.withLatestFrom(h),e.filter(function(t){return!!t[1]}),e.scan(function(t,e){return[t[1],e[0]]},[0,0]),e.map(function(t){return t[1]-t[0]})),C),{isScrolling:h,isAtTop:c,isAtBottom:u,atBottomState:v,atTopStateChange:d,atBottomStateChange:m,scrollDirection:I,atBottomThreshold:f,atTopThreshold:p,scrollVelocity:C,lastJumpDueToItemResize:S}},e.tup(w)),lt=e.system(function(t){var n=t[0].log,r=e.statefulStream(!1),o=e.streamFromEmitter(e.pipe(r,e.filter(function(t){return t}),e.distinctUntilChanged()));return e.subscribe(r,function(t){t&&e.getValue(n)("props updated",{},f.DEBUG)}),{propsReady:r,didMount:o}},e.tup(g),{singleton:!0}),st=e.system(function(t){var n=t[0],r=n.sizes,o=n.listRefresh,i=n.defaultItemSize,a=t[1].scrollTop,l=t[2].scrollToIndex,s=t[3].didMount,u=e.statefulStream(!0),c=e.statefulStream(0);return e.connect(e.pipe(s,e.withLatestFrom(c),e.filter(function(t){return!!t[1]}),e.mapTo(!1)),u),e.subscribe(e.pipe(e.combineLatest(o,s),e.withLatestFrom(u,r,i),e.filter(function(t){var e=t[1],n=t[3];return t[0][1]&&(!b(t[2].sizeTree)||void 0!==n)&&!e}),e.withLatestFrom(c)),function(t){var n=t[1];setTimeout(function(){e.handleNext(a,function(){e.publish(u,!0)}),e.publish(l,n)})}),{scrolledToInitialItem:u,initialTopMostItemIndex:c}},e.tup(tt,w,rt,lt),{singleton:!0});function ut(t){return!!t&&("smooth"===t?"smooth":"auto")}var ct=e.system(function(t){var n=t[0],r=n.totalCount,o=n.listRefresh,i=t[1],a=i.isAtBottom,l=i.atBottomState,s=t[2].scrollToIndex,u=t[3].scrolledToInitialItem,c=t[4],m=c.propsReady,d=c.didMount,p=t[5].log,h=t[6].scrollingInProgress,g=e.statefulStream(!1),v=null;function S(t){e.publish(s,{index:"LAST",align:"end",behavior:t})}return e.subscribe(e.pipe(e.combineLatest(e.pipe(e.duc(r),e.skip(1)),d),e.withLatestFrom(e.duc(g),a,u,h),e.map(function(t){var e=t[0],n=e[0],r=e[1]&&t[3],o="auto";return r&&(o=function(t,e){return"function"==typeof t?ut(t(e)):e&&ut(t)}(t[1],t[2]||t[4]),r=r&&!!o),{totalCount:n,shouldFollow:r,followOutputBehavior:o}}),e.filter(function(t){return t.shouldFollow})),function(t){var n=t.totalCount,r=t.followOutputBehavior;v&&(v(),v=null),v=e.handleNext(o,function(){e.getValue(p)("following output to ",{totalCount:n},f.DEBUG),S(r),v=null})}),e.subscribe(e.pipe(e.combineLatest(e.duc(g),r,m),e.filter(function(t){return t[0]&&t[2]}),e.scan(function(t,e){var n=e[1];return{refreshed:t.value===n,value:n}},{refreshed:!1,value:0}),e.filter(function(t){return t.refreshed}),e.withLatestFrom(g,r)),function(t){var n=t[1],r=e.handleNext(l,function(t){!n||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||v||(e.getValue(p)("scrolling to bottom due to increased size",{},f.DEBUG),S("auto"))});setTimeout(r,100)}),e.subscribe(e.combineLatest(e.duc(g),l),function(t){var e=t[1];t[0]&&!e.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===e.notAtBottomBecause&&S("auto")}),{followOutput:g}},e.tup(tt,at,rt,st,lt,g,w));function mt(t){return t.reduce(function(t,e){return t.groupIndices.push(t.totalCount),t.totalCount+=e+1,t},{totalCount:0,groupIndices:[]})}var dt=e.system(function(t){var n=t[0],r=n.totalCount,o=n.groupIndices,i=n.sizes,a=t[1],l=a.scrollTop,s=a.headerHeight,u=e.stream(),c=e.stream(),m=e.streamFromEmitter(e.pipe(u,e.map(mt)));return e.connect(e.pipe(m,e.map(e.prop("totalCount"))),r),e.connect(e.pipe(m,e.map(e.prop("groupIndices"))),o),e.connect(e.pipe(e.combineLatest(l,i,s),e.filter(function(t){return Q(t[1])}),e.map(function(t){return R(t[1].groupOffsetTree,Math.max(t[0]-t[2],0),"v")[0]}),e.distinctUntilChanged(),e.map(function(t){return[t]})),c),{groupCounts:u,topItemsIndexes:c}},e.tup(tt,w));function ft(t,e){return!(!t||t[0]!==e[0]||t[1]!==e[1])}function pt(t,e){return!(!t||t.startIndex!==e.startIndex||t.endIndex!==e.endIndex)}function ht(t,e,n){return"number"==typeof t?n===ot&&"top"===e||"down"===n&&"bottom"===e?t:0:n===ot?"top"===e?t.main:t.reverse:"bottom"===e?t.main:t.reverse}function gt(t,e){return"number"==typeof t?t:t[e]||0}var vt=e.system(function(t){var n=t[0],r=n.scrollTop,o=n.viewportHeight,i=n.deviation,a=n.headerHeight,l=n.fixedHeaderHeight,s=e.stream(),u=e.statefulStream(0),c=e.statefulStream(0),m=e.statefulStream(0),d=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(e.duc(r),e.duc(o),e.duc(a),e.duc(s,ft),e.duc(m),e.duc(u),e.duc(l),e.duc(i),e.duc(c)),e.map(function(t){var e=t[0],n=t[1],r=t[2],o=t[3],i=o[0],a=o[1],l=t[4],s=t[6],u=t[7],c=t[8],m=e-u,d=t[5]+s,f=Math.max(r-m,0),p="none",h=gt(c,"top"),g=gt(c,"bottom");return i-=u,a+=r+s,(i+=r+s)>e+d-h&&(p=ot),(a-=u)<e-f+n+g&&(p="down"),"none"!==p?[Math.max(m-r-ht(l,"top",p)-h,0),m-f-s+n+ht(l,"bottom",p)+g]:null}),e.filter(function(t){return null!=t}),e.distinctUntilChanged(ft)),[0,0]);return{listBoundary:s,overscan:m,topListHeight:u,increaseViewportBy:c,visibleRange:d}},e.tup(w),{singleton:!0}),St={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function It(t,e,n){if(0===t.length)return[];if(!Q(e))return t.map(function(t){return s({},t,{index:t.index+n,originalIndex:t.index})});for(var r,o=[],i=U(e.groupOffsetTree,t[0].index,t[t.length-1].index),a=void 0,l=0,u=m(t);!(r=u()).done;){var c=r.value;(!a||a.end<c.index)&&(a=i.shift(),l=e.groupIndices.indexOf(a.start)),o.push(s({},c.index===a.start?{type:"group",index:l}:{index:c.index-(l+1)+n,groupIndex:l},{size:c.size,offset:c.offset,originalIndex:c.index,data:c.data}))}return o}function Ct(t,e,n,r,o){var i=0,a=0;if(t.length>0){i=t[0].offset;var l=t[t.length-1];a=l.offset+l.size}var s=i,u=r.lastOffset+(n-r.lastIndex)*r.lastSize-a;return{items:It(t,r,o),topItems:It(e,r,o),topListHeight:e.reduce(function(t,e){return e.size+t},0),offsetTop:i,offsetBottom:u,top:s,bottom:a,totalCount:n,firstItemIndex:o}}var Tt,wt,xt,yt=e.system(function(t){var n=t[0],r=n.sizes,o=n.totalCount,i=n.data,a=n.firstItemIndex,l=n.recalcInProgress,u=t[1],c=t[2],d=c.visibleRange,f=c.listBoundary,p=c.topListHeight,h=t[3],g=h.scrolledToInitialItem,v=h.initialTopMostItemIndex,S=t[4].topListHeight,I=t[5],C=t[6].didMount,T=e.statefulStream([]),w=e.stream();e.connect(u.topItemsIndexes,T);var x=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(C,l,e.duc(d),e.duc(o),e.duc(r),e.duc(v),g,e.duc(T),e.duc(a),i),e.filter(function(t){return t[0]&&!t[1]}),e.map(function(t){var n=t[2],r=n[0],o=n[1],i=t[3],a=t[5],l=t[6],s=t[7],u=t[8],c=t[9],d=t[4],f=d.sizeTree,p=d.offsetTree;if(0===i||0===r&&0===o)return St;if(b(f))return Ct(function(t,e,n){if(Q(e)){var r=$(t,e);return[{index:R(e.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:t,size:0,offset:0,data:n&&n[0]}]}(function(t,e){return"number"==typeof t?t:"LAST"===t.index?e-1:t.index}(a,i),d,c),[],i,d,u);var h=[];if(s.length>0)for(var g,v=s[0],S=s[s.length-1],I=0,C=m(U(f,v,S));!(g=C()).done;)for(var T=g.value,w=T.value,x=Math.max(T.start,v),y=Math.min(T.end,S),E=x;E<=y;E++)h.push({index:E,size:w,offset:I,data:c&&c[E]}),I+=w;if(!l)return Ct([],h,i,d,u);var H=s.length>0?s[s.length-1]+1:0,L=function(t,e,n,r){return void 0===r&&(r=0),r>0&&(e=Math.max(e,D(t,r,_).offset)),V((i=n,l=N(o=t,e,a=j),s=N(o,i,a,l),o.slice(l,s+1)),K);var o,i,a,l,s}(p,r,o,H);if(0===L.length)return null;var k=i-1;return Ct(e.tap([],function(t){for(var e,n=m(L);!(e=n()).done;){var i=e.value,a=i.value,l=a.offset,s=i.start,u=a.size;a.offset<r&&(l+=((s+=Math.floor((r-a.offset)/u))-i.start)*u),s<H&&(l+=(H-s)*u,s=H);for(var d=Math.min(i.end,k),f=s;f<=d&&!(l>=o);f++)t.push({index:f,size:u,offset:l,data:c&&c[f]}),l+=u}}),h,i,d,u)}),e.filter(function(t){return null!==t}),e.distinctUntilChanged()),St);return e.connect(e.pipe(i,e.filter(function(t){return void 0!==t}),e.map(function(t){return t.length})),o),e.connect(e.pipe(x,e.map(e.prop("topListHeight"))),S),e.connect(S,p),e.connect(e.pipe(x,e.map(function(t){return[t.top,t.bottom]})),f),e.connect(e.pipe(x,e.map(function(t){return t.items})),w),s({listState:x,topItemsIndexes:T,endReached:e.streamFromEmitter(e.pipe(x,e.filter(function(t){return t.items.length>0}),e.withLatestFrom(o,i),e.filter(function(t){var e=t[0].items;return e[e.length-1].originalIndex===t[1]-1}),e.map(function(t){return[t[1]-1,t[2]]}),e.distinctUntilChanged(ft),e.map(function(t){return t[0]}))),startReached:e.streamFromEmitter(e.pipe(x,e.throttleTime(200),e.filter(function(t){var e=t.items;return e.length>0&&e[0].originalIndex===t.topItems.length}),e.map(function(t){return t.items[0].index}),e.distinctUntilChanged())),rangeChanged:e.streamFromEmitter(e.pipe(x,e.filter(function(t){return t.items.length>0}),e.map(function(t){var e=t.items;return{startIndex:e[0].index,endIndex:e[e.length-1].index}}),e.distinctUntilChanged(pt))),itemsRendered:w},I)},e.tup(tt,dt,vt,st,rt,at,lt),{singleton:!0}),bt=e.system(function(t){var n=t[0],r=n.sizes,o=n.firstItemIndex,i=n.data,a=t[1].listState,l=t[2].didMount,s=e.statefulStream(0);return e.connect(e.pipe(l,e.withLatestFrom(s),e.filter(function(t){return 0!==t[1]}),e.withLatestFrom(r,o,i),e.map(function(t){var e=t[0][1],n=t[1],r=t[2],o=t[3],i=void 0===o?[]:o,a=0;if(n.groupIndices.length>0)for(var l,s=m(n.groupIndices);!((l=s()).done||l.value-a>=e);)a++;var u=e+a;return Ct(Array.from({length:u}).map(function(t,e){return{index:e,size:0,offset:0,data:i[e]}}),[],u,n,r)})),a),{initialItemCount:s}},e.tup(tt,yt,lt),{singleton:!0}),Et=e.system(function(t){var n=t[0].scrollVelocity,r=e.statefulStream(!1),o=e.stream(),i=e.statefulStream(!1);return e.connect(e.pipe(n,e.withLatestFrom(i,r,o),e.filter(function(t){return!!t[1]}),e.map(function(t){var e=t[0],n=t[1],r=t[2],o=t[3],i=n.enter;if(r){if((0,n.exit)(e,o))return!1}else if(i(e,o))return!0;return r}),e.distinctUntilChanged()),r),e.subscribe(e.pipe(e.combineLatest(r,n,o),e.withLatestFrom(i)),function(t){var e=t[0],n=t[1];return e[0]&&n&&n.change&&n.change(e[1],e[2])}),{isSeeking:r,scrollSeekConfiguration:i,scrollVelocity:n,scrollSeekRangeChanged:o}},e.tup(at),{singleton:!0}),Ht=e.system(function(t){var n=t[0].topItemsIndexes,r=e.statefulStream(0);return e.connect(e.pipe(r,e.filter(function(t){return t>0}),e.map(function(t){return Array.from({length:t}).map(function(t,e){return e})})),n),{topItemCount:r}},e.tup(yt)),Rt=e.system(function(t){var n=t[0],r=n.footerHeight,o=n.headerHeight,i=n.fixedHeaderHeight,a=t[1].listState,l=e.stream(),s=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(r,o,i,a),e.map(function(t){var e=t[3];return t[0]+t[1]+t[2]+e.offsetBottom+e.bottom})),0);return e.connect(e.duc(s),l),{totalListHeight:s,totalListHeightChanged:l}},e.tup(w,yt),{singleton:!0}),Lt=e.system(function(t){var n=t[0],r=n.scrollBy,o=n.scrollTop,i=n.deviation,a=n.scrollingInProgress,l=t[1],s=l.isScrolling,u=l.isAtBottom,c=l.atBottomState,m=l.scrollDirection,d=t[3],p=d.beforeUnshiftWith,h=d.shiftWithOffset,g=d.sizes,v=d.recalcInProgress,S=t[4].log,I=e.streamFromEmitter(e.pipe(t[2].listState,e.withLatestFrom(l.lastJumpDueToItemResize),e.scan(function(t,e){var n=t[1],r=e[0],o=r.items,i=r.totalCount,a=r.bottom+r.offsetBottom,l=0;return t[2]===i&&n.length>0&&o.length>0&&(0===o[0].originalIndex&&0===n[0].originalIndex||0!=(l=a-t[3])&&(l+=e[1])),[l,o,i,a]},[0,[],0,0]),e.filter(function(t){return 0!==t[0]}),e.withLatestFrom(o,m,a,S,u,c),e.filter(function(t){return!t[3]&&0!==t[1]&&t[2]===ot}),e.map(function(t){var e=t[0][0];return(0,t[4])("Upward scrolling compensation",{amount:e},f.DEBUG),e})));return e.connect(e.pipe(I,e.withLatestFrom(i),e.map(function(t){return t[1]-t[0]})),i),e.subscribe(e.pipe(e.combineLatest(e.statefulStreamFromEmitter(s,!1),i),e.filter(function(t){return!t[0]&&0!==t[1]}),e.map(function(t){return t[1]})),function(t){t>0?(e.publish(r,{top:-t,behavior:"auto"}),e.publish(i,0)):(e.publish(i,0),e.handleNext(o,function(){e.publish(v,!1)}),e.publish(r,{top:-t,behavior:"auto"}))}),e.connect(e.pipe(h,e.map(function(t){return{top:-t}})),r),e.connect(e.pipe(p,e.withLatestFrom(g),e.map(function(t){return t[0]*t[1].lastSize})),I),{deviation:i}},e.tup(w,at,yt,tt,g)),kt=e.system(function(t){var n=t[0].totalListHeight,r=t[1].didMount,o=t[2].scrollTo,i=e.statefulStream(0);return e.subscribe(e.pipe(r,e.withLatestFrom(i),e.filter(function(t){return 0!==t[1]}),e.map(function(t){return{top:t[1]}})),function(t){e.handleNext(e.pipe(n,e.filter(function(t){return 0!==t})),function(){setTimeout(function(){e.publish(o,t)})})}),{initialScrollTop:i}},e.tup(Rt,lt,w),{singleton:!0}),zt=e.system(function(t){var n=t[0].viewportHeight,r=t[1].totalListHeight,o=e.statefulStream(!1);return{alignToBottom:o,paddingTopAddition:e.statefulStreamFromEmitter(e.pipe(e.combineLatest(o,n,r),e.filter(function(t){return t[0]}),e.map(function(t){return Math.max(0,t[1]-t[2])}),e.distinctUntilChanged()),0)}},e.tup(w,Rt),{singleton:!0}),Bt=e.system(function(t){var n=t[0],r=n.scrollTo,o=n.scrollContainerState,i=e.stream(),a=e.stream(),l=e.stream(),u=e.statefulStream(!1),c=e.statefulStream(void 0);return e.connect(e.pipe(e.combineLatest(i,a),e.map(function(t){var e=t[0],n=e.viewportHeight,r=e.scrollHeight;return{scrollTop:Math.max(0,e.scrollTop-t[1].offsetTop),scrollHeight:r,viewportHeight:n}})),o),e.connect(e.pipe(r,e.withLatestFrom(a),e.map(function(t){var e=t[0];return s({},e,{top:e.top+t[1].offsetTop})})),l),{useWindowScroll:u,customScrollParent:c,windowScrollContainerState:i,windowViewportRect:a,windowScrollTo:l}},e.tup(w)),Ft=["done","behavior"],Pt=e.system(function(t){var n=t[0],r=n.sizes,o=n.totalCount,i=t[1],a=i.scrollTop,l=i.viewportHeight,c=i.headerHeight,m=i.scrollingInProgress,d=t[2].scrollToIndex,f=e.stream();return e.connect(e.pipe(f,e.withLatestFrom(r,l,o,c,a),e.map(function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],l=t[5],c=n.done,d=n.behavior,f=u(n,Ft),p=null,h=J(n,r,i-1),g=q(h,r.offsetTree)+a;return g<l?p=s({},f,{behavior:d,align:"start"}):g+R(r.sizeTree,h)[1]>l+o&&(p=s({},f,{behavior:d,align:"end"})),p?c&&e.handleNext(e.pipe(m,e.skip(1),e.filter(function(t){return!1===t})),c):c&&c(),p}),e.filter(function(t){return null!==t})),d),{scrollIntoView:f}},e.tup(tt,w,rt,yt,g),{singleton:!0}),Ot=["listState","topItemsIndexes"],Mt=e.system(function(t){return s({},t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},e.tup(vt,bt,lt,Et,Rt,kt,zt,Bt,Pt)),Ut=e.system(function(t){var n=t[0],r=n.totalCount,o=n.sizeRanges,i=n.fixedItemSize,a=n.defaultItemSize,l=n.trackItemSizes,c=n.itemSize,m=n.data,d=n.firstItemIndex,f=n.groupIndices,p=n.statefulTotalCount,h=t[1],g=h.initialTopMostItemIndex,v=h.scrolledToInitialItem,S=t[2],I=t[3],C=t[4],T=C.listState,w=C.topItemsIndexes,x=u(C,Ot),y=t[5].scrollToIndex,b=t[7].topItemCount,E=t[8].groupCounts,H=t[9],R=t[10];return e.connect(x.rangeChanged,H.scrollSeekRangeChanged),e.connect(e.pipe(H.windowViewportRect,e.map(e.prop("visibleHeight"))),S.viewportHeight),s({totalCount:r,data:m,firstItemIndex:d,sizeRanges:o,initialTopMostItemIndex:g,scrolledToInitialItem:v,topItemsIndexes:w,topItemCount:b,groupCounts:E,fixedItemHeight:i,defaultItemHeight:a},I,{statefulTotalCount:p,listState:T,scrollToIndex:y,trackItemSizes:l,itemSize:c,groupIndices:f},x,H,S,R)},e.tup(tt,st,w,ct,yt,rt,Lt,Ht,dt,Mt,g)),Vt=(Tt=function(){if("undefined"==typeof document)return"sticky";var t=document.createElement("div");return t.style.position="-webkit-sticky","-webkit-sticky"===t.style.position?"-webkit-sticky":"sticky"},xt=!1,function(){return xt||(xt=!0,wt=Tt()),wt});function At(t,e){var n=i(null),r=a(function(r){if(null!==r){var o,i,a=r.getBoundingClientRect(),l=a.width;if(e){var s=e.getBoundingClientRect(),u=a.top-s.top;o=s.height-Math.max(0,u),i=u+e.scrollTop}else o=window.innerHeight-Math.max(0,a.top),i=a.top+window.pageYOffset;n.current={offsetTop:i,visibleHeight:o,visibleWidth:l},t(n.current)}},[t,e]),l=v(r),s=l.callbackRef,u=l.ref,c=a(function(){r(u.current)},[r,u]);return o(function(){if(e){e.addEventListener("scroll",c);var t=new ResizeObserver(c);return t.observe(e),function(){e.removeEventListener("scroll",c),t.unobserve(e)}}return window.addEventListener("scroll",c),window.addEventListener("resize",c),function(){window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,e]),s}var Wt=["placeholder"],Nt=["style","children"],Dt=["style","children"];function Gt(t){return t}var _t=e.system(function(){var t=e.statefulStream(function(t){return"Item "+t}),n=e.statefulStream(null),r=e.statefulStream(function(t){return"Group "+t}),o=e.statefulStream({}),i=e.statefulStream(Gt),a=e.statefulStream("div"),l=e.statefulStream(e.noop),s=function(t,n){return void 0===n&&(n=null),e.statefulStreamFromEmitter(e.pipe(o,e.map(function(e){return e[t]}),e.distinctUntilChanged()),n)};return{context:n,itemContent:t,groupContent:r,components:o,computeItemKey:i,headerFooterTag:a,scrollerRef:l,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}});function jt(t,n){var r=e.stream();return e.subscribe(r,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+n,"color: red;","color: inherit;","color: blue;")}),e.connect(r,t),r}var Kt=e.system(function(t){var n=t[0],r=t[1],o={item:jt(r.itemContent,"Rename the %citem%c prop to %citemContent."),group:jt(r.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:jt(n.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:jt(n.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:jt(n.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:e.stream(),maxHeightCacheSize:e.stream(),footer:e.stream(),header:e.stream(),HeaderContainer:e.stream(),FooterContainer:e.stream(),ItemContainer:e.stream(),ScrollContainer:e.stream(),GroupContainer:e.stream(),ListContainer:e.stream(),emptyComponent:e.stream(),scrollSeek:e.stream()};function i(t,n,o){e.connect(e.pipe(t,e.withLatestFrom(r.components),e.map(function(t){var e,r=t[0],i=t[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),s({},i,((e={})[n]=r,e))})),r.components)}return e.subscribe(o.adjustForPrependedItems,function(){console.warn("react-virtuoso: adjustForPrependedItems is no longer supported. Use the firstItemIndex property instead - https://virtuoso.dev/prepend-items.","color: red;","color: inherit;","color: blue;")}),e.subscribe(o.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),e.subscribe(o.HeaderContainer,function(){console.warn("react-virtuoso: HeaderContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the header component and pass components.Header to change its contents.")}),e.subscribe(o.FooterContainer,function(){console.warn("react-virtuoso: FooterContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the footer component and pass components.Footer to change its contents.")}),e.subscribe(o.scrollSeek,function(t){var o=t.placeholder,i=u(t,Wt);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),e.publish(r.components,s({},e.getValue(r.components),{ScrollSeekPlaceholder:o})),e.publish(n.scrollSeekConfiguration,i)}),i(o.footer,"Footer","footer"),i(o.header,"Header","header"),i(o.ItemContainer,"Item","ItemContainer"),i(o.ListContainer,"List","ListContainer"),i(o.ScrollContainer,"Scroller","ScrollContainer"),i(o.emptyComponent,"EmptyPlaceholder","emptyComponent"),i(o.GroupContainer,"Group","GroupContainer"),s({},n,r,o)},e.tup(Ut,_t)),Yt=function(t){return n.createElement("div",{style:{height:t.height}})},Zt={position:Vt(),zIndex:1,overflowAnchor:"none"},qt={overflowAnchor:"none"},Jt=n.memo(function(t){var r=t.showTopList,o=void 0!==r&&r,i=me("listState"),a=ce("sizeRanges"),u=me("useWindowScroll"),c=me("customScrollParent"),m=ce("windowScrollContainerState"),d=ce("scrollContainerState"),f=c||u?m:d,p=me("itemContent"),h=me("context"),g=me("groupContent"),v=me("trackItemSizes"),S=me("itemSize"),C=me("log"),T=I(a,S,v,o?e.noop:f,C,c),w=T.callbackRef,x=T.ref,y=n.useState(0),b=y[0],E=y[1];de("deviation",function(t){b!==t&&(x.current.style.marginTop=t+"px",E(t))});var H=me("EmptyPlaceholder"),R=me("ScrollSeekPlaceholder")||Yt,L=me("ListComponent"),k=me("ItemComponent"),z=me("GroupComponent"),B=me("computeItemKey"),F=me("isSeeking"),P=me("groupIndices").length>0,O=me("paddingTopAddition"),M=me("statefulTotalCount"),U=o?{}:{boxSizing:"border-box",paddingTop:i.offsetTop+O,paddingBottom:i.offsetBottom,marginTop:b};return!o&&0===M&&H?l(H,te(H,h)):l(L,s({},te(L,h),{ref:w,style:U,"data-test-id":o?"virtuoso-top-item-list":"virtuoso-item-list"}),(o?i.topItems:i.items).map(function(t){var e=t.originalIndex,n=B(e+i.firstItemIndex,t.data,h);return F?l(R,s({},te(R,h),{key:n,index:t.index,height:t.size,type:t.type||"item"},"group"===t.type?{}:{groupIndex:t.groupIndex})):"group"===t.type?l(z,s({},te(z,h),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,style:Zt}),g(t.index)):l(k,s({},te(k,h),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,"data-item-group-index":t.groupIndex,style:qt}),P?p(t.index,t.groupIndex,t.data,h):p(t.index,t.data,h))}))}),$t={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Qt={width:"100%",height:"100%",position:"absolute",top:0},Xt={width:"100%",position:Vt(),top:0};function te(t,e){if("string"!=typeof t)return{context:e}}var ee=n.memo(function(){var t=me("HeaderComponent"),e=ce("headerHeight"),n=me("headerFooterTag"),r=S(function(t){return e(C(t,"height"))}),o=me("context");return t?l(n,{ref:r},l(t,te(t,o))):null}),ne=n.memo(function(){var t=me("FooterComponent"),e=ce("footerHeight"),n=me("headerFooterTag"),r=S(function(t){return e(C(t,"height"))}),o=me("context");return t?l(n,{ref:r},l(t,te(t,o))):null});function re(t){var e=t.usePublisher,r=t.useEmitter,o=t.useEmitterValue;return n.memo(function(t){var n=t.style,i=t.children,a=u(t,Nt),c=e("scrollContainerState"),m=o("ScrollerComponent"),d=e("smoothScrollTargetReached"),f=o("scrollerRef"),p=o("context"),h=T(c,d,m,f),g=h.scrollerRef,v=h.scrollByCallback;return r("scrollTo",h.scrollToCallback),r("scrollBy",v),l(m,s({ref:g,style:s({},$t,n),"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0},a,te(m,p)),i)})}function oe(t){var r=t.usePublisher,o=t.useEmitter,i=t.useEmitterValue;return n.memo(function(t){var n=t.style,a=t.children,c=u(t,Dt),m=r("windowScrollContainerState"),d=i("ScrollerComponent"),f=r("smoothScrollTargetReached"),h=i("totalListHeight"),g=i("deviation"),v=i("customScrollParent"),S=i("context"),I=T(m,f,d,e.noop,v),C=I.scrollerRef,w=I.scrollByCallback,x=I.scrollToCallback;return p(function(){return C.current=v||window,function(){C.current=null}},[C,v]),o("windowScrollTo",x),o("scrollBy",w),l(d,s({style:s({position:"relative"},n,0!==h?{height:h+g}:{}),"data-virtuoso-scroller":!0},c,te(d,S)),a)})}var ie=function(t){var r=t.children,o=ce("viewportHeight"),i=S(e.compose(o,function(t){return C(t,"height")}));return n.createElement("div",{style:Qt,ref:i,"data-viewport-type":"element"},r)},ae=function(t){var e=t.children,r=At(ce("windowViewportRect"),me("customScrollParent"));return n.createElement("div",{ref:r,style:Qt,"data-viewport-type":"window"},e)},le=function(t){var e=t.children,n=me("TopItemListComponent"),r=me("headerHeight"),o=s({},Xt,{marginTop:r+"px"}),i=me("context");return l(n||"div",{style:o,context:i},e)},se=t(Kt,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",react18ConcurrentRendering:"react18ConcurrentRendering",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},n.memo(function(t){var e=me("useWindowScroll"),r=me("topItemsIndexes").length>0,o=me("customScrollParent"),i=o||e?ae:ie;return n.createElement(o||e?pe:fe,s({},t),n.createElement(i,null,n.createElement(ee,null),n.createElement(Jt,null),n.createElement(ne,null)),r&&n.createElement(le,null,n.createElement(Jt,{showTopList:!0})))})),ue=se.Component,ce=se.usePublisher,me=se.useEmitterValue,de=se.useEmitter,fe=re({usePublisher:ce,useEmitterValue:me,useEmitter:de}),pe=oe({usePublisher:ce,useEmitterValue:me,useEmitter:de}),he={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},ge={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},ve=Math.round,Se=Math.ceil,Ie=Math.floor,Ce=Math.min,Te=Math.max;function we(t,e){return Array.from({length:e-t+1}).map(function(e,n){return{index:n+t}})}var xe=e.system(function(t){var n=t[0],r=n.overscan,o=n.visibleRange,i=n.listBoundary,a=t[1],l=a.scrollTop,u=a.viewportHeight,c=a.scrollBy,m=a.scrollTo,d=a.smoothScrollTargetReached,f=a.scrollContainerState,p=t[2],h=t[3],g=t[4],v=g.propsReady,S=g.didMount,I=t[5],C=I.windowViewportRect,T=I.windowScrollTo,w=I.useWindowScroll,x=I.customScrollParent,y=I.windowScrollContainerState,b=e.statefulStream(0),E=e.statefulStream(0),H=e.statefulStream(he),R=e.statefulStream({height:0,width:0}),L=e.statefulStream({height:0,width:0}),k=e.stream(),z=e.stream(),B=e.statefulStream(0);e.connect(e.pipe(S,e.withLatestFrom(E),e.filter(function(t){return 0!==t[1]}),e.map(function(t){return{items:we(0,t[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),H),e.connect(e.pipe(e.combineLatest(e.duc(b),o,e.duc(L,function(t,e){return t&&t.width===e.width&&t.height===e.height})),e.withLatestFrom(R),e.map(function(t){var e=t[0],n=e[0],r=e[1],o=r[0],i=r[1],a=e[2],l=t[1],s=a.height,u=a.width,c=l.width;if(0===n||0===c)return he;if(0===u)return ge;var m=Ee(c,u),d=m*Ie(o/s),f=m*Se(i/s)-1;f=Te(0,Ce(n-1,f));var p=we(d=Ce(f,Te(0,d)),f),h=ye(l,a,p),g=h.top,v=h.bottom;return{items:p,offsetTop:g,offsetBottom:Se(n/m)*s-v,top:g,bottom:v,itemHeight:s,itemWidth:u}})),H),e.connect(e.pipe(R,e.map(function(t){return t.height})),u),e.connect(e.pipe(e.combineLatest(R,L,H),e.map(function(t){var e=ye(t[0],t[1],t[2].items);return[e.top,e.bottom]}),e.distinctUntilChanged(ft)),i);var F=e.streamFromEmitter(e.pipe(e.duc(H),e.filter(function(t){return t.items.length>0}),e.withLatestFrom(b),e.filter(function(t){var e=t[0].items;return e[e.length-1].index===t[1]-1}),e.map(function(t){return t[1]-1}),e.distinctUntilChanged())),P=e.streamFromEmitter(e.pipe(e.duc(H),e.filter(function(t){var e=t.items;return e.length>0&&0===e[0].index}),e.mapTo(0),e.distinctUntilChanged())),O=e.streamFromEmitter(e.pipe(e.duc(H),e.filter(function(t){return t.items.length>0}),e.map(function(t){var e=t.items;return{startIndex:e[0].index,endIndex:e[e.length-1].index}}),e.distinctUntilChanged(pt)));e.connect(O,h.scrollSeekRangeChanged),e.connect(e.pipe(k,e.withLatestFrom(R,L,b),e.map(function(t){var e=t[1],n=t[2],r=t[3],o=nt(t[0]),i=o.align,a=o.behavior,l=o.offset,s=o.index;"LAST"===s&&(s=r-1);var u=be(e,n,s=Te(0,s,Ce(r-1,s)));return"end"===i?u=ve(u-e.height+n.height):"center"===i&&(u=ve(u-e.height/2+n.height/2)),l&&(u+=l),{top:u,behavior:a}})),m);var M=e.statefulStreamFromEmitter(e.pipe(H,e.map(function(t){return t.offsetBottom+t.bottom})),0);return e.connect(e.pipe(C,e.map(function(t){return{width:t.visibleWidth,height:t.visibleHeight}})),R),s({totalCount:b,viewportDimensions:R,itemDimensions:L,scrollTop:l,scrollHeight:z,overscan:r,scrollBy:c,scrollTo:m,scrollToIndex:k,smoothScrollTargetReached:d,windowViewportRect:C,windowScrollTo:T,useWindowScroll:w,customScrollParent:x,windowScrollContainerState:y,deviation:B,scrollContainerState:f,initialItemCount:E},h,{gridState:H,totalListHeight:M},p,{startReached:P,endReached:F,rangeChanged:O,propsReady:v})},e.tup(vt,w,at,Et,lt,Bt));function ye(t,e,n){var r=e.height;return void 0===r||0===n.length?{top:0,bottom:0}:{top:be(t,e,n[0].index),bottom:be(t,e,n[n.length-1].index)+r}}function be(t,e,n){var r=Ee(t.width,e.width);return Ie(n/r)*e.height}function Ee(t,e){return Te(1,Ie(t/e))}var He=["placeholder"],Re=e.system(function(){var t=e.statefulStream(function(t){return"Item "+t}),n=e.statefulStream({}),r=e.statefulStream(null),o=e.statefulStream("virtuoso-grid-item"),i=e.statefulStream("virtuoso-grid-list"),a=e.statefulStream(Gt),l=e.statefulStream(e.noop),s=function(t,r){return void 0===r&&(r=null),e.statefulStreamFromEmitter(e.pipe(n,e.map(function(e){return e[t]}),e.distinctUntilChanged()),r)};return{context:r,itemContent:t,components:n,computeItemKey:a,itemClassName:o,listClassName:i,scrollerRef:l,ListComponent:s("List","div"),ItemComponent:s("Item","div"),ScrollerComponent:s("Scroller","div"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),Le=e.system(function(t){var n=t[0],r=t[1],o={item:jt(r.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:e.stream(),ScrollContainer:e.stream(),ListContainer:e.stream(),emptyComponent:e.stream(),scrollSeek:e.stream()};function i(t,n,o){e.connect(e.pipe(t,e.withLatestFrom(r.components),e.map(function(t){var e,r=t[0],i=t[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),s({},i,((e={})[n]=r,e))})),r.components)}return e.subscribe(o.scrollSeek,function(t){var o=t.placeholder,i=u(t,He);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),e.publish(r.components,s({},e.getValue(r.components),{ScrollSeekPlaceholder:o})),e.publish(n.scrollSeekConfiguration,i)}),i(o.ItemContainer,"Item","ItemContainer"),i(o.ListContainer,"List","ListContainer"),i(o.ScrollContainer,"Scroller","ScrollContainer"),s({},n,r,o)},e.tup(xe,Re)),ke=n.memo(function(){var t=Me("gridState"),e=Me("listClassName"),n=Me("itemClassName"),r=Me("itemContent"),o=Me("computeItemKey"),i=Me("isSeeking"),a=Oe("scrollHeight"),u=Me("ItemComponent"),c=Me("ListComponent"),m=Me("ScrollSeekPlaceholder"),d=Me("context"),f=Oe("itemDimensions"),p=S(function(t){a(t.parentElement.parentElement.scrollHeight);var e=t.firstChild;e&&f(e.getBoundingClientRect())});return l(c,s({ref:p,className:e},te(c,d),{style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom}}),t.items.map(function(e){var a=o(e.index);return i?l(m,s({key:a},te(m,d),{index:e.index,height:t.itemHeight,width:t.itemWidth})):l(u,s({},te(u,d),{className:n,"data-index":e.index,key:a}),r(e.index,d))}))}),ze=function(t){var e=t.children,r=Oe("viewportDimensions"),o=S(function(t){r(t.getBoundingClientRect())});return n.createElement("div",{style:Qt,ref:o},e)},Be=function(t){var e=t.children,r=At(Oe("windowViewportRect"),Me("customScrollParent"));return n.createElement("div",{ref:r,style:Qt},e)},Fe=t(Le,{optional:{totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},n.memo(function(t){var e=s({},t),r=Me("useWindowScroll"),o=Me("customScrollParent"),i=o||r?Be:ze;return n.createElement(o||r?Ae:Ve,s({},e),n.createElement(i,null,n.createElement(ke,null)))})),Pe=Fe.Component,Oe=Fe.usePublisher,Me=Fe.useEmitterValue,Ue=Fe.useEmitter,Ve=re({usePublisher:Oe,useEmitterValue:Me,useEmitter:Ue}),Ae=oe({usePublisher:Oe,useEmitterValue:Me,useEmitter:Ue}),We=e.system(function(){var t=e.statefulStream(function(t){return n.createElement("td",null,"Item $",t)}),r=e.statefulStream(null),o=e.statefulStream(null),i=e.statefulStream({}),a=e.statefulStream(Gt),l=e.statefulStream(e.noop),s=function(t,n){return void 0===n&&(n=null),e.statefulStreamFromEmitter(e.pipe(i,e.map(function(e){return e[t]}),e.distinctUntilChanged()),n)};return{context:r,itemContent:t,fixedHeaderContent:o,components:i,computeItemKey:a,scrollerRef:l,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),Ne=e.system(function(t){return s({},t[0],t[1])},e.tup(Ut,We)),De=function(t){return n.createElement("tr",null,n.createElement("td",{style:{height:t.height}}))},Ge=function(t){return n.createElement("tr",null,n.createElement("td",{style:{height:t.height,padding:0,border:0}}))},_e=n.memo(function(){var t=Je("listState"),e=qe("sizeRanges"),r=Je("useWindowScroll"),o=Je("customScrollParent"),i=qe("windowScrollContainerState"),a=qe("scrollContainerState"),u=o||r?i:a,c=Je("itemContent"),m=Je("trackItemSizes"),d=I(e,Je("itemSize"),m,u,Je("log"),o),f=d.callbackRef,p=d.ref,h=n.useState(0),g=h[0],v=h[1];$e("deviation",function(t){g!==t&&(p.current.style.marginTop=t+"px",v(t))});var S=Je("EmptyPlaceholder"),C=Je("ScrollSeekPlaceholder")||De,T=Je("FillerRow")||Ge,w=Je("TableBodyComponent"),x=Je("TableRowComponent"),y=Je("computeItemKey"),b=Je("isSeeking"),E=Je("paddingTopAddition"),H=Je("firstItemIndex"),R=Je("statefulTotalCount"),L=Je("context");if(0===R&&S)return l(S,te(S,L));var k=t.offsetTop+E+g,z=t.offsetBottom,B=k>0?n.createElement(T,{height:k,key:"padding-top"}):null,F=z>0?n.createElement(T,{height:z,key:"padding-bottom"}):null,P=t.items.map(function(t){var e=t.originalIndex,n=y(e+H,t.data,L);return b?l(C,s({},te(C,L),{key:n,index:t.index,height:t.size,type:t.type||"item"})):l(x,s({},te(x,L),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,style:{overflowAnchor:"none"}}),c(t.index,t.data,L))});return l(w,s({ref:f,"data-test-id":"virtuoso-item-list"},te(w,L)),[B].concat(P,[F]))}),je=function(t){var r=t.children,o=qe("viewportHeight"),i=S(e.compose(o,function(t){return C(t,"height")}));return n.createElement("div",{style:Qt,ref:i,"data-viewport-type":"element"},r)},Ke=function(t){var e=t.children,r=At(qe("windowViewportRect"),Je("customScrollParent"));return n.createElement("div",{ref:r,style:Qt,"data-viewport-type":"window"},e)},Ye=t(Ne,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",react18ConcurrentRendering:"react18ConcurrentRendering"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},n.memo(function(t){var r=Je("useWindowScroll"),o=Je("customScrollParent"),i=qe("fixedHeaderHeight"),a=Je("fixedHeaderContent"),l=Je("context"),u=S(e.compose(i,function(t){return C(t,"height")})),c=o||r?Xe:Qe,m=o||r?Ke:je,d=Je("TableComponent"),f=Je("TableHeadComponent"),p=a?n.createElement(f,s({key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:u},te(f,l)),a()):null;return n.createElement(c,s({},t),n.createElement(m,null,n.createElement(d,s({style:{borderSpacing:0}},te(d,l)),[p,n.createElement(_e,{key:"TableBody"})])))})),Ze=Ye.Component,qe=Ye.usePublisher,Je=Ye.useEmitterValue,$e=Ye.useEmitter,Qe=re({usePublisher:qe,useEmitterValue:Je,useEmitter:$e}),Xe=oe({usePublisher:qe,useEmitterValue:Je,useEmitter:$e}),tn=ue,en=ue,nn=Ze,rn=Pe;export{en as GroupedVirtuoso,f as LogLevel,nn as TableVirtuoso,tn as Virtuoso,rn as VirtuosoGrid};
1
+ import{systemToComponent as t}from"@virtuoso.dev/react-urx";import*as e from"@virtuoso.dev/urx";import*as n from"react";import{useLayoutEffect as r,useEffect as o,useRef as i,useCallback as a,createElement as l}from"react";import{flushSync as s}from"react-dom";function u(){return u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u.apply(this,arguments)}function c(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,p,h="undefined"!=typeof document?r:o;!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR"}(p||(p={}));var g=((f={})[p.DEBUG]="debug",f[p.INFO]="log",f[p.WARN]="warn",f[p.ERROR]="error",f),v=e.system(function(){var t=e.statefulStream(p.ERROR);return{log:e.statefulStream(function(n,r,o){var i;void 0===o&&(o=p.INFO),o>=(null!=(i=("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL)?i:e.getValue(t))&&console[g[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:t}},[],{singleton:!0});function S(t,e){void 0===e&&(e=!0);var n=i(null),r=function(t){};if("undefined"!=typeof ResizeObserver){var o=new ResizeObserver(function(e){var n=e[0].target;null!==n.offsetParent&&t(n)});r=function(t){t&&e?(o.observe(t),n.current=t):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function I(t,e){return void 0===e&&(e=!0),S(t,e).callbackRef}function C(t,e,n,r,o,i){return S(function(n){for(var a=function(t,e,n,r){var o=t.length;if(0===o)return null;for(var i=[],a=0;a<o;a++){var l=t.item(a);if(l&&void 0!==l.dataset.index){var s=parseInt(l.dataset.index),u=parseFloat(l.dataset.knownSize),c=e(l,"offsetHeight");if(0===c&&r("Zero-sized element, this should not happen",{child:l},p.ERROR),c!==u){var m=i[i.length-1];0===i.length||m.size!==c||m.endIndex!==s-1?i.push({startIndex:s,endIndex:s,size:c}):i[i.length-1].endIndex++}}}return i}(n.children,e,0,o),l=n.parentElement;!l.dataset.virtuosoScroller;)l=l.parentElement;var s=i?i.scrollTop:"window"===l.firstElementChild.dataset.viewportType?window.pageYOffset||document.documentElement.scrollTop:l.scrollTop;r({scrollTop:Math.max(s,0),scrollHeight:(null!=i?i:l).scrollHeight,viewportHeight:(null!=i?i:l).offsetHeight}),null!==a&&t(a)},n)}function T(t,e){return Math.round(t.getBoundingClientRect()[e])}function w(t,e){return Math.abs(t-e)<1.01}function x(t,n,r,l,u){void 0===l&&(l=e.noop);var c=i(null),m=i(null),d=i(null),f=i(!1),p=a(function(e){var r=e.target,o=r===window||r===document?window.pageYOffset||document.documentElement.scrollTop:r.scrollTop,i=r===window?document.documentElement.scrollHeight:r.scrollHeight,a=r===window?window.innerHeight:r.offsetHeight,l=function(){t({scrollTop:Math.max(o,0),scrollHeight:i,viewportHeight:a})};f.current?s(l):l(),f.current=!1,null!==m.current&&(o===m.current||o<=0||o===r.scrollHeight-T(r,"height"))&&(m.current=null,n(!0),d.current&&(clearTimeout(d.current),d.current=null))},[t,n]);return o(function(){var t=u||c.current;return l(u||c.current),p({target:t}),t.addEventListener("scroll",p,{passive:!0}),function(){l(null),t.removeEventListener("scroll",p)}},[c,p,r,l,u]),{scrollerRef:c,scrollByCallback:function(t){f.current=!0,c.current.scrollBy(t)},scrollToCallback:function(e){var r=c.current;if(r&&(!("offsetHeight"in r)||0!==r.offsetHeight)){var o,i,a,l="smooth"===e.behavior;if(r===window?(i=Math.max(T(document.documentElement,"height"),document.documentElement.scrollHeight),o=window.innerHeight,a=document.documentElement.scrollTop):(i=r.scrollHeight,o=T(r,"height"),a=r.scrollTop),e.top=Math.ceil(Math.max(Math.min(i-o,e.top),0)),w(o,i)||e.top===a)return t({scrollTop:a,scrollHeight:i,viewportHeight:o}),void(l&&n(!0));l?(m.current=e.top,d.current&&clearTimeout(d.current),d.current=setTimeout(function(){d.current=null,m.current=null,n(!0)},1e3)):m.current=null,r.scrollTo(e)}}}}var b=e.system(function(){var t=e.stream(),n=e.stream(),r=e.statefulStream(0),o=e.stream(),i=e.statefulStream(0),a=e.stream(),l=e.stream(),s=e.statefulStream(0),u=e.statefulStream(0),c=e.statefulStream(0),m=e.stream(),d=e.stream(),f=e.statefulStream(!1),p=e.statefulStream(!1);return e.connect(e.pipe(t,e.map(function(t){return t.scrollTop})),n),e.connect(e.pipe(t,e.map(function(t){return t.scrollHeight})),l),e.connect(n,i),{scrollContainerState:t,scrollTop:n,viewportHeight:a,headerHeight:s,fixedHeaderHeight:u,footerHeight:c,scrollHeight:l,smoothScrollTargetReached:o,react18ConcurrentRendering:p,scrollTo:m,scrollBy:d,statefulScrollTop:i,deviation:r,scrollingInProgress:f}},[],{singleton:!0}),y={lvl:0};function E(t,e,n,r,o){return void 0===r&&(r=y),void 0===o&&(o=y),{k:t,v:e,lvl:n,l:r,r:o}}function H(t){return t===y}function R(){return y}function L(t,e){if(H(t))return y;var n=t.k,r=t.l,o=t.r;if(e===n){if(H(r))return o;if(H(o))return r;var i=P(r);return U(M(t,{k:i[0],v:i[1],l:O(r)}))}return U(M(t,e<n?{l:L(r,e)}:{r:L(o,e)}))}function k(t,e,n){if(void 0===n&&(n="k"),H(t))return[-Infinity,void 0];if(t[n]===e)return[t.k,t.v];if(t[n]<e){var r=k(t.r,e,n);return-Infinity===r[0]?[t.k,t.v]:r}return k(t.l,e,n)}function z(t,e,n){return H(t)?E(e,n,1):e===t.k?M(t,{k:e,v:n}):function(t){return N(D(t))}(M(t,e<t.k?{l:z(t.l,e,n)}:{r:z(t.r,e,n)}))}function B(t,e,n){if(H(t))return[];var r=t.k,o=t.v,i=t.r,a=[];return r>e&&(a=a.concat(B(t.l,e,n))),r>=e&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(B(i,e,n))),a}function F(t){return H(t)?[]:[].concat(F(t.l),[{k:t.k,v:t.v}],F(t.r))}function P(t){return H(t.r)?[t.k,t.v]:P(t.r)}function O(t){return H(t.r)?t.l:U(M(t,{r:O(t.r)}))}function M(t,e){return E(void 0!==e.k?e.k:t.k,void 0!==e.v?e.v:t.v,void 0!==e.lvl?e.lvl:t.lvl,void 0!==e.l?e.l:t.l,void 0!==e.r?e.r:t.r)}function V(t){return H(t)||t.lvl>t.r.lvl}function U(t){var e=t.l,n=t.r,r=t.lvl;if(n.lvl>=r-1&&e.lvl>=r-1)return t;if(r>n.lvl+1){if(V(e))return D(M(t,{lvl:r-1}));if(H(e)||H(e.r))throw new Error("Unexpected empty nodes");return M(e.r,{l:M(e,{r:e.r.l}),r:M(t,{l:e.r.r,lvl:r-1}),lvl:r})}if(V(t))return N(M(t,{lvl:r-1}));if(H(n)||H(n.l))throw new Error("Unexpected empty nodes");var o=n.l,i=V(o)?n.lvl-1:n.lvl;return M(o,{l:M(t,{r:o.l,lvl:r-1}),r:N(M(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}function A(t,e,n){return H(t)?[]:W(B(t,k(t,e)[0],n),function(t){return{index:t.k,value:t.v}})}function W(t,e){var n=t.length;if(0===n)return[];for(var r=e(t[0]),o=r.index,i=r.value,a=[],l=1;l<n;l++){var s=e(t[l]),u=s.index,c=s.value;a.push({start:o,end:u-1,value:i}),o=u,i=c}return a.push({start:o,end:Infinity,value:i}),a}function N(t){var e=t.r,n=t.lvl;return H(e)||H(e.r)||e.lvl!==n||e.r.lvl!==n?t:M(e,{l:M(t,{r:e.l}),lvl:n+1})}function D(t){var e=t.l;return H(e)||e.lvl!==t.lvl?t:M(e,{r:M(t,{l:e.r})})}function G(t,e,n,r){void 0===r&&(r=0);for(var o=t.length-1;r<=o;){var i=Math.floor((r+o)/2),a=n(t[i],e);if(0===a)return i;if(-1===a){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error("Failed binary finding record in array - "+t.join(",")+", searched for "+e)}function _(t,e,n){return t[G(t,e,n)]}var j=e.system(function(){return{recalcInProgress:e.statefulStream(!1)}},[],{singleton:!0});function K(t){var e=t.size,n=t.startIndex,r=t.endIndex;return function(t){return t.start===n&&(t.end===r||Infinity===t.end)&&t.value===e}}function Y(t,e){var n=t.index;return e===n?0:e<n?-1:1}function q(t,e){var n=t.offset;return e===n?0:e<n?-1:1}function Z(t){return{index:t.index,value:t}}function J(t,e,n){var r=t,o=0,i=0,a=0,l=0;if(0!==e){a=r[l=G(r,e-1,Y)].offset;var s=k(n,e-1);o=s[0],i=s[1],r.length&&r[l].size===k(n,e)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(var u,c=d(A(n,e,Infinity));!(u=c()).done;){var m=u.value,f=m.start,p=m.value,h=(f-o)*i+a;r.push({offset:h,size:p,index:f}),o=f,a=h,i=p}return{offsetTree:r,lastIndex:o,lastOffset:a,lastSize:i}}function $(t,e){var n=e[0],r=e[1];n.length>0&&(0,e[2])("received item sizes",n,p.DEBUG);var o=t.sizeTree,i=o,a=0;if(r.length>0&&H(o)&&2===n.length){var l=n[0].size,s=n[1].size;i=r.reduce(function(t,e){return z(z(t,e,l),e+1,s)},i)}else{var u=function(t,e){for(var n,r=H(t)?0:Infinity,o=d(e);!(n=o()).done;){var i=n.value,a=i.size,l=i.startIndex,s=i.endIndex;if(r=Math.min(r,l),H(t))t=z(t,0,a);else{var u=A(t,l-1,s+1);if(!u.some(K(i))){for(var c,m=!1,f=!1,p=d(u);!(c=p()).done;){var h=c.value,g=h.start,v=h.end,S=h.value;m?(s>=g||a===S)&&(t=L(t,g)):(f=S!==a,m=!0),v>s&&s>=g&&S!==a&&(t=z(t,s+1,S))}f&&(t=z(t,l,a))}}}return[t,r]}(i,n);i=u[0],a=u[1]}if(i===o)return t;var c=J(t.offsetTree,a,i),m=c.offsetTree;return{sizeTree:i,offsetTree:m,lastIndex:c.lastIndex,lastOffset:c.lastOffset,lastSize:c.lastSize,groupOffsetTree:r.reduce(function(t,e){return z(t,e,Q(e,m))},R()),groupIndices:r}}function Q(t,e){if(0===e.length)return 0;var n=_(e,t,Y);return n.size*(t-n.index)+n.offset}function X(t,e,n){if(function(t){return void 0!==t.groupIndex}(t))return e.groupIndices[t.groupIndex]+1;var r=tt("LAST"===t.index?n:t.index,e);return Math.max(0,r,Math.min(n,r))}function tt(t,e){if(!et(e))return t;for(var n=0;e.groupIndices[n]<=t+n;)n++;return t+n}function et(t){return!H(t.groupOffsetTree)}var nt={offsetHeight:"height",offsetWidth:"width"},rt=e.system(function(t){var n=t[0].log,r=t[1].recalcInProgress,o=e.stream(),i=e.stream(),a=e.statefulStreamFromEmitter(i,0),l=e.stream(),s=e.stream(),c=e.statefulStream(0),m=e.statefulStream([]),d=e.statefulStream(void 0),f=e.statefulStream(void 0),h=e.statefulStream(function(t,e){return T(t,nt[e])}),g=e.statefulStream(void 0),v={offsetTree:[],sizeTree:R(),groupOffsetTree:R(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},S=e.statefulStreamFromEmitter(e.pipe(o,e.withLatestFrom(m,n),e.scan($,v),e.distinctUntilChanged()),v);e.connect(e.pipe(m,e.filter(function(t){return t.length>0}),e.withLatestFrom(S),e.map(function(t){var e=t[0],n=t[1],r=e.reduce(function(t,e,r){return z(t,e,Q(e,n.offsetTree)||r)},R());return u({},n,{groupIndices:e,groupOffsetTree:r})})),S),e.connect(e.pipe(i,e.withLatestFrom(S),e.filter(function(t){return t[0]<t[1].lastIndex}),e.map(function(t){var e=t[1];return[{startIndex:t[0],endIndex:e.lastIndex,size:e.lastSize}]})),o),e.connect(d,f);var I=e.statefulStreamFromEmitter(e.pipe(d,e.map(function(t){return void 0===t})),!0);e.connect(e.pipe(f,e.filter(function(t){return void 0!==t&&H(e.getValue(S).sizeTree)}),e.map(function(t){return[{startIndex:0,endIndex:0,size:t}]})),o);var C=e.streamFromEmitter(e.pipe(o,e.withLatestFrom(S),e.scan(function(t,e){var n=e[1];return{changed:n!==t.sizes,sizes:n}},{changed:!1,sizes:v}),e.map(function(t){return t.changed})));e.subscribe(e.pipe(c,e.scan(function(t,e){return{diff:t.prev-e,prev:e}},{diff:0,prev:0}),e.map(function(t){return t.diff})),function(t){t>0?(e.publish(r,!0),e.publish(l,t)):t<0&&e.publish(s,t)}),e.subscribe(e.pipe(c,e.withLatestFrom(n)),function(t){t[0]<0&&(0,t[1])("`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:c},p.ERROR)});var w=e.streamFromEmitter(l);e.connect(e.pipe(l,e.withLatestFrom(S),e.map(function(t){var e=t[0],n=t[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: prepending items does not work with groups");return F(n.sizeTree).reduce(function(t,n){var r=n.k,o=n.v;return{ranges:[].concat(t.ranges,[{startIndex:t.prevIndex,endIndex:r+e-1,size:t.prevSize}]),prevIndex:r+e,prevSize:o}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),o);var x=e.streamFromEmitter(e.pipe(s,e.withLatestFrom(S),e.map(function(t){return Q(-t[0],t[1].offsetTree)})));return e.connect(e.pipe(s,e.withLatestFrom(S),e.map(function(t){var e=t[0],n=t[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: shifting items does not work with groups");var r=F(n.sizeTree).reduce(function(t,n){var r=n.v;return z(t,Math.max(0,n.k+e),r)},R());return u({},n,{sizeTree:r},J(n.offsetTree,0,r))})),S),{data:g,totalCount:i,sizeRanges:o,groupIndices:m,defaultItemSize:f,fixedItemSize:d,unshiftWith:l,shiftWith:s,shiftWithOffset:x,beforeUnshiftWith:w,firstItemIndex:c,sizes:S,listRefresh:C,statefulTotalCount:a,trackItemSizes:I,itemSize:h}},e.tup(v,j),{singleton:!0}),ot="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function it(t){var e="number"==typeof t?{index:t}:t;return e.align||(e.align="start"),e.behavior&&ot||(e.behavior="auto"),e.offset||(e.offset=0),e}var at=e.system(function(t){var n=t[0],r=n.sizes,o=n.totalCount,i=n.listRefresh,a=t[1],l=a.scrollingInProgress,s=a.viewportHeight,u=a.scrollTo,c=a.smoothScrollTargetReached,m=a.headerHeight,d=a.footerHeight,f=t[2].log,h=e.stream(),g=e.statefulStream(0),v=null,S=null,I=null;function C(){v&&(v(),v=null),I&&(I(),I=null),S&&(clearTimeout(S),S=null),e.publish(l,!1)}return e.connect(e.pipe(h,e.withLatestFrom(r,s,o,g,m,d,f),e.map(function(t){var n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],m=t[6],d=t[7],f=it(n),g=f.align,T=f.behavior,w=f.offset,x=a-1,b=X(f,r,x),y=Q(b,r.offsetTree)+u;"end"===g?(y=y-o+k(r.sizeTree,b)[1],b===x&&(y+=m)):"center"===g?y=y-o/2+k(r.sizeTree,b)[1]/2:y-=s,w&&(y+=w);var E=function(t){C(),t?(d("retrying to scroll to",{location:n},p.DEBUG),e.publish(h,n)):d("list did not change, scroll successful",{},p.DEBUG)};if(C(),"smooth"===T){var H=!1;I=e.subscribe(i,function(t){H=H||t}),v=e.handleNext(c,function(){E(H)})}else v=e.handleNext(e.pipe(i,function(t){var e=setTimeout(function(){t(!1)},150);return function(n){n&&(t(!0),clearTimeout(e))}}),E);return S=setTimeout(function(){C()},1200),e.publish(l,!0),d("scrolling from index to",{index:b,top:y,behavior:T},p.DEBUG),{top:y,behavior:T}})),u),{scrollToIndex:h,topListHeight:g}},e.tup(rt,b,v),{singleton:!0}),lt="up",st={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},ut=e.system(function(t){var n=t[0],r=n.scrollContainerState,o=n.scrollTop,i=n.viewportHeight,a=n.headerHeight,l=n.footerHeight,s=n.scrollBy,u=e.statefulStream(!1),c=e.statefulStream(!0),m=e.stream(),d=e.stream(),f=e.statefulStream(4),p=e.statefulStream(0),h=e.statefulStreamFromEmitter(e.pipe(e.merge(e.pipe(e.duc(o),e.skip(1),e.mapTo(!0)),e.pipe(e.duc(o),e.skip(1),e.mapTo(!1),e.debounceTime(100))),e.distinctUntilChanged()),!1),g=e.statefulStreamFromEmitter(e.pipe(e.merge(e.pipe(s,e.mapTo(!0)),e.pipe(s,e.mapTo(!1),e.debounceTime(200))),e.distinctUntilChanged()),!1);e.connect(e.pipe(e.combineLatest(e.duc(o),e.duc(p)),e.map(function(t){return t[0]<=t[1]}),e.distinctUntilChanged()),c),e.connect(e.pipe(c,e.throttleTime(50)),d);var v=e.streamFromEmitter(e.pipe(e.combineLatest(r,e.duc(i),e.duc(a),e.duc(l),e.duc(f)),e.scan(function(t,e){var n,r,o=e[0],i=o.scrollTop,a=o.scrollHeight,l=e[1],s={viewportHeight:l,scrollTop:i,scrollHeight:a};return i+l-a>-e[4]?(i>t.state.scrollTop?(n="SCROLLED_DOWN",r=t.state.scrollTop-i):(n="SIZE_DECREASED",r=t.state.scrollTop-i||t.scrollTopDelta),{atBottom:!0,state:s,atBottomBecause:n,scrollTopDelta:r}):{atBottom:!1,notAtBottomBecause:s.scrollHeight>t.state.scrollHeight?"SIZE_INCREASED":l<t.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<t.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},st),e.distinctUntilChanged(function(t,e){return t&&t.atBottom===e.atBottom}))),S=e.statefulStreamFromEmitter(e.pipe(r,e.scan(function(t,e){var n=e.scrollTop,r=e.scrollHeight,o=e.viewportHeight;return w(t.scrollHeight,r)?{scrollTop:n,scrollHeight:r,jump:0,changed:!1}:t.scrollTop!==n&&r-(n+o)<1?{scrollHeight:r,scrollTop:n,jump:t.scrollTop-n,changed:!0}:{scrollHeight:r,scrollTop:n,jump:0,changed:!0}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),e.filter(function(t){return t.changed}),e.map(function(t){return t.jump})),0);e.connect(e.pipe(v,e.map(function(t){return t.atBottom})),u),e.connect(e.pipe(u,e.throttleTime(50)),m);var I=e.statefulStream("down");e.connect(e.pipe(r,e.map(function(t){return t.scrollTop}),e.distinctUntilChanged(),e.scan(function(t,n){return e.getValue(g)?{direction:t.direction,prevScrollTop:n}:{direction:n<t.prevScrollTop?lt:"down",prevScrollTop:n}},{direction:"down",prevScrollTop:0}),e.map(function(t){return t.direction})),I),e.connect(e.pipe(r,e.throttleTime(50),e.mapTo("none")),I);var C=e.statefulStream(0);return e.connect(e.pipe(h,e.filter(function(t){return!t}),e.mapTo(0)),C),e.connect(e.pipe(o,e.throttleTime(100),e.withLatestFrom(h),e.filter(function(t){return!!t[1]}),e.scan(function(t,e){return[t[1],e[0]]},[0,0]),e.map(function(t){return t[1]-t[0]})),C),{isScrolling:h,isAtTop:c,isAtBottom:u,atBottomState:v,atTopStateChange:d,atBottomStateChange:m,scrollDirection:I,atBottomThreshold:f,atTopThreshold:p,scrollVelocity:C,lastJumpDueToItemResize:S}},e.tup(b)),ct=e.system(function(t){var n=t[0].log,r=e.statefulStream(!1),o=e.streamFromEmitter(e.pipe(r,e.filter(function(t){return t}),e.distinctUntilChanged()));return e.subscribe(r,function(t){t&&e.getValue(n)("props updated",{},p.DEBUG)}),{propsReady:r,didMount:o}},e.tup(v),{singleton:!0}),mt=e.system(function(t){var n=t[0],r=n.sizes,o=n.listRefresh,i=n.defaultItemSize,a=t[1].scrollTop,l=t[2].scrollToIndex,s=t[3].didMount,u=e.statefulStream(!0),c=e.statefulStream(0);return e.connect(e.pipe(s,e.withLatestFrom(c),e.filter(function(t){return!!t[1]}),e.mapTo(!1)),u),e.subscribe(e.pipe(e.combineLatest(o,s),e.withLatestFrom(u,r,i),e.filter(function(t){var e=t[1],n=t[3];return t[0][1]&&(!H(t[2].sizeTree)||void 0!==n)&&!e}),e.withLatestFrom(c)),function(t){var n=t[1];setTimeout(function(){e.handleNext(a,function(){e.publish(u,!0)}),e.publish(l,n)})}),{scrolledToInitialItem:u,initialTopMostItemIndex:c}},e.tup(rt,b,at,ct),{singleton:!0});function dt(t){return!!t&&("smooth"===t?"smooth":"auto")}var ft=e.system(function(t){var n=t[0],r=n.totalCount,o=n.listRefresh,i=t[1],a=i.isAtBottom,l=i.atBottomState,s=t[2].scrollToIndex,u=t[3].scrolledToInitialItem,c=t[4],m=c.propsReady,d=c.didMount,f=t[5].log,h=t[6].scrollingInProgress,g=e.statefulStream(!1),v=null;function S(t){e.publish(s,{index:"LAST",align:"end",behavior:t})}return e.subscribe(e.pipe(e.combineLatest(e.pipe(e.duc(r),e.skip(1)),d),e.withLatestFrom(e.duc(g),a,u,h),e.map(function(t){var e=t[0],n=e[0],r=e[1]&&t[3],o="auto";return r&&(o=function(t,e){return"function"==typeof t?dt(t(e)):e&&dt(t)}(t[1],t[2]||t[4]),r=r&&!!o),{totalCount:n,shouldFollow:r,followOutputBehavior:o}}),e.filter(function(t){return t.shouldFollow})),function(t){var n=t.totalCount,r=t.followOutputBehavior;v&&(v(),v=null),v=e.handleNext(o,function(){e.getValue(f)("following output to ",{totalCount:n},p.DEBUG),S(r),v=null})}),e.subscribe(e.pipe(e.combineLatest(e.duc(g),r,m),e.filter(function(t){return t[0]&&t[2]}),e.scan(function(t,e){var n=e[1];return{refreshed:t.value===n,value:n}},{refreshed:!1,value:0}),e.filter(function(t){return t.refreshed}),e.withLatestFrom(g,r)),function(t){var n=t[1],r=e.handleNext(l,function(t){!n||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||v||(e.getValue(f)("scrolling to bottom due to increased size",{},p.DEBUG),S("auto"))});setTimeout(r,100)}),e.subscribe(e.combineLatest(e.duc(g),l),function(t){var e=t[1];t[0]&&!e.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===e.notAtBottomBecause&&S("auto")}),{followOutput:g}},e.tup(rt,ut,at,mt,ct,v,b));function pt(t){return t.reduce(function(t,e){return t.groupIndices.push(t.totalCount),t.totalCount+=e+1,t},{totalCount:0,groupIndices:[]})}var ht=e.system(function(t){var n=t[0],r=n.totalCount,o=n.groupIndices,i=n.sizes,a=t[1],l=a.scrollTop,s=a.headerHeight,u=e.stream(),c=e.stream(),m=e.streamFromEmitter(e.pipe(u,e.map(pt)));return e.connect(e.pipe(m,e.map(function(t){return t.totalCount})),r),e.connect(e.pipe(m,e.map(function(t){return t.groupIndices})),o),e.connect(e.pipe(e.combineLatest(l,i,s),e.filter(function(t){return et(t[1])}),e.map(function(t){return k(t[1].groupOffsetTree,Math.max(t[0]-t[2],0),"v")[0]}),e.distinctUntilChanged(),e.map(function(t){return[t]})),c),{groupCounts:u,topItemsIndexes:c}},e.tup(rt,b));function gt(t,e){return!(!t||t[0]!==e[0]||t[1]!==e[1])}function vt(t,e){return!(!t||t.startIndex!==e.startIndex||t.endIndex!==e.endIndex)}function St(t,e,n){return"number"==typeof t?n===lt&&"top"===e||"down"===n&&"bottom"===e?t:0:n===lt?"top"===e?t.main:t.reverse:"bottom"===e?t.main:t.reverse}function It(t,e){return"number"==typeof t?t:t[e]||0}var Ct=e.system(function(t){var n=t[0],r=n.scrollTop,o=n.viewportHeight,i=n.deviation,a=n.headerHeight,l=n.fixedHeaderHeight,s=e.stream(),u=e.statefulStream(0),c=e.statefulStream(0),m=e.statefulStream(0),d=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(e.duc(r),e.duc(o),e.duc(a),e.duc(s,gt),e.duc(m),e.duc(u),e.duc(l),e.duc(i),e.duc(c)),e.map(function(t){var e=t[0],n=t[1],r=t[2],o=t[3],i=o[0],a=o[1],l=t[4],s=t[6],u=t[7],c=t[8],m=e-u,d=t[5]+s,f=Math.max(r-m,0),p="none",h=It(c,"top"),g=It(c,"bottom");return i-=u,a+=r+s,(i+=r+s)>e+d-h&&(p=lt),(a-=u)<e-f+n+g&&(p="down"),"none"!==p?[Math.max(m-r-St(l,"top",p)-h,0),m-f-s+n+St(l,"bottom",p)+g]:null}),e.filter(function(t){return null!=t}),e.distinctUntilChanged(gt)),[0,0]);return{listBoundary:s,overscan:m,topListHeight:u,increaseViewportBy:c,visibleRange:d}},e.tup(b),{singleton:!0}),Tt={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function wt(t,e,n){if(0===t.length)return[];if(!et(e))return t.map(function(t){return u({},t,{index:t.index+n,originalIndex:t.index})});for(var r,o=[],i=A(e.groupOffsetTree,t[0].index,t[t.length-1].index),a=void 0,l=0,s=d(t);!(r=s()).done;){var c=r.value;(!a||a.end<c.index)&&(a=i.shift(),l=e.groupIndices.indexOf(a.start)),o.push(u({},c.index===a.start?{type:"group",index:l}:{index:c.index-(l+1)+n,groupIndex:l},{size:c.size,offset:c.offset,originalIndex:c.index,data:c.data}))}return o}function xt(t,e,n,r,o){var i=0,a=0;if(t.length>0){i=t[0].offset;var l=t[t.length-1];a=l.offset+l.size}var s=i,u=r.lastOffset+(n-r.lastIndex)*r.lastSize-a;return{items:wt(t,r,o),topItems:wt(e,r,o),topListHeight:e.reduce(function(t,e){return e.size+t},0),offsetTop:i,offsetBottom:u,top:s,bottom:a,totalCount:n,firstItemIndex:o}}var bt=e.system(function(t){var n=t[0],r=n.sizes,o=n.totalCount,i=n.data,a=n.firstItemIndex,l=t[1],s=t[2],c=s.visibleRange,m=s.listBoundary,f=s.topListHeight,p=t[3],h=p.scrolledToInitialItem,g=p.initialTopMostItemIndex,v=t[4].topListHeight,S=t[5],I=t[6].didMount,C=t[7].recalcInProgress,T=e.statefulStream([]),w=e.stream();e.connect(l.topItemsIndexes,T);var x=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(I,C,e.duc(c,gt),e.duc(o),e.duc(r),e.duc(g),h,e.duc(T),e.duc(a),i),e.filter(function(t){return t[0]&&!t[1]}),e.map(function(t){var n=t[2],r=n[0],o=n[1],i=t[3],a=t[5],l=t[6],s=t[7],u=t[8],c=t[9],m=t[4],f=m.sizeTree,p=m.offsetTree;if(0===i||0===r&&0===o)return Tt;if(H(f))return xt(function(t,e,n){if(et(e)){var r=tt(t,e);return[{index:k(e.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:t,size:0,offset:0,data:n&&n[0]}]}(function(t,e){return"number"==typeof t?t:"LAST"===t.index?e-1:t.index}(a,i),m,c),[],i,m,u);var h=[];if(s.length>0)for(var g,v=s[0],S=s[s.length-1],I=0,C=d(A(f,v,S));!(g=C()).done;)for(var T=g.value,w=T.value,x=Math.max(T.start,v),b=Math.min(T.end,S),y=x;y<=b;y++)h.push({index:y,size:w,offset:I,data:c&&c[y]}),I+=w;if(!l)return xt([],h,i,m,u);var E=s.length>0?s[s.length-1]+1:0,R=function(t,e,n,r){return void 0===r&&(r=0),r>0&&(e=Math.max(e,_(t,r,Y).offset)),W((i=n,l=G(o=t,e,a=q),s=G(o,i,a,l),o.slice(l,s+1)),Z);var o,i,a,l,s}(p,r,o,E);if(0===R.length)return null;var L=i-1;return xt(e.tap([],function(t){for(var e,n=d(R);!(e=n()).done;){var i=e.value,a=i.value,l=a.offset,s=i.start,u=a.size;a.offset<r&&(l+=((s+=Math.floor((r-a.offset)/u))-i.start)*u),s<E&&(l+=(E-s)*u,s=E);for(var m=Math.min(i.end,L),f=s;f<=m&&!(l>=o);f++)t.push({index:f,size:u,offset:l,data:c&&c[f]}),l+=u}}),h,i,m,u)}),e.filter(function(t){return null!==t}),e.distinctUntilChanged()),Tt);return e.connect(e.pipe(i,e.filter(function(t){return void 0!==t}),e.map(function(t){return t.length})),o),e.connect(e.pipe(x,e.map(function(t){return t.topListHeight})),v),e.connect(v,f),e.connect(e.pipe(x,e.map(function(t){return[t.top,t.bottom]})),m),e.connect(e.pipe(x,e.map(function(t){return t.items})),w),u({listState:x,topItemsIndexes:T,endReached:e.streamFromEmitter(e.pipe(x,e.filter(function(t){return t.items.length>0}),e.withLatestFrom(o,i),e.filter(function(t){var e=t[0].items;return e[e.length-1].originalIndex===t[1]-1}),e.map(function(t){return[t[1]-1,t[2]]}),e.distinctUntilChanged(gt),e.map(function(t){return t[0]}))),startReached:e.streamFromEmitter(e.pipe(x,e.throttleTime(200),e.filter(function(t){var e=t.items;return e.length>0&&e[0].originalIndex===t.topItems.length}),e.map(function(t){return t.items[0].index}),e.distinctUntilChanged())),rangeChanged:e.streamFromEmitter(e.pipe(x,e.filter(function(t){return t.items.length>0}),e.map(function(t){var e=t.items;return{startIndex:e[0].index,endIndex:e[e.length-1].index}}),e.distinctUntilChanged(vt))),itemsRendered:w},S)},e.tup(rt,ht,Ct,mt,at,ut,ct,j),{singleton:!0}),yt=e.system(function(t){var n=t[0],r=n.sizes,o=n.firstItemIndex,i=n.data,a=t[1].listState,l=t[2].didMount,s=e.statefulStream(0);return e.connect(e.pipe(l,e.withLatestFrom(s),e.filter(function(t){return 0!==t[1]}),e.withLatestFrom(r,o,i),e.map(function(t){var e=t[0][1],n=t[1],r=t[2],o=t[3],i=void 0===o?[]:o,a=0;if(n.groupIndices.length>0)for(var l,s=d(n.groupIndices);!((l=s()).done||l.value-a>=e);)a++;var u=e+a;return xt(Array.from({length:u}).map(function(t,e){return{index:e,size:0,offset:0,data:i[e]}}),[],u,n,r)})),a),{initialItemCount:s}},e.tup(rt,bt,ct),{singleton:!0}),Et=e.system(function(t){var n=t[0].scrollVelocity,r=e.statefulStream(!1),o=e.stream(),i=e.statefulStream(!1);return e.connect(e.pipe(n,e.withLatestFrom(i,r,o),e.filter(function(t){return!!t[1]}),e.map(function(t){var e=t[0],n=t[1],r=t[2],o=t[3],i=n.enter;if(r){if((0,n.exit)(e,o))return!1}else if(i(e,o))return!0;return r}),e.distinctUntilChanged()),r),e.subscribe(e.pipe(e.combineLatest(r,n,o),e.withLatestFrom(i)),function(t){var e=t[0],n=t[1];return e[0]&&n&&n.change&&n.change(e[1],e[2])}),{isSeeking:r,scrollSeekConfiguration:i,scrollVelocity:n,scrollSeekRangeChanged:o}},e.tup(ut),{singleton:!0}),Ht=e.system(function(t){var n=t[0].topItemsIndexes,r=e.statefulStream(0);return e.connect(e.pipe(r,e.filter(function(t){return t>0}),e.map(function(t){return Array.from({length:t}).map(function(t,e){return e})})),n),{topItemCount:r}},e.tup(bt)),Rt=e.system(function(t){var n=t[0],r=n.footerHeight,o=n.headerHeight,i=n.fixedHeaderHeight,a=t[1].listState,l=e.stream(),s=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(r,o,i,a),e.map(function(t){var e=t[3];return t[0]+t[1]+t[2]+e.offsetBottom+e.bottom})),0);return e.connect(e.duc(s),l),{totalListHeight:s,totalListHeightChanged:l}},e.tup(b,bt),{singleton:!0});function Lt(t){var e,n=!1;return function(){return n||(n=!0,e=t()),e}}var kt=Lt(function(){return/iP(ad|hone|od).+Version\/[\d.]+.*Safari/i.test(navigator.userAgent)}),zt=e.system(function(t){var n=t[0],r=n.scrollBy,o=n.scrollTop,i=n.deviation,a=n.scrollingInProgress,l=t[1],s=l.isScrolling,u=l.isAtBottom,c=l.scrollDirection,m=t[3],d=m.beforeUnshiftWith,f=m.shiftWithOffset,h=m.sizes,g=t[4].log,v=t[5].recalcInProgress,S=e.streamFromEmitter(e.pipe(t[2].listState,e.withLatestFrom(l.lastJumpDueToItemResize),e.scan(function(t,e){var n=t[1],r=e[0],o=r.items,i=r.totalCount,a=r.bottom+r.offsetBottom,l=0;return t[2]===i&&n.length>0&&o.length>0&&(0===o[0].originalIndex&&0===n[0].originalIndex||0!=(l=a-t[3])&&(l+=e[1])),[l,o,i,a]},[0,[],0,0]),e.filter(function(t){return 0!==t[0]}),e.withLatestFrom(o,c,a,u,g),e.filter(function(t){return!t[3]&&0!==t[1]&&t[2]===lt}),e.map(function(t){var e=t[0][0];return(0,t[5])("Upward scrolling compensation",{amount:e},p.DEBUG),e})));function I(t){t>0?(e.publish(r,{top:-t,behavior:"auto"}),e.publish(i,0)):(e.publish(i,0),e.publish(r,{top:-t,behavior:"auto"}))}return e.subscribe(e.pipe(S,e.withLatestFrom(i,s)),function(t){var n=t[0],r=t[1];t[2]&&kt()?e.publish(i,r-n):I(-n)}),e.subscribe(e.pipe(e.combineLatest(e.statefulStreamFromEmitter(s,!1),i,v),e.filter(function(t){return!t[0]&&!t[2]&&0!==t[1]}),e.map(function(t){return t[1]}),e.throttleTime(1)),I),e.connect(e.pipe(f,e.map(function(t){return{top:-t}})),r),e.subscribe(e.pipe(d,e.withLatestFrom(h),e.map(function(t){return t[0]*t[1].lastSize})),function(t){e.publish(i,t),requestAnimationFrame(function(){e.publish(r,{top:t}),requestAnimationFrame(function(){e.publish(i,0),e.publish(v,!1)})})}),{deviation:i}},e.tup(b,ut,bt,rt,v,j)),Bt=e.system(function(t){var n=t[0].totalListHeight,r=t[1].didMount,o=t[2].scrollTo,i=e.statefulStream(0);return e.subscribe(e.pipe(r,e.withLatestFrom(i),e.filter(function(t){return 0!==t[1]}),e.map(function(t){return{top:t[1]}})),function(t){e.handleNext(e.pipe(n,e.filter(function(t){return 0!==t})),function(){setTimeout(function(){e.publish(o,t)})})}),{initialScrollTop:i}},e.tup(Rt,ct,b),{singleton:!0}),Ft=e.system(function(t){var n=t[0].viewportHeight,r=t[1].totalListHeight,o=e.statefulStream(!1);return{alignToBottom:o,paddingTopAddition:e.statefulStreamFromEmitter(e.pipe(e.combineLatest(o,n,r),e.filter(function(t){return t[0]}),e.map(function(t){return Math.max(0,t[1]-t[2])}),e.distinctUntilChanged()),0)}},e.tup(b,Rt),{singleton:!0}),Pt=e.system(function(t){var n=t[0],r=n.scrollTo,o=n.scrollContainerState,i=e.stream(),a=e.stream(),l=e.stream(),s=e.statefulStream(!1),c=e.statefulStream(void 0);return e.connect(e.pipe(e.combineLatest(i,a),e.map(function(t){var e=t[0],n=e.viewportHeight,r=e.scrollHeight;return{scrollTop:Math.max(0,e.scrollTop-t[1].offsetTop),scrollHeight:r,viewportHeight:n}})),o),e.connect(e.pipe(r,e.withLatestFrom(a),e.map(function(t){var e=t[0];return u({},e,{top:e.top+t[1].offsetTop})})),l),{useWindowScroll:s,customScrollParent:c,windowScrollContainerState:i,windowViewportRect:a,windowScrollTo:l}},e.tup(b)),Ot=["done","behavior"],Mt=e.system(function(t){var n=t[0],r=n.sizes,o=n.totalCount,i=t[1],a=i.scrollTop,l=i.viewportHeight,s=i.headerHeight,m=i.scrollingInProgress,d=t[2].scrollToIndex,f=e.stream();return e.connect(e.pipe(f,e.withLatestFrom(r,l,o,s,a),e.map(function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],l=t[5],s=n.done,d=n.behavior,f=c(n,Ot),p=null,h=X(n,r,i-1),g=Q(h,r.offsetTree)+a;return g<l?p=u({},f,{behavior:d,align:"start"}):g+k(r.sizeTree,h)[1]>l+o&&(p=u({},f,{behavior:d,align:"end"})),p?s&&e.handleNext(e.pipe(m,e.skip(1),e.filter(function(t){return!1===t})),s):s&&s(),p}),e.filter(function(t){return null!==t})),d),{scrollIntoView:f}},e.tup(rt,b,at,bt,v),{singleton:!0}),Vt=["listState","topItemsIndexes"],Ut=e.system(function(t){return u({},t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},e.tup(Ct,yt,ct,Et,Rt,Bt,Ft,Pt,Mt)),At=e.system(function(t){var n=t[0],r=n.totalCount,o=n.sizeRanges,i=n.fixedItemSize,a=n.defaultItemSize,l=n.trackItemSizes,s=n.itemSize,m=n.data,d=n.firstItemIndex,f=n.groupIndices,p=n.statefulTotalCount,h=t[1],g=h.initialTopMostItemIndex,v=h.scrolledToInitialItem,S=t[2],I=t[3],C=t[4],T=C.listState,w=C.topItemsIndexes,x=c(C,Vt),b=t[5].scrollToIndex,y=t[7].topItemCount,E=t[8].groupCounts,H=t[9],R=t[10];return e.connect(x.rangeChanged,H.scrollSeekRangeChanged),e.connect(e.pipe(H.windowViewportRect,e.map(function(t){return t.visibleHeight})),S.viewportHeight),u({totalCount:r,data:m,firstItemIndex:d,sizeRanges:o,initialTopMostItemIndex:g,scrolledToInitialItem:v,topItemsIndexes:w,topItemCount:y,groupCounts:E,fixedItemHeight:i,defaultItemHeight:a},I,{statefulTotalCount:p,listState:T,scrollToIndex:b,trackItemSizes:l,itemSize:s,groupIndices:f},x,H,S,R)},e.tup(rt,mt,b,ft,bt,at,zt,Ht,ht,Ut,v)),Wt=Lt(function(){if("undefined"==typeof document)return"sticky";var t=document.createElement("div");return t.style.position="-webkit-sticky","-webkit-sticky"===t.style.position?"-webkit-sticky":"sticky"});function Nt(t,e){var n=i(null),r=a(function(r){if(null!==r&&r.offsetParent){var o,i,a=r.getBoundingClientRect(),l=a.width;if(e){var s=e.getBoundingClientRect(),u=a.top-s.top;o=s.height-Math.max(0,u),i=u+e.scrollTop}else o=window.innerHeight-Math.max(0,a.top),i=a.top+window.pageYOffset;n.current={offsetTop:i,visibleHeight:o,visibleWidth:l},t(n.current)}},[t,e]),l=S(r),s=l.callbackRef,u=l.ref,c=a(function(){r(u.current)},[r,u]);return o(function(){if(e){e.addEventListener("scroll",c);var t=new ResizeObserver(c);return t.observe(e),function(){e.removeEventListener("scroll",c),t.unobserve(e)}}return window.addEventListener("scroll",c),window.addEventListener("resize",c),function(){window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,e]),s}var Dt=["placeholder"],Gt=["style","children"],_t=["style","children"];function jt(t){return t}var Kt=e.system(function(){var t=e.statefulStream(function(t){return"Item "+t}),n=e.statefulStream(null),r=e.statefulStream(function(t){return"Group "+t}),o=e.statefulStream({}),i=e.statefulStream(jt),a=e.statefulStream("div"),l=e.statefulStream(e.noop),s=function(t,n){return void 0===n&&(n=null),e.statefulStreamFromEmitter(e.pipe(o,e.map(function(e){return e[t]}),e.distinctUntilChanged()),n)};return{context:n,itemContent:t,groupContent:r,components:o,computeItemKey:i,headerFooterTag:a,scrollerRef:l,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}});function Yt(t,n){var r=e.stream();return e.subscribe(r,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+n,"color: red;","color: inherit;","color: blue;")}),e.connect(r,t),r}var qt=e.system(function(t){var n=t[0],r=t[1],o={item:Yt(r.itemContent,"Rename the %citem%c prop to %citemContent."),group:Yt(r.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:Yt(n.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:Yt(n.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:Yt(n.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:e.stream(),maxHeightCacheSize:e.stream(),footer:e.stream(),header:e.stream(),HeaderContainer:e.stream(),FooterContainer:e.stream(),ItemContainer:e.stream(),ScrollContainer:e.stream(),GroupContainer:e.stream(),ListContainer:e.stream(),emptyComponent:e.stream(),scrollSeek:e.stream()};function i(t,n,o){e.connect(e.pipe(t,e.withLatestFrom(r.components),e.map(function(t){var e,r=t[0],i=t[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),u({},i,((e={})[n]=r,e))})),r.components)}return e.subscribe(o.adjustForPrependedItems,function(){console.warn("react-virtuoso: adjustForPrependedItems is no longer supported. Use the firstItemIndex property instead - https://virtuoso.dev/prepend-items.","color: red;","color: inherit;","color: blue;")}),e.subscribe(o.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),e.subscribe(o.HeaderContainer,function(){console.warn("react-virtuoso: HeaderContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the header component and pass components.Header to change its contents.")}),e.subscribe(o.FooterContainer,function(){console.warn("react-virtuoso: FooterContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the footer component and pass components.Footer to change its contents.")}),e.subscribe(o.scrollSeek,function(t){var o=t.placeholder,i=c(t,Dt);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),e.publish(r.components,u({},e.getValue(r.components),{ScrollSeekPlaceholder:o})),e.publish(n.scrollSeekConfiguration,i)}),i(o.footer,"Footer","footer"),i(o.header,"Header","header"),i(o.ItemContainer,"Item","ItemContainer"),i(o.ListContainer,"List","ListContainer"),i(o.ScrollContainer,"Scroller","ScrollContainer"),i(o.emptyComponent,"EmptyPlaceholder","emptyComponent"),i(o.GroupContainer,"Group","GroupContainer"),u({},n,r,o)},e.tup(At,Kt)),Zt=function(t){return n.createElement("div",{style:{height:t.height}})},Jt={position:Wt(),zIndex:1,overflowAnchor:"none"},$t={overflowAnchor:"none"},Qt=n.memo(function(t){var r=t.showTopList,o=void 0!==r&&r,i=fe("listState"),a=de("sizeRanges"),s=fe("useWindowScroll"),c=fe("customScrollParent"),m=de("windowScrollContainerState"),d=de("scrollContainerState"),f=c||s?m:d,p=fe("itemContent"),h=fe("context"),g=fe("groupContent"),v=fe("trackItemSizes"),S=fe("itemSize"),I=fe("log"),T=C(a,S,v,o?e.noop:f,I,c).callbackRef,w=n.useState(0),x=w[0],b=w[1];pe("deviation",function(t){x!==t&&b(t)});var y=fe("EmptyPlaceholder"),E=fe("ScrollSeekPlaceholder")||Zt,H=fe("ListComponent"),R=fe("ItemComponent"),L=fe("GroupComponent"),k=fe("computeItemKey"),z=fe("isSeeking"),B=fe("groupIndices").length>0,F=fe("paddingTopAddition"),P=o?{}:{boxSizing:"border-box",paddingTop:i.offsetTop+F,paddingBottom:i.offsetBottom,marginTop:x};return!o&&0===i.totalCount&&y?l(y,ne(y,h)):l(H,u({},ne(H,h),{ref:T,style:P,"data-test-id":o?"virtuoso-top-item-list":"virtuoso-item-list"}),(o?i.topItems:i.items).map(function(t){var e=t.originalIndex,n=k(e+i.firstItemIndex,t.data,h);return z?l(E,u({},ne(E,h),{key:n,index:t.index,height:t.size,type:t.type||"item"},"group"===t.type?{}:{groupIndex:t.groupIndex})):"group"===t.type?l(L,u({},ne(L,h),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,style:Jt}),g(t.index)):l(R,u({},ne(R,h),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,"data-item-group-index":t.groupIndex,style:$t}),B?p(t.index,t.groupIndex,t.data,h):p(t.index,t.data,h))}))}),Xt={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch",willChange:"transform"},te={width:"100%",height:"100%",position:"absolute",top:0},ee={width:"100%",position:Wt(),top:0};function ne(t,e){if("string"!=typeof t)return{context:e}}var re=n.memo(function(){var t=fe("HeaderComponent"),e=de("headerHeight"),n=fe("headerFooterTag"),r=I(function(t){return e(T(t,"height"))}),o=fe("context");return t?l(n,{ref:r},l(t,ne(t,o))):null}),oe=n.memo(function(){var t=fe("FooterComponent"),e=de("footerHeight"),n=fe("headerFooterTag"),r=I(function(t){return e(T(t,"height"))}),o=fe("context");return t?l(n,{ref:r},l(t,ne(t,o))):null});function ie(t){var e=t.usePublisher,r=t.useEmitter,o=t.useEmitterValue;return n.memo(function(t){var n=t.style,i=t.children,a=c(t,Gt),s=e("scrollContainerState"),m=o("ScrollerComponent"),d=e("smoothScrollTargetReached"),f=o("scrollerRef"),p=o("context"),h=x(s,d,m,f),g=h.scrollerRef,v=h.scrollByCallback;return r("scrollTo",h.scrollToCallback),r("scrollBy",v),l(m,u({ref:g,style:u({},Xt,n),"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0},a,ne(m,p)),i)})}function ae(t){var r=t.usePublisher,o=t.useEmitter,i=t.useEmitterValue;return n.memo(function(t){var n=t.style,a=t.children,s=c(t,_t),m=r("windowScrollContainerState"),d=i("ScrollerComponent"),f=r("smoothScrollTargetReached"),p=i("totalListHeight"),g=i("deviation"),v=i("customScrollParent"),S=i("context"),I=x(m,f,d,e.noop,v),C=I.scrollerRef,T=I.scrollByCallback,w=I.scrollToCallback;return h(function(){return C.current=v||window,function(){C.current=null}},[C,v]),o("windowScrollTo",w),o("scrollBy",T),l(d,u({style:u({position:"relative"},n,0!==p?{height:p+g}:{}),"data-virtuoso-scroller":!0},s,ne(d,S)),a)})}var le=function(t){var r=t.children,o=de("viewportHeight"),i=I(e.compose(o,function(t){return T(t,"height")}));return n.createElement("div",{style:te,ref:i,"data-viewport-type":"element"},r)},se=function(t){var e=t.children,r=Nt(de("windowViewportRect"),fe("customScrollParent"));return n.createElement("div",{ref:r,style:te,"data-viewport-type":"window"},e)},ue=function(t){var e=t.children,n=fe("TopItemListComponent"),r=fe("headerHeight"),o=u({},ee,{marginTop:r+"px"}),i=fe("context");return l(n||"div",{style:o,context:i},e)},ce=t(qt,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",react18ConcurrentRendering:"react18ConcurrentRendering",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},n.memo(function(t){var e=fe("useWindowScroll"),r=fe("topItemsIndexes").length>0,o=fe("customScrollParent"),i=o||e?se:le;return n.createElement(o||e?ge:he,u({},t),n.createElement(i,null,n.createElement(re,null),n.createElement(Qt,null),n.createElement(oe,null)),r&&n.createElement(ue,null,n.createElement(Qt,{showTopList:!0})))})),me=ce.Component,de=ce.usePublisher,fe=ce.useEmitterValue,pe=ce.useEmitter,he=ie({usePublisher:de,useEmitterValue:fe,useEmitter:pe}),ge=ae({usePublisher:de,useEmitterValue:fe,useEmitter:pe}),ve={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Se={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Ie=Math.round,Ce=Math.ceil,Te=Math.floor,we=Math.min,xe=Math.max;function be(t,e){return Array.from({length:e-t+1}).map(function(e,n){return{index:n+t}})}var ye=e.system(function(t){var n=t[0],r=n.overscan,o=n.visibleRange,i=n.listBoundary,a=t[1],l=a.scrollTop,s=a.viewportHeight,c=a.scrollBy,m=a.scrollTo,d=a.smoothScrollTargetReached,f=a.scrollContainerState,p=t[2],h=t[3],g=t[4],v=g.propsReady,S=g.didMount,I=t[5],C=I.windowViewportRect,T=I.windowScrollTo,w=I.useWindowScroll,x=I.customScrollParent,b=I.windowScrollContainerState,y=e.statefulStream(0),E=e.statefulStream(0),H=e.statefulStream(ve),R=e.statefulStream({height:0,width:0}),L=e.statefulStream({height:0,width:0}),k=e.stream(),z=e.stream(),B=e.statefulStream(0);e.connect(e.pipe(S,e.withLatestFrom(E),e.filter(function(t){return 0!==t[1]}),e.map(function(t){return{items:be(0,t[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),H),e.connect(e.pipe(e.combineLatest(e.duc(y),o,e.duc(L,function(t,e){return t&&t.width===e.width&&t.height===e.height})),e.withLatestFrom(R),e.map(function(t){var e=t[0],n=e[0],r=e[1],o=r[0],i=r[1],a=e[2],l=t[1],s=a.height,u=a.width,c=l.width;if(0===n||0===c)return ve;if(0===u)return Se;var m=Re(c,u),d=m*Te(o/s),f=m*Ce(i/s)-1;f=xe(0,we(n-1,f));var p=be(d=we(f,xe(0,d)),f),h=Ee(l,a,p),g=h.top,v=h.bottom;return{items:p,offsetTop:g,offsetBottom:Ce(n/m)*s-v,top:g,bottom:v,itemHeight:s,itemWidth:u}})),H),e.connect(e.pipe(R,e.map(function(t){return t.height})),s),e.connect(e.pipe(e.combineLatest(R,L,H),e.map(function(t){var e=Ee(t[0],t[1],t[2].items);return[e.top,e.bottom]}),e.distinctUntilChanged(gt)),i);var F=e.streamFromEmitter(e.pipe(e.duc(H),e.filter(function(t){return t.items.length>0}),e.withLatestFrom(y),e.filter(function(t){var e=t[0].items;return e[e.length-1].index===t[1]-1}),e.map(function(t){return t[1]-1}),e.distinctUntilChanged())),P=e.streamFromEmitter(e.pipe(e.duc(H),e.filter(function(t){var e=t.items;return e.length>0&&0===e[0].index}),e.mapTo(0),e.distinctUntilChanged())),O=e.streamFromEmitter(e.pipe(e.duc(H),e.filter(function(t){return t.items.length>0}),e.map(function(t){var e=t.items;return{startIndex:e[0].index,endIndex:e[e.length-1].index}}),e.distinctUntilChanged(vt)));e.connect(O,h.scrollSeekRangeChanged),e.connect(e.pipe(k,e.withLatestFrom(R,L,y),e.map(function(t){var e=t[1],n=t[2],r=t[3],o=it(t[0]),i=o.align,a=o.behavior,l=o.offset,s=o.index;"LAST"===s&&(s=r-1);var u=He(e,n,s=xe(0,s,we(r-1,s)));return"end"===i?u=Ie(u-e.height+n.height):"center"===i&&(u=Ie(u-e.height/2+n.height/2)),l&&(u+=l),{top:u,behavior:a}})),m);var M=e.statefulStreamFromEmitter(e.pipe(H,e.map(function(t){return t.offsetBottom+t.bottom})),0);return e.connect(e.pipe(C,e.map(function(t){return{width:t.visibleWidth,height:t.visibleHeight}})),R),u({totalCount:y,viewportDimensions:R,itemDimensions:L,scrollTop:l,scrollHeight:z,overscan:r,scrollBy:c,scrollTo:m,scrollToIndex:k,smoothScrollTargetReached:d,windowViewportRect:C,windowScrollTo:T,useWindowScroll:w,customScrollParent:x,windowScrollContainerState:b,deviation:B,scrollContainerState:f,initialItemCount:E},h,{gridState:H,totalListHeight:M},p,{startReached:P,endReached:F,rangeChanged:O,propsReady:v})},e.tup(Ct,b,ut,Et,ct,Pt));function Ee(t,e,n){var r=e.height;return void 0===r||0===n.length?{top:0,bottom:0}:{top:He(t,e,n[0].index),bottom:He(t,e,n[n.length-1].index)+r}}function He(t,e,n){var r=Re(t.width,e.width);return Te(n/r)*e.height}function Re(t,e){return xe(1,Te(t/e))}var Le=["placeholder"],ke=e.system(function(){var t=e.statefulStream(function(t){return"Item "+t}),n=e.statefulStream({}),r=e.statefulStream(null),o=e.statefulStream("virtuoso-grid-item"),i=e.statefulStream("virtuoso-grid-list"),a=e.statefulStream(jt),l=e.statefulStream(e.noop),s=function(t,r){return void 0===r&&(r=null),e.statefulStreamFromEmitter(e.pipe(n,e.map(function(e){return e[t]}),e.distinctUntilChanged()),r)};return{context:r,itemContent:t,components:n,computeItemKey:a,itemClassName:o,listClassName:i,scrollerRef:l,ListComponent:s("List","div"),ItemComponent:s("Item","div"),ScrollerComponent:s("Scroller","div"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),ze=e.system(function(t){var n=t[0],r=t[1],o={item:Yt(r.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:e.stream(),ScrollContainer:e.stream(),ListContainer:e.stream(),emptyComponent:e.stream(),scrollSeek:e.stream()};function i(t,n,o){e.connect(e.pipe(t,e.withLatestFrom(r.components),e.map(function(t){var e,r=t[0],i=t[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),u({},i,((e={})[n]=r,e))})),r.components)}return e.subscribe(o.scrollSeek,function(t){var o=t.placeholder,i=c(t,Le);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),e.publish(r.components,u({},e.getValue(r.components),{ScrollSeekPlaceholder:o})),e.publish(n.scrollSeekConfiguration,i)}),i(o.ItemContainer,"Item","ItemContainer"),i(o.ListContainer,"List","ListContainer"),i(o.ScrollContainer,"Scroller","ScrollContainer"),u({},n,r,o)},e.tup(ye,ke)),Be=n.memo(function(){var t=Ue("gridState"),e=Ue("listClassName"),n=Ue("itemClassName"),r=Ue("itemContent"),o=Ue("computeItemKey"),i=Ue("isSeeking"),a=Ve("scrollHeight"),s=Ue("ItemComponent"),c=Ue("ListComponent"),m=Ue("ScrollSeekPlaceholder"),d=Ue("context"),f=Ve("itemDimensions"),p=I(function(t){a(t.parentElement.parentElement.scrollHeight);var e=t.firstChild;e&&f(e.getBoundingClientRect())});return l(c,u({ref:p,className:e},ne(c,d),{style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom}}),t.items.map(function(e){var a=o(e.index);return i?l(m,u({key:a},ne(m,d),{index:e.index,height:t.itemHeight,width:t.itemWidth})):l(s,u({},ne(s,d),{className:n,"data-index":e.index,key:a}),r(e.index,d))}))}),Fe=function(t){var e=t.children,r=Ve("viewportDimensions"),o=I(function(t){r(t.getBoundingClientRect())});return n.createElement("div",{style:te,ref:o},e)},Pe=function(t){var e=t.children,r=Nt(Ve("windowViewportRect"),Ue("customScrollParent"));return n.createElement("div",{ref:r,style:te},e)},Oe=t(ze,{optional:{totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},n.memo(function(t){var e=u({},t),r=Ue("useWindowScroll"),o=Ue("customScrollParent"),i=o||r?Pe:Fe;return n.createElement(o||r?Ne:We,u({},e),n.createElement(i,null,n.createElement(Be,null)))})),Me=Oe.Component,Ve=Oe.usePublisher,Ue=Oe.useEmitterValue,Ae=Oe.useEmitter,We=ie({usePublisher:Ve,useEmitterValue:Ue,useEmitter:Ae}),Ne=ae({usePublisher:Ve,useEmitterValue:Ue,useEmitter:Ae}),De=e.system(function(){var t=e.statefulStream(function(t){return n.createElement("td",null,"Item $",t)}),r=e.statefulStream(null),o=e.statefulStream(null),i=e.statefulStream({}),a=e.statefulStream(jt),l=e.statefulStream(e.noop),s=function(t,n){return void 0===n&&(n=null),e.statefulStreamFromEmitter(e.pipe(i,e.map(function(e){return e[t]}),e.distinctUntilChanged()),n)};return{context:r,itemContent:t,fixedHeaderContent:o,components:i,computeItemKey:a,scrollerRef:l,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),Ge=e.system(function(t){return u({},t[0],t[1])},e.tup(At,De)),_e=function(t){return n.createElement("tr",null,n.createElement("td",{style:{height:t.height}}))},je=function(t){return n.createElement("tr",null,n.createElement("td",{style:{height:t.height,padding:0,border:0}}))},Ke=n.memo(function(){var t=Qe("listState"),e=$e("sizeRanges"),r=Qe("useWindowScroll"),o=Qe("customScrollParent"),i=$e("windowScrollContainerState"),a=$e("scrollContainerState"),s=o||r?i:a,c=Qe("itemContent"),m=Qe("trackItemSizes"),d=C(e,Qe("itemSize"),m,s,Qe("log"),o),f=d.callbackRef,p=d.ref,h=n.useState(0),g=h[0],v=h[1];Xe("deviation",function(t){g!==t&&(p.current.style.marginTop=t+"px",v(t))});var S=Qe("EmptyPlaceholder"),I=Qe("ScrollSeekPlaceholder")||_e,T=Qe("FillerRow")||je,w=Qe("TableBodyComponent"),x=Qe("TableRowComponent"),b=Qe("computeItemKey"),y=Qe("isSeeking"),E=Qe("paddingTopAddition"),H=Qe("firstItemIndex"),R=Qe("statefulTotalCount"),L=Qe("context");if(0===R&&S)return l(S,ne(S,L));var k=t.offsetTop+E+g,z=t.offsetBottom,B=k>0?n.createElement(T,{height:k,key:"padding-top"}):null,F=z>0?n.createElement(T,{height:z,key:"padding-bottom"}):null,P=t.items.map(function(t){var e=t.originalIndex,n=b(e+H,t.data,L);return y?l(I,u({},ne(I,L),{key:n,index:t.index,height:t.size,type:t.type||"item"})):l(x,u({},ne(x,L),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,style:{overflowAnchor:"none"}}),c(t.index,t.data,L))});return l(w,u({ref:f,"data-test-id":"virtuoso-item-list"},ne(w,L)),[B].concat(P,[F]))}),Ye=function(t){var r=t.children,o=$e("viewportHeight"),i=I(e.compose(o,function(t){return T(t,"height")}));return n.createElement("div",{style:te,ref:i,"data-viewport-type":"element"},r)},qe=function(t){var e=t.children,r=Nt($e("windowViewportRect"),Qe("customScrollParent"));return n.createElement("div",{ref:r,style:te,"data-viewport-type":"window"},e)},Ze=t(Ge,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",react18ConcurrentRendering:"react18ConcurrentRendering"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},n.memo(function(t){var r=Qe("useWindowScroll"),o=Qe("customScrollParent"),i=$e("fixedHeaderHeight"),a=Qe("fixedHeaderContent"),l=Qe("context"),s=I(e.compose(i,function(t){return T(t,"height")})),c=o||r?en:tn,m=o||r?qe:Ye,d=Qe("TableComponent"),f=Qe("TableHeadComponent"),p=a?n.createElement(f,u({key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:s},ne(f,l)),a()):null;return n.createElement(c,u({},t),n.createElement(m,null,n.createElement(d,u({style:{borderSpacing:0}},ne(d,l)),[p,n.createElement(Ke,{key:"TableBody"})])))})),Je=Ze.Component,$e=Ze.usePublisher,Qe=Ze.useEmitterValue,Xe=Ze.useEmitter,tn=ie({usePublisher:$e,useEmitterValue:Qe,useEmitter:Xe}),en=ae({usePublisher:$e,useEmitterValue:Qe,useEmitter:Xe}),nn=me,rn=me,on=Je,an=Me;export{rn as GroupedVirtuoso,p as LogLevel,on as TableVirtuoso,nn as Virtuoso,an as VirtuosoGrid};
2
2
  //# sourceMappingURL=index.m.js.map