"use strict";function _typeof2(e){return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof2(e)}module.exports=function(e){var t={};function o(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===_typeof2(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(r,i,function(t){return e[t]}.bind(null,i));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t,o){var r=!1,i=void 0,n=void 0;!function(){var e=wx.getSystemInfoSync();r="ios"===e.platform;var t=e.screenWidth||375,o=e.pixelRatio||2;t===i&&o===n||(i=t,n=o)}();var h=/([+-]?\d+(?:\.\d+)?)rpx/gi;e.exports={transformRpx:function(e,t){if("string"!=typeof e)return e;var o=h;return e.replace(o,function(e,o){return(0===(h=Number(o))?0:(h=h/750*i,0===(h=Math.floor(h+1e-4))?1!==n&&r?.5:1:h))+(t?"px":"");var h})}}},function(e,t,o){e.exports={}},function(e,t,o){var r=o(3);e.exports=function(e){return new r(e)}},function(e,t,o){var r="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)},i=o(1),n=o(4),h=o(0),a=200;function s(e){var t=this,o=e.id,i=e.dataKey,h=e.page,a=e.itemSize,s=e.useInPage,c=e.placeholderClass,l=e.root;if(!(o&&i&&h&&a))throw new Error("parameter id, dataKey, page, itemSize is required");if("function"!=typeof a&&"object"!==(void 0===a?"undefined":r(a)))throw new Error("parameter itemSize must be function or object with key width and height");if(!("object"!==(void 0===a?"undefined":r(a))||a.width&&a.height||a.props&&a.queryClass&&a.dataKey))throw new Error("parameter itemSize must be function or object with key width and height");if(this.id=o,this.dataKey=i,this.page=h,this.root=l,this.placeholderClass=c,h._recycleViewportChange=n,this.comp=h.selectComponent("#"+o),this.itemSize=a,this.itemSizeOpt=a,this.useInPage=s||!1,this.comp&&(this.comp.context=this,this.comp.setPage(h),this.comp.setUseInPage(this.useInPage)),this.useInPage&&!this.root)throw new Error("parameter root is required when useInPage is true");this.useInPage&&(this.oldPageScroll=this.root.onPageScroll,this.root.onPageScroll=function(e){t.comp&&t.comp._scrollViewDidScroll({detail:{scrollLeft:0,scrollTop:e.scrollTop}}),t.oldPageScroll.apply(t.root,[e])},this.oldReachBottom=this.root.onReachBottom,this.root.onReachBottom=function(e){t.comp&&t.comp.triggerEvent("scrolltolower",{}),t.oldReachBottom.apply(t.root,[e])},this.oldPullDownRefresh=this.root.onPullDownRefresh,this.root.onPullDownRefresh=function(e){t.comp&&t.comp.triggerEvent("scrolltoupper",{}),t.oldPullDownRefresh.apply(t.root,[e])})}function c(e,t){if(!t)return e;if(void 0!==e[t])return e[t];for(var o=t.split("."),i=0;i10&&console.warn("[recycle-view] get itemSize count exceed maximum of 10, now got",r);var g=this;function y(e,t){var o=h[t];if(!o)throw console.error("[recycle-view] auto calculate size array error, no map size found",e,t,h),new Error("[recycle-view] auto calculate size array error, no map size found");var i=r[o.sizeIndex];if(!i)throw console.log("[recycle-view] auto calculate size array error, no size found",e,t,o,r),new Error("[recycle-view] auto calculate size array error, no size found");return{width:i.width,height:i.height}}if(i.length){var m={};m[o.dataKey]=i,this.page.setData(m,function(){wx.createSelectorQuery().selectAll("."+o.queryClass).boundingClientRect(function(i){!function(i){i.forEach(function(e,t){var o=n[t];r[o].width=e.width,r[o].height=e.height}),g.itemSize=y;var h=g._recalculateSize(e);o.cacheKey&&wx.setStorageSync(o.cacheKey,r),t&&t(h)}(i)}).exec()})}else{g.itemSize=y;var v=g._recalculateSize(e);t&&t(v)}},s.prototype._recalculateSize=function(e){for(var t={},o=this.itemSize,r="function"==typeof o,i=this.comp,n=i.data,h=0,s=0,c=0,l=0,p=[],u=e.length,f=0;fn.width){if(l=0,h=d.width,p.length>=2?s+=p[p.length-2].height||0:s+=d.height,s>=a*(c+1)){var g=f-1,y=c;c+=parseInt((s-a*c)/a,10);for(var m=y;m=a*(l+1)&&l++,h+=d.width,d.beforeHeight=0===f?0:p[p.length-2].beforeHeight;var S=c+"."+l;if(t[S]||(t[S]=[]),t[S].push(f),u-1===f&&d.height>a){var b=c;s+=d.height,c+=parseInt((s-a*c)/a,10);for(var x=b;x<=c;x++){var z=x+"."+l;t[z]||(t[z]=[]),t[z].push(f)}}}var _={array:p,map:t,totalHeight:p.length?p[p.length-1].beforeHeight+p[p.length-1].height:0};return i.setItemSize(_),_},s.prototype.deleteList=function(e,t,o){this.checkComp();var r=this.id;return i[r]?(i[r].list.splice(e,t),this._forceRerender(r,o),this):this},s.prototype.updateList=function(e,t,o){this.checkComp();var r=this.id;if(!i[r])return this;for(var n=i[r].list.length,h=0;h=t.length||e<0?null:{left:0,top:t[e].beforeHeight,width:t[e].width,height:t[e].height}},s.prototype.getScrollTop=function(){return this.checkComp(),this.comp.currentScrollTop||0},s.prototype.transformRpx=s.transformRpx=function(e,t){return"number"==typeof e&&(e+="rpx"),parseFloat(h.transformRpx(e,t))},s.prototype.getViewportItems=function(e){this.checkComp();var t=this.comp.getIndexesInViewport(e);if(t.length<=0)return[];for(var o=[],r=i[this.id].list,n=0;n=a.ignoreBeginIndex&&l<=a.ignoreEndIndex||i.push(h[l])}var p={};p[n.key]=i;var u=this.selectComponent("#"+o.id);p[u.data.batchKey]=!this.data.batchSetRecycleData,u._setInnerBeforeAndAfterHeight({beforeHeight:a.minTop,afterHeight:a.afterHeight}),this.setData(p,function(){"function"==typeof t&&t()})}}}]);