react-virtuoso 2.8.0-alpha.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AATree.d.ts +40 -40
- package/dist/Grid.d.ts +482 -482
- package/dist/List.d.ts +6253 -6041
- package/dist/Table.d.ts +6087 -5875
- package/dist/alignToBottomSystem.d.ts +549 -529
- package/dist/comparators.d.ts +3 -3
- package/dist/components.d.ts +1158 -296
- package/dist/domIOSystem.d.ts +15 -15
- package/dist/followOutputSystem.d.ts +378 -362
- package/dist/gridSystem.d.ts +281 -281
- package/dist/groupedListSystem.d.ts +75 -71
- package/dist/hooks/__mocks__/useChangedChildSizes.d.ts +4 -4
- package/dist/hooks/__mocks__/useScrollTop.d.ts +7 -7
- package/dist/hooks/__mocks__/useSize.d.ts +3 -3
- package/dist/hooks/useChangedChildSizes.d.ts +3 -3
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +3 -3
- package/dist/hooks/useScrollTop.d.ts +6 -6
- package/dist/hooks/useSize.d.ts +6 -6
- package/dist/hooks/useWindowViewportRect.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.m.js.map +1 -1
- package/dist/initialItemCountSystem.d.ts +542 -518
- package/dist/initialScrollTopSystem.d.ts +560 -540
- package/dist/initialTopMostItemIndexSystem.d.ts +163 -153
- package/dist/interfaces.d.ts +279 -279
- package/dist/listStateSystem.d.ts +489 -469
- package/dist/listSystem.d.ts +5426 -5214
- package/dist/loggerSystem.d.ts +17 -17
- package/dist/propsReadySystem.d.ts +12 -12
- package/dist/scrollIntoViewSystem.d.ts +645 -617
- package/dist/scrollSeekSystem.d.ts +57 -57
- package/dist/scrollToIndexSystem.d.ts +81 -77
- package/dist/sizeRangeSystem.d.ts +50 -50
- package/dist/sizeSystem.d.ts +68 -66
- package/dist/stateFlagsSystem.d.ts +65 -65
- package/dist/topItemCountSystem.d.ts +489 -469
- package/dist/totalListHeightSystem.d.ts +517 -497
- package/dist/upwardScrollFixSystem.d.ts +614 -590
- package/dist/utils/binaryArraySearch.d.ts +6 -6
- package/dist/utils/correctItemSize.d.ts +1 -1
- package/dist/utils/positionStickyCssValue.d.ts +1 -1
- package/dist/utils/simpleMemoize.d.ts +1 -1
- package/dist/windowScrollerSystem.d.ts +35 -35
- package/package.json +5 -15
- package/dist/TableVirtuoso.js +0 -2
- package/dist/TableVirtuoso.js.map +0 -1
- package/dist/TableVirtuoso.mjs +0 -2
- package/dist/TableVirtuoso.mjs.map +0 -1
- package/dist/VirtuosoGrid.js +0 -2
- package/dist/VirtuosoGrid.js.map +0 -1
- package/dist/VirtuosoGrid.mjs +0 -2
- package/dist/VirtuosoGrid.mjs.map +0 -1
- package/dist/components/CompProps.d.ts +0 -2
- package/dist/components/GroupedVirtuoso.d.ts +0 -27
- package/dist/components/TableVirtuoso.d.ts +0 -5717
- package/dist/components/Virtuoso.d.ts +0 -205
- package/dist/components/VirtuosoGrid.d.ts +0 -93
- package/dist/components/index.d.ts +0 -4
- package/dist/index-27.js +0 -2
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/shared.js +0 -2
- package/dist/shared.js.map +0 -1
- package/dist/shared.mjs +0 -2
- package/dist/shared.mjs.map +0 -1
package/dist/index.m.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{systemToComponent as e}from"@virtuoso.dev/react-urx";import{system as t,stream as n,statefulStream as o,connect as r,pipe as i,map as l,getValue as a,streamFromEmitter as u,filter as s,distinctUntilChanged as c,subscribe as d,tup as f,merge as m,duc as h,skip as p,mapTo as g,debounceTime as v,statefulStreamFromEmitter as I,combineLatest as C,scan as S,publish as x,throttleTime as T,withLatestFrom as w,handleNext as y,noop as b,prop as H,tap as R,compose as z}from"@virtuoso.dev/urx";import{useRef as k,useCallback as B,useEffect as E,useLayoutEffect as L,memo as P,createElement as O}from"react";function M(){return(M=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}).apply(this,arguments)}function A(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 V(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 W(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return V(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)?V(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.")}return(n=e[Symbol.iterator]()).next.bind(n)}function D(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}function F(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}var G,N,U=t(function(){var e=n(),t=n(),a=o(0),u=n(),s=o(0),c=n(),d=n(),f=o(0),m=o(0),h=n(),p=n(),g=o(!1);return r(i(e,l(function(e){return e[0]})),t),r(i(e,l(function(e){return e[1]})),d),r(t,s),{scrollContainerState:e,scrollTop:t,viewportHeight:c,headerHeight:f,footerHeight:m,scrollHeight:d,smoothScrollTargetReached:u,scrollTo:h,scrollBy:p,statefulScrollTop:s,deviation:a,scrollingInProgress:g}},[],{singleton:!0});!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(N||(N={}));var _=((G={})[N.DEBUG]="debug",G[N.INFO]="log",G[N.WARN]="warn",G[N.ERROR]="error",G),j=t(function(){var e=o(N.ERROR);return{log:o(function(t,n,o){var r;void 0===o&&(o=N.INFO),o>=(null!=(r=("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL)?r:a(e))&&console[_[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),K=t(function(e){var t=e[0].log,n=o(!1),r=u(i(n,s(function(e){return e}),c()));return d(n,function(e){e&&a(t)("props updated",{},N.DEBUG)}),{propsReady:n,didMount:r}},f(j),{singleton:!0}),Y="up",Z={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},q=t(function(e){var t=e[0],f=t.scrollContainerState,y=t.scrollTop,b=t.viewportHeight,H=t.headerHeight,R=t.footerHeight,z=t.scrollBy,k=o(!1),B=o(!0),E=n(),L=n(),P=o(4),O=u(i(m(i(h(y),p(1),g(!0)),i(h(y),p(1),g(!1),v(100))),c())),M=I(i(m(i(z,g(!0)),i(z,g(!1),v(200))),c()),!1);r(i(h(y),l(function(e){return 0===e}),c()),B),r(B,L);var A=u(i(C(f,h(b),h(H),h(R),h(P)),S(function(e,t){var n,o,r=t[0],i=r[0],l=r[1],a=t[1],u={viewportHeight:a,scrollTop:i,scrollHeight:l};return i+a-l>-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:u,atBottomBecause:n,scrollTopDelta:o}):{atBottom:!1,notAtBottomBecause:u.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":a<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:u}},Z),c(function(e,t){return e&&e.atBottom===t.atBottom}))),V=I(i(f,S(function(e,t){var n=t[0],o=t[1];return e.scrollHeight!==o?e.scrollTop!==n?{scrollHeight:o,scrollTop:n,jump:e.scrollTop-n,changed:!0}:{scrollHeight:o,scrollTop:n,jump:0,changed:!0}:{scrollTop:n,scrollHeight:o,jump:0,changed:!1}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),s(function(e){return e.changed}),l(function(e){return e.jump})),0);r(i(A,l(function(e){return e.atBottom})),k),d(k,function(e){setTimeout(function(){return x(E,e)})});var W=o("down");d(k,function(e){setTimeout(function(){x(E,e)})}),r(i(f,l(function(e){return e[0]}),c(),S(function(e,t){return a(M)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Y:"down",prevScrollTop:t}},{direction:"down",prevScrollTop:0}),l(function(e){return e.direction})),W),r(i(f,T(50),g("none")),W),r(k,E);var D=o(0);return r(i(O,s(function(e){return!e}),g(0)),D),r(i(y,T(100),w(O),s(function(e){return!!e[1]}),S(function(e,t){return[e[1],t[0]]},[0,0]),l(function(e){return e[1]-e[0]})),D),{isScrolling:O,isAtTop:B,isAtBottom:k,atBottomState:A,atTopStateChange:L,atBottomStateChange:E,scrollDirection:W,atBottomThreshold:P,scrollVelocity:D,lastJumpDueToItemResize:V}},f(U)),J=t(function(e){var t=e[0].scrollVelocity,a=o(!1),u=n(),f=o(!1);return r(i(t,w(f,a,u),s(function(e){return!!e[1]}),l(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}),c()),a),d(i(C(a,t,u),w(f)),function(e){var t=e[0],n=e[1];return t[0]&&n&&n.change&&n.change(t[1],t[2])}),{isSeeking:a,scrollSeekConfiguration:f,scrollVelocity:t,scrollSeekRangeChanged:u}},f(q),{singleton:!0}),$={lvl:0};function Q(e,t,n,o,r){return void 0===o&&(o=$),void 0===r&&(r=$),{k:e,v:t,lvl:n,l:o,r:r}}function X(e){return e===$}function ee(){return $}function te(e,t){if(X(e))return $;var n=e.k,o=e.l,r=e.r;if(t===n){if(X(o))return r;if(X(r))return o;var i=le(o);return ce(ue(e,{k:i[0],v:i[1],l:ae(o)}))}return ce(ue(e,t<n?{l:te(o,t)}:{r:te(r,t)}))}function ne(e,t,n){if(void 0===n&&(n="k"),X(e))return[-Infinity,void 0];if(e[n]===t)return[e.k,e.v];if(e[n]<t){var o=ne(e.r,t,n);return-Infinity===o[0]?[e.k,e.v]:o}return ne(e.l,t,n)}function oe(e,t,n){return X(e)?Q(t,n,1):t===e.k?ue(e,{k:t,v:n}):function(e){return me(he(e))}(ue(e,t<e.k?{l:oe(e.l,t,n)}:{r:oe(e.r,t,n)}))}function re(e,t,n){if(X(e))return[];var o=e.k,r=e.v,i=e.r,l=[];return o>t&&(l=l.concat(re(e.l,t,n))),o>=t&&o<=n&&l.push({k:o,v:r}),o<=n&&(l=l.concat(re(i,t,n))),l}function ie(e){return X(e)?[]:[].concat(ie(e.l),[{k:e.k,v:e.v}],ie(e.r))}function le(e){return X(e.r)?[e.k,e.v]:le(e.r)}function ae(e){return X(e.r)?e.l:ce(ue(e,{r:ae(e.r)}))}function ue(e,t){return Q(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 se(e){return X(e)||e.lvl>e.r.lvl}function ce(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(se(t))return he(ue(e,{lvl:o-1}));if(X(t)||X(t.r))throw new Error("Unexpected empty nodes");return ue(t.r,{l:ue(t,{r:t.r.l}),r:ue(e,{l:t.r.r,lvl:o-1}),lvl:o})}if(se(e))return me(ue(e,{lvl:o-1}));if(X(n)||X(n.l))throw new Error("Unexpected empty nodes");var r=n.l,i=se(r)?n.lvl-1:n.lvl;return ue(r,{l:ue(e,{r:r.l,lvl:o-1}),r:me(ue(n,{l:r.r,lvl:i})),lvl:r.lvl+1})}function de(e,t,n){return X(e)?[]:fe(re(e,ne(e,t)[0],n),function(e){return{index:e.k,value:e.v}})}function fe(e,t){var n=e.length;if(0===n)return[];for(var o=t(e[0]),r=o.index,i=o.value,l=[],a=1;a<n;a++){var u=t(e[a]),s=u.index,c=u.value;l.push({start:r,end:s-1,value:i}),r=s,i=c}return l.push({start:r,end:Infinity,value:i}),l}function me(e){var t=e.r,n=e.lvl;return X(t)||X(t.r)||t.lvl!==n||t.r.lvl!==n?e:ue(t,{l:ue(e,{r:t.l}),lvl:n+1})}function he(e){var t=e.l;return X(t)||t.lvl!==e.lvl?e:ue(t,{r:ue(e,{l:t.r})})}function pe(e,t,n,o){void 0===o&&(o=0);for(var r=e.length-1;o<=r;){var i=Math.floor((o+r)/2),l=n(e[i],t);if(0===l)return i;if(-1===l){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 ge(e,t,n){return e[pe(e,t,n)]}function ve(e,t){return Math.round(e.getBoundingClientRect()[t])}function Ie(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 Ce(e,t){var n=e.index;return t===n?0:t<n?-1:1}function Se(e,t){var n=e.offset;return t===n?0:t<n?-1:1}function xe(e){return{index:e.index,value:e}}function Te(e,t){var n=t[0],o=t[1];n.length>0&&(0,t[2])("received item sizes",n,N.DEBUG);var r=e.sizeTree,i=e.offsetTree,l=r,a=0;if(o.length>0&&X(r)&&2===n.length){var u=n[0].size,s=n[1].size;l=o.reduce(function(e,t){return oe(oe(e,t,u),t+1,s)},l)}else{var c=function(e,t){for(var n,o=X(e)?0:Infinity,r=W(t);!(n=r()).done;){var i=n.value,l=i.size,a=i.startIndex,u=i.endIndex;if(o=Math.min(o,a),X(e))e=oe(e,0,l);else{var s=de(e,a-1,u+1);if(!s.some(Ie(i))){for(var c,d=!1,f=!1,m=W(s);!(c=m()).done;){var h=c.value,p=h.start,g=h.end,v=h.value;d?(u>=p||l===v)&&(e=te(e,p)):(f=v!==l,d=!0),g>u&&u>=p&&v!==l&&(e=oe(e,u+1,v))}f&&(e=oe(e,a,l))}}}return[e,o]}(l,n);l=c[0],a=c[1]}if(l===r)return e;var d=0,f=0,m=0,h=0;if(0!==a){h=pe(i,a-1,Ce),m=i[h].offset;var p=ne(l,a-1);d=p[0],f=p[1],i.length&&i[h].size===ne(l,a)[1]&&(h-=1),i=i.slice(0,h+1)}else i=[];for(var g,v=W(de(l,a,Infinity));!(g=v()).done;){var I=g.value,C=I.start,S=I.value,x=(C-d)*f+m;i.push({offset:x,size:S,index:C}),d=C,m=x,f=S}return{sizeTree:l,offsetTree:i,groupOffsetTree:o.reduce(function(e,t){return oe(e,t,we(t,i))},ee()),lastIndex:d,lastOffset:m,lastSize:f,groupIndices:o}}function we(e,t){if(0===t.length)return 0;var n=ge(t,e,Ce);return n.size*(e-n.index)+n.offset}function ye(e,t){if(!be(t))return e;for(var n=0;t.groupIndices[n]<=e+n;)n++;return e+n}function be(e){return!X(e.groupOffsetTree)}var He={offsetHeight:"height",offsetWidth:"width"},Re=t(function(e){var t=e[0].log,f=n(),m=n(),h=I(m,0),p=n(),g=o(0),v=o([]),C=o(void 0),x=o(void 0),T=o(function(e,t){return ve(e,He[t])}),y=o(void 0),b={offsetTree:[],sizeTree:ee(),groupOffsetTree:ee(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},H=I(i(f,w(v,t),S(Te,b),c()),b);r(i(v,s(function(e){return e.length>0}),w(H),l(function(e){var t=e[0],n=e[1],o=t.reduce(function(e,t,o){return oe(e,t,we(t,n.offsetTree)||o)},ee());return M({},n,{groupIndices:t,groupOffsetTree:o})})),H),r(i(m,w(H),s(function(e){return e[0]<e[1].lastIndex}),l(function(e){var t=e[1];return[{startIndex:e[0],endIndex:t.lastIndex,size:t.lastSize}]})),f),r(C,x);var R=I(i(C,l(function(e){return void 0===e})),!0);r(i(x,s(function(e){return void 0!==e&&X(a(H).sizeTree)}),l(function(e){return[{startIndex:0,endIndex:0,size:e}]})),f);var z=u(i(f,w(H),S(function(e,t){var n=t[1];return{changed:n!==e.sizes,sizes:n}},{changed:!1,sizes:b}),l(function(e){return e.changed})));r(i(g,S(function(e,t){return{diff:e.prev-t,prev:t}},{diff:0,prev:0}),l(function(e){return e.diff}),s(function(e){return e>0})),p),d(i(g,w(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:g},N.ERROR)});var k=u(p);return r(i(p,w(H),l(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 ie(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})),f),{data:y,totalCount:m,sizeRanges:f,groupIndices:v,defaultItemSize:x,fixedItemSize:C,unshiftWith:p,beforeUnshiftWith:k,firstItemIndex:g,sizes:H,listRefresh:z,statefulTotalCount:h,trackItemSizes:R,itemSize:T}},f(j),{singleton:!0}),ze="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function ke(e){var t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&ze||(t.behavior="auto"),t.offset||(t.offset=0),t}var Be=t(function(e){var t=e[0],a=t.sizes,u=t.totalCount,s=t.listRefresh,c=e[1],f=c.scrollingInProgress,m=c.viewportHeight,h=c.scrollTo,p=c.smoothScrollTargetReached,g=c.headerHeight,v=c.footerHeight,I=e[2].log,C=n(),S=o(0),T=null,b=null,H=null;function R(){T&&(T(),T=null),H&&(H(),H=null),b&&(clearTimeout(b),b=null),x(f,!1)}return r(i(C,w(a,m,u,S,g,v,I),l(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],l=e[4],a=e[5],u=e[6],c=e[7],m=ke(t),h=m.align,g=m.behavior,v=m.offset,I=r-1,S=m.index;"LAST"===S&&(S=I),S=ye(S,n);var w=we(S=Math.max(0,S,Math.min(I,S)),n.offsetTree)+a;"end"===h?(w=w-o+ne(n.sizeTree,S)[1],S===I&&(w+=u)):"center"===h?w=w-o/2+ne(n.sizeTree,S)[1]/2:w-=l,v&&(w+=v);var z=function(e){R(),e?(c("retrying to scroll to",{location:t},N.DEBUG),x(C,t)):c("list did not change, scroll successful",{},N.DEBUG)};if(R(),"smooth"===g){var k=!1;H=d(s,function(e){k=k||e}),T=y(p,function(){z(k)})}else T=y(i(s,function(e){var t=setTimeout(function(){e(!1)},50);return function(n){n&&(e(!0),clearTimeout(t))}}),z);return b=setTimeout(function(){R()},1200),x(f,!0),c("scrolling from index to",{index:S,top:w,behavior:g},N.DEBUG),{top:w,behavior:g}})),h),{scrollToIndex:C,topListHeight:S}},f(Re,U,j),{singleton:!0});function Ee(e,t,n){return"number"==typeof e?n===Y&&"top"===t||"down"===n&&"bottom"===t?e:0:n===Y?"top"===t?e.main:e.reverse:"bottom"===t?e.main:e.reverse}function Le(e,t){return"number"==typeof e?e:e[t]||0}var Pe=t(function(e){var t=e[0],r=t.scrollTop,a=t.viewportHeight,u=t.deviation,d=t.headerHeight,f=n(),m=o(0),p=o(0),g=o(0),v=o(0);return{listBoundary:f,overscan:v,topListHeight:m,fixedHeaderHeight:p,increaseViewportBy:g,visibleRange:I(i(C(h(r),h(a),h(d),h(f,D),h(v),h(m),h(p),h(u),h(g)),l(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=r[0],l=r[1],a=e[4],u=e[6],s=e[7],c=e[8],d=t-s,f=e[5]+u,m=Math.max(o-d,0),h="none",p=Le(c,"top"),g=Le(c,"bottom");return i-=s,l+=o,(i+=o)>t+f-p&&(h=Y),(l-=s)<t-m+n+g&&(h="down"),"none"!==h?[Math.max(d-o-Ee(a,"top",h)-p,0),d-m-u+n+Ee(a,"bottom",h)+g]:null}),s(function(e){return null!=e}),c(D)),[0,0])}},f(U),{singleton:!0}),Oe=t(function(e){var t=e[0],a=t.scrollTo,u=t.scrollContainerState,s=n(),c=n(),d=n(),f=o(!1),m=o(void 0);return r(i(C(s,c),l(function(e){var t=e[0],n=t[1];return[Math.max(0,t[0]-e[1].offsetTop),n]})),u),r(i(a,w(c),l(function(e){var t=e[0];return M({},t,{top:t.top+e[1].offsetTop})})),d),{useWindowScroll:f,customScrollParent:m,windowScrollContainerState:s,windowViewportRect:c,windowScrollTo:d}},f(U)),Me={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Ae={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Ve=Math.ceil,We=Math.floor,De=Math.min,Fe=Math.max;function Ge(e,t){return Array.from({length:t-e+1}).map(function(t,n){return{index:n+e}})}var Ne=t(function(e){var t=e[0],a=t.overscan,d=t.visibleRange,f=t.listBoundary,m=e[1],p=m.scrollTop,v=m.viewportHeight,S=m.scrollBy,x=m.scrollTo,T=m.smoothScrollTargetReached,y=m.scrollContainerState,b=e[2],H=e[3],R=e[4],z=R.propsReady,k=R.didMount,B=e[5],E=B.windowViewportRect,L=B.windowScrollTo,P=B.useWindowScroll,O=B.customScrollParent,A=B.windowScrollContainerState,V=o(0),W=o(0),G=o(Me),N=o({height:0,width:0}),U=o({height:0,width:0}),_=n(),j=n(),K=o(0);r(i(k,w(W),s(function(e){return 0!==e[1]}),l(function(e){return{items:Ge(0,e[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),G),r(i(C(h(V),d,h(U,function(e,t){return e&&e.width===t.width&&e.height===t.height})),w(N),l(function(e){var t=e[0],n=t[0],o=t[1],r=o[0],i=o[1],l=t[2],a=e[1],u=l.height,s=l.width,c=a.width;if(0===n||0===c)return Me;if(0===s)return Ae;var d=Math.floor(c/s),f=d*We(r/u),m=d*Ve(i/u)-1;m=De(n-1,m);var h=Ge(f=De(m,Fe(0,f)),m),p=Ue(a,l,h),g=p.top,v=p.bottom;return{items:h,offsetTop:g,offsetBottom:Ve(n/d)*u-v,top:g,bottom:v,itemHeight:u,itemWidth:s}})),G),r(i(N,l(function(e){return e.height})),v),r(i(C(N,U,G),l(function(e){var t=Ue(e[0],e[1],e[2].items);return[t.top,t.bottom]}),c(D)),f);var Y=u(i(h(G),s(function(e){return e.items.length>0}),w(V),s(function(e){var t=e[0].items;return t[t.length-1].index===e[1]-1}),l(function(e){return e[1]-1}),c())),Z=u(i(h(G),s(function(e){var t=e.items;return t.length>0&&0===t[0].index}),g(0),c())),q=u(i(h(G),s(function(e){return e.items.length>0}),l(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),c(F)));r(q,H.scrollSeekRangeChanged),r(i(_,w(N,U,V),l(function(e){var t=e[1],n=e[2],o=e[3],r=ke(e[0]),i=r.align,l=r.behavior,a=r.offset,u=r.index;"LAST"===u&&(u=o-1);var s=_e(t,n,u=Math.max(0,u,Math.min(o-1,u)));return"end"===i?s=Math.round(s-t.height+n.height):"center"===i&&(s=Math.round(s-t.height/2+n.height/2)),a&&(s+=a),{top:s,behavior:l}})),x);var J=I(i(G,l(function(e){return e.offsetBottom+e.bottom})),0);return r(i(E,l(function(e){return{width:e.visibleWidth,height:e.visibleHeight}})),N),M({totalCount:V,viewportDimensions:N,itemDimensions:U,scrollTop:p,scrollHeight:j,overscan:a,scrollBy:S,scrollTo:x,scrollToIndex:_,smoothScrollTargetReached:T,windowViewportRect:E,windowScrollTo:L,useWindowScroll:P,customScrollParent:O,windowScrollContainerState:A,deviation:K,scrollContainerState:y,initialItemCount:W},H,{gridState:G,totalListHeight:J},b,{startReached:Z,endReached:Y,rangeChanged:q,propsReady:z})},f(Pe,U,q,J,K,Oe));function Ue(e,t,n){var o=t.height;return void 0===o||0===n.length?{top:0,bottom:0}:{top:_e(e,t,n[0].index),bottom:_e(e,t,n[n.length-1].index)+o}}function _e(e,t,n){var o=Math.floor(e.width/t.width);return We(n/o)*t.height}function je(e,t){void 0===t&&(t=!0);var n=k(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 Ke(e,t){return void 0===t&&(t=!0),je(e,t).callbackRef}function Ye(e,t){var n=k(null),o=B(function(o){if(null!==o){var r,i,l=o.getBoundingClientRect(),a=l.width;if(t){var u=t.getBoundingClientRect(),s=l.top-u.top;r=u.height-Math.max(0,s),i=s+t.scrollTop}else r=window.innerHeight-Math.max(0,l.top),i=l.top+window.pageYOffset;n.current={offsetTop:i,visibleHeight:r,visibleWidth:a},e(n.current)}},[e,t]),r=je(o),i=r.callbackRef,l=r.ref,a=B(function(){o(l.current)},[o,l]);return E(function(){if(t){t.addEventListener("scroll",a);var e=new ResizeObserver(a);return e.observe(t),function(){t.removeEventListener("scroll",a),e.unobserve(t)}}return window.addEventListener("scroll",a),window.addEventListener("resize",a),function(){window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),i}var Ze="undefined"!=typeof document?L:E;function qe(e,t,n,o,r,i){return Ke(function(n){for(var l=function(e,t,n,o){var r=e.length;if(0===r)return null;for(var i=[],l=0;l<r;l++){var a=e.item(l);if(a&&void 0!==a.dataset.index){var u=parseInt(a.dataset.index),s=parseFloat(a.dataset.knownSize),c=t(a,"offsetHeight");if(0===c&&o("Zero-sized element, this should not happen",{child:a},N.ERROR),c!==s){var d=i[i.length-1];0===i.length||d.size!==c||d.endIndex!==u-1?i.push({startIndex:u,endIndex:u,size:c}):i[i.length-1].endIndex++}}}return i}(n.children,t,0,r),a=n.parentElement;!a.dataset.virtuosoScroller;)a=a.parentElement;var u=i?i.scrollTop:"window"===a.firstElementChild.dataset.viewportType?window.pageYOffset||document.documentElement.scrollTop:a.scrollTop;o(i?[Math.max(u,0),i.scrollHeight]:[Math.max(u,0),a.scrollHeight]),null!==l&&e(l)},n)}function Je(e,t,n,o,r){void 0===o&&(o=b);var i=k(null),l=k(null),a=k(null),u=B(function(n){var o=n.target,r=o===window||o===document?window.pageYOffset||document.documentElement.scrollTop:o.scrollTop,i=o===window?document.documentElement.scrollHeight:o.scrollHeight;e([Math.max(r,0),i]),null!==l.current&&(r===l.current||r<=0||r===o.scrollHeight-ve(o,"height"))&&(l.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t]);return E(function(){var e=r||i.current;return o(r||i.current),u({target:e}),e.addEventListener("scroll",u,{passive:!0}),function(){o(null),e.removeEventListener("scroll",u)}},[i,u,n,o,r]),{scrollerRef:i,scrollByCallback:function(e){null===l.current&&i.current.scrollBy(e)},scrollToCallback:function(n){var o=i.current;if(o&&(!("offsetHeight"in o)||0!==o.offsetHeight)){var r,u,s,c="smooth"===n.behavior;if(o===window?(u=Math.max(ve(document.documentElement,"height"),document.documentElement.scrollHeight),r=window.innerHeight,s=document.documentElement.scrollTop):(u=o.scrollHeight,r=ve(o,"height"),s=o.scrollTop),n.top=Math.ceil(Math.max(Math.min(u-r,n.top),0)),Math.abs(r-u)<1.01||n.top===s)return e([s,u]),void(c&&t(!0));c?(l.current=n.top,a.current&&clearTimeout(a.current),a.current=setTimeout(function(){a.current=null,l.current=null,t(!0)},1e3)):l.current=null,o.scrollTo(n)}}}}var $e=t(function(e){var t=e[0],n=t.sizes,l=t.listRefresh,a=t.defaultItemSize,u=e[1].scrollTop,c=e[2].scrollToIndex,f=e[3].didMount,m=o(!0),h=o(0);return r(i(f,w(h),s(function(e){return 0!==e[1]}),g(!1)),m),d(i(C(l,f),w(m,n,a),s(function(e){var t=e[1],n=e[3];return e[0][1]&&(!X(e[2].sizeTree)||void 0!==n)&&!t}),w(h)),function(e){var t=e[1];setTimeout(function(){y(u,function(){x(m,!0)}),x(c,t)})}),{scrolledToInitialItem:m,initialTopMostItemIndex:h}},f(Re,U,Be,K),{singleton:!0});function Qe(e){return!!e&&("smooth"===e?"smooth":"auto")}var Xe=t(function(e){var t=e[0],n=t.totalCount,r=t.listRefresh,u=e[1],c=u.isAtBottom,f=u.atBottomState,m=e[2].scrollToIndex,g=e[3].scrolledToInitialItem,v=e[4],I=v.propsReady,T=v.didMount,b=e[5].log,H=e[6].scrollingInProgress,R=o(!1),z=null;function k(e){x(m,{index:"LAST",align:"end",behavior:e})}return d(i(C(i(h(n),p(1)),T),w(h(R),c,g,H),l(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?Qe(e(t)):t&&Qe(e)}(e[1],e[2]||e[4]),o=o&&!!r),{totalCount:n,shouldFollow:o,followOutputBehavior:r}}),s(function(e){return e.shouldFollow})),function(e){var t=e.totalCount,n=e.followOutputBehavior;z&&(z(),z=null),z=y(r,function(){a(b)("following output to ",{totalCount:t},N.DEBUG),k(n),z=null})}),d(i(C(h(R),n,I),s(function(e){return e[0]&&e[2]}),S(function(e,t){var n=t[1];return{refreshed:e.value===n,value:n}},{refreshed:!1,value:0}),s(function(e){return e.refreshed}),w(R,n)),function(e){var t=e[1],n=y(f,function(e){!t||e.atBottom||"SIZE_INCREASED"!==e.notAtBottomBecause||z||(a(b)("scrolling to bottom due to increased size",{},N.DEBUG),k("auto"))});setTimeout(n,100)}),d(C(h(R),f),function(e){var t=e[1];e[0]&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&k("auto")}),{followOutput:R}},f(Re,q,Be,$e,K,j,U));function et(e){return e.reduce(function(e,t){return e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e},{totalCount:0,groupIndices:[]})}var tt=t(function(e){var t=e[0],o=t.totalCount,a=t.groupIndices,d=t.sizes,f=e[1],m=f.scrollTop,h=f.headerHeight,p=n(),g=n(),v=u(i(p,l(et)));return r(i(v,l(H("totalCount"))),o),r(i(v,l(H("groupIndices"))),a),r(i(C(m,d,h),s(function(e){return be(e[1])}),l(function(e){return ne(e[1].groupOffsetTree,Math.max(e[0]-e[2],0),"v")[0]}),c(),l(function(e){return[e]})),g),{groupCounts:p,topItemsIndexes:g}},f(Re,U)),nt={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0};function ot(e,t,n){if(0===e.length)return[];if(!be(t))return e.map(function(e){return M({},e,{index:e.index+n,originalIndex:e.index})});for(var o,r=[],i=de(t.groupOffsetTree,e[0].index,e[e.length-1].index),l=void 0,a=0,u=W(e);!(o=u()).done;){var s=o.value;(!l||l.end<s.index)&&(l=i.shift(),a=t.groupIndices.indexOf(l.start)),r.push(M({},s.index===l.start?{type:"group",index:a}:{index:s.index-(a+1)+n,groupIndex:a},{size:s.size,offset:s.offset,originalIndex:s.index,data:s.data}))}return r}function rt(e,t,n,o,r){var i=0,l=0;if(e.length>0){i=e[0].offset;var a=e[e.length-1];l=a.offset+a.size}var u=i,s=o.lastOffset+(n-o.lastIndex)*o.lastSize-l;return{items:ot(e,o,r),topItems:ot(t,o,r),topListHeight:t.reduce(function(e,t){return t.size+e},0),offsetTop:i,offsetBottom:s,top:u,bottom:l,totalCount:n}}var it,lt,at,ut=t(function(e){var t=e[0],a=t.sizes,d=t.totalCount,f=t.data,m=t.firstItemIndex,p=e[1],g=e[2],v=g.visibleRange,S=g.listBoundary,x=g.topListHeight,y=e[3],b=y.scrolledToInitialItem,z=y.initialTopMostItemIndex,k=e[4].topListHeight,B=e[5],E=e[6].didMount,L=o([]),P=n();r(p.topItemsIndexes,L);var O=I(i(C(E,h(v),h(d),h(a),h(z),b,h(L),h(m),f),s(function(e){return e[0]}),l(function(e){var t=e[1],n=t[0],o=t[1],r=e[2],i=e[4],l=e[5],a=e[6],u=e[7],s=e[8],c=e[3],d=c.sizeTree,f=c.offsetTree;if(0===r||0===n&&0===o)return nt;if(X(d))return rt(function(e,t,n){if(be(t)){var o=ye(e,t);return[{index:ne(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]}]}(i,c,s),[],r,c,u);var m=[];if(a.length>0)for(var h,p=a[0],g=a[a.length-1],v=0,I=W(de(d,p,g));!(h=I()).done;)for(var C=h.value,S=C.value,x=Math.max(C.start,p),T=Math.min(C.end,g),w=x;w<=T;w++)m.push({index:w,size:S,offset:v,data:s&&s[w]}),v+=S;if(!l)return rt([],m,r,c,u);var y=a.length>0?a[a.length-1]+1:0,b=function(e,t,n,o){return void 0===o&&(o=0),o>0&&(t=Math.max(t,ge(e,o,Ce).offset)),fe((i=n,a=pe(r=e,t,l=Se),u=pe(r,i,l,a),r.slice(a,u+1)),xe);var r,i,l,a,u}(f,n,o,y);if(0===b.length)return null;var H=r-1;return rt(R([],function(e){for(var t,r=W(b);!(t=r()).done;){var i=t.value,l=i.value,a=l.offset,u=i.start,c=l.size;l.offset<n&&(a+=((u+=Math.floor((n-l.offset)/c))-i.start)*c),u<y&&(a+=(y-u)*c,u=y);for(var d=Math.min(i.end,H),f=u;f<=d&&!(a>=o);f++)e.push({index:f,size:c,offset:a,data:s&&s[f]}),a+=c}}),m,r,c,u)}),s(function(e){return null!==e}),c()),nt);return r(i(f,s(function(e){return void 0!==e}),l(function(e){return e.length})),d),r(i(O,l(H("topListHeight"))),k),r(k,x),r(i(O,l(function(e){return[e.top,e.bottom]})),S),r(i(O,l(function(e){return e.items})),P),M({listState:O,topItemsIndexes:L,endReached:u(i(O,s(function(e){return e.items.length>0}),w(d,f),s(function(e){var t=e[0].items;return t[t.length-1].originalIndex===e[1]-1}),l(function(e){return[e[1]-1,e[2]]}),c(D),l(function(e){return e[0]}))),startReached:u(i(O,T(200),s(function(e){var t=e.items;return t.length>0&&t[0].originalIndex===e.topItems.length}),l(function(e){return e.items[0].index}),c())),rangeChanged:u(i(O,s(function(e){return e.items.length>0}),l(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),c(F))),itemsRendered:P},B)},f(Re,tt,Pe,$e,Be,q,K),{singleton:!0}),st=t(function(e){var t=e[0],n=t.sizes,a=t.firstItemIndex,u=t.data,c=e[1].listState,d=e[2].didMount,f=o(0);return r(i(d,w(f),s(function(e){return 0!==e[1]}),w(n,a,u),l(function(e){var t=e[0][1],n=e[1],o=e[2],r=e[3],i=void 0===r?[]:r,l=0;if(n.groupIndices.length>0)for(var a,u=W(n.groupIndices);!((a=u()).done||a.value-l>=t);)l++;var s=t+l;return rt(Array.from({length:s}).map(function(e,t){return{index:t,size:0,offset:0,data:i[t]}}),[],s,n,o)})),c),{initialItemCount:f}},f(Re,ut,K),{singleton:!0}),ct=t(function(e){var t=e[0].topItemsIndexes,n=o(0);return r(i(n,s(function(e){return e>0}),l(function(e){return Array.from({length:e}).map(function(e,t){return t})})),t),{topItemCount:n}},f(ut)),dt=t(function(e){var t=e[0],o=t.footerHeight,a=t.headerHeight,u=e[1].listState,s=n(),c=I(i(C(o,a,u),l(function(e){var t=e[2];return e[0]+e[1]+t.offsetBottom+t.bottom})),0);return r(h(c),s),{totalListHeight:c,totalListHeightChanged:s}},f(U,ut),{singleton:!0}),ft=t(function(e){var t=e[0],n=t.scrollBy,o=t.scrollTop,a=t.deviation,c=t.scrollingInProgress,f=e[1],m=f.isScrolling,h=f.isAtBottom,p=f.atBottomState,g=f.scrollDirection,v=e[3],y=v.beforeUnshiftWith,b=v.sizes,H=e[4].log,R=u(i(e[2].listState,w(f.lastJumpDueToItemResize),S(function(e,t){var n=e[1],o=t[0],r=o.items,i=o.totalCount,l=t[1],a=0;if(e[2]===i){if(n.length>0&&r.length>0){var u=1===r.length;if(0!==r[0].originalIndex||0!==n[0].originalIndex)for(var s=function(e){var t=r[e],o=n.find(function(e){return e.originalIndex===t.originalIndex});return o?t.offset!==o.offset||u?(a=t.offset-o.offset+t.size-o.size,"break"):void 0:"continue"},c=r.length-1;c>=0;c--){var d=s(c);if("continue"!==d&&"break"===d)break}}0!==a&&(a+=l)}return[a,r,i]},[0,[],0]),s(function(e){return 0!==e[0]}),w(o,g,c,H,h,p),s(function(e){return!e[3]&&0!==e[1]&&e[2]===Y}),l(function(e){var t=e[0][0];return(0,e[4])("Upward scrolling compensation",{amount:t},N.DEBUG),t})));return r(i(R,w(a),l(function(e){return e[1]-e[0]})),a),d(i(C(I(m,!1),a),s(function(e){return!e[0]&&0!==e[1]}),l(function(e){return e[1]}),T(1)),function(e){e>0?(x(n,{top:-e,behavior:"auto"}),x(a,0)):(x(a,0),x(n,{top:-e,behavior:"auto"}))}),r(i(y,w(b),l(function(e){return e[0]*e[1].lastSize})),R),{deviation:a}},f(U,q,ut,Re,j)),mt=t(function(e){var t=e[0].totalListHeight,n=e[1].didMount,r=e[2].scrollTo,a=o(0);return d(i(n,w(a),s(function(e){return 0!==e[1]}),l(function(e){return{top:e[1]}})),function(e){y(i(t,s(function(e){return 0!==e})),function(){setTimeout(function(){x(r,e)})})}),{initialScrollTop:a}},f(dt,K,U),{singleton:!0}),ht=t(function(e){var t=e[0].viewportHeight,n=e[1].totalListHeight,r=o(!1);return{alignToBottom:r,paddingTopAddition:I(i(C(r,t,n),s(function(e){return e[0]}),l(function(e){return Math.max(0,e[1]-e[2])}),c()),0)}},f(U,dt),{singleton:!0}),pt=t(function(e){var t=e[0],o=t.sizes,a=t.totalCount,u=e[1],c=u.scrollTop,d=u.viewportHeight,f=u.headerHeight,m=u.scrollingInProgress,h=e[2].scrollToIndex,g=n();return r(i(g,w(o,d,a,f,c),l(function(e){var t=e[0],n=t.index,o=t.behavior,r=void 0===o?"auto":o,l=t.done,a=e[1],u=e[2],c=e[4],d=e[5],f=e[3]-1,h=null;n=ye(n,a);var g=we(n=Math.max(0,n,Math.min(f,n)),a.offsetTree)+c;return g<d?h={index:n,behavior:r,align:"start"}:g+ne(a.sizeTree,n)[1]>d+u&&(h={index:n,behavior:r,align:"end"}),h?l&&y(i(m,p(1),s(function(e){return!1===e})),l):l&&l(),h}),s(function(e){return null!==e})),h),{scrollIntoView:g}},f(Re,U,Be,ut,j),{singleton:!0}),gt=t(function(e){return M({},e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},f(Pe,st,K,J,dt,mt,ht,Oe,pt)),vt=t(function(e){var t=e[0],n=t.totalCount,o=t.sizeRanges,a=t.fixedItemSize,u=t.defaultItemSize,s=t.trackItemSizes,c=t.itemSize,d=t.data,f=t.firstItemIndex,m=t.groupIndices,h=t.statefulTotalCount,p=e[1],g=p.initialTopMostItemIndex,v=p.scrolledToInitialItem,I=e[2],C=e[3],S=e[4],x=S.listState,T=S.topItemsIndexes,w=A(S,["listState","topItemsIndexes"]),y=e[5].scrollToIndex,b=e[7].topItemCount,R=e[8].groupCounts,z=e[9],k=e[10];return r(w.rangeChanged,z.scrollSeekRangeChanged),r(i(z.windowViewportRect,l(H("visibleHeight"))),I.viewportHeight),M({totalCount:n,data:d,firstItemIndex:f,sizeRanges:o,initialTopMostItemIndex:g,scrolledToInitialItem:v,topItemsIndexes:T,topItemCount:b,groupCounts:R,fixedItemHeight:a,defaultItemHeight:u},C,{statefulTotalCount:h,listState:x,scrollToIndex:y,trackItemSizes:s,itemSize:c,groupIndices:m},w,z,I,k)},f(Re,$e,U,Xe,ut,Be,ft,ct,tt,gt,j)),It=(it=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"},at=!1,function(){return at||(at=!0,lt=it()),lt});function Ct(e){return e}var St=t(function(){var e=o(function(e){return"Item "+e}),t=o(null),n=o(function(e){return"Group "+e}),r=o({}),a=o(Ct),u=o("div"),s=o(b),d=function(e,t){return void 0===t&&(t=null),I(i(r,l(function(t){return t[e]}),c()),t)};return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:a,headerFooterTag:u,scrollerRef:s,FooterComponent:d("Footer"),HeaderComponent:d("Header"),TopItemListComponent:d("TopItemList"),ListComponent:d("List","div"),ItemComponent:d("Item","div"),GroupComponent:d("Group","div"),ScrollerComponent:d("Scroller","div"),EmptyPlaceholder:d("EmptyPlaceholder"),ScrollSeekPlaceholder:d("ScrollSeekPlaceholder")}});function xt(e,t){var o=n();return d(o,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+t,"color: red;","color: inherit;","color: blue;")}),r(o,e),o}var Tt=t(function(e){var t=e[0],o=e[1],u={item:xt(o.itemContent,"Rename the %citem%c prop to %citemContent."),group:xt(o.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:xt(t.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:xt(t.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:xt(t.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:n(),maxHeightCacheSize:n(),footer:n(),header:n(),HeaderContainer:n(),FooterContainer:n(),ItemContainer:n(),ScrollContainer:n(),GroupContainer:n(),ListContainer:n(),emptyComponent:n(),scrollSeek:n()};function s(e,t,n){r(i(e,w(o.components),l(function(e){var o,r=e[0],i=e[1];return console.warn("react-virtuoso: "+n+" property is deprecated. Pass components."+t+" instead."),M({},i,((o={})[t]=r,o))})),o.components)}return d(u.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;")}),d(u.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),d(u.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.")}),d(u.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.")}),d(u.scrollSeek,function(e){var n=e.placeholder,r=A(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),x(o.components,M({},a(o.components),{ScrollSeekPlaceholder:n})),x(t.scrollSeekConfiguration,r)}),s(u.footer,"Footer","footer"),s(u.header,"Header","header"),s(u.ItemContainer,"Item","ItemContainer"),s(u.ListContainer,"List","ListContainer"),s(u.ScrollContainer,"Scroller","ScrollContainer"),s(u.emptyComponent,"EmptyPlaceholder","emptyComponent"),s(u.GroupContainer,"Group","GroupContainer"),M({},t,o,u)},f(vt,St)),wt=function(e){return O("div",{style:{height:e.height}})},yt={position:It(),zIndex:1,overflowAnchor:"none"},bt=P(function(e){var t=e.showTopList,n=void 0!==t&&t,o=Ft("listState"),r=Ft("deviation"),i=Dt("sizeRanges"),l=Ft("useWindowScroll"),a=Ft("customScrollParent"),u=Dt("windowScrollContainerState"),s=Dt("scrollContainerState"),c=a||l?u:s,d=Ft("itemContent"),f=Ft("context"),m=Ft("groupContent"),h=Ft("trackItemSizes"),p=Ft("itemSize"),g=Ft("log"),v=qe(i,p,h,n?b:c,g,a),I=Ft("EmptyPlaceholder"),C=Ft("ScrollSeekPlaceholder")||wt,S=Ft("ListComponent"),x=Ft("ItemComponent"),T=Ft("GroupComponent"),w=Ft("computeItemKey"),y=Ft("isSeeking"),H=Ft("groupIndices").length>0,R=Ft("paddingTopAddition"),z=Ft("firstItemIndex"),k=Ft("statefulTotalCount"),B=n?{}:{boxSizing:"border-box",paddingTop:o.offsetTop+R,paddingBottom:o.offsetBottom,marginTop:r};return!n&&0===k&&I?O(I,kt(I,f)):O(S,M({},kt(S,f),{ref:v,style:B,"data-test-id":n?"virtuoso-top-item-list":"virtuoso-item-list"}),(n?o.topItems:o.items).map(function(e){var t=e.originalIndex,n=w(t+z,e.data,f);return y?O(C,M({},kt(C,f),{key:n,index:e.index,height:e.size,type:e.type||"item"},"group"===e.type?{}:{groupIndex:e.groupIndex})):"group"===e.type?O(T,M({},kt(T,f),{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:yt}),m(e.index)):O(x,M({},kt(x,f),{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex,style:{overflowAnchor:"none"}}),H?d(e.index,e.groupIndex,e.data,f):d(e.index,e.data,f))}))}),Ht={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Rt={width:"100%",height:"100%",position:"absolute",top:0},zt={width:"100%",position:It(),top:0};function kt(e,t){if("string"!=typeof e)return{context:t}}var Bt=P(function(){var e=Ft("HeaderComponent"),t=Dt("headerHeight"),n=Ft("headerFooterTag"),o=Ke(function(e){return t(ve(e,"height"))}),r=Ft("context");return e?O(n,{ref:o},O(e,kt(e,r))):null}),Et=P(function(){var e=Ft("FooterComponent"),t=Dt("footerHeight"),n=Ft("headerFooterTag"),o=Ke(function(e){return t(ve(e,"height"))}),r=Ft("context");return e?O(n,{ref:o},O(e,kt(e,r))):null});function Lt(e){var t=e.usePublisher,n=e.useEmitter,o=e.useEmitterValue;return P(function(e){var r=e.style,i=e.children,l=A(e,["style","children"]),a=t("scrollContainerState"),u=o("ScrollerComponent"),s=t("smoothScrollTargetReached"),c=o("scrollerRef"),d=o("context"),f=Je(a,s,u,c),m=f.scrollerRef,h=f.scrollByCallback;return n("scrollTo",f.scrollToCallback),n("scrollBy",h),O(u,M({ref:m,style:M({},Ht,r),"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0},l,kt(u,d)),i)})}function Pt(e){var t=e.usePublisher,n=e.useEmitter,o=e.useEmitterValue;return P(function(e){var r=e.style,i=e.children,l=A(e,["style","children"]),a=t("windowScrollContainerState"),u=o("ScrollerComponent"),s=t("smoothScrollTargetReached"),c=o("totalListHeight"),d=o("deviation"),f=o("customScrollParent"),m=o("context"),h=Je(a,s,u,b,f),p=h.scrollerRef,g=h.scrollByCallback,v=h.scrollToCallback;return Ze(function(){return p.current=f||window,function(){p.current=null}},[p,f]),n("windowScrollTo",v),n("scrollBy",g),O(u,M({style:M({position:"relative"},r,0!==c?{height:c+d}:{}),"data-virtuoso-scroller":!0},l,kt(u,m)),i)})}var Ot=function(e){var t=e.children,n=Dt("viewportHeight"),o=Ke(z(n,function(e){return ve(e,"height")}));return O("div",{style:Rt,ref:o,"data-viewport-type":"element"},t)},Mt=function(e){var t=e.children,n=Ye(Dt("windowViewportRect"),Ft("customScrollParent"));return O("div",{ref:n,style:Rt,"data-viewport-type":"window"},t)},At=function(e){var t=e.children,n=Ft("TopItemListComponent"),o=Ft("headerHeight"),r=M({},zt,{marginTop:o+"px"}),i=Ft("context");return O(n||"div",{style:r,context:i},t)},Vt=e(Tt,{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",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",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},P(function(e){var t=Ft("useWindowScroll"),n=Ft("topItemsIndexes").length>0,o=Ft("customScrollParent"),r=o||t?Mt:Ot;return O(o||t?Ut:Nt,M({},e),O(r,null,O(Bt,null),O(bt,null),O(Et,null)),n&&O(At,null,O(bt,{showTopList:!0})))})),Wt=Vt.Component,Dt=Vt.usePublisher,Ft=Vt.useEmitterValue,Gt=Vt.useEmitter,Nt=Lt({usePublisher:Dt,useEmitterValue:Ft,useEmitter:Gt}),Ut=Pt({usePublisher:Dt,useEmitterValue:Ft,useEmitter:Gt}),_t=t(function(){var e=o(function(e){return"Item "+e}),t=o({}),n=o(null),r=o("virtuoso-grid-item"),a=o("virtuoso-grid-list"),u=o(Ct),s=o(b),d=function(e,n){return void 0===n&&(n=null),I(i(t,l(function(t){return t[e]}),c()),n)};return{context:n,itemContent:e,components:t,computeItemKey:u,itemClassName:r,listClassName:a,scrollerRef:s,ListComponent:d("List","div"),ItemComponent:d("Item","div"),ScrollerComponent:d("Scroller","div"),ScrollSeekPlaceholder:d("ScrollSeekPlaceholder","div")}}),jt=t(function(e){var t=e[0],o=e[1],u={item:xt(o.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:n(),ScrollContainer:n(),ListContainer:n(),emptyComponent:n(),scrollSeek:n()};function s(e,t,n){r(i(e,w(o.components),l(function(e){var o,r=e[0],i=e[1];return console.warn("react-virtuoso: "+n+" property is deprecated. Pass components."+t+" instead."),M({},i,((o={})[t]=r,o))})),o.components)}return d(u.scrollSeek,function(e){var n=e.placeholder,r=A(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),x(o.components,M({},a(o.components),{ScrollSeekPlaceholder:n})),x(t.scrollSeekConfiguration,r)}),s(u.ItemContainer,"Item","ItemContainer"),s(u.ListContainer,"List","ListContainer"),s(u.ScrollContainer,"Scroller","ScrollContainer"),M({},t,o,u)},f(Ne,_t)),Kt=P(function(){var e=Qt("gridState"),t=Qt("listClassName"),n=Qt("itemClassName"),o=Qt("itemContent"),r=Qt("computeItemKey"),i=Qt("isSeeking"),l=$t("scrollHeight"),a=Qt("ItemComponent"),u=Qt("ListComponent"),s=Qt("ScrollSeekPlaceholder"),c=Qt("context"),d=$t("itemDimensions"),f=Ke(function(e){l(e.parentElement.parentElement.scrollHeight);var t=e.firstChild;t&&d(t.getBoundingClientRect())});return O(u,M({ref:f,className:t},kt(u,c),{style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom}}),e.items.map(function(t){var l=r(t.index);return i?O(s,M({key:l},kt(s,c),{index:t.index,height:e.itemHeight,width:e.itemWidth})):O(a,M({},kt(a,c),{className:n,"data-index":t.index,key:l}),o(t.index,c))}))}),Yt=function(e){var t=e.children,n=$t("viewportDimensions"),o=Ke(function(e){n(e.getBoundingClientRect())});return O("div",{style:Rt,ref:o},t)},Zt=function(e){var t=e.children,n=Ye($t("windowViewportRect"),Qt("customScrollParent"));return O("div",{ref:n,style:Rt},t)},qt=e(jt,{optional:{totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},P(function(e){var t=M({},e),n=Qt("useWindowScroll"),o=Qt("customScrollParent"),r=o||n?Zt:Yt;return O(o||n?tn:en,M({},t),O(r,null,O(Kt,null)))})),Jt=qt.Component,$t=qt.usePublisher,Qt=qt.useEmitterValue,Xt=qt.useEmitter,en=Lt({usePublisher:$t,useEmitterValue:Qt,useEmitter:Xt}),tn=Pt({usePublisher:$t,useEmitterValue:Qt,useEmitter:Xt}),nn=t(function(){var e=o(function(e){return O("td",null,"Item $",e)}),t=o(null),n=o(null),r=o({}),a=o(Ct),u=o(b),s=function(e,t){return void 0===t&&(t=null),I(i(r,l(function(t){return t[e]}),c()),t)};return{context:t,itemContent:e,fixedHeaderContent:n,components:r,computeItemKey:a,scrollerRef:u,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),on=t(function(e){return M({},e[0],e[1])},f(vt,nn)),rn=function(e){return O("tr",null,O("td",{style:{height:e.height}}))},ln=function(e){return O("tr",null,O("td",{style:{height:e.height,padding:0,border:0}}))},an=P(function(){var e=mn("listState"),t=mn("deviation"),n=fn("sizeRanges"),o=mn("useWindowScroll"),r=mn("customScrollParent"),i=fn("windowScrollContainerState"),l=fn("scrollContainerState"),a=r||o?i:l,u=mn("itemContent"),s=mn("trackItemSizes"),c=qe(n,mn("itemSize"),s,a,mn("log"),r),d=mn("EmptyPlaceholder"),f=mn("ScrollSeekPlaceholder")||rn,m=mn("TableBodyComponent"),h=mn("TableRowComponent"),p=mn("computeItemKey"),g=mn("isSeeking"),v=mn("paddingTopAddition"),I=mn("firstItemIndex"),C=mn("statefulTotalCount"),S=mn("context");if(0===C&&d)return O(d,kt(d,S));var x=e.offsetTop+v+t,T=e.offsetBottom,w=x>0?O(ln,{height:x,key:"padding-top"}):null,y=T>0?O(ln,{height:T,key:"padding-bottom"}):null,b=e.items.map(function(e){var t=e.originalIndex,n=p(t+I,e.data,S);return g?O(f,M({},kt(f,S),{key:n,index:e.index,height:e.size,type:e.type||"item"})):O(h,M({},kt(h,S),{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:{overflowAnchor:"none"}}),u(e.index,e.data,S))});return O(m,M({ref:c,"data-test-id":"virtuoso-item-list"},kt(m,S)),[w].concat(b,[y]))}),un=function(e){var t=e.children,n=fn("viewportHeight"),o=Ke(z(n,function(e){return ve(e,"height")}));return O("div",{style:Rt,ref:o,"data-viewport-type":"element"},t)},sn=function(e){var t=e.children,n=Ye(fn("windowViewportRect"),mn("customScrollParent"));return O("div",{ref:n,style:Rt,"data-viewport-type":"window"},t)},cn=e(on,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",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"},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"}},P(function(e){var t=mn("useWindowScroll"),n=mn("customScrollParent"),o=fn("fixedHeaderHeight"),r=mn("fixedHeaderContent"),i=mn("context"),l=Ke(z(o,function(e){return ve(e,"height")})),a=n||t?gn:pn,u=n||t?sn:un,s=mn("TableComponent"),c=mn("TableHeadComponent"),d=r?O(c,M({key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:l},kt(c,i)),r()):null;return O(a,M({},e),O(u,null,O(s,M({style:{borderSpacing:0}},kt(s,i)),[d,O(an,{key:"TableBody"})])))})),dn=cn.Component,fn=cn.usePublisher,mn=cn.useEmitterValue,hn=cn.useEmitter,pn=Lt({usePublisher:fn,useEmitterValue:mn,useEmitter:hn}),gn=Pt({usePublisher:fn,useEmitterValue:mn,useEmitter:hn}),vn=Wt,In=Wt,Cn=dn,Sn=Jt;export{In as GroupedVirtuoso,N as LogLevel,Cn as TableVirtuoso,vn as Virtuoso,Sn as VirtuosoGrid};
|
|
1
|
+
import{systemToComponent as t}from"@virtuoso.dev/react-urx";import*as e from"@virtuoso.dev/urx";import{getValue as n,tup as o,system as r,stream as i,streamFromEmitter as a,pipe as l,map as s,connect as u,prop as c,combineLatest as m,filter as d,distinctUntilChanged as f,statefulStream as p,noop as h,subscribe as g,publish as v,statefulStreamFromEmitter as S,withLatestFrom as I,compose as C}from"@virtuoso.dev/urx";import*as x from"react";import{useRef as T,useCallback as w,useEffect as y,useLayoutEffect as b,createElement as E}from"react";function H(){return H=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},H.apply(this,arguments)}function R(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 L(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 k(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 L(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)?L(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.")}function z(t,e){return!(!t||t[0]!==e[0]||t[1]!==e[1])}function B(t,e){return!(!t||t.startIndex!==e.startIndex||t.endIndex!==e.endIndex)}var F,P,O=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.stream(),m=e.stream(),d=e.statefulStream(!1);return e.connect(e.pipe(t,e.map(function(t){return t[0]})),n),e.connect(e.pipe(t,e.map(function(t){return t[1]})),l),e.connect(n,i),{scrollContainerState:t,scrollTop:n,viewportHeight:a,headerHeight:s,footerHeight:u,scrollHeight:l,smoothScrollTargetReached:r,scrollTo:c,scrollBy:m,statefulScrollTop:i,deviation:o,scrollingInProgress:d}},[],{singleton:!0});!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR"}(P||(P={}));var M=((F={})[P.DEBUG]="debug",F[P.INFO]="log",F[P.WARN]="warn",F[P.ERROR]="error",F),V=e.system(function(){var t=e.statefulStream(P.ERROR);return{log:e.statefulStream(function(n,o,r){var i;void 0===r&&(r=P.INFO),r>=(null!=(i=("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL)?i:e.getValue(t))&&console[M[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0}),U=e.system(function(t){var o=t[0].log,r=e.statefulStream(!1),i=e.streamFromEmitter(e.pipe(r,e.filter(function(t){return t}),e.distinctUntilChanged()));return e.subscribe(r,function(t){t&&n(o)("props updated",{},P.DEBUG)}),{propsReady:r,didMount:i}},o(V),{singleton:!0}),A="up",W={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},N=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.streamFromEmitter(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())),h=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.duc(r),e.map(function(t){return 0===t}),e.distinctUntilChanged()),c),e.connect(c,d);var g=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[0],a=r[1],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}},W),e.distinctUntilChanged(function(t,e){return t&&t.atBottom===e.atBottom}))),v=e.statefulStreamFromEmitter(e.pipe(o,e.scan(function(t,e){var n=e[0],o=e[1];return t.scrollHeight!==o?t.scrollTop!==n?{scrollHeight:o,scrollTop:n,jump:t.scrollTop-n,changed:!0}:{scrollHeight:o,scrollTop:n,jump:0,changed:!0}:{scrollTop:n,scrollHeight:o,jump:0,changed:!1}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),e.filter(function(t){return t.changed}),e.map(function(t){return t.jump})),0);e.connect(e.pipe(g,e.map(function(t){return t.atBottom})),u),e.subscribe(u,function(t){setTimeout(function(){return e.publish(m,t)})});var S=e.statefulStream("down");e.subscribe(u,function(t){setTimeout(function(){e.publish(m,t)})}),e.connect(e.pipe(o,e.map(function(t){return t[0]}),e.distinctUntilChanged(),e.scan(function(t,n){return e.getValue(h)?{direction:t.direction,prevScrollTop:n}:{direction:n<t.prevScrollTop?A:"down",prevScrollTop:n}},{direction:"down",prevScrollTop:0}),e.map(function(t){return t.direction})),S),e.connect(e.pipe(o,e.throttleTime(50),e.mapTo("none")),S),e.connect(u,m);var I=e.statefulStream(0);return e.connect(e.pipe(p,e.filter(function(t){return!t}),e.mapTo(0)),I),e.connect(e.pipe(r,e.throttleTime(100),e.withLatestFrom(p),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:p,isAtTop:c,isAtBottom:u,atBottomState:g,atTopStateChange:d,atBottomStateChange:m,scrollDirection:S,atBottomThreshold:f,scrollVelocity:I,lastJumpDueToItemResize:v}},e.tup(O)),D=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(N),{singleton:!0}),G={lvl:0};function _(t,e,n,o,r){return void 0===o&&(o=G),void 0===r&&(r=G),{k:t,v:e,lvl:n,l:o,r:r}}function j(t){return t===G}function K(){return G}function Y(t,e){if(j(t))return G;var n=t.k,o=t.l,r=t.r;if(e===n){if(j(o))return r;if(j(r))return o;var i=Q(o);return nt(tt(t,{k:i[0],v:i[1],l:X(o)}))}return nt(tt(t,e<n?{l:Y(o,e)}:{r:Y(r,e)}))}function Z(t,e,n){if(void 0===n&&(n="k"),j(t))return[-Infinity,void 0];if(t[n]===e)return[t.k,t.v];if(t[n]<e){var o=Z(t.r,e,n);return-Infinity===o[0]?[t.k,t.v]:o}return Z(t.l,e,n)}function q(t,e,n){return j(t)?_(e,n,1):e===t.k?tt(t,{k:e,v:n}):function(t){return it(at(t))}(tt(t,e<t.k?{l:q(t.l,e,n)}:{r:q(t.r,e,n)}))}function J(t,e,n){if(j(t))return[];var o=t.k,r=t.v,i=t.r,a=[];return o>e&&(a=a.concat(J(t.l,e,n))),o>=e&&o<=n&&a.push({k:o,v:r}),o<=n&&(a=a.concat(J(i,e,n))),a}function $(t){return j(t)?[]:[].concat($(t.l),[{k:t.k,v:t.v}],$(t.r))}function Q(t){return j(t.r)?[t.k,t.v]:Q(t.r)}function X(t){return j(t.r)?t.l:nt(tt(t,{r:X(t.r)}))}function tt(t,e){return _(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 et(t){return j(t)||t.lvl>t.r.lvl}function nt(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(et(e))return at(tt(t,{lvl:o-1}));if(j(e)||j(e.r))throw new Error("Unexpected empty nodes");return tt(e.r,{l:tt(e,{r:e.r.l}),r:tt(t,{l:e.r.r,lvl:o-1}),lvl:o})}if(et(t))return it(tt(t,{lvl:o-1}));if(j(n)||j(n.l))throw new Error("Unexpected empty nodes");var r=n.l,i=et(r)?n.lvl-1:n.lvl;return tt(r,{l:tt(t,{r:r.l,lvl:o-1}),r:it(tt(n,{l:r.r,lvl:i})),lvl:r.lvl+1})}function ot(t,e,n){return j(t)?[]:rt(J(t,Z(t,e)[0],n),function(t){return{index:t.k,value:t.v}})}function rt(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 it(t){var e=t.r,n=t.lvl;return j(e)||j(e.r)||e.lvl!==n||e.r.lvl!==n?t:tt(e,{l:tt(t,{r:e.l}),lvl:n+1})}function at(t){var e=t.l;return j(e)||e.lvl!==t.lvl?t:tt(e,{r:tt(t,{l:e.r})})}function lt(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 st(t,e,n){return t[lt(t,e,n)]}function ut(t,e){return Math.round(t.getBoundingClientRect()[e])}function ct(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 mt(t,e){var n=t.index;return e===n?0:e<n?-1:1}function dt(t,e){var n=t.offset;return e===n?0:e<n?-1:1}function ft(t){return{index:t.index,value:t}}function pt(t,e,n){var o=t,r=0,i=0,a=0,l=0;if(0!==e){a=o[l=lt(o,e-1,mt)].offset;var s=Z(n,e-1);r=s[0],i=s[1],o.length&&o[l].size===Z(n,e)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(var u,c=k(ot(n,e,Infinity));!(u=c()).done;){var m=u.value,d=m.start,f=m.value,p=(d-r)*i+a;o.push({offset:p,size:f,index:d}),r=d,a=p,i=f}return{offsetTree:o,lastIndex:r,lastOffset:a,lastSize:i}}function ht(t,e){var n=e[0],o=e[1];n.length>0&&(0,e[2])("received item sizes",n,P.DEBUG);var r=t.sizeTree,i=r,a=0;if(o.length>0&&j(r)&&2===n.length){var l=n[0].size,s=n[1].size;i=o.reduce(function(t,e){return q(q(t,e,l),e+1,s)},i)}else{var u=function(t,e){for(var n,o=j(t)?0:Infinity,r=k(e);!(n=r()).done;){var i=n.value,a=i.size,l=i.startIndex,s=i.endIndex;if(o=Math.min(o,l),j(t))t=q(t,0,a);else{var u=ot(t,l-1,s+1);if(!u.some(ct(i))){for(var c,m=!1,d=!1,f=k(u);!(c=f()).done;){var p=c.value,h=p.start,g=p.end,v=p.value;m?(s>=h||a===v)&&(t=Y(t,h)):(d=v!==a,m=!0),g>s&&s>=h&&v!==a&&(t=q(t,s+1,v))}d&&(t=q(t,l,a))}}}return[t,o]}(i,n);i=u[0],a=u[1]}if(i===r)return t;var c=pt(t.offsetTree,a,i),m=c.offsetTree;return{sizeTree:i,offsetTree:m,lastIndex:c.lastIndex,lastOffset:c.lastOffset,lastSize:c.lastSize,groupOffsetTree:o.reduce(function(t,e){return q(t,e,gt(e,m))},K()),groupIndices:o}}function gt(t,e){if(0===e.length)return 0;var n=st(e,t,mt);return n.size*(t-n.index)+n.offset}function vt(t,e){if(!St(e))return t;for(var n=0;e.groupIndices[n]<=t+n;)n++;return t+n}function St(t){return!j(t.groupOffsetTree)}var It={offsetHeight:"height",offsetWidth:"width"},Ct=e.system(function(t){var n=t[0].log,o=e.stream(),r=e.stream(),i=e.statefulStreamFromEmitter(r,0),a=e.stream(),l=e.stream(),s=e.statefulStream(0),u=e.statefulStream([]),c=e.statefulStream(void 0),m=e.statefulStream(void 0),d=e.statefulStream(function(t,e){return ut(t,It[e])}),f=e.statefulStream(void 0),p={offsetTree:[],sizeTree:K(),groupOffsetTree:K(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},h=e.statefulStreamFromEmitter(e.pipe(o,e.withLatestFrom(u,n),e.scan(ht,p),e.distinctUntilChanged()),p);e.connect(e.pipe(u,e.filter(function(t){return t.length>0}),e.withLatestFrom(h),e.map(function(t){var e=t[0],n=t[1],o=e.reduce(function(t,e,o){return q(t,e,gt(e,n.offsetTree)||o)},K());return H({},n,{groupIndices:e,groupOffsetTree:o})})),h),e.connect(e.pipe(r,e.withLatestFrom(h),e.filter(function(t){return t[0]<t[1].lastIndex}),e.map(function(t){var e=t[1];return[{startIndex:t[0],endIndex:e.lastIndex,size:e.lastSize}]})),o),e.connect(c,m);var g=e.statefulStreamFromEmitter(e.pipe(c,e.map(function(t){return void 0===t})),!0);e.connect(e.pipe(m,e.filter(function(t){return void 0!==t&&j(e.getValue(h).sizeTree)}),e.map(function(t){return[{startIndex:0,endIndex:0,size:t}]})),o);var v=e.streamFromEmitter(e.pipe(o,e.withLatestFrom(h),e.scan(function(t,e){var n=e[1];return{changed:n!==t.sizes,sizes:n}},{changed:!1,sizes:p}),e.map(function(t){return t.changed})));e.subscribe(e.pipe(s,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(a,t):t<0&&e.publish(l,t)}),e.subscribe(e.pipe(s,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:s},P.ERROR)});var S=e.streamFromEmitter(a);e.connect(e.pipe(a,e.withLatestFrom(h),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 $(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})),o);var I=e.streamFromEmitter(e.pipe(l,e.withLatestFrom(h),e.map(function(t){return gt(-t[0],t[1].offsetTree)})));return e.connect(e.pipe(l,e.withLatestFrom(h),e.map(function(t){var e=t[0],n=t[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: shifting items does not work with groups");var o=$(n.sizeTree).reduce(function(t,n){var o=n.v;return q(t,Math.max(0,n.k+e),o)},K());return H({},n,{sizeTree:o},pt(n.offsetTree,0,o))})),h),{data:f,totalCount:r,sizeRanges:o,groupIndices:u,defaultItemSize:m,fixedItemSize:c,unshiftWith:a,shiftWith:l,shiftWithOffset:I,beforeUnshiftWith:S,firstItemIndex:s,sizes:h,listRefresh:v,statefulTotalCount:i,trackItemSizes:g,itemSize:d}},e.tup(V),{singleton:!0}),xt="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function Tt(t){var e="number"==typeof t?{index:t}:t;return e.align||(e.align="start"),e.behavior&&xt||(e.behavior="auto"),e.offset||(e.offset=0),e}var wt=e.system(function(t){var n=t[0],o=n.sizes,r=n.totalCount,i=n.listRefresh,a=t[1],l=a.scrollingInProgress,s=a.viewportHeight,u=a.scrollTo,c=a.smoothScrollTargetReached,m=a.headerHeight,d=a.footerHeight,f=t[2].log,p=e.stream(),h=e.statefulStream(0),g=null,v=null,S=null;function I(){g&&(g(),g=null),S&&(S(),S=null),v&&(clearTimeout(v),v=null),e.publish(l,!1)}return e.connect(e.pipe(p,e.withLatestFrom(o,s,r,h,m,d,f),e.map(function(t){var n=t[0],o=t[1],r=t[2],a=t[3],s=t[4],u=t[5],m=t[6],d=t[7],f=Tt(n),h=f.align,C=f.behavior,x=f.offset,T=a-1,w=f.index;"LAST"===w&&(w=T),w=vt(w,o);var y=gt(w=Math.max(0,w,Math.min(T,w)),o.offsetTree)+u;"end"===h?(y=y-r+Z(o.sizeTree,w)[1],w===T&&(y+=m)):"center"===h?y=y-r/2+Z(o.sizeTree,w)[1]/2:y-=s,x&&(y+=x);var b=function(t){I(),t?(d("retrying to scroll to",{location:n},P.DEBUG),e.publish(p,n)):d("list did not change, scroll successful",{},P.DEBUG)};if(I(),"smooth"===C){var E=!1;S=e.subscribe(i,function(t){E=E||t}),g=e.handleNext(c,function(){b(E)})}else g=e.handleNext(e.pipe(i,function(t){var e=setTimeout(function(){t(!1)},50);return function(n){n&&(t(!0),clearTimeout(e))}}),b);return v=setTimeout(function(){I()},1200),e.publish(l,!0),d("scrolling from index to",{index:w,top:y,behavior:C},P.DEBUG),{top:y,behavior:C}})),u),{scrollToIndex:p,topListHeight:h}},e.tup(Ct,O,V),{singleton:!0});function yt(t,e,n){return"number"==typeof t?n===A&&"top"===e||"down"===n&&"bottom"===e?t:0:n===A?"top"===e?t.main:t.reverse:"bottom"===e?t.main:t.reverse}function bt(t,e){return"number"==typeof t?t:t[e]||0}var Et=e.system(function(t){var n=t[0],o=n.scrollTop,r=n.viewportHeight,i=n.deviation,a=n.headerHeight,l=e.stream(),s=e.statefulStream(0),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(l,z),e.duc(m),e.duc(s),e.duc(u),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=bt(c,"top"),g=bt(c,"bottom");return i-=u,a+=o,(i+=o)>e+d-h&&(p=A),(a-=u)<e-f+n+g&&(p="down"),"none"!==p?[Math.max(m-o-yt(l,"top",p)-h,0),m-f-s+n+yt(l,"bottom",p)+g]:null}),e.filter(function(t){return null!=t}),e.distinctUntilChanged(z)),[0,0]);return{listBoundary:l,overscan:m,topListHeight:s,fixedHeaderHeight:u,increaseViewportBy:c,visibleRange:d}},e.tup(O),{singleton:!0}),Ht=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[1];return[Math.max(0,e[0]-t[1].offsetTop),n]})),r),e.connect(e.pipe(o,e.withLatestFrom(a),e.map(function(t){var e=t[0];return H({},e,{top:e.top+t[1].offsetTop})})),l),{useWindowScroll:s,customScrollParent:u,windowScrollContainerState:i,windowViewportRect:a,windowScrollTo:l}},e.tup(O)),Rt={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Lt={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},kt=Math.round,zt=Math.ceil,Bt=Math.floor,Ft=Math.min,Pt=Math.max;function Ot(t,e){return Array.from({length:e-t+1}).map(function(e,n){return{index:n+t}})}var Mt=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,c=a.scrollTo,m=a.smoothScrollTargetReached,d=a.scrollContainerState,f=t[2],p=t[3],h=t[4],g=h.propsReady,v=h.didMount,S=t[5],I=S.windowViewportRect,C=S.windowScrollTo,x=S.useWindowScroll,T=S.customScrollParent,w=S.windowScrollContainerState,y=e.statefulStream(0),b=e.statefulStream(0),E=e.statefulStream(Rt),R=e.statefulStream({height:0,width:0}),L=e.statefulStream({height:0,width:0}),k=e.stream(),F=e.stream(),P=e.statefulStream(0);e.connect(e.pipe(v,e.withLatestFrom(b),e.filter(function(t){return 0!==t[1]}),e.map(function(t){return{items:Ot(0,t[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),E),e.connect(e.pipe(e.combineLatest(e.duc(y),r,e.duc(L,function(t,e){return t&&t.width===e.width&&t.height===e.height})),e.withLatestFrom(R),e.map(function(t){var e=t[0],n=e[0],o=e[1],r=o[0],i=o[1],a=e[2],l=t[1],s=a.height,u=a.width,c=l.width;if(0===n||0===c)return Rt;if(0===u)return Lt;var m=At(c,u),d=m*Bt(r/s),f=m*zt(i/s)-1;f=Ft(n-1,f);var p=Ot(d=Ft(f,Pt(0,d)),f),h=Vt(l,a,p),g=h.top,v=h.bottom;return{items:p,offsetTop:g,offsetBottom:zt(n/m)*s-v,top:g,bottom:v,itemHeight:s,itemWidth:u}})),E),e.connect(e.pipe(R,e.map(function(t){return t.height})),s),e.connect(e.pipe(e.combineLatest(R,L,E),e.map(function(t){var e=Vt(t[0],t[1],t[2].items);return[e.top,e.bottom]}),e.distinctUntilChanged(z)),i);var O=e.streamFromEmitter(e.pipe(e.duc(E),e.filter(function(t){return t.items.length>0}),e.withLatestFrom(y),e.filter(function(t){var e=t[0].items;return e[e.length-1].index===t[1]-1}),e.map(function(t){return t[1]-1}),e.distinctUntilChanged())),M=e.streamFromEmitter(e.pipe(e.duc(E),e.filter(function(t){var e=t.items;return e.length>0&&0===e[0].index}),e.mapTo(0),e.distinctUntilChanged())),V=e.streamFromEmitter(e.pipe(e.duc(E),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(B)));e.connect(V,p.scrollSeekRangeChanged),e.connect(e.pipe(k,e.withLatestFrom(R,L,y),e.map(function(t){var e=t[1],n=t[2],o=t[3],r=Tt(t[0]),i=r.align,a=r.behavior,l=r.offset,s=r.index;"LAST"===s&&(s=o-1);var u=Ut(e,n,s=Pt(0,s,Ft(o-1,s)));return"end"===i?u=kt(u-e.height+n.height):"center"===i&&(u=kt(u-e.height/2+n.height/2)),l&&(u+=l),{top:u,behavior:a}})),c);var U=e.statefulStreamFromEmitter(e.pipe(E,e.map(function(t){return t.offsetBottom+t.bottom})),0);return e.connect(e.pipe(I,e.map(function(t){return{width:t.visibleWidth,height:t.visibleHeight}})),R),H({totalCount:y,viewportDimensions:R,itemDimensions:L,scrollTop:l,scrollHeight:F,overscan:o,scrollBy:u,scrollTo:c,scrollToIndex:k,smoothScrollTargetReached:m,windowViewportRect:I,windowScrollTo:C,useWindowScroll:x,customScrollParent:T,windowScrollContainerState:w,deviation:P,scrollContainerState:d,initialItemCount:b},p,{gridState:E,totalListHeight:U},f,{startReached:M,endReached:O,rangeChanged:V,propsReady:g})},e.tup(Et,O,N,D,U,Ht));function Vt(t,e,n){var o=e.height;return void 0===o||0===n.length?{top:0,bottom:0}:{top:Ut(t,e,n[0].index),bottom:Ut(t,e,n[n.length-1].index)+o}}function Ut(t,e,n){var o=At(t.width,e.width);return Bt(n/o)*e.height}function At(t,e){return Pt(1,Bt(t/e))}function Wt(t,e){void 0===e&&(e=!0);var n=T(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 Nt(t,e){return void 0===e&&(e=!0),Wt(t,e).callbackRef}function Dt(t,e){var n=T(null),o=w(function(o){if(null!==o){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]),r=Wt(o),i=r.callbackRef,a=r.ref,l=w(function(){o(a.current)},[o,a]);return y(function(){if(e){e.addEventListener("scroll",l);var t=new ResizeObserver(l);return t.observe(e),function(){e.removeEventListener("scroll",l),t.unobserve(e)}}return window.addEventListener("scroll",l),window.addEventListener("resize",l),function(){window.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,e]),i}var Gt="undefined"!=typeof document?b:y;function _t(t,e,n,o,r,i){return Nt(function(n){for(var a=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},P.ERROR),c!==u){var m=i[i.length-1];0===i.length||m.size!==c||m.endIndex!==s-1?i.push({startIndex:s,endIndex:s,size:c}):i[i.length-1].endIndex++}}}return i}(n.children,e,0,r),l=n.parentElement;!l.dataset.virtuosoScroller;)l=l.parentElement;var s=i?i.scrollTop:"window"===l.firstElementChild.dataset.viewportType?window.pageYOffset||document.documentElement.scrollTop:l.scrollTop;o(i?[Math.max(s,0),i.scrollHeight]:[Math.max(s,0),l.scrollHeight]),null!==a&&t(a)},n)}function jt(t,n,o,r,i){void 0===r&&(r=e.noop);var a=T(null),l=T(null),s=T(null),u=w(function(e){var o=e.target,r=o===window||o===document?window.pageYOffset||document.documentElement.scrollTop:o.scrollTop,i=o===window?document.documentElement.scrollHeight:o.scrollHeight;t([Math.max(r,0),i]),null!==l.current&&(r===l.current||r<=0||r===o.scrollHeight-ut(o,"height"))&&(l.current=null,n(!0),s.current&&(clearTimeout(s.current),s.current=null))},[t,n]);return y(function(){var t=i||a.current;return r(i||a.current),u({target:t}),t.addEventListener("scroll",u,{passive:!0}),function(){r(null),t.removeEventListener("scroll",u)}},[a,u,o,r,i]),{scrollerRef:a,scrollByCallback:function(t){null===l.current&&a.current.scrollBy(t)},scrollToCallback:function(e){var o=a.current;if(o&&(!("offsetHeight"in o)||0!==o.offsetHeight)){var r,i,u,c="smooth"===e.behavior;if(o===window?(i=Math.max(ut(document.documentElement,"height"),document.documentElement.scrollHeight),r=window.innerHeight,u=document.documentElement.scrollTop):(i=o.scrollHeight,r=ut(o,"height"),u=o.scrollTop),e.top=Math.ceil(Math.max(Math.min(i-r,e.top),0)),Math.abs(r-i)<1.01||e.top===u)return t([u,i]),void(c&&n(!0));c?(l.current=e.top,s.current&&clearTimeout(s.current),s.current=setTimeout(function(){s.current=null,l.current=null,n(!0)},1e3)):l.current=null,o.scrollTo(e)}}}}var Kt=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]&&(!j(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(Ct,O,wt,U),{singleton:!0});function Yt(t){return!!t&&("smooth"===t?"smooth":"auto")}var Zt=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,h=e.statefulStream(!1),g=null;function v(t){e.publish(s,{index:"LAST",align:"end",behavior:t})}return e.subscribe(e.pipe(e.combineLatest(e.pipe(e.duc(o),e.skip(1)),d),e.withLatestFrom(e.duc(h),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?Yt(t(e)):e&&Yt(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;g&&(g(),g=null),g=e.handleNext(r,function(){e.getValue(f)("following output to ",{totalCount:n},P.DEBUG),v(o),g=null})}),e.subscribe(e.pipe(e.combineLatest(e.duc(h),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(h,o)),function(t){var n=t[1],o=e.handleNext(l,function(t){!n||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||g||(e.getValue(f)("scrolling to bottom due to increased size",{},P.DEBUG),v("auto"))});setTimeout(o,100)}),e.subscribe(e.combineLatest(e.duc(h),l),function(t){var e=t[1];t[0]&&!e.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===e.notAtBottomBecause&&v("auto")}),{followOutput:h}},e.tup(Ct,N,wt,Kt,U,V,O));function qt(t){return t.reduce(function(t,e){return t.groupIndices.push(t.totalCount),t.totalCount+=e+1,t},{totalCount:0,groupIndices:[]})}var Jt=r(function(t){var e=t[0],n=e.totalCount,o=e.groupIndices,r=e.sizes,p=t[1],h=p.scrollTop,g=p.headerHeight,v=i(),S=i(),I=a(l(v,s(qt)));return u(l(I,s(c("totalCount"))),n),u(l(I,s(c("groupIndices"))),o),u(l(m(h,r,g),d(function(t){return St(t[1])}),s(function(t){return Z(t[1].groupOffsetTree,Math.max(t[0]-t[2],0),"v")[0]}),f(),s(function(t){return[t]})),S),{groupCounts:v,topItemsIndexes:S}},o(Ct,O)),$t={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0};function Qt(t,e,n){if(0===t.length)return[];if(!St(e))return t.map(function(t){return H({},t,{index:t.index+n,originalIndex:t.index})});for(var o,r=[],i=ot(e.groupOffsetTree,t[0].index,t[t.length-1].index),a=void 0,l=0,s=k(t);!(o=s()).done;){var u=o.value;(!a||a.end<u.index)&&(a=i.shift(),l=e.groupIndices.indexOf(a.start)),r.push(H({},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 Xt(t,e,n,o,r){var i=0,a=0;if(t.length>0){i=t[0].offset;var l=t[t.length-1];a=l.offset+l.size}var s=i,u=o.lastOffset+(n-o.lastIndex)*o.lastSize-a;return{items:Qt(t,o,r),topItems:Qt(e,o,r),topListHeight:e.reduce(function(t,e){return e.size+t},0),offsetTop:i,offsetBottom:u,top:s,bottom:a,totalCount:n}}var te,ee,ne,oe=e.system(function(t){var n=t[0],o=n.sizes,r=n.totalCount,i=n.data,a=n.firstItemIndex,l=t[1],s=t[2],u=s.visibleRange,c=s.listBoundary,m=s.topListHeight,d=t[3],f=d.scrolledToInitialItem,p=d.initialTopMostItemIndex,h=t[4].topListHeight,g=t[5],v=t[6].didMount,S=e.statefulStream([]),I=e.stream();e.connect(l.topItemsIndexes,S);var C=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(v,e.duc(u),e.duc(r),e.duc(o),e.duc(p),f,e.duc(S),e.duc(a),i),e.filter(function(t){return t[0]}),e.map(function(t){var n=t[1],o=n[0],r=n[1],i=t[2],a=t[4],l=t[5],s=t[6],u=t[7],c=t[8],m=t[3],d=m.sizeTree,f=m.offsetTree;if(0===i||0===o&&0===r)return $t;if(j(d))return Xt(function(t,e,n){if(St(e)){var o=vt(t,e);return[{index:Z(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),m,c),[],i,m,u);var p=[];if(s.length>0)for(var h,g=s[0],v=s[s.length-1],S=0,I=k(ot(d,g,v));!(h=I()).done;)for(var C=h.value,x=C.value,T=Math.max(C.start,g),w=Math.min(C.end,v),y=T;y<=w;y++)p.push({index:y,size:x,offset:S,data:c&&c[y]}),S+=x;if(!l)return Xt([],p,i,m,u);var b=s.length>0?s[s.length-1]+1:0,E=function(t,e,n,o){return void 0===o&&(o=0),o>0&&(e=Math.max(e,st(t,o,mt).offset)),rt((i=n,l=lt(r=t,e,a=dt),s=lt(r,i,a,l),r.slice(l,s+1)),ft);var r,i,a,l,s}(f,o,r,b);if(0===E.length)return null;var H=i-1;return Xt(e.tap([],function(t){for(var e,n=k(E);!(e=n()).done;){var i=e.value,a=i.value,l=a.offset,s=i.start,u=a.size;a.offset<o&&(l+=((s+=Math.floor((o-a.offset)/u))-i.start)*u),s<b&&(l+=(b-s)*u,s=b);for(var m=Math.min(i.end,H),d=s;d<=m&&!(l>=r);d++)t.push({index:d,size:u,offset:l,data:c&&c[d]}),l+=u}}),p,i,m,u)}),e.filter(function(t){return null!==t}),e.distinctUntilChanged()),$t);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(C,e.map(e.prop("topListHeight"))),h),e.connect(h,m),e.connect(e.pipe(C,e.map(function(t){return[t.top,t.bottom]})),c),e.connect(e.pipe(C,e.map(function(t){return t.items})),I),H({listState:C,topItemsIndexes:S,endReached:e.streamFromEmitter(e.pipe(C,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(z),e.map(function(t){return t[0]}))),startReached:e.streamFromEmitter(e.pipe(C,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(C,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(B))),itemsRendered:I},g)},e.tup(Ct,Jt,Et,Kt,wt,N,U),{singleton:!0}),re=e.system(function(t){var n=t[0],o=n.sizes,r=n.firstItemIndex,i=n.data,a=t[1].listState,l=t[2].didMount,s=e.statefulStream(0);return e.connect(e.pipe(l,e.withLatestFrom(s),e.filter(function(t){return 0!==t[1]}),e.withLatestFrom(o,r,i),e.map(function(t){var e=t[0][1],n=t[1],o=t[2],r=t[3],i=void 0===r?[]:r,a=0;if(n.groupIndices.length>0)for(var l,s=k(n.groupIndices);!((l=s()).done||l.value-a>=e);)a++;var u=e+a;return Xt(Array.from({length:u}).map(function(t,e){return{index:e,size:0,offset:0,data:i[e]}}),[],u,n,o)})),a),{initialItemCount:s}},e.tup(Ct,oe,U),{singleton:!0}),ie=r(function(t){var e=t[0].topItemsIndexes,n=p(0);return u(l(n,d(function(t){return t>0}),s(function(t){return Array.from({length:t}).map(function(t,e){return e})})),e),{topItemCount:n}},o(oe)),ae=e.system(function(t){var n=t[0],o=n.footerHeight,r=n.headerHeight,i=t[1].listState,a=e.stream(),l=e.statefulStreamFromEmitter(e.pipe(e.combineLatest(o,r,i),e.map(function(t){var e=t[2];return t[0]+t[1]+e.offsetBottom+e.bottom})),0);return e.connect(e.duc(l),a),{totalListHeight:l,totalListHeightChanged:a}},e.tup(O,oe),{singleton:!0}),le=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.atBottomState,m=l.scrollDirection,d=t[3],f=d.beforeUnshiftWith,p=d.shiftWithOffset,h=d.sizes,g=t[4].log,v=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=e[1],l=0;if(t[2]===i){if(n.length>0&&r.length>0){var s=1===r.length;if(0!==r[0].originalIndex||0!==n[0].originalIndex)for(var u=function(t){var e=r[t],o=n.find(function(t){return t.originalIndex===e.originalIndex});return o?e.offset!==o.offset||s?(l=e.offset-o.offset+e.size-o.size,"break"):void 0:"continue"},c=r.length-1;c>=0;c--){var m=u(c);if("continue"!==m&&"break"===m)break}}0!==l&&(l+=a)}return[l,r,i]},[0,[],0]),e.filter(function(t){return 0!==t[0]}),e.withLatestFrom(r,m,a,g,u,c),e.filter(function(t){return!t[3]&&0!==t[1]&&t[2]===A}),e.map(function(t){var e=t[0][0];return(0,t[4])("Upward scrolling compensation",{amount:e},P.DEBUG),e})));return e.connect(e.pipe(v,e.withLatestFrom(i),e.map(function(t){return t[1]-t[0]})),i),e.subscribe(e.pipe(e.combineLatest(e.statefulStreamFromEmitter(s,!1),i),e.filter(function(t){return!t[0]&&0!==t[1]}),e.map(function(t){return t[1]}),e.throttleTime(1)),function(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"}))}),e.connect(e.pipe(p,e.map(function(t){return{top:-t}})),o),e.connect(e.pipe(f,e.withLatestFrom(h),e.map(function(t){return t[0]*t[1].lastSize})),v),{deviation:i}},e.tup(O,N,oe,Ct,V)),se=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(ae,U,O),{singleton:!0}),ue=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(O,ae),{singleton:!0}),ce=e.system(function(t){var n=t[0],o=n.sizes,r=n.totalCount,i=t[1],a=i.scrollTop,l=i.viewportHeight,s=i.headerHeight,u=i.scrollingInProgress,c=t[2].scrollToIndex,m=e.stream();return e.connect(e.pipe(m,e.withLatestFrom(o,l,r,s,a),e.map(function(t){var n=t[0],o=n.index,r=n.behavior,i=void 0===r?"auto":r,a=n.done,l=t[1],s=t[2],c=t[4],m=t[5],d=t[3]-1,f=null;o=vt(o,l);var p=gt(o=Math.max(0,o,Math.min(d,o)),l.offsetTree)+c;return p<m?f={index:o,behavior:i,align:"start"}:p+Z(l.sizeTree,o)[1]>m+s&&(f={index:o,behavior:i,align:"end"}),f?a&&e.handleNext(e.pipe(u,e.skip(1),e.filter(function(t){return!1===t})),a):a&&a(),f}),e.filter(function(t){return null!==t})),c),{scrollIntoView:m}},e.tup(Ct,O,wt,oe,V),{singleton:!0}),me=["listState","topItemsIndexes"],de=e.system(function(t){return H({},t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},e.tup(Et,re,U,D,ae,se,ue,Ht,ce)),fe=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,c=n.firstItemIndex,m=n.groupIndices,d=n.statefulTotalCount,f=t[1],p=f.initialTopMostItemIndex,h=f.scrolledToInitialItem,g=t[2],v=t[3],S=t[4],I=S.listState,C=S.topItemsIndexes,x=R(S,me),T=t[5].scrollToIndex,w=t[7].topItemCount,y=t[8].groupCounts,b=t[9],E=t[10];return e.connect(x.rangeChanged,b.scrollSeekRangeChanged),e.connect(e.pipe(b.windowViewportRect,e.map(e.prop("visibleHeight"))),g.viewportHeight),H({totalCount:o,data:u,firstItemIndex:c,sizeRanges:r,initialTopMostItemIndex:p,scrolledToInitialItem:h,topItemsIndexes:C,topItemCount:w,groupCounts:y,fixedItemHeight:i,defaultItemHeight:a},v,{statefulTotalCount:d,listState:I,scrollToIndex:T,trackItemSizes:l,itemSize:s,groupIndices:m},x,b,g,E)},e.tup(Ct,Kt,O,Zt,oe,wt,le,ie,Jt,de,V)),pe=(te=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"},ne=!1,function(){return ne||(ne=!0,ee=te()),ee}),he=["placeholder"],ge=["style","children"],ve=["style","children"];function Se(t){return t}var Ie=r(function(){var t=p(function(t){return"Item "+t}),e=p(null),n=p(function(t){return"Group "+t}),o=p({}),r=p(Se),i=p("div"),a=p(h),u=function(t,e){return void 0===e&&(e=null),S(l(o,s(function(e){return e[t]}),f()),e)};return{context:e,itemContent:t,groupContent:n,components:o,computeItemKey:r,headerFooterTag:i,scrollerRef:a,FooterComponent:u("Footer"),HeaderComponent:u("Header"),TopItemListComponent:u("TopItemList"),ListComponent:u("List","div"),ItemComponent:u("Item","div"),GroupComponent:u("Group","div"),ScrollerComponent:u("Scroller","div"),EmptyPlaceholder:u("EmptyPlaceholder"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder")}});function Ce(t,e){var n=i();return g(n,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+e,"color: red;","color: inherit;","color: blue;")}),u(n,t),n}var xe=r(function(t){var e=t[0],o=t[1],r={item:Ce(o.itemContent,"Rename the %citem%c prop to %citemContent."),group:Ce(o.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:Ce(e.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:Ce(e.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:Ce(e.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:i(),maxHeightCacheSize:i(),footer:i(),header:i(),HeaderContainer:i(),FooterContainer:i(),ItemContainer:i(),ScrollContainer:i(),GroupContainer:i(),ListContainer:i(),emptyComponent:i(),scrollSeek:i()};function a(t,e,n){u(l(t,I(o.components),s(function(t){var o,r=t[0],i=t[1];return console.warn("react-virtuoso: "+n+" property is deprecated. Pass components."+e+" instead."),H({},i,((o={})[e]=r,o))})),o.components)}return g(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;")}),g(r.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),g(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.")}),g(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.")}),g(r.scrollSeek,function(t){var r=t.placeholder,i=R(t,he);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),v(o.components,H({},n(o.components),{ScrollSeekPlaceholder:r})),v(e.scrollSeekConfiguration,i)}),a(r.footer,"Footer","footer"),a(r.header,"Header","header"),a(r.ItemContainer,"Item","ItemContainer"),a(r.ListContainer,"List","ListContainer"),a(r.ScrollContainer,"Scroller","ScrollContainer"),a(r.emptyComponent,"EmptyPlaceholder","emptyComponent"),a(r.GroupContainer,"Group","GroupContainer"),H({},e,o,r)},o(fe,Ie)),Te=function(t){return x.createElement("div",{style:{height:t.height}})},we={position:pe(),zIndex:1,overflowAnchor:"none"},ye=x.memo(function(t){var e=t.showTopList,n=void 0!==e&&e,o=Ae("listState"),r=Ae("deviation"),i=Ue("sizeRanges"),a=Ae("useWindowScroll"),l=Ae("customScrollParent"),s=Ue("windowScrollContainerState"),u=Ue("scrollContainerState"),c=l||a?s:u,m=Ae("itemContent"),d=Ae("context"),f=Ae("groupContent"),p=Ae("trackItemSizes"),g=Ae("itemSize"),v=Ae("log"),S=_t(i,g,p,n?h:c,v,l),I=Ae("EmptyPlaceholder"),C=Ae("ScrollSeekPlaceholder")||Te,x=Ae("ListComponent"),T=Ae("ItemComponent"),w=Ae("GroupComponent"),y=Ae("computeItemKey"),b=Ae("isSeeking"),R=Ae("groupIndices").length>0,L=Ae("paddingTopAddition"),k=Ae("firstItemIndex"),z=Ae("statefulTotalCount"),B=n?{}:{boxSizing:"border-box",paddingTop:o.offsetTop+L,paddingBottom:o.offsetBottom,marginTop:r};return!n&&0===z&&I?E(I,Re(I,d)):E(x,H({},Re(x,d),{ref:S,style:B,"data-test-id":n?"virtuoso-top-item-list":"virtuoso-item-list"}),(n?o.topItems:o.items).map(function(t){var e=t.originalIndex,n=y(e+k,t.data,d);return b?E(C,H({},Re(C,d),{key:n,index:t.index,height:t.size,type:t.type||"item"},"group"===t.type?{}:{groupIndex:t.groupIndex})):"group"===t.type?E(w,H({},Re(w,d),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,style:we}),f(t.index)):E(T,H({},Re(T,d),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,"data-item-group-index":t.groupIndex,style:{overflowAnchor:"none"}}),R?m(t.index,t.groupIndex,t.data,d):m(t.index,t.data,d))}))}),be={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Ee={width:"100%",height:"100%",position:"absolute",top:0},He={width:"100%",position:pe(),top:0};function Re(t,e){if("string"!=typeof t)return{context:e}}var Le=x.memo(function(){var t=Ae("HeaderComponent"),e=Ue("headerHeight"),n=Ae("headerFooterTag"),o=Nt(function(t){return e(ut(t,"height"))}),r=Ae("context");return t?E(n,{ref:o},E(t,Re(t,r))):null}),ke=x.memo(function(){var t=Ae("FooterComponent"),e=Ue("footerHeight"),n=Ae("headerFooterTag"),o=Nt(function(t){return e(ut(t,"height"))}),r=Ae("context");return t?E(n,{ref:o},E(t,Re(t,r))):null});function ze(t){var e=t.usePublisher,n=t.useEmitter,o=t.useEmitterValue;return x.memo(function(t){var r=t.style,i=t.children,a=R(t,ge),l=e("scrollContainerState"),s=o("ScrollerComponent"),u=e("smoothScrollTargetReached"),c=o("scrollerRef"),m=o("context"),d=jt(l,u,s,c),f=d.scrollerRef,p=d.scrollByCallback;return n("scrollTo",d.scrollToCallback),n("scrollBy",p),E(s,H({ref:f,style:H({},be,r),"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0},a,Re(s,m)),i)})}function Be(t){var e=t.usePublisher,n=t.useEmitter,o=t.useEmitterValue;return x.memo(function(t){var r=t.style,i=t.children,a=R(t,ve),l=e("windowScrollContainerState"),s=o("ScrollerComponent"),u=e("smoothScrollTargetReached"),c=o("totalListHeight"),m=o("deviation"),d=o("customScrollParent"),f=o("context"),p=jt(l,u,s,h,d),g=p.scrollerRef,v=p.scrollByCallback,S=p.scrollToCallback;return Gt(function(){return g.current=d||window,function(){g.current=null}},[g,d]),n("windowScrollTo",S),n("scrollBy",v),E(s,H({style:H({position:"relative"},r,0!==c?{height:c+m}:{}),"data-virtuoso-scroller":!0},a,Re(s,f)),i)})}var Fe=function(t){var e=t.children,n=Ue("viewportHeight"),o=Nt(C(n,function(t){return ut(t,"height")}));return x.createElement("div",{style:Ee,ref:o,"data-viewport-type":"element"},e)},Pe=function(t){var e=t.children,n=Dt(Ue("windowViewportRect"),Ae("customScrollParent"));return x.createElement("div",{ref:n,style:Ee,"data-viewport-type":"window"},e)},Oe=function(t){var e=t.children,n=Ae("TopItemListComponent"),o=Ae("headerHeight"),r=H({},He,{marginTop:o+"px"}),i=Ae("context");return E(n||"div",{style:r,context:i},e)},Me=t(xe,{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",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",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},x.memo(function(t){var e=Ae("useWindowScroll"),n=Ae("topItemsIndexes").length>0,o=Ae("customScrollParent"),r=o||e?Pe:Fe;return x.createElement(o||e?De:Ne,H({},t),x.createElement(r,null,x.createElement(Le,null),x.createElement(ye,null),x.createElement(ke,null)),n&&x.createElement(Oe,null,x.createElement(ye,{showTopList:!0})))})),Ve=Me.Component,Ue=Me.usePublisher,Ae=Me.useEmitterValue,We=Me.useEmitter,Ne=ze({usePublisher:Ue,useEmitterValue:Ae,useEmitter:We}),De=Be({usePublisher:Ue,useEmitterValue:Ae,useEmitter:We}),Ge=["placeholder"],_e=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(Se),l=e.statefulStream(e.noop),s=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,scrollerRef:l,ListComponent:s("List","div"),ItemComponent:s("Item","div"),ScrollerComponent:s("Scroller","div"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),je=e.system(function(t){var n=t[0],o=t[1],r={item:Ce(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."),H({},i,((e={})[n]=o,e))})),o.components)}return e.subscribe(r.scrollSeek,function(t){var r=t.placeholder,i=R(t,Ge);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),e.publish(o.components,H({},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"),H({},n,o,r)},e.tup(Mt,_e)),Ke=x.memo(function(){var t=Qe("gridState"),e=Qe("listClassName"),n=Qe("itemClassName"),o=Qe("itemContent"),r=Qe("computeItemKey"),i=Qe("isSeeking"),a=$e("scrollHeight"),l=Qe("ItemComponent"),s=Qe("ListComponent"),u=Qe("ScrollSeekPlaceholder"),c=Qe("context"),m=$e("itemDimensions"),d=Nt(function(t){a(t.parentElement.parentElement.scrollHeight);var e=t.firstChild;e&&m(e.getBoundingClientRect())});return E(s,H({ref:d,className:e},Re(s,c),{style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom}}),t.items.map(function(e){var a=r(e.index);return i?E(u,H({key:a},Re(u,c),{index:e.index,height:t.itemHeight,width:t.itemWidth})):E(l,H({},Re(l,c),{className:n,"data-index":e.index,key:a}),o(e.index,c))}))}),Ye=function(t){var e=t.children,n=$e("viewportDimensions"),o=Nt(function(t){n(t.getBoundingClientRect())});return x.createElement("div",{style:Ee,ref:o},e)},Ze=function(t){var e=t.children,n=Dt($e("windowViewportRect"),Qe("customScrollParent"));return x.createElement("div",{ref:n,style:Ee},e)},qe=t(je,{optional:{totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},x.memo(function(t){var e=H({},t),n=Qe("useWindowScroll"),o=Qe("customScrollParent"),r=o||n?Ze:Ye;return x.createElement(o||n?en:tn,H({},e),x.createElement(r,null,x.createElement(Ke,null)))})),Je=qe.Component,$e=qe.usePublisher,Qe=qe.useEmitterValue,Xe=qe.useEmitter,tn=ze({usePublisher:$e,useEmitterValue:Qe,useEmitter:Xe}),en=Be({usePublisher:$e,useEmitterValue:Qe,useEmitter:Xe}),nn=r(function(){var t=p(function(t){return x.createElement("td",null,"Item $",t)}),e=p(null),n=p(null),o=p({}),r=p(Se),i=p(h),a=function(t,e){return void 0===e&&(e=null),S(l(o,s(function(e){return e[t]}),f()),e)};return{context:e,itemContent:t,fixedHeaderContent:n,components:o,computeItemKey:r,scrollerRef:i,TableComponent:a("Table","table"),TableHeadComponent:a("TableHead","thead"),TableBodyComponent:a("TableBody","tbody"),TableRowComponent:a("TableRow","tr"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}}),on=r(function(t){return H({},t[0],t[1])},o(fe,nn)),rn=function(t){return x.createElement("tr",null,x.createElement("td",{style:{height:t.height}}))},an=function(t){return x.createElement("tr",null,x.createElement("td",{style:{height:t.height,padding:0,border:0}}))},ln=x.memo(function(){var t=fn("listState"),e=fn("deviation"),n=dn("sizeRanges"),o=fn("useWindowScroll"),r=fn("customScrollParent"),i=dn("windowScrollContainerState"),a=dn("scrollContainerState"),l=r||o?i:a,s=fn("itemContent"),u=fn("trackItemSizes"),c=_t(n,fn("itemSize"),u,l,fn("log"),r),m=fn("EmptyPlaceholder"),d=fn("ScrollSeekPlaceholder")||rn,f=fn("TableBodyComponent"),p=fn("TableRowComponent"),h=fn("computeItemKey"),g=fn("isSeeking"),v=fn("paddingTopAddition"),S=fn("firstItemIndex"),I=fn("statefulTotalCount"),C=fn("context");if(0===I&&m)return E(m,Re(m,C));var T=t.offsetTop+v+e,w=t.offsetBottom,y=T>0?x.createElement(an,{height:T,key:"padding-top"}):null,b=w>0?x.createElement(an,{height:w,key:"padding-bottom"}):null,R=t.items.map(function(t){var e=t.originalIndex,n=h(e+S,t.data,C);return g?E(d,H({},Re(d,C),{key:n,index:t.index,height:t.size,type:t.type||"item"})):E(p,H({},Re(p,C),{key:n,"data-index":e,"data-known-size":t.size,"data-item-index":t.index,style:{overflowAnchor:"none"}}),s(t.index,t.data,C))});return E(f,H({ref:c,"data-test-id":"virtuoso-item-list"},Re(f,C)),[y].concat(R,[b]))}),sn=function(t){var e=t.children,n=dn("viewportHeight"),o=Nt(C(n,function(t){return ut(t,"height")}));return x.createElement("div",{style:Ee,ref:o,"data-viewport-type":"element"},e)},un=function(t){var e=t.children,n=Dt(dn("windowViewportRect"),fn("customScrollParent"));return x.createElement("div",{ref:n,style:Ee,"data-viewport-type":"window"},e)},cn=t(on,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",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"},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"}},x.memo(function(t){var e=fn("useWindowScroll"),n=fn("customScrollParent"),o=dn("fixedHeaderHeight"),r=fn("fixedHeaderContent"),i=fn("context"),a=Nt(C(o,function(t){return ut(t,"height")})),l=n||e?gn:hn,s=n||e?un:sn,u=fn("TableComponent"),c=fn("TableHeadComponent"),m=r?x.createElement(c,H({key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:a},Re(c,i)),r()):null;return x.createElement(l,H({},t),x.createElement(s,null,x.createElement(u,H({style:{borderSpacing:0}},Re(u,i)),[m,x.createElement(ln,{key:"TableBody"})])))})),mn=cn.Component,dn=cn.usePublisher,fn=cn.useEmitterValue,pn=cn.useEmitter,hn=ze({usePublisher:dn,useEmitterValue:fn,useEmitter:pn}),gn=Be({usePublisher:dn,useEmitterValue:fn,useEmitter:pn}),vn=Ve,Sn=Ve,In=mn,Cn=Je;export{Sn as GroupedVirtuoso,P as LogLevel,In as TableVirtuoso,vn as Virtuoso,Cn as VirtuosoGrid};
|
|
2
2
|
//# sourceMappingURL=index.m.js.map
|