/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.1.2-master-a9ba340 */ !function(t,e,i){"use strict";function s(){return{controller:o,template:n,compile:function(t,e){t.addClass("md-virtual-repeat-container").addClass(e.hasOwnProperty("mdOrientHorizontal")?"md-orient-horizontal":"md-orient-vertical")}}}function n(t){return'
'+t[0].innerHTML+"
"}function o(t,i,s,n,o,r,h,l,a){this.$rootScope=o,this.$scope=h,this.$element=l,this.$attrs=a,this.size=0,this.scrollSize=0,this.scrollOffset=0,this.horizontal=this.$attrs.hasOwnProperty("mdOrientHorizontal"),this.repeater=null,this.autoShrink=this.$attrs.hasOwnProperty("mdAutoShrink"),this.autoShrinkMin=parseInt(this.$attrs.mdAutoShrinkMin,10)||0,this.originalSize=null,this.offsetSize=parseInt(this.$attrs.mdOffsetSize,10)||0,this.oldElementSize=null,this.maxElementPixels=s.ELEMENT_MAX_PIXELS,this.$attrs.mdTopIndex?(this.bindTopIndex=n(this.$attrs.mdTopIndex),this.topIndex=this.bindTopIndex(this.$scope),e.isDefined(this.topIndex)||(this.topIndex=0,this.bindTopIndex.assign(this.$scope,0)),this.$scope.$watch(this.bindTopIndex,e.bind(this,function(t){t!==this.topIndex&&this.scrollToIndex(t)}))):this.topIndex=0,this.scroller=l[0].querySelector(".md-virtual-repeat-scroller"),this.sizer=this.scroller.querySelector(".md-virtual-repeat-sizer"),this.offsetter=this.scroller.querySelector(".md-virtual-repeat-offsetter");var c=e.bind(this,this.updateSize);t(e.bind(this,function(){c();var t=i.debounce(c,10,null,!1),s=e.element(r);this.size||t(),s.on("resize",t),h.$on("$destroy",function(){s.off("resize",t)}),h.$emit("$md-resize-enable"),h.$on("$md-resize",c)}))}function r(t){return{controller:h,priority:1e3,require:["mdVirtualRepeat","^^mdVirtualRepeatContainer"],restrict:"A",terminal:!0,transclude:"element",compile:function(e,i){var s=i.mdVirtualRepeat,n=s.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/),o=n[1],r=t(n[2]),h=i.mdExtraName&&t(i.mdExtraName);return function(t,e,i,s,n){s[0].link_(s[1],n,o,r,h)}}}}function h(t,i,s,n,o,r,h,l){this.$scope=t,this.$element=i,this.$attrs=s,this.$browser=n,this.$document=o,this.$rootScope=r,this.$$rAF=h,this.onDemand=l.parseAttributeBoolean(s.mdOnDemand),this.browserCheckUrlChange=n.$$checkUrlChange,this.newStartIndex=0,this.newEndIndex=0,this.newVisibleEnd=0,this.startIndex=0,this.endIndex=0,this.itemSize=t.$eval(s.mdItemSize)||null,this.isFirstRender=!0,this.isVirtualRepeatUpdating_=!1,this.itemsLength=0,this.unwatchItemSize_=e.noop,this.blocks={},this.pooledBlocks=[],t.$on("$destroy",e.bind(this,this.cleanupBlocks_))}function l(t){if(!e.isFunction(t.getItemAtIndex)||!e.isFunction(t.getLength))throw Error("When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement functions getItemAtIndex() and getLength() ");this.model=t}o.$inject=["$$rAF","$mdUtil","$mdConstant","$parse","$rootScope","$window","$scope","$element","$attrs"],h.$inject=["$scope","$element","$attrs","$browser","$document","$rootScope","$$rAF","$mdUtil"],r.$inject=["$parse"],e.module("material.components.virtualRepeat",["material.core","material.components.showHide"]).directive("mdVirtualRepeatContainer",s).directive("mdVirtualRepeat",r);var a=3;o.prototype.register=function(t){this.repeater=t,e.element(this.scroller).on("scroll wheel touchmove touchend",e.bind(this,this.handleScroll_))},o.prototype.isHorizontal=function(){return this.horizontal},o.prototype.getSize=function(){return this.size},o.prototype.setSize_=function(t){var e=this.getDimensionName_();this.size=t,this.$element[0].style[e]=t+"px"},o.prototype.unsetSize_=function(){this.$element[0].style[this.getDimensionName_()]=this.oldElementSize,this.oldElementSize=null},o.prototype.updateSize=function(){this.originalSize||(this.size=this.isHorizontal()?this.$element[0].clientWidth:this.$element[0].clientHeight,this.handleScroll_(),this.repeater&&this.repeater.containerUpdated())},o.prototype.getScrollSize=function(){return this.scrollSize},o.prototype.getDimensionName_=function(){return this.isHorizontal()?"width":"height"},o.prototype.sizeScroller_=function(t){var e=this.getDimensionName_(),i=this.isHorizontal()?"height":"width";if(this.sizer.innerHTML="",ti&&(t=i-1),this.scrollTo(e*t)},o.prototype.resetScroll=function(){this.scrollTo(0)},o.prototype.handleScroll_=function(){var t="rtl"!=document.dir&&"rtl"!=document.body.dir;t||this.maxSize||(this.scroller.scrollLeft=this.scrollSize,this.maxSize=this.scroller.scrollLeft);var e=this.isHorizontal()?t?this.scroller.scrollLeft:this.maxSize-this.scroller.scrollLeft:this.scroller.scrollTop;if(!(e===this.scrollOffset||e>this.scrollSize-this.size)){var i=this.repeater.getItemSize();if(i){var s=Math.max(0,Math.floor(e/i)-a),n=(this.isHorizontal()?"translateX(":"translateY(")+(!this.isHorizontal()||t?s*i:-(s*i))+"px)";if(this.scrollOffset=e,this.offsetter.style.webkitTransform=n,this.offsetter.style.transform=n,this.bindTopIndex){var o=Math.floor(e/i);o!==this.topIndex&&othis.container.getScrollSize())&&(this.items instanceof l&&this.items.$$includeIndexes(this.newStartIndex,this.newEndIndex),this.virtualRepeatUpdate_(this.items,this.items)))):(this.unwatchItemSize_&&this.unwatchItemSize_!==e.noop&&this.unwatchItemSize_(),this.unwatchItemSize_=this.$scope.$watchCollection(this.repeatListExpression,e.bind(this,function(t){t&&t.length&&this.readItemSize_()})),void(this.$rootScope.$$phase||this.$scope.$digest()))},h.prototype.getItemSize=function(){return this.itemSize},h.prototype.getItemCount=function(){return this.itemsLength},h.prototype.virtualRepeatUpdate_=function(t,i){this.isVirtualRepeatUpdating_=!0;var s=t&&t.length||0,n=!1;if(this.items&&s=this.newEndIndex)&&this.poolBlock_(e)},this),this.$browser.$$checkUrlChange=e.noop;var h,l,a=[],c=[];for(h=this.newStartIndex;h