51bcd6d9963c1eb54c3e9e0ff9221a93ec12d053c1e157b0166f038508d01dc4

Source Code:

(function(f){var k=window.AmazonUIPageJS||window.P,n=k._namespace||k.attributeErrors,b=n?n("ProductAdsDetailPageAssets",""):k;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,k,n){f.when("A","a-carousel-framework","a-carousel-ajax-standard").register("AmazonClicks",function(b,f,k){function q(a,b,g){var m=a.getAttr("pageNumber"),c;c=a.getAttr("initialSeenAsins");for(var e=a.getAttr("fetchedItems").slice(c.length),d=0;d<e.length;d++)e[d]&&e[d].oid&&c.push(e[d].oid);
c=JSON.stringify(c);g.pg=m;g.tot=a.getAttr("set_size");g.start=g.offset;g.num=g.count;g.cc=1===m?0:g.offset;g.oData=c;k.getItems(a,b,g)}function c(a,r){Array.isArray(a)&&b.each(a,function(a){e[a]=r})}function t(a){b.each(e,function(b,g){b===a&&delete e[g]})}var d={},e={},h={},a={},p=[],l=b.extend([],k),u=function(a,b,g){return function(){a.apply(b,g)}};l.init=function(a){var c=a.getAttr("ajax");if(c&&c.params){var g=c.params;if((c=a.getAttr("fetchedItems"))&&c.length!==g.start){var m=0;c.forEach(function(a){a&&
m++});var d=[];a.dom.$carousel.children("li").each(function(a,c){if(a>=g.start)return!1;d.push(b.trim(c.innerHTML))});m!==d.length&&(g.offset=d.length,a.setAttr("fetchedItems",d))}}k.init(a)};l.getItems=function(c,d,g){var m=!1,e=c.getAttr("name");b.each(a,function(a,b){b!==e&&(m=m||a)});c=u(q,this,[c,d,g]);(d=h[e]!==n)&&m?p.push(c):(d&&(a[e]=!0),c())};f.registerStrategy("ajax","clicksCustomAjax",l);return{registerFeedbackEvents:function(a,c,d,e,p){var f=!0,h=function(){b.$("#"+c).text(e);f=!1;b.$("."+
p).each(function(){b.$(this).show()})},l=function(){b.$("#"+c).text(d);f=!0;b.$("."+p).each(function(){b.$(this).hide()})};b.$("#"+c).click(function(){f?h():l()});b.on("a:carousel:"+a+":change:pageNumber",l);l()},registerFeedbackEventsWithSponsoredLabel:function(a,c,d,e){var f=!0,p=function(){b.$("#"+d).show();f=!1;b.$("."+e).each(function(){b.$(this).show()})},l=function(){b.$("#"+d).hide();f=!0;b.$("."+e).each(function(){b.$(this).hide()})};b.$("#"+c).click(function(){f?p():l()});b.on("a:carousel:"+
a+":change:pageNumber",l);l()},truncateTitles:function(a){b.$("."+a).each(function(){var c=b.$(this);if("hidden"===c.css("overflow")){var d=c.html(),e=b.$(this.cloneNode(!0)).hide().css("position","absolute").css("overflow","visible").width(c.width()).height("auto");c.after(e);for(e.html(d);0<d.length&&e.height()>c.height();)d=d.substr(0,d.length-1),e.html(d+"\x26#133;");c.html(e.html()).height("auto").removeClass(a);e.remove()}})},preventSpinners:function(a,c){d[a]===n&&(b.on("a:carousel:"+a+":ajaxSuccess",
function(a){b.delay(function(){var d=b.$("#"+c+" li.a-carousel-card-empty");0<d.length&&(a.carousel.setAttr("set_size",d[0].getAttribute("aria-posinset")-1),d.removeClass("a-carousel-card-empty"))},200)}),d[a]="defined")},registerCarouselToSaveAsins:function(d,e,f){t(d);c(f,d);a[d]=!1;h[d]===n&&(b.on("a:carousel:"+d+":ajaxSuccess",function(e){var f=e.carousel.getAttr("fetchedItems").slice(-1*e.params.count),g=[];b.each(f,function(a){g.push(a.oid)});c(g,d);a[e.carousel.getAttr("name")]=!1;0<p.length&&
p.shift()()}),h[d]=e)}}});(function(b,k,n){function q(){return b.P&&b.P.AUI_BUILD_DATE}q()?(f.when("jQuery").register("sponsored-products-truncator-jQuery",function(c){return c}),f.when("ready").register("sponsored-products-truncator-ready",function(){})):b.amznJQ&&(b.amznJQ.available("jQuery",function(){f.register("sponsored-products-truncator-jQuery",function(){return b.amznJQ.jQuery})}),b.amznJQ.onReady("jQuery",function(){f.register("sponsored-products-truncator-ready",function(){})}),b.amznJQ.available("amazonShoveler",
function(){f.register("sponsored-products-truncator-amznJQ-shoveler",function(){})}));f.register("sponsored-products-truncator-util",function(){function c(c,b){f({logLevel:c,attribution:"ProductAdsDetailPageAssets",message:"[sponsored-products-truncator] "+b})}var f=b.ueLogError;"function"!==typeof f&&(f=function(c,b){if(b&&b.message)throw Error(b.message);if(c&&c.message)throw Error(c.message);});return{constants:{FEATURE_NAME:"SponsoredProductsTitleTruncation"},count:b.ue&&b.ue.count||function(){},
isAUI:q,log:{warn:function(b){c("WARN",b)},error:function(b){c("ERROR",b)}}}})})(k,document);(function(b,k,n){f.when("A","sponsored-products-truncator-jQuery","sponsored-products-truncator-util").register("sponsored-products-truncator-line-truncator",function(b,c,f){function d(a){this.$element=a;this.$experimentElement=c("\x3cdiv\x3e").addClass("sponsored-products-truncator-offscreen-truncate");this.maxRows=a.attr("data-rows");this.text=a.attr("data-fulltext")?a.attr("data-fulltext"):this.$element.html();
this.lineHeight=this.getLineHeight();this.maxRows||f.log.error("Truncation element missing necessary line number data")}var e,h;e=/(?=[ \-\/])|(?=[\u3105-\u312F])|(?=[\u31A0-\u31BA])|(?=[\u4E00-\u9FD5])|(?=[\u3400-\u4DB5])|(?=[\uF900-\uFAFF])|(?=[\u3040-\u309F])|(?=[\u30A0-\u30FF])|(?=[\u3190-\u319F])/;h=/[^\/\-\[\]():\s]/;d.prototype.truncate=function(){var a=this.text,b,a=c.trim(a);this.$element.append(this.$experimentElement);this.checkLineFit(a)?this.text!==this.$element.html()&&this.$element.html(a):
(b=this.truncateByToken(a))?(this.$element.html(b),this.$element.attr({title:a})):f.log.error("Unable to successfully truncate line "+a);this.$experimentElement.remove()};d.prototype.getLineHeight=function(){var a=this.$element.html(),b;this.$element.html("\x26hellip;");b=this.$element.innerHeight();this.$element.html(a);return b};d.prototype.checkLineFit=function(a){this.$experimentElement.html(a);a=this.$experimentElement.get(0).clientHeight/this.lineHeight;return Math.round(a)<=this.maxRows};d.prototype.truncateByToken=
function(a){a=a.split(this.getTokenSeparatorRegex());var b=a.length,c=0,d,e,f;for(f=1;f!==b;)if(d=Math.floor((b+f)/2),e=a.slice(0,d).join("")+"\x26hellip;",this.checkLineFit(e)){if(1>=b-d){for(c=d;0<c&&!h.test(a[c-1]);)c--;break}f=d}else b=d;if(0!==c)return a.slice(0,c).join("")+"\x26hellip;"};d.prototype.getTokenSeparatorRegex=function(){return this.$element.attr("data-truncate-by-character")?"":e};return{truncateLines:function(a){a.find(".sponsored-products-truncator-truncate:visible, .sponsored-products-truncator-truncate-medium:visible").each(function(){(new d(c(this))).truncate();
c(this).addClass("sponsored-products-truncator-truncated").removeClass("sponsored-products-truncator-truncate sponsored-products-truncator-truncate-medium");c(this).removeClass(function(a,b){return(b.match(/sponsored-products-truncator-line-clamp-\d/g)||[]).join(" ")})});b.trigger("sponsored-products-truncator:linestruncated")}}});f.when("jQuery","A","sponsored-products-truncator-line-truncator","a-carousel-framework").register("sp-dp-carousel-truncation",function(b,c,f,d){function e(a){"string"===
typeof a?(f.truncateLines(c.$("#"+a)),d.getCarouselByName(a+"_carousel")&&c.trigger("spTruncationComplete",d.getCarouselByName(a+"_carousel"))):(f.truncateLines(a.carousel.dom.$container),c.trigger("spTruncationComplete",a.carousel))}var h="sp_detail sp_detail2 sp_detail_thematic sp_phone_detail sp_phone_detail2 sp_phoneapp_detail sp_phoneapp_detail2 sp_phone_detail_thematic sp_phoneapp_detail_thematic".split(" ");c.on("spCarouselNoTruncationRegistration",function(){var a=c.state("spTruncatorStatus");
if(!a||!a.truncationInitialized){for(a=h.length-1;0<=a;a--)e(h[a]),c.on("a:carousel:"+h[a]+"_carousel:change:animating",e),c.on("a:carousel:"+h[a]+"_carousel:change:loading",e),c.on("a:carousel:"+h[a]+"_carousel:change:pageSize",e);c.state("spTruncatorStatus",{truncationInitialized:!0})}});c.on("spMobileCarouselAjaxComplete",e);return{setUpTruncation:function(a){e(a);c.on("a:carousel:"+a+"_carousel:change:animating",e);c.on("a:carousel:"+a+"_carousel:change:loading",e);c.on("a:carousel:"+a+"_carousel:change:pageSize",
e)}}})})(k,document)});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,r=f._namespace||f.attributeErrors,b=r?r("SponsoredProductsViewabilityAssets",""):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,r){d.when("A","SponsoredProductsEventBatcher","SPHAT").register("SponsoredProductsViewability",function(b,l,h){function k(c,a){c="SPView-"+a+"-"+c;f.ue&&f.ue.count(c,(f.ue.count(c)||0)+1)}function n(c){return{qualifier:a("qualifier",c),id:a("id",c),widgetName:a("widgetName",c),
adId:a("adId",c),adIndex:a("adIndex",c),eventType:a("eventType",c)}}function a(c,a){return(c=(new RegExp("[?\x26]"+c+"(\x3d([^\x26#]*)|\x26|#|$)")).exec(a))&&c[2]?decodeURIComponent(c[2].replace(/\+/g," ")):""}function e(c){g[c.selector].viewHandler=b.delay(function(){if(c){var a=c.data("viewpixelurl");a&&-1===d.indexOf(a)&&(l.sendRequest(n(a+"\x26eventType\x3d1")),d.push(a),g[c.selector]&&(g[c.selector].viewState="VIEWED",k("viewUrlSuccess",g[c.selector].placementId)),p())}},500)}function p(){for(var c in g)if("VIEWED"===
g[c].viewState)delete g[c];else{var a=b.$(c),m=g[a.selector].viewState;"VIEWED"!==m&&(b.onScreen(a,-.15*a.height())?"OFF"===m&&(g[a.selector].viewState="ON",e(a)):"ON"===m&&(g[a.selector].viewState="OFF",clearTimeout(g[a.selector].viewHandler)))}}var g={},d=[],q=[],m=[];b.on("spViewTrackingElementLoaded",p);return{registerViewTrackingElement:function(a,e){-1===d.indexOf(a.data("viewpixelurl"))&&(k("totalAds",e),g[a.selector]={viewState:"OFF",viewHandler:null,placementId:e},b.trigger("spViewTrackingElementLoaded"))},
registerAuiEvents:function(a){Array.isArray(a)&&a.forEach(function(a){if(-1===m.indexOf(a))b.on(a,p)})},loadImagePixel:function(a,b,e,m){!h.checkForHiddenElementsWithTargetList(b,e,m)&&Array.isArray(q)&&-1===q.indexOf(a)&&(q.push(a),l.sendRequest(n(a)))}}});d.when("A","SponsoredProductsViewabilityConfig").register("SponsoredProductsEventBatcher",function(b,l){function h(a,c){a||(q+=1,g+=c);p+=c;t+=1;k("avgRequestFailurePerPage",q/t);k("avgEventFailurePerPage",g/p)}function k(a,c){f.ue&&f.ue.count("SPBatch-"+
a,c)}function n(a){var c=[];b.each(a,function(a){c.push({data:a})});return{events:c}}function a(){if(0<e.length){var a=e.length,c=n(e);e=[];var g=/unagi-\w\w.amazon.com\/1\/events\/com.amazon.eel.SponsoredProductsEventTracking.(prod|gamma)/;l.eelEndpoint!==r&&g.test(l.eelEndpoint)?b.ajax(l.eelEndpoint,{method:"post",params:c,paramsFormat:"json",contentType:"application/json",accepts:"application/json",success:function(c,b,e){h(!0,a);k("batchSuccess",a)},error:function(c,b,e){d.log("Warning -- sushi response: "+
e+" | StatusText: "+b+" | xhrStatusCode: "+(c.http?c.http.status:"could not get xhr status code. ")+" | url: "+l.eelEndpoint,"WARN","SponsoredProductsViewabilityAssets");h(!1,a);k("batchError",a)}}):(h(!1,a),k("batchError",a),d.log("Warning -- sushi endpoint incorrectly configured with: "+l.eelEndpoint,"WARN","SponsoredProductsViewabilityAssets"))}}var e=[],p=0,g=0,t=0,q=0;b.interval(function(){a()},250);f.addEventListener("beforeunload",function(){a()});return{sendRequest:function(b){e.push(b);15<
e.length&&a()},_batchRequest:function(){a()}}});d.when("A","SponsoredProductsEventBatcher").register("SPHAT",function(b,d){function h(a,b){a&&f.ue&&f.ue.count&&f.ue.count(a,(f.ue.count(a)||0)+b?1:0)}function k(a,e){return a&&e?0<b.$(a).find(e.join(",")).filter(function(){return"hidden"===b.$(this).css("visibility")||"0"===b.$(this).css("opacity")||b.$(this).is(":hidden")}).length:!1}function n(a,e){var d=":hidden";b.$.each(e,function(a,b){d+=":not("+b+")"});return 0<b.$(a).children(d).length}return{checkForHiddenElementsWithTargetList:function(a,
b,d){a=k(a,b);h(d,a);return a},checkForHiddenElements:function(a,b,d){a=n(a,b);h(d,a);return a}}});d.when("A","ready").register("SponsoredProductsViewabilityConfigInitializer",function(b){function f(b){d.register("SponsoredProductsViewabilityConfig",function(){return{eelEndpoint:b,updateEelEndpoint:function(a){this.eelEndpoint=a}}})}var h=b.state("SpViewabilityConfigState"),k=!1;"undefined"!==typeof h&&null!==h&&"undefined"!==typeof h.eelEndpoint&&null!==h.eelEndpoint&&(k=!0,f(h.eelEndpoint));b.state.bind("SpViewabilityConfigState",
function(b,a){a.eelEndpoint&&"undefined"!==typeof b.eelEndpoint&&null!==b.eelEndpoint&&(k?d.when("SponsoredProductsViewabilityConfig").execute(function(a){a.updateEelEndpoint(b.eelEndpoint)}):(k=!0,f(b.eelEndpoint)))})})});
/* ******** */
(function(f){var e=window.AmazonUIPageJS||window.P,l=e._namespace||e.attributeErrors,c=l?l("CommonDetailPageScripts",""):e;c.guardFatal?c.guardFatal(f)(c,window):c.execute(function(){f(c,window)})})(function(f,e,l){f.when("jQuery","jumpLink").execute(function(c,a){var p=c("#miniATFUDP"),b=0;0<p.length&&(b=p.height()+9);1===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",1E3,b):2===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",
1200,b):3===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",1400,b):4===e.isACRJumplLinkAnimated?a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",10,b):0<p.length&&(b=p.height()+9,a.bind("#acrCustomerWriteReviewLink, #acrCustomerReviewLink, #reviewLink, #reviewLinkShort, #reviewCreateLink",10,b));0<c("#reviewStarsLinkedCustomerReviews").length&&a.bind("#reviewStarsLinkedCustomerReviews",
10,b);0<c("#askATFLink").length&&a.bind("#askATFLink",10,b);f.when("cf").execute(function(f){0<c("#important-information a[href\x3d'#legal-disclaimer']").length&&a.bind("#important-information a[href\x3d'#legal-disclaimer']",10,b,!0)});a.bind("#seeMoreDetailsLink",300,b)});"use strict";f.when("A","jQuery","ImageBlockATF","jumpLink","cf").register("miniATFUtils",function(c,a,p,b){function l(m){t&&!m||u||(m=(new Date).getTime()-x,m=50>m?50-m:10,t=1,t=0,x=(new Date).getTime(),setTimeout(function(){var m=
q.scrollTop(),c=a("#miniATFUDP");if(0<c.length){var d=y;if("T1"===d){d=a("#sims_fbt");if(0>=d.length||0>=d.height())d=a("#buyxgety_feature_div");var b=d,d=Number.MAX_VALUE;if(b&&0<b.length){var h=b.height(),b=b.offset();h&&b&&(d=b.top+h)}d=Math.min(d,1200)}else if("T2"===d){d="#product-details-grid_feature_div #prodDetails #important-information_feature_div #importantInformation #detail-bullets #detail_bullets_id #technical-data #technicalSpecifications_feature_div #productDescription #product-description-iframe #dpx-btf-hlcx-comparison_feature_div #HLCXComparisonWidget_feature_div".split(" ");
b=Number.MAX_VALUE;for(h=0;h<d.length;h++){var g=a(d[h]);if(g&&0<g.length&&0<g.height()){var k;k=Number.MAX_VALUE;g&&0<g.length&&(g=g.offset())&&(k=g.top);k<b&&(b=k)}}d=Math.min(b,1700)-100}else d=void 0;m>d?!v&&c.is(":hidden")&&(c.removeClass("a-hidden"),c.slideDown(200)):(c.slideUp(200),v=0)}},m))}b=a("#miniATFUDP");var z=a("#miniATFPartialSelection")[0],n=a(".twister-dropdown-highlight")[0];if(!(0>=b.length)){var q,v=0,x=0,t=0,r={},u=0,w=0,y="T2";r.setMiniATFShowHeight=function(a){y=a};r.setMiniATFScrollUpHeight=
function(b){w=0;"T1"===b&&(b=a("#productTitle"),0<b.length&&(b=b.offset())&&(w=b.top-20))};a("body").delegate(".go-to-top","click",function(){a("body, html").animate({scrollTop:w},300);v=1;z&&n&&(a(n).removeClass("transparentTwisterDropdownBorder"),a(n).addClass("highlightTwisterDropdownBorder"));return!1});z&&n&&a(n).click(function(){a(this).addClass("transparentTwisterDropdownBorder");a(this).removeClass("highlightTwisterDropdownBorder")});q=a(e);q.scroll(function(){l(0)});q.resize(function(){l(1)});
f.when("ImageBlockBTF").execute(function(b){var f=function(k){var c=k.getState().selected_variations;if(c){var d="",e=k.getState().variation_display_labels;a.each(b.visualDimensions,function(a,k){a=1===b.gIsNewTwister?k:e[k];c[a]&&(d+=" "+c[a])});return d&&d.substring(1)}},e=b.defaultColor,d=e,l=b.landingAsinColor,h,g=a("#miniATF_image");0<g.length&&(h=g.attr("src"));r.updateMiniATFDiv=function(){u=0;var b=a("#miniATF_image");0<b.length&&h&&b.attr("src",h)};c.on("image-block-twister-swatch-click",
function(a,c,g,n){u=1;a=(a=n?n:f(c))&&""!==a?a:e;a===l&&(a=e);a!==d&&(h=(c=a!==e&&a!==l?b:p)&&c.colorImages&&c.colorImages[a]&&0<c.colorImages[a].length&&c.colorImages[a][0]?c.colorImages[a][0].large:null,d=a)})});return r}});"use strict";f.when("ueCount","jQuery").execute(function(c,a){a("#miniATF_BackToTopLink").click(function(){c.incrementCounterByOne("sl_back_to_top_button_click_count")})});"use strict";f.when("jQuery","dp-util-cookie","cf").execute(function(c,a){"000-0000000-8675309"===c("#addToCart").find('input[name\x3d"session-id"]').val()&&
c("#addToCart").find('input[name\x3d"session-id"]').val(a("session-id"))})});
/* ******** */
(function(f){var n=window.AmazonUIPageJS||window.P,u=n._namespace||n.attributeErrors,b=u?u("ProductBundleUIAssets",""):n;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,n,u){f.when("A","ready").register("bundle-listing.model",function(b){function a(){this.asin="";this.isBundle=this.componentsPending=this.componentsAvailable=!1}var t=b.$,g,c=0,e,h,d,k,f,l=new a,p=function(a,c,r){if(h()&&!f()&&!k()){if(d()){var m={asin:d()};l.componentsPending=!0;return g=b.get("/gp/product/ajax-handlers/get-bundle-details.html",
{params:m,accepts:"text/html",timeout:2E3,indicator:r,success:function(q){null===q||t.trim(q).length?(l.componentsAvailable=!0,a(q)):e(a,c,r,p,"An empty Ajax response was received for bundleAsin: "+d(),null,!0)},error:function(q,b,d){e(a,c,r,p,b,d)}})}e(a,c,r,p)}};e=function(a,e,d,h,q,g,m){3>c?(l.componentsPending=!1,c+=1,m?h(a,e,d):b.delay(function(){h(a,e,d)},200)):(l.componentsPending=!0,e(q,g))};var m=function(){null!==g&&g!==u&&g.abort();l=new a;var b=t("#bundle-state");b.length&&(l.asin=b.data("asin"),
l.isBundle=b.data("isbundle"))};h=function(){return l.isBundle&&""!==d()};d=function(){return l.asin};k=function(){return l.componentsAvailable};f=function(){return l.componentsPending};m();return{isBundle:h,getBundleASIN:d,hasComponentsAvailable:k,hasComponentsPending:f,loadBundleComponents:p,refresh:m}});"use strict";f.when("A","bundle-constants","bundle-logger","bundle-state","ready").register("bundle-pricing",function(b,a,t,g){var c=b.$,e=!1,h="",d=0,k,f,l,p,m,v,w,r,n;b.on(a.BUNDLE_PRICING_AJAX_TRIGGER_EVENT,
function(){k(!1)});k=function(a){if(a||p())a={asin:g.getBundleASIN()},a.asin?l(a):(t.logWarning("Unable to find bundle asin, will retry","bundlePricingAjax"),f(!1))};l=function(a){b.get("/gp/product/ajax-handlers/get-bundle-pricing.html",{params:a,accepts:"text/html",timeout:2E3,success:m,failure:function(a,b,q){t.logWarning("Error in getBundlePricing, retrying.");f(!0,b,q)}})};f=function(a,c,e){3>d?(d+=1,b.delay(function(){k(!0)},200)):a&&t.logFatal(c,"bundlePricingAjax",e)};p=function(){var a=!e;
a||h===g.getBundleASIN()?(e=!0,h=g.getBundleASIN()):(a=!0,h=g.getBundleASIN(),d=0);return a};m=function(a){b.objectIsEmpty(a)||(w(a),n(a),r(a),v(a))};v=function(b){b[a.BUNDLE_LISTING_WIDGET_V2_PRIME_ELIGIBLE]&&c(a.BUNDLE_PRICEBLOCK_PRIME_ELIGIBLE).removeClass("aok-hidden")};w=function(e){var d=e[a.BUNDLE_LISTING_WIDGET_V2_SAVINGS],h=e[a.BUNDLE_LISTING_WIDGET_V2_SAVINGS_LABEL],g=e[a.BUNDLE_LISTING_WIDGET_V2_YOU_SAVE],m=e[a.BUNDLE_LISTING_WIDGET_V2_YOU_SAVE_LABEL];e=e[a.BUNDLE_LISTING_WIDGET_V2_SAVINGS_NO_YOU_SAVE_LABEL];
b.objectIsEmpty(d)||b.objectIsEmpty(h)||b.objectIsEmpty(g)||b.objectIsEmpty(m)?b.objectIsEmpty(d)||b.objectIsEmpty(h)||b.objectIsEmpty(m)?b.objectIsEmpty(g)||b.objectIsEmpty(e)||(c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL).html(e.trim()),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_PRICE).html(g.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_ROW).removeClass("aok-hidden"),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_COLUMN).removeClass("aok-hidden")):(c(a.BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_PRICE).html(d.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_LABEL).html(m.trim()),
c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL).html(h.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_ROW).removeClass("aok-hidden"),c(a.BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_COLUMN).removeClass("aok-hidden")):(c(a.BUNDLE_PRICEBLOCK_SAVINGS_PRICE).html(d.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_LABEL).html(m.trim()),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_PRICE).html(g.trim()),c(a.BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL).html(h.trim()),c(a.BUNDLE_PRICEBLOCK_SAVINGS_ROW).removeClass("aok-hidden"),c(a.BUNDLE_PRICEBLOCK_SAVINGS_YOU_SAVE_COLUMN).removeClass("aok-hidden"))};
r=function(e){var d=e[a.BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH];e=e[a.BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH_LABEL];b.objectIsEmpty(d)||b.objectIsEmpty(e)||(c(a.BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE).html(d.trim()),c(a.BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE_LABEL).html(e.trim()),c(a.BUNDLE_PRICEBLOCK_STRIKETHROUGH_ROW).removeClass("aok-hidden"))};n=function(e){var d=e[a.BUNDLE_LISTING_WIDGET_V2_DEAL];e=e[a.BUNDLE_LISTING_WIDGET_V2_DEAL_LABEL];b.objectIsEmpty(d)||b.objectIsEmpty(e)||(c(a.BUNDLE_PRICEBLOCK_DEAL_PRICE).html(d.trim()),
c(a.BUNDLE_PRICEBLOCK_DEAL_LABEL).html(e.trim()),c(a.BUNDLE_PRICEBLOCK_DEAL_ROW).removeClass("aok-hidden"))};return{parsePricingData:m,_retryCount:function(){return d}}});"use strict";f.when("A","ready").register("bundle-state",function(b){var a=b.$,f={bundleState:"#bundle-state"};return{elements:f,getBundleASIN:function(){var b=a(f.bundleState);if(b.length)return b.data("asin")}}});"use strict";f.when("A").register("bundle-logger",function(b){b=n.ue||!1;var a=b.count||!1,f=b.log||!1,g=n.ueLogError||
!1,c=function(a,b,c,k){"INFO"!==b&&g?(null!==k&&"object"===typeof k?k.message="["+a+"] "+k.message:k={message:"["+a+"]"},g(k,{logLevel:b,attribution:c,message:a})):"INFO"===b&&f&&f(a,c)};return{logCount:function(b,c){if(a)return a(b,c),a(b)},logInfo:function(a,b){c(a,"INFO",b,null)},logWarning:function(a,b,d){c(a,"WARN",b,d)},logError:function(a,b,d){c(a,"ERROR",b,d)},logFatal:function(a,b,d){c(a,"FATAL",b,d)}}});"use strict";f.when("A","ready").register("bundle-constants",function(){return{STRIKE_THROUGH_PRICE:"#bundle_strikethrough_price",
BUNDLE_PRICE:"#bundle_price",YOU_SAVE:"#bundle_you_save",BUNDLE_DEAL_PRICE:"#bundle_deal_price",TOTAL_BOUGHT_SEPARATELY:"#bundle_total_bought_separately",BUNDLE_PRICEBLOCK_DEAL_PRICE:"#priceblock-bundle-deal-price",BUNDLE_PRICEBLOCK_DEAL_LABEL:"#priceblock-bundle-deal-label",BUNDLE_PRICEBLOCK_DEAL_ROW:"#priceblock-bundle-deal-row",BUNDLE_PRICEBLOCK_SAVINGS_PRICE:"#priceblock-bundle-savings-price",BUNDLE_PRICEBLOCK_SAVINGS_ROW:"#priceblock-bundle-savings-row",BUNDLE_PRICEBLOCK_SAVINGS_LABEL:"#priceblock-bundle-savings-label",
BUNDLE_PRICEBLOCK_YOU_SAVE_LABEL:"#bundle-v2-savings-atf-you-save-label",BUNDLE_PRICEBLOCK_YOU_SAVE_PRICE:"#priceblock-bundle-you-save-price",BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_PRICE:"#bundle-v2-savings-no-you-save-atf",BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_LABEL:"#bundle-v2-savings-no-you-save-label-atf",BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE:"#bundle-v2-price-strikethrough-atf",BUNDLE_PRICEBLOCK_STRIKETHROUGH_ROW:"#bundle-priceblock-strikethrough-row",BUNDLE_PRICEBLOCK_STRIKETHROUGH_PRICE_LABEL:"#bundle-v2-price-strikethrough-atf-label",
BUNDLE_PRICEBLOCK_SAVINGS_NO_YOU_SAVE_COLUMN:"#bundle-v2-savings-no-you-save-atf-column",BUNDLE_PRICEBLOCK_SAVINGS_YOU_SAVE_COLUMN:"#bundle-v2-you-save-atf-column",BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_COLUMN:"#bundle-v2-you-save-no-savings-atf-column",BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_LABEL:"#bundle-v2-you-save-no-savings-atf-label",BUNDLE_PRICEBLOCK_YOU_SAVE_NO_SAVINGS_PRICE:"#bundle-v2-you-save-no-savings-atf-price",BUNDLE_PRICEBLOCK_LESS_THAN_BUYING_SEPERATELY_PRICE:"#priceblock-bundle-less-than-buying-seperately-price",
BUNDLE_PRICEBLOCK_PRIME_ELIGIBLE:"#bundle-v2-atf-prime-logo",BUNDLE_TWISTER_PLUS_FEATURE:"#bundles-twister-plus",BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH:"bundle-listing-v2-strikethrough",BUNDLE_LISTING_WIDGET_V2_STRIKETHROUGH_LABEL:"bundle-listing-v2-strikethrough-label",BUNDLE_LISTING_WIDGET_V2_SAVINGS:"bundle-listing-v2-savings",BUNDLE_LISTING_WIDGET_V2_YOU_SAVE:"bundle-listing-v2-you-save",BUNDLE_LISTING_WIDGET_V2_YOU_SAVE_LABEL:"bundle-listing-v2-you-save-label",BUNDLE_LISTING_WIDGET_V2_DEAL:"bundle-listing-v2-deal",
BUNDLE_LISTING_WIDGET_V2_DEAL_LABEL:"bundle-listing-v2-deal-label",BUNDLE_LISTING_WIDGET_V2_SAVINGS_LABEL:"bundle-listing-v2-savings-label",BUNDLE_LISTING_WIDGET_V2_SAVINGS_NO_YOU_SAVE_LABEL:"bundle-listing-v2-you-save-no-savings-label",BUNDLE_LISTING_WIDGET_V2_PRIME_ELIGIBLE:"bundle-listing-v2-prime-eligible",BUNDLE_LISTING_V2_READY_EVENT:"bundle-listing-V2:widget:ready",BUNDLE_LISTING_BOTTOM_SHEET_READY_EVENT:"bundle-listing:sheet:ready",BUNDLE_PRICING_AJAX_TRIGGER_EVENT:"bundle-pricing-ajax-trigger-event"}});
"use strict";f.when("A","ready").execute(function(b){var a=b.$,f=2,g,c,e=!1,h,d=!1,k,n=function(){return b.interval(function(){b.onScreen("#customizable-secondary-view")&&!d&&c();d&&clearInterval(k)},500)};k=n();var l=function(c){e=!0;f=2;var d=a("#customizable_bundle_state"),g=a(c);c=a(g).find("#customizable-add-to-cart-token");d.length&&c.length&&(d=d.data("tiers"),b.each(d,function(b,c){c=a(g).find("#customizable-tier-ajax-"+b);a("#asin-faceouts-tier-"+b).html(c.html())}),b.trigger("customizable-faceouts-loaded",
c))},p=function(c){var d=a("#customizable_bundle_state").data("tiers");b.each(d,function(b,d){d=a("#asin-faceouts-tier-"+b);b=d.find(".a-spinner-wrapper");d=d.find("p");c?(b.addClass("aok-hidden"),d.removeClass("aok-hidden")):(b.removeClass("aok-hidden"),d.addClass("aok-hidden"))})};c=function(){d=!0;var c=a("#customizable_bundle_state").attr("data-asin");e&&c===h||(e=!1,h=c,p(!1),b.get("/gp/product/ajax-handlers/get-product-grouping-tiers.html",{params:{asin:c},accepts:"text/html",timeout:4E3,success:l,
failure:g}))};g=function(a,d,e){0>=f?(b.trigger("customizable-faceouts-not-loaded"),p(!0)):(f--,c())};b.on("a:popover:beforeShow:customizable_bundle_secondary_view",c);b.on("a:popover:afterHide:customizable_bundle_secondary_view",function(){d=!1;f=2;k=n()})});"use strict";f.when("jQuery").register("list-of-bundles",function(b){var a=b("#pba-lob-carousel-container");a.length&&(a.removeClass("a-carousel-static"),f.when("a-carousel-framework","dp-time-to-interactive").execute(function(b,f){f.getClickToCIPromise().then(function(){a.addClass("a-carousel-static");
b.createAll()})}))})});
/* ******** */
(function(m){var k=window.AmazonUIPageJS||window.P,E=k._namespace||k.attributeErrors,a=E?E("BurjDesktopAssets",""):k;a.guardFatal?a.guardFatal(m)(a,window):a.execute(function(){m(a,window)})})(function(m,k,E){m.when("jQuery","ready").register("action-panel-secondary-panel",function(a){function d(b,c){b&&c&&h[b]&&(a("#"+b+"_secondaryPanelHeadingText").text(c),h[b].heading=c)}function e(b,c){if(b&&c&&h[b]){var d=a("#"+c);a("#"+b+"_secondaryPanelHeadingContent").append(d);h[b].headingContentId=c}}function g(b,
c){if(b&&c&&h[b]){var d=a("#"+c);0<d.length&&(c!==h[b].contentId&&a("#"+h[b].contentId).addClass("aok-hidden"),a("#"+b+"_secondaryPanelContent").append(d),d.removeClass("aok-hidden"),h[b].contentId=c)}}function f(b){b&&h[b]&&a("#actionPanel,#superleafActionPanel").animate({left:"+\x3d420px"},400,"swing",function(){a("#"+b+"_secondaryPanel").addClass("aok-hidden");a("#"+b+"_secondaryPanelBackButton").removeClass("backButtonClickedState");"undefined"!==typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&
"function"===typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty("overflow","visible","important")})}var h={},c=function(b){a(this).addClass("backButtonClickedState");f(b.data.panelId)};return{init:function(b){if(b.panelId){h[b.panelId]=b;b.heading&&d(b.panelId,b.heading);b.headingContentId&&e(b.panelId,b.headingContentId);b.contentId&&g(b.panelId,b.contentId);var f=a("#"+b.panelId+"_secondaryPanelBackButton");
f.unbind("click",c);f.bind("click",{panelId:b.panelId},c);"0px"!==a("#actionPanel").css("left")&&a("#actionPanel").css("left","0px")}},setHeading:d,setHeadingContent:e,setContent:g,animateIn:function(b){b&&h[b]&&.5!==parseFloat(a("#"+b+"_secondaryPanel").closest(".feature").css("opacity"))&&(a("#actionPanelWrapper,#superleafActionPanelWrapper")[0]!==E&&"undefined"!==typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&"function"===typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&
a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty("overflow","hidden","important"),a("#"+b+"_secondaryPanel").removeClass("aok-hidden"),a("#actionPanel,#superleafActionPanel").animate({left:"-\x3d420px"},400,"swing"))},animateOut:f}});m.when("jQuery","ready").register("elevatorFeature",function(a){var d,e,g,f,h,c,b,u=function(){k.pageYOffset>f?(d.addClass("stickyBar"),g.removeClass("aok-hidden"),e.removeClass("aok-hidden")):(d.removeClass("stickyBar"),g.addClass("aok-hidden"),
e.addClass("aok-hidden"))},v=function(){var c=k.pageYOffset,d,f;d=0;for(f=b.length;d<f;++d){var g=b[d],e=a(g.element);if(0<e.length){var n=e.offset().top-h-10,e=n+e.height(),l;c>=n-10&&c<=e+10?(a(g.selector).addClass("elevatorHighlight"),l=g.selector):a(g.selector).hasClass("elevatorHighlight")&&l!==g.selector&&a(g.selector).removeClass("elevatorHighlight")}}},z=function(a){if(0<a.length){var b=a.offset().top-h-10;t(b,a)}},t=function(b,d){var g=a(k).scrollTop(),f=Math.abs(g-b)+0,e=f/2E3*1E3,n=0>g-
b,l=!1,u=n?b-.2*f:b+.2*f;c=!0;a(".elevatorButton").removeClass("elevatorHighlight");a("html, body").animate({scrollTop:b},{duration:500>e?500:e,step:function(a,c){d&&!l&&(n?a>u:a<u)&&(l=!0,a=d.offset().top-h-10,b!==a&&(c.end=a))},complete:function(){c=!1;v()}})},r=function(c,d,g){var f=a(c);f.length?(b.push({selector:d,element:c}),a(d).click(function(){f=a(c);z(f)})):a(g).addClass("aok-hidden")},y=function(){var c=[];a("#beautyRecommendations").length&&c.push("#beautyRecommendations");a("#sims_fbt").length&&
c.push("#sims_fbt");a("#session-sims-feature, #fallbacksession-sims-feature").length&&c.push("#session-sims-feature, #fallbacksession-sims-feature");a("#purchase-sims-feature").length&&c.push("#purchase-sims-feature");if(c.length)c.sort(function(c,b){return a(c).offset().top-a(b).offset().top}),c.forEach(function(a){b.push({selector:"#elevatorRelatedProductsSection",element:a})}),a("#elevatorRelatedProductsSection").click(function(){for(var b=k.pageYOffset,d=0,f=c.length,g=null;null===g&&d<f;){var e=
a(c[d++]);0<e.length&&Math.floor(e.offset().top-h-10)>b&&(g=e)}null===g&&d===f&&(g=a(c[0]));z(g)});else{a("#elevatorRelatedProductsSection").addClass("aok-hidden");for(var d=a(".elevatorDividerSection"),g=!0,f=d.length-1;g&&0<=f;){var e=a(d[f]);e.hasClass("aok-hidden")?f--:(e.addClass("aok-hidden"),g=!1)}}},x=function(){a("#elevatorViewBuyingOptionsButton .a-button-inner").click(function(){t(a("#a-page .a-container").offset().top-10,null)})},l;m.when("page-refresh:page").execute(function(a){l=a});
var n=function(){if(l&&l.config){var b=!1,c;for(c in l.config)if(l.config[c].affectedFeatures&&(a(l.config[c].affectedFeatures).each(function(c,d){c=a(d);"none"!==c.css("display")&&"1"!==c.css("opacity")&&(b=!0)}),b))return!0}return!1},w=function(){if(n())setTimeout(function(){w()},200);else{d=a("#elevatorBar");e=a("#elevatorBarPlaceholder");g=a("#elevatorViewBuyingOptionsSection");f=d.position().top;h=d.height();b=[];var l=!1;c=!1;r("#productDescription, #product-description_feature_div, #product-description-iframe",
"#elevatorMoreAboutThisItemSection","#elevatorMoreAboutThisItemSection, #elevatorMoreAboutThisItemDivider");r("#detail-bullets, #prodDetails","#elevatorProductDetailsSection","#elevatorProductDetailsSection, #elevatorProductDetailsDivider");r("#quickPromoBucketContent","#elevatorSpecialOffersSection","#elevatorSpecialOffersSection, #elevatorSpecialOffersDivider");r("#cm_cr_dpwidget","#elevatorCustomerReviewsSection","#elevatorCustomerReviewsSection, #elevatorCustomerReviewsDivider");y();x();a(k).resize(function(){f=
d.position().top});a(k).scroll(function(){l=!0});setInterval(function(){l&&(l=!1,u(),c||v())},100);u();v()}};return{init:w}});"use strict";m.when("A","a-popover","actionpanel-modified-popover","cf").register("sns-frequency-dropdown",function(a,d,e){var g=a.$;return{init:function(){g("#sns-frequency-button").length&&(new e("sns-frequency-dropdown-popover",g("#sns-frequency-button")),a.declarative("sns-frequency-update","click",function(a){var e=a.$target.parents("li");a=a.data.frequency;e.siblings().removeClass("sns-selected-frequency");
e.addClass("sns-selected-frequency");g("#rcxOrdFreq").val(a);g("#sns-frequency-button-label").text(e.text());d.get("sns-frequency-dropdown-popover").hide()}),a.declarative("sns-frequency-dropdown-popover-close","click",function(a){d.get("sns-frequency-dropdown-popover").hide()}))}}});m.when("jQuery","action-panel").register("mom-checkbox",function(a,d){return{init:function(){var e=a("#addToCart"),g=e.attr("action");a("#chkMom").change(function(){if(a("#chkMom").length){var f;a("#chkMom").is(":checked")?
(e.attr("action","/gp/family/pipeline/view-signup/"),f="mom"):(e.attr("action",g),f="sns");d.setPanelState({mode:f})}});a("#chkMom").length&&a("#chkMom").is(":checked")&&a("#chkMom").attr("checked",!1)}}});m.when("jQuery","A").register("twister-aui-page-state",function(a,d){var e="beautyRecommendations bRecDynamicStrings csxfsSecondaryPanelSettings ccxsmartShelfSecondaryPanelSettings accessoryInfo smartShelfVASInfo".split(" ");return{updatePageState:function(){var g=d.parseJSON;d.each(a('script[type\x3d"a-state"]'),
function(f){f=a(f);if(!f.data("a-eval")){var h=f.attr("data-a-state");if(h&&(h=g(h),h.key&&-1!==a.inArray(h.key,e))){var c=g(f.html());d.state.replace(h.key,c);f.data("a-eval",!0)}}})}}});m.when("A","skinToneSelector","scenesAjaxHandler","colorScenesSlider","colorScenesCarousel","ready").register("colorScenes",function(a,d,e,g,f){function h(){O=!0;F.addClass("aok-hidden");G.removeClass("aok-hidden");m.addClass("aok-hidden");T.initCarousel();k.CounterScenesController&&r(k.CounterScenesController.getCounterSelection());
a.trigger("colorScenes:expandCounter");q&&q.count&&q.count("colorScenesShowScene",1)}function c(){G.addClass("aok-hidden");m.removeClass("aok-hidden");F.removeClass("aok-hidden");O=!1;p(k).resize()}function b(){O?c():h();q&&q.count&&q.count("colorScenesClickCounterIngress",1)}function u(){var a=T.getCarouselWidth(),c=E.getSlideTrackWidth();X=a/c;Y=c/a}function v(a,c,b){u();E.moveSlider(-a*Y,c,b)}function z(a,c){u();U.hideWhenClickOutside();T.moveCarouselByX(-a*X,c,!1,!1)}function t(a,c){T.updateImagePosition(R[a],
R[c])}function r(a){O&&T.selectCarouselItemAtIndex(a,!1);x(a-1)}function y(c){Z||(a.trigger("colorScenes:expandCounter"),a.trigger("colorScenes:select",c),x(c+1))}function x(a){M&&a!==H&&(I.css("background-image",'url("'+V[B[a]]+'")').fadeTo(300,1),H=a)}function l(a,c,b){p.each(a,function(a,d){"missingSkinTones"!==a&&"placeHolderImageId"!==a&&(p("#carouselSceneImage_"+a).css("background-image",'url("'+d+'")').fadeTo(300,1),V[a]=d,c&&("function"===typeof A&&A("cf","colorScenesFetchImages",{wb:1}),
I.css("background-image",'url("'+d+'")').fadeTo(300,1),p("#colorScenesIngressLeftImg").delay(300).animate({"margin-right":"25px"},300,"linear")),b&&"function"===typeof J&&(J("ld","colorScenesFetchImages",{wb:1}),J("ld","colorScenesFeature",{wb:1})))})}function n(){K.click(function(a){h();q&&q.count&&q.count("colorScenesClickIngressButton",1)});W.click(function(a){c();q&&q.count&&q.count("colorScenesClickBackButton",1)});N.length&&N.click(b)}function w(c){if(c[L]){"function"===typeof A&&A("cf","colorScenesIsEnabled",
{wb:1});F=p("#imageBlock_feature_div");K=p("#colorScenesIngressButton");I=p("#colorScenesIngressImages").children();m=p("#colorScenesIngressContainer");G=p("#colorScenesStage");W=p("#colorScenesBackArrowImage");N=p("#counterColorScenesIngress");c=1;k.CounterScenesController&&(c=k.CounterScenesController.getCounterSelection());T=new f(c);a.on("scenesCarousel:select",y);1<B.length?(E=new g,a.on("scenesCarousel:sync",v),a.on("scenesSlider:sync",z)):p("#colorSceneSliderSection").addClass("aok-hidden");
U=new d(S);a.on("skinToneSelector:select",t);"function"===typeof A&&A("bb","colorScenesFetchImages",{wb:1});var b=H;c=b-7;var e=H+1,h=e+7,u=B.length;for(D.getSceneInfo(B[H],l,!0,!1);0<=c||h<u;)0<=c&&(b=B.slice(c,b).toString(),D.getSceneInfo(b,l,!1,!1),b=c,c-=7),h<u&&(e=B.slice(e,h).toString(),D.getSceneInfo(e,l,!1,!1),e=h,h+=7);0<b&&e<u?(b=B.slice(0,b).toString(),D.getSceneInfo(b,l,!1,!1),e=B.slice(e,u).toString(),D.getSceneInfo(e,l,!1,!0)):0<b?(b=B.slice(0,b).toString(),D.getSceneInfo(b,l,!1,!0)):
e<u&&(e=B.slice(e,u).toString(),D.getSceneInfo(e,l,!1,!0));n();M=!0;m.removeClass("aok-hidden");K.removeClass("aok-hidden");N.removeClass("aok-hidden");"function"===typeof J&&J("ld","colorScenesIsEnabled",{wb:1});"function"===typeof A&&A("cf","colorScenesFeature",{wb:1});q&&q.count&&q.count("colorScenesShowIngress",1)}}var p=a.$,q=k.ue,A=k.uet,J=k.uex,F,m,K,I,G,W,N,O,M=!1,D,L,H,B,V={},P,C,U,S,R,Z,Y,X,E,T;return{init:function(a){L=a.parentAsin;B=a.variationAsins;L&&B&&0<B.length&&(H=a.currentAsinIndex,
P=a.isEnabledEndPoint,C=a.infoEndPoint,R=a.skinToneToPositionCssClass,S=a.defaultSkinTone,Z=a.isSingletonCase,"function"===typeof A&&A("bb","colorScenesFeature",{wb:1}),D=new e(P,C),"function"===typeof A&&A("bb","colorScenesIsEnabled",{wb:1}),D.checkIsEnabled(L,w))},selectSceneItem:r}});m.when("A").execute(function(a){k.CounterScenesController=new function(){function d(a,b,d){if("string"===typeof b||"number"===typeof b)"string"===typeof b&&(b=parseInt(b,10)),d?e(a,b+1):e(a,b-1)}function e(a,b){h||
"function"!==typeof a||(h=!0,"undefined"!==typeof b?a(b):a(),h=!1)}var g,f,h;this.registerCounter=function(a){"object"===typeof a&&a?g=a:k.ueLogError&&k.ueLogError({message:"[Failed to register Counter Twister with CounterScenesController]"},{logLevel:"ERROR",attribution:"counter_scenes_controller_register_counter_error"})};this.registerColorScene=function(a){"object"===typeof a&&a?f=a:k.ueLogError&&k.ueLogError({message:"[Failed to register Color Scene with CounterScenesController]"},{logLevel:"ERROR",
attribution:"counter_scenes_controller_register_scene_error"})};this.getCounterSelection=function(){return g?g.getCurrentSelectedIndex()+1:1};f=g=null;h=!1;a.on("colorScenes:expandCounter",function(){g&&e(g.expandCounter)});a.on("colorScenes:select",function(a){g&&d(g.selectCounterVariationAtIndex,a,!1)});a.on("counter:select",function(a){f&&d(f.selectSceneItem,a,!0)})}});m.when("A").register("skinToneSelector",function(a){return function(d){function e(){v.addClass("aok-hidden");u.removeClass("aok-hidden");
t=!1}function g(a){u.addClass("aok-hidden");v.removeClass("aok-hidden");c(k).click(h.hideWhenClickOutside);t=!0;b&&b.count&&b.count("colorScenesOpenSkinTone",1);a.preventDefault();a.stopPropagation();return!1}function f(d){var g=d.target.id,f=z.attr("id");d=c(d.target);g!==f&&z.removeClass("selectedSkinTone");d.addClass("selectedSkinTone");a.trigger("skinToneSelector:select",g,f);z=d;e();b&&b.count&&b.count(r[g],1)}var h=this,c=a.$,b=k.ue,u,v,z,t=!1,r={skinTone_10:"colorScenesSelectSkinTone10",skinTone_20:"colorScenesSelectSkinTone20",
skinTone_30:"colorScenesSelectSkinTone30",skinTone_40:"colorScenesSelectSkinTone40",skinTone_50:"colorScenesSelectSkinTone50"};h.hideWhenClickOutside=function(){t&&(e(),c(k).unbind("click",h.hideWhenClickOutside),t=!1)};(function(b){u=c("#colorSceneSkinToneButton");v=c("#skinTonePanel");z=c("#"+b);z.addClass("selectedSkinTone");a.trigger("skinToneSelector:select",b,null);u.click(g);c(".skinToneColor").click(f)})(d)}});m.when("A").register("scenesAjaxHandler",function(a){return function(d,e){function g(a,
b,d){if(!a||0===a.length)throw Error(b+" is null or empty for "+d);}var f,h;this.getSceneInfo=function(c,b,d,e){g(c,"asinList","getSceneInfo");var f=h+c;a.ajax(f,{method:"get",success:function(a,c,g){"function"===typeof b&&b(a,d,e)},error:function(){k.ueLogError&&k.ueLogError({message:"[Failed to load sprite images from"+f+" ]"},{logLevel:"ERROR",attribution:"color_scenes_throwing_the_error"})}})};this.checkIsEnabled=function(c,b){g(c,"parentAsin","checkIsEnabled");var d=f+c;a.ajax(d,{method:"get",
success:function(a,c,d){"function"===typeof b&&b(a)},error:function(){k.ueLogError&&k.ueLogError({message:"[Failed to determined if colorscene is enabled for "+c+" with url "+d+" ]"},{logLevel:"ERROR",attribution:"color_scenes_is_enabled_throwing_the_error"})}})};(function(a,b){g(a,"checkEnabledEndpoint","init");g(b,"loadImagesEndpoint","init");f=a;h=b})(d,e)}});m.when("A","a-carousel-framework","scenesMoveEventUtil","scenesFlickVelocity").register("colorScenesCarousel",function(a,d,e,g){return function(f){function h(){return C}
function c(){M=K.first().width();D=K.first().outerWidth(!0)-M;N=K.first().position().left;O=K.last().position().left;L=N-q/2+D+M/2;H=O-q/2+D+M/2;var a=Q.find(".selectedCarouselItem");V=0<a.length?a.width()-M-2*D:0;B=H-L}function b(a){P=!1;e.bind(v,u);U=e.getClientX(a);R.startFlickVelocityTracking();S=C;a.preventDefault();a.stopPropagation();return!1}function u(a){e.unbind(v,u);R.triggerFlickVelocityMove();y();a.preventDefault();a.stopPropagation();return!1}function v(a){var b=e.getClientX(a),c=b-
U;U=b;l.moveCarouselByX(c,!0,!1,!1);P=!0;a.preventDefault();a.stopPropagation();return!1}function m(b){if(!P||5>=Math.abs(Math.abs(S-C))){var c=b.data.index;l.selectCarouselItemAtIndex(b.data.index,!1);a.trigger("scenesCarousel:select",c);w&&w.count&&w.count("colorScenesClickSceneImage",1)}P=!1}function t(a){l.moveCarouselByX(a,!0,!1,!1)}function r(){return C>L&&C<H}function y(){Math.abs(S-C)&&w&&w.count&&w.count("colorScenesCarouselMove",Math.abs(S-C))}function x(){d.onInit("colorScenes",function(b){c();
C=L;G=n(I[E-1]);G.addClass("selectedCarouselItem");G.siblings(".sceneImageNamePlate").addClass("selectedCarouselItem");l.selectCarouselItemAtIndex(E,!1);a.on("a:carousel:colorScenes:repaint",function(a){l.selectCarouselItemAtIndex(E,!0)})})}var l=this,n=a.$,w=k.ue,p,q,A,J,F,Q,K,I,G,E,N,O,M,D,L,H,B,V,P,C,U,S,R;l.getCarouselWidth=function(){return B};l.moveCarouselByX=function(b,d,e,g){C-=b;c();C<L?C=L:C>H&&(C=H);e?F.gotoPixel(C,{animationDuration:0}):500<Math.abs(b)?F.gotoPixel(C,{animationDuration:400}):
F.gotoPixel(C);d&&a.trigger("scenesCarousel:sync",b,!d,g)};l.selectCarouselItemAtIndex=function(a,b){c();var d=q/2-N-D-M/2+V,d=F.getItemOffset(a)-d;l.moveCarouselByX(C-d,!0,b,!0);E=a;a=n(I[a-1]);G.attr("id")!==a.attr("id")&&(G&&(G.removeClass("selectedCarouselItem"),G.siblings(".sceneImageNamePlate").removeClass("selectedCarouselItem")),a.addClass("selectedCarouselItem"),a.siblings(".sceneImageNamePlate").addClass("selectedCarouselItem"),G=a)};l.updateImagePosition=function(a,b){I.removeClass(b).addClass(a)};
l.resizeCarouselContainer=function(){A.width(p.parent().width());q=p.width()};l.initCarousel=function(){l.resizeCarouselContainer();d.initializeAll()};(function(c){P=!1;R=new g(t,y,r,h);E=c;p=n("#leftCol");q=p.width();A=n("#colorScenesCarouselSection");J=n("#colorScenesCarouselContainer");Q=J.find(".a-carousel");K=Q.children();F=d.getCarouselByName("colorScenes");I=n(".carouselSceneImage");x();I.mousedown(b);"undefined"!==typeof k.ontouchstart&&I.bind("touchstart",b);c=I;for(var e=0;e<c.length;e++)n(c[e]).bind("click",
{index:e+1},m),"undefined"!==typeof k.ontouchend&&n(c[e]).bind("touchend",{index:e+1},m);a.on.resize(l.resizeCarouselContainer);a.on.orientationchange(l.resizeCarouselContainer)})(f)}});m.when("A","scenesMoveEventUtil","scenesFlickVelocity").register("colorScenesSlider",function(a,d,e){return function(){function g(a){d.bind(h,f);y=d.getClientX(a);A.startFlickVelocityTracking();l=x;a.preventDefault();a.stopPropagation();return!1}function f(a){d.unbind(h,f);A.triggerFlickVelocityMove();b();a.preventDefault();
a.stopPropagation();return!1}function h(a){var b=d.getClientX(a),c=b-y;y=b;u.moveSlider(c,!0,!1);a.preventDefault();a.stopPropagation();return!1}function c(a){if(t[0]===a.target){y=r.offset().left;var b=d.getClientX(a),c=b-y-p/2;y=b;u.moveSlider(c,!0,!0);v&&v.count&&v.count("colorScenesClickSlider",c);a.preventDefault();a.stopPropagation();return!1}}function b(){var a=Math.abs(l-x);a&&v&&v.count&&v.count("colorScenesSliderMove",a)}var u=this,v=k.ue,m=a.$,t,r,y,x,l,n,w,p,q,A;u.getSlideTrackWidth=function(){return q};
u.moveSlider=function(b,c,d){if(0!==Math.abs(b)){var e=x+b;e>w&&(e=w);e<n&&(e=n);x=e;d?r.animate({left:e},200):r.css("left",e);c&&a.trigger("scenesSlider:sync",b,!1)}};A=new e(function(a){u.moveSlider(-a,!0,!1)},b,function(){return x>n&&x<w},function(){return x});t=m("#colorSceneSliderBar");r=m("#colorSceneSlider");a.capabilities.touch&&(t.css("height","8px"),r.css("height","15px"));p=r.outerWidth();x=-p/2;r.css("left",x);n=-p/2;w=t.outerWidth()-p/2;q=w-n;r.mousedown(g);t.click(c);"undefined"!==typeof k.ontouchstart&&
(r.bind("touchstart",g),t.bind("touchstart",c))}});m.when("A").register("scenesFlickVelocity",function(a){return function(d,e,g,f){function h(a,b){if("function"!==typeof a)throw Error(b);}var c=this,b,k,m,z,t,r,y,x,l;c.startFlickVelocityTracking=function(){k=b=0;m=Date.now();z=t();clearInterval(r);r=setInterval(c.computeFlickVelocity,50)};c.computeFlickVelocity=function(){var a,c;a=Date.now();c=a-m;m=a;a=t()-z;z=t();c=1E3*a/(1+c);b=.8*c+.2*c};c.triggerFlickVelocityMove=function(){clearInterval(r);
50<Math.abs(b)&&(k=.05*b,m=Date.now(),a.requestAnimationFrame(c.flickVelocityMove))};c.flickVelocityMove=function(){var b;k&&(b=Date.now()-m,b=-k*Math.exp(-b/500),1<Math.abs(b)&&l()?(y(b),a.requestAnimationFrame(c.flickVelocityMove)):x())};(function(a,b,c,d){h(a,"moveRefFn is null or undefined for FlickVelocityController.");h(c,"checkLimitRefFn is null or undefined for FlickVelocityController.");h(d,"getFrameRefFn is null or undefined for FlickVelocityController.");y=a;x=b;l=c;t=d})(d,e,g,f)}});m.when("A").register("scenesMoveEventUtil",
function(a){function d(a,d){e(k).unbind("mousemove",a).unbind("mouseup",d);"undefined"!==typeof k.ontouchmove&&e(k).unbind("touchmove",a).unbind("touchend",d)}var e=a.$;return{bind:function(a,f){d(a,f);e(k).bind("mousemove",a).bind("mouseup",f);"undefined"!==typeof k.ontouchmove&&e(k).bind("touchmove",a).bind("touchend",f)},unbind:d,getClientX:function(a){return a.originalEvent&&a.originalEvent.targetTouches&&0<a.originalEvent.targetTouches.length?a.originalEvent.targetTouches[0].clientX:a.clientX}}});
m.when("A","atf").register("smart-shelfT1",function(a){function d(b,c,d,e){a.$("#ASIN").val(b);a.$("#offerListingID").val(c);a.$("#isAddOn").val(d);a.$("#quantity").val(e);p.submit();a.$("#ASIN").val(W);a.$("#offerListingID").val(N);a.$("#isAddOn").val(O);a.$("#quantity").val(q)}function e(a,b){G&&G.count&&G.count(a,b)}function g(){h();a.$("body").delegate("#add-to-cart-button","click",L);m.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_0");
d(n.asin,n.offerId,n.addOn,1);m.addClass("aok-hidden");r.removeClass("aok-hidden");e("smartShelfAccessoriesAdded",1)});v.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_1");d(n.asin1,n.offerId1,n.addOn1,1);v.addClass("aok-hidden");y.removeClass("aok-hidden");e("smartShelfAccessoriesAdded",1)});z.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_2");d(n.asin2,n.offerId2,n.addOn2,
1);z.addClass("aok-hidden");x.removeClass("aok-hidden");e("smartShelfAccessoriesAdded",1)});t.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_w");d(n.warrantyAsin,n.warrantyOfferId,!1);t.addClass("aok-hidden");l.removeClass("aok-hidden")});a.$("body").undelegate("#add-to-cart-button","click.siatc");a.$("body").undelegate("#add-to-cart-button","click.vaswarrantysiatc")}function f(){F=[];w=a.state("smartShelfVASInfo");m=a.$(".csxsw_item_atc");
v=a.$(".csxsw_item1_atc");z=a.$(".csxsw_item2_atc");t=a.$(".csxsw_warranty_atc");r=a.$(".csxsw_item_success");y=a.$(".csxsw_item1_success");x=a.$(".csxsw_item2_success");l=a.$(".csxsw_warranty_success");p=a.$("#addToCart");Q=b=!1;var d=a.$("#"+J+"_secondaryPanelBackButton");n.showBackButton&&"false"!==n.showBackButton?d.click(function(){b=!1}):d.addClass("aok-hidden");c=a.$("#"+J+"_actionPanelSecondaryPanelDivider");c.addClass("smartShelfDivider");c.removeClass("actionPanelSecondaryPanelDivider");
w!==E&&w.hideSmartShelf||(a.$("#add-to-cart-button"),g())}function h(){a.$("body").undelegate("#add-to-cart-button","click",B);a.$("body").undelegate("#add-to-cart-button","click",L)}var c,b,m,v,z,t,r,y,x,l,n,w,p,q,A,J,F,Q,K,I,G=k.ue,W=a.$("#ASIN").val(),N=a.$("#offerListingID").val(),O=a.$("#isAddOn").val(),M=function(){if(!b&&.5!==parseFloat(a.$("#"+J+"_secondaryPanel").closest(".feature").css("opacity"))){q=a.$("#quantity").val();Q||(e("smartShelfAccessoriesSeen",n.numberOfAccessories),e("smartShelfShowSecondaryPanel",
1),Q=!0);var c=a.$("#addToCart").find(".abbListItem");c.length&&c.each(function(b){b=a.$(this).find("input[id^\x3d'mbb-offer']");var c=a.$(this).find("input[name^\x3d'asin']");c.length&&this.removeChild(c[0]);b[0].checked&&c.length&&(a.$("#csxswWarrantyInclude").addClass("aok-hidden"),F.push([c[0].value,b[0].value]))});if(a.$("#addToCart").find(".atcFormServiceAsinData").length){var c=a.$("#addToCart").find(".atcFormServiceAsinData[name^\x3d'asin']"),d=a.$("#addToCart").find(".atcFormServiceAsinData[name^\x3d'offeringID']");
c.length&&d.length&&F.push([c.val(),d.val()])}a.$("#freeSampleOfferListingID").val()&&""!==a.$("#freeSampleOfferListingID").val()&&F.push([a.$("#csxfsSelectedAsin").val(),a.$("#freeSampleOfferListingID").val()]);A.animateIn(J);b=!0}},D=function(b){a.$("#addToCart").submit(function(b){a.$.ajax({type:a.$("#addToCart").attr("method"),url:a.$("#addToCart").attr("action"),data:a.$("#addToCart").serialize(),success:function(b){var c=a.$.parseJSON(b);c&&!c.error&&(F.length?(b=F.pop(),d(b[0],b[1],!1,1)):
c.cartCount&&k.$Nav&&k.$Nav.when("api.setCartCount").run(function(a){a(c.cartCount)}))}});b.preventDefault()})},L=function(){if(a.$("#smartShelfDP_feature_div").children().length||a.$("#smartShelfContent_feature_div").children().length){if("false"!==n.changeForm||a.$("#actionPanel").hasClass("ap-onetime")||a.$("#regularBuybox").hasClass("a-accordion-active")||a.$("#oneTimeBuyBox").hasClass("a-accordion-active")){var b="";p.length&&null!==p.prop("action")&&(b=p.prop("action"));var c="",d=b.search("ref\x3d");
p.length&&-1!==d&&(c=b.substr(d,b.length));b="/gp/consumables/add-to-cart-ajax.html/"+c;a.$("#addToCart").prop("action",b)}M();D()}},H=function(){I++;3>I&&B()},B=function(b){K||(b.preventDefault(),a.$.ajax({timeout:5E3,url:"/gp/smartshelf/utility/trigger",success:function(b,c,d){var e;if(b&&b!==E&&""!==b.trim())try{var g=JSON.parse(b.trim());K="T1"===g.treatment||"C"===g.treatment;e="T1"===g.treatment}catch(h){H()}K?(e&&f(),a.$("#add-to-cart-button").click()):H()},error:function(a,b,c){H()}}))};return{init:function(b,
c){h();K=!1;I=0;A=b;J=c;n=a.state("accessoryInfo");"true"===n.doTrigger?a.$("body").delegate("#add-to-cart-button","click",B):f()},undelegateATC:h}});"use strict";m.when("A","jQuery","pantryEnhancementMetrics").execute("dpv2-pantryEnhancement-metrics",function(a,d,e){e.registerCounters()});m.when("A","jQuery").register("pantryEnhancementMetrics",function(a,d){return{registerCounters:function(){var a=d("#pantry-store-message");a.length&&a.bind("click",function(a){if(a=k.ue){var d=a.count("pantryStoreMessageClick")||
0;a.count("pantryStoreMessageClick",d+1)}})}}});"use strict";m.when("A","jQuery","dualDimMetrics","atf").execute("dualdimInfo-metrics",function(a,d,e){d(".dualDim-Swatch").length&&e.registerCounters()});m.when("A","jQuery","atf").register("dualDimMetrics",function(a,d){function e(a){var d=k.ue;if(d){var e=d.count(a)||0;d.count(a,e+1)}}return{registerCounters:function(){var a=d(".vodd-dim-wrapper").length,f=d(".twisterShelf_container").length,h=d(".twisterCounter_container").length;e("DualDimCount");
1===a&&1===f+h?(e("DualDimOneVoddCount"),1===f?e("DualDimVoddShelfCount"):1===h&&e("DualDimVoddCounterCount")):2===a?e("DualDim2VoddCount"):2===f?e("DualDimShelfCount"):2===h?e("DualDimCounterCount"):2===f+h&&e("DualDimShelfCounterCount")}}});m.when("A","action-panel","ready").register("aposWithBB",function(a,d){var e={mode:"onetime"},g={mode:"sns"},f={mode:"sampling"};return{init:function(){a.on("a:accordion:buybox-accordion:onetime-accordion:select",function(a){d.setPanelState(e)});a.on("a:accordion:buybox-accordion:sns-accordion:select",
function(a){d.setPanelState(g)});a.on("a:accordion:buybox-accordion:sampling-accordion:select",function(a){d.setPanelState(f)})}}});m.when("A","jQuery","ready","atf").execute(function(a,d){m.register("stickybuybox",function(){function e(){a.off("scroll",c);f();l=!1}function g(){var f=d("#csxfsSelectSampleButton"),g=d("input:radio[name\x3dtoggleBuyBox]");y.click(e);a.declarative("single-sample-widget-open-secondary-panel","click",e);f.click(e);g.change(function(){setTimeout(h,200)});d(k).resize(b);
a.on("TwisterShelfExpanded",h);a.on("TwisterShelfCollapsed",h);a.on("TwisterCounterExpanded",h);a.on("TwisterCounterCollapsed",h);a.on.scroll(c)}function f(){w.removeClass("stickybuybox");p.removeClass("stickybuybox");q.removeClass("stickybuybox")}function h(){f();v=r.offset();m=y.offset();z=x.offset();c()}function c(){var a=d(k).scrollTop(),b=d(k).scrollLeft(),c=t+a-38,e=n.offset().left,a=m?c-m.top:0,f=v?c-v.top:0,c=z?c-z.top:0;l&&(b=e-b,v&&0>f?(w.addClass("stickybuybox"),w.css({left:b+"px"})):(w.removeClass("stickybuybox"),
m&&!v&&0>a?(p.addClass("stickybuybox"),p.css({left:b+"px"})):(p.removeClass("stickybuybox"),z&&0>c?(q.addClass("stickybuybox"),q.css({left:b+"px"})):q.removeClass("stickybuybox"))))}function b(){t=d(k).height();c()}var m,v,z,t,r,y,x,l=!0,n=d("#actionPanel"),w,p,q;return{init:function(){r=d(".a-button-oneclick");y=d("#submit\\.add-to-cart").not(".a-button-preorder");x=d("#rcx-subscribe-submit-button");w=r.parent();p=y.parent();q=x.parent();t=d(k).height();h();g()}}})})});
/* ******** */
(function(g){var d=window.AmazonUIPageJS||window.P,r=d._namespace||d.attributeErrors,a=r?r("FreshDetailPageCommonAssets",""):d;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,d,r){g.when("A","jQuery","a-modal","afx-dp-uatc-proxy","afx-update-cart-count","a-dropdown","fresh-dp-double-click","afx-dp-csm-metrics-utils","fresh-show-atc-changeover","fresh-dp-quantity","afx-utils","ready").register("fresh-atc-handler",function(a,f,n,c,d,q,m,b,h,u,e){var p;g.when("EWC").execute(function(b){p=
b});g.when("nav.getFlyout").execute(function(b){b("ewc")});var F={"itemPrice:priceUnavailable:1":"PRICE_UNAVAILABLE","itemDeleted:itemCountOverflow:6":"QUANTITY_OVERFLOW"};return{addToFreshCart:function(q){function l(b,a,f,e){w(b);q.error(b,a,f,e)}function w(e,c){c=c||{};var d=e.data.sessionID;c.title=D(e.data.title);c.asin=e.data.asin;c.offerListingID=e.data.offerListingID;c.sessionID=d;switch(c.reasonCode?c.reasonCode:r){case t.itemNotAvailable:b.increment(k.freshUATCItemNotAvailableErrorCountMetric);
break;case t.itemPartiallyAvailable:b.increment(k.freshUATCItemPartiallyAvailableErrorCountMetric);break;case t.itemPartiallyAvailableForReservation:b.increment(k.freshUATCItemPartiallyAvailableForReservationErrorCountMetric);break;case t.itemNotAvailableForReservation:b.increment(k.freshUATCItemNotAvailableForReservationErrorCountMetric);break;case t.itemPriceUnavailable:b.increment(k.freshUATCItemPriceUnavailableErrorCountMetric);break;case t.itemCountOverflow:b.increment(k.freshUATCItemCountOverflowErrorCountMetric);
break;default:b.increment(k.freshUATCEmptyItemStatusCodeErrorCountMetric),g.log("fresh-atc-handler: No error status code.","ERROR")}c=f.param(c);n.create(e.$currentTarget,{name:"fresh-add-to-cart-modal",sessionID:d,url:"/afx/cart/reservation_conflict?"+c}).show();a.on("a:popover:afterHide:fresh-add-to-cart-modal",function(b){E(d);n.remove(b.popover)})}function D(b){var a={"\x26amp;":"\x26"},e;for(e in a)a.hasOwnProperty(e)&&(b=b.replace(e,a[e]));return b}function C(b){return b.filter(function(b){return b.statusKey in
F})}function x(b,a,e){e+=" returned by UATC is not an array";g.log(e,"Error",a);l(b,"","",e)}function y(e,f,d){d||(d=function(){});try{var n=e.data.asin;if(n)if(e.data.title){var h=e.data.offerListingID;if(h){var q=e.data.sessionID;if(q){var m=u.val();m||(g.log('fresh-atc-handler: "quantity" action parameter is missing.',"ERROR"),m=1);b.setWidgetClickTimestamp(k.freshUATCTCallScope);c({asin:n,offerListingID:h,sessionID:q,quantity:m,reftag:"afx-dp-addtocart",success:function(c){try{b.sendWidgetMetrics(k.freshUATCTCallScope);
var n;if(c&&c.isOK){var h=c.extraErrorInfos;if(h&&h.constructor===Array&&0<h.length)n=!0;else{var u=c.statusList,z;if(u&&u.constructor===Array&&0<u.length){var A=C(u);z=A&&0<A.length}else z=!1;n=z?!0:!1}}else n=!0;if(n)if(b.increment(k.freshUATCInvalidErrorResponseCountMetric),c)if(c.isOK){var t=c.extraErrorInfos,p=c.statusList;if(t&&t.constructor!==Array)x(e,t,"extraErrorInfos");else if(0<t.length){if(t&&!(0>=t.length)){var v=t[0];"ADDRESS_NOT_SELECTED"===v.statusCode?(b.increment(k.freshUATCAddressNotSelectedErrorCountMetric),
g.log("fresh-atc-handler: Address is not selected.","INFO")):w(e,{reasonCode:v.itemStatusCode,quantityAdded:v.availableQuantity,quantityRequested:v.requestedQuantity})}}else if(p&&p.constructor!==Array)x(e,p,"statusList");else if(0<p.length&&p&&!(0>=p.length)){var r=C(p);r&&0<r.length&&w(e,{reasonCode:F[r[0].statusKey]})}}else b.increment(k.freshUATCFailureCountMetric),l(e,"","","isOK returned by UATC is false");else b.increment(k.freshUATCFailureCountMetric),l(e,"","","No response from UATC");else b.increment(k.freshUATCSuccessCountMetric),
f(c,q,m)}catch(y){b.increment(k.freshAddToCartExceptionCountMetric),g.log("fresh-atc-handler exception: "+y,"ERROR")}finally{a.delay(d,B.reEnableDelay)}},error:function(c,f,n){try{b.sendWidgetMetrics(k.freshUATCTCallScope),b.increment(k.freshUATCFailureCountMetric),l(e,c,f,n)}catch(h){b.increment(k.freshAddToCartExceptionCountMetric),g.log("fresh-atc-handler exception: "+h,"ERROR")}finally{a.delay(d,B.reEnableDelay)}}})}else g.log('fresh-atc-handler: Required "sessionID" action parameter is missing.',
"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),l(e)}else g.log('fresh-atc-handler: Required "offerListingID" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),l(e)}else g.log('fresh-atc-handler: Required "title" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),l(e);else g.log('fresh-atc-handler: Required "asin" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),
l(e)}catch(z){b.increment(k.freshAddToCartExceptionCountMetric),g.log("fresh-atc-handler exception: "+z,"ERROR"),a.delay(d,B.reEnableDelay)}}function E(b){p&&"function"===typeof p.refresh?p.refresh():d(b)}var B={reEnableDelay:1E3},k={freshAddToCartClickCountMetric:"freshAddToCartClickCount",freshAddToCartMissingParameterCountMetric:"freshAddToCartMissingParameterCount",freshAddToCartExceptionCountMetric:"freshAddToCartExceptionCount",freshUATCTCallScope:"freshUATCCall",freshUATCSuccessCountMetric:"freshUATCSuccessCount",
freshUATCFailureCountMetric:"freshUATCFailureCount",freshUATCInvalidErrorResponseCountMetric:"freshUATCInvalidErrorResponseCount",freshUATCAddressNotSelectedErrorCountMetric:"freshUATCAddressNotSelectedErrorCount",freshUATCItemPartiallyAvailableErrorCountMetric:"freshUATCItemPartiallyAvailableErrorCount",freshUATCItemPartiallyAvailableForReservationErrorCountMetric:"freshUATCItemPartiallyAvailableForReservationErrorCount",freshUATCItemNotAvailableErrorCountMetric:"freshUATCItemNotAvailableErrorCount",
freshUATCItemNotAvailableForReservationErrorCountMetric:"freshUATCItemNotAvailableForReservationErrorCount",freshUATCEmptyItemStatusCodeErrorCountMetric:"freshUATCEmptyItemStatusCodeErrorCount",freshUATCItemPriceUnavailableErrorCountMetric:"freshUATCItemPriceUnavailableErrorCount",freshUATCItemCountOverflowErrorCountMetric:"freshUATCItemCountOverflowErrorCount"},t={itemNotAvailable:"ITEM_NOT_AVAILABLE",itemPartiallyAvailable:"ITEM_PARTIALLY_AVAILABLE",itemPartiallyAvailableForReservation:"ITEM_PARTIALLY_AVAILABLE_FOR_RESERVATION",
itemNotAvailableForReservation:"ITEM_NOT_AVAILABLE_FOR_RESERVATION",itemPriceUnavailable:"PRICE_UNAVAILABLE",itemCountOverflow:"QUANTITY_OVERFLOW"},z=function(b,e,a){h(a);E(e);q.success(b)};a.declarative("fresh-atc-handler","click",m(function(a,c){u.valid()?(e.vibrate(),b.increment(k.freshAddToCartClickCountMetric),y(a,z,c)):c()}))}}});"use strict";g.when("A","jQuery","a-button","fresh-show-atl-changeover","ready").register("FreshAddToShoppingList",function(a,f,d,c){function A(b){f("#"+b.asin+"-afx-atl-dropdown").change(function(a){b.$alreadyInMessage.addClass("aok-hidden");
b.$errorMessage.addClass("aok-hidden")})}function q(b){var f=(a.state("baseWidgetState")||{}).csrfToken;a.post("/afx/lists/json/shoppinglists/additem",{cache:!1,timeout:5E3,params:{asin:b.asin,listID:b.shoppingListID,token:f},success:function(a){b.addButtonInstance.enable();a.successful?(b.$modalParent.find("#"+b.cancelButtonID).click(),c()):1===a.errorCodes[0]?b.$alreadyInMessage.removeClass("aok-hidden"):m(b)},error:function(){b.addButtonInstance.enable();m(b)}})}function m(b){b.$errorMessage.removeClass("aok-hidden");
g.log("Failed to add asin "+b.asin+" to shopping list "+b.shoppingListID,"ERROR")}a.declarative("add-to-list","click",function(b){var a=b.$currentTarget.closest(".a-popover-wrapper");if(1>a.length)g.log("Could not find the element that parents this modal (it should contain class a-popover wrapper)","FATAL");else{var c=a.find("#"+b.data.addButtonID),e;1>c.length?(g.log("Could not find the button that will add the item. This is required for preventing double clicks","ERROR"),e=!1):b.data.asin?e=!0:
(g.log("ASIN was blank. Please supply the ASIN you wish to add to the list.","ERROR"),e=!1);e&&(c=d(c),c.isEnabled()&&(c.disable(),b={asin:b.data.asin,addButtonInstance:c,$modalParent:a,cancelButtonID:b.data.cancelButtonID,shoppingListID:a.find("#"+b.data.asin+"-afx-atl-dropdown").val(),$alreadyInMessage:a.find("#afx-atl-already-in"),$errorMessage:a.find("#afx-atl-service-error")},b.$alreadyInMessage.addClass("aok-hidden"),b.$errorMessage.addClass("aok-hidden"),A(b),q(b)))}})});"use strict";g.when("A",
"jQuery","fresh-add-to-cart","fresh-dp-quantity","fresh-show-atc-changeover").execute(function(a,f,d,c,A){d.addToFreshCart({success:function(a,c){A(a.data.renderableSellingQuantity?a.data.renderableSellingQuantity:a.data.quantity);a=c.couponClipStatus;if("CLIP_SUCCESSFUL"===a||"ALREADY_CLIPPED"===a)f("#unclippedCoupon").hide(),f("#clippedCoupon").show()},error:function(a,c,b,f){}});c.init();a.on("a:pageUpdate",function(){c.init();d.updateQuantity("freshAddToCartButton",c.val())});d.updateQuantity("freshAddToCartButton",
c.val());a.declarative("freshDetailPageQuantityUpdate","change",function(a){d.updateQuantity("freshAddToCartButton",c.val())});g.when("fresh-atfc-hook").execute(function(a){a.callback()})});g.when("A","jQuery","a-dropdown","fresh-dp-constants","fresh-add-to-cart","a-button").register("fresh-dp-quantity",function(a,f,d,c,g,q){return function(){var m,b,h,u,e,p,r,v,l,w,D,C,x,y=function(){if(!m){b=f(c.addToCartButtonSelector);e=d.getSelect(c.dropdownID);if(h=!!e){u=f(c.dropdownDivSelector);var a=e.getOptions().size();
a&&(r=a-1)}v=f(c.freeTextDivSelector);if(p=0!==v.length)l=f(c.freeTextInputSelector),w=f(c.freeTextErrorDivsSelector),D=f(c.freeTextErrorMsgMin),C=f(c.freeTextErrorMsgMax)}},E=function(){a.on(c.dropdownSelectedID,function(a){f(a.nativeItemNode).index()===r?(l.attr("validValue",x),l.val(x),v.show(),w.hide(),u.hide(),l.focus().select(),e.val("1")):x=e.val()});var d=function(){var a=l.attr("validValue");a&&(e.val(a),e.val()===a?(x=a,u.show(),v.hide()):(g.updateQuantity("freshAddToCartButton",a),b.focus()))},
n=function(){var a=B(l.val());l.attr("validValue",a?a:"")};l.change(n);l.keyup(n);l.keypress(function(a){if(0===a.which||8===a.which||a.ctrlKey||a.altKey||c.rxNumbersOnly.test(String.fromCharCode(a.which)))return!0;13===a.which&&(d(),b.click());return!1});l.blur(d)},B=function(){var a;a:{a=l.val();if(c.rxNumbersOnly.test(a)&&(a=parseInt(a,10),!isNaN(a)))break a;a=!1}w.hide();var b=q(c.addToCartButtonSelector);if(!1===a||0>=a)D.show(),b.isEnabled()&&b.disable();else if(1E3<=a)C.show();else return b.isEnabled()||
b.enable(),String(a);return!1};return{init:function(){m=!1;y();m=!0;if(p){v.hide().removeClass(c.auiHiddenClass);w.hide().removeClass(c.auiHiddenClass);var a=e.getOption(r),b=a.info()[0].text;a.update({value:"0",text:f.trim(b)+"+"});x=e.val();E()}},valid:function(){y();return p&&v.is(":visible")?!1!==B():!0},val:function(){y();return p&&v.is(":visible")?l.attr("validValue"):h?e.val():1}}}()});g.register("fresh-dp-constants",function(){return{actionPanelStateData:"apstate",actionPanelFreshState:"fresh",
mobileNavSearchFormSelector:'#nav-search-form, form[role\x3d"search"], #searchForm',rxNumbersOnly:/^\d+$/,auiHiddenClass:"aok-hidden",addToCartButtonSelector:"#freshAddToCartButton",dropdownID:"freshQuantity",dropdownSelectedID:"a:dropdown:selected:freshQuantity",dropdownDivSelector:"#quantitySelect",freeTextDivSelector:"#quantityText",freeTextInputSelector:"#quantityTextInput",freeTextErrorDivsSelector:"#quantityTextErrors \x3e div",freeTextErrorMsgMin:"#quantityFreeTextErrorMsgMin",freeTextErrorMsgMax:"#quantityFreeTextErrorMsgMax"}});
g.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,f){a.on("a:expander:ingredients-expander:toggle:expand",function(a){f.increment("almIngredientsExpand")});a.on("a:expander:ingredients-expander:toggle:collapse",function(a){f.increment("almIngredientsCollapse")})});g.when("A","ready").register("fresh-dp-prevent-atc-default",function(a){return{init:function(){a.$("#addToFreshCart").submit(function(a){a.preventDefault()})}}});"use strict";g.when("A","jQuery","a-button","ready").register("fresh-multiselleroffers-pagination-handler",
function(a,f,d){function c(a){var e=parseInt(m.attr("data-currentPage"),10),c=parseInt(m.attr("data-pageCount"),10),e="next"===a?e+1:e-1;m.attr("data-currentPage",e);0===e?b.disable():b.enable();e===c-1?h.disable():h.enable();f(".freshMultiSellerOffer").addClass("hidden");f('.freshMultiSellerOffer[data-page\x3d"'+e+'"]').removeClass("hidden")}var g=f("#freshMultiSellerOffersPreviousPage"),q=f("#freshMultiSellerOffersNextPage"),m=f("#freshMultiSellerOffersPagination"),b=d(g),h=d(q);a.declarative.create(g,
"fresh-multiselleroffers-previous-page",{});a.declarative.create(q,"fresh-multiselleroffers-next-page",{});a.declarative("fresh-multiselleroffers-previous-page","click",function(a){b.isEnabled()&&c("previous")});a.declarative("fresh-multiselleroffers-next-page","click",function(a){h.isEnabled()&&c("next")})});"use strict";g.when("A").register("afx-dp-uatc-proxy",function(a){return function(f){var d="/gp/add-to-cart/json";f.reftag!==r&&(d+="/ref\x3d"+f.reftag);a.post(d,{timeout:5E3,params:{"session-id":f.sessionID,
clientName:"SharedFreshHandler",nextPage:"cartitems",ASIN:f.asin,offerListingID:f.offerListingID,useUber:"1",source:"Fresh",ruleSet:"FreshGet",quantity:f.quantity},success:f.success,error:f.error})}});"use strict";g.when("A").register("afx-dp-get-cart-count",function(a){return function(f){a.get("/gp/api/cart/1.0/get-cart-count.json",{timeout:5E3,params:{sessionID:f.sessionID,clientName:"sharedFreshHandler"},success:f.success,error:f.error})}});"use strict";g.when("A").register("afx-dp-get-cart-item-count",
function(a){return function(a,d){if(d&&d.items){var c;for(c=0;c<d.items.length;++c){var g=d.items[c];if(g&&g.ASIN===a)return g.quantity}}}});"use strict";g.register("afx-dp-csm-metrics-utils",function(){return{setWidgetClickTimestamp:function(a){d.ue&&d.uet&&a&&d.uet("bb",a,{wb:1})},setWidgetTimestamp:function(a,f){d.ue&&d.uet&&a&&f&&d.uet(a,f,{wb:1})},increment:function(a){d.ue&&d.ue.count&&a&&d.ue.count(a,(d.ue.count(a)||0)+1)},setCount:function(a,f){d.ue&&d.ue.count&&a&&f&&d.ue.count(a,f)},sendWidgetMetrics:function(a){d.ue&&
d.uex&&a&&d.uex("ld",a,{wb:1})}}});"use strict";g.when("A","jQuery","a-button","ready").register("fresh-dp-double-click",function(a,d,g){return function(c){var d={disabled:"true"},f={};return function(g){var b=a.state("fresh-atc-status");b&&b.disabled||(b&&a.state("fresh-atc-status",d),c(g,function(){(b=a.state("fresh-atc-status"))&&a.state.replace("fresh-atc-status",f)}))}}});"use strict";g.register("afx-utils",function(){return{isFunction:function(a){return"function"===typeof a},isDefined:function(a){return"undefined"!==
typeof a},vibrate:function(){return d.amazon&&d.amazon.cordova&&d.amazon.cordova.notification&&d.amazon.cordova.notification.vibrate&&d.amazon.cordova.notification.vibrate(50)}}});"use strict";g.when("A","jQuery","fresh-show-atl-changeover","afx-dp-csm-metrics-utils","ready").register("FreshAddToAlexaLists",function(a,f,n,c){function r(a){c.increment(h.countAddToAlexaList);c.setWidgetClickTimestamp(h.addToAlexaListCallTime);q(a);f.ajax({url:a.data.url,type:"POST",contentType:"application/json",Accept:"application/json",
timeout:5E3,dataType:"json",data:JSON.stringify({value:b(a)}),headers:{"x-amzn-as-metadata":"{}"},success:function(b){c.sendWidgetMetrics(h.addToAlexaListCallTime);c.increment(h.addToAlexaListCallSuccess);n();m(a)},error:function(b,f,n){c.sendWidgetMetrics(h.addToAlexaListCallTime);c.increment(h.addToAlexaListCallFail);g.log("Error response: "+b.responseText,"ERROR");b.status===u?a&&a.data&&a.data.signInURL&&(d.location=a.data.signInURL):g.log("Failed to add item to shopping list "+a.data.title+", url : "+
a.data.url,"ERROR");m(a)}})}function q(a){a.$currentTarget.find(".afx-dp-add-to-alexa-list-link").addClass("aok-hidden");a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-spinner").removeClass("aok-hidden")}function m(a){a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-spinner").addClass("aok-hidden");a.$currentTarget.find(".afx-dp-add-to-alexa-list-link").removeClass("aok-hidden")}function b(a){a=a.data.title;return a.substring(0,Math.max(a.length,256))}a.declarative("add-to-alexa-lists",
"click",function(a){m(a);r(a)});var h={countAddToAlexaList:"countAddToAlexaList",addToAlexaListCallTime:"addToAlexaListCallTime",addToAlexaListCallSuccess:"addToAlexaListCallSuccess",addToAlexaListCallFail:"addToAlexaListCallFail"},u=401})});
/* ******** */
(function(l){var p=window.AmazonUIPageJS||window.P,B=p._namespace||p.attributeErrors,b=B?B("DetailPageAlohaAssets",""):p;b.guardFatal?b.guardFatal(l)(b,window):b.execute(function(){l(b,window)})})(function(l,p,B){l.when("A","a-modal","a-checkbox","aloha-simplebundle-common","ready").execute(function(b,p,l,k){function y(){b.declarative("show-review-tab","click",function(g){b.$(g.$target).closest(a.AUI_PAGE_ROOT).find(".popoverReviewsTab").click()});b.declarative("add-to-cart","click",function(g){b.$(a.SB_ROOT+
" "+a.SB_BUYBOX_ITEM_CHECKBOX+" "+a.INPUT_TYPE_CHECKBOX).filter(function(){return b.$(this).data("asin")===g.data.asin}).prop("checked",!0).change();b.$("[id^\x3dpopover-simpleBundle-]").each(function(){var a=p.get(b.$(this));a.isActive()&&a.hide()})});b.declarative("focus-image","mouseenter",function(b){var f=b.$target,k=f.parents(a.AUI_PAGE_ROOT);b=b.data;k.find("#productImageMain-"+b.asin).attr("src",b.imageUrl);k.find(".thumbnail-group").removeClass("a-button-selected");k.find("#"+f.prop("name")).addClass("a-button-selected")})}
var a={BUYBOX_ACCORDION:"#buyBoxAccordion",ADD_TO_CART_FORM:"#addToCart",ADD_TO_CART_ATTACH_BUTTON:"#add-to-cart-button.attach-dss-atc:button",SESSION_ID:"#session-id",OFFER_LISTING_ID:"#offerListingID",AUI_MODAL_SCROLLER:".a-modal-scroller",AUI_PAGE_ROOT:"#a-page",INPUT_TYPE_CHECKBOX:"input[type\x3d'checkbox']",BASE_PRODUCT_PRICE:"#base-product-price",BASE_PRODUCT_PRICE_DATA:"base-product-price",SB_ROOT:".showBundleAsins.simpleBundleFeatureContainer",SB_EXPANDED_MODAL_EXPANDER_HEADER_PREFIX:".simple-bundle-item-expand-header-",
SB_EXPANDED_MODAL_EXPANDER_CONTENT_PREFIX:".simple-bundle-item-expander-content-",SB_EXPANDED_MODAL_LINK:".simple-bundle-buybox-expanded-modal-link",SB_EXPANDED_MODAL_ITEM_LINK_PREFIX:".simple-bundle-item-link-",SB_ACCESSORY_ITEM_LINK_PREFIX:".popover-simpleBundle-link-",SB_BUYBOX_ITEM_CHECKBOX:".simple-bundle-buybox-item-checkbox",SB_BUYBOX_CHECKBOX_PREFIX:".simple-bundle-item-",SB_EXPANDED_CHECKBOX_PREFIX:".simple-bundle-modal-item-",SB_EXPANDER_TITLE:".aloha-simple-bundle-expand-header-title"},
f=!1,n=b.debounce(function(){var g=b.$(a.SB_ROOT);if(g.length){var h=b.$(a.ADD_TO_CART_FORM),n=h.find(":submit").length&&h.find(a.OFFER_LISTING_ID).val(),p=b.$(a.ADD_TO_CART_ATTACH_BUTTON),l=p.length;if(n||l){y();var q=k.getSimpleBundlePageState()||{},x=q.expandedBuyboxEnabled,H=q.selectionMode||"SINGLE",c=q.items||[],A=[],t=b.$(a.SESSION_ID).val(),F=g.find(a.SB_EXPANDED_MODAL_LINK),m,e={baseAsin:q.baseAsin,marketplaceId:q.marketPlaceId,baseItemPrice:b.$(a.BASE_PRODUCT_PRICE).data(a.BASE_PRODUCT_PRICE_DATA),
clientType:"aloha-simplebundle-desktop",currencyOfPreferenceSupported:q.currencyOfPreferenceSupported||!1},u=k.createMetricsLogger(e);f||(f=!0,b.defer(function(){u.logNexusImpression(c);u.logImpressionRefTag()}));F.click(function(b){b.originalEvent&&u.logExpandedLink()});c.forEach(function(e,d){function c(){var e=!1;h.click(function(){e=!e});g.find(a.SB_EXPANDED_MODAL_ITEM_LINK_PREFIX+d).click(function(){e||h.click();F.click();m=m||b.$(a.AUI_MODAL_SCROLLER);m.scrollTop(h.offset().top-m.offset().top+
m.scrollTop())})}function f(){var c=g.find(a.SB_EXPANDED_MODAL_EXPANDER_CONTENT_PREFIX+d),I="/gp/product/features/aloha-ppd/udp-ajax-handler/minidp.html?asin\x3d"+e.asin+"\x26marketplaceId\x3d"+q.marketPlaceId+"\x26offerId\x3d"+e.offerListingId+"\x26activeTab\x3d0",m="a:expander:simple-bundle-item-expander-"+d+":toggle",x=b.once(function(){c.load(I,null,function(e,a,d){b.$.trim(c.html())?(c.find(".a-span-last \x3e .a-spacing-top-base").remove(),c.find(".popover-add-to-cart-button").remove(),e=c.find("#a-page \x3e div \x3e div.a-row"),
a=c.find(".popover-in-stock"),a.remove(),a.addClass("aloha-simple-bundle-modal-detailed-info-header-row-text"),e.append(a),a=c.find(".popover-ship-sold-by"),a.remove(),a.addClass("aloha-simple-bundle-modal-detailed-info-header-row-text"),e.append(a),a=c.find(".popover-retail-domain"),a.remove(),e.append(a),e=c.find("#a-page \x3e div \x3e div.a-column.a-span9"),e.removeClass("a-span9"),e.addClass("a-span12")):c.text(q.ajaxFailMsg)})}),w=m+":expand";b.off(w);b.on(w,function(e){u.logItemLink(d);h.find(a.SB_EXPANDER_TITLE).removeClass("aloha-simple-bundle-expand-header-title-truncate");
b.$.trim(c.html())||x()});m+=":collapse";b.off(m);b.on(m,function(e){h.find(a.SB_EXPANDER_TITLE).addClass("aloha-simple-bundle-expand-header-title-truncate")})}var h=g.find(a.SB_EXPANDED_MODAL_EXPANDER_HEADER_PREFIX+d);if(x)c(),f();else{var n=g.find(a.SB_ACCESSORY_ITEM_LINK_PREFIX+d);n.unbind("click.MiniDpClickHandler");n.bind("click.MiniDpClickHandler",function(){u.logItemLink(d);u.logNexusOpenMiniDP(d,e);u.logMiniDPRefTag(d)})}k.setupCheckboxes(A,d,x,e.asin,q.maxBuyboxItemsDesktop,a.SB_BUYBOX_CHECKBOX_PREFIX+
d+" "+a.INPUT_TYPE_CHECKBOX,a.SB_EXPANDED_CHECKBOX_PREFIX+d+" "+a.INPUT_TYPE_CHECKBOX,a.SB_BUYBOX_CHECKBOX_PREFIX+d,a.SB_EXPANDED_CHECKBOX_PREFIX+d,H)});e=b.$(a.BUYBOX_ACCORDION);e.length?e.children().each(function(){h=b.$(this).find(a.ADD_TO_CART_FORM);var e=h.find(a.ADD_TO_CART_ATTACH_BUTTON),d=e.length,q=h.find(a.SB_ROOT).length,m=h.find(":submit").length&&h.find(a.OFFER_LISTING_ID).val();q&&m&&k.setupAddToCart(h,A,c,u,t,x);d&&k.setupAddToCartForButton(e,A,c,u,t,x,h)}):(n&&k.setupAddToCart(h,A,
c,u,t,x),l&&k.setupAddToCartForButton(p,A,c,u,t,x,h))}else g.hide()}},200);n();b.on("a:pageUpdate",n);b.on("attach:dss:initialized",function(){b.off("a:pageUpdate",n);n()})});"use strict";l.when("A","a-checkbox","aloha-uatc","aloha-buy-now-integration","aloha-buybox-form-util").register("aloha-simplebundle-common",function(b,v,D,k,y){function a(a,f){var h=b.$(a);h.change(function(){h.prop("checked",this.checked)});var c=b.$(f);c.length||(c=h);return{$element:h,$container:c,api:v(a),show:function(){c.hasClass(z.AUI_HIDDEN)&&
c.removeClass(z.AUI_HIDDEN);c.show()},hide:function(){c.hasClass(z.AUI_HIDDEN)||c.addClass(z.AUI_HIDDEN)},isVisible:function(){return!c.hasClass(z.AUI_HIDDEN)}}}function f(a,b,h){b.forEach(function(b){a.addItem(b.asin,b.offerListingId,b.quantity);h.logCheckboxSelected(b.index,b.quantity);h.logAddToCartRefTag(b.index)})}function n(b,a,h){var c=[],f=[];a.forEach(function(a,g){var m=b[g];a.api.isChecked()?c.push({asin:m.asin,offerListingId:m.offerListingId,ourPrice:m.ourPrice,ourPriceAmount:m.ourPriceAmount,
ourPriceSymbol:m.ourPriceSymbol,ourPriceCode:m.ourPriceCode,index:g,quantity:h}):f.push({asin:m.asin,ourPrice:m.ourPrice,ourPriceAmount:m.ourPriceAmount,ourPriceSymbol:m.ourPriceSymbol,ourPriceCode:m.ourPriceCode,index:g,isVisible:a.isVisible()})});return{selectedLineItems:c,unselectedItems:f}}var g=/[^\d,\.]/g,h=/,/g,E=/\./g,G=/(^\D+|\D+$)/,z={AUI_HIDDEN:"aok-hidden"};return{createMetricsLogger:function(a){function f(a,b){p.ue&&p.ue.count&&p.ue.count("aloha-simplebundle-"+a,b)}function n(){var e;
e=a.currencyOfPreferenceSupported?{priceFormatted:a.baseItemPrice,priceDecimal:null,currencySymbol:null}:l(a.baseItemPrice);return{baseAsin:a.baseAsin,baseItemPrice:e.priceFormatted,baseItemCurrencySymbol:e.currencySymbol,baseItemPriceDecimal:e.priceDecimal,clientType:a.clientType,feature:"abb"}}function c(e,b){p.ue&&p.ue.event&&(e.requestId=m,e.producerId="atch",e.obfuscatedMarketplaceId=a.marketplaceId,p.ue.event(e,"atch",b,{ssd:!0}))}function k(a){b.ajax("/gp/product/ajax-handlers/reftag.html?ref_\x3d"+
a,{method:"get"})}function t(b){return a.currencyOfPreferenceSupported?{priceFormatted:b.ourPrice,priceDecimal:parseFloat(b.ourPriceAmount)||null,currencySymbol:b.ourPriceSymbol}:l(b.ourPrice)}function l(a){a=a||"";var b=a.lastIndexOf(","),c=a.lastIndexOf("."),d;b>c?(c=E,d=h):(c=h,d=E);(b=a.match(G))&&(b=b[0].trim());c=a.replace(g,"").replace(c,"").replace(d,".");c=parseFloat(c);return{priceFormatted:a,currencySymbol:b,priceDecimal:c}}var m=Date.now().toString(10)+Math.random().toString(16).substring(2,
13);b.defer(function(){f("view",1)});return{logAddToCart:function(a){f("addtocart",a)},logExpandedLink:function(){f("buybox-expanded-link",1)},logCheckboxSelected:function(a,b){f("checkbox-"+(a+1),b)},logItemLink:function(a){f("link-"+(a+1),1)},logImpressionRefTag:function(){k("dp_atch_abb_i")},logAddToCartRefTag:function(a){k("dp_atch_abb_atc_"+(a+1))},logMiniDPRefTag:function(a){k("dp_atch_abb_smdp_"+(a+1))},logNexusImpression:function(a){var b=n();b.accessories=a.map(function(a,b){var c=t(a);return{asin:a.asin,
displayPosition:b+1,price:c.priceFormatted,currencySymbol:c.currencySymbol,priceDecimal:c.priceDecimal}});c(b,"attach.ABBImpression.5")},logNexusAddBaseToCart:function(a,b,f){var d=n();d.baseQuantity=Number(f);d.accessoriesAdded=a.map(function(a){var b=t(a);return{asin:a.asin,displayPosition:a.index+1,quantity:Number(a.quantity),price:b.priceFormatted,currencySymbol:b.currencySymbol,priceDecimal:b.priceDecimal}});d.accessoriesNotAdded=b.map(function(a){var b=t(a);return{asin:a.asin,displayPosition:a.index+
1,price:b.priceFormatted,currencySymbol:b.currencySymbol,priceDecimal:b.priceDecimal}});c(d,"attach.ABBAddBaseToCart.9")},logNexusOpenMiniDP:function(a,b){var f=t(b),d=n();d.accessoryAsin=b.asin;d.accessoryDisplayPosition=Number(a)+1;d.accessoryPrice=f.priceFormatted;d.accessoryItemCurrencySymbol=f.currencySymbol;d.accessoryItemPriceDecimal=f.priceDecimal;c(d,"attach.ABBShowMiniDP.4")}}},getSimpleBundlePageState:function(){var a=b.$(".simpleBundleJavascriptParameters").find("script").html();return b.parseJSON(a)},
getCheckboxCollectionObject:a,setupAddToCart:function(a,h,g,c,l,t){function v(a,r){if(m){var d=b.$(a.currentTarget);if(k.isBuyNow(d)){var q=t?1:e.find("*[name\x3d'quantity']").val()||1,w=n(g,h,q);k.checkoutWith(w.selectedLineItems,d)}else return}var C=D.createAddToCartRequest(l,function(){r()},function(){p.ueLogError&&p.ueLogError({message:"[There was an error while adding items to the cart using the universal add to cart api.]"},{logLevel:"ERROR",attribution:"SimpleBundle"});r()}),q=t?1:e.find("*[name\x3d'quantity']").val()||
1,w=n(g,h,q);f(C,w.selectedLineItems,c);d=w.unselectedItems.filter(function(a){return a.isVisible});c.logNexusAddBaseToCart(w.selectedLineItems,d,q);q=C.count();0!==q&&(d=b.$(a.currentTarget),k.isBuyNow(d)?k.checkoutWith(w.selectedLineItems,d):(m=!0,a.preventDefault(),c.logAddToCart(q),C.call()))}var m=!1,e=a;a.unbind("submit.SimpleBundleSubmitHandler");a.bind("submit.SimpleBundleSubmitHandler",function(a){var c=b.$(this);v(a,function(){c.submit()})});a.find(":submit").unbind("click.SBB");a.find(":submit").bind("click.SBB",
function(a){var c=b.$(this),d=c.closest(".a-accordion-row-container");d.length&&(e=d,v(a,function(){c.click()}))})},setupAddToCartForDeclarative:function(a,b,h,c,g,k,v){a.unbind("click.SimpleBundleClickHandler");a.bind("click.SimpleBundleClickHandler",function(a){a=D.createAddToCartRequest(g,function(){l.now("attach-external-atc-interceptor").execute(function(a){a&&q.selectedLineItems.forEach(function(b){a.updateAttachModule(b.asin)})})},function(){p.ueLogError&&p.ueLogError({message:"[There was an error while adding items to the cart using the universal add to cart api.]"},
{logLevel:"ERROR",attribution:"SimpleBundle"})});var e=k?1:v.find("*[name\x3d'quantity']").val()||1,q=n(h,b,e);f(a,q.selectedLineItems,c);var r=q.unselectedItems.filter(function(a){return a.isVisible});c.logNexusAddBaseToCart(q.selectedLineItems,r,e);if(e=a.count())c.logAddToCart(e),a.call()})},setupCheckboxes:function(b,f,h,c,g,k,n,m,e,l){var r=a(k,m);b.push(r);r.api.enable();r.$element.data("asin",c);if(h){var d=a(n,e);d.api.enable();d.api.check(r.api.isChecked());d.$element.change(function(){var a=
d.api.isChecked();r.api.check(a)});r.$element.change(function(){var a=r.api.isChecked();d.api.check(a);var c=0;b.forEach(function(a){c<g&&a.api.isChecked()?(c++,a.show()):a.hide()});c<g&&b.forEach(function(a){c<g&&a.api.isUnchecked()&&(c++,a.show())})})}else"SINGLE"===l&&r.$element.change(function(){r.api.isChecked()&&b.forEach(function(a,b){f!==b&&a.api.uncheck()})});0<b.length&&b[0].$element.change()},setupAddToCartForButton:function(a,f,h,c,g,k,p){function m(){var a=k?1:e.find("*[name\x3d'quantity']").val()||
1,b=n(h,f,a);y.addItems(p,b.selectedLineItems,c);var d=b.unselectedItems.filter(function(a){return a.isVisible});l.now("attach-external-atc-interceptor").execute(function(a){a&&b.selectedLineItems.forEach(function(b){a.updateAttachModule(b.asin)})});c.logNexusAddBaseToCart(b.selectedLineItems,d,a);c.logAddToCart(b.selectedLineItems.length)}var e=p;a.unbind("click.button.SBB");a.bind("click.button.SBB",function(){var a=b.$(this).closest(".a-accordion-row-container");a.length&&(e=a);m()})}}});"use strict";
l.when("A").register("aloha-uatc",function(b){function l(p,k,v,a,f){var n=0;f=f||5E3;a=a||v;var g={clientName:"AmazonWireless"};g.verificationSessionID=p;return{count:function(){return n},call:function(){n&&b.post("/gp/add-to-cart/json",{timeout:f,params:g,success:k,error:v,abort:a})},addItem:function(a,b,f){g["ASIN."+n]=a;g["offerListingID."+n]=b;g["quantity."+n]=f||1;n++}}}return{createAddToCartRequest:l,createSingleFinalCallbackAddToCartRequest:function(b,k){return l(b,k,k,k)}}});"use strict";
l.when("ready").register("aloha-buy-now-integration",function(){var b={};l.when("turbo-checkout-buy-now-integration").execute(function(l){b=l});return{isBuyNow:function(l){return"function"===typeof b.isBuyNow&&b.isBuyNow(l)},checkoutWith:function(l,p){return b.checkoutWith(l,p)}}});"use strict";l.when("A").register("aloha-buybox-form-util",function(b){function l(a){for(var b=2;0<a.find('input[name\x3d"asin.'+b+'"]').length||0<a.find('input[name\x3d"offeringID.'+b+'"]').length;)b++;return b}function p(a,
b){for(;0<a.find('input[name\x3d"asin.'+b+'"]').length||0<a.find('input[name\x3d"offeringID.'+b+'"]').length;)b++;return b}function k(a,f){return[b.$("\x3cinput /\x3e",{type:"hidden",name:"asin."+f,value:a.asin,class:"aloha-accessory-form-input"}),b.$("\x3cinput /\x3e",{type:"hidden",name:"offeringID."+f,value:a.offerListingId,class:"aloha-accessory-form-input"}),b.$("\x3cinput /\x3e",{type:"hidden",name:"quantity."+f,value:a.quantity||1,class:"aloha-accessory-form-input"})]}var y=[];b.on("aloha:detailPage:reappear",
function(){y=[];b.$(".aloha-accessory-form-input").remove()});return{addItems:function(a,b,n){var g=l(a);b.forEach(function(b){if(b!==B&&b.asin&&b.offerListingId){g=p(a,g);var f=k(b,g);f.forEach(function(b){a.append(b)});y.push(f);g++;n&&(n.logCheckboxSelected(b.index,b.quantity),n.logAddToCartRefTag(b.index))}});b=a.find('input[name\x3d"itemCount"]');0===b.length?a.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+g+'"\x3e'):b[0].value=g}}})});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,p=e._namespace||e.attributeErrors,b=p?p("PrivateLabelDesktopAssets",""):e;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,e,p){g.when("A","jQuery","twister-aui-page-state","ready").register("cross-sell-recommendations",function(b,h,C){function g(d){return h("#crossSellCheckbox"+d)}function e(){for(var d=0,b=0;b<q;b++)g(b).prop("checked")&&d++;h("#crossSellAddToCart").find("span.a-button-text").text(l["addToCartText"+
(d+1)]);h("#crossSellAddToList").find("span.a-button-text").text(l["addToWishlistText"+(d+1)]);h("#crossSellPriceLabel").text(l["priceText"+(d+1)]);d+=1;h("#crossSellForm").attr("action",r+d);d="";for(b=0;b<q;b++)d+=g(b).prop("checked")?"1":"0";d=parseInt(d,2);d=u[d];h("#crossSellPrice").html(d)}var v,l,q,u,r;return{init:function(){C.updatePageState();v=b.state("crossSellData");l=b.state("crossSellStrings");if(v&&l){q=v.numRecommendations;u=v.possibleSums;r=h("#crossSellForm").attr("action");for(var d=
0;d<q;d++)g(d).change(e);h("#crossSellPricePara").removeClass("a-hidden");e()}}}});g.when("A","atf","ready").execute(function(b){var h=b.$("#heroVideo");b=b.state("hero-video-state");h.length&&"undefined"!==b&&b.url&&h.attr("src",b.url)});"use strict";g.when("A","jQuery","imageBlockUtils","ImageBlockHeroUtils","postMetric").register("ImageBlockHeroVideoView",function(b,h,g,e,p){function v(a,b,d){if(!g.isjQueryObjDefined(a.find(".a-button-selected"))){var f=n.getCurrentItem(),y=0,t=b+y,k=e.getHeroImageHash(c,
f.color,y);-1!==k&&(t>=d&&(y=0,t=b),l(f.color)&&(x.dispatch("updateModel",{data:{index:y,thumbnailIndex:t,variant:k.variant,type:"hero-video"}}),b=a.find(".item").get(t),g.selectGivenThumbnail(h(b),a)))}}function l(a){null===c.heroVideo[a]&&a===c.landingAsinColor?a=c.heroVideo[c.defaultColor]:(a=c.heroVideo[a],a instanceof Array&&(a=a.length?a[0]:null));return a}function q(){if(c.repositionHeroImage){var a=e.getHeroDimParams(c,n.getCurrentItem());f.length&&g.isDefined(a)&&(a.xPos&&"undefined"!==typeof a.xPos&&
f.css({left:a.xPos+"px "}),f.css({top:a.yPos+"px","max-width":a.width+"px","min-height":a.height+"px",width:a.width+"px",height:a.height+"px"}))}}function u(){f.length&&f.hasClass("aok-hidden")&&0===n.getCurrentItem().thumbnailIndex&&f.removeClass("aok-hidden")}function r(){f.length&&!f.hasClass("aok-hidden")&&f.addClass("aok-hidden")}function d(a){f.length&&a&&(f.attr("poster",a.large),f.attr("src",a.url),f.get(0)&&(f.get(0).oncanplay=function(){u()}))}function B(a){if(a){var b;if(a.thumbUrl){b=
{thumb:a.thumbUrl,large:a.slateUrl,variant:a.variant,url:a.url};var c={};c[a.slateUrl]=[a.videoWidth,a.videoHeight];b.main=c}return b}}var z,c,n,x,A,w,f;return function(a,e,p,D){z=this;c=a;n=e;x=D;A=c.heroVideoVariant;c.heroImage[c.landingAsinColor]=c.heroImage[c.defaultColor];c.heroVideo[c.defaultColor]&&!Array.isArray(c.heroVideo[c.defaultColor])&&(a=B(c.heroVideo[c.defaultColor]),c.heroVideo[c.landingAsinColor]=a);z.render=function(a,t,k,e,q,r,p){w=e;h("#heroImage");f=h("#heroVideo");if(!l(a)){var m;
e=n.getCurrentItem();k=e.color;q=[];if(c.colorToVideo[k])for(r=c.colorToVideo[k],p=r.length-1;0<=p;p--){var u=r[p];A&&u.variant===A&&(q.push(u),r.splice(p,1))}q.length&&(m=B(q[0]));e="hero-video"===e.type||"hero-image"===e.type;m&&e&&(c.heroVideo[k]=m,d(l(k)),k=w.find(".heroImageThumbnail"),b.declarative.remove(k,"thumb-action"),m.type="hero-video",b.declarative.create(k,"thumb-action",m),m=n.getCurrentItem(),m={data:{index:m.index,thumbnailIndex:m.thumbnailIndex,variant:m.variant,type:"hero-video"}},
x.dispatch("updateModel",m),v(w,0,0,!1,!0),w.find(".a-button-selected").closest(".a-declarative").click())}m=t;if(k=l(a))e=k.thumb,c.heroImage&&c.heroImage[a].length&&(e=c.heroImage[a][0].thumb),a={type:"hero-video",index:0,thumbnailIndex:t,variant:k.variant},d(k),g.createThumbnail(a,e,w),t++,v(w,m,t);return t};z.update=function(a){if("mouseenter"===a.type)"ingress"===a.data.type?f.hasClass("aok-hidden")||(a.captured=!0):"hero-video"!==a.data.type&&r();else{var b;if(b="swatchHover"===a.type)a.data.color!==
n.getCurrentItem().color?b=!0:(b=l(n.getCurrentItem().color),b=f.length&&b&&f.attr("src")===b.url?!0:!1);b||r()}"swatchHover"===a.type?a.captured||("hero-video"!==n.getCurrentItem().type&&"hero-image"!==n.getCurrentItem().type?b=-1:l(a.data.color)?((a.data.color!==n.getCurrentItem().color||f.hasClass("aok-hidden"))&&d(l(a.data.color)),b=void 0):(r(),b=n.getCurrentItem(),x.dispatch("updateModel",{data:{index:b.index,thumbnailIndex:b.thumbnailIndex,variant:b.variant,type:"hero-image"}}),b=-1),-1!==
b&&(a.captured=!0)):"hero-video"===a.data.type&&(u(),"click"!==a.type&&c.usePeekHover||g.selectGivenThumbnail(a.$declarativeParent,w))};x.register("resize",q)}})});
/* ******** */
(function(d){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,a=h?h("DetailPageTwisterDPv2Assets",""):e;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,e,h){d.when("A","jQuery","a-popover","cf").register("burj-twister-utils",function(a,c,d){var f;return{getActivePopover:function(){f||(f=c("#twister").find("[id^\x3dvodd-button-]"));var a=null;f.length&&f.each(function(b,c){b=c.id.split("vodd-button-");if((b=d.get("vodd-popover-"+b[b.length-
1]))&&b.isActive())return a=b,!1});return a},getPageOffset:function(){var a,b;e.pageYOffset?(a=e.pageYOffset,b=e.pageXOffset):"CSS1Compat"===(document.compatMode||"")?(a=document.documentElement.scrollTop,b=document.documentElement.scrollLeft):(a=document.body.scrollTop,b=document.body.scrollLeft);return{top:a,left:b}}}});d.when("A","jQuery","a-popover","burj-twister-utils","cf").execute(function(a,c,d,f){function h(){a.on.scroll(function(){var a=f.getActivePopover();if(a){var b=k.get(0).getBoundingClientRect(),
c=a.$container.get(0).getBoundingClientRect();0>b.bottom&&0>c.bottom&&(a.attrs("originalFocus",null),a.hide())}})}function b(){var a=m.offset().top+m.height()-g.offset().top,b=g.height()-a;c("#twisterOverlay").css({height:b+"px",top:a+"px"})}function n(){var a=document.createElement("div");a.id="twisterOverlay";c(a).addClass("twister-overlay").css({width:g.outerWidth()}).bind("touchend click",function(a){return!1});g.append(a)}function p(a,d){b();g.addClass("twister-popover-visible");c("#twisterOverlay").show()}
function q(a,b){g.removeClass("twister-popover-visible");c("#twisterOverlay").hide()}var g=c("#actionPanel"),m=g.find("#twister_feature_div"),k=c(".burj #twister"),l;(function(){if(k.length&&(l=k.find("[id^\x3dvodd-button-]"),l.length)){n();var d=function(){f.getActivePopover()&&b()};a.on("a:pageUpdate",d);c(e).resize(d);l.bind("TwisterVODD.showPopup",p).bind("TwisterVODD.hidePopup",q);h()}})()})});
/* ******** */
(function(p){var m=window.AmazonUIPageJS||window.P,w=m._namespace||m.attributeErrors,e=w?w("VasUpsellWidgetAsset",""):m;e.guardFatal?e.guardFatal(p)(e,window):e.execute(function(){p(e,window)})})(function(p,m,w){p.when("A","ready").register("vas-metrics-publisher",function(e){var b=e.$,a=function(a,c){if(a&&32>=a.length){var d="?",g="";c&&(c.additionalRequestData&&(g+=d+"additionalRequestData\x3d"+JSON.stringify(c.additionalRequestData),d="\x26"),c.productAsin&&(g+=d+"pageAsin\x3d"+c.productAsin,
d="\x26"),c.upsellAsin&&(g+=d+"pageTypeId\x3d"+c.upsellAsin,d="\x26"),c.pageType&&(g+=d+"pageType\x3d"+c.pageType,d="\x26"),c.subPageType&&(g+=d+"subPageType\x3d"+c.subPageType,d="\x26"),g=c.hitType?g+(d+"hitType\x3d"+c.hitType):g+(d+"hitType\x3dpopUp"),d="\x26",c.merchantId&&(g+=d+"merchantId\x3d"+c.merchantId,d="\x26"),c.upsellAsinPrice&&(g+=d+"sdpMinimumPriceNew\x3d"+c.upsellAsinPrice,d="\x26"),c.productAsinPrice&&(g+=d+"merchantAsinPrice\x3d"+c.productAsinPrice));b.get("/gp/ls/impress.html/ref\x3d"+
a+g)}},h=function(a,b,d){var c="";a&&b&&d&&(c=a+"_"+b+"_"+d);return c},c=function(a,b,d,c){var g="";a&&b&&d&&c&&(g=a+"_"+b+"_"+d+"_"+c);return g},g=function(a,b){"undefined"!==typeof m.ue&&"undefined"!==typeof m.ue.count&&("undefined"===typeof b?m.ue.count(a,1):m.ue.count(a,b))};return{metric:function(a){"undefined"!==typeof m.ue&&"undefined"!==m.ue.count&&m.ue.count("vas_ppd_"+a,1)},increaseMetricBy:function(a,b){"undefined"!==typeof m.ue&&"undefined"!==m.ue.count&&m.ue.count("vas_ppd_"+a,b)},log:function(a){m.ueLogError&&
m.ueLogError(a,{logLevel:"ERROR",attribution:"ppd-bundles"})},logFatal:function(a,b,d){m.ueLogError&&m.ueLogError({message:a},{message:d,logLevel:"FATAL",attribution:b})},logRefTag:function(a,c,d,g,n,e,h,x,r){if(a){var u="?",v="";c&&(v+=u+"pageType\x3d"+c,u="\x26");d&&(v+=u+"subPageType\x3d"+d,u="\x26");g&&(v+=u+"pageTypeId\x3d"+g,u="\x26");v=n?v+(u+"hitType\x3d"+n):v+(u+"hitType\x3dpopUp");u="\x26";e&&(v+=u+"merchantId\x3d"+e,u="\x26");h&&(v+=u+"pageAsin\x3d"+h,u="\x26");x&&(v+=u+"sdpMinimumPriceNew\x3d"+
x,u="\x26");r&&(v+=u+"merchantAsinPrice\x3d"+r);b.get("/gp/ls/impress.html/ref\x3d"+a+v);"undefined"!==typeof m.ue&&"undefined"!==m.ue.count&&m.ue.count(a,1)}},logUeMetricIncreaseCount:g,getCSMName:h,getRefMarker:c,increaseCSMCounterBy:function(a,b){a&&"undefined"!==typeof m.ue&&"undefined"!==typeof m.ue.count&&m.ue.count(a,(m.ue.count(a)||0)+b)},logCSMCounter:function(a){a&&"undefined"!==typeof m.ue&&"undefined"!==typeof m.ue.count&&m.ue.count(a,(m.ue.count(a)||0)+1)},createCSMNameAndLog:function(a,
b,d){a=this.getCSMName(a,b,d);this.logCSMCounter(a);return a},logHit:a,createRefMarkerAndLog:function(a,b,d,c,g){a=this.getRefMarker(a,b,d,c);this.logHit(a,g);return a},logReftagAndCSMMetricForWidgetAction:function(b,e,d,l,n){var q=h(l,e,b);g(q);b=c(l,d,e,b);a(b,n)},hitParameterKeys:{upsellAsin:"upsellAsin",productAsin:"productAsin",pageType:"pageType",subPageType:"subPageType",upsellAsinPrice:"upsellAsinPrice",productAsinPrice:"productAsinPrice",hitType:"hitType",additionalRequestData:"additionalRequestData",
merchantId:"merchantId",zipCode:"zip"},CSMActionTypes:{glanceView:"gv",addToCart:"att",buyBack:"bbk",buyNow:"bnw",serviceIncluded:"incl",serviceNotIncluded:"cncl",expandBulletPoints:"expbp",collapseBulletPoints:"colbp",redirect:"redir",skip:"skip",escape:"escape"},RefmarkerActionTypes:{glanceView:"gv",glanceViewDisabled:"gvDis",addToCart:"att",buyBack:"bbk",buyNow:"bnw",serviceIncluded:"incl",serviceNotIncluded:"cncl",expandBulletPoints:"expbp",collapseBulletPoints:"colbp",redirect:"redir",hyperLinkClick:"click",
popoverShow:"popshow"}}});p.register("vas-utilities",function(e){return{generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var a=16*Math.random()|0;return("x"===b?a:a&3|8).toString(16)})},getPriceValue:function(b){var a=/[+-]?\d+(\.\d+)?/g;if(null!==b.match(a))return b.match(a).map(function(a){return parseFloat(a)})[0]},validateZipCode:function(b,a){return(new RegExp(a.val())).test(b)?!0:!1}}});p.when("A","vas-common-settings","vas-metrics-publisher",
"vas-mobile-config").register("vas-metric-utils",function(e,b,a,h){var c=h.mobileMetricConstants;return{createHitParameters:function(c){var f=b.getSetting("widgetCommonVM"),e=b.getSetting("winningWidgetVM"),d={},l={},e=e.baseAsinOfferData===w?e:e.baseAsinOfferData;l[c.additionalRequestDataKeys.zipCode]=f.zipCode;d[a.hitParameterKeys.productAsin]=f.productAsin;d[a.hitParameterKeys.upsellAsin]=e.upsellAsin;d[a.hitParameterKeys.merchantId]=f.merchantId;d[a.hitParameterKeys.productAsinPrice]=f.buyboxPrice;
d[a.hitParameterKeys.pageType]=c.hitRecordConstants.pageType;d[a.hitParameterKeys.upsellAsinPrice]=e.winningServiceMinPrice;d[a.hitParameterKeys.subPageType]=c.hitRecordConstants.subPageType;d[a.hitParameterKeys.additionalRequestData]=l;return d},createGlobalHitParameters:function(c){var f={},e=b.getSetting("widgetCommonVM");if(e){if(null===c||c===w)c={};c[a.hitParameterKeys.zipCode]=e.zipCode;f[a.hitParameterKeys.additionalRequestData]=c;f[a.hitParameterKeys.productAsin]=e.productAsin;f[a.hitParameterKeys.merchantId]=
e.merchantId;if(c=b.getSetting("winningWidgetVM"))f[a.hitParameterKeys.upsellAsin]=(c.baseAsinOfferData===w?c:c.baseAsinOfferData).upsellAsin}return f},getMobileMetricConstants:function(){b.getSetting("widgetCommonVM").isApp?(c.metricPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName?"aft":"aftxl",c.refmarkerPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName?"aft":"aftxl"):(c.metricPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName?
"mft":"mftxl",c.refmarkerPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName?"mft":"mftxl");return c}}});p.register("vas-device-constants",function(){return{DIV:{PRODUCT_QUANTITY_ID:"#quantity"}}});p.when("A","ready").register("vas-url-util",function(e){function b(a){return l.Q_STRING_REGEX.test(a)}function a(a){a=l.VAS_REGEX.exec(a);return null===a||3>=a.length?"":a[2]}function h(a,b){return a.replace(l.VAS_REGEX,"$1vas\x3d"+encodeURIComponent(b))}function c(a){a=
a.replace(l.VAS_REGEX,"");return 0<a.length&&"\x26"===a.charAt(0)?"?"+a.substring(1,a.length):a}function g(a,b,c){delete b[c];b=d(b);return h(a,b)}function f(a,b){return 0!==Object.keys(a).length&&b in a?!0:!1}function k(a){return JSON.parse(a.replace(/'/g,'"'))}function d(a){return JSON.stringify(a).replace(/"/g,"'")}var l={VAS_REGEX:/(\?|\&)vas=(.*?)(?=(&|$))/,Q_STRING_REGEX:/\?.*$/};return{getDecodedQueryParamString:function(){return decodeURIComponent(m.location.search)},getPathName:function(){return m.location.pathname},
doesAnyQueryStringExist:b,doesVasQueryParamExist:function(a){return l.VAS_REGEX.test(a)},getVasQueryParamValue:a,addOrUpdateKeyInVasQryParam:function(b,c,f){b=a(b);b=k(b);b[c]=f;return d(b)},replaceExistingVasParam:h,appendVasQueryParam:function(a,d){var c;c=b(a)?"\x26":"?";return a+c+"vas\x3d"+encodeURIComponent(d)},removeOrUpdateVasQryParamWithMarker:function(a,b,d){if(!f(b,d))throw Error("vas: specified key "+d+" does not exist");return 1===Object.keys(b).length?c(a):g(a,b,d)},removeVasQueryParam:c,
removeMarkerFromVasQueryParam:g,doesKeyExist:f,parseSingleQuotedStringAsJson:k,stringifyJsonWithSingleQuotes:d}});p.when("A","vas-metrics-publisher","ready").register("vas-atc-tracker",function(e,b){e=e.$;var a=!1,h=null,c=null,g=0,f=null,k=null,d=!1,l,n=function(){return 0===g?!1:!0},q=function(a,d){"undefined"!==typeof d?b.logUeMetricIncreaseCount(a+(l.showSTSServiceInterstitial||l.isParentServiceAsin?"_sts":""),d):b.logUeMetricIncreaseCount(a+(l.showSTSServiceInterstitial||l.isParentServiceAsin?
"_sts":""))},t=function(){if(a){var d=h;null!==d&&(d=((new Date).getTime()-d)/1E3,q("vas_si_hijack_interval_time",d),300<d&&(b.logRefTag("vas_si_hijack_interval_time_5M_"+l.productAsin+"_"+l.serviceAsin),b.logFatal("Customer spending more than 5 min on SI widget","vas-si","[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+",zip\x3d"+l.zipCode+"] ")))}},x=function(){if(n()){var a=c;null!==a&&(a=((new Date).getTime()-a)/1E3,q("vas_si_dismissal_interval_time",a),30<a&&(b.logRefTag("vas_si_hijack_dismissal_time_30S_"+
l.productAsin+"_"+l.serviceAsin),b.logFatal("Customer spending more than 30 sec on page after trying to dismiss SI widget","vas-si","[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+",zip\x3d"+l.zipCode+"] ")))}},r=function(){if(!d&&(d=!0,a)){q("vas_si_hijack_unload");b.logRefTag("vas_si_hijack_unload"+l.productAsin+"_"+l.serviceAsin);var c=h;if(null!==c){var f=(new Date).getTime();q("vas_si_hijack_unload_total_time",f-c);b.logFatal("Customer may be stuck on SI widget","vas-si",
"[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+",zip\x3d"+l.zipCode+"] ")}}return!0};e(m).unbind("beforeunload");e(m).bind("beforeunload",r);e(m).unbind("unload");e(m).bind("unload",r);return{isHijacked:function(){return a},setHijacked:function(){a||(a=!0,q("vas_si_atcHijack"),b.logRefTag("vas_si_atcHijack"),h=(new Date).getTime(),f=m.setInterval(t,6E4),k=m.setInterval(x,2E4))},unsetHijacked:function(){if(a){if(null!==h){var d=((new Date).getTime()-h)/1E3;q("vas_si_hijack_total_time",
d)}a=!1;q("vas_si_atcUnHijack");b.logRefTag("vas_si_atcUnHijack");h=null;g=0;c=null;null!==f&&(m.clearInterval(f),f=null);null!==k&&(m.clearInterval(k),k=null)}},getHijackTime:function(){return h},logHijackMetricOnPageUnload:r,setHijackDismissalAttempt:function(){0===g&&(c=(new Date).getTime());g++;1<g?q("vas_si_dismissal_count",1):q("vas_si_dismissal_count",0);2===g&&b.logFatal("SI widget is dismissed mulitple times","vas-si","[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+
",zip\x3d"+l.zipCode+"] ")},getDismissalTime:function(){return c},isDismissalAttempted:n,setWidgetMetaData:function(a){l=a},logMetric:q}});p.when("A","vas-metrics-publisher","vas-atc-tracker","ready").register("vas-atc-helper",function(e,b,a){var h=e.$,c,g=function(){a.logMetric("vas_si_atcClick_returnFalse");c&&(b.logFatal("Add to cart is clicked multiple times with vas SI","vas-si","[context::productAsin\x3d"+c.productAsin+",serviceAsin\x3d"+c.serviceAsin+",zip\x3d"+c.zipCode+"] "),b.logHit("vas_si_atcClick_returnFalse",
{upsellAsin:c.serviceAsin,productAsin:c.productAsin,additionalRequestData:c.zipCode}));return!1},f=function(){a.logMetric("vas_si_forceSafeATC_click");c.isMBCClick&&c.atcButton.bind("click",function(){var a=h(this).find("a")[0];a&&a.href&&(m.location.href=a.href)});if(c.atcButton)c.atcButton.unbind("click.lsatc").click().bind("click.lsatc",g);else{var b=h("#addToCart");b.append('\x3cinput type\x3d"hidden" id\x3d"add-to-cart-button" name\x3d"submit.add-to-cart" value\x3d"Add To Cart" /\x3e');b.submit()}},
k=function(){a.logMetric("vas_si_safeATC_click");c.atcEventInProgress||f()},d=function(){return{"session-id":h("#session-id").attr("value"),ASIN:c.productAsin,offerListingID:h("#offerListingID").attr("value"),isMerchantExclusive:h("#isMerchantExclusive").attr("value"),merchantID:h("#merchantID").attr("value"),isAddon:h("#isAddon").attr("value"),nodeID:h("#nodeID").attr("value"),sellingCustomerID:h("#sellingCustomerID").attr("value"),qid:h("#qid").attr("value"),sr:h("#sr").attr("value"),storeID:h("#storeID").attr("value"),
tagActionCode:h("#tagActionCode").attr("value"),viewID:h("#viewID").attr("value"),rsid:h("#rsid").attr("value"),sourceCustomerOrgListID:h("#sourceCustomerOrgListID").attr("value"),sourceCustomerOrgListItemID:h("#sourceCustomerOrgListItemID").attr("value"),wlPopCommand:"",quantity:h("#quantity").attr("value"),"submit.add-to-cart":"Submit+Query"}},l=function(b,d,f){document.body.style.cursor="default";a.logMetric(f,0);if(c.productAsin&&c.serviceAsin){f={dsc:1,productASIN:c.productAsin};var e=c.zipCode;
b=h(b);if(b=(b=(b=(b=(b=h(".giftableItem, .nonGiftableItem",b))&&b[0])&&b.outerHTML)&&h(b))&&b.attr("itemid"))f.itemID=b,f.newItems=b+",1",f.isHUC="true";e&&(f.area=e);f=JSON.stringify(f).replace(/"/g,"'");f="?vas\x3d"+encodeURIComponent(f)+"\x26psc\x3d1";a.unsetHijacked();m.location.href="/gp/product/"+c.serviceAsin+"/ref\x3d"+d+f;a.logMetric("vas_siatc_sdp_redirect")}else a.logMetric("vas_siatc_huc_redirect"),a.unsetHijacked(),m.location.href="/gp/cart/view.html";return!1},n=function(b){a.logMetric(b);
document.body.style.cursor="default";f();return!1},q=function(){var a,b,d,f;c.isMBCClick&&"undefined"!==typeof c.offerListingID&&(d=c.atcButton.find("a")[0])&&d.href&&(a=d.href,c.showSIATC&&(b=2,(f=a.match(/itemCount=([0-9]+)/i))&&f[1]&&(f=parseInt(f[1],10))&&(b=f+1),a=a.replace(/itemCount=([0-9]+)/i,"itemCount\x3d"+b)+"\x26offeringID."+b+"\x3d"+c.offerListingID,d.href=a));return a},t=function(){var a={};a.upsellAsin=c.serviceAsin;a.offerlistingId=c.offerListingID;a.merchantId=c.merchantId;e.trigger("vas:add-service-asin-buybox-event",
a)};return{addServiceToCart:function(b){var f=q();if(c.showSIATC)t(),a.logMetric("vas_siatc_service_added"),k();else{if(c.atcEventInProgress)return!1;c.atcEventInProgress=!0;a.logMetric("vas_si_addProduct");var e=function(a){l(a,b,"vas_siatc_sdp_redirect_ajaxFail")},g=function(a){n("vas_siatc_sdp_redirect_ajaxFail")};c.isMBCClick?h.get(f).done(e).fail(g):(f=d(),h.post("/gp/product/handle-buy-box/ref\x3dvas_dphbb_"+c.productAsin+"_"+c.serviceAsin,f).done(e).fail(g));document.body.style.cursor="progress"}return!1},
addProductToCartAndGoToSDP:function(a){var b,f=function(b){l(b,a,"vas_siatc_handle_buybox_ajax_fail")},e=function(){n("vas_siatc_handle_buybox_ajax_fail")};if(c.isMBCClick){var g=c.atcButton.find("a")[0];g&&g.href&&(b=g.href);h.get(b).done(f).fail(e)}else b=d(),h.post("/gp/product/handle-buy-box/ref\x3dvas_dphbb_"+c.productAsin+"_"+c.serviceAsin,b).done(f).fail(e);document.body.style.cursor="progress";return!1},lsATCHandlerSuppressATC:g,safeATCClick:k,forceSafeATCClick:f,setWidgetMetaData:function(a){c=
a}}});p.when("A","vas-device-constants","vas-metrics-publisher","vas-metric-utils","ready").register("vas-service-quantity-helper",function(e,b,a,h){function c(c){var e=g(b.DIV.PRODUCT_QUANTITY_ID);if(0>=e.length)return 1;if(null===c||c===w)c="";e=Number(e.val());if(isNaN(e)||0>=e)return e=h.createGlobalHitParameters(),a.logHit("vas_qtyEval",e),a.createCSMNameAndLog("vas","qtyEval"+c,"fail"),1;a.createCSMNameAndLog("vas","qty"+c,"success");1<e&&(c=h.createGlobalHitParameters({qty:e}),a.logHit("vas_multiQty",
c));return e}var g=e.$;return{getServiceQuantity:function(a,b){return a?c(b):1}}});p.when("A","vas-metrics-publisher","vas-utilities","vas-common-settings","vas-service-quantity-helper","vas_manage_forms").register("vas-core-buybox",function(e,b,a,h,c,g){function f(){var b=h.getSetting("widgetCommonVM"),d={};d.itemAssocId=a.generateUUID();d.addItemAssociation=b.isShipToStore||b.shouldAddItemAssociation||b.showUnifiedGuruExperience;return d}function k(a){try{"undefined"!==typeof a.offerlistingId&&
x()&&t("add",a.offerlistingId),b.increaseMetricBy("mbcFormAppend_fail",0),b.metric("mbcFormAppend_success")}catch(d){b.increaseMetricBy("mbcFormAppend_success",0),b.metric("mbcFormAppend_fail"),b.log(d)}}function d(){try{x()&&t("remove"),b.increaseMetricBy("mbcFormRemove_fail",0),b.metric("mbcFormRemove_success")}catch(a){b.increaseMetricBy("mbcFormRemove_success",0),b.metric("mbcFormRemove_fail"),b.log(a)}}function l(a){var b=n(q.BUY_BACK_FORM_ID),d=n(q.ADD_TO_CART_FORM_ID),d=Math.max(d.find("input[name^\x3d'asin']").length+
1,b.find("input[name^\x3d'asin']").length+1);if(b.length){var f=c.getServiceQuantity(h.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled);b.append('\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+d+'" name\x3d"quantity.'+d+'" value\x3d"'+f+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+d+'" name\x3d"asin.'+d+'" value\x3d"'+a.upsellAsin+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+
d+'" name\x3d"offeringID.'+d+'" value\x3d"'+a.offerlistingId+'" /\x3e')}}var n=e.$,q={PRODUCT_QUANTITY_ID:"#quantity",ADD_TO_CART_FORM_ID:"#addToCart",BUY_BACK_FORM_ID:"#buyBackBuyNow",MOBB_FORM_ID:"#second_new_accordion_form"},t=function(a,b){n("#mbc .a-button").each(function(){var d=n(this);d.text();var d=d.find("a")[0],c,f,e;if(d&&d.href){var g=d.href;(e=g.match(/itemCount=([0-9]+)/i))&&e[1]&&((f=parseInt(e[1],10))&&"add"===a?c=f+1:f&&"remove"===a&&(c=f-1));c&&(g=g.replace(/itemCount=([0-9]+)/i,
"itemCount\x3d"+c),"add"===a&&b?g+="\x26offeringID."+c+"\x3d"+b:"remove"===a&&(g=g.replace(new RegExp("\x26offeringID."+f+"\x3d[^\x26]*"),"")),d.href=g)}})},x=function(){var a=h.getSetting("widgetCommonVM");return(a.populateMBCATC||a.showFakeTwisterBundles||a.showEnhancedUpsellBundle)&&!a.showUnifiedGuruExperience},r=function(a){g.removeFieldsFromBuyBoxForm("addToCart");d();g.addFieldsInBuyBoxForm("addToCart",a.data.asinOfferData,f(),!1);k(a.data.asinOfferData);l(a.data.asinOfferData)},u={addServiceAsinBuybox:function(a){g.addFieldsInBuyBoxForm("addToCart",
a,f(),!1);k(a);var b=n(q.MOBB_FORM_ID),d=b.find("input[name^\x3d'offeringID']").length+1,e=b.find('input[name\x3d"itemCount"]');if(b.length){var l=c.getServiceQuantity(h.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled),l='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+d+'" name\x3d"quantity.'+d+'" value\x3d"'+l+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+d+'" name\x3d"asin.'+d+'" value\x3d"'+a.upsellAsin+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+
d+'" name\x3d"offeringID.'+d+'" value\x3d"'+a.offerlistingId+'" /\x3e';0===e.length?b.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+d+'"\x3e'):e[0].value=d;b.append(l)}h.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled&&(n(document.body).undelegate(q.PRODUCT_QUANTITY_ID,"change",r),n(document.body).delegate(q.PRODUCT_QUANTITY_ID,"change",{asinOfferData:a},r))},removeServiceAsinBuybox:function(){g.removeFieldsFromBuyBoxForm("addToCart");d();n(document.body).undelegate(q.PRODUCT_QUANTITY_ID,
"change",r)},addServiceAsinToBuyBack:function(a){l(a)}};return{registerBuyboxEventHandlers:function(){e.off("vas:add-service-asin-buybox-event");e.on("vas:add-service-asin-buybox-event",function(a){u.addServiceAsinBuybox(a)});e.off("vas:remove-service-asin-buybox-event");e.on("vas:remove-service-asin-buybox-event",function(){u.removeServiceAsinBuybox()});e.off("vas:add-service-asin-buyback-form-event");e.on("vas:add-service-asin-buyback-form-event",function(a){u.addServiceAsinToBuyBack(a)})}}});p.when("A",
"vas-metrics-publisher","vas-common-settings","vas-service-quantity-helper","ready").register("vas_manage_forms",function(e,b,a,h){function c(a,b){var c=g("*[id\x3d"+a+"]");if("retailheavybulky"===b.mappingSet||"heavybulky"===b.mappingSet)c=c.not("#usedAccordionRow *[id\x3d"+a+"]");return c}var g=e.$,f={retailheavybulky:"RetailHeavyBulky",heavybulky:"HeavyBulky"},k="vdo_devices_display_on_website premium_ce_brands_display_on_website amazon_ereaders_display_on_website amazon_home_display_on_website amazon_shm_display_on_website amazon_smp_display_on_website amazon_tablets_display_on_website digital_devices_7_display_on_website digital_products_3_display_on_website fsn_devices_display_on_website sud_devices_display_on_website digital_accessories_3_display_on_website digital_accessories_4_display_on_website digital_accessories_5_display_on_website digital_device_acc_display_on_website".split(" ");
return{addFieldsInBuyBoxForm:function(d,e,n,q){try{var t=a.getSetting("widgetCommonVM");c(d,t).each(function(){var b=g(this),d;d=q?b.find("input[name^\x3d'offeringID']").length:b.find("input[name^\x3d'offeringID']").length+1;var c=n.itemAssocId,v=d+1,p=n.addItemAssociation,m=h.getServiceQuantity(t.multiQuantityPurchaseEnabled),w=b.find('input[name\x3d"itemCount"]');0<k.indexOf(t.productWDG)&&(d=0===w.length?1:w[0].value);if("undefined"!==typeof e.offerlistingId){b.append('\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+
d+'" name\x3d"quantity.'+d+'" value\x3d"'+m+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+d+'" name\x3d"asin.'+d+'" value\x3d"'+e.serviceAsin+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+d+'" name\x3d"offeringID.'+d+'" value\x3d"'+e.offerlistingId+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"merchantID.'+d+'" name\x3d"merchantID.'+d+'" value\x3d"'+e.merchantId+'" /\x3e');if(p){c='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+
v+'.1" name\x3d"custom-name.'+v+'.1" value\x3d"itemAssoc" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+v+'.1" name\x3d"custom-value.'+v+'.1" value\x3d"'+c+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.1" name\x3d"custom-name.1.1" value\x3d"itemAssoc" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.1" name\x3d"custom-value.1.1" value\x3d"'+c+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.2" name\x3d"custom-name.1.2" value\x3d"UNIQ-itemAssoc" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.2" name\x3d"custom-value.1.2" value\x3d"'+
c+'" /\x3e';a:{p=e.asin;if((m=a.getSetting("winningWidgetVM"))&&m.vasTwisterOptions&&m.vasTwisterOptions[p]&&(p=m.vasTwisterOptions[p].mappingSet)&&f.hasOwnProperty(p)){p=f[p];break a}p=void 0}p&&(c+='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.3" name\x3d"custom-name.1.3" value\x3d"itemAssocType" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.3" name\x3d"custom-value.1.3" value\x3d"'+p+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+
v+'.2" name\x3d"custom-name.'+v+'.2" value\x3d"itemAssocType" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+v+'.2" name\x3d"custom-value.'+v+'.2" value\x3d"'+p+'" /\x3e');b.append(c)}0===w.length?b.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+d+'"\x3e'):w[0].value=Math.max(d,w[0].value)}});b.increaseMetricBy("vas_"+d+"_FormAppend_fail",0);b.metric("vas_"+d+"_FormAppend_success")}catch(x){b.increaseMetricBy("vas_"+d+"_FormAppend_success",
0),b.metric("vas_"+d+"_FormAppend_fail"),b.log(x)}},removeFieldsFromBuyBoxForm:function(d){try{g(".atcFormServiceAsinData").remove();var c=g("#"+d).find('input[name\x3d"itemCount"]');-1===k.indexOf(a.getSetting("widgetCommonVM").productWDG)&&0!==c.length&&1<=c[0].value&&--c[0].value;b.increaseMetricBy("vas_"+d+"FormRemove_fail",0);b.metric("vas_"+d+"FormRemove_success")}catch(f){b.increaseMetricBy("vas_"+d+"FormRemove_success",0),b.metric("vas_"+d+"FormRemove_fail"),b.log(f)}}}});p.when("A","vas-metrics-publisher",
"vas-url-util","ready").register("vas-persist-widget",function(e,b,a){return{initialize:function(){m.history&&m.history.replaceState?(e.on("vas:add-widget-state-url",function(e){try{var c;var g=a.getDecodedQueryParamString(),f=e.preSelectedWidgetValue;if(a.doesVasQueryParamExist(g)){var k=a.addOrUpdateKeyInVasQryParam(g,"vw",f);c=a.replaceExistingVasParam(g,k)}else{e={};e.vw=f;var d=a.stringifyJsonWithSingleQuotes(e);c=a.appendVasQueryParam(g,d)}var l=a.getPathName()+c;m.history.replaceState({},document.title,
l)}catch(n){b.metric("addWidgetStateInUrl_fail"),b.log(n)}}),e.on("vas:remove-widget-state-url",function(){var e=a.getDecodedQueryParamString();if(a.doesVasQueryParamExist(e))try{var c=a.getVasQueryParamValue(e),g=a.parseSingleQuotedStringAsJson(c);if(a.doesKeyExist(g,"vw")){var f=a.removeOrUpdateVasQryParamWithMarker(e,g,"vw"),k=a.getPathName()+f;m.history.replaceState({},document.title,k)}}catch(d){b.metric("removeWidgetStateFromUrl_fail"),b.log(d)}})):b.metric("vas_unsupportedBrowser")}}});p.when("A",
"vas-metrics-publisher","vas-common-settings","vas-atc-tracker","vas-atc-helper","vas-service-interstitial","valueadds_controller").register("vas-core-interstitial",function(e,b,a,h,c,g,f){var k=e.$,d,l,n=!1,q,t,x=function(a){var b=k("#"+(d.showSTSServiceInterstitial?"sts-":"")+"pdp-service-siatc-modal-content");if(b&&b.length){var c=b.find("."+a);c.length&&(b.find("."+d.selectedOfferFulfillmentType).addClass("vas-hidecomponent"),c.removeClass("vas-hidecomponent"),d.selectedOfferFulfillmentType=a)}},
r=function(){var a=k("#ppdb-add-service-checkbox");if(!n){h.setHijacked();k(document.body).undelegate("#mbc .a-button","click.lsatc");h.logMetric("vas_si_atcClick");n=!0;d.isMBCClick=!1;d.atcButton=k(this);var g=d.atcButton.attr("id");if(g&&"add-to-cart-button"!==g)if("mobb.addToCart"!==g){if(d.isMBCClick=!0,(g=d.atcButton.text())&&!g.match(/cart/i))return document.body.style.cursor="default",c.safeATCClick(),!1}else d.isMOBBlick=!0;if(0<a.length&&a.is(":checked"))return a=!0===d.isUpsellCritical?
"1":"0",g="vas_bdlppd_",d.isMBCClick&&(g+="mbc_"),d.isMOBBClick&&(g+="mobb_"),b.logRefTag(g+"checked_atc_"+a+"_"+d.productAsin+"_"+d.serviceAsin),h.logMetric("vas_bdlppd_atc_click"),document.body.style.cursor="default",c.safeATCClick(),n?!0:!1;k(document.body).undelegate("#add-to-cart-button","click.lsatc");k(document.body).undelegate("#mobb\\.addToCart","click.lsatc");if(d.productAsin&&d.serviceAsin&&1===d.atcButton.length&&1===q.length)return d.atcButton.bind("click.lsatc",c.lsATCHandlerSuppressATC),
f.isValueAddsAvailable()?(a=k.parseJSON(k("#valueAddsInterstitial").attr("data-a-modal")))?(a={name:a.name,header:a.header},k("#valueAddsInterstitial").attr("data-a-modal",JSON.stringify(a)).click(),e.$(".a-popover-inner").addClass("pdp-service-modal-instance"),d.showSTSServiceInterstitial&&x(d.selectedOfferFulfillmentType)):c.safeATCClick():(a=k.parseJSON(k("#vasServiceInterstitial").attr("data-a-modal")))?(a={name:a.name,header:a.header},k("#vasServiceInterstitial").attr("data-a-modal",JSON.stringify(a)).click(),
e.$(".a-popover-inner").addClass("pdp-service-modal-instance"),d.showSTSServiceInterstitial&&x(d.selectedOfferFulfillmentType)):c.safeATCClick(),!1;document.body.style.cursor="default";c.safeATCClick();return!1}},u=function(){q=k("#addToCart");q.submit(function(){h.unsetHijacked();return!0});t=k("#second_new_accordion_form");t.submit(function(){h.unsetHijacked();return!0});d.hijackMBCATC&&(k(document).undelegate("#mbc .a-button","click.lsatc"),k(document.body).delegate("#mbc .a-button","click.lsatc",
r),k.get("/gp/ls/impress.html/ref\x3dvas_mbc_ld_"+d.productAsin+"_"+d.serviceAsin));k(document).undelegate("#add-to-cart-button","click.lsatc");k(document.body).delegate("#add-to-cart-button","click.lsatc",r);k(document).undelegate("#mobb\\.addToCart","click.lsatc");k(document.body).delegate("#mobb\\.addToCart","click.lsatc",r)};return{registerSIEventHandlers:function(){k(document.body).undelegate("#add-to-cart-button","click.lsatc");var f=0!==k("#abb-interstitial").length;f&&b.metric("devicesInterstitialPresentCount");
if(f=!f)f="undefined"!==typeof a.getSetting("winningWidgetVM")?a.getSetting("widgetCommonVM").hijackATC:!1;f&&(d=a.getSetting("widgetCommonVM"),d.isShipToStoreAsinSelected="in_store"===d.selectedOfferFulfillmentType,d.atcEventInProgress=!1,d.isMBCClick=!1,d.isMOBBClick=!1,l=d.isWarrantyPresent,c.setWidgetMetaData(d),h.setWidgetMetaData(d),g.setWidgetMetaData(d),d.doRedirect&&null===document.getElementById("servicesInterstitial")&&null===document.getElementById("attach-warranty-pane")&&!l&&(u(),g.registerSIEventHandlers()))}}});
p.when("A","vas-metrics-publisher").register("vas-addUpsell-to-cart",function(e,b){return{addUpsell:function(a,h,c,g){e.ajax("/gp/product/handle-buy-box/",{method:"POST",params:{"session-id":c,"quantity.1":g,itemCount:1,"submit.add-to-cart":"Add to Cart","asin.1":a,"offeringID.1":h},success:function(){b.logUeMetricIncreaseCount("vas_addupsell_cart_success",1);b.logUeMetricIncreaseCount("vas_addupsell_cart_fail",0);e.trigger("vas:ldbb-upsell-added:desktop")},error:function(){b.logUeMetricIncreaseCount("vas_addupsell_cart_fail",
1);b.logUeMetricIncreaseCount("vas_addupsell_cart_success",0)}})}}});p.register("vas-mobile-config",function(){return{mobileMetricConstants:{refmarkerPrefixes:{tenant:"vas"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",isCritical:"crtcl"},metricPrefixes:{tenant:"vas"}}}});p.register("vas-widget-const",function(){return{COMMON:{DOM:{ADDSERVICE_SLOT:"addServices_feature_div",VAS_BUYBOX_SLOT:"vasBuyBox_feature_div",STS_BUYBOX_SLOT:"shipToStoreBuyBox_feature_div",
ADDONS_WIDGET_SLOT:"addons_feature_div",VALUE_ADDS_SLOT:"valueAdds_feature_div",VALUE_PROP_T1_SLOT:"valuePropT1_feature_div",VALUE_PROP_T2_SLOT:"valuePropT2_feature_div"},EVENT_NAME:{NO_BUYBOX:"vas:metrics:nobuybox",NO_PRODUCT:"vas:metrics:noproduct"},REFTAG_PREFIX:{NO_BUYBOX:"vas_nobb_d_ppd_",WIDGET_SUPRESSED:"vas-ppd-widget-suppressed",WIDGET_NO_PRODUCT:"vas-ppd-widget-should-suppressed"}},METRICS:{WIDGET_NAMES:{TABLET_PPD_BUNDLES:"tabbdl"},ACTION_NAMES:{GLANCE_VIEWS:"gv",ADD_TO_CART:"atc",REDIRECTION:"redir",
UPSELL_INCLUDED:"incl",UPSELL_EXCLUDED:"cncl"},TENANT_NAMES:{VAS:"vas"}}}});p.register("vas-common-settings",function(e){var b={};return{getSetting:function(a){return a?b[a]:b},setSetting:function(a,e,c){a&&c?b[a][c]=e:a&&(b[a]=e)},clearSettings:function(){b={}}}});p.when("A","vas-metrics-publisher","vas-common-settings","vas-widget-const","ready").register("vas-common-metrics",function(e,b,a,h){e.off(h.COMMON.EVENT_NAME.NO_BUYBOX);e.on(h.COMMON.EVENT_NAME.NO_BUYBOX,function(){var c=h.COMMON.REFTAG_PREFIX.NO_BUYBOX,
e=a.getSetting("widgetCommonVM").productAsin,f=a.getSetting("widgetCommonVM").zipCode;b.logRefTag(c+e+"_"+f,"LocalServicesWidget")});e.off(h.COMMON.EVENT_NAME.NO_PRODUCT);e.on(h.COMMON.EVENT_NAME.NO_PRODUCT,function(){var c=a.getSetting("widgetCommonVM").shouldSuppressWidget,e=a.getSetting("widgetCommonVM").isProductAvailable,f;c?f=h.COMMON.REFTAG_PREFIX.WIDGET_SUPRESSED:e||(f=h.COMMON.REFTAG_PREFIX.WIDGET_NO_PRODUCT);b.logRefTag(f,"LocalServicesWidget")})});p.when("A","vas-common-settings","vas-core-buybox",
"vas-core-interstitial","vas-widget-const","attach-to-ldbb","vas-persist-widget","valueadds_controller","ready").register("vas-widgets",function(e,b,a,h,c,g,f,k){var d=e.$,l=function(){b.clearSettings();var a,f,g=!1;k.isValueAddsAvailable()?e.each(d("#"+c.COMMON.DOM.VALUE_ADDS_SLOT).find("[data-a-state]"),function(c,l){f=e.parseJSON(d(c).attr("data-a-state")).key;"vas-common-vm"===f?(a=e.parseJSON(d(c).html()),b.setSetting("widgetCommonVM",a)):"vas-winning-widget-vm"===f&&(a=e.parseJSON(d(c).html()),
b.setSetting("winningWidgetVM",a),g=!0)}):e.each(d("#"+c.COMMON.DOM.ADDSERVICE_SLOT).find("[data-a-state]"),function(c,l){f=e.parseJSON(d(c).attr("data-a-state")).key;"vas-common-vm"===f?(a=e.parseJSON(d(c).html()),b.setSetting("widgetCommonVM",a)):"vas-winning-widget-vm"===f&&(a=e.parseJSON(d(c).html()),b.setSetting("winningWidgetVM",a),g=!0)});return g};return{initialize:function(){if(l()){a.registerBuyboxEventHandlers();h.registerSIEventHandlers();if("undefined"!==typeof b.getSetting("winningWidgetVM")){var d=
b.getSetting("winningWidgetVM").winningWidgetName;e.trigger("vas:widgetname:"+d)}else e.trigger(c.COMMON.EVENT_NAME.NO_BUYBOX);e.trigger(c.COMMON.EVENT_NAME.NO_PRODUCT);g.attachToLdbb();f.initialize()}}}});p.when("A","vas-metrics-publisher","vas-widget-const","atf","ready").register("vas-base-data-publisher",function(e,b,a,h){var c=e.$;h=function(){var g,f;e.each(c("#"+a.COMMON.DOM.VALUE_ADDS_SLOT).find("[data-a-state]"),function(a,b){f=e.parseJSON(c(a).attr("data-a-state")).key;"vas-base-vm"===f&&
(g=e.parseJSON(c(a).html()))});if(g){var h=!1,d={};if(0<c("#add-to-cart-button").length||0<c("#mbc .a-button").length)h=!0;d[b.hitParameterKeys.productAsin]=g.productAsin;d[b.hitParameterKeys.additionalRequestData]={asin:g.productAsin,dt:"d",zip:g.zipCode,ibba:h};b.logHit("hbs_product_data",d)}};h();return{publish:h}});p.when("A","vas-common-settings","vas-service-quantity-helper").register("attach-to-ldbb",function(e,b,a){var h=e.$,c=function(){h(document.body).undelegate(".gb-btn-atc","click.attachServicesHandler");
var c=a.getServiceQuantity(b.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled,"ldbb");e.trigger("vas:ldbb-a2c-event:desktop",c)};return{attachToLdbb:function(){b.getSetting("widgetCommonVM").attachToLdbb&&(h(document.body).undelegate(".gb-btn-atc","click.attachServicesHandler"),h(document.body).delegate(".gb-btn-atc","click.attachServicesHandler",c))}}});p.register("vas-si-config",function(){return{siMetricConstants:{hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",
isMBC:"mbc"},bsi_prefixes:{refmarkerPrefixes:{tenant:"vas",widget:"dbsi"},metricPrefixes:{tenant:"vas",widget:"dbsi"}},rsi_prefixes:{refmarkerPrefixes:{tenant:"vas",widget:"drsi"},metricPrefixes:{tenant:"vas",widget:"drsi"}}}}});p.when("A","vas-metrics-publisher","vas-utilities","ready").register("vas-zipcode-helper",function(e,b,a){var h=e.$,c,g,f,k,d,l,n,q,t,x,r,u,v,p,m,w,F,P,K,G,y,D,A,E,I=function(a,d){"undefined"!==typeof d?b.logUeMetricIncreaseCount(a+(y.showSTSServiceInterstitial||y.isParentServiceAsin?
"_sts":""),d):b.logUeMetricIncreaseCount(a+(y.showSTSServiceInterstitial||y.isParentServiceAsin?"_sts":""))},L=function(){d.hide();F.hide();w.hide();u.addClass("a-button-disabled").prop("disabled",!0)},Q=function(){L();q.hide();l.hide();t.show()};e.on("a:popover:show:VAS-SI-Zip-Update",function(a){E=a.popover});return{vasSIZipCodeUpdate:function(z,H){var J=z.bsi_prefixes.refmarkerPrefixes,R=z.additionalRequestDataKeys,B=z.bsi_prefixes.metricPrefixes;b.createCSMNameAndLog(B.tenant,B.widget,"updateZip");
z=m.val();if(a.validateZipCode(z,P)){A=m.val();var M=y.zipCode,S="vas_sx_zc_"+M+"_"+A,N="undefined"!==typeof y.childServiceAsins?y.childServiceAsins:[y.serviceAsin];b.logRefTag(S);if(A===D)return!1;e.ajax("/gp/ls/vas-ajax-handlers/vas-zipcode-refresh.html",{method:"get",params:{asinlist:N.join(","),vasZipcode:A,clientName:"vasBuyableSiZipRefresh",includeMerchantAddress:y.showSTSServiceInterstitial},success:function(a){var m,z,C=!(h.isEmptyObject(a)||"1"===a.hasError);if(C)for(var O=0;O<N.length;O++)if(z=
N[O],a[z]&&!m||!m.merchantId||y.showSTSServiceInterstitial&&"in_store"===a[z].fulfillmentType)m=a[z],y.serviceAsin=z;z=h(".vas-siatc-zip");z.length&&z.text(A);if(!C||e.objectIsEmpty(a)||1===a.hasError||e.objectIsEmpty(a[y.serviceAsin])||1===a[y.serviceAsin].hasError)return Q(),b.logRefTag("vas_sx_zaf_"+M+"_"+A),I("vas-si-atc-zip-ajaxFail"),b.createCSMNameAndLog(B.tenant,B.widget,"updateZipFail"),!1;e.objectIsEmpty(m.offerListingId)?(H.additionalRequestData[R.zipCode]=A,b.createRefMarkerAndLog(J.tenant,
y.mappingSet,J.widget,"zprfrsh0",H),L(),l.hide(),t.hide(),n.length&&n.text(A),q.show(),y.showSTSServiceInterstitial&&K.hide(),b.logRefTag("vas_sx_zfl_"+M+"_"+A),I("vas-si-atc-zipchange-nooffer")):(H.additionalRequestData[R.zipCode]=A,b.createRefMarkerAndLog(J.tenant,y.mappingSet,J.widget,"zprfrsh1",H),E&&E.hide(),a=m,y.offerListingID=a.offerListingId,y.isCBM=a.isCBM,y.merchantId=a.merchantId,y.isShipToStoreAsinSelected="in_store"===a.fulfillmentType,y.shouldAddItemAssociation=y.isShipToStoreAsinSelected,
a=m.isCBM,k.html(m.positiveRatingHtml),x.text(m.merchantName).prop("href",m.sellerReviewLink),c.html(m.price).className+="a-color-price",f.html(m.price).className+="a-color-price",a?(F.hide(),w.show(),v.hide(),p.show()):(w.hide(),F.show(),p.hide(),v.show()),e.objectIsEmpty(m.nextOfferPrice)||a?d.hide():(r.html(m.nextOfferPrice).className+="a-color-price",d.show()),q.hide(),l.hide(),u.removeClass("a-button-disabled").prop("disabled",!1),b.logRefTag(S),I("vas-si-atc-zipchange-offeravailable"),m.fulfillmentType&&
(a=m.fulfillmentType,g&&g.length&&(C=g.find("."+a),C.length&&(g.find("."+y.selectedOfferFulfillmentType).addClass("vas-hidecomponent"),C.removeClass("vas-hidecomponent"),y.selectedOfferFulfillmentType=a))),y.showSTSServiceInterstitial&&(K.show(),e.objectIsEmpty(m.merchantAddress)?G.hide():(G.text(m.merchantAddress.AddressLine1+", "+m.merchantAddress.City+", "+m.merchantAddress.StateOrRegion+" "+m.merchantAddress.PostalCode),G.show())));D=A},error:function(){D=A;Q();b.createCSMNameAndLog(B.tenant,
B.widget,"updateZipFail");I("vas-si-atc-zip-ajaxFail");E&&E.hide()}})}else D=z,L(),t.hide(),q.hide(),l.show();return!1},setZipCodeValuesFromDOM:function(){c=h("#vas-siatc-bestoffer-obm");f=h("#vas-siatc-bestoffer-cbm");k=h("#vas-siatc-ratingandreview");d=h("#vas-si-atc-remainingoffers");l=h("#vas-siatc-invalidzip-message");n=h("#vas-siatc-nooffer-zip");q=h("#vas-siatc-offerunavailable-message");t=h("#vas-siatc-zip-ajaxfail-message");x=h("#vas-siatc-merchantname");r=h("#vas-si-atc-remainingoffer-price");
u=h("#btnVasModalContinue");v=h("#vas-siatc-howitworks-obm");p=h("#vas-siatc-howitworks-cbm");w=h("#vas-siatc-cbm-gridrow");F=h("#vas-siatc-obm-gridrow");m=h("#vas-siatc-zip-input");P=h("#vas-zipCodeValidationRegexString");y.showSTSServiceInterstitial&&(g=h("#sts-pdp-service-siatc-modal-content"),h("#vas-sts-zip-update-modal"),g&&g.length&&(K=g.find(".vas-si-merchant"),G=g.find(".vas-si-merchant-address")))},setWidgetMetaData:function(a){y=a;D=y.zipCode}}});p.when("A","vas-common-settings","vas-atc-helper",
"vas-zipcode-helper","vas-atc-tracker","vas-metrics-publisher","vas-si-config","ready").register("vas-service-interstitial",function(e,b,a,h,c,g,f){var k=e.$,d,l,n=f.siMetricConstants.hitRecordConstants,q,t,x=f.siMetricConstants.additionalRequestDataKeys,r={addProductToCartAndGoToSDP:function(b,f){g.createRefMarkerAndLog(q.tenant,d.mappingSet,q.widget,g.RefmarkerActionTypes.redirect,d.hitParameters);g.createCSMNameAndLog(t.tenant,t.widget,g.CSMActionTypes.redirect);c.setHijackDismissalAttempt();c.logMetric(b);
d.atcEventInProgress?b=!0:(d.atcEventInProgress=!0,b=!1);if(!b)return a.addProductToCartAndGoToSDP(f),!1},triggerMetricsForPopoverShow:function(){c.logMetric("vas_si_show");var a=l+"show_"+d.serviceAsin;d.showSIATC?(c.logMetric("vas_buyable_si_show"),a=l+d.zipCode+"_"+d.merchantId):c.logMetric("vas_normal_si_show");g.createCSMNameAndLog(t.tenant,t.widget,g.CSMActionTypes.glanceView);g.createRefMarkerAndLog(q.tenant,d.mappingSet,q.widget,g.RefmarkerActionTypes.glanceView,d.hitParameters);g.logRefTag(a);
m.ue&&ue.trigger&&b.getSetting("widgetCommonVM").siRatingWeblabTreatment&&ue.trigger("DP_VAS_SI_RATING_235428",b.getSetting("widgetCommonVM").siRatingWeblabTreatment)},triggerMetricsForPopoverhide:function(){c.setHijackDismissalAttempt();c.logMetric("vas_si_hide_click");g.createCSMNameAndLog(t.tenant,t.widget,g.CSMActionTypes.escape);var b=l+"x1_"+d.productAsin+"_"+d.serviceAsin;d.showSIATC&&(b=l+"no_"+d.productAsin+"_"+d.serviceAsin);g.logRefTag(b);g.createRefMarkerAndLog(q.tenant,d.mappingSet,q.widget,
g.RefmarkerActionTypes.serviceNotIncluded,d.hitParameters);a.safeATCClick();return!1}};return{registerSIEventHandlers:function(){l="vas_si_";d.showSIATC&&(l="vas_sx_");d.isMBCClick&&(l+="mbc_");if(d.showSIATC){var b=k("#vas-siatc-zip-input");h.setZipCodeValuesFromDOM();b.keyup(function(a){13===a.keyCode&&k("#vas-siatc-zip-update").click()});k(document).undelegate("#vas-siatc-zip-update","click.vas-siatc-zip-refresh");k(document).delegate("#vas-siatc-zip-update","click.vas-siatc-zip-refresh",function(a){h.vasSIZipCodeUpdate(f.siMetricConstants,
d.hitParameters)});k(document).undelegate("#vas-si-moredetails","click.sdpredir");k(document).delegate("#vas-si-moredetails","click.sdpredir",function(a){r.addProductToCartAndGoToSDP("vas_siatc_see_more_details",l+"sm_"+d.productAsin+"_"+d.serviceAsin)});k(document).undelegate("#vas-si-otheroffers","click.sdpredir");k(document).delegate("#vas-si-otheroffers","click.sdpredir",function(a){r.addProductToCartAndGoToSDP("vas_siatc_otherOffersclick",l+"so_"+d.productAsin+"_"+d.serviceAsin)});k(document).undelegate("#vas-si-estimate-SDP",
"click.sdpredir");k(document).delegate("#vas-si-estimate-SDP","click.sdpredir",function(a){r.addProductToCartAndGoToSDP("vas_siatc_priceclick",l+"p_"+d.productAsin+"_"+d.serviceAsin)})}k(document).undelegate("#btnVasModalSkip","click");k(document).delegate("#btnVasModalSkip","click",function(b){c.setHijackDismissalAttempt();c.logMetric("vas_si_skip_click");g.createCSMNameAndLog(t.tenant,t.widget,g.CSMActionTypes.skip);b=l+"x2_"+d.productAsin+"_"+d.serviceAsin;d.showSIATC&&(b=l+"no_"+d.productAsin+
"_"+d.serviceAsin);g.logRefTag(b);g.createRefMarkerAndLog(q.tenant,d.mappingSet,q.widget,g.RefmarkerActionTypes.serviceNotIncluded,d.hitParameters);a.safeATCClick();return!1});k(document).undelegate("#btnVasModalContinue","click.pdpVasNext");k(document).delegate("#btnVasModalContinue","click.pdpVasNext",function(b){c.setHijackDismissalAttempt();c.logMetric("vas_si_yes_click");b=l+"y1_"+d.productAsin+"_"+d.serviceAsin;var f,e;d.showSIATC?(b=l+"atc_"+d.productAsin+"_"+d.serviceAsin,f=g.CSMActionTypes.addToCart,
e=g.RefmarkerActionTypes.addToCart):(f=g.CSMActionTypes.redirect,e=g.RefmarkerActionTypes.redirect);g.createRefMarkerAndLog(q.tenant,d.mappingSet,q.widget,e,d.hitParameters);g.createCSMNameAndLog(t.tenant,t.widget,f);a.addServiceToCart(b);return!1});e.off("a:popover:hide:vasServiceInterstitial");e.on("a:popover:hide:vasServiceInterstitial",function(a){r.triggerMetricsForPopoverhide()});e.off("a:popover:afterShow:vasServiceInterstitial");e.on("a:popover:afterShow:vasServiceInterstitial",function(a){r.triggerMetricsForPopoverShow()});
e.off("a:popover:hide:valueAddsInterstitial");e.on("a:popover:hide:valueAddsInterstitial",function(a){r.triggerMetricsForPopoverhide()});e.off("a:popover:afterShow:valueAddsInterstitial");e.on("a:popover:afterShow:valueAddsInterstitial",function(a){r.triggerMetricsForPopoverShow()});k("#buyableSIAsinRatingLink").unbind("click");k("#buyableSIAsinRatingLink").bind("click",function(){c.logMetric("vas_sx_sdp_rating_redirect");g.createRefMarkerAndLog(q.tenant,d.mappingSet,q.widget,g.RefmarkerActionTypes.redirect,
d.hitParameters);g.createCSMNameAndLog(t.tenant,t.widget,g.CSMActionTypes.redirect)});k("#siAsinRatingLink").unbind("click");k("#siAsinRatingLink").bind("click",function(){c.logMetric("vas_si_sdp_rating_redirect");g.createRefMarkerAndLog(q.tenant,d.mappingSet,q.widget,g.RefmarkerActionTypes.redirect,d.hitParameters);g.createCSMNameAndLog(t.tenant,t.widget,g.CSMActionTypes.redirect)})},setWidgetMetaData:function(a){d=a;h.setWidgetMetaData(a);d.showSIATC?(q=f.siMetricConstants.bsi_prefixes.refmarkerPrefixes,
t=f.siMetricConstants.bsi_prefixes.metricPrefixes):(q=f.siMetricConstants.rsi_prefixes.refmarkerPrefixes,t=f.siMetricConstants.rsi_prefixes.metricPrefixes);q.tenant=d.showSTSServiceInterstitial||d.isParentServiceAsin?"sts":"vas";t.tenant=d.showSTSServiceInterstitial||d.isParentServiceAsin?"sts":"vas";a=d;var b={},c={};c[x.zipCode]=d.zipCode;c[x.isMBC]=d.isMBCClick?1:0;b[g.hitParameterKeys.upsellAsin]=d.serviceAsin;b[g.hitParameterKeys.productAsin]=d.productAsin;b[g.hitParameterKeys.merchantId]=d.merchantId;
b[g.hitParameterKeys.pageType]=n.pageType;b[g.hitParameterKeys.subPageType]=n.subPageType;b[g.hitParameterKeys.additionalRequestData]=c;a.hitParameters=b}}});p.register("vas-twister-config",function(){return{vasTwisterMetricConstants:{refmarkerPrefixes:{tenant:"vas",widget:"dft"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",isPromo:"promo",isCritical:"crtcl"},metricPrefixes:{tenant:"vas",widget:"dft"}}}});p.when("A","vas-common-settings",
"vas-metrics-publisher","vas-twister-config","vas-metric-utils","ready").register("vas-twister-setting",function(e,b,a,h,c){var g=e.$,f={baseAsinMetaData:{},isUpsellCritical:"",hasPrecheckEnabled:""},k=h.vasTwisterMetricConstants.refmarkerPrefixes,d=h.vasTwisterMetricConstants.additionalRequestDataKeys,l=h.vasTwisterMetricConstants.metricPrefixes;return{getSettings:function(a){return"undefined"!==typeof a?f[a]:f},fetchTwisterSetting:function(){var n=g("#ppdb-add-service-checkbox");n.is(":checked")&&
n.prop("checked",!1);var n=b.getSetting("winningWidgetVM"),q=n.winningServicePriceWithPromotionApplied;f.baseAsinMetaData.upsellAsin=n.upsellAsin;f.upsellAsin=n.serviceAsinToOffer;f.baseAsinMetaData.offerlistingId=n.offerListingID;f.baseAsinMetaData.merchantId=n.merchantId;f.baseAsinMetaData.price=n.winningServiceMinPrice;f.isUpsellCritical=n.isUpsellCritical;f.hasPrecheckEnabled=n.hasPrecheckEnabled;f.dynamicStringChangeOnTwisterSelection=n.dynamicStringChangeOnTwisterSelection;f.promotionMessagingWeblab=
"undefined"!==typeof n.promotionMessagingWeblab?n.promotionMessagingWeblab:!1;f.isPromoPriceDisplayed=!e.objectIsEmpty(g.trim(q));f.productAsin=b.getSetting("widgetCommonVM").productAsin;f.zipCode=b.getSetting("widgetCommonVM").zipCode;f.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice;f.mappingSet=b.getSetting("widgetCommonVM").mappingSet;f.sessionId=b.getSetting("widgetCommonVM").sessionId;f.vasTwisterMetricConstants=h.vasTwisterMetricConstants;f.hitParameters=c.createHitParameters(f.vasTwisterMetricConstants);
n=f.hitParameters[a.hitParameterKeys.additionalRequestData];n[d.isPromo]=f.isPromoPriceDisplayed;n[d.isCritical]=f.isUpsellCritical;f.hitParameters[a.hitParameterKeys.additionalRequestData]=n;var n=f.upsellAsin,q=f.productAsin,t=f.baseAsinMetaData.price,x=f.baseAsinMetaData.merchantId,r="vas_bdlppd_fake_twister_"+(!0===f.isUpsellCritical?"1":"0")+"_a_"+f.zipCode;a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.glanceView,
f.hitParameters);a.metric("vas_bdlppd_fake_twister_");a.logRefTag(r,"LocalServicesWidget","Impression",n,"popUp",x,q,t,f.buyboxPrice)},logTwisterInteractionReftag:function(b){var d=f.isUpsellCritical,c=f.upsellAsin,e=f.productAsin,g=f.baseAsinMetaData.price,h=f.baseAsinMetaData.merchantId,m="vas_bdlppd_fake_twister_";f.isPromoPriceDisplayed&&(m="vas_bdplppd_fake_twister_promo_");a.logRefTag(m+(b?"y":"n")+"_"+(!0===d?"1":"0")+"_a","LocalServicesWidget","AddServiceCheck",c,"popUp",h,e,g);a.createCSMNameAndLog(l.tenant,
l.widget,b?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,b?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,f.hitParameters)},logTwisterATCReftag:function(){var b=!0===f.isUpsellCritical?"1":"0",d="vas_bdlppd_fake_twister_atc_"+b,c=f.upsellAsin,e=f.productAsin,g=f.baseAsinMetaData.price,h=f.baseAsinMetaData.merchantId;f.isPromoPriceDisplayed&&(d="vas_bdlppd_fake_twister_atc_promo_"+b);a.createCSMNameAndLog(l.tenant,
l.widget,a.CSMActionTypes.addToCart);a.logRefTag(d,"LocalServicesWidget","CartAdd",c,"popUp",h,e,g,f.buyboxPrice);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.addToCart,f.hitParameters);return!0},logTwisterExpanderReftagAndMetric:function(b){var d=f.upsellAsin,c=f.productAsin,e=f.baseAsinMetaData.merchantId,g=b?"vas_bdlppd_fake_twister_sm_click":"vas_bdlppd_fake_twister_sl_click";a.createCSMNameAndLog(l.tenant,l.widget,b?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints);
a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,b?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints,f.hitParameters);a.increaseMetricBy(g,1);a.logRefTag(g,"LocalServicesWidget","SeeMoreClick",d,"popUp",e,c)},logTwisterSDPRedirectReftagAndMetric:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.redirect,f.hitParameters)}}});p.when("A","vas-twister-setting",
"vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-twister-controller",function(e,b,a,h){var c=e.$,g=c("body"),f=!1,k=function(){b.logTwisterATCReftag()},d=function(){c("#ppdb-add-service-checkbox").prop("checked",!0);var d=b.getSettings("baseAsinMetaData");try{e.trigger("vas:add-service-asin-buybox-event",d),c("#addToCart").unbind("submit.ppdBundles"),c("#addToCart").bind("submit.ppdBundles",k),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",
0)}catch(f){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(f)}c("#vas-fake-twister-include-section").find("i").hasClass("a-icon-extender-collapse")||c("#vas-fake-twister-include-section").click();b.getSettings("isPromoPriceDisplayed")&&b.getSettings("promotionMessagingWeblab")&&(c("#vasTwisterSelectedPromotionMessage").removeClass("aok-hidden"),c("#vasTwisterNotSelectedPromotionMessage").addClass("aok-hidden"));e.trigger("vas:add-widget-state-url",
{preSelectedWidgetValue:b.getSettings("baseAsinMetaData").upsellAsin})},l=function(a){b.getSettings("dynamicStringChangeOnTwisterSelection")&&c("#vas-service-title-text").html(a.attr("data-title"))},n={vasTwisterTrigger:function(f){c(".vas-ppd-swatch-item").removeClass("vas-ppd-swatch-select");f.addClass("vas-ppd-swatch-select");l(f);if("removeOffer"===f.attr("data-twister-action")){c("#ppdb-add-service-checkbox").prop("checked",!1);try{e.trigger("vas:remove-service-asin-buybox-event"),c("#addToCart").unbind("submit.ppdBundles"),
a.increaseMetricBy("a2cFormRemoveEventSend_fail",0),a.metric("a2cFormRemoveEventSend_success"),e.trigger("vas:remove-widget-state-url")}catch(g){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(g)}b.getSettings("isPromoPriceDisplayed")&&b.getSettings("promotionMessagingWeblab")&&(c("#vasTwisterSelectedPromotionMessage").addClass("aok-hidden"),c("#vasTwisterNotSelectedPromotionMessage").removeClass("aok-hidden"));b.logTwisterInteractionReftag(!1)}else d(),
b.logTwisterInteractionReftag(!0)},vasTwisterExpander:function(){c("#vas-fake-twister-include-section").find("i").hasClass("a-icon-extender-collapse")?b.logTwisterExpanderReftagAndMetric(!1):b.logTwisterExpanderReftagAndMetric(!0)}},q=function(){c("#vas-fake-twister-include-section").unbind("click");c("#vas-fake-twister-include-section").bind("click",function(a){n.vasTwisterExpander()});c("#vas-fake-twiseter-detailLink").unbind("click");c("#vas-fake-twiseter-detailLink").bind("click",function(a){b.logTwisterSDPRedirectReftagAndMetric()})},
t=function(){f||(g.undelegate(".vas-ppd-swatch-item","click"),g.delegate(".vas-ppd-swatch-item","click",function(a){a=c(a.currentTarget);a.hasClass("vas-ppd-swatch-select")||n.vasTwisterTrigger(a)}),f=!0)},x=function(){e.off("vas:ldbb-a2c-event:desktop");e.on("vas:ldbb-a2c-event:desktop",function(a){if(c("#ppdb-add-service-checkbox").is(":checked")){var d=b.getSettings("baseAsinMetaData");h.addUpsell(d.upsellAsin,d.offerlistingId,b.getSettings("sessionId"),a)}});e.off("vas:ldbb-upsell-added:desktop");
e.on("vas:ldbb-upsell-added:desktop",function(){b.logTwisterATCReftag()})};e.off("vas:widgetname:twister");e.on("vas:widgetname:twister",function(){c("#vas-service-title-text");t();b.fetchTwisterSetting();b.getSettings("hasPrecheckEnabled")&&(d(),l(c(".vas-ppd-swatch-select")));q();x();c("#vasTwisterRow").removeClass("vas-twister-disabled")})});p.register("vas-twister-xl-config",function(){return{vasTwisterXLMetricConstants:{refmarkerPrefixes:{tenant:"vas",widget:"dftxl"},hitRecordConstants:{pageType:"DetailPage",
subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip"},metricPrefixes:{tenant:"vas",widget:"dftxl"}}}});p.when("A","vas-metrics-publisher","ready").register("vas-twister-page-refresh-common",function(e,b){function a(a){a=document.getElementById(a);var b=[];if(null===a||a===w)return b;a=a.getElementsByTagName("SCRIPT");e.each(a,function(a){b.push(a.innerHTML)});return b}function h(a,b){e.each(b,function(b){var c=document.createElement("script");c.type="text/javascript";c.text=b;b=document.getElementById(a);
null!==b&&b!==w&&b.appendChild(c)})}var c=e.$,g=null,f=function(d){try{var f=d.pageRefreshData,g=[];e.each(d.featuresWithScriptTags,function(b){g.push(a(b))});d.featuresToRefresh.forEach(function(a){c(a).replaceWith(c(f).find(a).prop("outerHTML"))});e.each(d.featuresWithScriptTags,function(a,b){h(a,g[b])});e.trigger("vas:vas-twister-page-refresh-complete",d);b.increaseMetricBy("vasTwisterUpdateFeatures_success",1);b.increaseMetricBy("vasTwisterUpdateFeatures_fail",0)}catch(k){e.trigger("vas:vas-twister-update-features-failed",
d),b.increaseMetricBy("vasTwisterUpdateFeatures_success",0),b.increaseMetricBy("vasTwisterUpdateFeatures_fail",1),b.log(k)}},k=function(a){e.trigger("vas:vas-twister-page-refresh-start",a);null!==g&&g.abort();g=e.ajax(a.ajaxUrl,{method:"POST",timeout:"90000",params:{isVariationalParent:a.isVariationalParent},success:function(c){a.pageRefreshData=c;f(a);b.increaseMetricBy("vasTwisterPageRefresh_success",1);b.increaseMetricBy("vasTwisterPageRefresh_fail",0)},error:function(){e.trigger("vas:vas-twister-page-refresh-failed",
a);b.increaseMetricBy("vasTwisterPageRefresh_success",0);b.increaseMetricBy("vasTwisterPageRefresh_fail",1)}})};return{performPageRefresh:function(a){"undefined"===typeof a.pageRefreshData?k(a):f(a)},abortPageRefreshRequests:function(){null!==g&&g.abort()},restoreInitialData:function(a){try{var f=a.pageRefreshData;e.each(a.featuresToRefresh,function(a){"undefined"!==typeof f[a]&&c(a).replaceWith(f[a])});b.increaseMetricBy("vasTwisterRestoreInitialData_success",1);b.increaseMetricBy("vasTwisterRestoreInitialData_fail",
0);e.trigger("vas:vas-twister-initialdata-restore-complete")}catch(g){b.increaseMetricBy("vasTwisterRestoreInitialData_success",0),b.increaseMetricBy("vasTwisterRestoreInitialData_fail",1),b.log(g)}}}});p.when("A","vas-common-settings","vas-metrics-publisher","vas-twister-xl-config","vas-metric-utils","ready").register("vas-twister-xl-setting",function(e,b,a,h,c){var g=e.$,f={vasTwisterOptions:{},baseAsinMetaData:{},productAsinAndOfferData:{},productPriceInTwisterVariation:{}},k=h.vasTwisterXLMetricConstants.refmarkerPrefixes,
d=h.vasTwisterXLMetricConstants.metricPrefixes,l=function(){var b=f.productAsinAndOfferData.asin,c=f.productAsinAndOfferData.merchantId,g="vas_bdlppd_fake_twister_a_"+f.productAsinAndOfferData.zipCode;a.metric("vas_bdlppd_vas_twister_");a.logRefTag(g,"LocalServicesWidget","Impression","","popUp",c,b,"","");a.createCSMNameAndLog(d.tenant,d.widget,a.CSMActionTypes.glanceView);e.each(f.vasTwisterOptions,function(b,c){var d=a.RefmarkerActionTypes.glanceView;b.isOfferAvailable||(d=a.RefmarkerActionTypes.glanceViewDisabled);
f.hitParameters[a.hitParameterKeys.upsellAsin]=c;a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,d,f.hitParameters)})},n=function(){try{var b=f.productAsinAndOfferData.asin,c=g("li[data-defaultasin\x3d"+b+"] .a-size-mini");c.length&&f.productPriceInTwisterVariation[b]===w&&(f.productPriceInTwisterVariation[b]=c.text());a.increaseMetricBy("saveInitialProductPriceContent_fail",0);a.metric("saveInitialProductPriceContent_success",1)}catch(e){a.createCSMNameAndLog(d.tenant,d.widget,"saveInitialProductError"),
a.increaseMetricBy("saveInitialProductPriceContent_success",0),a.metric("saveInitialProductPriceContent_fail",1),a.log(e)}};return{getProductAsinAndOfferData:function(a){return"undefined"!==typeof a?f.productAsinAndOfferData[a]:f.productAsinAndOfferData},getSettings:function(a){if("undefined"!==typeof a){a=f.vasTwisterOptions[a];var b={};b.asin=a.serviceAsin;b.offerlistingId=a.offerData.offerListingId;b.merchantId=a.offerData.merchantId;b.price=a.offerData.price;return b}},hasPrecheckEnabled:function(){return f.hasPrecheckEnabled},
getVasTwisterOption:function(a){if("undefined"!==typeof a)return f.vasTwisterOptions[a]},getInitialProductPriceContent:function(){return f.productPriceInTwisterVariation},setInitialWidgetSettings:function(){g("#ppdb-add-service-checkbox").is(":checked")&&g("#ppdb-add-service-checkbox").prop("checked",!1);var a=b.getSetting("winningWidgetVM"),d=a.vasTwisterOptions;f.productAsinAndOfferData=a.vasUpsellProductAsinAndOfferData;f.mappingSet=b.getSetting("widgetCommonVM").mappingSet;f.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice;
e.each(d,function(a,b){f.vasTwisterOptions[b]=a});f.vasTwisterXLMetricConstants=h.vasTwisterXLMetricConstants;f.hitParameters=c.createHitParameters(f.vasTwisterXLMetricConstants);f.hasPrecheckEnabled=a.hasPrecheckEnabled;n();l()},logVasTwisterInteractionReftag:function(b,c){b&&(b=f.vasTwisterOptions[c].offerData.price,a.logRefTag("vas_bdlppd_vas_twister_a","LocalServicesWidget","AddServiceCheck",c,"popUp",f.vasTwisterOptions[c].offerData.merchantId,f.productAsinAndOfferData.asin,b),f.hitParameters[a.hitParameterKeys.upsellAsin]=
c,f.hitParameters[a.hitParameterKeys.upsellAsinPrice]=b);c=a.CSMActionTypes.serviceIncluded;a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.serviceIncluded,f.hitParameters);a.createCSMNameAndLog(d.tenant,d.widget,c)},logVasTwistetATCReftag:function(b){a.createCSMNameAndLog(d.tenant,d.widget,a.CSMActionTypes.addToCart);var c=f.productAsinAndOfferData.asin,e=f.vasTwisterOptions[b].offerData.price,g=f.vasTwisterOptions[b].offerData.merchantId;f.hitParameters[a.hitParameterKeys.upsellAsin]=
b;f.hitParameters[a.hitParameterKeys.upsellAsinPrice]=e;a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.addToCart,f.hitParameters);a.logRefTag("vas_bdlppd_vas_twister_atc_","LocalServicesWidget","CartAdd",b,"popUp",g,c,e,"${buybox.priceViewModel.buyingPrice}");return!0},logTwisterExpanderReftagAndMetric:function(b,c){var e=f.vasTwisterOptions[c].offerData.price;a.createCSMNameAndLog(d.tenant,d.widget,b?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints);
f.hitParameters[a.hitParameterKeys.upsellAsin]=c;f.hitParameters[a.hitParameterKeys.upsellAsinPrice]=e;a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,b?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints,f.hitParameters)},getVasTwisterXLMetricConstants:function(){return f.vasTwisterXLMetricConstants},getHitParameters:function(){return f.hitParameters},isMultiQuantityPurchaseEnabled:function(){return b.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled},
isBusinessCustomer:function(){return b.getSetting("widgetCommonVM").businessCustomer}}});p.when("A","vas-twister-page-refresh-common","vas-metrics-publisher","vas-twister-xl-setting","vas-twister-xl-util","ready").register("vas-twister-page-refresh-webView",function(e,b,a,h,c){var g=e.$,f={},k={},d=function(a){a.pageRefreshData=f;b.restoreInitialData(a);n("1.0",a.featuresToRefresh)},l=function(){var a=h.getProductAsinAndOfferData().asin,b=g("#twister_feature_div"),c=g("li[data-defaultasin\x3d"+a+
"]"),a=g("li[data-defaultasin\x3d"+a+"] .a-size-mini"),d=g("#priceblock_ourprice"),f=g("#priceblock_saleprice");0>=b.length||0>=c.length||0>=a.length||(d.length?a.text(d.text()):f.length?a.text(f.text()):a.text(""))},n=function(a,b){e.each(b,function(b,c){g(b).css("opacity",a)})},q=function(){try{var b=h.getInitialProductPriceContent();e.each(b,function(a,b){b=g("li[data-defaultasin\x3d"+b+"] .a-size-mini");b.length&&b.text(a)});a.increaseMetricBy("restoreInitialPriceInProductTwister_fail",0);a.metric("restoreInitialPriceInProductTwister_success",
1)}catch(c){a.increaseMetricBy("restoreInitialPriceInProductTwister_success",0),a.metric("restoreInitialPriceInProductTwister_fail",1),a.log(c)}};e.off("vas:vas-twister-page-refresh-start");e.on("vas:vas-twister-page-refresh-start",function(a){n("0.5",a.featuresToRefresh);g("#vasTwisterRow").addClass("vas-twister-disabled")});e.off("vas:vas-twister-page-refresh-complete");e.on("vas:vas-twister-page-refresh-complete",function(a){k[a.baseOfferMerchantId+a.asin]=a.pageRefreshData;l();n("1.0",a.featuresToRefresh);
g("#vasTwisterRow").removeClass("vas-twister-disabled");e.trigger("vas:twister-update-widgets","hide");e.trigger("vas:add-asin-offer-data-to-cart",a.svcAsin)});e.off("vas:vas-twister-page-refresh-failed");e.on("vas:vas-twister-page-refresh-failed",function(a){n("1.0",a.featuresToRefresh);g("#vasTwisterRow").removeClass("vas-twister-disabled")});e.off("vas:vas-twister-update-features-failed");e.on("vas:vas-twister-update-features-failed",function(a){d(a.featuresToRefresh);n("1.0",a.featuresToRefresh)});
e.off("vas:vas-twister-initialdata-restore-complete");e.on("vas:vas-twister-initialdata-restore-complete",function(){q();e.trigger("vas:remove-asin-offer-data-to-cart");e.trigger("vas:twister-update-widgets","show")});e.off("vas:twister-update-widgets");e.on("vas:twister-update-widgets",function(a){var b=g("#dpFastTrack_feature_div"),c=g("#moreBuyingChoices_feature_div");0<b.length&&("show"===a?b.show():b.hide());0<c.length&&("show"===a?c.show():c.hide())});return{setInitialFeaturesData:function(a){e.each(a,
function(a,b){f[a]=g(a).prop("outerHTML")});e.trigger("vas:twister-update-widgets","show")},performPageRefresh:function(a){a.ajaxUrl=c.getAjaxUrl(a.asin,a.baseOfferMerchantId);a.pageRefreshData=k[a.baseOfferMerchantId+a.asin];a.featuresWithScriptTags=c.getFeaturesWithScriptTags();b.performPageRefresh(a)},abortPageRefreshRequests:function(){b.abortPageRefreshRequests()},restoreInitialPriceInProductTwister:q,restoreInitialData:d,updatePriceInProductTwisterDesktop:l,hideOfferUpdateWidget:function(){g("#vas-twister-price-update-div").hide()},
showOfferUpdateWidget:function(){g("#vas-twister-price-update-div").show()}}});p.when("A","vas-twister-xl-setting","ready").register("vas-twister-xl-util",function(e,b){function a(){return b.isBusinessCustomer()&&b.isMultiQuantityPurchaseEnabled()}function h(){return"{%27disableFreeFormQtyPicker%27:true}"}return{isRefreshRequired:function(a,e){return b.isBusinessCustomer()?a!==e||b.isMultiQuantityPurchaseEnabled()&&!b.hasPrecheckEnabled():a!==e},getAjaxUrl:function(b,e){b="/gp/product/"+b+"?m\x3d"+
e;return a()?b+"\x26vas\x3d"+h():b},getFeaturesWithScriptTags:function(){return b.isMultiQuantityPurchaseEnabled()&&!b.isBusinessCustomer()?["soldByThirdParty_feature_div","quantityLayoutHigh_feature_div"]:[]},disableQuantityRefresh:a,getQueryParamValueToDisableQuantityRefresh:h}});p.when("A","vas-twister-xl-setting","vas-twister-page-refresh-webView","vas-metrics-publisher","vas-twister-xl-util","ready").execute("vas-twister-xl-controller",function(e,b,a,h,c){var g=e.$,f="#buybox_feature_div #desktop_buybox #price_feature_div #unifiedPrice_feature_div #pmpux_feature_div #issuancePriceblockAmabot_feature_div #alternativeOfferEligibilityMessaging_feature_div #applicablePromotionList_feature_div #availability_feature_div #holidayDeliveryMessage_feature_div #dpFastTrack_feature_div #businessOnlyItem_feature_div #shipsFromSoldBy_feature_div #businessPricing_feature_div #smileEligibility_feature_div #holidayAvailabilityMessage_feature_div #moreBuyingChoices_feature_div #companyCompliancePolicies_feature_div".split(" "),
k=!1,d="",l="",n=function(){b.logVasTwistetATCReftag(l)},q=function(){try{e.trigger("vas:remove-service-asin-buybox-event"),g("#addToCart").unbind("submit.ppdBundles"),h.increaseMetricBy("a2cFormRemoveEventSend_fail",0),h.metric("a2cFormRemoveEventSend_success")}catch(a){h.increaseMetricBy("a2cFormRemoveEventSend_success",0),h.metric("a2cFormRemoveEventSend_fail"),h.log(a)}},m=function(a){try{e.trigger("vas:add-service-asin-buybox-event",a),g("#addToCart").bind("submit.ppdBundles",n),h.increaseMetricBy("a2cFormAddEventSend_success",
1),h.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(b){h.increaseMetricBy("a2cFormAddEventSend_success",0),h.increaseMetricBy("a2cFormAddEventSend_fail",1),h.log(b)}},p={vasTwisterExpander:function(a,c){g("#vas-fake-twister-includesection-"+a.attr("data-twister-svcAsin")).find("i").hasClass("a-icon-extender-collapse")?b.logTwisterExpanderReftagAndMetric(!1,c):b.logTwisterExpanderReftagAndMetric(!0,c)},ppdFakeTwisterTrigger:function(h){var n=h.attr("data-twister-svcAsin"),r={};if("undefined"===
typeof n||b.getVasTwisterOption(n).isOfferAvailable)if(g(".vas-ppd-swatch-item").removeClass("vas-ppd-swatch-select"),h.addClass("vas-ppd-swatch-select"),g(".vas-twister-whatsincluded").hide(),g("#vas-twister-title").html(h.attr("data-twister-callToAction")),"removeOffer"===h.attr("data-twister-action"))a.abortPageRefreshRequests(),g("#ppdb-add-service-checkbox").prop("checked",!1),l="undefined",c.isRefreshRequired(d,b.getProductAsinAndOfferData("merchantId"))?(r.featuresToRefresh=f,a.restoreInitialData(r),
d=b.getProductAsinAndOfferData("merchantId"),a.showOfferUpdateWidget()):a.hideOfferUpdateWidget(),q(),b.logVasTwisterInteractionReftag(!1,"ItemOnly"),e.trigger("vas:twister-update-widgets","show");else{!1===k&&(a.setInitialFeaturesData(f),k=!0);g("#ppdb-add-service-checkbox").prop("checked",!0);q();g("#vas-fake-twister-whatsincluded-"+h.attr("data-twister-svcAsin")).show();g("#vas-fake-twister-includesection-"+h.attr("data-twister-svcAsin")).find("i").hasClass("a-icon-extender-collapse")||(g("#vas-fake-twister-includesection-"+
h.attr("data-twister-svcAsin")).unbind("click"),g("#vas-fake-twister-includesection-"+h.attr("data-twister-svcAsin")).bind("click",function(a){p.vasTwisterExpander(h,n)}),g("#vas-fake-twister-includesection-"+h.attr("data-twister-svcAsin")).click());l=n;var w=b.getVasTwisterOption(n).baseOfferMerchantId;c.isRefreshRequired(d,w)?(r.asin=b.getProductAsinAndOfferData("asin"),r.svcAsin=n,r.merchantId=b.getVasTwisterOption(n).offerData.merchantId,r.isVariationalParent=!1,r.featuresToRefresh=f,r.baseOfferMerchantId=
w,a.performPageRefresh(r),d=w,a.showOfferUpdateWidget()):(e.trigger("vas:twister-update-widgets","hide"),m(b.getSettings(h.attr("data-twister-svcAsin"))),a.hideOfferUpdateWidget());b.logVasTwisterInteractionReftag(!0,n)}}};e.off("vas:add-asin-offer-data-to-cart");e.on("vas:add-asin-offer-data-to-cart",function(a){m(b.getSettings(a))});e.off("vas:remove-asin-offer-data-to-cart");e.on("vas:remove-asin-offer-data-to-cart",function(){q()});var r=function(){g(".vas-ppd-swatch-item").unbind("click");g(".vas-ppd-swatch-item").bind("click",
function(a){a=g(a.currentTarget);a.hasClass("vas-ppd-swatch-select")||p.ppdFakeTwisterTrigger(a)})};e.off("vas:widgetname:twister_xl");e.on("vas:widgetname:twister_xl",function(){b.setInitialWidgetSettings();r();d=b.getProductAsinAndOfferData("merchantId");a.restoreInitialPriceInProductTwister();if(b.hasPrecheckEnabled()){a.hideOfferUpdateWidget();var c=g(".vas-ppd-swatch-select");p.ppdFakeTwisterTrigger(c)}g("#vasTwisterRow").removeClass("vas-twister-disabled")})});p.when("A","dp-refresh-handler",
"vas-metrics-publisher","vas-twister-xl-setting","vas-twister-xl-util").register("vas-upsell-page-refresh",function(e,b,a,h,c){var g=e.$,f={featureName:"upsell"},k=function(b){return{pageRefreshUrl:"/gp/page/refresh",ajaxOptions:{method:"POST",timeout:"90000",success:function(){"undefined"===typeof b.svcAsin?e.trigger("vas:xl-twister-update-widgets","show"):(e.trigger("vas:add-asin-offer-data-to-cart",b.svcAsin),e.trigger("vas:xl-twister-update-widgets","hide"));a.increaseMetricBy("vasUpsellPageRefresh_success",
1);a.increaseMetricBy("vasUpsellPageRefresh_fail",0);e.trigger("vas:vas-xl-twister-page-refresh-complete",b)},error:function(){a.increaseMetricBy("vasUpsellPageRefresh_success",0);a.increaseMetricBy("vasUpsellPageRefresh_fail",1);e.trigger("vas:vas-xl-twister-page-refresh-complete",b)}}}},d=function(a,b){e.each(b,function(b,c){g(b).css("opacity",a)})};e.off("vas:vas-xl-twister-page-refresh-start");e.on("vas:vas-xl-twister-page-refresh-start",function(a){d("0.5",a.featuresToGreyOut);g("#vasTwisterRow").addClass("vas-twister-disabled")});
e.off("vas:vas-xl-twister-page-refresh-complete");e.on("vas:vas-xl-twister-page-refresh-complete",function(a){var b=h.getProductAsinAndOfferData().asin,c=g("#twister_feature_div"),f=g("li[data-defaultasin\x3d"+b+"]"),b=g("li[data-defaultasin\x3d"+b+"] .a-size-mini"),e=g("#priceblock_ourprice"),k=g("#priceblock_saleprice");0>=c.length||0>=f.length||0>=b.length||(e.length?b.text(e.text()):k.length?b.text(k.text()):b.text(""));d("1.0",a.featuresToGreyOut);g("#vasTwisterRow").removeClass("vas-twister-disabled")});
e.off("vas:xl-twister-update-widgets");e.on("vas:xl-twister-update-widgets",function(a){var b=g("#dpFastTrack_feature_div"),c=g("#moreBuyingChoices_feature_div");0<b.length&&("show"===a?b.show():b.hide());0<c.length&&("show"===a?c.show():c.hide())});return{performPageRefresh:function(a){var d=k(a),g=new b(f,w,d),h={};h.m=a.merchantId;h.triggerEvent=f.featureName;"undefined"!==typeof a.svcAsin&&c.disableQuantityRefresh()&&(h.vas=c.getQueryParamValueToDisableQuantityRefresh());h=g.createCustomParamsMap({},
h);e.trigger("vas:vas-xl-twister-page-refresh-start",a);g.doPageRefresh(h,d.ajaxOptions,!0)},hideOfferUpdateWidget:function(){g("#vas-twister-price-update-div").hide()},showOfferUpdateWidget:function(){g("#vas-twister-price-update-div").show()},restoreInitialPriceInProductTwister:function(){try{var b=h.getInitialProductPriceContent();e.each(b,function(a,b){b=g("li[data-defaultasin\x3d"+b+"] .a-size-mini");b.length&&b.text(a)});a.increaseMetricBy("restoreInitialPriceInProductTwister_fail",0);a.metric("restoreInitialPriceInProductTwister_success",
1)}catch(c){a.increaseMetricBy("restoreInitialPriceInProductTwister_success",0),a.metric("restoreInitialPriceInProductTwister_fail",1),a.log(c)}}}});p.register("vas-enhanceppd-config",function(){return{enhancedPPDMetricConstants:{refmarkerPrefixes:{tenant:"vas",widget:"eppdb"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",isCritical:"crtcl"},metricPrefixes:{tenant:"vas",widget:"eppdb"}}}});p.when("A","vas-common-settings","vas-metrics-publisher",
"vas-utilities","vas-enhanceppd-config","vas-metric-utils","ready").register("vas-enhanceppd-setting",function(e,b,a,h,c,g){var f={enhancePpdViewModel:{}},k=c.enhancedPPDMetricConstants.refmarkerPrefixes,d=c.enhancedPPDMetricConstants.metricPrefixes;return{getSettings:function(a){return f.hasOwnProperty(a)?f[a]:f},setSettings:function(a,b,c){a&&c?f[a][c]=b:a&&(f[a]=b)},fetchEnhancePpdSetting:function(){f.enhancePpdViewModel=b.getSetting("winningWidgetVM");f.productAsin=b.getSetting("widgetCommonVM").productAsin;
f.zipCode=b.getSetting("widgetCommonVM").zipCode;f.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice;f.isEnhanceUpsellPresence="undefined"===typeof f.enhancePpdViewModel.upsellAsinOfferData?!1:!0;f.sessionId=b.getSetting("widgetCommonVM").sessionId;f.mappingSet=b.getSetting("widgetCommonVM").mappingSet;f.enhancedPPDMetricConstants=c.enhancedPPDMetricConstants;f.hitParameters=g.createHitParameters(c.enhancedPPDMetricConstants);var e,n=!0===f.enhancePpdViewModel.isUpsellCritical?"1":"0",m=f.enhancePpdViewModel.baseAsinOfferData.upsellAsin,
p=f.enhancePpdViewModel.productAsin,x=h.getPriceValue(f.enhancePpdViewModel.winningServiceMinPrice),r=f.enhancePpdViewModel.baseAsinOfferData.merchantId,u=h.getPriceValue(f.buyboxPrice),v=f.zipCode;e=(!1===f.isEnhanceUpsellPresence?"vas_bdlppd_enh_":"vas_bdlppd_enh_upsell_")+n+"_a_"+v;a.logRefTag("vas_bdlppd_ld_"+n+"_a_"+v,"LocalServicesWidget","Impression",m,"popUp",r,p,x,u);a.logRefTag(e,"LocalServicesWidget","Impression",m,"popUp",r,p,x,u);e=f.isEnhanceUpsellPresence?"uppdb":d.widget;a.createCSMNameAndLog(d.tenant,
e,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(k.tenant,f.mappingSet,e,a.RefmarkerActionTypes.glanceView,f.hitParameters)},logPPDBundlesExpander:function(b){a.increaseMetricBy(!1===f.isEnhanceUpsellPresence?"vas_ppd_bdl_sm_clicks":"vas_ppd_bdl_sm_upg_clicks",1);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,b?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints,f.hitParameters);a.createCSMNameAndLog(d.tenant,d.widget,b?a.RefmarkerActionTypes.expandBulletPoints:
a.RefmarkerActionTypes.collapseBulletPoints)},logPPDBundlesATCReftag:function(){a.createCSMNameAndLog(d.tenant,d.widget,a.CSMActionTypes.addToCart);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.addToCart,f.hitParameters)},logCheckboxInteractionReftag:function(b){var c=!0===f.enhancePpdViewModel.isUpsellCritical?"1":"0",e=f.enhancePpdViewModel.baseAsinOfferData.upsellAsin,g=f.enhancePpdViewModel.productAsin,m=h.getPriceValue(f.enhancePpdViewModel.winningServiceMinPrice);
a.logRefTag("vas_bdlppd_"+b+"_"+f.ppdBundlesInteractionSlice+"_"+c+"_a","LocalServicesWidget","AddServiceCheck",e,"popUp",f.enhancePpdViewModel.baseAsinOfferData.merchantId,g,m);a.createCSMNameAndLog(d.tenant,d.widget,"y"===b?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,"y"===b?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,f.hitParameters)},logBuyBackReftagHandler:function(){var b=f.enhancePpdViewModel.baseAsinOfferData.upsellAsin,
c=f.enhancePpdViewModel.productAsin,e="vas_bbk_"+c+"_"+b,g=h.getPriceValue(f.enhancePpdViewModel.winningServiceMinPrice);a.logRefTag(e,"LocalServicesWidget","CartAdd",b,"popUp",f.enhancePpdViewModel.baseAsinOfferData.merchantId,c,g);a.createCSMNameAndLog(d.tenant,d.widget,a.CSMActionTypes.buyBack);a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.buyBack,f.hitParameters);return!0},logPPDBundlesBuyNowReftag:function(){a.createCSMNameAndLog(d.tenant,d.widget,a.CSMActionTypes.buyNow);
a.createRefMarkerAndLog(k.tenant,f.mappingSet,k.widget,a.RefmarkerActionTypes.buyNow,f.hitParameters)}}});p.when("A","vas-enhanceppd-setting","vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-enhanceppd-controller",function(e,b,a,h){var c=e.$,g=function(){b.logPPDBundlesATCReftag()},f=function(){b.logPPDBundlesBuyNowReftag()},k=function(){b.logBuyBackReftagHandler()},d=function(){try{e.trigger("vas:remove-service-asin-buybox-event"),c("#add-to-cart-button").unbind("click.ppdBundles"),
c("#buy-now-button").unbind("click.ppdBundles"),c("#buyBackBuyNow").length&&c(document.body).undelegate("#buyBackBuyNow","submit.vasBuyBackReftag"),a.increaseMetricBy("a2cFormRemoveEventSend_fail",0),a.metric("a2cFormRemoveEventSend_success")}catch(b){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(b)}},l=function(b){try{e.trigger("vas:add-service-asin-buybox-event",b),c("#add-to-cart-button").bind("click.ppdBundles",g),c("#buy-now-button").bind("click.ppdBundles",
f),e.trigger("vas:add-service-asin-buyback-form-event",b),c(document.body).delegate("#buyBackBuyNow","submit.vasBuyBackReftag",k),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(d){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(d)}},n={ppdBundlesCheckBoxHandler:function(){var a,f=c("#ppdBundlesEnhancedWrapper"),e=c("#ppdBundlesEnhancedBox");c("#ppdb-add-service-checkbox").is(":checked")?
(a="y",d(),b.getSettings("isEnhanceUpsellPresence")&&c("#ppdb-upsell-service-checkbox").is(":checked")?l(b.getSettings("enhancePpdViewModel").upsellAsinOfferData):l(b.getSettings("enhancePpdViewModel").baseAsinOfferData),f.addClass("ppdBundlesOrangeBorder").removeClass("ppdBundlesGrayBorder"),e.addClass("ppdBundlesOrangeBox"),null===b.getSettings("ppdBundlesInteractionSlice")&&b.setSettings("ppdBundlesInteractionSlice",1),c("#ppdBundlesExpanderContent").is(":visible")||c("#ppdBundlesExpanderHeadingLink").click()):
(a="n",f.addClass("ppdBundlesGrayBorder").removeClass("ppdBundlesOrangeBorder"),e.removeClass("ppdBundlesOrangeBox"),b.getSettings("isEnhanceUpsellPresence")&&c("#ppdb-upsell-service-checkbox").is(":checked")&&c("#ppdb-upsell-service-checkbox").click(),d());b.logCheckboxInteractionReftag(a);b.setSettings("ppdBundlesInteractionSlice",1)},ppdBundlesUpsellCheckBoxHandler:function(){var a;c("#ppdb-upsell-service-checkbox").is(":checked")?(c("#ppdb-add-service-checkbox").is(":checked")?(d(),l(b.getSettings("enhancePpdViewModel").upsellAsinOfferData)):
c("#ppdb-add-service-checkbox").click(),a="y"):(d(),l(b.getSettings("enhancePpdViewModel").baseAsinOfferData),a="n");b.logCheckboxInteractionReftag(a)}},m=function(){e.off("a:expander:ppdBundlesExpander:toggle:expand");e.on("a:expander:ppdBundlesExpander:toggle:expand",function(a){b.logPPDBundlesExpander(!0)});e.off("a:expander:ppdBundlesExpander:toggle:collapse");e.on("a:expander:ppdBundlesExpander:toggle:collapse",function(a){b.logPPDBundlesExpander(!1)});c("#ppdb-add-service-checkbox").unbind("change");
c("#ppdb-add-service-checkbox").bind("change",function(){n.ppdBundlesCheckBoxHandler()});b.getSettings("isEnhanceUpsellPresence")&&(c("#ppdb-upsell-service-checkbox").unbind("change"),c("#ppdb-upsell-service-checkbox").bind("change",function(){n.ppdBundlesUpsellCheckBoxHandler()}))},p=function(){e.off("vas:ldbb-a2c-event:desktop");e.on("vas:ldbb-a2c-event:desktop",function(a){if(c("#ppdb-add-service-checkbox").is(":checked")){var d;d=b.getSettings("isEnhanceUpsellPresence")&&c("#ppdb-upsell-service-checkbox").is(":checked")?
b.getSettings("enhancePpdViewModel").upsellAsinOfferData:b.getSettings("enhancePpdViewModel").baseAsinOfferData;h.addUpsell(d.upsellAsin,d.offerlistingId,b.getSettings("sessionId"),a)}});e.off("vas:ldbb-upsell-added:desktop");e.on("vas:ldbb-upsell-added:desktop",function(){g()})};e.off("vas:widgetname:enhancedPPD");e.on("vas:widgetname:enhancedPPD",function(){b.fetchEnhancePpdSetting();m();p();c("#ppdb-add-service-checkbox").is(":checked")?(d(),c("#ppdBundlesEnhancedWrapper").addClass("ppdBundlesOrangeBorder").removeClass("ppdBundlesGrayBorder"),
c("#ppdBundlesEnhancedBox").addClass("ppdBundlesOrangeBox"),b.getSettings("isEnhanceUpsellPresence")&&c("#ppdb-upsell-service-checkbox").is(":checked")?l(b.getSettings("enhancePpdViewModel").upsellAsinOfferData):l(b.getSettings("enhancePpdViewModel").baseAsinOfferData)):(c("#ppdBundlesEnhancedWrapper").addClass("ppdBundlesGrayBorder").removeClass("ppdBundlesOrangeBorder"),c("#ppdBundlesEnhancedBox").removeClass("ppdBundlesOrangeBox"))})});p.register("vas-ppdbundle-config",function(){return{ppdBundlesMetricConstants:{refmarkerPrefixes:{tenant:"vas",
widget:"ppdb"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",isCritical:"crtcl"},metricPrefixes:{tenant:"vas",widget:"ppdb"}}}});p.when("A","vas-common-settings","vas-metrics-publisher","vas-utilities","vas-ppdbundle-config","vas-metric-utils","ready").register("vas-ppdbundle-setting",function(e,b,a,h,c,g){var f=e.$,k={ppdBundleViewModel:{}},d=c.ppdBundlesMetricConstants.refmarkerPrefixes,l=c.ppdBundlesMetricConstants.metricPrefixes;
return{getSettings:function(a){return k.hasOwnProperty(a)?k[a]:k},setSettings:function(a,b,c){a&&c?k[a][c]=b:a&&(k[a]=b)},fetchPpdBundleSetting:function(){k.ppdBundleViewModel=b.getSetting("winningWidgetVM");k.productAsin=b.getSetting("widgetCommonVM").productAsin;k.zipCode=b.getSetting("widgetCommonVM").zipCode;k.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice;k.sessionId=b.getSetting("widgetCommonVM").sessionId;k.mappingSet=b.getSetting("widgetCommonVM").mappingSet;k.ppdBundlesMetricConstants=
c.ppdBundlesMetricConstants;k.hitParameters=g.createHitParameters(k.ppdBundlesMetricConstants);var e=f("#ppdb-add-service-checkbox");e.is(":checked")&&e.prop("checked",!1);var e=!0===k.ppdBundleViewModel.isUpsellCritical?"1":"0",m=k.zipCode,p=k.productAsin,x=h.getPriceValue(k.ppdBundleViewModel.baseAsinOfferData.price),r=h.getPriceValue(k.buyboxPrice),u=k.ppdBundleViewModel.baseAsinOfferData.upsellAsin,v=k.ppdBundleViewModel.baseAsinOfferData.merchantId,w="vas_bdlppd_old_"+e+"_a_"+m;a.logRefTag("vas_bdlppd_ld_"+
e+"_a_"+m,"LocalServicesWidget","Impression",u,"popUp",v,p,x,r);a.logRefTag(w,"LocalServicesWidget","Impression",u,"popUp",v,p,x,r);a.metric("bdl_old_gv");a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(d.tenant,k.mappingSet,d.widget,a.RefmarkerActionTypes.glanceView,k.hitParameters)},logCheckboxInteractionReftag:function(b){var c=!0===k.ppdBundleViewModel.isUpsellCritical?"1":"0",e=k.ppdBundleViewModel.baseAsinOfferData.upsellAsin,f=k.productAsin,g=h.getPriceValue(k.ppdBundleViewModel.baseAsinOfferData.price);
h.getPriceValue(k.buyboxPrice);a.logRefTag("vas_bdlppd_"+b+"_1_"+c+"_a","LocalServicesWidget","AddServiceCheck",e,"popUp",k.ppdBundleViewModel.baseAsinOfferData.merchantId,f,g);a.createCSMNameAndLog(l.tenant,l.widget,"y"===b?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(d.tenant,k.mappingSet,d.widget,"y"===b?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,k.hitParameters)},logATCInteraction:function(){a.createCSMNameAndLog(l.tenant,
l.widget,a.CSMActionTypes.addToCart);a.createRefMarkerAndLog(d.tenant,k.mappingSet,d.widget,a.RefmarkerActionTypes.addToCart,k.hitParameters)},logSDPRedirectReftagAndMetric:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(d.tenant,k.mappingSet,d.widget,a.RefmarkerActionTypes.redirect,k.hitParameters);return!0}}});p.when("A","vas-ppdbundle-setting","vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-ppdbundle-controller",function(e,
b,a,h){var c=e.$,g={ppdBundlesCheckBoxHandler:function(){var d;if(c("#ppdb-add-service-checkbox").is(":checked")){d=b.getSettings("ppdBundleViewModel").baseAsinOfferData;b.logATCInteraction();try{e.trigger("vas:add-service-asin-buybox-event",d),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(f){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(f)}d="y"}else{try{e.trigger("vas:remove-service-asin-buybox-event"),
a.increaseMetricBy("a2cFormRemoveEventSend_fail",0),a.metric("a2cFormRemoveEventSend_success")}catch(f){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(f)}d="n"}b.logCheckboxInteractionReftag(d)}},f=function(){c("#ppdb-add-service-checkbox").unbind("change");c("#ppdb-add-service-checkbox").bind("change",function(){g.ppdBundlesCheckBoxHandler()});c("#ppdBundles-estimate-SDP").unbind("click");c("#ppdBundles-estimate-SDP").bind("click",function(){b.logSDPRedirectReftagAndMetric()})},
k=function(){e.off("vas:ldbb-a2c-event:desktop");e.on("vas:ldbb-a2c-event:desktop",function(a){if(c("#ppdb-add-service-checkbox").is(":checked")){var f=b.getSettings("ppdBundleViewModel").baseAsinOfferData;h.addUpsell(f.upsellAsin,f.offerlistingId,b.getSettings("sessionId"),a)}})};e.off("vas:widgetname:ppdBundle");e.on("vas:widgetname:ppdBundle",function(){b.fetchPpdBundleSetting();f();k()})});p.register("vas-regularPPD-config",function(){return{regularPPDMetricConstants:{refmarkerPrefixes:{tenant:"vas",
widget:"rpdp"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip"},metricPrefixes:{tenant:"vas",widget:"rpdp"}}}});p.when("A","vas-common-settings","vas-metrics-publisher","vas-regularPPD-config","vas-metric-utils","ready").register("vas-regularppd-setting",function(e,b,a,h,c){var g,f,k,d,l=h.regularPPDMetricConstants.refmarkerPrefixes,m=h.regularPPDMetricConstants.metricPrefixes;return{fetchRegularPpdSetting:function(){g=b.getSetting("widgetCommonVM").productAsin;
f=b.getSetting("winningWidgetVM").upsellAsin;k=b.getSetting("widgetCommonVM").mappingSet;b.getSetting("widgetCommonVM");b.getSetting("widgetCommonVM");d=c.createHitParameters(h.regularPPDMetricConstants);a.createRefMarkerAndLog(l.tenant,k,l.widget,a.RefmarkerActionTypes.glanceView,d);a.createCSMNameAndLog(m.tenant,m.widget,a.CSMActionTypes.glanceView);a.logRefTag("vas_ppd_cs_"+g+"_"+f);a.logUeMetricIncreaseCount("vas_standard_pdp_show")},logRedirectMetrics:function(){a.createCSMNameAndLog(m.tenant,
m.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(l.tenant,k,l.widget,a.RefmarkerActionTypes.redirect,d)}}});p.when("A","vas-regularppd-setting","vas-metrics-publisher","ready").execute("vas-regularppd-controller",function(e,b,a){var h=e.$,c=function(){h(".sdpRedirect").unbind("click");h(".sdpRedirect").bind("click",function(){b.logRedirectMetrics();a.logUeMetricIncreaseCount("vas_pdp_sdp_redirect");b.logRedirectMetrics()})};e.off("vas:widgetname:regularPPD");e.on("vas:widgetname:regularPPD",
function(){c();b.fetchRegularPpdSetting()})});p.when("A","vas-common-settings","vas-metrics-publisher","ready").register("vas-brandmessaging-setting",function(e,b,a){var h,c,g;return{fetchBrandMessagingSettings:function(){h=b.getSetting("widgetCommonVM").productAsin;c=b.getSetting("winningWidgetVM").upsellAsin;g=b.getSetting("winningWidgetVM").impressionReftag;a.logRefTag(g,"LocalServicesWidget","Impression",c,null,null,h,null,null);a.logUeMetricIncreaseCount("vas_brand_gv")}}});p.when("A","vas-brandmessaging-setting",
"vas-metrics-publisher","ready").execute("vas-brandmessaging-controller",function(e,b,a){var h=e.$,c=function(){h("#vas-brand-messaging-details-redirect").unbind("click");h("#vas-brand-messaging-details-redirect").bind("click",function(){a.logUeMetricIncreaseCount("vas_brand_details_redir")})};e.off("vas:widgetname:brandMessagingDesktop");e.on("vas:widgetname:brandMessagingDesktop",function(){c();b.fetchBrandMessagingSettings()})});p.when("A","vas-widget-const","vas-value-prop-logger","vas-value-prop-constants",
"ready").register("vas-value-prop-controller",function(e,b,a,h){var c=e.$,g=b.COMMON.DOM.VALUE_PROP_T1_SLOT,f=h.VALUE_PROP_T1_WIDGET_NAME,k=function(){var b,h;e.each(c("#"+g).find("[data-a-state]"),function(g,k){h=e.parseJSON(c(g).attr("data-a-state")).key;"vas-value-prop-widget-vm"===h&&(b=e.parseJSON(c(g).html()),a.logGlanceViewRefTagAndCSM(b,f))})};b=function(){k();e.off(h.POPOVER_SHOW_EVENT);e.on(h.POPOVER_SHOW_EVENT,function(b){a.logPopoverShowRefTagAndCSM(f)});c(document.body).undelegate(h.HYPERLINK_TEXT_ID,
h.CLICK_EVENT);c(document.body).delegate(h.HYPERLINK_TEXT_ID,h.CLICK_EVENT,function(){a.logHyperLinkClickRefTagAndCSM(f)})};b();return{initialize:b}});p.when("A","vas-metrics-publisher").register("vas-value-prop-logger",function(e,b){var a=function(a){return{pageAsin:a.productAsin,services:h(a),zip:a.zipCode,additionalRequestData:{zip:a.zipCode,services:h(a)}}},h=function(a){var b=[];e.each(a.serviceOptions,function(a){b.push(a.serviceAsin)});return b},c=function(a,b){return["vas",b,a].join("_")};
return{logHyperLinkClickRefTagAndCSM:function(a){b.logHit(c(b.RefmarkerActionTypes.hyperLinkClick,a));b.logCSMCounter(c(b.RefmarkerActionTypes.hyperLinkClick,a))},logPopoverShowRefTagAndCSM:function(a){b.logHit(c(b.RefmarkerActionTypes.popoverShow,a));b.logCSMCounter(c(b.RefmarkerActionTypes.popoverShow,a))},logGlanceViewRefTagAndCSM:function(e,f){b.logHit(c(b.RefmarkerActionTypes.glanceView,f),a(e));b.logCSMCounter(c(b.RefmarkerActionTypes.glanceView,f))}}});p.when("ready").register("vas-value-prop-constants",
function(){return{CLICK_EVENT:"click",VALUE_PROP_T1_WIDGET_NAME:"valuePropT1",VALUE_PROP_T2_WIDGET_NAME:"valuePropT2",HYPERLINK_TEXT_ID:"#vas-valueProp-hyperLink-text",POPOVER_SHOW_EVENT:"a:popover:afterShow:valuePropClickThrough"}});p.when("A","vas-metrics-publisher","vas-common-settings").register("vas-si-conflicts",function(e,b,a){var h=e.$;return{isSIConflicting:function(){var c;c=!1;"undefined"!==typeof a.getSetting("widgetCommonVM")&&(c=a.getSetting("widgetCommonVM").isWarrantyPresent);(c=c||
null!==document.getElementById("servicesInterstitial")||null!==document.getElementById("attach-warranty-pane"))||(c=0!==h("#abb-interstitial").length)&&b.metric("devicesInterstitialPresentCount");return c},isHijackATC:function(){return"undefined"!==typeof a.getSetting("winningWidgetVM")?a.getSetting("widgetCommonVM").hijackATC:!1}}});p.when("A").register("valueadds_controller",function(e){return{isValueAddsAvailable:function(){return!1}}});p.when("A").register("vsx-services-constants",function(e){return{UNDEFINED:"undefined",
STRING:"string",NUMBER:"number",OBJECT:"object",BOOLEAN:"boolean",FEATURE_NAME:"VSXServices",FEATURE_ATTRIBUTION:"Value Added Services/Discovery/Value Adds Detail Page",ASIN:"asin",ADD_SELECTION_TYPE:"add",DELETE_SELECTION_TYPE:"delete",DELETE:"DELETE",AUI_BUTTON_SELECTED:"a-button-selected",AUI_BUTTON_FOCUS:"a-button-focus",AUI_BUTTON_TOGGLE_GROUP:".a-button-toggle-group",AUI_BUTTON_TOGGLE:".a-button-toggle",AUI_EXPANDER:"a:expander:",AUI_EXPANDER_EXPAND:":toggle:expand",AUI_EXPANDER_COLLAPSE:":toggle:collapse",
CLICK:"click",AUI_CARD_EXPANDED:"a-expander-content-expanded",ARIA_EXPANDED_STATE:"aria-expanded",ARIA_EXPANDED_STATE_VALUE_FALSE:"false",STYLE:"style",CARD_HIDDEN_STYLE:"overflow: hidden; display: none;",COLLAPSE_HEADING_ICON:"a-icon-section-collapse",EXPAND_HEADING_ICON:"a-icon-section-expand",CARD_OPENED:"tp_cc_vsx_dss_open",CARD_CLOSED:"tp_cc_vsx_dss_close",CARD_OPENED_SIMPLE_MESSAGING:"tp_cc_vsx_dss_open_simpleMessaging",CARD_CLOSED_SIMPLE_MESSAGING:"tp_cc_vsx_dss_close_simpleMessaging",CARD_OPENED_BUNDLE:"tp_cc_vsx_dss_open_bundle",
CARD_CLOSED_BUNDLE:"tp_cc_vsx_dss_close_bundle",ASIN_LINK_CLICK:"tp_cc_vsx_dss_asin_clk",ASIN_ADD:"tp_cc_vsx_dss_asin_add",ASIN_REMOVE:"tp_cc_vsx_dss_asin_rem",SEE_MORE_LINK:"tp_cc_vsx_dss_bsm_clk",GLANCE_VIEW:"tp_cc_vsx_dss_gv",GLANCE_VIEW_SIMPLE_MESSAGING:"tp_cc_vsx_dss_gv_simpleMessaging",GLANCE_VIEW_BUNDLE:"tp_cc_vsx_dss_gv_bundle",REF_TAG_BASE_URL:"/gp/product/ajax-handlers/reftag.html/ref\x3d",SIMPLE_MESSAGING_CARD_HEADER:"vsx-services-simpleMessaging-expander-header",SIMPLE_MESSAGING_DETAILS_LINK_ID:"#vsx-services-simpleMessaging-detailsLink",
SIMPLE_MESSAGING_DIV_ID:"#vsx-services-simpleMessaging",SIMPLE_MESSAGING_STATE_ELEMENT:"vsx-services-simpleMessaging-data",SIMPLE_MESSAGING_CARD_CONTENT_SELECTOR:".vsx-services-simpleMessaging .a-expander-content",SIMPLE_MESSAGING_HEADING_ICON_SELECTOR:".vsx-services-simpleMessaging .a-expander-container .a-expander-header .a-icon",SIMPLE_MESSAGING_GV:"vsx_simple_messaging_gv",BUNDLE_CARD_HEADER:"vsx-services-bundle-expander-header",BUNDLE_ASIN_LINK_ID:"#vsx-services-bundle-asinLink",BUNDLE_CARD_ICON_DIV_ID:"#vsx-services-bundle-icon",
BUNDLE_CARD_ICON_CSS:"vsx-services-bundle-icon-css",BUNDLE_CARD_ICON_SELECTED_CSS:"vsx-services-selected-icon-css",BUNDLE_CARD_POST_SELECTION_CLASS:"vsxServices-bundle-postSelection",BUNDLE_CARD_PRE_SELECTION_CLASS:"vsxServices-bundle-preSelection",BUNDLE_CARD_HIDDEN_CLASS:"vsxServices-bundle-hidden",BUNDLE_CARD_INCLUSION_BUTTON_ID:"#vsx-services-bundle-inclusionButton",BUNDLE_CARD_EXCLUSION_BUTTON_ID:"#vsx-services-bundle-exclusionButton",BUNDLE_DIV_ID:"#vsx-services-bundle",BUNDLE_STATE_ELEMENT:"vsx-services-bundle-data",
BUNDLE_CARD_CONTENT_SELECTOR:".vsx-services-bundle .a-expander-content",BUNDLE_HEADING_ICON_SELECTOR:".vsx-services-bundle .a-expander-container .a-expander-header .a-icon",BUNDLE_GV:"vsx_bundle_gv",BUNDLE_ASIN_MANDATORY:"vsx_bundle_asin_mandatory",BUNDLE_ASIN_ADDED:"vsx_bundle_asin_add",BUNDLE_ASIN_REMOVED:"vsx_bundle_asin_removed"}});p.when("A","cc-manager","vsx-services-constants").register("vsx-services-twister-registration",function(e,b,a){var h=e.$,c={init:function(){},validateInputParams:function(b){return b&&
typeof b!==a.UNDEFINED&&b.itemType===a.ASIN&&typeof b.asin===a.STRING&&typeof b.offerListingId===a.STRING?1:0},cardCollapse:function(){g(a.BUNDLE_CARD_CONTENT_SELECTOR,a.BUNDLE_HEADING_ICON_SELECTOR);g(a.SIMPLE_MESSAGING_CARD_CONTENT_SELECTOR,a.SIMPLE_MESSAGING_HEADING_ICON_SELECTOR)}},g=function(b,c){h(b).removeClass(a.AUI_CARD_EXPANDED).attr(a.ARIA_EXPANDED_STATE,a.ARIA_EXPANDED_STATE_VALUE_FALSE).attr(a.STYLE,a.CARD_HIDDEN_STYLE);h(c).removeClass(a.COLLAPSE_HEADING_ICON).addClass(a.EXPAND_HEADING_ICON)};
return{selectionUpdate:function(a,c){return b.ccSelectionUpdate(a,c)},registerFeature:function(){b.registerFeature({featureName:a.FEATURE_NAME,featureAttribution:a.FEATURE_ATTRIBUTION},c)},cardExpanderListener:function(){b.cardExpanded(a.FEATURE_NAME)}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("AmazonCertifiedDetailPageAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("A","ready").execute(function(a){var c=a.$,d=function(a){b.ue&&b.ue.count&&b.ue.count(a,1)},f=a.debounce(function(){var a=c("#amazon-certified-content");a.length&&!a.data("amazon-certified-render-counter-logged")&&(d("cetech-ac-badge-render"),a.data("amazon-certified-render-counter-logged",
!0))},1E3);a.on("a:popover:afterShow:AmazonCertifiedPopover a:popover:afterShow:AmazonCertifiedSecondaryView a:sheet:afterShow:AmazonCertifiedSheet",function(b){d("cetech-ac-explanatory-view-show");var e;b=c(".amazonCertifiedPageState").find("script").html();try{e=a.parseJSON(b)}catch(f){e={}}e=(e||{}).featuredCertificationShortId;c.get("/gp/product/ajax-handlers/reftag.html/ref\x3d"+(e?"amazon_certified_learn_more_"+e:"amazon_certified_learn_more"))});a.on("a:pageUpdate",f);f()})});
/* ******** */
(function(c){var f=window.AmazonUIPageJS||window.P,h=f._namespace||f.attributeErrors,b=h?h("TAFCopyToClipboardAssets"):f;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,f,h){});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,l=e._namespace||e.attributeErrors,f=l?l("DetailPageAttachAssets",""):e;f.guardFatal?f.guardFatal(g)(f,window):f.execute(function(){g(f,window)})})(function(g,e,l){"use strict";g.when("A").register("attach-variant-registration",function(f){var b={};return{registerVariantFlag:function(f){if(b.hasOwnProperty(f))throw"Variant flag already registered";b[f]=!0},getVariantFlag:function(f){return b.hasOwnProperty(f)}}});"use strict";g.when("A").register("attach-baselink",
function(){var f=null;g.when("BaseLinkFormHelper").execute(function(b){f=b});return{createBaseLinkFormFields:function(b,h){return f?f.addBaseLinkFields(b,h):null}}});"use strict";g.when("A").register("attach-external-atc-interceptor",function(f){var b=f.$,h=[],e=[],d=!1,a=!1,k=function(){a=!0},c=function(a){var c=e.indexOf(a);-1<c&&(a=b("#attach_add_accessory_alert_"+c),c=b("#attach_add_accessory_button_"+c),a&&c&&(a.removeClass("aok-hidden"),c.addClass("aok-hidden")))};return{updateAttachModule:function(a){k&&
(d?c(a):h.push(a))},loadAttachModule:function(b){if(a)for(d=!0,e=b;0<h.length;)b=h.shift(),c(b)},unloadAttachModule:function(){d=!1;e=[]},enableModule:k}});"use strict";g.when("A","attach-common","attach-variant-registration").register("attach-weblabs",function(f,b,e){function g(a){var b=f.$(a).val();a=[];if(b&&0<b.length)for(var b=b.slice(1,-1).split(","),d=0;d<b.length;d++){var k=b[d].trim();0<k.length&&a.push(k)}return a}var d={},a=d.Selectors={CORE_FREE_SHIPPING_MESSAGE:"#attach-core-free-shipping-message",
CLIENT_SIDE_ATTACH_WEBLABS:"#attach-weblabsToTriggerClientSide",CLIENT_SIDE_EMPTY_ASIN_LIST_WEBLABS:"#attach-weblabsToTriggerClientSideWhenEmptyAsinList",WEBLABS_TO_TRIGGER_ON_ADD_TO_CART:"#attach-weblabsToTriggerOnAddToCart",SHOW_ACCESSORY_COUPONS_DSS:"#attach-accessory-coupons-dss",SHOW_ACCESSORY_COUPONS_MBS:"#attach-accessory-coupons-mbs",DEBUG_IS_DEBUG:"#attach-debug-isDebug",DEBUG_QUERY_STRING:"#attach-debug-queryString",ATTACH_MARKETPLACE_ID:"#attach-marketplaceId"},k=d.Marketplaces={IN:"A21TJRUUN4KGV"};
d.isWarrantyPaneSuppressed=function(){return f.$(a.ATTACH_MARKETPLACE_ID).val()===k.IN};d.isShowAccessoryCouponsDssEnabled=function(){return b.elementExists(a.SHOW_ACCESSORY_COUPONS_DSS)};d.isShowAccessoryCouponsMbsEnabled=function(){return b.elementExists(a.SHOW_ACCESSORY_COUPONS_MBS)};d.isCoreFreeShippingMessageEnabled=function(){return b.elementExists(a.CORE_FREE_SHIPPING_MESSAGE)};d.isInstallmentsDssIntegrationEnabled=function(){return e.getVariantFlag("DP_INSTALLMENTS_DSS_231673:T1")};d.isAttachDebugParametersEnabled=
function(){return 0<f.$(a.DEBUG_IS_DEBUG).length||0<f.$(a.DEBUG_QUERY_STRING).length};d.isAttachDynamicBundlingEnabled=function(){return e.getVariantFlag("HCTP_DP_ATTACH_DYNAMIC_BUNDLING_MOBILE_249346:T1")};d.isWarrantyServerSideDSSEnabled=function(){return e.getVariantFlag("WTY_DSS_SERVERSIDE_273709:T1")};d.isWarrantyServerSideMBSEnabled=function(){return e.getVariantFlag("WTY_MBS_SERVERSIDE_273712:T1")};d.isTradeInDSSEnabled=function(){return e.getVariantFlag("CETECH_TRADEIN_ATTACH_DSS_EXPERIMENT_318373:T1")};
d.servicesInterstitialDeprecated=function(){return b.elementExists("#attachSIDeprecated")};d.getWeblabsToTriggerClientSide=function(){return g(a.CLIENT_SIDE_ATTACH_WEBLABS)};d.getWeblabsToTriggerClientSideForEmptyAsinList=function(){return g(a.CLIENT_SIDE_EMPTY_ASIN_LIST_WEBLABS)};d.getWeblabsToTriggerOnAddToCart=function(){return g(a.WEBLABS_TO_TRIGGER_ON_ADD_TO_CART).map(function(a){return a.split(":")[0]})};d.getAllWeblabsToTriggerClientSide=function(){var a=d.getWeblabsToTriggerClientSide(),a=
a.concat(d.getWeblabsToTriggerClientSideForEmptyAsinList());return a.concat(d.getWeblabsToTriggerOnAddToCart())};d.triggerClientSideWeblabs=function(a){a=a||[];a=a.concat(d.getAllWeblabsToTriggerClientSide());0<a.length&&(a=f.$.param({weblabs:a},!0),f.$.post("/gp/product/features/aloha-ppd/getTreatmentAndRecordWeblabs.html",a))};return d});"use strict";g.when("A").register("attach-logging",function(f){var b={},h,g,d;b.NEXUS={PRODUCER_ID:"atch",ACCESSORY_IMPRESSIONS_PREFIX:"attach.AccessoryImpressions.",
ACCESSORY_IMPRESSIONS_SCHEMA_VERSION:"10",ADD_ACCESSORY_PREFIX:"attach.AddAccessoryToCart.",ADD_ACCESSORY_SCHEMA_VERSION:"14",ADD_WARRANTY_PREFIX:"attach.AddWarrantyToCart.",ADD_WARRANTY_SCHEMA_VERSION:"5",WARRANTY_IMPRESSION_PREFIX:"attach.WarrantyImpression.",WARRANTY_IMPRESSION_SCHEMA_VERSION:"6",DSS_WARNING_MESSAGE_PREFIX:"attach.DssWarningMessages.",DSS_WARNING_MESSAGE_VERSION:"2",PROMOTION_CLAIMED_PREFIX:"attach.ClaimPromotion.",PROMOTION_CLAIMED_SCHEMA_VERSION:"2",ACCESSORY_TYPE:{ACCESSORY:"accessory",
WARRANTY:"warranty"}};b.FEATURES={DSS:"dss"};b.REF_TAGS={WARRANTY_IMPRESSION:"dp_atch_dss_w_i_",WARRANTY_ADD_TO_CART:"dp_atch_dss_w_y_"};b.CSM_METRICS={ATTACH_BASE_ATC_CLICK:"attachDesktopBaseATCClick",ATTACH_BASE_ATC_FAILURE:"ATTACH_DSS_ADD_BASE_FAILURE",ATTACH_BASE_ATC_SUCCESS:"ATTACH_DSS_ADD_BASE_SUCCESS",ATTACH_CART_CLICK:"ATTACH_DSS_CART_BUTTON_CLICK",ATTACH_CHECKOUT_CLICK:"ATTACH_DSS_CHECKOUT_CLICK",ATTACH_GET_CART_DESCRIPTION_FAILURE:"ATTACH_DSS_GET_CART_DESCRIPTION_AJAX_FAILURE",ATTACH_GET_CART_DESCRIPTION_SUCCESS:"ATTACH_DSS_GET_CART_DESCRIPTION_AJAX_SUCCESS",
ATTACH_SHOW_LESS:"attachDesktopShowLess",ATTACH_SHOW_MORE:"attachDesktopShowMore",ATTACH_SIDE_SHEET_CLOSE:"attachDesktopSideSheetClose",ATTACH_UPSELL_ATC_CLICK:"attachDesktopUpsellATCClick",ATTACH_UPSELL_ATC_FAILURE:"ATTACH_DSS_ADD_ACCESSORY_FAILURE",ATTACH_UPSELL_ATC_LATENCY:"attach_desktop_upsell_atc_latency",ATTACH_UPSELL_ATC_SUCCESS:"ATTACH_DSS_ADD_ACCESSORY_SUCCESS",MINI_DP_ATC:"attachDesktopMiniDPATC",MINI_DP_BACK:"attachDesktopMiniDPBack",MINI_DP_CANCEL:"attachDesktopMiniDPCancel",MINI_DP_CAROUSEL_THUMBNAIL_CHANGE:"attachDesktopMiniDPCarouselThumbnailChange",
MINI_DP_DWELL_TIME:"attach_desktop_mini_dp_dwell_time",MINI_DP_OPEN:"attachDesktopMiniDPOpen",TRADEIN_LOAD_FAILURE:"ATTACH_TRADEIN_LOAD_FAILURE",TRADEIN_LOAD_TIMEOUT:"ATTACH_TRADEIN_LOAD_TIMEOUT"};b.ENDPOINTS={REF_TAG:"/gp/product/ajax-handlers/reftag.html?ref_\x3d"};b.initialize=function(a,b){h=a;g=b};b.setPayloadBuilder=function(a){d=function(){var d=a();d.feature=h;d.obfuscatedMarketplaceId=g||e.ue_mid;d.producerId=b.NEXUS.PRODUCER_ID;d.requestId=b.getRandomHexString();return d}};b.getRandomHexString=
function(){return Date.now().toString(10)+Math.random().toString(16).substring(2,13)};b.log=function(a,d){e.ue&&e.ue.event&&e.ue.event(a,b.NEXUS.PRODUCER_ID,d,{ssd:!0})};b.logAccessoryAddToCart=function(a){var f=b.NEXUS.ADD_ACCESSORY_PREFIX+b.NEXUS.ADD_ACCESSORY_SCHEMA_VERSION,c=d();c.type=b.NEXUS.ACCESSORY_TYPE.ACCESSORY;c.displayPosition=parseInt(a.index)+1;c.accessoryAsin=a.asin;c.accessoryAsinPrice=a.priceFormatted;c.accessoryItemCurrencySymbol=a.currencySymbol;c.accessoryItemPriceDecimal=a.priceDecimal;
c.couponType=a.couponType;c.couponDecimal=a.couponDecimal;c.dealType=a.dealType;c.dealPercentSavings=a.dealPercentSavings;c.dealDollarAmount=a.dealDollarAmount;c.categoryDisplayPosition=parseInt(a.categoryIndex)+1;c.categoryTitle=a.categoryTitle;c.displayPositionWithinCategory=parseInt(a.asinIndexWithinCategory)+1;b.log(c,f)};b.logAccessoryImpressions=function(a){var f=b.NEXUS.ACCESSORY_IMPRESSIONS_PREFIX+b.NEXUS.ACCESSORY_IMPRESSIONS_SCHEMA_VERSION,c=d();c.accessories=[];for(var e=0;e<a.length;e++){var g=
a[e];c.accessories.push({displayPosition:parseInt(g.index)+1,asin:g.asin,price:g.priceFormatted,currencySymbol:g.currencySymbol,priceDecimal:g.priceDecimal,couponType:g.couponType,couponDecimal:g.couponDecimal,dealType:g.dealType,dealPercentSavings:g.dealPercentSavings,dealDollarAmount:g.dealDollarAmount,categoryDisplayPosition:parseInt(g.categoryIndex)+1,categoryTitle:g.categoryTitle,displayPositionWithinCategory:parseInt(g.asinIndexWithinCategory)+1})}b.log(c,f)};b.logWarrantyAddToCart=function(a){var f=
b.NEXUS.ADD_WARRANTY_PREFIX+b.NEXUS.ADD_WARRANTY_SCHEMA_VERSION,c=d();c.asin=a.asin;c.price=a.priceFormatted;c.warrantyCurrencySymbol=a.currencySymbol;c.warrantyPriceDecimal=a.priceDecimal;b.log(c,f);b.logWarrantyRefTag(b.REF_TAGS.WARRANTY_ADD_TO_CART,a.asin)};b.logWarrantyImpression=function(a){var f=b.NEXUS.WARRANTY_IMPRESSION_PREFIX+b.NEXUS.WARRANTY_IMPRESSION_SCHEMA_VERSION,c=d();c.asin=a.asin;c.price=a.priceFormatted;c.warrantyCurrencySymbol=a.currencySymbol;c.warrantyPriceDecimal=a.priceDecimal;
b.log(c,f);b.logWarrantyRefTag(b.REF_TAGS.WARRANTY_IMPRESSION,a.asin)};b.logWarrantyRefTag=function(a,e){var c=d().baseAsin;f.get(b.ENDPOINTS.REF_TAG+(a+c+"_"+e))};b.logSecondarySheetRefTag=function(a){var e=d().baseAsin;f.get(b.ENDPOINTS.REF_TAG+(a+"_"+e))};b.logMapleError=function(){e.ue&&e.ue.count&&e.ue.count("MAPLE::DSS::Error",(e.ue.count("MAPLE::DSS::Error")||0)+1)};b.logCount=function(a,b){e.ue&&e.ue.count&&(b=b||1,e.ue.count(a,(e.ue.count(a)||0)+b))};b.logDSSWarningMessage=function(a){var f=
b.NEXUS.DSS_WARNING_MESSAGE_PREFIX+b.NEXUS.DSS_WARNING_MESSAGE_VERSION,c=d();b.log({quantity:c.quantity.toString(),baseAsin:c.baseAsin,warningMessage:a},f)};b.logPromotionClaimed=function(a){var f=b.NEXUS.PROMOTION_CLAIMED_PREFIX+b.NEXUS.PROMOTION_CLAIMED_SCHEMA_VERSION,c=d();c.asin=a.asin;c.accessoryCurrencySymbol=a.currencySymbol;c.accessoryPriceDecimal=a.priceDecimal;c.displayPosition=a.index+1;null!==a.couponType&&(c.promoDecimal=a.couponDecimal,c.promoDecimalType=a.couponType,c.promoType="coupon");
b.log(c,f)};b.isFunction=function(a){return"function"===typeof a};b.beginLatencyCapture=function(a){b.isFunction(e.uet)&&e.uet("bb",a,{wb:1})};b.endLatencyCapture=function(a){b.isFunction(e.uex)&&e.uex("ld",a,{wb:1})};return b});"use strict";g.when("A","attach-logging").register("attach-maple",function(f,b){var e={},g;e.initialize=function(){g=!1};e.loadBannerHTML=function(){var d=f.$.Deferred(),a={};g&&(a.cart=null);f.post("/gp/cobrandcard/dss-maple-banner.html",{params:a,success:function(a){d.resolve(a)},
error:function(){b.logMapleError();d.resolve(null)}});return d.promise()};e.suppressMathBox=function(){g=!0};e.updateMathBox=function(b){"undefined"!==typeof mapleMathBox&&null!==mapleMathBox&&mapleMathBox.updateMapleMath({totalCost:b})};return e});"use strict";g.when("A","attach-desktop","dp-util-cookie","cf").execute(function(f,b,e){"000-0000000-8675309"===f.$("#attach-sessionId").val()&&f.$("#attach-sessionId").val(e("session-id"))})});
/* ******** */
(function(c){var e=window.AmazonUIPageJS||window.P,g=e._namespace||e.attributeErrors,a=g?g("DetailPageExpertContentAssets",""):e;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,e,g){c.when("A","Airy","ready").execute(function(a,m){function n(b){var c=b.parentId,d=b.modal;b=d.width;var d=d.height,f=.8*a.$(e).width(),m=.7*a.$(e).height(),f=Math.min(1.5,Math.min(f/b,m/d));a.$("#"+c).width(f*b).height(f*d)}function k(b){var e=b.parentId,d=b.metrics,f=b.resources,
g=b.initialVolume,n=d.videoId,k=d.client,l=d.marketplaceId,t=d.requestId,d=d.session,v=f.mediaUrl,w=f.postMediaSlateUrl,f=f.preMediaSlateUrl,p=b.modal.modalId;b=q.airySwfUrl;var r=m.isMobilePlatform(),h=void 0,u={parentId:e,contentId:n,mediaSourceInfo:v,swfUrl:b,slateImages:{preloadSlate:f,postMediaSlate:w},foresterMetadataParams:{client:k,method:r?"MobileDetailPage":"DetailPage",marketplaceId:l,requestId:t,session:d},bindings:{canplay:function(){h.setVolume(g)},play:function(){r&&h.enterFullScreen()}}};
r?h=m.embed(u):(a.on("a:popover:beforeShow:"+p,function(){c.when("a-modal").execute(function(a){(a=a.get(p))&&a.refresh();h?h.replay():(h=m.embed(u),h.play())})}),a.on("a:popover:afterHide:"+p,function(){h&&h.pause()}))}function g(){var b=q.airyCssUrl;0<l.length&&(b=a.$("\x3clink\x3e").attr("rel","stylesheet").attr("href",b),a.$("head").append(b))}var q=a.state("airyAssets"),l=a.state("dpreviewVideosMetadata");q&&l&&(g(),a.each(l,function(a){n(a);k(a)}),a.$(e).resize(a.debounce(function(){a.each(l,
n)},50)))});"use strict";c.when("A","ready").execute(function(a){a.$("a[data-ec-metrics]").each(function(c,g){var k=a.$(g),t=k.attr("data-ec-metrics");k.click(function(){e.ue.count(t,1)})})});"use strict";c.when("A","ready").execute(function(a){var c=a.$(".dpr-review-date").text();c&&""!==c.trim()||(a=a.$(".dpr-badge \x3e .dpr-award"),a.length&&a.css({marginTop:-a.height()/2}))})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageCommonOffersAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(n){var p=window.AmazonUIPageJS||window.P,l=p._namespace||p.attributeErrors,a=l?l("SmartShelfAssets",""):p;a.guardFatal?a.guardFatal(n)(a,window):a.execute(function(){n(a,window)})})(function(n,p,l){n.when("A","atf").register("smart-shelf-desktop",function(a){function n(d,c){var b={clientName:"SmartShelf",ASIN:d.find("input[name\x3d'ASIN']").val(),verificationSessionID:d.find("input[name\x3d'session-id']").val(),offerListingID:d.find("input[name\x3d'"+c+"']").val(),quantity:d.find("input[name\x3d'quantity'], select[name\x3d'quantity']").val(),
registryID:d.find("input[name\x3d'sourceCustomerOrgListID']").val(),registryItemID:d.find("input[name\x3d'sourceCustomerOrgListItemID']").val()};d.is(".ccxss_desktop_atc_form")||(b.snsOptIn=a.$("input[name\x3d'snsOptIn']").val(),b.rcxOrdFreq=a.$("input[name\x3d'rcxOrdFreq']").val(),b.snsOfferListingID=a.$("input[name\x3d'snsOfferListingID']").val(),b.snsMerchantID=a.$("input[name\x3d'snsMerchantID']").val(),b.momAsin=a.$("input[name\x3d'momAsin']").val(),b.snsAddressId=a.$("input[name\x3d'snsAddressId']").val(),
b.snsMostCommonFrequency=a.$("input[name\x3d'snsMostCommonFrequency']").val(),b.snsOnmlOfferId=a.$("input[name\x3d'snsOnmlOfferId']").val());if(b.quantity===l||"samplingOfferListingID"===c)b.quantity=1;c=d.find(".abbListItem");c.length&&c.each(function(d){var c=a.$(this),e=c.find("input[id^\x3d'mbb-offer']"),g=c.find("input[name^\x3d'asin']"),c=c.find("input[name^\x3d'quantity']");e[0].checked&&(a.$("#csxswWarrantyInclude").addClass("aok-hidden"),b["ASIN.warranty"+d]=g[0].value,b["offerListingID.warranty"+
d]=e[0].value,b["quantity.warranty"+d]=c[0].value)});if(d.find(".atcFormServiceAsinData").length){c=d.find(".atcFormServiceAsinData[name^\x3d'asin']");var g=d.find(".atcFormServiceAsinData[name^\x3d'offeringID']"),e=d.find(".atcFormServiceAsinData[name^\x3d'quantity']");c.length&&g.length&&e.length&&(b[c[0].id]=c[0].value,b[g[0].id]=g[0].value,b[e[0].id]=e[0].value)}d.find("#freeSampleOfferListingID")&&d.find("#freeSampleOfferListingID").val()&&""!==d.find("#freeSampleOfferListingID").val()&&(b["ASIN.sample"]=
a.$("input#csxfsSelectedAsin").val(),b["offeringListingID.sample"]=d.find("#freeSampleOfferListingID").val(),b["quantity.sample"]=1);return b}var h,f,q,w,t,u={},r={},e=p.ue,x=a.$(".ccxss_desktop_atc_form").length,z=function(d,c){a.$(d).addClass("aok-hidden");a.$(c).removeClass("aok-hidden")},A=function(a){var c="";a.length&&null!==a.prop("action")&&(c=a.prop("action"));var b="",e=c.search("ref\x3d");a.length&&-1!==e&&(b=c.substr(e,c.length));return b},m=function(d){var c=a.$(this),b=A(c),g={sessionID:c.find("input[name\x3d'session-id']").val(),
clientName:"SmartShelf"},h=function(){c.unbind("submit",m);c.submit()},f=function(b,f){(function(g){return a.on("SUCCESS_CALL_BACK"+c.attr("id"),function(f){b&&b.isOK?(p.$Nav.when("api.setCartCount").run(function(a){a(f)}),"main"!==d.data.buttonType||q?(f<=g||e&&e.count&&e.count("smartShelfAccessoriesAdded",1),z(c.find(".ccxss_atc_spinner"),c.find(".ccxss_success_message"))):(a.$(".smartShelfFailure").addClass("aok-hidden"),a.$(".smartShelfSuccess").removeClass("aok-hidden"),t||(0===x&&(x=a.$(".ccxss_desktop_atc_form").length),
e&&e.count&&e.count("smartShelfAccessoriesSeen",x),e&&e.count&&e.count("smartShelfShowSecondaryPanel",1),t=!0),w.animateIn(u[d.data.buttonId]),q=!0)):h();a.off("SUCCESS_CALL_BACK"+c.attr("id"))})})(f);k("SUCCESS_CALL_BACK"+c.attr("id"),g)},k=function(c,b){a.post("/gp/api/cart/1.0/get-cart-count.json",{params:b,success:function(b){var d;b&&b.isOK&&b.total&&b.total.numActiveItem!==l&&(d=b.total.numActiveItem);a.trigger(c,d)},error:h})};"ss"===d.data.buttonType&&(a.$(c.find(".csxsw_item_atc")).addClass("aok-hidden"),
a.$(c.find(".ccxss_atc_spinner")).removeClass("aok-hidden"));a.on("ATC_CALL_BACK"+c.attr("id"),function(e){a.post("/gp/add-to-cart/json/"+b,{params:n(c,r[d.data.buttonId]),success:function(a){f(a,e)},error:h});a.off("ATC_CALL_BACK"+c.attr("id"))});k("ATC_CALL_BACK"+c.attr("id"),g);d.preventDefault()},v=function(d){a.$(d.data.button).closest("form").bind("submit",{buttonType:"main",buttonId:d.data.button},m);a.$(".ccxss_desktop_atc_form").bind("submit",{buttonType:"ss",buttonId:"smartShelfButton"},
m)},k=function(d){a.$(d).closest("form").unbind("submit",m);a.$(".ccxss_desktop_atc_form").length&&a.$(".ccxss_desktop_atc_form").unbind("submit",m)},y=function(){var d=a.$("#smartShelfSamplingBuyBoxReplace");if(0!==d.length){var c=a.$("#toggleBuyBox #sampling");c.children().addClass("aok-hidden");c.append(d);d.removeClass("aok-hidden")}};return{init:function(d,c,b){w=d;h=a.state("smartShelfVASInfo");a.state("accessoryInfo");t=q=!1;u[b]=c;r[b]="offerListingID";r.smartShelfButton="offerListingID";
a.$("#"+c+"_secondaryPanelBackButton").click(function(){q=!1;y();k(b)});f=a.$("#"+c+"_actionPanelSecondaryPanelDivider");f.addClass("smartShelfDivider");f.removeClass("actionPanelSecondaryPanelDivider");a.$(".ccxsmartShelf .plsims").hide();h!==l&&h.hideSmartShelf||(k(b),a.$(b).unbind("click",v),a.$("#ccxssContent").children().not(".aok-hidden").length&&a.$(b).bind("click",{button:b},v))},initV2:function(d,c,b,e){w=d;h=a.state("smartShelfVASInfo");a.state("accessoryInfo");t=q=!1;u[b]=c;r[b]=e;r.smartShelfButton=
"offerListingID";a.$("#"+c+"_secondaryPanelBackButton").click(function(){q=!1;y();k(b)});f=a.$("#"+c+"_actionPanelSecondaryPanelDivider");f.addClass("smartShelfDivider");f.removeClass("actionPanelSecondaryPanelDivider");a.$(".ccxsmartShelf .plsims").hide();h!==l&&h.hideSmartShelf||(k(b),a.$(b).unbind("click",v),a.$("#ccxssContent").children().not(".aok-hidden").length&&a.$(b).bind("click",{button:b},v))},undelegateFormHandlers:k,undelegateAllHandlers:function(){Object.keys(u).forEach(function(d){a.$(d).closest("form").unbind("submit",
m)});a.$(".ccxss_desktop_atc_form").length&&a.$(".ccxss_desktop_atc_form").unbind("submit",m)}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageFeaturesAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(b){var f=window.AmazonUIPageJS||window.P,h=f._namespace||f.attributeErrors,d=h?h("BuyBoxRefreshAUIAssets",""):f;d.guardFatal?d.guardFatal(b)(d,window):d.execute(function(){b(d,window)})})(function(b,f,h){b.when("A","dp-refresh-handler").register("buybox-refresh-util",function(d,e){function b(c){g.each([{key:"timeOutInMs",type:"number"},{key:"eventCallback",type:"function"},{key:"rowFeatureName",type:"string"},{key:"rowEventType",type:"string"},{key:"refreshEventName",type:"string"},{key:"buyBoxType",
type:"string"}],function(a,d){var b=d.key,e=d.type;if(b in c&&typeof c[b]!==e)throw new TypeError(b+" should be of type "+e);})}var g=d.$,a={BB_ACCORDION_NAME:"buybox-accordion",TIME_OUT_MS:4E4,BB_TYPE_NEW:"new",REFRESH_EVENT_NEW:"newbuybox",BB_FEATURE_NEW:"newAccordionRow",ACCORDION_SELECT_EVENT:"select",CENTER_DIV:"centerCol",RIGHT_DIV:"rightCol",TWISTER_DIV:"twister_feature_div",PRICE_DIV_MOBILE:"mobile_unifiedPrice_feature_div",BB_DIV_MOBILE:"mobile_buybox_feature_div"};return{bbConstants:a,validateParams:b,
getDefaultRefreshOptions:function(c){var b={timeOutInMs:a.TIME_OUT_MS,buyBoxType:a.BB_TYPE_NEW,refreshEventName:a.REFRESH_EVENT_NEW,effectedElementIds:[a.TWISTER_DIV,a.PRICE_DIV_MOBILE,a.BB_DIV_MOBILE],rowFeatureName:a.BB_FEATURE_NEW,rowEventType:a.ACCORDION_SELECT_EVENT,eventCallback:function(c){this.refresh()}};"object"!==typeof c&&(c={});return g.extend(b,c)},getRefreshOptions:function(c,a){return"object"===typeof a?(b(a),g.extend({},c,a)):c},registerAccordionEvent:function(c){d.on("a:accordion:"+
a.BB_ACCORDION_NAME+":"+this.options.rowFeatureName+":"+this.options.rowEventType,function(a){c.options.eventCallback.call(c,a)})},getBbRefresh:function(){var a=this.getDpxPageRefreshApi(),b=this.options;a.fadeInFeatures(b.effectedElementIds);a.doPageRefresh(this.getRefreshParams(),{timeout:b.timeOutInMs})},getDpxPageRefreshApi:function(){return new e({featureName:this.options.refreshEventName})}}});"use strict";b.when("A","buybox-refresh-util").register("buybox-refresh-handler",function(b,e){function f(a){var b=
e.getDefaultRefreshOptions({effectedElementIds:[g.CENTER_DIV,g.RIGHT_DIV]});this.options=e.getRefreshOptions(b,a);e.registerAccordionEvent.call(this,this)}var g=e.bbConstants;f.prototype={refresh:e.getBbRefresh,getDpxPageRefreshApi:e.getDpxPageRefreshApi,getRefreshParams:function(){var a=this.options;return{Persistent:{selectObb:a.buyBoxType,selectBBRadio:a.buyBoxType},"Non-Persistent":{triggerEvent:a.refreshEventName}}}};return f})});
/* ******** */
(function(n){var q=window.AmazonUIPageJS||window.P,r=q._namespace||q.attributeErrors,e=r?r("DetailPageSnSAssets",""):q;e.guardFatal?e.guardFatal(n)(e,window):e.execute(function(){n(e,window)})})(function(n,q,r){n.when("sns-join-prime-endpoint").register("sns-buybox-constants",function(e){return{SNS_QUANTITY_FIELD:"#mobileQuantityDropDown, #tabletQuantityDropDown",SNS_FREQUENCY_NAME:"rcxOrdFreq",SNS_OPT_IN_NAME:"snsOptIn",QUANTITY_CONTAINER:"#selectQuantity, #mobileQuantitySelection, #sns",QUANTITY:"[name\x3dquantity]",
SNS_QUANTITY:"[name\x3drcxsubsQuan]",SNS_MOBILE_QUANTITY:".snsQuantityRadio input[name\x3d'quantity']:checked",SNS_FREQUENCY_FORM_FIELD:"[name\x3drcxOrdFreq]",SNS_FREQUENCY_FORM_FIELD_MOBILE:".rcxOrdFreq",SNS_ONMLV2_FREQUENCY_TRIGGER_DROPDOWN:"a:dropdown:rcxOrdFreq:select",SNS_ONMLV2_FREQUENCY_TRIGGER_RADIO_BUTTON:".snsOrdFreqRadio",SNS_ONMLV2_QUANTITY_TRIGGER_DROPDOWN:"a:dropdown:rcxsubsQuan:select",SNS_ONMLV2_QUANTITY_TRIGGER_RADIO_BUTTON:".snsQuantityRadio",SNS_ONMLV2_FREQUENCY_FORM_FIELD:"#onmlv2FormFields [name\x3d'rcxOrdFreq']",
SNS_SUBSCRIBE_BUTTON_FREQUENCY_FORM_FIELD:"#subscribeButtonFormFields [name\x3d'rcxOrdFreq']",SNS_ONMLV2_QUANTITY_FORM_FIELD:"#onmlv2FormFields [name\x3d'quantity']",SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD:"#subscribeButtonFormFields [name\x3d'quantity']",SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD:'#onmlv2FormFields [name\x3d"snsDeliveryOption"]',SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD:'#subscribeButtonFormFields [name\x3d"snsDeliveryOption"]',SNS_ONMLV2_QUANTITY_TRIGGER_DESKTOP:"#rcxsubsQuan",
SNS_ONMLV2_QUANTITY_TRIGGER_MOBILE:".snsQuantityRadio",SNS_DP_FREQUENCY_TRIGGER:"#sns-dp-frequency-trigger span",SNS_OPT_IN_CHECKBOX:"#snsOptInCheckbox",SNS_OFFER_LISTING_FIELD:"#snsOfferListingID",OFFER_LISTING_FIELD:"[name\x3dofferListingID]",SNS_FREQUENCY_SECTION:"#snsFrequencySection",SNS_SELECTED_FREQUENCY_LABEL:"#snsSelectedFrequencyLabel",SNS_FIRST_RECURRING_DELIVERY_DATE:"[id\x3dsnsFirstRecurringDeliveryDate]",SNS_BUY_NEW_BUTTON:"#buyNewSection, #newAccordionRow .a-accordion-row-a11y",SNS_BUY_USED_BUTTON:"#usedBuySection, #usedAccordionRow .a-accordion-row-a11y",
ONE_CLICK_BUTTON:".onml-one-click-button",ONE_CLICK_BUTTON_ICON:".onml-one-click-button i",ONE_CLICK_BUTTON_TEXT:".onml-one-click-button input+span",BUY_NOW_BUTTON:".onml-buy-now-button",BUY_NOW_BUTTON_ICON:".onml-buy-now-button i",BUY_NOW_BUTTON_TEXT:".onml-buy-now-button input+span",ADD_TO_CART_BUTTON:"#add-to-cart-button",ADD_TO_CART_DIV:"#addToCart",DSK_BB:"#sns",DSK_BB_DPV1:"#snsBuyBox",MOBILE_ADD_TO_CART_DIV:"#sns",MOBILE_SNS_BUYBOX:"#snsBuyBox",TABLET_ADD_TO_CART_DIV:"#snsTablet",NEW_ACCORDION_ROW_SUBMISSION_FORM:"#newAccordionRow #addToCart",
SNS_ACCORDION_ROW_SUBMISSION_FORM:"#snsAccordionRow #sns, #snsAccordionRowMobile #sns, #snsAccordionRowMobileApp #sns, #snsAccordionRowMovedUp #sns, #snsAccordionRowMobileMovedUp #sns, #snsAccordionRowMobileAppMovedUp #sns, #snsAccordionRowMiddle #sns, #snsAccordionRowMobileMiddle #sns, #snsAccordionRowMobileAppMiddle #sns",SNS_OPT_IN_FORM_FIELD:"[name\x3dsnsOptIn]",LEGACY_SPC_FORM_INPUT:"[name\x3d'submit.rcx-subscribe']",LEGACY_SPC_FORM_INPUT_X:"[name\x3d'submit.rcx-subscribe.x']",SNS_OFFER_FORM_FIELD:".snsONMLOffer",
SNS_DISCOUNT_PILL:"#snsDiscountPill",SNS_ONML_BUYBOX_UPSELL_MESSAGE_NON_TIERED:"#sns-onml-buybox-upsell-message-non-tiered",SNS_ONML_BUYBOX_UPSELL_MESSAGE_TIERED:"#sns-onml-buybox-upsell-message-tiered",SNS_ONML_FRDD:".sns-onml-frdd",SNS_ONMLV2_FRDD:".sns-onmlv2-frdd",SNS_FREQ_BOTTOMSHEET_SELECTOR:"[id\x3dsnsFrequencyBottomSheet]",SNS_OPT_IN_FEATURE_DIV:"#snsOptIn_div",SNS_OPT_IN_INPUT_ID:"[name\x3dsnsOptIn]",SNS_ONML_INIT_INPUT_ID:"isOnmlInitialized",SNS_ONML_INIT_INPUT_SELECTOR:"#isOnmlInitialized",
SNS_DATA_UPDATE_EVENT:"sns-declarative-data-update",SNS_ONML_MERCHANT_INFO:"#snsOnmlMerchantInfo",SNS_DISCOUNT_PILL_POPOVER_TIERED:".snsDiscountPillPopoverTiered",SNS_DISCOUNT_PILL_POPOVER_NON_TIERED:".snsDiscountPillPopoverNonTiered",SNS_BUY_NEW_PRICE:"#onml_snsBuyNew",CBB_BUY_NEW_PRICE:"#buyNew_cbb",NON_CBB_BUY_NEW_PRICE:"#buyNew_noncbb",SNS_PRICE_IN_BUY_USED_SECTION:"#usedBuySection #onml_snsBuyNew",CBB_SNS_BUY_NEW_PRICE:"#onml_snsBuyNew_cbb",SNS_CBB_ACCORDION_ROW:"#snsAccordionRow, #snsAccordionRowMobile, #snsAccordionRowMobileApp, #snsAccordionRowMovedUp, #snsAccordionRowMobileMovedUp, #snsAccordionRowMobileAppMovedUp, #snsAccordionRowMiddle, #snsAccordionRowMobileMiddle, #snsAccordionRowMobileAppMiddle",
SNS_ONMLV2_FORM_FIELDS:"#onmlv2FormFields",SUBSCRIBE_BUTTON_FORM_FIELDS:"#subscribeButtonFormFields",SNS_ACCORDION_HEADER_RADIO_BUTTON:'#snsAccordionRow [role\x3d"radio"], #snsAccordionRowMobile [role\x3d"radio"], #snsAccordionRowMobileApp [role\x3d"radio"], #snsAccordionRowMovedUp [role\x3d"radio"], #snsAccordionRowMobileMovedUp [role\x3d"radio"], #snsAccordionRowMobileAppMovedUp [role\x3d"radio"], #snsAccordionRowMiddle [role\x3d"radio"], #snsAccordionRowMobileMiddle [role\x3d"radio"], #snsAccordionRowMobileAppMiddle [role\x3d"radio"]',
SNS_CBB_PRIME_SHIPPING:"#sns-cbb-prime-shipping-header, #sns-cbb-prime-shipping-row",DPV2_BUY_NEW_PRICE:"#buyNew_dpv2",SUBSCRIBE_ONLY_LINK:"#subscribe-only",SUBSCRIBE_ONLY_FORM:"#sns-onml-subscribe-only",JUST_SUBSCRIBE_DIV:"#just-subscribe-button-container",GOLDBOX_DISCOUNT_MESSAGE:"#onml-goldbox-discount-message",SUBSCRIBE_ONLY_FORM_ATTRIBUTES:{name:"sns-onml-subscribe-only",id:"sns-onml-subscribe-only",method:"POST",action:"/gp/product/handle-buy-box/ref\x3donml_so_l"},SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES:{name:"sns-onmlv2-add-to-cart",
id:"sns-onmlv2-add-to-cart",method:"POST",action:"/gp/subscribe-and-save/atc/sns-atc.html"},JUST_SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-onmlv2-just-subscribe",id:"sns-onmlv2-just-subscribe",method:"POST",action:"/gp/subscribe-and-save/pipeline/subscribe.html"},BUY_NOW_FORM_ATTRIBUTES:{name:"sns-onmlv2-buy-now",id:"sns-onmlv2-buy-now",method:"POST",action:""},SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-legacy-subscribe",id:"sns-legacy-subscribe",method:"POST",action:"/gp/product/handle-buy-box"},
SNS_JOIN_PRIME_FORM_ATTRIBUTES:{name:"sns-join-prime",id:"sns-join-prime",method:"POST",action:""},SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF:{name:"sns-join-prime-vmf",id:"sns-join-prime-vmf",method:"POST",action:e.endpoint},SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-onmlv2-subscribe",id:"sns-onmlv2-subscribe",method:"POST",action:"/gp/subscribe-and-save/atc/sns-atc.html"},SNS_ATC_DECLARATIVE:"#addToCart_feature_div #atc-declarative",MOBB_ALTERNATE_OFFERS:"#SecondNewAccordionRow .a-accordion-row-a11y, #ThirdNewAccordionRow .a-accordion-row-a11y",
SNS_SUBMIT_SECTION_ID:"#snsSubmitSection",SNS_SWITCH_SUBMIT_SECTION_ID:"#snsSwitchSubmitSection",SNS_BUY_NOW_BUTTON:"#snsBuyNowSubmit",SNS_SUBSCRIBE_ONLY_BUTTON:"#snsSubscribeOnlySubmit",SNS_DECLARATIVE_ACTION:"#sns-submit-declarative",SNS_SUBSCRIBE_ONLY_ACTION:"sns-subscribe-only",SNS_BUY_BOX_PARAMS:"sns-buybox-message-params",SNS_BUY_BOX_PARAM_MAP:"buyboxMessageParamsMap",SNS_SELECT_DELIVERY_URL:"/gp/subscribe-and-save/dp/delivery.html/ref\x3drcxsubs_sns_delivery_url?app-nav-type\x3dmodal",SNS_SELECT_DELIVERY_OPTION_ID:"#snsDeliveryOption",
SNS_DELIVERY_OPTION_SNS:"sns",SNS_DELIVERY_OPTION_ONML:"onml",SNS_BASE_PRICE:"#sns-base-price",SNS_TIERED_PRICE:"#sns-tiered-price",SNS_DELIVERY_OPTION_DIV:"#snsDeliveryOpt",ONML_DELIVERY_OPTION_DIV:"#onmlDeliveryOpt",SNS_MOD_ACCORDION_HEADER_FEATURES:"#sns-cbb-prime-shipping-header-wrapper, #accordion-header-delivery-link",SNS_SUBSCRIPTION_PRICE:"#subscriptionPrice",SNS_DELIVERY_OPTION_SNS_LINK:"#sns-delivery-link",ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK:"#accordion-header-sns-delivery-link",SNS_DELIVERY_OPTION_ONML_LINK:"#onml-delivery-link",
ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK:"#accordion-header-onml-delivery-link",SNS_DELIVERY_BOTTOM_SHEET:"#snsDeliveryDateBottomSheet",SNS_DELIVERY_BOTTOM_SHEET_SPINNER:"#snsDeliveryDateBottomSheetSpinner",SNS_DELIVERY_BOTTOM_SHEET_CONTENT:"#snsDeliveryDateBottomSheetContent",SNS_SUBSCRIBE_SUBMIT_BUTTON:"#rcx-subscribe-submit-button",SNS_DELIVERY_UPSELL:"#sns-delivery-buybox-upsell-message",SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL:"#sns-delivery-buybox-upsell-message-new-or-unrecognized",SNS_DELIVERY_NON_TIERED_UPSELL:"#sns-delivery-buybox-upsell-message-non-tiered",
SNS_DELIVERY_TIERED_UPSELL:"#sns-delivery-buybox-upsell-message-tiered",ONML_DELIVERY_UPSELL:"#onml-delivery-buybox-upsell-message",ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL:"#onml-delivery-buybox-upsell-message-new-or-unrecognized-sns-customer",ONML_DELIVERY_NON_TIERED_UPSELL:"#onml-delivery-buybox-upsell-message-non-tiered",ONML_DELIVERY_TIERED_UPSELL:"#onml-delivery-buybox-upsell-message-tiered",SNS_ADD_TO_CART_FORM:"#sns-onmlv2-add-to-cart",SNS_SUBSCRIBE_FORM:"#sns-onmlv2-subscribe",JUST_SUBSCRIBE_FORM:"#sns-onmlv2-just-subscribe",
BUY_NOW_FORM:"#sns-onmlv2-buy-now",SNS_LEGACY_SUBSCRIBE_FORM:"#sns-legacy-subscribe",SNS_JOIN_PRIME_FORM:"#sns-join-prime",SNS_DELIVERY_PILL:"#sns-delivery-pill",SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL:"#sns-delivery-new-or-unrecognized-sns-customer-pill",SNS_DELIVERY_NON_TIERED_PILL:"#sns-delivery-non-tiered-pill",SNS_DELIVERY_TIERED_PILL:"#sns-delivery-tiered-pill",ONML_DELIVERY_PILL:"#onml-delivery-pill",ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL:"#onml-delivery-new-or-unrecognized-sns-customer-pill",
ONML_DELIVERY_NON_TIERED_PILL:"#onml-delivery-non-tiered-pill",ONML_DELIVERY_TIERED_PILL:"#onml-delivery-tiered-pill",SNS_TOGGLE_BUY_BOX:"[name\x3dtoggleBuyBox]",SNS_ONMLV2_JOIN_PRIME_UPSELL:"#momAEmsg",SNS_ONMLV2_JOIN_PRIME_CHECKBOX:"#chkMom",SNS_ONMLV2_JOIN_PRIME_BUTTON:"#mom-join-button",SNS_DELIVERY_BOTTOMSHEET_IN_BUYBOX:"#snsDeliveryDateBottomSheet",SNS_SWITCH_WIDGET_ONML_URL:"/auto-deliveries/switchWidgetMobile?",SNS_SWITCH_WIDGET_LEGACY_URL:"/auto-deliveries/switchWidgetLegacy?",SNS_SWITCH_WIDGET_LEGACY_CONTINUE_URL:"/gp/subscribe-and-save/pipeline/subscribe.html?",
SNS_SWITCH_WIDGET_ONML_DESKTOP_URL:"/auto-deliveries/ajax/switchWidgetAjax?",SNS_SWITCH_WIDGET_LEGACY_DESKTOP_URL:"/auto-deliveries/ajax/switchWidgetAjaxLegacy?",SNS_SWITCH_WIDGET_PARAMS:"sns-switch-message-params",SNS_SWITCH_WIDGET_PARAM_MAP:"switchMessageParamsMap",DISCOUNT_TYPE_ZERO_BASE:"ZERO_BASE",GET_MYD_RECOMMENDATIONS_URL:"/auto-deliveries/ajax/viewRecommendationsAjax",SOURCE_PAGE:"dp",VIEW_CART_URL:"/gp/cart/view.html",GO_TO_CHECKOUT_URL:"/gp/cart/desktop/go-to-checkout.html?proceedToCheckout\x3d1",
SNS_HUC_GET_TREATMENT_FORM_ID:"sns-get-huc-treatment"}});n.when("A","sns-utils","sns-constants","sns-buybox-constants","sns-messaging-utils","sns-atc-utils").register("sns-frequency-bottom-sheet",function(e,a,b,d,c,h){return{init:function(){function f(){var a=l(d.SNS_FREQUENCY_FORM_FIELD).val();l(d.SNS_FREQ_BOTTOMSHEET_SELECTOR).find("button[value\x3d"+a+"]").click()}var l=e.$;a.isMobileDevice()&&(a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE,f),a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,
f),e.declarative("sns-frequency-selected","click",function(g){var f=l(d.SNS_FREQUENCY_FORM_FIELD);g=g.$target;var k=g.val(),p={};p[d.SNS_FREQUENCY_NAME]=k;h.setOnmlDeclaratives(p);f.val(k);q.setTimeout(function(){e.trigger(d.SNS_DATA_UPDATE_EVENT)},0);l(d.SNS_FIRST_RECURRING_DELIVERY_DATE).html(g.data("frdd-label"));l(d.SNS_SELECTED_FREQUENCY_LABEL).html(g.data("freq-button-label"));c.updateMessages(k);a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_FREQUENCY,k)}))}}});n.when("A","sns-constants","sns-utils",
"sns-buybox-constants","sns-messaging-utils","sns-atc-utils").register("sns-frequency-popover",function(e,a,b,d,c,h){return{init:function(){function f(){var a=l(d.SNS_FREQUENCY_FORM_FIELD).val();l("[data-a-accordion-row-name\x3dfrequencyAccordionRow"+(a-1)+"] a").click()}var l=e.$;b.isMobileDevice()||(b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE,f),e.on("a:accordion:sns-dp-frequency-accordion:select",function(g){var f=l(d.SNS_FREQUENCY_FORM_FIELD),k=l(d.SNS_DP_FREQUENCY_TRIGGER),
p=l(g.selectedRow.$row[0]);g=p.data().frequencyLabel;var p=p.data().frequencyValue,t={};t[d.SNS_FREQUENCY_NAME]=p;h.setOnmlDeclaratives(t);f.val(p);q.setTimeout(function(){e.trigger(d.SNS_DATA_UPDATE_EVENT)},0);k.text(g);c.updateMessages(p);b.setOnmlUserPref(a.USER_PREFS_KEYS.SNS_FREQUENCY,p)}))}}});n.when("A","sns-utils","sns-constants","sns-buybox-utils","sns-buybox-constants","sns-atc-utils").register("sns-opt-in-checkbox",function(e,a,b,d,c,h){return{init:function(){function f(g){var f=e.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");
g=e.$(c.SNS_OPT_IN_FORM_FIELD);f&&(a.isMobileApp()||a.isTabletApp())&&h.getAddToCartStrings();var l={};l[c.SNS_OPT_IN_NAME]=f;h.setOnmlDeclaratives(l);g.val(f);q.setTimeout(function(){e.trigger(c.SNS_DATA_UPDATE_EVENT)},0);q.setTimeout(function(){d.updateAddToCartButtonLabel(f);d.updateOneClickButtonLabel(f);d.updateBuyNowButtonLabel(f)},0);d.showSnSMerchantInfoIfSnSOptInChecked(f);d.showGoldBoxDiscountMessageIfSnSOptInChecked(f);d.showSubscribeOnlyButtonIfSnSOptInChecked(f);a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN,
f)}function l(){var b=function(){var a=e.$("#buybox").find(".a-declarative").has("#add-to-cart-button");if(1===a.length)return a;a=e.$("#atc-declarative");return 1===a.length?a:null}();b&&b.click(function(){var f=h.getAddToCartData();if(f.inputs[c.SNS_OPT_IN_NAME]!==r){var d=a.getAStateFromDom(c.SNS_OPT_IN_FEATURE_DIV,"sns-add-to-cart-params","addToCartParams"),l=e.$(c.SNS_OPT_IN_CHECKBOX).is(":checked"),t={},t=d||{};t[c.SNS_OPT_IN_NAME]=l;var q=b.data("awMash");Object.keys(t).forEach(function(a){q.inputs[a]!==
f.inputs[a]&&(q.inputs[a]=f.inputs[a])})}})}a.isSnSEligible()&&f({snsOnLoad:!0});e.declarative("sns-opt-in-checked","change",f);a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,f);a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,a.enableSnSOptIn);a.isMobileApp()&&(a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,l),l());a.enableSnSOptIn()}}});n.when("A","sns-constants","sns-buybox-constants","sns-utils").register("sns-messaging-utils",function(e,a,b,d){var c=function(a,
c){var d=a.firstRecurringDeliveryDates[c-1];e.$(b.SNS_ONML_FRDD).each(function(){e.$(this).html(d)})};return{updateMessages:function(h){var f=d.getAStateFromDom(b.SNS_OPT_IN_FEATURE_DIV,"sns-buybox-message-params","buyboxMessageParamsMap");if(f){var l=e.$(b.SNS_ONML_BUYBOX_UPSELL_MESSAGE_NON_TIERED),g=e.$(b.SNS_ONML_BUYBOX_UPSELL_MESSAGE_TIERED),m=e.$(b.SNS_DISCOUNT_PILL_POPOVER_TIERED),k=e.$(b.SNS_DISCOUNT_PILL_POPOVER_NON_TIERED);f.tieredStatusOnRecurringDeliveryDates[h-1]===a.TIERED?(l.addClass("aok-hidden"),
g.removeClass("aok-hidden"),k.addClass("aok-hidden"),m.removeClass("aok-hidden")):(l.removeClass("aok-hidden"),g.addClass("aok-hidden"),k.removeClass("aok-hidden"),m.addClass("aok-hidden"));l=f.discountType;g=e.$(b.SNS_DISCOUNT_PILL);f.tieredStatusOnRecurringDeliveryDates[h-1]===a.TIERED?(g.attr("data-tiered-level",a.PREMIUM),l===a.ZERO_BASE&&g.removeClass("aok-hidden")):(g.attr("data-tiered-level",a.BASE),l===a.ZERO_BASE&&g.addClass("aok-hidden"));c(f,h)}}}});n.when("A","sns-buybox-constants","sns-onmlv2-utils",
"sns-moq-helper").register("sns-buy-now",function(e,a,b,d){var c=e.$;e.declarative("sns-buy-now","click",function(e){if(!d.isSnsLocked()&&!d.isSnsLocked()){e=c("\x3cform\x3e",{method:a.BUY_NOW_FORM_ATTRIBUTES.method,action:"/gp/subscribe-and-save/buynow/buy-now.html?ref\x3ddp_sns_bb_bn",id:a.BUY_NOW_FORM_ATTRIBUTES.id,name:a.BUY_NOW_FORM_ATTRIBUTES.name});var f="";if(b.isCbbTemplateEnabled())for(var l=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"snsAddressId"},{name:"snsOnmlOfferId"},
{name:"snsMostCommonFrequency"},{name:"rcxOrdFreq"},{name:"quantity"}],g=0;g<l.length;g++)var m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.getOnmlv2FormValueByName(k),f=f+b.createHiddenInput(m,k);else{b.removeFormFieldsIntroducedByCbb();l=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"snsAddressId"}];for(g=0;g<l.length;g++)m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.isMobileDevice()?
c(a.MOBILE_ADD_TO_CART_DIV+" [name\x3d"+k+"]").val():b.isWeb()?c(a.ADD_TO_CART_DIV+" [name\x3d"+k+"]").val():c(a.TABLET_ADD_TO_CART_DIV+" [name\x3d"+k+"]").val(),f+=b.createHiddenInput(m,k);l=b.isMobileDevice()?c(a.SNS_MOBILE_QUANTITY):c(a.QUANTITY_CONTAINER).find(a.SNS_QUANTITY);f+=b.createHiddenInput("quantity",l.val())}f+=b.createHiddenInput("submit.buy-now","1");e.html(f);c("body").append(e);c(a.BUY_NOW_FORM).submit();c(a.BUY_NOW_FORM).remove()}})});n.when("A","sns-buybox-constants","sns-onmlv2-utils",
"sns-moq-helper").register("sns-subscribe-only",function(e,a,b,d){var c=e.$;e.declarative("sns-subscribe-only","click",function(e){if(!d.isSnsLocked()){e=c("\x3cform\x3e",{method:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.method,action:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.action,id:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.id,name:a.JUST_SUBSCRIBE_FORM_ATTRIBUTES.name});var f="";if(b.isCbbTemplateEnabled())for(var l=[{name:"ASIN"},{name:"snsMerchantID"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"longShipAddressId",
fieldName:"snsAddressId"},{name:"rcxOrdFreq"},{name:"quantity"}],g=0;g<l.length;g++)var m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.getOnmlv2FormValueByName(k),f=f+b.createHiddenInput(m,k);else{b.removeFormFieldsIntroducedByCbb();l=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsMerchantID"},{name:"longShipAddressId",fieldName:"snsAddressId"}];for(g=0;g<l.length;g++)m=l[g].name,k=l[g].fieldName?l[g].fieldName:m,k=b.isMobileDevice()?c(a.MOBILE_ADD_TO_CART_DIV+
" [name\x3d"+k+"]").val():b.isWeb()?c(a.ADD_TO_CART_DIV+" [name\x3d"+k+"]").val():c(a.TABLET_ADD_TO_CART_DIV+" [name\x3d"+k+"]").val(),f+=b.createHiddenInput(m,k);l=b.isMobileDevice()?c(a.SNS_MOBILE_QUANTITY):c(a.QUANTITY_CONTAINER).find(a.SNS_QUANTITY);f+=b.createHiddenInput("quantity",l.val())}f+=b.createHiddenInput("ref","sns-subscribe-only");f+=b.createHiddenInput("submit.subscribe-only","1");e.html(f);c("body").append(e);c(a.JUST_SUBSCRIBE_FORM).submit();c(a.JUST_SUBSCRIBE_FORM).remove()}})});
n.when("A","a-dropdown","a-modal","sns-vmf-utils","sns-onmlv2-utils","sns-buybox-constants").register("sns-select-delivery",function(e,a,b,d,c,h){function f(){g("#sns-only-delivery-option-text").length&&(g("#sns-only-delivery-option-text").html(g("#sns-only-delivery-option-text").html().replace(/%_date_%/g,"\x3cspan class \x3d'sns-only-date'\x3e\x3c/span\x3e")),g("#sns-only-delivery-option-text").html(g("#sns-only-delivery-option-text").html().replace(/%_discount_%/g,"\x3cspan class \x3d'sns-only-discount'\x3e\x3c/span\x3e")),
g("#onml-later-delivery-option-text").html(g("#onml-later-delivery-option-text").html().replace(/%_date-more-later_%/g,"\x3cspan class \x3d'sns-ml-date'\x3e\x3c/span\x3e")),g("#onml-later-delivery-option-text").html(g("#onml-later-delivery-option-text").html().replace(/%_discount-more-later_%/g,"\x3cspan class \x3d'sns-ml-discount'\x3e\x3c/span\x3e")),g("#onml-now-delivery-option-text").html(g("#onml-now-delivery-option-text").html().replace(/%_date-one-now_%/g,"\x3cspan class \x3d'sns-one-now-date'\x3e\x3c/span\x3e")),
g("#onml-now-delivery-option-text").html(g("#onml-now-delivery-option-text").html().replace(/%_discount-one-now_%/g,"\x3cspan class \x3d'sns-one-now-discount'\x3e\x3c/span\x3e")));var a=c.getDeliveryInfoParam(),b=c.getDiscountOptionsParam(),f=c.getDiscountTypeParam(),d=c.getSnsFrequencyParam();c.getOnmlFrequencyParam();var l=c.getOnmlDateParam(),e=a.snsDates[g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")],a=a.onmlDates[g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex")],m=d[g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")].highlightedDiscount,
k=b[m],d=d[g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex")].highlightedDiscount,p=b[d],b=b[0];f===h.DISCOUNT_TYPE_ZERO_BASE&&0===d?(g(".onmlNextDeliveryDate").addClass("aok-hidden"),g(".onmlNextDeliveryDateNoDiscount").removeClass("aok-hidden")):(g(".onmlNextDeliveryDate").removeClass("aok-hidden"),g(".onmlNextDeliveryDateNoDiscount").addClass("aok-hidden"));f===h.DISCOUNT_TYPE_ZERO_BASE&&0===m?(g(".snsDeliveryDate").addClass("aok-hidden"),g(".snsDeliveryDateNoDiscount").removeClass("aok-hidden")):
(g(".snsDeliveryDate").removeClass("aok-hidden"),g(".snsDeliveryDateNoDiscount").addClass("aok-hidden"));g(".sns-only-date").html(e);g(".sns-only-discount").html(k);g(".sns-ml-date").html(a);g(".sns-ml-discount").html(p);g(".sns-one-now-date").html(l);g(".sns-one-now-discount").html(b)}function l(){var a,b,f;g(h.SNS_DELIVERY_OPTION_DIV).is(":checked")?(a=g("[name\x3drcxOrdFreqSns]").prop("selectedIndex"),b=c.getSnsFrequencyParam(),g("#rcxOrdFreqSnsWrapper").removeClass("aok-hidden"),g("#rcxOrdFreqOnmlWrapper").addClass("aok-hidden"),
f="sns"):(a=g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"),b=c.getOnmlFrequencyParam(),g("#rcxOrdFreqOnmlWrapper").removeClass("aok-hidden"),g("#rcxOrdFreqSnsWrapper").addClass("aok-hidden"),f="onml");d.selectFrequency(b[a],f)}var g=e.$,m,k,p;n.when("a-sheet").execute("sns-mobile-sheet",function(a){k=a});e.declarative("sns-delivery-date-bottom-sheet","click",function(a){g("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden")?d.updateFrequencyIndex(g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")):
d.updateFrequencyIndex(g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"));f();a={name:"sns_delivery_bottom_sheet",preloadDomId:"snsDeliveryDateBottomSheet",height:270,closeType:"message",closeMessage:g("#bottomSheetClose").val(),sheetType:"web"};m=k.create(a);m.show()});e.declarative("sns-delivery-date","click",function(a){g("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden")?d.updateFrequencyIndex(g("[name\x3drcxOrdFreqSns]").prop("selectedIndex")):d.updateFrequencyIndex(g("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"));
f();a=g(h.SNS_SUBMIT_SECTION_ID);var c={dataStrategy:"preload",header:g("#deliveryModalTitle").val(),name:"sns-delivery-modal"};p=b.create(a,c);p.show()});e.declarative("sns-delivery-cancel-btn","click",function(a){p.hide()});e.declarative("sns-delivery-change-btn","click",function(a){l();p.hide()});e.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){l()})});n.when("A","sns-buybox-constants","sns-priceblock-constants").register("sns-onmlv2-priceblock-utils",function(e,a,b){var d=e.$;return{updateDesktopPriceBlock:function(c){if(c){var e=
c.zeroBaseDiscount,f=0<d(a.SNS_TOGGLE_BUY_BOX).length,l=0<d(b.DP_STRIKE_PRICE).length;d(a.SNS_DELIVERY_OPTION_DIV).is(":checked")?(d(b.ONE_NOW_SHIPPING_MESSAGE).addClass("aok-hidden"),c.justSubscribeTieredStatus?(d(b.SNS_TIERED_PRICE).removeClass("aok-hidden"),d(b.SNS_BASED_PRICE).addClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).addClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden")):e?(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),
d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).addClass("aok-hidden")):(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).addClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden"))):d(a.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(d(b.ONE_NOW_SHIPPING_MESSAGE).removeClass("aok-hidden"),e?(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),
d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).addClass("aok-hidden"),l&&(d(a.SNS_TIERED_PRICE).hasClass("aok-hidden")?(d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).addClass("aok-hidden")):d(a.SNS_BASE_PRICE).hasClass("aok-hidden")&&(d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).removeClass("aok-hidden"),
d(b.SNS_BASED_SAVINGS).addClass("aok-hidden")))):(d(b.SNS_TIERED_PRICE).addClass("aok-hidden"),d(b.SNS_BASED_PRICE).removeClass("aok-hidden"),d(b.SNS_TIERED_SAVINGS).addClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).removeClass("aok-hidden"),d(b.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),d(b.SNS_SAVINGS_ROW).removeClass("aok-hidden")));f&&d(b.SNS_SAVINGS_ROW).addClass("aok-hidden")}},updateBuyboxPriceBlock:function(c){c&&(d(a.SNS_DELIVERY_OPTION_DIV).is(":checked")?(c.oneNowDiscountEligible||d(b.SNS_STRIKETHROUGH_PRICE).removeClass("aok-hidden"),
c.justSubscribeTieredStatus?(d(a.SNS_BASE_PRICE).addClass("aok-hidden"),d(a.SNS_TIERED_PRICE).removeClass("aok-hidden")):(d(a.SNS_BASE_PRICE).removeClass("aok-hidden"),d(a.SNS_TIERED_PRICE).addClass("aok-hidden"))):d(a.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(d(a.SNS_BASE_PRICE).removeClass("aok-hidden"),d(a.SNS_TIERED_PRICE).addClass("aok-hidden"),c.oneNowDiscountEligible||(d(b.SNS_STRIKETHROUGH_PRICE).addClass("aok-hidden"),d(b.SNS_BASED_SAVINGS).addClass("aok-hidden"))))}}});n.when("A","sns-buybox-constants",
"sns-constants","sns-onmlv2-utils").register("sns-onmlv2-message-utils",function(e,a,b,d){function c(){f("#sns-delivery-buybox-upsell-message").find([a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL,a.SNS_DELIVERY_NON_TIERED_UPSELL,a.SNS_DELIVERY_TIERED_UPSELL].join()).addClass("aok-hidden");f("#onml-delivery-buybox-upsell-message").find([a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL,a.ONML_DELIVERY_NON_TIERED_UPSELL,a.ONML_DELIVERY_TIERED_UPSELL].join()).addClass("aok-hidden")}function h(){f("#sns-delivery-pill").find([a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL,
a.SNS_DELIVERY_NON_TIERED_PILL,a.SNS_DELIVERY_TIERED_PILL].join()).addClass("aok-hidden");f("#onml-delivery-pill").find([a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL,a.ONML_DELIVERY_NON_TIERED_PILL,a.ONML_DELIVERY_TIERED_PILL].join()).addClass("aok-hidden")}var f=e.$;return{updateFirstRecurringDeliveryDate:function(b,c){if(b&&c){var d=b.firstRecurringDeliveryDates[c-1];f(a.SNS_ONMLV2_FRDD).each(function(){f(this).html(d)})}},updateUpsellMessages:function(d,g,e){if(d&&g&&e){var h=g.snsCustomer,p=null==
g.snsJustSubscribeOptionEnabled?g.snsCustomer||!1:g.snsJustSubscribeOptionEnabled||!1,t=f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).length?!0:!1,q=g.suppressSnSOneNowOption||!1,n=g.justSubscribeTieredStatus;g=g.tieredStatusOnRecurringDeliveryDates[e-1]===b.TIERED;d===b.DELIVERY_OPTION.SNS?(f(a.SNS_DELIVERY_UPSELL).removeClass("aok-hidden"),f(a.ONML_DELIVERY_UPSELL).addClass("aok-hidden"),p||q?t&&!h?(c(),f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden")):n?(c(),f(a.SNS_DELIVERY_TIERED_UPSELL).removeClass("aok-hidden")):
(c(),f(a.SNS_DELIVERY_NON_TIERED_UPSELL).removeClass("aok-hidden")):c()):d===b.DELIVERY_OPTION.ONML?(f(a.SNS_DELIVERY_UPSELL).addClass("aok-hidden"),f(a.ONML_DELIVERY_UPSELL).removeClass("aok-hidden"),p?t&&!h?(c(),f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden")):g?(c(),f(a.ONML_DELIVERY_TIERED_UPSELL).removeClass("aok-hidden")):(c(),f(a.ONML_DELIVERY_NON_TIERED_UPSELL).removeClass("aok-hidden")):(c(),f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden"))):
(f(a.SNS_DELIVERY_UPSELL).addClass("aok-hidden"),f(a.ONML_DELIVERY_UPSELL).addClass("aok-hidden"),c())}},updateDiscountPill:function(c,d,e){if(c&&d&&e){var k=d.snsCustomer,p=null==d.snsJustSubscribeOptionEnabled?d.snsCustomer||!1:d.snsJustSubscribeOptionEnabled||!1,t=f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).length?!0:!1,q=d.suppressSnSOneNowOption||!1,n=d.justSubscribeTieredStatus;e=d.tieredStatusOnRecurringDeliveryDates[e-1]===b.TIERED;d=d.zeroBaseDiscount;c===b.DELIVERY_OPTION.SNS?(f(a.SNS_DELIVERY_PILL).removeClass("aok-hidden"),
f(a.ONML_DELIVERY_PILL).addClass("aok-hidden"),p||q?t&&!k?(h(),d||f(a.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden")):n?(h(),f(a.SNS_DELIVERY_TIERED_PILL).removeClass("aok-hidden")):(h(),d||f(a.SNS_DELIVERY_NON_TIERED_PILL).removeClass("aok-hidden")):h()):c===b.DELIVERY_OPTION.ONML?(f(a.SNS_DELIVERY_PILL).addClass("aok-hidden"),f(a.ONML_DELIVERY_PILL).removeClass("aok-hidden"),p?t&&!k?(h(),d||f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden")):e?(h(),f(a.ONML_DELIVERY_TIERED_PILL).removeClass("aok-hidden")):
(h(),d||f(a.ONML_DELIVERY_NON_TIERED_PILL).removeClass("aok-hidden")):(h(),d||f(a.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden"))):(h(),f(a.SNS_DELIVERY_PILL).addClass("aok-hidden"),f(a.ONML_DELIVERY_PILL).addClass("aok-hidden"))}},updateBuyboxDeliveryOption:function(){f(a.SNS_DELIVERY_OPTION_DIV).is(":checked")?(e.declarative.remove(a.SNS_DECLARATIVE_ACTION),e.declarative.create(a.SNS_DECLARATIVE_ACTION,a.SNS_SUBSCRIBE_ONLY_ACTION),f(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_SNS),
f(a.SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_SNS),f(a.SNS_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden"),f(a.SNS_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden")):f(a.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(e.declarative.remove(a.SNS_DECLARATIVE_ACTION),e.declarative.create(a.SNS_DECLARATIVE_ACTION,d.getOnmlDeclarativeAction()),
f(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_ONML),f(a.SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD).val(a.SNS_DELIVERY_OPTION_ONML),f(a.SNS_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden"),f(a.SNS_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden"),f(a.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"))}}});n.when("A","a-dropdown","sns-vmf-utils","sns-onmlv2-utils","sns-metrics-constants",
"ready").execute("sns-onmlv2-frequency-update",function(e,a,b,d,c){function h(a){q.ue&&q.ue.count(a,(ue.count(a)||0)+1)}var f=e.$;e.on("a:dropdown:rcxOrdFreqSns:select",function(a){d.getDeliveryOption();d.getBuyboxMessageParam();a=f("[name\x3drcxOrdFreqSns]").prop("selectedIndex");b.updateFrequencyIndex(a);var g=d.getSnsFrequencyParam();b.selectFrequency(g[a],"sns");0<f("[name\x3drcxOrdFreqSns]").val().search("W")?h(c.SNS_LEGACY_WEEKLY_FREQUENCY_SELECT_METRICS):h(c.SNS_LEGACY_MONTHLY_FREQUENCY_SELECT_METRICS)});
e.on("a:dropdown:rcxOrdFreqOnml:select",function(a){d.getDeliveryOption();d.getBuyboxMessageParam();a=f("[name\x3drcxOrdFreqOnml]").prop("selectedIndex");b.updateFrequencyIndex(a);var g=d.getOnmlFrequencyParam();b.selectFrequency(g[a],"onml");0<f("[name\x3drcxOrdFreqOnml]").val().search("W")?h(c.SNS_ONML_WEEKLY_FREQUENCY_SELECT_METRICS):h(c.SNS_ONML_MONTHLY_FREQUENCY_SELECT_METRICS)})});n.when("A","sns-buybox-constants").execute("sns-onmlv2-quantity-update",function(e,a){var b=e.$;e.on(a.SNS_ONMLV2_QUANTITY_TRIGGER_DROPDOWN,
function(d){d=d.value;b(a.SNS_ONMLV2_QUANTITY_FORM_FIELD).val(d);b(a.SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD).val(d)});b(a.SNS_ONMLV2_QUANTITY_TRIGGER_RADIO_BUTTON).change(function(d){d=d.target.value;b(a.SNS_ONMLV2_QUANTITY_FORM_FIELD).val(d);b(a.SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD).val(d)})});n.when("A","sns-constants","sns-buybox-constants","sns-onmlv2-utils").execute("sns-accordion-content-update",function(e,a,b,d){var c=e.$,h=function(){c(b.SNS_DELIVERY_OPTION_DIV).is(":checked")?c(b.SNS_CBB_PRIME_SHIPPING).addClass("aok-hidden"):
c(b.ONML_DELIVERY_OPTION_DIV).is(":checked")&&c(b.SNS_CBB_PRIME_SHIPPING).removeClass("aok-hidden")};e.declarative("sns-delivery-change-btn","click",function(a){h()});e.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){h()})});n.when("sns-marketplace-util").register("sns-join-prime-endpoint",function(e){switch(e.marketplace){case "IN":e="/amazonprime/";break;case "ES":case "IT":case "FR":case "AU":case "GB":case "DE":e="/gp/mom/pipeline/view-signup/";break;default:e="/gp/family/pipeline/"}return{endpoint:e}});
n.register("sns-priceblock-constants",function(){return{PRICEBLOCK_SNSPRICE_ROW:"#priceblock_snsprice_row",SNS_UPSELL:"#priceblock_snsupsell_row",SNS_SAVINGS:"#snsprice_savings",DP_OUR_PRICE:"#priceblock_ourprice",DP_OUR_PRICE_LABEL:"#priceblock_ourprice_lbl",DP_OUR_PRICE_SAVINGS:"#regularprice_savings",DP_OUR_PRICE_BADGING:"#ourprice_fbabadge",DP_OUR_PRICE_SHIPPING:"#ourprice_shippingmessage",DP_OUR_PRICE_PPU:"#priceblock_ourprice_row #priceblock_ourprice+.a-size-small",DP_STRIKE_PRICE:"#price .a-text-strike",
DP_SALE_PRICE:"#priceblock_saleprice",DP_SALE_PRICE_LABEL:"#priceblock_saleprice_lbl",DP_SALE_PRICE_SHIPPING:"#saleprice_shippingmessage",DP_SALE_PRICE_PPU:"#priceblock_saleprice_row #priceblock_saleprice+.a-size-small",DP_DEAL_PRICE:"#priceblock_dealprice",DP_DEAL_PRICE_SAVINGS:"#dealprice_savings",DP_DEAL_PRICE_SHIPPING:"#dealprice_shippingmessage",DP_DEAL_PRICE_PPU:"#priceblock_dealprice_row #priceblock_dealprice+.a-size-small",SNS_PITCH_PRICE_UPSELL_TEXT:"#onmlPriceBlockUpsellText",SNS_ATF_REDESIGN_UPSELL_UNCHECKED:"#onml-atf-redesign-upsell-unchecked",
SNS_ATF_REDESIGN_UPSELL_CHECKED:"#onml-atf-redesign-upsell-checked",ONML_ATF_REDESIGN_UPSELL:"#onml-atf-redesign-upsell",SNS_PITCH_PRICE_FEATURE:"#snsPitchPrice_feature_div",NEW_PITCH_PRICE_FEATURE:"#newPitchPriceWrapper_feature_div",MOBILE_OUR_PRICE_SHIPPING:"#ourPrice_availability",SHIPPING_DETAILS:'[data-a-sheet*\x3d"shippingDetailsDisplayContent"]',SNS_TIERED_PRICE:"#unifiedPrice_feature_div #priceblock_snsprice_Tiered, #snsPrice #priceblock_snsprice_Tiered",SNS_BASED_PRICE:"#unifiedPrice_feature_div #priceblock_snsprice_Based, #snsPrice #priceblock_snsprice_Based",
SNS_TIERED_SAVINGS:"#unifiedPrice_feature_div #snsSavings_Tiered, #snsPrice #snsSavings_Tiered",SNS_BASED_SAVINGS:"#unifiedPrice_feature_div #snsSavings_NonTiered, #snsPrice #snsSavings_NonTiered",SNS_SAVINGS_LABEL:"#unifiedPrice_feature_div #snsSavings_lbl",SNS_SAVINGS_ROW:"#unifiedPrice_feature_div #priceblock_snsSavings_row, #snsPrice #priceblock_snsSavings_row",ONE_NOW_SHIPPING_MESSAGE:"#priceblock_oneNowShippingMessage, #priceblock_oneNowShippingMessage_dpv2",SNS_STRIKETHROUGH_PRICE:"#snsStrikeThroughPrice"}});
n.when("A","sns-utils","sns-constants","sns-price-utils","sns-buybox-constants","sns-priceblock-constants").register("sns-price-refresh",function(e,a,b,d,c,h){return{init:function(){e.declarative("sns-opt-in-checked","change",function(){d.showSnSPriceIfSnSOptInChecked()});a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,d.showSnSPriceIfSnSOptInChecked);d.showSnSPriceIfSnSOptInChecked();e.$(c.SNS_BUY_NEW_BUTTON).click(function(){var d=c.SNS_OPT_IN_CHECKBOX,f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN),
m=h.SNS_UPSELL,k=h.SNS_PITCH_PRICE_UPSELL_TEXT,p=h.ONML_ATF_REDESIGN_UPSELL;e.$(d).is(":checked")!==f&&(e.$(d).click(),a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN,f));e.$(p).removeClass("aok-hidden");!1===e.$(d).is(":checked")&&(e.$(m).removeClass("aok-hidden"),e.$(k).removeClass("aok-hidden"))});e.$(c.SNS_BUY_USED_BUTTON).click(function(){f()});e.$(c.MOBB_ALTERNATE_OFFERS).click(function(){f()});var f=function(){var d=c.SNS_OPT_IN_CHECKBOX,f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN),m=h.SNS_UPSELL,
k=h.SNS_PITCH_PRICE_UPSELL_TEXT,p=h.ONML_ATF_REDESIGN_UPSELL;!0===f&&(e.$(d).click(),a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN,!0));e.$(p).addClass("aok-hidden");e.$(m).addClass("aok-hidden");e.$(k).addClass("aok-hidden")}}}});n.when("A","sns-utils","sns-priceblock-constants","sns-buybox-constants").register("sns-price-utils",function(e,a,b,d){var c=e.$,h=b.SNS_PITCH_PRICE_UPSELL_TEXT,f=b.SNS_PITCH_PRICE_FEATURE,l=b.NEW_PITCH_PRICE_FEATURE,g=b.PRICEBLOCK_SNSPRICE_ROW,m=d.SNS_OPT_IN_CHECKBOX,
k=b.SNS_UPSELL,p=b.SNS_SAVINGS,t=b.DP_OUR_PRICE,q=b.DP_OUR_PRICE_LABEL,n=b.DP_OUR_PRICE_SAVINGS,y=b.DP_OUR_PRICE_BADGING,z=b.DP_OUR_PRICE_SHIPPING,A=b.DP_SALE_PRICE,B=b.DP_SALE_PRICE_LABEL,C=b.DP_SALE_PRICE_SHIPPING,r=b.DP_DEAL_PRICE,u=b.DP_DEAL_PRICE_SAVINGS,v=b.DP_DEAL_PRICE_SHIPPING,D=b.MOBILE_OUR_PRICE_SHIPPING,E=b.SHIPPING_DETAILS,F=d.SNS_BUY_NEW_PRICE,G=d.NON_CBB_BUY_NEW_PRICE,H=d.CBB_BUY_NEW_PRICE,I=d.SNS_PRICE_IN_BUY_USED_SECTION,J=d.CBB_SNS_BUY_NEW_PRICE,K=d.DPV2_BUY_NEW_PRICE,L=b.SNS_ATF_REDESIGN_UPSELL_CHECKED,
M=b.SNS_ATF_REDESIGN_UPSELL_UNCHECKED;return{showSnSPriceIfSnSOptInChecked:function(){a.isSnSEligible()&&(c(m).is(":checked")?a.shouldShowPrice()&&(c(g).length?(c(g).removeClass("aok-hidden"),c(p).removeClass("a-hidden"),c(k).addClass("aok-hidden"),c(n).addClass("a-hidden"),c(y).addClass("a-hidden"),c(z).addClass("a-hidden"),c(D).addClass("a-hidden"),c(t).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price"),c(q).addClass("onml-price-inactive"),
c(A).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price "),c(B).addClass("onml-price-inactive"),c(C).addClass("a-hidden"),c(r).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price"),c(u).addClass("a-hidden"),c(v).addClass("a-hidden"),c(g).css({display:"table-row",visibility:"visible"}),c(g).prev().has(E).addClass("aok-hidden"),c(G).addClass("aok-hidden"),c(F).removeClass("aok-hidden"),
c(H).addClass("aok-hidden"),c(I).addClass("aok-hidden"),c(J).removeClass("aok-hidden"),c(K).addClass("aok-hidden")):(c(h).addClass("aok-hidden"),c(l).addClass("aok-hidden"),c(f).removeClass("aok-hidden"),c(f).css({display:"block",visibility:"visible"}),c(L).removeClass("aok-hidden"),c(M).addClass("aok-hidden"))):c(g).length?(c(g).addClass("aok-hidden"),c(p).addClass("a-hidden"),c(k).removeClass("aok-hidden"),c(n).removeClass("a-hidden"),c(y).removeClass("a-hidden"),c(z).removeClass("a-hidden"),c(D).removeClass("a-hidden"),
c(t).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),c(q).removeClass("onml-price-inactive"),c(A).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),c(B).removeClass("onml-price-inactive"),c(C).removeClass("a-hidden"),c(r).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),c(u).removeClass("a-hidden"),
c(v).removeClass("a-hidden"),c(g).prev().has(E).removeClass("aok-hidden"),c(G).removeClass("aok-hidden"),c(F).addClass("aok-hidden"),c(H).removeClass("aok-hidden"),c(I).addClass("aok-hidden"),c(J).addClass("aok-hidden"),c(K).removeClass("aok-hidden")):(c(h).removeClass("aok-hidden"),c(l).removeClass("aok-hidden"),c(f).addClass("aok-hidden"),c(h).css({display:"block",visibility:"visible"}),c(M).removeClass("aok-hidden"),c(L).addClass("aok-hidden")))}}});n.when("A","sns-constants","sns-buybox-constants",
"sns-states-loaded-in-dom").register("sns-utils",function(e,a,b){var d=e.$,c={},h={},f=function(a,b,c){var f,e=function(a){if(!a||"object"===typeof a)return a;var c=d.parseJSON;q.JSON&&q.JSON.parse&&(c=JSON.parse);try{return"string"===typeof a?c(a):null}catch(f){return q.ueLogError&&q.ueLogError(f,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b}),null}};a=d(a||"html");return 1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+
b+"']"))&&1<=a.length?(f=e(a.first().text()),e("object"===typeof f?f[c]:null)):f},l=function(a){var c=f(b.SNS_OPT_IN_FEATURE_DIV,"sns-onml-params","onmlParams");return a?c&&c[a]:c},g=function(){var c=l("deviceType"),b=h[a.USER_PREFS_KEYS.ONML_PARAMS],b=b&&b.deviceType;return c||b};return{isSnSEligible:function(){return l("snsEligible")},getAStateFromDom:f,getOnmlParam:l,shouldShowPrice:function(){return l("showPrice")},getDeviceType:g,registerCallbackForNameSpace:function(a,b){c[a]||(c[a]=[]);-1===
c[a].indexOf(b)&&c[a].push(b)},executeCallbacksForNameSpace:function(a){if((a=c[a])&&a.constructor===Array)for(var b=0;b<a.length;b++)a[b]()},setOnmlUserPref:function(a,b){h[a]=b},getOnmlUserPref:function(a){return h[a]},deleteOnmlUserPref:function(a){delete h[a]},isMobileDevice:function(){var a=g();return"mobile"===a||"mobileApp"===a},isMobileApp:function(){return"mobileApp"===g()},isTabletApp:function(){var a=g();return"iPad"===a||"tabletApp"===a||"tabletLargeApp"===a},isVerucaBuyNowEnabled:function(){return l("verucaBuyNowEnabled")},
isVerucaOneClickEnabled:function(){return l("verucaOneClickEnabled")},enableSnSOptIn:function(){d(b.SNS_OPT_IN_CHECKBOX).removeAttr("disabled")},isSnsCustomer:function(){return l("snsCustomer")}}});n.when("A","sns-buybox-constants","sns-constants").register("sns-onmlv2-utils",function(e,a,b){function d(a,b){return![0,1,3,4,5].includes(b)}var c=e.$,h,f=function(a,b,d){var f,e=function(a){if(!a||"object"===typeof a)return a;var f=c.parseJSON;q.JSON&&q.JSON.parse&&(f=JSON.parse);try{return"string"===
typeof a?f(a):null}catch(d){return q.ueLogError&&q.ueLogError(d,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b}),null}};a=c(a||"html");return 1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+b+"']"))&&1<=a.length?(f=e(a.first().text()),e("object"===typeof f?f[d]:null)):f},l=function(a,b,f){var d;a=c(a||"html");if(1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+b+"']"))&&1<=a.length){if((a=a.first().text())&&"object"!==
typeof a){var e=c.parseJSON;q.JSON&&q.JSON.parse&&(e=JSON.parse);try{d="string"===typeof a?e(a):null}catch(g){q.ueLogError&&q.ueLogError(g,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b}),d=null}}else d=a;return f="object"===typeof d?d[f]:null}return d},g=function(){return f(r,a.SNS_BUY_BOX_PARAMS,a.SNS_BUY_BOX_PARAM_MAP)},m=function(a){var b=g();return b?b.deviceType===a:!1},k=function(){return m("mobile")||m("mobileApp")},
p=function(){return m("web")},t=function(){return document.querySelector(a.SNS_ACCORDION_HEADER_RADIO_BUTTON)},n=function(a,c){return a&&c?a.tieredStatusOnRecurringDeliveryDates[c-1]===b.TIERED:!1},x=function(a,b){return a&&b?a.firstRecurringDeliveryDates[b-1]:""};return{getAStateFromDom:f,getDeliveryOption:function(){return c(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val()},getSwitchDeliveryOption:function(){if(!h){var a=g();a&&(h=a.deliveryOption)}return h},getBuyboxMessageParam:g,isMobileDevice:k,
isMobileWeb:function(){return m("mobile")},isMobileApp:function(){return m("mobileApp")},isTabletApp:function(){return m("iPad")||m("tabletApp")||m("tabletLargeApp")},isWeb:p,getSnsFrequencyParam:function(){return f(r,"sns-frequency-params","snsFrequencyParamsMap")},getOnmlFrequencyParam:function(){return f(r,"sns-frequency-params","onmlFrequencyParamsMap")},getDeliveryInfoParam:function(){var a=Math.max(c("[name\x3drcxOrdFreqSns]").children("option").length,c("[name\x3drcxOrdFreqOnml]").children("option").length),
b=f(r,"sns-frequency-params","deliveryInfoParamsMap");6===a&&b.snsDates&&6<b.snsDates.length&&(a=b,a.snsDates=a.snsDates.filter(d),a.onmlDates=a.onmlDates.filter(d),b=a);return b},getDiscountOptionsParam:function(){return f(r,"sns-frequency-params","discountOptionsParamsMap")},getDiscountTypeParam:function(){return l(r,"sns-frequency-params","deliveryTypeParamsMap")},getOnmlDateParam:function(){return l(r,"sns-frequency-params","onmlDateParamsMap")},createHiddenInput:function(a,b){return'\x3cinput type\x3d"hidden" name\x3d"'+
a+'" value\x3d"'+b+'"\x3e'},getBuyNowAction:function(){return k()?c(a.MOBILE_ADD_TO_CART_DIV).attr("action"):p()?c(a.ADD_TO_CART_DIV).attr("action"):c(a.TABLET_ADD_TO_CART_DIV).attr("action")},getBuyNowActionFromCbbTemplate:function(){if(p())return c(a.NEW_ACCORDION_ROW_SUBMISSION_FORM).attr("action");if(k())return c(a.SNS_ACCORDION_ROW_SUBMISSION_FORM).attr("action")},getOnmlv2FormValueByName:function(b){return c(a.SNS_ONMLV2_FORM_FIELDS+" [name\x3d'"+b+"']").val()},getSubscribeButtonFormValueByName:function(b){return c(a.SUBSCRIBE_BUTTON_FORM_FIELDS+
" [name\x3d'"+b+"']").val()},isCbbTemplateEnabled:function(){return c(a.SNS_CBB_ACCORDION_ROW).length},removeFormFieldsIntroducedByCbb:function(){c(a.SNS_ONMLV2_FORM_FIELDS+" #ASIN").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #offerListingID").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #snsOfferListingID").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #snsMerchantID").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #rcxOrdFreq").remove();c(a.SNS_ONMLV2_FORM_FIELDS+" #quantity").remove()},getCbbSnsAccordionRowRadioButton:t,isCbbSnsAccordionRowExpanded:function(){return"true"===
t().getAttribute("aria-checked")},isTiered:n,getOnmlFirstRecurringDeliveryDate:x,getOnmlDeclarativeAction:function(){return c("#onmlDeclarativeAction").val()},generateUrlParams:function(b){if(!b){var d=a.SNS_SELECT_DELIVERY_URL;return d}var f=(k()?c(a.SNS_FREQUENCY_FORM_FIELD_MOBILE):c(a.SNS_FREQUENCY_FORM_FIELD)).val(),e=[];e.subscribeOnlyDate=b.justSubscribeDeliveryDate;e.subscribeOnlyDateShort=b.justSubscribeShortDeliveryDate;e.subscribeOnlyDiscount=b.justSubscribeTieredStatus?b.tieredDiscountPercent:
b.baseDiscountPercent;e.onmlDate=b.oneTimeDeliveryDate;e.onmlDateShort=b.oneTimeShortDeliveryDate;e.onmlDiscount=b.baseDiscountPercent;e.onmlNextDate=x(b,f);e.onmlNextDiscount=n(b,f)?b.tieredDiscountPercent:b.baseDiscountPercent;e.snsDeliveryOption=c(a.SNS_SELECT_DELIVERY_OPTION_ID).val();e.isMobile=k();e.snscsrf=b.deliveryModalCSRFToken;d=a.SNS_SELECT_DELIVERY_URL;Object.keys(e).forEach(function(a){d+="\x26"+a+"\x3d"+encodeURI(e[a])});return d},createUrlParameter:function(a,b){b=encodeURIComponent(b);
return a+"\x3d"+b+"\x26"}}});n.when("A","a-dropdown","sns-onmlv2-utils","sns-buybox-constants").register("sns-vmf-utils",function(e,a,b,d){var c=e.$;return{updateFrequencyIndex:function(b){var d=c("[name\x3drcxOrdFreqSns]")[0].options[b].value;b=c("[name\x3drcxOrdFreqOnml]")[0].options[b].value;a.getSelect(c("[name\x3drcxOrdFreqSns]")).setValue(d);a.getSelect(c("[name\x3drcxOrdFreqOnml]")).setValue(b)},selectFrequency:function(a,f){c(".sns-delivery-buybox-upsell-message").html(a.upsellInformation.message);
c(".sns-delivery-buybox-upsell-additional-message-title").html(a.upsellInformation.additionalMessageTitle);c(".sns-delivery-buybox-upsell-additional-message").html(a.upsellInformation.additionalMessage);if("sns"===f){c(".onml-delivery-link").addClass("aok-hidden");if(-1<a.value.indexOf("W|")){c(".sns-delivery-link").addClass("aok-hidden");c(".sns-delivery-link-weekly").removeClass("aok-hidden");var e=c(".sns-delivery-link-weekly").html()}else c(".sns-delivery-link").removeClass("aok-hidden"),c(".sns-delivery-link-weekly").addClass("aok-hidden"),
e=c(".sns-delivery-link").html();c(d.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).html(e);c(d.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden");c(d.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden")}else c(".sns-delivery-link").addClass("aok-hidden"),c(".sns-delivery-link-weekly").addClass("aok-hidden"),c(".onml-delivery-link").removeClass("aok-hidden"),c(d.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"),c(d.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden");
a=a.highlightedDiscount;e=b.getDiscountTypeParam();0===a?(c("#sns-base-price").removeClass("aok-hidden"),c("#sns-tiered-price").addClass("aok-hidden"),c(".discountPillLeft").addClass("pillLightUp"),c(".discountPillRight").removeClass("pillLightUp"),e===d.DISCOUNT_TYPE_ZERO_BASE?c("#snsDiscountPill").addClass("aok-hidden"):c("#snsDiscountPill").removeClass("aok-hidden")):(c("#sns-base-price").addClass("aok-hidden"),c("#sns-tiered-price").removeClass("aok-hidden"),c(".discountPillLeft").removeClass("pillLightUp"),
c(".discountPillRight").addClass("pillLightUp"),e===d.DISCOUNT_TYPE_ZERO_BASE&&"onml"===f?c("#snsDiscountPill").addClass("aok-hidden"):c("#snsDiscountPill").removeClass("aok-hidden"))}}});n.when("ready").register("sns-stringify-util",function(){return JSON&&"function"===typeof JSON.stringify?JSON.stringify:function(){var e={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},a=/[\\"\u0000-\u001F\u2028\u2029]/g,b=Object.prototype.toString,d=Array.isArray||function(a){return"[object Array]"===
b.call(a)},c=function(a){return e[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)};return function f(e){if(null===e)return"null";if("number"===typeof e)return isFinite(e)?e.toString():"null";if("boolean"===typeof e)return e.toString();if("object"===typeof e){if("function"===typeof e.toJSON)return f(e.toJSON());if(d(e)){for(var g="[",m=0;m<e.length;m++)g+=(m?", ":"")+f(e[m]);return g+"]"}if("[object Object]"===b.call(e)){g=[];for(m in e)e.hasOwnProperty(m)&&g.push(f(m)+": "+f(e[m]));return"{"+
g.join(", ")+"}"}}return'"'+e.toString().replace(a,c)+'"'}}()});n.when("A","sns-stringify-util","ready").register("sns-declarative-util",function(e,a){function b(a){return a&&("object"===typeof a||"object"===typeof a.prototype)}function d(){for(var a=0;a<arguments.length;a++)if("string"!==typeof arguments[a])throw"Function parameter must be of type string.";}function c(){for(var a=Object.prototype.toString,b=Array.isArray||function(b){return"[object Array]"===a.call(b)},c=0;c<arguments.length;c++){var e=
arguments[c];if(b(e)&&0<e.length)for(var h=0;h<e.length;h++)d(e[h]);else throw"Function parameter must be a non empty array.";}}function h(c){var d="data-"+c.getAttribute("data-action"),g=function(){var b=c.getAttribute(d),g=b?e.parseJSON(b):{};g.save=function(){var b=g.save;delete g.save;var e=a(g);c.setAttribute(d,e);g.save=b};return g};return{hasExactKeyHeirarchy:function(a,c){var d=g();a=a.split(".");for(var e=0<a.length,f=0;f<a.length&&e;f++)var h=a[f],e=b(d)&&d.hasOwnProperty(h),d=d[h];e&&c!==
r&&(e=d===c);return e},hasParsableJSON:function(){try{return g().save(),!0}catch(a){return!1}},put:function(a){var c=g();b(c.inputs)||(c.inputs={});e.$.each(a,function(a,b){c.inputs[a]=b});c.save()},getData:g}}return{query:function(a){c(a);var l=[],g=[],m=[],k,p,q=function(){return{numberOfMatchingActions:l.length,allMatchKeyValue:function(a,b){d(a);for(var c=0<this.numberOfMatchingActions,e=0;e<this.numberOfMatchingActions&&c;e++)c=(c=l[e])&&c.hasExactKeyHeirarchy(a,b);return c},putAll:function(a){for(var b=
0;b<this.numberOfMatchingActions;b++)l[b].put(a)},getStrings:function(){for(var a=0;a<this.numberOfMatchingActions;a++){var b=l[a];if(b.getData().strings)return b.getData().strings}return[]},getData:function(){for(var a=0;a<this.numberOfMatchingActions;a++){var b=l[a];if(b.getData())return b.getData()}return[]}}},n=function(){for(var c=e.$("#buybox").find(".a-declarative").get(),d=0<g.length,k=0;k<c.length;k++){var p=c[k],n;a:{n=p;for(var r=a,w=0;w<r.length;w++){var u;var v=n;u=r[w];b(v)&&"string"===
typeof u?(v=v.getAttribute("data-action")||"",u=0===u.localeCompare(v)):u=!1;if(u){n=!0;break a}}n=!1}if(n&&(p=h(p),p.hasParsableJSON()))if(d){n=!0;for(r=0;r<g.length&&n;r++)n=p.hasExactKeyHeirarchy(g[r],m[r]);n&&l.push(p)}else l.push(p)}return q()};k=function(a){d(a);g.push(a);return{equals:p,equalsAny:function(){return p(r)}}};p=function(a){m.push(a);return{where:k,execute:n}};return{where:k,execute:n}}}});n.when("A","sns-utils","sns-buybox-constants","sns-declarative-util").register("sns-atc-utils",
function(e,a,b,d){var c=e.$,h=["aw-mash","add-to-cart","one-click","show-services-interstitial"],f=function(a){d.query(h).where("buttonID").equals("add-to-cart").execute().putAll(a);d.query(h).where("buttonID").equals("buy-now").execute().putAll(a);d.query(h).where("buttonID").equals("buy-now-one-click").execute().putAll(a)};return{initializeOnmlDeclaratives:function(){if(a.isSnSEligible()){var d=a.getAStateFromDom(b.SNS_OPT_IN_FEATURE_DIV,"sns-add-to-cart-params","addToCartParams");f(d||{});c("\x3cinput type\x3dhidden value\x3dtrue \x3e").prop("id",
b.SNS_ONML_INIT_INPUT_ID).appendTo(b.SNS_OPT_IN_FEATURE_DIV)}},setOnmlDeclaratives:f,getAddToCartStrings:function(){return d.query(h).where("buttonID").equals("add-to-cart").execute().getStrings()},getAddToCartData:function(){return d.query(h).where("buttonID").equals("add-to-cart").execute().getData()}}});n.when("A","sns-utils","sns-constants","sns-atc-utils").register("sns-atc",function(e,a,b,d){return{init:function(){a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,d.initializeOnmlDeclaratives);
d.initializeOnmlDeclaratives()}}});n.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper").register("sns-onmlv2-atc",function(e,a,b,d){function c(c){if(!d.isSnsLocked()){var e=h("\x3cform\x3e",{method:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.method,action:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.action,id:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.id,name:a.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.name}),g="";if(b.isCbbTemplateEnabled())for(var m=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},
{name:"snsAddressId"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"rcxOrdFreq"},{name:"quantity"}],k=0;k<m.length;k++)var p=m[k].name,n=m[k].fieldName?m[k].fieldName:p,n=b.getOnmlv2FormValueByName(n),g=g+b.createHiddenInput(p,n);else{b.removeFormFieldsIntroducedByCbb();m=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"snsAddressId"}];for(k=0;k<m.length;k++)p=m[k].name,n=m[k].fieldName?
m[k].fieldName:p,n=b.isMobileDevice()?h(a.MOBILE_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():b.isWeb()?h(a.ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():h(a.TABLET_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val(),g+=b.createHiddenInput(p,n);m=b.isMobileDevice()?h(a.SNS_MOBILE_QUANTITY):h(a.QUANTITY_CONTAINER).find(a.SNS_QUANTITY);g+=b.createHiddenInput("quantity",m.val())}g+=b.createHiddenInput("ref",c);g+=b.createHiddenInput("submit.add-to-cart","1");e.html(g);h("body").append(e);h(a.SNS_ADD_TO_CART_FORM).submit();
h(a.SNS_ADD_TO_CART_FORM).remove()}}var h=e.$;e.declarative("sns-add-to-cart","click",function(a){c("onmlv2_atc")});return{createAndSubmitAddToCartForm:c}});n.when("A","sns-utils","sns-constants","sns-buybox-constants","sns-atc-utils").register("sns-buybox-utils",function(e,a,b,d){var c=function(a){if(0<a.length)return a.innerWidth()<a[0].scrollWidth},h=function(c,d,g){d=c+"_"+(g?"checkedLabel":"uncheckedLabel")+"_"+("oneClick"===c?d:"all");c=a.getOnmlParam(d);d=(g=a.getOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS))&&
g[d];if(c=c||d)return e.$("\x3cp\x3e"+c+"\x3c/p\x3e").text()};return{updateOneClickButtonLabel:function(b){if(a.isVerucaOneClickEnabled()){b="boolean"===typeof b?b:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");var l=e.$(d.ONE_CLICK_BUTTON),g=e.$(d.ONE_CLICK_BUTTON_ICON),m=e.$(d.ONE_CLICK_BUTTON_TEXT),k=a.getDeviceType(),p=h("oneClick",k,!0),k=h("oneClick",k,!1);p&&k&&(b?(m.text(p),c(m)&&(g.addClass("aok-hidden"),l.removeClass("a-button-icon"))):(m.text(k),g.length&&(l.addClass("a-button-icon"),g.removeClass("aok-hidden"))))}},
updateBuyNowButtonLabel:function(b){if(a.isVerucaBuyNowEnabled()){b="boolean"===typeof b?b:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");var l=e.$(d.BUY_NOW_BUTTON),g=e.$(d.BUY_NOW_BUTTON_ICON),m=e.$(d.BUY_NOW_BUTTON_TEXT),k=a.getDeviceType(),p=h("buyNow",k,!0),k=h("buyNow",k,!1);p&&k&&(b?(m.text(p),c(m)&&(g.addClass("aok-hidden"),l.removeClass("a-button-icon"))):(m.text(k),g.length&&(l.addClass("a-button-icon"),g.removeClass("aok-hidden"))))}},updateAddToCartButtonLabel:function(b){b="boolean"===typeof b?
b:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");var l=e.$(d.ADD_TO_CART_BUTTON).closest(".a-button"),g=l.find(".a-button-inner"),m=l.find("i.a-icon"),k=l.find("span.a-button-text"),p=a.getDeviceType(),n=h("addToCart",p,!0),p=h("addToCart",p,!1);n&&p&&(b?(k.text(n),g.addClass("sns-onml-sky-button-inner"),k.addClass("sns-onml-sky-button-text"),c(k)&&(m.addClass("aok-hidden"),l.removeClass("a-button-icon"))):(k.text(p),g.removeClass("sns-onml-sky-button-inner"),k.removeClass("sns-onml-sky-button-text"),
m.length&&(l.addClass("a-button-icon"),m.removeClass("aok-hidden"))))},showSnSMerchantInfoIfSnSOptInChecked:function(a){var b=e.$(d.SNS_ONML_MERCHANT_INFO);a="boolean"===typeof a?a:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)},showGoldBoxDiscountMessageIfSnSOptInChecked:function(a){var b=e.$(d.GOLDBOX_DISCOUNT_MESSAGE);a="boolean"===typeof a?a:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)},showSubscribeOnlyButtonIfSnSOptInChecked:function(a){var b=
e.$(d.JUST_SUBSCRIBE_DIV);a="boolean"===typeof a?a:e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)}}});n.when("A","sns-buybox-constants","sns-onmlv2-utils","ready").execute("sns-onmlv2-join-prime",function(e,a,b){var d=e.$,c=function(){d(a.SNS_ONMLV2_JOIN_PRIME_CHECKBOX).length&&(d(a.SNS_ONMLV2_JOIN_PRIME_UPSELL).removeClass("aok-hidden"),d(a.SNS_ONMLV2_JOIN_PRIME_CHECKBOX).is(":checked")?(d(a.SNS_ONMLV2_JOIN_PRIME_BUTTON).removeClass("aok-hidden"),d(a.SNS_SUBSCRIBE_SUBMIT_BUTTON).addClass("aok-hidden")):
(d(a.SNS_ONMLV2_JOIN_PRIME_BUTTON).addClass("aok-hidden"),d(a.SNS_SUBSCRIBE_SUBMIT_BUTTON).removeClass("aok-hidden")))};c();d(document).delegate(a.SNS_ONMLV2_JOIN_PRIME_CHECKBOX,"change",function(a){c()});e.declarative("sns-join-prime","click",function(c){c=e.state("momJoinPrimeEndpointState");c=d("\x3cform\x3e",{method:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES.method,action:c&&c.endpoint?c.endpoint:"/gp/prime/pipeline/membersignup/",id:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES.id,name:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES.name});
for(var f="",l=[{name:"session-id"},{name:"momAsin"},{name:"ref"}],g=0;g<l.length;g++)var m=l[g].name,k=b.getSubscribeButtonFormValueByName(m),f=f+b.createHiddenInput(m,k);c.html(f);d("body").append(c);d(a.SNS_JOIN_PRIME_FORM).submit();d(a.SNS_JOIN_PRIME_FORM).remove()})});n.when("A","sns-buybox-constants","sns-onmlv2-utils").execute("sns-legacy-subscribe",function(e,a,b){var d=e.$;e.declarative("sns-legacy-subscribe","click",function(c){c=d("\x3cform\x3e",{method:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.method,
action:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.action,id:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.id,name:a.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.name});for(var e="",f=[{name:"ASIN"},{name:"offerListingID"},{name:"merchantID"},{name:"snsOfferListingID"},{name:"snsMerchantID"},{name:"rcxOrdFreq"},{name:"quantity"}],l=0;l<f.length;l++)var g=f[l].name,m=b.getSubscribeButtonFormValueByName(g),e=e+b.createHiddenInput(g,m);e+=b.createHiddenInput("ref","sns-legacy-subscribe");e+=b.createHiddenInput("submit.rcx-subscribe",
"1");c.html(e);d("body").append(c);d(a.SNS_LEGACY_SUBSCRIBE_FORM).submit();d(a.SNS_LEGACY_SUBSCRIBE_FORM).remove()})});n.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper").register("sns-subscribe-button",function(e,a,b,d){function c(c){if(!d.isSnsLocked()){var l,g;h("#chkMom").length&&h("#chkMom").is(":checked")?(l=h("\x3cform\x3e",{method:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.method,action:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.action,id:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.id,name:a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.name}),
g=a.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.id):(l=h("\x3cform\x3e",{method:a.SUBSCRIBE_FORM_ATTRIBUTES.method,action:a.SUBSCRIBE_FORM_ATTRIBUTES.action,id:a.SUBSCRIBE_FORM_ATTRIBUTES.id,name:a.SUBSCRIBE_FORM_ATTRIBUTES.name}),g=a.SUBSCRIBE_FORM_ATTRIBUTES.id);for(var m="",k=[{name:"snsAsin"},{name:"rcxOrdFreqOnml"},{name:"rcxOrdFreqSns"}],p=0;p<k.length;p++)var n=k[p].name,q=h("[name\x3d'"+(k[p].fieldName?k[p].fieldName:n)+"']").val(),m=m+b.createHiddenInput(n,q);k=e.$(a.SNS_MOBILE_QUANTITY);if(k===r||
k.val()===r)k=h("[name\x3d'rcxsubsQuan']");p=!h("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden");p||(n=b.getDeliveryInfoParam().snsDates[h("[name\x3drcxOrdFreqSns]").prop("selectedIndex")],m+=b.createHiddenInput("snsDate",n));m+=b.createHiddenInput("onmlSelected",p);m+=b.createHiddenInput("vmfEnabled","true");m+=b.createHiddenInput("quantity",k.val());m+=b.createHiddenInput("ref",c+(p?"onml":"sns"));m+=b.createHiddenInput("submit.subscribe","1");l.html(m);h("body").append(l);h("#"+g).submit();h("#"+
g).remove()}}var h=e.$;e.declarative("sns-submit-btn-declarative","click",function(a){c("sns-subscribe-btn-dp-vmf-")});e.declarative("sns-mom-submit-btn-declarative","click",function(a){c("sns-mom-btn-dp-vmf-")})});n.register("sns-constants",function(){return{TIERED:"tiered",NON_TIERED:"nonTiered",BASE:"BASE",PREMIUM:"PREMIUM",ZERO_BASE:"ZERO_BASE",EVENT_NAMESPACE:{PAGE_UPDATE:"pageUpdate",FREQUENCY_HIDDEN_INPUT_CHANGE:"frequencyHiddenInputChange"},USER_PREFS_KEYS:{SNS_OPT_IN:"snsOptIn",SNS_FREQUENCY:"rcxOrdFreq",
ONML_PARAMS:"onmlParams"},DELIVERY_OPTION:{SNS:"sns",ONML:"onml"}}});n.when("A","sns-utils","sns-constants","sns-buybox-constants").register("sns-event-handler",function(e,a,b,d){return{init:function(){function c(a){for(var b=e.$("\x3cform\x3e",{method:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.method,action:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.action,id:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.id,name:d.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.name}),c=[{name:"ASIN"},{name:"offerListingID"},{name:"merchantID"},{name:"rcxOrdFreq"},
{name:"snsOfferListingID"},{name:"snsMerchantID"}],g="",m=0;m<c.length;m++)var k=c[m].name,p=e.$("[name\x3d"+k+"]").val(),g=g+('\x3cinput type\x3d"hidden" name\x3d"'+k+'" value\x3d"'+p+'"\x3e');g=g+('\x3cinput type\x3d"hidden" name\x3d"ref" value\x3d"'+a+'"\x3e')+'\x3cinput type\x3d"hidden" name\x3d"submit.rcx-subscribe" value\x3d"1"\x3e';a=e.$(d.QUANTITY_CONTAINER).find(d.QUANTITY);g+='\x3cinput type\x3d"hidden" name\x3d"quantity" value\x3d"'+a.val()+'"\x3e';b.html(g);e.$("body").append(b);e.$(d.SUBSCRIBE_ONLY_FORM).submit()}
a.isSnSEligible()&&a.setOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS,a.getOnmlParam());a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE,function(){var c=a.getOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS)||{},f=c.asin,l=a.getOnmlParam("asin");c.asin=l;a.setOnmlUserPref(b.USER_PREFS_KEYS.ONML_PARAMS,c);c=f!==l;f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_OPT_IN);"undefined"!==typeof f&&e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked")!==f&&(a.enableSnSOptIn(),e.$(d.SNS_OPT_IN_CHECKBOX).click());(f=a.getOnmlUserPref(b.USER_PREFS_KEYS.SNS_FREQUENCY))&&
!c?a.isMobileDevice()?e.$(d.SNS_FREQ_BOTTOMSHEET_SELECTOR).find("button[value\x3d"+f+"]").click():e.$("[data-a-accordion-row-name\x3dfrequencyAccordionRow"+(f-1)+"] a").click():a.deleteOnmlUserPref(b.USER_PREFS_KEYS.SNS_FREQUENCY)});e.$(d.SNS_FREQUENCY_FORM_FIELD).change(function(){a.executeCallbacksForNameSpace(b.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE)});e.on("a:pageUpdate",function(){a.executeCallbacksForNameSpace(b.EVENT_NAMESPACE.PAGE_UPDATE)});e.declarative("subscribe-only","click",function(a){c("onml_so_l")});
e.declarative("just-subscribe","click",function(a){c("onml_justsub_l")})}}});n.register("sns-metrics-constants",function(){return{SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS:"snsOnmlExistingSnsCustomerCheck",SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS:"snsOnmlNewSnsCustomerCheck",SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS:"snsOnmlExistingSnsCustomerUncheck",SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS:"snsOnmlNewSnsCustomerUncheck",SNS_SIGN_IN_IF_NOT_ALREADY_SIGNED_IN_METRICS:"snsSignInIfNotAlreadySignedIn",
SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS:"snsOnmlFrequencyLabelClick",SNS_ONML_FREQUENCY_CHANGE_METRICS:"snsOnmlFrequencyChange",SNS_ONML_WEEKLY_FREQUENCY_SELECT_METRICS:"snsOnmlWeeklyFrequencySelectMetrics",SNS_ONML_MONTHLY_FREQUENCY_SELECT_METRICS:"snsOnmlMonthlyFrequencySelectMetrics",SNS_LEGACY_WEEKLY_FREQUENCY_SELECT_METRICS:"snsLegacyWeeklyFrequencySelectMetrics",SNS_LEGACY_MONTHLY_FREQUENCY_SELECT_METRICS:"snsLegacyMonthlyFrequencySelectMetrics",SNS_ONML_UPSELL_MESSAGE_METRICS:"snsOnmlUpsellMessage",
SNS_ONML_SUBSCRIBE_ONLY_METRICS:"snsOnmlSubscribeOnly",SNS_CUSTOMER_RECOGNIZED_BUT_NOT_SIGNED_IN:"snsOnmlCustomerRecognizedButNotSignedIn",SNS_REQUIRE_SIGN_IN_STATUS_FAILED:"snsOnmlRequireSignInStatusFailed",SNS_ONMLV2_POPOVER_TRIGGERS:"justSubscribeLearnMorePopoverNonTiered justSubscribeLearnMorePopoverTiered onmlv2LearnMorePopoverNonTiered onmlv2LearnMorePopoverTiered onmlv2LearnMorePopoverNewOrUnrecognized justSubscribePillPopoverNonTiered justSubscribePillPopoverTiered onmlv2PillPopoverNonTiered onmlv2PillPopoverTiered onmlv2PillPopoverNewOrUnrecognized".split(" "),
SNS_ONMLV2_BOTTOMSHEET_TRIGGERS:"justSubscribeLearnMoreBottomsheetNonTiered justSubscribeLearnMoreBottomsheetTiered onmlv2LearnMoreBottomsheetNonTiered onmlv2LearnMoreBottomsheetTiered onmlv2LearnMoreBottomsheetNewOrUnrecognized justSubscribePillBottomsheetNonTiered justSubscribePillBottomsheetTiered onmlv2PillBottomsheetNonTiered onmlv2PillBottomsheetTiered onmlv2PillBottomsheetNewOrUnrecognized".split(" "),SNS_ONMLV2_DESKTOP_POPOVER_SHOW_METRICS:"snsOnmlv2DesktopPopoverShow",SNS_ONMLV2_MOBILE_BOTTOMSHEET_SHOW_METRICS:"snsOnmlv2MobileBottomsheetShow",
SNS_ONMLV2_DELIVERY_OPTION_CLICK_METRICS:"snsOnmlv2DeliveryOptionClick",SNS_ONMLV2_DELIVERY_OPTION_CLICK_MOBILE_METRICS:"snsOnmlv2DeliveryOptionClickMobile",SNS_ONMLV2_SWITCH_TO_SNS_METRICS:"snsOnmlv2SwitchToSns",SNS_ONMLV2_SWITCH_TO_ONML_METRICS:"snsOnmlv2SwitchToOnml",SNS_ONMLV2_SWITCH_TO_SNS_MOBILE_METRICS:"snsOnmlv2SwitchToSnsMobile",SNS_ONMLV2_SWITCH_TO_ONML_MOBILE_METRICS:"snsOnmlv2SwitchToOnmlMobile",SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_METRICS:"snsOnmlv2SubscribeNowWithOnmlDelivery",
SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_METRICS:"snsOnmlv2SubscribeNowWithSnsDelivery",SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_MOBILE_METRICS:"snsOnmlv2SubscribeNowWithOnmlDeliveryMobile",SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_MOBILE_METRICS:"snsOnmlv2SubscribeNowWithSnsDeliveryMobile",SNS_QUANTITY_SELECT_DESKTOP:"snsQuantitySelectDesktop",SNS_QUANTITY_SELECT_MOBILE:"snsQuantitySelectMobile",SNS_SWITCH_WIDGET_SEE_PRODUCTS_ONMLV2_METRICS:"snsSwitchWidgetSeeProductsOnmlv2",SNS_SWITCH_WIDGET_SEE_PRODUCTS_LEGACY_METRICS:"snsSwitchWidgetSeeProductsLegacy",
SNS_SWITCH_WIDGET_CONTINUE_LEGACY_METRICS:"snsSwitchWidgetContinueLegacy",SNS_SWITCH_WIDGET_CONTINUE_WITH_ONE_NOW_METRICS:"snsSwitchWidgetContinueWithOneNow",SNS_SWITCH_WIDGET_CONTINUE_WITH_SNS_METRICS:"snsSwitchWidgetContinueWithSns",SNS_SWITCH_WIDGET_BOTTOMSHEET_TOTAL_COUNT_METRICS:"snsSwitchWidgetBottomsheetTotalCount"}});n.when("A","sns-utils","sns-metrics-constants","sns-buybox-constants").register("sns-metrics-helper",function(e,a,b,d){return{init:function(){e.declarative("sns-opt-in-checked",
"change",function(){var c=e.$(d.SNS_OPT_IN_CHECKBOX).is(":checked");q.ue&&(c?a.isSnsCustomer()?q.ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS,(ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS)||0)+1):q.ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS,(ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS)||0)+1):a.isSnsCustomer()?q.ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS,(ue.count(b.SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS)||0)+1):q.ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS,
(ue.count(b.SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS)||0)+1))});e.$(document).delegate(".sns-buybox-upsell-trigger","click",function(a){q.ue&&q.ue.count(b.SNS_ONML_UPSELL_MESSAGE_METRICS,(ue.count(b.SNS_ONML_UPSELL_MESSAGE_METRICS)||0)+1)});e.$(document).delegate("#sns-dp-frequency-trigger","click",function(a){q.ue&&q.ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS)||0)+1)});e.$(document).delegate("#snsSelectedFrequencyLabel","click",function(a){q.ue&&
q.ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS)||0)+1)});e.on("a:accordion:sns-dp-frequency-accordion:select",function(){q.ue&&q.ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS)||0)+1)});e.$(document).delegate("#snsFrequencyBottomSheet button","click",function(a){q.ue&&q.ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS,(ue.count(b.SNS_ONML_FREQUENCY_CHANGE_METRICS)||0)+1)});e.$(document).delegate("#subscribe-only",
"click",function(a){q.ue&&q.ue.count(b.SNS_ONML_SUBSCRIBE_ONLY_METRICS,(ue.count(b.SNS_ONML_SUBSCRIBE_ONLY_METRICS)||0)+1)})}}});n.when("A","sns-onmlv2-utils","sns-metrics-constants","sns-buybox-constants","sns-constants","sns-onmlv2-cache").register("sns-onmlv2-metrics-helper",function(e,a,b,d,c,h){var f=e.$,l="",g="";b.SNS_ONMLV2_POPOVER_TRIGGERS.forEach(function(a){l+=" a:popover:beforeShow:"+a});b.SNS_ONMLV2_BOTTOMSHEET_TRIGGERS.forEach(function(a){g+=" a:sheet:beforeShow:"+a});e.declarative("sns-delivery-date",
"click",function(a){h.incrementDeliveryOptionClickCounter()});e.declarative("sns-delivery-date-bottom-sheet","click",function(a){h.incrementDeliveryOptionClickCounterMobile()});e.declarative("sns-delivery-change-btn","click",function(a){f(d.SNS_DELIVERY_OPTION_DIV).is(":checked")?h.incrementDeliveryOptionSwitchToSnsCounter():f(d.ONML_DELIVERY_OPTION_DIV).is(":checked")&&h.incrementDeliveryOptionSwitchToOnmlCounter()});e.on("a:popover:beforeHide:sns-delivery-modal",function(a){k(b.SNS_ONMLV2_DELIVERY_OPTION_CLICK_METRICS,
h.getDeliveryOptionClickCounter());k(b.SNS_ONMLV2_SWITCH_TO_SNS_METRICS,h.getDeliveryOptionSwitchToSnsCounter());k(b.SNS_ONMLV2_SWITCH_TO_ONML_METRICS,h.getDeliveryOptionSwitchToOnmlCounter());k(b.SNS_QUANTITY_SELECT_DESKTOP,h.getQuantityClickCounterDesktop())});e.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){k(b.SNS_ONMLV2_DELIVERY_OPTION_CLICK_MOBILE_METRICS,h.getDeliveryOptionClickCounterMobile());f(d.SNS_DELIVERY_OPTION_DIV).is(":checked")?h.incrementDeliveryOptionSwitchToSnsCounterMobile():
f(d.ONML_DELIVERY_OPTION_DIV).is(":checked")&&h.incrementDeliveryOptionSwitchToOnmlCounterMobile();k(b.SNS_ONMLV2_SWITCH_TO_SNS_MOBILE_METRICS,h.getDeliveryOptionSwitchToSnsCounterMobile());k(b.SNS_ONMLV2_SWITCH_TO_ONML_MOBILE_METRICS,h.getDeliveryOptionSwitchToOnmlCounterMobile());k(b.SNS_QUANTITY_SELECT_MOBILE,h.getQuantityClickCounterMobile())});e.on(l,function(){m(b.SNS_ONMLV2_DESKTOP_POPOVER_SHOW_METRICS)});e.on(g,function(){m(b.SNS_ONMLV2_MOBILE_BOTTOMSHEET_SHOW_METRICS)});e.$(document).delegate("#sns-submit-declarative",
"click",function(d){d=h.getDeliveryOption();var e=a.isMobileDevice();d===c.DELIVERY_OPTION.SNS?e?m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_MOBILE_METRICS):m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_METRICS):d===c.DELIVERY_OPTION.ONML&&(e?m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_MOBILE_METRICS):m(b.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_METRICS))});e.$(document).delegate(d.SNS_ONMLV2_QUANTITY_TRIGGER_DESKTOP,"change",function(a){h.incrementQuantityClickCounterDesktop();k(b.SNS_QUANTITY_SELECT_DESKTOP,
h.getQuantityClickCounterDesktop())});e.$(document).delegate(d.SNS_ONMLV2_QUANTITY_TRIGGER_MOBILE,"change",function(a){h.incrementQuantityClickCounterMobile();k(b.SNS_QUANTITY_SELECT_MOBILE,h.getQuantityClickCounterMobile())});var m=function(a){q.ue&&q.ue.count(a,(ue.count(a)||0)+1)},k=function(a,b){q.ue&&q.ue.count(a,b)}});n.when("A","sns-onmlv2-utils","sns-buybox-constants").register("sns-onmlv2-cache",function(e,a,b){var d=e.$,c=0,h=0,f=0,l=0,g=0,m=0,k=0,n=0;return{getDeliveryOptionClickCounter:function(){return c},
incrementDeliveryOptionClickCounter:function(){c++},getDeliveryOptionClickCounterMobile:function(){return h},incrementDeliveryOptionClickCounterMobile:function(){h++},getDeliveryOptionSwitchToSnsCounter:function(){return f},incrementDeliveryOptionSwitchToSnsCounter:function(){f++},getDeliveryOptionSwitchToSnsCounterMobile:function(){return l},incrementDeliveryOptionSwitchToSnsCounterMobile:function(){l++},getDeliveryOptionSwitchToOnmlCounterMobile:function(){return m},incrementDeliveryOptionSwitchToOnmlCounterMobile:function(){m++},
getDeliveryOptionSwitchToOnmlCounter:function(){return g},incrementDeliveryOptionSwitchToOnmlCounter:function(){g++},getDeliveryOption:function(){return d(b.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val()},getQuantityClickCounterDesktop:function(){return k},incrementQuantityClickCounterDesktop:function(a){k++},getQuantityClickCounterMobile:function(){return n},incrementQuantityClickCounterMobile:function(a){n++}}});n.when("sns-atc","sns-frequency-bottom-sheet","sns-frequency-popover","sns-opt-in-checkbox",
"sns-event-handler","sns-metrics-helper","sns-price-refresh").execute("sns-execute",function(e,a,b,d,c,h,f){e.init();a.init();b.init();d.init();c.init();h.init();f.init()});n.when("moq-core").register("sns-moq-helper",function(e){return{isSnsLocked:e.isSnsLocked}});n.register("sns-marketplace-util",function(){return{marketplace:"US"}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("AmazonsChoiceAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","a-popover","ready").execute(function(a,b){var g=a.$;g(document).delegate("#why-we-love-this-product-link","click mouseenter",function(a){b.get(g("#ac-badge-popover-declarative")).show();a.preventDefault()})});"use strict";b.when("A","atf","dp-refresh-handler","twisterModule","ac-state-utils").execute(function(a,
b,g,c,d){d.addACStateParamsToPageRefreshAjaxUrl()});"use strict";b.when("A","atf","dp-refresh-handler","ready").register("ac-state-utils",function(a,b,c){return{addACStateParamsToPageRefreshAjaxUrl:function(){var b={featureName:"acBadge"},d=a.$,e=a.state("acState");if(e){var f={};e.acAsin&&(f.acAsin=e.acAsin);e.modalityMetadata&&(f.ac_md=e.modalityMetadata);d.isEmptyObject(f)||(new c(b)).addParams(f)}}}})});
/* ******** */
(function(a){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,b=e?e("DetailPagePRSubsWidgetAssets",""):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,e){a.when("A","jQuery","ready","cf").execute(function(b,d){function a(){d(".prsubswidget-asin-title, .prsubswidget-asin-image").unbind("mousedown.prsubswidget");d(".prsubswidget-asin-title, .prsubswidget-asin-image").bind("mousedown.prsubswidget",function(a){if(c.ue&&c.ue.event&&d(a.target).parents("a")){var b=
d(a.target).parents("a").data("subsAsin");a=d(a.target).parents("a").data("surfacedAsinRequestId");b&&a&&c.ue.event({producerId:"prservices_subs_feedback_loop",schemaId:"prservices.ClickedSubstituteEvent.3",subsAsin:b,surfacedAsinRequestId:a},"producer","schema")}})}a();b.on("a:pageUpdate",a)})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("PrimeOneClickAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.register("PrimeOneClickCountdown",function(){function a(e,a,b,c,d){if(!(1>e)){var f=this;this.endTime=this.getCurrentTime()+e;this.expirationCallback=a;this.displayElement=b;this.displayEnabled=!!d;this.formatFunction=c;this.update();this.currentTimer=setInterval(function(){f.update()},6E4)}}
a.prototype.update=function(){var a=this.endTime-this.getCurrentTime();0>a&&(a=0);this.updateDisplay(a);0===a&&("function"===typeof this.expirationCallback&&this.expirationCallback(),this.destroy())};a.prototype.updateDisplay=function(a){this.displayElement&&this.displayEnabled&&(this.displayElement.innerHTML=this.getCountdownDisplay(Math.floor(a/3600),Math.floor(a%3600/60),a%60))};a.prototype.getCountdownDisplay=function(a,b,c){return"function"===typeof this.formatFunction?this.formatFunction(a,
b,c):a+"h "+b+"m "+c+"s"};a.prototype.enableDisplay=function(){this.displayEnabled=!0;this.update()};a.prototype.disableDisplay=function(a){this.displayEnabled=!1;a&&this.displayElement&&(this.displayElement.innerHTML="")};a.prototype.getCurrentTime=function(){return Math.floor(+new Date/1E3)};a.prototype.destroy=function(){clearTimeout(this.currentTimer)};return{Countdown:a}})});
/* ******** */
(function(k){var m=window.AmazonUIPageJS||window.P,q=m._namespace||m.attributeErrors,l=q?q("DetailPageSTSAssets",""):m;l.guardFatal?l.guardFatal(k)(l,window):l.execute(function(){k(l,window)})})(function(k,m,q){function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,
e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");}function l(b,e){if(!(b instanceof e))throw new TypeError("Cannot call a class as a function");
}"use strict";"use strict";k.when("A","jQuery","ship-to-store-settings","vas-metrics-publisher","ready").execute("ship-to-store-controller",function(b,e,u,f){function d(){k.when(a.STS_QTY_DROPDOWN).execute(function(c){n.stsVM.isSdpOfferSelected&&(c=c.getSelect("quantity"))&&(c.update({status:"disabled"}),1<parseInt(c.val(),10)&&(c.setValue("1"),e(a.STS_QUANTITY_ALERT).removeClass("a-hidden"),f.logUeMetricIncreaseCount(n.refTagPrefix+"quantityAlert")))})}function v(){k.when(a.STS_QTY_DROPDOWN).execute(function(c){(c=
c.getSelect("quantity"))&&c.update({status:"normal"});e(a.STS_QUANTITY_ALERT).addClass("a-hidden");e(a.STS_SERVICES_ROW).removeClass("addProfessionalServicesRow-alert-on")})}var a={STS_CHECKBOX:"#vas-psa-sts-checkbox-input",STS_PREFERENCES_BUTTON:"#vas-psa-sts-preferences-button",STS_QUANTITY_ALERT:".vas-psa-sts-quantity-alert",STS_SERVICES_ROW:".addProfessionalServicesRow",STS_ATC_BUTTON:"#add-to-cart-button",STS_QTY_DROPDOWN:"a-dropdown"},n={},c=JSON.parse(e("[data-a-state*\x3dvas-common-vm]").html());
c&&c.isShipToStore&&(c.hijackMBCATC=!1,c.populateMBCATC=!1,c.showFakeTwisterBundles=!1,c.showEnhancedUpsellBundle=!1,e("[data-a-state*\x3dvas-common-vm]").html(JSON.stringify(c)));var h={stsCheckBoxHandler:function(){if(e(a.STS_CHECKBOX).is(":checked")){if(f.logUeMetricIncreaseCount(n.refTagPrefix+"vasCheckBox_checked"),d(),n.stsVM.isSdpOfferSelected)try{b.trigger("vas:add-service-asin-buybox-event",n.stsVM.baseAsinOfferData),f.increaseMetricBy("a2cFormAddEventSend_success",1),f.increaseMetricBy("a2cFormAddEventSend_fail",
0)}catch(c){f.increaseMetricBy("a2cFormAddEventSend_success",0),f.increaseMetricBy("a2cFormAddEventSend_fail",1),f.log(c)}}else{f.logUeMetricIncreaseCount(n.refTagPrefix+"vasCheckBox_unchecked");v();try{b.trigger("vas:remove-service-asin-buybox-event"),f.increaseMetricBy("a2cFormRemoveEventSend_fail",0),f.increaseMetricBy("a2cFormRemoveEventSend_success",1)}catch(c){f.increaseMetricBy("a2cFormRemoveEventSend_success",0),f.increaseMetricBy("a2cFormRemoveEventSend_fail",1),f.log(c)}}},stsAtcHandler:function(){f.logUeMetricIncreaseCount(n.refTagPrefix+
"atcClick");e(a.STS_CHECKBOX).is(":checked")?f.logUeMetricIncreaseCount(n.refTagPrefix+"atcClick_vasBuyBoxChecked"):f.logUeMetricIncreaseCount(n.refTagPrefix+"atcClick_vasBuyBoxUnChecked");e(a.STS_ATC_BUTTON).unbind("click.lsatc");e(a.STS_ATC_BUTTON).click()}},g=function(){f.logRefTag(n.refTagPrefix);e(a.STS_CHECKBOX).unbind("change");e(a.STS_CHECKBOX).bind("change",function(){h.stsCheckBoxHandler()});e(a.STS_ATC_BUTTON).unbind("click.lsatc");e(a.STS_ATC_BUTTON).bind("click.lsatc",function(){h.stsAtcHandler()});
e(a.STS_PREFERENCES_BUTTON).unbind("click");e(a.STS_PREFERENCES_BUTTON).bind("click",function(){f.logUeMetricIncreaseCount(n.refTagPrefix+"selectAssemblyPreferences_click")});h.stsCheckBoxHandler()};b.off("vas:widgetname:sts");b.on("vas:widgetname:sts",function(){n=u.fetch();g()})});k.when("ship-to-store-settings","vas-common-settings","query-param","vas-widgets").register("sts-pdp-only-controller",function(b,e,u){var f=b.fetch();if(!f||!f.stsVM||"stsPdpOnly"!==f.stsVM.winningWidgetName)return!1;
k.when("A","ship-to-store-metric-publisher","ship-to-store-metric-names","vas-core-buybox").execute(function(d,b,a,n){function c(){}var h=new b(f.refTagPrefix);h.publish(a.LOADED);var g=d.$,W,r,N,l,m,t,q,G,x,y,H,O,P,X,I,A,Y,Z,aa,B,Q,ba,ca,R,da,S,J,C,w,T,K,z,D,U={},V=[],L={},M,E,F,ea,fa,p=[];c.prototype.init=function(){performance&&performance.mark("ship-to-store-ingress-start");k.when("a-popover","a-dropdown","ready").execute("sts-pdp-only-controller-init",function(b,e){h.publish(a.INIT);W=g("#addProfessionalServicesRow");
z=f.stsVM.modalOffers;d.isArray(z)&&z.length?(x=g("#sts-ingress-offered"),y=g("#sts-ingress-selected"),H=g("#sts-selected-service-below-address"),N=g("#add-to-cart-button"),l=g("#buyNow_feature_div"),m=g("#OneClickBox"),g("#vas-psa-sts-checkbox-input"),q=g("#sts-pdp-service-modal-content"),F=(b=e.getSelect("quantity"))?b.val():1,O=g(".sts-modal-content-column"),P=g(".sts-modal-map-column"),X=g("#sts-modal-map-pushpin-template"),I=g("#sts-modal-offer-scroller"),A=g("#sts-modal-offer-scroller-content"),
Y=g("#sts-modal-offer-wrapper-template"),Z=g("#sts-modal-offer-price-template"),aa=g("#vas-zipCodeValidationRegexString"),B=g("#sts-zip-error"),da=f.stsVM.includedServicesEnabled,S=f.stsVM.atcSiEnabled,R=2,M=f.stsVM.productQuantityToUpsellAsinMap,ea=Object.keys(M),h.publish(a.OFFERS_ON_PAGE_LOAD,z.length),k.when("a-modal").execute(function(a){G=a.get(g("#vasServiceInterstitial"));c.prototype.modalReady()}),r=g("body"),r.delegate("#sts-select-button","click",c.prototype.offeredIngressClick),r.delegate("#sts-change-installation",
"click",c.prototype.selectedIngressChangeClick),r.delegate(".sts-modal-accept-offer","click",c.prototype.acceptOfferClick),r.delegate(".sts-modal-decline-offer","click",c.prototype.declineOfferClick),r.delegate(".sts-modal-offer-wrapper","click",c.prototype.selectionChanged),r.delegate("#sts-pdp-only-sheet-zip-update-link","click",c.prototype.zipCodePopup),r.delegate("#sts-pdp-only-modal-zip-update-form","submit",c.prototype.zipCodeRefresh),r.undelegate("#add-to-cart-button","click.lsatc"),r.delegate("#add-to-cart-button",
"click.lsatc",c.prototype.atcClick),d.on("a:popover:beforeHide:vasServiceInterstitial",c.prototype.modalBeforeHide),d.on("a:popover:beforeShow:vasServiceInterstitial",c.prototype.modalBeforeShow),d.on("a:popover:afterShow:vasServiceInterstitial",c.prototype.modalAfterShow),d.on("a:popover:afterShow:includedServicesPopover",c.prototype.includedServicesPopoverHover),Q=g("#sts-pdp-only-sheet-zip-update-link"),d.declarative.create(Q,"a-popover",{name:"sts-zip-update",closeButton:"false",activate:"onclick"}),
fa=g("#sts-zip-update-popover-content"),d.on("a:dropdown:quantity:select",c.prototype.quantityChanged),c.prototype.generateHTMLTemplatesFromOffers(),E=new u,E.parameterExists("sts-ao")&&(b=E.getParameter("sts-ao"),b=A.find('[data-sts-ao\x3d"'+b+'"]'),0<b.length?(h.publish(a.PAGE_RELOAD_OFFER_NOT_FOUND),c.prototype.changeSelectedOffer(b),c.prototype.acceptOffer()):h.publish(a.PAGE_RELOAD_OFFER_FOUND)),d.trigger("sts:controller-ready")):(h.publish(a.NO_OFFERS_ON_PAGE_LOAD),h.publish(a.OFFERS_ON_PAGE_LOAD,
0),W.hide())})};c.prototype.includedServicesPopoverHover=function(){h.publish(a.INCLUDED_SERVICES_DESKTOP_HOVER)};c.prototype.getDefaultOffer=function(){return q.find(".sts-modal-offer-wrapper:first-of-type")};c.prototype.zipCodePopup=function(){fa.show();h.publish(a.ZIP_UPDATE_SHOW)};c.prototype.quantityChanged=function(a){F=a.value;a=t.find(".sts-merchant-address").html();c.prototype.generateHTMLTemplatesFromOffers();for(var b=null,e=0;e<p.length;e++)if(p[e].displayAddress===a){b=p[e];break}b?(a=
A.find('[data-sts-ao\x3d"'+b.storeId+'"]'),c.prototype.changeSelectedOffer(a),!y.is(":visible")&&0<=g.inArray(F,ea)?x.show():C&&(d.trigger("vas:remove-service-asin-buybox-event"),c.prototype.acceptOffer())):(d.trigger("vas:remove-service-asin-buybox-event"),y.hide(),x.hide(),C=!1,l.show(),m.show())};c.prototype.changeSelectedOffer=function(a){t.removeClass("sts-modal-offer-selected");t=a;c.prototype.selectHighlightedOffer()};c.prototype.highlightDefaultOffer=function(){t=c.prototype.getDefaultOffer();
c.prototype.selectHighlightedOffer()};c.prototype.selectHighlightedOffer=function(){t.addClass("sts-modal-offer-selected");g('input[name\x3d"shipToStore-merchant-select"]',t).prop("checked",!0);I.animate({scrollTop:t.offset().top-I.offset().top+I.scrollTop()})};c.prototype.setVisibleOffers=function(){var c=M[F];p=[];d.each(z,function(a){a.asin===c&&p.push(a)})};c.prototype.selectedIngressChangeClick=function(){h.publish(a.SELECTED_INGRESS_CHANGE_CLICK);G.show()};c.prototype.offeredIngressClick=function(){h.publish(a.OFFER_INGRESS_CLICK);
G.show()};c.prototype.modalReady=function(){k.when("a-button").execute(function(c){c("#sts-select-button").enable()})};c.prototype.modalAfterShow=function(){h.publish(a.OFFER_LIST_OPENED);ca=!0;c.prototype.renderMapPinsAndEventsIfMapLayerExists()};c.prototype.modalBeforeHide=function(){h.publish(a.OFFER_LIST_CLOSED);ba&&(r.undelegate("#add-to-cart-button","click.lsatc"),N.click())};c.prototype.modalBeforeShow=function(){if(performance){performance.mark("ship-to-store-modal-opened");performance.measure(a.MODAL_OPENED_AFTER_MILLISECONDS,
"ship-to-store-ingress-start","ship-to-store-modal-opened");var b=d.map(performance.getEntriesByName(a.MODAL_OPENED_AFTER_MILLISECONDS),function(c){return c.duration}).shift();b&&h.publish(a.MODAL_OPENED_AFTER_MILLISECONDS,b)}d.off("a:popover:beforeShow:vasServiceInterstitial",c.prototype.modalBeforeShow)};c.prototype.atcClick=function(){h.publish(a.ATC_CLICK);n.registerBuyboxEventHandlers();ba=!0;c.prototype.shouldContinueAtcClick()?(r.undelegate("#add-to-cart-button","click.lsatc"),N.click()):c.prototype.offeredIngressClick();
return!1};c.prototype.acceptOfferClick=function(){h.publish(a.OFFER_ACCEPTED_CLICK);c.prototype.acceptOffer();E.setParameter("sts-ao",U.storeId);c.prototype.closeModal()};c.prototype.acceptOffer=function(){h.publish(a.OFFER_ACCEPTED);y.find("#sts-selected-service-provider-address").text(t.find(".sts-merchant-address").text());y.find("#sts-selected-service-provider-name").text(t.find(".sts-merchant-name").text());H.length||(g("#sts-ingress-selected div:nth-child(2) div:nth-child(3) span").attr("id",
"sts-selected-service-below-address"),H=g("#sts-selected-service-below-address"));H.html(t.find(".sts-merchant-price").html());x.hide();y.show();C=!0;l.hide();m.hide();U=g(".sts-modal-offer-selected").data();var c=Object.assign({},U);delete c.id;d.trigger("vas:remove-service-asin-buybox-event");d.trigger("vas:add-service-asin-buybox-event",c);return!1};c.prototype.declineOfferClick=function(){h.publish(a.OFFER_DECLINED_CLICK);h.publish(a.OFFER_DECLINED);y.hide();x.show();d.trigger("vas:remove-service-asin-buybox-event");
E.removeParameter("sts-ao");C=!1;l.show();m.show();c.prototype.closeModal();return!1};c.prototype.closeModal=function(){G.hide();return!1};c.prototype.selectionChanged=function(a){c.prototype.changeSelectedOffer(g(a.currentTarget));a=D.index(D.filter(":checked"));K&&c.prototype.pushpinClicked(L[a])};c.prototype.zipCodeRefresh=function(b){k.when("vas-utilities").execute(function(d){var f=g(b.target).attr("action"),v=e.getSetting("widgetCommonVM"),n=g("#sts-zip-input").val();d.validateZipCode(n,aa)?
g.get(f,{a:v.productAsin,z:n,ms:v.mappingSet}).done(function(b){b&&b.length?(h.publish(a.ZIP_UPDATE_SUCCESS),B.addClass("aok-hidden"),c.prototype.convertZipCodeOffersToModalOffers(b),c.prototype.generateHTMLTemplatesFromOffers(),c.prototype.renderMapPinsAndEventsIfMapLayerExists(),Q.text(n),h.publish(a.OFFERS_ON_ZIP_UPDATE,b.length)):(h.publish(a.ZIP_UPDATE_NO_OFFERS),B.removeClass("aok-hidden"),h.publish(a.OFFERS_ON_ZIP_UPDATE,0))}).error(function(){h.publish(a.ZIP_UPDATE_ERROR);B.removeClass("aok-hidden")}):
(h.publish(a.ZIP_UPDATE_INVALID_ZIP_ENTERED),B.removeClass("aok-hidden"))});return!1};c.prototype.convertZipCodeOffersToModalOffers=function(c){c&&(d.each(c,function(c){if(c.geoCodes&&c.geoCodes.Latitude&&c.geoCodes.Longitude){var a={};a.latitude=c.geoCodes.Latitude;a.longitude=c.geoCodes.Longitude;c.geoCodes=[a]}}),z=c)};c.prototype.generateHTMLTemplatesFromOffers=function(){c.prototype.setVisibleOffers();if(!M[F])return h.publish(a.SELECTED_QTY_NOT_MAPPED_TO_ASIN),!1;if(!p||!p.length)return h.publish(a.SELECTED_QTY_MAPPED_TO_ASIN_WO_OFFERS),
!1;h.publish(a.SELECTED_QTY_MAPPED_TO_ASIN_W_OFFERS);t=null;A.empty();var b=0;d.each(p,function(a){var d=Y.clone(),e=Z.clone(),f={merchantId:a.merchantId,offerlistingId:a.offerListingId,upsellAsin:a.asin,storeId:a.storeId};e.removeClass("aok-hidden");e.html(a.localizedPrice);e.removeAttr("id");d.find(".sts-merchant-name").html(a.merchantName);d.find(".sts-merchant-address").html(a.displayAddress);d.find(".sts-merchant-ratings").html(a.ratingsAndReviews);d.find(".sts-merchant-price").html(a.priceAndServiceCount);
d.find(".sts-merchant-price .price").html(e);da&&c.prototype.showIncludedServices(d,a);d.data(f);d.attr("data-sts-ao",a.storeId);d.removeClass("aok-hidden");d.attr("id","sts-offer-merchant-row-"+b);A.append(d);b++});h.publish(a.OFFERS_GENERATED,b);c.prototype.highlightDefaultOffer();D=g('#sts-modal-offer-scroller-content input[name\x3d"shipToStore-merchant-select"]');p&&p[0]&&(x.find("#sts-offered-below-button").html(p[0].installationOfferedBelowButtonString),g("#sts-offered-below-button").find("#sts-pdp-only-lowest-price").text(p[0].localizedPrice));
if(performance){performance.mark("ship-to-store-ingress-end");performance.measure(a.INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY,"ship-to-store-ingress-start","ship-to-store-ingress-end");var e=performance.getEntriesByName(a.INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY);if(e.length){var f=e[0].duration;h.publish(a.INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY,e[0].startTime+f);h.publish(a.INGRESS_SHOWING_SINCE_MODULE_LOAD_LATENCY,f)}}};c.prototype.showIncludedServices=function(b,e){if(e.includedServicesList&&0<e.includedServicesList.length){e.includedServicesList.sort();
c.prototype.setPreviewString(b,e.includedServicesList);b.find(".sts-pdp-only-included-services-container").removeClass("aok-hidden");if(e.includedServicesList.length>R){b.find(".sts-pdp-only-included-services-number-of-services").html(e.includedServicesNumberOfServicesWithPreviewString);var f=g(".sts-pdp-only-included-services-popover-content-template").clone();f.find(".sts-pdp-only-included-services-all-providers").html(e.includedServicesAllProviders);var v=g.map(e.includedServicesList,function(c){var a=
document.createElement("li");a.innerHTML=c;return a});f.find(".sts-pdp-only-included-services-list").append(v);v=b.find(".sts-pdp-only-included-services-popover-trigger");f={name:"includedServicesPopover",inlineContent:f.prop("outerHTML")};d.declarative.create(v,"a-popover",f);b.find(".sts-pdp-only-included-services-popover-trigger").removeClass("aok-hidden")}h.publish(a.INCLUDED_SERVICES_NUMBER_OF_SERVICES,e.includedServicesList.length)}};c.prototype.setPreviewString=function(c,a){c.find(".sts-pdp-only-included-services-preview").html(a.slice(0,
R).join(", "))};c.prototype.renderMapLayer=function(){w||(w=new Microsoft.Maps.Map(document.getElementById("sts-modal-map"),{credentials:"AgD__4QLnPZjTdAY_U1NlB-RhTfje8ULMcKzTV6tv8A5KYH0L-22G8AHx4M61so5",showLocateMeButton:!1}),J=new Microsoft.Maps.Infobox(new Microsoft.Maps.Location(0,0),{visible:!1,offset:new Microsoft.Maps.Point(0,30),height:80,width:80}),J.setMap(w))};c.prototype.renderMapPinsAndEvents=function(){if(w&&(w.entities.clear(),V=[],L={},p&&p.length)){O.removeClass("sts-modal-content-column-no-map");
P.removeClass("aok-hidden");d.each(p,c.prototype.createPushpinsForSTS);c.prototype.centerLocations(V);var a=D.index(D.filter(":checked"));c.prototype.pushpinClicked(L[a])}};c.prototype.renderMapPinsAndEventsIfMapLayerExists=function(){c.prototype.renderMapLayerIfNotExists();if(!c.prototype.hasAllGeographicallyMappableOffers(p))O.addClass("sts-modal-content-column-no-map"),P.addClass("aok-hidden");else if(K)c.prototype.renderMapPinsAndEvents();else if(T)d.on("ship-to-store:bing-map:render-complete",
c.prototype.renderMapPinsAndEvents)};c.prototype.renderMapLayerIfNotExists=function(){if(c.prototype.hasAllGeographicallyMappableOffers(p)&&!T&&!K){T=!0;var a=(f.stsVM.languageOfPreference||"").replace("_","-");g.getScript("https://www.bing.com/api/maps/mapcontrol?setLang\x3d"+a,function(){g.getScript("https://images-na.ssl-images-amazon.com/images/G/01/vas/map/mapsjs-core.js",function(){g.getScript("https://images-na.ssl-images-amazon.com/images/G/01/vas/map/mapsjs-service.js",function(){g.getScript("https://images-na.ssl-images-amazon.com/images/G/01/vas/map/mapsjs-mapevents.js",
function(){g.getScript("https://images-na.ssl-images-amazon.com/images/G/01/vas/map/mapsjs-ui.js",function(){c.prototype.renderMapLayer();K=!0;d.trigger("ship-to-store:bing-map:render-complete")})})})})})}};c.prototype.createPushpinsForSTS=function(a,b){var d=a.geoCodes[0],d=new Microsoft.Maps.Location(d.latitude,d.longitude);V.push(d);var d=c.prototype.createPushpin(d,b),e=a.ratingsAndReviews.split(" "),f="0% positive";e.length&&4>=e[0].length&&(f=e[0]+" positive");d.metadata={title:a.merchantName,
displayAddress:a.displayAddress,price:a.localizedPrice,ratings:f,index:b};Microsoft.Maps.Events.addHandler(d,"click",function(a){c.prototype.pushpinClicked(a.target)});w.entities.push(d);L[d.metadata.index]=d};c.prototype.pushpinClicked=function(a){J.setLocation(a.getLocation());var d=X.clone();d.find(".sts-modal-map-pushpin-price").html(a.metadata.price);d.find(".sts-modal-map-pushpin-ratings").html(a.metadata.ratings);d.removeAttr("id");d.removeClass("aok-hidden");J.setOptions({visible:!0,description:d[0].outerHTML});
a=g("#sts-offer-merchant-row-"+a.metadata.index);c.prototype.changeSelectedOffer(a)};c.prototype.createPushpin=function(a,c){return new Microsoft.Maps.Pushpin(a,{icon:'\x3csvg style\x3d"left:-14px;top:-36px;" xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"28px" height\x3d"36px" \x3e\x3cpath d\x3d"M 19 31 C 19 32.7 16.3 34 13 34 C 9.7 34 7 32.7 7 31 C 7 29.3 9.7 28 13 28 C 16.3 28 19 29.3 19 31 Z" fill\x3d"#000" fill-opacity\x3d".2"\x3e\x3c/path\x3e\x3cpath d\x3d"M 13 0 C 9.5 0 6.3 1.3 3.8 3.8 C 1.4 7.8 0 9.4 0 12.8 C 0 16.3 1.4 19.5 3.8 21.9 L 13 31 L 22.2 21.9 C 24.6 19.5 25.9 16.3 25.9 12.8 C 25.9 9.4 24.6 6.1 22.1 3.8 C 19.7 1.3 16.5 0 13 0 Z" fill\x3d"#fff"\x3e\x3c/path\x3e\x3cpath d\x3d"M 13 2.2 C 6 2.2 2.3 7.2 2.1 12.8 C 2.1 16.1 3.1 18.4 5.2 20.5 L 13 28.2 L 20.8 20.5 C 22.9 18.4 23.8 16.2 23.8 12.8 C 23.6 7.07 20 2.2 13 2.2 Z" fill\x3d"#e47911"\x3e\x3c/path\x3e\x3ctext transform\x3d"matrix( 1 0 0 1 13 18 )" x\x3d"0" y\x3d"0" fill-opacity\x3d"1" fill\x3d"#fff" text-anchor\x3d"middle" font-weight\x3d"bold" font-size\x3d"13px" font-family\x3d"arial"\x3e'+
(c+1).toString()+"\x3c/text\x3e\x3c/svg\x3e"})};c.prototype.isGeographicallyMappableOffer=function(a){return a&&a.displayAddress&&a.geoCodes&&a.geoCodes.length&&a.geoCodes[0].latitude&&a.geoCodes[0].longitude&&a.merchantName&&a.merchantId&&a.offerListingId};c.prototype.hasAllGeographicallyMappableOffers=function(a){return null===a?!1:d.reduce(a,function(a,d){return a&&c.prototype.isGeographicallyMappableOffer(d)},!0)};c.prototype.centerLocations=function(a){w&&(a=Microsoft.Maps.LocationRect.fromLocations(a),
w.setView({bounds:a,padding:100}),9!==w.getZoom()&&w.setView({zoom:9}))};c.prototype.logUeMetricIncreaseCount=function(a,c){h.logUeMetricIncreaseCount(f.refTagPrefix+a,c)};c.prototype.shouldContinueAtcClick=function(){S||h.publish(a.ATC_CLICK_SI_DISABLED);return C||!x.is(":visible")||ca||!S};b=new c;b.init();d.on("a:pageUpdate",b.init)})});"use strict";"use strict";"use strict";k.when("A","ship-to-store-settings","ship-to-store-offer-tags-helper","ship-to-store").register("ship-to-store-pushpin-icon-helper",
function(b,e,u){return new function d(){var b=this;l(this,d);this.ZIP_ICON_CIRCLE_RADIUS=125;this.COLOR_ORANGE="#ec8c00";this.COLOR_GRAY="#767676";this.getPushpinIcon=function(a){return a.isMobileAddressAZipCode?b.createMobileAddressZipCodeIcon():a.showCustomerAddressOnMap?b.createPinIcon(a.pinSelected,'\x3cg transform\x3d"matrix( 1 0 0 1 4 5 )" id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                                \x3cg transform\x3d"translate(-905.000000, -636.000000)" fill\x3d"#FFFFFF"\x3e\n                                    \x3cg id\x3d"home" transform\x3d"translate(895.000000, 624.000000)"\x3e\n                                        \x3cg transform\x3d"translate(10.000000, 12.000000)" id\x3d"Group-2"\x3e\n                                            \x3cg\x3e\n                                                \x3cpolygon id\x3d"Fill-1" points\x3d"10.1169 -5.17241382e-05 -9.99999999e-05 7.09184483 1.1219 8.80468966 10.0959 2.51374138 18.7359 8.79486207 19.8859 7.10193103"\x3e\x3c/polygon\x3e\n                                                \x3cpolygon id\x3d"Fill-2" points\x3d"14.528475 5.30847414 14.528475 12.8948534 5.343225 12.8948534 5.343225 5.30847414 3.343225 5.30847414 3.343225 14.963819 16.528475 14.963819 16.528475 5.30847414"\x3e\x3c/polygon\x3e\n                                                \x3crect id\x3d"Rectangle" x\x3d"8.57142857" y\x3d"7.5" width\x3d"2.85714286" height\x3d"6"\x3e\x3c/rect\x3e\n                                            \x3c/g\x3e\n                                        \x3c/g\x3e\n                                    \x3c/g\x3e\n                                \x3c/g\x3e\n                            \x3c/g\x3e'):
e.get("offerTaggingEnabled")?u.hasCheapestTag(a.offerTags)?'\x3csvg width\x3d"29px" height\x3d"37px" viewBox\x3d"0 0 29 37" version\x3d"1.1" xmlns\x3d"http://www.w3.org/2000/svg" xmlns:xlink\x3d"http://www.w3.org/1999/xlink"\x3e\n                                         \x3cg id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                                             \x3cg id\x3d"2a-modal-sts-copy-4" transform\x3d"translate(-933.000000, -343.000000)"\x3e\n                                                 \x3cg id\x3d"modal-box-" transform\x3d"translate(360.000000, 66.000000)"\x3e\n                                                     \x3cg id\x3d"map-" transform\x3d"translate(415.000000, 36.000000)"\x3e\n                                                         \x3cg id\x3d"pin_sts" transform\x3d"translate(157.000000, 240.000000)"\x3e\n                                                             \x3cg id\x3d"pin-selected-copy-2" fill-rule\x3d"evenodd" stroke-width\x3d"1"\x3e\n                                                                 \x3cg id\x3d"Page-1"\x3e\n                                                                     \x3cpath d\x3d"M22.3448571,36.2826923 C22.3448571,37.0558462 19.1848571,37.6828462 15.2862857,37.6828462 C11.3877143,37.6828462 8.22628571,37.0558462 8.22628571,36.2826923 C8.22628571,35.5080769 11.3877143,34.8810769 15.2862857,34.8810769 C19.1848571,34.8810769 22.3448571,35.5080769 22.3448571,36.2826923" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                                                                     \x3cpath d\x3d"M15.2857143,35.0766308 C15.2028571,35.0605538 15,34.9567846 14.8771429,34.8924769 C14.8542857,34.8676308 2,25.9683231 2,15.6381692 C2,8.1434 7.96,2.04586154 15.2857143,2.04586154 C22.6114286,2.04586154 28.5714286,8.1434 28.5714286,15.6381692 C28.5714286,25.9683231 15.7171429,34.8676308 15.5871429,34.9567846 C15.5671429,34.9582462 15.3685714,35.0605538 15.2857143,35.0766308" id\x3d"Fill-3" fill\x3d"#00A4B4"\x3e\x3c/path\x3e\n                                                                     \x3cpath d\x3d"M15.2857143,1.02307692 C7.42857143,1.02307692 1,7.6 1,15.6384615 C1,26.4538462 14,35.5153846 14.4285714,35.8076923 C14.7142857,35.9538462 15,36.1 15.2857143,36.1 C15.5714286,36.1 15.8571429,35.9538462 16.1428571,35.8076923 C16.5714286,35.5153846 29.5714286,26.4538462 29.5714286,15.6384615 C29.5714286,7.6 23.1428571,1.02307692 15.2857143,1.02307692 M15.2857143,3.06923077 C22.06,3.06923077 27.5714286,8.70784615 27.5714286,15.6384615 C27.5714286,24.6576154 17.0614286,32.642 15.2857143,33.9266923 C13.51,32.642 3,24.6576154 3,15.6384615 C3,8.70784615 8.51142857,3.06923077 15.2857143,3.06923077" id\x3d"Fill-5" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                                 \x3c/g\x3e\n                                                             \x3c/g\x3e\n                                                             \x3cpath d\x3d"M14.9567054,23 L14.9567054,21.1964097 C13.8824304,21.1175638 12.9412219,20.8169685 12.1330517,20.2946146 L12.1330517,18.6388596 C12.8426646,18.9640988 13.404433,19.195705 13.8183738,19.3336853 C14.2323146,19.4716656 14.6117547,19.5554381 14.9567054,19.5850053 L14.9567054,16.7317846 L14.3653643,16.5100317 C13.5374827,16.2045039 12.9362919,15.8373833 12.561774,15.4086589 C12.1872561,14.9799345 12,14.4501967 12,13.8194298 C12,12.9816924 12.2710286,12.2868736 12.813094,11.7349525 C13.3551593,11.1830314 14.0696893,10.8676526 14.9567054,10.7888068 L14.9567054,9 L16.0506864,9 L16.0506864,10.8035903 C16.8194336,10.8824362 17.5635304,11.123898 18.2829989,11.5279831 L18.2829989,13.1837381 C17.464973,12.7599416 16.7208763,12.5036963 16.0506864,12.4149947 L16.0506864,15.2534319 L16.5681098,15.4456177 C17.4649816,15.770857 18.1055947,16.1453692 18.4899683,16.5691658 C18.8743419,16.9929623 19.0665259,17.5202362 19.0665259,18.1510032 C19.0665259,18.9690291 18.7930334,19.6515284 18.2460401,20.1985216 C17.6990469,20.7455149 16.9672696,21.0732131 16.0506864,21.1816262 L16.0506864,23 L14.9567054,23 Z M17.189018,18.2840549 C17.189018,17.9883829 17.1003177,17.7444571 16.9229145,17.5522703 C16.7455113,17.3600835 16.4547715,17.1900747 16.0506864,17.0422386 L16.0506864,19.5702218 C16.3759256,19.5307988 16.6469542,19.3878928 16.8637804,19.1414995 C17.0806065,18.8951061 17.189018,18.6092941 17.189018,18.2840549 Z M13.8479409,13.686378 C13.8479409,13.9721943 13.9341772,14.2136562 14.1066526,14.4107709 C14.2791279,14.6078855 14.562476,14.7852861 14.9567054,14.9429778 L14.9567054,12.4002112 C14.6117547,12.4494899 14.3407261,12.589932 14.1436114,12.8215417 C13.9464967,13.0531515 13.8479409,13.3414273 13.8479409,13.686378 Z" id\x3d"$" fill\x3d"#FFFFFF" fill-rule\x3d"nonzero"\x3e\x3c/path\x3e\n                                                         \x3c/g\x3e\n                                                     \x3c/g\x3e\n                                                 \x3c/g\x3e\n                                             \x3c/g\x3e\n                                         \x3c/g\x3e\n                                     \x3c/svg\x3e':
u.hasFastestTag(a.offerTags)?'\x3csvg width\x3d"29px" height\x3d"37px" viewBox\x3d"0 0 29 37" version\x3d"1.1" xmlns\x3d"http://www.w3.org/2000/svg" xmlns:xlink\x3d"http://www.w3.org/1999/xlink"\x3e\n                                        \x3cg id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                                            \x3cg id\x3d"2a-modal-sts-copy-4" transform\x3d"translate(-890.000000, -343.000000)"\x3e\n                                                \x3cg id\x3d"modal-box-" transform\x3d"translate(360.000000, 66.000000)"\x3e\n                                                    \x3cg id\x3d"map-" transform\x3d"translate(415.000000, 36.000000)"\x3e\n                                                        \x3cg id\x3d"pin_sts" transform\x3d"translate(114.000000, 240.000000)"\x3e\n                                                            \x3cg id\x3d"pin-selected-copy-2" stroke-width\x3d"1"\x3e\n                                                                \x3cg id\x3d"Page-1"\x3e\n                                                                    \x3cpath d\x3d"M22.3448571,36.2826923 C22.3448571,37.0558462 19.1848571,37.6828462 15.2862857,37.6828462 C11.3877143,37.6828462 8.22628571,37.0558462 8.22628571,36.2826923 C8.22628571,35.5080769 11.3877143,34.8810769 15.2862857,34.8810769 C19.1848571,34.8810769 22.3448571,35.5080769 22.3448571,36.2826923" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                                                                    \x3cpath d\x3d"M15.2857143,35.0766308 C15.2028571,35.0605538 15,34.9567846 14.8771429,34.8924769 C14.8542857,34.8676308 2,25.9683231 2,15.6381692 C2,8.1434 7.96,2.04586154 15.2857143,2.04586154 C22.6114286,2.04586154 28.5714286,8.1434 28.5714286,15.6381692 C28.5714286,25.9683231 15.7171429,34.8676308 15.5871429,34.9567846 C15.5671429,34.9582462 15.3685714,35.0605538 15.2857143,35.0766308" id\x3d"Fill-3" fill\x3d"#00A4B4"\x3e\x3c/path\x3e\n                                                                    \x3cpath d\x3d"M15.2857143,1.02307692 C7.42857143,1.02307692 1,7.6 1,15.6384615 C1,26.4538462 14,35.5153846 14.4285714,35.8076923 C14.7142857,35.9538462 15,36.1 15.2857143,36.1 C15.5714286,36.1 15.8571429,35.9538462 16.1428571,35.8076923 C16.5714286,35.5153846 29.5714286,26.4538462 29.5714286,15.6384615 C29.5714286,7.6 23.1428571,1.02307692 15.2857143,1.02307692 M15.2857143,3.06923077 C22.06,3.06923077 27.5714286,8.70784615 27.5714286,15.6384615 C27.5714286,24.6576154 17.0614286,32.642 15.2857143,33.9266923 C13.51,32.642 3,24.6576154 3,15.6384615 C3,8.70784615 8.51142857,3.06923077 15.2857143,3.06923077" id\x3d"Fill-5" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                                \x3c/g\x3e\n                                                            \x3c/g\x3e\n                                                            \x3cpath d\x3d"M12.7027775,22.9988509 C12.5330142,22.9000772 15.4618683,17.4301913 15.3612354,17.1898678 C15.2606025,16.9495444 12.1541096,16.0730249 12.0027227,15.650709 C11.8504608,15.228393 18.1343273,8.87887671 18.2997152,9.00176054 C18.4642281,9.12464437 15.5616261,14.6310843 15.6403822,14.8107436 C15.7200135,14.9896251 18.9017623,15.9026986 18.9988949,16.3499024 C19.0951524,16.7971062 12.8716657,23.0976246 12.7027775,22.9988509" id\x3d"bolt" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                        \x3c/g\x3e\n                                                    \x3c/g\x3e\n                                                \x3c/g\x3e\n                                            \x3c/g\x3e\n                                        \x3c/g\x3e\n                                    \x3c/svg\x3e':
'\x3csvg width\x3d"29px" height\x3d"37px" viewBox\x3d"0 0 29 37" version\x3d"1.1" xmlns\x3d"http://www.w3.org/2000/svg" xmlns:xlink\x3d"http://www.w3.org/1999/xlink"\x3e\n                                        \x3cg id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                                            \x3cg id\x3d"2a-modal-sts-copy-4" transform\x3d"translate(-1033.000000, -453.000000)"\x3e\n                                               \x3cg id\x3d"modal-box-" transform\x3d"translate(360.000000, 66.000000)"\x3e\n                                                    \x3cg id\x3d"map-" transform\x3d"translate(415.000000, 36.000000)"\x3e\n                                                        \x3cg id\x3d"pin_service" transform\x3d"translate(257.000000, 350.000000)"\x3e\n                                                            \x3cg id\x3d"pin-selected" stroke-width\x3d"1"\x3e\n                                                               \x3cg id\x3d"Page-1"\x3e\n                                                                    \x3cpath d\x3d"M22.3448571,36.2826923 C22.3448571,37.0558462 19.1848571,37.6828462 15.2862857,37.6828462 C11.3877143,37.6828462 8.22628571,37.0558462 8.22628571,36.2826923 C8.22628571,35.5080769 11.3877143,34.8810769 15.2862857,34.8810769 C19.1848571,34.8810769 22.3448571,35.5080769 22.3448571,36.2826923" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                                                                    \x3cpath d\x3d"M15.2857143,35.0766308 C15.2028571,35.0605538 15,34.9567846 14.8771429,34.8924769 C14.8542857,34.8676308 2,25.9683231 2,15.6381692 C2,8.1434 7.96,2.04586154 15.2857143,2.04586154 C22.6114286,2.04586154 28.5714286,8.1434 28.5714286,15.6381692 C28.5714286,25.9683231 15.7171429,34.8676308 15.5871429,34.9567846 C15.5671429,34.9582462 15.3685714,35.0605538 15.2857143,35.0766308" id\x3d"Fill-3" fill\x3d"#EC8C00"\x3e\x3c/path\x3e\n                                                                   \x3cpath d\x3d"M15.2857143,1.02307692 C7.42857143,1.02307692 1,7.6 1,15.6384615 C1,26.4538462 14,35.5153846 14.4285714,35.8076923 C14.7142857,35.9538462 15,36.1 15.2857143,36.1 C15.5714286,36.1 15.8571429,35.9538462 16.1428571,35.8076923 C16.5714286,35.5153846 29.5714286,26.4538462 29.5714286,15.6384615 C29.5714286,7.6 23.1428571,1.02307692 15.2857143,1.02307692 M15.2857143,3.06923077 C22.06,3.06923077 27.5714286,8.70784615 27.5714286,15.6384615 C27.5714286,24.6576154 17.0614286,32.642 15.2857143,33.9266923 C13.51,32.642 3,24.6576154 3,15.6384615 C3,8.70784615 8.51142857,3.06923077 15.2857143,3.06923077" id\x3d"Fill-5" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                                \x3c/g\x3e\n                                                            \x3c/g\x3e\n                                                            \x3cpath d\x3d"M20.0345576,15.6335486 C19.1039732,16.564133 17.7574459,16.8190133 16.5947577,16.4063241 L12.3241563,20.6769255 C11.8930289,21.1080529 11.1874985,21.1080529 10.7563711,20.6769255 L10.3230745,20.2430866 C9.89194713,19.8125015 9.89248943,19.1064288 10.3236168,18.6758437 L14.5936759,14.4057846 C14.1804444,13.2430964 14.435867,11.8960268 15.3659091,10.9654424 C16.2650401,10.0663113 17.5535416,9.79624662 18.6880302,10.1509099 L16.7948659,12.0440743 C16.7948659,12.0440743 16.4006148,12.8971099 17.2514813,13.7479764 C18.1023478,14.5993852 18.9559257,14.2051341 18.9559257,14.2051341 L20.8490901,12.3119698 C21.2037534,13.4464584 20.9336887,14.7349599 20.0345576,15.6335486" id\x3d"service" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                        \x3c/g\x3e\n                                                    \x3c/g\x3e\n                                               \x3c/g\x3e\n                                            \x3c/g\x3e\n                                        \x3c/g\x3e\n                                    \x3c/svg\x3e':
b.createPinIcon(a.pinSelected,'\x3ctext id\x3d"text" transform\x3d"matrix( 1 0 0 1 14 18 )" x\x3d"0" y\x3d"0" fill-opacity\x3d"1" fill\x3d"#fff" text-anchor\x3d"middle" font-weight\x3d"bold" font-size\x3d"13px" font-family\x3d"\'Amazon Ember\',Arial,sans-serif"\x3e\n                         '+(a.offerIndex+1)+"\n                     \x3c/text\x3e")};this.createMobileAddressZipCodeIcon=function(){return'\x3csvg height\x3d"'+b.ZIP_ICON_CIRCLE_RADIUS+'" width\x3d"'+b.ZIP_ICON_CIRCLE_RADIUS+'" xmlns\x3d"http://www.w3.org/2000/svg"\x3e\n                        \x3ccircle cx\x3d"50%" cy\x3d"50%" r\x3d"50%" fill\x3d"'+
b.COLOR_ORANGE+'" fill-opacity\x3d"0.5"\x3e\n                        \x3c/circle\x3e\n                        \x3ctext x\x3d"50%" y\x3d"50%" fill-opacity\x3d"1" fill\x3d"#000" text-anchor\x3d"middle" font-weight\x3d"bold" font-size\x3d"15px" dy\x3d".3em" font-family\x3d"\'Amazon Ember\',Arial,sans-serif"\x3e\n                             '+e.get("modalPushpinZipPrefix")+" "+e.get("zipCode")+"\n                        \x3c/text\x3e\n                    \x3c/svg\x3e"};this.createPinIcon=function(a,
d){return'\x3csvg style\x3d"left:-14px;top:-36px;"  xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"28px" height\x3d"36px" \x3e\n                        \x3cpath d\x3d"M21,33.5007825 C21,34.3286385 17.8665385,35 14.0007083,35 C10.1348781,35 7,34.3286385 7,33.5007825 C7,32.6713615 10.1348781,32 14.0007083,32 C17.8665385,32 21,32.6713615 21,33.5007825" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                        \x3cpath d\x3d"M14.2663345,32.1398355 L13.9060703,32.4894035 L13.858873,32.2328415 L14.013324,31.9216153 C14.1356449,32.0100221 14.2240065,32.0735979 14.2637423,32.1024204 L14.2663345,32.1398355 Z M14.0223706,31.9243914 C14.1104469,31.9676951 14.2449887,32.0282883 14.1809248,32.0165031 L14.0872178,32.525889 L13.8439568,32.151758 L13.8190752,32.0165031 C13.8151665,32.0172221 13.8115316,32.0178891 13.8081517,32.0185076 C13.8268521,32.0061311 13.8482135,31.9918659 13.8720408,31.9758254 C13.9134319,31.9589986 13.9652927,31.9405319 14.0223706,31.9243914 Z M13.9835281,31.9000747 C14.0877611,31.8286971 14.2181338,31.7380569 14.3666419,31.6328035 C14.8297355,31.3045911 15.3445613,30.9224441 15.8975864,30.4903188 C17.467962,29.2632512 19.0345365,27.879962 20.4908916,26.3720501 C24.5738016,22.1446002 27,17.783901 27,13.579646 C27,6.65108026 21.1739922,1 14,1 C6.8260078,1 1,6.65108026 1,13.579646 C1,17.7845531 3.42611067,22.1459465 7.5044675,26.3738413 C8.95113624,27.8735539 10.5036727,29.2473243 12.0594008,30.4668331 C12.6813761,30.954389 13.5349851,31.5757173 13.9835281,31.9000747 Z" id\x3d"Fill-3" stroke\x3d"#FFFFFF" stroke-width\x3d"2" fill\x3d"'+
(a?b.COLOR_ORANGE:b.COLOR_GRAY)+'"\x3e\x3c/path\x3e\n                        '+d+"\n                    \x3c/svg\x3e"}}});"use strict";k.register("ship-to-store-metric-names",function(){return{ATC_CLICK:"add_to_cart_button_click",ATC_CLICK_SI_DISABLED:"add_to_cart_button_click_si_disabled",ATC_UBB_CLICK:"add_to_cart_ubb_button_click",CHANGED_QUANTITY:"changed_quantity_event",IA_TYPE_NOT_SET:"ia_type_not_set",IA_TYPE_SET:"ia_type_set",INCLUDED_SERVICES_DESKTOP_HOVER:"included_services_desktop_hover",
INCLUDED_SERVICES_MOBILE_CLICK:"included_services_mobile_click",INCLUDED_SERVICES_NUMBER_OF_SERVICES:"included-services-number-of-services",INIT:"init",INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY:"ingress-showing-since-page-load-latency",INGRESS_SHOWING_SINCE_MODULE_LOAD_LATENCY:"ingress-showing-since-module-load-latency",LOADED:"loaded",MODAL_OPENED_AFTER_MILLISECONDS:"modal_opened_after_milliseconds",NO_ACTIVE_OFFER_TYPE:"no_active_offer_type",NO_OFFERS_ON_PAGE_LOAD:"no_offers_on_page_load",OFFER_ACCEPTED:"offer_accepted",
OFFER_ACCEPTED_CLICK:"offer_accepted_click",OFFER_DECLINED:"offer_declined",OFFER_DECLINED_CLICK:"offer_declined_click",OFFER_INGRESS_CLICK:"offer_ingress_click",OFFER_INGRESS_CLICK_MODAL_NOT_READY:"offer_ingress_click_modal_not_ready",OFFER_LIST_CLOSED:"offer_list_closed",OFFER_LIST_OPENED:"offer_list_opened",OFFER_SELECTED:"offer_selected",OFFERS_GENERATED:"offers_generated",OFFERS_ON_PAGE_LOAD:"offers_on_page_load",OFFERS_ON_ZIP_UPDATE:"offers_on_zip_update",PAGE_RELOAD_OFFER_FOUND:"page_reload_offer_found",
PAGE_RELOAD_OFFER_NOT_FOUND:"page_reload_offer_not_found",PAGE_RELOAD_OFFER_NOT_SPECIFIED:"page_reload_offer_not_specified",SELECTED_INGRESS_CHANGE_CLICK:"selected_ingress_change_click",SELECTED_INGRESS_CHANGE_CLICK_MODAL_NOT_READY:"selected_ingress_change_click_modal_not_ready",SELECTED_QTY_MAPPED_TO_ASIN_W_OFFERS:"selected_quantity_mapped_to_asin_with_offers",SELECTED_QTY_MAPPED_TO_ASIN_WO_OFFERS:"selected_quantity_mapped_to_asin_with_no_offers",SELECTED_QTY_NOT_MAPPED_TO_ASIN:"selected_quantity_not_mapped_to_asin",
ZIP_UPDATE_ERROR:"zip_update_error",ZIP_UPDATE_HIDE:"zip_update_hide",ZIP_UPDATE_HIDE_CLICK:"zip_update_hide_click",ZIP_UPDATE_INVALID_ZIP_ENTERED:"zip_update_invalid_zip_entered",ZIP_UPDATE_NO_OFFERS:"zip_update_no_offers",ZIP_UPDATE_SHOW:"zip_update_show",ZIP_UPDATE_SHOW_CLICK:"zip_update_show_click",ZIP_UPDATE_SUCCESS:"zip_update_success"}});"use strict";k.when("jQuery","ship-to-store-settings","ship-to-store-function","query-param").register("ship-to-store-metric-publisher",function(b,e,u,f){return function v(a){var n=
this;l(this,v);this.logError=function(a){u.try(function(){m.ueLogError(a,{logLevel:"ERROR",attribution:e.get("attribution")})})};this.logRefTag=function(a){var e=1<arguments.length&&arguments[1]!==q?arguments[1]:{};b.get("/gp/ls/impress.html/ref\x3d"+encodeURIComponent(a)+"?"+f.createQueryStringFromObject(e))};this.publish=function(a){var b=1<arguments.length&&arguments[1]!==q?arguments[1]:1;a=""+n.refTagPrefix+a;u.try(function(){m.ue.count(""+a,b)})};this.tag=function(a){u.try(function(){m.ue.tag(a)})};
this.refTagPrefix=a}});"use strict";k.when("A","ship-to-store-settings","ship-to-store").register("ship-to-store-weblab-names",function(){return{BUNDLE_PRICE_WEBLAB:"HCX_PDX_BUNDLE_PRICE_281319",ESTIMATED_DELIVERY_DATE_WEBLAB:"HCX_PDX_ESTIMATED_SERVICE_DATE_STS_MODAL_282859",LFS_BUNDLES_WEBLAB:"HCX_ISS_LFS_OFFER_BUNDLES_288649",DISTANCE_SORT_CLIENT_SIDE_WEBLAB:"HCX_PDX_LFS_OFFER_DISTANCE_SORTING_CLIENT_SIDE_318895"}});"use strict";k.when("jQuery","ship-to-store-function","ship-to-store").register("ship-to-store-weblab-publisher",
function(b,e){b=function f(){l(this,f)};b.logTreatment=function(b,d){e.try(function(){b&&d&&"INACTIVE"!==d&&m.ue.trigger(b,d)})};return b});"use strict";"use strict";"use strict";k.when("ship-to-store").register("ship-to-store-offer-tags-helper",function(){return new function e(){l(this,e);this.hasCheapestTag=function(e){return e!==q&&-1!==e.indexOf("CHEAPEST")};this.hasFastestTag=function(e){return e!==q&&-1!==e.indexOf("FASTEST")}}});"use strict";k.when("A","vas-common-settings","ready").register("ship-to-store-settings",
function(b,e){var k=b.$,f={stsVM:{}},d=function a(){l(this,a)};d.setWidgetsMetaData=function(a){e.clearSettings();b.each(d.parseWidgetsMetaData(a),function(a,c){e.setSetting(c,a)})};d.parseWidgetsMetaData=function(a){a=a||k("body");return{winningWidgetVM:b.parseJSON(a.find("[data-a-state*\x3dvas-winning-widget-vm]").html()),widgetCommonVM:b.parseJSON(a.find("[data-a-state*\x3dvas-common-vm]").html()),widgetBaseVM:b.parseJSON(a.find("[data-a-state*\x3dvas-base-vm]").html())}};d.logWidgetLoadMetrics=
function(){m.ue&&m.ue.tag&&f.stsVM&&(f.stsVM.isPdpOnlyExperience?m.ue.tag("pdpOnlyShipToStoreWidget"):f.stsVM.isParentServiceAsin?m.ue.tag("psaIngressWidget"):f.stsVM.isShipToStore&&m.ue.tag("pdpShipToStoreWidget"))};d.fetch=function(){d.setWidgetsMetaData();f=d.createSettingsFromWinningWidgetVM();d.logWidgetLoadMetrics();return d.get()};d.createSettingsFromWinningWidgetVM=function(a){var b={};b.stsVM=a||e.getSetting("winningWidgetVM");if(!b.stsVM)return b;b.productAsin=b.stsVM.productAsin;b.zipCode=
b.stsVM.zipCode;b.buyboxPrice=b.stsVM.buyboxPrice;b.refTagPrefix="stsPdpOnly"===b.stsVM.winningWidgetName?"vas_sts_pdp_only_":b.stsVM.isParentServiceAsin?"vas_psa_":b.stsVM.isShipToStore?"vas_sts_":b.stsVM.isSdpOfferSelected?"vas_sdp_offer_":"vas_";return b};d.get=function(a){return f.hasOwnProperty(a)?f[a]:f};d.set=function(a,b,c){a&&c?f[a][c]=b:f[a]=b};return d});"use strict";k.when("ship-to-store-settings","3p-promise").register("ship-to-store-function",function(b,e){var m=function d(){l(this,
d)};m.try=function(d){return(new e(function(b,a){d(b,a)})).catch(function(d){k.when("ship-to-store-metric-publisher").execute(function(a){a.logError(d,b.get("attribution"))});throw d;})};return m});"use strict";"use strict";var ga="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(b){return typeof b}:function(b){return b&&"function"===typeof Symbol&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b};k.when("a-util").register("query-param",function(b){var e=function f(){var d=
this;l(this,f);this._queryString="";this._parameters={};this.getParameters=function(){var b=f._getQueryStringFromBrowser();if(b===d._queryString)return d._parameters;d._queryString=b;d._queryString.slice(1).split("\x26").map(function(a){a=a.split("\x3d");if(a.length&&a[0].length){var b=decodeURIComponent(a[0]);switch(a.length){case 2:d._parameters[b]=decodeURIComponent(a[1]);break;case 1:d._parameters[b]=null}}});return d._parameters};this.getParameter=function(b){return d.getParameters()[b]};this.parameterExists=
function(b){return d.getParameters().hasOwnProperty(b)};this.setParameters=function(e){if("object"!==("undefined"===typeof e?"undefined":ga(e))||b.isArray(e))return!1;d._queryString="?"+f.createQueryStringFromObject(e);f._setQueryStringOnBrowser(d._queryString);return d};this.setParameter=function(b,a){if(!b||!b.length)return!1;var e=d.getParameters();e[b]=a;return d.setParameters(e)};this.removeParameter=function(b){if(!b||!b.length)return!1;var a=d.getParameters();delete a[b];return d.setParameters(a)};
this.getQueryString=function(){return d._queryString};this.isRedirectFromCart=function(){var b=m.location.href;return b&&(b.includes("ox_sc_act_title")||b.includes("ox_sc_act_image"))}};e.createQueryStringFromObject=function(b){var d=[];Object.keys(b).forEach(function(e){if(!b.hasOwnProperty(e)||""===e||""===b[e])return!1;d.push(encodeURIComponent(e)+"\x3d"+encodeURIComponent(b[e]))});return d.join("\x26")};e._getQueryStringFromBrowser=function(){return location.search.valueOf()};e._setQueryStringOnBrowser=
function(b){"function"===typeof history.replaceState?history.replaceState({},document.title,b):location.search=b};return e});"use strict";"use strict";"use strict";k.when("A","dp-refresh-handler","ship-to-store-atc","ship-to-store-metric-publisher","ship-to-store-metric-names","a-dropdown","ship-to-store").register("ship-to-store-page-refresh",function(b,e,k,f,d,m){var a=b.$;"use strict";return new function c(h){var g=this;l(this,c);this.pageRefresh=function(a,c,d,e){if(c.winningOfferListingId===
q||!a&&!d)b.trigger("ship-to-store:modal:closed");else{var f=a?c.winningOfferListingId:d.productOfferListingId;d&&d.productOfferListingId!==q||(f=c.winningOfferListingId);c.currentOfferListingId!==f?(c.currentOfferListingId=f,c.quantity=e,c.declineOffer=a,g.performPageRefresh(c)):b.trigger("ship-to-store:modal:closed")}};this.performPageRefresh=function(a){var c={pageRefreshUrl:"/gp/page/refresh"},d={method:"POST",timeout:"90000",success:function(){b.trigger("ship-to-store:ajax-restore-layer","1.0",
a.featuresToGreyOut);b.trigger(a.quantityUpdateCallback,a.quantity);"mobile"===a.deviceType&&(b.trigger("ship-to-store:restore-mobile-feature",a),b.trigger("ship-to-store:re-initialize-modules"));b.trigger("ship-to-store:update-ATC-handler",a);b.trigger("ship-to-store:page-refresh-success")},error:function(){b.trigger("ship-to-store:ajax-restore-layer","1.0",a.featuresToGreyOut);"mobile"===a.deviceType&&(b.trigger("ship-to-store:restore-mobile-feature",a),b.trigger("ship-to-store:re-initialize-modules"));
b.trigger("ship-to-store:page-refresh-failure")}};c.ajaxOptions=d;a.ajaxOptions=d;null===g.pageRefreshAjaxHandle&&(g.pageRefreshAjaxHandle=new e(g.featureAttributionInfo,q,c));g.callPageRefreshHandler(a)};this.callPageRefreshHandler=function(b){var c={},e={};c.oid=b.currentOfferListingId;c.otk=g.oidKey;c.triggerEvent=g.featureAttributionInfo.featureName;"mobile"===b.deviceType&&(b.selectedInitialFeatureData=a("#shipToStoreBuyBox_feature_div"),e.deviceType="mobile");c=g.pageRefreshAjaxHandle.createCustomParamsMap(e,
c);g.setOpacityForFeaturesInPDP("0.5",b.featuresToGreyOut);performance.mark(d.PAGE_REFRESH_STARTED);g.pageRefreshAjaxHandle.doPageRefresh(c,b.ajaxOptions,!0)};this.restoreShipToStoreFeature=function(b){a("#shipToStoreBuyBox_feature_div").replaceWith(b.selectedInitialFeatureData.prop("outerHTML"))};this.reInitModules=function(){k.atcClickIntercepted||b.trigger("a:pageUpdate")};this.updateBuyBoxQuantity=function(a){var c=m.getSelect("quantity");if(c){var d=c.getOptions().size();a>d?(c.setValue(d),b.trigger("ship-to-store-buybox-quantity-changed",
{value:d})):c.setValue(a)}};this.updateMobileBuyBoxQuantity=function(a){g.updateATCForm(a);var c=m.getSelect("mobileQuantityDropDown");if(c){var d=c.getOptions().size();a>d?(c.setValue(d),b.trigger("ship-to-store-mobile-buybox-quantity-changed",{value:d})):c.setValue(a)}};this.updateATCForm=function(b){a("#addToCart").find('input[name^\x3d"quantity"]').val(b)};this.updateATCHandlers=function(a){k.pageRefreshPerformed(a);k.hideBuyNowOneClickButtons();b.trigger("ship-to-store:modal:closed")};this.triggerMetricSuccess=
function(){performance.mark(d.PAGE_REFRESH_ENDED);performance.measure(d.PAGE_REFRESH_TIME,d.PAGE_REFRESH_STARTED,d.PAGE_REFRESH_ENDED);var a=b.map(performance.getEntriesByName(d.PAGE_REFRESH_TIME),function(a){return a.duration}).shift();a&&f.publish(d.PAGE_REFRESH_TIME,a);f.publish(d.PAGE_REFRESH_SUCCEEDED)};this.triggerMetricFailure=function(){f.publish(d.PAGE_REFRESH_FAILED)};this.setOpacityForFeaturesInPDP=function(c,d){b.each(d,function(b,d){a(b).css("opacity",c)})};this.oidKey="ValueAdds";this.featureAttributionInfo=
{featureName:"upsell"};this.pageRefreshAjaxHandle=null;b.on("ship-to-store:ajax-restore-layer",this.setOpacityForFeaturesInPDP);b.on("ship-to-store:updateQuantity",this.updateBuyBoxQuantity);b.on("ship-to-store:updateMobileQuantity",this.updateMobileBuyBoxQuantity);b.on("ship-to-store:restore-mobile-feature",this.restoreShipToStoreFeature);b.on("ship-to-store:re-initialize-modules",this.reInitModules);b.on("ship-to-store:update-ATC-handler",this.updateATCHandlers);b.on("ship-to-store:page-refresh-success",
this.triggerMetricSuccess);b.on("ship-to-store:page-refresh-failure",this.triggerMetricFailure)}});"use strict";k.when("A","ship-to-store-settings","ship-to-store").register("ship-to-store-vas-metric-utils",function(b,e){return new function f(){var b=this;l(this,f);this.metricConstants={refmarkerPrefixes:{tenant:"vas",mappingSet:"sts",desktopWidget:"dsts",mobileWidget:"msts"},hitRecordConstants:{pageType:"DetailPage",subPageType:"ValueAdds"},additionalRequestDataKeys:{zipCode:"zip"},hitParameterKeys:{productAsin:"productAsin",
pageType:"pageType",subPageType:"subPageType",additionalRequestData:"additionalRequestData",zipCode:"zip"},actions:{addToCart:"att",featureClick:"clk",view:"gv",includeService:"incl",declineService:"cncl"}};this.createHitParameters=function(){var f={},a={};a[b.metricConstants.additionalRequestDataKeys.zipCode]=e.get("zipCode");f[b.metricConstants.hitParameterKeys.productAsin]=e.get("productAsin");f[b.metricConstants.hitParameterKeys.pageType]=b.metricConstants.hitRecordConstants.pageType;f[b.metricConstants.hitParameterKeys.subPageType]=
b.metricConstants.hitRecordConstants.subPageType;f[b.metricConstants.hitParameterKeys.additionalRequestData]=a;return f};this.tenantName=function(){return b.metricConstants.refmarkerPrefixes.tenant};this.widgetName=function(){return e.get("isApp")?b.metricConstants.refmarkerPrefixes.mobileWidget:b.metricConstants.refmarkerPrefixes.desktopWidget};this.mappingSet=function(){return e.get("mappingSets")?e.get("mappingSets")[0]:b.metricConstants.refmarkerPrefixes.mappingSet};this.hitParameters=this.createHitParameters();
this.tenantName=this.tenantName();this.widgetName=this.widgetName();this.mappingSet=this.mappingSet()}});"use strict";k.when("A","query-param","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store").execute("ship-to-store-redirect",function(b,e,k,f){b=b.$;var d=["A1F0ZNSBIZPSXB"];e=new e;e.parameterExists("smid")&&e.isRedirectFromCart()&&d.includes(e.getParameter("smid"))&&(b("#add-to-cart-button").addClass("aok-disabled"),e.removeParameter("smid"),k.publish(f.STRIPED_MERCHANT_ID),
m.location.replace(m.location.href))})});
/* ******** */
(function(d){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,a=e?e("BeautyDesktopAssets",""):c;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,c,e){d.when("A","ready").register("beauty-local-promo-common",function(a){var d=0,c,e,h,k,l,g,m,f=!0;a.$("#beautyLocalPromo_widget").length&&a.$("#beautyLocalPromoSlot").length&&a.$("#add-to-cart-button").delegate("","click",function(){if(f){a.$("#actionPanelWrapper").css("min-height","675px");
a.$("#csxswImgfbt_2").addClass("aok-hidden");a.$("#beautyLocalPromo_widget_smartShelf").length&&a.$("#beautyLocalPromo_widget_smartShelf").remove();var b=a.$("#beautyLocalPromo_widget").clone().attr("id","beautyLocalPromo_widget_smartShelf");c=b.find("#beautyLocalPromo_addOfferButton");e=b.find("#input_beautyServiceClientPort").val();h=b.find("#input_encryptedPromoID").val();k=b.find("#input_customerID").val();l=b.find("#input_marketplaceID").val();g=b.find("#input_businessOfferID").val();m=b.find("#input_asin").val();
1>d&&(b.appendTo("#beautyLocalPromoSlot"),b.removeClass("aok-hidden"),a.$.BeautyService_UpdateBusinessOfferViewCount({urlPort:e,operation:"UpdateLocalPromoOfferViewCount",data:{businessOfferID:g}}));f=!1}});a.$("#ccxsmartshelf_secondaryPanelBackButton").length&&a.$("#ccxsmartshelf_secondaryPanelBackButton").delegate("","click",function(a){f=!0});a.$("#shelfSwatchSection-size_name").length&&a.$("#shelfSwatchSection-size_name").delegate("","click",function(a){f=!0});a.$.Coral_ClickAddOffer=function(b){a.$.extend(b,
{data:JSON.stringify(b.data),dataType:"json",type:"POST",contentType:"application/json",headers:{"Content-Encoding":"amz-1.0","X-Amz-Target":b.operation},success:function(b){a.$("#beautyLocalPromo_content").addClass("aok-hidden");a.$("#beautyLocalPromo_postSuccessContent").removeClass("aok-hidden");d++},error:function(b){a.$("#beautyLocalPromo_offerDetails").addClass("aok-hidden");a.$("#beautyLocalPromo_content").addClass("aok-hidden");a.$("#beautyLocalPromo_postFailureRetryContent").removeClass("aok-hidden")},
complete:function(){a.$("#beautyLocalPromo_addOffer_spinner").addClass("aok-hidden")}});return a.$.ajax(b)};a.$.BeautyService_ClickAddOffer=function(b){a.$.extend(b,{url:b.urlPort,operation:"com.amazon.beauty.service.BeautyService."+b.operation});return a.$.Coral_ClickAddOffer(b)};a.$.Coral_UpdateBusinessOfferViewCount=function(b){a.$.extend(b,{data:JSON.stringify(b.data),dataType:"json",type:"POST",contentType:"application/json",headers:{"Content-Encoding":"amz-1.0","X-Amz-Target":b.operation},success:function(){},
error:function(){},complete:function(){}});return a.$.ajax(b)};a.$.BeautyService_UpdateBusinessOfferViewCount=function(b){a.$.extend(b,{url:b.urlPort,operation:"com.amazon.beauty.service.BeautyService."+b.operation});return a.$.Coral_UpdateBusinessOfferViewCount(b)};a.declarative("pro-beauty-add-local-promo-offer-to-cart","click",function(){c.addClass("aok-hidden");a.$("#beautyLocalPromo_addOffer_spinner").removeClass("aok-hidden");a.$.BeautyService_ClickAddOffer({urlPort:e,operation:"AddLocalPromoOffer",
data:{encryptedPromotionID:h,customerID:k,marketplaceID:l,businessOfferID:g,asin:m}})});a.declarative("pro-beauty-add-local-promo-offer-failure-retry","click",function(){c.removeClass("aok-hidden");a.$("#beautyLocalPromo_offerDetails").removeClass("aok-hidden");a.$("#beautyLocalPromo_content").removeClass("aok-hidden");a.$("#beautyLocalPromo_postFailureRetryContent").addClass("aok-hidden")})})});
/* ******** */
(function(p){var x=window.AmazonUIPageJS||window.P,J=x._namespace||x.attributeErrors,I=J?J("DetailPageMiraiAssets",""):x;I.guardFatal?I.guardFatal(p)(I,window):I.execute(function(){p(I,window)})})(function(p,x,J){p.when("A","ready").register("mirai-device-types",function(){return{IS_MOBILE:!1,IS_TABLET:!1}});"use strict";p.when("A","ready").register("mirai-constants",function(){return{BOX_ID_PREFIX:"shopbylook-btf-item-box-",GET_RECOMMENDATION_ADD_LIKE:"getRecommendationsForLikeDPX",GET_RECOMMENDATION_DELETE_LIKE:"getRecommendationsForUnlikeDPX",
GET_RECOMMENDATION_ADD_DISLIKE:"getRecommendationsForDislikeDPX",GET_RECOMMENDATION_DELETE_DISLIKE:"getRecommendationsForUndislikeDPX",GET_RECOMMENDATION_QU2X:"getRecommendationsForSearchQueryDPX",DESKTOP_PERCENTAGE_TO_FLIP_PER_LIKE:.2,NUM_ITEMS_TO_FLIP_PER_DISLIKE:1,MOBILE_NUM_ITEMS_PER_SHOW_MORE:6,MOBILE_NUM_ITEMS_TO_FLIP:2,MOBILE_MAX_SHOW_MORE:2,RATINGS_HALF_STAR_THRESHOLD:.5,LIKE_PREFIX:"L",DISLIKE_PREFIX:"D",SBL_WEBSITE_ADDRESS_PREFIX:"/discover/",IS_PRIME_CLASS:"shopbylook-prime",SBL_FLIP_BOX_CLASS:"shopbylook-btf-item-box-flip",
MAX_ITEMS_PER_PAGE:20,MAX_NUMBER_OF_ITEMS_DESKTOP:100,MAX_NUMBER_OF_ITEMS_MOBILE:6,MIN_DESKTOP_WIDTH_NEEDED_FOR_ANCHOR:800,MAX_DESKTOP_PAGE_SIZE:10,PAGINATION_CLASS_PREFIX:"shopbylook-btf-items-section-p-",END_OF_RECOMMENDATIONS_START_INDEX:-1,MAX_LIKE_DISLIKE_FOR_URL:50,CURRENT_PAGE_STRING_KEY:"${page}",TOTAL_PAGES_STRING_KEY:"${total}",TOP_FILTERS_PADDING:200,FILTER_OPTIONS_WIDTH:210,BROWSE_SOURCE:"browse",MOBILE_REFINEMENT_BOTTOM_SHEET_NAMES:["0","1","2","All"],DEFAULT_EXPECTED_FONT_SIZE:13,REFINEMENT_SELECTOR_PREFIX:".sbl-refinement-",
NEW_ITEM_ANIMATION_TIME:750,AUI_EMPTY_IMAGE_URL:"https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/grey-pixel.gif",DEFAULT_SHOW_TRANSITION_TIME:300}});"use strict";p.when("A","jQuery","mirai-device-types","mirai-constants","ready").register("mirai-utils",function(e,n,f,c){function k(){n("html, body").animate({scrollTop:n(x).scrollTop()+2},100)}return{getElementData:function(c){var f=c.data();f.asin&&(f.asin=c.attr("data-asin"));return f},getCurrentPage:function(f){try{var k=f.attr("class"),
k=k.split(" ");for(f=0;f<k.length;f++)if(k[f].includes(c.PAGINATION_CLASS_PREFIX))return k[f].replace(c.PAGINATION_CLASS_PREFIX,"")}catch(e){}return"1"},getCurrentItemBoxes:function(c){return c.find(".shopbylook-btf-item-box")},getMaxNumberOfItems:function(){return f.IS_MOBILE?c.MAX_NUMBER_OF_ITEMS_MOBILE:c.MAX_NUMBER_OF_ITEMS_DESKTOP},scrollToActivateLazyLoad:function(){e.delay(k,500)},hideSelectedRefinementsBar:function(c){f.IS_MOBILE?c.removeClass("sbl-filter-keywords-activate"):e.slideUp(c.find("#sbl-selected-refinement-row"),
300,"ease-out",function(){})},closeSelectedRefinementItem:function(c){e.animate(c,{width:"0",margin:"0",opacity:"0","border-radius":"0"},350,"ease-out",function(){c.remove()})},startLoading:function(c){c.find("#shopbylook-btf-loading-section").show()},stopLoading:function(c){c.find("#shopbylook-btf-loading-section").hide();k()},updateReviewStars:function(k,e,n,x,p){if(f.IS_MOBILE){if(!e)return}else if(0>=k.find(".shopbylook-btf-item-ratings-row").length||!e)return;for(var z=p?"a-star-":"a-star-mini-",
F=0;5>=F;F++)e.removeClass(z+F).removeClass(z+F+"-5");!n||n<c.RATINGS_HALF_STAR_THRESHOLD||1>x?(p?k.find(".sbl-item-rating").addClass("sbl-ratings-hide"):e.addClass("shopbylook-ratings-hide"),k.find(".sbl-review-count").first().text("")):(F=Math.floor(n),e.addClass(z+F+(n-F>=c.RATINGS_HALF_STAR_THRESHOLD?"-5":"")),k.find(".sbl-review-count").first().text(p?x:"("+x+")"),p?k.find(".sbl-item-rating").removeClass("sbl-ratings-hide"):e.removeClass("shopbylook-ratings-hide"))},getSearchQuery:function(){var c=
1<x.location.search.length?x.location.search.substring(1):"";return e.contains(c,"keywords\x3d")&&(c=c.split("keywords\x3d")[1],!e.objectIsEmpty(c)&&(c=decodeURIComponent(c.split("\x26")[0]).replace(/\+/g," "),0<c.length))?c:""}}});"use strict";var I="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};p.when("A","jQuery","mirai-device-types","mirai-constants",
"mirai-utils","ready").execute("mirai-core",function(e,n,f,c,k){function p(a,b){-1===r.indexOf(c.LIKE_PREFIX+b.asin)&&(r.push(c.LIKE_PREFIX+b.asin),A.push({asin:b.asin,iteration:u}));v||(a=n(a).find(".shopbylook-btf-item-like-img"),a.attr("src",ia),a.addClass("active"))}function X(a,b){for(var h=!1,d=0;d<A.length;d++)if(A[d].asin===b.asin){A.splice(d,1);h=!0;break}for(d=0;d<r.length;d++)if(r[d]===c.LIKE_PREFIX+b.asin){r.splice(d,1);break}h&&(a=n(a).find(".shopbylook-btf-item-like-img"),a.attr("src",
Y),a.removeClass("active"))}function fa(a,b){-1===r.indexOf(c.DISLIKE_PREFIX+b.asin)&&(r.push(c.DISLIKE_PREFIX+b.asin),C.push({asin:b.asin,iteration:u}));f.IS_MOBILE?a.addClass("sbl-item-disliked"):(a=n(a).find(".shopbylook-btf-item-dislike-img"),a.attr("src",ja),a.addClass("active"))}function ga(a,b){for(var h=!1,d=0;d<C.length;d++)if(C[d].asin===b.asin){C.splice(d,1);h=!0;break}for(d=0;d<r.length;d++)if(r[d]===c.DISLIKE_PREFIX+b.asin){r.splice(d,1);break}h&&(a=n(a).find(".shopbylook-btf-item-dislike-img"),
a.attr("src",Z),a.removeClass("active"))}function ha(a){var b=k.getCurrentItemBoxes(g).first().clone();b.removeClass(c.SBL_FLIP_BOX_CLASS);b.removeClass("sbl-item-liked");g.empty();for(var h=0;h<a.length;h++){var d=b.clone(),e=a[h];K(d,e,!1);-1<r.indexOf(c.LIKE_PREFIX+e.asin)&&p(d,e);g.append(d)}g.removeClass(c.PAGINATION_CLASS_PREFIX+k.getCurrentPage(g));1===R(a.length)&&g.addClass(c.PAGINATION_CLASS_PREFIX+"last");f.IS_MOBILE?(G||(b=k.getCurrentItemBoxes(g),g.animate({height:w*Math.ceil(Math.min(b.length,
c.MOBILE_NUM_ITEMS_PER_SHOW_MORE)/B)},c.NEW_ITEM_ANIMATION_TIME)),a.length>=c.MOBILE_NUM_ITEMS_PER_SHOW_MORE?H.show():H.hide()):L();T()}function z(){q&&(q.abort(),q=null);var a=A;0===A.length&&0===C.length&&(a=[{asin:m.mainAsin,iteration:u}]);k.startLoading(l);var b=U(t);b.browseNode=m.browseNode;b.anchorAsin=m.mainAsin;b.positive=a;b.negative=C;b.count=k.getMaxNumberOfItems();b.currentViewAsins=[];b.iteration=u;b.isFilterChange=!0;q=n.ajax({type:"POST",url:c.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsDPX",
data:JSON.stringify(b),contentType:"application/json",dataType:"json",statusCode:{200:function(a){l.find("#shopbylook-btf-no-results-section").hide();var b=a.dpxRecommendationItemList;D=a.nextStart;ha(b)},204:function(){l.find("#shopbylook-btf-no-results-section").show();f.IS_MOBILE&&H.hide();g.find(".shopbylook-btf-item-box:nth-child(n+2)").remove();f.IS_MOBILE?(H.hide(),G||g.animate({height:w},c.NEW_ITEM_ANIMATION_TIME)):l.find("#sbl-btf-desktop-pagination").text(m.desktopPagination.replace(c.CURRENT_PAGE_STRING_KEY,
1).replace(c.TOTAL_PAGES_STRING_KEY,1))}}}).always(function(){k.stopLoading(l);aa();n("#sbl-search-title").hide();n("#sbl-header-title").show()})}function F(){if(f.IS_MOBILE)l.addClass("sbl-filter-keywords-activate");else{var a=l.find("#sbl-selected-refinement-row");a.is(":visible")||e.slideDown(a,300,"ease-out",function(){})}}function ka(){q&&(q.abort(),q=null);var a=k.getCurrentItemBoxes(g).length,b=k.getCurrentPage(g),h=R(a);k.startLoading(l);var d=c.MAX_NUMBER_OF_ITEMS_DESKTOP-a;if(f.IS_MOBILE)if(G)d=
c.MOBILE_NUM_ITEMS_PER_SHOW_MORE;else{d=a-B*g.outerHeight()/w;if(d>c.MOBILE_NUM_ITEMS_PER_SHOW_MORE){k.stopLoading(l);ba();return}d=c.MOBILE_NUM_ITEMS_PER_SHOW_MORE-d}else if(a>=c.MAX_NUMBER_OF_ITEMS_DESKTOP||D===c.END_OF_RECOMMENDATIONS_START_INDEX){if("last"===b||parseInt(b,10)>=h){"last"!==b&&(g.removeClass(c.PAGINATION_CLASS_PREFIX+b),g.addClass(c.PAGINATION_CLASS_PREFIX+"last"));L();k.stopLoading(l);return}d=parseInt(b,10)+1;d=d>=h?"last":d;g.removeClass(c.PAGINATION_CLASS_PREFIX+b);g.addClass(c.PAGINATION_CLASS_PREFIX+
d);L();k.stopLoading(l);return}var e=A;0===A.length&&0===C.length&&(e=[{asin:m.mainAsin,iteration:u}]);var y=U(t);y.browseNode=m.browseNode;y.anchorAsin=m.mainAsin;y.positive=e;y.negative=C;y.currentViewAsins=la(!1);y.start=D;y.count=d;y.iteration=u;q=n.ajax({type:"POST",url:c.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsDPX",data:JSON.stringify(y),contentType:"application/json",dataType:"json",statusCode:{424:function(){}},success:function(a){if(a&&a.dpxRecommendationItemList){var b=a.dpxRecommendationItemList;
D=a.nextStart;a=k.getCurrentItemBoxes(g).filter(":visible").first().clone();a.removeClass(c.SBL_FLIP_BOX_CLASS);a.removeClass("sbl-item-liked");for(var d=0;d<b.length;d++){var h=a.clone(),f=b[d];K(h,f,!1);-1<r.indexOf(c.LIKE_PREFIX+f.asin)&&p(h,f);g.append(h)}}else D=c.END_OF_RECOMMENDATIONS_START_INDEX}}).always(function(){if(v)ba();else if(f.IS_MOBILE)if(0<k.getCurrentItemBoxes(g).length-B*g.outerHeight()/w)ba();else{H.hide();var d=l.find("#sbl-no-content-message");d.css({top:g.outerHeight(),left:0});
d.stop(!0,!0).fadeIn(200).delay(4E3).fadeOut(200)}else a=k.getCurrentItemBoxes(g).length,h=R(a),d=parseInt(b,10)+1,d=d>=h?"last":d,g.removeClass(c.PAGINATION_CLASS_PREFIX+b),g.addClass(c.PAGINATION_CLASS_PREFIX+d),L();k.stopLoading(l)})}function R(a){var b=ca();return a>c.MAX_DESKTOP_PAGE_SIZE&&D!==c.END_OF_RECOMMENDATIONS_START_INDEX?Math.min(c.MAX_DESKTOP_PAGE_SIZE,Math.ceil(c.MAX_NUMBER_OF_ITEMS_DESKTOP/b)):Math.min(c.MAX_DESKTOP_PAGE_SIZE,Math.ceil(a/b))}function N(a,b,h,d){q&&(q.abort(),q=null);
if(0!==A.length||0!==C.length){var Q=la(b),y=k.getCurrentItemBoxes(g).filter(":visible"),p=f.IS_MOBILE?B*g.outerHeight()/w:ca(),r;r=b?f.IS_MOBILE?B:Math.ceil(p*c.DESKTOP_PERCENTAGE_TO_FLIP_PER_LIKE):1;var M=g.find("#"+c.BOX_ID_PREFIX+a.asin),z;z=f.IS_MOBILE?p-M.index()-1<B?p-y.length:0:f.IS_MOBILE&&b?(c.MOBILE_MAX_SHOW_MORE-V)*c.MOBILE_NUM_ITEMS_PER_SHOW_MORE:0;var E=U(t);E.browseNode=m.browseNode;E.anchorAsin=m.mainAsin;E.asin=a.asin;E.physicalId=a.physicalId;E.positive=A;E.negative=C;E.currentViewAsins=
Q;E.count=r+z;E.iteration=u;E.asinIndex=d;q=n.ajax({type:"POST",url:c.SBL_WEBSITE_ADDRESS_PREFIX+h,data:JSON.stringify(E),contentType:"application/json",dataType:"json",statusCode:{200:function(d){var h=d.sortedCurrentViewAsins,e=d.dpxRecommendationItemList;D=d.nextStart;var l=y.first().index(),m=r-1,Q=0;d=0;b||(d=g.find("#"+c.BOX_ID_PREFIX+a.asin),K(d,e[m])&&m--);if(f.IS_MOBILE&&b){h=M.index()+B-M.index()%B-1;h=(d=h>=y.length)?y.last():n(y.get(h));for(l=e.length-1;0<=l;l--)e[l].asin&&(m=M.clone(),
d?m.css({opacity:0}):m.css({height:0,opacity:0}),m.insertAfter(h),K(m,e[l],!1),v?m.animate({height:w,opacity:""},c.NEW_ITEM_ANIMATION_TIME,function(){n(this).height("auto")}):d?m.animate({opacity:""},c.NEW_ITEM_ANIMATION_TIME):m.animate({height:w,opacity:""},c.NEW_ITEM_ANIMATION_TIME));v||g.animate({height:g.outerHeight()+w},c.NEW_ITEM_ANIMATION_TIME);M.offset().top-x.pageYOffset>w&&n("html, body").animate({scrollTop:x.pageYOffset+M.outerHeight()},350)}else if(!f.IS_MOBILE&&0<m)for(;0<=m&&Q<h.length-
1;)for(d=Q;d<h.length;d++){var Q=d,t=g.find("#"+c.BOX_ID_PREFIX+h[d]);if(sa(t,p,l)&&K(t,e[m])){m--;break}}if(0<z)for(h=(V+1)*c.MOBILE_NUM_ITEMS_PER_SHOW_MORE,d=r;d<e.length;d++)l=k.getCurrentItemBoxes(g).eq(h++),K(l,e[d],!1);if(!f.IS_MOBILE&&y.length>c.MAX_ITEMS_PER_PAGE)for(d=c.MAX_ITEMS_PER_PAGE;d<y.length;d++)e=n(y[d]),e.hasClass("shopbylook-btf-item-explore-more")||e.remove()},204:function(){var b=l.find("#sbl-no-content-message");if(!e.objectIsEmpty(b)){var d=g.find("#"+c.BOX_ID_PREFIX+a.asin),
h=g.offset();b.css({top:d.find(v?".sbl-item-image":".shopbylook-btf-item-image").offset().top-h.top,left:d.offset().left-h.left,width:d.outerWidth()});b.stop(!0,!0).fadeIn(200).delay(4E3).fadeOut(200)}}}}).always(function(){k.scrollToActivateLazyLoad()})}}function ta(a){a=f.IS_MOBILE&&!v?n("#refinement-all-sheet").find(".sbl-refinement-"+a).first():n(".sbl-refinement-"+a).first();da(a,!0)}function ua(a){q&&(q.abort(),q=null);var b=[{asin:m.mainAsin,iteration:u}],h=U(t);h.browseNode=m.browseNode;h.anchorAsin=
m.mainAsin;h.positive=b;h.negative=C;h.count=k.getMaxNumberOfItems();h.currentViewAsins=m.initialAsinList.split(",");h.iteration=u;h.isFilterChange=!1;h.searchQuery=a;q=n.ajax({type:"POST",url:c.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsForSearchQueryDPX",data:JSON.stringify(h),contentType:"application/json",dataType:"json",statusCode:{200:function(b){var c=b.refinements;if(!e.objectIsEmpty(c)){if(!G||v){var h=n("#sbl-search-title"),f;f=h.hasClass("a-cardui-title")?h.find(".a-cardui-title-text").first():
h.first();h.show();f.html(m.searchInputTitle.replace("${query}",'\x3cspan class\x3d"sbl-font-emphasis"\x3e'+a+"\x3c/span\x3e"));n("#sbl-header-title").hide()}l.find("#shopbylook-btf-no-results-section").hide();D=b.nextStart;e.each(c,ta);ha(b.dpxRecommendationItemList);aa();k.scrollToActivateLazyLoad()}}}})}function la(a){a=k.getCurrentItemBoxes(g).map(function(){return k.getElementData(n(this)).asin}).get();f.IS_MOBILE||a.push(m.mainAsin);return a}function K(a,b,h){if(null===a||0===a.length||b===
J)return!1;if(h===J||h)a.toggleClass(c.SBL_FLIP_BOX_CLASS),a.removeClass("sbl-item-liked"),a.removeClass("sbl-item-disliked");var d=f.IS_MOBILE?a.find(".a-price-whole"):a.find(".shopbylook-btf-item-price").children("span");h=f.IS_MOBILE?v?a.find(".a-icon-star"):a.find(".shopbylook-btf-item-ratings-container").find(".a-icon-star-mini"):a.find(".shopbylook-btf-item-ratings");var e=a.find(v?".sbl-item-image":".shopbylook-btf-image-elem");a.attr("data-asin",b.asin);a.data("asin",b.asin);a.attr("data-physical-id",
b.physicalId);a.data("physicalId",b.physicalId);a.removeClass(c.IS_PRIME_CLASS);a.prop("id",c.BOX_ID_PREFIX+b.asin);e.attr("src",c.AUI_EMPTY_IMAGE_URL);e.attr("data-src",b.imageAddress);e.data("src",b.imageAddress);e.addClass("a-lazy-loaded");e.attr("alt",b.title);e.attr("title",b.title);a.find(v?".sbl-item-image-container":".shopbylook-btf-item-image").children("a").attr("href","/dp/"+b.asin+"/ref\x3dsbl_dpx_"+(f.IS_MOBILE?"m_":"")+m.mainAsin+"_"+u);d.text(f.IS_MOBILE?b.price.replace(/[^0-9\.]+/g,
""):b.price);if(f.IS_MOBILE){a.removeClass("sbl-item-liked").removeClass("sbl-item-disliked");for(d=0;d<A.length;d++)if(A[d].asin===b.asin){a.addClass("sbl-item-liked");break}G&&(b.prime?a.find(".shopbylook-prime-icon").addClass(c.IS_PRIME_CLASS):a.find(".shopbylook-prime-icon").removeClass(c.IS_PRIME_CLASS))}else d=a.find(".shopbylook-btf-item-dislike-img"),e=a.find(".shopbylook-btf-item-like-img"),d.attr("src",Z),d.removeClass("active"),e.attr("src",Y),e.removeClass("active"),G&&(b.prime?a.addClass(c.IS_PRIME_CLASS):
a.removeClass(c.IS_PRIME_CLASS));k.updateReviewStars(a,h,b.rating,b.ratingCount,f.IS_MOBILE&&G);return!0}function sa(a,b,c){b=f.IS_MOBILE?c+b:c+b-1;return!a.find(".shopbylook-btf-item-like-img").hasClass("active")&&a.index()>=c&&a.index()<b&&(f.IS_MOBILE?e.onScreen(a,0):!0)}function ca(){return f.IS_MOBILE?(V+1)*c.MOBILE_NUM_ITEMS_PER_SHOW_MORE:2*Math.floor(g.width()/g.children().eq(0).width())}function T(){var a=c.SBL_WEBSITE_ADDRESS_PREFIX+"bn/"+m.browseNode+"/ref\x3dsbl_dpe_"+(f.IS_MOBILE?"m_":
"")+m.mainAsin+"_"+u+"?displayAsins\x3d"+m.mainAsin+(0<r.length?"\x26asins\x3d"+r.slice(-c.MAX_LIKE_DISLIKE_FOR_URL).join():"")+(0<t.length?"\x26sblKeywords\x3d"+encodeURIComponent(t.join()):"");l.find("#shopbylook-btf-explore-more").attr("href",a)}function L(){var a=k.getCurrentItemBoxes(g).length,a=D?a:c.MAX_NUMBER_OF_ITEMS_DESKTOP,b=k.getCurrentPage(g),a=R(a),b="last"===b||parseInt(b,10)>a?a:parseInt(b,10),b=m.desktopPagination.replace(c.CURRENT_PAGE_STRING_KEY,b).replace(c.TOTAL_PAGES_STRING_KEY,
a);l.find("#sbl-btf-desktop-pagination").text(b);f.IS_MOBILE||(a=k.getCurrentItemBoxes(g),b=a.filter(":hidden"),a=a.filter(":visible"),0<b.length?l.find("#shopbylook-btf-prev-button").show():l.find("#shopbylook-btf-prev-button").hide(),a.length<=ca()&&D?l.find("#shopbylook-btf-next-button").hide():l.find("#shopbylook-btf-next-button").show())}function ma(){B=Math.floor(g.width()/g.children().eq(0).width());if(!v)if(f.IS_MOBILE){var a=l.find("#sbl-btf-content-section"),b=a.outerHeight()/w;b*B-k.getCurrentItemBoxes(g).length>=
B&&a.height(w*(b-1))}else L()}function aa(a){var b=t.length;0===b&&k.hideSelectedRefinementsBar(l);f.IS_MOBILE&&!v&&(a||(a=l.find("#sbl-btf-refinement-row")),-1<t.indexOf("@prime")&&--b,0<b?(a.find("#sbl-refinement-item-all").addClass("sbl-refinement-item-selected"),a.find("#sbl-show-more-selected").text("("+b+")")):(a.find("#sbl-refinement-item-all").removeClass("sbl-refinement-item-selected"),a.find("#sbl-show-more-selected").text("")))}function va(a){e.on("a:sheet:beforeHide:".concat(a.id),function(a){O&&
(z(),O=!1)})}function wa(){v?e.each(l.find(".sbl-bottom-sheet"),va):c.MOBILE_REFINEMENT_BOTTOM_SHEET_NAMES.forEach(function(a){e.on("a:sheet:beforeShow:sbl"+a+"Sheet",function(b){n("#refinement-"+a.toLowerCase()+"-sheet").closest(".a-sheet-web").height(x.innerHeight*("All"===a?.8:.5))});e.on("a:sheet:beforeHide:sbl"+a+"Sheet",function(a){O&&(z(),O=!1);a.sheet.$container.find(".sbl-refinement-expander-header").each(function(){n(this).find(".a-icon-section-collapse").length&&n(this).trigger("click")})})})}
function xa(a,b,c,d){a.addClass("sbl-keyword-item-"+d);a.attr("parentItem",".sbl-refinement-"+d);F();a.removeClass("sbl-filter-keyword-hidden").width("")}function da(a,b){var h=a.hasClass("sbl-refinement-item-selected"),d=a.closest(".sbl-refinements-bn-list");if(0!==d.length){var e=k.getElementData(d),g=e.refinementType,p="@"+g,r=k.getElementData(a.closest(".refinement-row")),q=r.refinementValue,r=r.refinementIndex,v=e.refinementSource===c.BROWSE_SOURCE,x="review"===g;O=!0;var u=void 0,e=void 0;v?
e=u=q:(u=p+(q?":"+q:""),e=g+(q?"-"+(x?q:r):""));n(c.REFINEMENT_SELECTOR_PREFIX+e).toggleClass("sbl-refinement-item-selected");var w=d.find(".sbl-refinement-item-selected").length,d=t.indexOf(u);n(".sbl_refinement_"+g+"_selected").each(function(){var a=n(this);if(x){for(var b=1;5>b;b++)b!==q&&n(c.REFINEMENT_SELECTOR_PREFIX+"review-"+b).removeClass("sbl-refinement-item-selected");for(b=0;b<t.length;b++)if(/^@review/.test(t[b])&&t[b]!==u){t.splice(b,1);break}a.text(0<w?m.refinementStarsAndUp.replace("${count}",
q):"")}else a.text(0<w?"("+w+")":"");0<w?l.find("#sbl-refinement-item-"+g).addClass("sbl-refinement-item-selected"):l.find("#sbl-refinement-item-"+g).removeClass("sbl-refinement-item-selected")});if(x)for(0<w?n(".sbl_refinement_review_title").hide():n(".sbl_refinement_review_title").show(),p=1;5>p;p++)p!==q&&l.find(".sbl-keyword-item-review-"+p).each(function(){k.closeSelectedRefinementItem(n(this))});-1<d?t.splice(d,1):t.push(u);d=l.find(".sbl-keyword-item-"+e);h||d.length?h&&d.length&&(k.closeSelectedRefinementItem(d.first()),
f.IS_MOBILE&&!b&&z()):(h=l.find(".sbl-filter-keyword-hidden").clone(),h.appendTo(f.IS_MOBILE?"#sbl-keywords-row":"#sbl-selected-refinement-items"),"review"===g?h.find(".sbl-filter-keyword-text").text(m.refinementStarsAndUp.replace("${count}",q)):"price"===g?h.find(".sbl-filter-keyword-text").text(a.closest(c.REFINEMENT_SELECTOR_PREFIX+e).text()):"prime"!==g&&h.find(".sbl-filter-keyword-text").text(n(".sbl_refinement_"+g+"_title").first().text()+": "+a.closest(c.REFINEMENT_SELECTOR_PREFIX+e).text()),
xa(h,a,g,e));f.IS_MOBILE||b||z()}}function na(a){var b=t.indexOf("@prime");if(0>b){t.push("@prime");a.find(".sbl-prime-toggle").addClass("sbl-prime-selected");b=l.find(".sbl-filter-keyword-hidden").clone();b.appendTo(f.IS_MOBILE?"#sbl-keywords-row":"#sbl-selected-refinement-items");var c=a.find(".a-icon-prime").clone();c.removeClass("sbl-mobile-refn-prime sbl_refinement_prime_title");c.addClass("sbl-keyword-prime-icon");c.appendTo(b.find(".sbl-filter-keyword-text"));b.click(function(){na(a)});b.removeClass("sbl-filter-keyword-hidden").width("");
b.addClass("sbl-keyword-item-prime-0");F()}else t.splice(b,1),a.find(".sbl-prime-toggle").removeClass("sbl-prime-selected"),b=l.find(".sbl-keyword-item-prime-0"),b.length&&k.closeSelectedRefinementItem(b.first());z()}function ba(){if(f.IS_MOBILE){if(!v){var a=k.getCurrentItemBoxes(g).length-B*g.outerHeight()/w,a=Math.ceil(Math.min(a,c.MOBILE_NUM_ITEMS_PER_SHOW_MORE)/B)*w;g.animate({height:g.outerHeight()+a},c.NEW_ITEM_ANIMATION_TIME)}D===c.END_OF_RECOMMENDATIONS_START_INDEX?H.hide():H.show()}}function W(){if(e.objectIsEmpty(l))e.off("scroll",
W);else if(e.onScreen(l,f.IS_MOBILE?100:50)){e.off("scroll",W);var a=k.getSearchQuery();e.objectIsEmpty(a)||ua(a)}}function oa(){l=n("#mirai-btf-shopbylook-row");if(0<l.length){var a=e.state("shopbylookStateData");a||l.hide();var b=k.getElementData(l),c=b.mainAsin;m&&m.mainAsin===c||m&&!c||!a||((m=a,m.mainAsin=c?c:m.mainAsin,m.browseNode=b.browseNode?b.browseNode:m.browseNode,ea=n(f.IS_MOBILE?"#mobile-dp-btf-shopbylook":"#desktop-dp-btf-shopbylook"),0<ea.length&&ea.find("h2"),S=pa=qa=P=null,O=!1,
A=[],C=[],r=[],V=u=0,D=null,t=[],v=(G=m.isPrimeEnabled===J||"true"===m.isPrimeEnabled)&&f.IS_MOBILE,Y=m.likeImage,ia=m.likeActiveImage,Z=f.IS_MOBILE?m.closeImage:m.dislikeImage,ja=f.IS_MOBILE?m.closeImage:m.dislikeActiveImage,T(),g=l.find("#shopbylook-btf-items-section"),H=f.IS_MOBILE?l.find("#shopbylook-btf-mobile-show-more"):l.find("#sbl-show-more"),ma(),x.addEventListener("resize",ma),w=k.getCurrentItemBoxes(g).first().outerHeight(),e.onScreen(l,0)||(e.off("scroll",W),e.on("scroll",W)),f.IS_MOBILE)?
f.IS_MOBILE&&!ra&&(wa(),ra=!0):aa())}else m&&(m.mainAsin=null)}function U(a){var b={},c=[];a.forEach(function(a){"object"===("undefined"===typeof a?"undefined":I(a))&&"price"===a.type?(a.min&&(b.minPrice=a.min),a.max&&(b.maxPrice=a.max)):c.push(a)});b.filters=c;return b}var Z="dislike.svg",ja="dislike_active.svg",Y="like.svg",ia="like_active.svg",m,l,ea,A=[],C=[],r=[],u=0,V=0,D=null,q=null,t=[],P=null,qa=null,pa=null,S=null,ra=!1,O=!1,g=null,H=null,w=null,B=null,G=!1,v=!1;e.on("a:pageUpdate",oa);
e.declarative("sblItemLike","click",function(a){var b=a.$currentTarget.closest(v?".sbl-item-button":".shopbylook-btf-item-like");a=b.closest(".shopbylook-btf-item-box");var e=a.index(),d=k.getElementData(a);u++;v?(p(a,d),N(d,!0,c.GET_RECOMMENDATION_ADD_LIKE,e)):(b=b.find(".shopbylook-btf-item-like-img"),f.IS_MOBILE&&a.addClass("sbl-item-liked"),b.hasClass("active")?(X(a,d),N(d,!0,c.GET_RECOMMENDATION_DELETE_LIKE,e)):(ga(a,d),p(a,d),N(d,!0,c.GET_RECOMMENDATION_ADD_LIKE,e)),T())});e.declarative("sblItemDislike",
"click",function(a){a=a.$currentTarget.closest(v?".sbl-item-close":".shopbylook-btf-item-dislike");var b=a.closest(".shopbylook-btf-item-box"),e=k.getElementData(b);f.IS_MOBILE?(X(b,e),fa(b,e),N(e,!1,c.GET_RECOMMENDATION_ADD_DISLIKE,b.index())):(u++,a.find(".shopbylook-btf-item-dislike-img").hasClass("active")?(ga(b,e),N(e,!1,c.GET_RECOMMENDATION_DELETE_DISLIKE,b.index())):(X(b,e),fa(b,e),N(e,!1,c.GET_RECOMMENDATION_ADD_DISLIKE,b.index())),T())});e.declarative("sblRefinementChange","click",function(a){da(a.$currentTarget.find(".sbl-refinement-option-button"),
!1)});e.declarative("sblNextPage","click",ka);e.declarative("sblPrevPage","click",function(){q&&(q.abort(),q=null);var a=k.getCurrentPage(g),b=k.getCurrentItemBoxes(g).length,b=R(b);k.startLoading(l);b="last"===a||parseInt(a,10)>b?Math.max(1,b-1):Math.max(1,parseInt(a,10)-1);g.removeClass(c.PAGINATION_CLASS_PREFIX+a);g.addClass(c.PAGINATION_CLASS_PREFIX+b);L();k.stopLoading(l)});e.declarative("sblShowMore","click",function(a){f.IS_MOBILE&&ka()});e.declarative("sblRefinementClear","click",function(){k.hideSelectedRefinementsBar(l);
t=[];n(".refinement-button-selected-value").each(function(){n(this).text("")});n(".sbl_refinement_review_title").show();l.find(".sbl-filter-keyword-container:not(.sbl-filter-keyword-hidden)").remove();n(".sbl-refinement-item-selected").removeClass("sbl-refinement-item-selected");G&&l.find(".sbl-prime-selected").removeClass("sbl-prime-selected");z()});e.declarative("sblSelectedRefinementClear","click",function(a){a=n(a.$declarativeParent.parent().attr("parentItem")).first();da(a)});e.declarative("sblRefinementHover",
"click mouseenter",function(a){var b=n("#sbl-refinements-list");a=a.$currentTarget.find(".refinement-filter");!(b=b.find("#"+k.getElementData(a).filterDiv))||P&&P.attr("id")===b.attr("id")||(S?S.removeClass("sbl-selected"):pa.show(),S=a,S.addClass("sbl-selected"),qa.width(c.FILTER_OPTIONS_WIDTH),b.show(),P&&P.hide(),P=b)});e.declarative("sblPrimeRefinementChange","click",function(a){na(a.$currentTarget.find("#sbl-refinement-item-prime"))});oa()})});
/* ******** */
(function(q){var f=window.AmazonUIPageJS||window.P,p=f._namespace||f.attributeErrors,b=p?p("ABPricingFreeFormQuantityPickerAssets",""):f;b.guardFatal?b.guardFatal(q)(b,window):b.execute(function(){q(b,window)})})(function(q,f,p){q.when("jQuery","A","ready").execute(function(b,h){function r(b){f.ue!==p&&f.ue.count!==p&&f.ue.count(b,(f.ue.count(b)||0)+1)}function t(b,a,c){null===c&&(c="");var u=new RegExp("\\b("+a+"\x3d).*?(\x26|#|$)");if(0<=b.search(u))return b.replace(u,"$1"+c+"$2");b=b.replace(/[?#]$/,
"");return b+(0<b.indexOf("?")?"\x26":"?")+a+"\x3d"+c}function m(){return h.state("ABPricingFreeFormQuantityPicker")}function l(b,a){return 0!==b.find('option[value\x3d"'+a.toString()+'"]').length}function e(){n||m()===p||(n=!0,q.register("abPricingFfqp_utils",function(){return{PACKAGE_PREFIX:"ABPricingFreeFormQuantityPicker",getPageState:m,incrementMetricByOne:r,replaceUrlParam:t,dropdownContainsQuantity:l}}))}var n=!1;e();q.register("abPricingFfqp_lazyInitializer",function(){return{tryInitialize:e}})});
"use strict";q.when("jQuery","ready").register("abPricingFfqp_metrics",function(b){var h=!0,r=!0;return{updateReftagTriggering:function(b){h=b},updateCounterTriggering:function(b){r=b},register:function(b){b.reftag&&this.registerReftag(b.reftag);b.counter&&this.registerCounter(b.counter)},registerCounter:function(b){r&&f.ue&&f.ue.count&&f.ue.count(b,(f.ue.count(b)||0)+1)},registerReftag:function(f){h&&b.ajax("/gp/product/ajax-handlers/reftag.html/ref\x3d"+f,{type:"GET",cache:!1,timeout:500,retryCount:0,
retryLimit:3,retryInterval:500,retryExponentialBase:2,error:function(){this.retryCount++;this.retryCount<=this.retryLimit&&setTimeout(function(){b.ajax(this)}.bind(this),Math.pow(this.retryExponentialBase,this.retryCount)*this.retryInterval)}})}}});"use strict";q.when("jQuery","A","abPricingFfqp_utils","abPricingFfqp_metrics").register("abPricingFfqp_quantityManager",function(b,h,r,t){function m(a){for(var b="",c=0;c<a;c++)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*
Math.random()));return b}function l(a,b){return(a=(new RegExp("(?:^|\\?|\x26)"+b+"\x3d(?:([^\x26#]*)|\x26|#|$)")).exec(a))?a[1]?decodeURIComponent(a[1].replace(/\+/g," ")):"":p}function e(a,b,c){var d=a.split("#");a=d[0];a="?"===a[0]?a.substr(1):a;d=d[1];"undefined"!==typeof c&&null!==c?(c=b+"\x3d"+c,b=new RegExp("(^|\x26)("+b+"\x3d[^\x26]*)"),a=b.test(a)?a.replace(b,"$1"+c):a+((0!==a.length?"\x26":"")+c)):(b=new RegExp("(^|\x26)("+b+"\x3d[^\x26]*)"),b.test(a)&&(a=a.replace(b,""),"\x26"===a[0]&&(a=
a.substr(1))));return"?"+a+("undefined"!==typeof d?"#"+d:"")}function n(a){var b=f.location.protocol+"//"+f.location.host+f.location.pathname,c=f.location.search,d;for(d in a)a.hasOwnProperty(d)&&(c=e(c,d,a[d]));return b+c}function d(a){if(f.history!==p&&f.history.pushState!==p){var b={};b.qty=a;f.history.pushState({},"",n(b))}}function a(){var a=parseInt(l(f.location.search,"qty"));this.currentQuantity=isNaN(a)?1:a;this.wireUpSelectorBasedEvents()}var c=r.PACKAGE_PREFIX+".QuantityRefreshCheckError";
a.prototype.getCurrentQuantity=function(){return this.currentQuantity};a.prototype.wireUpSelectorBasedEvents=function(){var a=this;q.when("A","jQuery","quanityChangePriceUpdate").execute(function(b,c,d){a.quantityChangePriceUpdater=d;b.on("a:pageUpdate",function(){a.handleTwisterPageRefresh()})})};a.prototype.update3PPriceBlock=function(){if(!(this.leastMinimumOrderQuantity===p||1>=this.leastMinimumOrderQuantity)){var a=b(".price3P");a.hasClass("updatedPrice3P")||(a.addClass("updatedPrice3P"),this.quantityChangePriceUpdater.ajaxCall({qt:this.leastMinimumOrderQuantity,
quantityPriceField:"quantity_price"}))}};a.prototype.handleTwisterPageRefresh=function(){this.update3PPriceBlock()};a.prototype.reloadPageForQuantity=function(a,b){var c={};c.qty=a;c.psc=1;"undefined"!==typeof b&&("undefined"!==typeof b.refTag&&(c.ref_=b.refTag),"undefined"!==typeof b.activeBuyBoxId&&(c.selectObb=b.activeBuyBoxId),"undefined"!==typeof b.merchantId&&(c.smid=b.merchantId));f.location.href=n(c)};a.prototype.isPageRefreshNotRequired=function(a){return this.currentQuantity===parseInt(a)};
a.prototype.notifyQuantityChanged=function(a,b){h.trigger("buyBoxQuantityChanged",b.senderId,a);h.trigger("notifyBuyingInBulkOptionClicked",a);if(!this.isPageRefreshNotRequired(a)&&(this.currentQuantity=parseInt(a),d(a),!0!==b.preventRefreshCheck)){var e=this,m=r.getPageState(),m={asin:m.asin,quantity:a,refreshData:m.lastRefreshData,activeBuyBoxId:b.activeBuyBoxId};if(b.qdsForLockedMerchantEnabled){var n=l(f.location.search,"smid");"undefined"!==typeof n&&(m.merchantId=n)}h.trigger("quantityRefreshCheckStarted");
h.get("/gp/product/ajax-handlers/quantity-page-refresh.html",{params:m,timeout:4E3,error:function(){r.incrementMetricByOne(c);e.reloadPageForQuantity(a,{activeBuyBoxId:b.activeBuyBoxId})},success:function(){h.trigger("quantityRefreshCheckFinished")}})}};a.prototype.fetchAllTiersForQuantityDiscountTable=function(a){var b=r.getPageState(),c=this.isQPTBuyBoxAwareEnabled(a),b=c?{ref:"b2b_vqp_tiers",asin:b.asin,cb:m(20),qptResponseFormat:"json",selectObb:a.activeBuyBoxId}:{ref:"b2b_vqp_tiers",asin:b.asin,
cb:m(20),qptResponseFormat:"json"};if(a.qdsForLockedMerchantEnabled){var d=l(f.location.search,"smid");"undefined"!==typeof d&&(b.merchantId=d)}var e=this;this.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableStarted",a);h.get("/gp/product/ajax-handlers/quantity-price-table.html",{params:b,timeout:4E3,error:function(){e.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableError",a)},success:function(b){b.hasError?e.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableError",a):c?h.trigger("fetchQuantityDiscountTableCompleted",
b.entries,a.senderId):h.trigger("fetchQuantityDiscountTableCompleted",b.entries)}})};a.prototype.updateLimitedAvailabilityMessageVisibility=function(a){h.trigger("updateLimitedAvailabilityMessageVisibility",a.hasAvailability)};a.prototype.isQPTBuyBoxAwareEnabled=function(a){return a&&a.senderId&&a.activeBuyBoxId};a.prototype.triggerBuyBoxAwareEvent=function(a,b){this.isQPTBuyBoxAwareEnabled(b)?h.trigger(a,b.senderId):h.trigger(a)};a.prototype.notifyBuyingInBulkOptionClicked=function(a){h.trigger("notifyBuyingInBulkOptionClicked",
a)};return{EVENT__BUY_BOX_QUANTITY_CHANGED:"buyBoxQuantityChanged",EVENT__QUANTITY_REFRESH_CHECK_STARTED:"quantityRefreshCheckStarted",EVENT__QUANTITY_REFRESH_CHECK_FINISHED:"quantityRefreshCheckFinished",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_STARTED:"fetchQuantityDiscountTableStarted",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_COMPLETED:"fetchQuantityDiscountTableCompleted",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_ERROR:"fetchQuantityDiscountTableError",EVENT__UPDATE_LIMITED_AVAILABILITY_MESSAGE_VISIBILITY:"updateLimitedAvailabilityMessageVisibility",
EVENT__NOTIFY_BUYING_IN_BULK_OPTION_CLICKED:"notifyBuyingInBulkOptionClicked",getUrlParameter:l,replaceUrlParameter:e,singleton:new a}});"use strict";q.when("jQuery","A","a-dropdown","a-button","abPricingFfqp_utils","abPricingFfqp_quantityManager").register("abPricingFfqp_quantityPickerLogic",function(b,h,f,t,m,l){function e(a){return a.prop("selectedIndex")+1===a.prop("length")}function n(a,b){if(!m.dropdownContainsQuantity(a,b)){var d=document.createElement("option");d.value=b;d.text=b.toString();
a.append(d)}}function d(a){this.id=a.id;this.buyBoxId=a.buyBoxId;this.quantityHiddenFieldSelector=a.quantityHiddenFieldSelector;this.leastMinimumOrderQuantity=a.leastMinimumOrderQuantity;this.predefinedQuantitiesDropdownSelector=a.predefinedQuantitiesDropdownSelector;this.predefinedQuantitiesDropdownContainerSelector=a.predefinedQuantitiesDropdownContainerSelector;this.freeQuantityTextInputSelector=a.freeQuantityTextInputSelector;this.freeQuantityTextInputOuterSelector=a.freeQuantityTextInputOuterSelector;
this.updateButtonSelector=a.updateButtonSelector;this.addToCartButtonSelector=a.addToCartButtonSelector;this.initialQuantity=a.initialQuantity;this.buyingOptionPosition=a.buyingOptionPosition;this.limitedAvailabilityMessageSelector=a.limitedAvailabilityMessageSelector;this.initialQuantity&&this.updateQuantityHiddenField(this.initialQuantity);this.wireUpSelectorBasedEvents()}d.prototype.wireUpSelectorBasedEvents=function(){var a=this,c=b(this.predefinedQuantitiesDropdownSelector);h.on("a:dropdown:"+
c[0].id+":select",function(b){a.handleDropdownOptionClicked(b.value)});h.on(l.EVENT__BUY_BOX_QUANTITY_CHANGED,function(b,c){a.handleQuantityChangedOnOtherBuyBox(b,c)});h.on(l.EVENT__QUANTITY_REFRESH_CHECK_STARTED,function(){a.handleQuantityRefreshCheckStarted()});h.on(l.EVENT__QUANTITY_REFRESH_CHECK_FINISHED,function(){a.handleQuantityRefreshCheckFinished()});h.on(l.EVENT__UPDATE_LIMITED_AVAILABILITY_MESSAGE_VISIBILITY,function(b){a.updateLimitedAvailabilityMessageVisibility(b)})};d.prototype.wireUpReferenceBasedEvents=
function(){var a=this,c=b(this.freeQuantityTextInputSelector),d=b(this.updateButtonSelector);c.keydown(function(b){a.handleTextInputKeyDown(b)});c.keyup(function(b){a.handleTextInputKeyUp(b)});c.focus(function(){a.handleTextInputFocused()});d.click(function(){a.handleButtonClick()})};d.prototype.attachToDOM=function(){this.wireUpReferenceBasedEvents();e(b(this.predefinedQuantitiesDropdownSelector))?this.switchToFreeQuantityUI():this.switchToPredefinedQuantitiesUI();this.enableUI();this.lastSelectedQuantity=
this.getCurrentQuantity();l.singleton.leastMinimumOrderQuantity=this.leastMinimumOrderQuantity};d.prototype.getCurrentQuantity=function(){if(this.isTextInputVisible()){var a=b(this.freeQuantityTextInputSelector);return parseInt(a.val())}return this.isDropdownVisible()?(a=b(this.predefinedQuantitiesDropdownSelector),parseInt(a.find(":selected").val())):p};d.prototype.handleQuantityRefreshCheckStarted=function(){this.doesDOMExist()&&this.disableUI()};d.prototype.handleQuantityRefreshCheckFinished=function(){this.doesDOMExist()&&
this.enableUI()};d.prototype.handleDropdownOptionClicked=function(a){var c=b(this.predefinedQuantitiesDropdownSelector);e(c)?(a=b(this.freeQuantityTextInputSelector),a.val(this.lastSelectedQuantity.toString()),this.switchToFreeQuantityUI(),a.focus(),m.incrementMetricByOne("freeFormQtyPickerMaxQtySelected")):(this.lastSelectedQuantity=a=parseInt(a),this.updateQuantityHiddenField(a),l.singleton.notifyQuantityChanged(a,{senderId:this.id,activeBuyBoxId:this.buyBoxId}))};d.prototype.handleTextInputFocused=
function(){b(this.freeQuantityTextInputSelector).select()};d.prototype.handleTextInputKeyUp=function(a){13!==a.keyCode&&t(this.updateButtonSelector).show()};d.prototype.handleTextInputKeyDown=function(a){13===a.keyCode&&(a.preventDefault(),b(this.updateButtonSelector).click(),b(this.addToCartButtonSelector).focus())};d.prototype.clampQuantity=function(a){999<a&&(a=999);this.leastMinimumOrderQuantity!==p&&a<this.leastMinimumOrderQuantity&&(a=this.leastMinimumOrderQuantity);return a};d.prototype.handleButtonClick=
function(){var a=b(this.predefinedQuantitiesDropdownSelector),c=f.getSelect(a[0]),d=b(this.freeQuantityTextInputSelector),h=d.val(),e=parseInt,n=h.match(/[1-9][0-9]*/),e=e(null===n?"1":n[0]),e=this.clampQuantity(e);m.dropdownContainsQuantity(a,e)?(this.switchToPredefinedQuantitiesUI(),c.setValue(e.toString()),this.handleDropdownOptionClicked(e)):(a=e.toString(),a!==h&&d.val(a),t(this.updateButtonSelector).hide(),this.updateQuantityHiddenField(e),l.singleton.notifyQuantityChanged(e,{senderId:this.id,
activeBuyBoxId:this.buyBoxId}))};d.prototype.doesDOMExist=function(){return 0<b(this.predefinedQuantitiesDropdownSelector).length&&0<b(this.freeQuantityTextInputSelector).length&&0<b(this.updateButtonSelector).length};d.prototype.handleQuantityChangedOnOtherBuyBox=function(a,c){if(a!==this.id&&this.doesDOMExist()&&this.getCurrentQuantity()!==c){a=b(this.predefinedQuantitiesDropdownSelector);var d=f.getSelect(a[0]);m.dropdownContainsQuantity(a,c)?(d.setValue(c.toString()),this.lastSelectedQuantity=
c,this.switchToPredefinedQuantitiesUI()):(b(this.freeQuantityTextInputSelector).val(c.toString()),this.switchToFreeQuantityUI());this.updateQuantityHiddenField(c)}};d.prototype.showDropdown=function(){b(this.predefinedQuantitiesDropdownContainerSelector).removeClass("aok-hidden")};d.prototype.hideDropdown=function(){b(this.predefinedQuantitiesDropdownContainerSelector).addClass("aok-hidden")};d.prototype.isDropdownVisible=function(){return!b(this.predefinedQuantitiesDropdownContainerSelector).hasClass("aok-hidden")};
d.prototype.showTextInput=function(){"mobile"===m.getPageState().platform?b(this.freeQuantityTextInputOuterSelector).removeClass("aok-hidden"):b(this.freeQuantityTextInputSelector).removeClass("aok-hidden")};d.prototype.hideTextInput=function(){"mobile"===m.getPageState().platform?b(this.freeQuantityTextInputOuterSelector).addClass("aok-hidden"):b(this.freeQuantityTextInputSelector).addClass("aok-hidden")};d.prototype.isTextInputVisible=function(){return"mobile"===m.getPageState().platform?!b(this.freeQuantityTextInputOuterSelector).hasClass("aok-hidden"):
!b(this.freeQuantityTextInputSelector).hasClass("aok-hidden")};d.prototype.disableTextInput=function(){if("mobile"===m.getPageState().platform){var a=b(this.freeQuantityTextInputSelector),c=b(this.freeQuantityTextInputOuterSelector);a.prop("disabled","disabled");c.addClass("a-form-disabled")}else a=b(this.freeQuantityTextInputSelector),a.prop("disabled","disabled"),a.addClass("a-form-disabled")};d.prototype.enableTextInput=function(){if("mobile"===m.getPageState().platform){var a=b(this.freeQuantityTextInputSelector),
c=b(this.freeQuantityTextInputOuterSelector);a.removeProp("disabled");c.removeClass("a-form-disabled")}else a=b(this.freeQuantityTextInputSelector),a.removeProp("disabled"),a.removeClass("a-form-disabled")};d.prototype.switchToFreeQuantityUI=function(){this.hideDropdown();this.showTextInput();t(this.updateButtonSelector).hide()};d.prototype.switchToPredefinedQuantitiesUI=function(){this.showDropdown();this.hideTextInput();t(this.updateButtonSelector).hide()};d.prototype.disableUI=function(){var a=
f.getSelect(this.predefinedQuantitiesDropdownSelector),b=t(this.updateButtonSelector);a.update({status:"disabled"});this.disableTextInput();b.disable()};d.prototype.enableUI=function(){var a=f.getSelect(this.predefinedQuantitiesDropdownSelector),b=t(this.updateButtonSelector);a.update({status:"normal"});this.enableTextInput();b.enable()};d.prototype.updateQuantityHiddenField=function(a){var c=b(this.quantityHiddenFieldSelector);c.is("select")?(n(c,a),f.getSelect(c).val(a)):c.val(a.toString());c="select#mobileQuantityDropDown";
1==this.buyingOptionPosition&&(c="#SecondNewAccordionRow "+c);"mobile"===m.getPageState().platform&&this.quantityHiddenFieldSelector!==c&&(c=b(c))&&c.is("select")&&(n(c,a),f.getSelect(c).val(a))};d.prototype.updateLimitedAvailabilityMessageVisibility=function(a){var c=b(this.addToCartButtonSelector).closest(".a-button"),c=t(c);a?(b(this.limitedAvailabilityMessageSelector).addClass("aok-hidden"),c.enable()):(b(this.limitedAvailabilityMessageSelector).removeClass("aok-hidden"),c.disable())};return{QuantityPickerLogic:d}});
"use strict";q.when("jQuery","A","a-dropdown","a-modal","a-button","abPricingFfqp_utils","abPricingFfqp_quantityManager","abPricingFfqp_metrics").register("abPricingFfqpV2_quantityPickerLogic",function(b,h,r,t,m,l,e,n){function d(a,b){if(!l.dropdownContainsQuantity(a,b)){var k=document.createElement("option");k.value=b;k.text=b.toString();a.append(k)}}function a(a){this.id=a.id;this.buyBoxId=a.buyBoxId;this.quantityHiddenFieldSelector=a.quantityHiddenFieldSelector;this.leastMinimumOrderQuantity=a.leastMinimumOrderQuantity;
this.quantityPickerSelector=a.quantityPickerSelector;this.quantityDiscountTableSelector=this.quantityPickerSelector+" .quantity-discount-table";this.quantityTextInputLabelSelector=this.quantityPickerSelector+" .quantity-text-input-label";this.accordionRowContainerSelector=a.accordionRowContainerSelector;this.buyboxAccordionContainerSelector=a.buyboxAccordionContainerSelector;this.loadMoreMessage=a.loadMoreMessage;this.fetchTheBestPricesMessage=a.fetchTheBestPricesMessage;this.qdtErrorMessage=a.qdtErrorMessage;
this.includeRfqdLinkInNewPicker=a.includeRfqdLinkInNewPicker;this.requestForQuantityDiscountModalSelector=a.requestForQuantityDiscountModalSelector;this.requestForQuantityDiscountMessage=a.requestForQuantityDiscountMessage;this.bbtLinkSelector=a.bbtLinkSelector;this.preloadQuantityPriceTable=a.preloadQuantityPriceTable;this.addToCartButtonSelector=a.addToCartButtonSelector;this.limitedAvailabilityMessageSelector=a.limitedAvailabilityMessageSelector;this.fetchQuantityDiscountTableCompleted=this.fetchQuantityDiscountTableStarted=
this.isLoadMoreButtonClicked=!1;this.quantityTextInputSelector=this.quantityPickerSelector;this.quantityTextInputSelector+=" .quantity-text-input-with-label";this.loadMoreButtonForUncompetitiveTiersPresence=this.hasError=!1;this.quantityPricingTableSummaryEnabled=a.quantityPricingTableSummaryEnabled;this.qdsForLockedMerchantEnabled=a.qdsForLockedMerchantEnabled;this.isAODLinkEnabled=!0===a.isAODLinkEnabled;this.wireUpSelectorBasedEvents();this.initializeQuantityHiddenField()}var c=l.PACKAGE_PREFIX+
".PriceTableLoadError",q=l.PACKAGE_PREFIX+".QuantityPriceTableRender",v=l.PACKAGE_PREFIX+".QuantityPriceTableView",w=l.PACKAGE_PREFIX+".QuantityPriceTableRenderWithLockedMerchant",x=l.PACKAGE_PREFIX+".QuantityPriceTableViewWithLockedMerchant",y=l.PACKAGE_PREFIX+".QuantityPriceTableRenderWithUncompetitiveTiers",z=l.PACKAGE_PREFIX+".QuantityPriceTableViewWithUncompetitiveTiers",A=l.PACKAGE_PREFIX+".QuantityPriceTableLoadMoreButtonClicked",B=l.PACKAGE_PREFIX+".QuantityPriceTableLoadMoreButtonClickedWithUncompetitiveTiers",
C=l.PACKAGE_PREFIX+".QuantityPriceTableBBTLinkRender",D=l.PACKAGE_PREFIX+".QuantityPriceTableBBTLinkClick",E=l.PACKAGE_PREFIX+".QuantityPriceTableRFQDBBTLinkClick",F=l.PACKAGE_PREFIX+".QuantityPriceTableAvailabilityMessageRender",G=l.PACKAGE_PREFIX+".QuantityPriceTableAvailabilityMessageView";a.prototype.wireUpSelectorBasedEvents=function(){var a=this;h.on(e.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_STARTED,function(b){b&&b!==a.id||a.handleFetchQuantityDiscountTableStarted()});h.on(e.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_COMPLETED,
function(b,k){k&&k!==a.id||a.handleFetchQuantityDiscountTableCompleted(b)});h.on(e.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_ERROR,function(b){b&&b!==a.id||a.handleFetchQuantityDiscountTableError()});h.on(e.EVENT__BUY_BOX_QUANTITY_CHANGED,function(b,k){a.handleQuantityChangedOnOtherBuyBox(b,k)});h.on(e.EVENT__QUANTITY_REFRESH_CHECK_STARTED,function(){a.handleQuantityRefreshCheckStarted()});h.on(e.EVENT__QUANTITY_REFRESH_CHECK_FINISHED,function(){a.handleQuantityRefreshCheckFinished()});h.on(e.EVENT__UPDATE_LIMITED_AVAILABILITY_MESSAGE_VISIBILITY,
function(b){a.updateLimitedAvailabilityMessageVisibility(b)})};a.prototype.initializeQuantityHiddenField=function(){var a=e.singleton.currentQuantity,b=parseInt(this.leastMinimumOrderQuantity);b&&b>a&&(a=b);this.updateQuantityHiddenField(a)};a.prototype.handleFetchQuantityDiscountTableCompleted=function(a){this.wireUpQuantityDiscountTableData(a);this.generateQuantityDiscountTable();this.fetchQuantityDiscountTableCompleted=!0};a.prototype.handleFetchQuantityDiscountTableStarted=function(){this.fetchQuantityDiscountTableStarted=
!0};a.prototype.wireUpQuantityDiscountTableData=function(a){this.priceTiers=a;this.buildQptRenderMetrics();this.buildQptForLockedMerchantMetrics(w);this.buildQptUncompetitiveTiersMetrics(y);this.buildAvailabilityMessageMetrics(F)};a.prototype.handleFetchQuantityDiscountTableError=function(){l.incrementMetricByOne(c);this.fetchQuantityDiscountTableStarted=!1;this.hasError=!0;this.generateQuantityDiscountTable()};a.prototype.wireUpReferenceBasedEvents=function(){var a=this,g=b(this.quantityTextInputSelector),
k=b(this.quantityTextInputLabelSelector);k.click(function(){g.focus();g.click()});g.focus(function(){k.hide();a.showQuantityDiscountTable()});g.blur(function(){a.updateQuantityAndHideQuantityDiscountTable();k.show()});g.live("keypress input",function(b){a.isValidQuantityTextInputKeyCode(b);this.value=this.value.replace(/[^0-9]/g,"")});g.live("keydown",function(b){a.isValidQuantityTextPressKeyCode(b)});g.live("click change paste keyup",function(){a.clampQuantity(g.val());a.generateQuantityDiscountTable()})};
a.prototype.attachToDOM=function(){this.wireUpReferenceBasedEvents();this.enableUI();e.singleton.leastMinimumOrderQuantity=this.leastMinimumOrderQuantity};a.prototype.isValidQuantityTextPressKeyCode=function(a){var b={left:37,up:38,right:39,down:40},k=f.event?a.keyCode:a.which,c;for(c in b)b[c]===k&&a.preventDefault()};a.prototype.isValidQuantityTextInputKeyCode=function(a){var b=f.event?a.keyCode:a.which;8!==b&&46!==b&&(13===b?(this.updateQuantityAndHideQuantityDiscountTable(),a.preventDefault()):
(b=String.fromCharCode(b),/\d/.test(b)||a.preventDefault()))};a.prototype.getCurrentQuantity=function(){var a=b(this.quantityTextInputSelector);return this.clampQuantity(a.val())};a.prototype.handleQuantityRefreshCheckStarted=function(){this.doesDOMExist()&&this.disableUI()};a.prototype.handleQuantityRefreshCheckFinished=function(){this.doesDOMExist()&&this.enableUI()};a.prototype.clampQuantity=function(a){var b=a;999<a&&(b=999);this.leastMinimumOrderQuantity!==p&&a<this.leastMinimumOrderQuantity&&
(b=this.leastMinimumOrderQuantity);return b};a.prototype.doesDOMExist=function(){return 0<b(this.quantityTextInputSelector).length};a.prototype.handleQuantityChangedOnOtherBuyBox=function(a,g){a!==this.id&&this.doesDOMExist()&&this.getCurrentQuantity()!==g&&(b(this.quantityTextInputSelector).val(g),this.updateQuantityHiddenField(g))};a.prototype.showQuantityDiscountTable=function(){this.buildQptViewMetrics();this.preloadQuantityPriceTable||this.fetchQuantityDiscountTableStarted||e.singleton.fetchAllTiersForQuantityDiscountTable({senderId:this.id,
activeBuyBoxId:this.buyBoxId,qdsForLockedMerchantEnabled:this.qdsForLockedMerchantEnabled});this.fetchQuantityDiscountTableCompleted&&(this.buildQptForLockedMerchantMetrics(x),this.buildQptUncompetitiveTiersMetrics(z,this.getStartIndexOfQuantityDiscountTierTable(),3),this.buildAvailabilityMessageMetrics(G));var a=b(this.quantityPickerSelector),g=b(this.accordionRowContainerSelector),k=b(this.buyboxAccordionContainerSelector);0<g.length&&(g.get(0).setAttribute("style","overflow:visible"),g=g.find(".a-accordion-inner.accordion-row-content"),
0<g.length&&g.get(0).setAttribute("style","overflow:visible"));0<k.length&&(k.get(0).setAttribute("style","overflow:visible"),k=k.find(".a-accordion-inner"),0<k.length&&k.get(0).setAttribute("style","overflow:visible"));a.addClass("open")};a.prototype.hideQuantityDiscountTable=function(){b(this.quantityPickerSelector).removeClass("open")};a.prototype.updateQuantityAndHideQuantityDiscountTable=function(){var a=b(this.quantityDiscountTableSelector),g=b(this.quantityTextInputSelector),k=this.clampQuantity(g.val());
g.val(k);this.updateQuantityHiddenField(k);e.singleton.notifyQuantityChanged(k,{senderId:this.id,activeBuyBoxId:this.buyBoxId,qdsForLockedMerchantEnabled:this.qdsForLockedMerchantEnabled});this.isLoadMoreButtonClicked=!1;this.hideQuantityDiscountTable();a.empty()};a.prototype.disableUI=function(){var a=b(this.quantityTextInputSelector),g=b(this.quantityDiscountTableSelector);a.attr("disabled",!0);a.addClass("quantity-text-input-disabled");g.attr("disabled",!0)};a.prototype.enableUI=function(){var a=
b(this.quantityTextInputSelector),g=b(this.quantityDiscountTableSelector);a.attr("disabled",!1);a.removeClass("quantity-text-input-disabled");g.attr("disabled",!1);this.hideQuantityDiscountTable()};a.prototype._isMobileQuantityHiddenFieldSelector=function(){return"string"===typeof this.quantityHiddenFieldSelector&&-1<this.quantityHiddenFieldSelector.indexOf("select#mobileQuantityDropDown")};a.prototype._mobileQuantityHiddenFieldSelector=function(){return this.quantityHiddenFieldSelector.replace("select#quantity",
"select#mobileQuantityDropDown")};a.prototype.updateQuantityHiddenField=function(a){var g=b(this.quantityHiddenFieldSelector).first();g.is("select")&&(d(g,a),r.getSelect(g).val(a));g.val(a.toString());"mobile"!==l.getPageState().platform||this._isMobileQuantityHiddenFieldSelector()||(g=b(this._mobileQuantityHiddenFieldSelector()))&&g.is("select")&&(d(g,a),r.getSelect(g).val(a),g.val(a.toString()))};a.prototype.generateVisibleTiersList=function(a,b){for(var k=[],c=0;b<this.priceTiers.length&&(this.isLoadMoreButtonClicked||
3>c);){var d=this.priceTiers[b];if(this.isLoadMoreButtonClicked||0===c||!d.isUncompetitive)k.push({quantity:0===c?Math.max(a,d.quantity):d.quantity,savingsMessage:d.savingsMessage,availabilityMessage:d.availabilityMessage,quantityPickerPriceText:d.quantityPickerPriceText,isDiscountUnlocked:0===c?0===b&&"BUSINESS_VOLUME_AWARE_PRICING"===d.program:!1,isFirstTier:0===c}),c++;b++}return k};a.prototype.findStartIndexOfQuantityDiscountTierTable=function(a){for(var b=0,k=this.priceTiers.length-1;b<=k;){var c=
parseInt((b+k)/2),d;d=this.priceTiers[c].quantity;d=0===d.length?0:parseInt(d);if(d===a)return c;d>a?k=c-1:b=c+1}return Math.max(0,k)};a.prototype.getStartIndexOfQuantityDiscountTierTable=function(){var a=this.getCurrentQuantity();return this.findStartIndexOfQuantityDiscountTierTable(a)};a.prototype.generateQuantityDiscountTable=function(){this.cleanOutQuantityDiscountTable();var a=b(this.quantityDiscountTableSelector);this.hasError?a.append(this.generateSingleTierDiscountTableUnorderedList(this.generateQdtErrorMessage())):
this.priceTiers===p?a.append(this.generateFetchInProcessTableUnorderedList()):0===this.priceTiers.length?a.append(this.generateSingleTierDiscountTableUnorderedList()):a.append(this.generateQuantityDiscountTableUnorderedList())};a.prototype.cleanOutQuantityDiscountTable=function(){b(this.quantityDiscountTableSelector).empty()};a.prototype.areUncompetitiveTiersPresent=function(a,b){"undefined"===typeof a&&(a=0);b="undefined"===typeof b?this.priceTiers.length:Math.min(a+b,this.priceTiers.length);var c=
!1;for(a+=1;a<b;a++)if(this.priceTiers[a].isUncompetitive){c=!0;break}return c};a.prototype.isAvailabilityMessagePresent=function(){return this.priceTiers[0].availabilityMessage!=p};a.prototype.showLoadMoreButton=function(a){this.loadMoreButtonForUncompetitiveTiersPresence=this.areUncompetitiveTiersPresent(a);return!this.isLoadMoreButtonClicked&&(3<this.priceTiers.length-a||this.loadMoreButtonForUncompetitiveTiersPresence)};a.prototype.showBuyingInBulkLink=function(a){return"undefined"!==typeof this.priceTiers[a].buyingInBulkLink};
a.prototype.generateQuantityDiscountTableUnorderedList=function(){var a=this.getCurrentQuantity(),g=this.findStartIndexOfQuantityDiscountTierTable(a),a=this.generateVisibleTiersList(a,g),c=document.createElement("ul");c.setAttribute("class","qdt-ul");for(var d=b(c),e=0;e<a.length;e++)d.append(this.generateQuantityDiscountTierOption(a[e]));this.showLoadMoreButton(g)?d.append(this.generateLoadMoreOption()):this.showBuyingInBulkLink(g)?d.append(this.generateBuyingInBulkOption(g)):1!=this.includeRfqdLinkInNewPicker&&
"true"!=this.includeRfqdLinkInNewPicker||d.append(this.generateRequestForQuantityDiscountOption());return c};a.prototype.generateSingleTierDiscountTableUnorderedList=function(a){var g=this.getCurrentQuantity(),g=this.generateSingleTierQuantityList(g),c=document.createElement("ul");c.setAttribute("class","qdt-ul");for(var d=b(c),e=0;e<g.length;e++)d.append(this.generateQuantityDiscountTierOption(g[e]));a&&d.append(a);return c};a.prototype.generateSingleTierQuantityList=function(a){var b=[];b.push({quantity:Math.max(a,
1),savingsMessage:null,availabilityMessage:null,quantityPickerPriceText:"",isDiscountUnlocked:!1,isFirstTier:!0});return b};a.prototype.generateFetchInProcessTableUnorderedList=function(){var a=document.createElement("ul");a.setAttribute("class","qdt-ul");b(a).append(this.generateFetchInProcessOption());return a};a.prototype._removeINRSymbol=function(a){a=a.split("\x3e");return a[a.length-1]};a.prototype._populateOptionPriceContent=function(a,b){if("string"===typeof a.quantityPickerPriceText&&-1!==
a.quantityPickerPriceText.search("currencyINR")){var c=document.createElement("span");c.setAttribute("class","currencyINR");c.textContent="  ";b.appendChild(c);a=this._removeINRSymbol(a.quantityPickerPriceText);b.appendChild(document.createTextNode(a))}else b.textContent=a.quantityPickerPriceText};a.prototype.generateQuantityDiscountTierOption=function(a){var b=this,c=document.createElement("li"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div");a.isFirstTier?
(e.textContent=a.quantity,c.setAttribute("class","qdt-dropdown-item qdt-active")):(e.textContent=a.quantity+"+",c.setAttribute("class","qdt-dropdown-item"));b._populateOptionPriceContent(a,f);e.setAttribute("class","option-tier");f.setAttribute("class","option-price");a.availabilityMessage!=p?this.generateTierWithAvailabilityMessageContent(d,e,f,a.availabilityMessage):a.savingsMessage!=p?this.generateTierWithSavingsMessageContent(d,e,f,a):(d.setAttribute("class","qdt-dropdown-option-no-saving-message"),
d.appendChild(e),d.appendChild(f));c.appendChild(d);c.addEventListener("mousedown",function(){b.handleQuantityDiscountTableOptionClicked(a.quantity)});return c};a.prototype.generateTierWithAvailabilityMessageContent=function(a,b,c,d){var e=document.createElement("div");e.textContent=d;e.setAttribute("class","option-availability-message");this.generateTierWithMessageContent(a,b,c,e)};a.prototype.generateTierWithSavingsMessageContent=function(a,c,d,e){var f=document.createElement("div");f.textContent=
e.savingsMessage;e.isDiscountUnlocked?(e=document.createElement("div"),e.setAttribute("class","option-unlocked-saving-message-icon"),b(f).prepend(e),f.setAttribute("class","option-unlocked-saving-message")):f.setAttribute("class","option-saving-message");this.generateTierWithMessageContent(a,c,d,f)};a.prototype.generateTierWithMessageContent=function(a,b,c,d){var e=document.createElement("div");a.setAttribute("class","qdt-dropdown-option-regular");e.setAttribute("class","option-price-and-message");
e.appendChild(c);e.appendChild(d);a.appendChild(b);a.appendChild(e)};a.prototype.generateLoadMoreOption=function(){var a=this,b=document.createElement("li"),c=document.createElement("div");c.textContent=this.loadMoreMessage;b.setAttribute("class","qdt-dropdown-item");c.setAttribute("class","qdt-dropdown-option-load-more");b.setAttribute("id","qdt-dropdown-load-more");b.appendChild(c);b.addEventListener("mousedown",function(b){a.handleLoadMoreOptionClicked(b)});return b};a.prototype.generateRequestForQuantityDiscountOption=
function(){var a=this,b=document.createElement("a");b.textContent=this.requestForQuantityDiscountMessage;b.setAttribute("class","a-link-normal qdt-dropdown-request-for-quantity-discount");b.addEventListener("mousedown",function(b){a.handleRequestForQuantityDiscountOptionClicked(b)});return this.generateLinkOption(b)};a.prototype.generateBuyingInBulkOption=function(a){var b=this;a={container:{element:document.createElement("div"),class:"qdt-dropdown-buying-in-bulk"},link:{element:document.createElement("a"),
class:"a-link-normal qdt-dropdown-buying-in-bulk-link",text:b.priceTiers[a].buyingInBulkLink},message:{element:document.createElement("div"),class:"qdt-dropdown-buying-in-bulk-message",text:b.priceTiers[a].buyingInBulkMessage}};for(var c in a)a[c].element.setAttribute("class",a[c].class),"undefined"!==typeof a[c].text&&(a[c].element.textContent=a[c].text);a.container.element.appendChild(a.link.element);a.container.element.appendChild(a.message.element);a.link.element.addEventListener("mousedown",
function(a){b.handleBuyingInBulkOptionClicked(b.bbtLinkSelector,D,a)});n.registerCounter(C);return this.generateLinkOption(a.container.element)};a.prototype.generateLinkOption=function(a){var b=document.createElement("li"),c=document.createElement("div");b.setAttribute("class","qdt-dropdown-item qdt-inactive");c.setAttribute("class","qdt-dropdown-option-link");c.appendChild(a);b.appendChild(c);return b};a.prototype.generateFetchInProcessOption=function(){var a=document.createElement("li"),b=document.createElement("div"),
c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("img");e.src="https://m.media-amazon.com/images/G/01/AmazonBusiness/vapLoading3._CB1556651073_.gif";c.textContent=this.fetchTheBestPricesMessage;e.setAttribute("class","fetching-in-progress-img");a.setAttribute("class","qdt-dropdown-item qdt-inactive");b.setAttribute("class","qdt-dropdown-option-fetch-in-progress");d.appendChild(e);b.appendChild(d);b.appendChild(c);a.setAttribute("id","qdt-dropdown-fetch-in-progress");
a.appendChild(b);return a};a.prototype.generateQdtErrorMessage=function(){var a=document.createElement("li"),b=document.createElement("div");if(this.isAODLinkEnabled){var c=document.createElement("span");c.setAttribute("class","a-declarative");c.setAttribute("data-action","show-all-offers-display");c.setAttribute("data-show-all-offers-display","{}");c.innerHTML=this.qdtErrorMessage;b.appendChild(c)}else b.innerHTML=this.qdtErrorMessage;a.setAttribute("class","qdt-dropdown-item qdt-inactive");b.setAttribute("class",
"qdt-dropdown-option-request-for-olp");a.setAttribute("id","qdt-dropdown-error-message");a.appendChild(b);var d=b.getElementsByTagName("a")[0];d.addEventListener("mousedown",function(a){d.click()});return a};a.prototype.handleLoadMoreOptionClicked=function(a){this.isLoadMoreButtonClicked=!0;this.buildLoadMoreButtonMetrics();this.generateQuantityDiscountTable();a.preventDefault()};a.prototype.handleQuantityDiscountTableOptionClicked=function(a){b(this.quantityTextInputSelector).val(a);this.updateQuantityAndHideQuantityDiscountTable();
b(this.quantityTextInputLabelSelector).show()};a.prototype.handleRequestForQuantityDiscountOptionClicked=function(a){var c=b(this.requestForQuantityDiscountModalSelector).find(".a-declarative");(c=t.get(c))&&c.show();this.handleBuyingInBulkOptionClicked(this.requestForQuantityDiscountModalSelector,E,a)};a.prototype.handleBuyingInBulkOptionClicked=function(a,b,c){if(a=document.querySelector(a+" .a-link-normal"))n.registerCounter(b),b=this.getCurrentQuantity(),e.singleton.notifyBuyingInBulkOptionClicked(b),
a.click();c.preventDefault()};a.prototype.updateLimitedAvailabilityMessageVisibility=function(a){var c=b(this.addToCartButtonSelector).closest(".a-button"),c=m(c);a?(b(this.limitedAvailabilityMessageSelector).addClass("aok-hidden"),c.enable()):(b(this.limitedAvailabilityMessageSelector).removeClass("aok-hidden"),c.disable())};a.prototype.buildQptReftagPrefix=function(){return this.quantityPricingTableSummaryEnabled?"qpts":"qpt"};a.prototype.buildQptRenderMetrics=function(){var a={};a.reftag=this.buildQptReftagPrefix();
a.counter=q+(this.quantityPricingTableSummaryEnabled?".QPTS":"");n.register(a)};a.prototype.buildQptViewMetrics=function(){var a={};a.reftag=this.buildQptReftagPrefix()+"_c";a.counter=v+(this.quantityPricingTableSummaryEnabled?".QPTS":"");n.register(a)};a.prototype.buildQptForLockedMerchantMetrics=function(a){this.qdsForLockedMerchantEnabled&&n.registerCounter(a)};a.prototype.buildQptUncompetitiveTiersMetrics=function(a,b,c){this.areUncompetitiveTiersPresent(b,c)&&n.registerCounter(a)};a.prototype.buildLoadMoreButtonMetrics=
function(){this.loadMoreButtonForUncompetitiveTiersPresence?n.registerCounter(B):n.registerCounter(A)};a.prototype.buildAvailabilityMessageMetrics=function(a){this.isAvailabilityMessagePresent()&&n.registerCounter(a)};return{QuantityPickerLogicV2:a}})});
/* ******** */
(function(f){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,b=h?h("DetailPageFluxComponents",""):g;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,g,h){f.when("dp-flux-utils").register("dp-flux-action",function(b){function e(d,a,c){if(b.isNonEmptyString(d)&&b.isNonEmptyString(a))this._name=d,this._source=a,this._metadata=c;else throw Error("Action(...): Action must be created with valid name and source");}e.prototype={getName:function(){return this._name},
getSource:function(){return this._source},getMetaData:function(){return this._metadata}};return e.prototype.constructor=e});f.when("dp-flux-utils").register("dp-flux-attribution",function(b){function e(d,a,c,k){if(b.isNonEmptyString(d)&&b.isNonEmptyString(a)&&b.isNonEmptyString(c)&&b.isNonEmptyString(k))this._name=d,this._category=a,this._type=c,this._item=k;else throw Error("All parameters (name, categoty, type, item) must be a non-empty string");}e.prototype={getName:function(){return this._name},
getAttribution:function(){return"name: "+this._name+"; CTI\x3d "+this._category+"/"+this._type+"/"+this._item}};return e.prototype.constructor=e});f.when("A","dp-flux-action","dp-flux-attribution").register("dp-flux-dispatcher",function(b,e,d){function a(){this._callbacks={};this._isDispatching=!1;this._pendingAction=null;this._lastID=1}var c=b.$;a.prototype={register:function(a,b){if(!(a instanceof d))throw Error("Dispatch.register(...): attribution must be instance of Attribution");if(!c.isFunction(b))throw Error("Dispatch.register(...): callback must be a function");
var e="ID_"+this._lastID++;this._callbacks[e]={attribution:a,callback:b,_isCallbackExecutionStarted:!1,_isCallbackExecutionCompleted:!1};return e},unregister:function(a){if(this._callbacks[a])delete this._callbacks[a];else throw Error("Dispatcher.unregister(...): "+a+" does not map to a registered callback");},dispatch:function(a){if(this._isDispatching)throw Error("Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch");if(!(a instanceof e))throw Error("Dispatch.dispatch(...): action param must be of type Action");
this._startDispatching(a);for(var c in this._callbacks)this._callbacks[c]._isCallbackExecutionStarted||this._invokeCallback(c);this._stopDispatching()},waitFor:function(a){if(!this._isDispatching)throw Error("Dispatcher.waitFor(...): Must be invoked while dispatching");if(!c.isArray(a))throw Error("Dispatcher.waitFor(...): dispatchTokenList must be an array");for(var b=0;b<a.length;b++){var d=a[b];if(!this._callbacks[d])throw Error("Dispatcher.waitFor(...): "+d+" does not map to a registered callback. ");
if(this._callbacks[d]._isCallbackExecutionStarted)if(this._callbacks[d]._isCallbackExecutionCompleted)continue;else throw Error("Dispatcher.waitFor(...): Circular dependency detected while waiting for "+d);this._invokeCallback(d)}},_invokeCallback:function(a){this._callbacks[a]._isCallbackExecutionStarted=!0;try{this._callbacks[a].callback(this._pendingAction)}catch(c){f.log("Dispatcher._invokeCallback(...): Error while calling dispatcher callback: error message \x3d "+c.message,"FATAL",this._callbacks[a].attribution.getAttribution())}this._callbacks[a]._isCallbackExecutionCompleted=
!0},_startDispatching:function(a){for(var c in this._callbacks)this._callbacks[c]._isCallbackExecutionStarted=!1,this._callbacks[c]._isCallbackExecutionCompleted=!1;this._pendingAction=a;this._isDispatching=!0},_stopDispatching:function(){this._pendingAction=null;this._isDispatching=!1}};return a.prototype.constructor=a});f.when("A","dp-flux-utils").register("dp-flux-emitter",function(b,e){function d(){this._subscriptions={}}var a=b.$;d.prototype={emit:function(a){if(e.isNonEmptyString(a))b.each(this._subscriptions[a]||
[],function(a){a()});else throw Error("Emitter.emit()...: eventType must be a non empty string");},addListener:function(c,b){if(e.isNonEmptyString(c)&&a.isFunction(b))this._subscriptions[c]=this._subscriptions[c]||[],this._subscriptions[c].push(b);else throw Error("Emitter.addListener()...: Invalid arguments - eventType must be a non empty string \x26 callback must be a function ");},removeListener:function(c,b){if(e.isNonEmptyString(c)&&a.isFunction(b)){if(c=this._subscriptions[c])b=a.inArray(b,
c),-1!==b&&c.splice(b,1)}else throw Error("Emitter.removeListener()...: Invalid arguments - eventType must be a non empty string \x26 callback must be a function");}};return d});f.when("A","dp-flux-emitter","dp-flux-attribution","dp-flux-dispatcher","dp-flux-utils").register("dp-flux-store",function(b,e,d,a,c){function f(b,k,g,h){if(!(b instanceof d))throw Error("storeAttribution should be instance of Attribution");if(!(g instanceof a))throw Error("dispatcher must be an instance of Dispatcher");if(!l.isFunction(k))throw Error("Store must provide a reduce callback method");
this.reduce=k;this.dispatcher=g;this._storeAttribution=b;this._state=h||{};c.deepFreeze(this._state);this._dispatchToken=this.dispatcher.register(this._storeAttribution,this._invokeOnDispatch.bind(this));this._changed=!1;this._changeEvent=this._storeAttribution.getName()+":change";this._emitter=new e}var l=b.$;f.prototype={addListener:function(a){return this._emitter.addListener(this._changeEvent,a)},removeListener:function(a){this._emitter.removeListener(this._changeEvent,a)},getDispatcher:function(){return this.dispatcher},
getDispatchToken:function(){return this._dispatchToken},getState:function(){return this._state},getStoreAttribution:function(){return this._storeAttribution},_invokeOnDispatch:function(a){this._changed=!1;var b=this._state;(a=this.reduce(this._state,a)||b)&&a!==b&&(this._state=a,c.deepFreeze(this._state),this._changed=!0,this._emitter.emit(this._changeEvent))}};return f.prototype.constructor=f});f.when("A","dp-flux-attribution").register("dp-flux-store-group",function(b){function e(b,a,c){this._stores=
a;this._callBack=c;this._attribution=b;this._registerStoreGroup()}e.prototype={_registerStoreGroup:function(){var b=this._getUniformDispatcher();this._dispatchToken=b.register(this._attribution,function(){b.waitFor(this._getStoreTokens());this._callBack()}.bind(this))},unregisterStoreGroup:function(){this._getUniformDispatcher().unregister(this._dispatchToken)},_getUniformDispatcher:function(){var d=this._stores[0].getDispatcher();b.each(this._stores,function(a){if(d!==a.getDispatcher())throw Error("All stores must have common dispatcher");
});return d},_getStoreTokens:function(){return b.map(this._stores,function(b){return b.getDispatchToken()})}};return e.prototype.constructor=e});f.when("A","dp-flux-store-group").register("dp-flux-store-subscription",function(b,e){function d(a,b,d){this._stores=b;this._changed=!1;this._updatedStores=[];this._viewUpdateCallBack=d;this._viewAttribution=a;this._allListeners=[];this._addListenerToAllStores();this._storeGroup=new e(a,b,this._viewCallBack.bind(this))}d.prototype={_storeListener:function(a){this._changed=
!0;this._updatedStores.push(a)},_addListenerToAllStores:function(){var a;b.each(this._stores,function(b){a=this._storeListener.bind(this,b);this._allListeners.push({listener:a,store:b});b.addListener(a)},this)},_removeListenerFromAllStores:function(){b.each(this._allListeners,function(a){a.store.removeListener(a.listener)})},_viewCallBack:function(){if(this._changed){try{this._viewUpdateCallBack(this._updatedStores)}catch(a){f.log("StoreSubscription._viewCallBack(...): view callback failed "+a,"WARN",
this._viewAttribution.getAttribution())}this._changed=!1;this._updatedStores=[]}},reset:function(){this._removeListenerFromAllStores();this._storeGroup.unregisterStoreGroup()}};return d.prototype.constructor=d});f.when("A").register("dp-flux-utils",function(b){function e(a){return"string"===typeof a||"[object String]"===Object.prototype.toString.call(a)}function d(a){if(!Object.isFrozen(a)){var c=Object.getOwnPropertyNames(a);b.each(c,function(b){var c=a[b];a[b]=c&&"object"===typeof c?d(c):c});Object.freeze(a)}return a}
return{isString:e,isNonEmptyString:function(a){return!(!e(a)||!b.trim(a).length)},deepFreeze:function(a){return Object.freeze&&Object.getOwnPropertyNames&&Object.isFrozen?(d(a),!0):!1}}});f.when("A","dp-flux-attribution","dp-flux-store","dp-flux-store-subscription").register("dp-flux-view",function(b,e,d,a){function c(c,g,h){if(!(c instanceof e))throw Error("View(...): viewAttribution should be an instance of Attribution");if(f.isArray(g)&&1<=g.length)b.each(g,function(a){if(!(a instanceof d))throw Error("View(...): storeList contains an object which is not of type Store");
});else throw Error("View(...): View must listen on at least one store");if(!f.isFunction(h))throw Error("View(...): View must provide update callback method");this._viewAttribution=c;this._storeSubscription=new a(c,g,h)}var f=b.$;c.prototype.getViewAttribution=function(){return this._viewAttribution};c.prototype.unregisterStores=function(){this._storeSubscription.reset()};return c})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageCCXUSSProductInfoAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var y=window.AmazonUIPageJS||window.P,t=y._namespace||y.attributeErrors,z=t?t("DetailPageUSSAssets",""):y;z.guardFatal?z.guardFatal(c)(z,window):z.execute(function(){c(z,window)})})(function(c,y,t){c.when("A").register("uss-constants-common",function(c){return{classList:{SHOW_ELEMENT:"aok-block",HIDE_ELEMENT:"aok-hidden",STOP_SCROLLING:"uss-u-no-scroll",LIGHT_BOX_JS_HOOK:"js-light-box",LIGHT_BOX_IDENTIFIER:"uss-o-light-box",RIGHT_SIDE_SHEET:"uss-o-right-side-sheet",RIGHT_SIDE_SHEET_LAYOUT:"uss-l-right-side-sheet",
SHEET_OPEN:"is-open",SHEET_CLOSE:"is-close",USS_SHEET_VIEW_IDENTIFIER:"uss-sheet-view",CLOSE_ICON:"uss-o-close-icon",CLOSE_ICON_MEDIUM:"uss-o-close-icon-medium",USS_SHEET_VIEW_CLOSE_ICON:"uss-sheet-view-close-icon",PROMISING_UI_ELEMENT:"uss-o-promising-ui-element",PROMISING_UI_ELEMENT_ANIMATION:"uss-o-promising-ui-element-animation",IS_LOADING:"is-loading",IS_RESOLVED:"is-resolved",UI_PROMISE:"ui-promise",UI_VALUE:"ui-value",TEMPLATE_STORE:"uss-template-store",TEMPLATE:"uss-template",TEMPLATE_NAME:"template-name",
ATC_ACKNOWLEDGEMENT_MESSAGE:"atc-acknowledgement-message",ATC_GENERIC_ERROR:"atc-generic-error",ATC_STATUS_MESSAGE_COMPONENT:"uss-c-atc-status-msg",ATC_SUCCESS:"atc-success",ATC_ERROR:"atc-error",ITEM_IN_CART:"item-in-cart",CART_STATUS_MESSAGE_COMPONENT:"uss-c-cart-status-msg",CART_SUB_TOTAL:"cart-sub-total",CART_COUNT:"cart-count",SHIPPING_DETAILS:"uss-c-shipping-details",SHIPPING_MESSAGE_PLACEHOLDER:"shipping-message-placeholder",MAIN_IMAGE:"main-image",SUB_NAV:"uss-c-sub-nav",CHECKOUT_BUTTON:"checkout-btn",
CART_BUTTON:"cart-btn",CHECKOUT_FORM:"checkout-form",FACEOUT_IMAGE:"p13n-sc-dynamic-image",FACEOUT_TITLE:"uss-asin-title",FACEOUT_REVIEW_STARS:"uss-review-stars",FACEOUT_BEST_SELLER:"p13n-best-seller",FACEOUT_PRICE:"uss-price",CONTINUE_SHOPPING_LINK:"continue-shopping",SUCCESS_ELEMENT:".p13n-sc-atc-success",ERROR_ELEMENT:".p13n-sc-atc-error",BUTTON_ELEMENT:".a-button-primary",DISABLE_BUTTON:"a-button-disabled"},fatalMessagesList:{INVALID_SHEET_ID:"sheetID must be valid string",INVALID_CONSTRUCTOR_USAGE:"Constructor needs to be called with 'new' keyword",
INCORRECT_PARAMETER_PASSED:"Incorrect parameter passed."},widgetType:{WIDGET:"uss-widget",RECOMMENDATION_WIDGET:"uss-recommendation-widget",NO_RECOMMENDATION_WIDGET:"uss-no-recommendation-widget",LIST_RECOMMENDATION:"uss-list-recommendation-widget",CAROUSEL_RECOMMENDATION:"uss-carousel-recommendation-widget",PRIMARY_ACTION_STATUS_WIDGET:"uss-primary-action-status-widget",ATCStatusWidget:"uss-c-atc-status-widget",ATC_STATUS_IMB_WIDGET:"atc-status-imb-widget",MAPLE_WIDGET:"maple-recommendation-widget"},
layout:{defaultLayout:{DEFAULT_LAYOUT:"uss-l-default-layout",HEAD:"uss-c-head",BODY:"uss-c-body",HEAD_DIVIDER:"uss-c-head-divider",BOTTOM_MARGIN_BETWEEN_WIDGETS:"a-spacing-medium",TOP_MARGIN_BETWEEN_WIDGETS:"a-spacing-top-medium",SKELETON_LOADER:"uss-loading-skeleton",RECOMMENDATION_LOADING_MESSAGE:"loading-message",RECOMMENDATION_LOADED_MESSAGE:"uss-recommendations-loaded-message"}},actionSources:{DP_ATC_CLICK:"dp-atc-click",USS_INGRESS_CLICK:"uss-ingress-click",USS_INLINE_ATC_CLICK:"uss-inline-atc-click",
SHEET_CLOSE_BUTTON_CLICK:"sheet-close",CONTINUE_SHOPPING_CLICK:"continue-shopping-click"},stores:{ATC_STATUS_STORE:"uss-atc-status-store",RECOMMENDATION_DATA_STORE:"uss-recommendation-data-store",USS_SHEET_STORE:"uss-sheet-store"},actions:{USS_OPEN:"uss-open",USS_CLOSE:"uss-close",RECOMMENDATION_DATA_RECEIVE:"recommendation-data-receive",ATC_RECEIVE:"atc-receive"},metrics:{ATC_PROMISE_RESOLVED_TIMER:"atcPromiseResolve",PERCOLATE_DATA_PROMISE_RESOLVED_TIMER:"percolateDataPromiseResolve",ATC_PROMISE_REJECTED_COUNTER:"atcPromiseRejected",
PERCOLATE_DATA_PROMISE_REJECTED_COUNTER:"percolateDataPromiseRejected",SECONDARY_ADD_TO_CART_CLICK_COUNTER:"secondaryAtcClick",COMPATIBLE_BROWSER_COUNTER:"compatibleBrowser",NON_COMPATIBLE_BROWSER_COUNTER:"nonCompatibleBrowser",FACEOUT_IMAGE_CLICK_COUNTER:"faceout:imageClick",FACEOUT_REVIEW_STARS_CLICK_COUNTER:"faceout:reviewStarClick",FACEOUT_TITLE_CLICK_COUNTER:"faceout:titleClick",FACEOUT_PRICE_CLICK_COUNTER:"faceout:priceClick",FACEOUT_BEST_SELLER_CLICK_COUNTER:"faceout:bestSellerClick",SEE_MORE_EXISTENCE_COUNTER:"ussListWidget:seeMore",
SEE_MORE_CLICK_COUNTER:"ussListWidget:seeMoreClick",SEE_LESS_CLICK_COUNTER:"ussListWidget:seeLessClick",CHECKOUT_FORM_CLICK_COUNTER:"checkoutFormClick",CART_BUTTON_CLICK_COUNTER:"cartButtonClick",CONTINUE_SHOPPING_CLICK:"continueShoppingClick",PAGE_LANDING_PRECONDITIONS_PASSED:"pageLandingPreconditionsPassed",POST_ATC_PRECONDITIONS_FAILED:"postATCPreconditionsFailed",PROGRAM_ELIGIBILITY_REGISTRY_OVERWRITTEN:"programEligibilityRegistryOverwritten"},transitionTimingFunction:{EVEN_EASE:"cubic-bezier(0.4, 0, 0.6, 1)",
ENTER_EASE:"cubic-bezier(0, 0, 0.2, 1)",EXIT_EASE:"cubic-bezier(0.4, 0, 1, 1)",EASE_IN:"ease-in",EASE_OUT:"ease-out"},animationType:{FADE_IN:"fadeIn",NO_ANIMATION:"noAnimation"}}});c.when("dp-flux-attribution","uss-constants-common").register("uss-constants",function(c,n){n.ussCTI={CATEGORY:"Website",TYPE:"Detail Page",ITEM:"USS"};n.metrics.PREFIX="uss:";n.ajaxParams={BASE_URL:"/gp/product/handle-buy-box",REFTAG:"dp_start-bbf_1_glance",ASIN:"ASIN",OFFER_LISTING_ID:"offerListingID",AJAX_TIMEOUT:1E4};
n.actionSources.SHEET_CLOSE_BUTTON_CLICK="sheet-close-button-click";n.ussCommonAttribution=new c("uss-common",n.ussCTI.CATEGORY,n.ussCTI.TYPE,n.ussCTI.ITEM);n.defaultAtcAnimationType=n.animationType.FADE_IN;n.atcAnimationStatusEvent="uss:atc:animation:status:resolved";return n});c.when("dp-flux-utils","uss-constants").register("uss-logger-service",function(c,n){function r(a,b){if(c.isNonEmptyString(a))a=n.metrics.PREFIX+a,ue&&ue.count&&(b===t&&(b=(ue.count(a)||0)+1),ue.count(a,b));else throw Error("counterKey must be non empty string");
}function v(a){if(c.isNonEmptyString(a))this._timerName=a,this._startTime=0;else throw Error("timerName must be non empty string");}v.prototype={start:function(){this._startTime=Date.now()},stop:function(){this._startTime&&r(this._timerName,Date.now()-this._startTime)}};return{logCounter:r,Timer:v}});c.when("A","uss-utils","uss-logger-service","uss-constants").register("uss-preconditions",function(c,n,r,v){function a(a){a=c.$("#"+a+"_feature_div").html();null!==a&&(a=a.trim());return null!==a&&0<
a.length}function b(){return c.capabilities.transform&&c.capabilities.transition&&n.isFlexBoxSupported()}function g(){return c.$("#uss-weblabTreatment").val()}var d=/^T[0-9]+$/;b()?r.logCounter(v.metrics.COMPATIBLE_BROWSER_COUNTER):r.logCounter(v.metrics.NON_COMPATIBLE_BROWSER_COUNTER);return{isUssConditionsPassed:function(){return"true"===c.$("#uss-serverPreconditionsPassed").val()&&b()&&!a("scheduledDelivery")&&!a("simpleBundle")&&!a("partialStateBuyBox")},isUssWeblabInTreatment:function(){return d.test(g())},
triggerUSSWeblabValue:function(){return d.test(c.$("#uss-miniFrameworkWeblabTreatment").val())?c.$("#uss-weblabValue").val():1},ussWeblabTreatmentValue:g,isBrowserUssCompatible:b}});c.when("A","3p-promise","uss-constants","uss-logger-service").register("uss-utils",function(c,n,r,v){var a=c.$,b=r.classList,g=a("body"),d={},m=["isPreview","forceWidgets","previewCampaigns","auditEnabled"];(function(){var a=y.location.search,a=a.substr(1);a.split("\x26").forEach(function(f){f=f.split("\x3d");2===f.length&&
(d[f[0]]=f[1])})})();return{loadImage:function(h,f){return new n(function(e,k){f=f||"";var q=a("\x3cimg src\x3d'"+h+"' alt\x3d'"+f+"'\x3e");q.load(function(){e(q)});q.error(function(f){k(f)});q[0].complete&&e(q)})},isFlexBoxSupported:function(){var a=c.$("\x3cdiv\x3e\x3c/div\x3e")[0];return""===a.style.flex||""===a.style.webkitFlex||""===a.style.msFlex||""===a.style.MozBoxFlex||""===a.style.webkitBoxFlex?!0:!1},disablePageScroll:function(){g.addClass(b.STOP_SCROLLING)},enablePageScroll:function(){g.removeClass(b.STOP_SCROLLING)},
isMobileApp:function(){return"true"===c.$("#uss-mobileApp").val()},getDebugParams:function(){var a={};m.forEach(function(f){var e;e=null;d.hasOwnProperty(f)&&(e=d[f]);e&&(a[f]=e)});return a},shouldFireAndForgetWeblabTrigger:function(){var h=!1;0!=a("#uss-shouldFireAndForgetWeblabTrigger").length&&(h="true"===a("#uss-shouldFireAndForgetWeblabTrigger").val());return h},fireAndForgetWeblabTrigger:function(a,f){var e="/gp/uss/weblab-trigger.html?",e=/^T[0-9]+$/.test(c.$("#uss-miniFrameworkWeblabTreatment").val())?
e+("weblabValue\x3d"+a+"\x26treatment\x3d"+f):e+("triggerWeblab\x3d"+a+"\x26treatment\x3d"+f);y.navigator&&navigator.sendBeacon?navigator.sendBeacon(e)||c.$.ajax({url:e}):c.$.ajax({url:e})},showATCSuccess:function(){c.$("#atc-toast").length&&c.$("#atc-success").length&&(c.$("#atc-toast").css("display","block"),c.$("#atc-toast").addClass("atc-toast-success-styles"),c.$("#atc-success").css("display","block"),setTimeout(function(){c.$("#atc-success").css("display","none");c.$("#atc-toast").css("display",
"none");c.$("#atc-toast").removeClass("atc-toast-success-styles")},1500))},showATCFailure:function(){c.$("#atc-toast").length&&c.$("#atc-failed").length&&(c.$("#atc-toast").css("display","block"),c.$("#atc-toast").addClass("atc-toast-failure-styles"),c.$("#atc-failed").css("display","block"),setTimeout(function(){c.$("#atc-failed").css("display","none");c.$("#atc-toast").css("display","none");c.$("#atc-toast").removeClass("atc-toast-failure-styles")},1500))}}});c.when("A","atf","uss-utils").register("uss-init-helper",
function(z,n,r,v){return{loadUssCommonAssetsAfterPreload:function(){c.when("uss-constants","dp-flux-action","uss-dispatcher","uss-utils").register("uss-action-creator-helper",function(a,b,g,d){function m(){z.$("#add-to-cart-button").removeAttr("disabled")}return{primaryATCClick:function(h,f){var e=new b(a.actions.USS_OPEN,a.actionSources.DP_ATC_CLICK,{recommendationBaseIdentifier:h});f.percolateData.then(function(k){var q={isContainsRecommendation:!1,widgets:[]};k.recommendationData&&(q.widgets=k.recommendationData.widgets||
[]);m();q.widgets.length||(q.widgets.push({widgetType:a.widgetType.NO_RECOMMENDATION_WIDGET}),q.recommendationBaseIdentifier=h);g.dispatch(e);f.atcData.then(function(f){var k={};1===f.isOk?k=f.atcStatusData:k.isAtcGenericError=!0;f=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,k);g.dispatch(f)},function(){var f=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,{isAtcGenericError:!0});g.dispatch(f)});q.recommendationBaseIdentifier=h;k=new b(a.actions.RECOMMENDATION_DATA_RECEIVE,a.actionSources.DP_ATC_CLICK,
q);g.dispatch(k)},function(){f.atcData.then(function(a){m();1===a.isOk?d.showATCSuccess():d.showATCFailure()},function(){d.showATCFailure()})})},secondaryATCClick:function(h,f){h.atcData.then(function(e){var k={};1===e.isOk?k=e.atcStatusData:k.isAtcGenericError=!0;k.params=f;e=new b(a.actions.ATC_RECEIVE,a.actionSources.USS_INLINE_ATC_CLICK,k);g.dispatch(e)},function(){})}}})},loadUssCommonAssets:function(){c.when("dp-flux-dispatcher").register("uss-dispatcher",function(a){return new a});c.when("A",
"uss-constants").register("promising-ui-element",function(a,b){var g=b.classList;return a.createClass({_element:null,_uiPromiseElement:null,_uiValueElement:null,_isResolved:!1,init:function(a){var b=a.find("."+g.UI_PROMISE),h=a.find("."+g.UI_VALUE);if((a.hasClass(g.PROMISING_UI_ELEMENT)||a.hasClass(g.PROMISING_UI_ELEMENT_ANIMATION))&&b.length&&h.length)this._uiPromiseElement=b,this._uiValueElement=h,this._element=a,this.showUIPromise();else throw Error("PromisingUIElement.init()...: HTML structure is not compatible with PromisingUIElement");
},showUIPromise:function(){this._element.addClass(g.IS_LOADING);this._element.removeClass(g.IS_RESOLVED);this._isResolved=!1},showUIValue:function(){this._element.addClass(g.IS_RESOLVED);this._element.removeClass(g.IS_LOADING);this._isResolved=!0},getValueElement:function(){return this._uiValueElement},getElement:function(){return this._element},isResolved:function(){return this._isResolved}})});c.when("A","uss-sheet-component","uss-constants","uss-store-repository","dp-flux-attribution","uss-layout",
"dp-flux-view","widget-creation-helper","dp-flux-action","uss-dispatcher").register("uss-sheet-view",function(a,b,g,d,m,h,f,e,k,q){function l(){p=!0;var a=g.classList,l=g.ussCTI,u=d.getStore(g.stores.USS_SHEET_STORE),w=d.getStore(g.stores.RECOMMENDATION_DATA_STORE),A=[u,w],l=new m("uss-sheet-view",l.CATEGORY,l.TYPE,l.ITEM),x=new b(a.USS_SHEET_VIEW_IDENTIFIER,{beforeClose:function(){q.dispatch(new k(g.actions.USS_CLOSE,g.actionSources.SHEET_CLOSE_BUTTON_CLICK))}}),a=x.getSheetElement(),D=new h(a);
new f(l,A,function(a){var f;if(-1!==c.inArray(u,a))if(f=u.getState(),f.isSheetOpen()){if(f.getActionSource()===g.actionSources.DP_ATC_CLICK){D.reset();var k=e.createAtcStatusWidget();f=e.createIMBWidget(f.getActionSource());D.renderWidgets([k,f])}x.open()}else f.getActionSource()!==g.actionSources.SHEET_CLOSE_BUTTON_CLICK&&x.close();-1!==c.inArray(w,a)&&D.renderWidgets(e.createRecommendationWidget(w))})}var c=a.$,p=!1;return{initializeUSSSheetView:function(){p||l()}}});c.when("A","uss-constants",
"uss-template-store","uss-widget-factory").register("widget-creation-helper",function(a,b,g,d){return{createAtcStatusWidget:function(){var a={content:g.getTemplate(b.widgetType.ATCStatusWidget),widgetType:b.widgetType.ATCStatusWidget};return d.getWidget(a)},createRecommendationWidget:function(b){var h,f=[];b=b.getState().getNewRecommendations();a.each(b,function(a){(h=d.getWidget(a))&&f.push(h)});return f},createIMBWidget:function(){return d.getWidget({content:"\x3cdiv\x3e\x3c/div\x3e",widgetType:b.widgetType.ATC_STATUS_IMB_WIDGET})}}});
c.when("A","dp-flux-store","uss-dispatcher").register("uss-store-repository",function(a,b,g){var d={};return{registerStore:function(a,h,f){h=new b(a,h,g,f);return d[a.getName()]=h},getStore:function(a){return d[a]},getDispatcher:function(){return g}}});c.when("A","uss-store-repository","dp-flux-attribution","uss-sheet-store","uss-constants").register("uss-recommendation-data-store",function(a,b,g,d,c){function h(a,f,e){this._unprocessedChunkIndex=e||0;this._recommendationBaseIdentifier=a;this._dataChunks=
f||[]}var f=a.$,e=c.ussCTI;g=new g(c.stores.RECOMMENDATION_DATA_STORE,e.CATEGORY,e.TYPE,e.ITEM);d=b.getStore(c.stores.USS_SHEET_STORE);h.prototype={_getRecommendations:function(f){var e=[];f<this._dataChunks.length&&a.each(this._dataChunks,function(h,b){b>=f&&a.each(h,function(a){e.push(a)})});return e},getAllRecommendations:function(){return this._getRecommendations(0)},getNewRecommendations:function(){return this._getRecommendations(this._unprocessedChunkIndex)},getRecommendationBaseIdentifier:function(){return this._recommendationBaseIdentifier},
addRecommendationChunk:function(k){var e=[];a.each(k,function(a){a.widgetType=a.widgetType||c.widgetType.RECOMMENDATION_WIDGET});e=f.merge(e,this._dataChunks);e=f.merge(e,[k]);return new h(this._recommendationBaseIdentifier,e,this._dataChunks.length)}};e=new h;return b.registerStore(g,function(a,f){var e=a,g=c.actions;switch(f.getName()){case g.USS_OPEN:b.getDispatcher().waitFor([d.getDispatchToken()]);d.getState().getActionSource()===c.actionSources.DP_ATC_CLICK&&(e=new h(d.getState().getRecommendationBaseIdentifier()));
break;case g.RECOMMENDATION_DATA_RECEIVE:g=d.getState().getRecommendationBaseIdentifier(),f=f._metadata,f.recommendationBaseIdentifier===g&&(e=a.addRecommendationChunk(f.widgets))}return e},e)});c.when("uss-store-repository","dp-flux-attribution","uss-constants").register("uss-sheet-store",function(a,b,g){function d(a,e,k){this._isSheetOpen=a||!1;this._actionSource=e;this._recommendationBaseIdentifier=k}var c=g.actions,h=g.ussCTI;b=new b(g.stores.USS_SHEET_STORE,h.CATEGORY,h.TYPE,h.ITEM);d.prototype=
{isSheetOpen:function(){return this._isSheetOpen},getActionSource:function(){return this._actionSource},getRecommendationBaseIdentifier:function(){return this._recommendationBaseIdentifier}};h=new d(!1);return a.registerStore(b,function(a,e){var k=a;switch(e.getName()){case c.USS_OPEN:a.isSheetOpen()||(e.getSource()===g.actionSources.DP_ATC_CLICK?k=new d(!0,e.getSource(),e.getMetaData().recommendationBaseIdentifier):e.getSource()===g.actionSources.USS_INGRESS_CLICK&&a.getRecommendationBaseIdentifier()&&
(k=new d(!0,e.getSource(),a.getRecommendationBaseIdentifier())));break;case c.USS_CLOSE:a.isSheetOpen()&&(k=new d(!1,e.getSource(),a.getRecommendationBaseIdentifier()))}return k},h)});c.when("A","uss-store-repository","dp-flux-attribution","uss-constants","dp-flux-utils").register("uss-atc-status-store",function(a,b,g,d,c){function h(){this.status=t;this.cart={subTotal:{}};this.mainImage={};this.isAtcGenericError=this.shippingMessageHTML=this.imbHTML=t}a=new g("uss-atc-status-store",d.ussCTI.CATEGORY,
d.ussCTI.TYPE,d.ussCTI.ITEM);h.prototype={setStatus:function(a){this.status=1===a||a===d.classList.ATC_SUCCESS?d.classList.ATC_SUCCESS:d.classList.ATC_ERROR},setCart:function(a,e,k){c.isNonEmptyString(a)&&(this.cart.count=parseInt(a));e&&(this.cart.subTotal=e);c.isNonEmptyString(k)&&(this.cart.checkoutUrl=k)},setMainImage:function(a,e){c.isNonEmptyString(a)&&(this.mainImage.src=a,c.isNonEmptyString(e)?this.mainImage.altText:this.mainImage.altText="")},setImbHTML:function(a){c.isNonEmptyString(a)&&
(this.imbHTML=a)},setShippingMessageHTML:function(a){c.isNonEmptyString(a)&&(this.shippingMessageHTML=a)},setIsAtcGenericError:function(a){this.isAtcGenericError=a}};g=new h;b.registerStore(a,function(a,e){var k=a;switch(e.getName()){case d.actions.ATC_RECEIVE:var b=e.getMetaData();e.getSource()===d.actionSources.DP_ATC_CLICK?(k=new h,b.isAtcGenericError?k.setIsAtcGenericError(!0):(k.setStatus(b.status),k.setCart(b.cart.count,b.cart.subTotal,b.cart.checkoutUrl),k.setMainImage(b.mainImage.src,b.mainImage.altText),
k.setImbHTML(b.imbHTML),k.setShippingMessageHTML(b.shippingMessageHTML))):e.getSource()!==d.actionSources.USS_INLINE_ATC_CLICK||b.isAtcGenericError||(k=new h,k.setStatus(a.status),k.setMainImage(a.mainImage.src,a.mainImage.altText),k.setImbHTML(a.imbHTML),k.setShippingMessageHTML(a.shippingMessageHTML),b.cart&&k.setCart(b.cart.count,b.cart.subTotal,a.cart.checkoutUrl));break;case d.actions.USS_OPEN:e.getSource()===d.actionSources.DP_ATC_CLICK&&(k=new h)}return k},g)});c.when("A","uss-constants").register("uss-template-store",
function(a,b){var g=a.$,d=b.classList,c={};return{init:function(){var a=g("."+d.TEMPLATE_STORE),f;1===a.length&&a.find("."+d.TEMPLATE).each(function(a,b){f=g("\x3cdiv\x3e\x3c/div\x3e");b=g(b);f.append(b);(a=b.data(d.TEMPLATE_NAME))&&(c[a]=f.html())})},getTemplate:function(a){return c[a]},_nameToTemplateMap:c}});c.when("A","dp-flux-attribution","dp-flux-utils","uss-store-repository","uss-widget","uss-constants").register("uss-widget-factory",function(a,b,g,d,m,h){var f=a.$,e={};e[h.widgetType.WIDGET]=
m;a=h.ussCTI;var k=new b("uss-widget-factory",a.CATEGORY,a.TYPE,a.ITEM);return{registerWidgetType:function(a,b){if(!g.isNonEmptyString(a))throw Error("uss-widget-factory.registerWidgetType()... : name parameter must be valid string. provided name param is \x3d "+a);if(!(b.prototype instanceof m))throw Error("uss-widget-factory.registerWidgetType()... : constructor.prototype must be instance of Widget. provided constructor param is \x3d "+b);e[a]=b},getWidgetType:function(a){return e[a]},getWidget:function(a){var g,
d=k;try{var m=a.widgetType||h.widgetType.WIDGET,C=e[m];if(!C)return c.log("Widget.getWidget()... : Constructor not exist for type : "+m,"FATAL",d.getAttribution()),g;var E=C.getAttribution&&C.getAttribution();E&&(d=E);if(a.attribution)var u=a.attribution,d=new b(u.name,u.category,u.type,u.item);var w=f(a.content),A=f("\x3cdiv\x3e\x3c/div\x3e");A.append(w);g=new C(d,A)}catch(x){c.log("Widget.getWidget()... : "+x.message,"FATAL",d.getAttribution&&d.getAttribution())}return g}}});c.when("A","uss-constants",
"dp-flux-view","uss-store-repository","uss-dispatcher").register("uss-widget",function(a,b,g,d,c){function h(b){var f=[];a.each(b,function(a){var b=d.getStore(a);if(b)f.push(b);else throw Error("Widget.getWidget().getStores()... : store with name \x3d "+a+" not exists");});return f}var f=b.classList,e=b.widgetType;return a.createClass({init:function(a,b){this._element=b;this._element.addClass(e.WIDGET);this._element.addClass(f.HIDE_ELEMENT);this._attribution=a;this._dispacther=c;this.getStoreNames().length&&
(b=h(this.getStoreNames()),this._fluxView=new g(a,b,this.update.bind(this)),this.update(b))},show:function(e){e=e||{};e=e.showWidgetAnimation||{};var h=b.animationType;e.animationType=e.animationType||h.NO_ANIMATION;switch(e.animationType){case h.FADE_IN:a.fadeIn(this._element,e.timeDuration||100,e.transitionTimingFunction||b.transitionTimingFunction.EVEN_EASE);break;case h.NO_ANIMATION:this._element.addClass(f.SHOW_ELEMENT),this._element.removeClass(f.HIDE_ELEMENT)}},hide:function(){this._element.addClass(f.HIDE_ELEMENT);
this._element.removeClass(f.SHOW_ELEMENT)},beforeRender:function(){},afterRender:function(){},getElement:function(){return this._element},getAttribution:function(){return this._attribution},getDispatcher:function(){return this._dispacther},update:function(a){},getStoreNames:function(){return[]},deleteWidget:function(){this._element.remove();this._fluxView&&this._fluxView.unregisterStores()}})});c.when("A","uss-constants","uss-widget-factory","uss-logger-service").register("uss-recommendation-widget",
function(a,b,g,d){var c=b.widgetType;a=g.getWidgetType(c.WIDGET);var h=b.classList,f=b.metrics;b=a.extend({init:function(a,b){this._super(a,b);this._element.addClass(c.RECOMMENDATION_WIDGET);this._addTrackingMetrics()},_addTrackingMetrics:function(){this._element.find("."+h.FACEOUT_IMAGE).click(function(){d.logCounter(f.FACEOUT_IMAGE_CLICK_COUNTER)});this._element.find("."+h.FACEOUT_REVIEW_STARS).click(function(){d.logCounter(f.FACEOUT_REVIEW_STARS_CLICK_COUNTER)});this._element.find("."+h.FACEOUT_PRICE).click(function(){d.logCounter(f.FACEOUT_PRICE_CLICK_COUNTER)});
this._element.find("."+h.FACEOUT_TITLE).click(function(){d.logCounter(f.FACEOUT_TITLE_CLICK_COUNTER)});this._element.find("."+h.FACEOUT_BEST_SELLER).click(function(){d.logCounter(f.FACEOUT_BEST_SELLER_CLICK_COUNTER)})}});g.registerWidgetType(c.RECOMMENDATION_WIDGET,b);return b});c.when("A","uss-constants","uss-widget-factory","dp-flux-attribution","uss-template-store","dp-flux-action","uss-logger-service").register("uss-no-recommendation-widget",function(a,b,g,d,c,h,f){var e=b.widgetType;a=g.getWidgetType(e.WIDGET);
var k=b.ussCTI,q=new d(b.widgetType.NO_RECOMMENDATION_WIDGET,k.CATEGORY,k.TYPE,k.ITEM);d=a.extend({init:function(a,d){this._super(a,d);this._element.addClass(e.NO_RECOMMENDATION_WIDGET);a=c.getTemplate(b.widgetType.NO_RECOMMENDATION_WIDGET);this._element.append(a);this._continueShoppingLink=this._element.find("."+b.classList.CONTINUE_SHOPPING_LINK);this._continueShoppingLink.click(function(a){a.preventDefault();f.logCounter(b.metrics.CONTINUE_SHOPPING_CLICK);this.getDispatcher().dispatch(new h(b.actions.USS_CLOSE,
b.actionSources.CONTINUE_SHOPPING_CLICK))}.bind(this))}});d.getAttribution=function(){return q};g.registerWidgetType(e.NO_RECOMMENDATION_WIDGET,d);return d});c.when("A","uss-constants","uss-widget-factory").register("primary-action-status-widget",function(a,b,g){var d=b.widgetType;a=g.getWidgetType(d.WIDGET).extend({init:function(a,b){this._super(a,b);this.getElement().addClass(d.PRIMARY_ACTION_STATUS_WIDGET)}});g.registerWidgetType(d.PRIMARY_ACTION_STATUS_WIDGET,a);return a});c.when("A","promising-ui-element",
"uss-utils","uss-constants").register("promising-image",function(a,b,g,d){var m=a.$,h=d.classList;return b.extend({init:function(a,b){this._element=m(b);this._attribution=a;this._super(this._element);this._eventHandle=t},_showTickMarkImage:function(b){switch(b){case h.ATC_SUCCESS:this._showSuccessTickMark();break;case h.ATC_ERROR:this._showErrorTickMark();break;default:return}a.off(this._eventHandle.event,this._eventHandle.callback)},_showSuccessTickMark:function(){m(".main-image").find(".success-tick-mark-placeholder").addClass("success-tick-mark-image")},
_showErrorTickMark:function(){var b=m(".main-image").find(".error-tick-mark-placeholder");b.addClass("error-tick-mark-image");a.fadeIn(b,200,d.transitionTimingFunction.EASE_OUT)},showUIValue:function(b,e,h){var q=this,l=d.defaultAtcAnimationType,B=this._super.bind(this);l===d.animationType.FADE_IN&&(this._eventHandle=a.on(d.atcAnimationStatusEvent,this._showTickMarkImage.bind(this,h)));return g.loadImage(b,e).then(function(b){if(l===d.animationType.FADE_IN){var e=m(".main-image").find(".ui-promise");
a.fadeOut(e,200,d.transitionTimingFunction.EASE_IN,function(){q._appendImageToUIValue(b);B();var e=m(".main-image").find(".ui-value");a.fadeIn(e,200,d.transitionTimingFunction.EASE_OUT)})}else this._appendImageToUIValue(b),B();return!0}.bind(this),function(){c.log("PromisingImage.showUIValue() ... : failed to load image","FATAL",this._attribution.getAttribution());return!1}.bind(this))},_appendImageToUIValue:function(a){this.getValueElement().empty();this.getValueElement().append(a)}})});c.when("A",
"promising-ui-element","uss-constants").register("atc-status-msg",function(a,b,g){var d=g.classList;return b.extend({init:function(a){this._atcStatusElement=a;this._super(this._atcStatusElement)},_showSuccessMessage:function(){this._atcStatusElement.addClass(d.ATC_SUCCESS);this._atcStatusElement.removeClass(d.ATC_ERROR);this._atcStatusElement.removeClass(d.ITEM_IN_CART)},_showFailureMessage:function(){this._atcStatusElement.addClass(d.ATC_ERROR);this._atcStatusElement.removeClass(d.ATC_SUCCESS);this._atcStatusElement.removeClass(d.ITEM_IN_CART)},
_showItemInCartMessage:function(){this._atcStatusElement.addClass(d.ITEM_IN_CART);this._atcStatusElement.removeClass(d.ATC_ERROR);this._atcStatusElement.removeClass(d.ATC_SUCCESS)},showUIValue:function(b){var h=this,f=g.defaultAtcAnimationType;switch(b){case d.ATC_SUCCESS:this._showSuccessMessage();break;case d.ATC_ERROR:this._showFailureMessage();break;case d.ITEM_IN_CART:this._showItemInCartMessage();break;default:return}this._super();f===g.animationType.FADE_IN&&(b=this._atcStatusElement.find("."+
d.UI_PROMISE),a.fadeOut(b,200,g.transitionTimingFunction.EASE_IN,function(){var b=h._atcStatusElement.find("."+d.UI_VALUE);a.fadeIn(b,200,g.transitionTimingFunction.EASE_OUT,function(){a.trigger(g.atcAnimationStatusEvent)})}))}})});c.when("A","promising-ui-element","uss-constants","dp-flux-utils").register("cart-status-message",function(a,b,g,d){var c=g.classList;return b.extend({init:function(a){this._cartStatusElement=a;this._subTotalElement=this._cartStatusElement.find("."+c.CART_SUB_TOTAL);this._cartCountElement=
this._cartStatusElement.find("."+c.CART_COUNT);this._cartCountSingularTemplate=this._cartCountElement.data("cart-count-singular-template");this._cartCountPluralTemplate=this._cartCountElement.data("cart-count-plural-template");this._super(this._cartStatusElement);this._eventHandle=t},_atcAnimationStatusResolved:function(){setTimeout(function(){this._cartStatusElement.addClass("uss-c-cart-status-msg-transition");a.off(this._eventHandle.event,this._eventHandle.callback)}.bind(this),200)},showUIValue:function(b,
f){var e=g.defaultAtcAnimationType;if("number"===typeof b&&d.isNonEmptyString(f)){var c;1===b?c=this._cartCountSingularTemplate.replace("###cartCount",b):1<b&&(c=this._cartCountPluralTemplate.replace("###cartCount",b));this._cartCountElement.html(c);this._subTotalElement.html(f);this._super();e===g.animationType.FADE_IN&&(this._eventHandle=a.on(g.atcAnimationStatusEvent,this._atcAnimationStatusResolved.bind(this)))}}})});c.when("A","a-button","uss-constants","uss-logger-service").register("uss-sub-nav",
function(a,b,c,d){var m=c.classList,h=c.metrics;return{getInstance:function(f){var e={},k=f.find("."+m.CHECKOUT_FORM);b("."+m.CHECKOUT_BUTTON,f);var q=f.find("."+m.CART_BUTTON),l=t;k.submit(function(){d.logCounter(h.CHECKOUT_FORM_CLICK_COUNTER)});q.click(function(){d.logCounter(h.CART_BUTTON_CLICK_COUNTER)});e.updateCheckoutUrl=function(a){k.attr("action",a)};e.hide=function(){a.$(f).addClass("is-hidden")};e.atcAnimationStatusResolved=function(){setTimeout(function(){a.$(f).addClass("uss-c-sub-nav-margin");
a.$(f).addClass("uss-c-sub-nav-transition");a.off(l.event,l.callback)}.bind(),200)};e.show=function(){a.$(f).removeClass("is-hidden");c.defaultAtcAnimationType===c.animationType.FADE_IN&&(l=a.on(c.atcAnimationStatusEvent,e.atcAnimationStatusResolved.bind()))};e.preInitiate=function(){var a=k.parent();a.find("iframe#ussCheckoutPrefetch").remove();var b=(new Date).getTime(),e="/gp/checkoutprefetch/checkout-prefetch.html?cartInitiateId\x3d"+b,f=document.createElement("iframe");f.setAttribute("src",e);
f.setAttribute("style","width:0px;height:0px;display:none;position:absolute;");f.setAttribute("name","ussCheckoutPrefetch");f.setAttribute("id","ussCheckoutPrefetch");a.append(f);a=k.find("#cartInitiateId");a.length?a.val(b):k.append("\x3cinput type\x3d'hidden' name\x3d'cartInitiateId' id\x3d'cartInitiateId' value\x3d'"+b+"'\x3e")};e.hide();return e}}});c.when("A","uss-constants").register("uss-shipping-details",function(a,b){var c=a.$;return{getInstance:function(d){var m=d.find("."+b.classList.SHIPPING_DETAILS),
h=m.find("."+b.classList.SHIPPING_MESSAGE_PLACEHOLDER),f=b.defaultAtcAnimationType,e=t,k=function(){var a=h.find(".a-row").find("a"),b=a.attr("onclick");if("undefined"!==typeof b&&b.includes("amz_js_PopWin")){var e=[];c.each(a[0].attributes,function(a,b){e.push(b.name)});c.each(e,function(b,e){a.removeAttr(e)});a.attr("href","/gp/help/customer/display.html?nodeId\x3d527692")}},q={hide:function(){m.addClass(b.classList.HIDE_ELEMENT);m.removeClass(b.classList.SHOW_ELEMENT)},atcAnimationStatusResolved:function(){setTimeout(function(){m.addClass("uss-c-shipping-details-transition");
a.off(e.event,e.callback)}.bind(),200)},show:function(c){h.empty();h.append(a.$(c));k();m.addClass(b.classList.SHOW_ELEMENT);m.removeClass(b.classList.HIDE_ELEMENT);f===b.animationType.FADE_IN&&(e=a.on(b.atcAnimationStatusEvent,q.atcAnimationStatusResolved.bind()))}};q.hide();return q}}});c.when("A","uss-constants","primary-action-status-widget","dp-flux-attribution","uss-widget-factory","atc-status-msg","cart-status-message","promising-image","uss-sub-nav","uss-shipping-details").register("atc-status-widget",
function(a,b,c,d,m,h,f,e,k,q){var l=b.ussCTI,B=b.widgetType,p=b.classList,n=new d(b.widgetType.ATCStatusWidget,l.CATEGORY,l.TYPE,l.ITEM);c=c.extend({init:function(a,b){this._atcGenericError=b.find("."+p.ATC_GENERIC_ERROR);this._atcAcknowledgementMessage=b.find("."+p.ATC_ACKNOWLEDGEMENT_MESSAGE);this._mainImage=new e(a,this._atcAcknowledgementMessage.find("."+p.MAIN_IMAGE));this._atcStatusMessage=new h(this._atcAcknowledgementMessage.find("."+p.ATC_STATUS_MESSAGE_COMPONENT));this._cartStatusMessage=
new f(this._atcAcknowledgementMessage.find("."+p.CART_STATUS_MESSAGE_COMPONENT));this._subNav=k.getInstance(this._atcAcknowledgementMessage.find("."+p.SUB_NAV));this._shippingDetails=q.getInstance(this._atcAcknowledgementMessage);this._viewState={};this._super(a,b)},update:function(e){var c;a.each(e,function(e){if(e.getStoreAttribution().getName()===b.stores.ATC_STATUS_STORE){var f=e.getDispatcher()._pendingAction;f&&f.getName()===b.actions.ATC_RECEIVE&&this._subNav.preInitiate();c=e.getState();c.isAtcGenericError?
this.showGenericError():(e=a.diff(this._viewState,c),e.status&&c.status&&this._atcStatusMessage.showUIValue(c.status),e.cart.count&&c.cart.count&&(this._cartStatusMessage.showUIValue(c.cart.count,c.cart&&c.cart.subTotal&&c.cart.subTotal.displayString||""),e.cart.checkoutUrl&&c.cart.checkoutUrl&&this._subNav.updateCheckoutUrl(c.cart.checkoutUrl),this._subNav.show()),e.mainImage.src&&c.mainImage.src&&this._mainImage.showUIValue(c.mainImage.src,c.mainImage.altText,c.status),e.shippingMessageHTML&&c.shippingMessageHTML&&
this._shippingDetails.show(c.shippingMessageHTML));this._viewState=c}}.bind(this))},showGenericError:function(){this._atcAcknowledgementMessage.addClass(p.HIDE_ELEMENT);this._atcAcknowledgementMessage.removeClass(p.SHOW_ELEMENT);this._atcGenericError.removeClass(p.HIDE_ELEMENT);this._atcGenericError.addClass(p.SHOW_ELEMENT)},getStoreNames:function(){return[b.stores.ATC_STATUS_STORE]}});c.getAttribution=function(){return n};m.registerWidgetType(B.ATCStatusWidget,c);return c});c.when("A","uss-constants",
"dp-flux-attribution","uss-widget-factory").register("atc-status-imb-widget",function(a,b,g,d){var m=d.getWidgetType(b.widgetType.WIDGET),h=b.ussCTI,f=new g("atc-status-imb-widget",h.CATEGORY,h.TYPE,h.ITEM);g=m.extend({init:function(a,c){c.addClass(b.widgetType.ATC_STATUS_IMB_WIDGET);this._super(a,c)},update:function(e){var d;a.each(e,function(e){if(e.getStoreAttribution().getName()===b.stores.ATC_STATUS_STORE)if(d=e.getState(),d.imbHTML){this.getElement().empty();e=a.$(d.imbHTML);var h=e.children().length;
if(1<=h){e.find(".a-declarative a").unwrap();var g=e.find(".a-declarative span");g.removeClass("a-color-link huc-cursor-pointer");g.unwrap();this.getElement().append(e);this.show();1<h&&c.log("ImbWidget.update(...): More than one IMB message exist : html \x3d "+d.imbHTML,"WARN",f.getAttribution())}else this.hide()}else this.hide()}.bind(this))},afterRender:function(){this.hide()},getStoreNames:function(){return[b.stores.ATC_STATUS_STORE]}});g.getAttribution=function(){return f};d.registerWidgetType(b.widgetType.ATC_STATUS_IMB_WIDGET,
g);return g});c.when("A").register("uss-base-layout",function(a){return a.createClass({init:function(a){this._ussSheetElement=a},renderWidgets:function(a){throw Error("Layout.renderWidgets()...: Subclass must implement update method");},reset:function(){throw Error("Layout.reset()...: Subclass must implement reset method");},getUssSheetElement:function(){return this._ussSheetElement}})});c.when("A","uss-base-layout","promising-ui-element","uss-constants","primary-action-status-widget","atc-status-imb-widget").register("uss-default-layout",
function(a,b,c,d,m,h){var f=d.layout.defaultLayout;return b.extend({init:function(b){this._super(b);this._element=b.find("."+f.DEFAULT_LAYOUT);this._ussHead=this._element.find("."+f.HEAD);this._ussBody=this._element.find("."+f.BODY);this._widgetList=[];this._recommendationLoader=a.$("."+f.SKELETON_LOADER);this._recommendationLoadingMessage=a.$("."+f.RECOMMENDATION_LOADING_MESSAGE);this._recommendationLoadedMessage=a.$("."+f.RECOMMENDATION_LOADED_MESSAGE);this._ussBody.append(this._recommendationLoader);
this._recommendationLoaderFadeOutOptions={timeDuration:200,transitionTimingFunction:d.transitionTimingFunction.EASE_IN};this._recommendationLoaderFadeInOptions={timeDuration:200,transitionTimingFunction:d.transitionTimingFunction.EASE_OUT};this._recommendationWidgetOptions={showWidgetAnimation:{animationType:d.animationType.FADE_IN,timeDuration:200,transitionTimingFunction:d.transitionTimingFunction.EASE_OUT}}},renderWidgets:function(b){var c,d=!1;a.each(b,function(b){c={};b.beforeRender();this._widgetList.push(b);
if(b instanceof m)this._ussHead.prepend(b.getElement());else if(b.getElement().addClass(f.BOTTOM_MARGIN_BETWEEN_WIDGETS),b.getElement().addClass(f.TOP_MARGIN_BETWEEN_WIDGETS),b instanceof h)this._ussBody.prepend(b.getElement());else{if(!d){d=!0;var e=this;a.fadeOut(this._recommendationLoader,this._recommendationLoaderFadeOutOptions.timeDuration,this._recommendationLoaderFadeOutOptions.transitionTimingFunction,function(){a.fadeIn(e._recommendationLoadedMessage,e._recommendationLoaderFadeInOptions.timeDuration,
e._recommendationLoaderFadeInOptions.transitionTimingFunction)})}c=this._recommendationWidgetOptions;this._ussBody.append(b.getElement())}b.show(c);b.afterRender()}.bind(this))},reset:function(){a.each(this._widgetList,function(a){a.deleteWidget()});this._widgetList=[];this._ussBody.empty();this._ussBody.append(this._recommendationLoader);this._ussBody.append(this._recommendationLoadedMessage);this._recommendationLoader.css({display:"block"});this._recommendationLoadingMessage.css({display:"none"});
this._recommendationLoadedMessage.css({display:"none"});this.resetScrollPosition()},resetScrollPosition:function(){this._ussBody.scrollTop(0)}})});c.when("uss-constants","dp-flux-action","uss-dispatcher","uss-utils").register("uss-action-creator-helper",function(a,b,c,d){function m(){z.$("#add-to-cart-button").removeAttr("disabled")}return{primaryATCClick:function(h,f){var e=new b(a.actions.USS_OPEN,a.actionSources.DP_ATC_CLICK,{recommendationBaseIdentifier:h});f.percolateData.then(function(d){var q=
{isContainsRecommendation:!1,widgets:[]};d.recommendationData&&(q.widgets=d.recommendationData.widgets||[]);m();q.widgets.length||(q.widgets.push({widgetType:a.widgetType.NO_RECOMMENDATION_WIDGET}),q.recommendationBaseIdentifier=h);c.dispatch(e);f.atcData.then(function(e){var f={};1===e.isOk?f=e.atcStatusData:f.isAtcGenericError=!0;e=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,f);c.dispatch(e)},function(){var e=new b(a.actions.ATC_RECEIVE,a.actionSources.DP_ATC_CLICK,{isAtcGenericError:!0});
c.dispatch(e)});q.recommendationBaseIdentifier=h;d=new b(a.actions.RECOMMENDATION_DATA_RECEIVE,a.actionSources.DP_ATC_CLICK,q);c.dispatch(d)},function(){f.atcData.then(function(a){m();1===a.isOk?d.showATCSuccess():d.showATCFailure()},function(){d.showATCFailure()})})},secondaryATCClick:function(d,f){d.atcData.then(function(e){var d={};1===e.isOk?d=e.atcStatusData:d.isAtcGenericError=!0;d.params=f;e=new b(a.actions.ATC_RECEIVE,a.actionSources.USS_INLINE_ATC_CLICK,d);c.dispatch(e)},function(){})}}})},
initializeUSSComponents:function(){c.when("uss-template-store","uss-sheet-store","uss-recommendation-data-store","uss-store-repository","uss-widget","uss-recommendation-widget","primary-action-status-widget","uss-widget-factory","uss-sheet-view","uss-layout").register("uss-framework-ready",function(a){a.init()});c.when("uss-sheet-view","uss-framework-ready").register("uss-sheet-view-ready",function(a){a.initializeUSSSheetView()})},initializeBuyBox:function(){c.when("buy-box-override","atc-status-widget",
"atc-status-imb-widget","uss-atc-status-store","uss-framework-ready","uss-sheet-view-ready").execute(function(a){a.init()})}}});c.when("A","uss-constants","uss-logger-service").register("uss-eligibility",function(c,n,r){var v=n.metrics,a={};return{getUssEligibility:function(b,c){return{primaryAsinData:{asin:b,offerListingId:c},eligibility:a}},registerProgramEligibility:function(b,c){b&&(a[b]&&r.logCounter(v.PROGRAM_ELIGIBILITY_REGISTRY_OVERWRITTEN+"."+programName),a[b]=c)}}});c.when("A","atf","uss-init-helper",
"uss-preconditions","uss-logger-service","uss-constants").register("uss-init",function(t,n,r,v,a,b){function g(){r.loadUssCommonAssets();c.when("A","3p-promise","uss-light-box","uss-constants","uss-logger-service").register("uss-sheet-component",function(a,b,c,d,g){function l(b,f){if(!(this instanceof l))throw Error(r.INVALID_CONSTRUCTOR_USAGE);if("string"===typeof b)if(this._sheet=m("#"+b),1===this._sheet.length)this._sheetID=b,this._sheet.addClass(p.RIGHT_SIDE_SHEET),this._sheet.addClass(p.RIGHT_SIDE_SHEET_LAYOUT),
this._sheet.addClass(p.SHEET_CLOSE),this._sheet.attr("role","dialog"),this._sheet.appendTo(w),this._closeIcon=this._createCloseIcon(),this._closeIcon.click(function(){var a=this.close();f.beforeClose&&f.beforeClose(a);g.logCounter(this._sheetID+":closeIconClick")}.bind(this)),this._sheet.append(this._closeIcon),c.getElement().click(function(){var a=this.close();f.beforeClose&&f.beforeClose(a);g.logCounter(this._sheetID+":lightBoxClick")}.bind(this)),this._sheet.removeClass(p.HIDE_ELEMENT),a.on(d.atcAnimationStatusEvent,
function(){A.is(":visible")&&a.fadeIn(x,200,n.EASE_OUT)});else throw Error("Unique element with id '"+b+"' must exist inside a DOM");else throw Error(r.INVALID_SHEET_ID);}var m=a.$,p=d.classList,n=d.transitionTimingFunction,r=d.fatalMessagesList,u=d.layout.defaultLayout,w=m("body"),A=m("."+u.SKELETON_LOADER),x=m("."+u.RECOMMENDATION_LOADING_MESSAGE);l.prototype.open=function(){var d=this;return new b(function(b){var f=d._getSheetSize();d._sheet.css({right:"-"+f+"px"});c.show();a.animationFrameDelay(function(){a.animate(d._sheet,
{right:0},400,n.ENTER_EASE,function(){d._sheet.removeClass(p.SHEET_CLOSE);d._sheet.addClass(p.SHEET_OPEN);d.showCloseIcon();b(!0);g.logCounter(d._sheetID+":open")})});d._closeIcon.css({right:f+15+"px"})})};l.prototype.close=function(){return new b(function(b){var d="-"+this._getSheetSize()+"px";a.animate(this._sheet,{right:d},300,n.EXIT_EASE,function(){this._sheet.removeClass(p.SHEET_OPEN);this._sheet.addClass(p.SHEET_CLOSE);b(!0);g.logCounter(this._sheetID+":close")}.bind(this));this.hideCloseIcon();
c.hide()}.bind(this))};l.prototype.getSheetElement=function(){return this._sheet};l.prototype._getSheetSize=function(){return this._sheet.outerWidth()};l.prototype._createCloseIcon=function(){return m("\x3cdiv class \x3d '"+(p.CLOSE_ICON+" "+p.CLOSE_ICON_MEDIUM+"  "+p.HIDE_ELEMENT)+"'\x3e\x3c/div\x3e")};l.prototype.showCloseIcon=function(){a.fadeIn(this._closeIcon,200,n.EVEN_EASE)};l.prototype.hideCloseIcon=function(){a.fadeOut(this._closeIcon,200,n.EVEN_EASE)};return l});c.when("A","uss-constants",
"uss-utils").register("uss-light-box",function(a,b,c){var d=a.$,g=b.classList,l=d("\x3cdiv class\x3d'"+g.LIGHT_BOX_IDENTIFIER+" "+g.LIGHT_BOX_JS_HOOK+" "+g.HIDE_ELEMENT+"'\x3e\x3c/div\x3e");d("body").append(l);return{show:function(){l.addClass(g.SHOW_ELEMENT);l.removeClass(g.HIDE_ELEMENT);c.disablePageScroll();a.animationFrameDelay(function(){a.animate(l,{opacity:.6},400,b.transitionTimingFunction.EVEN_EASE)})},hide:function(){l.removeClass(g.SHOW_ELEMENT);a.animate(l,{opacity:0},300,b.transitionTimingFunction.EVEN_EASE,
function(){l.addClass(g.HIDE_ELEMENT);l.removeClass(g.SHOW_ELEMENT);c.enablePageScroll()})},getElement:function(){return l}}});c.when("A","uss-constants","dp-flux-attribution","dp-flux-view","uss-store-repository","uss-atc-status-store").register("nav-bar-cart-count-view",function(a,b,c,d,g,l){var m=a.$;a=b.ussCTI;c=new c("nav-bar-cart-count-view",a.CATEGORY,a.TYPE,a.ITEM);l=g.getStore(b.stores.ATC_STATUS_STORE);new d(c,[l],function(a){if(-1!==m.inArray(l,a)){var b=l.getState();y.$Nav.when("api.setCartCount").run(function(a){b.cart.count&&
a(b.cart.count)})}})});c.when("A").register("buy-box-utility",function(a){var b=a.$;return{isWarrantySelectedInBuyBox:function(){var a=!1;b("#abbWrapper .abbListItem input[type\x3dcheckbox]").each(function(){a=a||b(this).prop("checked")});return a}}});c.when("A","uss-action-creator-helper","uss-preconditions","uss-logger-service","uss-constants","uss-utils","uss-eligibility").register("uss-atc",function(a,b,c,d,g,l,m){function p(a){this.widgetName=a;this.isPrimaryAtc="DetailPageBuyBox"===a}var n=
a.$,r=g.ajaxParams.AJAX_TIMEOUT,u=g.ajaxParams.BASE_URL,w={};p.prototype._getAtcUrl=function(a){var b=u;a.hasOwnProperty("ref")&&(b=b+"/ref\x3d"+a.ref);(a=a.linkParams)&&""!==a.trim()&&("\x26"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1)),b=b+"?"+a);return b};p.prototype._addUssParameters=function(a){a.params.isUSSAjax=1;this.isPrimaryAtc&&(a.params.isPrimaryATC=1,l.shouldFireAndForgetWeblabTrigger()||(a.params.triggerUSSWeblab=c.triggerUSSWeblabValue()));a=this._addEligibilityParameters(a);
var b=l.getDebugParams();Object.keys(b).forEach(function(c){a.params[c]=b[c]});return a};p.prototype._addEligibilityParameters=function(a){var b=m.getUssEligibility(a.params[g.ajaxParams.ASIN],a.params[g.ajaxParams.OFFER_LISTING_ID]);a.params.ussEligibility=JSON.stringify(b);return a};p.prototype._callback=function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);"function"===typeof a&&a.apply(this,b)};p.prototype._addToCart=function(b,d){this.isPrimaryAtc&&c.isUssWeblabInTreatment()&&
a.$("#add-to-cart-button").attr("disabled",!0);var f=this;b=this._getAtcUrl(b);d=this._addUssParameters(d);var g=n.Deferred(),k=n.Deferred(),l={};a.post(b,{params:d.params,success:function(b,c,e){d.hasOwnProperty("success")&&f._callback(d.success,b,c,e);a.trigger("USS ATC: Success")},error:function(b,c,e){g.reject();k.reject();d.hasOwnProperty("error")&&f._callback(d.error,b,c,e);a.trigger("USS ATC : Failure")},abort:function(a){g.reject();k.reject();d.hasOwnProperty("abort")&&f._callback(d.abort,
a)},chunk:function(a){if(a&&a.hasOwnProperty("name")){switch(a.name){case "atc-data":g.resolve(a.response);break;case "percolate-data":k.resolve(a.response);break;default:var b={message:"ATC Failed for widget "+f.widgetName+". Unrecognized chunk name found. ",logLevel:"FATAL"};y.ueLogError&&y.ueLogError("USS ATC Failure for widget "+f.widgetName,b)}d.hasOwnProperty("chunk")&&f._callback(d.chunk,a)}},timeout:d.timeout||r});l.atcData=g;this.isPrimaryAtc&&(l.percolateData=k);return l};return{addToCart:function(a,
c,e){if(!a||!a.trim().length||"object"!==typeof c)throw g.fatalMessagesList.INCORRECT_PARAMETER_PASSED;var h="DetailPageBuyBox"===a;w[a]||(w[a]=new p(a));a=w[a]._addToCart(e,c);h||(h={},h.baseAsin=c.params.ASIN||c.params.a,h.baseReftag=e.ref,d.logCounter(g.metrics.SECONDARY_ADD_TO_CART_CLICK_COUNTER),b.secondaryATCClick(a,h));return a}}});c.when("A","uss-atc","uss-action-creator-helper","uss-preconditions","uss-logger-service","uss-constants","buy-box-utility","uss-utils").register("buy-box-override",
function(a,b,c,d,g,l,m,p){var n=a.$,r=l.metrics;a={actionButton:null,whitelistedActions:{"submit.add-to-cart":1},init:function(){this.checkPreconditionsAndManipulateBuyBox()},checkPreconditionsAndManipulateBuyBox:function(){this.buyBoxForm=n("#addToCart");d.isUssConditionsPassed()&&this.attachFormHandler()},attachFormHandler:function(){this.buyBoxForm.submit(this.submitForm.bind(this));this.buyBoxForm.find("input[type\x3dsubmit], input[type\x3dbutton]").click(function(a){this.actionButton=a.target}.bind(this))},
isValidAction:function(){return this.actionButton&&this.actionButton.name in this.whitelistedActions},submitForm:function(a){if(!m.isWarrantySelectedInBuyBox()&&this.isValidAction())if(d.isUssWeblabInTreatment()){a.preventDefault();a=this.getAddToCartParameters();var h={params:a},n={ref:l.ajaxParams.REFTAG};p.shouldFireAndForgetWeblabTrigger()&&p.fireAndForgetWeblabTrigger(d.triggerUSSWeblabValue(),d.ussWeblabTreatmentValue());var h=b.addToCart("DetailPageBuyBox",h,n),x=new g.Timer(r.ATC_PROMISE_RESOLVED_TIMER),
t=new g.Timer(r.PERCOLATE_DATA_PROMISE_RESOLVED_TIMER);x.start();t.start();h.atcData.then(function(a){1===a.isOk&&x.stop()},function(){g.logCounter(r.ATC_PROMISE_REJECTED_COUNTER)});h.percolateData.then(function(){t.stop()},function(){g.logCounter(r.PERCOLATE_DATA_PROMISE_REJECTED_COUNTER)});c.primaryATCClick(a[l.ajaxParams.ASIN],h)}else g.logCounter(l.metrics.POST_ATC_PRECONDITIONS_FAILED),this.addHiddenUSSField("isUSSControl",1),p.shouldFireAndForgetWeblabTrigger()?p.fireAndForgetWeblabTrigger(d.triggerUSSWeblabValue(),
d.ussWeblabTreatmentValue()):this.addHiddenUSSField("triggerUSSWeblab",d.triggerUSSWeblabValue());else g.logCounter(l.metrics.POST_ATC_PRECONDITIONS_FAILED)},addHiddenUSSField:function(a,b){n("\x3cinput\x3e").attr({type:"hidden",id:a,name:a,value:b}).appendTo(this.buyBoxForm)},getAddToCartParameters:function(){var a={},b=this.buyBoxForm.serializeArray();n.each(b,function(b,c){a[c.name]=c.value});return a}};return{init:a.init.bind(a)}})}function d(){v.isUssConditionsPassed()&&(a.logCounter(b.metrics.PAGE_LANDING_PRECONDITIONS_PASSED),
m||(g(),m=!0,r.initializeUSSComponents()),r.initializeBuyBox())}var m=!1;t.on("PageRefresh:ATF",function(){d()});d()})});
/* ******** */
(function(g){var h=window.AmazonUIPageJS||window.P,m=h._namespace||h.attributeErrors,b=m?m("MonthlyPaymentsDetailPageAssets",""):h;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,h,m){g.when("A").register("monthly-payments-equal-pay-common",function(b){var f=b.$,a={TWISTER_DEBOUNCE_DURATION:300,counter:{checkboxShown:"salmon-mp-ep-dp-checkbox-shown",checkboxHiddenHtmlUnrecognized:"salmon-mp-ep-dp-checkbox-hidden-html-unrecognized",checkboxHiddenMissingPaymentOfferInfo:"sal-mp-ep-dp-checkbox-hidden-missing-paymentOfferInfo",
checkboxHiddenOneClickDetected:"salmon-mp-ep-dp-checkbox-hidden-one-click-detected",checkboxHiddenMissingAddToCartButton:"salmon-mp-ep-dp-checkbox-hidden-missing-add-to-cart-button",checkboxHiddenMissingBuyNowButton:"salmon-mp-ep-dp-checkbox-hidden-missing-buy-now-button",checkboxHiddenInstallmentsDetected:"salmon-mp-ep-dp-checkbox-hidden-installments-detected",checkboxChecked:"salmon-mp-ep-dp-checkbox-checked",checkboxUnchecked:"salmon-mp-ep-dp-checkbox-unchecked",checkboxCheckedAddToCartClicked:"salmon-mp-ep-dp-checkbox-checked-addtocart-clicked",
checkboxCheckedBuynowClicked:"salmon-mp-ep-dp-checkbox-checked-buynow-clicked",checkboxUncheckedAddToCartClicked:"salmon-mp-ep-dp-checkbox-unchecked-addtocart-clicked",checkboxUncheckedBuynowClicked:"salmon-mp-ep-dp-checkbox-unchecked-buynow-clicked",messageAddToCartClicked:"salmon-mp-ep-dp-message-addtocart-clicked",messageBuynowClicked:"salmon-mp-ep-dp-message-buynow-clicked",messageShown:"salmon-mp-ep-dp-message-shown",continueButtonClicked:"salmon-mp-ep-dp-continue-button-clicked",tncOpened:"salmon-mp-ep-dp-tnc-opened",
tncCheckboxChecked:"salmon-mp-ep-dp-tnc-checkbox-checked",tncCheckboxUnchecked:"salmon-mp-ep-dp-tnc-checkbox-unchecked",tncNoThankYouOrExit:"salmon-mp-ep-dp-tnc-no-thank-you-or-exit",featureNotPresent:"salmon-mp-ep-dp-feature-not-present"},reftag:{failedDataInputs:"DATA_INPUTS_NOT_FOUND:",missingPaymentOfferInfo:"MISSING_PAYMENT_OFFER_INFO:",oneClickDetected:"ONE_CLICK_DETECTED:",htmlUnrecognized:"HTML_UNRECOGNIZED:",missingAddToCartButton:"MISSING_ADD_TO_CART_BUTTON:",missingBuyNowButton:"MISSING_BUY_NOW_BUTTON:",
installmentsDetected:"INSTALLMENTS_DETECTED:"},selector:{addToCartButton:"#add-to-cart-button",buyNowButton:"#buy-now-button",oneClickButton:"#one-click-submit-btn",addToCartFormDesktop:"div#qualifiedBuybox form#addToCart, div#newAccordionRow form#addToCart",addToCartFormMobile:"div#mobile_qualifiedBuybox_feature_div form#addToCart",buyNowForm:"form#buyNowCheckout",mobileWebBuyNowForm:"form#buyNow",atcPaymentOfferInfo:"#atcPaymentOfferInfo",bnPaymentOfferInfo:"#bnPaymentOfferInfo",mpEpBuyboxFinancingCheckbox:".mp-ep-buybox-financing-checkbox",
monthlyPaymentsFeature:"#monthlyPayments_feature_div",installmentsMobileFeature:"#mobileapp_installmentPaymentAccordionRow",atcDeclarative:"div#mobileapp_qualifiedBuybox_feature_div #atc-declarative",tabletActDeclarative:'.a-declarative[data-action\x3d"add-to-cart"]:has([id\x3d"buybox.addToCart"])',buyBoxAtcData:"#buybox-atc-data",bnSpanFirstChild:"#buyNow \x3e :first",mpPaymentOfferInfo:"#mp-ep-payment-offer-info",mpEpPriceIntegerValue:"#mp-ep-plcc-tnc-price-integ-value",mpEpPriceDecimalValue:"#mp-ep-plcc-tnc-price-decimal-value",
mpEpPriceDollarIcon:"#mp-ep-plcc-price-dollar-icon"},id:{bnSpan:"buyNow",buyBoxAtcData:"buybox-atc-data",atcPaymentOfferInfo:"atcPaymentOfferInfo",atcDeclarative:"atc-declarative",bnPaymentOfferInfo:"bnPaymentOfferInfo",asin:"input#ASIN"},isFeaturePresent:function(){return!(!f(a.selector.monthlyPaymentsFeature).length||!f(a.selector.mpPaymentOfferInfo).length)},logCounter:function(a){h.ue&&h.ue.count&&h.ue.count(a,1)},logRefTag:function(a){f.get("/gp/product/ajax-handlers/reftag.html/ref\x3d"+("MONTHLY_PAYMENTS_"+
a+h.location.href))},urlParam:function(a){try{return(new RegExp("[?\x26]"+a+"\x3d([^\x26#]*)")).exec(h.location.href)[1]||0}catch(c){return 0}},isCheckboxSelected:function(a){return!!(a&&a.isChecked&&a.isChecked())},updateStateFromCheckbox:function(b,c){a.isCheckboxSelected(b)?c.check():c.uncheck()},isPaymentOfferInfoPresent:function(a){return!!a},logger:{fatal:function(a,c){g.logError(c,a,"FATAL")},error:function(a,c){g.logError(c,a,"ERROR")},warn:function(a,c){g.logError(c,a,"WARN")}},getPaymentOfferInfo:function(){var b=
f(a.selector.mpPaymentOfferInfo).attr("data-executioninfo");if(b)b=JSON.parse(b);else var b=f(a.selector.mpPaymentOfferInfo).attr("data-cardType"),c=f(a.selector.mpPaymentOfferInfo).attr("data-offerType"),b={cardType:b,offerType:c};return b}};return a});g.when("A","a-button","a-checkbox","a-modal","monthly-payments-equal-pay-common").execute("mp-ep-tnc",function(b,f,a,g,c){var h=b.$,n,d=!1,k=a(".mp-ep-buybox-financing-checkbox input[type\x3d'checkbox']"),e=a(".mp-ep-terms-and-conditions-checkbox input[type\x3d'checkbox']"),
p=f(".mp-ep-terms-and-conditions-confirm-button");b.declarative("acceptTermsAndConditionsConfirmButton","click",function(){d=!0;c.updateStateFromCheckbox(e,k);n.hide();c.logCounter(c.counter.continueButtonClicked)});b.declarative("acceptTermsAndConditionsCancelButton","click",function(){d=!1;n.hide()});b.declarative("selectMonthlyPaymentsEqualPayCheckbox","click",function(){k&&c.updateStateFromCheckbox(k,e)});b.declarative("selectEqualPayTermsAndConditionsCheckbox","click",function(){e.isChecked()?
c.logCounter(c.counter.tncCheckboxChecked):c.logCounter(c.counter.tncCheckboxUnchecked)});var q=b.debounce(function(){k=a(".mp-ep-buybox-financing-checkbox input[type\x3d'checkbox']");e=a(".mp-ep-terms-and-conditions-checkbox input[type\x3d'checkbox']");p=f(".mp-ep-terms-and-conditions-confirm-button");k.enable(!0);b.on("a:popover:beforeHide:mp-ep-terms-and-conditions-content",function(){d||c.logCounter(c.counter.tncNoThankYouOrExit)});b.on("a:popover:afterShow:mp-ep-terms-and-conditions-content",
function(){n||(n=g.get(h("#mp-ep-terms-and-conditions-popover")));e.isEmpty()&&(e=a(".mp-ep-terms-and-conditions-checkbox input[type\x3d'checkbox']"));p.isEmpty()&&(p=f(".mp-ep-terms-and-conditions-confirm-button"));c.logCounter(c.counter.tncOpened)})},c.TWISTER_DEBOUNCE_DURATION);q();b.on("a:pageUpdate",q)});g.when("A","a-checkbox","monthly-payments-equal-pay-common","a-modal").execute(function(b,f,a){function g(){if(d(a.selector.mpEpPriceIntegerValue).length&&d(a.selector.mpEpPriceDecimalValue).length&&
d(a.selector.mpEpPriceDollarIcon).length){var b=p.split(".");2===b.length&&b[0]&&b[1]&&(d(a.selector.mpEpPriceDollarIcon).text("$"),d(a.selector.mpEpPriceIntegerValue).text(b[0]),d(a.selector.mpEpPriceDecimalValue).text(b[1]))}}function c(b,c){var e="",f=d(a.selector.addToCartFormDesktop);b&&(b.cartType=c||"ADD_TO_CART",e=JSON.stringify(b));if(d(a.selector.tabletActDeclarative).length&&h(a.selector.tabletActDeclarative,e))return!0;if(1===f.length)return b=d(a.selector.atcPaymentOfferInfo),b.length?
b.val(e):d("\x3cinput\x3e").attr({type:"hidden",name:"paymentOfferInfo",value:e,id:a.id.atcPaymentOfferInfo}).appendTo(f),!0;a.logger.error("PLCC SALMON ERROR: Multile ATC form found in DPX for ASIN: "+d(a.id.asin).value)}function h(a,b){var c=!1;(a=d(a).data())&&d.each(a,function(a,d){if(d&&d.inputs)return d.inputs.paymentOfferInfo=b,c=!0,!1});return c}function n(){if(d(a.selector.mpEpBuyboxFinancingCheckbox).length)if(e)if(r)a.logRefTag(a.reftag.oneClickDetected),a.logCounter(a.counter.checkboxHiddenOneClickDetected);
else if(d(a.selector.installmentsMobileFeature).length)a.logRefTag(a.reftag.installmentsDetected),a.logCounter(a.counter.checkboxHiddenInstallmentsDetected);else if(t){if(c())return a.logCounter(a.counter.checkboxShown),!1;a.logRefTag(a.reftag.failedDataInputs);a.logCounter(a.counter.checkboxHiddenHtmlUnrecognized)}else a.logRefTag(a.reftag.missingAddToCartButton),a.logCounter(a.counter.checkboxHiddenMissingAddToCartButton);else a.logRefTag(a.reftag.missingPaymentOfferInfo),a.logCounter(a.counter.checkboxHiddenMissingPaymentOfferInfo);
else if(a.isPaymentOfferInfoPresent(e))return a.logCounter(a.counter.messageShown),!1;return!0}var d=b.$;if(a.isFeaturePresent()){var k=!1,e=a.getPaymentOfferInfo(),p=d(a.selector.mpPaymentOfferInfo).attr("data-productPrice"),q=d("span#mp-ep-plcc-header-msg"),l=f(a.selector.mpEpBuyboxFinancingCheckbox),m=d(a.selector.monthlyPaymentsFeature),t=!!d(a.selector.addToCartButton).length,r=!!d(a.selector.oneClickButton).length;b.declarative("selectMonthlyPaymentsEqualPayCheckbox","change",function(){a.isCheckboxSelected(l)?
(k=!0,c(e),a.logCounter(a.counter.checkboxChecked)):(k=!1,c(),a.logCounter(a.counter.checkboxUnchecked))});var u=b.debounce(function(){a.isFeaturePresent()?(e=a.getPaymentOfferInfo(),p=d(a.selector.mpPaymentOfferInfo).attr("data-productPrice"),q=d("span#mp-ep-plcc-header-msg"),l=f(a.selector.mpEpBuyboxFinancingCheckbox),m=d(a.selector.monthlyPaymentsFeature),t=!!d(a.selector.addToCartButton).length,r=!!d(a.selector.oneClickButton).length,g(),b.capabilities.isAmazonApp&&(q.removeClass("a-size-large"),
q.addClass("a-size-medium")),e&&(e.mpDebug="1"===a.urlParam("mpDebug")?"1":"0"),n()?m.hide():(l.enable(!0),k&&(l.check(),c(e),a.logCounter(a.counter.checkboxChecked))),!d(a.selector.mpEpBuyboxFinancingCheckbox).length&&a.isPaymentOfferInfoPresent(e)&&c(e),d(a.selector.addToCartButton).click(b.debounce(function(){d(a.selector.mpEpBuyboxFinancingCheckbox).length?a.isCheckboxSelected(l)?(c(e,"ADD_TO_CART"),a.logCounter(a.counter.checkboxCheckedAddToCartClicked)):a.logCounter(a.counter.checkboxUncheckedAddToCartClicked):
(c(e,"ADD_TO_CART"),a.logCounter(a.counter.messageAddToCartClicked))},4E3,!0)),d(a.selector.buyNowButton).bind("click.financialOptionsCheckout",b.debounce(function(){d(a.selector.mpEpBuyboxFinancingCheckbox).length?a.isCheckboxSelected(l)?a.logCounter(a.counter.checkboxCheckedBuynowClicked):a.logCounter(a.counter.checkboxUncheckedBuynowClicked):a.logCounter(a.counter.messageBuynowClicked)},4E3,!0)),d(a.selector.buyNowButton).bind("click.financialOptionsCheckout",function(){a.isCheckboxSelected(l)?
c(e,"BUY_NOW"):d(a.selector.mpEpBuyboxFinancingCheckbox).length||c(e,"BUY_NOW")})):a.logCounter(a.featureNotPresent)},a.TWISTER_DEBOUNCE_DURATION);u();b.on("a:pageUpdate",u)}else a.logCounter(a.featureNotPresent)});g.when("A").register("monthly-payments-bottomSheetBackgroundScroller",function(b){b=b.$;var f=b("#a-page"),a=b("body");return{disablePageScrolling:function(){var b=a.scrollTop();f.css({position:"fixed",top:"-"+b+"px"})},enablePageScrolling:function(){var b=Math.abs(f.position().top);f.css({position:"",
top:""});a.scrollTop(b)}}})});
/* ******** */
(function(c){var e=window.AmazonUIPageJS||window.P,d=e._namespace||e.attributeErrors,a=d?d("PantryAddressWidgetAsset",""):e;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,e,d){var a="undefined"===typeof a?"UnknownDevice":a;c.when("A","ready","pantry-page","enable-pantry-dp-paw-asset").execute("paw-cia",function(b){var c=function(a){a&&0!==Number(a.isValidAddress)?b.$("form#add-zip").unbind("submit").submit():d(a)},d=function(a){a&&0===Number(a.isValidAddress)?
b.$("div#paw-form-invalid-zip-error").removeClass("aok-hidden"):b.$("div#paw-form-general-error").removeClass("aok-hidden");b.$("form#add-zip input[name\x3d'zip']").removeAttr("disabled");b.$("form#add-zip .a-button").removeClass("a-button-disabled");b.$("div#paw-button-spinner").addClass("aok-hidden")};b.$("form#add-zip").submit(function(f){f.preventDefault();b.$("form#add-zip input[name\x3d'zip']").attr("disabled","disabled");b.$("form#add-zip .a-button").addClass("a-button-disabled");b.$("div#paw-form-invalid-zip-error").addClass("aok-hidden");
b.$("div#paw-form-general-error").addClass("aok-hidden");b.$("div#paw-button-spinner").removeClass("aok-hidden");f={locationType:"LOCATION_INPUT",zipCode:b.$("form#add-zip input[name\x3d'zip']").val().toUpperCase(),deviceType:a,pageType:e.ue_pty,actionSource:"pantry-detail-page"};b.post("/gp/delivery/ajax/address-change.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:f,success:c,error:d})})});a="web";"use strict";c.when("A","atf").execute("pantry-enable-pantry-dp-paw-asset-gate",
function(a){c.declare("enable-pantry-dp-paw-asset",!0)})});
/* ******** */
(function(q){var n=window.AmazonUIPageJS||window.P,t=n._namespace||n.attributeErrors,e=t?t("PantryCDListAssets",""):n;e.guardFatal?e.guardFatal(q)(e,window):e.execute(function(){q(e,window)})})(function(q,n,t){q.when("A","a-dropdown","a-button","pantry-product-tile-utils","pantry-product-tile-quantity","enable-pantry-cd-list-asset","ready").execute(function(e,q,n,r,f,u){var l=e.$;u=r.prefix;var g=r.selectors,c=r.controlClasses,t=r.formUrls,x=r.ajaxUrls;e.declarative(u+"-cdlist-delete","click",function(k){var a=
r.getItemContainerByElement(k.$target);if(n(a.find(g.itemCDListDeleteButton)).isEnabled()){var p=n(a.find(g.itemATCButton));f.getQuantity(a);var b=k.data,m=b.asin,d=b.cdListId;if(d){var h=f.getQuantity(a);f.setQuantity(a,0);f.disableQuantities(a);p.disable();a.addClass(c.cdListExecuting);e.post(x.deleteFromCDListUrl,{params:{asin:m,cdListId:d,quantity:h},success:function(b){if(0===Number(b.status))a.find(g.itemMessaging).html(b.messaging),a.removeClass(c.cdListExecuting),a.addClass(c.cdListDeleteSuccess),
l(".p-cdlist-"+d+"-item-count").html(b.itemCountString);else{var v=a.find(g.itemMessaging);a.removeClass(c.cdListExecuting);a.addClass(c.cdListActionError);v.find(g.itemCDListActionError).remove();v.append(b.messaging);e.delay(function(){a.removeClass(c.cdListActionError);f.enableQuantities(a);p.enable()},3E3)}},error:function(b){var c=l('\x3cform action\x3d"'+t.cdListUrl+"/"+d+'" method\x3d"POST"\x3e\x3c/form\x3e');e.each({action:"deleteItem",cdListId:d,asin:m,quantity:h},function(a,b){c.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,
value:a}))});a.append(c);c.submit()}});k.$event.preventDefault()}}});e.declarative(u+"-cdlist-delete-undo","click",function(k){var a=k.data,p=a.quantity,b=r.getItemContainerByElement(k.$target),m=n(b.find(g.itemATCButton)),a=k.data,d=a.asin,h=a.cdListId;h&&(b.addClass(c.cdListUndoingDelete),e.post(x.undoDeleteFromCDListUrl,{params:{asin:d,cdListId:h,quantity:p},success:function(a){if(0===Number(a.status))b.removeClass(c.cdListUndoingDelete),b.removeClass(c.cdListDeleteSuccess),f.enableQuantities(b),
f.setQuantity(b,p),m.enable(),l(".p-cdlist-"+h+"-item-count").html(a.itemCountString);else{var d=b.find(g.itemMessaging);b.removeClass(c.cdListUndoingDelete);b.removeClass(c.cdListDeleteSuccess);b.addClass(c.cdListActionError);d.find(g.itemCDListActionError).remove();d.append(a.messaging);e.delay(function(){b.removeClass(c.cdListActionError);b.addClass(c.cdListDeleteSuccess);f.enableQuantities(b);m.enable()},3E3)}},error:function(a){var c=l('\x3cform action\x3d"'+t.cdListUrl+"/"+h+'" method\x3d"POST"\x3e\x3c/form\x3e');
e.each({action:"addItem",cdListId:h,asin:d,quantity:p},function(a,b){c.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});b.append(c);c.submit()}}),k.$event.preventDefault())});e.declarative(u+"-cdlist-move","change",function(k){var a=r.getItemContainerByElement(k.$target),p=n(a.find(g.itemATCButton)),b=f.getQuantity(a),m=a.find(g.itemCDListMoveToSelect),d=q.getSelect(m),h=d.val(),u=m.find('option[value\x3d"'+h+'"]').text();d.update({status:"disabled"});d.setValue("");d.update({status:"normal"});
var m=k.data,v=m.asin,w=m.cdListId;w&&(f.disableQuantities(a),p.disable(),a.addClass(c.cdListExecuting),e.post(x.moveToCDListUrl,{params:{asin:v,cdListId:w,moveToCDListId:h,quantity:b},success:function(b){if(0===Number(b.status)){var d=l(b.messaging);d.find(g.itemCDListMovedTo).html('\x3ca href\x3d"/gp/pantry/yourlists/'+h+'"\x3e'+u+"\x3c/a\x3e");a.find(g.itemMessaging).html(d);a.removeClass(c.cdListExecuting);a.addClass(c.cdListMoveSuccess);f.enableQuantities(a);f.setQuantity(a,0);f.disableQuantities(a);
l(".p-cdlist-"+w+"-item-count").html(b.itemCountString);l(".p-cdlist-"+h+"-item-count").html(b.moveToListItemCountString)}else a.find(g.itemMessaging),a.removeClass(c.cdListExecuting),a.addClass(c.cdListActionError),a.find(g.itemMessaging).html(b.messaging),e.delay(function(){a.removeClass(c.cdListActionError);f.enableQuantities(a);p.enable()},3E3)},error:function(c){var d=l('\x3cform action\x3d"'+t.cdListUrl+"/"+w+'" method\x3d"POST"\x3e\x3c/form\x3e');e.each({action:"moveItem",cdListId:w,moveToCDListId:h,
asin:v,quantity:b},function(a,b){d.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});a.append(d);d.submit()}}),k.$event.preventDefault())})});"use strict";q.when("A").execute("pantry-enable-pantry-cd-list-asset-gate",function(e){q.declare("enable-pantry-cd-list-asset",!0)})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("PantryCPIAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("A","atf").execute("pantry-enable-pantry-dp-cpi-asset-gate",function(a){c.declare("enable-pantry-dp-cpi-asset",!0)});"use strict";c.when("A","pantry-cpi-atc","enable-pantry-dp-cpi-asset","ready").execute(function(a,b){var d=a.throttle(function(a){b.itemsAddedToCart(a)},2500,{trailing:!1});
a.on("pantryAtcSuccess",function(a){d(a)});a.on("pantryAtcClick",function(a){b.positionBar()});c.when("ewc.app").execute(function(a){a.on("ewc:cartUpdate:success",function(a){d({});b.positionBar()})});b.hideGenericMessage()})});
/* ******** */
(function(d){var h=window.AmazonUIPageJS||window.P,r=h._namespace||h.attributeErrors,c=r?r("PantryCommonUtilsAssets",""):h;c.guardFatal?c.guardFatal(d)(c,window):c.execute(function(){d(c,window)})})(function(d,h,r){d.when("A","a-dropdown","a-button","enable-pantry-common-utils-asset","ready").register("pantry-product-tile-common-utils",function(c,u,v){var f=c.$,m=f(h),l={itemContainer:".p-prod-tile",itemQuantitySelect:".p-prod-tile-quantity-select",itemQuantityDisplay:".p-prod-tile-quantity",itemQuantityInput:".p-prod-tile-quantity-input",
itemButtons:".p-prod-tile-buttons",itemATC:".p-prod-tile-atc",itemPromo:".p-prod-tile-promo",itemInCart:".p-prod-tile-in-cart",itemMessaging:".p-prod-tile-messaging",itemInlineUpsell:".p-prod-tile-inline-upsell",itemMessageOverImg:".p-prod-tile-message-over-img",itemDetail:".p-prod-tile-detail",itemCarousel:".p-prod-tile-carousel",itemCDListActions:".p-prod-tile-cdlist-actions",itemCDListMoveToSelect:".p-prod-tile-cdlist-move-dropdown",itemCDListDeleteButton:".p-prod-tile-cdlist-delete-button",itemCDListMovedTo:".p-prod-tile-cdlist-moved-to",
itemCDListActionError:".p-prod-tile-cdlist-action-error",aoosButton:".p-prod-tile-aoos-button",aoosError:".p-prod-tile-aoos-error"},n=f("body"),p={addToCartUrl:"/gp/pantry/ajax/product/add-to-cart.html",miniDpaddToCartUrl:"/gp/pantry/ajax/product/add-to-cart-mini-dp.html",deleteFromCDListUrl:"/gp/pantry/ajax/product/delete-item-from-cdlist.html",moveToCDListUrl:"/gp/pantry/ajax/product/move-item-to-cdlist.html",undoDeleteFromCDListUrl:"/gp/pantry/ajax/product/undo-delete-item-from-cdlist.html",updateCDListItemQuantityUrl:"/gp/pantry/ajax/product/change-cdlist-item-quantity.html",
viewSimilarItemsUrl:"/gp/pantry/ajax/product/mobile/get-mobile-aoos-carousel.html",cxVersionErrorMetricUrl:"/gp/pantry/ajax/product/cxVersionErrorMetric.html"},q=function(a,b){b=b||n;return b.find(".p-prod-tile-asin-"+a)},w=function(a){a=f(a).attr("class").split(/\s+/);for(var b=0;b<a.length;b++){var c=a[b];if(-1!==c.indexOf("p-prod-tile-type-"))return c.substring(17)}},e=function(a,b,t){var k={tileType:b,mode:t,ref_:"p_prod_tile_atc_"+b};c.each(a,function(a,b){c.each(a,function(a,c){"sessionId"===
c?k[c]=a:"refTag"===c?k.ref_=a:k[b+"."+c]=a})});return k},x=c.state("pantry-strings")||{},g=function(){var a=c.state("cpi_hybrid_pages");if(!a)return!0;var b="excludedPathList"in a?a.excludedPathList:[],t="includedQueryParamList"in a?a.includedQueryParamList:[];if(!("disableHybridPages"in a&&a.disableHybridPages))return!0;var k=h.location.pathname;"/"!==k.substr(-1)&&(k+="/");for(a=0;a<b.length;a++)if(0<=k.indexOf(b[a])){b=h.location.search;for(a=0;a<t.length;a++)if(0<=b.indexOf(t[a]))return!0;return!1}return!0};
return{commonAPI:{$window:m,prefix:"p-prod-tile",resultsContainer:n,ajaxTriggeringOffset:1200,ajaxUrls:p,formUrls:{addToCartUrl:"/gp/pantry/actions/add-items.html",cdListUrl:"/gp/pantry/yourlists"},tileTypes:{CDLIST:"cdlist",LIST:"list",SIMILAR_ITEM:"similarItem",CAROUSEL:"carousel",MOBILE_LIST:"mobile-list",MOBILE_CDLIST:"mobile-cdlist"},atcModes:{SINGLE:"single",MULTI:"multi"},popoverFeatures:{"default":{timeout:5E3},minimumOrderValue:{timeout:1E4},inlineUpsell:{timeout:15E3}},ajaxAddToCartUrl:"/gp/pantry/ajax/product/add-to-cart.html",
formAddToCartUrl:"/gp/pantry/actions/add-items.html",miniDpaddToCartUrl:"/gp/pantry/ajax/product/add-to-cart-mini-dp.html",dpAddToCartURL:"/gp/pantry/ajax/product/add-to-cart-dp.html",elementTopAboveWindowBottom:function(a,b){a=f(a).offset().top;var c=m.scrollTop()+m.height();b&&(a+=b);return a<=c},elementTopBelowWindowTop:function(a,b){a=f(a).offset().top;var c=m.scrollTop();b&&(a+=b);return a>=c},updateNavCartCount:function(a){a&&h.$Nav&&h.$Nav.when("api.setCartCount").run(function(b){b(a)})},getItemContainersByAsin:q,
getItemContainerByElement:function(a,b){return f(a).closest(l.itemContainer)},getItemContainerType:w,getItemContainerAsin:function(a){a=f(a).attr("class").split(/\s+/);for(var b=0;b<a.length;b++){var c=a[b];if(-1!==c.indexOf("p-prod-tile-asin-"))return c.substring(17)}},roundToDecimal:function(a,b){return+parseFloat(a).toFixed(b)||0},createParamsForAjaxHandler:e,extendParamsForAjaxHandler:function(a,b,c,k){b=e(b,c,k);b.isAddAnother=a;return b},updateUrlParameters:function(a,b){c.each(b,function(b,
c){var e=new RegExp("([?\x26])"+c+"\x3d[^\x26#]*");a=a.match(e)?a.replace(e,"$1"+c+"\x3d"+b):a+((-1===a.indexOf("?")?"?":"\x26")+c+"\x3d"+b)});return a},submitToFormHandler:function(a){var b={"submit.addToCart":"addToCart",ref_:"p_prod_tile_atc_form"},e=f('\x3cform action\x3d"/gp/pantry/actions/add-items.html" method\x3d"POST"\x3e\x3c/form\x3e'),k=1;c.each(a,function(a,c){b["offeringID."+k]=a.offeringId;b["pantryRegion."+k]=a.pantryRegion;b["quantity."+k]=a.quantity;b["asin."+k]=c;b["session-id"]=
a.sessionId;b["anti-csrftoken-a2z"]=a.csrftoken;k++});c.each(b,function(a,b){e.append(f('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});n.append(e);e.submit()},disableCDListActions:function(a){var b=u.getSelect(a.find(l.itemCDListMoveToSelect));b&&b.update({status:"disabled"});(a=v(a.find(l.itemCDListDeleteButton)))&&a.disable()},enableCDListActions:function(a){var b=u.getSelect(a.find(l.itemCDListMoveToSelect));b&&b.update({status:"normal"});(a=v(a.find(l.itemCDListDeleteButton)))&&a.enable()},
getTileTypesByAsin:function(a){var b={};q(a).each(function(a,c){a=w(c);b[a]=!0});var e=[];c.each(b,function(a,b){e.push(b)});return e},getString:function(a){return x[a]},addATCHanlder:function(a){c.on("pantryTileItemATCSuccess",a)},logCXVersionError:function(a){c.post(p.cxVersionErrorMetricUrl,{cache:!1,params:{tileType:a}})},showCPIWidget:function(){d.when("pantry-cpi-mobile-message-provider").execute(function(a){g()&&a.showCPIWidget()})},isValidUrlForCPI:g,getActionUrl:function(a,b,e){return a+
"?"+c.$.param({ref_:b,"discoveredAsins.0":e})}},selectors:l,controlClasses:{itemZero:"p-prod-tile-zero",atcExecuting:"p-prod-tile-atc-executing",atcSuccess:"p-prod-tile-atc-success",inuSuccess:"p-prod-tile-inu-success",cdListExecuting:"p-prod-tile-cdlist-executing",cdListDeleteSuccess:"p-prod-tile-cdlist-delete-success",cdListActionError:"p-prod-tile-cdlist-action-error",cdListUndoingDelete:"p-prod-tile-cdlist-undoing-delete",cdListUndoError:"p-prod-tile-cdlist-delete-undo-error",cdListMoveSuccess:"p-prod-tile-cdlist-move-success",
aoosViewSimilarToggle:"p-prod-tile-aoos-view-similar-toggle",aoosCollapsed:"p-prod-tile-aoos-collapsed",aoosExpanded:"p-prod-tile-aoos-expanded",aoosSlidedOut:"p-prod-tile-aoos-slidedOut",aoosExecuting:"p-prod-tile-aoos-executing",aoosSuccess:"p-prod-tile-aoos-success"}}});"use strict";d.when("A","enable-pantry-common-utils-asset").register("pantry-product-tile-metrics",function(c){return{addCounter:function(c){var d=h.ue;"undefined"!==typeof d&&d.count(c,1)}}});"use strict";d.when("A","pantry-product-tile-utils",
"pantry-product-tile-atc-base","a-popover","enable-pantry-common-utils-asset","ready").execute(function(c,d,h,f){var m=c.$,l=m("body");c.declarative("mini-dp-sims-select","click",function(c){c.$currentTarget.parent().find("img").removeClass("current");c.$target.addClass("current");var e=c.data;c=e.asin;var e=e.primaryAsin,d=document.getElementsByClassName("p-prod-tile-mini-dp-details-row-primary-"+e),g=document.getElementsByClassName("p-prod-tile-mini-dp-details-"+e+"-"+c),d=d[0],g=g[0];m(".p-prod-tile-mini-dp-box-fill-confirmation-"+
e+"-"+c).removeClass("p-prod-tile-mini-dp-percent-section-show");d.innerHTML=g.innerHTML});var n=function(h){var e={"submit.addToCart":"addToCart",ref_:"p-mini-dp-form"},f=m('\x3cform action\x3d"'+d.formAddToCartUrl+'" method\x3d"POST"\x3e\x3c/form\x3e'),g=1;c.each(h,function(a,b){e["offeringID."+g]=a.offeringId;e["pantryRegion."+g]=a.pantryRegion;e["quantity."+g]=a.quantity;e["asin."+g]=b;e["session-id"]=a.sessionId;g++});c.each(e,function(a,b){f.append(m('\x3cinput type\x3d"hidden"\x3e').attr({name:b,
value:a}))});l.append(f);f.submit()},p=function(d){var e={ref_:"p-mini-dp"};c.each(d,function(d,g){c.each(d,function(a,b){"sessionId"===b?e[b]=a:e[g+"."+b]=a})});return e},q=function(c){n(c)};c.declarative("p-prod-tile-mini-dp-atc","click",function(f){var e=f.data,l=f.$target.closest("form");d.getItemContainerByElement(l);var g=e.asin,a={};f.$event.preventDefault();e.quantity=1;a[g]=e;c.post(d.miniDpaddToCartUrl,{params:p(a),success:function(b){var c=b.pantryBox,e=b.cartCount,f=b.itemMessagings,l=
b.wayfinderBoxHtml,p=b.enableWayfinderSavingInfo,q=b.pantrySavingInfo,r=b.wayfinderSavingHtml;!b.error&&c&&e&&l?(b=".p-prod-tile-mini-dp-atc-confirm-"+a[g].primaryAsin+"-"+g,p?h.updateWayfinderSavingInfo(q,r):h.updateWayfinder(c,l),d.updateNavCartCount(e),m(b).addClass("p-prod-tile-mini-dp-atc-confirm-success"),c=".p-prod-tile-mini-dp-box-fill-confirmation-"+a[g].primaryAsin+"-"+g,f=f[g],m(c).html(f),m(c).addClass("p-prod-tile-mini-dp-percent-section-show")):n(a)},error:function(){"undefined"!==typeof q&&
n(a)}})})});"use strict";d.when("A","pantry-product-tile-utils","enable-pantry-common-utils-asset","ready").execute(function(c,d){var h=c.$,f=d.prefix;c.declarative(f+"-similar-pagination","click",function(d){var l=function(c){c=h(c);p.empty().append(c);p.css("opacity",1)},n=d.$target.closest("li"),p=n.closest(".a-pagination").closest("."+f+"-popover-content");d.$event.preventDefault();d.$event.stopPropagation();n.hasClass("a-disabled")||n.hasClass("a-selected")||(d=n.find("a").attr("href"),p.css("opacity",
.5),c.get(d,{success:l}));return!1})});"use strict";d.when("A","pantry-product-tile-common-utils","enable-pantry-common-utils-asset","ready").register("pantry-product-tile-utils",function(c,d){return c.$.extend({selectors:d.selectors,controlClasses:d.controlClasses},d.commonAPI)});"use strict";d.when("A").execute("pantry-enable-pantry-common-utils-asset-gate",function(c){d.declare("enable-pantry-common-utils-asset",!0)})});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,q=e._namespace||e.attributeErrors,a=q?q("PantryDetailPageATCAssets",""):e;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,e,q){g.when("A","a-button","inlinue-upsell-util","pantry-inu-atc-base","atf").execute(function(a,e,h,f){var l=0;g.when("pantry-wayfinder-cpi-util").execute(function(a){l=a.shouldUpdateCPI()});var m=function(){g.when("pantry-wayfinder-cpi-util").execute(function(a){a.updateCPI()})},n=function(d){var c=
{ref_:h.refTag};f.isRecommendationVisible()||(c.sendUpsellRecommendations=1);c.triggerINUWeblab=1;a.each(d,function(b,d){a.each(b,function(b,a){"session-id"===a||"sessionId"===a||"verificationSessionID"===a?c.sessionId=b:"refTag"===a?c.ref_=b:c[d+"."+a]=b})});return c},p=function(d){var c={};a.each(d.serializeArray(),function(b){"ASIN"===b.name||"a"===b.name?c.asin=b.value:"quantity"===b.name?(b=parseInt(b.value,10),isNaN(b)&&(b=1),c.quantity=b):"offerListingID"===b.name||"oid"===b.name?c.offeringId=
b.value:c[b.name]=b.value});d={};d[c.asin]=c;return n(d)},k=function(d){a.$("form#addToCart").unbind("submit").submit()};a.declarative("pantry-inu-click","click",function(a){var c=a.data.ref.substring(a.data.ref.lastIndexOf("ref\x3d")+4,a.data.ref.lastIndexOf("?"));f.logINUNexusMessage("click",c,a.data.text)});h.initATCHandler(function(d){a.trigger("pantryAtcClick",d);a.$("#pantryInlineUpsellWrapper");d.preventDefault();d=a.$(this);var c=e("#submit\\.add-to-cart");c.disable();a.ajax(h.getActionUrl(h.dpAddToCartURL,
h.refTag,h.getASIN()),{method:d.attr("method"),cache:!1,params:p(d),success:function(b){var d=b.cartCount,r=b.enableInlineUpsell;!b.error&&d&&r&&(f.isRecommendationVisible()||b.upsellRecommendations)?(f.showConfirmation(),f.showRecommendation(b.upsellRecommendations,b.enableNexusLog),f.updateNavbarCartCount(d),f.updateFreeShipping(),l&&m(),h.successHandler(b),a.trigger("pantryAtcSuccess",b)):k(b);c.enable()},error:function(a){c.enable();k(a)}})})});"use strict";g.when("A","pantry-product-tile-common-utils",
"atf","pantry-page","enable-pantry-dp-atc-asset").register("inlinue-upsell-util",function(a,e){return a.$.extend({refTag:"pantry_dp_bb_inu",getASIN:function(){return a.$("#ASIN").val()},successHandler:function(h){var f=a.$("#wayfinder-message-provider-wrapper"),e=a.$(".pantry-wayfinder-sticky-bar");!f.length&&e.length&&a.$("html, body").animate({scrollTop:a.$("#addToCart").offset().top-e.height()-18},1E3);g.when("pantry-wayfinder-box-info").execute(function(a){a.setBoxInfo(h.pantryBox);a.updateBoxDisplay(h.wayfinderBoxHtml)})},
initATCHandler:function(e){a.ajax("/gp/pantry/cart/json?nextPage\x3dgetActivePantryCartQuantity",{method:"GET",success:function(f){0<f.getActivePantryCartQuantity&&a.$("form#addToCart").unbind("submit").submit(e)}})}},e.commonAPI)});"use strict";g.when("A","a-button","inlinue-upsell-util","atf").register("pantry-inu-atc-base",function(a,g,h){var f=function(){return a.$("#pantryInlineUpsellWrapper").is(":visible")},l=function(a,b,d,e){b<d&&a.clone().appendTo(".inu-list");a.html(e.textToShow);a.attr("href",
e.URL);a.attr("title",e.textToShow)},m=function(a,b,d,e,f){d<e&&(b.clone().appendTo(".inu-list"),a.clone().appendTo(".inu-list"));e={ref:f.URL,text:f.textToShow};b.attr("data-action","pantry-inu-click");b.attr("data-pantry-inu-click",JSON.stringify(e));b.attr("id","pantry-inu-click-"+d);a.appendTo(b.find("#pantry-inu-link"));a.html(f.textToShow);a.attr("href",f.URL);a.attr("title",f.textToShow)},n=0,p=function(c,b,d){n&&(c={pageType:"Detail",subPageType:"InlineUpsell",eventData:JSON.stringify({pageType:"Detail",
pageWidget:"InlineUpsell",uiAction:c,itemDescription:b,advertisementId:d})},a.post("/gp/pantry/ajax/log-nexus-message.html",{params:c}))},k=function(a,b,d){e.ueLogError&&e.ueLogError(a,{logLevel:"ERROR",attribution:b,message:d})},d=function(c,b){if(!f()){var d=h.getASIN(),e=a.$("#pantry-inu-action"),g=a.$(".inu-item");c=c[d];var k=c.length-1;a.$.each(c,function(c,d){1===b&&null!==e?(m(g,e,c,k,d),e=a.$("#pantry-inu-action:last")):l(g,c,k,d);g=a.$(".inu-item:last")});n=b;p("PageUpdate",d,"");a.$("#pantryInlineUpsellWrapper").slideDown()}};
return{updateNavbarCartCount:function(a){a&&e.$Nav&&e.$Nav.when("api.setCartCount").run(function(b){b(a)})},updateFreeShipping:function(){a.ajax("/gp/pantry/wayfinder/free-shipping-promo-bar.html",{cache:!1,method:"get",success:function(c){c.trim()&&a.$("#pantry-wayfinder-free-shipping-promo-bar").html(c)}})},isRecommendationVisible:f,appendRecommendation:l,appendRecommendationWithAction:m,logINUNexusMessage:p,showRecommendation:function(a,b){try{d(a,b)}catch(e){k(e,"PantryInlineUpsell","Show recommendation failed on Desktop or Mobile DP:")}},
showConfirmation:function(){var c=a.$("#pantry-inu-confirmation");c&&c.show()},logError:k,doShowRecommendation:d}});"use strict";g.when("A","atf").execute("pantry-enable-pantry-dp-atc-asset-gate",function(a){g.declare("enable-pantry-dp-atc-asset",!0)})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("PantryDetailPageCommonAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","atf").execute("pantry-page-detector",function(a){(a.$("#pantryStoreInfo_feature_div").text()||a.$("#pantryBuyBox_feature_div").length||a.$(".a-declarative[data-action\x3d'aw-mash-pantry']").length)&&b.declare("pantry-page",!0)})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageQuantityAwarePriceAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageVoltageComplianceAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DetailPageSellerProfileDesktopAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when().register("seller-profile-treatment",function(){return"C"})});
/* ******** */
(function(a){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,c=d?d("DetailPageAToZGuaranteeAssets",""):b;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,b,d){a.when("A").register("atoz-csm-counters",function(c){var a=function(a){return ue.count(a)||0},b=function(a,b){ue.count(a,b)};return{getCounter:a,setCounter:b,incrementCounter:function(c,d){d=d||1;b(c,a(c)+d)}}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DetailPageInteractiveBadgesAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when().register("interactive-badges-treatment",function(){return"C"})});
/* ******** */
(function(a){var f=window.AmazonUIPageJS||window.P,k=f._namespace||f.attributeErrors,b=k?k("WestlakeAssets",""):f;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,f,k){a.when("A").register("alw-asin-impression",function(b){var a={};b.on("skycity-image-loaded",function(){for(var e=document.getElementsByClassName("skycity-alw-item-container"),h=[],c=e.length,d=0;d<c;d++){var g=e[d].getElementsByClassName("a-link-normal");0<g.length&&"undefined"!==typeof g[0].href&&
(g=g[0].href.split("/dp/")[1].split("/")[0],10===g.length&&g===g.toUpperCase()&&h.push(g))}if(0<h.length&&f.ue){e=[];for(c=0;c<h.length;c++)d=h[c],"undefined"===typeof a[d]&&(e.push({id:d}),a[d]=!0);0<e.length&&(f.ue.impression({programGroup:"brightbuy",impressionType:"asin",impressionData:[{featureName:"alw-dt",resources:e}],foresterChannel:"action-impressions"}),b.trigger("skycity-asin-impression-sent"))}})});"use strict";a.when("A","jQuery").register("alw-delay-load-images",function(b,f){function e(){if(null!==
document.getElementById("skycity-soft-merge"))for(var a=document.querySelectorAll(".skycity-image-html"),c=0;c<a.length;c++){var d=f(a[c]);d.hasClass("skycity-image-loaded")||(a[c].insertAdjacentHTML("afterend",a[c].getAttribute("data-html")),d.addClass("skycity-image-loaded"))}b.trigger("skycity-image-loaded")}b.on("a:pageUpdate",e);a.when("atf").execute("alw-load-images",e)})});
/* ******** */
(function(p){var t=window.AmazonUIPageJS||window.P,C=t._namespace||t.attributeErrors,m=C?C("DetailPageHomeInnovationAssets",""):t;m.guardFatal?m.guardFatal(p)(m,window):m.execute(function(){p(m,window)})})(function(p,t,C){p.when("A").register("hit-common",function(m){var a=m.$;return{find:function(a,h){if(!Array.isArray(a))return null;if("function"!==typeof h)throw new TypeError("predicate must be a function");for(var f=0;f<a.length;f++)if(h(a[f]))return a[f];return null},id:function(a){return"#"+
a},isPresent:function(e){return e?0!==a("#"+e).length:!1},getDevice:function(){return m.capabilities?m.capabilities.isAmazonApp?"AmazonApp":m.capabilities.mobile?"mobile":m.capabilities.tablet?"tablet":"desktop":""},getUserAgent:function(){return navigator?navigator.userAgent:""},balanceArrays:function(a,h,f){var b=Math.max(f-h.length,f/2);f=Math.max(f-a.length,f/2);return a.slice(0,b).concat(h.slice(0,f))}}});"use strict";p.when("jQuery","showroom-atf-metrics").register("atf-ajax-helper",function(m,
a){function e(k){if(k)if(h(k)){if(k.onStart)k.onStart();try{var d=new Date;m.ajax({type:k.ajaxConfig.type,url:k.ajaxConfig.endpoint,data:k.ajaxConfig.data,contentType:"application/json",dataType:"json",success:function(c){b(k,d);a.addOne(k.metricNames.ajaxSuccessHandler);a.logShowroomAtfEvent(k.event,a.STATUS_TYPES.SUCCESS);k.successHandler&&k.successHandler(k.event,c)},error:function(c,l,g){b(k,d);a.addOne(k.metricNames.ajaxErrorHandler);500===c.status?(a.logShowroomAtfEvent(k.event,a.STATUS_TYPES.ERROR),
k.triedCount++,a.addOne(k.metricNames.retry),k.triedCount<k.ajaxConfig.maxRetries?e(k):(a.addOne(k.metricNames.maxRetries),f(k))):f(k)}})}catch(l){a.addOne(k.metricNames.unexpectedError),a.logShowroomAtfEvent(k.event,a.STATUS_TYPES.ERROR),f(k)}}else k.metricNames&&k.metricNames.invalidRequest&&a.addOne(k.metricNames.invalidRequest),f(k)}function h(a){var d=a.ajaxConfig;if(!d||"object"!==typeof d||!d.endpoint||"string"!==typeof d.endpoint||!d.maxRetries||"number"!==typeof d.maxRetries||0>d.maxRetries||
!d.type||"string"!==typeof d.type||"number"!==typeof a.triedCount||0>a.triedCount||!a.errorHandler||"function"!==typeof a.errorHandler||!a.event||"object"!==typeof a.event)return!1;var b;a:if((d=a.metricNames)&&"object"===typeof d){for(b in g)if(!d.hasOwnProperty(g[b])){b=!1;break a}b=!0}else b=!1;return!b||a.onStart&&"function"!==typeof a.onStart||a.onEnd&&"function"!==typeof a.onEnd||!a.successHandler||"function"!==typeof a.successHandler?!1:!0}function f(b){a.logShowroomAtfEvent(b.event,a.STATUS_TYPES.ERROR);
b.errorHandler&&b.errorHandler(b.event);b.metricNames&&b.metricNames.requestErrorHandler&&a.addOne(b.metricNames.requestErrorHandler)}function b(b,d){a.logValue(b.metricNames.latency,new Date-d);if(b.onEnd)b.onEnd()}var g="ajaxErrorHandler ajaxSuccessHandler invalidRequest latency maxRetries requestErrorHandler retry unexpectedError".split(" ");return{DefaultAjaxRequest:function(){this.ajaxConfig={data:{},endpoint:"",maxRetries:0,type:""};this.errorHandler=function(){};this.event=null;this.metricNames=
{ajaxErrorHandler:"",ajaxSuccessHandler:"",invalidRequest:"",latency:"",maxRetries:"",requestErrorHandler:"",retry:"",unexpectedError:""};this.onEnd=function(){};this.onStart=function(){};this.successHandler=function(){};this.triedCount=0},executeAjax:e}});"use strict";p.when("jQuery","showroom-atf-data-helper","showroom-atf-metrics").register("ingress-collection",function(m,a,e){function h(a,b){d=a;b&&b()}function f(c){0<c.triedCount&&e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_REQUEST_RETRY);
var n=a.createIngressKeyWithParams(c.asin,c.stageId);h(n,c.onStart);var v=e.createShowroomAtfEvent(c.stageId,c.asin,e.EVENT_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_COLLECTION,new Date);try{var q=new Date;m.ajax({type:"GET",url:g.ingressCollectionEndpoint,data:{asin:c.asin,stageId:c.stageId},contentType:"application/json",dataType:"json",success:function(d,g,l){a.isValidIngressCollection(d)?(k[n]=d,c.successHandler&&c.successHandler(d,c.event),e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_REQUEST_SUCCESS),
e.logShowroomAtfEvent(v,e.STATUS_TYPES.SUCCESS)):(b(c.errorHandler,c.event),e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_INGRESS_COLLECTION))},error:function(a,d,k){switch(a.status){case 400:case 403:case 404:l.push(n);b(c.errorHandler,c.event);break;case 500:c.triedCount++;c.triedCount<g.maxTries?f(c):(b(c.errorHandler,c.event),e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_RETRIES));break;default:b(c.errorHandler,c.event)}e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_HTTP);
e.logShowroomAtfEvent(v,e.STATUS_TYPES.ERROR)},complete:function(){var a=c.onEnd;n===d&&(d=null,a&&a());e.logValue(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_LATENCY,new Date-q)}})}catch(w){b(c.errorHandler,c.event),n===d&&(d=null),e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_EXCEPTION),e.logShowroomAtfEvent(c.event,e.STATUS_TYPES.ERROR)}}function b(a,d){"function"===typeof a&&a(d);e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR)}var g={ingressCollectionEndpoint:"/showroom/ingressPrecompute",
maxTries:3},k={},d=null,l=[];return{getIngressCollection:function(c){try{if(!c||0!==c.triedCount||!c.asin||"string"!==typeof c.asin||!c.stageId||"string"!==typeof c.stageId||c.successHandler&&"function"!==typeof c.successHandler||c.errorHandler&&"function"!==typeof c.errorHandler||c.onStart&&"function"!==typeof c.onStart||c.onEnd&&"function"!==typeof c.onEnd||c.event&&"object"!==typeof c.event)b(c.errorHandler,c.event),e.addOne(e.COUNTER_NAMES.SHOWROOM_WEBSITE_COLLECTION_GET_INGRESS_ERROR_INPUTS);
else{var g=a.createIngressKeyWithParams(c.asin,c.stageId),v=k[g];a.isValidIngressCollection(v)?c.successHandler&&(c.event&&delete c.event._startTime,c.successHandler(v,c.event)):g!==d&&(-1<l.indexOf(g)?b(c.errorHandler,c.event):f(c))}}catch(h){}},getExistingCollection:function(c,d){try{var b;var e=a.createIngressKeyWithParams(c,d),g=k[e];b=a.isValidIngressCollection(g)?g:null;return b}catch(l){return null}},IngressCollectionRequest:function(a,d,b,e,g,k,l){this.asin=a;this.stageId=d;this.successHandler=
b;this.errorHandler=e;this.onStart=g;this.onEnd=k;this.triedCount=0;this.event=l;return this}}});"use strict";p.when("jQuery","showroom-atf-metrics","atf-ajax-helper").register("atf-ingress-thumbnails",function(m,a,e){return{IngressThumbnailsRequest:function(h,f,b,g){e.DefaultAjaxRequest.call(this);this.ajaxConfig={data:{asin:h},endpoint:"/showroom/ingressThumbnails",maxRetries:3,type:"GET"};this.asin=h;this.errorHandler=g;this.event=a.createShowroomAtfEvent(f,h,a.EVENT_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS,
new Date);this.metricNames={ajaxErrorHandler:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_AJAX_ERROR,ajaxSuccessHandler:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_SUCCESS,invalidRequest:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_INVALID_REQUEST,latency:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_LATENCY,maxRetries:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_MAX_RETRIES,requestErrorHandler:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_REQUEST_ERROR,
retry:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_RETRY,unexpectedError:a.COUNTER_NAMES.SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_UNEXPECTED_ERROR};this.stageId=f;this.successHandler=b;return this},getIngressThumbnails:function(a){e.executeAjax(a)}}});"use strict";p.when("A","hit-common","showroom-atf-data-helper","showroom-atf-constants").register("showroom-atf-background-items-rendering",function(m,a,e,h){var f=m.$;return{renderOptionThumbnails:function(b,g,k,d,l){if(g&&k&&Array.isArray(b)){g=
f(a.id(g));g.empty();for(var c=0;c<b.length;c++){var n=b[c],v=e.getMainImage(n),q=e.getThumbImage(n);if(v&&q){var w=-1<d.indexOf(v.physicalId),A=v,p=w,x=k,v=l,w=f("\x3clabel/\x3e"),A=A.physicalId;f("\x3cinput type\x3d'radio'/\x3e").attr("name",x).attr("value",A).prop("checked",p).appendTo(w);q=v+"/"+q.physicalId+"."+q.extension;f("\x3cimg/\x3e").attr("src",q).addClass("iv-showroom-bg-image").appendTo(w);q=w;m.declarative.create(q,h.DECLARATIVES.BACKGROUND_SELECT,n);q.appendTo(g)}}}}}});"use strict";
p.when("A","showroom-atf-data-helper","showroom-atf-metrics").register("showroom-atf-collage",function(m,a,e){function h(a,d){return a.depthIndex-d.depthIndex}function f(b){for(var d=[],e=0;e<b.length;e++){var c=a.getMainImage(b[e]);c&&d.push(c.physicalId)}return d}function b(a,b,l,c){var n=a.physicalId,v=a.width;a=a.height;b=b.sort(h);b=f(b);l=l.sort(h);l=f(l);e.addOne(e.COUNTER_NAMES.COLLAGE_METHOD_INGRESS_COLLECTION);l=b.concat(l);n=n+"._CLa|"+v+","+a;l=g(l,"png");b=l.length+1;for(var q="",m=0;m<
b;m++)q+="0,0,"+v+","+a,m<b-1&&(q+="+");return c+"/"+n+"|"+l+"|"+q+"_.png"}function g(a,b){return a.map(function(a){return a?a+"."+b:null}).filter(function(a){return null!==a})}return{generateCollageUrlV1WithBackgroundPhysicalIds:function(e,d,g){if(!a.isValidIngressCollection(e)||!Array.isArray(d)||!g)return null;d=d.map(function(b){return a.getItemByMainPhysicalId(e.backgroundItems,b)});return b(e.backgroundImage,d,e.items,g)},generateCollageUrlV2WithWallAndFloorPhysicalIds:function(b,d,e,c){if(!a.isValidIngressCollection(b)||
!c)return null;d=a.getItemByMainPhysicalId(b.backgroundItems,d);e=a.getItemByMainPhysicalId(b.backgroundItems,e);var g=b.backgroundImage,f=b.items,m=a.getMainImage(d),w=a.getMainImage(e);b=[];for(var p=[],t=[],x=[],z=f.sort(h),f=0;f<z.length;f++){var y=z[f];y&&y.images&&(y.shouldAttachToRoom?(b.push(a.getItemImage(y)),p.push(a.getShadowImage(y))):(t.push(a.getItemImage(y)),x.push(a.getShadowImage(y))))}c=""+c+"/11fLee27VZL._TSa";c+="|b-src:"+g.physicalId+"."+g.extension;d&&(c+="|w-src:",c+=m.physicalId+
"."+m.extension);e&&(c+="|f-src:",c+=w.physicalId+"."+w.extension);d=Math.min(b.length,5);for(f=0;f<d;f++)b[f]&&p[f]&&(c+="|wfi"+(f+1)+"-src:",c+=b[f].physicalId+"."+b[f].extension,c+="|wfs"+(f+1)+"-src:",c+=p[f].physicalId+"."+p[f].extension);d=Math.min(t.length,20);for(f=0;f<d;f++)t[f]&&x[f]&&(c+="|i"+(f+1)+"-src:",c+=t[f].physicalId+"."+t[f].extension,c+="|s"+(f+1)+"-src:",c+=x[f].physicalId+"."+x[f].extension);c+="_.json";return encodeURI(c)}}});"use strict";p.when("A").register("showroom-atf-constants",
function(m){return{FLOOR_ITEM_CATEGORY:"Floor",WALL_ITEM_CATEGORY:"Wall",WOOD_MATERIAL_LABEL:"Wood",CARPET_MATERIAL_LABEL:"Carpet",THUMB_IMAGE_LABEL:"THUMB",MAIN_IMAGE_LABEL:"MAIN",ITEM_IMAGE_LABEL:"ITEM",SHADOW_IMAGE_LABEL:"SHADOW",ROOM_OPTION_GROUP_NAME:"room-options",WALL_OPTION_GROUP_NAME:"wall-options",FLOOR_OPTION_GROUP_NAME:"floor-options",SHOWROOM_THUMBNAIL_TYPE:"showroom-image",SHOWROOM_THUMBNAIL_CLASS:"showroom-imageblock-thumbnail",SHOWROOM_THUMBNAIL_INDEX:1,IMAGE_THUMBNAIL_CLASS:".imageThumbnail",
IMAGE_CLICK_EVENT_NAME:"imageClick",SHOWROOM_INGRESS_TYPE:"showroomIngress",SHOWROOM_INGRESS_CLICK_ACTION_NAME:"showroomIngressClick",INGRESS_TYPE:"ingress",SHOWROOM_DECLARATIVE_IMAGE_ACTION:"showroom-image-action",SWATCH_HOVER_EVENT_TYPE:"swatchHover",SHOWROOM_MAIN_IMAGE_TYPE:"showroom-main-image",TWISTER_DATA_EVENT:"showroomTwisterData",MOUSE_ENTER_EVENT_TYPE:"mouseenter",SELECTOR:{id:{backgroundOptions:"ivShowroomOptionsSection",backgroundOptionsSpinner:"ivShowroomBackgroundOptionsSpinner",callToAction:"ivShowroomImmersiveViewCallToAction",
collageFailure:"ivShowroomCollageFailure",collageImage:"ivCollageShowroom",collageSpinner:"ivShowroomCollageSpinner",errorCallToAction:"ivShowroomImmersiveViewErrorCallToAction",failureError:"ivShowroomFailure",floorOptions:"ivFloorOptionsShowroom",hoverCollageImage:"ivHoverCollageShowroom",ingressLink:"ivIngressLinkShowroom",largeShowroomDiv:"ivLargeShowroom",mainShowroom:"ivMainShowroom",optionsSection:"ivShowroomOptionsSection",roomOptionsDiv:"ivRoomOptionsShowroom",showroomTab:"ivShowroomTab",
switchRoomsSection:"ivShowroomSwitchRoomsSection",wallOptionsDiv:"ivWallOptionsShowroom"},classes:{hidden:"aok-hidden"}},STRING_IDS:{floorTypeSubheading:"showroom_dp_imageblock_atf_floor_type_subheading",switchRoomsTitle:"showroom_dp_imageblock_atf_switch_rooms_title",wallTypeSubheading:"showroom_dp_imageblock_atf_wall_type_subheading",woodtypeSubheading:"showroom_dp_imageblock_atf_wood_type_subheading"},DECLARATIVES:{BACKGROUND_SELECT:"background-select",EGRESS_TO_SHOWROOM:"srm-egress-to-showroom",
SWITCH_ROOMS_THUMBNAIL:"switch-rooms-thumbnail",SWITCH_ROOMS_OPTIONS:"switch-room-options"}}});"use strict";p.when("A","showroom-atf-constants","hit-common").register("showroom-atf-data-helper",function(m,a,e){function h(f){return f?e.find(f.images,function(b){return b.type===a.MAIN_IMAGE_LABEL}):null}return{getMainImage:h,getItemImage:function(f){return f?e.find(f.images,function(b){return b.type===a.ITEM_IMAGE_LABEL}):null},getShadowImage:function(f){return f?e.find(f.images,function(b){return b.type===
a.SHADOW_IMAGE_LABEL}):null},getThumbImage:function(f){return f?e.find(f.images,function(b){return b.type===a.THUMB_IMAGE_LABEL}):null},getWallItems:function(e){return e.filter(function(b){return b.itemCategory===a.WALL_ITEM_CATEGORY})},getWoodFloorItems:function(e){return e.filter(function(b){return b.itemCategory===a.FLOOR_ITEM_CATEGORY&&b.material===a.WOOD_MATERIAL_LABEL})},getCarpetFloorItems:function(e){return e.filter(function(b){return b.itemCategory===a.FLOOR_ITEM_CATEGORY&&b.material===a.CARPET_MATERIAL_LABEL})},
getItemByMainPhysicalId:function(a,b){return a&&b?e.find(a,function(a){return(a=h(a))?a.physicalId===b:!1}):null},createIngressKeyWithParams:function(a,b){return a+":"+b},isValidIngressCollection:function(a){return a&&a.stageId&&!m.objectIsEmpty(a.backgroundImage)&&Array.isArray(a.items)&&Array.isArray(a.backgroundItems)?!0:!1}}});"use strict";p.when("A","jQuery","imageBlockUtils","showroom-atf-constants","hit-common","showroom-atf-metrics").register("showroom-imageblock-detail-page-rendering",function(m,
a,e,h,f,b){function g(a){b.addOne(b.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_MAIN_IMAGE_SELECT);var e=b.createShowroomAtfEvent(c,d,b.EVENT_NAMES.IMAGEBLOCK_MAIN_IMAGE_CLICK);b.logShowroomAtfEvent(e,b.STATUS_TYPES.SUCCESS);k(a)}function k(a){a.action=h.SHOWROOM_INGRESS_CLICK_ACTION_NAME;a.data=n;l.dispatch(h.SHOWROOM_INGRESS_CLICK_ACTION_NAME,a)}var d,l,c,n;return{createThumbnail:function(b,c,d){n={type:h.SHOWROOM_INGRESS_TYPE,index:0,thumbnailIndex:c,variant:d.variant};e.createThumbnail({type:h.SHOWROOM_THUMBNAIL_TYPE,
index:0,thumbnailIndex:c,variant:d.variant},d.thumb,b,h.SHOWROOM_THUMBNAIL_CLASS);d=h.SHOWROOM_THUMBNAIL_CLASS;c=a(".pos-360.item");d=b.children("."+d);var g=b.children(":visible").length;1===c.length?(d.insertBefore(c),c=g-1):(d.appendTo(b),c=g);return c},updateMainImage:function(b,c){var d=b.find("#showroom-main-image");d.length?d.attr("src",c.hiRes):(d=a("\x3cimg/\x3e").attr("src",c.hiRes).attr("id","showroom-main-image"),d.appendTo(b),m.declarative.create(b,h.SHOWROOM_DECLARATIVE_IMAGE_ACTION,
n),m.declarative(h.SHOWROOM_DECLARATIVE_IMAGE_ACTION,["click"],g))},hideShowroomMainImage:function(b){a(f.id("image-canvas-caption")).removeClass("aok-hidden");b.parent().css("z-index",-1);b.parent().addClass("aok-hidden")},showShowroomMainImage:function(b){a(f.id("image-canvas-caption")).addClass("aok-hidden");b.parent().css("z-index",2);b.parent().removeClass("aok-hidden")},mainImageIsHidden:function(){return!a(f.id("image-canvas-caption")).hasClass("aok-hidden")},handleShowroomIngressClick:k,handleShowroomThumbnailClick:function(a){b.addOne(b.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_THUMBNAIL_SELECT);
var e=b.createShowroomAtfEvent(c,d,b.EVENT_NAMES.IMAGEBLOCK_THUMBNAIL_CLICK);b.logShowroomAtfEvent(e,b.STATUS_TYPES.SUCCESS);k(a)},handleShowroomMainImageClick:g,refresh:function(a,b,e){l=a;d=b;c=e}}});"use strict";p.when("A","showroom-atf-constants","showroom-atf-metrics").register("showroom-lite-atf-feature-data",function(m,a,e){function h(a){return a in f}var f={};return{setData:function(b){b&&b.asin&&b.imageDomain&&b.defaultCollageUrl&&b.defaultStageId&&Array.isArray(b.itemMainImagePhysicalIds)&&
!h(b.asin)&&(f[b.asin]=b,m.trigger(a.TWISTER_DATA_EVENT,b.asin))},getDataForAsin:function(a){return f[a]},isDataValidForAsin:h}});"use strict";p.when("A","jQuery","imageBlockUtils","imageBlockImmersiveViewUtils","showroom-immersive-view-tab","showroom-lite-atf-feature-data","showroom-imageblock-detail-page-rendering","showroom-atf-constants","hit-common","showroom-atf-metrics").register("ImageBlockImmersiveViewShowroom",function(m,a,e,h,f,b,g,k,d,l){function c(a){a=q.colorToAsin[a.color].asin;a||
(a=q.mediaAsin);return a}function n(){f.onTabSelect(b.getDataForAsin(c(w.getCurrentItem())))}var p,q,w,t,D,x,z;return function(f,E,C,G){p=this;q=f;w=E;t=G;m.on(k.TWISTER_DATA_EVENT,function(a){c(w.getCurrentItem())===a&&(a={type:"updatedData",data:w.getCurrentItem()},t.dispatch("updateView",a))});p.render=function(e,f,h,k,m,n){D=k;x=m.find(d.id("main-showroom-container"));x.parent().find(d.id("showroom-canvas-caption"));a(d.id("main-image-container"));try{var q=c(w.getCurrentItem());if(b.isDataValidForAsin(q)){var p=
b.getDataForAsin(q);g.refresh(t,p.asin,p.defaultStageId);n||g.updateMainImage(x,p.imageData,t);f=g.createThumbnail(k,f,p.imageData);a("#ivShowroomTabHeading").removeClass("aok-hidden");if(q!==z){l.addOne(l.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_FEATURE_RENDERED);var v=l.createShowroomAtfEvent(p.defaultStageId,q,l.EVENT_NAMES.IMAGEBLOCK_LOAD);l.logShowroomAtfEvent(v,l.STATUS_TYPES.SUCCESS);z=q}}else a("#ivShowroomTabHeading").addClass("aok-hidden")}catch(y){a("#ivShowroomTabHeading").addClass("aok-hidden")}return f};
p.update=function(a){try{var d=a.data;w.setCurrentEvent(a);if(d.type===k.SHOWROOM_THUMBNAIL_TYPE){d.interaction=a.type;d.isUserGenerated=!0;if(b.isDataValidForAsin(c(d))){d.interaction===k.MOUSE_ENTER_EVENT_TYPE&&g.mainImageIsHidden()&&l.addOne(l.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_THUMBNAIL_HOVER);var f=b.getDataForAsin(c(d)).imageData;g.updateMainImage(x,f,t);g.showShowroomMainImage(x)}q.usePeekHover&&"click"!==a.type||(e.selectGivenThumbnail(a.$declarativeParent,D),"click"===a.type&&e.useTabbedImmersiveView(q)&&
g.handleShowroomThumbnailClick(a))}else d.type!==k.SHOWROOM_MAIN_IMAGE_TYPE&&(a.type===k.SWATCH_HOVER_EVENT_TYPE?d.color===w.getCurrentItem().color&&w.getCurrentItem().type===k.SHOWROOM_THUMBNAIL_TYPE?g.showShowroomMainImage(x):g.hideShowroomMainImage(x):g.hideShowroomMainImage(x))}catch(h){console.log(h)}};h.attachTabSelectHandler("ivShowroomTab",n);document.getElementById("ivShowroomTabHeading").addEventListener("click",function(a){l.addOne(l.COUNTER_NAMES.TAB_SELECT);a=b.getDataForAsin(z).defaultStageId;
a=l.createShowroomAtfEvent(a,z,l.EVENT_NAMES.IMMERSIVE_VIEW_TAB_CLICK);l.logShowroomAtfEvent(a,l.STATUS_TYPES.SUCCESS)})}});"use strict";p.when("A","jQuery","hit-common","showroom-atf-collage","showroom-atf-background-items-rendering","showroom-atf-data-helper","showroom-atf-constants","ingress-collection","showroom-atf-metrics","showroom-immersive-view-tab-layout","showroom-atf-switch-rooms-rendering","atf-ingress-thumbnails").register("showroom-immersive-view-tab",function(m,a,e,h,f,b,g,k,d,l,c,
n){function p(c){if(c.asin!==N){var f;try{d.addOne(d.COUNTER_NAMES.INIT);r=c;f=d.createShowroomAtfEvent(r.defaultStageId,r.asin,d.EVENT_NAMES.IMMERSIVE_VIEW_LOAD,new Date);l.initViewLayout(r);a(e.id(g.SELECTOR.id.switchRoomsSection)).addClass(u.classes.hidden);a(e.id(g.SELECTOR.id.collageImage)).hide().fadeIn();O||(m.declarative.create(a(e.id(g.SELECTOR.id.ingressLink)),g.DECLARATIVES.EGRESS_TO_SHOWROOM,{allowLinkDefault:!0}),O=!0);if(P===b.createIngressKeyWithParams(r.asin,r.stageId))return;y(r.defaultCollageUrl,
null,d.COUNTER_NAMES.DEFAULT_COLLAGE_SUCCESS,d.COUNTER_NAMES.DEFAULT_COLLAGE_ERROR);var h=new n.IngressThumbnailsRequest(r.asin,r.defaultStageId,x,z);n.getIngressThumbnails(h);var v=new k.IngressCollectionRequest(r.asin,r.defaultStageId,D,A,q,t,f);k.getIngressCollection(v)}catch(T){d.addOne(d.COUNTER_NAMES.INIT_ERROR_EXCEPTION),d.logShowroomAtfEvent(f,d.STATUS_TYPES.ERROR)}N=c.asin}}function q(){a(e.id(g.SELECTOR.id.backgroundOptions)).addClass(u.classes.hidden);a(e.id(g.SELECTOR.id.callToAction)).addClass(u.classes.hidden);
a(e.id(g.SELECTOR.id.ingressLink)).addClass(u.classes.hidden);a(e.id(g.SELECTOR.id.backgroundOptionsSpinner)).removeClass(u.classes.hidden)}function t(){a(e.id(g.SELECTOR.id.callToAction)).removeClass(u.classes.hidden);a(e.id(g.SELECTOR.id.ingressLink)).removeClass(u.classes.hidden);a(e.id(g.SELECTOR.id.backgroundOptionsSpinner)).addClass(u.classes.hidden)}function A(b){a(e.id(g.SELECTOR.id.backgroundOptions)).addClass(u.classes.hidden);a(e.id(g.SELECTOR.id.failureError)).removeClass(u.classes.hidden);
J("/showroom?"+B.ASIN+"\x3d"+r.asin+"\x26"+B.REF_MARKER+"\x3d"+I.REF_MARKER);d.addOne(d.COUNTER_NAMES.INIT_ERROR_SHOWROOM_WEBSITE);d.logShowroomAtfEvent(b,d.STATUS_TYPES.ERROR)}function D(c,l){if(b.isValidIngressCollection(c)){a(e.id(g.SELECTOR.id.failureError)).addClass(u.classes.hidden);var h=c.backgroundItems,k=r.defaultCollageUrl;a(e.id(g.SELECTOR.id.backgroundOptions)).removeClass(u.classes.hidden);var m=b.getWallItems(h).slice(0,10);f.renderOptionThumbnails(m,g.SELECTOR.id.wallOptionsDiv,g.WALL_OPTION_GROUP_NAME,
k,r.imageDomain);m=b.getWoodFloorItems(h);h=b.getCarpetFloorItems(h);h=e.balanceArrays(m,h,10);f.renderOptionThumbnails(h,g.SELECTOR.id.floorOptions,g.FLOOR_OPTION_GROUP_NAME,k,r.imageDomain);E(c);P=b.createIngressKeyWithParams(r.asin,r.stageId);l&&l._startTime&&d.logValue(d.COUNTER_NAMES.INIT_SUCCESS,new Date-l._startTime);d.logShowroomAtfEvent(l,d.STATUS_TYPES.SUCCESS)}else d.logShowroomAtfEvent(l,d.STATUS_TYPES.ERROR),d.addOne(d.COUNTER_NAMES.INIT_ERROR_INGRESS_COLLECTION)}function x(b,d){var f=
d.slice(0,8);c.renderSwitchRoomThumbnails(f,g.SELECTOR.id.roomOptionsDiv,r.defaultStageId,g.DECLARATIVES.SWITCH_ROOMS_THUMBNAIL);1<d.length&&a(e.id(g.SELECTOR.id.switchRoomsSection)).removeClass(u.classes.hidden)}function z(){a(e.id(g.SELECTOR.id.switchRoomsSection)).addClass(u.classes.hidden);d.addOne(d.COUNTER_NAMES.INIT_SWITCH_ROOMS_ERROR_INGRESS_THUMBNAILS)}function y(b,c,f,h){var l=a(e.id(g.SELECTOR.id.collageImage)),k=l[0];k.onload=function(){a(e.id(g.SELECTOR.id.collageSpinner)).addClass(u.classes.hidden);
a(e.id(g.SELECTOR.id.collageFailure)).addClass(u.classes.hidden);a(e.id(g.SELECTOR.id.collageImage)).removeClass(u.classes.hidden);d.logValue(d.COUNTER_NAMES.COLLAGE_LOAD_SUCCESS_LATENCY,new Date-k._startTime);d.logValue(f,new Date-k._startTime);d.logShowroomAtfEvent(c,d.STATUS_TYPES.SUCCESS)};k.onerror=function(){a(e.id(g.SELECTOR.id.collageSpinner)).addClass(u.classes.hidden);a(e.id(g.SELECTOR.id.collageImage)).addClass(u.classes.hidden);d.logValue(d.COUNTER_NAMES.COLLAGE_LOAD_ERROR_LATENCY,new Date-
k._startTime);H(h,c)};k._startTime=new Date;a(e.id(g.SELECTOR.id.collageSpinner)).removeClass(u.classes.hidden);l.attr("src",b)}function E(a){var b,c=S(a),d=R(a),d=c.concat(d),c={};c[B.ITEM_IDS]=d;c[B.EMPTY_FEATURE_IDS]=a.excludedFPs;c[B.REF_MARKER]=I.REF_MARKER;c[B.ASIN]=r.asin;a=I.SHOWROOM_FULL_RELATIVE_PATH+"?";for(b in c)c.hasOwnProperty(b)&&(a+=b+"\x3d"+c[b]+"\x26");b=encodeURI(a);J(b)}function J(b){a(e.id(g.SELECTOR.id.ingressLink)).removeClass(u.classes.hidden).attr("href",b).attr("target",
"_blank")}function G(a,b){D(a,b);E(a);y(r.defaultCollageUrl,b,d.COUNTER_NAMES.SWAP_COLLAGE_SUCCESS,d.COUNTER_NAMES.SWAP_COLLAGE_ERROR)}function H(b,c){a(e.id(g.SELECTOR.id.collageFailure)).removeClass(u.classes.hidden);d.addOne(b);d.logShowroomAtfEvent(c,d.STATUS_TYPES.ERROR)}function K(b,c){var d=a("#switch-room-"+c+" \x3e img");0<d.length&&d.attr("src",b)}function R(a){return a.items.map(function(a){return a.stageItemId})}function S(a){var c=L();return a.backgroundItems.filter(function(a){a=b.getMainImage(a).physicalId;
return-1<c.indexOf(a)}).map(function(a){return a.stageItemId})}function L(){var a=[],b=F(g.FLOOR_OPTION_GROUP_NAME);b&&a.push(b);(b=F(g.WALL_OPTION_GROUP_NAME))&&a.push(b);return a}function F(b){return a("[name\x3d"+b+"]:checked").val()}function M(b){var c=a("#switch-room-"+b.data.stageId+" \x3e img");0<c.length&&c[0].src&&(b.data.imageUrl=c[0].src)}var N,B={ITEM_IDS:"itemIds",EMPTY_FEATURE_IDS:"emptyFeatureIds",REF_MARKER:"ref_",ASIN:"asin"},I={REF_MARKER:"srm_dpx_dpatf",SHOWROOM_FULL_RELATIVE_PATH:"/showroom/ingress"},
u={classes:{hidden:"aok-hidden"}},P,r,O=!1,Q=null;m.on("a:popover:afterShow:immersiveView",function(){Q=m.interval(function(){!m.onScreen(a(e.id(g.SELECTOR.id.showroomTab)))||document.hidden!==C&&document.hidden||d.addOne(d.COUNTER_NAMES.IMMERSIVE_VIEW_SHOWROOM_TAB_DWELL_VISIBLE)},1E3)});m.on("a:popover:afterHide:immersiveView",function(){clearInterval(Q)});m.declarative(g.DECLARATIVES.SWITCH_ROOMS_THUMBNAIL,["change"],function(b){M(b);b=b.data;d.addOne(d.COUNTER_NAMES.SWITCH_ROOMS);b.defaultCollageUrl=
b.imageUrl;b.defaultStageId=b.stageId;b.asin=r.asin;b.imageDomain=r.imageDomain;r=b;b=d.createShowroomAtfEvent(r.defaultStageId,r.asin,d.EVENT_NAMES.SWITCH_ROOMS,new Date);try{a(e.id(g.SELECTOR.id.collageImage)).hide().fadeIn();y(r.defaultCollageUrl,null,d.COUNTER_NAMES.DEFAULT_COLLAGE_SUCCESS,d.COUNTER_NAMES.DEFAULT_COLLAGE_ERROR);var c=new k.IngressCollectionRequest(r.asin,r.defaultStageId,G,A,q,t,b);k.getIngressCollection(c)}catch(f){d.addOne(d.COUNTER_NAMES.SWITCH_ROOMS_ERROR_EXCEPTION),d.logShowroomAtfEvent(b,
d.STATUS_TYPES.ERROR)}});m.declarative(g.DECLARATIVES.SWITCH_ROOMS_THUMBNAIL,["mouseenter"],function(b){M(b);var c=a(e.id(g.SELECTOR.id.hoverCollageImage));0<c.length&&(c.attr("src",b.data.imageUrl),c.removeClass(g.SELECTOR.classes.hidden))});m.declarative(g.DECLARATIVES.SWITCH_ROOMS_OPTIONS,["mouseleave"],function(b){b=a(e.id(g.SELECTOR.id.hoverCollageImage));0<b.length&&(b.attr("src",""),b.addClass(g.SELECTOR.classes.hidden))});m.declarative(g.DECLARATIVES.BACKGROUND_SELECT,["change"],function(a){a=
a.data;var c=d.createShowroomAtfEvent("","",d.EVENT_NAMES.SWAP,new Date);c.featurePointId=a.featurePoint;c.items=a.itemId;c.notes=a.itemCategory+":"+a.material;try{c.showroomId=r.defaultStageId;c.asin=r.asin;var e=k.getExistingCollection(r.asin,r.defaultStageId);if(e)if(a=c,b.isValidIngressCollection(e)){E(e);var f=r.imageDomain;if("V2"===(r&&r.defaultCollageUrl&&"json"===r.defaultCollageUrl.substr(r.defaultCollageUrl.lastIndexOf(".")+1)?"V2":"V1")){var l=F(g.WALL_OPTION_GROUP_NAME),m=F(g.FLOOR_OPTION_GROUP_NAME),
n=h.generateCollageUrlV2WithWallAndFloorPhysicalIds(e,l,m,f);y(n,a,d.COUNTER_NAMES.SWAP_COLLAGE_SUCCESS,d.COUNTER_NAMES.SWAP_COLLAGE_ERROR);K(n,e.stageId)}else{var p=L(),q=h.generateCollageUrlV1WithBackgroundPhysicalIds(e,p,f);y(q,a,d.COUNTER_NAMES.SWAP_COLLAGE_SUCCESS,d.COUNTER_NAMES.SWAP_COLLAGE_ERROR);K(q,e.stageId)}}else d.addOne(d.COUNTER_NAMES.SWAP_ERROR_INGRESS_COLLECTION),d.logShowroomAtfEvent(a,d.STATUS_TYPES.ERROR);else H(d.COUNTER_NAMES.SWAP_ERROR_INGRESS_COLLECTION,c)}catch(t){H(d.COUNTER_NAMES.SWAP_ERROR_EXCEPTION,
c)}});m.declarative(g.DECLARATIVES.EGRESS_TO_SHOWROOM,["click"],function(b){b=d.createShowroomAtfEvent(r.defaultStageId,r.asin,d.EVENT_NAMES.EGRESS_TO_SHOWROOM);b.notes=a(e.id(g.SELECTOR.id.ingressLink))[0].href;d.logShowroomAtfEvent(b);d.addOne(d.COUNTER_NAMES.EGRESS_TO_SHOWROOM)});return{onTabSelect:function(a){try{p(a)}catch(b){}},init:p}});"use strict";p.when("A","jQuery","hit-common","showroom-atf-constants").register("showroom-immersive-view-tab-layout",function(m,a,e,h){function f(a,c,d){a=
b(a,c);d&&(a.innerHTML=d);return a}function b(a,b){var d=document.createElement("div");a&&(d.id=a);b&&d.setAttribute("class",b);return d}function g(a,b){var d=document.createElement("img");a&&(d.id=a);b&&d.setAttribute("class",b);return d}var k,d=!1;return{initViewLayout:function(l){if(!d){k=l;l=a(e.id(h.SELECTOR.id.largeShowroomDiv));if(0<l.length){var c=g(h.SELECTOR.id.collageImage);l.append(c);c=g(h.SELECTOR.id.hoverCollageImage,h.SELECTOR.classes.hidden);l.append(c)}var c=document.getElementsByClassName("iv-showroom-option-sidebar")[0],
n=c.firstChild;c&&(l=b(h.SELECTOR.id.switchRoomsSection),c.insertBefore(l,n),c=f(h.STRING_IDS.switchRoomsTitle,"iv-showroom-switch-rooms-title",k.displayStrings?k.displayStrings[h.STRING_IDS.switchRoomsTitle]:""),l.appendChild(c),c=b(h.SELECTOR.id.roomOptionsDiv,"iv-showroom-room-option-row"),m.declarative.create(c,h.DECLARATIVES.SWITCH_ROOMS_OPTIONS),l.appendChild(c));l=a(e.id(h.SELECTOR.id.optionsSection));0<l.length&&(l.empty(),c=f(h.STRING_IDS.wallTypeSubheading,"iv-showroom-background-type-heading",
k.displayStrings?k.displayStrings[h.STRING_IDS.wallTypeSubheading]:""),l.append(c),c=b(h.SELECTOR.id.wallOptionsDiv,"iv-showroom-background-option-row"),l.append(c),c=f(h.STRING_IDS.floorTypeSubheading,"iv-showroom-background-type-heading",k.displayStrings?k.displayStrings[h.STRING_IDS.floorTypeSubheading]:""),l.append(c),c=b(h.SELECTOR.id.floorOptions,"iv-showroom-background-option-row"),l.append(c));d=!0}}}});"use strict";p.when("hit-common").register("showroom-atf-metrics",function(m){return{EVENT_NAMES:{IMMERSIVE_VIEW_LOAD:"srm_atf_iv_load",
SWAP:"srm_atf_swap",SWITCH_ROOMS:"srm_atf_switch_rooms",SHOWROOM_WEBSITE_GET_INGRESS_COLLECTION:"srm_atf_showroom_website_get_ingress_collection",SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS:"srm_atf_showroom_website_get_ingress_thumbnails",EGRESS_TO_SHOWROOM:"srm_atf_egress_to_showroom",IMAGEBLOCK_LOAD:"srm_atf_imageBlock_load",IMAGEBLOCK_THUMBNAIL_CLICK:"srm_atf_thumbnail_click",IMAGEBLOCK_MAIN_IMAGE_CLICK:"srm_atf_main_image_click",IMMERSIVE_VIEW_TAB_CLICK:"srm_atf_iv_tab_click"},COUNTER_NAMES:{COLLAGE_LOAD_SUCCESS:"showroom:atf:collage:load:success",
COLLAGE_LOAD_SUCCESS_LATENCY:"showroom:atf:collage:load:success:latency",COLLAGE_LOAD_ERROR_LATENCY:"showroom:atf:collage:load:error:latency",COLLAGE_METHOD_INGRESS_COLLECTION:"showroom:atf:collage:method:ingressCollection",DEFAULT_COLLAGE_SUCCESS:"showroom:atf:collage:default:success",DEFAULT_COLLAGE_ERROR:"showroom:atf:collage:default:error",EGRESS_TO_SHOWROOM:"showroom:atf:egress:to:srm",IMMERSIVE_VIEW_SHOWROOM_TAB_DWELL_VISIBLE:"showroom:atf:tab:dwell:visible",INIT:"showroom:atf:init",INIT_SUCCESS:"showroom:atf:init:success",
INIT_ERROR_EXCEPTION:"showroom:atf:init:error:exception",INIT_ERROR_FEATURE_DATA:"showroom:atf:init:error:featureData",INIT_ERROR_INGRESS_COLLECTION:"showroom:atf:init:error:ingressCollection",INIT_ERROR_SHOWROOM_WEBSITE:"showroom:atf:init:error:showroomWebsite",INIT_SWITCH_ROOMS_ERROR_INGRESS_THUMBNAILS:"showroom:atf:init:switchRooms:error:ingressThumbnails",SHOWROOM_IMAGEBLOCK_FEATURE_RENDERED:"showroom:atf:imageBlock:feature:render",SHOWROOM_IMAGEBLOCK_THUMBNAIL_HOVER:"showroom:atf:imageBlock:thumbnail:hover",
SHOWROOM_IMAGEBLOCK_THUMBNAIL_SELECT:"showroom:atf:imageBlock:thumbnail:select",SHOWROOM_IMAGEBLOCK_MAIN_IMAGE_SELECT:"showroom:atf:imageBlock:mainImage:select",SHOWROOM_WEBSITE_COLLECTION_GET_INGRESS_ERROR_INPUTS:"showroom:atf:showroomWebsite:getIngress:error:inputs",SHOWROOM_WEBSITE_COLLECTION_LATENCY:"showroom:atf:showroomWebsite:request:latency",SHOWROOM_WEBSITE_COLLECTION_REQUEST_SUCCESS:"showroom:atf:showroomWebsite:request:success",SHOWROOM_WEBSITE_COLLECTION_REQUEST_RETRY:"showroom:atf:showroomWebsite:request:retry",
SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR:"showroom:atf:showroomWebsite:request:error",SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_EXCEPTION:"showroom:atf:showroomWebsite:request:error:exception",SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_HTTP:"showroom:atf:showroomWebsite:request:error:http",SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_INGRESS_COLLECTION:"showroom:atf:showroomWebsite:request:error:ingressCollection",SHOWROOM_WEBSITE_COLLECTION_REQUEST_ERROR_RETRIES:"showroom:atf:showroomWebsite:request:error:retries",
SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_AJAX_ERROR:"showroom:atf:showroomWebsite:getIngressThumbnails:error:ajax",SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_SUCCESS:"showroom:atf:showroomWebsite:getIngressThumbnails:success",SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_INVALID_REQUEST:"showroom:atf:showroomWebsite:getIngressThumbnails:error:invalidRequest",SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_LATENCY:"showroom:atf:showroomWebsite:getIngressThumbnails:latency",SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_MAX_RETRIES:"showroom:atf:showroomWebsite:getIngressThumbnails:maxRetries",
SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_REQUEST_ERROR:"showroom:atf:showroomWebsite:getIngressThumbnails:error:request",SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_RETRY:"showroom:atf:showroomWebsite:getIngressThumbnails:retry",SHOWROOM_WEBSITE_GET_INGRESS_THUMBNAILS_UNEXPECTED_ERROR:"showroom:atf:showroomWebsite:getIngressThumbnails:error:unexpected",SWAP_COLLAGE_SUCCESS:"showroom:atf:swap:collage:success",SWAP_COLLAGE_ERROR:"showroom:atf:swap:collage:error",SWAP_ERROR_EXCEPTION:"showroom:atf:swap:error:exception",
SWAP_ERROR_FEATURE_DATA:"showroom:atf:swap:error:featureData",SWAP_ERROR_INGRESS_COLLECTION:"showroom:atf:swap:error:ingressCollection",SWITCH_ROOMS:"showroom:atf:switchRooms",SWITCH_ROOMS_ERROR_EXCEPTION:"showroom:atf:switchRooms:error:exception",TAB_SELECT:"showroom:atf:tab:select",TAB_SELECT_ERROR_EXCEPTION:"showroom:atf:tab:select:error:exception"},STATUS_TYPES:{SUCCESS:"success",ERROR:"error"},addOne:function(a){try{if(t.ue&&a){var e=(t.ue.count(a)||0)+1;t.ue.count(a,e)}}catch(h){}},addCount:function(a,
e){try{if(t.ue&&a&&"number"===typeof e){var h=(t.ue.count(a)||0)+e;t.ue.count(a,h)}}catch(f){}},logValue:function(a,e){try{t.ue&&a&&"number"===typeof e&&t.ue.count(a,e)}catch(h){}},createShowroomAtfEvent:function(a,e,h,f){var b={};b.showroomId=a;b.asin=e;b.eventType=h;b.status="";b.featurePointId="";b.items="";b.source="";b.latency=null;b.notes="";b.device=m.getDevice();b.userAgent=m.getUserAgent();b.producerId="showroom_atf";b.schemaId="com.amazon.showroom.ingress.clientEvent.3";b._startTime=f;return b},
logShowroomAtfEvent:function(a,e){try{if(t.ue&&t.ue.event&&a){e&&(a.status=e);!a.latency&&a._startTime&&(a.latency=new Date-a._startTime);delete a._startTime;for(var h in a)if(a.hasOwnProperty(h)){var f=a[h];0!==f&&!1!==f&&(f||delete a[h])}t.ue.event(a,"showroom_atf","com.amazon.showroom.ingress.clientEvent.3")}}catch(b){}}}});"use strict";p.when("A","hit-common","showroom-atf-data-helper","showroom-atf-constants").register("showroom-atf-switch-rooms-rendering",function(m,a,e,h){var f=m.$;return{renderSwitchRoomThumbnails:function(b,
e,k,d){if(e&&Array.isArray(b)){e=f(a.id(e));e.empty();for(var l=[],c=[],n=0;n<b.length;n++)b[n].stageId===k?l.push(b[n]):c.push(b[n]);b=l.concat(c);for(l=0;l<b.length;l++){var n=c=b[l],p=c.stageId===k,q;q=n.stageId;q=f("\x3clabel/\x3e").attr("id","switch-room-"+q);var t=n;f("\x3cinput type\x3d'radio'/\x3e").attr("name",h.ROOM_OPTION_GROUP_NAME).attr("value",t.stageId).prop("checked",p).appendTo(q);n=n.imageUrl;f("\x3cimg/\x3e").attr("src",n).appendTo(q);n=q;c.imageUrl&&(m.declarative.create(n,d,c),
n.appendTo(e))}}}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageTextLinkIngressAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("InteractionTrackingAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(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){});
/* ******** */
(function(a){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,b=d?d("DetailPageCustomerReviewsAttributeAssets",""):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,d){a.when("customerReviewsAttributeSeeAllRatingsCounter").execute(function(b){b.init()});a.when("A").register("customerReviewsAttributeSeeAllRatingsCounter",function(b){return{init:function(){var a=c.ue;a&&a.count("customerReviewsAttributeDesktopRender",1);b.declarative("cra-see-all-rating-click",
"click",function(){a&&a.count("customerReviewsAttributeSeeAllRatingsClick",1)})}}})});
/* ******** */
(function(a){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,c=h?h("DetailPageUssStrxAssets",""):e;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,e,h){a.when("A","uss-strx-constants","uss-strx-metrics-logger","atf").register("uss-strx-metrics",function(e,a,k){var g;return{init:function(){g=new k(a.logging.METRIC_PREFIX)},updateAndLogCounter:function(b,f){g.updateAndLogCounter(b,f)},logCounter:function(b,f){g.logCounter(b,f)}}});a.when("A",
"atf").register("uss-strx-metrics-logger",function(a){return function(a){function c(f,d){null!==d&&"number"===typeof d&&e.ue&&e.ue.count&&e.ue.count(b.attribution+f,d)}function g(f){var d=0;e.ue&&e.ue.count&&(d=e.ue.count(b.attribution+f));return d}var b=this;b.attribution=a||"";b.logCounter=c;b.getCounter=g;b.updateAndLogCounter=function(b,d){var l=g(b);null!==l&&"number"===typeof l?c(b,l+d):c(b,d)}}});a.when("A","atf").register("uss-strx-constants",function(a){return{eligibility:{ELIGIBILITY_TYPE:"STRX"},
logging:{METRIC_PREFIX:"USS.STRX."},metrics:{MISSING_ASIN:"MissingASIN",MISSING_DISPLAYABLE:"MissingDisplayableFlag",MISSING_OFFERLISTING:"MissingOfferListingId",MISSING_MARKETPLACE:"MissingMarketplaceId",MISSING_LANGUAGE_HEADER:"MissingLanguageHeader"}}});a.when("A","uss-strx-constants","uss-strx-metrics","uss-eligibility","atf").register("uss-strx-eligibility",function(a,e,k,g){function b(b,a){typeof b!==typeof h&&!1!==b||k.updateAndLogCounter(a,1)}var f=a.$,d=e.metrics;k.init();(function(){var a,
c=null;a=f("#strx-uss-widget-container");if(a.length){var c=a.attr("data-asin"),h=a.attr("data-displayable"),k=a.attr("data-offer-listing-id"),m=a.attr("data-marketplace-id");a=a.attr("data-language-header");b(c,d.MISSING_ASIN);b(h,d.MISSING_DISPLAYABLE);b(k,d.MISSING_OFFERLISTING);b(m,d.MISSING_MARKETPLACE);b(a,d.MISSING_LANGUAGE_HEADER);c={asin:c,displayable:h,offerListingId:k,marketplaceId:m,languageHeader:a}}(a=c)&&g.registerProgramEligibility(e.eligibility.ELIGIBILITY_TYPE,a)})();return{}})});
/* ******** */
(function(k){var n=window.AmazonUIPageJS||window.P,q=n._namespace||n.attributeErrors,d=q?q("AmazonDevicesDetailPageUtilityAssets",""):n;d.guardFatal?d.guardFatal(k)(d,window):d.execute(function(){k(d,window)})})(function(k,n,q){k.when("A").execute(function(d){d.declarative("popup-window","click",function(c){var a=c.data.windowName||"popupWindow",b=c.data.windowOptions||"width\x3d600,height\x3d400,scrollbars\x3dyes";c.$event.preventDefault();n.open(c.$target.prop("href"),a,b)})});"use strict";k.when("A").register("ods-element-factory",
function(d){var c=d.$;return{getHiddenInput:function(a,b){return c("\x3cinput\x3e").prop("name",a).prop("type","hidden").prop("value",b)}}});"use strict";k.register("ods-url-utils",function(){return{getUrlParam:function(d){for(var c=null,a=n.location.search.substr(1).split("\x26"),b=0;b<a.length;b++){var g=a[b].split("\x3d");g[0]===d&&(c=g[1])}return c}}});"use strict";k.when("A").register("csmCounter",function(d){var c=d.$;return{register:function(a,b,g){a&&b&&g&&c(a).bind(b,c.proxy(this.increment,
this,g))},increment:function(a){a&&n.ue.count(a,(n.ue.count(a)||0)+1)},update:function(a,b){a&&"number"===typeof b&&n.ue.count(a,b)}}});"use strict";k.register("function-utils",function(){return{throttle:function(d,c,a){var b,g,f,h=null,e=0;a||(a={});var m=function(){e=!1===a.leading?0:(new Date).getTime();h=null;f=d.apply(b,g);h||(b=g=null)};return function(){var l=(new Date).getTime();e||!1!==a.leading||(e=l);var p=c-(l-e);b=this;g=arguments;0>=p||p>c?(h&&(clearTimeout(h),h=null),e=l,f=d.apply(b,
g),h||(b=g=null)):h||!1===a.trailing||(h=setTimeout(m,p));return f}},debounce:function(d,c,a){var b;return function(){var g=this,f=arguments;clearTimeout(b);b=setTimeout(function(){b=null;a||d.apply(g,f)},c);a&&!b&&d.apply(g,f)}},memoize:function(d,c){var a={};return function(){for(var b=0<arguments.length?"":"%NO_ARGUMENTS%",g=0;g<arguments.length;g++)b&&(b+="-"),b+="object"===typeof arguments[g]?JSON.stringify(arguments[g]):arguments[g];a.hasOwnProperty(b)||(a[b]=c.apply(d,arguments));return a[b]}}}});
"use strict";k.when("A").register("odsRefTagUtils",function(d){var c=d.$;return{send:function(a,b){if(!a)throw Error("refTag is not defined");c.get((b||"/gp/product/ajax-handlers/reftag.html")+"/ref\x3d"+a)}}});"use strict";k.when("A").register("ods-image-utilities",function(d){function c(b,a){var f=new Image;f.onload=function(){a.resolve(b)};f.onerror=function(){a.reject(b)};f.src=b}var a=d.$;return{preloadImage:function(b,g){var f=a.Deferred(),h;c(b,f);g&&d.capabilities.hires&&(h=a.Deferred(),c(g,
h));return{image:f.promise(),hiResImage:h?h.promise():q}},preloadImages:function(b){for(var g=[],f=0;f<b.length;f++){var h=a.Deferred();c(b[f],h);g.push(h.promise())}return g}}});"use strict";k.when("A").register("ODSEventDispatcher",function(d){return d.createClass({init:function(){this._callbacks={}},registerCallback:function(c,a){var b=this._callbacks[c]||[];-1===b.indexOf(a)&&b.push(a);this._callbacks[c]=b},unregisterCallback:function(c,a){if(c=this._callbacks[c])a=c.indexOf(a),-1<a&&c.splice(a,
1)},dispatch:function(c){var a=this._callbacks[c];if(a)for(var b=0;b<a.length;b++)a[b].apply(this,Array.prototype.slice.call(arguments,1))}})});"use strict";k.when("A","jQuery").register("BuyboxManagerFactory",function(d,c){function a(b,a,h,e){var m=d.copy(h);c.each(m,function(d){-1===["initialize","reset"].indexOf(d)&&(b[d]=e?c.proxy(a,null,d):c.proxy(h,d))})}function b(b,f,h,e){var d=function(r){if(!p&&(e?(e.initialize(),a(l,d,e,!1)):k=new h,p=new f(k),c.each(b,function(b,a){l[a]=c.proxy(p,a)}),
"string"===typeof r))return l[r].apply(p,Array.prototype.slice.call(arguments,1))},l={reset:function(){p?(e&&e.reset(),k&&k.reset(),p.reset()):d()},initialize:d},p,k;e&&a(l,d,e,!0);c.each(b,function(b,a){l[a]=c.proxy(d,null,a)});return l}return{create:function(a,f,h){return b(a,f,h)},extend:function(a,f,h){return b(a,f,null,h)}}});"use strict";k.when("jQuery","BuyboxManagerViewHelper").register("BuyboxManagerFormHelper",function(d,c){function a(b,a){return'\x3cinput type\x3d"hidden" name\x3d"'+b+
'" value\x3d"'+a+'" /\x3e'}function b(b){return 0<=b.attr("id").search("buyNow")}function g(b){return 0<=b.attr("id").search("addToCart")||0<=b.attr("id").search("mobile-installments")}function f(b,a){return d.map(b,function(b){return d(b).attr(a)})}'input[name\x3d"%NAME%"]'.replace("%NAME%","verificationSessionID");var h='input[name\x3d"%NAME%"]'.replace("%NAME%","a"),e='input[name\x3d"%NAME%"]'.replace("%NAME%","oid"),m='input[name\x3d"%NAME%"]'.replace("%NAME%","quantity"),l='input[name\x3d"%NAME%"]'.replace("%NAME%",
"asin"),k='input[name\x3d"%NAME%"]'.replace("%NAME%","offeringID"),u='input[name\x3d"%NAME%"]'.replace("%NAME%","quantity"),r=[h,e,m].concat([l,k,u]).join(", ");return{removeAllFormFields:function(b){b.find(r).remove()},getHiddenInputHTML:a,isFormBuyNow:b,isFormAddToCart:g,createMobileAppFormInputs:function(b){var f=b[0],h,g,e;f&&(h=f.asin,g=f.offerId,e=f.quantity);for(f=1;f<b.length;f++)h+="|"+b[f].asin,g+="|"+b[f].offerId,e+="|"+b[f].quantity;return""+(a("asin",h)+a("offeringID",g)+a("quantity",
e))},getViewData:function(a){if(b(a)){var d=f(a.find(l),"value")[0].split("|"),t=f(a.find(k),"value")[0].split("|");a=f(a.find(u),"value")[0].split("|");return c.buildRawData(d,t,a)}if(g(a))return d=f(a.find(h),"value"),t=f(a.find(e),"value"),a=f(a.find(m),"value"),c.buildRawData(d,t,a);throw Error("Add to order button not handled in buyBoxManagerFormHelper");},updateMobileAppFormInputsWithSubscriptionData:function(b,f,h){if(!d.isEmptyObject(b._digitalSubscriptionAsinMap)){var g=[],e=b._digitalSubscriptionAsinMap,
c;for(c in e)if(e.hasOwnProperty(c)){var m=e[c],l=m.name,m=m.value;g.push('input[name\x3d"%NAME%"]'.replace("%NAME%",l));g.push('input[name\x3d"%NAME%"]'.replace("%NAME%",m));delete e[c]}l=g.join(",");h.find(l).remove();b._digitalSubscriptionAsinMap=e}h="";for(e=1;e<f.length;e++)f[e].customAttribute&&(l="custom-name.%INDEX.1".replace("%INDEX",e),m="custom-value.%INDEX.1".replace("%INDEX",e),g=f[e],h+=a(l,g.customAttribute.name)+a(m,g.customAttribute.value),b._digitalSubscriptionAsinMap||(b._digitalSubscriptionAsinMap=
{}),b._digitalSubscriptionAsinMap[g.asin]={index:e,name:l,value:m});return h}}});"use strict";k.when("A","jQuery","BuyboxManagerViewBase").register("BuyboxManagerView",function(d,c,a){return a.extend({init:function(){this._super()},moveFieldsToContainer:function(b,a){for(var f=1,h=[],e;e===q||0<e.length;)e=b.find(this.getHiddenSelector("ASIN."+f)),0<e.length&&h.push(e.get(0),b.find(this.getHiddenSelector("offerListingID."+f)).get(0),b.find(this.getHiddenSelector("quantity."+f)).get(0)),f++;a.append(h)},
render:function(b){this._super(b);var a=this;this.$forms.each(function(f){var h=c(this),e=h.find('input[type\x3d"hidden"][name^\x3d"ASIN."]'),d=c.isArray(b)?b.length:0,l=a.$fieldsContainers.get(f);e.each(function(){var b=c(this);if(!b.parent().is(l)){var f=a._getAsinIndex(b);d++;b.prop("name","ASIN."+d);h.find('input[type\x3d"hidden"][name\x3d"offerListingID.'+f+'"]').prop("name","offerListingID."+d);h.find('input[type\x3d"hidden"][name\x3d"quantity.'+f+'"]').prop("name","quantity."+d)}})})},buildHTML:function(b,
a){return this.getHiddenInputHTML("ASIN."+a,b.asin)+this.getHiddenInputHTML("offerListingID."+a,b.offerId)+this.getHiddenInputHTML("quantity."+a,b.quantity)},getDataFromDOM:function(){var b=[],a=this.$fieldsContainers.first(),f=this;a.find('input[type\x3d"hidden"][name^\x3d"ASIN."]').each(function(){var h=c(this),e=f._getAsinIndex(h);b.push({asin:h.val(),offerId:a.find(f.getHiddenSelector("offerListingID."+e)).val(),quantity:parseInt(a.find(f.getHiddenSelector("quantity."+e)).val(),10)})});return b},
_getAsinIndex:function(b){return parseInt(b.prop("name").substring(5),10)}})});"use strict";k.when("A","jQuery").register("BuyboxManagerViewBase",function(d,c){return d.createClass({init:function(){this.reset()},registerAtcBtn:function(a){this.$atcBtns=this.$atcBtns.add(a)},registerForm:function(a){a="string"===typeof a?c(a):a;if(a instanceof c&&0<a.length&&0===this.$forms.has(a).length){this.$forms=this.$forms.add(a);var b=this.createFieldsContainer(a);this.moveFieldsToContainer(a,b)}},createFieldsContainer:function(a){var b=
a.find(".buyboxManagerHiddenFieldsContainer");0===b.length&&(b=c('\x3cdiv class\x3d"buyboxManagerHiddenFieldsContainer"\x3e'),a.append(b));0===this.$fieldsContainers.has(b).length&&(this.$fieldsContainers=this.$fieldsContainers.add(b));return b.first()},moveFieldsToContainer:function(a,b){throw Error("The view must override the moveFieldsToContainer function");},getHiddenSelector:function(a,b){var g='input[type\x3d"hidden"]';"string"===typeof a&&(g+='[name\x3d"'+a+'"]');"string"===typeof b&&(g+='[value\x3d"'+
b+'"]');return g},getHiddenInputHTML:function(a,b){return'\x3cinput type\x3d"hidden" name\x3d"'+a+'" value\x3d"'+b+'" /\x3e'},render:function(a){this.appendFormData(a)},appendFormData:function(a,b){b=b||1;var g="";if(c.isArray(a))for(var f=0;f<a.length;f++)g+=this.buildHTML(a[f],b+f);this.$fieldsContainers.html(g)},reset:function(){this.$forms=c();this.$fieldsContainers=c();this.registerForm(c("#addToCart"));c("#mobile-installments")&&this.registerForm(c("#mobile-installments"));this.$atcBtns=c();
this.registerAtcBtn(c("#add-to-cart-button"));this.registerAtcBtn(c("#bb_to_cfg_button"));this.registerAtcBtn(c("#buy-now-button"));c("#installments-button").length&&this.registerAtcBtn(c("#installments-button"))}})});"use strict";k.when("jQuery").register("BuyboxManagerViewHelper",function(d){var c={FORM:"form",AW_MASH:"aw_mash",SHOW_HCTP_ATTACH:"show-hctp-attach",UNKNOWN:q};return{ViewType:c,getAtcBtnViewType:function(a){var b=c.UNKNOWN;a instanceof d||(a=d(a));var g=a.closest('.a-declarative[data-action\x3d"aw-mash"]'),
f=a.closest('.a-declarative[data-action\x3d"show-hctp-attach"]');return 0<g.length?c.AW_MASH:0<a.closest("form").length?c.FORM:0<f.length?c.SHOW_HCTP_ATTACH:b},buildRawData:function(a,b,g){var f={},h=[];d.each(a,function(a,c){var d=b.length>a?b[a]:"";a=g.length>a?parseInt(g[a],10):1;var k=c+":"+d;f.hasOwnProperty(k)?h[f[k]].quantity+=a:f[k]=h.push({asin:c,offerId:d,quantity:a})-1});return h}}});"use strict";k.when("A","jQuery","ODSEventDispatcher","ods-url-utils","BuyboxManagerViewBase").register("BuyboxManagerController",
function(d,c,a,b,g){return d.createClass({init:function(b){if(!(b instanceof g))throw new TypeError("The view must inherits from BuyboxManagerViewBase");this._view=b;this._eventDispatcher=new a;this._enableEvents(!0);this.reset();var h=this;d.on("a:dropdown:mobileQuantityDropDown:select",function(b){h.setPageAsinQuantity(parseInt(b.value,10))});this._isFreeFormQuantityPickerPresent()&&this._makeAwareOfFreeFormQuantity()},_enableEvents:function(b){c.each("UpsellAsinAdded UpsellAsinRemoved UpsellAsinChanged PageAsinAdded PageAsinReplaced PageAsinChanged".split(" "),
c.proxy(function(a,e){b?(this["register"+e]=c.proxy(this._eventDispatcher,"registerCallback",e),this["unregister"+e]=c.proxy(this._eventDispatcher,"unregisterCallback",e)):(delete this["register"+e],delete this["unregister"+e])},this))},_parseInitialAsins:function(){var b=this._view.getDataFromDOM();if(b)for(var a=0;a<b.length;a++)this[0===a?"setPageAsin":"setUpsellAsin"](b[a].asin,b[a].offerId,b[a].quantity)},_dispatchSetUpsellAsinEvents:function(b,a,e,c){c!==e&&(0===c&&0<e?this._eventDispatcher.dispatch("UpsellAsinAdded",
b,a,e,c):0===e&&0<c&&this._eventDispatcher.dispatch("UpsellAsinRemoved",b,a,e,c),this._eventDispatcher.dispatch("UpsellAsinChanged",b,a,e,c))},_indexOfAsin:function(b,a){a=a||"";for(var e=0;e<this._asinsData.length;e++)if(this._asinsData[e].asin===b&&this._asinsData[e].offerId===a)return e;return-1},_isFreeFormQuantityPickerPresent:function(){return 0<c('select[id$\x3d"-predefinedQuantitiesDropdown"]').length},_makeAwareOfFreeFormQuantity:function(){var a=this;d.on("buyBoxQuantityChanged",function(b,
c){a.setPageAsinQuantity(c)});var c=parseInt(b.getUrlParam("qty"),10);c&&a.setPageAsinQuantity(c)},setUpsellAsin:function(b,a,c,g){if("string"!==typeof b||0>=b.length)throw new TypeError("The asin argument is required");var d=this._indexOfAsin(b,a),k=0;a=a||"";c="number"===typeof c?Math.max(0,c):1;if(0===d)throw Error("To modify the pageAsin, use setPageAsin() instead.");if(0<d)g=this._asinsData[d],k=g.quantity,0>=c?this._asinsData.splice(d,1):g.quantity=c;else if(0<c)this._asinsData.push({asin:b,
offerId:a,quantity:c,customAttribute:g});else return!1;this.render();this._dispatchSetUpsellAsinEvents(b,a,c,k,d);return!0},registerForm:function(b){this._view.registerForm(b);this.render()},registerAtcBtn:function(b){this._view.registerAtcBtn(b);this.render()},setPageAsin:function(b,a,c){if("string"!==typeof b||0>=b.length)throw new TypeError("The asin argument is required");var g=this._indexOfAsin(b,a),d=0<this._asinsData.length?this._asinsData[0].quantity:0;a=a||"";if(0>=c)throw new TypeError("The quantity of the page asin must be \x3e 0.");
c="number"===typeof c?Math.max(1,c):1;if(0===g&&c===d)return!1;0<g&&this.setUpsellAsin(b,a,0);this._asinsData[0]={asin:b,offerId:a,quantity:c};this.render();-1<g?this._eventDispatcher.dispatch("PageAsinReplaced",b,a,c,d):this._eventDispatcher.dispatch("PageAsinAdded",b,a,c);this._eventDispatcher.dispatch("PageAsinChanged",b,a,c);return!0},setPageAsinQuantity:function(b){var a=this._asinsData&&this._asinsData.length&&this._asinsData[0];a&&this.setPageAsin(a.asin,a.offerId,b)},addUpsellAsin:function(b,
a,c){c=c||1;for(var g=0;g<this._asinsData.length;g++){var d=this._asinsData[g];if(d.asin===b){this.setUpsellAsin(b,a,d.quantity+c);return}}this.setUpsellAsin(b,a,c)},render:function(){this._view.render(this._asinsData)},getAsins:function(){return d.copy(this._asinsData)},getUpsellAsins:function(){var b=this.getAsins();b.splice(0,1);return b},resetUpsellAsins:function(){this._asinsData=[this._asinsData[0]];return d.copy(this._asinsData)},getPageAsin:function(){return d.copy(this._asinsData[0])},reset:function(){this._asinsData=
[];this._parseInitialAsins()}})});"use strict";k.when("BuyboxManagerController","BuyboxManagerView","BuyboxManagerFactory","jQuery").register("BuyboxManager",function(d,c,a,b){return a.create("getAsins getUpsellAsins setUpsellAsin resetUpsellAsins getPageAsin setPageAsin registerUpsellAsinChanged registerUpsellAsinAdded registerUpsellAsinRemoved registerPageAsinChanged registerPageAsinAdded registerPageAsinReplaced unregisterUpsellAsinChanged unregisterUpsellAsinRemoved unregisterUpsellAsinAdded unregisterPageAsinChanged unregisterPageAsinAdded unregisterPageAsinReplaced addUpsellAsin registerForm registerAtcBtn".split(" "),
d,c)});"use strict";k.when("jQuery","BuyboxManagerViewHelper").register("BuyboxManagerMashHelper",function(d,c){return{createInputs:function(a){var b={a:[],oid:[],quantity:[]};d.each(a,function(a,c){b.a.push(c.asin);b.oid.push(c.offerId);b.quantity.push(c.quantity)});b.a=b.a.join("|");b.oid=b.oid.join("|");b.quantity=b.quantity.join("|");return b},getViewData:function(a){var b=a.inputs.a.split("|"),g=a.inputs.oid.split("|");a=a.inputs.quantity.split("|");return c.buildRawData(b,g,a)},setDeclarativeMultiple:function(a){a.buttonID=
"add-multiple-to-cart"},getDeclarativeDataFromBtn:function(a){return a.closest('.a-declarative[data-action\x3d"aw-mash"]').data("awMash")},isAddToCart:function(a){return"add-to-cart"===a.buttonID},updateInputWithSubscriptionData:function(a,b,c){if(!d.isEmptyObject(a._digitalSubscriptionAsinMap)){var f=a._digitalSubscriptionAsinMap,h;for(h in f)if(f.hasOwnProperty(h)){var e=f[h],k=e.index;if(c.length<=k||c[k].asin!==h)b[e.name]&&delete b[e.name],b[e.value]&&delete b[e.value],delete f[h]}a._digitalSubscriptionAsinMap=
f}d.each(c,function(c,g){if(g.customAttribute){var d="custom-name."+(c+1)+".1",f="custom-value."+(c+1)+".1";b[d]=g.customAttribute.name;b[f]=g.customAttribute.value;a._digitalSubscriptionAsinMap||(a._digitalSubscriptionAsinMap={});a._digitalSubscriptionAsinMap[g.asin]={index:c,name:d,value:f}}})}}});"use strict";k.when("ODSBuyboxManagerController","BuyboxManager","BuyboxManagerFactory","A","jQuery").register("ODSBuyboxManager",function(d,c,a,b,g){return a.extend(["addMetadata","getMetadata","getAsins",
"getPageAsin","getUpsellAsins"],d,c)});"use strict";k.when("BuyboxManager","ODSBuyboxAsinMetadata","A","jQuery").register("ODSBuyboxManagerController",function(d,c,a,b){return a.createClass({init:function(){this.reset()},addMetadata:function(b){if(!(b instanceof c))throw Error("The argument metadata must be an instance of ODSBuyboxAsinMetadata");if(!b.isValid())throw Error("The metadata is NOT valid");this._metadatas[b.asin+":"+b.offerId]=b.clone()},getMetadata:function(b,a){return this._metadatas[b+
":"+a]},getMetadatas:function(){return a.copy(this._metadatas)},enhanceAsinsData:function(a){if("undefined"!==typeof a&&null!==a&&0!==a.length){var c=this;b.isArray(a)?a=b.map(a,function(a){return b.extend({},a,{metadata:c.getMetadata(a.asin,a.offerId)})}):a.metadata=c.getMetadata(a.asin,a.offerId)}return a},getPageAsin:function(){return this.enhanceAsinsData(d.getPageAsin())},getUpsellAsins:function(){return this.enhanceAsinsData(d.getUpsellAsins())},getAsins:function(){return this.enhanceAsinsData(d.getAsins())},
reset:function(){this._metadatas={}}})});"use strict";k.when("A","jQuery").register("ODSBuyboxAsinMetadata",function(d,c){var a=d.createClass({init:function(b,a,c,d,e,k,l){this.asin=b;this.offerId=a;this.buyingPrice=c;this.listingPrice=d;this.title=e;this.imageUrl=k;this.availabilityMessage=l},isValid:function(){var b="string"===typeof this.asin&&0<this.asin.length;return"number"===typeof this.buyingPrice&&b},clone:function(){return new a(this.asin,this.offerId,this.buyingPrice,this.listingPrice,
this.title)}});return a});"use strict";k.when("A","jQuery","a-modal").register("singleton-popup-modal",function(d,c,a){function b(b){null===e?(h=f.appendTo(c("body")),e=a.create(h,b)):e.update(b);e.show()}function g(){e&&e.hide()}var f=c('\x3cdiv style\x3d"display:none"\x3e'),h=null,e=null;d.declarative("cfg-singleton-modal-close","click",g);d.declarative("cfg-singleton-modal-open","click",function(a){b({inlineContent:a.data.inlineContent,header:a.data.header,width:a.data.width||"502",position:"triggerRight"},
!0)});return{show:b,hide:g,destroy:function(){e&&(a.remove(e),e=null)}}});"use strict";k.when("A").register("MakoCommonCartHelper",function(d){var c=d.$,a=d.createClass({init:function(b,a,c,d){this.sessionId=b||"";this.clientName=a||"";this.asinsData=c||[];this.additionalData=d||{};this.reftag;this.hasBeenPosted=!1},setSessionId:function(b){this.sessionId=b;return this},setClientName:function(b){this.clientName=b;return this},setAsinsData:function(b){if(Array.isArray(b))return this.asinsData=b,this},
addAsinData:function(b,a,c){this.asinsData.push({asin:b,offerId:a,quantity:c});return this},setAdditionalData:function(a){this.additionalData=a;return this},setReftag:function(a){this.reftag=a;return this},sendRequest:function(){if(this.hasBeenPosted)k.log("Request has already been sent.","WARN");else if(this._verifyRequest()){var a=this._buildRequestData();this.hasBeenPosted=!0;a=c.ajax({url:"/gp/add-to-cart/json/"+(this.reftag?"ref\x3d"+this.reftag:""),type:"POST",data:a});a.done(function(a){d.trigger("mako:common-cart-request:complete",
a)});return a}},_verifyRequest:function(){var a=!0;this.sessionId&&""!==this.sessionId||(a=!1,k.log("SessionId is undefined or blank","WARN"));this.asinsData&&this.asinsData.length||(a=!1,k.log("No asins data exist for cart handler request","WARN"));return a},_buildRequestData:function(){var a={};a.verificationSessionID=this.sessionId;a.clientName=this.clientName;for(var c=0;c<this.asinsData.length;c++){var d=this.asinsData[c];a["asin."+c]=d.asin;a["offeringID."+c]=d.offerId||d.offerListingID;a["quantity."+
c]=d.quantity}if(this.additionalData)for(var h in this.additionalData)this.additionalData.hasOwnProperty(h)&&(a[h]=this.additionalData[h]);return a}});return{createRequest:function(b,c){return new a(b,c)}}});"use strict";k.when().register("ExtraDataHelper",function(){function d(a,b){return a&&a.name&&0===a.name.indexOf(b)}function c(a,b){var c=Array.prototype.slice.call(a.elements);a=c.filter(function(a){return a&&a.tagName&&"input"===a.tagName.toLowerCase()&&d(a,["custom-name",b,""].join("."))});
c=c.filter(function(a){return a&&a.tagName&&"input"===a.tagName.toLowerCase()&&d(a,["custom-value",b,""].join("."))});return{names:a,values:c}}function a(a,b){return a!==q&&null!==a?a:b}function b(b,c,d){c=a(c,"([0-9]+)");d=a(d,"([0-9]+)");return new RegExp([b,c,d].join("."))}function g(a,b){var c=document.createElement("input");c.type="hidden";c.name=a;c.value=b;return c}function f(a,c,d,e){var f=b("custom-name",a);return c.reduce(function(b,c){var g=f.exec(c);if(g){var g=g[1],h=["custom-value",
a,g].join(".");b[g]={name:d(c),value:e(h)}}return b},{})}function h(a,b,c,d){Object.keys(b).forEach(function(e){var g=b[e],f=["custom-name",a,e].join(".");e=["custom-value",a,e].join(".");"object"===typeof g&&(c(f,g.name),d(e,g.value))})}function e(a,b){var c=Object.keys(a),d=function(b){return a[b]};return f(b,c,d,d)}function k(a,b,c){var d=function(b,c){a[b]=c};h(c,b,d,d)}function l(a,b){a=c(a,b);var d=a.names.map(function(a){return a.name}),e=function(a){return function(b){var c=a.filter(function(a){return a.name===
b});return c.length?c[0].value:q}};return f(b,d,e(a.names),e(a.values))}function p(a,b,d){var e=c(a,d),f=function(b){return function(c,d){var e=b.filter(function(a){return a.name===c});e.length?e.forEach(function(a){a.value=d}):a.appendChild(g(c,d))}};h(d,b,f(e.names),f(e.values))}function n(a){return Object.keys(a).reduce(function(b,c){c=a[c];b[c.name]=c.value;return b},{})}function r(a,b){var c=Object.keys(a).reduce(function(b,c){c=a[c];b[c.name]=c;return b},{});Object.keys(b).forEach(function(d){if(c[d])c[d].value=
b[d];else{var e=w(a),f={name:d,value:b[d]};a[e]=f;c[d]=f}});return a}function v(a,b){return a-b}function w(a){a=Object.keys(a).map(function(a){return parseInt(a)}).sort(v);if(a.length){if(1!==a[0])return 1;for(var b=1;b<a.length;b++)if(1!==a[b]-a[b-1])return a[b-1]+1;return a.length+1}return 1}return{getObjectExtraData:function(b,c){c=a(c,1);return n(e(b,c))},setObjectExtraData:function(b,c,d){d=a(d,1);c=r(e(b,d),c);k(b,c,d)},getFormExtraData:function(b,c){if(!b)return{};c=a(c,1);return n(l(b,c))},
setFormExtraData:function(b,c,d){b&&(d=a(d,1),c=r(l(b,d),c),p(b,c,d))}}})});
/* ******** */
(function(k){var m=window.AmazonUIPageJS||window.P,n=m._namespace||m.attributeErrors,d=n?n("DetailPagePreRegistrationAssets",""):m;d.guardFatal?d.guardFatal(k)(d,window):d.execute(function(){k(d,window)})})(function(k,m,n){k.when("A","a-checkbox","a-dropdown","ExtraDataHelper").register("PreRegistration.View",function(d,e,c,l){var f=d.$,h={},g=d.createClass({init:function(b,a){this.selectors={};this._setupSelectors(b,a);this.reset()},reset:function(){this._giftingCheckbox=e(this.selectors.GIFTING_CHECKBOX_SELECTOR);
this._giftingCheckboxElement=f(this.selectors.GIFTING_CHECKBOX_SELECTOR);this._accountLinkingCheckbox=e(this.selectors.ACCOUNT_LINKING_CHECKBOX_SELECTOR);this._accountLinkingCheckboxes=e(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_SELECTOR);this._desktopQuantityDropdown=c.getSelect(this.selectors.DESKTOP_QUANTITY_DROPDOWN_SELECTOR);this._mobileQuantityDropdown=c.getSelect(this.selectors.MOBILE_QUANTITY_DROPDOWN_SELECTOR);this._quantityAlert=f(this.selectors.QUANTITY_ALERT_SELECTOR);this._giftingAlert=
f(this.selectors.GIFTING_ALERT_SELECTOR);this._mainGiftingAlert=f(this.selectors.MAIN_GIFTING_ALERT_SELECTOR);this._declaratives=f(this.selectors.DECLARATIVES_SELECTOR);this._forms=f(this.selectors.FORMS_SELECTOR);this._quantityAlert.length&&(this._quantityAlertFormatString=this._quantityAlert.html())},_setupSelectors:function(b,a){this.selectors.ACCOUNT_LINKING_ATTRIBUTE_NAME="isDevicePreRegistered";this.selectors.MAX_QUANTITY_LIMIT_FORMAT_SPECIFIER="$PREREG_MAX_QUANTITY";this.selectors.AUI_HIDDEN_CLASS=
"aok-hidden";this.selectors.AUI_COLOR_TERTIARY="a-color-tertiary";this.selectors.GIFTING_CHECKBOX_SELECTOR="#gift-wrap"+b;this.selectors.ACCOUNT_LINKING_CHECKBOX_SELECTOR="#account-linking"+b;this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_SELECTOR=".pre-reg-checkbox-option";this.selectors.DESKTOP_QUANTITY_DROPDOWN_SELECTOR=a[b].desktopQuantityDropdown;this.selectors.MOBILE_QUANTITY_DROPDOWN_SELECTOR=a[b].mobileQuantityDropdown;this.selectors.QUANTITY_ALERT_SELECTOR="#preregistrationQuantityAlert"+b;
this.selectors.GIFTING_ALERT_SELECTOR="#preregistrationGiftingAlert"+b;this.selectors.MAIN_GIFTING_ALERT_SELECTOR="#preregistrationGiftingAlert";this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR="#preRegCheckboxText"+b;this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR=".mako-pre-reg-checkbox-text";this.selectors.DECLARATIVES_SELECTOR="#atc-declarative, #buyNow .a-declarative";this.selectors.FORMS_SELECTOR="form#addToCart, form#mobile-installments, form#buyNow, form#buyNowCheckout, form#oneClickBuy, form#buyNowOneClickCheckout"},
updateQuantityLimit:function(b){this._quantityAlert.length&&this._quantityAlertFormatString&&(b=this._quantityAlertFormatString.replace(this.selectors.MAX_QUANTITY_LIMIT_FORMAT_SPECIFIER,b),this._quantityAlert.html(b))},_setDeclarativeExtraData:function(b){this._declaratives.each(function(){var a=f(this),c=a.data("action");c&&(a=a.data(c))&&a.inputs&&l.setObjectExtraData(a.inputs,b)})},_setFormExtraData:function(b){this._forms.each(function(){l.setFormExtraData(this,b)})},setAccountLinkingAttributeValue:function(b){var a=
{};a[this.selectors.ACCOUNT_LINKING_ATTRIBUTE_NAME]=b;this._setDeclarativeExtraData(a);this._setFormExtraData(a)},_isCheckboxChecked:function(b){return!b.isEmpty()&&b.isChecked()},isGiftingChecked:function(){return this._isCheckboxChecked(this._giftingCheckbox)},uncheckGiftingbox:function(){e(this.selectors.GIFTING_CHECKBOX_SELECTOR).uncheck();this._hide(this._mainGiftingAlert)},isAccountLinkingChecked:function(){return this._isCheckboxChecked(this._accountLinkingCheckbox)},getQuantity:function(){return this._desktopQuantityDropdown?
this._desktopQuantityDropdown.val():this._mobileQuantityDropdown?this._mobileQuantityDropdown.val():1},scrollGiftingIntoView:function(){this._giftingCheckboxElement.length&&!d.onScreen(this._giftingCheckboxElement,5)&&this._giftingCheckboxElement[0].scrollIntoView()},_hide:function(b){b.addClass(this.selectors.AUI_HIDDEN_CLASS)},_show:function(b){b.removeClass(this.selectors.AUI_HIDDEN_CLASS)},_isHidden:function(b){return b.hasClass(this.selectors.AUI_HIDDEN_CLASS)},showGiftingAlert:function(){this._show(this._giftingAlert)},
hideGiftingAlert:function(){this._hide(this._giftingAlert)},showQuantityAlert:function(){this._show(this._quantityAlert)},hideQuantityAlert:function(){this._hide(this._quantityAlert)},isGiftingAlertHidden:function(){return this._isHidden(this._giftingAlert)},enableAccountLinkingCheckboxes:function(b){this._accountLinkingCheckboxes.enable();f(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);f(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);
b?this._accountLinkingCheckboxes.check():this._accountLinkingCheckboxes.uncheck()},enableInstanceAccountLinkingCheckbox:function(b){this._accountLinkingCheckbox.enable();f(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);f(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);b?this._accountLinkingCheckbox.check():this._accountLinkingCheckbox.uncheck()},disableAccountLinkingCheckbox:function(){this._accountLinkingCheckboxes.uncheck();
this._accountLinkingCheckbox.disable();f(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).addClass(this.selectors.AUI_COLOR_TERTIARY)},disableAccountLinkingCheckboxForQuantityCheck:function(){this._accountLinkingCheckbox.uncheck();this._accountLinkingCheckbox.disable();f(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).addClass(this.selectors.AUI_COLOR_TERTIARY)},isAccountLinkingCheckboxEnabled:function(){return this._accountLinkingCheckbox.isEnabled()},allAccountLinkingCheckboxEnabled:function(){return this._accountLinkingCheckboxes.isEnabled()},
updateAccountLinkingCheckboxes:function(b){b?this._accountLinkingCheckboxes.check():this._accountLinkingCheckboxes.uncheck()},openPopup:function(b){m.open(b,"popupWindow","width\x3d600,height\x3d400,scrollbars\x3dyes")}});return{getInstance:function(b,a){var c=""===b?"default":b;h[c]||(h[c]=new g(b,a));return h[c]}}});k.when("A","PreRegistration.View","PreRegistration.Metrics").register("PreRegistration.Controller",function(d,e,c){var l=d.$,f={},h={"":{quantityChangeEvent:"a:dropdown:selected:quantity",
mobileQuantityDropdown:"#quantity",desktopQuantityDropdown:"#mobileQuantityDropDown"},"-installment":{quantityChangeEvent:"a:dropdown:selected:installmentsQuantityDropdown",mobileQuantityDropdown:"#installmentsQuantityDropdown",desktopQuantityDropdown:"#installmentsQuantityDropdown"},"-deals":{quantityChangeEvent:"a:dropdown:dealOrderQuantityDropdown:select",mobileQuantityDropdown:"#dealOrderQuantityDropdown",desktopQuantityDropdown:"#dealOrderQuantityDropdown"}},g,b=d.createClass({init:function(a,
b){this.selectors={};this._data=a;this._view=e.getInstance(b,h);this._metrics=new c;this._suffix=b;this.reset(a);this._bindEventsOnce()},reset:function(a){this._setupSelectors(this._suffix);this._view.reset();this._view.uncheckGiftingbox();this._bindEventsDOM();"object"===typeof a?(this._showStatus=a.showStatus,this._maxQuantityLimit=a.maxQuantity,this._defaultValue=a.defaultValue,this._status=a.status,this._asin=a.asin,g=g==n?this._defaultValue:g,this._view.updateQuantityLimit(this._maxQuantityLimit),
this._view.setAccountLinkingAttributeValue(this._defaultValue),this._checkQuantity(this._view.getQuantity()),this._showStatus?this._metrics.emitGiftingAndAccountLinkingLoadedMetric(this._asin):this._metrics.emitGiftingLoadedMetric(this._asin)):this._view.setAccountLinkingAttributeValue("false")},_setupSelectors:function(a){this.selectors.QUANTITY_CHANGE_EVENT=h[a].quantityChangeEvent;this.selectors.DETAIL_PAGE_GIFTING_DECLARATIVE_NAME="detail-page-gifting-declarative"+a;this.selectors.DESKTOP_GIFTING_DECLARATIVE_NAME=
"mako-gifting-declarative"+a;this.selectors.MOBILE_POPOVER_TRIGGER_EVENT="a:popover:beforeSlide:preRegistration-secview"+a;this.selectors.MOBILE_GIFTING_DECLARATIVE_NAME="mako-gifting-declarative-mobile";this.selectors.ACCOUNT_LINKING_DECLARATIVE_NAME="mako-preReg-declarative"+a;this.selectors.POPUP_DECLARATIVE_NAME="preReg-popup-window"+a;this.selectors.PAGE_UPDATE_EVENT="a:pageUpdate";this.selectors.INSTALLMENT_ATC_SELECTOR="#installments-button";this.selectors.ADD_TO_CART_SELECTOR="#add-to-cart-button";
this.selectors.BUY_NOW_BUTTON_SELECTOR="#buy-now-button";this.selectors.BUY_NOW_CLICK_EVENT="click.makoPreRegistration";this.selectors.ONE_CLICK_BUTTON_SELECTOR="#one-click-button"},_checkQuantity:function(a){a>this._maxQuantityLimit&&this._isStatusAllowedConditional()?(this._view.scrollGiftingIntoView(),this._disableAccountLinkingCheckbox(),this._metrics.emitALForceUncheckedQuantityHigh(this._asin),this._view.isGiftingAlertHidden()&&this._view.showQuantityAlert()):(this._view.isGiftingChecked()||
(this._enableAccountLinkingCheckbox(g),this._view.hideGiftingAlert()),this._view.hideQuantityAlert())},_giftingCheckboxChecked:function(){this._view.hideQuantityAlert();this._view.showGiftingAlert();this._view.isAccountLinkingChecked()&&this._metrics.emitALForceUncheckedGiftingSelected(this._asin);this._disableAccountLinkingCheckbox()},_giftingCheckboxUnchecked:function(){this._view.hideGiftingAlert();this._enableAccountLinkingCheckbox();this._checkQuantity(this._view.getQuantity())},_enableAccountLinkingCheckbox:function(){this._view.enableInstanceAccountLinkingCheckbox(g);
this._view.setAccountLinkingAttributeValue(g?"true":"false")},_disableAccountLinkingCheckbox:function(){this._view.disableAccountLinkingCheckbox();g=this._view.isAccountLinkingChecked();this._view.setAccountLinkingAttributeValue("false")},_bindEventsOnce:function(){d.on(this.selectors.PAGE_UPDATE_EVENT,this._handlePageUpdate.bind(this));d.on(this.selectors.QUANTITY_CHANGE_EVENT,this._handleQuantityChange.bind(this));d.on(this.selectors.MOBILE_POPOVER_TRIGGER_EVENT,this._handlePopupClickMobile.bind(this));
d.declarative(this.selectors.DETAIL_PAGE_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));d.declarative(this.selectors.DESKTOP_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));d.declarative(this.selectors.MOBILE_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));d.declarative(this.selectors.ACCOUNT_LINKING_DECLARATIVE_NAME,"click",this._handleAccountLinkingClick.bind(this));d.declarative(this.selectors.POPUP_DECLARATIVE_NAME,"click",this._handlePopupClick.bind(this));
d.declarative(this.selectors.POPUP_DECLARATIVE_NAME,"mouseenter",this._handlePopupHover.bind(this))},_bindEventsDOM:function(){l(this.selectors.INSTALLMENT_ATC_SELECTOR).click(this._handleATC.bind(this,"ATC"));l(this.selectors.ADD_TO_CART_SELECTOR).click(this._handleATC.bind(this,"ATC"));l(this.selectors.BUY_NOW_BUTTON_SELECTOR).bind(this.selectors.BUY_NOW_CLICK_EVENT,this._handleATC.bind(this,"BUYNOW"));l(this.selectors.ONE_CLICK_BUTTON_SELECTOR).click(this._handleATC.bind(this,"ONECLICK"))},_handlePageUpdate:function(){this._view.reset();
var a=this._defaultValue;this._showStatus&&(a=this._view.isAccountLinkingChecked());this._view.setAccountLinkingAttributeValue(a?"true":"false")},_handleQuantityChange:function(a){this._checkQuantity(a.value)},_handleGiftingClick:function(a){if(this._isInputEvent(a)||this._isDefaultInstance())this._view.isGiftingChecked()?(this._giftingCheckboxChecked(),this._metrics.emitGiftingCheckedMetric(this._asin)):(this._giftingCheckboxUnchecked(),this._metrics.emitGiftingUncheckedMetric(this._asin))},_handleAccountLinkingClick:function(a){if(this._isInputEvent(a)){var b=
this._view.isAccountLinkingChecked();b?(this._view.uncheckGiftingbox(),this._handleGiftingClick(a),this._metrics.emitALCheckedMetric(this._asin)):this._metrics.emitALUncheckedMetric(this._asin);g=b;this._view.updateAccountLinkingCheckboxes(b);this._view.setAccountLinkingAttributeValue(b?"true":"false")}},_handlePopupClick:function(a){a.$event.preventDefault();a=a.$target.prop("href");this._view.openPopup(a);this._metrics.emitWhyIsThisImportantClickedMetric(this._asin)},_handlePopupClickMobile:function(a){this._metrics.emitWhyIsThisImportantClickedMetric(this._asin)},
_handlePopupHover:function(a){this._metrics.emitPopupHoverMetric(this._asin)},_handleATC:function(a){this._metrics.emitATCGiftingALSelectionMetric(this._asin,a,this._view.isGiftingChecked(),this._view.isAccountLinkingChecked())},_isInputEvent:function(a){return"input"===a.targetTag.toLowerCase()},_isStatusAllowedConditional:function(){return"ALLOWED_CONDITIONAL"===this._status},_isDefaultInstance:function(){return""===this._suffix},getInstanceData:function(){return this._data}});return{getInstance:function(a,
c){c="undefined"===typeof c?"":c;var d=""===c?"default":c;f[d]?a&&f[d].reset(a):f[d]=new b(a,c);return f[d]},reset:function(){Object.keys(f).forEach(function(a){var b=f[a].getInstanceData();f[a].reset(b)})}}});k.when("A","odsRefTagUtils").register("PreRegistration.Metrics",function(d,e){return d.createClass({emitGiftingAndAccountLinkingLoadedMetric:function(c){e.send("PREREGISTRATION_"+c+"_GIFTING_AL_LOADED")},emitGiftingLoadedMetric:function(c){e.send("PREREGISTRATION_"+c+"_ONLY_GIFTING_LOADED")},
emitALForceUncheckedQuantityHigh:function(c){e.send("PREREGISTRATION_"+c+"_AL_FORCE_UNCHECKED_QUANTITYHIGH")},emitALForceUncheckedGiftingSelected:function(c){e.send("PREREGISTRATION_"+c+"_AL_FORCE_UNCHECKED_GIFTINGSELECTED")},emitGiftingCheckedMetric:function(c){e.send("PREREGISTRATION_"+c+"_GIFTING_CHECKED")},emitGiftingUncheckedMetric:function(c){e.send("PREREGISTRATION_"+c+"_GIFTING_UNCHECKED")},emitALCheckedMetric:function(c){e.send("PREREGISTRATION_"+c+"_AL_CHECKED")},emitALUncheckedMetric:function(c){e.send("PREREGISTRATION_"+
c+"_AL_UNCHECKED")},emitWhyIsThisImportantClickedMetric:function(c){e.send("PREREGISTRATION_"+c+"_WHY_IS_THIS_IMPORTANT_CLICKED")},emitPopupHoverMetric:function(c){e.send("PREREGISTRATION_"+c+"_WHY_IS_THIS_IMPORTANT_HOVER")},emitATCGiftingALSelectionMetric:function(c,d,f,h){f?e.send("PREREGISTRATION_"+c+"_"+d+"_GIFTING_CHECKED"):e.send("PREREGISTRATION_"+c+"_"+d+"_GIFTING_UNCHECKED");h?e.send("PREREGISTRATION_"+c+"_"+d+"_AL_CHECKED"):e.send("PREREGISTRATION_"+c+"_"+d+"_AL_UNCHECKED")}})});k.when("A",
"PreRegistration.Controller").execute(function(d,e){d.on("a:accordion:buybox_accordion:select",function(c){e.reset()});d.on("a:accordion:buybox-accordion:select",function(c){e.reset()})})});
/* ******** */
(function(f){var c=window.AmazonUIPageJS||window.P,h=c._namespace||c.attributeErrors,a=h?h("DetailPageHIDECollectionsAssets",""):c;a.guardFatal?a.guardFatal(f)(a,window):a.execute(function(){f(a,window)})})(function(f,c,h){f.when("A","ready").register("hide-collections-engagement-metrics-pd",function(a){var g=function(a,d){c.ue&&c.ue.count&&c.ue.count(a,d)};return{logViewCounters:function(a,d,b){g("collectionsView-PD-"+d,1);b&&b.length&&(b=b.length,d===b&&g("collectionsLoadLast-PD-"+d,1),1===d&&a===
b&&g("collectionsLoopback-PD",1))},logInitialLoadCounter:function(){g("collectionsLoad-PD",1)},logImpressionCounters:function(a,d){g(a,d)}}});f.when("A","a-carousel-framework","hide-collections-engagement-metrics-pd","ready").execute(function(a,c,f){var d=[],b=function(e){var b=a.$("#hide-collections-container-pd .a-carousel-row-inner li[aria-posinset\x3d'"+e+"']").find(".a-column").size();0!==b&&(f.logImpressionCounters("collectionsTotalAsinShown-PD",b),d.push(e))};a.on("a:carousel:hide-collections-carousel-pd:change:pageNumber",
function(e){var c=e.carousel.getAttr("ajax").id_list;f.logViewCounters(e.oldValue,e.newValue,c);-1===d.indexOf(e.newValue)&&(1!==e.newValue&&2!==e.newValue?a.delay(function(){b(e.newValue)},1E3):b(e.newValue))});c.onInit("hide-collections-carousel-pd",function(a){a=a.getAttr("ajax").id_list;f.logInitialLoadCounter();f.logViewCounters(h,1,a);b(1)})})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageICartAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var d=window.AmazonUIPageJS||window.P,f=d._namespace||d.attributeErrors,b=f?f("AllOffersDisplayIngressAssets",""):d;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,d,f){c.execute("all-offers-display-ingress-init",function(){c.when("A","jQuery","all_offers_display_ingress_utils","all-offers-display-register-state").execute("all_offers_display_ingress_load_AOD_assets",function(b,a,e,g){function h(b){c.now().execute(function(a){a!==f||g.isMarkerOverrideRegistered()||
(c.register("aodIngressClick"),c.register("aodDeclarativeEvent",function(){return b}),g.setMarkerOverrideTriggered())})}b.state("aod:assetsLoaded",{isAodAssetsLoaded:!0});b.declarative("show-all-offers-display","click",function(a){a.$event.preventDefault();a.$event.stopPropagation();b.state("aod:assets2Loaded")||(e.isClickOnAODIngressSupported(a)?(h(a),c.when("aod-load-event-handler","aodDeclarativeEvent").execute(function(a,b){a.renderAodAction(b)})):e.redirectToOlp(a))});b.declarative("s-show-all-offers-display",
"click",function(a){a.$event.preventDefault();a.$event.stopPropagation();b.state("aod:assets2Loaded")||(e.isClickOnAODIngressSupported(a)?(h(a),c.when("search-all-offers-display-util","aodDeclarativeEvent").execute(function(a,b){a.searchOnClickHandler(b)})):e.redirectToOlp(a))})});c.when("A","jQuery","all-offers-display-register-state").execute("all-offers-display-enable-compare",function(b,a,e){b.state("aod:assets2Loaded")||-1===d.location.href.indexOf("#aod")&&-1===d.location.href.indexOf("#AOD")||
c.now().execute(function(a){a!==f||e.isMarkerOverrideRegistered()||(c.register("aodIngressClick"),e.setMarkerOverrideTriggered())})});c.when("A","jQuery","all_offers_display_ingress_olp_hyperlink").register("all_offers_display_ingress_utils",function(b,a,c){return{isClickOnAODIngressSupported:function(a){return c.getOlpHyperlink(a)?!0:!1},redirectToOlp:function(a){(a=c.getOlpHyperlink(a))?d.location.href=a:d.ueLogError&&d.ueLogError({logLevel:"ERROR",attribution:"aod_no_href",message:"[Redirection failed since href is null]"})}}});
c.register("all_offers_display_ingress_csm_counters",function(){var b=d.ue;return{incrementAndTriggerCounter:function(a){b&&b.count&&b.count(a,(b.count(a)||0)+1)},triggerUnitCounter:function(a){b&&b.count&&b.count(a,1)}}});c.when("all_offers_display_ingress_csm_counters").register("all_offers_display_ingress_aod_supported",function(b){return{isPropertySupported:function(a,e,g){var h=typeof a[e]===g;if(!h){var d={};a.tagName&&(d.tagName=a.tagName);a.getAttribute&&"function"===typeof a.getAttribute&&
(a.getAttribute("id")&&(d.id=a.getAttribute("id")),a.getAttribute("class")&&(d.class=a.getAttribute("class")),a.getAttribute("href")&&(d.href=a.getAttribute("href")));a="aodPropertyUnsupportedMessage, element: "+JSON.stringify(d);c.log(a+(", propertyName: "+e+", propertyType: "+g),"WARN","aodPropertyUnsupportedMessage");b.triggerUnitCounter("aodPropertyUnsupportedMessage")}return h}}});c.when("A","jQuery","all_offers_display_ingress_aod_supported").register("all_offers_display_ingress_olp_hyperlink",
function(b,a,c){return{getOlpHyperlink:function(b){if(b&&b.$event&&b.$event.target){var d=b.$event.target;if("A"===d.nodeName&&d.href)return d.href;if(c.isPropertySupported(b.$event.target,"closest","function"))return(b=d.closest("a"))?b.href:null;if(b=a(d).closest("a"))return b.attr("href")}return null}}});c.when("A","jQuery").register("all-offers-display-register-state",function(b,a){var c=!1;return{isMarkerOverrideRegistered:function(){return c},setMarkerOverrideTriggered:function(){c=!0}}})})});
/* ******** */
(function(c){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,b=d?d("NpxBuyNowAssets@Shared","NpxBuyNowAssets"):a;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,a,d){"use strict";c.when("ready").register("npx-buynow-csm",function(){return{logCount:function(b){a.ue&&a.ue.count&&a.ue.count(b,1)}}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("NpxBuyNowAssets@Desktop","NpxBuyNowAssets"):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){"use strict";b.when("A","npx-buynow-csm","ready").register("npx-buynow-education-desktop-logger",function(a,b){a.on("a:popover:show:buynow-education-popover",function(){b.logCount("desktopBuyNowEducationPopoverShow")})})});
/* ******** */
(function(k){var m=window.AmazonUIPageJS||window.P,y=m._namespace||m.attributeErrors,d=y?y("TurboCheckoutBaseAssets",""):m;d.guardFatal?d.guardFatal(k)(d,window):d.execute(function(){k(d,window)})})(function(k,m,y){"use strict";k.register("turbo-function-adapter",function(){return{adapt:function(d){return function(){if("function"!==typeof d)throw"Parameter 'property' is invalid. Expected a function but got "+typeof d;return d.apply(d,arguments)}}}});"use strict";k.when("turbo-configuration","turbo-function-adapter").execute("turbo-signin-adapter-factory",
function(d,c){k.when(d.get(d.KEYS.SHOW_SIGN_IN_INTERFACE)).register("turbo-signin-adapter",function(a){return{show:c.adapt(a.show)}})});"use strict";k.when("turbo-configuration","turbo-function-adapter").execute("turbo-view-adapter-factory",function(d,c){k.when(d.get(d.KEYS.VIEW_ADAPTER)).register("turbo-view-adapter",function(a){return{registerCallbacks:c.adapt(a.registerCallbacks),close:c.adapt(a.close),show:c.adapt(a.show),removeContent:c.adapt(a.removeContent),setContent:c.adapt(a.setContent),
closeImmediatelyThenExecute:c.adapt(a.closeImmediatelyThenExecute),closeAndNavigate:c.adapt(a.closeAndNavigate),closeToFullscreen:c.adapt(a.closeToFullscreen),updateBounds:c.adapt(a.updateBounds)}})});"use strict";k.when("turbo-checkout-page-ready").execute(function(){k.declare("turbo-eligibility-override",!1)});"use strict";k.when("A","turbo-checkout-csm","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-address-id",function(d,c,a){function b(a){for(var b=0;b<a.length;b++){var d=
e(a[b]);if(0<d.length)return c.logCount("turboCheckoutAddressSelectorIndex"+b),d}c.logCount("turboCheckoutAddressSelectorMissing");return e()}var e=d.$;return{getAddressId:function(){return b(a.get(a.KEYS.ADDRESS_INPUT_SELECTORS)).val()||""},set:function(c){b(a.get(a.KEYS.ADDRESS_INPUT_SELECTORS)).val()!==c&&b(a.get(a.KEYS.ADDRESS_INPUT_SELECTORS)).val(c).trigger("change",[c])}}});"use strict";k.when("A","turbo-checkout-utils","turbo-callback-list","turbo-configuration","turbo-checkout-load-events",
"turbo-checkout-page-ready").register("turbo-checkbox-exclusion-listener",function(d,c,a,b,e){function f(a){var c=p;p=!1;for(var b=0;b<l.length;b++){var d=r(l[b]).find("input[type\x3dcheckbox]");a(d)}c!==p&&(q("Exclusion checkbox state changed"),n.callAll("exclusionCheckbox"))}function h(a){var c;if(!(c=p)){c=!1;for(var b=0;b<a.length&&!c;b++){var d=r(a[b]);(c=d.prop("checked"))&&q("Exclusion checkbox is checked",d)}}p=c}function q(a,b){c.logDebug("turbo-checkbox-exclusion-listener",a,b)}function g(){f(h)}
var l=b.get(b.KEYS.CHECKBOX_EXCLUSION_ROOT_NODES),r=d.$,n=a.create(),p=!1;e.bind(function(){f(function(a){q("Listening for change events on:",a);a.unbind("change",g).bind("change",g);h(a)})});return{onStateChange:function(a){n.push(a)},isAnyCheckboxChecked:function(){return p}}});"use strict";k.when("A","turbo-callback-list","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-custom-price-input",function(d,c,a){function b(){var a=e();q!==a&&(q=a,h.callAll())}function e(){return f("#gcPriceOverride").val()||
""}var f=d.$,h=c.create(),q;a.bind(function(){q=e();f("#gcPriceOverride").unbind("change",b).bind("change",b)});return{getCustomPrice:e,onChange:function(a){h.push(a)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-callback-list","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-quantity-input",function(d,c,a,b,e,f){function h(c){var b;b=c?c.value?parseInt(c.value,10):c.target&&c.target.value?parseInt(c.target.value,
10):void 0:void 0;p===b?a.logDebug("turbo-checkout-quantity-input","Quantity change event does NOT have new quantity. Suppressing callbacks",void 0):(p=b,a.logDebug("turbo-checkout-quantity-input","Quantity change event",c),l.callAll())}function q(a){a=a.val();(a=parseInt(a,10))||c.logCount("turboCheckoutNoQuantityFromPage");return a}var g=d.$,l=e.create(),r=b.get(b.KEYS.QUANTITY_SELECT_SELECTOR),n="Multiple quantity nodes present on the page. This may lead to an incorrect quantity being used in Turbo! Selector \x3d "+
r,p;f.bind(function(){var b=g(r);p=q(b);b.unbind("change",h).bind("change",h);1<b.length&&(a.logError(n,"turbo-checkout-quantity-input"),a.logDebug("turbo-checkout-quantity-input",n,b));c.logCount("turboCheckoutQuantityNodes",b.length)});return{getQuantity:function(){return q(g(r))},setQuantity:function(a){var c=g(r),b=q(c);a=parseInt(a,10);b!==a&&c.val(a).change()},onChange:function(a){l.push(a)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-callback-list","turbo-configuration",
"turbo-checkout-quantity-input","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-warranty-input",function(d,c,a,b,e,f,h){var q=d.$,g=b.create(),l=e.get(e.KEYS.WARRANTY_CHECKBOX_INPUT_SELECTOR),r=e.get(e.KEYS.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR),n=e.get(e.KEYS.WARRANTY_ASIN_INPUT_NAME),p=e.get(e.KEYS.WARRANTY_OFFER_INPUT_SELECTOR);h.bind(function(){q(l).unbind("click",g.callAll).bind("click",g.callAll)});return{select:function(a){a&&q(r+" input[name^\x3d"+n+
"][value\x3d"+a+"]").parents(r).find(l).click()},onChange:function(a){g.push(a)},getLineItem:function(b){if(q(l+":checked").length){var d=q(l+":checked").first().parents(r).find("input[name^\x3d"+n+"]").val()||"",e=q(p).val()||"";b=parseInt(b,10)||f.getQuantity()||1;if(d&&e)return{asin:d,offerListingId:e,quantity:b,isDiscoveredAsin:!0};c.logCount("turboCheckoutIncompleteWarrantyInputs");a.logError("Incomplete input data for the selected warranty checkbox - asin:"+d+", offerId:"+e+", quantity:"+b)}else a.logDebug("turbo-checkout-warranty-input",
"No warranty checkbox is selected",void 0)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-callback-list","turbo-configuration","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-vas-input",function(d,c,a,b,e){function f(){return l(q).prop("checked")||!1}function h(){var a=n;n=f();a!==n&&r.callAll(n)}var q=b.get(b.KEYS.VAS_CHECKBOX_SELCTOR),g=b.get(b.KEYS.VAS_CHANGE_EVENTS),l=d.$,r=a.create(),n;e.bind(function(){n=f();g.forEach(function(a){d.off(a,h);d.on(a,
h)})});return{isSelected:f,onChange:function(a){r.push(a)}}});"use strict";k.when("A","turbo-checkout-utils","turbo-callback-list","turbo-checkout-load-events","turbo-checkout-csm","turbo-checkout-aui-page-state-parser","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-accessories-input",function(d,c,a,b,e,f,h){function q(){var a=t;t=z();t!==a&&u.callAll()}function g(){if(k===y&&w(v).length){var a=f.parse("simpleBundleParameterMap",".simpleBundleFeatureContainer");0===a.length?
(e.logCount("Turbo:Accessories:No:State"),k={}):l(a)}}function l(a){k={};a[0].items.forEach(function(a){k[a.asin]={asin:a.asin,offerListingId:a.offerListingId,isDiscoveredAsin:!0}})}function r(){return w(v).find("input[type\x3dcheckbox]")}function n(){r().unbind("change",q).bind("change",q)}function p(){return w(v).length?1>=t:0===t}function z(){var a=0;r().each(function(){w(this).prop("checked")&&a++});c.logDebug("turbo-checkout-accessories-input","Accessories selected "+a);return a}var w=d.$,u=
a.create(),t=0,k,v=h.get(h.KEYS.ENABLED_ACCESSORIES_SELECTOR);g();n();b.bind(function(){g();n();z()});return{isEligible:p,registerCallback:function(a){u.push(a)},getLineItem:function(){if(p()){var a;a=r().filter(":checked").val();a=k?k[a]:void 0;return a||y}return y},select:function(a){a&&w(v+" input[type\x3dcheckbox][value\x3d"+a+"]").click()}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-form","turbo-checkout-ref-tagger","turbo-checkout-page-state","turbo-checkout-product-state",
"turbo-checkout-page-ready").register("turbo-checkout-joined-state",function(d,c,a,b,e,f,h){function q(a,c,b){c&&(b&&(c.quantity=b),a.push(c))}function g(a,n){function f(){var b=a.turboWeblab;b||c.logCount("turboCheckoutWeblabNameNotDefinedInState");return b}function h(){return a.turboWeblabTreatment}this.pageState=a;this.productStates=n;this.getLineItems=function(){return g.lineItemInputs};this.getActiveId=function(){return g.id};this.getHeaderText=function(){return g?g.turboHeaderText||a.turboHeaderText:
a.turboHeaderText};this.getLoadingText=function(){return a.turboLoadingText};this.getAddressId=function(){return a.addressId};this.getRequestId=function(){return a.requestId};this.getSessionId=function(){return a.sessionId};this.getInitiateSelector=function(){return a.initiateSelector};this.getWeblab=f;this.getWeblabTreatment=h;this.isTurboLaunched=function(){return!f()&&"C"!==h()};this.isProductStateEligible=function(){return n.isTurboEligible};this.getRefTag=function(){if(!g)throw"Turbo checkout product state is NOT resolved. Cannot generate ref tag";
var a=d.$("#"+g.id),a=b.getRefTag(a);return e.generateJoinedValue(a)};this.resolve=function(a){if(a){g=n.states[a];if(!g)throw a="Resolved turbo checkout product state is undefined. Id \x3d "+a,l(a,n),a;l("Resolved new product state",g);d.trigger("turbo:checkout:state:product:resolved")}};var g=1!==n.states.length?y:n.states[0]}function l(c,b){a.logDebug("turbo-checkout-joined-state",c,b)}return{createTurboState:function(a,b,d,e,w,u){if(e&&d)throw"Custom item price is NOT supported with warranty";
var l=f.get();b&&(l.addressId=b);b=h.get();if(a||e||d||u)a=parseInt(a,10),b.states.forEach(function(b){b.lineItemInputs.forEach(function(b){a&&(b.quantity=a);e?(b.customItemPrice=e,c.logCount("turboCheckoutItemPriceOverrided")):b.customItemPrice&&c.logCount("turboCheckoutItemPriceSelectorFallBackToTurboState")});q(b.lineItemInputs,u,a);q(b.lineItemInputs,d,a)});l=new g(l,b);l.resolve(w);return l}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-aui-page-state-parser",
"turbo-checkout-page-ready").register("turbo-checkout-page-state",function(d,c,a,b,e){function f(a,c,b,d,e,f,g,h,q){this.version=a;this.turboWeblab=c;this.turboWeblabTreatment=b;this.initiateSelector=d;this.turboLoadingText=e;this.turboHeaderText=f;this.addressId=g;this.requestId=h;this.sessionId=q}function h(c,b){a.logDebug("turbo-checkout-page-state",c,b)}var q=b.get(b.KEYS.TURBO_PAGE_STATE_KEY),g=b.get(b.KEYS.PAGE_STATE_PARSING_ROOT_NODE_SELECTOR),l=new f("0","","C","#buy-now-button","","","",
"","");return{get:function(b,d){b=b||q;d=d||g;d=e.parse(b,d);c.logCount("turboCheckoutPageStates",d.length);1<d.length?(a.logError("Multiple turbo checkout page states found! Turbo will NOT show","turbo-checkout-page-state",void 0),h("PageStates",d),b=void 0):(0===d.length&&h("Turbo checkout page state ["+b+"] is NOT present"),b=d[0]);if(b)if(b.version)b=new f(b.version,b.turboWeblab||"",b.turboWeblabTreatment||"C",b.initiateSelector||".buy-now-button",b.turboLoadingText||"",b.turboHeaderText||"",
b.addressId||"",b.requestId||"",b.sessionId||"");else{d=b.inputs||{};var p=b.strings||{};b=new f("1",b.turboWeblab||"",b.turboWeblabTreatment||"C",(b.configurations||{}).initiateSelector||"#buy-now-button",p.TURBO_LOADING_TEXT||"",p.TURBO_CHECKOUT_HEADER||"",d.addressId||"",d.requestId||"",d.sessionId||"")}else c.logCount("turboCheckoutStateNotDefined"),b=l;h("Turbo Checkout PageState",b);return b}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-aui-page-state-parser",
"turbo-checkout-page-ready").register("turbo-checkout-product-state",function(d,c,a,b,e){function f(a,b){this.isTurboEligible=a;this.states=b}function h(a,b,c,d){this.id=a;this.isTurboEligible=b;this.lineItemInputs=c;this.turboHeaderText=d||""}function q(a,b,c,d,e,f,n,g,h){this.asin=b||"";this.offerListingId=c||"";this.quantity=parseInt(d,10)||1;this.isTurboEligible=!!this.asin&&!!this.offerListingId&&a;this.productTitle=e||"";this.customItemPrice=f||"";this.addToCartTimeAsUnixEpochMilliseconds=n||
"";this.addToCartSessionId=g||"";this.isDiscoveredAsin=!!h}function g(b,c){a.logDebug("turbo-checkout-product-state",b,c)}function l(a){if(!a.lineItemInputs||!a.lineItemInputs.length||!a.id)return g('Versioned product state is invalid. Expected non empty "id" and "lineItemInputs". Turbo may NOT show',a),p;var b=!0,c=d.map(a.lineItemInputs,function(a){a=new q(a.isTurboEligible,a.asin,a.offerListingId,a.quantity,a.productTitle,a.customItemPrice,a.addToCartTimeAsUnixEpochMilliseconds,a.addToCartSessionId,
a.isDiscoveredAsin);b=b&&a.isTurboEligible;return a});return new h(a.id,b,c,a.turboHeaderText)}var r=b.get(b.KEYS.TURBO_PRODUCT_STATE_KEY),n=b.get(b.KEYS.PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR),p=new h("buy-now-button",!1,[],""),z=new f(!1,[p]);return{get:function(b,d){b=b||r;d=d||n;d=e.parse(b,d);c.logCount("turboCheckoutProductStates",d.length);1<d.length&&"turbo-checkout-page-state"===b?(a.logError("turbo-checkout-page-state only supports the single item use case! Turbo will NOT show","turbo-checkout-product-state",
void 0),b=[]):b=d;if((d=b)&&d.length){var t=!1;b=[];for(var k=0;k<d.length;k++){var v;var m=d[k];m?m.version?v=l(m):m.inputs&&m.eligibility?(v=m.strings||{},m=new q(m.eligibility.isEligible,m.inputs.a,m.inputs.oid,m.inputs.quantity,v.TURBO_CHECKOUT_HEADER,m.inputs.customItemPrice),v=new h("buy-now-button",m.isTurboEligible,[m],v.TURBO_CHECKOUT_HEADER)):(g('Legacy product state is missing "inputs" or "eligibility". Turbo will NOT show',m),v=p):(g("Product state parsed DOM object is invalid. Turbo may NOT show",
m),v=p);t=t||v.isTurboEligible||!1;m=v.id;if(b[m])throw d="Duplicate product state found. id \x3d "+m,g(d,b),d;b.push(v);b[v.id]=v}b=new f(t,b)}else g("Parsed states are invalid. Turbo will NOT show",d),b=z;g("Turbo Checkout Product State(s)",b);return b}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-auto-open","turbo-checkout-address-id","turbo-checkout-quantity-input","turbo-checkout-warranty-input","turbo-checkout-custom-price-input",
"turbo-callback-list","turbo-checkout-joined-state","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-state-handler",function(d,c,a,b,e,f,h,q,g,l,r,n){function p(a,b,c,d,e,p){a=a||h.getQuantity();b=b||f.getAddressId();c=c||q.getLineItem(a);d=d||g.getCustomPrice();p=p||n.getLineItem();return r.createTurboState(a,b,c,d,e,p)}function z(a,c){b.logDebug("turbo-checkout-state-handler",a,c)}function w(a,b,c,d,e){x=p(a,b,c,y,d,e)}function u(){d.trigger("turbo:checkout:product:onChange");
m.callAll()}function t(){var a=p();b.isDeepEquals(x,a)||(x=a,z("New Turbo State",x),u())}var k=d.$,v=c.get(c.KEYS.AJAX_PAGE_UPDATE_EVENT),m=l.create(),x,B=!1;x=p();return{isProductTurboEligible:function(){return!B&&x.isProductStateEligible()||c.get(c.KEYS.OVERRIDE_ELIGIBILITY)},getLineItems:function(){return x.getLineItems()},getAddressId:function(){return x.getAddressId()},getWeblabAllocation:function(){return x.getWeblabTreatment()},registerCallback:function(a){m.push(a)},startMonitoringPage:function(){e.updateInputsAndThen(w);
h.onChange(t);q.onChange(t);g.onChange(t);n.registerCallback(t);d.off(v,t);d.on(v,t);u()},getRequestId:function(){return x.getRequestId()},getSessionId:function(){return x.getSessionId()},getExperimentName:function(){return x.getWeblab()},getStrings:function(){return{TURBO_LOADING_TEXT:x.getLoadingText(),TURBO_CHECKOUT_HEADER:x.getHeaderText()}},getInitiateSelector:function(){return x.getInitiateSelector()},isTurboLaunched:function(){return x.isTurboLaunched()},isPhysicalGiftCardExperimentEligible:function(){var b=
0!==k("#giftcardcustomtwister_feature_div").length;b&&(z("Physical Gift Card use case"),a.logCount("turboCheckoutGiftCardUseCase"));return b},setTurboStateNotEligible:function(){B=!0},resolveProductState:function(a){x.resolve(a)},getActiveId:function(){return x.getActiveId()},getRefTag:function(){return x.getRefTag()}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-aui-page-state-parser",function(d,c){var a=d.$;return{parse:function(b,d){b="script[data-a-state*\x3d'"+
b+"'], #"+b;d=d?a(d).find(b):a(b);b=[];for(var f=0;f<d.length;f++){var h;a:{try{var q=a(d[f]).text();h=JSON.parse(q);break a}catch(g){c.logError("JSON::parse exception. Exception \x3d "+g,"turbo-checkout-aui-page-state-parser",void 0)}h=void 0}h&&b.push(h)}return b}}});"use strict";k.when("jQuery","turbo-checkout-auto-open","turbo-checkout-page-ready").register("turbo-checkout-page-load-spinner",function(d,c){function a(){0!==d("#turbo-checkout-auto-load-spinner-container").length&&(d("#turbo-checkout-auto-load-spinner-container").remove(),
e.unbind("touchmove touchstart touchend touchcancel click scroll",b))}function b(a){a.preventDefault();a.stopPropagation()}var e=d("body");c.isAutoOpenEligible()&&(e.bind("touchmove touchstart touchend touchcancel click scroll",b),e.append("\x3cdiv id\x3d'turbo-checkout-auto-load-spinner-container' class\x3d'turbo-checkout-auto-load-spinner-container'\x3e\x3cdiv id\x3d'turbo-checkout-auto-load-circle-container' class\x3d'turbo-checkout-auto-load-circle-container'\x3e\x3cdiv id\x3d'turbo-checkout-auto-load-spinner' class\x3d'a-spinner a-spinner-medium turbo-checkout-auto-load-spinner'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e"),
setTimeout(a,5E3));return{removePageLoadSpinner:a}});"use strict";k.when("turbo-configuration","turbo-checkout-ref-tagger","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-urls",function(d,c,a){function b(a,b){var c=d.get(d.KEYS.DEVICE_OVERRIDE);return"\x26pipelineType\x3dturbo\x26clientId\x3dretailwebsite"+(c?"\x26devicestring-override\x3d"+c:"")+g(a,b)}function e(a){var b=d.get(d.KEYS.HOST_PAGE_TYPE_IDENTIFIER);return"ref_\x3d"+a+"\x26referrer\x3d"+b}function f(b){return a.isNonEmptyString(b)?
"\x26weblab\x3d"+b:""}function h(){return d.get(d.KEYS.IS_ADD_TO_CART_ENABLED)?"\x26temporaryAddToCart\x3d1":""}function q(b){if(!b||!b.length)return"";d.get(d.KEYS.IS_ADD_TO_CART_ENABLED)||a.logError('Discovered asins present but add to cart is disabled? This will generate a "clickstream_ignore" hit on the server side and cause the hit to be ignored by clickstream and the attribution lost!',"turbo-checkout-urls");var c="";b.forEach(function(a,b){c+="\x26discoveredAsins."+b+"\x3d"+a});return c}function g(b,
c){var d="";a.isNonEmptyString(b)&&(d+="\x26pageRequestId\x3d"+b);a.isNonEmptyString(c)&&(d+="\x26pageSessionId\x3d"+c);return d}function l(){return r("auiDebug","auiDebug")+r("ds_user","ds_user")+r("ds_turbo_workspace","ds_workspace")+r("stringDebug","stringDebug")}function r(b,c){var d="";b=a.getUrlQueryParam(b);a.isNonEmptyString(b)&&(d="\x26"+c+"\x3d"+b);return d}return{buildInitiatePathWith:function(a,c,d,g){return"/checkout/turbo-initiate?"+e(a)+b(d,g)+f(c)+h()+l()},buildEligibilityPathWith:function(a,
c,d,g){return"/checkout/turbo-initiate?"+e(a)+b(d,g)+f(c)+"\x26checkEligibilityOnly\x3dtrue"+h()+l()},buildConfirmPathWith:function(a,c,d,g,r){return"/checkout/turbo-initiate/confirm?"+e(a)+b(d,g)+f(c)+h()+q(r)},buildLogPageHitPathWith:function(a,d){return"/checkout/log-page-hit?"+c.generateRefTag(a,c.ACTIONS.CLOSE,d)+b()},buildTriggerWeblabPathWith:function(a,b,c,d,h){return"/checkout/triggerWeblab?"+e(a)+f(b)+"\x26weblabAllocation\x3d"+c+g(d,h)},buildTriggerWeblabPathWithoutWeblab:function(a,b,
c){return"/checkout/triggerWeblab?"+e(a)+g(b,c)}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-callback-list",function(){function d(){var c=[];this.callAll=function(){for(var a=0;a<c.length;a++){var b=c[a];b.apply(b,arguments)}};this.push=function(a){if("function"!==typeof a)throw"Invalid callback. Expected typeof 'callback' to be 'function'. typeof \x3d "+typeof a;-1===c.indexOf(a)&&c.push(a)};this.remove=function(a){a=c.indexOf(a);-1!==a&&c.splice(a,1)}}return{create:function(){return new d}}});
"use strict";k.when("turbo-callback-list","turbo-checkout-page-ready").register("turbo-filtered-callback-list",function(d){function c(a){var b=d.create();this.callAll=b.callAll;this.remove=b.remove;this.push=function(c){(c=c[a])&&"function"===typeof c&&b.push(c)}}return{create:function(a){if(!a||"string"!==typeof a)throw"Invalid filter parameter. Expected 'filter' to be a non empty string. typeof \x3d "+typeof a+" value \x3d "+a;return new c(a)}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-utils",
"turbo-checkout-page-ready").register("turbo-checkout-form",function(d,c,a){function b(a){var b=c.get(c.KEYS.FORM_SELECTOR_OVERRIDE);if(b&&0<e(b).length)return e(b);b=c.get(c.KEYS.FORM_TYPE);if("link"===b)return a.find("a");if("form"===b)return a.closest("form");throw"Unsupported FORM_TYPE is configured. value \x3d "+b;}var e=d.$,f=/[\/?&]ref_?=([^?&]+)/;return{getForms:b,getRefTag:function(c){if(1!==c.length)return a.logError("Expected getRefTag input to have a single element. Cannot resolve refTag as this is a data quality risk",
"turbo-checkout-form"),a.logDebug("turbo-checkout-form","Expected getRefTag input to have a single element. Cannot resolve refTag as this is a data quality risk",c),"";c=b(c);c=((c.attr("action")||c.attr("href")||"")+"\x26"+c.serialize()).match(f)||{};return 2===c.length?c[1]:""}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-page-ready").register("turbo-checkout-ajax-wrapper",function(d,c){return{load:function(a,b){b.hasOwnProperty("timeout")||(b.timeout=2E4);return d.ajax(a,b)},
loadWithJQXHR:function(a,b){b.hasOwnProperty("timeout")||(b.timeout=2E4);return d.$.ajax(a,b)},createXHRRequest:function(){var a=new XMLHttpRequest;a.timeout=2E4;return a}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-session-storage","turbo-checkout-quantity-input","turbo-checkout-address-id","turbo-checkout-warranty-input","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-auto-open",function(d,c,a,b,e,f,h,q){function g(b,
c){a.logDebug("turbo-checkout-auto-open",b,c)}function l(){return r()&&0!==k}function r(){var d;if(d="1"===t.trb_open||"1"===a.getUrlQueryParam("trb_open"))(d=b.isPresent("hasTurboAutoOpened"))&&c.logCount("turboCheckoutAutoOpenLoopPrevented"),d=!d;return d}function n(){return 1===k&&r()}function p(){n()&&(l()&&(k=2,b.set("hasTurboAutoOpened","1")),A(t.trb_bid),d.trigger("turbo:checkout:auto:open"))}var z=d.$,k=0,u="trb_open trb_addr trb_qty trb_warrAsin trb_auth trb_sid trb_bid trb_accessoryAsin trb_accessoryOffer".split(" "),
t={},A=function(){};return{setup:function(b,c){if(r()){k=1;var e=m.location.href;z.each(u,function(b,c){b=a.getUrlQueryParam(c);t[c]=b;e=a.removeQueryParam(c,b,e)});g("Parameters:",t);a.replaceHistory(e);"function"===typeof b?A=b:a.logError("Initiate action must be supplied, and it must be a function.");d.on("turbo:checkout:prefetcher:state:dataStale",p);c()}else k=0,g("Disabled")},reset:function(){b.remove("hasTurboAutoOpened")},isAutoOpenEligible:r,isAutoOpenEnabled:l,isAutoOpenReadyToBeOpened:n,
updateInputsAndThen:function(a){var b=t.trb_qty,c=t.trb_addr,d=t.trb_warrAsin,g=t.trb_bid,n=t.trb_accessoryAsin,r=t.trb_accessoryOffer;if(b||c||d||g||n||r){b&&e.setQuantity(b);c&&f.set(c);var p;d&&(h.select(d),p=h.getLineItem(b));var l;n&&r&&(q.select(n),l=q.getLineItem());a(b,c,p,g,l)}}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-checkout-utils",function(){function d(){return navigator.userAgent}function c(a,b){if(a===b||"function"===typeof a&&"function"===typeof b)return!0;
if(typeof a!==typeof b)return!1;if("object"!==typeof a||null===a||null===b)return a===b||a!==a&&b!==b;var d=Object.getOwnPropertyNames(a);if(d.length!==Object.getOwnPropertyNames(b).length)return!1;for(var f=0;f<d.length;f++){var h=d[f];if(!a.hasOwnProperty(h)||!b.hasOwnProperty(h)||!c(a[h],b[h]))return!1}return!0}return{logError:function(a,b){k.log(a,"ERROR",b||"turbo-checkout-utils")},logWarning:function(a,b){k.log(a,"WARN",b||"turbo-checkout-utils")},logDebug:function(){},getUserAgent:d,isAndroid:function(){return!!d().match(/[a|A]ndroid/)},
isIPhone:function(){return!!d().match(/iPhone/)},isIPad:function(){return!!d().match(/iPad/)},isInternetExplorer:function(){return!!d().match(/MSIE/)},createFQDN:function(a){/^http/.test(a)||(a=m.location.origin?m.location.origin+a:m.location.protocol+"//"+m.location.hostname+":"+m.location.port+a);return a},getUrlQueryParam:function(a,b){b||(b=m.location.href);a=a.replace(/[\[\]]/g,"\\$\x26");return(a=(new RegExp("[?\x26]"+a+"(\x3d([^\x26#]*)|\x26|#|$)")).exec(b))?a[2]?decodeURIComponent(a[2].replace(/\+/g,
" ")):"":y},removeQueryParam:function(a,b,c){var d=c;a&&b&&c&&(a=a+"\x3d"+b,d=c.replace(new RegExp("\\?"+a+"[\x26]?","g"),"?"),d=d.replace(new RegExp("[\x26]?"+a,"g"),""));return d},replaceHistory:function(a){m.history.pushState&&m.history.replaceState(null,m.title,a)},isNonEmptyString:function(a){return"string"===typeof a&&0<a.length},isDeepEquals:c}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-csm",function(d){function c(a,c,d,e){return"function"===
typeof m.uet?m.uet.apply(m.uet,arguments):e||b()}function a(a,b,c){return"function"===typeof m.ues?m.ues.apply(m.ues,arguments):c}function b(){return+new Date}function e(d){function e(){q&&f&&p&&h&&!k&&"function"===typeof u&&(u(q,f,p,h),k=!0)}var f,h,p,q,k=!1,u;this.getId=function(){return d};this.markClick=function(){q=c("tc",d)};this.markFirstByte=function(){f=a("t0",d,b())};this.markAboveTheFold=function(){p=c("af",d);e()};this.markCriticalFeature=function(){h=c("cf",d);e()};this.whenDataSet=function(a){u=
a;e()}}function f(a){"undefined"!==typeof m.ue_t0&&m.ue.count(a,Date.now()-m.ue_t0)}var h=0,q=[];return{createScope:function(){return new e("chk_turbo_"+ ++h)},logCount:function(a,b){b=b||1;d.logDebug("Logging counter "+a+" with value "+b);if(m.ue&&m.ue.count){var c=a+"_time";m.ue.count(a,b);f(c);for(var e=0;e<q.length;++e)m.ue.count(a+"."+q[e],b),f(c+"."+q[e])}},addCounterExtraSuffix:function(a){q.push(a)},timestamp:b}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-page-ready").register("turbo-checkout-counter",
function(d,c){var a=0,b=0,e=0,f=0,h=0,q=0,g="u";d.on("turbo:checkout:sheet:beforeOpen",function(){c.logCount("turboCheckoutSheetOpen",a);"u"!==g?(++h,c.logCount("turboCheckoutPrefetchUsed",h),"p"===g?c.logCount("turboCheckoutPrefetchUsedInProgress",h):c.logCount("turboCheckoutPrefetchUsedFull",h)):(++q,c.logCount("turboCheckoutPrefetchMissing",q))});d.on("turbo:checkout:sheet:beforeClose",function(){++b;c.logCount("turboCheckoutSheetClose",b)});d.on("turbo:checkout:prefetcher:state:dataPrefetching",
function(){c.logCount("turboCheckoutPrefetchRequested",e);g="p"});d.on("turbo:checkout:prefetcher:state:dataFresh",function(){++f;c.logCount("turboCheckoutPrefetchAvailable",f);g="a"});d.on("turbo:checkout:prefetcher:state:dataStale",function(){g="u"});return{incrementSheetOpenedCounter:function(){a++},incrementPrefetchCounter:function(){e++},getSheetOpenCount:function(){return a},getPrefetchCount:function(){return e}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-checkout-cacher",
function(){return{createCache:function(d){var c=!1,a;return function(){c||(a=d(),c=!0);return a}}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-utils","turbo-checkout-counter","turbo-checkout-page-ready").register("turbo-checkout-ref-tagger",function(d,c,a,b){function e(a,c,d){a="chk_"+a+"_"+(c+"_"+b.getPrefetchCount()+"-"+b.getSheetOpenCount());return f(d?a+"_"+d:a)}function f(a){if(!("string"===typeof a&&0<a.length&&64>=a.length&&q.test(a))||g.test(a))throw"Invalid ref tag. This would be filtered and replaced in clickstream. Value \x3d "+
a;return a}var h={ELIGIBILITY:"eligibility",BUY_NOW:"buyNow",CLOSE:"close"},q=/(^[A-z]$|^[A-z][A-z0-9_-]*[A-Za-z0-9]$)/,g=/[_-]{2,}/,l=c.get(c.KEYS.HOST_PAGE_TYPE_IDENTIFIER);return{generateRefTag:function(a,b,c){return"ref_\x3d"+e(a,b,c)},generateValue:e,generateJoinedValue:function(c){if(!c)return e(l,h.BUY_NOW,"fallback");try{var d=c+"_"+(h.BUY_NOW+"_"+b.getPrefetchCount()+"-"+b.getSheetOpenCount());return f(d)}catch(g){return a.logError(g,"turbo-checkout-ref-tagger"),e(l,h.BUY_NOW,"fallback")}},
generateEligibilityValue:function(){return e(l,h.ELIGIBILITY)},ACTIONS:h,TAGS:{TOUCH:"touch",TOUCH_X:"touchX",BACK:"back",ROTATION:"rotation"}}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-checkout-prefetch-timer",function(d){function c(){f||(f=!0,d.trigger("turbo:checkout:timer:onTimeout"))}function a(){if(f)return!0;var a=(new Date).getTime();return e?6E5<=a-e:!1}var b,e,f=!1;return{startTimer:function(){b||(b=m.setTimeout(c,6E5));e||(e=(new Date).getTime())},isTimeout:a,
resetTimer:function(){m.clearTimeout(b);f=!1;e=b=null},checkTimeout:function(){a()&&c()}}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-form","turbo-checkout-buy-now-onclick-handler","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-buy-now-button",function(d,c,a,b,e,f,h,q){function g(a,c){b.logDebug("turbo-checkout-buy-now-button",a,c)}function l(a){return a?r(a):c(e.getInitiateSelector())}function r(d){var e=
c("#"+d),f=q.get(q.KEYS.BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID);if(!f)return e;var h=c("[id\x3d"+d+"]");if(2>h.length)return e;a.logCount("turboCheckoutBuyNowDuplicateIdPresent");g("Duplicate nodes present for BuyNow button ID: #"+d+". Resolving BuyNow button with CSS: "+f);h=h.filter(f);return 1!==h.length?(a.logCount("turboCheckoutBuyNowUnableToResolveButtonIdWithCss"),b.logError("Unable to resolve a unique BuyNow button with CSS: "+f+". Defaulting to first button with ID: #"+d,"turbo-checkout-buy-now-button",
void 0),e):h}function n(b){g("Buy now button clicked");a.logCount("turboCheckoutBuyNowClicked");h.isConflictingOnClickListenerPresent(c(b.currentTarget))&&(F=!0);b&&b.currentTarget&&b.currentTarget.id||(g("Click event target is INVALID. Expected event target with an id. Turbo will NOT show",b),F=!0);if(F)F=!1,g("Buy now button callbacks supressed");else{e.resolveProductState(b.currentTarget.id);var d;g("Calling buy now button callbacks...");d=!1;for(var n=0;n<v.length;n++)d=d||v[n]();d?(g("Supressing default buy now button action"),
b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation(),d=!0):d=void 0;if(d)return!1}f.getForms(c(b.currentTarget)).attr("data-action",p());g("Calling default BuyNow action. User will be sent to Checkout SPC. Turbo will NOT show.");a.logCount("turboCheckoutBuyNowDefault");h.callCachedOnClickListenerIfPresent(b.currentTarget,b);return!0}function p(){return l().attr("name")||"submit.buy-now"}function k(a){for(var b=v.length-1;0<=b;--b)v[b]===a&&v.splice(b,1)}function m(a){if(!a&&1<l().length)throw"Button id parameter is NOT present. Cannot execute action without a button id on a page with multiple buy now buttons!";
}function u(a){a=l(a);t(a);a.click()}function t(b){for(var d=q.get(q.KEYS.CONFLICTING_INITIATE_LISTENERS),e=0;e<d.length;e++){var f=d[e];g("Unbound configured event '"+f+"' from buy now button");a.logCount("turboCheckoutBuyNowButtonConflictingListeners");b.unbind(f);c(document.body).undelegate(b.selector,f)}}var A=q.get(q.KEYS.BUY_NOW_CLICK_EVENT),v=[],F=!1;d.on("turbo:checkout:clickInitiate",u);a.logCount("turboCheckoutBuyNowButtonBound");return{registerOnClickCallback:function(a){k(a);v.push(a)},
deregisterOnClickCallback:k,executeOriginalBuyNowAction:function(a){m(a);F=!0;d.trigger("turbo:checkout:buyNowDisabled");d.trigger("turbo:checkout:clickInitiate",a)},executeTurboBuyNowAction:function(a){m(a);F=!1;u(a)},getSubmitAction:p,bindTurboClickEvent:function(a){a=a||l();h.removeConflictingOnClickListenerIfPresentAndCacheIt(a);a.unbind(A).bind(A,n)},removeConflictingListeners:t,getBuyNowButtons:l}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-buy-now-onclick-handler",
function(d,c,a,b){function e(a,b){a.each(function(a,d){c(d).removeProp(b)})}function f(a,b){var d=!1;a.each(function(){var a=c(this),e=a.find("[onclick]"),f=a.prop("onclick"),h=e.prop("onclick");return g(f)&&g(h)||1<e.length||!g(f||h)||q(a)!==b?(d=!0,!1):!0});return d}function h(a){return a.prop("onclick")||a.find("[onclick]").prop("onclick")}function q(a){return a.attr("onclick")||a.find("[onclick]").attr("onclick")}function g(a){return"function"===typeof a}function l(a,c){b.logDebug("turbo-checkout-buy-now-onclick-handler",
a,c)}var r;return{callCachedOnClickListenerIfPresent:function(b,c){g(r)&&(l("BuyNow button onclick listener function called."),a.logCount("turboCheckoutBuyNowButtonOnClickListenerCalled"),r.call(b,c.originalEvent))},removeConflictingOnClickListenerIfPresentAndCacheIt:function(b){var c=h(b),d=q(b);g(c)&&d&&(f(b,d)?(l("[DOM ERROR] Turbo will NOT show. BuyNow button node has INVALID 'onclick' DOM structure.",b),a.logCount("turboCheckoutBuyNowButtonInvalidOnClickDOM")):(l("BuyNow button node has 'onclick' attribute. Removing its listener and caching it.",
b),a.logCount("turboCheckoutBuyNowButtonOnClickListenerRemoveAndCache"),r=c,c=b.find("[onclick]"),e(b,"onclick"),e(c,"onclick")))},isConflictingOnClickListenerPresent:function(b){if(b=g(h(b)))l("Turbo will NOT show. BuyNow button node has conflicting 'onclick' listener."),a.logCount("turboCheckoutBuyNowButtonConflictingOnClickListener");return b}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-buy-now-button","turbo-checkout-page-ready").register("turbo-checkout-buy-now-integration",
function(d,c,a){function b(a,b){c.logDebug(a,"turbo-checkout-buy-now-integration",b)}var e=d.$,f=[];d.on("turbo:checkout:page:reappear",function(){b("Removing additional form inputs from form",f);for(var a;(a=f.shift())!==y;)a.remove()});return{isBuyNow:function(b){return b instanceof e&&b.attr("data-action")===a.getSubmitAction()},checkoutWith:function(a,d){if(Array.isArray(a)&&d instanceof e){var g;g=d;for(var l=1;0<g.find('input[name\x3d"asin.'+l+'"]').length||0<g.find('input[name\x3d"offeringID.'+
l+'"]').length;)l++;g=l;for(var l=[],r=0;r<a.length;r++){var n=a[r];if(n!==y&&n.asin&&n.offerListingId){var p=g,n=[e("\x3cinput /\x3e",{type:"hidden",name:"asin."+p,value:n.asin}),e("\x3cinput /\x3e",{type:"hidden",name:"offeringID."+p,value:n.offerListingId}),e("\x3cinput /\x3e",{type:"hidden",name:"quantity."+p,value:n.quantity||1})];Array.prototype.push.apply(l,n);g++}else b('Line item inputs are invalid. Expected "asin" and "offerListingId" keys in object. Customer purchase inputs ignored!',n),
c.logError('Line item inputs are invalid. Expected "asin" and "offerListingId" keys in object. Customer purchase inputs ignored!')}r=d.find('input[name\x3d"itemCount"]');1===r.length?r.val(g):d.append(e("\x3cinput /\x3e",{type:"hidden",name:"itemCount",value:g}));b("Appended additional buy now inputs.",l);d.append.apply(d,l);f=l}else g="Inputs are invalid. Expected array and jQuery object. lineItems \x3d "+a+" $form \x3d "+d,b(g,arguments),c.logError(g)}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-configuration-keys",
function(d){var c={HOST_PAGE_TYPE_IDENTIFIER:"HOST_PAGE_TYPE_IDENTIFIER",FORM_TYPE:"FORM_TYPE",FORM_SELECTOR_OVERRIDE:"FORM_SELECTOR_OVERRIDE",BUY_NOW_BUTTON_SELECTOR:"BUY_NOW_BUTTON_SELECTOR",BUY_NOW_BUTTON_V2_SELECTOR:"BUY_NOW_BUTTON_V2_SELECTOR",BUY_NOW_CLICK_EVENT:"BUY_NOW_CLICK_EVENT",BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID:"BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID",QUANTITY_SELECT_SELECTOR:"QUANTITY_SELECT_SELECTOR",ADDRESS_INPUT_SELECTORS:"ADDRESS_INPUT_SELECTORS",WARRANTY_CHECKBOX_INPUT_SELECTOR:"WARRANTY_CHECKBOX_INPUT_SELECTOR",
WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR:"WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR",WARRANTY_ASIN_INPUT_NAME:"WARRANTY_ASIN_INPUT_NAME",WARRANTY_OFFER_INPUT_SELECTOR:"WARRANTY_OFFER_INPUT_SELECTOR",AJAX_PAGE_UPDATE_EVENT:"AJAX_PAGE_UPDATE_EVENT",PREFETCH_TREATMENT:"PREFETCH_TREATMENT",NO_PREFETCH_TREATMENT:"NO_PREFETCH_TREATMENT",BUY_NOW_ONLY_TREATMENT:"BUY_NOW_ONLY_TREATMENT",IS_DEVICE_FILTER_REQUIRED:"IS_DEVICE_FILTER_REQUIRED",IS_SIGN_IN_SUPPORTED:"IS_SIGN_IN_SUPPORTED",USES_MASH_WILL_REAPPEAR:"USES_MASH_WILL_REAPPEAR",
SHOW_SIGN_IN_INTERFACE:"SHOW_SIGN_IN_INTERFACE",IFRAME_ID:"IFRAME_ID",EXTEND_ELIGIBLE_STATE:"EXTEND_ELIGIBLE_STATE",VIEW_ADAPTER:"VIEW_ADAPTER",PAGE_STATE_PARSING_ROOT_NODE_SELECTOR:"PAGE_STATE_PARSING_ROOT_NODE_SELECTOR",PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR:"PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR",TURBO_PAGE_STATE_KEY:"TURBO_PAGE_STATE_KEY",TURBO_PRODUCT_STATE_KEY:"TURBO_PRODUCT_STATE_KEY",DEVICE_OVERRIDE:"DEVICE_OVERRIDE",CONFLICTING_INITIATE_LISTENERS:"CONFLICTING_INITIATE_LISTENERS",VAS_CHANGE_EVENTS:"VAS_CHANGE_EVENTS",
VAS_CHECKBOX_SELCTOR:"VAS_CHECKBOX_SELCTOR",CHECKBOX_EXCLUSION_ROOT_NODES:"CHECKBOX_EXCLUSION_ROOT_NODES",MASH_ADAPTER:"MASH_ADAPTER",IS_ADD_TO_CART_ENABLED:"IS_ADD_TO_CART_ENABLED",IS_BUYNOW_ENABLED_FOR_SCREENREADER:"IS_BUYNOW_ENABLED_FOR_SCREENREADER",BACKGROUND_SCROLL_TARGET_SELECTOR:"BACKGROUND_SCROLL_TARGET_SELECTOR",NO_PREFETCH_EXPERIMENT_WEBLABS:"NO_PREFETCH_EXPERIMENT_WEBLABS",ENABLED_ACCESSORIES_SELECTOR:"ENABLED_ACCESSORIES_SELECTOR",OVERRIDE_ELIGIBILITY:"OVERRIDE_ELIGIBILITY",validate:function(a){if("string"!==
typeof a||!c[a])throw"The key '"+a+"' is not defined within 'turbo-configuration-keys'.";}};return c});"use strict";k.when("A","turbo-configuration-keys","turbo-device-configuration","turbo-client-configuration","turbo-eligibility-override","turbo-checkout-page-ready").register("turbo-configuration",function(d,c,a,b,e){function f(a,b){var c=h(a);l[a]=c===y?b:c}function h(c){var d=b[c];c=a[c];if(q(d))return d;if(q(c))return c}function q(a){return"boolean"===typeof a||a}function g(c){if(!q(b[c])&&!q(a[c]))throw"Required configuration override for key '"+
c+"' is missing";l[c]=h(c)}var l;return{get:function(a){c.validate(a);var b;l||(l={},g(c.HOST_PAGE_TYPE_IDENTIFIER),g(c.SHOW_SIGN_IN_INTERFACE),g(c.EXTEND_ELIGIBLE_STATE),g(c.VIEW_ADAPTER),f(c.FORM_TYPE,"form"),f(c.FORM_SELECTOR_OVERRIDE,""),f(c.BUY_NOW_BUTTON_SELECTOR,"#buy-now-button"),f(c.BUY_NOW_BUTTON_V2_SELECTOR,".checkout-buy-now"),f(c.BUY_NOW_CLICK_EVENT,"click.turboCheckout"),f(c.BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID,""),f(c.QUANTITY_SELECT_SELECTOR,'select[name\x3d"quantity"]'),
f(c.ADDRESS_INPUT_SELECTORS,["#unifiedLocation1ClickAddress","#unifiedLocationAddress"]),f(c.WARRANTY_CHECKBOX_INPUT_SELECTOR,".mbb-checkbox input[name\x3dmbba]"),f(c.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR,".mbb-checkbox-column"),f(c.WARRANTY_ASIN_INPUT_NAME,"mbba"),f(c.WARRANTY_OFFER_INPUT_SELECTOR,"#mbb-offering-id"),f(c.AJAX_PAGE_UPDATE_EVENT,"a:pageUpdate"),f(c.PREFETCH_TREATMENT,"PREFETCH_DISABLED"),f(c.NO_PREFETCH_TREATMENT,"T1"),f(c.BUY_NOW_ONLY_TREATMENT,"BUY_NOW_LAUNCHED"),f(c.IS_DEVICE_FILTER_REQUIRED,
!1),f(c.IS_SIGN_IN_SUPPORTED,!0),f(c.USES_MASH_WILL_REAPPEAR,!1),f(c.IFRAME_ID,"turbo-checkout-iframe"),f(c.PAGE_STATE_PARSING_ROOT_NODE_SELECTOR,"#turboState"),f(c.PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR,"#turboState"),f(c.TURBO_PAGE_STATE_KEY,"turbo-checkout-page-state"),f(c.TURBO_PRODUCT_STATE_KEY,"turbo-checkout-page-state"),f(c.DEVICE_OVERRIDE,""),f(c.CONFLICTING_INITIATE_LISTENERS,[]),f(c.CHECKBOX_EXCLUSION_ROOT_NODES,"#simpleBundle_feature_div #monthlyPayments_feature_div #bbg_feature_div #addons_feature_div #mobile-accessory-upsell #detailPageGifting_feature_div #twister-plus-feature".split(" ")),
f(c.ENABLED_ACCESSORIES_SELECTOR,".simpleBundleCheckBoxArea"),f(c.MASH_ADAPTER,""),f(c.IS_ADD_TO_CART_ENABLED,!0),f(c.IS_BUYNOW_ENABLED_FOR_SCREENREADER,!0),f(c.BACKGROUND_SCROLL_TARGET_SELECTOR,"#productTitleGroupAnchor"),f(c.VAS_CHANGE_EVENTS,["turbo:checkout:sheet:doClose"]),f(c.VAS_CHECKBOX_SELCTOR,"#vas-checkbox-input"),f(c.VAS_CHANGE_EVENTS,["turbo:checkout:sheet:doClose"]),f(c.VAS_CHECKBOX_SELCTOR,"#vas-checkbox-input"),f(c.NO_PREFETCH_EXPERIMENT_WEBLABS,["RCX_CHECKOUT_TURBO_PRIME_UPSELL_222066"]),
f(c.OVERRIDE_ELIGIBILITY,e));b=l;return b[a]},KEYS:d.copy(c)}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-weblab-allocation","turbo-checkout-state-handler","turbo-checkbox-exclusion-listener","turbo-checkout-content-loader","turbo-checkout-device-filter","turbo-callback-list","turbo-checkout-auto-open","turbo-checkout-vas-input","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-base-eligible-state",function(d,c,a,b,e,f,h,q,g,l){function k(){A=!0}function n(){A=
!1}function p(){var d=new m;f.isDeviceTurboEligible()||d.invalidate("Device is NOT eligible");e.isError()&&!c.isNoPrefetch()&&d.invalidate("Prefetch failed");a.isProductTurboEligible()||d.invalidate("Product is NOT eligible");q.isAutoOpenEnabled()||A||d.invalidate("Cheetah eligibility response is false");c.isControl()&&d.invalidate("Weblab is in CONTROL");c.isBuyNowOnly()&&d.invalidate("Weblab is in buy now only treatment");g.isSelected()&&d.invalidate("Value added service is selected and NOT supported");
l.isEligible()||d.invalidate("Accessory selection was not eligible");b.isAnyCheckboxChecked()&&d.invalidate("Exclusion case checkbox is checked");u.callAll(d);d.logInvalidState();return d.canShow()}function m(){var a=!0,b=[];this.invalidate=function(c){a=!1;b.push(c)};this.logInvalidState=function(){a||d.logDebug("turbo-base-eligible-state","Cannot show turbo because: "+b)};this.canShow=function(){return a}}function w(a){t.callAll(p(),a)}var u=h.create(),t=h.create(),A=!1;return{addStateCheck:function(a){u.push(a)},
canShow:p,registerStateChangeCallback:function(a){t.push(a)},onStateChange:w,setup:function(){e.registerCallback({onTurboEligible:k,onFinish:k,onTurboIneligible:n});a.registerCallback(w);b.onStateChange(w);g.onChange(w);l.registerCallback(w)}}});"use strict";k.when("A","turbo-callback-list","turbo-checkout-page-ready").register("turbo-checkout-base-view",function(d,c){function a(a){if("string"!==typeof a)throw"Parameter 'iFrameContainerSelector' is not a string.";this.onBoundsAdjustedCallbacks=c.create();
this.IFRAME_CONTAINER_SELECTOR=a}var b=d.$;a.prototype.updateBounds=function(a,b){if("number"!==typeof a)throw'Parameter "iFrameContainerHeightInPixels" is not a number. Cannot validate bounds.';var c=this.$getIFrameContainer().height(),d=a-c,g=c+d;0!==d&&(this.$getIFrameContainer().height(g),b&&a!==b?(this.$getIFrame().height(b),this.$getIFrameContainer().css("overflow-y","scroll"),this.$getIFrameContainer().css("-webkit-overflow-scrolling","touch")):(this.$getIFrame().height("100%"),this.$getIFrameContainer().css("overflow-y",
""),this.$getIFrameContainer().css("-webkit-overflow-scrolling","")),a=parseInt(this.$getIFrameContainer().css("min-height"),10),g=g>a?g:a,c!==g&&this.onBoundsAdjustedCallbacks.callAll(g))};a.prototype.$getIFrameContainer=function(){return b(this.IFRAME_CONTAINER_SELECTOR)};a.prototype.$getIFrame=function(){return b(this.IFRAME_CONTAINER_SELECTOR+" iframe")};a.prototype.pushBoundsAdjustedCallback=function(a){this.onBoundsAdjustedCallbacks.push(a)};return{extend:function(){function b(){a.apply(this,
arguments)}b.prototype=Object.create(a.prototype);return b.prototype.constructor=b}}});"use strict";k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-eligible-state-check",function(d){d.get(d.KEYS.EXTEND_ELIGIBLE_STATE)||k.when("turbo-base-eligible-state").register("turbo-checkout-eligible-state",function(c){return{canShow:c.canShow,registerStateChangeCallback:c.registerStateChangeCallback,setup:c.setup}})});"use strict";k.when("A","turbo-checkout-state-handler","turbo-configuration",
"turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-weblab-allocation",function(d,c,a){function b(){return c.getWeblabAllocation()}function e(){return c.getExperimentName()}function f(){return"C"===b()}function h(){var b=a.get(a.KEYS.NO_PREFETCH_EXPERIMENT_WEBLABS);return Array.isArray(b)&&-1!==b.indexOf(e())&&!f()}return{getAllocation:b,getExperimentName:e,isControl:f,isBuyNowOnly:function(){return b()===a.get(a.KEYS.BUY_NOW_ONLY_TREATMENT)},isPrefetch:function(){return!h()&&
b()===a.get(a.KEYS.PREFETCH_TREATMENT)},isNoPrefetch:function(){var c=a.get(a.KEYS.NO_PREFETCH_TREATMENT);return h()||!!b().match(c)}}});"use strict";k.when("A","jQuery","turbo-checkout-ajax-wrapper","turbo-checkout-utils","turbo-checkout-urls","turbo-checkout-csm","turbo-checkout-weblab-allocation","turbo-checkout-buy-now-button","turbo-checkout-form","turbo-configuration","turbo-checkout-state-handler","turbo-checkout-eligibility-response-weblabs","turbo-checkout-page-ready").register("turbo-checkout-weblab-trigger",
function(d,c,a,b,e,f,h,q,g,l,k,n){function p(){d.on("turbo:checkout:prefetch:onTurboEligible",function(){D=!0;t()})}function z(){d.on("turbo:checkout:prefetch:onTurboIneligible",function(){D=!1;t()})}function w(){d.on("a:pageUpdate",function(){t()})}function u(){d.on("turbo:checkout:auto:open",function(){F()})}function t(){0===A().length?f.logCount("turboCheckoutBuyNowButtonMissing"):0===g.getForms(A()).length&&f.logCount("turboCheckoutBuyNowFormMissing");0<g.getForms(A()).length&&(D?(b.logDebug("turbo-checkout-weblab-trigger",
"Adding trigger to form: "+h.getAllocation()),B.val(h.getAllocation()),y.val(h.getExperimentName()),G.val(k.getRequestId()),C.val(k.getSessionId()),g.getForms(A()).append(B,y,G,C)):(b.logDebug("turbo-checkout-weblab-trigger","Removing trigger from form: "+h.getAllocation()),B.remove(),y.remove(),G.remove(),C.remove()))}function A(){var a=l.get(l.KEYS.BUY_NOW_BUTTON_SELECTOR),b=l.get(l.KEYS.BUY_NOW_BUTTON_V2_SELECTOR);return 0===c(a).length?c(b):c(a)}function v(){if(n.get()&&0<n.get().length||D&&!k.isTurboLaunched())b.logDebug("turbo-checkout-weblab-trigger",
"Calling cheetah to trigger: "+h.getAllocation()),0<g.getForms(A()).find(B).length||f.logCount("turboCheckoutTriggerMissing"),F(!D||k.isTurboLaunched())}function F(a){a=a?e.buildTriggerWeblabPathWithoutWeblab(k.getRefTag,k.getRequestId(),k.getSessionId()):e.buildTriggerWeblabPathWith(k.getRefTag(),h.getExperimentName(),h.getAllocation(),k.getRequestId(),k.getSessionId());var b={additionalWeblabsToTrigger:JSON.stringify(n.get())},d="function"===typeof m.Blob;"function"===typeof m.navigator.sendBeacon&&
d?(b=new Blob([c.param(b)],{type:"application/x-www-form-urlencoded"}),m.navigator.sendBeacon(a,b)||f.logCount("turboCheckoutTriggerRecordingFailed")):x(a,b)}function x(b,c){a.load(b,{method:"POST",params:c,error:function(a,b,c){a&&204===a.http.status||f.logCount("turboCheckoutTriggerRecordingFailed")},abort:function(a){f.logCount("turboCheckoutTriggerRecordingFailed")}})}var B,y,G,C,D=!1;return{setup:function(){B=c("\x3cinput/\x3e",{type:"hidden",name:"triggerTurboWeblab",value:""});y=c("\x3cinput/\x3e",
{type:"hidden",name:"triggerTurboWeblabName",value:""});G=c("\x3cinput/\x3e",{type:"hidden",name:"turboPageRequestId",value:""});C=c("\x3cinput/\x3e",{type:"hidden",name:"turboPageSessionId",value:""});w();p();z();q.registerOnClickCallback(v);u()}}});"use strict";k.when("A","turbo-checkout-form","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-page-ready").register("turbo-checkout-page-filter",function(d,c,a,b){function e(b,c){a.logDebug("turbo-checkout-page-filter",b,c)}return{isCurrentViewTurboEligible:function(){var a=
d.$(b.getInitiateSelector()),h=c.getForms(a),k=0<a.length&&a.length===h.length;k||(e("Page is NOT turbo eligible. Parent forms / nested links do not match the number of initiate selectors",a),e("Forms",h));return k}}});"use strict";k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-device-filter-check",function(d){d.get(d.KEYS.IS_DEVICE_FILTER_REQUIRED)||k.when("turbo-checkout-cacher","turbo-checkout-page-ready").register("turbo-checkout-device-filter",function(c){var a=function(){return!0};
return{isDeviceTurboEligible:c.createCache(a),isSignInSupported:c.createCache(a)}})});"use strict";k.when("A","turbo-checkout-state-handler","turbo-checkout-device-filter","turbo-checkout-page-filter","turbo-checkout-weblab-allocation","turbo-checkout-page-ready").register("turbo-checkout-eligibility-aggregator",function(d,c,a,b,e){return{isTurboEligible:function(){return b.isCurrentViewTurboEligible()&&c.isProductTurboEligible()&&!e.isBuyNowOnly()},isSignInSupported:function(){return a.isSignInSupported()&&
!e.isBuyNowOnly()},shouldAttemptPrefetch:function(){return a.isDeviceTurboEligible()&&!e.isBuyNowOnly()}}});"use strict";k.when("A","turbo-checkout-ref-tagger","turbo-filtered-callback-list","turbo-checkout-state-handler","turbo-checkout-ajax-wrapper","turbo-checkout-utils","turbo-checkout-urls","turbo-checkout-csm","turbo-checkout-eligibility-aggregator","turbo-checkout-eligibility-response-weblabs","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-content-loader",
function(d,c,a,b,e,f,h,k,g,l,r){function n(a){k.logCount("turboCheckoutInitiate");K();M=!1;L=Date.now();u("Notifying loading callbacks");E="started";P.callAll();d.trigger("turbo:checkout:prefetch:onStart");k.logCount("turboCheckoutPrefetchStart");var f=a?c.generateEligibilityValue():b.getRefTag(),f=(a?h.buildEligibilityPathWith:h.buildInitiatePathWith)(f,b.getExperimentName(),b.getRequestId(),b.getSessionId());D=e.loadWithJQXHR(f,{type:"POST",data:p(a),headers:z(),xhr:w,success:v,error:F})}function p(a){var c=
{isAsync:1};b.getAddressId()&&(c.addressID=b.getAddressId());b.isPhysicalGiftCardExperimentEligible()&&(c.isPhysicalGiftCard=b.isPhysicalGiftCardExperimentEligible());if(a&&r.isEligible()&&r.getLineItem()){var d=r.getLineItem();c["asin.1"]=d.asin;c["offerListing.1"]=d.offerListingId;c["requiresEligibilityCheck.1"]="true"}a||b.getLineItems().forEach(function(a,b){b+=1;c["asin."+b]=a.asin;c["offerListing."+b]=a.offerListingId;c["quantity."+b]=a.quantity;a.customItemPrice&&(c["customItemPrice."+b]=a.customItemPrice,
c.customItemPrice=a.customItemPrice);var d=a.addToCartTimeAsUnixEpochMilliseconds;d&&(c["addToCartTimeAsUnixEpochMilliseconds."+b]=d);(a=a.addToCartSessionId)&&(c["addToCartSessionId."+b]=a)});return c}function z(){var a={"x-amz-support-custom-signin":1};a["x-amz-turbo-checkout-dp-url"]=m.location.href;a["x-amz-checkout-entry-referer-url"]=m.location.href;return a}function w(){var a=e.createXHRRequest();a.addEventListener("readystatechange",function(){if(M||!a.readyState||2>a.readyState)u("Ignoring ready state changed event because headers already received or missing xhr");
else if(M=!0,k.logCount("turboCheckoutPrefetchHeadersReceived"),k.logCount("turboCheckoutPrefetchHeadersReceivedDuration",Date.now()-L),x(a)){u("Headers received: Turbo eligible");k.logCount("turboCheckoutTurboEligibleAfterCheetahChecks");var b=t(a),c=g.isSignInSupported();b&&(u("Headers received: Signin required"),k.logCount("turboCheckoutSigninRequired"),c||(u("Sign-in required but it is disabled or not supported."),k.logCount("turboCheckoutSigninNotSupported")));if(c||!b)u("Notifying turbo eligible callbacks"),
I.callAll(),d.trigger("turbo:checkout:prefetch:onTurboEligible");A(a)&&R.callAll(a.getResponseHeader("x-amzn-checkout-login-provider"))}else u("Headers received: Not turbo eligible"),S.callAll(),d.trigger("turbo:checkout:prefetch:onTurboIneligible")});return a}function u(a,b){f.logDebug("turbo-checkout-content-loader",a,b)}function t(a){return a&&a.getResponseHeader("x-amzn-checkout-login-required")}function A(a){return g.isSignInSupported()&&t(a)}function v(a,b,c){k.logCount("turboCheckoutPrefetchEnd",
Date.now()-L);D=null;b=x(c);var e,g=a&&a.match(G);if(g&&0<g.length)try{var h=C(g[0]);e=C.parseJSON(h.text())}catch(p){f.logError("Could not extract page state from cheetah page: "+p)}else u("Could not extract page state from response data");var h=e&&"turbo"===e.pipelineType,g=e&&e.currentPurchaseId&&0<String(e.currentPurchaseId).trim().length,n=c.getResponseHeader("x-amzn-experiment-weblabs-to-trigger");if(n!==y){var m=[];try{m=JSON.parse(n)}catch(p){console.error("Error parsing additional weblabs from xhr response header: ",
p)}l.set(m)}h&&!g&&f.logError("No purchaseid provided, cannot show turbo");b&&h&&g?("started"!==E&&f.logError("turbo-checkout-content-loader","Error processing turbo available callbacks. Expected state to be started but was "+E),u("Notifying turbo available callbacks"),E="success",Q.callAll(a,e),d.trigger("turbo:checkout:prefetch:onSuccess"),k.logCount("turboCheckoutTurboPrefetchSuccess")):b&&A(c)?u("Body received: Eligible and sign-in is supported and required."):(u("Body received: No turbo page or not eligible: isTurboEligible: "+
b+" isTurboPage: "+h+" hasPurchaseId: "+g),B(),k.logCount("turboCheckoutTurboPrefetchFail"))}function F(a,b,c){k.logCount("turboCheckoutPrefetchEnd");D=null;u("Error while initiate",c);k.logCount("turboCheckoutTurboPrefetchError");"timeout"===b&&k.logCount("turboCheckoutInitiateTimeOut");B()}function x(a){return a&&a.getResponseHeader("x-amz-turbo-checkout-eligible")}function B(){"started"!==E&&f.logError("turbo-checkout-content-loader","Error processing turbo not available callbacks. Expected state to be started but was "+
E);u("Notifying error callbacks");E="error";O.callAll();d.trigger("turbo:checkout:prefetch:onError")}function K(){D&&D.abort&&(u("Aborting running request..."),D.abort())}var G=/<script.*data-a-state.*checkout:conductor:page.*>.*<\/script>/,C=d.$,D,E="stopped",L,M=!1,P=a.create("onStart"),Q=a.create("onFinish"),O=a.create("onError"),I=a.create("onTurboEligible"),S=a.create("onTurboIneligible"),R=a.create("onSigninRequired");d.on("turbo:checkout:signInController:onDoSignIn",B);return{registerCallback:function(a){P.push(a);
Q.push(a);O.push(a);I.push(a);R.push(a);S.push(a)},callInitiate:function(){u("Calling turbo initiate");n()},checkEligibility:function(){u("Calling turbo eligibility check only");n(!0)},abortCall:K,isSuccess:function(){return"success"===E},isError:function(){return"error"===E},isStarted:function(){return"started"===E}}});"use strict";k.when("A","jQuery","turbo-checkout-ref-tagger","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-history-manager",function(d,c,a,b){function e(){if(m.history.state&&
m.history.state.turboAction)return m.history.state.turboAction}c(m).bind("popstate.turbo",function(c){e();e()?(b.logDebug("turbo-checkout-history-manager","Trigger sheet open"),d.trigger("turbo:checkout:sheet:doOpen")):(b.logDebug("turbo-checkout-history-manager","Trigger sheet close"),d.trigger("turbo:checkout:sheet:doClose",{immediate:!1,reason:a.TAGS.BACK}))});return{sheetOpened:function(){e();e()||(b.logDebug("turbo-checkout-history-manager","Adding turbo history state"),m.history.pushState({turboAction:"popover"},
document.title+" Turbo open"))},sheetClosed:function(){e();e()&&(b.logDebug("turbo-checkout-history-manager","Removing turbo history state"),m.history.back())}}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-base-visibility-manager",function(d){function c(){d.trigger("turbo:checkout:page:gone")}return{setup:function(){d.on("turbo:checkout:sheet:onNavigateAway",c)}}});k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-mash-will-reappear-check",function(d){d.get(d.KEYS.USES_MASH_WILL_REAPPEAR)||
k.when("turbo-base-visibility-manager").register("turbo-checkout-page-visibility-manager",function(c){return c})});"use strict";k.when("A","jQuery","turbo-checkout-view-state","turbo-checkout-weblab-allocation","turbo-checkout-state-handler","turbo-checkout-content-loader","turbo-checkout-prefetch-timer","turbo-checkout-page-visibility-manager","turbo-checkout-counter","turbo-checkout-utils","turbo-checkout-eligibility-aggregator","turbo-checkout-auto-open","turbo-checkout-page-ready").register("turbo-checkout-prefetcher",
function(d,c,a,b,e,f,h,k,g,l,m,n){function p(a){var b=w;w=a;l.logDebug("turbo-checkout-prefetcher","Transitioning from "+b.name+" to "+a.name);if(b.onExit)b.onExit(a.name);if(a.onEnter)a.onEnter(b.name);d.trigger("turbo:checkout:prefetcher:state:"+a.name);d.trigger("turbo:checkout:prefetcher:state",a.name)}var z,w,u=function(){var a=f.isError(),b=!m.isTurboEligible(),c=h.isTimeout(),d=0===z;l.logDebug("turbo-checkout-prefetcher","Test is data stale: isStaleWhenCheetahReturnsError: "+a+" isStaleWhenProductNotEligiblie: "+
b+" isStaleWhenTimeoutOccurs: "+c+" isStaleWhenNoMorePrefetchesAvailable: "+d);return a||b||c||d},t=function(){var a=m.isTurboEligible()&&!h.isTimeout()&&0<z;l.logDebug("turbo-checkout-prefetcher","Test should prefetch: eligibilityAggregator.isTurboEligible(): "+m.isTurboEligible()+" !timer.isTimeout(): "+!h.isTimeout()+" _prefetchesAvailable: "+z);return a},A={name:"start",onEvent:function(a){m.shouldAttemptPrefetch()?"controller:onPageLoaded"===a&&p(v):p(B)},onExit:function(){e.startMonitoringPage()}},
v={name:"dataStale",onEvent:function(a){"page:gone"!==a&&"prefetch:onError"!==a&&"sheet:afterClose"!==a&&t()&&p(y)}},y={name:"dataPrefetching",onEnter:function(){g.incrementPrefetchCounter();b.isPrefetch()||a.isOpeningOrOpen()||n.isAutoOpenReadyToBeOpened()?f.callInitiate():f.checkEligibility();--z},onEvent:function(a){if("page:gone"===a)p(v);else{var c=f.isSuccess()&&b.isPrefetch(),d=f.isSuccess()&&b.isNoPrefetch();l.logDebug("turbo-checkout-prefetcher","Test is data fresh: isFreshWhenPrefetchResultOKInT1: "+
c+" isFreshWhenPrefetchResultOKInT4: "+d);c||d?p(x):u()?p(v):"product:onChange"===a&&t()&&p(y)}},onExit:function(a){"dataFresh"!==a&&f.abortCall()}},x={name:"dataFresh",onEnter:function(){h.startTimer()},onEvent:function(b){"page:gone"===b?p(v):u()?p(v):(a.isClosed()||"product:onChange"===b)&&t()&&p(y)},onExit:function(){h.resetTimer()}},B={name:"end"},K="controller:onPageLoaded sheet:beforeOpen sheet:afterClose product:onChange prefetch:onSuccess prefetch:onError timer:onTimeout page:gone page:reappear".split(" "),
G={"sheet:beforeOpen":function(){z=10}};return{setup:function(){z=10;w=A;c.each(K,function(a,b){var c=G[b];d.on("turbo:checkout:"+b,function(a){l.logDebug("turbo-checkout-prefetcher","Processing "+b);c&&c();if(w.onEvent)w.onEvent(b)})})},getState:function(){return w.name}}});"use strict";k.when("A","turbo-signin-adapter","turbo-checkout-content-loader","turbo-checkout-buy-now-button","turbo-checkout-csm","turbo-checkout-weblab-allocation","turbo-checkout-utils","turbo-callback-list","turbo-checkout-state-handler",
"turbo-checkout-eligible-state","turbo-checkout-page-ready").register("turbo-checkout-signin-controller",function(d,c,a,b,e,f,h,k,g,l){function m(){t=!1}function n(a){t=!0;A=a;e.logCount("turboCheckoutSigninRequired")}function p(){var a=t&&l.canShow();a&&(h.logDebug("turbo-checkout-signin-controller","Showing sign in dialog"),e.logCount("turboCheckoutSigninPopup"),c.show(A,z,w),d.trigger("turbo:checkout:signInController:onDoSignIn"));return a}function z(){h.logDebug("turbo-checkout-signin-controller",
"Signin success");e.logCount("turboCheckoutSigninSuccess");u.callAll()}function w(){h.logDebug("turbo-checkout-signin-controller","Signin failed");e.logCount("turboCheckoutSigninFailed")}var u=k.create(),t=!1,A;return{setup:function(){a.registerCallback({onStart:m,onSigninRequired:n});b.registerOnClickCallback(p)},registerCallback:u.push}});"use strict";k.when("A","turbo-configuration","turbo-callback-list","turbo-filtered-callback-list","turbo-checkout-page-ready").register("turbo-checkout-iframe",
function(d,c,a,b){function e(){return d.$("#"+l)}function f(){if(!(0<e().length))throw"Attempted to read / write the iFrame without it being in the DOM. This would result in an undefined iFrame document.";var a=e()[0];return a.contentDocument||a.contentWindow.document}function h(){if(0<e().length)throw"Attempted to insert multiple Turbo Checkout iFrames";}function k(){return d.$("\x3ciframe/\x3e",{id:l,src:"about:blank",scrolling:"no","class":"turbo-checkout-blank"})}function g(a){p.push(a)}var l=
c.get(c.KEYS.IFRAME_ID),m=b.create("beforeFramePopulated"),n=b.create("afterFramePopulated"),p=a.create();g(function(a){a.addClass("turbo-checkout-shown")});d.on("turbo:checkout:iframe:document:loaded",function(){p.callAll(e())});return{write:function(a){m.callAll();a+='\x3cscript\x3e"use strict";window.parent.P.now("turbo-checkout-controller").execute("callbackPageController", function callbackPageController(controller) {controller.frameHtmlRendered();});P.when("load").execute("onTurboDocumentLoaded", function onTurboDocumentLoaded() {window.parent.P.when("A").execute("triggerTurboDocumentLoaded", function triggerTurboDocumentLoaded(A) {A.trigger("turbo:checkout:iframe:document:loaded");});});\x3c/script\x3e';
if("string"!==typeof a)throw"Attempted to write non-string value to iFrame. typeof \x3d "+typeof a;var b=f();b.open();b.write(a);b.close();n.callAll(e()[0])},remove:function(){e().remove()},appendTo:function(a){h();a.append(k())},insertInto:function(a){h();a.html(k())},hasContent:function(){var a=0<e().length&&f();return a&&(a.body.hasChildNodes()||a.head.hasChildNodes())},registerCallbacks:function(a){m.push(a);n.push(a)},onContentLoaded:g}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-checkout-view-state",
function(d){function c(a,b){return function(){return e===a||e===b}}function a(a){return function(){e=a;b.apply(b,arguments)}}function b(a,b){a&&"string"===typeof a&&d.trigger(a,b)}var e=0;return{isClosed:c(0),isClosing:c(1),isOpen:c(2),isOpening:c(3),isClosingOrClosed:c(1,0),isOpeningOrOpen:c(3,2),setToOpen:a(2),setToOpening:a(3),setToClosed:a(0),setToClosing:a(1)}});"use strict";k.when("A","turbo-view-adapter","turbo-checkout-view-state","turbo-checkout-eligible-state","turbo-checkout-content-loader",
"turbo-checkout-utils","turbo-checkout-weblab-allocation","turbo-checkout-weblab-trigger","turbo-checkout-csm","turbo-checkout-state-handler","turbo-checkout-device-filter","turbo-checkout-ajax-wrapper","turbo-checkout-page-visibility-manager","turbo-checkout-counter","turbo-checkout-prefetcher","turbo-checkout-prefetch-timer","turbo-checkout-buy-now-button","turbo-checkout-signin-controller","turbo-checkout-auto-open","turbo-checkout-urls","turbo-checkout-ref-tagger","turbo-configuration","turbo-checkout-event-verification",
"turbo-checkout-page-ready").register("turbo-checkout-controller",function(d,c,a,b,e,f,h,k,g,l,m,n,p,z,w,u,t,A,v,y,x,B,K){function G(){t.bindTurboClickEvent();d.off("turbo:checkout:dimmer:clicked");d.on("turbo:checkout:dimmer:clicked",function(a){a()})}function C(a,b){f.logDebug("turbo-checkout-controller",a,b)}function D(a,b){I();a||c.close({reason:b})}function E(){C("Handling signin success");M()}function L(){C("Handling buy now button click");M();return!0}function M(){W=setTimeout(P,2E4);J=g.createScope();
J.markClick();N="loading";T=!1;u.checkTimeout();z.incrementSheetOpenedCounter();c.show()}function P(){g.logCount("turboCheckoutContenLoadTimeout")}function Q(){I();c.removeContent()}function O(){I();K.logBuyNowButtonClickHandlerMetrics()}function I(){b.canShow()?(C("Registering with buy now button"),d.trigger("turbo:checkout:buyNowEnabled"),t.registerOnClickCallback(L)):(C("Unregistering from buy now button"),d.trigger("turbo:checkout:buyNowDisabled"),t.deregisterOnClickCallback(L))}function S(a,
b){g.logCount("turboCheckoutPrefetchSuccess");a&&(h.isControl()||h.isBuyNowOnly())&&(C("Received content in control: "+a.substring(0,255)),g.logCount("turboCheckoutControlContentReceived"));U=b;c.setContent(a);I()}function R(){I();a.isOpeningOrOpen()&&(g.logCount("turboCheckoutYieldNewPurchase"),c.closeImmediatelyThenExecute(V))}function Y(){clearTimeout(W);N="unknown";!H||H.isResolved()||H.isRejected()||(C("Initiate confirm called for "+U.currentPurchaseId+" with existing confirm still executing. Aborting"),
g.logCount("turboCheckoutConfirmPending"),H._supersedByNewPurchase=!0,H.abort());aa()}function Z(){var a=l.getLineItems().filter(function(a){return a&&a.isDiscoveredAsin}).map(function(a,b){return a.asin});g.logCount("turboCheckoutDiscoveredAsins",a.length);return a}function aa(){g.logCount("turboCheckoutConfirm");var a=U.currentPurchaseId,b=y.buildConfirmPathWith(l.getRefTag(),h.getExperimentName(),l.getRequestId(),l.getSessionId(),Z());H=n.loadWithJQXHR(b,{type:"POST",data:{pid:a},success:function(a,
b,c){g.logCount("turboCheckoutConfirmSuccess")},error:function(b,d,e){"abort"===d?g.logCount("turboCheckoutConfirmAborted"):("timeout"===d&&g.logCount("turboCheckoutConfirmTimeOut"),g.logCount("turboCheckoutConfirmFailed"));b._supersedByNewPurchase||(f.logError("Issue confirming turbo initiate prefetch for pid "+a+": "+e+", "+d),g.logCount("turboCheckoutYieldNewPurchase"),c.closeImmediatelyThenExecute(V))}})}function ba(){J.markFirstByte()}function V(){t.executeOriginalBuyNowAction(l.getActiveId())}
function ca(a){d.trigger("turbo:checkout:embedded:page:showSpinner");H.done(a)}function ea(a,b,c){N=c;T=!1}function fa(){T=!0}function da(a){d.off("turbo:checkout:dimmer:clicked");d.on("turbo:checkout:dimmer:clicked",function(a){a()});a&&a.doNotLog||(a&&!a.doNotLog?X(N,a.reason):X(N,!1));N="closed"}function X(a,b){var c=y.buildLogPageHitPathWith(T?a+"2":a,b);C("Logging page hit from "+a+" to "+B.get(B.KEYS.HOST_PAGE_TYPE_IDENTIFIER)+" reason "+b);n.load(c,{method:"POST",params:{pageType:B.get(B.KEYS.HOST_PAGE_TYPE_IDENTIFIER),
referrer:a},timeout:4E3})}function ga(){a.isOpeningOrOpen()&&g.logCount("turboCheckoutProductChangedWhileOpening")}var J,N,U,T;x=B.get(B.KEYS.AJAX_PAGE_UPDATE_EVENT);var W,H;d.on(x,G);G();return{pageLoaded:function(){var a=h.getExperimentName();if(a){var f=h.getAllocation();g.addCounterExtraSuffix("wl:"+f);g.addCounterExtraSuffix(a+":"+f)}m.isDeviceTurboEligible()&&(b.setup(),b.registerStateChangeCallback(D),p.setup(),e.registerCallback({onStart:Q,onTurboEligible:O,onFinish:S,onError:R}),k.setup(),
A.setup(),A.registerCallback(E),J=g.createScope(),c.registerCallbacks({beforeFramePopulated:Y,afterFramePopulated:ba}),l.registerCallback(ga),d.on("turbo:checkout:sheet:beforeClose",da),d.on("turbo:checkout:embedded:page:beforeReload",ea),d.on("turbo:checkout:embedded:page:animation:start",fa),v.setup(t.executeTurboBuyNowAction,O),w.setup(),d.trigger("turbo:checkout:controller:onPageLoaded"))},loadFullscreen:function(a,b){function d(){a=f.createFQDN(a);"thankyou"===b?(g.logCount("turboCheckoutYieldTYP"),
c.closeAndNavigate(a)):(g.logCount("turboCheckoutYield"),c.closeToFullscreen(a))}!H||H.isResolved()||H.isRejected()?d():(g.logCount("turboCheckoutWaitYield"),ca(d))},frameContentReady:function(a,b,c){d.trigger("turbo:checkout:embedded:page:ready",a,b);(function(){var a=function(){J.markCriticalFeature();c.confirmHit(B.get(B.KEYS.HOST_PAGE_TYPE_IDENTIFIER),l.getRefTag());J.whenDataSet(c.recordClientSideMetrics);b.off("checkout:afterReload",a)};b.on("checkout:afterReload",a)})();(function(){b.on("checkout:beforeReload",
function(c){d.trigger("turbo:checkout:embedded:page:beforeReload",a,b,c)});b.on("checkout:reload",function(c){d.trigger("turbo:checkout:embedded:page:reload",a,b,c)});b.on("checkout:afterReload",function(c){d.trigger("turbo:checkout:embedded:page:afterReload",a,b,c)});b.on("turbo:checkout:animation:start",function(){d.trigger("turbo:checkout:embedded:page:animation:start")});d.on("turbo:checkout:embedded:page:showSpinner",function(){c.showSpinner()});d.off("turbo:checkout:dimmer:clicked");d.on("turbo:checkout:dimmer:clicked",
function(a){b.trigger("turbo:checkout:dimmer:clicked:iFrame",a)});b.on("turbo:checkout:update:dimmer",function(a){d.trigger("turbo:checkout:update:dimmer:afterReload",a)});b.on("turbo:checkout:update:modal:header",function(a){d.trigger("turbo:checkout:update:modal:header:afterReload",a)})})()},frameHtmlRendered:function(){J.markAboveTheFold()},updateBounds:function(a,b){c.updateBounds(a,b)}}});"use strict";k.when("turbo-checkout-page-load-spinner","turbo-checkout-controller","turbo-checkout-csm",
"turbo-checkout-page-ready").register("turbo-checkout-startup",function(d,c,a){d.removePageLoadSpinner();a.logCount("turboCheckoutControllerPageLoaded");c.pageLoaded()});"use strict";k.when("turbo-checkout-assets-load-trigger").register("turbo-checkout-page-ready",function(){m.ue&&m.ue.count&&"undefined"!==typeof m.ue_t0&&m.ue.count("turboCheckoutPageReady",Date.now()-m.ue_t0)});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-quantity-input",
"turbo-checkout-warranty-input","turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-checkout-authportal-return-query",function(d,c,a,b,e,f,h){function k(b){a.logDebug("turbo-checkout-authportal-return-query",b)}function g(a){return!!a.match("trb_auth\x3d1")}function l(d){if(g(d)){d=((d||"").match(p)||[])[1]||"";var e=b.getSessionId();a.isNonEmptyString(d)||c.logCount("turboCheckoutPostAuthEmptySessionParameter");a.isNonEmptyString(e)||c.logCount("turboCheckoutPostAuthEmptySessionPageState");
a.isNonEmptyString(d)&&a.isNonEmptyString(e)&&d!==e&&(a.logWarning("Turbo Session Flip Detected. Post authentication sessionId \x3d "+e+", Expected \x3d "+d,"turbo-checkout-authportal-return-query"),c.logCount("turboCheckoutPostAuthSessionFlip"))}}var r=/&?(openid|aToken|serial)[^&]*/g,n=/&?trb_(open|auth|qty|warrAsin|sid|accessory(Asin|Offer))=[^&]*/g,p=/&?trb_sid=([^&]*)/,z=/\?[?&]*/,w=/[?&]{2,}/g;l(m.location.search);return{buildFrom:function(a){k("Initial Query \x3d "+a);a=(a||"?").replace(r,
"");a=a.replace(n,"");a+="\x26trb_auth\x3d1\x26trb_open\x3d1";var c=e.getQuantity();a+=1<c?"\x26trb_qty\x3d"+c:"";c=f.getLineItem();a+=c&&c.asin?"\x26trb_warrAsin\x3d"+c.asin:"";c=b.getSessionId();a+=0<c.length?"\x26trb_sid\x3d"+c:"";c=b.getActiveId();a+=c?"\x26trb_bid\x3d"+c:"";c=h.getLineItem();a+=c&&c.asin&&c.offerListingId?"\x26trb_accessoryAsin\x3d"+c.asin+"\x26trb_accessoryOffer\x3d"+c.offerListingId:"";a=a.replace(z,"?").replace(w,"\x26");k("Final Query \x3d "+a);return a},isReturningFromAuthPortal:g,
validateSession:l}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-csm","turbo-checkout-auto-open","turbo-checkout-authportal-return-query","turbo-checkout-page-ready").register("turbo-checkout-browser-signin",function(d,c,a,b){function e(a){if(f(a)){c.logCount("turboCheckoutForceMobileClaimCollection");var b=a.match(g)[1],e=decodeURIComponent(b);b===e&&d.logError("The pre-defined returnTo seems to be un-encoded");e=encodeURIComponent(e+(-1===e.indexOf("?")?"?":"\x26")+"openid.return_to\x3d"+
h());return a.replace(b,e)}return a+(-1===a.indexOf("?")?"?":"\x26")+"openid.return_to\x3d"+h()}function f(a){return null!==a.match(g)}function h(){var a=b.buildFrom(m.location.search);return encodeURIComponent("https://"+m.location.hostname+m.location.pathname.replace(r,"/ref\x3dtrb_chk_auth")+a)}function k(){var a=m.location.search.match(l)?"turboCheckoutSigninSuccess":"turboCheckoutSigninFailed";c.logCount(a)}var g=/openid\.return_to=([^&$]+)/,l=/openid\.mode=id_res/,r=/(\/ref=[^/]*\/?$|\/?$)/;
b.isReturningFromAuthPortal(m.location.search)&&(c.logCount("turboCheckoutAuthPortalReturn"),k());return{show:function(b){b=e(b);c.logCount("turboCheckoutSignInUrlSize",b.length);a.reset();m.location.href=b},_encodeSignInUrl:e,_isReturnToParameterPredefined:f}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-page-ready").register("turbo-checkout-strings",function(d,c){function a(a){return function(){var e=c.getStrings()[a];if(e)return e;d.logDebug("turbo-checkout-strings",
'String for key "'+a+'" is undefined! Returning empty string.');return""}}return{getHeaderText:a("TURBO_CHECKOUT_HEADER"),getLoadingText:a("TURBO_LOADING_TEXT")}});"use strict";k.when("jQuery","turbo-checkout-page-ready").register("turbo-checkout-loading-spinner",function(d){function c(){return d("#turbo-loading-container")}function a(a){var c=d("\x3cdiv\x3e",{id:"turbo-loading-content"}).append(d("\x3cdiv\x3e",{id:"turbo-loading-spinner","class":"a-spinner a-spinner-medium"}));"string"===typeof a&&
a&&c.append(d("\x3cdiv\x3e",{id:"turbo-loading-text",text:a}));return c}return{create:function(b){return d("\x3cdiv\x3e",{id:"turbo-loading-container"}).append(a(b))},get:c,show:function(){c().addClass("turbo-checkout-shown")}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-eligibility-response-weblabs",function(d,c){var a=[];return{set:function(b){d.$.isArray(b)&&(a=b)},get:function(){return a}}});"use strict";k.when("turbo-checkout-csm","turbo-checkout-utils",
"turbo-checkout-page-ready").register("turbo-checkout-session-storage",function(d,c){function a(a,d){c.logDebug("turbo-checkout-session-storage",a,d)}return{isPresent:function(b){var c;a:{try{c=m.sessionStorage.getItem(b);break a}catch(f){d.logCount("turboCheckoutSessionStorageExceptionGet"),a("get() exception",f)}c=null}return null!==c&&c!==y},set:function(b,c){try{m.sessionStorage.setItem(b,c)}catch(f){d.logCount("turboCheckoutSessionStorageExceptionSet"),a("set() exception",f)}},remove:function(b){try{return m.sessionStorage.removeItem(b)}catch(c){d.logCount("turboCheckoutSessionStorageExceptionRemove"),
a("remove() exception",c)}}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-load-events",function(d,c){var a=c.get(c.KEYS.AJAX_PAGE_UPDATE_EVENT);return{bind:function(b){d.off(a,b);d.off("turbo:checkout:controller:onPageLoaded",b);d.on(a,b);d.on("turbo:checkout:controller:onPageLoaded",b)}}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-buy-now-button","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-event-verification",
function(d,c,a,b,e,f){function h(){var a=f.get(f.KEYS.BUY_NOW_CLICK_EVENT).split(".");return 1<a.length?a[1]:"turboCheckout"}function k(b){var c=b.map(function(a){return a.namespace}).filter(function(a,b,c){return c.indexOf(a)===b});b.length!==c.length&&a.logCount("turboCheckoutBuyNowButtonDuplicateClickHandler")}function g(b){if((b=b.filter(function(a){return a!==y&&"click"===a.type&&0<=n.indexOf(a.namespace)}))&&0<b.length){var c=0;b.forEach(function(b){b.namespace!==h()&&(a.logCount("turboCheckoutBuyNowButtonClickHandlerWhitelisted:"+
b.namespace),c++)});0<c&&a.logCount("turboCheckoutBuyNowButtonClickHandlerWhitelistedQuantity:"+c)}}function l(b){if((b=b.filter(function(a){return a!==y&&"click"===a.type&&0>n.indexOf(a.namespace)}))&&0<b.length){var c=0;b.forEach(function(){a.logCount("turboCheckoutBuyNowButtonClickHandlerNotWhitelisted");c++});a.logCount("turboCheckoutBuyNowButtonClickHandlerNotWhitelistedQuantity:"+c)}}var m=!1,n=[h(),"accessoryUpsellInterstitial","makoPreRegistration","moq","siatc","hctpDFL","bbg","vasBuyNow",
"ppdBundles","makoGiftingMetrics","financialOptionsCheckout"];return{logBuyNowButtonClickHandlerMetrics:function(){var d=e.getBuyNowButtons();if(!m&&d&&0<d.length){for(var f=0;f<d.length;f++){var h=c._data(d[f],"events");if(!h||!h.click){a.logCount("turboCheckoutBuyNowButtonNoBoundHandlers");return}var n=(h=h.click)?h.length:0;1<n&&(b.logDebug("turbo-checkout-event-verification","Multiple handlers bound to 'click' in Buy Now button. Number of handlers: "+n,void 0),a.logCount("turboCheckoutBuyNowButtonMultipleClickEventsBound"),
a.logCount("turboCheckoutBuyNowButtonMultipleClickEventsBoundQuantity:"+n));k(h);l(h);g(h)}m=!0}}}})});
/* ******** */
(function(f){var p=window.AmazonUIPageJS||window.P,r=p._namespace||p.attributeErrors,a=r?r("TurboCheckoutDesktopAssets",""):p;a.guardFatal?a.guardFatal(f)(a,window):a.execute(function(){f(a,window)})})(function(f,p,r){f.when("turbo-configuration-keys","turbo-checkout-page-ready").register("turbo-device-configuration",function(a){var c;c||(c={},c[a.SHOW_SIGN_IN_INTERFACE]="turbo-checkout-browser-signin",c[a.EXTEND_ELIGIBLE_STATE]=!1,c[a.IS_DEVICE_FILTER_REQUIRED]=!0,c[a.VIEW_ADAPTER]="turbo-checkout-modal",
c[a.WARRANTY_CHECKBOX_INPUT_SELECTOR]="input[id^\x3dmbb-offeringID-]",c[a.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR]=".abbListItem",c[a.WARRANTY_OFFER_INPUT_SELECTOR]="input[id^\x3dmbb-offeringID-]:checked",c[a.WARRANTY_ASIN_INPUT_NAME]="asin");return c});"use strict";f.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-device-variant","turbo-checkout-is-touch-and-orientation-enabled","turbo-checkout-page-ready").register("turbo-checkout-device-filter",function(a,
c,k,f,g,p){function h(a){var b=!1;this.countOnce=function(){b||(c.logCount(a),b=!0)}}function d(a){k.logDebug("turbo-checkout-device-filter",a)}var r="turboCheckoutDisabledDesktopAuiVariant"+g,l,b,u,v,t,m,w;return{isDeviceTurboEligible:function(){l=l||new h("Desktop"===g?"turboCheckoutDesktopAuiVariantEligible":r);var e;(e=b)||(e=k.isInternetExplorer()?"turboCheckoutDisabledDesktopIE":k.isIPad()?"turboCheckoutDisabledDesktopIPad":k.isIPhone()?"turboCheckoutDisabledDesktopIPhone":k.isAndroid()?"turboCheckoutDisabledDesktopAndroid":
"turboCheckoutDesktopUserAgentEligible",e=new h(e));b=e;u=u||new h("turboCheckoutDisabledDesktopTouch");v=v||new h("turboCheckoutDisabledDesktopOrientation");t=t||new h("turboCheckoutDisabledDesktopTouchAndOrientation");m=m||new h("turboCheckoutDisabledTurboDesktopOnDevice");w=w||new h("turboCheckoutEnabledTurboDesktopOnDevice");l.countOnce();"Desktop"===g||d("Aui device variant is NOT Desktop. Turbo will NOT show. Variant is "+g);(e="Desktop"!==g)||(b.countOnce(),e=!!(k.isInternetExplorer()||k.isIPad()||
k.isAndroid()||k.isIPhone()));if(e)return m.countOnce(),!1;if(e=a.capabilities.touch)u.countOnce(),d("Touch enabled device. Turbo will NOT show");var c=a.capabilities.orientation;c&&(v.countOnce(),d("Orientation enabled device. Turbo will NOT show"));e&&c&&t.countOnce();if((e||c)&&!p)return m.countOnce(),!1;w.countOnce();return!0},isSignInSupported:function(){return f.get(f.KEYS.IS_SIGN_IN_SUPPORTED)}}});"use strict";f.when("turbo-checkout-page-ready").execute(function(){f.declare("turbo-checkout-device-variant",
"Desktop")});"use strict";f.when("A","a-modal","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-iframe","turbo-checkout-base-view","turbo-checkout-loading-spinner","turbo-checkout-view-state","turbo-checkout-ref-tagger","turbo-checkout-strings","turbo-checkout-page-ready").register("turbo-checkout-modal",function(a,c,f,E,g,F,h,d,z,l){function b(a){E.logDebug("turbo-checkout-modal",a)}function u(){!A()||d.isOpeningOrOpen()?b("show() suppressed. View is null or undefined or view state is opening or open"):
(d.setToOpening(),m().show())}function v(){x&&d.isOpeningOrOpen()&&(g.appendTo(e()),g.write(x))}function t(){g.remove();if(0<e().length)b("Modal frame is in DOM. Inserting Spinner"),e().height("").html(h.create(l.getLoadingText())).append(w()),q("#turbo-checkout-modal-header").text(l.getHeaderText());else{b("Modal frame is NOT in DOM. Resetting Modal");var a={inlineContent:q("\x3cdiv\x3e",{id:"turbo-checkout-frame"}).html(h.create(l.getLoadingText())).append(w()).prop("outerHTML"),padding:"none",
dataStrategy:"inline",header:'\x3cdiv id\x3d"turbo-checkout-modal-header"\x3e'+l.getHeaderText()+"\x3c/div\x3e"};m().update(a)}}function m(){return B=B||c.get(q("#turbo-checkout-modal"))}function w(){return q("\x3cscript/\x3e",{type:"text/javascript",html:'P.when("A").execute(function turboFrameReady(A) { A.trigger("turbo:checkout:frame:ready"); });'})}function e(){return q("#turbo-checkout-frame")}function y(a){!A()||d.isClosingOrClosed()?b("close() suppressed. View is undefined or null or view state is closing or closed"):
(n=a||n,n.notify=!0===n.notify||n.notify===r,d.setToClosing(),m().hide())}function A(){var a=m();a||b("Modal is undefined or null. Modal \x3d "+a);return a?!0:!1}function C(b){q(document.body).unbind("click");b();a.trigger("turbo:checkout:sheet:onNavigateAway");y({notify:!1,immediate:!0,doNotLog:!0})}function D(a){b("onDismiss");n={notify:!0,reason:a}}var q=a.$,n={},x,B,G=new (F.extend())("#turbo-checkout-frame");g.onContentLoaded(function(a){h.get().remove()});a.on("a:popover:dismiss:turbo",function(){b("onClick_X");
D(z.TAGS.TOUCH_X)});a.declarative("a-popover-floating-close","click",function(){b("onDimmerClicked");D(z.TAGS.TOUCH)});a.on("a:popover:beforeShow:turbo",function(){b("onBeforeOpen");d.setToOpening("turbo:checkout:sheet:beforeOpen");t()});a.on("a:popover:show:turbo",function(){b("onOpen");d.setToOpen();x||h.show()});a.on("a:popover:beforeHide:turbo",function(){b("onBeforeClose");d.setToClosing.apply(d,!0===n.notify?["turbo:checkout:sheet:beforeClose",n]:r);e().removeClass("turbo-checkout-shown")});
a.on("a:popover:hide:turbo",function(){b("onClose");d.setToClosed("turbo:checkout:sheet:afterClose");n={}});a.on("a:popover:afterHide:turbo",t);a.on("turbo:checkout:sheet:doOpen",u);a.on("turbo:checkout:sheet:doClose",y);a.on("turbo:checkout:frame:ready",v);a.on(a.constants.BROWSER_EVENTS.ORIENTATION_CHANGE,function(){f.logCount("turboCheckoutDesktopOrientationChange");d.isOpen()&&f.logCount("turboCheckoutDesktopOrientationChangeWhenModalOpen")});a.on("turbo:checkout:state:product:resolved",function(){q("#turbo-checkout-modal-header").text(l.getHeaderText())});
a.on("turbo:checkout:update:modal:header:afterReload",function(a){null!==a&&q("#turbo-checkout-modal-header").text(a)});return{show:u,setContent:function(a){x=a;b("iFrame content saved");d.isOpeningOrOpen()?v():(b("setFrameContent NOT called"),b("viewState is not opening? isOpeningOrOpen \x3d "+d.isOpeningOrOpen()),b("iFrame already has content? iFrame.hasContent \x3d "+g.hasContent()))},removeContent:function(){x="";t()},close:y,closeToFullscreen:function(a){C(function(){p.location.href=a})},closeImmediatelyThenExecute:C,
closeAndNavigate:function(b){p.location.href=b;a.trigger("turbo:checkout:sheet:onNavigateAway");y({notify:!1,doNotLog:!0})},registerCallbacks:g.registerCallbacks,updateBounds:function(a){G.updateBounds(a)}}});"use strict";f.declare("turbo-checkout-is-touch-and-orientation-enabled",!1)});
/* ******** */
(function(c){var d=window.AmazonUIPageJS||window.P,e=d._namespace||d.attributeErrors,a=e?e("DetailPageTurboCheckoutDesktopAssets",""):d;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,d,e){c.when("turbo-configuration-keys","turbo-checkout-page-ready").register("turbo-client-configuration",function(a){var b;b||(b={},b[a.HOST_PAGE_TYPE_IDENTIFIER]="detail",b[a.BUY_NOW_ONLY_TREATMENT]="T1",b[a.NO_PREFETCH_TREATMENT]=/T[2-9]/,b[a.ADDRESS_INPUT_SELECTORS]=["#unifiedLocation1ClickAddress",
"#addToCart input[name\x3d'dropdown-selection']","#unifiedLocationAddress","input[name\x3d'dropdown-selection']"],b[a.QUANTITY_SELECT_SELECTOR]="#quantity",b[a.CONFLICTING_INITIATE_LISTENERS]=["click.siatc"],b[a.VAS_CHANGE_EVENTS]=["vas:remove-service-asin-buybox-event","vas:add-service-asin-buybox-event"],b[a.VAS_CHECKBOX_SELCTOR]="#ppdb-add-service-checkbox");return b})});
/* ******** */