1var ProductDetail2Module;(function(n){var t=function(){function n(n,t){var i=this;this.AddToWishList=function(n){i.Scope.TrackEvent_(TrackingEventType.AddToWishlist,{ProductModel:n},i.GetDataForAddToWishlistEvent)} 2;this.GetDataForAddToWishlistEvent=function(n,t){switch(t){case 1:return{event:"Add to Wishlist",eventAction:n.ProductModel.Name,id:n.ProductModel.Id.toString(),eventLabel:n.ProductModel.Level2.Slug}} 3};this.GetDataForProductDetailLoadEvent=function(n,t){switch(t){case 1:return i.GetGtmDataForProductDetailLoadEvent(n.ProductView,n.Context,n.ListName);default:throw new Error("Tracker service type ("+ 4t+") is not implemented");}};this.GetGtmDataForProductDetailLoadEvent=function(n,t,i){var r=n.Product,u=!!r.ListPrice&&!!r.SalePrice?r.ListPrice-r.SalePrice:0;return{event:"dlReadyDetail",ecommerce:{detail: 5{products:[{id:r.Id,name:r.Name,list:i,position:1,category:r.Category?r.Category:"N/A",brand:r.Brand?r.Brand:"N/A",variant:"N/A",price:r.SalePrice||r.ListPrice,dimension14:TrackerHelperModule.TrackerHelperService. 6GetCategoryData(r.Categories,0,"PDept"),dimension15:TrackerHelperModule.TrackerHelperService.GetCategoryData(r.Categories,0,"Dept"),dimension20:r.Availability?"yes":"no",dimension21:r.IsNew?"yes":"no", 7dimension22:r.IsOnSale?"yes":"no",dimension35:u,dimension36:r.ListPrice,dimension49:r.ProfileNumber,dimension50:t.Market,dimension51:t.Cluster,dimension93:TrackerHelperModule.TrackerHelperService.GetVTOEnabled( 8r.Categories),metric3:u,metric4:r.ListPrice}]}}}};this.GetDataForAddToCartEvent=function(n,t){switch(t){case 1:return n.SelectedProduct.Quantity>0?i.GetGtmDataForAddToCartEvent(n.Product,n.SelectedProduct, 9n.Context,n.ListName):i.GetGtmDataForRemoveFromBasketEvent(n.Product,n.SelectedProduct,n.Context,n.ListName);default:throw new Error("Tracker service type ("+t+") is not implemented");}};this.GetGtmDataForAddToCartEvent= 10function(n,t,i,r){var u=n.SalePrice!=null?n.ListPrice-n.SalePrice:"0",f=window.top.AvonShopBambuserContext?window.top.AvonShopBambuserContext.ShowId:null;f&&(r="livestream"+f+r);return{event:"addToCart", 11ecommerce:{add:{actionField:{list:r},products:[{id:n.Id,name:n.Name,list:r,position:"1",category:n.Category?n.Category:"N/A",brand:n.Brand?n.Brand:"N/A",variant:t.VariantName?t.VariantName:"N/A",price: 12n.SalePrice||n.ListPrice,quantity:t.Quantity,dimension14:TrackerHelperModule.TrackerHelperService.GetCategoryData(n.Categories,0,"PDept"),dimension15:TrackerHelperModule.TrackerHelperService.GetCategoryData( 13n.Categories,0,"Dept"),dimension20:n.Availability?"yes":"no",dimension21:n.IsNew?"yes":"no",dimension22:n.IsOnSale?"yes":"no",dimension35:u,dimension36:n.ListPrice,dimension49:n.ProfileNumber,dimension50: 14i.Market,dimension51:i.Cluster,dimension59:"checkout",dimension93:TrackerHelperModule.TrackerHelperService.GetVTOEnabled(n.Categories),metric3:u,metric4:n.ListPrice}]}}}};this.GetGtmDataForRemoveFromBasketEvent= 15function(n,t,i,r){var u=n.SalePrice!=null?n.ListPrice-n.SalePrice:"0";return{event:"removeFromCart",ecommerce:{remove:{products:[{id:n.Id,name:n.Name,list:r,position:"1",category:n.Category?n.Category: 16"N/A",brand:n.Brand?n.Brand:"N/A",variant:t.VariantName?t.VariantName:"N/A",price:n.SalePrice||n.ListPrice,quantity:Math.abs(t.Quantity),dimension14:n.PDept!=null?n.PDept.Name:"N/A",dimension15:n.Dept!= 17null?n.Dept.Name:"N/A",dimension20:n.Availability?"yes":"no",dimension21:n.IsNew?"yes":"no",dimension22:n.IsOnSale?"yes":"no",dimension35:u,dimension36:n.ListPrice,dimension49:n.ProfileNumber,dimension50: 18i.Market,dimension51:i.Cluster,dimension59:"checkout",dimension93:TrackerHelperModule.TrackerHelperService.GetVTOEnabled(n.Categories),metric3:u,metric4:n.ListPrice}]}}}};this.AddToCart=function(n,t,r, 19u){i.Scope.TrackEvent_(t.Quantity>0?TrackingEventType.AddToCart:TrackingEventType.RemoveFromBasket,{Product:n,SelectedProduct:t,Context:r,ListName:u},i.GetDataForAddToCartEvent,1)};this.Scope=n;this.NotifyMeTrackerService= 20t}return n.prototype.SetAvonAnalyticsObject=function(n){try{var t={product_page_url:window.location.href};n.Product!==null&&(t.product_name=n.Product.Name);n.Product.Level2!==null&&(t.product_brand=n. 21BrandName,t.product_category=n.Product.Level2.Name);n.Product.PDept!==null&&(t.product_subcategory=n.Product.PDept.Name);n.Product.ListPrice!==null&&(t.product_unit_price=n.Product.ListPrice.toString( 22));n.Product.SalePrice!==null&&(t.product_sale_price=n.Product.SalePrice.toString());t.product_onsale=n.Product.IsOnSale?"yes":"no";t.product_isnew=n.Product.IsNew?"yes":"no";t.product_isavailable=n.Product. 23Availability===1?"yes":"no";t.product_SKUs=[];n.Product.SingleVariantSku===""?(n.NonShadeVariants!==null&&n.NonShadeVariants.length!==0&&(t.product_SKUs=_.pluck(n.NonShadeVariants,"Value")),n.ShadeVariants. 24length!==0&&(t.product_SKUs=_.pluck(n.ShadeVariants[0].Variants,"Sku"))):t.product_SKUs.push(n.Product.SingleVariantSku);this.Scope.Analytics.MergeAnalytics(t)}catch(i){}},n.prototype.NotifyMe=function( 25n){this.Scope.TrackEvent_(TrackingEventType.NotifyMe,n,this.NotifyMeTrackerService.GetDataForNotifyMeEvent)},n.prototype.IncreaseQty=function(){this.Scope.Analytics.TrackEvent(TrackingEventType.ChooseQuantityUp, 26null)},n.prototype.DecreaseQty=function(){this.Scope.Analytics.TrackEvent(TrackingEventType.ChooseQuantityDown,null)},n.prototype.SocialShareButton=function(){this.Scope.Analytics.TrackEvent(TrackingEventType. 27ProductDetailShareIntent,null)},n.prototype.OnSocialShare=function(n){this.Scope.Analytics.TrackEvent(TrackingEventType.ProductDetailShareType,{content_share_type:n,content_share_url:window.location.href})} 28,n}();n.ProductDetailTrackerService=t;var i=function(){function n(){}return n}();n.GetDataForAddToCartEventModel=i;var r=function(){function n(){}return n}();
28n.GetDataForProductDetailLoadEventModel=r; 29var u=function(){function n(){}return n}();n.GetDataForAddToWishlistEventModel=u})(ProductDetail2Module||(ProductDetail2Module={}));app.service("ProductDetailTrackerService",["$rootScope","NotifyMeTrackerService", 30ProductDetail2Module.ProductDetailTrackerService]);var ProductDetail2Module;(function(n){var t=function(){function n(){}return n}();n.NotifyMeFormModel=t})(ProductDetail2Module||(ProductDetail2Module= 31{}));var ProductDetail2Module;(function(n){var t=function(){function n(){}return n}();n.SelectedProductModel=t})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;(function(n){ 32var t=["$scope","$rootScope","CartService","ProductService","WishListService","ProductDetailTrackerService","ApptusNotificationService","RecommendationEngineService","DynamicYieldTrackingService",function( 33t,i,r,u,f,e,o,s,h){var c;c=t.isQuantitySelectorAddsToBag?new n.AddToCartDirectiveQuantitySelectorAddsBehaviour(t,e,r):new n.AddToCartDirectiveQuantitySelectorDoesNotAddBehaviour(t);t.addedToWishlist=!1; 34t.notifyMeFormModel=new n.NotifyMeFormModel;t.notifyMeFormModel.customerEmail=t.customerEmail;c.initialization();t.product.IsConditional&&t.product.Conditional&&(!t.conditionalProductMessages||t.conditionalProductMessages. 35length<1)&&(t.conditionalProductMessages=t.product.Conditional.Messages);t.isAddToBagVisible=function(){return c.isAddToBagVisible()};t.isQuantitySelectorVisible=function(){return c.isQuantitySelectorVisible( 36)};t.addToCartClick=function(){var n=c.quantityToAdd();t.addToCart(n)};t.addToCart=function(n){var u,i=t.selectedProduct();if(i.Sku!=""){u={Sku:i.Sku,Quantity:n,Campaign:_ShopContext.CampaignNumber};r. 37AddToCart(u,"",t.product.SalePrice);o.AddtoCartNotification(t.product.Id,i.Sku,t.product.NotificationTicket);i.Quantity=n;e.AddToCart(t.product,i,_ShopContext,window.location.pathname);var f={Type:6,ProductId: 38t.product.ProductId};s.SendRecommendationEvent(f)}};t.setQuantity=function(){var n=t.selectedProduct(),i=_ShopContext.CampaignNumber;r.GetCartItem(n.Sku,i)};t.notifyMeSubmit=function(){var i,n,r;r=t.notifyMeFormModel. 39customerEmail;n=t.product;i={EmailAddress:r,LanguageId:0,ProductId:n.Id,ProductName:n.Name};u.AddNotification(i)};t.notifyMe=function(){t.notifyMeSubmitted=!1;t.showModal("NotifyMeModal",{DisableClose: 40!0,Model:null,Scope:null})};t.closeNotifyMe=function(){t.closeModal("NotifyMeModal")};t.increaseQty=function(){return c.increaseQty()};t.decreaseQty=function(){return c.decreaseQty()};t.addToWishlist= 41function(){var n;n=t.product;f.Add(n.Id).then(l)};t.removeFromWishlist=function(){var n;n=t.product;f.RemoveProduct(n.Id).then(l)};t.hasActiveVariantOrConditionalCanAdd=function(){var n=!1;return t.product. 42Conditional!=null&&(n=t.product.Conditional.CanAddToCart),t.product.Availability==1&&t.product.HasActiveVariant||n};t.hasActiveVariant=function(){return t.product.Availability==1&&t.product.HasActiveVariant} 43;t.hasSelectedVariant=function(){var n=t.selectedProduct();return n.Sku!=""};t.selectedProduct=function(){var i=new n.SelectedProductModel;return i.Sku=t.product.SingleVariantSku,i.Fsc=t.product.SingleVariantFsc, 44t.selectedShadeVariant!=null&&typeof t.selectedShadeVariant!="undefined"?(i.Sku=t.selectedShadeVariant.Sku,i.VariantName=t.selectedShadeVariant.Name,i.DisplayLineNumber=t.selectedShadeVariant.DisplayLineNumber, 45i.Fsc=t.selectedShadeVariant.Fsc):t.selectedSizeVariant!=null&&typeof t.selectedSizeVariant!="undefined"&&(i.Sku=t.selectedSizeVariant.Value,i.Fsc=t.selectedSizeVariant.Fsc),i.Sku=i==null?"":i.Sku.trim( 46),i};t.isConditional=function(){return t.product.Availability===5};t.isNotForIndividualSale=function(){return t.product.Availability===0};t.shouldShowNotifyMeButton=!t.isConditional()&&!t.product.IsNotAvailable&& 47!t.hasActiveVariant()&&!t.isNotForIndividualSale();t.$on("ProductService_AddNotificationSuccess",function(){t.notifyMeSubmitted=!0;e.NotifyMe(t.product)});t.$on("WishListService_AddWishListSuccess",function( 48){t.addedToWishlist=!0;e.AddToWishList(t.product);var n={Type:7,ProductId:t.product.Id};s.SendRecommendationEvent(n)});t.$on("CartService_GetCartItemSuccess",function(n,t){c.setNewQuantity(t.Quantity)} 49);t.$on("CartService.RemoveProductSuccess",function(){i.LoadSession();i.$broadcast("AddToCartDirective_ShowMiniCart")});
49t.$watch("selectedShadeVariant",function(){t.setQuantity()});t.$watch("selectedSizeVariant", 50function(){t.setQuantity()});t.$on("CartService_AddSuccess",function(n,i){t.setQuantity();a(i.ConditionalProducts);var u=c.quantityToAdd(),f=t.selectedProduct();if(t.isDynamicYieldEnabled&&u>0){var e= 51t.product.SalePrice>0?t.product.SalePrice:t.product.ListPrice;r.GetCartForDY().then(function(n){var i=h.GetCartModel(n),r={productId:f.Fsc,currency:t.currency,quantity:u,value:u*e,cart:i};h.TrackAddToCart( 52r)})}});t.$on("SessionService_GetSessionSuccess",function(n,t){a(t.CartSummary.ConditionalProducts)});function l(){f.GetWishList().then(function(n){var r;r=t.product;t.addedToWishlist=!1;for(var i=0;i< 53n.length;i++)if(n[i].Id===r.Id){t.addedToWishlist=!0;break}})}function a(n){n&&n.forEach(function(n){n.ProductId===t.product.Id&&(t.conditionalProductMessages=n.Messages,t.product.Conditional.CanAddToCart= 54n.CanAddToCart)})}l();i.Session&&i.Session.CartSummary&&a(i.Session.CartSummary.ConditionalProducts)}],i=function(){function n(n,i){return{restrict:"E",replace:!1,template:"",scope:{product:"=",selectedShadeVariant: 55"=",customerEmail:"=",showModal:"=",closeModal:"=",selectedSizeVariant:"=",quantity:"=",isQuantitySelectorAddsToBag:"=",allowedMaxQuantityProductInCart:"=",isDynamicYieldEnabled:"=",currency:"="},controller: 56t,link:function(t,r){var u=n.get("addToCart.html");r.append(i(u)(t));t.setQuantity()}}}return n}();n.AddToCartDirective=i})(ProductDetail2Module||(ProductDetail2Module={}));app.directive("pdpAddToCart", 57["$templateCache","$compile",ProductDetail2Module.AddToCartDirective]);var ProductDetail2Module;(function(n){var t=function(){function n(n,t,i){this.scope=n;this.productDetailTrackerService=t;this.cartService= 58i}return n.prototype.initialization=function(){this.scope.quantity=1},n.prototype.isAddToBagVisible=function(){return!this.scope.quantity},n.prototype.isQuantitySelectorVisible=function(){return!!this. 59scope.quantity},n.prototype.quantityToAdd=function(){return 1},n.prototype.increaseQty=function(){this.scope.allowedMaxQuantityProductInCart&&this.scope.allowedMaxQuantityProductInCart>0&&this.scope.allowedMaxQuantityProductInCart<= 60this.scope.quantity||(this.scope.addToCart(1),this.productDetailTrackerService.IncreaseQty())},n.prototype.decreaseQty=function(){var n=this.scope.quantity;if(this.scope.quantity>0){if(this.scope.quantity--, 61n==1){var t=this.scope.selectedProduct();this.cartService.RemoveProduct(t.Sku,_ShopContext.CampaignNumber.toString())}else this.scope.addToCart(-1);this.productDetailTrackerService.DecreaseQty()}},n.prototype. 62setNewQuantity=function(n){this.scope.quantity=typeof n!="undefined"?n:0},n}();n.AddToCartDirectiveQuantitySelectorAddsBehaviour=t})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module; 63(function(n){var t=function(){function n(n){this.scope=n}return n.prototype.initialization=function(){},n.prototype.isAddToBagVisible=function(){return!0},n.prototype.isQuantitySelectorVisible=function( 64){return!0},n.prototype.quantityToAdd=function(){return this.scope.quantity},n.prototype.increaseQty=function(){this.scope.allowedMaxQuantityProductInCart&&this.scope.allowedMaxQuantityProductInCart>0&& 65this.scope.allowedMaxQuantityProductInCart<=this.scope.quantity||this.scope.quantity++},n.prototype.decreaseQty=function(){this.scope.quantity>1&&this.scope.quantity--},n.prototype.setNewQuantity=function( 66){this.scope.quantity=1},n}();n.AddToCartDirectiveQuantitySelectorDoesNotAddBehaviour=t})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;(function(){})(ProductDetail2Module|| 67(ProductDetail2Module={}));var ProductDetail2Module;(function(){})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;(function(n){var t=["$scope","$location","$rootScope",function( 68n){n.availableShadeVariants=_.where(n.shadeVariants,function(n){return n.IsAvailable});n.showShadeColorHexSwatches=n.availableShadeVariants.every(function(n){return!!n.ColorHex});n.isSectionExpanded=!0; 69n.selectShade=function(t){n.selectedShadeVariant=t;window.YMK.isLoaded()&&window.YMK.applyMakeupBySku(t.TryItOnMakeupSku)};n.hasShadeVariants&&(n.selectedShadeVariant=n.availableShadeVariants[0]);n.toggleSectionExpansion= 70function(){n.isSectionExpanded=!n.isSectionExpanded;n.isSectionExpanded||n.scrollIntoView()};n.format=function(n,t){return n.replace("{0}",t)}}],i=function(){function n(n,i,r){return{restrict:"E",replace: 71!1,template:"",scope:{hasShadeVariants:"@",selectedShadeVariant:"=",shadeVariants:"=",shadeSelectionChanged:"&",isDesktopLayout:"=",swatchZoomEnabled:"="},controller:t,link:function(t,u){var f=n.get("shadeSelector.html"); 72u.append(i(f)(t));r(function(){var n=$(u).find(".Selector"),i=n.first(),r=n.last();i.length>0&&r.length>0&&i[0].getBoundingClientRect().top!==r[0].getBoundingClientRect().top&&
72(t.isShadeExpanderVisible= 73!0)},200);t.scrollIntoView=function(){$(u).scrollintoview({duration:150})}}}}return n}();n.ShadeSelectorDirective=i})(ProductDetail2Module||(ProductDetail2Module={}));app.directive("pdpShadeSelector", 74["$templateCache","$compile","$timeout",ProductDetail2Module.ShadeSelectorDirective]);var __extends=this.__extends||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);function r(){this.constructor= 75n}r.prototype=t.prototype;n.prototype=new r},ProductDetail2Module;(function(n){var t=function(n){__extends(t,n);function t($scope,t,i,r,u,f,e,o,s,h,c,l,a){var v=this;n.call(this,$scope);this.CartService= 76f;this.ProductService=e;this.WishListService=o;this.ProductDetailTrackerService=s;this.ProductDetailRatingService=h;this.SocialShareTrackerService=c;this.ApptusNotificationService=l;this.recommendationEngineService= 77a;this.timer=null;this.clicks=0;this.notifyMeSubmitted=!1;this.addedToWishlist=!1;this.waitingForSecondClick=!1;this.SectionOpenStates=[];this.SectionExpandedStates=[];this.DesktopOpenSection="Description"; 78this.GetHQYouTubeImage=function(n){return n?n.replace("/1.","/hqdefault."):""};this.HideElementByClass=function(n){$("."+n).hide()};this.Scope=$scope;this.Zoom=new ZoomModule.ZoomController;this.ViewModel. 79ImageUrls=[];this.ViewModel.HasShadeVariants=this.ViewModel.ShadeVariants!==undefined&&this.ViewModel.ShadeVariants!==null&&this.ViewModel.ShadeVariants.length>0&&this.ViewModel.ShadeVariants[0]!==undefined&& 80this.ViewModel.ShadeVariants[0]!==null&&this.ViewModel.ShadeVariants[0].Variants!==null&&this.ViewModel.ShadeVariants[0].Variants.length>0;this.SetDefaultShadeAndSize();this.ViewModel.HasShortDescription= 81this.ViewModel.Product.ShortDescription!==undefined&&this.ViewModel.Product.ShortDescription!==null&&this.ViewModel.Product.ShortDescription.trim()!=="";this.ViewModel.Product.ImageUrl=this.Scope.Cdn. 82ProductImageLarge(this.ViewModel.Product.ProfileNumber,1);this.ViewModel.Product.ImageAbsoluteUrl=this.Scope.Cdn.ProductImageLarge(this.ViewModel.Product.ProfileNumber,1,!0);this.ViewModel.Product.Url= 83window.location.href;a.DisableDefaultRecommendations();$scope.$on("RecommendationEngineService.CustomRecommendation",function(){var n={Type:1,ProductId:v.ViewModel.Product.Id};a.GetRecommendedProducts( 84n)});$scope.$on("SocialSharingDirective_SocialShare",function(n,t){v.Scope.TrackEvent_(TrackingEventType.ProductDetailShareType,{ShareType:t.sharetype,ShareUrl:window.location.href},v.SocialShareTrackerService. 85GetDataForSocialShareEvent)});$scope.$on("Carousel_SlideShown",function(n,t){v.OnCarouselSlideShown(t)});$scope.GetRatingIcon=this.ProductDetailRatingService.GetRatingIcon;$scope.PartialViewLoaded=this. 86Initialize;_.delay(function(){v.LoadImages();v.ProductDetailTrackerService.SetAvonAnalyticsObject(v.ViewModel);v.TrackProductDetailLoad();v.TrackReady();v.SetupTryItOn()},2)}return t.prototype.ImageOrVideoClick= 87function(){$("#popupTryItOnThumb").hide();$("#tryItOnThumb").show();$('<div class="popupTryItOn" id="YMK-module"><\/div>').appendTo("#popupCarouselTryItOn");$(".tryItOn").remove()},t.prototype.CloseImagePopup= 88function(){if(this.Scope.ViewModel.IsPopupOpen=!1,this.ViewModel.Media.length>0&&this.CarouselPopupScope&&this.CarouselPopupScope.currentIndex>=this.ViewModel.ImageUrls.length){var n=this.CarouselPopupScope. 89currentIndex,t=".Slides .DesktopYouTubeFrame"+n,i=".YoutubeThumbnail"+n;$(t).attr("src","");$(t).hide();$(i).show()}$("#PdpImageCarouselDesktop").appendTo(".PdpImageCarouselDesktop");$(".PdpImagePopupBackground"). 90hide();$("body").css("overflow","visible")},t.prototype.InitThumbnail=function(n){n==0&&$($(".Item.ThumbItem")[n]).addClass("Selected");this.Scope.SafeApply()},t.prototype.InitImageAndVideoThumbUrls=function( 91){this.ViewModel.ImageAndVideoThumbUrls=[];for(var n=0;n<this.ViewModel.ImageUrls.length;n++)this.ViewModel.ImageAndVideoThumbUrls.push(this.ViewModel.ImageUrls[n]);for(var n=0;n<this.ViewModel.Media. 92length;n++)this.ViewModel.ImageAndVideoThumbUrls.push(this.GetHQYouTubeImage(this.ViewModel.Media[n].ThumbnailUrl))},t.prototype.ShowImageGalleryPopup=function(){$(".PdpImagePopupBackgroun
92d").show();$( 93".PdpImagePopupBackground").css("display","table");this.CarouselPopup=$("#PdpImageCarouselDesktopPopup carousel");this.CarouselPopupScope=this.CarouselPopup.scope();$("body").css("overflow","hidden"); 94this.Scope.ViewModel.IsPopupOpen=!0;this.ImageOrVideoClick()},t.prototype.ShowNextThumbImage=function(){var i=$(".Item.ThumbItem").length,n=$(".Item.ThumbItem:visible").last().attr("id");if(+n<i-1){var 95r=+n+1,t=$(".Item.ThumbItem").get(r);$(t).removeClass("ng-hide");var u=$(".Item.ThumbItem:visible").first();u.hide();$(t).show()}},t.prototype.ShowPrevThumbImage=function(){var n=$(".Item.ThumbItem:visible"). 96first().attr("id");if(+n>0){var i=+n-1,t=$(".Item.ThumbItem").get(i);$(t).removeClass("ng-hide");var r=$(".Item.ThumbItem:visible").last();r.hide();$(t).show()}},t.prototype.ShowThumbImageInit=function( 97n){var t=!0;return n>4&&(t=!1),t},t.prototype.GoToItem=function(n){this.Carousel=$("#PdpImageCarouselDesktop carousel");this.CarouselPopup=$("#PdpImageCarouselDesktopPopup carousel");this.CarouselScope= 98this.Carousel.scope();this.CarouselPopupScope=this.CarouselPopup.scope();var t=this.CarouselScope.currentIndex;this.CarouselScope.showSlide(n,!0,!0);this.CarouselPopupScope.showSlide(n,!0,!0);n<t?(this. 99SetArrowsWhenSlidePrevious(this.CarouselScope.currentIndex,this.CarouselScope),this.SetArrowsWhenSlidePrevious(this.CarouselScope.currentIndex,this.CarouselPopupScope)):n>t&&(this.SetArrowsWhenSlideNext( 100this.CarouselScope.currentIndex,this.CarouselScope),this.SetArrowsWhenSlideNext(this.CarouselScope.currentIndex,this.CarouselPopupScope))},t.prototype.SetArrowsWhenSlideNext=function(n,t){n>0&&($(".PdpLeftArrowActive"). 101show(),$(".PdpLeftArrowInactive").hide());t.slideCount-1==n?($(".PdpRightArrowActive").hide(),$(".PdpRightArrowInactive").show()):($(".PdpRightArrowActive").show(),$(".PdpRightArrowInactive").hide())} 102,t.prototype.SetArrowsWhenSlidePrevious=function(n,t){n<t.slideCount-1&&($(".PdpRightArrowActive").show(),$(".PdpRightArrowInactive").hide());n==0?($(".PdpLeftArrowActive").hide(),$(".PdpLeftArrowInactive"). 103show()):($(".PdpLeftArrowActive").show(),$(".PdpLeftArrowInactive").hide())},t.prototype.SelectThumbnail=function(n){$($(".ThumbItem")).removeClass("Selected");$($(".Item.ThumbItem")[n]).addClass("Selected")} 104,t.prototype.GetYouTubeVideoUrl=function(n){return n?"https:"+n+"?autohide=1&start=0&rel=0&wmode=transparent&autoplay=0":""},t.prototype.ShowImageGalleryVideo=function(n,t,i){var u=+i- 105this.ViewModel.ImageUrls.length,f=this.ViewModel.Media[u],e="."+n+i,r=".Slides ."+t+i;$(r).attr("src",this.GetYouTubeVideoUrl(f.EmbeddedUrl));$(e).hide();$(r).show()},t.prototype.ShowImageGalleryVideoPopup= 106function(n){this.ShowImageGalleryVideo("YoutubeThumbnail","DesktopYouTubeFrame",n);this.ShowImageGalleryPopup()},t.prototype.OnCarouselSlideShown=function(n){if(this.Carousel=$("#PdpImageCarouselDesktop carousel"), 107this.CarouselScope=this.Carousel.scope(),this.CarouselPopup=$("#PdpImageCarouselDesktopPopup carousel"),this.CarouselPopupScope=this.CarouselPopup.scope(),this.CarouselPopup&&this.Carousel&&typeof this. 108CarouselPopup!="undefined"&&typeof this.CarouselPopupScope!="undefined"&&this.CarouselPopupScope.currentIndex!=this.CarouselScope.currentIndex){if(this.Carousel.is(n.container))this.CarouselPopupScope. 109showSlide(n.currentIndex,!0,!0);else if(this.CarouselPopup.is(n.container)){if(this.ViewModel.Media.length>0){var f=this.ViewModel.ImageUrls.length,r=n.currentIndex;
109if(n.isNextClicked&&r>f){var t=r-1, 110i=".Slides .DesktopYouTubeFrame"+t,u=".YoutubeThumbnail"+t;$(i).attr("src","");$(i).hide();$(u).show()}if(n.isPreviousClicked&&r>=f-1){var t=r+1,i=".Slides .DesktopYouTubeFrame"+t,u=".YoutubeThumbnail"+ 111t;$(i).attr("src","");$(i).hide();$(u).show()}}this.CarouselScope.showSlide(n.currentIndex,!0,!0)}this.SelectThumbnail(n.currentIndex);n.isNextClicked&&n.currentIndex>4&&this.ShowNextThumbImage();n.isPreviousClicked&& 112n.currentIndex<4&&this.ShowPrevThumbImage()}},t.prototype.RatingIcon=function(n){var t=Math.floor(this.ViewModel.Product.Rating+.5);return t>n?"pdp_star_filled":"pdp_star_empty"},t.prototype.ToggleRatingsHistogram= 113function(n){var t=$(".RatingHistogram");if(this.Scope.Layout.IsPhone)t.hide();else{if(!this.IsRatingHistogramInitialized){var i=$(".BVRRRatingsHistogramButtonPopin");i.length>0?(i.css("display","block"), 114t.append(i),this.IsRatingHistogramInitialized=!0):n=!1}n?t.show():t.hide()}},t.prototype.GoToPromotion=function(n){window.location.href=this.Scope.Url.GetPromotionUrl(n)},t.prototype.ToggleSharingOverlay= 115function(){var n=$("#PdpShareLink"),i=n.width()/2,t=$(".SharingOverlay"),r=n.position().left+i;t.offset({left:r});t.fadeToggle(200);this.ProductDetailTrackerService.SocialShareButton()},t.prototype.IsSectionExpanded= 116function(n){return this.SectionExpandedStates[n]===!0},t.prototype.IsSectionOpen=function(n){return this.SectionOpenStates[n]===!0},t.prototype.ToggleSection=function(n){var t=this.IsSectionOpen(n);this. 117SectionOpenStates[n]=!t},t.prototype.ToggleSectionExpansion=function(n){var t=this.IsSectionExpanded(n);this.SectionExpandedStates[n]=!t;t&&$("#Section"+n).scrollintoview({duration:150})},t.prototype. 118ToggleSectionDesktop=function(n){this.DesktopOpenSection=n},t.prototype.IsSectionOpenDesktop=function(n){return this.DesktopOpenSection===n},t.prototype.SetDefaultShadeAndSize=function(){if(this.ViewModel. 119Quantity=this.ViewModel.Product.Quantity,this.ViewModel.SelectedSizeVariant=null,this.ViewModel.HasShadeVariants){var n=this.ViewModel.ShadeVariants[0].Variants.filter(function(n){return!!n.IsAvailable} 120);n.length>0&&(this.ViewModel.SelectedShadeVariant=n[0])}},Object.defineProperty(t.prototype,"ViewModel",{get:function(){return this.Scope.ViewModel},enumerable:!0,configurable:!0}),t.prototype.LoadImages= 121function(){for(var n=this,h=[],r=1,u=9,f=u-r+1,e=[],o=[],t=r;t<=u;t++){var s=this.Scope.Cdn.ProductImageXtraLarge(this.ViewModel.Product.ProfileNumber,t);o.push(s);var i=this.Scope.Url.FileExists(s);i. 122then(function(t){e[o.indexOf(t)]=t;n.Scope.SafeApply()},function(){});i.finally(function(){n.Scope.ViewModel.ImageUrls=e.filter(function(n){return!!n});f--;f<=0&&_.delay(function(){var t=$(".GalleryImages"); 123n.Zoom.zoom(t,n.Scope.Layout.IsPhone);n.Scope.ViewModel.CarouselElementCount=n.Scope.ViewModel.Media.length+n.Scope.ViewModel.ImageUrls.length;n.Scope.ViewModel.Product.IsTryItOnProduct&&(n.Scope.ViewModel. 124CarouselElementCount+=1);n.InitImageAndVideoThumbUrls();n.SelectThumbnail(0)},3)});h.push(i)}},t.prototype.SetupTryItOn=function(){window.ymkAsyncInit=function(){window.YMK.init({autoOpen:!0,width:document. 125getElementById("PdpImageCarouselDesktop").offsetWidth-60,height:document.getElementById("PdpImageCarouselDesktop").offsetHeight})};window.onresize=function(){};function n(){}$(document).on("click",".SmallImage", 126function(){n()});$(document).on("click",".VideoImage",function(){n()})},t.prototype.TrackReady=function(){this.Scope.Analytics.TrackReady(["dlReadyDetail"])},t.prototype.Initialize=function(){_.delay( 127function(){window.IncludeYotpoScript&&window.IncludeYotpoScript()},2)},t.prototype.TrackProductDetailLoad=function(){var n=this;this.Scope.Analytics.TrackIfDomReady(function(){n.Scope.TrackEvent_(TrackingEventType. 128ProductDetailLoad,{ProductView:n.Scope.ViewModel,Context:n.Scope.ShopContext,ListName:window.location.pathname},n.ProductDetailTrackerService.GetDataForProductDetailLoadEvent,1)})},t.$inject=["$scope", 129"$anchorScroll","$filter","$cookies","$locale","CartService","ProductService","WishListService","ProductDetailTrackerService","ProductDetailRatingService","SocialShareTrackerService","ApptusNotificationService", 130"RecommendationEngineService"],t}(BaseController);n.ProductDetail2Controller=t})(ProductDetail2Module||(ProductDetail2Module={}));app.controller("ProductDetail2Controller",ProductDetail2Module.ProductDetail2Controller); 131var ZoomModule;(function(n){var t=function(){function n(){}return n.prototype.zoom=function(n,t){n.each(function(i){var u={url:"",callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,magnify:385/ 132613*3},c=n[i],o=n[i],f=$(o),r=document.createElement("img"),s=$(r),h=!1,e;(u.url||(e=f.find("img"),e[0]&&(u.url=e.data("src")||e.attr("src")),u.url))&&(function(){var t=n[i].style.position,r=n[i].style. 133overflow;f.one("zoom.destroy",function(){f.off(".zoom");n[i].style.position=t;n[i].style.overflow=r;s.remove()})}(),r.onload=function(){if(!t){var l=null,a=null;f.on("mouseenter.zoom",function(n){l=$( 134"#PdpImageCarouselDesktop .CarouselPrevious:visible");a=$("#PdpImageCarouselDesktop .CarouselNext:visible");l.hide();a.hide();$(".Magnify").hide();e(!0);d(n.pageX,n.pageY)});f.on("mouseleave.zoom",function( 135){g();l.show();a.show();$(".Magnify").show()});f.on("mousemove",function(n){var s=document.body.getBoundingClientRect().top,h=$("#PdpImageCarouselDesktop")[0].getBoundingClientRect().top,c=h-s,l=document. 136body.getBoundingClientRect().left,a=$("#PdpImageCarouselDesktop")[0].getBoundingClientRect().left,v=a-l,e=$("#PdpImageCarouselDesktop")[0].clientWidth,o=$("#PdpImageCarouselDesktop")[0].clientHeight,y= 137$("body").position().left,p=$("body").position().top,w=n.pageX-v-y,b=n.pageY-c-p,t=w/e,i=b/o;t>1&&(t=1);i>1&&(i=1);var u=+String(r.style.width).replace("px",""),f=+String(r.style.height).replace("px", 138"");r.style.left=-(t*u*(u-e)/u)+"px";r.style.top=-(i*f*(f-o)/f)+"px"})}var p=new Hammer.Manager(n[i]),nt=new Hammer.Tap({event:"doubletap",taps:2,threshold:500,posThreshold:500});p.add(nt);var v=null, 139y=null;p.on("doubletap",function(n){t&&(h?(h=!1,v.show(),y.show(),g(),$(".MagnifyMobile").css("visibility","visible"),setTimeout(function(){$(".zoomImg").each(function(n){$(".zoomImg")[n].style.opacity= 140"0"})},500)):(v=$(".PdpImageMobile .CarouselPrevious:visible"),y=$(".PdpImageMobile .CarouselNext:visible"),e(!0),h=!0,$(".MagnifyMobile").css("visibility","hidden"),d(n.center.x,n.center.y),v.hide(), 141y.hide()))});function tt(n,t,i){this.targetWidth=$(n).outerWidth();this.targetHeight=$(n).outerHeight();t===n?(this.sourceWidth=this.targetWidth,this.sourceHeight=this.targetHeight):(this.sourceWidth= 142t.outerWidth(),this.sourceHeight=t.outerHeight());this.xRatio=(i.width-this.targetWidth)/this.sourceWidth;this.yRatio=(i.height-this.targetHeight)/this.sourceHeight;ut(i);ft(i)}function w(n,t,i){var f= 143et(),e=ot();if(this.isStartMoving){this.isStartMoving=!1;var o=f/2,s=e/2;n.style.left=o+"px";n.style.top=s+"px"}else{var h=t-this.startTapX,c=i-this.startTapY,r=this.imgStartLeft+h,u=this.imgStartTop+ 144c;this.startTapX<t?r=k(r,0):this.startTapX>t;r=b(r,f);this.startTapY<i?u=k(u,0):this.startTapY>i;u=b(u,e);n.style.left=r+"px";n.style.top=u+"px"}}function b(n,t){return Math.max(n,t)}function k(n,t){return Math. 145min(n,t)}function it(n,t,i,r){var u=$(n).css("position"),f=$(t);n.style.position=/(absolute|fixed)/.test(u)?u:"relative";n.style.overflow="hidden";i.style.width=i.style.height="";$(i).addClass("zoomImg"). 146css({position:"absolute",top:0,left:0,opacity:0,width:i.width*r,height:i.height*r,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(n)}function rt(n,t,i){this.startTapX=n;this.startTapY=t;this. 147imgStartLeft=+String(i.style.left).replace("px","");this.imgStartTop=+String(i.style.top).replace("px","")}function e(n){this.isStartMoving=n}function ut(n){var t=$(".GalleryImage").first().height(),i= 148$(".GalleryImage").css("margin-top").replace("px",""),r=+n.clientWidth-+t-+i;this.offsetY=r*-1}function ft(n){var t=$(".GalleryImages").width(),i=+n.clientWidth-+t;this.offsetX=i*-1}function et(){return this. 149offsetX}function ot(){return this.offsetY}it(c,o,r,u.magnify);e(!0);function d(n,t){tt(c,o,r);w(r,n,t);r.style.opacity="1";s.stop().fadeTo($.support.opacity?u.duration:0,1)}function g(){s.stop().fadeTo( 150u.duration,0);e(!0)}if(u.touch){f.on("touchstart",function(n){rt(n.originalEvent.touches[0].pageX,n.originalEvent.touches[0].pageY,r)});f.on("touchmove.zoom",function(n){n.preventDefault();w(r,n.originalEvent. 151touches[0].pageX,n.originalEvent.touches[0].pageY)})}},r.src=u.url)})},n}();n.ZoomController=t})(ZoomModule||(ZoomModule={}));app.controller("ZoomController",ZoomModule.ZoomController)
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.