1(function(window2,factory2){factory2(window2.Flickity,window2.fizzyUIUtils)})(window,function(Flickity,utils){var Slide=Flickity.Slide,slideUpdateTarget=Slide.prototype.updateTarget;Slide.prototype.updateTarget=function(){if(slideUpdateTarget.apply(this,arguments),!!this.parent.options.fade){var slideTargetX=this.target-this.x,firstCellX=this.cells[0].x;this.cells.forEach(function(cell){var targetX=cell.x-firstCellX-slideTargetX;cell.renderPosition(targetX)})}};var proto=Flickity.prototype;Flickity.createMethods.push("_createFade"),proto._createFade=function(){this.fadeIndex=this.selectedIndex,this.prevSelectedIndex=this.selectedIndex,this.on("select",this.onSelectFade),this.on("dragEnd",this.onDragEndFade),this.on("settle",this.onSettleFade),this.on("activate",this.onActivateFade),this.on("deactivate",this.onDeactivateFade)};var updateSlides=proto.updateSlides;proto.updateSlides=function(){updateSlides.apply(this,arguments),this.options.fade},proto.onSelectFade=function(){this.fadeIndex=Math.min(this.prevSelectedIndex,this.slides.length-1),this.prevSelectedIndex=this.selectedIndex},proto.onSettleFade=function(){if(delete this.didDragEnd,!!this.options.fade)var fadedSlide=this.slides[this.fadeIndex]},proto.onDragEndFade=function(){this.didDragEnd=!0},proto.onActivateFade=function(){this.options.fade&&this.element.classList.add("is-fade")},proto.onDeactivateFade=function(){this.options.fade&&this.element.classList.remove("is-fade")};var positionSlider=proto.positionSlider;proto.positionSlider=function(){if(!this.options.fade){positionSlider.apply(this,arguments);return}this.fadeSlides(),this.dispatchScrollEvent()};var positionSliderAtSelected=proto.positionSliderAtSelected;proto.positionSliderAtSelected=function(){this.options.fade&&this.setTranslateX(0),positionSliderAtSelected.apply(this,arguments)},proto.fadeSlides=function(){if(!(this.slides.length<2)){var indexes=this.getFadeIndexes(),fadeSlideA=this.slides[indexes.a],fadeSlideB=this.slides[indexes.b],distance=this.wrapDifference(fadeSlideA.target,fadeSlideB.target),progress=this.wrapDifference(fadeSlideA.target,-this.x);progress=progress/distance;var fadeHideIndex=indexes.a;this.isDragging&&(fadeHideIndex=progress>.5?indexes.a:indexes.b);var isNewHideIndex=this.fadeHideIndex!=null&&this.fadeHideIndex!=fadeHideIndex&&this.fadeHideIndex!=indexes.a&&this.fadeHideIndex!=indexes.b;this.fadeHideIndex=fadeHideIndex}},proto.getFadeIndexes=function(){return!this.isDragging&&!this.didDragEnd?{a:this.fadeIndex,b:this.selectedIndex}:this.options.wrapAround?this.getFadeDragWrapIndexes():this.getFadeDragLimitIndexes()},proto.getFadeDragWrapIndexes=function(){var distances=this.slides.map(function(slide,i){return this.getSlideDistance(-this.x,i)},this),absDistances=distances.map(function(distance2){return Math.abs(distance2)}),minDistance=Math.min.apply(Math,absDistances),closestIndex=absDistances.indexOf(minDistance),distance=distances[closestIndex],len=this.slides.length,delta=distance>=0?1:-1;return{a:closestIndex,b:utils.modulo(closestIndex+delta,len)}},proto.getFadeDragLimitIndexes=function(){for(var dragIndex=0,i=0;i<this.slides.length-1;i++){var slide=this.slides[i];if(-this.x<slide.target)break;dragIndex=i}return{a:dragIndex,b:dragIndex+1}},proto.wrapDifference=function(a,b){var diff=b-a;if(!this.options.wrapAround)return diff;var diffPlus=diff+this.slideableWidth,diffMinus=diff-this.slideableWidth;return Math.abs(diffPlus)<Math.abs(diff)&&(diff=diffPlus),Math.abs(diffMinus)<Math.abs(diff)&&(diff=diffMinus),diff};var _getWrapShiftCells=proto._getWrapShiftCells;proto._getWrapShiftCells=function(){this.options.fade||_getWrapShiftCells.apply(this,arguments)};var shiftWrapCells=proto.shiftWrapCells;return proto.shiftWrapCells=function(){this.options.fade||shiftWrapCells.apply(this,arguments)},Flickity}); 2//# sourceMappingURL=/cdn/shop/t/324/assets/flickity-fade.js.map?v=70708211373116380081789759285
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.