react-virtuoso
Advanced tools
Comparing version 0.11.0 to 0.11.1
@@ -17,4 +17,5 @@ import { VirtuosoProps, VirtuosoState, TItemContainer } from './Virtuoso'; | ||
scrollToIndex(location: TScrollLocation): void; | ||
componentWillUnmount(): void; | ||
render(): JSX.Element; | ||
} | ||
export {}; |
@@ -1,391 +0,8 @@ | ||
// modules are defined as an array | ||
// [ module function, map of requires ] | ||
// | ||
// map of requires is short require name -> numeric require | ||
// | ||
// anything defined in a previous bundle is accessed via the | ||
// orig method which is the require for previous bundles | ||
parcelRequire = (function (modules, cache, entry, globalName) { | ||
// Save the require from previous bundle to this closure if any | ||
var previousRequire = typeof parcelRequire === 'function' && parcelRequire; | ||
var nodeRequire = typeof require === 'function' && require; | ||
function newRequire(name, jumped) { | ||
if (!cache[name]) { | ||
if (!modules[name]) { | ||
// if we cannot find the module within our internal map or | ||
// cache jump to the current global require ie. the last bundle | ||
// that was added to the page. | ||
var currentRequire = typeof parcelRequire === 'function' && parcelRequire; | ||
if (!jumped && currentRequire) { | ||
return currentRequire(name, true); | ||
} | ||
'use strict' | ||
// If there are other bundles on this page the require from the | ||
// previous one is saved to 'previousRequire'. Repeat this as | ||
// many times as there are bundles until the module is found or | ||
// we exhaust the require chain. | ||
if (previousRequire) { | ||
return previousRequire(name, true); | ||
} | ||
// Try the node require function if it exists. | ||
if (nodeRequire && typeof name === 'string') { | ||
return nodeRequire(name); | ||
} | ||
var err = new Error('Cannot find module \'' + name + '\''); | ||
err.code = 'MODULE_NOT_FOUND'; | ||
throw err; | ||
} | ||
localRequire.resolve = resolve; | ||
localRequire.cache = {}; | ||
var module = cache[name] = new newRequire.Module(name); | ||
modules[name][0].call(module.exports, localRequire, module, module.exports, this); | ||
} | ||
return cache[name].exports; | ||
function localRequire(x){ | ||
return newRequire(localRequire.resolve(x)); | ||
} | ||
function resolve(x){ | ||
return modules[name][1][x] || x; | ||
} | ||
} | ||
function Module(moduleName) { | ||
this.id = moduleName; | ||
this.bundle = newRequire; | ||
this.exports = {}; | ||
} | ||
newRequire.isParcelRequire = true; | ||
newRequire.Module = Module; | ||
newRequire.modules = modules; | ||
newRequire.cache = cache; | ||
newRequire.parent = previousRequire; | ||
newRequire.register = function (id, exports) { | ||
modules[id] = [function (require, module) { | ||
module.exports = exports; | ||
}, {}]; | ||
}; | ||
var error; | ||
for (var i = 0; i < entry.length; i++) { | ||
try { | ||
newRequire(entry[i]); | ||
} catch (e) { | ||
// Save first error but execute all entries | ||
if (!error) { | ||
error = e; | ||
} | ||
} | ||
} | ||
if (entry.length) { | ||
// Expose entry point to Node, AMD or browser globals | ||
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js | ||
var mainExports = newRequire(entry[entry.length - 1]); | ||
// CommonJS | ||
if (typeof exports === "object" && typeof module !== "undefined") { | ||
module.exports = mainExports; | ||
// RequireJS | ||
} else if (typeof define === "function" && define.amd) { | ||
define(function () { | ||
return mainExports; | ||
}); | ||
// <script> | ||
} else if (globalName) { | ||
this[globalName] = mainExports; | ||
} | ||
} | ||
// Override the current require with this new one | ||
parcelRequire = newRequire; | ||
if (error) { | ||
// throw error from earlier, _after updating parcelRequire_ | ||
throw error; | ||
} | ||
return newRequire; | ||
})({"../node_modules/parcel/src/builtins/bundle-url.js":[function(require,module,exports) { | ||
var bundleURL = null; | ||
function getBundleURLCached() { | ||
if (!bundleURL) { | ||
bundleURL = getBundleURL(); | ||
} | ||
return bundleURL; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./react-virtuoso.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./react-virtuoso.cjs.development.js') | ||
} | ||
function getBundleURL() { | ||
// Attempt to find the URL of the current script and use that as the base URL | ||
try { | ||
throw new Error(); | ||
} catch (err) { | ||
var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g); | ||
if (matches) { | ||
return getBaseURL(matches[0]); | ||
} | ||
} | ||
return '/'; | ||
} | ||
function getBaseURL(url) { | ||
return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^/]+$/, '$1') + '/'; | ||
} | ||
exports.getBundleURL = getBundleURLCached; | ||
exports.getBaseURL = getBaseURL; | ||
},{}],"../node_modules/parcel/src/builtins/css-loader.js":[function(require,module,exports) { | ||
var bundle = require('./bundle-url'); | ||
function updateLink(link) { | ||
var newLink = link.cloneNode(); | ||
newLink.onload = function () { | ||
link.remove(); | ||
}; | ||
newLink.href = link.href.split('?')[0] + '?' + Date.now(); | ||
link.parentNode.insertBefore(newLink, link.nextSibling); | ||
} | ||
var cssTimeout = null; | ||
function reloadCSS() { | ||
if (cssTimeout) { | ||
return; | ||
} | ||
cssTimeout = setTimeout(function () { | ||
var links = document.querySelectorAll('link[rel="stylesheet"]'); | ||
for (var i = 0; i < links.length; i++) { | ||
if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) { | ||
updateLink(links[i]); | ||
} | ||
} | ||
cssTimeout = null; | ||
}, 50); | ||
} | ||
module.exports = reloadCSS; | ||
},{"./bundle-url":"../node_modules/parcel/src/builtins/bundle-url.js"}],"../node_modules/parcel/src/builtins/hmr-runtime.js":[function(require,module,exports) { | ||
var global = arguments[3]; | ||
var OVERLAY_ID = '__parcel__error__overlay__'; | ||
var OldModule = module.bundle.Module; | ||
function Module(moduleName) { | ||
OldModule.call(this, moduleName); | ||
this.hot = { | ||
data: module.bundle.hotData, | ||
_acceptCallbacks: [], | ||
_disposeCallbacks: [], | ||
accept: function (fn) { | ||
this._acceptCallbacks.push(fn || function () {}); | ||
}, | ||
dispose: function (fn) { | ||
this._disposeCallbacks.push(fn); | ||
} | ||
}; | ||
module.bundle.hotData = null; | ||
} | ||
module.bundle.Module = Module; | ||
var checkedAssets, assetsToAccept; | ||
var parent = module.bundle.parent; | ||
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') { | ||
var hostname = "" || location.hostname; | ||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws'; | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "59249" + '/'); | ||
ws.onmessage = function (event) { | ||
checkedAssets = {}; | ||
assetsToAccept = []; | ||
var data = JSON.parse(event.data); | ||
if (data.type === 'update') { | ||
var handled = false; | ||
data.assets.forEach(function (asset) { | ||
if (!asset.isNew) { | ||
var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id); | ||
if (didAccept) { | ||
handled = true; | ||
} | ||
} | ||
}); // Enable HMR for CSS by default. | ||
handled = handled || data.assets.every(function (asset) { | ||
return asset.type === 'css' && asset.generated.js; | ||
}); | ||
if (handled) { | ||
console.clear(); | ||
data.assets.forEach(function (asset) { | ||
hmrApply(global.parcelRequire, asset); | ||
}); | ||
assetsToAccept.forEach(function (v) { | ||
hmrAcceptRun(v[0], v[1]); | ||
}); | ||
} else { | ||
window.location.reload(); | ||
} | ||
} | ||
if (data.type === 'reload') { | ||
ws.close(); | ||
ws.onclose = function () { | ||
location.reload(); | ||
}; | ||
} | ||
if (data.type === 'error-resolved') { | ||
console.log('[parcel] ✨ Error resolved'); | ||
removeErrorOverlay(); | ||
} | ||
if (data.type === 'error') { | ||
console.error('[parcel] 🚨 ' + data.error.message + '\n' + data.error.stack); | ||
removeErrorOverlay(); | ||
var overlay = createErrorOverlay(data); | ||
document.body.appendChild(overlay); | ||
} | ||
}; | ||
} | ||
function removeErrorOverlay() { | ||
var overlay = document.getElementById(OVERLAY_ID); | ||
if (overlay) { | ||
overlay.remove(); | ||
} | ||
} | ||
function createErrorOverlay(data) { | ||
var overlay = document.createElement('div'); | ||
overlay.id = OVERLAY_ID; // html encode message and stack trace | ||
var message = document.createElement('div'); | ||
var stackTrace = document.createElement('pre'); | ||
message.innerText = data.error.message; | ||
stackTrace.innerText = data.error.stack; | ||
overlay.innerHTML = '<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;">' + '<span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span>' + '<span style="top: 2px; margin-left: 5px; position: relative;">🚨</span>' + '<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">' + message.innerHTML + '</div>' + '<pre>' + stackTrace.innerHTML + '</pre>' + '</div>'; | ||
return overlay; | ||
} | ||
function getParents(bundle, id) { | ||
var modules = bundle.modules; | ||
if (!modules) { | ||
return []; | ||
} | ||
var parents = []; | ||
var k, d, dep; | ||
for (k in modules) { | ||
for (d in modules[k][1]) { | ||
dep = modules[k][1][d]; | ||
if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) { | ||
parents.push(k); | ||
} | ||
} | ||
} | ||
if (bundle.parent) { | ||
parents = parents.concat(getParents(bundle.parent, id)); | ||
} | ||
return parents; | ||
} | ||
function hmrApply(bundle, asset) { | ||
var modules = bundle.modules; | ||
if (!modules) { | ||
return; | ||
} | ||
if (modules[asset.id] || !bundle.parent) { | ||
var fn = new Function('require', 'module', 'exports', asset.generated.js); | ||
asset.isNew = !modules[asset.id]; | ||
modules[asset.id] = [fn, asset.deps]; | ||
} else if (bundle.parent) { | ||
hmrApply(bundle.parent, asset); | ||
} | ||
} | ||
function hmrAcceptCheck(bundle, id) { | ||
var modules = bundle.modules; | ||
if (!modules) { | ||
return; | ||
} | ||
if (!modules[id] && bundle.parent) { | ||
return hmrAcceptCheck(bundle.parent, id); | ||
} | ||
if (checkedAssets[id]) { | ||
return; | ||
} | ||
checkedAssets[id] = true; | ||
var cached = bundle.cache[id]; | ||
assetsToAccept.push([bundle, id]); | ||
if (cached && cached.hot && cached.hot._acceptCallbacks.length) { | ||
return true; | ||
} | ||
return getParents(global.parcelRequire, id).some(function (id) { | ||
return hmrAcceptCheck(global.parcelRequire, id); | ||
}); | ||
} | ||
function hmrAcceptRun(bundle, id) { | ||
var cached = bundle.cache[id]; | ||
bundle.hotData = {}; | ||
if (cached) { | ||
cached.hot.data = bundle.hotData; | ||
} | ||
if (cached && cached.hot && cached.hot._disposeCallbacks.length) { | ||
cached.hot._disposeCallbacks.forEach(function (cb) { | ||
cb(bundle.hotData); | ||
}); | ||
} | ||
delete bundle.cache[id]; | ||
bundle(id); | ||
cached = bundle.cache[id]; | ||
if (cached && cached.hot && cached.hot._acceptCallbacks.length) { | ||
cached.hot._acceptCallbacks.forEach(function (cb) { | ||
cb(); | ||
}); | ||
return true; | ||
} | ||
} | ||
},{}]},{},["../node_modules/parcel/src/builtins/hmr-runtime.js"], null) | ||
//# sourceMappingURL=/index.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=e(require("resize-observer-polyfill"));function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t,n){return(a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}var f=t.createContext(void 0);function c(e){return function(){var t=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e,t){return t(e)}:1===t.length?t[0]:function(e,n){var r=function(e){return n(e)};t.slice().reverse().forEach(function(e){var t=r;r=function(n){return e(n,t)}}),r(e)}}.apply(void 0,arguments);return function(e,t){var n=function(n){return e(function(e){return t(e,n)})};return{subscribe:n,pipe:c(n)}}(e,t)}}function h(e,t){void 0===t&&(t=!0);var n=[],r=e,i=function(e){return n.push(e),void 0!==r&&e(r),function(){n=n.filter(function(t){return t!==e})}};return{next:function(e){t&&e===r||(r=e,n.forEach(function(t){return t(e)}))},subscribe:i,pipe:c(i),subscribers:n}}function v(){var e=[],t=function(t){return e.push(t),function(){e=e.filter(function(e){return e!==t})}};return{next:function(t){e.forEach(function(e){return e(t)})},subscribe:t,pipe:c(t)}}function p(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array(t.length).fill(!1),i=Array(t.length),o=[],s=function(e){r.every(function(e){return e})&&e.forEach(function(e){return e(i)})};t.forEach(function(e,t){e.subscribe(function(e){r[t]=!0,i[t]=e,s(o)})});var u=function(e){return o.push(e),s([e]),function(){o=o.filter(function(t){return t!==e})}};return{subscribe:u,pipe:c(u)}}function d(e){return function(t,n){n(e(t))}}function g(e){return function(t,n){return n(e)}}function m(e){return function(t,n){e>0?e--:n(t)}}function y(e){return function(t,n){e(t)&&n(t)}}function x(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array(t.length).fill(!1),i=Array(t.length);return t.forEach(function(e,t){e.subscribe(function(e){i[t]=e,r[t]=!0})}),function(e,t){r.every(function(e){return e})&&t([e].concat(i))}}var b=new(function(){function e(){this.level=0}var t=e.prototype;return t.rebalance=function(){return this},t.adjust=function(){return this},t.remove=function(){return this},t.find=function(){},t.findWith=function(){},t.findMax=function(){return-Infinity},t.findMaxValue=function(){},t.insert=function(e,t){return new C({key:e,value:t,level:1})},t.walkWithin=function(){return[]},t.walk=function(){return[]},t.ranges=function(){return[]},t.rangesWithin=function(){return[]},t.empty=function(){return!0},t.isSingle=function(){return!0},t.isInvariant=function(){return!0},t.keys=function(){return[]},e}());Object.freeze(b);var k=function(e){function t(t){return e.call(this,"Unreachable case: "+t)||this}return o(t,e),t}(l(Error)),C=function(){function e(e){var t=e.value,n=e.level,r=e.left,i=void 0===r?b:r,o=e.right,s=void 0===o?b:o;this.key=e.key,this.value=t,this.level=n,this.left=i,this.right=s}var t=e.prototype;return t.remove=function(e){var t=this.left,n=this.right;if(e===this.key){if(t.empty())return n;if(n.empty())return t;var r=t.last();return this.clone({key:r[0],value:r[1],left:t.deleteLast()}).adjust()}return e<this.key?this.clone({left:t.remove(e)}).adjust():this.clone({right:n.remove(e)}).adjust()},t.empty=function(){return!1},t.find=function(e){return e===this.key?this.value:e<this.key?this.left.find(e):this.right.find(e)},t.findWith=function(e){var t=e(this.value);switch(t){case-1:return this.left.findWith(e);case 0:return[this.key,this.value];case 1:return this.right.findWith(e);default:throw new k(t)}},t.findMax=function(e){if(this.key===e)return e;if(this.key<e){var t=this.right.findMax(e);return-Infinity===t?this.key:t}return this.left.findMax(e)},t.findMaxValue=function(e){if(this.key===e)return this.value;if(this.key<e){var t=this.right.findMaxValue(e);return void 0===t?this.value:t}return this.left.findMaxValue(e)},t.insert=function(e,t){return e===this.key?this.clone({key:e,value:t}):e<this.key?this.clone({left:this.left.insert(e,t)}).rebalance():this.clone({right:this.right.insert(e,t)}).rebalance()},t.walkWithin=function(e,t){var n=this.key,r=this.value,i=[];return n>e&&(i=i.concat(this.left.walkWithin(e,t))),n>=e&&n<=t&&i.push({key:n,value:r}),n<=t&&(i=i.concat(this.right.walkWithin(e,t))),i},t.walk=function(){return[].concat(this.left.walk(),[{key:this.key,value:this.value}],this.right.walk())},t.last=function(){return this.right.empty()?[this.key,this.value]:this.right.last()},t.deleteLast=function(){return this.right.empty()?this.left:this.clone({right:this.right.deleteLast()}).adjust()},t.clone=function(t){return new e({key:void 0!==t.key?t.key:this.key,value:void 0!==t.value?t.value:this.value,level:void 0!==t.level?t.level:this.level,left:void 0!==t.left?t.left:this.left,right:void 0!==t.right?t.right:this.right})},t.isSingle=function(){return this.level>this.right.level},t.rebalance=function(){return this.skew().split()},t.adjust=function(){var e=this.left,t=this.right,n=this.level;if(t.level>=n-1&&e.level>=n-1)return this;if(n>t.level+1){if(e.isSingle())return this.clone({level:n-1}).skew();if(e.empty()||e.right.empty())throw new Error("Unexpected empty nodes");return e.right.clone({left:e.clone({right:e.right.left}),right:this.clone({left:e.right.right,level:n-1}),level:n})}if(this.isSingle())return this.clone({level:n-1}).split();if(t.empty()||t.left.empty())throw new Error("Unexpected empty nodes");var r=t.left,i=r.isSingle()?t.level-1:t.level;return r.clone({left:this.clone({right:r.left,level:n-1}),right:t.clone({left:r.right,level:i}).split(),level:r.level+1})},t.isInvariant=function(){var e=this.left,t=this.right,n=this.level;return n===e.level+1&&(n===t.level||n===t.level+1)&&!(!t.empty()&&n<=t.right.level)&&e.isInvariant()&&t.isInvariant()},t.keys=function(){return[].concat(this.left.keys(),[this.key],this.right.keys())},t.ranges=function(){return this.toRanges(this.walk())},t.rangesWithin=function(e,t){return this.toRanges(this.walkWithin(e,t))},t.toRanges=function(e){if(0===e.length)return[];for(var t=e[0],n=t.key,r=t.value,i=[],o=1;o<=e.length;o++){var s=e[o];i.push({start:n,end:s?s.key-1:Infinity,value:r}),s&&(n=s.key,r=s.value)}return i},t.split=function(){var e=this.right,t=this.level;return e.empty()||e.right.empty()||e.level!=t||e.right.level!=t?this:e.clone({left:this.clone({right:e.left}),level:t+1})},t.skew=function(){var e=this.left;return e.empty()||e.level!==this.level?this:e.clone({right:this.clone({left:e.right})})},e}(),w=function(){function e(e){this.root=e}e.empty=function(){return new e(b)};var t=e.prototype;return t.find=function(e){return this.root.find(e)},t.findMax=function(e){return this.root.findMax(e)},t.findMaxValue=function(e){if(this.empty())throw new Error("Searching for max value in an empty tree");return this.root.findMaxValue(e)},t.findWith=function(e){return this.root.findWith(e)},t.insert=function(t,n){return new e(this.root.insert(t,n))},t.remove=function(t){return new e(this.root.remove(t))},t.empty=function(){return this.root.empty()},t.keys=function(){return this.root.keys()},t.walk=function(){return this.root.walk()},t.walkWithin=function(e,t){var n=this.root.findMax(e);return this.root.walkWithin(n,t)},t.ranges=function(){return this.root.ranges()},t.rangesWithin=function(e,t){var n=this.root.findMax(e);return this.root.rangesWithin(n,t)},t.isInvariant=function(){return this.root.isInvariant()},e}(),I=function(){function e(e){this.nanIndices=[],this.rangeTree=e;var t=w.empty(),n=0,r=!1,i=e.ranges(),o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{if((s=i.next()).done)break;u=s.value}var a=u.start,l=u.end,f=u.value;isNaN(f)?(this.nanIndices.push(a),r||(t=t.insert(n,{startIndex:a,endIndex:Infinity,size:f})),r=!0):r||(t=t.insert(n,{startIndex:a,endIndex:l,size:f}),n+=(l-a+1)*f)}this.offsetTree=t}e.create=function(){return new e(w.empty())};var t=e.prototype;return t.empty=function(){return this.rangeTree.empty()},t.insert=function(t,n,r){var i=this.rangeTree;if(i.empty())return new e(i.insert(0,r));if(this.nanIndices.length&&this.nanIndices.indexOf(n)>-1){if(i.find(this.nanIndices[0]-1)===r)return new e(w.empty().insert(0,r));var o=this.nanIndices,s=Array.isArray(o),u=0;for(o=s?o:o[Symbol.iterator]();;){var a;if(s){if(u>=o.length)break;a=o[u++]}else{if((u=o.next()).done)break;a=u.value}i=i.insert(a,r)}return new e(i)}var l=i.rangesWithin(t-1,n+1);if(l.some(function(e){return e.start===t&&(e.end===n||Infinity===e.end)&&e.value===r}))return this;var f=!1,c=!1,h=l,v=Array.isArray(h),p=0;for(h=v?h:h[Symbol.iterator]();;){var d;if(v){if(p>=h.length)break;d=h[p++]}else{if((p=h.next()).done)break;d=p.value}var g=d.start,m=d.end,y=d.value;f?(n>=g||r===y)&&(i=i.remove(g)):(c=y!==r,f=!0),m>n&&n>=g&&(y===r||isNaN(y)||(i=i.insert(n+1,y)))}return c&&(i=i.insert(t,r)),i===this.rangeTree?this:new e(i)},t.insertSpots=function(t,n){if(this.empty()){var r=this.rangeTree,i=t,o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{if((s=i.next()).done)break;u=s.value}var a=u;r=r.insert(a,n).insert(a+1,NaN)}return new e(r)}throw new Error("attempting to overwrite non-empty tree")},t.offsetOf=function(e){if(this.offsetTree.empty())return 0;var t=this.offsetTree.findWith(function(t){return t.startIndex>e?-1:t.endIndex<e?1:0});if(t){var n=t[1];return t[0]+(e-n.startIndex)*n.size}throw new Error("Requested offset outside of the known ones, index: "+e)},t.itemAt=function(e){return{index:e,size:this.rangeTree.findMaxValue(e),offset:NaN}},t.indexRange=function(e,t){if(0===t)return[];if(this.rangeTree.empty())return[{index:0,size:0,offset:NaN}];var n=[],r=this.rangeTree.rangesWithin(e,t),i=Array.isArray(r),o=0;for(r=i?r:r[Symbol.iterator]();;){var s;if(i){if(o>=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}for(var u=s,a=Math.max(e,u.start),l=Math.min(t,void 0===u.end?Infinity:u.end),f=a;f<=l;f++)n.push({index:f,size:u.value,offset:NaN})}return n},t.range=function(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=Infinity),this.offsetTree.empty())return[{index:0,size:0,offset:0}];var i=[],o=this.offsetTree.rangesWithin(e,t),s=Array.isArray(o),u=0;for(o=s?o:o[Symbol.iterator]();;){var a;if(s){if(u>=o.length)break;a=o[u++]}else{if((u=o.next()).done)break;a=u.value}var l=a.start,f=a.value,c=f.startIndex,h=f.endIndex,v=f.size,p=l,d=c;if(l<e&&(p+=((d+=Math.floor((e-l)/v))-c)*v),d<n&&(p+=(n-d)*v,d=n),isNaN(v))return i.push({index:d,size:0,offset:p}),i;h=Math.min(h,r);for(var g=d;g<=h&&!(p>t);g++)i.push({index:g,size:v,offset:p}),p+=v}return i},t.total=function(e){var t=0,n=this.rangeTree.rangesWithin(0,e),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var s=o.start,u=o.end,a=o.value;t+=((u=Math.min(u,e))-s+1)*(isNaN(a)?0:a)}return t},t.getOffsets=function(e){var t=this,n=w.empty();return e.forEach(function(e){var r=t.offsetOf(e);n=n.insert(r,e)}),new E(n)},e}(),E=function(){function e(e){this.tree=e}var t=e.prototype;return t.findMaxValue=function(e){return this.tree.findMaxValue(e)},t.empty=function(){return this.tree.empty()},e}(),S=function(){function e(){}return e.prototype.transpose=function(e){return e.map(function(e){return{groupIndex:0,index:e.index,offset:e.offset,size:e.size,transposedIndex:e.index,type:"item"}})},e}(),T=function(){function e(e){this.count=e.reduce(function(e,t){return e+t+1},0);var t=w.empty(),n=0,r=0,i=e,o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{if((s=i.next()).done)break;u=s.value}var a=u;t=t.insert(r,[n,r]),n++,r+=a+1}this.tree=t}var t=e.prototype;return t.totalCount=function(){return this.count},t.transpose=function(e){var t=this;return e.map(function(e){var n=t.tree.find(e.index);if(n)return{groupIndex:n[0],index:e.index,offset:e.offset,size:e.size,type:"group"};var r=t.tree.findMaxValue(e.index)[0];return{groupIndex:r,index:e.index,offset:e.offset,size:e.size,transposedIndex:e.index-r-1,type:"item"}})},t.groupIndices=function(){return this.tree.keys()},e}();function M(e){var t;return function(n){t&&t(),n&&(t=e.subscribe(n))}}function N(e){return e.next}var R=function(e){var t,n,r=h(!1);return e.pipe(m(1),g(!0)).subscribe(r.next),e.pipe(m(1),g(!1),function(e,r){t=e,n&&clearTimeout(n),n=setTimeout(function(){r(t)},200)}).subscribe(r.next),r},O=function(e){return e.length>0?e[0].offset:0},z=function(e){return e[0].total(e[1]-1)},A=function(e){var t=e.overscan,n=void 0===t?0:t,r=e.totalCount,i=void 0===r?0:r,o=e.itemHeight,s=h(0),u=h(0),a=h(0),l=h(0),f=h(),c=h(i),g=h(),m=h(),b=I.create(),k=!1,C=h([]),w=h(),E=v();o&&(b=b.insert(0,0,o));var A=h(b);o||f.pipe(x(A,C)).subscribe(function(e){var t=e[0],n=e[1],r=e[2],i=k?I.create():n;k&&(i=I.create(),k=!1);var o=t,s=Array.isArray(o),u=0;for(o=s?o:o[Symbol.iterator]();;){var a;if(s){if(u>=o.length)break;a=o[u++]}else{if((u=o.next()).done)break;a=u.value}var l=a.start,f=a.end,c=a.size;i=i.empty()&&l==f&&r.indexOf(l)>-1?i.insertSpots(r,c):i.insert(l,f,c)}i!==n&&A.next(i)});var j=new S;g.subscribe(function(e){j=new T(e),c.next(j.totalCount()),C.next(j.groupIndices())});var H=p(A,c).pipe(d(z)),W=p(H,l).pipe(d(function(e){return e[0]+e[1]})),L=p(A,C).pipe(d(function(e){return e[0].getOffsets(e[1])})),V=h([]);p(A,m,c).pipe(y(function(e){return e[1]>0}),d(function(e){var t=e[0],n=Math.max(0,Math.min(e[1]-1,e[2]));return j.transpose(t.indexRange(0,n))})).subscribe(V.next),p(A,L,a).pipe(y(function(e){return!e[1].empty()&&!e[0].empty()}),x(V),d(function(e){var t=e[0],n=t[0],r=e[1],i=t[1].findMaxValue(Math.max(t[2],0));if(1===r.length&&r[0].index===i)return r;var o=n.itemAt(i);return j.transpose([o])})).subscribe(V.next);var F,P,_=V.pipe(d(function(e){return e.reduce(function(e,t){return e+t.size},0)})),D=V.pipe(d(function(e){return e.length&&e[e.length-1].index+1})),q=p(s,a,_,u,l,D,c,A).pipe((F=function(e){return function(t,n){var r=n[0],i=n[1],o=n[2],s=n[3],u=n[4],a=n[5],l=n[6],f=n[7],c=t.length;if(0===l)return[];var h=O(t),v=h-i+s-u-o,p=Math.max(l-1,0);if(v<r||c>0&&(t[0].index<a||t[c-1].index>p)){var d=Math.max(i+o,o);return j.transpose(f.range(d,i+r+2*e-1,a,p))}if(h>i+o){var g=Math.max(i+o-2*e,o);return j.transpose(f.range(g,i+r-1,a,p))}return t}}(n),P=[],function(e,t){t(P=F(P,e))})),G=v(),U=0;q.pipe(d(function(e){return e.length?e[e.length-1].index:0})).pipe(x(c)).subscribe(function(e){var t=e[0],n=e[1];0!==n&&t===n-1&&U!==t&&(U=t,G.next(t))});var K=p(q,a,_).pipe(d(function(e){return O(e[0])})),Y=E.pipe(x(A,_,C,s,c),d(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];"number"==typeof t&&(t={index:t,align:"start"});var s=t.index,u=t.align,a=void 0===u?"start":u;s=Math.max(0,s,Math.min(e[5]-1,s));var l=n.offsetOf(s);return"end"==a?l=l-o+n.itemAt(s).size:"center"===a?l=Math.round(l-o/2+n.itemAt(s).size/2):-1===i.indexOf(s)&&(l-=r),l})),B=w.subscribe(function(e){f.next([{start:0,end:0,size:30}]),s.next(30*e),k=!0,B()}),J=C.pipe(),Q=K.pipe(d(function(e){return-e})),X=R(a);return{groupCounts:N(g),itemHeights:N(f),footerHeight:N(l),listHeight:N(u),viewportHeight:N(s),scrollTop:N(a),topItemCount:N(m),totalCount:N(c),scrollToIndex:N(E),initialItemCount:N(w),list:M(q),topList:M(V),listOffset:M(K),totalHeight:M(W),endReached:M(G),isScrolling:M(X),stickyItems:M(C),groupIndices:M(J),stickyItemsOffset:M(Q),scrollTo:M(Y)}},j=function(e,n,i){var o=t.useRef(null),s=t.useRef(0),u=t.useRef(0),a=new r(function(t){var n=t[0].contentRect.height;s.current!==n&&(s.current=n,i&&(u.current=window.requestAnimationFrame(function(){return i(t[0].target)})),e(n))});return t.useEffect(function(){return function(){return window.cancelAnimationFrame(u.current)}},[]),function(e){e?(a.observe(e),n&&n(e),o.current=e):(a.unobserve(o.current),o.current=null)}};function H(e,n){var r=t.useState(function(e,t){return function(){var n=t;return e(function(e){n=e}),n}}(e,n)),i=r[0],o=r[1];return t.useLayoutEffect(function(){return e(o),function(){return e(void 0)}},[]),i}var W={height:"40rem",overflowY:"auto",WebkitOverflowScrolling:"touch",position:"relative",outline:"none"},L=function(e){var r=e.className,i=e.style,o=e.reportScrollTop,s=e.scrollTo,u=e.children,a=t.useRef(null),l=t.useCallback(function(e){o(e.target.scrollTop)},[]),f=t.useCallback(function(e){e?(e.addEventListener("scroll",l,{passive:!0}),a.current=e):a.current.removeEventListener("scroll",l)},[]);return s(function(e){a.current.scrollTo({top:e})}),n.createElement("div",{ref:f,style:i,tabIndex:0,className:r},u)},V=function(e){var t=e.children,r=e.className,o=e.ScrollContainer,s=e.scrollTop,u=e.scrollTo;return n.createElement(void 0===o?L:o,{style:i({},W,e.style),reportScrollTop:s,scrollTo:u,className:r},t)},F=function(e){var r=e.render,i=e.stickyClassName,o=t.useContext(f),s=o.topList,u=H(o.list,[]),a=H(s,[]),l=[],c=0,h=[],v=a.reduce(function(e,t){return e+t.size},0);return a.forEach(function(e,t){var n=e.index;h.push(n),l.push(r(e,{key:n,"data-index":n,"data-known-size":e.size,className:i,style:{top:c+"px",marginTop:0===t?-v+"px":void 0}})),c+=e.size}),u.forEach(function(e){h.indexOf(e.index)>-1||l.push(r(e,{key:e.index,"data-index":e.index,"data-known-size":e.size}))}),n.createElement(n.Fragment,null," ",l," ")},P=function(e){var n=e.stickyClassName,r=t.useRef(null);return t.useLayoutEffect(function(){var e=document.createElement("style");return document.head.appendChild(e),e.sheet.insertRule("."+n+" {\n position: sticky;\n position: -webkit-sticky;\n z-index: 2;\n } ",0),r.current=e,function(){document.head.removeChild(r.current),r.current=null}},[]),null},_=function(){return String.fromCharCode(Math.round(25*Math.random()+97))},D=function(){return new Array(12).fill(0).map(_).join("")},q={top:0,position:"absolute",height:"100%",width:"100%",overflow:"absolute"},G=function(e){return n.createElement("div",{style:{height:e.height+"px",position:"absolute",top:0}}," ")},U=function(e){return n.createElement("footer",{ref:e.footerRef},e.children)},K=function(e){return n.createElement("div",{ref:e.listRef,style:e.style},e.children)},Y=function(e){var r=e.footer,i=e.FooterContainer,o=void 0===i?U:i,s=j(t.useContext(f).footerHeight);return n.createElement(o,{footerRef:s},r())},B=function(e){var r=e.fixedItemHeight,i=e.children,o=e.ListContainer,s=t.useContext(f),u=s.listHeight,a=s.itemHeights,l={marginTop:H(s.listOffset,0)+"px"},c=j(u,function(){},function(e){if(!r){var t=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.item(n);if(i&&void 0!==i.dataset.index){var o=parseInt(i.dataset.index),s=parseInt(i.dataset.knownSize),u=i.offsetHeight;if(u!==s){var a=t[t.length-1];0===t.length||a.size!==u||a.end!==o-1?t.push({start:o,end:o,size:u}):t[t.length-1].end++}}}return t}(e.children);t.length>0&&a(t)}});return n.createElement(o,{listRef:c,style:l},i)},J=function(e){var r=e.style,i=e.footer,o=e.item,s=e.fixedItemHeight,u=e.ScrollContainer,a=e.ListContainer,l=e.FooterContainer,c=e.className,h=t.useContext(f),v=h.scrollTo,p=h.scrollTop,d=h.viewportHeight,g=H(h.totalHeight,0),m=t.useMemo(D,[]),y=j(d);return n.createElement(V,{style:r,ScrollContainer:u,className:c,scrollTo:v,scrollTop:p},n.createElement("div",{ref:y,style:q},n.createElement(B,{fixedItemHeight:s,ListContainer:a},n.createElement(F,{render:o,stickyClassName:m}),i&&n.createElement(Y,{footer:i,FooterContainer:l}))),n.createElement(G,{height:g}),n.createElement(P,Object.assign({},{stickyClassName:m})))},Q=function(e){return n.createElement(f.Provider,{value:e.contextValue},n.createElement(J,{style:e.style||{},className:e.className,item:e.item,footer:e.footer,fixedItemHeight:void 0!==e.itemHeight,ScrollContainer:e.ScrollContainer,FooterContainer:e.FooterContainer,ListContainer:e.ListContainer||K}))},X=function(e){function t(t){var r;return(r=e.call(this,t)||this).itemRender=function(e,t){var o=t.key,s=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(t,["key"]),u=r.props,a=u.computeItemKey,l=u.item,f=u.ItemContainer,c=void 0===f?"div":f;return a&&(o=a(e.index)),n.createElement(c,i({},s,{key:o}),l(e.index))},r.state=A(t),r}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.isScrolling(e.scrollingStateChange),t.endReached(e.endReached),t.topItemCount(e.topItems||0),t.totalCount(e.totalCount),e.initialItemCount&&t.initialItemCount(e.initialItemCount),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.render=function(){return n.createElement(Q,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},t}(t.PureComponent),Z=function(e){function t(t){var r;return(r=e.call(this,t)||this).itemRender=function(e,t){var i=r.props.ItemContainer,o=r.props.GroupContainer||i;if("group"==e.type){var s=r.props.group(e.groupIndex);return o?n.createElement(o,Object.assign({key:t.key},t),s):n.createElement("div",Object.assign({},t),s)}var u=r.props.item(e.transposedIndex,e.groupIndex);return i?n.createElement(i,Object.assign({key:t.key},t),u):n.createElement("div",Object.assign({},t),u)},r.state=A(t),r}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.endReached(e.endReached),t.isScrolling(e.scrollingStateChange),t.groupCounts(e.groupCounts),t.groupIndices(e.groupIndices),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.render=function(){return n.createElement(Q,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},t}(t.PureComponent),$=Math.ceil,ee=Math.floor,te=Math.min,ne=Math.max,re=function(e){return $(e)-e<.03?$(e):ee(e)},ie=function(){var e=h([0,0,void 0,void 0]),t=h(0),n=h(0),r=h(0),i=h([0,0]),o=h(0),s=h(0),u=v();p(e,n,r,t).pipe(x(i)).subscribe(function(e){var t=e[0],n=t[0],r=n[0],u=n[1],a=n[2],l=n[3],f=t[1],c=t[2],h=t[3],v=e[1];if(void 0!==a&&void 0!==l){if(0==h)return i.next([0,-1]),void s.next(0);var p=v[0],d=v[1],g=re(r/a),m=function(e,t){return void 0===t&&(t=ee),t(e/g)},y=function(e){var t=e?[0,c]:[c,0],n=t[1],r=g*ee((f-t[0])/l),o=g*$((f+u+n)/l)-1;o=te(h-1,o),r=te(o,ne(0,r)),i.next([r,o]),s.next(m(r)*l)},x=l*m(p),b=l*m(d)+l;h<d-1?y(!0):x>f?y(!1):b<f+u&&y(!0),o.next(l*m(h,$))}});var a=u.pipe(x(e,t),d(function(e){var t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3];if(void 0===o||void 0===s)return 0;"number"==typeof t&&(t={index:t,align:"start"});var u=t.index,a=t.align,l=void 0===a?"start":a;u=Math.max(0,u,Math.min(e[2]-1,u));var f=re(r/o),c=ee(u/f)*s;return"end"==l?c=c-i+s:"center"===l&&(c=Math.round(c-i/2+s/2)),c})),l=R(n),f=v(),c=0;return i.pipe(x(t)).subscribe(function(e){var t=e[0][1],n=e[1];0!==n&&t===n-1&&c!==t&&(c=t,f.next(t))}),{gridDimensions:N(e),totalCount:N(t),scrollTop:N(n),overscan:N(r),scrollToIndex:N(u),itemRange:M(i),totalHeight:M(o),listOffset:M(s),scrollTo:M(a),isScrolling:M(l),endReached:M(f)}},oe=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).state=ie(),t}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.overscan(e.overscan||0),t.totalCount(e.totalCount),t.isScrolling(e.scrollingStateChange),t.endReached(e.endReached),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.render=function(){return n.createElement(se,Object.assign({},this.props,{engine:this.state}))},t}(n.PureComponent),se=function(e){var i,o,s,u,a=e.ScrollContainer,l=e.ItemContainer,f=void 0===l?"div":l,c=e.ListContainer,h=void 0===c?"div":c,v=e.className,p=e.item,d=e.itemClassName,g=void 0===d?"virtuoso-grid-item":d,m=e.listClassName,y=void 0===m?"virtuoso-grid-list":m,x=e.engine,b=e.style,k=void 0===b?{height:"40rem"}:b,C=x.itemRange,w=x.listOffset,I=x.gridDimensions,E=x.scrollTo,S=x.scrollTop,T=H(x.totalHeight,0),M={marginTop:H(w,0)+"px"},N=H(C,[0,0]),R=(i=function(e){var t=e.element.firstChild.firstChild;I([e.width,e.height,t.offsetWidth,t.offsetHeight])},o=t.useRef(null),s=t.useRef([0,0]),u=new r(function(e){var t=e[0].contentRect,n=t.width,r=t.height;s.current[0]===n&&s.current[1]===r||(s.current=[n,r],i({element:e[0].target,width:n,height:r}))}),function(e){e?(u.observe(e),o.current=e):(u.unobserve(o.current),o.current=null)});return n.createElement(V,{style:k,ScrollContainer:a,className:v,scrollTo:E,scrollTop:S},n.createElement("div",{ref:R,style:q},n.createElement(h,{style:M,className:y},function(e,t,r,i){for(var o=N[1],s=[],u=N[0];u<=o;u++)s.push(n.createElement(i,{key:u,className:r},t(u)));return s}(0,p,g,f))),n.createElement(G,{height:T}))};exports.GroupedVirtuoso=Z,exports.Virtuoso=X,exports.VirtuosoGrid=oe,exports.VirtuosoPresentation=Q; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=e(require("resize-observer-polyfill"));function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t,n){return(a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}var f=t.createContext(void 0);function c(e){return function(){var t=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e,t){return t(e)}:1===t.length?t[0]:function(e,n){var r=function(e){return n(e)};t.slice().reverse().forEach(function(e){var t=r;r=function(n){return e(n,t)}}),r(e)}}.apply(void 0,arguments);return function(e,t){var n=function(n){return e(function(e){return t(e,n)})};return{subscribe:n,pipe:c(n)}}(e,t)}}function h(e,t){void 0===t&&(t=!0);var n=[],r=e,i=function(e){return n.push(e),void 0!==r&&e(r),function(){n=n.filter(function(t){return t!==e})}};return{next:function(e){t&&e===r||(r=e,n.forEach(function(t){return t(e)}))},subscribe:i,pipe:c(i),subscribers:n}}function v(){var e=[],t=function(t){return e.push(t),function(){e=e.filter(function(e){return e!==t})}};return{next:function(t){e.forEach(function(e){return e(t)})},subscribe:t,pipe:c(t)}}function d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array(t.length).fill(!1),i=Array(t.length),o=[],s=function(e){r.every(function(e){return e})&&e.forEach(function(e){return e(i)})};t.forEach(function(e,t){e.subscribe(function(e){r[t]=!0,i[t]=e,s(o)})});var u=function(e){return o.push(e),s([e]),function(){o=o.filter(function(t){return t!==e})}};return{subscribe:u,pipe:c(u)}}function p(e){return function(t,n){n(e(t))}}function m(e){return function(t,n){return n(e)}}function g(e){return function(t,n){e>0?e--:n(t)}}function y(e){return function(t,n){e(t)&&n(t)}}function x(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array(t.length).fill(!1),i=Array(t.length);return t.forEach(function(e,t){e.subscribe(function(e){i[t]=e,r[t]=!0})}),function(e,t){r.every(function(e){return e})&&t([e].concat(i))}}var b=new(function(){function e(){this.level=0}var t=e.prototype;return t.rebalance=function(){return this},t.adjust=function(){return this},t.remove=function(){return this},t.find=function(){},t.findWith=function(){},t.findMax=function(){return-Infinity},t.findMaxValue=function(){},t.insert=function(e,t){return new C({key:e,value:t,level:1})},t.walkWithin=function(){return[]},t.walk=function(){return[]},t.ranges=function(){return[]},t.rangesWithin=function(){return[]},t.empty=function(){return!0},t.isSingle=function(){return!0},t.isInvariant=function(){return!0},t.keys=function(){return[]},e}());Object.freeze(b);var k=function(e){function t(t){return e.call(this,"Unreachable case: "+t)||this}return o(t,e),t}(l(Error)),C=function(){function e(e){var t=e.value,n=e.level,r=e.left,i=void 0===r?b:r,o=e.right,s=void 0===o?b:o;this.key=e.key,this.value=t,this.level=n,this.left=i,this.right=s}var t=e.prototype;return t.remove=function(e){var t=this.left,n=this.right;if(e===this.key){if(t.empty())return n;if(n.empty())return t;var r=t.last();return this.clone({key:r[0],value:r[1],left:t.deleteLast()}).adjust()}return e<this.key?this.clone({left:t.remove(e)}).adjust():this.clone({right:n.remove(e)}).adjust()},t.empty=function(){return!1},t.find=function(e){return e===this.key?this.value:e<this.key?this.left.find(e):this.right.find(e)},t.findWith=function(e){var t=e(this.value);switch(t){case-1:return this.left.findWith(e);case 0:return[this.key,this.value];case 1:return this.right.findWith(e);default:throw new k(t)}},t.findMax=function(e){if(this.key===e)return e;if(this.key<e){var t=this.right.findMax(e);return-Infinity===t?this.key:t}return this.left.findMax(e)},t.findMaxValue=function(e){if(this.key===e)return this.value;if(this.key<e){var t=this.right.findMaxValue(e);return void 0===t?this.value:t}return this.left.findMaxValue(e)},t.insert=function(e,t){return e===this.key?this.clone({key:e,value:t}):e<this.key?this.clone({left:this.left.insert(e,t)}).rebalance():this.clone({right:this.right.insert(e,t)}).rebalance()},t.walkWithin=function(e,t){var n=this.key,r=this.value,i=[];return n>e&&(i=i.concat(this.left.walkWithin(e,t))),n>=e&&n<=t&&i.push({key:n,value:r}),n<=t&&(i=i.concat(this.right.walkWithin(e,t))),i},t.walk=function(){return[].concat(this.left.walk(),[{key:this.key,value:this.value}],this.right.walk())},t.last=function(){return this.right.empty()?[this.key,this.value]:this.right.last()},t.deleteLast=function(){return this.right.empty()?this.left:this.clone({right:this.right.deleteLast()}).adjust()},t.clone=function(t){return new e({key:void 0!==t.key?t.key:this.key,value:void 0!==t.value?t.value:this.value,level:void 0!==t.level?t.level:this.level,left:void 0!==t.left?t.left:this.left,right:void 0!==t.right?t.right:this.right})},t.isSingle=function(){return this.level>this.right.level},t.rebalance=function(){return this.skew().split()},t.adjust=function(){var e=this.left,t=this.right,n=this.level;if(t.level>=n-1&&e.level>=n-1)return this;if(n>t.level+1){if(e.isSingle())return this.clone({level:n-1}).skew();if(e.empty()||e.right.empty())throw new Error("Unexpected empty nodes");return e.right.clone({left:e.clone({right:e.right.left}),right:this.clone({left:e.right.right,level:n-1}),level:n})}if(this.isSingle())return this.clone({level:n-1}).split();if(t.empty()||t.left.empty())throw new Error("Unexpected empty nodes");var r=t.left,i=r.isSingle()?t.level-1:t.level;return r.clone({left:this.clone({right:r.left,level:n-1}),right:t.clone({left:r.right,level:i}).split(),level:r.level+1})},t.isInvariant=function(){var e=this.left,t=this.right,n=this.level;return n===e.level+1&&(n===t.level||n===t.level+1)&&!(!t.empty()&&n<=t.right.level)&&e.isInvariant()&&t.isInvariant()},t.keys=function(){return[].concat(this.left.keys(),[this.key],this.right.keys())},t.ranges=function(){return this.toRanges(this.walk())},t.rangesWithin=function(e,t){return this.toRanges(this.walkWithin(e,t))},t.toRanges=function(e){if(0===e.length)return[];for(var t=e[0],n=t.key,r=t.value,i=[],o=1;o<=e.length;o++){var s=e[o];i.push({start:n,end:s?s.key-1:Infinity,value:r}),s&&(n=s.key,r=s.value)}return i},t.split=function(){var e=this.right,t=this.level;return e.empty()||e.right.empty()||e.level!=t||e.right.level!=t?this:e.clone({left:this.clone({right:e.left}),level:t+1})},t.skew=function(){var e=this.left;return e.empty()||e.level!==this.level?this:e.clone({right:this.clone({left:e.right})})},e}(),w=function(){function e(e){this.root=e}e.empty=function(){return new e(b)};var t=e.prototype;return t.find=function(e){return this.root.find(e)},t.findMax=function(e){return this.root.findMax(e)},t.findMaxValue=function(e){if(this.empty())throw new Error("Searching for max value in an empty tree");return this.root.findMaxValue(e)},t.findWith=function(e){return this.root.findWith(e)},t.insert=function(t,n){return new e(this.root.insert(t,n))},t.remove=function(t){return new e(this.root.remove(t))},t.empty=function(){return this.root.empty()},t.keys=function(){return this.root.keys()},t.walk=function(){return this.root.walk()},t.walkWithin=function(e,t){var n=this.root.findMax(e);return this.root.walkWithin(n,t)},t.ranges=function(){return this.root.ranges()},t.rangesWithin=function(e,t){var n=this.root.findMax(e);return this.root.rangesWithin(n,t)},t.isInvariant=function(){return this.root.isInvariant()},e}(),I=function(){function e(e){this.nanIndices=[],this.rangeTree=e;var t=w.empty(),n=0,r=!1,i=e.ranges(),o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{if((s=i.next()).done)break;u=s.value}var a=u.start,l=u.end,f=u.value;isNaN(f)?(this.nanIndices.push(a),r||(t=t.insert(n,{startIndex:a,endIndex:Infinity,size:f})),r=!0):r||(t=t.insert(n,{startIndex:a,endIndex:l,size:f}),n+=(l-a+1)*f)}this.offsetTree=t}e.create=function(){return new e(w.empty())};var t=e.prototype;return t.empty=function(){return this.rangeTree.empty()},t.insert=function(t,n,r){var i=this.rangeTree;if(i.empty())return new e(i.insert(0,r));if(this.nanIndices.length&&this.nanIndices.indexOf(n)>-1){if(i.find(this.nanIndices[0]-1)===r)return new e(w.empty().insert(0,r));var o=this.nanIndices,s=Array.isArray(o),u=0;for(o=s?o:o[Symbol.iterator]();;){var a;if(s){if(u>=o.length)break;a=o[u++]}else{if((u=o.next()).done)break;a=u.value}i=i.insert(a,r)}return new e(i)}var l=i.rangesWithin(t-1,n+1);if(l.some(function(e){return e.start===t&&(e.end===n||Infinity===e.end)&&e.value===r}))return this;var f=!1,c=!1,h=l,v=Array.isArray(h),d=0;for(h=v?h:h[Symbol.iterator]();;){var p;if(v){if(d>=h.length)break;p=h[d++]}else{if((d=h.next()).done)break;p=d.value}var m=p.start,g=p.end,y=p.value;f?(n>=m||r===y)&&(i=i.remove(m)):(c=y!==r,f=!0),g>n&&n>=m&&(y===r||isNaN(y)||(i=i.insert(n+1,y)))}return c&&(i=i.insert(t,r)),i===this.rangeTree?this:new e(i)},t.insertSpots=function(t,n){if(this.empty()){var r=this.rangeTree,i=t,o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{if((s=i.next()).done)break;u=s.value}var a=u;r=r.insert(a,n).insert(a+1,NaN)}return new e(r)}throw new Error("attempting to overwrite non-empty tree")},t.offsetOf=function(e){if(this.offsetTree.empty())return 0;var t=this.offsetTree.findWith(function(t){return t.startIndex>e?-1:t.endIndex<e?1:0});if(t){var n=t[1];return t[0]+(e-n.startIndex)*n.size}throw new Error("Requested offset outside of the known ones, index: "+e)},t.itemAt=function(e){return{index:e,size:this.rangeTree.findMaxValue(e),offset:NaN}},t.indexRange=function(e,t){if(0===t)return[];if(this.rangeTree.empty())return[{index:0,size:0,offset:NaN}];var n=[],r=this.rangeTree.rangesWithin(e,t),i=Array.isArray(r),o=0;for(r=i?r:r[Symbol.iterator]();;){var s;if(i){if(o>=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}for(var u=s,a=Math.max(e,u.start),l=Math.min(t,void 0===u.end?Infinity:u.end),f=a;f<=l;f++)n.push({index:f,size:u.value,offset:NaN})}return n},t.range=function(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=Infinity),this.offsetTree.empty())return[{index:0,size:0,offset:0}];var i=[],o=this.offsetTree.rangesWithin(e,t),s=Array.isArray(o),u=0;for(o=s?o:o[Symbol.iterator]();;){var a;if(s){if(u>=o.length)break;a=o[u++]}else{if((u=o.next()).done)break;a=u.value}var l=a.start,f=a.value,c=f.startIndex,h=f.endIndex,v=f.size,d=l,p=c;if(l<e&&(d+=((p+=Math.floor((e-l)/v))-c)*v),p<n&&(d+=(n-p)*v,p=n),isNaN(v))return i.push({index:p,size:0,offset:d}),i;h=Math.min(h,r);for(var m=p;m<=h&&!(d>t);m++)i.push({index:m,size:v,offset:d}),d+=v}return i},t.total=function(e){var t=0,n=this.rangeTree.rangesWithin(0,e),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var s=o.start,u=o.end,a=o.value;t+=((u=Math.min(u,e))-s+1)*(isNaN(a)?0:a)}return t},t.getOffsets=function(e){var t=this,n=w.empty();return e.forEach(function(e){var r=t.offsetOf(e);n=n.insert(r,e)}),new E(n)},e}(),E=function(){function e(e){this.tree=e}var t=e.prototype;return t.findMaxValue=function(e){return this.tree.findMaxValue(e)},t.empty=function(){return this.tree.empty()},e}(),S=function(){function e(){}return e.prototype.transpose=function(e){return e.map(function(e){return{groupIndex:0,index:e.index,offset:e.offset,size:e.size,transposedIndex:e.index,type:"item"}})},e}(),T=function(){function e(e){this.count=e.reduce(function(e,t){return e+t+1},0);var t=w.empty(),n=0,r=0,i=e,o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var u;if(o){if(s>=i.length)break;u=i[s++]}else{if((s=i.next()).done)break;u=s.value}var a=u;t=t.insert(r,[n,r]),n++,r+=a+1}this.tree=t}var t=e.prototype;return t.totalCount=function(){return this.count},t.transpose=function(e){var t=this;return e.map(function(e){var n=t.tree.find(e.index);if(n)return{groupIndex:n[0],index:e.index,offset:e.offset,size:e.size,type:"group"};var r=t.tree.findMaxValue(e.index)[0];return{groupIndex:r,index:e.index,offset:e.offset,size:e.size,transposedIndex:e.index-r-1,type:"item"}})},t.groupIndices=function(){return this.tree.keys()},e}();function R(e){var t;return function(n){t&&t(),n&&(t=e.subscribe(n))}}function M(e){return e.next}var N=function(e){var t,n,r=h(!1);return e.pipe(g(1),m(!0)).subscribe(r.next),e.pipe(g(1),m(!1),function(e,r){t=e,n&&clearTimeout(n),n=setTimeout(function(){r(t)},200)}).subscribe(r.next),r},O=function(e){return e.length>0?e[0].offset:0},z=function(e){return e[0].total(e[1]-1)},A=function(e){var t=e.overscan,n=void 0===t?0:t,r=e.totalCount,i=void 0===r?0:r,o=e.itemHeight,s=h(0),u=h(0),a=h(0),l=h(0),f=h(),c=h(i),m=h(),g=h(),b=I.create(),k=!1,C=h([]),w=h(),E=v();o&&(b=b.insert(0,0,o));var A=h(b);o||f.pipe(x(A,C)).subscribe(function(e){var t=e[0],n=e[1],r=e[2],i=k?I.create():n;k&&(i=I.create(),k=!1);var o=t,s=Array.isArray(o),u=0;for(o=s?o:o[Symbol.iterator]();;){var a;if(s){if(u>=o.length)break;a=o[u++]}else{if((u=o.next()).done)break;a=u.value}var l=a.start,f=a.end,c=a.size;i=i.empty()&&l==f&&r.indexOf(l)>-1?i.insertSpots(r,c):i.insert(l,f,c)}i!==n&&A.next(i)});var W=new S;m.subscribe(function(e){W=new T(e),c.next(W.totalCount()),C.next(W.groupIndices())});var j=d(A,c).pipe(p(z)),H=d(j,l).pipe(p(function(e){return e[0]+e[1]})),L=d(A,C).pipe(p(function(e){return e[0].getOffsets(e[1])})),V=h([]);d(A,g,c).pipe(y(function(e){return e[1]>0}),p(function(e){var t=e[0],n=Math.max(0,Math.min(e[1]-1,e[2]));return W.transpose(t.indexRange(0,n))})).subscribe(V.next),d(A,L,a).pipe(y(function(e){return!e[1].empty()&&!e[0].empty()}),x(V),p(function(e){var t=e[0],n=t[0],r=e[1],i=t[1].findMaxValue(Math.max(t[2],0));if(1===r.length&&r[0].index===i)return r;var o=n.itemAt(i);return W.transpose([o])})).subscribe(V.next);var F,P,_=V.pipe(p(function(e){return e.reduce(function(e,t){return e+t.size},0)})),D=V.pipe(p(function(e){return e.length&&e[e.length-1].index+1})),U=d(s,a,_,u,l,D,c,A).pipe((F=function(e){return function(t,n){var r=n[0],i=n[1],o=n[2],s=n[3],u=n[4],a=n[5],l=n[6],f=n[7],c=t.length;if(0===l)return[];var h=O(t),v=h-i+s-u-o,d=Math.max(l-1,0);if(v<r||c>0&&(t[0].index<a||t[c-1].index>d)){var p=Math.max(i+o,o);return W.transpose(f.range(p,i+r+2*e-1,a,d))}if(h>i+o){var m=Math.max(i+o-2*e,o);return W.transpose(f.range(m,i+r-1,a,d))}return t}}(n),P=[],function(e,t){t(P=F(P,e))})),q=v(),G=0;U.pipe(p(function(e){return e.length?e[e.length-1].index:0})).pipe(x(c)).subscribe(function(e){var t=e[0],n=e[1];0!==n&&t===n-1&&G!==t&&(G=t,q.next(t))});var K=d(U,a,_).pipe(p(function(e){return O(e[0])})),Y=E.pipe(x(A,_,C,s,c),p(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];"number"==typeof t&&(t={index:t,align:"start"});var s=t.index,u=t.align,a=void 0===u?"start":u;s=Math.max(0,s,Math.min(e[5]-1,s));var l=n.offsetOf(s);return"end"==a?l=l-o+n.itemAt(s).size:"center"===a?l=Math.round(l-o/2+n.itemAt(s).size/2):-1===i.indexOf(s)&&(l-=r),l})),B=w.subscribe(function(e){f.next([{start:0,end:0,size:30}]),s.next(30*e),k=!0,B()}),J=C.pipe(),Q=K.pipe(p(function(e){return-e})),X=N(a);return{groupCounts:M(m),itemHeights:M(f),footerHeight:M(l),listHeight:M(u),viewportHeight:M(s),scrollTop:M(a),topItemCount:M(g),totalCount:M(c),scrollToIndex:M(E),initialItemCount:M(w),list:R(U),itemsRendered:R(U),topList:R(V),listOffset:R(K),totalHeight:R(H),endReached:R(q),isScrolling:R(X),stickyItems:R(C),groupIndices:R(J),stickyItemsOffset:R(Q),scrollTo:R(Y)}},W=function(e,n,i){var o=t.useRef(null),s=t.useRef(0),u=t.useRef(0),a=new r(function(t){var n=t[0].contentRect.height;s.current!==n&&(s.current=n,i&&(u.current=window.requestAnimationFrame(function(){return i(t[0].target)})),e(n))});return t.useEffect(function(){return function(){return window.cancelAnimationFrame(u.current)}},[]),function(e){e?(a.observe(e),n&&n(e),o.current=e):(a.unobserve(o.current),o.current=null)}};function j(e,n){var r=t.useState(function(e,t){return function(){var n=t;return e(function(e){n=e}),n}}(e,n)),i=r[0],o=r[1];return t.useLayoutEffect(function(){return e(o),function(){return e(void 0)}},[]),i}var H={height:"40rem",overflowY:"auto",WebkitOverflowScrolling:"touch",position:"relative",outline:"none"},L=function(e){var r=e.className,i=e.style,o=e.reportScrollTop,s=e.scrollTo,u=e.children,a=t.useRef(null),l=t.useCallback(function(e){o(e.target.scrollTop)},[]),f=t.useCallback(function(e){e?(e.addEventListener("scroll",l,{passive:!0}),a.current=e):a.current.removeEventListener("scroll",l)},[]);return s(function(e){a.current.scrollTo({top:e})}),n.createElement("div",{ref:f,style:i,tabIndex:0,className:r},u)},V=function(e){var t=e.children,r=e.className,o=e.ScrollContainer,s=e.scrollTop,u=e.scrollTo;return n.createElement(void 0===o?L:o,{style:i({},H,e.style),reportScrollTop:s,scrollTo:u,className:r},t)},F=function(e){var r=e.render,i=e.stickyClassName,o=t.useContext(f),s=o.topList,u=j(o.list,[]),a=j(s,[]),l=[],c=0,h=[],v=a.reduce(function(e,t){return e+t.size},0);return a.forEach(function(e,t){var n=e.index;h.push(n),l.push(r(e,{key:n,"data-index":n,"data-known-size":e.size,className:i,style:{top:c+"px",marginTop:0===t?-v+"px":void 0}})),c+=e.size}),u.forEach(function(e){h.indexOf(e.index)>-1||l.push(r(e,{key:e.index,"data-index":e.index,"data-known-size":e.size}))}),n.createElement(n.Fragment,null," ",l," ")},P=function(e){var n=e.stickyClassName,r=t.useRef(null);return t.useLayoutEffect(function(){var e=document.createElement("style");return document.head.appendChild(e),e.sheet.insertRule("."+n+" {\n position: sticky;\n position: -webkit-sticky;\n z-index: 2;\n } ",0),r.current=e,function(){document.head.removeChild(r.current),r.current=null}},[]),null},_=function(){return String.fromCharCode(Math.round(25*Math.random()+97))},D=function(){return new Array(12).fill(0).map(_).join("")},U={top:0,position:"absolute",height:"100%",width:"100%",overflow:"absolute"},q=function(e){return n.createElement("div",{style:{height:e.height+"px",position:"absolute",top:0}}," ")},G=function(e){return n.createElement("footer",{ref:e.footerRef},e.children)},K=function(e){return n.createElement("div",{ref:e.listRef,style:e.style},e.children)},Y=function(e){var r=e.footer,i=e.FooterContainer,o=void 0===i?G:i,s=W(t.useContext(f).footerHeight);return n.createElement(o,{footerRef:s},r())},B=function(e){var r=e.fixedItemHeight,i=e.children,o=e.ListContainer,s=t.useContext(f),u=s.listHeight,a=s.itemHeights,l={marginTop:j(s.listOffset,0)+"px"},c=W(u,function(){},function(e){if(!r){var t=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.item(n);if(i&&void 0!==i.dataset.index){var o=parseInt(i.dataset.index),s=parseInt(i.dataset.knownSize),u=i.offsetHeight;if(u!==s){var a=t[t.length-1];0===t.length||a.size!==u||a.end!==o-1?t.push({start:o,end:o,size:u}):t[t.length-1].end++}}}return t}(e.children);t.length>0&&a(t)}});return n.createElement(o,{listRef:c,style:l},i)},J=function(e){var r=e.style,i=e.footer,o=e.item,s=e.fixedItemHeight,u=e.ScrollContainer,a=e.ListContainer,l=e.FooterContainer,c=e.className,h=t.useContext(f),v=h.scrollTo,d=h.scrollTop,p=h.viewportHeight,m=j(h.totalHeight,0),g=t.useMemo(D,[]),y=W(p);return n.createElement(V,{style:r,ScrollContainer:u,className:c,scrollTo:v,scrollTop:d},n.createElement("div",{ref:y,style:U},n.createElement(B,{fixedItemHeight:s,ListContainer:a},n.createElement(F,{render:o,stickyClassName:g}),i&&n.createElement(Y,{footer:i,FooterContainer:l}))),n.createElement(q,{height:m}),n.createElement(P,Object.assign({},{stickyClassName:g})))},Q=function(e){return n.createElement(f.Provider,{value:e.contextValue},n.createElement(J,{style:e.style||{},className:e.className,item:e.item,footer:e.footer,fixedItemHeight:void 0!==e.itemHeight,ScrollContainer:e.ScrollContainer,FooterContainer:e.FooterContainer,ListContainer:e.ListContainer||K}))},X=function(e){function t(t){var r;return(r=e.call(this,t)||this).itemRender=function(e,t){var o=t.key,s=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(t,["key"]),u=r.props,a=u.computeItemKey,l=u.item,f=u.ItemContainer,c=void 0===f?"div":f;return a&&(o=a(e.index)),n.createElement(c,i({},s,{key:o}),l(e.index))},r.state=A(t),r}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.isScrolling(e.scrollingStateChange),t.endReached(e.endReached),t.topItemCount(e.topItems||0),t.totalCount(e.totalCount),e.initialItemCount&&t.initialItemCount(e.initialItemCount),t.itemsRendered(e.itemsRendered),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.componentWillUnmount=function(){this.state.itemsRendered(void 0)},r.render=function(){return n.createElement(Q,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},t}(t.PureComponent),Z=function(e){function t(t){var r;return(r=e.call(this,t)||this).itemRender=function(e,t){var i=r.props.ItemContainer,o=r.props.GroupContainer||i;if("group"==e.type){var s=r.props.group(e.groupIndex);return o?n.createElement(o,Object.assign({key:t.key},t),s):n.createElement("div",Object.assign({},t),s)}var u=r.props.item(e.transposedIndex,e.groupIndex);return i?n.createElement(i,Object.assign({key:t.key},t),u):n.createElement("div",Object.assign({},t),u)},r.state=A(t),r}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.endReached(e.endReached),t.isScrolling(e.scrollingStateChange),t.groupCounts(e.groupCounts),t.groupIndices(e.groupIndices),t.itemsRendered(e.itemsRendered),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.componentWillUnmount=function(){this.state.itemsRendered(void 0)},r.render=function(){return n.createElement(Q,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},t}(t.PureComponent),$=Math.ceil,ee=Math.floor,te=Math.min,ne=Math.max,re=function(e){return $(e)-e<.03?$(e):ee(e)},ie=function(){var e=h([0,0,void 0,void 0]),t=h(0),n=h(0),r=h(0),i=h([0,0]),o=h(0),s=h(0),u=v();d(e,n,r,t).pipe(x(i)).subscribe(function(e){var t=e[0],n=t[0],r=n[0],u=n[1],a=n[2],l=n[3],f=t[1],c=t[2],h=t[3],v=e[1];if(void 0!==a&&void 0!==l){if(0==h)return i.next([0,-1]),void s.next(0);var d=v[0],p=v[1],m=re(r/a),g=function(e,t){return void 0===t&&(t=ee),t(e/m)},y=function(e){var t=e?[0,c]:[c,0],n=t[1],r=m*ee((f-t[0])/l),o=m*$((f+u+n)/l)-1;o=te(h-1,o),r=te(o,ne(0,r)),i.next([r,o]),s.next(g(r)*l)},x=l*g(d),b=l*g(p)+l;h<p-1?y(!0):x>f?y(!1):b<f+u&&y(!0),o.next(l*g(h,$))}});var a=u.pipe(x(e,t),p(function(e){var t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3];if(void 0===o||void 0===s)return 0;"number"==typeof t&&(t={index:t,align:"start"});var u=t.index,a=t.align,l=void 0===a?"start":a;u=Math.max(0,u,Math.min(e[2]-1,u));var f=re(r/o),c=ee(u/f)*s;return"end"==l?c=c-i+s:"center"===l&&(c=Math.round(c-i/2+s/2)),c})),l=N(n),f=v(),c=0;return i.pipe(x(t)).subscribe(function(e){var t=e[0][1],n=e[1];0!==n&&t===n-1&&c!==t&&(c=t,f.next(t))}),{gridDimensions:M(e),totalCount:M(t),scrollTop:M(n),overscan:M(r),scrollToIndex:M(u),itemRange:R(i),totalHeight:R(o),listOffset:R(s),scrollTo:R(a),isScrolling:R(l),endReached:R(f)}},oe=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).state=ie(),t}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.overscan(e.overscan||0),t.totalCount(e.totalCount),t.isScrolling(e.scrollingStateChange),t.endReached(e.endReached),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.render=function(){return n.createElement(se,Object.assign({},this.props,{engine:this.state}))},t}(n.PureComponent),se=function(e){var i,o,s,u,a=e.ScrollContainer,l=e.ItemContainer,f=void 0===l?"div":l,c=e.ListContainer,h=void 0===c?"div":c,v=e.className,d=e.item,p=e.itemClassName,m=void 0===p?"virtuoso-grid-item":p,g=e.listClassName,y=void 0===g?"virtuoso-grid-list":g,x=e.engine,b=e.style,k=void 0===b?{height:"40rem"}:b,C=x.itemRange,w=x.listOffset,I=x.gridDimensions,E=x.scrollTo,S=x.scrollTop,T=j(x.totalHeight,0),R={marginTop:j(w,0)+"px"},M=j(C,[0,0]),N=(i=function(e){var t=e.element.firstChild.firstChild;I([e.width,e.height,t.offsetWidth,t.offsetHeight])},o=t.useRef(null),s=t.useRef([0,0]),u=new r(function(e){var t=e[0].contentRect,n=t.width,r=t.height;s.current[0]===n&&s.current[1]===r||(s.current=[n,r],i({element:e[0].target,width:n,height:r}))}),function(e){e?(u.observe(e),o.current=e):(u.unobserve(o.current),o.current=null)});return n.createElement(V,{style:k,ScrollContainer:a,className:v,scrollTo:E,scrollTop:S},n.createElement("div",{ref:N,style:U},n.createElement(h,{style:R,className:y},function(e,t,r,i){for(var o=M[1],s=[],u=M[0];u<=o;u++)s.push(n.createElement(i,{key:u,className:r},t(u)));return s}(0,d,m,f))),n.createElement(q,{height:T}))};exports.GroupedVirtuoso=Z,exports.Virtuoso=X,exports.VirtuosoGrid=oe,exports.VirtuosoPresentation=Q; | ||
//# sourceMappingURL=react-virtuoso.cjs.production.min.js.map |
@@ -1,6 +0,8 @@ | ||
import React, { CSSProperties, PureComponent, ReactElement, FC } from 'react'; | ||
import React, { CSSProperties, FC, PureComponent, ReactElement } from 'react'; | ||
import { TSubscriber } from 'tinyrx'; | ||
import { TScrollLocation } from './EngineCommons'; | ||
import { ListItem } from './GroupIndexTransposer'; | ||
import { TRender, TRenderProps } from './VirtuosoList'; | ||
import { VirtuosoStore } from './VirtuosoStore'; | ||
import { TScrollContainer, TListContainer, TFooterContainer } from './VirtuosoView'; | ||
import { TRender, TRenderProps } from './VirtuosoList'; | ||
import { TFooterContainer, TListContainer, TScrollContainer } from './VirtuosoView'; | ||
export declare type VirtuosoState = ReturnType<typeof VirtuosoStore>; | ||
@@ -14,6 +16,7 @@ export declare type TItemContainer = React.FC<TRenderProps>; | ||
item: (index: number) => ReactElement; | ||
computeItemKey: (index: number) => number; | ||
computeItemKey?: (index: number) => number; | ||
itemHeight?: number; | ||
endReached?: (index: number) => void; | ||
scrollingStateChange?: (isScrolling: boolean) => void; | ||
itemsRendered?: TSubscriber<ListItem[]>; | ||
style?: CSSProperties; | ||
@@ -45,3 +48,4 @@ className?: string; | ||
scrollToIndex(location: TScrollLocation): void; | ||
componentWillUnmount(): void; | ||
render(): JSX.Element; | ||
} |
@@ -26,2 +26,3 @@ import { ListItem } from './GroupIndexTransposer'; | ||
list: (callback: ((val: ListItem[]) => void) | undefined) => void; | ||
itemsRendered: (callback: ((val: ListItem[]) => void) | undefined) => void; | ||
topList: (callback: ((val: ListItem[]) => void) | undefined) => void; | ||
@@ -28,0 +29,0 @@ listOffset: (callback: ((val: number) => void) | undefined) => void; |
{ | ||
"name": "react-virtuoso", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"homepage": "https://virtuoso.dev", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
2
1
521884
29
4721