(function($){'use strict';var dw,dh,rw,rh,lx,ly;var defaults={loadingNotice:'Loading image',errorNotice:'The image could not be loaded',errorDuration:2500,preventClicks:true,onShow:undefined,onHide:undefined};function EasyZoom(target,options){this.$target=$(target);this.opts=$.extend({},defaults,options);if(this.isOpen===undefined){this._init();} return this;} EasyZoom.prototype._init=function(){var self=this;this.$link=this.$target.find('a');this.$image=this.$target.find('img');this.$flyout=$('
');this.$notice=$('');this.$target.on('mouseenter.easyzoom touchstart.easyzoom',function(e){self.isMouseOver=true;if(!e.originalEvent.touches||e.originalEvent.touches.length===1){e.preventDefault();self.show(e,true);}}).on('mousemove.easyzoom touchmove.easyzoom',function(e){if(self.isOpen){e.preventDefault();self._move(e);}}).on('mouseleave.easyzoom touchend.easyzoom',function(){self.isMouseOver=false;if(self.isOpen){self.hide();}});if(this.opts.preventClicks){this.$target.on('click.easyzoom','a',function(e){e.preventDefault();});}};EasyZoom.prototype.show=function(e,testMouseOver){var w1,h1,w2,h2;var self=this;if(!this.isReady){this._load(this.$link.attr('href'),function(){if(self.isMouseOver||!testMouseOver){self.show(e);}});return;} this.$target.append(this.$flyout);w1=this.$target.width();h1=this.$target.height();w2=this.$flyout.width();h2=this.$flyout.height();dw=this.$zoom.width()-w2;dh=this.$zoom.height()-h2;rw=dw/w1;rh=dh/h1;this.isOpen=true;if(this.opts.onShow){this.opts.onShow.call(this);} if(e){this._move(e);}};EasyZoom.prototype._load=function(href,callback){var zoom=new Image();this.$target.addClass('is-loading').append(this.$notice.text(this.opts.loadingNotice));this.$zoom=$(zoom);zoom.onerror=$.proxy(function(){var self=this;this.$notice.text(this.opts.errorNotice);this.$target.removeClass('is-loading').addClass('is-error');this.detachNotice=setTimeout(function(){self.$notice.detach();self.detachNotice=null;},this.opts.errorDuration);},this);zoom.onload=$.proxy(function(){if(!zoom.width){return;} this.isReady=true;this.$notice.detach();this.$flyout.html(this.$zoom);this.$target.removeClass('is-loading').addClass('is-ready');callback();},this);zoom.style.position='absolute';zoom.src=href;};EasyZoom.prototype._move=function(e){if(e.type.indexOf('touch')===0){var touchlist=e.touches||e.originalEvent.touches;lx=touchlist[0].pageX;ly=touchlist[0].pageY;} else{lx=e.pageX||lx;ly=e.pageY||ly;} var offset=this.$target.offset();var pt=ly-offset.top;var pl=lx-offset.left;var xt=Math.ceil(pt*rh);var xl=Math.ceil(pl*rw);if(xl<0||xt<0||xl>dw||xt>dh){this.hide();} else{this.$zoom.css({top:''+(xt*-1)+'px',left:''+(xl*-1)+'px'});}};EasyZoom.prototype.hide=function(){if(this.isOpen){this.$flyout.detach();this.isOpen=false;if(this.opts.onHide){this.opts.onHide.call(this);}}};EasyZoom.prototype.swap=function(standardSrc,zoomHref,srcsetStringOrArray){this.hide();this.isReady=false;if(this.detachNotice){clearTimeout(this.detachNotice);} if(this.$notice.parent().length){this.$notice.detach();} if($.isArray(srcsetStringOrArray)){srcsetStringOrArray=srcsetStringOrArray.join();} this.$target.removeClass('is-loading is-ready is-error');this.$image.attr({src:standardSrc,srcset:srcsetStringOrArray});this.$link.attr('href',zoomHref);};EasyZoom.prototype.teardown=function(){this.hide();this.$target.removeClass('is-loading is-ready is-error').off('.easyzoom');if(this.detachNotice){clearTimeout(this.detachNotice);} delete this.$link;delete this.$zoom;delete this.$image;delete this.$notice;delete this.$flyout;delete this.isOpen;delete this.isReady;};$.fn.easyZoom=function(options){return this.each(function(){var api=$.data(this,'easyZoom');if(!api){$.data(this,'easyZoom',new EasyZoom(this,options));} else if(api.isOpen===undefined){api._init();}});};if(typeof define==='function'&&define.amd){define(function(){return EasyZoom;});} else if(typeof module!=='undefined'&&module.exports){module.exports=EasyZoom;}})(jQuery);jQuery(document).ready(function($){'use strict';if(!$('body').hasClass('mobile')&&!$().zoom){var $easyzoom=$(".easyzoom").easyZoom({preventClicks:true,loadingNotice:' ',errorNotice:' '});if($('.easyzoom').length>0){var easyzoom_api=$easyzoom.data('easyZoom');$("table.variations").on('change','select',function(){easyzoom_api.teardown();easyzoom_api._init();});}} function nectar_scrollToY(scrollTargetY,speed,easing){var scrollY=window.scrollY||document.documentElement.scrollTop,scrollTargetY=scrollTargetY||0,speed=speed||2000,easing=easing||'easeOutSine',currentTime=0;var time=Math.max(.1,Math.min(Math.abs(scrollY-scrollTargetY)/speed,.8));var easingEquations={easeInOutQuint:function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,5);} return 0.5*(Math.pow((pos-2),5)+2);}};function tick(){currentTime+=1/60;var p=currentTime/time;var t=easingEquations[easing](p);if(p<1){requestAnimationFrame(tick);window.scrollTo(0,scrollY+((scrollTargetY-scrollY)*t));}else{window.scrollTo(0,scrollTargetY);}} tick();} function initZoomForTarget(zoomTarget){var leftAlignedBool=(window.innerWidth>999&&$('[data-gallery-style="left_thumb_sticky"]').length>0)?true:false;var galleryWidth=(leftAlignedBool)?$('.woocommerce-product-gallery .product-slider').width():$('.woocommerce-product-gallery').width(),zoomEnabled=false;$(zoomTarget).each(function(index,target){var image=zoomTarget.find('img[data-large_image_width]');if(image.data('large_image_width')>galleryWidth){zoomEnabled=true;return false;}});if(zoomEnabled){var zoom_options=$.extend({touch:false},wc_single_product_params.zoom_options);if('ontouchstart'in document.documentElement){if(leftAlignedBool){}else{zoom_options.on='click';}} zoomTarget.trigger('zoom.destroy');zoomTarget.zoom(zoom_options);}} var $mainProdSlider=false;var $thumbProdSlider=false;function NectarWooReviewsModal(){this.$el=$('#tab-reviews #review_form_wrapper');this.$button=$('#reviews .nectar-product-reviews-trigger');this.setup();this.state={open:false};} NectarWooReviewsModal.prototype.setup=function(){var that=this;this.$el.addClass('modal');if($('body.material').length>0){this.$el.find('#review_form').prepend('');} else{this.$el.find('#review_form').prepend('');} this.$el.detach();$('body').append(this.$el);if($('body').find('.nectar-slide-in-cart-bg').length==0){$('body').append('');} this.$closeBtnEl=this.$el.find('.nectar-close-btn-wrap');this.$bgEl=$('.nectar-slide-in-cart-bg');this.timeout='';this.$button.on('click',function(){that.open();return false;});$('#review_form .nectar-close-btn-wrap, .nectar-slide-in-cart-bg').on('click',function(e){that.close();e.preventDefault();});};NectarWooReviewsModal.prototype.open=function(){clearTimeout(this.timeout);this.$closeBtnEl.addClass('open');this.$el.addClass('open');this.$bgEl.addClass('open').addClass('revealed');this.state.open=true;};NectarWooReviewsModal.prototype.close=function(){var that=this;this.$el.removeClass('open');this.$bgEl.removeClass('open');this.$closeBtnEl.removeClass('open');this.timeout=setTimeout(function(){that.$bgEl.removeClass('revealed');},400);this.state.open=false;};if($('.nectar-product-reviews-trigger').length>0){var reviewsModal=new NectarWooReviewsModal();} function nectarWooProdSliderInit(){$mainProdSlider=$('.product div.images .flickity.product-slider .slider').flickity({draggable:true,imagesLoaded:true,prevNextButtons:false,pageDots:false,resize:true,adaptiveHeight:true,on:{change:function(index){if($().zoom){initZoomForTarget(this.$element.find('.flickity-slider > .slide:eq('+index+')'));} this.$element.find('.flickity-slider > .slide').removeClass('flex-active-slide');this.$element.find('.flickity-slider > .slide:eq('+index+')').addClass('flex-active-slide');},dragStart:function(){$('.product div.images .flickity.product-slider .slider').addClass('is-moving');},dragEnd:function(){$('.product div.images .flickity.product-slider .slider').removeClass('is-moving');}}});$thumbProdSlider=$('.product div .flickity.product-thumbs .slider').flickity({asNavFor:'.images .flickity.product-slider .slider',contain:true,resize:true,groupCells:true,draggable:true,percentPosition:true,adaptiveHeight:true,imagesLoaded:true,prevNextButtons:true,cellAlign:'left',pageDots:false});} function nectarWooProdSliderDestroy(){$mainProdSlider.flickity('destroy');$thumbProdSlider.flickity('destroy');} function leftAlignedGalleryZoom(){$('[data-gallery-style="left_thumb_sticky"] .flickity.product-slider .slide').each(function(i){initZoomForTarget($(this));});} function leftAlignedRelationsInit(){$('[data-gallery-style="left_thumb_sticky"] .flickity.product-slider .slide').each(function(i){i=i+1;$(this).find('.woocommerce-product-gallery__image').attr('id','nectar_woo_gallery_slide_'+i);});leftAlignedGalleryZoom();$('[data-gallery-style="left_thumb_sticky"] .flickity.product-thumbs .thumb').each(function(i){i=i+1;if($(this).find('.thumb-inner > a.skip-hash').length==0){$(this).find('.thumb-inner').wrapInner('');$(this).find('.thumb-inner a').on('click',function(e){e.preventDefault();});}});if($('.product[data-gallery-style="left_thumb_sticky"] .product-thumbs .thumb-inner > a.active').length==0){$('.product[data-gallery-style="left_thumb_sticky"] .product-thumbs .thumb:first-child .thumb-inner > a').addClass('active');}} function leftAlignedRelationsDestroy(){$('[data-gallery-style="left_thumb_sticky"] .flickity.product-slider .slide').each(function(){$(this).find('.woocommerce-product-gallery__image').attr('id','');});$('[data-gallery-style="left_thumb_sticky"] .flickity.product-thumbs .thumb').each(function(){$(this).find('.thumb-inner > a > img').unwrap();});} var leftAlignedScrollTop=$(window).scrollTop();var headerSpace=$('#header-space').height();function leftAlignedActive(){leftAlignedScrollTop=window.nectarDOMInfo.scrollTop||$(window).scrollTop();var closestToTop=$('.product[data-gallery-style="left_thumb_sticky"] .images .slide:first-child');$('.product[data-gallery-style="left_thumb_sticky"] .product-slider .slide').each(function(){if($(this).offset().top-leftAlignedScrollTop