58ccbd7d8b83c4933186f08462d060601ef3875f8106a1cb6f3aeaabf27aa8de

Source Code:

(function(y){var n=window.AmazonUIPageJS||window.P,fa=n._namespace||n.attributeErrors,c=fa?fa("DetailPageImageBlockAssets",""):n;c.guardFatal?c.guardFatal(y)(c,window):c.execute(function(){y(c,window)})})(function(y,n,fa){y.register("postMetric",function(){return{postCountMetric:function(c){if("undefined"!==typeof c){var a=n.ue;if(a){var b=a.count(c)||0;a.count(c,b+1)}}},postTimeMetric:function(c,a){if("undefined"!==typeof c&&"undefined"!==typeof a){var b=n.ue;b&&b.count(c,a)}}}});"use strict";y.register("logFailedInteractionMetric",
function(){return{isEnabled:!1}});y.register("postEarlyMetric",function(){return null});"use strict";y.when("jQuery","ImageBlockController","ImageBlockATF","ImageBlockBTF").register("ImageBlock",function(c,a,b,m){c=c.extend(!0,{},b,m);var l=new a(c);y.register("ImageBlockAPI",function(){return l.api});return l});"use strict";y.when("A","jQuery").execute(function(c,a){c.on("a:image:load:landingImage",function(){n.performance&&performance.now&&n.ue&&ue.count&&ue.count("DPLandingImageHighResDownloadTime",
performance.now())});c.loadDynamicImage(a("#landingImage"))});"use strict";y.when("ImageBlockATF","atf").register("ImageBlockAiryLoader",function(c){function a(b){b&&(y.load.js(b),n.performance&&performance.now&&n.ue&&ue.count&&ue.count("DPAiryDownloadStartTime",n.parseInt(performance.now())))}function b(b){b&&y.load.css(b)}var m=c.airyConfig;void 0===m?y.when("ImageBlockBTF").execute(function(c){m=c.airyConfig;a(m.jsUrl);b(m.cssUrl)}):(a(m.jsUrl),b(m.cssUrl))});"use strict";y.when("jQuery","ImageBlockModel",
"ImageBlockView","imageBlockUtils","ImageBlockState").register("ImageBlockController",function(c,a,b,m,l){var f={};return function(F){var h=this;h.dispatch=function(b,a){var h=f[b];m.isDefined(h)&&c.each(h,function(b,f){f.call(n,a)})};h.register=function(b,a){m.isDefined(f[b])||(f[b]=[]);"function"===typeof a&&f[b].push(a)};h.model=new a(F,h);h.view=new b(F,h,h.model);h.api=new l(F,h,h.model);h.init=function(){h.model.init();h.view.init()};h.init()}});"use strict";y.when("A","imageBlockUtils").register("ImageBlockModel",
function(c,a){function b(b,f,c,h,l){a.isDefined(b)&&(G.type=b);a.isDefined(f)&&(G.index=f);a.isDefined(c)&&(G.thumbnailIndex=c);a.isDefined(h)&&(G.variant=h);a.isDefined(l)&&(G.color=l)}function m(a){b("image",0,0,"MAIN",a||h.landingAsinColor||h.defaultColor)}function l(a){a=a.data;C=c.copy(G);b(a.type,a.index,a.thumbnailIndex,a.variant,a.color)}function f(b){l(b);b=c.copy(b);b.data=c.copy(G);k.dispatch("updateView",b)}function F(){C=c.copy(G);m(G.color)}var h,k,G={},C={},H,n;return function(b,a){k=
a;h=b;k.register("updateSelection",f);k.register("updateModel",l);k.register("resetModel",F);this.init=function(){m()};this.getCurrentItem=function(){return c.copy(G)};this.getPreviousItem=function(){return c.copy(C)};this.setCurrentEvent=function(b){H=b};this.getCurrentEvent=function(){return H};this.setImmersiveViewModalInstance=function(b){n=b};this.getImmersiveViewModalInstance=function(){return n};this.updateTitle=function(b){h.title=b}}});"use strict";y.when("ImageBlockBTF","postMetric").execute(function(c,
a){function b(b,a,F,h,m){function G(b){"click"===b.type&&h.postCountMetric("thumbClick");"click"===b.type&&t.overrideAltImageClickAction?r.dispatch("thumbActionClick",b):r.dispatch("updateSelection",b)}function C(b){t.useClickZoom||r.dispatch("imageClick",b)}function H(b){t.useClickZoom||r.dispatch("imageHover",b)}function M(b){r.dispatch("button360Click",b)}function A(a){!F.isDefined(a)||"swatchClick"!==a.type&&"updatedData"!==a.type?(q.update(a),"swatchHover"!==a.type&&z.getPreviousItem().thumbnailIndex!==
a.data.thumbnailIndex&&h.postCountMetric(a.data.type+"ThumbnailSelected"),b.trigger("image-block-thumbnail-selected",a.data)):(q.render(a.data.color,!1,a.onload),a={hasComponents:!0,components:[{name:"mainimage"},{name:"thumbnail"}]},"function"===typeof n.markFeatureRender&&n.markFeatureRender("imageblock",a))}function I(b){r.dispatch("resize",b)}function N(b){F.selectThumbnail(b,E)}function O(){"function"===typeof n.markFeatureInteractive&&n.markFeatureInteractive("imageblock",{hasComponents:!0,
components:[{name:"mainimage",events:["click"],alwaysInteractive:!0}]})}function L(){"function"===typeof n.markFeatureInteractive&&n.markFeatureInteractive("imageblock",{hasComponents:!0,components:[{name:"mainimage",events:["hover"],alwaysInteractive:!0},{name:"thumbnail",events:["click","hover"],alwaysInteractive:!0}]});1===c.useIV?y.when("a-modal").execute(function(){O()}):O();t.disableHoverOnAltImages||b.declarative("thumb-action",["mouseenter","mouseleave"],G);b.declarative("thumb-action",["click"],
G);b.declarative("main-image-click",["click"],C);b.declarative("main-image-click",["mouseenter","mouseleave"],H);b.declarative("button-360-click",["click"],M);b.on("resize",I)}function e(b){var a=b.data,g;a&&"ingress"!==a.type&&"click"===b.type&&(g=b);return g}function x(b){var a=z.getCurrentItem(),g={type:"click"};g.$declarativeParent=b;g.data=a;return g}var q,t,r,z,E;return function(b,c,g){q=this;t=b;r=c;z=g;E=a("#imageBlock #altImages ul");var d=a("#imageBlock .canvas"),p=a("#main-image-container"),
h;q.subViews=[];for(c=0;c<m.length;c++)q.subViews.push(new m[c](b,g,q,r));q.render=function(b,g,e){var c=0;E.find(".item").remove();b=b||z.getCurrentItem().color;a.each(q.subViews,function(a,f){c=f.render(b,c,d,E,p,g,e)||c});var r=E.find(".a-button-selected").closest(".a-declarative");h=x(r)};q.init=function(){E=a("#imageBlock #altImages ul");var b=E.find(".a-button-selected").closest(".a-declarative"),g=b.data("action"),b=b.data(g)||{};b.color=t.landingAsinColor||t.defaultColor;r.dispatch("updateModel",
{data:b});q.render(b.color,!0);t.isDebug&&n.console&&console.log(t);r.register("updateView",A);r.register("selectThumbnail",N);L()};q.update=function(b){a.each(q.subViews,function(a,g){g.update(b)});t.usePeekHover&&("mouseleave"===b.type?r.dispatch("updateSelection",h):"click"===b.type&&(h=e(b)||h))}}}var m=["A","jQuery","imageBlockUtils","postMetric"].concat(c.views);y.when.apply(y,m).register("ImageBlockView",function(){for(var a=arguments[0],f=arguments[1],c=arguments[2],h=arguments[3],m=[],G=
4,n=arguments.length;G<n;G++)m.push(arguments[G]);return b(a,f,c,h,m)})});"use strict";y.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockAltImageView",function(c,a,b,m,l,f,F){function h(g,e,d,p){if(!b.isjQueryObjDefined(g.find(".a-button-selected"))){var c=z.getCurrentItem();if(!p||"chromeless-video"!==c.type||!r.autoplayVideo){p=0;"image"===c.type&&(p=Math.max(n(c.color,c.variant),0));var f=e+p;f>=d&&(p=0,f=e);
e=b.getImageHash(c.color,p,r);-1!==e&&(E.dispatch("updateModel",{data:{index:p,thumbnailIndex:f,variant:e.variant,type:"image"}}),e=g.find(".item").get(f),b.selectGivenThumbnail(a(e),g))}}}function k(g,e,d){e=r.colorImages&&r.colorImages[e];var p=g;b.isDefined(e)&&(a.each(e,function(a,e){g<r.maxAlts&&(b.createThumbnail({type:"image",index:a,thumbnailIndex:g,variant:e.variant},e.thumb,J,"imageThumbnail"),g++)}),f.isEnabled&&F.logAltImgRequestPlacedOnThumbnails(a,f,z),h(J,p,g,d));return g}function G(b,
g){if("image"===b.type){var e=a("#image-canvas-caption #canvasCaption"),d,p=r.staticStrings,c=r.colorImages,f=b.color,h=b.index;g&&r.useIV?d=p.clickToExpand:c[f]&&c[f][h].hiRes&&r.useHoverZoom?(d=r.useHoverZoomIpad?p.touchToZoom:r.useClickZoom?p.clickToZoom:p.rollOverToZoom,r.hoverZoomIndicator&&(d="\x3cimg src\x3d'"+r.staticImages.hoverZoomIcon+"'/\x3e\x26nbsp;"+d)):r.useIV&&(d=p.clickToExpand);e.html(d)}}function n(a,g){return b.getIndexForVariant(a,g,r)}function H(e,d){var p="a-dynamic-image";
if(!r.acEnabled){var c;a.each(e.main,function(a,g){b.isDefined(c)||(c=parseFloat(g[1]/g[0])<=parseFloat(r.holderRatio)?" a-stretch-vertical":" a-stretch-horizontal")});p+=c}var f=b.getMaxDimensionsOfMainImage(e.main,g,r),h=f[0],q=f[1],f=a("\x3cdiv\x3e\x3c/div\x3e"),h={"max-height":h,"max-width":q};f.addClass(p).css(h).attr({"data-old-hires":e.hiRes,"data-a-manual-replacement":"true",onload:d}).data("a-dynamic-image",e.main);return f}function M(b){var a=u.find(".swatchHoverExp");b=H(b);a.find(".imgTagWrapper").html(b);
c.loadImageManually(b);return a}function A(b){var a=g.css("height");null!==a&&b.find(".imgTagWrapper").css("height",a);b.addClass("selected");r.imgTagWrapperClasses&&b.find(".imgTagWrapper").addClass(r.imgTagWrapperClasses)}function I(a,g){if("image"===a.type||"unavailable"===a.type||"lazy-loaded"===a.type){b.isDefined(g)&&l.postCountMetric("mainImageUpdateOnTwisterVariationClick");var e=b.getImageHash(a.color,a.index,r);if(-1===e)return e={data:{index:0,thumbnailIndex:0,variant:"",type:"unavailable"}},
b.lazyLoadingRequired(a,z,r)?L(a,!1,g):(E.dispatch("updateModel",e),b.showUnavailable(a.color)),-1;var d=u.find(".item.itemNo"+a.thumbnailIndex);if(!b.isjQueryObjDefined(d)){var d=a.thumbnailIndex,d=u.find(".mainImageTemplate").clone().removeClass("template mainImageTemplate").addClass("image item itemNo"+d+" maintain-height"),p=H(e,g);d.find(".placeHolder").replaceWith(p);u.find(".list").append(d);c.loadImageManually(p)}A(d);E.dispatch("loadMagnifier");G(a);r.useIV&&b.isDefined(e.hiRes)&&d.css("cursor",
"pointer");a.isUserGenerated&&(d=z.getPreviousItem(),p=a.variant,b.isDefined(p)&&d.thumbnailIndex!==a.thumbnailIndex&&(f.isEnabled&&F.logAltImgRequestServed(f),l.postCountMetric("ImageThumbnailSelectedVariant:"+p),0===p.indexOf("IG")&&(l.postCountMetric("IGImageSelectedVariant:"+p),l.postCountMetric("IGImageSelectedEvent:"+a.interaction))));c.trigger("dp:image-block:update",e)}}function N(a){var g=Math.max(n(a.color,z.getCurrentItem().variant),0),g=b.getImageHash(a.color,g,r);if(-1===g)return b.lazyLoadingRequired(a,
z,r)?b.lazyLoadOnHoverEnabled(r)&&(O(".3",!0),b.spinner(u,!0),c.delay(function(){z.getCurrentEvent().data===a&&L(a,!0)},500)):b.showUnavailable(a.color),-1;var e=M(g);l.postCountMetric("mainImageUpdateOnTwisterVariationHover");A(e);c.trigger("dp:image-block:update",g)}function O(b,g){g?u.css("opacity",b):a("#imageBlock").css("opacity",b)}function L(a,g,f){d=g;p=f;var c=a.color,h=r.colorToAsin[c];if(h&&h.asin){var q={};q.params={asin:h.asin,productGroupID:r.productGroupID,color:c};q.success=function(q){q?
(l.postCountMetric("lazyloadImageBlockOnTwisterUpdateSuccess"),b.ajaxState(h.asin,"success"),r.colorImages[c]=q.colorImage,b.isDefined(r.spin360ColorEnabled)&&(r.spin360ColorEnabled[c]=q.enable360),c===a.color&&(g&&d?(l.postCountMetric("lazyloadImageBlockOnTwisterHoverSuccess"),a===z.getCurrentEvent().data&&(e(a),N(a))):(l.postCountMetric("lazyloadImageBlockOnTwisterClickSuccess"),q={type:"updatedData",data:z.getCurrentItem(),onload:f||p},E.dispatch("updateView",q))),y.register(b.rankedImagesReadyEvent(h.asin))):
(l.postCountMetric("lazyloadImageBlockOnTwisterUpdateFail"),b.ajaxState(h.asin,"fail"))};q.error=function(){l.postCountMetric("lazyloadImageBlockOnTwisterUpdateFail");b.ajaxState(h.asin,"fail")};q.indicator=b.spinner(u);b.ajaxState(h.asin,void 0)&&"fail"!==b.ajaxState(h.asin,void 0)||(g?l.postCountMetric("lazyloadImageBlockOnTwisterHover"):l.postCountMetric("lazyloadImageBlockOnTwisterClick"),O(".3",g),m.load("/gp/product/features/apparel-main-image/ranked-images.html",q),b.ajaxState(h.asin,"sent"));
return r.colorImages&&r.colorImages[c]}}function e(g,e){b.lazyLoadingRequired(g,z,r)||(a("#imageBlock").css("opacity","1"),u.css("opacity","1"),b.spinner(u,!1),u.find("li").removeClass("selected"),a("#image-canvas-caption #canvasCaption").empty(),b.hideUnavailable(),e&&u.find(".list .item").remove())}function x(){var e=u.find(".item .imgTagWrapper"),d=b.getContainerHeight(g,r.holderRatio,r.holderMaxHeight);0<d&&(g.height(d),e.height(d));u.find("img.a-dynamic-image").each(function(){var e=a(this);
e.data("a-manual-replacement")&&c.loadDynamicImage(this);var d=e.data("a-dynamic-image"),d=b.getMaxDimensionsOfMainImage(d,g,r);e.css({"max-height":d[0]+"px","max-width":d[1]+"px"})})}function q(b){G(z.getCurrentItem(),"mouseenter"===b.type)}var t,r,z,E,J,u,g,d,p,v;return function(a,d,p,c){t=this;r=a;z=d;E=c;r.colorImages[r.landingAsinColor]=r.colorImages[r.defaultColor];t.render=function(a,d,p,c,f,h,q){u=p;J=c;g=f;v=k(d,a,h);h||(a=z.getCurrentItem(),b.lazyLoadingRequired(a,z,r)&&E.dispatch("updateModel",
{data:{type:"lazy-loaded"}}));e(z.getCurrentItem(),!h);I(z.getCurrentItem(),q);return v};t.update=function(a){var g=a.data;z.setCurrentEvent(a);"ingress"!==g.type&&e(a.data,!1);"swatchHover"===a.type?g.color===z.getCurrentItem().color?I(z.getCurrentItem()):a.captured||-1===N(g)||(a.captured=!0):"image"===g.type&&(g.interaction=a.type,g.isUserGenerated=!0,"mouseenter"===a.type&&l.postCountMetric("dpcc_imageThumbHovered_"+(g.thumbnailIndex+1)+"_"+v),I(g),r.usePeekHover&&"click"!==a.type||(b.selectGivenThumbnail(a.$declarativeParent,
J),"click"===a.type&&(l.postCountMetric("dpcc_imageThumbClicked_total"),l.postCountMetric("dpcc_imageThumbClicked_"+(g.thumbnailIndex+1)+"_"+v))))};r.overrideAltImageClickAction&&b.addTag("clickEnabledOnAltImages");E.register("imageHover",q);E.register("resize",x)}});"use strict";y.when("A","jQuery","imageBlockUtils","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockMagnifierView",function(c,a,b,m,l,f){function F(a){O?a.css("cursor","url('"+H.staticImages.zoomIn+"'), auto"):
(a.css("cursor","-webkit-zoom-in"),a.css("cursor","-moz-zoom-in"),a.css("cursor","zoom-in"))}function h(a){var e=a.match(/\._((\w|,|\.)+)_\.(gif|jpg|png)$/i);a={};if(b.isDefined(e))for(var e=e[1].split("_"),c=0;c<e.length;c++){var f=e[c].match(/^([A-Z]+)(\d+(\.\d+)?)$/);b.isDefined(f)&&(a[f[1]]=parseInt(f[2],10))}return a}function k(k,e){function x(){var a;e.useClickZoom?(a=e.offsetInClickZoom,a=[Math.min(1,Math.max(0,A[0]-(D[0]+a))/(D[2]-2*a)),Math.min(1,Math.max(0,A[1]-(D[1]+a))/(D[3]-2*a))]):a=
v&&v.updatePosition();if(a&&p&&p.detailSize){var b=[p.detailSize[0]-p.rect.width,p.detailSize[1]-p.rect.height];c.capabilities.rtl?p.detailImage.get(0).style.right=-(a[0]*b[0])+"px":p.detailImage.get(0).style.left=-(a[0]*b[0])+"px";p.detailImage.get(0).style.top=-(a[1]*b[1])+"px"}}function q(a){return a.offsetParent().hasClass("a-dynamic-image-container")}function t(b){var g=S?b.originalEvent.touches[0]||b.originalEvent.changedTouches[0]:"";A=S?[g.pageX,g.pageY]:[b.pageX,b.pageY];if(c.capabilities.rtl){var e=
a(n).width();A=S?[e-g.pageX,g.pageY]:[e-b.pageX,b.pageY]}}function r(a){S&&a.preventDefault();t(a);e.useClickZoom?a=[D[0],D[1],D[0]+D[2],D[1]+D[3]]:(a=v?v.offset:k.offsetParent().offset(),a=H.acEnabled?[a.left,a.top,g.width()+a.left,g.height()+a.top]:[C[0]+a.left,C[1]+a.top,C[0]+C[2]+a.left,C[1]+C[3]+a.top]);A[0]<a[0]||A[1]<a[1]||A[0]>=a[2]||A[1]>=a[3]||H.acEnabled&&!q(k)?(e.fadeMagnifier?N||(N=!0,Z=setTimeout(function(){z(!0)},500)):e.useClickZoom||z(),B&&(B=!1,clearTimeout(aa))):(B||(B=!0,aa=setTimeout(function(){m.postCountMetric("dppc_hoverZoomOpened");
l.isEnabled&&f.logHoverZoomRequestServed(l)},1E3)),e.fadeMagnifier&&N&&(N=!1,clearTimeout(Z)),x())}function z(b){b&&u.suppressMagnifier(!0);if(Q&&(p&&p.hide(),v&&(v.destroy(),v=null),Q=!1,S?(k.unbind("touchmove.magnifier touchstart.magnifier touchend.magnifier"),a(document).trigger("disengaged.magnifier")):a(document).unbind("mousemove.magnifier").trigger("disengaged.magnifier"),G(),b))k.one("click.magnifier touchstart.magnifier",function(a){E(a,!0)})}function E(b,d){d&&u.suppressMagnifier(!1);if(!Q&&
!ea&&(0===ba&&(m.postCountMetric("dppc_hoverTime",new Date-(n.ue&&n.ue.t0||0)),ba=1),I[R]||(m.postCountMetric("dppc_hoverMain"),I[R]=1),C=[k.position().left,k.position().top,k.width(),k.height()],R&&(t(b),p?p.refit().show():p=new M,e.useClickZoom||(v=v||new y),D=p.getWindowSize(),x()),Q=!0,S?(k.unbind("touchstart.magnifier touchmove.magnifier").bind("touchmove.magnifier",r).bind("touchend.magnifier",z),a(document).trigger("engaged.magnifier")):(H.acEnabled?g.unbind("mousemove.magnifier"):k.unbind("mousemove.magnifier"),
a(document).trigger("engaged.magnifier").bind("mousemove.magnifier",r)),d)){var c=a("#zoomWindow");if(0<c.length)c.one("click.magnifier touchend.magnifier",function(a){z(!0)})}}function G(){e.useHoverZoom&&(S?k.bind("touchstart.magnifier touchmove.magnifier",E):H.acEnabled?q(k)&&g.bind("mousemove.magnifier",E):k.bind("mousemove.magnifier",E))}var u=this,g=k.offsetParent(),d={detailImageUrl:k.attr("data-old-hires"),location:"over",locationElement:k,prelaod:"ready",zIndex:50,offsetInClickZoom:50};e=
a.extend(d,e);e.adjustment=[10,0,-10,0];var p=null,v=null,A=null,C=null,D=null,K={"null":1,"":1,undefined:1},Q=!1,ea=!1,R=e.detailImageUrl,S=e.useHoverZoomIpad||0,ba=0,I={},y=function(){function b(a){var g=Math.round(Math.min(k.width(),p.rect.width/a));a=Math.round(Math.min(k.height(),p.rect.height/a));h.css({width:g,height:a});d=[g,a]}var g=this,d=[0,0],c=(p.detailSize&&p.detailSize[0]||5E8)/C[2],f=(p.detailSize&&p.detailSize[1]||5E8)/C[3],c=f>c?f:c;a("#magnifierLens").remove();var h=a("\x3cdiv id\x3d'magnifierLens' /\x3e").css({position:"absolute"});
e.generalImageUrls.zoomLensBackground&&h.css({backgroundImage:"url("+e.generalImageUrls.zoomLensBackground+")"});H.showMagnifierOnHover?F(h):h.css("cursor","pointer");g.updatePosition=function(){var a=[C[2]-d[0],C[3]-d[1]],b=0>=a[0]?.5:Math.max(0,Math.min(1,(A[0]-d[0]/2-C[0]-g.offset.left)/a[0])),e=0>=a[1]?.5:Math.max(0,Math.min(1,(A[1]-d[1]/2-C[1]-g.offset.top)/a[1])),c=C[0]+Math.round(b*a[0]),a=C[1]+Math.round(e*a[1]);h.get(0).style.left=c+"px";h.get(0).style.top=a+"px";return[b,e]};g.destroy=function(){h.remove()};
g.offset=k.offsetParent().offset();b(c);g.updatePosition();h.appendTo(k.parent());p.detailImage[0].complete||p.detailImage.load(function(){var a=p.detailImage.width()/C[2];b(a);g.updatePosition()})};y.preload=function(){u.preload(e.generalImageUrls.lensBackgroundUrl)};var M=function(){function g(){var d={};if("over"===e.location){var d=e.useClickZoom,f={},h=a("#leftCol"),r=a("#centerCol"),t=a("#rightCol"),x=a("#hover-zoom-end"),v=a("#actionPanelContainer"),l=b.isjQueryObjDefined(h)?h.outerHeight():
r.outerHeight();f.top=b.isjQueryObjDefined(h)?h.offset().top:r.offset().top;f.bottom=l+f.top;f.right=b.isjQueryObjDefined(t)?t.offset().left:v.offset().left;f.left=d?0:h.offset().left+h.outerWidth();b.isjQueryObjDefined(x)&&x.offset().top>f.bottom&&(f.bottom=x.offset().top);d=f}else"right"===e.location&&(d=k.offset(),d={left:d.left+k.outerWidth(),top:d.top,right:d.left+k.outerWidth()+400,bottom:d.top+400});e.minHeightElement&&(d.bottom=Math.max(d.bottom,d.top+a(e.minHeightElement).outerHeight()));
d.bottom=Math.min(d.bottom,a(n).scrollTop()+a(n).height());d.left+=p[0];d.top+=p[1];d.right+=p[2];d.bottom+=p[3];d.width=d.right-d.left;d.height=d.bottom-d.top;e.enhancedHoverOverlay&&b.isDefined(n.pageXOffset)&&(f=a(n).width(),d.width=f-d.left+n.pageXOffset-18,d.height-=14);q.css({left:d.left,top:d.top,width:d.width,height:d.height});c.rect=d;return c}function d(a){var b=new Image;c.detailSize=[0,0];b.onload=function(){c.detailSize=[b.width,b.height];x()};b.src=a.attr("src");if(0<b.width&&0<b.height)c.detailSize=
[b.width,b.height];else if(e.detailImageSize)c.detailSize=e.detailImageSize;else{a=h(b.src);var g=C[2]/C[3];a.SS||a.AA?(a=a.SS||a.AA,c.detailSize=[a,a]):a.SX?c.detailSize=[a.SX,Math.round(a.SX/g)]:a.SY?c.detailSize=[Math.round(a.SY*g),a.SY]:a.SL&&(c.detailSize=1<=g?[a.SL,Math.round(a.SL/g)]:[Math.round(a.SL*g),a.SL])}}var c=this,p=e.adjustment;a("#zoomWindow").remove();var f={overflow:"hidden",position:"absolute",backgroundColor:"white",zIndex:e.zIndex};e.enhancedHoverOverlay&&(f.boxShadow="0 6px 8px 2px rgba(0,0,0,.25)",
f.border="1px solid #949494",f.borderColor="rgb(148,148,148)");var q=a("\x3cdiv id\x3d'zoomWindow' /\x3e").css(f);e.fadeMagnifier&&q.fadeIn(200);e.useClickZoom&&(O?q.css("cursor",'url("'+e.zoomOutIcon+'"), auto'):(q.css("cursor","-webkit-zoom-out"),q.css("cursor","-moz-zoom-out"),q.css("cursor","zoom-out")));c.updateImage=function(b){b=a("\x3cimg id\x3d'detailImg' src\x3d'"+b+"'/\x3e").css("position","absolute");c.detailImage&&c.detailImage.remove();q.append(b);a(document).trigger("updated.magnifier");
c.detailImage=b;d(c.detailImage)};c.refit=function(){g();d(c.detailImage);return c};e.fadeMagnifier?(c.show=function(){q.fadeIn(200);return c},c.hide=function(){q.fadeOut(200);return c}):(c.show=function(){q.show();return c},c.hide=function(){q.hide();return c});c.destroy=function(){q.remove();return c};c.getWindowSize=function(){return[c.rect.left,c.rect.top,c.rect.width,c.rect.height]};c.updateImage(R);g();q.appendTo(document.body)},N=!1,Z,B=!1,aa;u.preload=function(b){b=a.makeArray(b);for(var g=
b.length,d=0;d<g;d++)b[d]instanceof Array?u.preload(b[d]):"string"===typeof b[d]&&b[d]&&!K[b[d]]&&(K[b[d]]=new Image,K[b[d]].src=b[d])};u.changeImage=function(b,d){Q&&z();R=d;k.attr("src",b);u.preload(b);C=[k.position().left,k.position().top,k.width(),k.height()];d&&("immediately"===e.preload?u.preload(d,!0):a(n).ready(function(){u.preload(d)}),p?p.updateImage(d):k.attr("data-old-hires",d))};u.destroy=function(){H.acEnabled?g.unbind("touchstart touchstart.magnifier touchmove.magnifier mousemove.magnifier"):
k.unbind("touchstart touchstart.magnifier touchmove.magnifier mousemove.magnifier");a(document).unbind("mousemove.magnifier");v&&v.destroy();v=null;p&&p.destroy();p=null};u.detailImage=function(){return p.detailImage};u.suppressMagnifier=function(a){ea=a};u.isEngaged=function(){return Q};u.engageMagnifier=E;u.disengageMagnifier=z;k[0].complete?G():k.one("load",G);u.preload(k.attr("src"));n.performance&&performance.now&&n.ue&&ue.count&&ue.count("MagnifierImageDownload",performance.now());if(e.preload){var ja=
e.detailImageUrl,d=function(){u.preload(ja,!0);e.useClickZoom||y.preload()},W=e.preload;W.constructor!==Array&&(W=[W]);for(var w=0;w<W.length;w++)if("immediately"===W[w])d();else if(a(n)[W[w]])a(n)[W[w]](d);else a(n).bind(W[w],d)}return u}function G(){if(H.useHoverZoom){var c={adjustment:[0,0,1,1],generalImageUrls:H.staticImages,location:"over",minHeightElement:"#imageBlock",preload:"ready",zIndex:199,useHoverZoomIpad:H.useHoverZoomIpad,useHoverZoom:H.useHoverZoom,useClickZoom:H.useClickZoom,fadeMagnifier:H.fadeMagnifier,
zoomOutIcon:H.staticImages.zoomOutCur,enhancedHoverOverlay:H.enhancedHoverOverlay||H.atfEnhancedHoverOverlay};I&&(I.destroy(),I=void 0);var e=y.find(".image.item.selected img[data-old-hires]").not("[data-old-hires\x3d'']");b.isjQueryObjDefined(e)?H.useClickZoom?(e.one("click.loadmagnifier touchstart.loadmagnifier",function(a){I=new k(e,c);I.engageMagnifier(a,!0)}),O?e.css("cursor",'url("'+H.staticImages.zoomInCur+'"), auto'):(e.css("cursor","-webkit-zoom-in"),e.css("cursor","-moz-zoom-in"),e.css("cursor",
"zoom-in"))):I=new k(e,c):l.isEnabled&&f.logHoverZoomApplicability(a,l)}}var C,H,M,A,I,y,O=navigator.userAgent.match(/msie|trident/i);return function(a,b,c,f){C=this;H=a;M=b;l.refToModel=M;A=f;C.render=function(a,b,c,e,f,h){y=c;I&&(I.destroy(),I=void 0)};C.update=function(a){};A.register("loadMagnifier",G);A.register("resize",G)}});"use strict";y.when("A","jQuery","imageBlockUtils","postMetric").register("ImageBlockTwisterView",function(c,a,b,m){function l(a,c,f){a=(a=f?f:b.getColorFromState(c.getState().hovered_variations,
h))&&""!==a?a:h.defaultColor;G.dispatch("updateView",{type:"swatchHover",data:{color:a}});m.postCountMetric("swatchHover")}function f(a,c,f,l){a=(a=l?l:b.getColorFromState(c.getState().selected_variations,h))&&""!==a?a:h.defaultColor;a===k.getCurrentItem().color?"function"===typeof f&&f():(G.dispatch("updateSelection",{type:"swatchClick",data:{color:a},onload:function(){var a={hasComponents:!0,components:[{name:"mainImage"}]};"function"===typeof n.markFeatureRender&&n.markFeatureRender("imageblock",
a);f()}}),m.postCountMetric("swatchClick"))}var F,h,k,G;return function(a,b,m,A){F=this;h=a;k=b;G=A;c.on("image-block-twister-swatch-hover",l);c.on("image-block-twister-swatch-click",f);F.render=function(a,b,c,f,e){};F.update=function(a){}}});"use strict";y.when("A","jQuery","Airy","imageBlockUtils","ImageBlockLoader","postMetric","vse_ns_videoPlayer").register("ImageBlockVideoView",function(c,a,b,m,l,f,F){function h(b,d,g,c){!e.autoplayVideo||X||e.useChromelessVideoPlayer?!m.isjQueryObjDefined(b.find(".a-button-selected"))&&
(g=x.getCurrentItem(),!c||e.prioritizeVideos||"chromeless-video"===g.type&&e.autoplayVideo)&&(c=m.getVideoHash(g.color,0,e),-1!==c&&(d+=0,q.dispatch("updateModel",{data:{index:0,thumbnailIndex:d,variant:c.variant,type:e.useChromelessVideoPlayer?"chromeless-video":"chromeful-video"}}),d=b.find(".item").get(d),m.selectGivenThumbnail(a(d),b))):(m.selectGivenThumbnail(b.find("img:last"),b),m.fadeToThumbnail(b.find("img").length-1,E,b))}function k(a){var b=x.getCurrentItem().color;if(e.useChildVideos&&
!e.colorToVideo[b]){var d=function(){if(a){e.colorToVideo[b]=a;var d={type:"updatedData",data:x.getCurrentItem()};q.dispatch("updateView",d)}};e.lazyLoadExperienceDisabled?d():y.when(m.rankedImagesReadyEvent(e.colorToAsin[b].asin)).execute(function(){d()})}}function G(a){if(!e.useChildVideos)return m.lazyLoadingRequired(x.getCurrentItem(),x,e)?void 0:e.videos;if(e.colorToVideo[a])return e.colorToVideo[a];var b=e.colorToAsin[a];if(b&&b.asin){var d={};d.params={asin:b.asin,productGroupID:e.productGroupID,
useAiryVideoPlayer:!0,useChromelessVideoPlayer:e.useChromelessVideoPlayer,isUDP:e.isUDP};e.isDPXFeatureEnabled||(d.success=function(a){k(a)},l.load("/gp/product/features/apparel-main-image/videos.html",d));return e.colorToVideo&&e.colorToVideo[a]}}function n(){q.dispatch("selectThumbnail",m.useTabbedImmersiveView(e)?1:0)}function H(d,g,c,e){return b.embed({isShowFirstFrameWhenReadyEnabled:!0,parentElement:d[0],streamingUrls:g.url,swfUrl:c.swfUrl,foresterMetadataParams:c.foresterMetadataParams,backgroundColor:"transparent",
flashParams:{wmode:"transparent"},experiments:{supportChromelessPlayback:!0},bindings:{canplay:function(){var a=m.isjQueryObjDefined(d.find("video"))?"HTML5":"FLASH";f.postCountMetric("dppc_chromelessVideo:"+a)},playing:function(){d.parent().css("z-index",8)},videounsupported:function(){n();f.postCountMetric("dppc_chromelessVideo:VIDEO_UNSUPPORTED")},error:function(){n();f.postCountMetric("dppc_chromelessVideo:ERROR")},ended:function(){u.seek(0)}},cuePoints:[{values:g.durationSeconds-1,type:"position",
callback:function(b,g,c){b=c.durationSeconds-c.playheadTimeSeconds;d.parent().css("background-color","white").find(".airy-renderer-container").fadeTo(1E3*b,.1,function(){d.parent().css({"background-color":"transparent","z-index":-1});n();a(this).show().css("opacity",1)})}}]})}function M(b){if("chromeful-video"===b.type||"chromeless-video"===b.type){var f=m.getVideoHash(b.color,b.index,e);if(-1===f)return-1;if("chromeful-video"===b.type){b=E.width()/E.height();var p=parseInt(f.videoWidth,10),h=parseInt(f.videoHeight,
10);m.updateAspectRatio(b,p,h,r);u?(u.show(),m.loadMediaIntoAiry(u,f,g,e.tabletWeb)):u=e.tabletWeb?v:m.createAiryInstanceForChromeful(r,f,g,null,e.autoplayVideo,E,z,t);b:if(m.useTabbedImmersiveView(e)){if(1<m.getVideosCount(x.getCurrentItem().color,e)){if(m.isDefined(J)){z.show();break b}J=a('\x3ca class\x3d"more-videos"\x3e\x3c/a\x3e').attr("href","#").text(e.staticStrings.watchMoreVideos);z.find("#videoCaption").append(J);c.declarative.create(J,"videoIngressClick",d)}m.playVideoInImmersiveView(e,
x.getCurrentItem().color)&&(c.declarative.create(r,"videoIngressClick",d),r.attr&&r.attr("data-ux-click",""),r.children().css("z-index","-1"),r.css("display","inline-block"))}else z.find("#videoCaption").text(e.staticStrings.playVideo),z.show();f=u;e.autoplayVideo&&f&&!X&&(m.toggleVideoCaption(z),f.setVolume(0),f.show(),f.play(),X=!0)}else u?(u.show(),m.loadMediaIntoAiry(u,f,g,e.tabletWeb),u.play(),z.show()):(u=H(r,f,g))&&u.play()}}function A(b,g,c){var p=G(g);g=b;m.isDefined(p)&&0<p.length&&e.alwaysIncludeVideo&&
b===e.maxAlts&&(t.find(".item:last").remove(),b--);m.isDefined(p)&&(a.each(p,function(g,c){if(b<e.maxAlts){var h=e.useChromelessVideoPlayer?"chromeless-video":"chromeful-video",q={type:h,index:g,thumbnailIndex:b,variant:c.variant};d={type:"video-ingress",index:g,thumbnailIndex:b,variant:c.variant};m.useTabbedImmersiveView(e)&&("chromeful-video"===h&&(D+=" videoBlockIngress  videoBlockDarkIngress",c.thumb=c.thumb.replace("_PKmb-play-button-overlay-thumb","")),e.altsOnLeft||(D+=" a-align-top"));m.createThumbnail(q,
c.thumb,t,D);if(2===e.dp60VideoPosition){var r=t,q=e.dp60VideoPosition;if(0!==q){var x=r.children(".imageThumbnail"),r=r.children(".videoBlockIngress");x&&r&&x[q-1]&&a(x[q-1]).before(r[0])}}m.useTabbedImmersiveView(e)&&(I(t.find(".videoBlockIngress img"),e.videoIngressATFSlateThumbURL),q=1<p.length?"multiple-videos":"one-video",(x=1<p.length?p.length+" "+e.staticStrings.multipleVideos:e.staticStrings.singleVideo)&&t.find(".videoBlockIngress").append(t.find("#videoCount_template").clone().text(x).attr("id",
"videoCount")).addClass(q));U||(U=!0,f.postCountMetric("chromeless-video"===h?"dppc_chromelessVideoAvailable":"dppc_chromefulVideoAvailable"));b++}if(m.useTabbedImmersiveView(e))return!1}),h(t,g,b,c));return b}function I(a,b){var d=a.attr("src");if(d&&b){a.attr("src",b);var g=new Image;g.onload=function(b){a.attr("src",d)};g.src=d}}function N(a){u&&u.pause();a.data=d;a.clickTimeStamp=a.$event.timeStamp;var b="a"===a.targetTag?"dpcc_videoIngressLink":"dpcc_videoIngressSlate";q.dispatch("imageClick",
a);f.postTimeMetric("dpcc_vse_videoingressclick",a.$event.timeStamp);f.postCountMetric(b)}function O(a){v=a.player;v.hide=function(){v.pause();c.$("#main-video-container").find(".vse-player-container").hide()};v.show=function(){c.$("#main-video-container").find(".vse-player-container").show();v.play()};v.getMediaSourceInfo=function(){return m.getMediaSourceInfo()}}var L,e,x,q,t,r,z,E,J,u,g,d,p,v,U=!1,X=!1,D="videoThumbnail";return function(b,h,l,v){L=this;e=b;x=h;q=v;g=e.airyConfig;e.colorToVideo=
{};e.colorToVideo[e.landingAsinColor]=e.colorToVideo[e.defaultColor]=e.videos;L.render=function(b,d,g,f,h,q){t=f;r=h.find("#main-video-container");z=r.parent().find("#video-canvas-caption");E=a("#main-image-container");e.useChromelessVideoPlayer||r.addClass("chromeful-container");p=A(d,b,q);M(x.getCurrentItem());m.useTabbedImmersiveView(e)&&c.declarative("videoIngressClick",["click"],N);b=x.getCurrentItem().color;d=m.getVideoHash(b,0,e);-1!==d&&e.tabletWeb&&(b=m.getNilgiriServiceAjaxRequest(e,b,d),
F.get(c,"#main-video-container",b,function(){c.$("#main-video-container").find(".vse-player-container").hide()},function(){c.$("#imageBlock #altImages ul").find("li.videoThumbnail").hide()}));return p};L.update=function(a){var b=a.data;"ingress"!==b.type&&u&&(u.hide(),r.parent().css("z-index",-1),z.hide());if("swatchHover"===a.type)b.color===x.getCurrentItem().color?M(x.getCurrentItem()):a.captured||m.lazyLoadingRequired(b,x,e)&&!m.lazyLoadOnHoverEnabled(e)&&M(x.getCurrentItem());else if("chromeful-video"===
b.type||"chromeless-video"===b.type)"mouseenter"===a.type&&f.postCountMetric("dpcc_videoThumbHovered_"+(b.thumbnailIndex+1)+"_"+p),M(b),e.usePeekHover&&"click"!==a.type||(m.selectGivenThumbnail(a.$declarativeParent,t),"click"===a.type&&m.useTabbedImmersiveView(e)&&(f.postCountMetric("dpcc_videoThumbClicked_"+(b.thumbnailIndex+1)+"_"+p),d.action="videoIngressClick",d.clickTimeStamp=a.$event.timeStamp,d.$event=a.$event,d.$currentTarget=a.$currentTarget,q.dispatch("videoIngressClick",d),f.postTimeMetric("dpcc_vse_videoingressclick",
a.$event.timeStamp)))};if(e.isDPXFeatureEnabled)c.on("triggerVideoAjax",k);c.on("vsePlayer-imageblock_tablet",O)}});"use strict";y.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric","postEarlyMetric","imageBlockImmersiveViewUtils").register("ImageBlockImmersiveView",function(c,a,b,m,l,f,F,h){function k(a){return a.hiRes||a.large||a.main[a.main.length-1]}function G(){w.find("#ivTitle").click(function(){W.hide()})}function C(){P=Oa?{type:"360-spin"}:aa.getCurrentItem()}
function H(){var a=w.find("#ivStage"),b=W.$container.find(".a-popover-wrapper"),d=b.find(".a-popover-inner"),b=b.height()-h.getDimension(d,"padding-top")-h.getDimension(d,"padding-bottom");w.css("height",b);var d=w.find("#ivTitle").outerHeight(!0),g=w.find("#ivVariationSelection").outerHeight(!0),c=w.find("#ivMediaSelection").outerHeight(!0),f=w.find("#ivThumbs"),e=h.getDimension(f,"margin-top")+h.getDimension(f,"margin-bottom");f.css("height",b-d-g-c-e);w.find("#ivLargeImage").css("height",b);a.css("width",
w.width()-h.getDimension(w,"padding-left")-h.getDimension(w,"padding-right")-w.find("#ivThumbColumn").width()-h.getDimension(a,"margin-left")-h.getDimension(a,"margin-right"))}function M(){w.find("#ivMediaSelect").change(function(){var b=a(this).val();"all"===b?(w.find("#ivVideoList").hide(),w.find("#ivThumbs").show(),w.find(".ivThumbVideo").show(),"chromeful-video"===P.type&&w.find("#ivVideo_"+P.index).click()):"images"===b?(w.find("#ivVideoList").hide(),w.find("#ivThumbs").show(),w.find(".ivThumbVideo").hide(),
"chromeful-video"===P.type&&(0===ca&&0===V?w.find("#iv360").click():0===ca?w.find("#ivHeroImage_0").click():w.find("#ivImage_0").click())):"videos"===b&&(w.find("#ivVideoList").show(),w.find("#ivThumbs").hide(),"chromeful-video"!==P.type?w.find("#ivVideoList_0").click():w.find("#ivVideoList_"+P.index).click())})}function A(){var a=w.find("#ivStage").find("#ivLargeImage"),b=a.width(),d=a.height(),g=a.find(".fullscreen");g.removeAttr("style");var c=g.width(),f=g.height();0<g.length&&(g[0].naturalWidth&&
(c=g[0].naturalWidth),g[0].naturalHeight&&(f=g[0].naturalHeight));a.css("cursor","auto");var c=0===c?1:c,f=0===f?1:f,e=Math.min(b/c,d/f),p=f*e,h=c*e;1>e?(Pa?a.css("cursor","url('"+B.staticImages.zoomIn+"'), auto"):(a.css("cursor","-webkit-zoom-in"),a.css("cursor","-moz-zoom-in"),a.css("cursor","zoom-in")),za=!0):za=!1;c=Math.min(h,c);f=Math.min(p-20,f);g.css({"margin-top":(d-f)/2,"margin-left":(b-c)/2,height:f,width:c});a.css("visibility","visible");Aa=!1}function I(a){var b=w.find("#ivLargeImage");
b.css("visibility","hidden");b.empty();h.animateStageIn(b);b.append(a);A()}function N(){da&&da.pause();w.find("#ivLarge360").css("display","none");w.find("#ivLargeVideo").css("display","none");w.find("#ivLargeImage").css("display","none");r()}function O(d){N();w.find("#ivLargeImage").css("display","block");var g;"hero-image"===d?b.isDefined(ha)&&(g=k(ha[P.index])):b.isDefined(ia)&&(g=k(ia[P.index]));if(b.isDefined(g)){w.find(".fullscreen").remove();var c=a("\x3cimg\x3e").attr("src",g).addClass("fullscreen"),
f=w.find("#ivLargeImage");h.animateStageOut(f,function(){c.load(function(){I(c)});if(c[0].complete)I(c);else{f.empty();var b=(f.height()-104)/2,d=(f.width()-80)/2;a("\x3cimg\x3e").attr("src",B.staticImages.spinner).css({position:"relative",top:b+"px",left:d+"px"}).appendTo(f)}})}}function L(){var a=parseInt(P.index,10)+1;a>=ga.length||w.find("#ivVideo_"+a).click()}function e(){var a;b.isDefined(ga)&&(a=ga[P.index]);if(b.isDefined(a)){N();var d=w.find("#ivLargeVideo").css("display","block");da?(da.isDetached()&&
da.attach(d[0]),b.loadMediaIntoAiry(da,a,va,B.tabletWeb),da.show()):(da=b.createAiryInstanceForChromeful(d,a,va,"ImmersiveView"),va.enableContinuousPlay&&da.bind("ended",L));da.play({isAsync:!0})}}function x(){C();var a;a="hero-image"===P.type?w.find("#ivHeroImage_"+P.index):"image"===P.type?w.find("#ivImage_"+P.index):"chromeful-video"===P.type||"chromeless-video"===P.type?w.find("#ivVideo_"+P.index):"360-spin"===P.type?w.find("#iv360"):b.isDefined(ha)?w.find("#ivHeroImage_"+P.index):w.find("#ivImage_"+
P.index);b.isjQueryObjDefined(a)||(a=w.find("#ivImage_0"));q(a)}function q(a){w.find(".ivThumb").removeClass("selected");a.addClass("selected");a.hasClass("ivThumbVideo")?(P.type="chromeful-video",P.index=a.attr("id").split("_")[1],e()):a.hasClass("ivHeroImage")?(P.type="hero-image",P.index=a.attr("id").split("_")[1],O(P.type)):a.hasClass("iv360Image")?(P.type="360-spin",P.index=0,t()):(P.type="image",P.index=a.attr("id").split("_")[1],O(P.type))}function t(){N();w.find("#ivLarge360").css("display",
"block");g();var a=w.find("#ivLarge360");a.css({opacity:0});setTimeout(function(){a.css({opacity:.4});h.animateStageIn(a)},200);E();l.postCountMetric("dppc_click360");ra=Date.now()}function r(){0<ra&&(z("dppc_duration360",Date.now()-ra),ra=0)}function z(a,b){n.ue&&n.ue.count(a,b)}function E(){if(0<oa){var a=w.find(".iv360Hint");a.removeClass("iv360HintFaded");a.animate({opacity:1},200)}}function J(b,d){if(oa<b.length){var g=a("\x3cimg /\x3e").css({display:"block",width:6*ma+"px",height:qa+"px"});
g.hide();d.append(g);g.get(0).onload=function(){d.closest(document.documentElement).length&&(oa++,1===oa&&(E(),0<ra&&z("dppc_loadTime360",Date.now()-ra)),0<Ga&&z("dppc_perSpriteloadTime360",Date.now()-Ga),w.find("#iv360Spinner").hide(),g.show(),wa=5*T.imageLocations[Math.floor(xa/T.imageLocations[0].length)][xa%T.imageLocations[0].length],J(b,d))};g.attr("src",b[oa].replace(/(\._SP)\d+(,)\d+/,"$1"+sa+"$2"+ta));Ga=Date.now()}}function u(a){if(b.isDefined(T.spriteWidthSizes)&&0<T.spriteWidthSizes.length){var d=
T.spriteWidthSizes,g=d.length,c=d[0],f=d[g-1];if(a<=c)return c;if(a>f)return f;for(c=0;c<g;c++)if(a>d[c]&&a<=d[c+1])return d[c+1]}else return a}function g(){var b=w.find("#ivLarge360");b.children("#image-360-sprites").length||(b.append("\x3cdiv id\x3d'image-360-sprites'\x3e\x3c/div\x3e"),b.css({"margin-left":0,"margin-top":0,width:b.parent().width(),height:b.parent().height(),overflow:"hidden",position:"relative","-ms-user-select":"none","-webkit-user-select":"none","-mos-user-select":"none"}),a("\x3cimg\x3e").attr("src",
B.staticImages.spinnerNoLabel).attr("id","iv360Spinner").css({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"block"}).appendTo(b),Ha=!0,d())}function d(){if(b.isDefined(T.spriteURLs)&&b.isDefined(w)&&Ha&&!Ia){var d=w.find("#ivLarge360"),g=a("\x3cdiv\x3e").addClass("iv360Hint").css({position:"absolute",width:"100%",bottom:0,opacity:0,display:"block"});b.isDefined(T.staticImages.hint360)&&a("\x3cimg\x3e").css({"margin-left":"auto","margin-right":"auto",display:"block"}).attr("src",
T.staticImages.hint360).appendTo(g);a("\x3cdiv\x3e").css({"text-align":"center"}).text(B.staticStrings.dragToSpin).appendTo(g);g.appendTo(d);var g=T.imageWidth,c=T.imageHeight,f=d.parent().width(),e=d.parent().height(),h=0,q=0;g/c>f/e?(sa=u(f),ta=Math.round(c/g*sa),ma=Math.ceil(f),qa=Math.ceil(ta/sa*f),q=(e-qa)/2):(ta=u(e),sa=Math.round(g/c*ta),qa=Math.ceil(e),ma=Math.ceil(sa/ta*e),h=(f-ma)/2);d.css({"margin-left":h,"margin-top":q,width:ma+"px",height:qa+"px",overflow:"hidden",position:"relative"});
d.children("#image-360-sprites").css("width",6*ma+"px");J(T.spriteURLs,w.find("#image-360-sprites"),0);g=w.find("#ivLarge360");g.bind("mousedown",X);g.bind("touchstart",p);g.bind("touchmove",v);g.bind("touchend",U);a(document).bind("mousemove",D);a(document).bind("mouseup",K);b.isDefined(B.staticImages.grab)&&d.css("cursor","url('"+B.staticImages.grab+"'), auto");Ia=!0}}function p(a){Ba=!0;Ja=a.originalEvent.targetTouches[0].clientX}function v(a){Ba&&(Q(a.originalEvent.targetTouches[0].clientX-Ja),
Ja=a.originalEvent.targetTouches[0].clientX)}function U(a){Ba&&(Ba=!1)}function X(a){Ca=!0;fa=a.originalEvent.clientX;b.isDefined(B.staticImages.grabbing)&&(a=w.find("#ivLarge360"),a.css("cursor","url('"+B.staticImages.grabbing+"'), auto"),a.parents(".a-declarative").last().css("cursor","url('"+B.staticImages.grabbing+"'), auto"));return!1}function D(a){Ca&&(Q(a.originalEvent.clientX-fa),fa=a.originalEvent.clientX)}function K(a){Ca&&(Ca=!1,b.isDefined(B.staticImages.grab)&&(a=w.find("#ivLarge360"),
a.css("cursor","url('"+B.staticImages.grab+"'), auto"),a.parents(".a-declarative").last().css("cursor","auto")))}function Q(a){for(a=wa-=a/ma*180;0>a;)a+=360;for(;360<a;)a-=360;wa=a;var d;a=360;for(var g=0;g<oa;g++)for(var c=0;c<T.imageLocations[g].length;c++){var f=Math.abs(wa-5*T.imageLocations[g][c]);f<a&&(a=f,d=g*T.imageLocations[0].length+c)}d!==xa&&(a=Math.floor(d/T.imageLocations[0].length),a!==Math.floor(xa/T.imageLocations[0].length)&&(b.isDefined(Ka)||(Ka=document.createElement("canvas").getContext("2d")),
g=w.find("#image-360-sprites").children(),Ka.drawImage(g[a],0,0)),a=w.find(".iv360Hint").not(".iv360HintFaded"),b.isDefined(a)&&(a.addClass("iv360HintFaded"),a.animate({opacity:0},750)));xa=d;a=d%T.imageLocations[0].length*-1*ma;d=-1*Math.floor(d/T.imageLocations[0].length)*qa;g=w.find("#ivLarge360").children("#image-360-sprites");g.css("-webkit-transform","translate3d("+a+"px, "+d+"px, 0)");g.css("transform","translate3d("+a+"px, "+d+"px, 0)")}function ea(){w.delegate(".ivThumb","click",function(){var b=
a(this);q(b)});w.delegate(".ivThumbVideoListOuter","click",function(){w.find(".ivThumbVideoListOuter").removeClass("selected");var b=a(this);b.addClass("selected");P.type="chromeful-video";P.index=b.attr("id").split("_")[1];e()})}function R(){da&&!da.isDetached()&&(va.volume=da.getVolume(),da.detach(),!document.all||n.atob||document.addEventListener||(da=null));w.find("#ivLargeImage").empty();r()}function S(a,b){return 0<b?b/2:Math.min(0,Math.max(b,a))}function ba(b){var d=pa.left-(b.pageX-Da[0])*
Ea;c.capabilities.rtl&&(d=pa.left-(a(n).width()-b.pageX-Da[0])*Ea);b=pa.top-(b.pageY-Da[1])*Ea;d=S(d,Fa.left);b=S(b,Fa.top);w.find(".fullscreen").css({left:d,top:b})}function ya(){w.delegate("#ivLargeImage","click",function(a){if(Aa)A();else if(za){w.find(".fullscreen").removeAttr("style");if(za){var b=w.find("#ivLargeImage"),d=b.find(".fullscreen");Pa?b.css("cursor","url('"+B.staticImages.zoomOut+"'), auto"):(b.css("cursor","-webkit-zoom-out"),b.css("cursor","-moz-zoom-out"),b.css("cursor","zoom-out"));
Aa=!0;var g=w.find("#ivLargeImage");Fa.left=g.width()-d.width();Fa.top=g.height()-d.height();var g=b.height()/2,c=b.width()/2;Da=[b.offset().left+c,b.offset().top+g];pa.top=g-d.height()/2;pa.left=c-d.width()/2;d.css({position:"relative",left:pa.left,top:pa.top});Ea=Math.max(d.height()/b.height(),d.width()/b.width())}ba(a)}});w.delegate("#ivLargeImage","mousemove",function(a){Aa&&ba(a)})}function la(d){if(b.isImmersiveViewEnabled(B,aa.getCurrentItem().color))if(La){var g=d.$event.originalEvent;g.acknowledge&&
g.acknowledge(d.$currentTarget[0]);Oa=b.isDefined(d)&&"button-360-click"===d.action;f.isEnabled&&F.logImmersiveViewRequestServed(f);l.postCountMetric("dppc_immersiveViewOpened");if(b.isDefined(W))W.show();else{d=a("#auiImmersiveViewDiv");var g=a(n).height()-150,e=a(n).width()-75;W=La.create(d,{name:"immersiveView",activate:"onclick",width:e,height:g,popoverLabel:"ImmersiveView",hideHeader:!0});d.click()}if(Ma){w=a("#ivMain");d=aa.getCurrentItem().color;ia=B.colorImages[d];ha=B.heroImage[d];ga=B.useChildVideos?
B.colorToVideo[d]:B.videos;Na=Y()&&B.spin360ColorEnabled[d];T=Y()?B.spin360ColorData[d]:void 0;C();ka=V=na=ca=0;b.isDefined(ha)&&(V=ha.length);b.isDefined(ia)&&(ca=ia.length);b.isDefined(ga)&&(na=ga.length);Na&&(ka=1);h.populateTitle(w.find("#ivTitle"),45,B);h.populateVariationSelection(w.find("#ivVariationSelection"));d=w.find("#ivMediaSelect");0===ca+ka||0===na?(d.parent().hide(),w.find("#ivThumbs").addClass("noMediaSelection")):(d.empty(),a("\x3coption/\x3e").attr("value","all").prop("selected",
!0).text(B.staticStrings.allMedia+" ("+(V+ca+ka+na)+")").appendTo(d),a("\x3coption/\x3e").attr("value","images").text(B.staticStrings.images+" ("+(V+ca+ka)+")").appendTo(d),a("\x3coption/\x3e").attr("value","videos").text(B.staticStrings.videos+" ("+na+")").appendTo(d),d.parent().show(),d.val("all"));d=w.find("#ivThumbs");d.find(".ivRow").not(".placeholder").remove();for(var g=V+ca+na+ka,p=e=0;e<g;)for(var q=d.find(".ivRow.placeholder").clone().removeClass("placeholder").appendTo(d),r=0;3>r&&e<g;r++,
e++,p++)if(p<V){var t=ha[e].thumb,x=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivHeroImage").attr("id","ivHeroImage_"+e).appendTo(q);x.find(".ivThumbImage").css("background",'url("'+h.getResizedThumbnailURL(t)+'") center no-repeat')}else if(p>=V&&p<ca+V)t=ia[e-V].thumb,x=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").attr("id","ivImage_"+(e-V)).appendTo(q),x.find(".ivThumbImage").css("background",'url("'+h.getResizedThumbnailURL(t)+'") center no-repeat');
else if(p>=V+ca&&p<ca+V+ka)x=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("iv360Image").attr("id","iv360").appendTo(q),x.find(".ivThumbImage").css("background",'url("'+(b.isDefined(B.staticImages.icon360)?h.getResizedThumbnailURL(B.staticImages.icon360,!0):"")+'") center no-repeat');else if(t=ga[e-ca-V-ka],x=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivThumbVideo").attr("id","ivVideo_"+(e-ca-V-ka)).appendTo(q),x.find(".ivThumbImage").css("background",
'url("'+t.thumbUrl+'") center no-repeat'),b.isDefined(t)){var v={position:"triggerTop"},k=w.find("#ivThumbs").find(".ivThumbVideoPopover.placeholder").clone().removeClass("placeholder");k.find(".ivVideoPopoverTitle").text(t.title);k.find(".ivVideoPopoverDuration").text(t.durationTimestamp);v.inlineContent=k[0];c.declarative.create(x,"a-tooltip",v)}d=w.find("#ivVideoList");d.find(".ivThumbVideoListOuter").not(".placeholder").remove();g=d.find(".placeholder");for(e=0;e<na;e++)p=ga[e],q=g.clone().removeClass("placeholder").appendTo(d),
q.attr("id","ivVideoList_"+e),q.find(".ivThumbImage").css("background",'url("'+p.thumbUrl+'") center no-repeat'),q.find(".ivThumbTitle").text(p.title),q.find(".ivThumbDuration").text(p.durationTimestamp);w.find("#ivLarge360").empty();oa=0;Ia=Ha=!1;va=B.airyConfig;Ma=!1;Qa()}}else n.performance&&performance.now&&n.ue&&ue.count&&ue.count("DPIBClickFailedInteractionCount",(ue.count("DPIBClickFailedInteractionCount")||0)+1);else l.postCountMetric("immersiveViewNotExistsClickCount")}function ua(a){var g=
B.colorToAsin[a],c={},f=500;if(g&&g.asin){c.params={asin:g.asin};var e="360"+g.asin,p=Date.now();c.success=function(g){z("dppc_asyncRequestTime360",Date.now()-p);g&&b.isDefined(g.spin360.spin360Model)?(b.ajaxState(e,"success"),B.spin360ColorData[a]=g.spin360.spin360Model,a===aa.getCurrentItem().color&&(T=B.spin360ColorData[a],d())):c.error()};c.error=function(){l.postCountMetric("dppc_asyncFailed360");z("dppc_asyncRequestTime360",Date.now()-p);f*=2;16E3>=f?setTimeout(function(){p=Date.now();m.load("/gp/product/features/apparel-main-image/360.html",
c)},f):b.ajaxState(e,"fail")};b.ajaxState(e)&&"fail"!==b.ajaxState(e)||(m.load("/gp/product/features/apparel-main-image/360.html",c),b.ajaxState(e,"sent"))}}function Y(){return b.isDefined(B.spin360ConfigEnabled)&&B.spin360ConfigEnabled}var Z,B,aa,ja,W,w,ha,ia,ga,V,ca,na,ka,P,da,va,T,Na,ma,qa,ta,sa,fa,Ja,Oa=!1,Ha=!1,Ia=!1,wa=0,xa=0,ra=0,Ga=0,Ca=!1,Ba=!1,oa=0,Ka,Pa=navigator.userAgent.match(/msie|trident/i),Ma=!0,Aa=!1,za=!1,Fa={},pa={},Ea,Da,La;y.when("a-modal").execute(function(a){La=a});var Qa=
c.once(function(){M();ea();ya();c.on("a:popover:afterUpdatePosition:immersiveView",H);c.on("a:popover:afterShow:immersiveView",x);c.on("a:popover:afterHide:immersiveView",R);G()});return function(d,g,e,p){Z=this;B=d;aa=g;f.refToModel=aa;ja=p;Y()&&(B.spin360ColorData[B.landingAsinColor]=B.spin360ColorData[B.defaultColor],B.spin360ColorEnabled[B.landingAsinColor]=B.spin360ColorEnabled[B.defaultColor]);b.isDefined(B.staticImages.icon360)&&a("#imageBlock #altImages ul").find(".360IngressTemplate").find("img").attr("src",
h.addStyleCodeToURL(B.staticImages.icon360,"_FMpng_RI_"));Z.render=function(a,d,g,f,e,p){Ma=!0;Y()&&B.spin360ColorEnabled[a]&&!b.isDefined(B.spin360ColorData[a])&&(B.spin360ColorData[a]={},ua(a));b.isImmersiveViewEnabled(B,aa.getCurrentItem().color)&&Y()&&B.spin360ColorEnabled[a]&&(d===B.maxAlts&&(a=f.find(".item.imageThumbnail"),g=f.find(".item.videoThumbnail"),b.isDefined(g)&&1<g.length?g.last().remove():a.last().remove(),d--),a=f.find(".360IngressTemplate").clone().removeClass("360IngressTemplate").removeClass("aok-hidden").addClass("item"),
c.declarative.create(a,"button-360-click"),f.append(a),d++,l.postCountMetric("dppc_display360"));return d};Z.update=function(a){};b.isImmersiveViewEnabled(B,aa.getCurrentItem().color)||b.addTag("immersiveViewNotAvailable");ja.register("imageClick",la);ja.register("button360Click",la)}});"use strict";y.when("A","jQuery","imageBlockUtils","postMetric","logFailedInteractionMetric","postEarlyMetric","imageBlockImmersiveViewUtils").register("ImageBlockTabbedImmersiveView",function(c,a,b,m,l,f,F){function h(){var b=
M.getImmersiveViewModalInstance().$container.find(".a-popover-wrapper"),f=b.find(".a-popover-inner"),b=b.height()-F.getDimension(f,"padding-top")-F.getDimension(f,"padding-bottom");a("#iv-tab-view-container").css("height",b);N=a("#iv-tab-view-container ul.iv-tab-views li").filter(function(){return"none"!==a(this).css("display")}).length;1<N?(a("#iv-tab-view-container ul.iv-tab-views li").parent().show(),f=a("#iv-tab-view-container ul.iv-tab-views li").parent().height(),b-=f):a("#iv-tab-view-container ul.iv-tab-views li").parent().hide();
a("#iv-tab-view-container .iv-tab-content").css("height",b);c.trigger("dp:image-block:immersive-view:resize")}function k(){c.trigger("dp:image-block:immersive-view:reset")}function G(h){if(b.isImmersiveViewEnabled(H,M.getCurrentItem().color))if(L){var x=h.$event.originalEvent;x.acknowledge&&x.acknowledge(h.$currentTarget[0]);l.isEnabled&&f.logImmersiveViewRequestServed(l);m.postCountMetric("dppc_immersiveViewOpened");b.isDefined(h)&&("button-360-click"===h.action?a("#iv360TabHeading").click():"videoIngressClick"===
h.action?(O=h.clickTimeStamp,a("#ivVideosTabHeading").click()):"showroomIngressClick"===h.action?(O=h.clickTimeStamp,a("#ivShowroomTabHeading").click()):a("#ivImagesTabHeading").click());x=M.getImmersiveViewModalInstance();if(b.isDefined(x))x.show();else{h=a("#auiImmersiveViewDiv");var x=Math.min(Math.max(a(n).height()-150,540),1080),r=Math.min(Math.max(a(n).width()-75,990),1980),x=L.create(h,{name:"immersiveView",activate:"onclick",width:r,height:x,popoverLabel:"ImmersiveView",hideHeader:!0});M.setImmersiveViewModalInstance(x);
h.click()}I&&(I=!1,e(),c.trigger("dp:image-block:immersive-view:init"))}else n.performance&&performance.now&&n.ue&&ue.count&&ue.count("DPIBClickFailedInteractionCount",(ue.count("DPIBClickFailedInteractionCount")||0)+1);else m.postCountMetric("immersiveViewNotExistsClickCount")}var C,H,M,A,I=!0,N=0,O,L;y.when("a-modal").execute(function(a){L=a});var e=c.once(function(){c.on("a:popover:afterUpdatePosition:immersiveView",h);c.on("a:popover:afterShow:immersiveView",h);c.on("a:popover:afterHide:immersiveView",
k)}),x=c.once(function(){var b=a("#iv-tab-view-container ul.iv-tab-views li");b.bind("click",function(f){var e=b.filter(".iv-active");e.attr("id")!==a(this).attr("id")&&c.trigger("dp:ivTabs:"+e.find("a").attr("data-iv-tab-view")+":deselect",f);b.removeClass("iv-active");a(this).addClass("iv-active");a("#iv-tab-view-container .iv-tab-content").hide();e=a(this).find("a").attr("data-iv-tab-view");a("#"+e).show();"ivVideosTab"===e&&(f.clickTimeStamp=O||f.timeStamp);c.trigger("dp:ivTabs:"+e+":select",
f);m.postCountMetric("dppc_"+e);return!1})});return function(a,c,f,e){C=this;H=a;M=c;l.refToModel=M;A=e;C.render=function(a,b,c,g,d,f){m.postCountMetric("dpcc_altThumbs_"+b);I=!0};C.update=function(a){};C.getTitle=function(){};C.getVariationSelectionInfo=function(){};x();b.isImmersiveViewEnabled(H,M.getCurrentItem().color)||b.addTag("immersiveViewNotAvailable");A.register("imageClick",G);A.register("button360Click",G);b.useTabbedImmersiveView(H)&&(A.register("videoIngressClick",G),A.register("showroomIngressClick",
G))}});"use strict";y.when("A").register("ImageBlockLoader",function(c){return{load:function(a,b){b=b||{};b.timeout=b.timeout||4E3;c.ajax(a,b)}}});"use strict";y.when("A","jQuery","Airy","postMetric","ImageBlockATF","ImageBlockBTF","logFailedInteractionMetric","postEarlyMetric").register("imageBlockUtils",function(c,a,b,m,l,f,F,h){function k(a){return null!==a&&"undefined"!==typeof a}function G(b){var d=0;a.each(b,function(a,b){var g=parseInt(b[1],10);g>d&&(d=g)});return d}function C(b){var d=0;a.each(b,
function(a,b){var g=parseInt(b[0],10);g>d&&(d=g)});return d}function H(a,b,c){b=b.width();if(c.naturalMainImageSize)return b;a=G(a);0<a&&(b=Math.min(b,a));return b}function y(a,b,c){b=b.height();if(c.naturalMainImageSize)return b;a=C(a);0<a&&(b=Math.min(b,a));return b}function A(b){var d;a.each(b,function(a,b){k(d)||(d=b[1]/b[0])});return d||1}function I(a,b,c){b.fadeTo(500,0,function(){O(a,c);b.fadeTo(500,1)})}function N(a){a&&a.toggle()}function O(b,d){var c=d.find("img");k(c[b])&&a(c[b]).click()}
function L(a,b){u[a]=b?b:u[a];return u[a]}function e(b,d,c){c=c||J;c=c.colorImages;if(1>c.length||!k(c[b])||!k(d))return-1;var f=-1;a.each(c[b],function(a,b){b.variant===d&&(f=a)});return f}function x(b,d,c){c=c||J;c=c.colorImages;return!(k(c)&&k(c[b])&&k(c[b][d])&&k(c[b][d].main))||1>a.map(c[b][d].main,function(a,b){return b}).length?-1:c[b][d]}function q(a,b,c,f){f.parent().css("z-index",2);0!==c&&0!==b&&(b/=c,a>b?f.css("width",b/a*100+"%"):f.css("height",a/b*100+"%"))}function t(b,d){var c;if(c=
b.useIV)c=b.colorImages&&b.colorImages[d]&&0<b.colorImages[d].length?!0:!1;F.isEnabled&&(F.IVApplicaple=c,h.logImmersiveViewApplicability(a,F));return c}var r,z,E,J=a.extend(!0,{},l,f),u={};return{isDefined:k,isDefinedAndEmpty:function(a){return k(a)&&"object"===typeof a&&0===Object.keys(a).length},isUndefinedOrEmpty:function(a){return k(a)?"object"===typeof a&&0===Object.keys(a).length:!0},isDefinedAndNotEmpty:function(a){return k(a)?"object"===typeof a&&0<Object.keys(a).length:!1},isjQueryObjDefined:function(a){return 0!==
a.length},getAspectRatio:A,getMaxHeightOfMainImage:y,getMaxWidthOfMainImage:H,getMaxDimensionsOfMainImage:function(a,b,c){if(c.acEnabled)return[b.height(),b.width()];var f=y(a,b,c);b=H(a,b,c);a=A(a);c=b/a;b=Math.min(b,f*a);f=Math.min(f,c);return[f,b]},getContainerHeight:function(a,b,c){var f=a.get(0);a=0;if(k(f)){a=f.offsetWidth/b;a=Math.min(a,c);var e;b=J.mainImageHeightPartitions;c=J.mainImageMaxSizes;if(k(c)&&k(b)){for(var h=0,q=n.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,
f=0;f<b.length;f++)q>b[f]&&(h=f+1);c.length>=h&&(e=c[h])}k(e)&&(a=Math.min(e[1],a))}return a},getColorFromState:function(b,d){if(b){d=d||J;var c="";a.each(d.visualDimensions,function(a,d){b[d]&&(c+=" "+b[d])});return c&&c.substring(1)}},createThumbnail:function(a,b,f,e){var h=f.find(".template").clone().removeClass("template").addClass("item"),q=document.createElement("img");q.src=b;h.find(".placeHolder").replaceWith(q);(b=a.heroVideoVariant)&&"hero-image"===a.type&&a.variant===b&&h.addClass("heroImageThumbnail");
k(e)&&h.addClass(e);c.declarative.create(h,"thumb-action",a);h.attr&&h.attr("data-ux-click","");f.append(h)},selectGivenThumbnail:function(a,b){var c=a.find(".a-button");b.find(".a-button").removeClass("a-button-selected").removeClass("a-button-focus");c.addClass("a-button-selected").addClass("a-button-focus")},createAiryInstanceForChromeful:function(c,d,f,e,h,q,x,l){var k=a.extend({},f.foresterMetadataParams);null!==e&&(k.method+="."+e);var t=[];d.disabledViewIds&&(t=d.disabledViewIds);return b.embed({parentElement:c[0],
streamingUrls:d.url,contentId:d.mediaObjectId,contentMinAge:Number(d.minimumAge||"")||0,contentTitle:d.title,swfUrl:f.swfUrl,foresterMetadataParams:k,backgroundColor:"black",flashParams:{wmode:"transparent"},slateImages:{preloadSlate:d.slateUrl,postMediaSlate:d.slateUrl},videoAds:f.videoAds,bindings:{play:function(){"ImmersiveView"===e?r||(r=!0,m.postCountMetric("dppc_chromefulVideoPlayedIV")):z||(z=!0,m.postCountMetric("dppc_chromefulVideoPlayedPV"))}},cuePoints:[{values:d.durationSeconds-1,type:"position",
callback:function(a,b,c){h&&(I(0,q,l),N(x))}}],disabledViewIds:t})},loadMediaIntoAiry:function(a,b,c,f){a&&a.getMediaSourceInfo()!==b.url&&(f?(E={mediaSourceInfo:[b.url],contentId:b.mediaObjectId,refTag:"vse_ib_tablet_web"},a.loadMedia(E)):a.loadMedia({mediaSourceInfo:b.url,contentId:b.mediaObjectId,contentMinAge:Number(b.minimumAge||"")||0,contentTitle:b.title,slateImages:{preloadSlate:b.slateUrl,postMediaSlate:b.slateUrl}}))},showUnavailable:function(b){b&&(a("#imageBlock .unvailableVariation").html(b),
a("#imageBlock .variationUnavailable").show())},hideUnavailable:function(){a("#imageBlock .variationUnavailable").hide()},fadeToThumbnail:I,toggleVideoCaption:N,selectThumbnail:O,spinner:function(b,c){var f=a("#imageBlock .a-spinner").parent();0===f.length&&(f=a("\x3cdiv\x3e\x3c/div\x3e").append(a("\x3cspan\x3e\x3c/span\x3e").addClass("a-spinner").addClass("a-spinner-medium")),b.append(f),f.css({position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 0)","-webkit-transform":"translate3d(-50%, -50%, 0)",
"z-index":"3",width:"48px",height:"48px",border:"8px solid #FFFFFF","-webkit-border-radius":"20px","-moz-border-radius":"20px","border-radius":"100%"}));c?f.show():f.hide();return f},rankedImagesReadyEvent:function(a){return"ranked-images-ready-for-"+a},ajaxState:L,getIndexForVariant:e,getImageHash:x,lazyLoadingRequired:function(a,b,c){b=Math.max(e(a.color,b.getCurrentItem().variant,c),0);b=-1!==x(a.color,b,c);a=c.colorToAsin[a.color]&&c.colorToAsin[a.color].asin;a=!a||"success"!==L(a);return!c.lazyLoadExperienceDisabled&&
!b&&a},lazyLoadOnHoverEnabled:function(a){return!a.lazyLoadExperienceOnHoverDisabled},updateAspectRatio:q,repositionVideoBanner:function(a,b,c,f){setTimeout(function(){var c=a.width()/a.height();q(c,16,9,b)},f||0)},getVideosCount:function(a,b){return b.useChildVideos&&b.colorToVideo[a]?b.colorToVideo[a].length:b.videos?b.videos.length:0},getVideoHash:function(a,b,c){if(c.useChildVideos){if(!k(c.colorToVideo))return-1;a=c.colorToVideo[a]}else a=c.videos;return k(a)&&k(a[b])&&k(a[b].url)?a[b]:-1},isImmersiveViewEnabled:t,
playVideoInImmersiveView:function(a,b){return t(a,b)&&a.useTabbedImmersiveView},useTabbedImmersiveView:function(a){return a.useTabbedImmersiveView},getMediaSourceInfo:function(){return k(E)?E.mediaSourceInfo[0]:""},getNilgiriServiceAjaxRequest:function(a,b,c){return{requester:"DetailPageTablet",marketplaceID:c.marketPlaceID,clientPrefix:"ImageBlock_tablet",locale:c.languageCode,page:"DetailPageTablet",placement:"ImageBlock",video:{videoURL:c.url,imageURL:c.slateUrl}}},addTag:function(a){n.ue&&n.ue.tag&&
n.ue.tag(a)}}});"use strict";y.when("A","jQuery","imageBlockUtils","ImageBlockHeroUtils").register("ImageBlockHeroImageView",function(c,a,b,m){function l(c,f,e,h){if(!b.isjQueryObjDefined(c.find(".a-button-selected"))){var k=I.getCurrentItem();if(!h||"chromeless-video"!==k.type||!A.autoplayVideo){h=0;if("hero-image"===k.type){h=F(k.color,k.variant);if(-1===h)return;h=-1!==h?h:0}var l=f+h;l>=e&&(h=0,l=f);f=m.getHeroImageHash(A,k.color,h);-1!==f&&(N.dispatch("updateModel",{data:{index:h,thumbnailIndex:l,
variant:f.variant,type:"hero-image"}}),f=c.find(".item").get(l),b.selectGivenThumbnail(a(f),c))}}}function f(c,f,e){if("hero-video"===I.getCurrentItem().type)return c;f=A.heroImage&&A.heroImage[f];var h=c;b.isDefined(f)&&(a.each(f,function(a,f){c<A.maxAlts&&(b.createThumbnail({type:"hero-image",index:a,thumbnailIndex:c,variant:f.variant},f.thumb,O,"imageThumbnail"),c++)}),l(O,h,c,e));return c}function F(c,f){var e=A.heroImage;if(1>e.length||!b.isDefined(e[c])||!b.isDefined(f))return-1;var h=-1;a.each(e[c],
function(a,b){b.variant===f&&(h=a)});return h}function h(){if(L.length&&A.repositionHeroImage){var a=m.getHeroDimParams(A,I.getCurrentItem()),c;b.isDefined(a)&&(c=b.isDefined(a.xPos)?a.xPos+"px "+a.yPos+"px ":"center "+a.yPos+"px ",L.css({"background-position":c,"background-size":a.width+"px "+a.height+"px ","max-width":a.width+"px ","min-height":a.height+"px ",filter:"","-ms-filter":""}))}}function k(a,c,f,e){if(L.length&&a&&c){if("function"===typeof f||e){var h=new Image;h.onload=e?function(){L.css("background-image",
'url("'+a+'")')}:f;h.src=a}f=c[1];var h=c[0],k;e||L.css({"background-image":'url("'+a+'")'});A.repositionHeroImage&&(c=m.getHeroDimParams(A,I.getCurrentItem(),c),b.isDefined(c)&&(f=c.width,h=c.height,k=b.isDefined(c.xPos)?c.xPos+"px "+c.yPos+"px ":"center "+c.yPos+"px "));L.css({"background-position":k,"background-size":f+"px "+h+"px ","max-width":f+"px ","min-height":h+"px ",filter:"","-ms-filter":""})}}function G(b,c,f,e){b=m.getHeroImageHash(A,b,c);if(-1===b)return-1;c=a.map(b.main,function(a,
b){return b})[0];k(c,b.main[c],f,e)}function n(a,b,c){if("hero-image"!==a.type)return-1;var f=F(a.color,I.getCurrentItem().variant),f=-1!==f?f:0;if(-1===m.getHeroImageHash(A,a.color,f))return-1;var e=I.getCurrentItem();a.thumbnailIndex=e.thumbnailIndex;a.type=e.type;a.variant=e.variant;a.index=f;H(a,b,c)}function H(a,b,f){var h=m.getHeroImageHash(A,a.color,a.index),k;k=a&&e&&c.equals(a,e)?!0:!1;e||(e=a);if(!k&&a||b)G(a.color,a.index,b,f),e=a;L.removeClass("hide-background");c.trigger("dp:image-block:update",
h)}var y,A,I,N,O,L,e={};return function(c,e,k,l){y=this;A=c;I=e;N=l;A.heroImage[A.landingAsinColor]=A.heroImage[A.defaultColor];y.render=function(b,c,e,h,g,d,k){O=h;L=a("#heroImage");b=f(c,b,d);n(I.getCurrentItem(),k,d);return b};y.update=function(a){var c=a.data;"ingress"!==c.type&&L.addClass("hide-background");"swatchHover"===a.type?a.captured||(c.type=I.getCurrentItem().type,-1!==n(c)&&(a.captured=!0)):"hero-image"===c.type&&(H(c),"click"!==a.type&&A.usePeekHover||b.selectGivenThumbnail(a.$declarativeParent,
O))};N.register("resize",h)}});"use strict";y.when("A","jQuery","imageBlockUtils").register("ImageBlockAltImageIngressView",function(c,a,b){var m,l,f,F;return function(a,k,n,C){m=this;l=a;f=C;m.render=function(a,f,h,k,n,G,C){F=k;m=this;h=l.maxAlts;k=f;n=l.colorImages[a]?l.colorImages[a].length:0;n+=b.getVideosCount(a,l);a=l.heroImage[a];G=0;a&&(G=a.length);a=n+G;a>h&&(h=a-h,a=F.find(".altIngressTemplate").clone().removeClass("altIngressTemplate").removeClass("aok-hidden").addClass("item"),h+="+",
k={type:"ingress",index:0,thumbnailIndex:f,variant:""},a.find("#altIngressText").append(h),c.declarative.create(a,"thumb-action",k),F.append(a),k=f++);return k};m.update=function(a){"ingress"===a.data.type&&"click"===a.type&&f.dispatch("imageClick",a)}}});"use strict";y.when("imageBlockUtils").register("ImageBlockState",function(c){return function(a,b,m){this.getImageHash=function(b){var f=m.getCurrentItem();b=c.getIndexForVariant(f.color,b||"MAIN",a);return c.getImageHash(f.color,b,a)};this.onImageUpdateForTwister=
function(a){b.register("updateSelection",function(b){"swatchClick"===b.type&&"function"===typeof a&&a()})}}});"use strict";y.when("jQuery","imageBlockUtils").register("ImageBlockHeroUtils",function(c,a){function b(a,b){var c;if(b.repositionHeroImage){c=a[1];var k=a[0];if(768>=(n.innerHeight||document.documentElement.clientHeight||document.body.clientHeight))c*=.7,k*=.7;else{var l=((n.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-1024)/256,l=Math.max(Math.min(l,1),0);
c*=.7+.3*l;k*=.7+.3*l}c=[c,k]}return c}function m(b,c,h){var k;if(h.repositionHeroImage){var l=n.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;h=h.heroFocalPoint;if(a.isDefined(h)){k=Math.max((l-Math.min(1500,b))/2,0);var m=Math.max((l-b)/2,0);k-=m;l=Math.max(Math.min(l,1500),1024);k=k+(l-420-23)/2-b/c[1]*h}}return k}function l(b,l,h){b=b.heroImage;return!(a.isDefined(b)&&a.isDefined(b[l])&&a.isDefined(b[l][h])&&a.isDefined(b[l][h].main))||1>c.map(b[l][h].main,function(a,
b){return b}).length?-1:b[l][h]}return{getHeroImageHash:l,getHeroDimParams:function(f,F,h){if(f.repositionHeroImage){if(!a.isDefined(h)){h=l(f,F.color,F.index);if(-1===h)return;F=c.map(h.main,function(a,b){return b})[0];h=h.main[F]}F=b(h,f);f=m(F[0],h,f);return{height:F[1],width:F[0],xPos:f,yPos:75}}}}});"use strict";y.when("A","jQuery","imageBlockUtils").register("imageBlockImmersiveViewUtils",function(c,a,b){function m(a,l){var h=c.copy(a);if(b.isDefined(a)&&a.length>l){try{for(var k=-1,m=0;m<a.length;m++){var n=
a.charAt(m);if(" "===n||"."===n||"?"===n||";"===n||","===n||":"===n)k=m;if(m===l-4){h=a.substring(0,-1===k?m:k);break}}}catch(y){h=a.substring(0,l-3)}h+="..."}return h}function l(a,b){var c=a.lastIndexOf(".");return a="_"===a.charAt(c-1)?a.substring(0,c-1)+b+a.substring(c):a.substring(0,c)+"."+b+a.substring(c)}return{getDimension:function(a,b){var c=parseInt(a.css(b),10);return isNaN(c)?0:c},attachTabSelectHandler:function(a,b){c.on("dp:ivTabs:"+a+":select",b)},attachTabDeselectHandler:function(a,
b){c.on("dp:ivTabs:"+a+":deselect",b)},attachImmersiveViewResizeHandler:function(a){c.on("dp:image-block:immersive-view:resize",a)},detachImmersiveViewResizeHandler:function(a){c.off("dp:image-block:immersive-view:resize",a)},attachImmersiveViewResetHandler:function(a){c.on("a:popover:afterHide:immersiveView",a)},hideTabHeading:function(b){a("#"+b).hide()},unhideTabHeading:function(b){a("#"+b).show()},addStyleCodeToURL:l,getResizedThumbnailURL:function(a,b){a=a.replace(/\._(AA|SS)\d+_/,"").replace(/\._SX\d+_SY\d+_CR,0,0,\d+,\d+_/,
"");a=a.replace(/\._(US)\d+_/,"").replace(/\._SR\d+,\d+_/,"").replace(/\._SP[0-9,C]+_/,"");a=a.replace(/\._CB\d+_SS\d+_/,"");var c="_AA50_";b&&(c+="FMpng_RI_");return l(a,c)},populateVariationSelection:function(c){if(b.isDefined(n.DetailPage)&&b.isDefined(n.DetailPage.StateController)){c.empty();var l=n.DetailPage.StateController.getState(),h=l.variation_label_order,k;for(k in h)if(h.hasOwnProperty(k)){var m=h[k],y=l.selected_variations[m],m=l.variation_display_labels[m];y&&a("\x3cdiv/\x3e").addClass("ivVariations").text(m+
":"+y).appendTo(c)}}},populateTitle:function(a,b,c){a.html(c.title);a.attr("title",a.text());a.html(m(c.title,b))},animateStageIn:function(a){a.animate({opacity:1},200)},animateStageOut:function(a,b){a.animate({opacity:.4},100,b)},logError:function(a,b,c,l){n.ueLogError&&n.ueLogError(l,{logLevel:a,attribution:b,message:c})}}});"use strict";y.when("A","jQuery","imageBlockUtils","postMetric","imageBlockImmersiveViewUtils").register("ImageBlockImmersiveViewImages",function(c,a,b,m,l){function f(){l.populateTitle(t.find("#ivTitle"),
160,x)}function n(){var a=q.getCurrentItem().color;z=x.colorImages[a];r=x.heroImage[a];E=J=0;b.isDefined(r)&&(E=r.length);b.isDefined(z)&&(J=z.length)}function h(a){return a.hiRes||a.large||a.main[a.main.length-1]}function k(){var a=t.find("#ivStage").find("#ivLargeImage"),b=a.width(),c=a.height(),d=a.find(".fullscreen");d.removeAttr("style");var e=d.width(),f=d.height();0<d.length&&(d[0].naturalWidth&&(e=d[0].naturalWidth),d[0].naturalHeight&&(f=d[0].naturalHeight));a.css("cursor","auto");var e=
0===e?1:e,f=0===f?1:f,h=Math.min(b/e,c/f),l=f*h,k=e*h;1>h?(g?a.css("cursor","url('"+x.staticImages.zoomIn+"'), auto"):(a.css("cursor","-webkit-zoom-in"),a.css("cursor","-moz-zoom-in"),a.css("cursor","zoom-in")),v=!0):v=!1;e=Math.min(k,e);f=Math.min(l-20,f);d.css({"margin-top":(c-f)/2,"margin-left":(b-e)/2,height:f,width:e});a.css("visibility","visible");p=!1}function y(a){var b=t.find("#ivLargeImage");b.css("visibility","hidden");b.empty();l.animateStageIn(b);b.append(a);k()}function C(c){t.find("#ivLargeImage").css("display",
"none");t.find("#ivLargeImage").css("display","block");var d;"hero-image"===c?b.isDefined(r)&&(d=h(r[u.index])):b.isDefined(z)&&(d=h(z[u.index]));if(b.isDefined(d)){t.find(".fullscreen").remove();var e=a("\x3cimg\x3e").attr("src",d).addClass("fullscreen"),f=t.find("#ivLargeImage");l.animateStageOut(f,function(){e.load(function(){y(e)});if(e[0].complete)y(e);else{f.empty();var b=(f.height()-104)/2,c=(f.width()-80)/2;a("\x3cimg\x3e").attr("src",x.staticImages.spinner).css({position:"relative",top:b+
"px",left:c+"px"}).appendTo(f)}})}}function H(a){t.find(".ivThumb").removeClass("selected");a.addClass("selected");a.hasClass("ivHeroImage")?u.type="hero-image":u.type="image";u.index=a.attr("id").split("_")[1];C(u.type);m.postCountMetric("dpcc_iv_thumbCLick_"+(parseInt(u.index,10)+1)+"_"+(E+J))}function M(){t.delegate(".ivThumb","click",function(){var b=a(this);H(b)})}function A(a,b){return 0<b?b/2:Math.min(0,Math.max(b,a))}function I(a){var b=X.top-(a.pageY-K[1])*D;a=A(X.left-(a.pageX-K[0])*D,U.left);
b=A(b,U.top);t.find(".fullscreen").css({left:a,top:b})}function N(){t.delegate("#ivLargeImage","click",function(a){if(p)k();else if(v){t.find(".fullscreen").removeAttr("style");if(v){var b=t.find("#ivLargeImage"),c=b.find(".fullscreen");g?b.css("cursor","url('"+x.staticImages.zoomOut+"'), auto"):(b.css("cursor","-webkit-zoom-out"),b.css("cursor","-moz-zoom-out"),b.css("cursor","zoom-out"));p=!0;var d=t.find("#ivLargeImage");U.left=d.width()-c.width();U.top=d.height()-c.height();var d=b.height()/2,
e=b.width()/2;K=[b.offset().left+e,b.offset().top+d];X.top=d-c.height()/2;X.left=e-c.width()/2;c.css({position:"relative",left:X.left,top:X.top});D=Math.max(c.height()/b.height(),c.width()/b.width())}I(a);m.postCountMetric("dpcc_iv_largeImageCLick")}});t.delegate("#ivLargeImage","mousemove",function(a){p&&I(a)})}function O(){t.find("#ivLargeImage").empty()}function L(c){if(d){t=a("#ivMain");n();u=q.getCurrentItem();f();l.populateVariationSelection(t.find("#ivVariationSelection"));c=t.find("#ivThumbs");
c.find(".ivRow").not(".placeholder").remove();for(var e=E+J,g=0,h=0;g<e;)for(var k=c.find(".ivRow.placeholder").clone().removeClass("placeholder").appendTo(c),m=0;4>m&&g<e;m++,g++,h++)if(h<E){var p=r[g].thumb,x=c.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivHeroImage").attr("id","ivHeroImage_"+g).appendTo(k);x.find(".ivThumbImage").css("background",'url("'+l.getResizedThumbnailURL(p)+'") center no-repeat')}else h>=E&&h<J+E&&(p=z[g-E].thumb,x=c.find(".ivThumb.placeholder").clone().removeClass("placeholder").attr("id",
"ivImage_"+(g-E)).appendTo(k),x.find(".ivThumbImage").css("background",'url("'+l.getResizedThumbnailURL(p)+'") center no-repeat'));Q();d=!1}else f();c=a("#ivImagesTab").height();t.css("height",c);e=t.find("#ivTitle").outerHeight(!0);g=t.find("#ivVariationSelection").outerHeight(!0);h=t.find("#ivThumbs");k=l.getDimension(h,"margin-top")+l.getDimension(h,"margin-bottom");h.css("height",c-e-g-k);t.find("#ivLargeImage").css("height",c);c=t.find("#ivStage");e=t[0]&&t[0].getBoundingClientRect&&Math.floor(t[0].getBoundingClientRect().width)||
t.width();c.css("width",e-l.getDimension(t,"padding-left")-l.getDimension(t,"padding-right")-t.find("#ivThumbColumn").width()-l.getDimension(c,"margin-left")-l.getDimension(c,"margin-right"));u=q.getCurrentItem();c="hero-image"===u.type?t.find("#ivHeroImage_"+u.index):"image"===u.type?t.find("#ivImage_"+u.index):b.isDefined(r)?t.find("#ivHeroImage_"+u.index):t.find("#ivImage_"+u.index);b.isjQueryObjDefined(c)||(c=t.find("#ivImage_0"));H(c)}var e,x,q,t,r,z,E,J,u,g=navigator.userAgent.match(/msie|trident/i),
d=!0,p=!1,v=!1,U={},X={},D,K,d=!0,Q=c.once(function(){M();N();l.attachImmersiveViewResizeHandler(L);l.attachTabDeselectHandler("ivImagesTab",O)});return function(b,c,f,g){e=this;x=b;q=c;e.render=function(b,c,e,f,g,h){d=!0;n();0===E+J?l.hideTabHeading("ivImagesTabHeading"):l.unhideTabHeading("ivImagesTabHeading");1===E+J?a("#ivThumbs").hide():a("#ivThumbs").show()};e.update=function(a){};l.attachTabSelectHandler("ivImagesTab",L)}});"use strict";y.when("A","jQuery","imageBlockUtils","postMetric","imageBlockImmersiveViewUtils",
"vse_ns_preLoaderHook","vse_ns_lazyLoaderHook").register("ImageBlockImmersiveViewVideos",function(c,a,b,m,l,f,F){function h(){z.delegate(".ivThumb","click",function(){var b=a(this);z.find(".ivThumb").removeClass("selected");b.addClass("selected");b.hasClass("ivThumbVideo")&&(E.type="chromeful-video",E.index=b.attr("id").split("_")[1])})}function k(){if(ba){var b=a("#ivVideosTab").height();z.css("height",b);var c=z.find(".vse-lb-container");J=b-l.getDimension(c,"padding-top")-l.getDimension(c,"padding-bottom");
c.css({"max-height":b,overflow:"hidden"});if(Q){z.css({"max-width":Math.floor(1.77*J)});return}var b=z.find(".vse-player-container"),c=z.find(".vse-video-action-strip"),d=z.find(".vse-lb-video-metadata"),e=Math.floor(J-l.getDimension(d,"height")-l.getDimension(c,"height")),f=Math.floor(1.77*e);b.css({"max-height":e,"max-width":f,marginLeft:"auto",marginRight:"auto"});d.css({"max-width":f,marginLeft:"auto",marginRight:"auto"});c.css({"max-width":f,marginLeft:"auto",marginRight:"auto"})}ea&&(b=z.find(".vse-vertical-scroll"),
c=l.getDimension(b,"margin-top")+l.getDimension(b,"margin-bottom"),b.css("max-height",J-c))}function y(){C();u&&u.pause();R=!1;D=!0;v=null;S=!0;ba=!1}function C(){R=!1;u&&u.pause()}function H(d){v=d.clickTimeStamp?d.clickTimeStamp:c.now();b.isDefined(r)&&(r.eventTimestamp=v);K&&(F.get(c,"#ivVideoBlock",t,Y,Z),z=a("#ivVideoBlock"),q.getCurrentItem(),E=q.getCurrentItem(),ya());k();R=!0;K=!1;I()}function M(b){K&&(z=a("#ivVideoBlock"),q.getCurrentItem(),E=q.getCurrentItem(),ya());R&&I();k()}function A(a){u=
a.player;ba&&(L(),I())}function I(){if(u&&R&&(z.find(".vse-lb-container").animate({opacity:1},200),u.play(r),m.postCountMetric("dpcc_vse_videoBlock_video_played"),D)){var a=n.ue;a&&(a=a.count("dpcc_vse_videoingressclick"),a=(new Date).getTime()-a,m.postTimeMetric("dpcc_vse_vitff",a),D=!1)}}function N(){c.trigger("vse:detailpage-imageblock:page:lightBoxClosed")}function O(a){g=a.popover.$popover;ba=!0;L()}function L(){ba&&S&&R&&u&&(g.addClass(c.$(g).find(".vse-lb-container").data("cssClass")),c.trigger("vse:detailpage-imageblock:page:lightBoxOpened",
{lightBoxId:"ivVideoBlock",assetSpec:r}),k(),S=!1)}var e,x,q,t,r,z,E,J,u,g,d,p,v,U,X,D=!0,K=!0,Q=!1,ea=!1,R=!1,S=!0,ba=!1,ya=c.once(function(){h();l.attachImmersiveViewResizeHandler(M);l.attachTabDeselectHandler("ivVideosTab",C);l.attachImmersiveViewResetHandler(y)}),la=function(c,d,e){a("#ivVideoBlockSpinner").addClass("aok-hidden");m.postCountMetric("dpcc_vse_videoBlock_preload_failed_"+d.placement);c=q.getCurrentItem().color;c=b.getVideoHash(c,0,x);u||(u=b.createAiryInstanceForChromeful(a("#ivVideoBlock"),
c,x.airyConfig,"ImmersiveView"));Q=!0;a("#ivVideoBlock").css({"max-width":1.77*J,margin:"0 auto"});R&&Q&&u.play({isAsync:!0})},fa=function(b,c,d){K||F.get(b,"#ivVideoBlock",t,Y,Z);a("#ivVideoBlockSpinner").addClass("aok-hidden")},Y=function(a,b,c){ea=!0;k()},Z=function(a,b,c){m.postCountMetric("dpcc_vse_videoBlock_lazyload_failed_"+b.pageContext.placement+"_"+b.configuration.type)};return function(a,g,h,k){e=this;x=a;q=g;e.render=function(a,e,g,h,k,m){a=q.getCurrentItem().color;e=b.getVideoHash(a,
0,x);!0===m?d=x.mediaAsin:(d=x.colorToAsin[a]&&x.colorToAsin[a].asin,d=b.isDefined(d)?d:x.mediaAsin);p=null!==x.vseVideoDataSourceTreatment&&"T1"===x.vseVideoDataSourceTreatment?"ASIN":"physicalID";U=x.contentWeblab;X=x.contentWeblabTreatment;K=!0;-1===e?l.hideTabHeading("ivVideosTabHeading"):(l.unhideTabHeading("ivVideosTabHeading"),t={page:"DetailPage",placement:"ImageBlock",device:"Desktop",marketplaceID:e.marketPlaceID,locale:e.languageCode,product:{contentID:d,contentIDType:"ASIN"},video:{contentID:e.mediaObjectId,
contentIDType:p,videoURL:e.url,imageURL:e.slateUrl},requestId:x.dpRequestId,weblabContext:[{name:U,assignment:X,ignoreForG2S2Key:!0}],metadata:{ProductTitle:x.title}},r={videoUrl:t.video.videoURL,contentId:t.video.contentID,duration:0,vendorCode:"",eventTimestamp:b.isDefined(v)?v:c.now(),imageUrl:t.video.imageURL,productAsin:t.product.contentID,index:0},b.isDefinedAndNotEmpty(u)&&(u.destroy(),u=null),f.get(c,"#ivVideoBlock",t,fa,la))};e.update=function(a){};l.attachTabSelectHandler("ivVideosTab",
H);c.on("vsePlayer-detailpage-imageblock",A);c.on("a:popover:afterShow:immersiveView",O);c.on("a:popover:beforeHide:immersiveView",N)}});"use strict";y.when("A","jQuery","imageBlockUtils","ImageBlockLoader","nexusLogger360","postMetric","imageBlockImmersiveViewUtils","hit-spin360-feature-data","hit-spin360-constants").register("ImageBlockImmersiveView360",function(c,a,b,m,l,f,n,h,k){function y(){var b=a("#iv360Tab").height();D.css("height",b);var c=D.find("#ivTitle360").outerHeight(!0),d=D.find("#ivVariationSelection360").outerHeight(!0),
e=D.find("#ivThumbs360"),f=n.getDimension(e,"margin-top")+n.getDimension(e,"margin-bottom");e.css("height",b-c-d-f);b=D.find("#ivStage360");c=D[0]&&D[0].getBoundingClientRect&&Math.floor(D[0].getBoundingClientRect().width)||D.width();b.css("width",c-n.getDimension(D,"padding-left")-n.getDimension(D,"padding-right")-D.find("#ivThumbColumn360").width()-n.getDimension(b,"margin-left")-n.getDimension(b,"margin-right"))}function C(){I();var a=D.find("#ivLarge360");a.css({opacity:0});setTimeout(function(){a.css({opacity:.4});
n.animateStageIn(a)},200);H()}function H(){if(0<w){var a=D.find(".iv360Hint");a.removeClass("iv360HintFaded");a.animate({opacity:1},200)}}function M(b,c){if(w<b.length){var d=a("\x3cimg /\x3e").css({display:"block",width:6*Q+"px",height:ea+"px"});d.hide();c.append(d);d.get(0).onload=function(){c.closest(document.documentElement).length&&(w++,1===w&&(H(),0<B&&(l.time("dppc_loadTime360",Date.now()-B,v.mediaAsin),f.postTimeMetric("dppc_loadTime360",Date.now()-B))),0<aa&&(l.time("dppc_perSpriteloadTime360",
Date.now()-aa,v.mediaAsin),f.postTimeMetric("dppc_perSpriteloadTime360",Date.now()-aa)),D.find("#iv360Spinner").hide(),d.show(),Y=5*K.imageLocations[Math.floor(Z/K.imageLocations[0].length)][Z%K.imageLocations[0].length],M(b,c))};d.attr("src",b[w].replace(/(\._SP)\d+(,)\d+/,"$1"+S+"$2"+R));aa=Date.now()}}function A(a){if(b.isDefined(K.spriteWidthSizes)&&0<K.spriteWidthSizes.length){var c=K.spriteWidthSizes,d=c.length,e=c[0],f=c[d-1];if(a<=e)return e;if(a>f)return f;for(e=0;e<d;e++)if(a>c[e]&&a<=c[e+
1])return c[e+1]}else return a}function I(){var b=D.find("#ivLarge360");b.children("#image-360-sprites").length||(b.append("\x3cdiv id\x3d'image-360-sprites'\x3e\x3c/div\x3e"),b.css({"margin-left":0,"margin-top":0,width:b.parent().width(),height:b.parent().height(),overflow:"hidden",position:"relative","-ms-user-select":"none","-webkit-user-select":"none","-mos-user-select":"none"}),a("\x3cimg\x3e").attr("src",v.staticImages.spinnerNoLabel).attr("id","iv360Spinner").css({position:"absolute",top:"50%",
left:"50%",transform:"translate(-50%, -50%)",display:"block"}).appendTo(b),la=!0,N())}function N(){if(b.isDefined(K.spriteURLs)&&b.isDefined(D)&&la&&!ua){var c=D.find("#ivLarge360"),d=a("\x3cdiv\x3e").addClass("iv360Hint").css({position:"absolute",width:"100%",bottom:0,opacity:0,display:"block"});b.isDefined(K.staticImages.hint360)&&a("\x3cimg\x3e").css({"margin-left":"auto","margin-right":"auto",display:"block"}).attr("src",K.staticImages.hint360).appendTo(d);a("\x3cdiv\x3e").css({"text-align":"center"}).text(v.staticStrings.dragToSpin).appendTo(d);
d.appendTo(c);var d=K.imageWidth,f=K.imageHeight,g=c.parent().width(),h=c.parent().height(),l=0,k=0;d/f>g/h?(S=A(g),R=Math.round(f/d*S),Q=Math.ceil(g),ea=Math.ceil(R/S*g),k=(h-ea)/2):(R=A(h),S=Math.round(d/f*R),ea=Math.ceil(h),Q=Math.ceil(S/R*h),l=(g-Q)/2);c.css({"margin-left":l,"margin-top":k,width:Q+"px",height:ea+"px",overflow:"hidden",position:"relative"});c.children("#image-360-sprites").css("width",6*Q+"px");M(K.spriteURLs,D.find("#image-360-sprites"),0);d=D.find("#ivLarge360");d.bind("mousedown",
x);d.bind("touchstart",O);d.bind("touchmove",L);d.bind("touchend",e);a(document).bind("mousemove",q);a(document).bind("mouseup",t);b.isDefined(v.staticImages.grab)&&c.css("cursor","url('"+v.staticImages.grab+"'), auto");ua=!0}}function O(a){W=!0;fa=a.originalEvent.targetTouches[0].clientX}function L(a){W&&(r(a.originalEvent.targetTouches[0].clientX-fa),fa=a.originalEvent.targetTouches[0].clientX)}function e(a){W&&(W=!1)}function x(a){ja=!0;ba=a.originalEvent.clientX;b.isDefined(v.staticImages.grabbing)&&
(a=D.find("#ivLarge360"),a.css("cursor","url('"+v.staticImages.grabbing+"'), auto"),a.parents(".a-declarative").last().css("cursor","url('"+v.staticImages.grabbing+"'), auto"));return!1}function q(a){ja&&(r(a.originalEvent.clientX-ba),ba=a.originalEvent.clientX)}function t(a){ja&&(ja=!1,b.isDefined(v.staticImages.grab)&&(a=D.find("#ivLarge360"),a.css("cursor","url('"+v.staticImages.grab+"'), auto"),a.parents(".a-declarative").last().css("cursor","auto")))}function r(a){Y-=a/Q*180;ia&&(l.count("dppc_360dragToSpin",
v.mediaAsin),f.postCountMetric("dppc_360dragToSpin"));ia=!1;for(a=Y;0>a;)a+=360;for(;360<a;)a-=360;Y=a;var c;a=360;for(var d=0;d<w;d++)for(var e=0;e<K.imageLocations[d].length;e++){var g=Math.abs(Y-5*K.imageLocations[d][e]);g<a&&(a=g,c=d*K.imageLocations[0].length+e)}c!==Z&&(a=Math.floor(c/K.imageLocations[0].length),a!==Math.floor(Z/K.imageLocations[0].length)&&(b.isDefined(ha)||(ha=document.createElement("canvas").getContext("2d")),d=D.find("#image-360-sprites").children(),ha.drawImage(d[a],0,0)),
a=D.find(".iv360Hint").not(".iv360HintFaded"),b.isDefined(a)&&(a.addClass("iv360HintFaded"),a.animate({opacity:0},750)));Z=c;a=c%K.imageLocations[0].length*-1*Q;c=-1*Math.floor(c/K.imageLocations[0].length)*ea;d=D.find("#ivLarge360").children("#image-360-sprites");d.css("-webkit-transform","translate3d("+a+"px, "+c+"px, 0)");d.css("transform","translate3d("+a+"px, "+c+"px, 0)")}function z(){if(V){D=a("#ivMain360");var b=U.getCurrentItem().color;J()&&u(b);K=J()?v.spin360ColorData[b]:void 0;n.populateTitle(D.find("#ivTitle360"),
160,v);n.populateVariationSelection(D.find("#ivVariationSelection360"));D.find("#ivLarge360").empty();w=0;ua=la=!1;Z=Y=0;ca();V=!1}0!==a("#iv360Tab").height()&&(n.detachImmersiveViewResizeHandler(z),y(),C(),B=Date.now(),ga=ia=!0,l.count("dppc_click360",v.mediaAsin),f.postCountMetric("dppc_click360"))}function E(a,c,d){a=v.colorToAsin[d];var e={},g=500;if(!a||!a.asin)if(d===v.defaultColor)a={asin:v.winningAsin};else return;e.params={asin:a.asin};var k="360"+a.asin,p=Date.now();e.success=function(a){l.time("dppc_asyncRequestTime360",
Date.now()-p,v.mediaAsin);f.postTimeMetric("dppc_asyncRequestTime360",Date.now()-p);a&&b.isDefined(a.spin360)?((a=a.spin360.spin360Model)&&h.setData(a),b.ajaxState(k,"success")):e.error()};e.error=function(){l.count("dppc_asyncFailedTransient360",v.mediaAsin);f.postCountMetric("dppc_asyncFailedTransient360");l.time("dppc_asyncRequestTime360",Date.now()-p,v.mediaAsin);f.postTimeMetric("dppc_asyncRequestTime360",Date.now()-p);g*=2;16E3>=g?setTimeout(function(){p=Date.now();m.load("/gp/product/features/apparel-main-image/360.html",
e)},g):(l.count("dppc_asyncFailed360",v.mediaAsin),f.postCountMetric("dppc_asyncFailed360"),b.ajaxState(k,"fail"))};b.ajaxState(k)&&"fail"!==b.ajaxState(k)||(m.load("/gp/product/features/apparel-main-image/360.html",e),b.ajaxState(k,"sent"))}function J(){return v&&b.isDefined(v.spin360ConfigEnabled)&&v.spin360ConfigEnabled}function u(a){return b.isDefinedAndNotEmpty(v.spin360ColorData[a])?!0:b.isDefined(v.spin360LazyLoadEnabled)&&v.spin360LazyLoadEnabled}function g(){ga&&(l.time("dppc_duration360",
Date.now()-B,v.mediaAsin),f.postTimeMetric("dppc_duration360",Date.now()-B),ga=!1)}function d(a){a=v.colorToAsin[a.color].asin;a||(a=v.mediaAsin);return a}var p,v,U,X,D,K,Q,ea,R,S,ba,fa,la=!1,ua=!1,Y=0,Z=0,B=0,aa=0,ja=!1,W=!1,w=0,ha,ia=!0,ga=!1,V=!0,ca=c.once(function(){n.attachImmersiveViewResizeHandler(z);n.attachImmersiveViewResizeHandler(y);n.attachImmersiveViewResetHandler(g);n.attachTabDeselectHandler("iv360Tab",g)});return function(e,g,m,q){p=this;v=e;U=g;X=q;e=v.landingAsinColor;g=v.defaultColor;
b.isDefined(v.staticImages.icon360)&&a("#imageBlock #altImages ul").find(".360IngressTemplate").find("img").attr("src",n.addStyleCodeToURL(v.staticImages.icon360,"_FMpng_RI_"));J()&&(v.spin360ColorData||(v.spin360ColorData={}),e===g&&b.isDefinedAndEmpty(v.spin360ColorData[g])&&delete v.spin360ColorData[g]);c.on(k.TWISTER_DATA_EVENT,function(a){d(U.getCurrentItem())===a&&(K=h.getData(a),N(),a={type:"updatedData",data:U.getCurrentItem()},X.dispatch("updateView",a))});p.render=function(e,g,k,m,p,q){V=
!0;!J()||b.isDefinedAndEmpty(v.spin360ColorData[e])&&!h.getData(d(U.getCurrentItem()))?n.hideTabHeading("iv360TabHeading"):(v.spin360ColorData[e]=h.getData(d(U.getCurrentItem())),b.isDefinedAndNotEmpty(v.spin360ColorData[e])?(a("#ivThumbs360").hide(),n.unhideTabHeading("iv360TabHeading"),b.isImmersiveViewEnabled(v,U.getCurrentItem().color)&&J()&&u(e)&&(g===v.maxAlts&&(e=m.find(".item.imageThumbnail"),g=m.find(".item.videoThumbnail"),b.isDefined(g)&&1<g.length?g.last().remove():e.last().remove()),
e=m.find(".360IngressTemplate").clone().removeClass("360IngressTemplate").removeClass("aok-hidden").addClass("item"),c.declarative.create(e,"button-360-click"),m.append(e),l.count("dppc_display360",v.mediaAsin),f.postCountMetric("dppc_display360"))):b.isDefined(v.spin360LazyLoadEnabled)&&v.spin360LazyLoadEnabled?(v.spin360ColorData[e]={},n.hideTabHeading("iv360TabHeading"),E(m,g,e)):n.hideTabHeading("iv360TabHeading"))};p.update=function(a){};n.attachTabSelectHandler("iv360Tab",z)}});y.register("nexusLogger360",
function(){return{count:function(c,a){n.ue&&n.ue.event({asin:a,metricName:c,metricValue:1},"hit-360","hit360.clientEvent.3")},time:function(c,a,b){n.ue&&n.ue.event({asin:b,metricName:c,metricValue:a},"hit-360","hit360.clientEvent.3")}}});y.register("hit-spin360-constants",function(){return{TWISTER_DATA_EVENT:"spin360TwisterData"}});y.when("A","hit-spin360-constants").register("hit-spin360-feature-data",function(c,a){var b={};return{setData:function(m){var l=m.asin;b[l]||(b[l]=m,c.trigger(a.TWISTER_DATA_EVENT,
l))},getData:function(a){return b[a]}}});"use strict";y.when("postMetric","imageBlockImmersiveViewUtils").execute("vse-ns-ajax-calls",function(c,a){try{var b=n.location.host,m={dub:"https://www.amazon.co.uk/vap/ew/",pdx:"https://www.amazon.co.jp/vap/ew/"},l=b.split(".")[1],f=-1===b.indexOf(".proxy.amazon.com")?"/vap/ew/":void 0!==m[l]?m[l]:"https://www.amazon.com/vap/ew/",F="vse_lazyLoaderHook:success:",h="vse_lazyLoaderHook:error:",k="vse_preLoaderHook:success:",G="vse_preLoaderHook:error:",C="vse_lightPlayerLoaderHook:success:",
H="vse_lightPlayerLoaderHook:error:",M=4E3,A=3}catch(I){a.logError("FATAL","vse_ns_desktop","[Domain] ",I)}y.register("vse_ns_preLoaderHook",function(){function b(h,l){try{var e=h.A,m=h.block,q=h.request,n=h.handleFailure,r=h.handleSuccess,z=e.$;l--;var y=A-l-1,F=e.now();e.ajax(f+"componentbuilder",{params:q,paramsFormat:"json",crossDomain:!0,method:"post",contentType:"application/json",timeout:q.timeout||M,withCredentials:!0,success:function(a){var b=e.now()-F;c.postTimeMetric(k,b);c.postCountMetric(k+
q.page+":"+q.placement+":"+y);z(m).html(a);r(e,q,a)},error:function(a){c.postCountMetric(G+q.page+":"+q.placement+":"+y);(0===a.http.status||500<=a.http.status&&599>=a.http.status)&&0<l?b(h,l):(c.postCountMetric(G,1),n(e,q,a))}})}catch(u){a.logError("FATAL","vse_ns_desktop","[vse_ns_preLoaderHook] ",u)}}return{get:function(a,c,e,f,h){b({A:a,block:c,request:e,handleFailure:h,handleSuccess:f},A)}}});y.register("vse_ns_lazyLoaderHook",function(){function b(k,l,e){try{var m=k.A,q=k.context,n=k.handleFailure,
r=k.handleSuccess;l.attr("data-configuration");var z=atob(l.attr("data-configuration")),y=JSON.parse(z),C={pageContext:q,configuration:y},u=m.now();e--;var g=A-e-1;m.ajax(f+"subcomponent/"+y.type,{params:C,paramsFormat:"json",method:"post",contentType:"application/json",timeout:q.timeout||M,withCredentials:!0,success:function(a){var b=m.now()-u;c.postTimeMetric(F,b);c.postCountMetric(F+q.page+":"+q.placement+":"+y.type+":"+g);l.html(a);r(m,C,a)},error:function(a){c.postCountMetric(h+q.page+":"+q.placement+
":"+y.type+":"+g);(0===a.http.status||500<=a.http.status&&599>=a.http.status)&&0<e?b(k,l,e):(c.postCountMetric(h,1),n(m,C,a))}})}catch(d){a.logError("FATAL","vse_ns_desktop","[vse_ns_lazyLoaderHook] ",d)}}return{get:function(a,c,e,f,h){var k=a.$;k(c+" div[data-configuration]").each(function(){b({A:a,context:e,handleFailure:h,handleSuccess:f},k(this),A)})}}});y.register("vse_ns_videoPlayer",function(){function b(h,k,e){try{var l=h.A,m=h.block,n=h.request,r=h.handleFailure,y=h.handleSuccess,F=l.$;e--;
var G=A-e-1,u=l.now();l.ajax(f+"subcomponent/vseplayer",{params:n,paramsFormat:"json",crossDomain:!0,method:"post",contentType:"application/json",timeout:n.timeout||M,withCredentials:!0,success:function(a){var b=l.now()-u;c.postTimeMetric(C,b);c.postCountMetric(C+n.page+":"+n.placement+":"+G);F(m).html(a);y(l,n,a)},error:function(a){c.postCountMetric(H+n.page+":"+n.placement+":"+G);(0===a.http.status||500<=a.http.status&&599>=a.http.status)&&0<e?b(h,e):(c.postCountMetric(H,1),r(l,n,a))}})}catch(g){a.logError("FATAL",
"vse_ns_lightPlayer","[vse_ns_lightPlayerLoaderHook] ",g)}}return{get:function(a,c,e,f,h){b({A:a,block:c,request:e,handleFailure:h,handleSuccess:f},A)}}})});"use strict";y.when("A","ImageBlockATF","ImageBlockBTF","imageBlockUtils","postMetric").execute(function(c,a,b,m,l){var f=[0,50,100,500,1E3,2E3,3E3,3500];(function(){var a=b.colorImages,c=0,k;for(k in a)a[k]&&a[k].length&&(c+=a[k].length);a="image_size_bucket:gt"+f[f.length-1];for(k=1;k<f.length;k++)if(c<=f[k]){a="image_size_bucket:"+f[k-1]+"-"+
f[k];break}l.postCountMetric(a);m.addTag(a)})();(function(){var b=a.colorImages;b&&b.initial&&b.initial.length&&(b=b.initial.length,n.ue&&ue.count&&ue.count("altImageCount",b))})();(function(){var a=b.lazyLoadExperienceDisabled;m.isDefined(b.lazyLoadExperienceDisabled)&&!a&&(l.postCountMetric("lazyLoadingExperienceOnTwisterUpdateEnabled"),m.addTag("lazyLoadingExperienceOnTwisterUpdateEnabled"))})()});y.when("A","get-resource-time","postMetric","afterLoad").execute(function(c,a,b){var m=c.state("desktop-landing-image-data");
m&&(m=c.values(m),a=a.getResourceTimeByName("img",m),c.each(a,function(a){a&&(a.responseEnd&&b.postCountMetric("ibDesktopLandingImageDownloadTime",n.parseInt(a.responseEnd)),a.transferSize?b.postCountMetric("ibDesktopLandingImageSizeInBytes",n.parseInt(a.transferSize)):0===a.transferSize&&b.postCountMetric("ibDesktopLandingImageCached",1))}))})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPagePaymentOptionsJavascript",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */