Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-virtuoso

Package Overview
Dependencies
Maintainers
1
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtuoso - npm Package Compare versions

Comparing version 3.1.3 to 3.1.4

2

dist/index.js

@@ -1,2 +0,2 @@

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

@@ -1,2 +0,2 @@

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

@@ -5,3 +5,3 @@ {

"sideEffects": false,
"version": "3.1.3",
"version": "3.1.4",
"homepage": "https://virtuoso.dev/",

@@ -56,10 +56,9 @@ "license": "MIT",

"@emotion/styled": "^10.0.27",
"@faker-js/faker": "^7.6.0",
"@microsoft/api-extractor": "^7.25.0",
"@playwright/test": "^1.22.2",
"@playwright/test": "^1.27.1",
"@testing-library/react": "^13.4.0",
"@types/faker": "^5.1.4",
"@types/jest": "^26.0.20",
"@types/jsdom": "^16.2.3",
"@types/lodash": "^4.14.165",
"@types/parcel-bundler": "^1.12.1",
"@types/react": "^18.0.5",

@@ -85,3 +84,2 @@ "@types/react-beautiful-dnd": "^13.0.0",

"eslint-plugin-react-hooks": "^4.0.8",
"faker": "^5.1.0",
"husky": "^6.0.0",

@@ -91,8 +89,7 @@ "jest": "^26.6.3",

"lodash": "^4.17.21",
"microbundle": "^0.13.0",
"parcel": "^1.12.4",
"parcel-bundler": "^1.12.4",
"playwright": "^1.22.2",
"playwright-chromium": "^1.22.2",
"microbundle": "^0.15.1",
"parcel": "^2.8.0",
"playwright": "^1.27.1",
"prettier": "^2.2.1",
"process": "^0.11.10",
"react": "^18.0.0",

@@ -105,3 +102,3 @@ "react-beautiful-dnd": "^13.0.0",

"rollup-plugin-dts": "^4.2.0",
"semantic-release": "^17.3.0",
"semantic-release": "^19.0.5",
"ts-jest": "^26.5.1",

@@ -108,0 +105,0 @@ "tslib": "^2.0.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc