!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Infinity=e()}(this,function(){"use strict";function e(t){console.error("[BScroll warn]: "+t)}var o=function(){return(o=Object.assign||function(t){for(var e,o=1,n=arguments.length;or[0]&&e[1]this.list.length&&(e=o-this.list.length,this.addEmptyData(e)),[2,this.checkToFetch(o)]})})},g.prototype.add=function(t){for(var e=0;e=t.length&&(e=t.length-1),o>t.length&&(o=t.length),this.collectUnusedDom(t,e,o),this.createDom(t,e,o),this.cacheHeight(t,e,o);t=this.positionDom(t,e,o);return{start:e,startPos:t.startPos,startDelta:t.startDelta,end:o,endPos:t.endPos}},D.prototype.collectUnusedDom=function(t,e,o){for(var n,i=0;ithis.scroll.maxScrollY&&(this.scroll.maxScrollY=-(t-this.scroll.scroller.scrollBehaviorY.wrapperSize)),{end:o,startPos:n,endPos:t}},P.prototype.destroy=function(){for(var t=this.scroll.scroller,e=t.content,t=t.scrollBehaviorY;e.firstChild;)e.removeChild(e.firstChild);this.domManager.destroy(),this.scroll.off("scroll",this.update),this.scroll.off("destroy",this.destroy),t.hooks.off(t.hooks.eventTypes.computeBoundary)},P.pluginName="infinity",P});