(function(d){var c=window.AmazonUIPageJS||window.P,p=c._namespace||c.attributeErrors,a=p?p("DetailPageAlohaAssets",""):c;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,c,p){d.when("A").register("aloha-cartapi",function(a){return{createAddToCartRequest:function(d,r,u,h,n,l){l=l||5E3;n=n||h;var f={items:[]};return{count:function(){return f.items.length},call:function(b){if(0<f.items.length){var t={"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"',
Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"',"Accept-Language":"en-US","x-api-csrf-token":r},g=a.$('meta[name\x3d"encrypted-slate-token"]');g.length&&g.attr("content")?(c.ue.count("simpleBundleAjaxSlateTokenPresent",1),t["x-amzn-encrypted-slate-token"]=g.attr("content")):c.ue.count("simpleBundleAjaxSlateTokenAbsent",1);a.$.ajax({url:b===p?d+"?ref_\x3ddp_atch_abb_atc":d+"?ref_\x3d"+b,xhrFields:{withCredentials:!0},type:"POST",headers:t,data:JSON.stringify(f),timeout:l,
success:u,error:h,abort:n})}},addItem:function(a,c,g){f.items.push({asin:a,offerListingId:c,quantity:Number(g||1)})}}}}});"use strict";d.when("A","a-modal","aloha-simplebundle-common","ready").execute(function(a,c,d){function m(b){!l&&a.onScreen(document.getElementById(h.SIMPLE_BUNDLE),0)&&(l=!0,a.defer(function(){b.logNexusImpressionsOnDpx(n.DESKTOP)}))}var h={AUI_PAGE_ROOT:"#a-page",SB_ROOT:".showBundleAsins.simpleBundleFeatureContainer",SIMPLE_BUNDLE:"simpleBundleV2_feature_div"},n={DESKTOP:"desktop"},
l=!1,f=a.debounce(function(){if(a.$(h.SB_ROOT).length){var b=d.getSimpleBundlePageState()||{},c=b.csrfToken,g=b.cartEndpoint,f=b.items||[];b={baseAsin:b.baseAsin,marketplaceId:b.marketPlaceId,baseItemPrice:a.$("#base-product-price").data("base-product-price"),clientType:"aloha-simplebundle-desktop",currencyOfPreferenceSupported:b.currencyOfPreferenceSupported||!1};var k=d.createMetricsLogger(b,f,n.DESKTOP);m(k);if(!l)a.on(a.constants.BROWSER_EVENTS.SCROLL,function(){m(k)});k.setupMiniDpImpressionTriggering();
d.setupAccessoryAddToCart(f,k,g,c)}},200);(function(){a.declarative("show-review-tab","click",function(b){a.$(b.$target).closest(h.AUI_PAGE_ROOT).find(".popoverReviewsTab").click()});a.declarative("focus-image","mouseenter",function(a){var b=a.$target,c=b.parents(h.AUI_PAGE_ROOT);a=a.data;c.find("#productImageMain-"+a.asin).attr("src",a.imageUrl);c.find(".thumbnail-group").removeClass("a-button-selected");c.find("#"+b.prop("name")).addClass("a-button-selected")})})();f();a.on("a:pageUpdate",f);a.on("attach:dss:initialized",
function(){a.off("a:pageUpdate",f);f()})});"use strict";d.when("A","aloha-cartapi").register("aloha-simplebundle-common",function(a,m){var r=/[^\d,\.]/g,p=/,/g,h=/\./g,n=/(^\D+|\D+$)/,l=Date.now().toString(10)+Math.random().toString(16).substring(2,13),f=!1;return{createMetricsLogger:function(b,d,f){function m(a,v,c,d,f){var e=q(b.baseItemPrice);return{baseAsin:b.baseAsin,basePrice:e.priceDecimal,currencySymbol:e.currencySymbol,clientType:b.clientType,producerId:"atch",marketplaceId:b.marketplaceId,
uniqueId:l,accessoryAsin:a,accessoryPrice:v,displayPosition:c,featureLayout:d,deviceType:f}}function k(a,b){c.ue&&c.ue.event&&c.ue.event(a,"atch",b,{ssd:!0})}function g(a){return b.currencyOfPreferenceSupported?{priceFormatted:a.ourPrice,priceDecimal:parseFloat(a.ourPriceAmount)||null,currencySymbol:a.ourPriceSymbol}:q(a.ourPrice)}function q(a){a=a||"";var b=a.lastIndexOf(","),e=a.lastIndexOf(".");if(b>e){e=h;var c=p}else e=p,c=h;(b=a.match(n))&&(b=b[0].trim());e=a.replace(r,"").replace(e,"").replace(c,
".");e=parseFloat(e);return{priceFormatted:a,currencySymbol:b,priceDecimal:e}}a.defer(function(){c.ue&&c.ue.count&&c.ue.count("aloha-simplebundle-view",1)});return{logExpandedLink:function(){c.ue&&c.ue.count&&c.ue.count("aloha-simplebundle-buybox-expanded-link",1)},logNexusImpressionsOnDpx:function(){for(var a=0;a<d.length;a++){var b=d[a];b=m(b.asin,g(b).priceDecimal,a,"dpx",f);k(b,"attach.ABBImpression.7")}},setupMiniDpImpressionTriggering:function(){a.$(".simpleBundle-popover-title").unbind("click").bind("click",
function(a){a=parseInt(a.currentTarget.className.split("popover-simpleBundle-link-")[1].at(0));var b=d[a];a=m(b.asin,g(b).priceDecimal,a,"minidp",f);k(a,"attach.ABBImpression.7")})},logNexusAddAccessoryToCart:function(a,b,c,q,d){var e=m();e.accessoryAsin=a;e.accessoryPrice=g(b).priceDecimal;e.displayPosition=c;e.featureLayout=q;e.deviceType=d;k(e,"attach.ABBAddAccessoryToCart.4")}}},getSimpleBundlePageState:function(){var b=a.$(".simpleBundleJavascriptParameters").find("script").html();return a.parseJSON(b)},
setupAccessoryAddToCart:function(b,h,g,l){function k(b,e,f,k,p,r){var q=m.createAddToCartRequest(g,l,function(a){n(b);h.logNexusAddAccessoryToCart(b,e,f,p,r);d.when("EWC").execute("abb-everywhere-cart",function(a){a.refresh()});var c=a.entity.count.entity.items;d.when("nav.setCartCount").execute("abb-nav-cart",function(a){a(c)});d.when("mash").execute("abb-mash",function(a){a.cart.didUpdate({newCartQuantity:c})})},function(){a.$("#abb_add_accessory_spinner_"+b).addClass("aok-hidden");a.$("#minidp_add_accessory_spinner_"+
b).addClass("aok-hidden");a.$("#abb_add_accessory_error_"+b).removeClass("aok-hidden");a.$("#minidp_add_accessory_error_"+b).removeClass("aok-hidden");c.ueLogError&&c.ueLogError({message:"[There was an error while adding items to the cart using the universal add to cart api.]"},{logLevel:"ERROR",attribution:"SimpleBundle"})});q.addItem(b,e.offerListingId);q.call(k)}function n(b){a.$("#abb_add_accessory_spinner_"+b).addClass("aok-hidden");a.$("#minidp_add_accessory_spinner_"+b).addClass("aok-hidden");
a.$("#abb_add_accessory_alert_"+b).removeClass("aok-hidden");a.$("#minidp_add_accessory_alert_"+b).removeClass("aok-hidden")}f||(f=!0,a.$(".simpleBundleSection").each(function(b,c){a.$(c).closest("#simpleBundleV2_feature_div").length||a.$(c).closest("#simpleBundle_feature_div").length||c.remove()}),a.declarative("abb-accessory-add","click",function(c){var e=c.data;c=e.asin;var d;a:{for(d=0;d<b.length;d++)if(b[d].asin===c)break a;d=void 0}var f=b[d];e=e.atcRefmarker;var m=e.includes("base")?"dpx":
"minidp",g=e.includes("desktop")?"desktop":"mobile";a.$("#abb_accessory_add_button_"+c).addClass("aok-hidden");a.$("#minidp_accessory_add_button_"+c).addClass("aok-hidden");a.$("#abb_add_accessory_spinner_"+c).removeClass("aok-hidden");a.$("#minidp_add_accessory_spinner_"+c).removeClass("aok-hidden");k(c,f,d,e,m,g)}))}}});"use strict";d.when("ready").register("aloha-buy-now-integration",function(){var a={};d.when("turbo-checkout-buy-now-integration").execute(function(c){a=c});return{isBuyNow:function(c){return"function"===
typeof a.isBuyNow&&a.isBuyNow(c)},checkoutWith:function(c,d){return a.checkoutWith(c,d)}}})});
/* ******** */
(function(e){var u=window.AmazonUIPageJS||window.P,x=u._namespace||u.attributeErrors,a=x?x("SoftlinesRecommendationsAssets",""):u;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,u,x){e.when("A","jQuery","softlines-utils","atf").register("looks-data-cache",function(a,c,r){var g=c("#multipleRecommendations"),f=[],d=!1,p=[],t="cts",m=!1,h={};if(0<g.length){var b=g.attr("data-ids");if(r.isString(b))if(b=a.parseJSON(b),c.isPlainObject(b)&&c.isArray(b.recommendations)){a=
b.recommendations;for(var n=a.length,b=0;b<n;b++){var k=a[b];if(c.isPlainObject(k)&&c.isArray(k.asins)){var l=k.asins;if(c.isArray(l)){l=l.splice(0,Math.min(4,l.length));k.asins=l;p.push(k);for(var q=l.length,w=[],k=0;k<q;k++){var v=l[k];c.isPlainObject(v)&&r.isString(v.asin)&&w.push(v.asin)}l=w.join();l=encodeURIComponent(l);f.push(l)}}}1<n&&(d=!0)}else if(c.isPlainObject(b)&&c.isPlainObject(b.recommendations)&&(a=b.recommendations.recommendations,t=b.recommendations.reftagSuffix,null!==b.recommendations.recommendationUrlParams&&
(h=c.param(b.recommendations.recommendationUrlParams)),m=!0,c.isArray(a))){n=a.length;for(b=0;b<n;b++)if(k=a[b],c.isArray(k)){l=k.splice(0,Math.min(4,k.length));p.push(l);q=l.length;w=[];for(k=0;k<q;k++)v=l[k],c.isPlainObject(v)&&r.isString(v.id)&&w.push(v.id);l=w.join();l=encodeURIComponent(l);f.push(l)}1<n&&(d=!0)}}var v=g.attr("data-asin"),e=g.attr("data-injectedViewModel"),y=g.attr("data-showSimplifiedPrice"),u=g.attr("data-showRecommendationsPrimeEligibility"),z=g.attr("data-primeEligibleLocale");
return{getLooks:function(){return p},getLooksAsins:function(){return f},getAsin:function(){return v},getRecommendationUrlParams:function(){return h},getReftagSuffix:function(){return t},isShovelerArrowsEnabled:function(){return d},isNewFormat:function(){return m},getInjectedViewModel:function(){return e},getShowSimplifiedPrice:function(){return y},getShowRecommendationsPrimeEligibility:function(){return u},getIsPrimeEligibleLocale:function(){return z}}});"use strict";e.when("A","jQuery","recommendations-carousel-data",
"softlines-utils","looks-data-cache","atf").register("complete-the-look-carousel-data",function(a,c,r,g,f){a=a.extend({},r);var d={SOFTLINES_CTL:"ctl-carousel",SOFTLINES_RECS_CTL:"srecs-ctl-carousel",ctl:"ctl-carousel",srecsc:"srecs-ctl-carousel"};a.getCounterPrefix=function(a){return d[a]};a.getProducts=function(){var a=[],d=f.getLooks(),m,h,b=d.length;for(m=0;m<b;m++){var n=d[m];if(c.isPlainObject(n)&&c.isArray(n.asins)){var k=n.asins,l=k.length;for(h=0;h<l;h++){var q=k[h];c.isPlainObject(q)&&g.isString(q.asin)&&
a.push(q.asin)}}if(c.isArray(n))for(k=n,l=k.length,h=0;h<l;h++)q=k[h],c.isPlainObject(q)&&g.isString(q.id)&&(n="",null!==q.asinSpecificUrlParams&&(n=c.param(q.asinSpecificUrlParams)),a.push(q.id+":"+n))}return a};a.getDataSetType=function(){var a=f.getLooks(),d=a.length,m="";if(!0===f.isNewFormat())return f.getReftagSuffix();0<d&&(a=a[0],c.isPlainObject(a)&&c.isArray(a.asins)&&(a=a.asins,0<a.length&&(a=a[0],c.isPlainObject(a)&&g.isString(a.asinDataSetType)&&(m=a.asinDataSetType))));return m};return a});
"use strict";e.when("jQuery","softlines-utils","looks-data-cache","atf").register("lookFeedback",function(a,c,r){function g(){0<b.length&&0<h.length&&(b.removeClass("visibleFeedbackBlock"),h.removeClass("hidden"),b.addClass("hidden"),h.addClass("visibleFeedbackBlock"));"undefined"!==typeof Storage&&localStorage.setItem(d,"1")}function f(b){a.ajax({timeout:4E3,type:"GET",url:"/gp/softlines/logger/seed/"+t+"/look/"+e+("/ref\x3dctl_look_"+m+"_vote_"+b),data:{vote:b}})}var d,e,t=r.getAsin(),m,h=a("#afterCtlFeedback"),
b=a("#beforeCtlFeedback");a("#ctlButtonYes").click(function(){g();f("yes")});a("#ctlButtonNo").click(function(){g();f("no")});return{updateFeedback:function(a){m=a;--a;var k=r.getLooksAsins();0<=a&&a<k.length&&(e=k[a]);d=t+e;"undefined"!==typeof Storage&&(a=localStorage.getItem(d),0<b.length&&0<h.length&&(b.removeClass("hiddenFeedbackBlock"),"1"===a?(b.addClass("hidden"),h.removeClass("hidden"),h.addClass("visibleFeedbackBlock")):(b.removeClass("hidden"),b.addClass("visibleFeedbackBlock"),h.addClass("hidden"))))}}});
"use strict";e.when("A","metrics-logger").register("csm-metrics-logger",function(a,c){var e=u.ue;a=a.extend({},c);a.addCount=function(a,c){var d=e.count(a)||0;e.count(a,d+c)};return a});"use strict";e.when("jQuery","softlines-utils","looks-data-cache").register("ob-link-generator",function(a,c,e){return{getOutfitBuilderUrlForPageNumber:function(g){--g;var f,d=a("#outfitBuilder"),p=e.getLooksAsins();0<=g&&g<p.length&&0<d.length&&(d=d.data("outfitbuilderurlprefix"),c.isStringNotEmpty(d)&&(f=d+p[g]));
return f}}});"use strict";e.when("A","jQuery","a-carousel-framework","a-carousel-ajax-standard","complete-the-look-carousel-data","looks-data-cache","softlines-utils","csm-metrics-logger","ob-link-generator","lookFeedback","ready").execute("complete-the-look-ajax",function(a,c,e,g,f,d,p,t,m,h){var b=f.getDataSetType(),n=f.getCounterPrefix(b);a=a.extend({},g);a.getItems=function(b,a,c){c.asin=d.getAsin();c.dataSetType=f.getDataSetType();c.reftagSuffix=d.getReftagSuffix();c.recommendationsUrlParams=
d.getRecommendationUrlParams();var n=d.getInjectedViewModel();p.isStringNotEmpty(n)&&(c.injectViewModel=n);c.showSimplifiedPrice=d.getShowSimplifiedPrice();c.showRecommendationsPrimeEligibility=d.getShowRecommendationsPrimeEligibility();c.isPrimeEligibleLocale=d.getIsPrimeEligibleLocale();g.getItems(b,a,c)};a.init=function(b){h.updateFeedback(1);var a=f.getProducts();b.setAttr("ajax",{url:"/gp/product/ajax-handlers/complete-the-look-carousel.html",id_list:a});return g.init(b)};a.afterInit=function(b){g.afterInit(b);
var a=d.getLooks(),f=0;c.isArray(a)&&(f=a.length);t.addCount(n+":shown",1);b.onChange("pageNumber",function(b,a){var d=":back";b>a&&(d=":next");b===f&&1===a&&(d=":back");a===f&&1===b&&(d=":next");h.updateFeedback(b);a=c("#outfitBuilder");if(0<a.length){var k=m.getOutfitBuilderUrlForPageNumber(b);p.isStringNotEmpty(k)&&a.attr("href",k)}t.addCount(n+":page:"+b+d,1)})};e.registerStrategy("ajax","complete-the-look",a)});"use strict";e.when("A","jQuery","a-carousel-framework","looks-data-cache","complete-the-look-carousel-data",
"csm-metrics-logger","ready").execute("complete-the-look-display",function(a,c,r,g,f,d){function p(b){function a(b){b.dom.$viewport.css("height","")}b.onChange("pageNumber",function(){b.dom.$carousel.children("li").css("visibility","")});b.onChange("pageSize",function(c,d){c>d&&a(b)});b.onChange("loading",function(c){c||a(b)});b.onChange("firstVisibleItem",function(){a(b)});b.onChange("animating",function(a,d){if(!a){var n=b.getAttr("firstVisibleItem")-1,g=n+b.getAttr("pageSize");b.dom.$carousel.children("li").each(function(b,
a){b=b>=n&&b<g;c(a).css("visibility",b?"":"hidden").attr("aria-hidden",b?"false":"true")})}});b.onChange("single_page_align minimum_gutter_width",function(){this.repaint(b)});b.onChange("minimum_gutter_width",function(){this.repaint(b)});b.onChange("pageNumber",function(b){e.when("is-softlines-recommendations-edp-enabled").execute(function(a){a&&e.when("srecs-edp-carousel-page-change-handler").execute(function(a){a.refreshEDP(b)})})})}var t=.82;a=f.getDataSetType();var m=f.getCounterPrefix(a),h=c("#recommendations");
r.registerStrategy("display","complete-the-look",{repaint:function(b){g.isShovelerArrowsEnabled()||(t=1);b.getDimensions();var a=h.width()*t,c=Math.round(.225*a),d=Math.round(.0125*a);b.setAttr("currentGutter",0);b.setAttr("pageSize",4);var f=b.dom.$carousel,e=f.children("li"),a=e.length,m=b.getAttr("firstVisibleItem")-1,r=m+4,p=c+"px",u="0 "+d+"px";e.each(function(b,a){b=b>=m&&b<r;a.style.visibility=b?"":"hidden";a.style.width=p;a.style.margin=u;a.setAttribute("aria-hidden",b?"false":"true")});d=
e.first().outerWidth(!0);e=a*d;f.removeClass("a-text-right a-text-center");f.css("width",e+"px");f={carousel:{width:e,outerWidth:f.outerWidth()},items:[]};for(e=0;e<a;e++)f.items.push({width:c,outerWidth:d});b.updateDimensionsCache(f);b.gotoIndex(b.getAttr("firstVisibleItem"),{animationDuration:0});b.triggerEvent("repaint")},resize:function(b,a){a.viewport&&void 0!==a.viewport.width&&(this.repaint(b),d.addCount(m+":resized",1))},init:function(b){var a=g.isShovelerArrowsEnabled(),c=[];a&&(c=f.getProducts());
0<c.length&&b.setAttr("set_size",c.length);b.setAttr("minimum_gutter_width",0);b.setAttr("first_item_flush_left",!0);this.repaint(b);a&&(a=b.getDimensions(),b.dom.$container.find(".a-carousel-left, .a-carousel-right, .a-carousel-viewport").css("height",Math.max(a.viewport.height,a.items[0]?a.items[0].height:0)+"px"));a=b.getAttr("firstVisibleItem");1<a&&(b.setAttr("firstVisibleItem",a),a=Math.ceil(a/b.getAttr("pageSize")),b.gotoPage(a));p(b)}})});"use strict";e.when("jQuery").register("softlines-utils",
function(a){function c(c){return"undefined"!==a.type(c)&&"null"!==a.type(c)}function e(g){return c(g)&&"string"===a.type(g)}return{isNotNull:c,isString:e,isStringNotEmpty:function(a){return e(a)&&0<a.length}}});"use strict";e.register("metrics-logger",function(){return{addCount:function(a,c){}}});"use strict";e.register("recommendations-carousel-data",function(){return{getProducts:function(){}}});"use strict";e.when("jQuery","atf").register("is-softlines-recommendations-edp-enabled",function(a){var c=
!1;0<a("#recommendationsData").length&&(c=!0);return c});e.when("is-softlines-recommendations-edp-enabled").execute(function(a){a&&("use strict",e.when("A","jQuery","atf").register("recommendations-data-cache",function(a,e){var g,f,d,p=!1,t=!1,m,h=e("#recommendationsData");if(0<h.length){g=h.attr("data-seed-asin");var b=h.attr("data-recommended-asins");"undefined"!==typeof b&&(f=a.parseJSON(b));d=h.attr("data-dataset-type");p="true"===h.attr("data-is-multiple-looks-enabled");t="true"===h.attr("data-is-shoveler-enabled");
b=h.attr("data-edp-defect-display-data");"undefined"!==typeof b&&(m=a.parseJSON(b))}return{getSeedAsin:function(){return g},getRecommendedAsins:function(){return f},setRecommendedAsins:function(b){0<h.length&&e.isArray(b)&&(b=JSON.stringify(b),h.attr("data-recommended-asins",b),f=a.parseJSON(b))},getRecommendationsDatasetType:function(){return d},isShovelerEnabled:function(){return t},isMultipleLooksEnabled:function(){return p},getEDPDefectDisplayData:function(){return m}}}),"use strict",e.when("A",
"jQuery","recommendations-data-cache","ready").register("softlines-recommendations-edp-helper",function(a,r,g){function f(){var a=d.featureContext(),c={},e=a.cqAttributeType,b=a.cqFlagName,f=a.resolver,k=a.featureName,l=k+"-"+a.dataHash;b&&0<b.length&&(c.flag=b);var b=g.getRecommendedAsins(),q=g.getRecommendationsDatasetType();c.recommendedAsins=encodeURIComponent(b);c.datasetType=q;b=JSON.stringify(b)+q;b in d.cacheStorage?c=d.cacheStorage[b]:(c=p.generateTemplateViewModel(l,a.defects,d,c,e,f),d.cacheStorage[b]=
c);e="#"+a.placeHolderId;a=r("#"+a.templateId).html();p.renderEDP(e,a,c,k)}var d,p;a.on("SoftlinesEDPRecommendationsActionEventHandler",function(a){d=a;e.when("EDPUtils").execute(function(a){p=a;f()})});return{getSrecsEDPScopeHandler:function(){return d},srecsEDPActionEvent:f}}),"use strict",e.when("softlines-recommendations-edp-helper","looks-data-cache","recommendations-data-cache","ready").register("srecs-edp-carousel-page-change-handler",function(a,e,g){return{refreshEDP:function(f){var d=e.getLooksAsins();
--f;0<=f&&f<d.length&&(d=d[f]);d=decodeURIComponent(d);d=d.split(",");g.setRecommendedAsins(d);a.srecsEDPActionEvent()}}}))})});
/* ******** */
(function(p){var l=window.AmazonUIPageJS||window.P,g=l._namespace||l.attributeErrors,a=g?g("SoftlinesPWAssets",""):l;a.guardFatal?a.guardFatal(p)(a,window):a.execute(function(){p(a,window)})})(function(p,l,g){p.when("A","pw-metric-utils","softlines-common-utils","afterLoad","a-state").register("PWAddressValidator",function(a,c,d){c.addCSMTag("pwAddressValidatorJSLoaded");c=function(){function e(){b=a.state("pwState")?a.state("pwState"):{}}function c(){b.hasOwnProperty("isTryState")&&(g.isTryState=
b.isTryState);b.hasOwnProperty("isPWEnabled")&&(g.isPWEnabled=b.isPWEnabled);var e=a.state("unifiedLocation")?a.state("unifiedLocation"):{};e=e.hasOwnProperty("urlParams")?e.urlParams:{};e=d.extendAndOverride(e,g);a.state("unifiedLocation",{urlParams:e})}var g={isTryState:!1,isPWExperienceEnabled:!0,isLocUXPageRefresh:!0,isPWEnabled:!1};e();c();a.state.bind("pwState",function(b,a){if(a.isTryState||a.isPWEnabled)e(),c()})};var b=a.state("pwState")?a.state("pwState"):{};b.hasOwnProperty("isPWExperienceEnabled")&&
b.isPWExperienceEnabled&&c()});"use strict";p.when("A","pw-metric-utils","pw-common-utils","try-state-param-util").register("pw-buybox",function(a,c,d,b){var e=a.$;c.addCSMTag("pwBuyBoxJSLoaded");var k=function(){var b,a=e("#pwController_feature_div");d.isNotEmpty(a)&&(a=a.find("script"),d.isNotEmpty(a)&&(a=a.html())&&(b=e.parseJSON(a)));return b},u=function(b){var a=k();a&&(a=e.extend(a,b),(b=d.toString(a))&&e("#pwController_feature_div").find("script").html(b))},h=function(){return 0<e("#shouldDefaultTBYBOffer").length&&
"true"===e("#shouldDefaultTBYBOffer").attr("data-value")},A=function(){var b={isTryState:!0,isPWChildState:!0,shouldDefaultTBYBOffer:h()};a.state("pwState",b);u({isTryState:!0,shouldDefaultTBYBOffer:h()})},f=function(){e("#freeReturns_feature_div").addClass("aok-hidden");e("#points_feature_div").addClass("aok-hidden")},m=function(){e("#freeReturns_feature_div").removeClass("aok-hidden");e("#points_feature_div").removeClass("aok-hidden")},r=function(){e("#pwBuyBoxAccordionRow").hasClass("a-accordion-active")?
f():m()};r();var n=function(){e("#pwBuyBoxAccordionRow").hasClass("a-accordion-active")&&A()};n();d.registerTrySelectHandler(function(){A();c.addCount("pwSwitchToPWBuyBoxBCounter");f()});var v=function(){n();d.isPwBuyBoxVisible()&&(a.state("pwState",{isTryState:!1,isPWChildState:!0}),u({isTryState:!1}),c.addCount("pwSwitchToRetailBuyBoxCounter"));m()};d.registerBuySelectHandlerForToggle(function(){h()&&b.queryParams().isTryState===g||v()});d.registerBuySelectHandlerForBBRows(function(){v()});p.when("a-modal",
"ready","a-state").execute(function(b){var f=function(){e(document).undelegate("#pw-add-to-cart-button","click.pwBuyboxAtc");e(document).delegate("#pw-add-to-cart-button","click.pwBuyboxAtc",function(){var a=b.get(e("#watchWarrantyModalPwAtc")),d=k();if(!a||a.isVisible())l.ue&&l.ue.log("LEWIS_ADD_TO_CART","PW_DUMMY_CSM_CHANNEL"),d.isAddressPWEligible?e("#pwAddToCart").submit():(e("#pw-unable-to-ship-message").removeClass("aok-hidden"),e("#pw-eligible-cities-popover").removeClass("aok-hidden"))})},
m=a.state("pwState")?a.state("pwState"):{};(function(){a.on("a:pageUpdate",function(){n();var b=k();b&&(b.isPWChildState=d.isPwBuyBoxVisible(),b.shouldDefaultTBYBOffer=h(),a.state("pwState",b),b.isPWChildState&&(e("#pw-unable-to-ship-message").addClass("aok-hidden"),e("#pw-eligible-cities-popover").addClass("aok-hidden"),c.addCSMTagForPWFeature(b,"Ajax"),f()));r()})})();m.hasOwnProperty("isPWExperienceEnabled")&&m.isPWExperienceEnabled&&f()})});p.declare("PWConfig",{buyBox:{auiEvents:{tryRowSelectEvent:"a:accordion:pwBuyBoxAccordion:tryAccordionRow:select",
buyRowSelectEvent:"a:accordion:pwBuyBoxAccordion:buyAccordionRow:select",pwRowSelectEvent:"a:accordion:buybox-accordion:pwBuyBoxAccordionRow:select",newRowSelectEvent:"a:accordion:buybox-accordion:newAccordionRow:select",dealsRowSelectEvent:"a:accordion:buybox-accordion:dealsAccordionRow:select",pwInlineTwisterToggleOnEvent:"a:switch:inlineTwisterPrimeWardrobeToggle:on",pwInlineTwisterToggleOffEvent:"a:switch:inlineTwisterPrimeWardrobeToggle:off",pwDesktopTwisterToggleOnEvent:"a:switch:twisterPrimeWardrobeToggle_desktop:on",
pwDesktopTwisterToggleOffEvent:"a:switch:twisterPrimeWardrobeToggle_desktop:off",pwRowSoftlinesSelectEvent:"a:accordion:buybox-accordion:pwBuyBoxAccordionRow_softlines:select",newRowSoftlinesSelectEvent:"a:accordion:buybox-accordion:newAccordionRow_softlines:select"},tryAccordionRowID:"#tryAccordionRow",pwAccordionRowID:"#pwBuyBoxAccordionRow",pwSoftlinesAccordionRowID:"#pwBuyBoxAccordionRow_softlines"}});p.declare("ScopingPWConfig",{nodeId:"14434870031"});"use strict";p.when("A","pw-metric-utils").register("pwFeatureToggle",
function(a,c){function d(){return"true"===b("#tbybMerchantDifferentThanWinningMerchant").attr("data-value")}var b=a.$;c.addCSMTag("pwFeatureToggleJSLoaded");var e={MAPLE_BANNER:".maple-banner",PROMO_APPLICABLE_LIST:"#applicable_promotion_list_sec"};a.state.bind("pwState",function(a,g){if((g.isTryState||g.isPWEnabled)&&a.isPWChildState){var h=[],k=[];if(a.isTryState&&a.isPWEnabled){if(h.push(b(".pw-try-feature")),k.push(b(".pw-buy-feature")),!0===d())for(var f=Object.keys(e),m=0;m<f.length;++m)k.push(b(e[f[m]]))}else if(h.push(b(".pw-buy-feature")),
k.push(b(".pw-try-feature")),!0===d())for(f=Object.keys(e),m=0;m<f.length;++m)h.push(b(e[f[m]]));for(m=0;m<h.length;++m)f=h[m],0<f.length&&(f.removeClass("pw-hidden"),f.selector in e&&c.addCount("tbybHidingOfferInconsistentFeatureCount"));for(m=0;m<k.length;++m)h=k[m],0<h.length&&(h.addClass("pw-hidden"),h.selector in e&&c.addCount("tbybHidingOfferInconsistentFeatureCount"))}g.shouldDefaultTBYBOffer&&(a.shouldDefaultTBYBOffer?(b(".pw-try-feature").removeClass("pw-hidden"),b(".pw-buy-feature").addClass("pw-hidden")):
(b(".pw-buy-feature").removeClass("pw-hidden"),b(".pw-try-feature").addClass("pw-hidden")))})});"use strict";p.when("A","pw-metric-utils","dp-refresh-handler","atf").execute(function(a,c,d){function b(b){(new d(e)).addParams({isTryState:b})}var e={featureName:"primeWardrobe"};c.addCSMTag("pwTwisterDesktopJSLoaded");(c=a.state("pwState"))&&(c=c.isTryState)&&b(c);a.state.bind("pwState",function(a,d){d.isTryState&&b(a.isTryState)})});"use strict";p.when("A","PWConfig").register("pw-common-utils",function(a,
c){var d=function(){};d.prototype.isNotEmpty=function(b){return b&&b.length};d.prototype.isPwBuyBoxVisible=function(){var b=c.buyBox;return this.isBuyboxRowVisible(b.tryAccordionRowID)||this.isBuyboxRowVisible(b.pwAccordionRowID)||this.isBuyboxRowVisible(b.pwSoftlinesAccordionRowID)};d.prototype.isBuyboxRowVisible=function(b){b=a.$(b);return this.isNotEmpty(b)};d.prototype.registerTrySelectHandler=function(b){a.on(c.buyBox.auiEvents.tryRowSelectEvent,b);a.on(c.buyBox.auiEvents.pwRowSelectEvent,b);
a.on(c.buyBox.auiEvents.pwRowSoftlinesSelectEvent,b);a.on(c.buyBox.auiEvents.pwInlineTwisterToggleOnEvent,b);a.on(c.buyBox.auiEvents.pwDesktopTwisterToggleOnEvent,b)};d.prototype.registerBuySelectHandlerForToggle=function(b){a.on(c.buyBox.auiEvents.pwInlineTwisterToggleOffEvent,b);a.on(c.buyBox.auiEvents.pwDesktopTwisterToggleOffEvent,b)};d.prototype.registerBuySelectHandlerForBBRows=function(b){a.on(c.buyBox.auiEvents.buyRowSelectEvent,b);a.on(c.buyBox.auiEvents.newRowSelectEvent,b);a.on(c.buyBox.auiEvents.newRowSoftlinesSelectEvent,
b);a.on(c.buyBox.auiEvents.dealsRowSelectEvent,b)};d.prototype.toString=function(b){var d=b;if("object"===typeof b){var c="";d="";a.each(b,function(b,a){d+=c+'"'+a+'":'+b;c=","});d&&(d="{"+d+"}")}return d};return new d});"use strict";p.when("A").register("pw-metric-utils",function(a){function c(a,b){if(l.ue&&l.ue.tag)if(a.hasOwnProperty("isPWExperienceEnabled")&&a.isPWExperienceEnabled){var d=a.hasOwnProperty("isPWEnabled")&&a.isPWEnabled;a=a.hasOwnProperty("isTryState")&&a.isTryState;l.ue.tag("isPWExperienceEnabled"+
b);d?l.ue.tag("isPWEnabled"+b):l.ue.tag("isNotPWEnabled"+b);a?l.ue.tag("isTryState"+b):l.ue.tag("isNotTryState"+b)}else l.ue.tag("isNotPWExperienceEnabled"+b)}p.when("ready","a-state").execute(function(){var d=a.state("pwState")?a.state("pwState"):{};c(d,"")});return{addCSMTagForPWFeature:c,addCSMTag:function(a){l.ue&&l.ue.tag&&l.ue.tag(a)},addCount:function(a){l.ue&&l.ue.count&&l.ue.count(a,l.ue.count(a)||1)}}});"use strict";p.when("A").register("try-state-param-util",function(){function a(){return l.location.search.replace(/(^\?)/,
"").split("\x26").reduce(function(a,b){b=b.split("\x3d");b[0]&&(a[b[0]]=b[1]);return a},{})}function c(a){if(!a)return"";var b=Object.keys(a).map(function(b){return b+"\x3d"+a[b]});return b?b.join("\x26"):""}return{isTryStateEnabled:function(){var d=a();return d&&"1"===d.isTryState},isTryStateDisabled:function(){var d=a();return d&&"0"===d.isTryState},setTryState:function(d){var b=a();b.isTryState=d?"1":"0";l.history.replaceState(l.history.state,document.title,l.location.pathname+"?"+c(b))},queryParams:a}});
"use strict";p.when("A","twister-utils").execute(function(a,c){a.state.bind("pwState",function(a,b){(b.isTryState||b.isPWEnabled)&&a.isPWChildState&&"undefined"!==typeof c.checkPWBadge&&c.checkPWBadge(null,!1)})});"use strict";p.when("A","a-switch","desktop-configurator-twister-register","pw-metric-utils","dp-js-logger","desktop-twister-toggle-prime-wardrobe").register("pw-desktop-twister-slot-htm-modifier",function(a,c,d,b,e,k){function l(b,c,d){b=b.find("#twisterPriceIdentifier");if(b===g)return g;
b=b.attr("data-value");if(b===g)return g;var n=b.concat("_dp_twister_bo_to_price");a.state.parse();b=a.state(n);if(b===g)return d.addClass(n),a.on(n,function(b){a.state.parse();var c=a.state(n);if(c!==g&&c.PRIME_WARDROBE!==b){b=a.$("."+n);var d=".pw-twister-swatch_"+n;if(0===a.$(d).length){var f=b.clone();f[0].id="pwTwisterSwatchPrice";f.addClass("pw-twister-swatch_"+n);f.addClass("twisterSwatchPrice");f.removeClass("unified-price");f.find(".price-strikethrough").addClass("pw-hidden");f.find(".a-size-base").text(c.PRIME_WARDROBE);
0===a.$(d).length&&(b.addClass("pw-hidden"),b.removeClass("twister-swatch-price"),b.before(f))}}}),g;a.trigger(n,c);return b.PRIME_WARDROBE}k=a.$;k=k("#twisterPrimeWardrobeToggle");var h=c.getSwitch(k);b.addCSMTag("pwDesktopConfiguratorSlotModifier");var p=new e("pwDesktopConfiguratorSlotModifier",this);d.registerModifier({modify:function(a){try{if(a&&h&&h.isOn()){var c=a.find(".twisterPrime");0<c.length&&c.addClass("pw-hidden");var d=a.find(".badge-slot");0<d.length&&d.addClass("pw-hidden");var n=
a.find(".inline-twister-swatch-price");if(0<n.length){c="twisterPrimeWardrobe";n[0].classList.contains("aok-hidden")&&(c+=" aok-hidden");var e=n.find(".twisterSwatchPrice");var f=e===g?g:e.text().trim();var k=l(a,f,n);if(f!==g&&k!==g&&f!==k){var q=n.clone();q[0].id="pwTwisterSwatchPrice";q.addClass("pw-twister-swatch");q.addClass("twisterSwatchPrice");q.removeClass("unified-price");q.find(".price-strikethrough").addClass("pw-hidden");q.find(".a-size-base").text(k);n.addClass("pw-hidden");n.before(q);
n.removeClass("twister_swatch_price")}n.after("\x3cdiv class\x3d'"+c+"'\x3e\x3ci class\x3d'a-icon-prime-wardrobe-badge-mini a-icon-mini aok-align-center'\x3e\x3c/i\x3e\x3c/div\x3e")}var t=a.find("#twisterAvailability");0<t.length&&t.addClass("pw-hidden")}else if(h&&a){var u=a.find(".twisterPrimeWardrobe");0<u.length&&u.addClass("pw-hidden");c=a.find(".twisterPrime");0<c.length&&c.removeClass("pw-hidden");d=a.find(".badge-slot");0<d.length&&d.removeClass("pw-hidden");n=a.find(".inline-twister-swatch-price");
0<n.length&&(a.find(".pw-twister-swatch").addClass("pw-hidden"),n.removeClass("pw-hidden"),n.addClass("twister_swatch_price"));t=a.find("#twisterAvailability");0<t.length&&t.removeClass("pw-hidden")}}catch(y){p.logError(y),b.addCount("dp:pwToggle:desktopPwTwisterSlotHtmModifier:error:counter",1)}}})});"use strict";p.when("A","a-switch","twister-filter-update","twisterRefreshFilterView","pw-metric-utils","try-state-param-util","pw-buybox","twister-js-init-dpx-data","dp-js-logger","desktop-twister-view",
"load").register("desktop-twister-toggle-prime-wardrobe",function(a,c,d,b,e,k,l,h,p,f){function m(){return null!==q&&q.isOn()}function r(){q&&m()&&q.toggle()}function n(){a.on("a:switch:twisterPrimeWardrobeToggle_desktop:flip",function(){var b=m();e.addCount(b?"pwDesktopToggleUserOn":"pwDesktopToggleUserOff");v(b)})}function v(a){k!==g&&(k.setTryState(a),x("#tab_heading_desktop_buybox_group_1").find("a").first().click(),k.isTryStateEnabled()?x("#pwBuyBoxAccordionRow").find("img").first().click():
x("[id^\x3dnewAccordionRow]").first().find("i").first().click());try{d.updateFilter({filterName:"PRIME_WARDROBE",enabled:a}),b.refreshTwisterAvailability()}catch(z){u.logError(z),e.addCount("pwDesktopToggleUpdateError")}}function B(){k&&k.isTryStateEnabled()&&("PARENT_VIEW"===f.viewType?f.twisterView.isAllViewsInitialized().then(function(){q&&!1===m()&&q.toggle()}):q&&!1===m()&&q.toggle())}var x=a.$;l=x("#twisterPrimeWardrobeToggle");var q=c.getSwitch(l),t=!1;e.addCSMTag("pwDesktopTwisterToggleJSLoaded");
var u=new p("pwDesktopTwisterToggleJSLoaded",this);m()&&v(m());h!==g&&(1>=h.num_total_variations||h.pwASINs!==g&&0===h.pwASINs.length)?(k.isTryStateEnabled()&&k.setTryState(!1),e.addCount("pwDesktopHidingToggle"),q=null,x(".pw-twister-desktop")!==g&&x(".pw-twister-desktop").remove(),c=t=!0):c=!1;c||(n(),B(),b!==g&&b.addToEligibleToInEligibleAsinCallbacks(r));return{isToggleOn:m,updateFilter:v,hasHideToggle:function(){return t}}});"use strict";p.when("A","pw-metric-utils","ready").execute(function(a,
c){function d(){if(h("#pwDealId")===g||null===h("#pwDealId")||h("#pwDealInfoPrefix")===g||null===h("#pwDealInfoPrefix"))r=!1;else if(f=h("#pwDealId").attr("data-value"),m=h("#pwDealInfoPrefix").attr("data-value"),f===g||null===f)r=!1;else{var a=h("#pw_deal_expiry_timer_"+f);if(a===g||null===a)r=!1;else if(a=a.text(),a===g||null===a)r=!1;else{var c=a.match(/\d+/g).map(Number);a=k(c[0]);var d=k(c[1]);c=k(c[2]);a=a+"h "+d+"m "+c+"s";d=h("#deal_expiry_timer_"+f);l()?(c=d.text().match(/\d+/g).map(Number),
a=k(c[0]),d=k(c[1]),c=k(c[2]),setTimeout(b,500,a+"h "+d+"m "+c+"s","#deal_expiry_timer_",500)):setTimeout(b,1E3,a,"#pw_deal_expiry_timer_",1E3)}}}function b(a,d,u){try{r=!0;a!==g&&null!==a&&null!==a.match(/\d+/g)&&a.match(/\d+/g)!==g||setTimeout(b,u,a,d,u);var n=a.match(/\d+/g).map(Number),q=n[0],t=n[1],v=e(n[2]-1);59===parseInt(v)&&(t=e(t-1),59===parseInt(t)&&--q);var y=0>q?!0:document.getElementById("deal_over_"+f)===g||null===document.getElementById("deal_over_"+f)||document.getElementById("deal_over_"+
f).classList.contains("a-hidden")?!1:!0;if(y)document.getElementById("pwldDealOverText").style.display="block",document.getElementById("pwdealCountdownTimer").style.display="none";else{var z=k(q)+"h "+k(t)+"m "+k(v)+"s";h("#pw_deal_expiry_timer_"+f)!==g&&null!==h("#pw_deal_expiry_timer_"+f)||setTimeout(b,u,a,d,u);h("#pw_deal_expiry_timer_"+f).text(m+" "+z);if(l()){var w=h(d+f).text();setTimeout(b,500,w,"#deal_expiry_timer_",500)}else w=h("#pw_deal_expiry_timer_"+f).text(),setTimeout(b,1E3,w,"#pw_deal_expiry_timer_",
1E3)}}catch(C){15<p?(c.addCount("PW_TIMER_UPDATE_ERROR"),r=!1):(l()?(w=h(d+f).text(),setTimeout(b,500,w,"#deal_expiry_timer_",500)):(w=h("#pw_deal_expiry_timer_"+f).text(),setTimeout(b,1E3,w,"#pw_deal_expiry_timer_",1E3)),p+=1)}}function e(a){0>parseInt(a)&&(a="59");return a}function k(a){10>parseInt(a)&&(a="0"+a);return a}function l(){var a=h("#deal_expiry_timer_"+f);return a===g||null===a||a.text()===g||null===a.text()||document.getElementById("dealCountdownTimer_"+f)===g||null===document.getElementById("dealCountdownTimer_"+
f)||document.getElementById("dealCountdownTimer_"+f).classList.contains("a-hidden")?!1:!0}var h=a.$,p=0;c.addCSMTag("pwTimerJSLoaded");var f,m,r;(function(){a.on("a:pageUpdate",function(){r!==g&&null!==r&&!1===r&&d()})})();d()})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageTopBrandAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("A").register("brand-insights-metrics",function(a){return{addCSMTag:function(a){b.ue&&b.ue.tag&&b.ue.tag(a)},addCount:function(a){b.ue&&b.ue.count&&b.ue.count(a,(b.ue.count(a)||0)+1)}}});"use strict";c.when("A","brand-insights-metrics","load").register("brand-insights",function(a,
b){var c=a.$,d=[".hcr-badge",".hrrv-badge",".hrrv-badge-suppress"],f=["#brandInsights_feature_div_1","#brandInsights_feature_div_2","#brandInsights_feature_div_3","#brandInsights_feature_div_4"];b.addCSMTag("marcaCXTopBrand");var e=function(){var a=d.some(function(a){return 0<c(a).length});f.forEach(function(d){0<c(d).length&&(a?(c(d).addClass("aok-hidden hoc-feature-hidden"),b.addCount("marcaCXBTFTopBrandSuppressed")):c(d).removeClass("aok-hidden"))})};e();(function(){a.on("a:pageUpdate",function(){e()})})()})});
/* ******** */
(function(c){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,b=d?d("DetailPageSoftlinesFitProductAssets",""):a;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,a,d){c.when("A","ready").execute(function(b){b.$("#fit-sizechartv2-0").length&&"object"===typeof a.ue&&a.ue.count&&a.ue.count("SizeChartV2:TableRendered.",1)})});
/* ******** */
(function(d){var e=window.AmazonUIPageJS||window.P,f=e._namespace||e.attributeErrors,a=f?f("FreeSampleAssets",""):e;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,e,f){d.when("A","a-popover","ready").execute(function(a,e){0===a.$("#freeSampleInlineJavascript").length&&d.register("sampling-feature",function(){function d(){var c=a.$("#csxfsSelectedBlock").height()*b.IMAGE_PADDING_FACTOR;a.$("#csxfsImageSelected").css("padding-top",c);a.$("#csxfsYourGiftText").css({left:b.MOVE_MAX_X,
opacity:0});a.$("#csxfsSampleImages").css({height:0,opacity:0});a.$(".csxfs_normal").each(function(){a.$(this).css("borderWidth",b.BORDERWIDTH_MIN)})}function f(c){c=a.$("#"+c);var b=a.$("#a-popover-csxDetailsPopOver");e.create(c,{name:"csxDetailsPopOver",width:715,position:"triggerBottom",content:b.html(),activate:a.capabilities.touch?"onmouseover":"onclick"})}function r(c,b){"1"!==a.$("#buybox_feature_div").css("opacity")?setTimeout(function(){r(c,b)},500):(a.$(".csxfs_featurecontainer").show(),
g=!1,n(),f("csxfsTitleDetailsLink"),f("csxfsSecondaryDetailsLink"),h()?(a.$("#csxfsSelectSampleButton, #csxfsImageSelected").bind("click",function(){c.animateIn(b)}),a.$(".csxfs_normal").bind("click",k).bind("click",function(){c.animateOut(b)}),a.$(".csxfs_normal").hover(x,y),a.$("#csxfsNoThanks").bind("click",p).unbind("click",k)):(a.$("#csxfsImageSelected").bind("click",z),a.$("#csxfsAcceptSampleButton").bind("click",k),a.$("#csxfsDeclineSampleButton").bind("click",p)),a.$("#csxfsImageSelected").hasClass("csxfs_faded_image")?
(l=!1,a.$("#addToCart").find("#freeSampleOfferListingID").val(""),a.$("#csxfsSelectedAsin").val("")):(a.$("#freeSampleOfferListingID").val(a.$("#csxfsImg0").data("offerlistingid")),a.$("#csxfsSelectedAsin").val(a.$("#csxfsImg0").data("asin"))))}var b={MOVE_MAX_X:16,MOVE_MIN_X:0,BORDERWIDTH_MAX:1,BORDERWIDTH_MIN:0,DELAY:"slow",FEATURE_CONTAINER_HEIGHT:114},g=!0,t=function(){a.$("#csffsFeaturecontainer").animate({height:b.FEATURE_HEIGHT},b.DELAY,function(){a.$("#csxfsSelectedSampleText").css({left:b.MOVE_MAX_X,
opacity:0})});a.$("#csxfsSamplesBlock").removeClass("a-hidden");a.$("#csxfsSelectedBlock").addClass("a-hidden");a.$("#csxfsImageSelected").removeClass("csxfs_faded_image");a.$("#csxfsSampleImages").animate({height:b.SAMPLES_HEIGHT,opacity:1},b.DELAY);a.$(".csxfs_normal").each(function(){a.$(this).animate({borderWidth:b.BORDERWIDTH_MAX},"3000")});a.$("#csxfsYourGiftText").animate({left:b.MOVE_MIN_X,opacity:1},b.DELAY);q(!0);return!1},q=function(c){c?(a.$("#csxfsFreeSampleDeclinedTitle").hide(),a.$("#csxfsSelectedSampleText").removeClass("csxfs_nosampleselected_text"),
a.$("#csxfsSampleTitle").show(),a.$("#csxfsFreeSampleTitle").show()):(a.$("#csxfsFreeSampleDeclinedTitle").show(),a.$("#csxfsSelectedSampleText").addClass("csxfs_nosampleselected_text"),a.$("#csxfsSampleTitle").hide(),a.$("#csxfsFreeSampleTitle").hide())},A=function(){g=!1;a.$("#csxfsLnkDiffGiftSec").hide();a.$("#csxfsLnkChooseGift").show();a.$("#csxfsLnkNoGift").hide();q(!1);a.$("#csxfsImageSelected").addClass("csxfs_faded_image");a.$("#freeSampleOfferListingID").remove();a.$("#csxfsAcceptSample").show();
a.$.get(a.$(this).data("foresterurl"));return!1},h=function(){return 1<a.$("#csxfsItemsCount").val()?!0:!1},v=function(){var c=a.$(this).data("foresterurl");c&&a.$.get(c);h()?u():(n(),a.$("#addToCart").find("#freeSampleOfferListingID").val(a.$("#csxfsImg0").data("offerlistingid")),a.$("#csxfsSampleTitle").text(a.$("#csxfsImg0").data("title")).show(),a.$("#csxfsImageSelected").removeClass("csxfs_faded_image"),a.$("#csxfsLnkNoGift").show(),q(!0),a.$("#csxfsAcceptSample").hide())},u=function(){a.$("#csxfsLnkDiffGiftSec").show();
a.$("#csxfsLnkChooseGift").hide();a.$("#csxfsLnkNoGift").show();t();return!1},n=function(){g||(a.$("#addToCart").prepend(a.$('\x3cinput type\x3d"hidden" id\x3d"freeSampleOfferListingID" name\x3d"freeSampleOfferListingID" value\x3d""\x3e')),g=!0)},B=function(){var c=a.$(this).find("img").attr("src"),w=a.$(this).data("title");a.$("#csxfsSampleImages").animate({height:0,opacity:0},b.DELAY);a.$("#csxfsSamplesBlock").addClass("a-hidden");a.$("#csxfsImageSelected").attr("src",c);a.$("#csxfsSampleTitle").text(w);
a.$("#csxfsSelectedBlock").removeClass("a-hidden");c=a.$("#csxfsSelectedBlock").height()*b.IMAGE_PADDING_FACTOR;a.$("#csxfsImageSelected").css("padding-top",c);a.$("#csffsFeaturecontainer").animate({height:b.FEATURE_CONTAINER_HEIGHT},"3000",function(){a.$("#csxfsYourGiftText").css({left:b.MOVE_MAX_X,opacity:0})});a.$("#csxfsSelectedSampleText").animate({left:b.MOVE_MIN_X,opacity:1},b.DELAY);a.$(".csxfs_normal").each(function(){a.$(this).removeClass("csxfs_highlight")});a.$(this).addClass("csxfs_highlight");
d();n();a.$("#addToCart").find("#freeSampleOfferListingID").val(a.$(this).data("offerlistingid"));a.$.get(a.$(this).data("foresterurl"))},m,l=!0,k=function(){l=!0;a.$("#csxfsSampleTitle").removeClass("csxfs_hidden_elements");a.$("#csxfsNoSample").addClass("csxfs_hidden_elements");a.$("#csxfsImageSelected").removeClass("csxfs_faded_image");if(h()){var c=a.$("#csxfsSampleTitle").text().trim(),b=a.$(this).data("title"),c=c.substring(0,c.indexOf(" ")+1)+b;a.$("#csxfsSampleTitle").text(c);a.$("#csxfsSelectProductSubheadingText").text(b);
m=b;b=a.$(this).find("img").attr("src");a.$("#csxfsImageSelected").attr("src",b);a.$(".csxfs_normal").removeClass("csxfs_highlight");a.$(this).addClass("csxfs_highlight");a.$("#csxfsButtonTextChange").removeClass("csxfs_hidden_elements");a.$("#csxfsButtonTextSelect").addClass("csxfs_hidden_elements");a.$("#csxfsFreeSampleTitle").removeClass("csxfs_hidden_elements");a.$("#csxfsTitleDetailsLink").removeClass("csxfs_hidden_elements");a.$("#csxfsSelectSampleTitle").addClass("csxfs_hidden_elements");a.$("#csxfsCountSampleChoices").addClass("csxfs_hidden_elements");
a.$("#freeSampleOfferListingID").val(a.$(this).data("offerlistingid"));a.$("#csxfsSelectedAsin").val(a.$(this).data("asin"));a.$.get(a.$(this).data("foresterurl"))}else a.$("#csxfsDeclineSampleButton").removeClass("csxfs_hidden_elements"),a.$("#csxfsAcceptSampleButton").addClass("csxfs_hidden_elements"),a.$("#freeSampleOfferListingID").val(a.$("#csxfsImg0").data("offerlistingid")),a.$("#csxfsSelectedAsin").val(a.$("#csxfsImg0").data("asin")),a.$.get(a.$("#csxfsImg0").data("foresterurl"))},p=function(){l=
!1;a.$("#csxfsSampleTitle").addClass("csxfs_hidden_elements");a.$("#csxfsNoSample").removeClass("csxfs_hidden_elements");a.$("#csxfsImageSelected").addClass("csxfs_faded_image");if(h()){a.$(".csxfs_normal").removeClass("csxfs_highlight");a.$("#csxfsNoThanks").addClass("csxfs_highlight");var b=a.$(this).data("title");a.$("#csxfsSelectProductSubheadingText").text(b);m=b;a.$("#csxfsButtonTextChange").addClass("csxfs_hidden_elements");a.$("#csxfsButtonTextSelect").removeClass("csxfs_hidden_elements");
a.$("#csxfsFreeSampleTitle").addClass("csxfs_hidden_elements");a.$("#csxfsTitleDetailsLink").addClass("csxfs_hidden_elements");a.$("#csxfsSelectSampleTitle").removeClass("csxfs_hidden_elements");a.$("#csxfsCountSampleChoices").removeClass("csxfs_hidden_elements")}else a.$("#csxfsDeclineSampleButton").addClass("csxfs_hidden_elements"),a.$("#csxfsAcceptSampleButton").removeClass("csxfs_hidden_elements");a.$("#freeSampleOfferListingID").val("");a.$("#csxfsSelectedAsin").val("");a.$.get(a.$("#csxfsNoThanks").data("foresterurl"));
return!1},z=function(){l?p():k()},x=function(){m=a.$("#csxfsSelectProductSubheadingText").text();a.$("#csxfsSelectProductSubheadingText").text(a.$(this).data("title"))},y=function(){a.$("#csxfsSelectProductSubheadingText").text(m)};return{init:function(){a.$(".csxfs_featurecontainer").show();var c=a.$("#csffsFeaturecontainer").hasClass("a-hidden");a.$("#csffsFeaturecontainer").removeClass("a-hidden");b.FEATURE_HEIGHT=a.$("#csxfsSamplesBlock").removeClass("a-hidden").height();b.SAMPLES_HEIGHT=a.$("#csxfsSampleImages").height();
a.$("#csxfsSamplesBlock").addClass("a-hidden");b.FEATURE_CONTAINER_HEIGHT=a.$("#csffsFeaturecontainer").height();c&&a.$("#csffsFeaturecontainer").addClass("a-hidden");a.$("#csxfsImageSelected").hasClass("csxfs_faded_image")&&a.$("#addToCart").find("#freeSampleOfferListingID").val("");d();a.$("#csxfsLnkDiffGift").bind("click",t);a.$("#csxfsLnkNoGift").bind("click",A);a.$(".csxfs_normal").bind("click",B);a.$("#csxfsImageSelected").bind("click",v);a.$("#csxfsLnkChooseGift").bind("click",u);a.$("#csxfsAcceptSample").bind("click",
v)},initV2:r}})})});
/* ******** */
(function(d){var c=window.AmazonUIPageJS||window.P,a=c._namespace||c.attributeErrors,b=a?a("DetailPageOffersMulticlickAssets",""):c;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,c,a){d.when("A","preventMulticlick:forceFormSubmit","atf").execute(function(b,d){function e(b){c.ue&&c.ue.count&&c.ue.count(b,1)}var f=!1,a=function(c){var a=b.$(document);a&&a.delegate(c,"click",function(){var a=b.$(c);if(!a||"submit"!==a.prop("type"))return!0;if(f)return e("oneClickDisableOneClickButton"),
a.attr("disabled",!0),!1;e("oneClickTriggerOneClickFormSubmit");d(a);f=!0;setTimeout(function(){e("oneClickEnableOneClickButtonAfterTimeout");f=!1;a.attr("disabled",!1)},3E4);return!0})};b.on("mash:willReappear",function(){e("oneClickEnableOneClickButtonOnMashReappear");f=!1});a("#one-click-button");a("#oneClickBuyButton");a("#prime-toggle-main");e("oneClickPreventMultiClickModuleCalled")});"use strict";d.when("A","atf").register("preventMulticlick:forceFormSubmit",function(a){return function(a){}})});
/* ******** */
(function(e){var l=window.AmazonUIPageJS||window.P,p=l._namespace||l.attributeErrors,a=p?p("DetailPageDesktopOffersAssets",""):l;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,l,p){e.when("A").register("add-to-form",function(a){return{addInputToForm:function(a,b,k,d){var c=document.createElement("input");c.id=a;c.type="hidden";c.name=k;c.value=d;b.appendChild(c)}}});"use strict";e.when("A","add-to-cart-parameter-name","add-to-cart-constants","add-to-form","afterLoad").execute("giftOptions-autoUpdate",
function(a,c,b,k){var d=a.$;d("input[type\x3d'checkbox'][id\x3d'gift-wrap']").each(function(){if(d(this).is(":checked")){var a=c.constructParameterName(b.ITEM_TYPES.BASE,0,b.PARAMETER_PATHS.GIFTOPTIONS),g=d(this).get(0).form;g&&k.addInputToForm("giftCheckBoxInput",g,a,"true")}})});"use strict";e.when("A","add-to-cart-parameter-name","add-to-cart-constants","add-to-form").execute("giftOptions-update",function(a,c,b,k){function d(){f("input[type\x3d'checkbox'][id\x3d'gift-wrap']").each(function(){f(this).change(function(){if(f(this).is(":checked")){var a=
c.constructParameterName(b.ITEM_TYPES.BASE,0,b.PARAMETER_PATHS.GIFTOPTIONS),d=f(this).get(0).form;d&&k.addInputToForm("giftCheckBoxInput",d,a,"true")}else(a=f('[id\x3d"giftCheckBoxInput"]'))&&a.remove()})})}var f=a.$;d();a.on("a:pageUpdate",function(){d()})});"use strict";e.when("A","add-to-cart-parameter-name","add-to-cart-constants","dp-get-offerDisplay-container").execute("quantity-update",function(a,c,b,k){function d(m){if(m&&m.value!==p&&m.nativeItemNode&&m.nativeItemNode.form!==p){var a=g(m.nativeItemNode.form);
a&&(a=a.find(h))&&a.val(m.value);a=k.getOfferDisplayContainerByElement(g(m.nativeItemNode));f(a,"form#addToCart",q,m.value);f(a,"form#buyNow","quantity",m.value)}}function f(a,b,c,d){0<a.length&&b&&(a=a.find(b+" input[name\x3d'"+c+"']"),0<a.length&&a.val(d))}var g=a.$,q=c.constructParameterName(b.ITEM_TYPES.BASE,0,b.PARAMETER_PATHS.QUANTITY),h='input[name\x3d"'+q+'"]';a.on("addToCartQuantityChange",d);a.on("a:dropdown:quantity:select",d)});"use strict";e.when("jQuery","a-popover","A","a-dropdown",
"moq-core","ready").register("moq",function(a,c,b,k,d){function f(n,b){0===k.getSelect(b).val().length?d.lockSubmission(n,a.noop,u):d.unlockSubmission(n,e)}function g(n){n=d.findMoqOfferContainerWithDomElement(n.nativeItemNode);if(null!==n){var a=n.find("#quantity, #rcxsubsQuan");f(n,a);d.tweakDisplayTextForMoqQuantityDropdown(a)}}function q(a){return d.findMoqOfferContainerWithDomElement(a.popover.$trigger[0]).find("#quantity, #rcxsubsQuan")}function h(){t||(b.on("a:popover:beforeShow:moqAtcPopover",
function(a){var n=q(a);0!==n.length&&(p(n),setTimeout(function(){n.addClass("highlightQuantityDropdownBorder")},20))}),b.on("a:popover:afterHide:moqAtcPopover",function(a){a=q(a);0!==a.length&&(a.removeClass("highlightQuantityDropdownBorder"),l(a))}),b.on("a:popover:beforeShow:MOQPreLoadPopOver",function(a){a=q(a);0!==a.length&&p(a)}),b.on("a:popover:afterHide:MOQPreLoadPopOver",function(a){a=q(a);0!==a.length&&l(a)}),b.on("a:dropdown:rcxsubsQuan:select",g),b.on("a:dropdown:quantity:select",g),t=
!0)}function m(a){var b=a.parent().parent("div").innerWidth()-a.prev("label").outerWidth()-5;100<b&&a.width(b)}function u(a){if(null===c.get(a)){var b=d.findMoqOfferContainerWithDomElement(a[0]).find("script#moqPopoverContent");0!==b.length&&(b=b.html(),a.addClass("cursorDisabled"),c.create(a,{name:"moqAtcPopover",position:"triggerLeft",closeButton:"false",inlineContent:b}))}}function e(a){null!==c.get(a)&&(a.removeClass("cursorDisabled"),c.remove(a))}function l(a){setTimeout(function(){r--;0<r||
(a.prop("disabled",!1),a.removeClass("quantityBarGrayOut"))},370)}function p(a){r++;0===k.getSelect(a).val().length&&(a.prop("disabled",!0),a.addClass("quantityBarGrayOut"))}function v(a){var b=a.find("#quantity, #rcxsubsQuan");0===b.length||b.hasClass("aok-hidden")||(k.getSelect(b).setValue(""),m(b),w(a),f(a,b))}function w(a){if(0!==a.length){var b=a.find("#quantity, #rcxsubsQuan");a.click(function(){setTimeout(function(){m(b)},20)})}}var t=!1,r=0;return{initializeQuantitySelect:function(){var a=
d.findMoqOfferContainers();0!==a.length&&(a.forEach(v),h())}}});"use strict";e.when("dp-click-counter").execute("dp-desktop-atc-click-counter",function(a){var c=document.getElementById("add-to-cart-button");c&&a.record(c,"dp-desktop-atc")});"use strict";e.when("A","ready").execute(function(a){function c(){for(var b=a.$(".offersConsistencyEnabled"),c=[],d=0;d<b.length;d++)"undefined"!=typeof b[d]&&null!=b[d]&&c.push(b[d].children);return c}function b(b){b.length&&(f=a.$("#buybox .a-accordion-active"),
f.length&&(g=f.index()));g=k(g)}function k(b){var c=a.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");c.length&&0===c.index()&&(b+=1);return b}function d(){var b=a.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");b.length&&h.length&&(b=b.index(),h[0].length&&(0===b?e=0:e=h[0].length-1))}var f,g=0,e=0,h=c();b(h);d();a.on("a:pageUpdate",function(){h=c();b(h);d()});a.on("a:accordion:buybox-accordion:select",function(b){b=a.$(b.selectedRow.$row).index();b=k(b);for(var c=
0;c<h.length;c++)h[c][g].style.display="none",h[c][b].style.display="block";g=b});a.on("a:tabs:offerDisplayGroup_tabs:select",function(b){b=a.$(b.selectedTab.$tab).index();for(var c=0;c<h.length;c++)h[c][0===e?e:g].style.display=0===b?"block":"none",h[c][0===e?g:e].style.display=0===b?"none":"block"})});e.when("A","ready").execute("quantity-selector-metrics",function(a){function c(a){l.ue&&l.ue.count(a,(ue.count(a)||0)+1)}a.on("a:dropdown:select",function(a){try{var b=a.name,d=a.value;if("quantity"===
b||"rcxsubsQuan"===b)c("desktop:quantitySelected_"+d),1<d&&c("desktop:quantitySelected:moreThanOne")}catch(f){c("desktop:quantitySelected:error")}})});"use strict";e.when("A","a-truncate","ready").execute(function(a,c){a.on("a:accordion:buybox-accordion:select",function(a){null!=document.getElementById("truncatedConditionNoteContainer")&&(c.manualTruncate("#truncatedConditionNoteContainer"),l.truncateConditionNote())});l.expandConditionNote=function(){document.getElementById("truncatedConditionNoteContainer").classList.add("aok-hidden");
var b=document.getElementById("expandedConditionNote");b.classList.remove("aok-hidden");b&&(b.setAttribute("tabindex","-1"),a.$("#expandedConditionNote").focus())};l.truncateConditionNote=function(){document.getElementById("truncatedConditionNoteContainer").classList.remove("aok-hidden");document.getElementById("expandedConditionNote").classList.add("aok-hidden");document.getElementById("truncateConditionExpanderButton").focus();var a=document.getElementById("expandedConditionNote");a&&a.removeAttribute("tabindex")}});
e.when("A").execute(function(a){a.on("a:truncate:truncatedCondition:updated",function(a){a=document.querySelector("#truncatedConditionNote .a-truncate-cut");var b=document.querySelector("#truncatedConditionNote .a-truncate-full");null!=b&&null!=a&&(b.ariaHidden=!0,a.ariaHidden=!1)})})});
/* ******** */
(function(b){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,c=d?d("ActionPanelAssets",""):a;c.guardFatal?c.guardFatal(b)(c,window):c.execute(function(){b(c,window)})})(function(b,a,d){b.when("A","jQuery","action-panel").register("usedBuyBoxDPv2",function(c,e,a){var d=function(){e("#one-click-button-ubb, #toggleBuyBox #used #add-to-cart-button-ubb").click(function(){e("#addToCart").attr("action",function(c,b){return b.replace("ref\x3ddp_start-bbf_1_glance","ref\x3ddp_start-ubbf_1_glance")});
return!0});b.when("a-popover").execute(function(b){var a=function(a){a.preventDefault();a=e("#usedItemConditionInfoLink");b.create(a,{width:250,position:"triggerBottom",activate:c.capabilities.touch?"onmousemove":"onclick",closeButton:!1,popoverLabel:"Used condition details",name:"usedItemConditionDetailsPopover",dataStrategy:"preload"}).show()};e(document).undelegate("#usedItemConditionInfoLink","click",a);e(document).delegate("#usedItemConditionInfoLink","click",a)})};return{init:function(){d()}}})});
/* ******** */
(function(C){var t=window.AmazonUIPageJS||window.P,q=t._namespace||t.attributeErrors,D=q?q("SDCXDetailPageAssets",""):t;D.guardFatal?D.guardFatal(C)(D,window):D.execute(function(){C(D,window)})})(function(C,t,q){C.when("A","jQuery").execute(function(D,x){function I(){I.prototype.popoverRangeDisplay=function(a,c){a=""+[a.getUTCDate(),"-",a.getUTCMonth()+1,"-",a.getUTCFullYear()].join("");return a=a+" - "+[c.getUTCDate(),"-",c.getUTCMonth()+1,"-",c.getUTCFullYear()].join("")};I.prototype.timeRangeDisplay=
function(a,c){return a+" - \x3cbr/\x3e"+c}}function y(a,c){a="__"+a;c=c&&u.isDebugEnabled();return function(d){function b(b,a,d,h){b[a]&&h||(b[a]=d,c&&u.debug("     key "+a+" \x3d "+d))}this[a]||(this[a]={});if(d.data)for(var h in d.data)d.data.hasOwnProperty(h)&&b(this[a],h,d.data[h],d.optional);else if(d.key)if(d.value!==q)b(this[a],d.key,d.value,d.optional);else return this[a][d.key]}}function E(a,c,d,b){b='\x3coption value\x3d"';a&&(b+=a);b+='"';d&&(b+='selected\x3d"selected" ');b+='\x3e\x3cspan class\x3d"sd-timeslot-rowindex-date"\x3e';
c&&(b+=c);return b+"\x3c/span\x3e\x3c/option\x3e"}function G(a){var c=["__",a,"Fn"].join("");return function(a){var b;a.register&&a.fn&&(this[c]||(this[c]=[]),this[c][a.register]=a.fn);if(a.nil&&this[c])for(b in this[c])if(this[c].hasOwnProperty(b))this[c][b]();if(a.arg&&this[c])for(b in this[c])if(this[c].hasOwnProperty(b))this[c][b](a.arg)}}function z(a,c){var d="__dom"+c+"_"+a,b="__dom_cached"+c+"_"+a;return function(){if(this[b]){if(this[d])return this[d]}else{this[b]=!0;var h=this.config({key:a});
h||t.console&&t.console.firebug&&console.warn(["no",c,a,"configured"].join(" "));if(h=SDFramework.jq("#"+h))return this[d]=h;t.console&&t.console.firebug&&console.warn(["no",c,"DOM element found"].join(" "))}}}function M(a){var c={};c.config=y("region_config");a&&c.config(a);c.add=function(a){a&&(this.__regions=a)};c.load=function(a){this.__loadedRegions||(this.__loadedRegions=!0,this.__regions?this._insert(a)(this.__regions):this._ajaxLoad(a))};c.pick=function(a){return function(){var b=SDFramework.jq(["#",
this.id," option:selected"].join("")).val();a.config({key:"region",value:b});a.selectCalendar()}};c._insert=function(a){var b=this;return function(c,f){b.__regions=c;f="";b.config({key:"str_selectRegion"})&&(f=E("",b.config({key:"str_selectRegion"}),!0));var d=!1,h;for(h in c)c[h].oK&&c[h].oV&&(d=!0,f+=E(c[h].oK,c[h].oV,!1));b._loading(!1);if(c=(c=b.config({key:"dom_regionList"}))?SDFramework.jq("#"+c):0)d?(c.html(f).attr("disabled",!1),c.change(b.pick(a)),c.focus(b.pick(a))):(c.attr("disabled",!0),
(f=b.config({key:"str_noRegions"}))&&c.html(E("",f,!0)))}};c._ajaxLoad=function(a){var b=this._insert(a);a={merchant:a.config({key:"id_merchant"}),marketplace:a.config({key:"id_marketplace"}),ASIN:a.config({key:"id_asin"}),SKU:a.config({key:"id_sku"}),FMID:a.config({key:"id_fmid"}),regionRequest:1};if(this.config({key:"load_url"})){this._loading(!0);var c=SDFramework.jq.getJSON(this.config({key:"load_url"}),a,b);SDFramework.jq().ajaxError(function(){return function(a,d,h){d===c&&b()}}())}else b()};
c._loading=function(a){var b=this.config({key:"dom_regionLoading"});(b=b?SDFramework.jq("#"+b):0)&&b.css("display",a?"inline":"none");this.config({key:"dom_regionList"})&&SDFramework.jq("#"+this.config({key:"dom_regionList"})).css("display",a?"none":"inline")};return c}function N(a,c,d){var b={pickenabled:0,clickenabled:0};b.config=y("zipcode");a&&b.config(a);b._zi=z("dom_zipInput","zipcode");b.enable=function(a){this._zi()&&!this.pickenabled&&(this._zi().unbind("keyup"),this._zi().bind("keyup",this.pick(a)),
this._zi().bind("keypress",function(a){if(13==a.keyCode)return a.preventDefault(),a.stopPropagation(),!1}),this.pickenabled=1,this._zi().unbind("focus"),this._zi().bind("focus",this.focus(a)),this._zi().unbind("blur"),this._zi().bind("blur",this.blur(a)));var b=this.config({key:"dom_zipGo"});b&&(b=SDFramework.jq("#"+b))&&!this.clickenabled&&(b.bind("click",this.click(a)),this.clickenabled=1)};b.click=function(a){var b=this,c=this._zi();return function(){b.select(c.val(),a,!0,b.config({key:"postal_code_length"}));
return!1}};b.focus=function(a){var b=this;this._zi();return function(a){a=b.config({key:"dom_zipDefaultClass"});var c="#"+b.config({key:"dom_zipInput"}),f="#"+b.config({key:"dom_zipValue"}),e="#"+b.config({key:"dom_zipLabel"});x(c+"."+a).size();f=x(f).html();x(c).val(f);x(c).removeClass(a);x(e).hide()}};b.blur=function(a){var b=this;this._zi();return function(a){a="#"+b.config({key:"dom_zipInput"});var c="#"+b.config({key:"dom_zipEmpty"}),f=b.config({key:"dom_zipDefaultClass"}),e="#"+b.config({key:"dom_zipLabel"});
""===x(a).val()&&(c=x(c).html(),x(a).addClass(f),x(a).val(c),x(e).html(c),x(e).show())}};b.selectCallback=function(a,b){this.selectTimer=q;a.config({key:"zipcode",value:b});a.selectCalendar()};b.invalidate=function(a,b){var c=this;this.selectTimer&&clearTimeout(this.selectTimer);this.selectTimer=setTimeout(function(){c.selectCallback(a,b)},500)};b.select=function(a,b,c){this&&(this._enter_err&&this._enter_err().css("display","none"),this._valid_err&&this._valid_err().css("display","none"));var f=
"#"+this.config({key:"dom_zipValue"});x(f).html(a);(f=this.is_valid_zip_code(a,this.config({key:"postal_code_length"})))?c&&(this[f]().css("display","block"),b.config({key:"zipcode",value:q}),b.unselectCalendar()):this.invalidate(b,a)};b.pick=function(a){var b=this;return function(c){if(this){var f=SDFramework.jq(this).val(),k="#"+b.config({key:"dom_zipPrefix"}),e="#"+b.config({key:"dom_zipEmpty"}),v="#"+b.config({key:"dom_zipValue"});k=SDFramework.jq(k).html();e=SDFramework.jq(e).html();c=x(v).html()!=
f||13==c.keyCode;f&&(f=SDFramework.jq.trim(f.replace(k,"")),f=SDFramework.jq.trim(f.replace(e,"")));d&&c&&b.select(f,a,!0,6)}}};b.validate_zipcode=function(a,b,c){function f(a,b){a||(a="");if(!e.config({key:"postal_format"}).test(a))return"_valid_err"}function d(a){if(!a)return"_enter_err"}var e=this;return 1<a?f:d};b._enter_err=z("dom_zipEntError","entererror");b._valid_err=z("dom_zipValError","validerror");b.is_valid_zip_code=b.validate_zipcode(c,b._enter_err,b._valid_err);return b}function O(a){function c(a,
c,f){function b(a){var b=a.inputs;b&&b.clearSlotFields();if(b=a.message)b.clear(),b.parent&&b.parent()&&b.parent().hide();a.shoppingCart&&a.__setCanPlaceSdOrder(!1);(a=a.cutoff)&&a.enable(!1)}function d(a){var b={};a!==q&&a.today!==q&&a.c_m_id!==q&&a.tmr_m!==q&&a.tmr_d!==q?(b.today_m=a.c_m_id,b.today_d=a.today,b.tmr_m=a.tmr_m,b.tmr_d=a.tmr_d):(a=new Date,b.today_m=a.getMonth(),b.today_d=a.getDate(),a=new Date(a.getTime()+864E5),b.tmr_m=a.getMonth(),b.tmr_d=a.getDate());return b}return function(h){if(h)if(c.hasRes(h,
f)){var e=c.getRes(h,f);if(e)if(SDUtils.isEmptyObject(e))b(a);else{var v=a.inputs;v&&v.updateSlotFields(e);if(v=a.message){var g=0,p=a.config({key:"sd_calendar"}),l=a.config({key:"id_offerlist_id"});calID=a.zipcode?"Z:"+a.config({key:"zipcode"})+"\nO:"+l:"R:1\nO:"+l;l=p.calData.getCal(calID);var r,k;for(k in l.days)if(l.days.hasOwnProperty(k)){var m=l.days[k];m[0]===h&&(r=m[1])}(h=a.message.config({key:"timeslotDeterminationFn"}))&&h(l)&&(g=1,v.serviceCharges=l.serviceCharges);h=p.config({key:"dateDisplay"});
v.serviceDisplay=l.serviceDisplay;v.update(e.ultStart,e.ultEnd,g,e,r,h,d(l))}r=a.cutoff;e=e.ultCutoff;r&&e?r.hasTimeLeft(e)?(r.update(e),a.__setCanPlaceSdOrder(!0)):(r.enable(!0,!0),a.__setCanPlaceSdOrder(!1)):a.__setCanPlaceSdOrder(!0)}else b(a)}else b(a);else b(a)}}var d={};d.config=y("config");d.shoppingCart=new J.AddToCartWrapper;d.oneClick=new J.OneClickWrapper;d.cutoff=null;d.inputs=new ScheduledDelivery.Data.FormPersistence;d.checkbox=new ScheduledDelivery.BuyBox.SDIntentCheckbox;d.slotInput=
new ScheduledDelivery.BuyBox.SlotStorage(a?a.slotInputClass:"sd_slot_input",a?a.widgetRoot:"sd_div");d.initMessage=function(){this.message=L();this.message.showDropdown=0;this.message.showServices=1};d.noSlotNotSureMessagePresent=!1;d.noSlotUnknownMessagePresent=!1;d.unselectCalendar=function(){var a=this.config({key:"sd_calendar"});a&&(a.deactivateCalendar(),this.onCalendarUnselected())};d.onCalendarUnselected=function(){this.message&&this.message.clear();this.cutoff&&this.cutoff.hasOwnProperty("enable")&&
this.cutoff.enable(!1);var a=this.config({key:"sd_calendar"});a&&(a=a.active,this.slotInput.storeSlotInput(a),this.slotInput.clearSlotInput(a));this.shoppingCart&&this.shoppingCart.hasOwnProperty("enable")&&this.checkbox.isChecked()&&this.__setCanPlaceSdOrder(!1)};d.__setCanPlaceSdOrder=function(a){this.checkbox&&this.checkbox.exists()&&this.checkbox.isChecked()&&this.shoppingCart&&this.shoppingCart.enable(a)};d.selectCalendar=function(){var a=this.config({key:"sd_calendar"});if(a)if(this.config({key:"id_offerlist_id"})===
q||this.zipcode&&this.config({key:"zipcode"})===q)a.calendar();else if(this.config({key:"id_address"})!==q||"A1PA6795UKMFR9"!==this.config({key:"id_marketplace"})&&this.config({key:"zipcode"})!==q){var d=this.config({key:"shipoption"})||0,f=this.config({key:"id_offerlist_id"});d={merchant:this.config({key:"id_merchant"}),marketplace:this.config({key:"id_marketplace"}),asin:this.config({key:"id_asin"}),quantity:this.config({key:"id_quantity"})?this.config({key:"id_quantity"}):1,SKU:this.config({key:"id_sku"}),
FMID:this.config({key:"id_fmid"}),offerListingID:f,shipoption:d};if(this.zipcode){var r=this.config({key:"zipcode"});d.id="Z:"+r+"\nO:"+f;1===this.config({key:"isAFN"})&&this.config({key:"id_address"})?d.address=this.config({key:"id_address"}):(d.zipcode=r,d.address=r)}else d.id="R:1\nO:"+f,d.region=1;(f=a.config({key:"load_url"}))||(f="/gp/product/features/scheduled-delivery/get-slots-json.html?powerbar\x3d0");a.config({key:"load_url",value:f});a.config({key:"load_payload",value:d});a.selectCalled({register:"buyboxUI",
fn:c(this,a,d.id)});a.calendar(d.id)}else a.buyboxNoAddrMessage(),a.calendar()};d.initializeDOM=function(a){function b(a){var b=a.config({key:"sd_calendar"}),c=a.slotInput.repopulateSlotInput(b.active),e=a.config({key:"dom_mainElement"}),v=a.config({key:"dom_notSureError"}),g=a.config({key:"dom_unknownError"}),f=a.config({key:"isAFN"});e&&(SDFramework.jq("#"+e).show(),(e=a.shoppingCart)&&a.checkbox&&a.checkbox.exists()&&a.checkbox.isChecked()&&e.enable(c),(c=a.cutoff)&&c.enable(!1),(c=a.oneClick)&&
c.enable(!1),a.regions&&(a.regions.config({key:"load_url",value:"jurisdictions.json"}),a.regions.load(a),a.regions.pick(a)),a.zipcode&&(a.zipcode.enable(a),SDFramework.jq("#sd_zipcode_go").click(),(c=a.config({key:"dom_zipInput"}))&&SDFramework.jq("#"+c).keyup()),b.popup&&b.popup.logClientSideMetrics&&b.popup.logClientSideMetrics(b.popup.clientSideMetrics.selectSD));1===f&&a.noSlotNotSureMessagePresent&&v&&SDFramework.jq("#"+v).show();1===f&&a.noSlotUnknownMessagePresent&&g&&SDFramework.jq("#"+g).show()}
function c(a){var b=a.config({key:"dom_mainElement"}),c=a.config({key:"dom_notSureError"}),e=a.config({key:"dom_unknownError"});b&&(SDFramework.jq("#"+b).hide(),a.shoppingCart&&a.shoppingCart.enable(!0),a.oneClick&&a.oneClick.enable(!0));c&&(a.noSlotNotSureMessagePresent=SDFramework.jq("#"+c).is(":visible"),SDFramework.jq("#"+c).hide());e&&(a.noSlotUnknownMessagePresent=SDFramework.jq("#"+e).is(":visible"),SDFramework.jq("#"+e).hide());b=a.config({key:"sd_calendar"});c=b.active;b.popup&&b.popup.logClientSideMetrics&&
b.popup.logClientSideMetrics(b.popup.clientSideMetrics.unselectSD);a.slotInput.storeSlotInput(c);a.slotInput.clearSlotInput(c)}return function(){var f=a.checkbox;f&&(f.exists()&&!f.isChecked()||b(a),f.bindDOM(),f.onCheck.handlers.add(function(){b(a)}),f.onClear.handlers.add(function(){c(a)}),f.setChecked(!1),f.exists()&&c(a))}}(d);return d}function P(){function a(a,b){if(!a||0===a.length)return 0;a=a.get(0);a=SDFramework.jq.data(a,"mutex");return b?a?a+1:1:a&&0<a?a-1:0}var c={};c.config=y("continue");
c.enable=function(c){var b=this.config({key:"enabledButton"}),d=this.config({key:"disabledButton"});b=b?SDFramework.jq("input[name\x3d"+b+"]"):null;d=d?SDFramework.jq("#"+d):null;c?a(d,0)||(b&&0<b.length&&b.css("display","block"),d&&0<d.length&&d.css("display","none")):(d&&0<d.length&&(a(d,1),d.css("display","block")),b&&0<b.length&&b.css("display","none"))};return c}function L(){var a={};a.config=y("message");a._dom_container=z("element_container","message");a._dom=z("element","message");a._dom_service=
z("element_service","message");a.clear=function(){this._dom()&&(this._dom().html(""),this._dom_container().hide());this._dom_service()&&this._dom_service().html("")};a.hide=function(){this._dom()&&(this._dom().hide(),this._dom().parent().hide());this._dom_service()&&(this._dom_service().hide(),this._dom_service().parent().hide())};a.show=function(){this._dom()&&(this._dom_container().show(),this._dom().show());this._dom_service()&&(this._dom_container().show(),this._dom_service().show())};a.updateDeferred=
function(a,d){this.clear();this.hide();if(a&&d&&(d=d.ultEnd)){d=this.dateDisplay.displayDateFn(new Date(1E3*d));switch(a.slotQualityDetail){case "BUSINESS_UNKNOWN_PROMISE":case "SYSTEM_UNKNOWN_PROMISE":a=".sd_no_promise_msg";break;case "CAPACITY_FULL":a=".sd_call_date_msg";break;case "SD_INVENTORY_STATE_RESTRICTED":a=".sd_estimate_msg";break;default:return}if(a=this._dom().find(a))a.find(".sd_promise_date").html(d),a.show(),this._dom().find(".sd_change_phone_number").show(),this._dom().parent(".sd_post_script").hide(),
this.show()}};a.update=function(a,d,b,h,f,r,m){if(a||d)if(a&&d||(b=!1),this._dom()){var c=a?b?this.dateDisplay.slotDisplayDateFn(new Date(1E3*a)):this.dateDisplay.displayDateFn(new Date(1E3*a)):null;r=d?b?this.dateDisplay.slotDisplayDateFn(new Date(1E3*d)):this.dateDisplay.displayDateFn(new Date(1E3*d)):null;b&&h&&(c="\x26nbsp;"+h.localStartTime,r=h.localEndTime+" "+this.dateDisplay.displayDateFn(new Date(1E3*d)));var e=b?this.config({key:"str_slot"}):this.config({key:"str_date"});b&&h?(b=new Date(1E3*
a),b.getUTCDay(),0===this.showDropdown?(this.config({key:"sd_item_delivery_message"})!==q&&(e=this.config({key:"sd_item_delivery_message"})),43200===d-a&&h.isHBDayDelivery&&this.config({key:"sd_item_delivery_message_without_time"})!==q&&(e=this.config({key:"sd_item_delivery_message_without_time"}))):e=this.config({key:"str_slot_message"}),e||(e=""),0===this.showDropdown&&(a="",m&&b.getUTCMonth()===m.today_m&&b.getUTCDate()===m.today_d?a=this.config({key:"sd_today"})+",":m&&b.getUTCMonth()===m.tmr_m&&
b.getUTCDate()===m.tmr_d&&(a=this.config({key:"sd_tomorrow"})+","),e=e.replace("%dot",a)),e=e.replace("%dts",h.localStartTime),e=e.replace("%dday",""),e=e.replace("%dte",h.localEndTime),e=e.replace("%dd",f)):(f=e,m=c,a=r,m=m?m:"",a=a?a:"",b=b?[m,"-",a].join(" "):""!==m?m:a,e=f+b);this._dom().html(e);this._dom().parent().show();0===this.showDropdown&&this.updateServiceMessage(this.getServices(h.reservationId));1===this.showServices&&this.showAvailableServices()}else t.console&&t.console.firebug&&t.console.warn("No message element available");
else t.console&&t.console.firebug&&t.console.log("message update called with no start or end"),this.clear()};a.showAvailableServices=function(){this._dom_service().parent().hide();if(this.serviceCharges!==q&&null!==this.serviceCharges&&!SDUtils.isEmptyObject(this.serviceCharges)){var a="",d;for(d in this.serviceCharges)if(this.serviceCharges.hasOwnProperty(d)){if(-1===d.indexOf(":"))var b=this.serviceDisplay[d].services===q?this.serviceDisplay[d].serviceDisplay:this.serviceDisplay[d].services.OLD.serviceDisplay;
else b=d.split(":"),b=this.serviceDisplay[b[0]].services[b[1]].serviceDisplay;b=-1!==b.indexOf("%formattag_start")?b.replace("%formattag_start","\x3cli class\x3dsd_bb_services\x3e"):"\x3cli class\x3dsd_bb_services\x3e"+b;b=-1!==b.indexOf("%formattag_end")?b.replace("%formattag_end","\x3c/li\x3e"):b+"\x3c/li\x3e";b=b.replace("%formatCost_start",'\x3cspan class\x3d"a-color-price"\x3e');b=b.replace("%formatCost_end","\x3c/span\x3e");b=b.replace("%service_cost",this.serviceCharges[d]);a+=b}this._dom_service().html(a);
this._dom_service().parent().show()}};a.updateServiceMessage=function(a){this._dom_service().parent().hide();var c=this.config({key:"sd_item_delivery_service_message"});if(!(null===a||1>a.length||c===q)){for(var b="",h=0;h<a.length;h++)if(-1===a[h].indexOf(":"))b=this.serviceDisplay[a[h]].services===q?b+"\x3cbr\x3e - "+this.serviceDisplay[a[h]].serviceAbbr:b+"\x3cbr\x3e - "+this.serviceDisplay[a[h]].services.OLD.serviceAbbr;else{var f=a[h].split(":");b=b+"\x3cbr\x3e - "+this.serviceDisplay[f[0]].services[f[1]].serviceAbbr}c=
c.replace("%services",b);this._dom_service().html(c);this._dom_service().parent().show()}};a.getServices=function(a){if(null===a||a===q)return null;a=a.split(";");if(4>a.length||1>a[3].length)return null;a=a[3].split("^");for(var c=[],b=0;b<a.length;b++)if(-1!==a[b].indexOf(":"))for(var h=a[b].split(":")[1],f=0;f<h.length;f++)c.push(a[b].charAt(0).toUpperCase()+":"+h.charAt(f));else for(h=a[b].split(""),f=0;f<h.length;f++)this.serviceDisplay[h[f].toUpperCase()]!==q&&c.push(h[f].toUpperCase());return c};
return a}function Q(a){function c(a){var b=a.inputs;b&&b.clearSlotFields();if(b=a.message)b.clear(),b.parent&&b.parent()&&b.parent().hide();(a=a.cbutton)&&a.enable(0)}function d(a){var b=t.console;b&&b.firebug&&b.warn(a)}function b(a){var b={};a!==q&&a.today!==q&&a.c_m_id!==q&&a.tmr_m!==q&&a.tmr_d!==q?(b.today_m=a.c_m_id,b.today_d=a.today,b.tmr_m=a.tmr_m,b.tmr_d=a.tmr_d):(a=new Date,b.today_m=a.getMonth(),b.today_d=a.getDate(),a=new Date(a.getTime()+864E5),b.tmr_m=a.getMonth(),b.tmr_d=a.getDate());
return b}function h(a,f,g){return function(e){if(e&&!e.nil)if(f.hasRes(e,g)){var l=f.getRes(e,g);SDUtils.isEmptyObject(l)&&(c(a),d("No reservation selected for "+e));var v=a.inputs;v&&v.updateSlotFields(l);if(v=a.message){var p=0,h=a.config({key:"sd_calendar"}),k=h.calData.getCal(404),r=a.message.config({key:"timeslotDeterminationFn"});r&&r(k)&&(p=1);var m,w;for(w in k.days)k.days.hasOwnProperty(w)&&(r=k.days[w],r[0]===e&&(m=r[1]));e=h.config({key:"dateDisplay"});v.serviceDisplay=k.serviceDisplay;
v.update(l.ultStart,l.ultEnd,p,l,m,e,b(k))}(l=a.cbutton)&&l.enable(1)}else c(a),d("Time UI time")}}function f(){var a=x.browser;if(null===a)return"";var b="unknown";a.mozilla?b="mozilla":a.msie?b="msie":a.webkit?b="webkit":a.safari?b="safari":a.opera&&(b="opera");return b+":"+a.version}function r(a,b){if(b){var g=b.config({key:"sd_calendar"});g&&(a?(g.loadCalled({register:"shipoptionUI",fn:function(a){var b=a.calendarData;a=a.resId;var g=b.slotQualityInfo;g&&("DEFERRED"===g.slotQuality&&k.message.updateDeferred(g,
b.defaultDates),k.inputs.updateSlotQuality(g,a,b.defaultDates))}}),a=ScheduledDelivery.Debug.forceNoSlots?{}:{merchant:b.config({key:"id_merchant"}),marketplace:b.config({key:"id_marketplace"}),requestId:b.config({key:"id_request"}),asin:b.config({key:"id_asin"}),sku:b.config({key:"id_sku"}),FMID:b.config({key:"id_fmid"}),quantity:b.config({key:"id_quantity"}),offerListingID:b.config({key:"id_offerlist_id"}),address:b.config({key:"id_address"}),itemListId:b.config({key:"id_itemList_id"}),shipoption:b.config({key:"id_shipoption"}),
browserType:f(),templateSlotID:b.config({key:"id_template_slot"}),ie:"UTF8"},g.config({key:"load_payload",value:a}),(a=g.config({key:"load_url"}))||(a="/gp/product/features/scheduled-delivery/get-slots-json.html?powerbar\x3d0"),g.config({key:"load_url",value:a}),g.calData.clearCals(),g.calendar(404),g.selectCalled({register:"shipoptionUI",fn:h(b,g,404)})):g.calendar())}}function m(a){return function(){var b=a.config({key:"id_is_selected"});r(0,a);b&&r(1,a)}}var k={};k.config=y("config");k.inputs=
new ScheduledDelivery.Data.FormPersistence;k.message=L();k.cbutton=P();a?x("body").bind(a,m(k)):t.console&&console.warn("Unable to bind load fn to dom element.");return k}function R(){function a(){}function c(a){var b='\x3ctr\x3e\x3ctd colspan\x3d"9"\x3e\x3ctable class\x3d"sd-legend"\x3e\x3ctr class\x3d"sd-legend"\x3e\x3ctd\x3e\x3ctable\x3e\x3ctr\x3e'+('\x3ctd class\x3d"sd-timeslot-weekday-date-small"\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x3cspan class"sd-legend"\x3e'+d.config({key:"not_available_key"})+
"\x3c/span\x3e\x3c/td\x3e");b=b+"\x3c/tr\x3e\x3c/table\x3e\x3c/td\x3e\x3ctd\x3e\x3ctable\x3e\x3ctr\x3e"+('\x3ctd class\x3d"sd-timeslot-highlight-date-small"\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x3cspan class"sd-legend"\x3e'+d.config({key:"available_key"})+"\x3c/span\x3e\x3c/td\x3e");b=b+"\x3c/tr\x3e\x3c/table\x3e\x3c/td\x3e\x3ctd\x3e\x3ctable\x3e\x3ctr\x3e"+('\x3ctd class\x3d"sd-timeslot-selected-date-small"\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x3cspan class"sd-legend"\x3e'+d.config({key:"selected_key"})+
"\x3c/span\x3e\x3c/td\x3e");b='\x3ctable id\x3d"sd-timeslot"\x3e\x3cthead\x3e'+(b+"\x3c/tr\x3e\x3c/table\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/td\x3e\x3c/tr\x3e");var f=a.ids;var c=new Date;var m=new Date(3E3,0,1);for(k in f)f.hasOwnProperty(k)&&(new Date(1E3*f[k].su)<m&&(m=new Date(1E3*f[k].su)),new Date(1E3*f[k].eu)>c&&(c=new Date(1E3*f[k].eu)));var k=m;b=b+'\x3ctr class\x3d"sd-timeslot-scroll-title"\x3e'+('\x3cth\x3e\x3cspan class\x3d"sd-timeslot-scroll-title"\x3e'+d.config({key:"months"})[a.c_m_id]+
" "+k.getUTCFullYear()+"\x3c/span\x3e\x3c/th\x3e");b+='\x3cth\x3e\x3cspan class\x3d"sd-timeslot-scroll-title"\x3e'+d.config({key:"months"})[a.n_m_id]+" "+c.getUTCFullYear()+"\x3c/span\x3e\x3c/th\x3e";b+='\x3c/tr\x3e\x3c/thead\x3e\x3ctbody\x3e\x3ctr\x3e\x3ctd valign\x3d"top"\x3e\x3cdiv id\x3d"sdcal-curr-month"\x3e\x3ctable class\x3d"sdcal-table" cellpadding\x3d"0" cellspacing\x3d"0" width\x3d224px style\x3d"table-layout: fixed;"\x3e';for(a=0;7>a;a++)b+='\x3ccol width\x3d"32px"/\x3e';b+='\x3cthead class\x3d"sdcal-head"\x3e\x3ctr\x3e';
for(a=0;7>a;a++)b+='\x3ctd class\x3d"sd-timeslot-index-date"\x3e'+d.config({key:"days"})[a]+"\x3c/td\x3e";b+='\x3c/tr\x3e\x3c/thead\x3e\x3ctbody\x3e\x3c/tbody\x3e\x3c/table\x3e\x3c/div\x3e \x3c!-- sdcal-curr-month --\x3e\x3c/td\x3e\x3ctd valign\x3d"top"\x3e\x3cdiv id\x3d"sdcal-next-month" style\x3d"float:right;"\x3e\x3ctable class\x3d"sdcal-table" cellpadding\x3d"0" cellspacing\x3d"0" width\x3d224px style\x3d"table-layout: fixed;"\x3e';for(a=0;7>a;a++)b+='\x3ccol width\x3d"32px"/\x3e';b+='\x3cthead class\x3d"sdcal-head"\x3e\x3ctr\x3e';
for(a=0;7>a;a++)b+='\x3ctd class\x3d"sd-timeslot-index-date"\x3e'+d.config({key:"days"})[a]+"\x3c/td\x3e";return b+"\x3c/tr\x3e\x3c/thead\x3e\x3ctbody\x3e\x3c/tbody\x3e\x3c/table\x3e\x3c/div\x3e \x3c!-- sdcal-next-month --\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e"}var d={};d.config=y("config");d._dom=z("element","popup");d.popupInitialized=!1;d.popupContent=[];d.enable=function(a){a?(a=this.config({key:"linkId"}),a=SDFramework.jq("#"+a),a.show()):((a=this._dom())&&a.hide(),a=this.config({key:"linkId"}),
a=SDFramework.jq("#"+a),a.hide())};d.onSelect=function(){var a=this.config({key:"available"}),c=this.config({key:"element"});SDFramework.jq("#"+c+" ."+a).click(function(a){return function(){var b=SDFramework.jq(this).attr("id");b=a._dateId({parse:b});a.select(b);b?a.selectCalled({arg:b}):a.selectCalled({nil:!0})}}(this))};d.click=function(){return function(){}};d.setup=function(b){function h(a,b,c){function g(a,b){if(1>a||a>l)return SDFramework.jq("\x3ctd\x3e\x26nbsp;\x3c/td\x3e").addClass(b.config({key:"notaday"}));
var g=SDFramework.jq("\x3ctd\x3e"+a+"\x3c/td\x3e");g.addClass(b.config({key:"day"}));g.addClass(b.config({key:"notavailable"}));g.attr("id",b._dateId({date:a+e}));return g}if(c){var f=b.config({key:"next_month_id"});var l=a.n_m_len;var e=a.c_m_len;c=(a.c_m_delta+a.c_m_len)%7}else f=b.config({key:"current_month_id"}),l=a.c_m_len,e=0,c=a.c_m_delta;f=["#",b.config({key:"element"})," #",f," table.sdcal-table tbody"].join("");a=Math.max(Math.ceil((a.c_m_len+a.c_m_delta)/7),Math.ceil((a.n_m_len+(a.c_m_delta+
a.c_m_len)%7)/7));f=SDFramework.jq(f);f.html("");for(var d=0;d<a;++d){for(var v=SDFramework.jq("\x3ctr\x3e\x3c/tr\x3e"),k=1;7>=k;++k)v.append(g(7*d+k-c,b));f.append(v)}}if(this._dom()){if(!this.popupInitialized){var f=this.config({key:"linkId"}),r=SDFramework.jq("#"+f);this.popupInitialized=!0}if(f=function(a,b){var c=["c_m_len","c_m_delta","n_m_len"],g;for(g in c)if(c.hasOwnProperty(g)){if(!a.hasOwnProperty(c[g]))return["No",g,"data value"].join(" ");if(0>a[c[g]])return["Negative",g,"data value",
c[g]].join(" ")}a=["next_month_id","current_month_id"];for(g in a)if(!b.config({key:a[g]}))return["No",a[g],"configured"].join(" ")}(b,this))t.console&&t.console.firebug&&console.warn("Invalid data: "+f);else{var m=this.config({key:"element"});f=SDFramework.jq("#"+m);f[0]?f[0].innerHTML=c(b):t.console&&t.console.firebug&&console.warn("No "+m+" element");h(b,this,0);h(b,this,1);b.today&&this.config({key:"today"})&&SDFramework.jq(this._dateId({id:b.today})).addClass(this.config({key:"today"}));C.when("jQuery",
"legacy-popover").execute(function(b){r.removeAmazonPopoverTrigger();r.amazonPopoverTrigger({width:540,location:["left","bottom","right"],locationAlign:"middle",localContent:"#"+m,title:'\x3cspan class\x3d"sd-timeslot-calendar-title"\x3e'+d.config({key:"popup_date_title"})+"\x3c/span\x3e",modal:!0,semiStatic:!0,onHide:a,draggable:!0,closeText:d.config({key:"closeText"}),closeEventInclude:["CLICK_OUTSIDE","CLICK_TRIGGER"]})})}}};d._dateId=function(a){if(this.config({key:"prefix"})){if(a.parse)return a.parse.split("-").pop();
if(a.date)return[this.config({key:"prefix"}),a.date].join("-");if(a.id){var b=this.config({key:"element"});b&&(b=["#",b," "].join(""));a=[this.config({key:"prefix"}),a.id].join("-");return b+"#"+a}}};d.add=function(a){a=SDFramework.jq(this._dateId({id:a}));a.removeClass(this.config({key:"notavailable"}));a.addClass(this.config({key:"available"}))};d.selectCalled=G("select");d.select=function(a){var b=this.config({key:"current_month_id"}),c=this.config({key:"next_month_id"}),d=this.config({key:"selected"}),
m=this.config({key:"element"});b=["#",m," #",b," .",d].join("");c=["#",m," #",c," .",d].join("");m=SDFramework.jq(b);c=SDFramework.jq(c);m.removeClass(d);c.removeClass(d);a&&(a=this._dateId({id:a}),SDFramework.jq(a).addClass(d))};return d}function S(){function a(a){return function(){var b=SDFramework.jq(["select#",this.id," option:selected"].join(""));b.val()?a.selectCalled({arg:b.val()}):a.selectCalled({nil:!0})}}var c={};c.config=y("config");c._dom=z("element","dropdrown");c.__slots=[];c.__slotIds=
{};c.enable=function(c){if(this._dom()){var b=this.config({key:"str_disable"});c?(b&&this.make(),this._dom().attr("disabled",!1),a(this)()):(this._dom().attr("disabled",!0),b&&this._dom().html(E("",b,!0)))}else t.console&&t.console.firebug&&console.warn("no dropdown DOM element found")};c.make=function(){var a=this.config({key:"str_select"});if(a){this._dom()||t.console&&t.console.firebug&&console.warn("Unable to find DOM element for makeDropdown");a=E("",a,!0);if(0<this.__slots.length){this.__slots.sort(function(a,
b){if(a.details.startDateUTC&&a.details.endDateUTC&&b.details.startDateUTC&&b.details.endDateUTC){a=a.details;b=b.details;var c=a.startDateUTC-b.startDateUTC;if(0!==c)return c;c=a.endDateUTC-b.endDateUTC;return 0!==c?c:(a.services!==q?a.services:"").length<=(b.services!==q?b.services:"").length}a=a.id;b=b.id;var g=0,f=0;0<=a.indexOf("-")?(c=parseInt(a.substring(0,a.indexOf("-")),10),g=parseInt(a.substring(a.indexOf("-")+1),10)):c=parseInt(a,10);0<=b.indexOf("-")?(a=parseInt(b.substring(0,b.indexOf("-")),
10),f=parseInt(b.substring(b.indexOf("-")+1),10)):a=parseInt(b,10);return 100*(c-a)+(g-f)});for(var b=0;b<this.__slots.length;b++){var c=this.__slots[b],f=c.id;c=c.details;var r=c.name,m="";c.services&&0<c.services.length&&(m=c.services.sort().join(""));a+=E(f,r,!1,m)}}this._dom().html(a)}else t.console&&t.console.firebug&&console.warn("Missing str_select for makeDropdown")};c.clear=function(){this.__slots=[];this.__slotIds={}};c.add=function(a,b,c,f,r){if(!this.__slotIds[a]){this.__slotIds[a]=1;
var d={};d.name=b;d.startDateUTC=f;d.endDateUTC=r;d.services=c?c:"";b={};b.id=a;b.details=d;this.__slots.push(b)}};c.selectCalled=G("select");c.select=function(a){try{this._dom().val(a)}catch(b){}};c.onSelect=function(){this._dom().change(a(this));this._dom().focus(a(this))};return c}function T(a){function c(a,b){b=a.ids[b];if(!b)return!1;var c=a.shipOfferingID;a=a.carrierFss;if(a){var f=(new ScheduledDelivery.Data.ReservationIdParser(b.id)).getCarriers();for(var d=[],m=0;m<f.length;m++)d.push(a[f[m]]);
f=ScheduledDelivery.Data.FulfillmentServiceSubclass.pickTightestSla.apply(q,d)}SDFramework.jq("#sd_buybox_root").trigger("slotSelected");return{slotId:b.srsids,reservationId:b.id,reservationType:b.rt,start:b.su,ultStart:b.s,mltStart:b.sm,localStartTime:b.sut,end:b.eu,ultEnd:b.e,mltEnd:b.em,localEndTime:b.eut,cutoff:b.cu,ultCutoff:b.c,mltCutoff:b.cm,timeZone:b.t,tz:b.tz,minShip:b.minShip,maxShip:b.maxShip,shipOffer:c,fss:f}}a={};a.calendarData=y("calendar_data");a.clearCals=function(){this.__calendar_data=
null;this.calendarData=y("calendar_data")};a.getCal=function(a){return this.calendarData({key:a})};a.hasCal=function(a){return this.calendarData({key:a})?!0:!1};a.hasRes=function(a,b){if(!a)return!1;if(!this.hasCal(b))return u.debug("no cal for "+b),!1;var d=this.getCal(b);if(!d.ids)return u.debug("no ids in cal "+b),!1;b=c(d,a);return SDUtils.isEmptyObject(b)?(u.debug("No res data for "+a),!1):!0};a.getRes=function(a,b){if(!this.hasRes(a,b))return{};b=this.getCal(b);return b.ids[a]?c(b,a):(u.warn("getRes messup"),
{})};a.load=function(a,b){b._loading(!0);var c=b.config({key:"load_url"});t.console&&t.console.firebug&&console.warn("loading URL : "+c);var f=b.config({key:"load_payload"});a={url:c,type:"POST",dataType:"json",contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",data:f,traditional:!0,success:function(a,b,c){return function(f,d){c.calendarData({key:b,value:f});a._loading(!1);a.calendar(b);SDFramework.jq("#sd_buybox_root").trigger("slotsReturned")}}(b,a,this),error:function(a){return function(b,
c,f){t.console&&t.console.firebug&&console.warn("unable to get calendar");a._loading(!1,1);a.deactivateCalendar();SDFramework.jq("#sd_buybox_root").trigger("slotsErrored")}}(b,a,this),timeout:2E4};SDFramework.jq.ajax(a)};return a}function K(a,c,d,b,h,f,r,m){var k={};k.identifier=a;k.startDate=c;k.startDateUTC=c;k.endDate=d;k.endDateUTC=d;k.key=h;k.selected=!1;k.textDisplay=f;k.cost=0;k.areNonVisibleServices=!1;k.config=y("config");k.showAsterisk=function(){return this.areNonVisibleServices&&m};k.getServices=
function(a){var b=[];a=a.split("^");for(var g=0;g<a.length;g++){var c=a[g];if(-1!==c.indexOf(":")){var l=c.split(":");c=l[0];l=l[1];for(var f=0;f<l.length;f++)b.push(c+":"+l.charAt(f))}else for(l=0;l<c.length;l++)b.push(c.charAt(l))}return b};k.initializeWithScheduledDelivery=function(a){this.identifier=a.id;this.startDate=new Date(1E3*a.s);this.endDate=new Date(1E3*a.e);this.startDateUTC=new Date(1E3*a.su);this.endDateUTC=new Date(1E3*a.eu);this.startTimeDisplay=a.sut;this.endTimeDisplay=a.eut;this.promotion=
a.prom;this.cost=a.costDisplay;this.services=this.getServices(a.service);this.areNonVisibleServices=!1;this.serviceDisplay="";for(var b in this.services)this.services.hasOwnProperty(b)&&(a=this.services[b].charAt(0),r[a]?this.serviceDisplay+=r[a].serviceAbbr+", ":this.areNonVisibleServices=!0);this.serviceDisplay=0<this.serviceDisplay.length?this.serviceDisplay.substring(0,this.serviceDisplay.length-2):""};b&&k.initializeWithScheduledDelivery(b);k.selectSlot=function(a){this.selected=a};k.timePlacement=
function(a,b,g){var c=a.getTime(),f=this.startDate.getTime();switch(g){case "D":var e=c/864E5|0;var d=f/864E5|0;break;case "H":e=a.getUTCHours();d=this.startDate.getUTCHours();break;case "M":e=a.getUTCMinutes(),d=this.startDate.getUTCMinutes()}return(d-e)/b|0};k.slotPlacement=function(a,b,g,c){return{timeSpot:this.timePlacement(a,g,c),daySpot:this.timePlacement(a,b,"D")}};k.toString=function(){var a=this.startTimeDisplay,b=this.endTimeDisplay;a=this.textDisplay?a+"-"+b+" "+this.textDisplay:this.dateDisplay&&
this.dateDisplay.displayDateFn?a+"-"+b+" "+this.dateDisplay.displayDateFn(this.endDate):a+"-"+b+" "+this.endDate.toDateString();b=!this.cost||this.cost.match(/^\s*$/)||"open"==this.cost||"\x26nbsp;"==this.cost?"\x26nbsp;":"("+this.cost+")";var g="";this.showAsterisk()&&(g="*");return[a," ",this.serviceDisplay," ",b,g].join("")};return k}function U(a,c){function d(a,b){-1!==a.indexOf(":")?(a=a.split(":"),b=b[a[0]].services[a[1]]):b=b[a];return b}function b(a){if(a===q)return"";for(var b=[],c=0;c<a.length;c++)if(-1!==
a[c].indexOf("^"))b.push(a[c]);else for(var f=a[c].split(""),e=0;e<f.length;e++)b.push(f[e]);b.sort();return b.join("^")}var h={};h.config=y("config");h.parent=a;h.uiOwner=c;h.slots=[];h.allSlots=[];h.currentServices=[];h.slotsPerService=[];h.slotsForServiceCombinations=[];h.services=[];h.serviceStrings=[];h.pivotDateTime=null;h.pivotDay=3;h.nightSlotEndTimeLimit=19;h.initialized=!1;h.initialize=function(a,b){this.initialized||(this.daySpan||(this.daySpan=this.uiOwner.config({key:"daySpan"})),this.dayLength||
(this.dayLength=this.uiOwner.config({key:"dayLength"})),this.setPivotDate(a),this.initializeServiceType("",!0),this.defaultSlotId=b,this.initialized=!0)};h.getDefaultBaseSlot=function(){if(this.serviceStrings===q)return this.sortedSlotList()[0];for(var a=0;a<this.sortedSlotList().length;a++){var b=this.sortedSlotList()[a],c=b.services;if(c===q||1>c.length||!this.containVisibleService(c))return b}return this.sortedSlotList()[0]};h.containVisibleService=function(a){for(var b=0;b<a.length;b++)if(this.serviceStrings[a[b]]!==
q)return!0;return!1};h.getDefaultSlot=function(a){if(this.defaultSlotId)return"NO_DEFAULT"===this.defaultSlotId?null:this.getSlotByKey(this.defaultSlotId);if(0===a)return this.getDefaultBaseSlot();for(var b=a=null,c=0;c<this.sortedSlotList().length;c++){var f=this.sortedSlotList()[c];if(parseInt(f.endTimeDisplay.split(":")[0],10)>=this.nightSlotEndTimeLimit){if(null===a||a.startDateUTC>f.startDateUTC)a=f}else if(null===b||b.startDateUTC>f.startDateUTC)b=f}return null!==b?b:a};h.setSlots=function(a,
b){var c=new Date;a=a.getCal(b);this.initialize(c,a.defaultSlotId);if(a){b=(b=this.uiOwner.config({key:"surcharge_message"}))&&0<=b.indexOf("*");for(var f in a.ids)if(a.ids.hasOwnProperty(f)){var e=void 0,v=void 0;for(e in a.days)a.days[e][0]&&a.days[e][0]==f&&(v=a.days[e][1]);e=K(null,null,null,a.ids[f],f,v,a.serviceDisplay,b);v=a.serviceDisplay;if(e.endDate>new Date){var g=e,p=this.parent.config({key:"dateDisplay"});g.dateDisplay=p;this.allSlots.push(e);g=void 0;var l=e.services,B=v;p=[];for(g in l)(-1!==
l[g].indexOf(":")||B[l[g]])&&p.push(l[g]);0===p.length&&p.push("");g=void 0;l=e;if(1<p.length){p.sort();B=p.join("");for(g in p)p.hasOwnProperty(g)&&(this.currentServices[p[g]]=!1,(e=d(p[g],v))||(p[g]=""),""===p[g]&&(this.slots.push(l),this.currentServices[""]=!0),this.services[p[g]]=p[g]);this.slotsForServiceCombinations[B]||(this.slotsForServiceCombinations[B]=[]);this.slotsForServiceCombinations[B].push(l)}else 1==p.length&&(g=p[0],this.currentServices[g]=!1,(e=d(g,v))||(g=""),""===g&&(this.slots.push(l),
this.currentServices[""]=!0),this.slotsPerService[g]||(this.slotsPerService[g]=[]),this.slotsPerService[g].push(l),this.services[g]=g)}}this.copyServiceStrings(a.serviceDisplay);this.formatServiceChargesString(a.serviceCharges)}a=this.uiOwner.config({key:"dayLength"});b=a/2|0;f=this.sortedSlotList()[0].startDate;1===this.orderDayAsFirstDay&&(f=c);this.setPivotDay((f.getUTCDay()+b)%a);this.setPivotDate(f)};h.copyServiceStrings=function(a){for(var b in a)if(a.hasOwnProperty(b)&&(this.serviceStrings[b]=
{serviceString:a[b].serviceString,serviceLearnMore:a[b].serviceLearnMore},a[b].services)){var c=a[b].services,f;for(f in c)c.hasOwnProperty(f)&&(this.serviceStrings[b+":"+f]={serviceString:c[f].serviceString,serviceLearnMore:c[f].serviceLearnMore})}};h.formatServiceChargesString=function(a){for(var b in a)a.hasOwnProperty(b)&&this.serviceStrings.hasOwnProperty(b)&&this.serviceStrings[b].serviceString&&(this.serviceStrings[b].serviceString=this.serviceStrings[b].serviceString.replace("%service_cost",
a[b]))};h.initializeServiceType=function(a,b){this.currentServices[a]=b};h.setServiceType=function(a,b){this.currentServices[a]===q&&(a="");this.currentServices[a]=b;a=[];for(var c in this.currentServices)"undefined"!=typeof c&&""!==c&&this.currentServices[c]&&a.push(c);0===a.length?this.slots=this.slotsPerService[""]:1==a.length?this.slots=this.slotsPerService[a[0]]:(a.sort(),c=a.join(""),this.slots=this.slotsForServiceCombinations[c])};h.lastGrid=null;h.setPivotDay=function(a){0<=a&&6>=a&&(this.pivotDay=
a)};h.setPivotDate=function(a){this.pivotDateTime=a?new Date(a.getTime()):new Date;this.pivotDateTime.setUTCHours(0,0,0,0);var b=this.pivotDateTime.getUTCDay();this.pivotDateTime.setUTCDate(this.pivotDateTime.getUTCDate()+this.pivotDay-b);this.pivotDateTime.setUTCDate(this.pivotDateTime.getUTCDate());b=this.uiOwner.config({key:"dayLength"});var c=+b/2|0,f=new Date(this.pivotDateTime.getTime());f.setUTCDate(f.getUTCDate()-c);var e=new Date(this.pivotDateTime.getTime());e.setUTCDate(e.getUTCDate()+
c);e.setUTCHours(23,59,59,999);a.getTime()>e.getTime()?this.pivotDateTime.setUTCDate(this.pivotDateTime.getUTCDate()+b):a.getTime()<f.getTime()&&this.pivotDateTime.setUTCDate(this.pivotDateTime.getUTCDate()-b)};h.slotsInRange=function(){var a=+this.uiOwner.config({key:"dayLength"})/2|0,b=new Date(this.pivotDateTime);b.setUTCDate(b.getUTCDate()-a);a=[];this.sortedSlotList();if(this.slots)for(var c=0;c<this.slots.length;c++){var d=this.slots[c].timePlacement(b,this.daySpan,"D");0<=d&&d<this.dayLength&&
(a[d]||(a[d]=[]),a[d].push(this.slots[c]))}return this.lastGrid=a};h.sortedSlotList=function(){this.initialize(new Date);return this.allSlots.sort(function(a,b){return 0===a.startDate-b.startDate?a.endDate-b.endDate:a.startDate-b.startDate})};h.orderedRowKeys=function(a){a=[];var b=[],c=0;for(c in this.lastGrid)if(c==parseInt(c,10))for(var d in this.lastGrid[c])d==parseInt(d,10)&&a.push({start:60*this.lastGrid[c][d].startDate.getUTCHours()+this.lastGrid[c][d].startDate.getUTCMinutes(),end:60*this.lastGrid[c][d].endDate.getUTCHours()+
this.lastGrid[c][d].endDate.getUTCMinutes(),stime:this.lastGrid[c][d].startTimeDisplay,etime:this.lastGrid[c][d].endTimeDisplay});a.sort(function(a,b){return a.start==b.start?a.end-b.end:a.start-b.start});0<a.length&&b.push(a[0]);for(d=1;d<a.length;d++)a[d-1].start==a[d].start&&a[d-1].end==a[d].end||b.push(a[d]);return b};h.getSlotById=function(a){if(!a)return null;for(var b=0;b<this.allSlots.length;b++)if(this.allSlots[b].identifier==a)return this.allSlots[b];return null};h.getSlotByTimes=function(a,
c,d){if(!(a&&c&&d&&this.allSlots))return null;var f=d.split(";");d=[];4<=f.length&&(d=f[3].split("^"));for(f=0;f<this.allSlots.length;f++){var e=this.allSlots[f],v;if(v=e.startDate.getTime()==1E3*a&&e.endDate.getTime()==1E3*c)v=d,v=b(e.services)===b(v);if(v)return e}return null};h.getCurrentSlotByTimes=function(a,b){if(!a||!b||!this.slots)return null;for(var c=0;c<this.slots.length;c++){var d=this.slots[c];if(d.startDate.getTime()==a&&d.endDate.getTime()==b)return d}return null};h.getSlotByKey=function(a){for(var b=
0;b<this.allSlots.length;b++)if(this.allSlots[b].key===a)return this.allSlots[b];return null};return h}function V(a){function c(a,b){var c=e.config({key:"notavailable"}),g=e.config({key:"slotButton"}),d="",f="";if(-1===a&&-1===b)return c=e.config({key:"notavailable"}),a='\x3ctd class\x3d"'+g+'" rowspan\x3d"1"\x3e'+('\x3cdiv class\x3d"'+c+'"\x3e')+"\x3c/div\x3e",a+="\x3c/td\x3e";var v=1;if(e.model.lastGrid[b])for(var h=0;h<e.model.lastGrid[b].length;h++)if(a.start==60*e.model.lastGrid[b][h].startDate.getUTCHours()+
e.model.lastGrid[b][h].startDate.getUTCMinutes()&&a.end==60*e.model.lastGrid[b][h].endDate.getUTCHours()+e.model.lastGrid[b][h].endDate.getUTCMinutes()){c=e.config({key:"available"});e.model.lastGrid[b][h].promotion&&(c+=" "+e.config({key:"promotionavailable"}));d=e.model.lastGrid[b][h].key;f=e.model.lastGrid[b][h].cost;e.model.lastGrid[b][h].showAsterisk()&&(f+="*");var k=e.model.lastGrid[b][h],n=e.selected_id;if(!n&&k.selected||n==k.key)c+=" "+e.config({key:"selected"});e.model.lastGrid[b][h].rowspan!==
q&&(v=e.model.rowspan)}[e.config({key:"prefix"}),d].join("-");a='\x3ctd id\x3d"'+d+'" class\x3d"'+g+" "+c+' ap_custom_close" rowspan\x3d"'+v+'"\x3e';a=c===e.config({key:"notavailable"})?a+"\x26nbsp;":a+f;return a+="\x3c/td\x3e"}function d(a,b){a=a+"Nav"+b;b='\x3ctd class\x3d"'+e.config({key:a+"Class"})+'"\x3e';b+=e.config({key:a+"Inner"});return b+"\x3c/td\x3e"}function b(){function b(){var b=e.model.pivotDateTime.getUTCMonth(),c=e.model.pivotDateTime.getUTCFullYear(),g=e.model.pivotDateTime.getUTCDate();
e.selected_id===q&&(e.selected_id=SDFramework.jq("#"+e.config({key:"element"})+" ."+e.config({key:"selected"})).attr("id"));e.navigateLateralSlots(0,g,b,c);b=e.selected_id;c=null;b&&(b=e.model.getSlotByKey(b),c=e.model.getCurrentSlotByTimes(b.startDate.getTime(),b.endDate.getTime()));c&&(a.enableInconsistentWithBuybox(!1),e.selected_id=c.key,k(e,c.key))}function c(b){var c=this.id;SDFramework.jq(this).bind("click",function(b){a.enableInconsistentWithBuybox(!1);e.selected_id=c;k(e,c)});SDFramework.jq(this).dblclick(function(){SDFramework.jq(".ap_close").click()})}
var d=SDFramework.jq(".sd-timeslot-scroll-title-left-enabled"),l=SDFramework.jq(".sd-timeslot-scroll-title-right-enabled"),f=SDFramework.jq("td."+e.config({key:"available"})),h=SDFramework.jq("td."+e.config({key:"selected"}));d.bind("click",function(a){a=e.model.pivotDateTime.getUTCMonth();var b=e.model.pivotDateTime.getUTCFullYear(),c=e.model.pivotDateTime.getUTCDate();e.navigateLateralSlots(-1,c,a,b)});l.bind("click",function(a){a=e.model.pivotDateTime.getUTCMonth();var b=e.model.pivotDateTime.getUTCFullYear(),
c=e.model.pivotDateTime.getUTCDate();e.navigateLateralSlots(1,c,a,b)});SDFramework.jq(".sdServiceType").click(function(a){var c=SDFramework.jq(this);a=c.is(":checked");c=c.attr("servicetype");e.selectService(c,a);b()});SDFramework.jq(".sdHSelectServiceType").change(function(a){SDFramework.jq(".sdHServiceType",this).each(function(){var a=SDFramework.jq(this),b=a.is(":selected");a=a.attr("servicetype");e.selectService(a,b)});setTimeout(b,0)});f.each(c);h.each(c)}function h(a,b,c){for(var g=0;g<c.length;g++)if(a==
60*c[g].startDate.getUTCHours()+c[g].startDate.getUTCMinutes()&&b==60*c[g].endDate.getUTCHours()+c[g].endDate.getUTCMinutes())return g;return-1}function f(a){var b;if(3>a.length)return null;var c=-1;for(b=0;b<a.length-2;b++)if(a[b].start==a[b+1].start){c=b;break}if(0>c)return null;var l=a[c].end,d=a[c+1].end;for(b=c+2;b<a.length&&!(a[b].start!=l||a[b].end>d);b++){if(a[b].end==d)return[c,b];l=a[b].end}return null}function r(){var a=e.config({key:"rootWidgetId"});SDFramework.jq("#"+a).attr("alreadyShowingPopup",
1);0===e.showDropdown&&SDFramework.jq("#"+a).parents("td").eq(0).prev().find("input[type\x3dradio]").click();t.popoverTimer&&(a=t.popoverTimer[e.config({key:"widgetIndex"})],a!==q&&clearTimeout(a));e.logClientSideMetrics(e.clientSideMetrics.openCalendar);a=null!==e.selectedSlot?e.selectedSlot.services:[];for(var c=0;c<a.length;c++)e.model.setServiceType(a[c],1);a=e.config({key:"element"});a=SDFramework.jq("#"+a);c=e.getCalendarHtml();a&&a[0]&&(a[0].innerHTML=c);b();SDFramework.jq("#ap_overlay").bind("touchend",
function(){this.click()})}function m(){e.select(e.selected_id);e.logClientSideMetrics(e.clientSideMetrics.closeCalendar);var a=e.config({key:"rootWidgetId"});SDFramework.jq("#"+a).attr("alreadyShowingPopup",0)}function k(a,b){var c=a.config({key:"element"}),g=a.config({key:"selected"});a.config({key:"available"});SDFramework.jq("#"+c+" ."+g).removeClass(g);b&&(SDFramework.jq("#"+b).addClass(g),b=a.model.getSlotByKey(b),a.logClientSideMetricsForSlot(a.clientSideMetrics.selectSlot,b))}var e={};e.config=
y("config");e._dom=z("element","popup");e.popupInitialized=!1;e.model=U(a,e);e.selectedSlot=null;e.enable=function(a){a?(a=this.config({key:"linkId"}),a=SDFramework.jq("#"+a),a.show()):(this._dom()&&this._dom().hide(),a=this.config({key:"linkId"}),a=SDFramework.jq("#"+a),a.hide())};e.onSelect=function(){};e.click=function(){};e.colorSwatch=function(){var a=[];a.push('\x3cdiv class\x3d"calendar-header"\x3e');a.push('\x3cspan class\x3d"calendar-swatch calendar-available"\x3e\x26nbsp;\x3c/span\x3e\x3cspan class\x3d"calendar-legend"\x3e'+
e.config({key:"available_key"})+"\x3c/span\x3e");a.push('\x3cspan class\x3d"calendar-swatch calendar-selected"\x3e\x26nbsp;\x3c/span\x3e\x3cspan class\x3d"calendar-legend"\x3e'+e.config({key:"selected_key"})+"\x3c/span\x3e");a.push('\x3cspan class\x3d"calendar-swatch calendar-not-available"\x3e\x26nbsp;\x3c/span\x3e\x3cspan class\x3d"calendar-legend"\x3e'+e.config({key:"not_available_key"})+"\x3c/span\x3e");this.promotionAvailable&&a.push('\x3cspan class\x3d"calendar-swatch calendar-promotion-available"\x3e\x26nbsp;\x3c/span\x3e\x3cspan class\x3d"calendar-legend"\x3e'+
e.config({key:"promotion_available_key"})+"\x3c/span\x3e");a.push("\x3c/div\x3e");return a.join("")};e.refreshSlots=function(){for(var a in this.model.allSlots)if(this.model.allSlots.hasOwnProperty(a)){var b=this.model.allSlots[a];b.originalEndDate&&(b.endDate=b.originalEndDate);b.originalEndTimeDisplay&&(b.endTimeDisplay=b.originalEndTimeDisplay);b.rowspan=q;b.promotion!==q&&(this.promotionAvailable=!0)}};e.getCalendarHtml=function(){var a=this.config({key:"days"}),b=this.config({key:"dayLength"}),
p=+b/2|0,l="";this.model.initialize(new Date);this.refreshSlots();this.model.slotsInRange();l+=this.colorSwatch();l+='\x3ctable class\x3d"sd-timeslot-header" border\x3d0 cellpadding\x3d2 cellspacing\x3d0 width\x3d"470"\x3e\x3cthead\x3e';var h=new Date(this.model.pivotDateTime.getTime());h.setUTCDate(h.getUTCDate()-p);var k=new Date(this.model.pivotDateTime.getTime());k.setUTCDate(k.getUTCDate()+p);var A=h.getUTCDay();var m=this.model.pivotDateTime.getUTCMonth();var r=this.model.pivotDateTime.getUTCFullYear();
var n=this.model.pivotDateTime.getUTCDate();var w=this.config({key:"surcharge_message"});var t=[];t.push('\x3ctr class\x3d"sd_notice"\x3e');t.push('\x3ctd colspan\x3d"3"\x3e');t.push('\x3cspan class\x3d"sd_notice"\x3e');t.push(w);t.push("\x3c/span\x3e");t.push("\x3c/td\x3e");t.push("\x3c/tr\x3e");t.push("\x3ctr\x3e");t.push('\x3ctd colspan\x3d"3"\x3e');t.push('\x3chr class\x3d"sd_dashed" /\x3e');t.push("\x3c/td\x3e");t.push("\x3c/tr\x3e");w=t.join("");l+=w;w="";t=e.config({key:"months"});t=new I(t);
w=w+'\x3ctr class\x3d"sd-timeslot-scroll-title"\x3e'+d("left",e._canMove(-1,n,m,r)?"Enabled":"Disabled");w=w+'\x3ctd class\x3d"sd-timeslot-scroll-title"\x3e\x3cspan class\x3d"sd-timeslot-scroll-title"\x3e'+t.popoverRangeDisplay(h,k);w=w+"\x3c/span\x3e\x3c/td\x3e"+d("right",e._canMove(1,n,m,r)?"Enabled":"Disabled");this.model.monthOfDays=[];this.model.dayOfDays=[];m=new Date;l=l+(w+"\x3c/tr\x3e")+'\x3c/thead\x3e\x3c/table\x3e\x3ctable class\x3d"sd-timeslot-table" width\x3d"470px" style\x3d"table-layout: fixed;"\x3e\x3ctbody\x3e\x3ctr class\x3d"sd-timeslot-index-date"\x3e\x3cth class\x3d"sd-timeslot-index-date sdleft"\x3e\x26nbsp;\x3c/th\x3e';
for(n=r=0;n<=2*p;n++)k=new Date(h.getTime()),k.setDate(k.getUTCDate()+n),l+='\x3cth class\x3d"sd-timeslot-index-date"\x3e',w=(A+n)%7,w=0>w?7+w:w,l+='\x3cspan class\x3d"sd-timeslot-index-date"\x3e',l=1===this.model.orderDayAsFirstDay&&e.config({key:"sd_today"})!==q&&m.getFullYear()===k.getFullYear()&&m.getUTCMonth()===k.getUTCMonth()&&m.getUTCDate()===k.getUTCDate()?l+e.config({key:"sd_today"}):l+a[w],l+="\x3cbr /\x3e"+k.getDate(),l+="\x3c/span\x3e",l+="\x3c/th\x3e",this.model.monthOfDays[r]=k.getUTCMonth(),
this.model.dayOfDays[r]=k.getUTCDate(),r++;l+="\x3c/tr\x3e";a=this.model.orderedRowKeys(!0);if(0===a.length){l+="\x3ctr\x3e";for(A=-p;A<=p;A++)l+=c(-1,-1);l=l+'\x3c/tr\x3e\x3ctr\x3e\x3ctd class\x3d"sd-timeslot-index-date sdleft"\x3e\x3c/td\x3e'+('\x3ctd class\x3d"sd-message" colspan\x3d'+b+'\x3e\x3cspan class\x3d"sd-message"\x3e'+e.config({key:"no_slots_for_week"})+"\x3c/span\x3e\x3c/td\x3e");l+="\x3c/tr\x3e"}this.model.cellsToMerge=f(a);this.model.availableDay=q;this.model.hideCells={};null!==this.model.cellsToMerge&&
e.checkSlots(a);this.model.availableDay!==q&&0>=this.model.availableDay&&(a.splice(this.model.cellsToMerge[0]+1,1),this.model.rowspan=this.model.cellsToMerge[1]-this.model.cellsToMerge[0]);p=new I(e.config({key:"months"}));for(n=0;n<a.length;n++){h=a[n];A=[h.stime,h.etime];l+="\x3ctr\x3e";l+='\x3ctd class\x3d"sd-timeslot-rowindex-date sdleft"\x3e\x3cspan class\x3d"sd-timeslot-rowindex-date"\x3e'+p.timeRangeDisplay(A[0],A[1])+"\x3c/span\x3e\x3c/td\x3e";for(A=0;A<b;A++)e.isHidden(n,A)===q&&(l+=c(h,
A));l+="\x3c/tr\x3e"}l=l+"\x3c/tbody\x3e\x3c/table\x3e"+('\x3cspan class\x3d"sd_add_services_msg"\x3e'+e.config({key:"sd_checkout_spc_service_list"})+"\x3c/span\x3e");p={};b={};for(var u in this.model.services)-1!==u.indexOf(":")&&(a=u.split(":"),b[a[0]]!==q?b[a[0]].push(a[1]):(b[a[0]]=[],b[a[0]].push(a[1]),p[a[0]]=1));for(var x in this.model.services)this.model.services.hasOwnProperty(x)&&-1===x.indexOf(":")&&(p[x]?b[x].push("OLD"):(u=l,l=x,e.model.serviceStrings[l]?(a=e.model.serviceStrings[l].serviceString,
A=e.model.serviceStrings[l].serviceLearnMore,h=[],h.push('\x3cdiv class\x3d"sd_notice"\x3e'),a&&e.model.currentServices[l]&&(h.push(a),A&&(h.push(" "),h.push(A))),h.push("\x3c/div\x3e"),l=h.join("")):l="",l=u+l));for(var H in b)if(b.hasOwnProperty(H)){l+='\x3cdiv class\x3d"sd_notice"\x3e';for(x=0;x<b[H].length;x++)a=b[H][x],p=H+":"+a,u=e.model.serviceStrings[p]?e.model.serviceStrings[p].serviceLearnMore:q,a="OLD"===a?e.model.currentServices[H]:e.model.currentServices[p],p=e.model.serviceStrings[p].serviceString,
a&&(l+=p,u&&(l+=" "+u),l+="\x3cbr /\x3e");l+="\x3c/div\x3e"}return l};e.checkSlots=function(a){var b=this.config({key:"dayLength"});this.model.availableDay=0;this.model.matchingDays=[];for(var c=0;c<b;c++)this.model.lastGrid[c]&&e.processMatchingColumn(e.checkColumn(a,c),a,c);e.hideRow(b)};e.hideRow=function(a){if(!(0>=this.model.availableDay))for(a=0;a<this.model.matchingDays.length;a++)e.hideOneCell(this.model.cellsToMerge[1],this.model.matchingDays[a])};e.processMatchingColumn=function(a,b,c){if(!(0>
a)){a=this.model.lastGrid[c][a];a.originalEndDate=new Date(a.endDate.getTime());a.originalEndTimeDisplay=a.endTimeDisplay;a.endDate.setUTCHours(b[this.model.cellsToMerge[0]].end/60|0);a.endDate.setUTCMinutes(b[this.model.cellsToMerge[0]].end%60);a.endTimeDisplay=b[this.model.cellsToMerge[0]].etime;a.rowspan=1;for(b=this.model.cellsToMerge[0]+1;b<this.model.cellsToMerge[1];b++)e.hideOneCell(b,c);this.model.rowspan=this.model.cellsToMerge[1]-this.model.cellsToMerge[0]+1}};e.checkColumn=function(a,b){var c=
this.model.cellsToMerge[0],g=h(a[c+1].start,a[c+1].end,this.model.lastGrid[b]);if(0>g)return-1;this.model.availableDay++;if(0<=h(a[c].start,a[c].end,this.model.lastGrid[b]))return-1;for(c+=2;c<a.length&&c<=this.model.cellsToMerge[1];c++)if(0<=h(a[c].start,a[c].end,this.model.lastGrid[b]))return-1;this.model.availableDay--;this.model.matchingDays.push(b);return g};e.isHidden=function(a,b){return this.model.hideCells['"'+this.model.monthOfDays[b]+"-"+this.model.dayOfDays[b]+"-"+a+'"']};e.hideOneCell=
function(a,b){this.model.hideCells['"'+this.model.monthOfDays[b]+"-"+this.model.dayOfDays[b]+"-"+a+'"']=1};e.clientSideMetrics={};e.clientSideMetrics.selectSD="1";e.clientSideMetrics.loadSlots="2";e.clientSideMetrics.openCalendar="3";e.clientSideMetrics.selectSlot="4";e.clientSideMetrics.closeCalendar="5";e.clientSideMetrics.nextPageCalendar="6";e.clientSideMetrics.prevPageCalendar="7";e.clientSideMetrics.unselectSD="8";e.clientSideMetrics.selectionChanged="9";e.clientSideMetrics.initializeSDPopup=
"10";e.logClientSideMetrics=function(a){this.logClientSideMetricsForSlot(a,this.selectedSlot)};e.logClientSideMetricsForSlot=function(a,b){var c="",g="",d="",e="",f="",h="",k="",n="",v="",m="DP",r="",t="";if(this.model){if(this.model.parent){var u=this.model.parent.config({key:"load_payload"});u&&(c=u.marketplace,g=u.asin,n=u.shipoption,r=u.address);this.model.parent.isSpc&&this.model.parent.isSpc()?m="SPC":(u=this.model.parent.config({key:"id_select_fn"}))&&("shipoptionselectpage"===u.substring(0,
20)?m="SOSP":"emptySetSOCallback"===u&&(m="YA"))}this.model.getDefaultBaseSlot&&this.model.getDefaultBaseSlot()&&this.model.getDefaultBaseSlot().startDate&&this.model.getDefaultBaseSlot().startDate.getTime&&(d=this.model.getDefaultBaseSlot().startDate.getTime(),e=this.model.getDefaultBaseSlot().endDate.getTime());this.model.allSlots&&this.model.allSlots.length!==q&&(t=this.model.allSlots.length.toString())}b&&(f=b.startDate.getTime(),h=b.endDate.getTime(),k=b.services,v=b.identifier);if(g instanceof
Array)for(b=0;b<g.length;b++)ue.log(["mpid\x3d",c,"\x26asin\x3d",g[b],"\x26a\x3d",a,"\x26fas\x3d",d,"\x26ss\x3d",f,"\x26svc\x3d",encodeURIComponent(k),"\x26so\x3d",encodeURIComponent(n),"\x26sid\x3d",encodeURIComponent(v),"\x26page\x3d",m,"\x26addr\x3d",r,"\x26snum\x3d",t,"\x26se\x3d",h,"\x26fae\x3d",e].join(""),"scheduled-delivery",null);else ue.log(["mpid\x3d",c,"\x26asin\x3d",g,"\x26a\x3d",a,"\x26fas\x3d",d,"\x26ss\x3d",f,"\x26svc\x3d",encodeURIComponent(k),"\x26so\x3d",encodeURIComponent(n),"\x26sid\x3d",
encodeURIComponent(v),"\x26page\x3d",m,"\x26addr\x3d",r,"\x26snum\x3d",t,"\x26se\x3d",h,"\x26fae\x3d",e].join(""),"scheduled-delivery",null)};e.setup=function(a){if(!this.popupInitialized){var c=this.config({key:"linkId"}),d=SDFramework.jq("#"+c);this.popupInitialized=!0}var l=this;if(this._dom())if((c=function(a,b){var c=["c_m_len","c_m_delta","n_m_len","timeslots"],d;for(d in c)if(c.hasOwnProperty(d)){if(!a.hasOwnProperty(c[d]))return["No",d,"data value"].join(" ");if(0>a[c[d]])return["Negative",
d,"data value",c[d]].join(" ")}a=["next_month_id","current_month_id"];for(d in a)if(!b.config({key:a[d]}))return["No",a[d],"configured"].join(" ")}(a,this))&&t.console&&t.console.firebug)console.warn("Invalid data: "+c);else{a.today&&this.config({key:"today"})&&SDFramework.jq(this._dateId({id:a.today})).addClass(this.config({key:"today"}));var f=l.config({key:"element"});C.when("jQuery","legacy-popover").execute(function(a){d.removeAmazonPopoverTrigger();d.unbind("touchend.sd");d.bind("touchend.sd",
function(){this.click()});d.unbind("click.sd");d.bind("click.sd",function(){return!SDUtils.protectAgainstDoubleAction("calendarButton")});d.amazonPopoverTrigger({width:545,location:["left","bottom","right","top","centered"],locationAlign:"middle",localContent:"#"+f,title:'\x3cspan class\x3d"sd-timeslot-calendar-title"\x3e'+e.config({key:"popup_time_title"})+"\x3c/span\x3e",modal:!0,semiStatic:!0,onShow:r,onHide:m,draggable:!0,closeText:e.config({key:"closeText"}),closeEventInclude:["CLICK_OUTSIDE",
"CLICK_TRIGGER"]})});(function(){var a=l.config({key:"element"});a=SDFramework.jq("#"+a);var c=l.getCalendarHtml();a&&a[0]&&(a[0].innerHTML=c);b()})()}};e._dateId=function(a){if(this.config({key:"prefix"})){if(a.parse)return a.parse.split("-").pop();if(a.date)return[this.config({key:"prefix"}),a.date].join("-");if(a.id){var b=this.config({key:"element"});b&&(b=["#",b," "].join(""));a=[this.config({key:"prefix"}),a.id].join("-");return b+"#"+a}}};e.add=function(a){};e.selectCalled=G("select");e.selectService=
function(a,b){this.model.setServiceType(a,b)};e.select=function(a){var b=this.config({key:"element"}),c=this.config({key:"selected"});this.config({key:"available"});this.config({key:"slotButton"});SDFramework.jq("#"+b+" ."+c).removeClass(c);a&&(SDFramework.jq("#"+a).addClass(c),this.selectCalled({arg:a}),b=!1,c="",this.selectedSlot?(c=this.selectedSlot.key,this.selectedSlot.selected=!1):b=!0,this.selectedSlot=this.model.getSlotByKey(a))&&(this.selectedSlot.selected=!0,b?this.logClientSideMetrics(this.clientSideMetrics.loadSlots):
c!==this.selectedSlot.key&&this.logClientSideMetrics(this.clientSideMetrics.selectionChanged));this.selectedSlot&&this.model.setPivotDate(this.selectedSlot.startDate)};e._canMove=function(a,b,c,d){var l=this.model.sortedSlotList(),g=l[0];l=l[l.length-1];var f=new Date,e=this.config({key:"dayLength"});if(!g||!l)return!1;var h=+e/2|0;f.setUTCFullYear(2004);f.setUTCMonth(0);f.setUTCDate(1);f.setUTCFullYear(d);f.setUTCMonth(c);f.setUTCDate(b);f.setUTCHours(0,0,0,0);f.setUTCDate(f.getUTCDate()+a*e);a=
new Date(f.getTime());a.setUTCDate(a.getUTCDate()-h);a.setUTCHours(0,0,0,0);b=new Date(f.getTime());b.setUTCDate(b.getUTCDate()+h);b.setUTCHours(23,59,59,999);return b<new Date||b<g.endDate||a>l.startDate?!1:!0};e.navigateLateralSlots=function(a,c,d,l){if(this._canMove(a,c,d,l)){var g=SDFramework.jq("#"+this.config({key:"element"})),f=new Date,e=this.config({key:"dayLength"});f.setUTCFullYear(2004);f.setUTCMonth(0);f.setUTCDate(1);f.setUTCFullYear(l);f.setUTCMonth(d);f.setUTCDate(c);f.setUTCHours(0,
0,0,0);f.setUTCDate(f.getUTCDate()+a*e);this.model.setPivotDate(f);this.model.slotsInRange();c=this.getCalendarHtml();g.html(c);b();g=-1===a?this.clientSideMetrics.prevPageCalendar:this.clientSideMetrics.nextPageCalendar;0!==a&&this.logClientSideMetrics(g);return c}};return e}function W(){function a(a,b,c,d){var l=SDUtils.isBeacon(a);c?l&&0<b?a.slideDown(b):a.show():l&&0<b?a.slideUp(b):a.hide();a=a.parents(".sd_widget_root").find(".sd_controls");d?a.show():a.hide()}function c(a,b){a.each(function(){g(this).amazonPopoverTrigger({location:["right",
"auto"],locationAlign:"top",locationMargin:-10,width:null,skin:null,hoverHideDelay:0,hoverShowDelay:0,showOnHover:!0,showCloseButton:!1,literalContent:b})})}function d(a){a.css("cursor","not-allowed");a.addClass("sd-disabled")}function b(a){a.css("cursor","");a.removeClass("sd-disabled")}function h(a,b){a={noSlotNotSure:g("#"+a.config({key:"dom_noslotsNotSure"})),noSlotUnknown:g("#"+a.config({key:"dom_noslotsUnknown"})),ineligibleZip:g("#"+a.config({key:"dom_slotsContent"})),slotsContent:g("#"+a.config({key:"dom_slotsContent"}))};
for(var c in a)c===b?a[c].show():a[c].hide()}function f(f,e,p){if(f.config({key:"hideWidgetOnError"})){var l=p?p.slotQualityInfo:null;p=l?l.slotQualityDetail:"";l=l?l.errorCode:"";e||(p="NORMAL");e="noSlotUnknown";switch(p){case "SYSTEM_UNKNOWN_PROMISE":e="noSlotUnknown";"JurisdictionNotFound"===l&&(e="slotsContent");break;case "BUSINESS_UNKNOWN_PROMISE":case "CAPACITY_FULL":e="noSlotUnknown";break;case "SD_INVENTORY_STATE_RESTRICTED":e="noSlotNotSure";break;case "NORMAL":e="slotsContent"}h(f,e);
e={JurisdictionNotFound:g("#"+f.config({key:"dom_zipEntError"}))};for(var k in e)k===l?e[k].show():e[k].hide();v(f,"NORMAL"===p)}else{if("ATVPDKIKX0DER"==f.config({key:"load_payload"}).marketplace&&e){switch(p.slotQualityInfo.slotQualityDetail){case "CAPACITY_FULL":k=".sd_call_date_msg";break;case "SD_INVENTORY_STATE_RESTRICTED":k=".sd_estimate_msg";break;default:k=".sd_no_promise_msg"}g(".sd_phone_number").css("position","static");k=g(k).html();0!==g(".sd_change_phone_number").length&&(k+=g(".sd_change_phone_number").html())}else k=
p?p.errorMsg:"";l=f.config({key:"dom_noslots"});l=g("#"+l);var B=f.config({key:"dom_reload"});B=g("#"+B);var n=f.config({key:"message_hook"}),m=g("#calendarLink"+f.popup.__config.widgetIndex),r;n&&0<n.length&&(r=n.add(m).add("#sd_dummy_click_div_"+f.popup.__config.widgetIndex));e?(r?(e=r,c(e,'\x3cdiv class\x3d"sdWarn"\x3e\x3cspan class\x3d"swSprite s_alertSm"\x3e\x3c/span\x3e'+k+"\x3c/div\x3e"),d(e)):(k&&(e=l.find("div.sd_err_from_result_content"),e.html(k),SDUtils.isBeacon(l)&&(e=e.find("h6"),e.contents().replaceAll(e).wrap("\x3ch4/\x3e"))),
a(l,300,!0,!1),d(m)),B.show(),f.disableAndDeselect(p)):(r?(e=r,e.removeAmazonPopoverTrigger(),b(e)):b(m),a(l,0,!1,!0),B.hide(),f=g("#"+f.config({key:"dom_widget_root"})).parents("td").eq(0).prev().find("input[type\x3dradio]"),f.removeAttr("disabled"),f.parents("div.fake-label.a-box").removeClass("sd-disabled"))}}function r(a){if(a.isSpc()){var b=a.config({key:"dom_widget_root"});a=a.config({key:"dom_no_widget_root"});g("#"+b+" .sd_widget").show();g("#"+b).show();g("#"+a).hide()}}function m(a){if(a.isSpc()){var b=
a.config({key:"id_is_selected"}),c=a.config({key:"dom_widget_root"});a=a.config({key:"dom_no_widget_root"});b?(g("#"+c+" .sd_widget").show(),g("#"+c).show(),g("#"+a).hide()):(g("#"+c+" .sd_widget").show(),g("#"+c).hide(),g("#"+a).show())}}function k(a,b){var c=a.config({key:"dom_widget_root"}),d=a.config({key:"dom_no_widget_root"});a=a.config({key:"dom_reload"});a=g("#"+a);g("#"+c).show();g("#"+d).hide();a.hide();b&&"SYSTEM_UNKNOWN_PROMISE"===b.slotQualityDetail&&a.show()}function e(a,b){a=new ScheduledDelivery.Data.ReservationIdParser(a);
b=new ScheduledDelivery.Data.ReservationIdParser(b);var c=a.getCharges(),d=b.getCharges();return c.currencyCode===d.currencyCode&&.01>Math.abs(d.perItem-c.perItem)&&.01>Math.abs(d.perShipment-c.perShipment)&&a.getEncodedServices()===b.getEncodedServices()}function v(a,b){a=g("#"+a.config({key:"dom_slotTrigger"}));a.prop?a.prop("disabled",!b):b?a.removeAttr("disabled"):a.attr("disabled","disabled");b?a.parents(".sd-button").removeClass("sd-button-disabled"):a.parents(".sd-button").addClass("sd-button-disabled")}
var g=SDFramework.jq,p={status:{}};p.icon=y("icon");p.config=y("config");p.calData=T(this);p.popup={};p.popup.config=y("config");p.popup.selectCalled=G("select");p.dropdown=S();p.active=q;p.loadCalled=G("load");p.enableInconsistentWithBuybox=function(b){var c=this.config({key:"dom_inconsistent"});a(g("#"+c),200,b,!0)};p.buyboxNoAddrMessage=function(){h(this,"noSlotUnknown")};p.isSpc=function(){var a=this.config({key:"id_select_fn"});return a&&"spcpage"===a.substring(0,7)};p.isSosp=function(){var a=
this.config({key:"id_select_fn"});return a&&"shipoptionselectpage"===a.substring(0,20)};p.isSpcSd=function(){if(this.isSpc()){var a=this.config({key:"message_hook"});return a&&0<a.length&&0<=a.attr("src").indexOf("radio-on")}return!1};p.spcThrowCvIfSelected=function(){if(this.isSpcSd()){x("#"+this.config({key:"dom_widget_root"})+" input[type\x3dhidden]").attr("value","");var a=this.config({key:"id_select_fn"});(a=a&&eval(a))&&a({},this.config({key:"dom_widget_root"}))}};p.handleNoSlotSelection=function(){if(this.isSosp()){var a=
this.config({key:"dom_widget_root"});a=SDFramework.jq("#"+a);a.find(".sd_change_phone_number").show();a.find(".sd_promises").show();a.find(".sd_promise_msg").show();a.find(".sd_promise_msg \x3espan").addClass("sd_no_slot_selection_msg")}};p.calendar=function(a){if(a)if(this.calData.hasCal(a)){this._loading(!1);this._enableIcon(!0);v(this,!0);var b=this.config({key:"dom_retry"}),c=this;g("#"+b).click(function(){h(c,"slotsContent")});b=this.config({key:"selectedSlot"});this.config({key:"slotQuality"});
this.config({key:"slotQualityDetail"});var d=this.calData.getCal(a);d=d.slotQualityInfo;this.status.deferred=d&&"DEFERRED"===d.slotQuality;this.loadCalled({arg:{calendarData:this.calData.getCal(a),resId:b}});d&&"DEFERRED"===d.slotQuality&&(this.deactivateCalendar(),D.trigger("scheduled-delivery:enable-ship-option",this.config({key:"dom_widget_root"})));k(this,d);b=null;if(!this.active||this.active!=a){d=this.calData.getCal(a);var l=this.popup.__config,q=this.popup.__selectFn;if(d&&d.slotQualityInfo&&
"DEFERRED"===d.slotQualityInfo.slotQuality&&"SD_INVENTORY_STATE_RESTRICTED"===d.slotQualityInfo.slotQualityDetail&&d.defaultDates&&d.defaultDates.maxShipDisplay&&0<g("#SDShippingOrientedPromiseDate").length&&0<g("#SDShippingOrientedPromiseBox").length){g("#SDShippingOrientedPromiseDate").html(d.defaultDates.maxShipDisplay);g("#SDShippingOrientedPromiseBox").show();return}if(d&&d.days&&0!==d.days.length)f(this,!1),m(this);else{this.logClientSideMetricsForNoSlots(p.clientSideMetrics.initializeSDPopup);
r(this);f(this,!0,d);this.deactivateCalendar();this.active=0;this.spcThrowCvIfSelected();return}var n=this.config({key:"timeslotDeterminationFn"});if(n&&n(d)){this.popup=V(this);this.popup.__config=l;this.popup.__selectFn=q;C.when("scheduledDelivery","ready").execute(p.getDocLoadFn());this.popup.showDropdown=this.showDropdown;this.popup.model.orderDayAsFirstDay=this.orderDayAsFirstDay;this.popup.model.setSlots(this.calData,a);this.popup.logClientSideMetrics(this.popup.clientSideMetrics.initializeSDPopup);
b=this.popup.model.getSlotByTimes(this.config({key:"selectedStart"}),this.config({key:"selectedEnd"}),this.config({key:"selectedSlot"}));!b&&this.config({key:"selectedStart"})&&this.config({key:"selectedEnd"})?(this.enableInconsistentWithBuybox(!0),b=this.popup.model.getDefaultSlot(this.daySlotAsDefaultSlot),this.spcThrowCvIfSelected()):b?this.enableInconsistentWithBuybox(!1):b=this.popup.model.getDefaultSlot(this.daySlotAsDefaultSlot);var w=g("#sd_dummy_click_div_"+l.widgetIndex);w&&0<w.length&&
w.click(function(a){var b=x("#sd_widgets_"+l.widgetIndex).parents("td").eq(0).prev().find("input[type\x3dimage]");b&&0<b.length&&b.click();a.stopPropagation()})}else{this.popup=R();this.popup.__config=l;this.popup.__selectFn=q;d=this.calData.getCal(a).ids;q=this.config({key:"selectedStart"});n=this.config({key:"selectedEnd"});for(w in d)if(d[w].hasOwnProperty("s")&&d[w].hasOwnProperty("e")){var t=d[w].s,u=d[w].e,y=d[w].eu;d[w].su==q&&y==n&&(b||(b=K(null,null,null,d[w],w)));t==q&&u==n&&(b||(b=K(null,
null,null,d[w],w)))}b?this.enableInconsistentWithBuybox(!1):(this.enableInconsistentWithBuybox(!0),this.spcThrowCvIfSelected());g(document).ready(p.getDocLoadFn())}this.active=a;this._changeCalendar()}this.dropdown&&this.dropdown.hasOwnProperty("enable")&&this.dropdown.enable(!0);this.popup&&this.popup.hasOwnProperty("enable")&&this.popup.enable(!0);b?(this.isSpcSd()&&!e(b.identifier,this.config({key:"selectedSlot"}))&&this.config({key:"existing",value:"populating this field here will force a resubmit on the following call"}),
this.popup.select(b.key),this.dropdown&&(this.dropdown.select(b.key),this.dropdown.selectCalled({arg:b.key}),this.dropdown._dom().change(function(){}))):this.handleNoSlotSelection()}else this._loadCalendar(a);else this.deactivateCalendar()};p.deactivateCalendar=function(){this._enableIcon(!1);v(this,!1);this.dropdown&&this.dropdown.hasOwnProperty("enable")&&this.dropdown.enable(!1);this.popup&&this.popup.hasOwnProperty("enable")&&this.popup.enable(!1);var a=this.config({key:"clientCallbacks"});a&&
a.calendarDisabled&&a.calendarDisabled()};p._changeCalendar=function(){function a(a){return{id:a[0],name:a[1]}}var b=this.calData.getCal(this.active),c=b.slotQualityInfo;if(!c||"DEFERRED"!==c.slotQuality)if(this.popup&&this.popup.setup(b),this.dropdown&&this.dropdown.clear(),b&&b.days){if((c=this.config({key:"timeslotDeterminationFn"}))&&c(b)){b=this.popup.model.sortedSlotList();for(var d in b)if(d){var f=b[d];this.popup&&this.popup.add(f.key);this.dropdown&&this.dropdown.add(f.key,f.toString(),f.services,
f.startDateUTC,f.endDateUTC)}}else for(f in b.days)b.days.hasOwnProperty(f)&&(d=a(b.days[f]),this.popup&&this.popup.add(d.id),this.dropdown&&this.dropdown.add(d.id,d.name,""));this.dropdown&&(this.dropdown.make(),this.dropdown.onSelect());if(this.popup)this.popup.onSelect();d=function(a){};b=function(a){};this.dropdown&&(d=function(a){var b=a.dropdown;return function(a){b.select(a)}});this.popup&&(b=function(a){var b=a.popup;return function(a){b.select(a)}});if(this.dropdown||this.popup){this.popup.selectCalled({register:"dropdown",
fn:d(this)});this.dropdown&&this.dropdown.selectCalled({register:"popup",fn:b(this)});var e=this;d=function(a){if(a&&e.config({key:"existing"})&&e.config({key:"existing"})!=a){e.config({key:"existing",value:a});a=e.config({key:"id_select_fn"});var b={};x("#"+e.config({key:"dom_widget_root"})+" input[type\x3dhidden]").each(function(){var a=x(this).attr("key"),c=x(this).attr("value");a&&(b[a]=c)});var c;a&&(c=eval(a));a=e.config({key:"dom_widget_root"});c&&c(b,a)}else e.config({key:"existing",value:a})};
t.$&&this.config({key:"message_hook"})&&$(this.config({key:"message_hook"}).get(0)).unbind("click");(b=this.config({key:"message_hook"}))&&0<b.length&&-1==b.attr("src").indexOf("radio-on")&&b.bind("click",d);this.popup&&this.popup.selectCalled({register:"rcxCallback",fn:d});this.dropdown&&this.dropdown.selectCalled({register:"rcxCallback",fn:d})}}else t.console&&t.console.firebug&&console.warn("no calendar data"),this.deactivateCalendar()};p.selectCalled=function(a){this.dropdown&&this.dropdown.selectCalled(a);
this.popup&&this.popup.selectCalled&&this.popup.selectCalled(a)};p.hasRes=function(a,b){return this.calData.hasRes(a,b)};p.getRes=function(a,b){return this.calData.getRes(a,b)};p._loadCalendar=function(a){this.calData.hasCal(a)&&this.calendar(a);this.calData.load(a,this)};p._enableIcon=function(a){var b=this.icon({key:"dom_disabled"}),c=this.icon({key:"dom_enabled"});b?(b=g(b),a?b.hide():b.show()):t.console&&t.console.firebug&&console.warn("no disabled calendar icon configured");c?(c=g(c),a?c.show():
c.hide()):t.console&&t.console.firebug&&console.warn("no active calendar icon configured")};p._getConfigDOM=function(a){a=this.config({key:a});return g(a?"#"+a:[])};p.disableAndDeselect=function(a){var b=g("#"+this.config({key:"dom_widget_root"})).parents("td").eq(0).prev().find("input:radio"),c=g("input[name\x3d'csm.scheduledDelivery']");(0===c.length||1<g("input[name\x3d"+b.attr("name")+"]:radio:not(:disabled)").length)&&"ATVPDKIKX0DER"!=this.config({key:"load_payload"}).marketplace?(b.attr("disabled",
"disabled"),b.is(":checked")&&g("input[name\x3d"+b.attr("name")+"]:radio:not(:disabled):first").attr("checked",!0)):(a=a?a.defaultDates:{ultStart:2E5,ultEnd:200001,timeZone:"PST",minShip:1,maxShip:2},c.attr("value",encodeURIComponent(ScheduledDelivery.Data.Json.serialize({refdataVersion:"AFN",slot:{reservationId:"X",start:a.ultStart,mltStart:a.ultStart,end:a.ultEnd,mltEnd:a.ultEnd,timeZone:a.timeZone,tz:"America/Los_Angeles",minShip:a.minShip,maxShip:a.maxShip,fss:"NOT_FAST_TRACK"},qualityInfo:{slotQuality:"DEFERRED",
slotQualityDetail:"BUSINESS_UNKNOWN_PROMISE"}}))));b.parents("div.fake-label.a-box").addClass("sd-disabled")};p._loading=function(b,c){var d=this._getConfigDOM("dom_loadbar"),f=this._getConfigDOM("dom_reload"),e=this._getConfigDOM("dom_failbar"),g=this._getConfigDOM("dom_bar");b?(g.hide(),a(e,100,!1,!1),f.hide(),d.show()):c?(d.hide(),g.hide(),a(e,100,!0,!1),f.show(),this.disableAndDeselect()):(d.hide(),a(e,100,!1,!0),f.hide(),g.show())};p.getDocLoadFn=function(){var a=this;return function(){var b=
a.icon({key:"dom_enabled"});b&&(b=g(b),a.popup.hasOwnProperty("click")&&b.click(a.popup.click()))}};p.clientSideMetrics={};p.clientSideMetrics.initializeSDPopup="10";p.logClientSideMetricsForNoSlots=function(a){var b="",c="",d="",f="DP",e="",g=this.config({key:"load_payload"});g&&(b=g.marketplace,c=g.asin,d=g.shipoption,e=g.address);this.isSpc()?f="SPC":(g=this.config({key:"id_select_fn"}))&&("shipoptionselectpage"===g.substring(0,20)?f="SOSP":"emptySetSOCallback"===g?f="YA":"emptyORCSetSOCallback"===
g&&(f="ORC"));if(c instanceof Array)for(g=0;g<c.length;g++)ue.log(["mpid\x3d",b,"\x26asin\x3d",c[g],"\x26a\x3d",a,"\x26fas\x3d\x26ss\x3d\x26svc\x3d\x26so\x3d",encodeURIComponent(d),"\x26sid\x3d\x26page\x3d",f,"\x26addr\x3d",e,"\x26snum\x3d0\x26se\x3d\x26fae\x3d"].join(""),"scheduled-delivery",null);else ue.log(["mpid\x3d",b,"\x26asin\x3d",c,"\x26a\x3d",a,"\x26fas\x3d\x26ss\x3d\x26svc\x3d\x26so\x3d",encodeURIComponent(d),"\x26sid\x3d\x26page\x3d",f,"\x26addr\x3d",e,"\x26snum\x3d0\x26se\x3d\x26fae\x3d"].join(""),
"scheduled-delivery",null)};g(document).ready(p.getDocLoadFn());return p}function F(a,c,d,b,h,f){c=c?c:{};this.UISettings=b=b?b:{};this.domSettings=h;this.dataField=f;this.UISettings.showDropdown=this.UISettings.showDropdown!==q&&0===this.UISettings.showDropdown?0:1;this.UISettings.orderDayAsFirstDay=this.UISettings.orderDayAsFirstDay!==q&&1===this.UISettings.orderDayAsFirstDay?1:0;this.UISettings.daySlotAsDefaultSlot=this.UISettings.daySlotAsDefaultSlot!==q&&1===this.UISettings.daySlotAsDefaultSlot?
1:0;this.calendarRef=W();this.widgetIndex=a;this.calendarRef.orderDayAsFirstDay=this.UISettings.orderDayAsFirstDay;this.calendarRef.daySlotAsDefaultSlot=this.UISettings.daySlotAsDefaultSlot;this.calendarRef.showDropdown=this.UISettings.showDropdown;F.prototype.isTimeslot=function(a){if(!a||!a.hasOwnProperty("ids"))return!1;if("MFN2013"===b.sdUseCase)return!0;var c=0,d;for(d in a.ids)if(a.ids.hasOwnProperty(d)&&a.ids[d]){var f=a.ids[d];if(f.hasOwnProperty("e")&&f.hasOwnProperty("s")&&23>(f.e-f.s)/
3600){c=1;break}}return c||a.timeslots};this.calendarRef.config({key:"dateDisplay",value:this.dateDisplay});this.calendarRef.config({data:{id_merchant:"A1",id_marketplace:"M1",timeslotDeterminationFn:this.isTimeslot}});1===this.UISettings.showDropdown?this.calendarRef.dropdown.config({key:"element",value:"sduiDropdown"+a}):this.calendarRef.dropdown=null;this.calendarRef.popup.config({data:{element:"sdcal-popup"+a,current_month_id:"sdcal-curr-month",next_month_id:"sdcal-next-month",notaday:"sdcal-notaday",
day:"sdcal-day",notavailable:"sdcal-noavail",available:"sdcal-avail",promotionavailable:"sdcal-promavail",selected:"sdcal-select",today:"sdcal-today",prefix:"sdcal",closeText:"close",slotButton:"sd-timeslot-slot",daySpan:"1",dayLength:7,linkId:h?h.widgetRoot+" ."+h.calendarTrigger:"calendarLink"+a,rootWidgetId:h?h.widgetRoot:"sd_widgets_"+a,widgetIndex:a,leftNavEnabledClass:"sd-timeslot-scroll-title-left-enabled",leftNavEnabledInner:"\x26#8249;\x26#8249;",leftNavDisabledClass:"sd-timeslot-scroll-title-left-disabled",
leftNavDisabledInner:"\x26#8249;\x26#8249;",rightNavEnabledClass:"sd-timeslot-scroll-title-right-enabled",rightNavEnabledInner:"\x26#8250;\x26#8250;",rightNavDisabledClass:"sd-timeslot-scroll-title-right-disabled",rightNavDisabledInner:"\x26#8250;\x26#8250;"}},1);this.calendarRef.config({key:"selectedSlot",value:c.reservationId});this.calendarRef.config({key:"selectedStart",value:c.ultStart});this.calendarRef.config({key:"selectedEnd",value:c.ultEnd});this.calendarRef.config({key:"slotQuality",value:c.slotQuality});
this.calendarRef.config({key:"slotQualityDetail",value:c.slotQualityDetail});this.calendarRef.config({key:"showDropdown",value:this.UISettings.showDropdown})}function X(a,c,d,b){function h(a){function b(a){var b=["custom-value"];a=SDFramework.jq("input[value\x3d'"+a+"']");0<a.length?(a=a.attr("name").match(/\.\d+\.\d+/),b.push(a[0])):b=[];return b.join("")}a&&a.setMappings({reservationId:[b("SD-ResID")||"custom-value.1.10001"],mltStart:[b("SD-StartTime")||"custom-value.1.10002"],mltEnd:[b("SD-EndTime")||
"custom-value.1.10003"],mltCutoff:[b("SD-CutoffTime")||"custom-value.1.10005"],timeZone:[b("SD-WindowTZ")||"custom-value.1.10004",b("SD-CutoffTZ")||"custom-value.1.10006"],minShip:[b("SD-MinShipDtUTC")||"custom-value.1.10011"],maxShip:[b("SD-MaxShipDtUTC")||"custom-value.1.10010"],shipOffer:[b("SD-ShipOfferID")||"custom-value.1.10009"],fss:[b("SD-PromiseLFSS")||"custom-value.1.10012"],data:[b("SD-Data")||"custom-value.1.10013"],reservationType:[b("SD-ResType")],start:[b("SD-SlotStartLTZ")],end:[b("SD-SlotEndLTZ")],
tz:[b("SD-SlotLongTZ")]})}function f(a,b,c){return a&&b&&c?(a.config({key:b,value:c}),!0):!1}function r(a){a.calendarRef.config({key:"clientCallbacks",value:{calendarDisabled:function(){if(a.bbSDUI)a.bbSDUI.onCalendarUnselected()}}})}function m(a){if(this.bbSDUI=O(a.dom)){if(a.zipcode){var b=a.dom,c=this.bbSDUI,d=a.zipcode;c&&(c.zipcode=N({data:{dom_zipInput:"undefined"===typeof b?"sd_zipcode":b.widgetRoot+" ."+b.postalInput,dom_zipGo:"sd_zipcode_go",dom_zipEntError:"undefined"===typeof b?"sd_zipcode_enter_err":
b.widgetRoot+" ."+b.ineligiblePostal,dom_zipValError:"undefined"===typeof b?"sd_zipcode_valid_err":b.widgetRoot+" ."+b.invalidPostal,dom_zipDefaultClass:"undefined"===typeof b?"":b.postalDefault,dom_zipOverdisplay:"undefined"===typeof b?"":b.widgetRoot+" ."+b.postalOverdisplay,dom_zipLabel:"undefined"===typeof b?"":b.widgetRoot+" ."+b.postalLabel,dom_zipValue:"undefined"===typeof b?"":b.widgetRoot+" ."+b.postalValue,dom_zipEmpty:"undefined"===typeof b?"":b.widgetRoot+" ."+b.postalEmpty,dom_zipPrefix:"undefined"===
typeof b?"":b.widgetRoot+" ."+b.postalPrefix}},d,1))}else(b=this.bbSDUI)&&(b.regions=M({data:{dom_regionList:"sd_region",dom_regionLoading:"sd_region_loading"}}));this.itemCache=new SDUtils.Cache(k);(b=this.bbSDUI)&&a&&(b.config({data:{dom_mainElement:a.dom?a.dom.widgetRoot+" ."+a.dom.content:"sd_divUI",dom_notSureError:a.dom?a.dom.widgetRoot+" ."+a.dom.notSureError:"",dom_unknownError:a.dom?a.dom.widgetRoot+" ."+a.dom.unknownError:"",dom_zipInput:a.dom?a.dom.widgetRoot+" ."+a.dom.postalInput:null,
dom_loading:"sd_region_loading"}}),f(b.checkbox,"dom_sdCheckbox",a.dom?a.dom.widgetRoot+" ."+a.dom.enabled:"sd_intent"),a.isAFN&&(f(b,"isAFN",a.isAFN),a.addressId&&0<a.addressId.length&&f(b,"id_address",a.addressId)),f(b,"id_merchant",a.merchantID),f(b,"id_marketplace",a.marketplaceID),f(b,"id_asin",a.asinID),f(b,"id_sku",a.msku),f(b,"id_fmid",a.fmID),f(b,"id_quantity",a.quantity),f(b,"id_offerlist_id",a.offerListingID),a.shipoption&&f(b,"shipoption",a.shipoption));h(this.bbSDUI.inputs);b=this.bbSDUI.shoppingCart;
f(b,"disabledHTML",a.cartDisabledHTML);f(b,"element","#addToCartSpan, #twisterAddToCartOrig");f(b,"cursorDisabled","not-allowed");f(this.bbSDUI.oneClick,"element","#oneClickSingleClick, .oneClickDiv b, #oneClickDivId");(b=this.bbSDUI.cutoff)&&b.config({data:{element:"sd_cutoff_div",fail:"sd_cutoff_missed_div",dom_replace:"sd_cutoff"}});a=a.dom;if(!this.calendarRef.config({key:"showDropdown"})){b=this.bbSDUI;b.initMessage();c="sd_widgets_BB .sdMessage_buybox p";d="sd_widgets_BB .sdMessage_buybox";
var e="sd_widgets_BB .sdMessage_service_buybox p";a&&(c=a.widgetRoot+" ."+a.slotDisplay,d=a.widgetRoot+" ."+a.slotDisplayContainer,e=a.widgetRoot+" ."+a.serviceDisplay);b.message&&b.message.config({data:{element:c,element_container:d,element_service:e,timeslotDeterminationFn:this.isTimeslot}})}r(this)}else u.warn("SD CFG BB noUI")}var k=["asin","merchantID","sku","fmid"],e=["asin","merchantID","heavyBulky","sku","fmid"];d=1;b&&b.sdShowDropdown!==q&&(d=b.sdShowDropdown?1:0);m.prototype=new F("BB",
null,c,{showDropdown:d},a.dom);m.prototype.injectDom=function(a,b,c,d,f){this.currentSD=a;c=this.calendarRef.config({key:"pickDateText"});this.calendarRef.config({key:"learnMoreText"});var e=this.calendarRef.config({key:"noSlotsAddressBB"}),g=this.calendarRef.config({key:"retrieveError"});this.calendarRef.config({key:"tryAgain"});var h=this.calendarRef.config({key:"showDropdown"}),l=SDFramework.jq("#sd_widgets_"+a),k=[];k.push('\x3cspan class\x3d"sd_Loading" style\x3d"display: none;"\x3e');k.push("\x3cp\x3e");
k.push(b);k.push("\x3c/p\x3e");k.push("\x3c/span\x3e");1===h?(k.push('\x3cdiv class\x3d"sdMessage_buybox" style\x3d"display: none;"\x3e\x3c/div\x3e'),k.push('\x3cdiv class\x3d"sdMessage_buybox" style\x3d"display: none;"\x3e\x3cspan class\x3d"swSprite s_notifySm"\x3e\x3c/span\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e')):(k.push('\x3cdiv class\x3d"sdMessage_buybox" style\x3d"display: none;"\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e'),k.push('\x3cdiv class\x3d"sdMessage_service_buybox" style\x3d"display: none;"\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e'));
k.push('\x3cspan class\x3d"sd_widget" style\x3d"display: none"\x3e');1===h?(k.push('\x3cspan class\x3d"sd_Active"\x3e'),k.push('\x3cselect id\x3d"sduiDropdown',a,'" class\x3d"sdbuybox" name\x3d"sduiDate" disabled \x3e'),k.push('\x3coption value\x3d"" selected\x3e',c,"\x3c/option\x3e"),k.push("\x3c/select\x3e"),k.push("\x3c/span\x3e"),k.push('\x3cspan class\x3d"sd_calicon sd_calicon_disabled"\x3e'),k.push(d),k.push("\x3c/span\x3e"),k.push('\x3ca href\x3d"#" id\x3d"calendarLink',a,'" onclick\x3d"return false;"\x3e'),
k.push('\x3cspan class\x3d"sd_calicon sd_calicon_enabled" style\x3d"display: none;"\x3e'),k.push(f)):(k.push('\x3cspan class\x3d"sd_calicon sd_calicon_disabled"\x3e'),k.push(d),k.push("\x3c/span\x3e"),k.push('\x3ca href\x3d"#" id\x3d"calendarLink',a,'" onclick\x3d"return false;"\x3e'),k.push('\x3cspan class\x3d"sd_calicon sd_calicon_enabled" style\x3d"display: none;"\x3e'),k.push(f),k.push(this.calendarRef.config({key:"sd_select_another_date_and_time"})));k.push("\x3c/span\x3e");k.push("\x3c/a\x3e");
k.push("\x3c/span\x3e");k.push('\x3cdiv class\x3d"sd_err_noslots" style\x3d"display: none;"\x3e');k.push('\x3cspan id\x3d"sd_bb_no_slots_message" style\x3d"color: #ff0000; font-weight: bold;"\x3e',e,"\x3c/span\x3e");k.push("\x3c/div\x3e");k.push('\x3cdiv class\x3d"sd_err_connect" style\x3d"display: none;"\x3e');k.push('\x3cspan id\x3d"sd_bb_retrieve_error" style\x3d"color: #ff0000; font-weight: bold;"\x3e',g,"\x3c/span\x3e");k.push("\x3c/div\x3e");k.push('\x3cdiv id\x3d"sdcal-popup',a,'" class\x3d"sdCalendarPopover" style\x3d"display: none"\x3e\x3c/div\x3e');
l.prepend(k.join(""))};m.prototype.establishDomHooks=function(b){var c=this.currentSD;f(this.bbSDUI,"sd_calendar",this.calendarRef);var d=this.calendarRef;d.icon({key:"dom_disabled",value:".sd_calicon_disabled"});d.icon({key:"dom_enabled",value:".sd_calicon_enabled"});f(d,"dom_bar","sd_widgets_"+c+" .sd_calendar");f(d,"dom_failbar","sd_widgets_"+c+" .sd_err_connect");f(d,"dom_noslots","sd_widgets_"+c+" .sd_err_noslots");f(d,"dom_loadbar","sd_widgets_"+c+" .sd_Loading");"undefined"!==typeof b&&(f(d,
"dom_bar",b.widgetRoot+" ."+b.content),f(d,"dom_noslots",b.widgetRoot+" ."+b.notSureError),f(d,"dom_loadbar",b.widgetRoot+" ."+b.loading),f(d,"hideWidgetOnError",1),f(d,"dom_slotsContent",b.widgetRoot+" ."+b.content),f(d,"dom_noslotsNotSure",b.widgetRoot+" ."+b.notSureError),f(d,"dom_noslotsUnknown",b.widgetRoot+" ."+b.unknownError),f(d,"dom_zipEntError",b.widgetRoot+" ."+b.ineligiblePostal),f(d,"dom_slotDisplay",b.widgetRoot+" ."+b.slotDisplayContainer),f(d,"dom_retry",b.widgetRoot+" ."+b.retry),
f(d,"dom_slotTrigger",b.widgetRoot+" ."+b.calendarTrigger));f(d,"load_url",a.load_url);f(d.dropdown,"element","")};m.prototype.initializeSpecificDom=function(){this.bbSDUI.initializeDOM()};var v=[];m.prototype.getRequestItemIDForKey=function(a){var b=this.itemCache.operate(a,{},SDUtils.Cache.IF_EXISTS.PRESERVE,SDUtils.Cache.IF_NEW.ADD),c=b.requestItemID;c===q&&(c=v.length,b.requestItemID=c,v[c]=a);return c};m.prototype.getKeyForRequestItemID=function(a){return v[a]};m.prototype.getIsSDAvailableParams=
function(a,b){a={marketplaceID:a};for(var c=0,d=0;d<b.length;d++){var f=b[d];if(f.isSDAvailable===q){a["requestItemID"+c]=this.getRequestItemIDForKey(f);for(var g=0;g<e.length;g++){var h=e[g],k=f[h];null!==k&&k!==q&&(a[h+c]=k)}c++}}return a};m.prototype.getKeyFromConfig=function(){return{asin:this.bbSDUI.config({key:"id_asin"}),merchantID:this.bbSDUI.config({key:"id_merchant"}),sku:this.bbSDUI.config({key:"id_sku"}),fmid:this.bbSDUI.config({key:"id_fmid"})}};m.prototype.setIsSDAvailable=function(a,
b){this.itemCache.update(a,{isSDAvailable:b});this.itemCache.keysAreEqual(a,this.getKeyFromConfig())&&(this.bbSDUI.config({key:"isSDAvailable",value:b}),this.refreshAppearance())};m.prototype.onTwisterChildrenIsSDAvailableResponse=function(a){u.isDebugEnabled()&&u.debug("isSDAvailable:",a);for(var b in a)a.hasOwnProperty(b)&&this.setIsSDAvailable(this.getKeyForRequestItemID(b),a[b])};m.prototype.onTwisterChildrenIsSDAvailableError=function(a,b,c){u.isWarnEnabled()&&(u.warn("SD isSDAvailable AJAX error: "+
b),c&&u.warn("(HTTP error: "+c+")"))};m.prototype.cacheChildData=function(a){for(var b=0;b<a.length;b++){var c=a[b];this.itemCache.update(c,c)}};m.prototype.batchIsSDAvailable=function(a){var b=this.bbSDUI.config({key:"id_marketplace"});a=this.getIsSDAvailableParams(b,a);var c=this;SDFramework.jq.ajax({url:"/gp/product/features/scheduled-delivery/is-sd-available-json.html?powerbar\x3d0",type:"POST",dataType:"json",data:a,success:function(a){c.onTwisterChildrenIsSDAvailableResponse(a)},error:function(a,
b,d){c.onTwisterChildrenIsSDAvailableError(a,b,d)},timeout:2E4})};m.prototype.fetchTwisterData=function(a){this.cacheChildData(a);this.batchIsSDAvailable(a)};return new m(a)}t.ScheduledDelivery={};t.SDUtils={};var u=function(){function a(){}function c(){return!1}for(var d=["log","info","debug","warn","error"],b={suppressDefaultConsole:a},h=0;h<d.length;h++){var f=d[h],r="is"+f.charAt(0).toUpperCase()+f.substr(1)+"Enabled";b[r]=c;b[f]=a}return b}();ScheduledDelivery.Debug={requiredArg:function(a){return a}};
t.SDFramework={jq:x};(function(){SDFramework.Class=function(){function a(a){SDFramework.jq.extend(this.rep,a)}function c(a,b){return function(){return b.apply(a,arguments)}}function d(a){var b=this.rep,d;for(d in a)a.hasOwnProperty(d)&&(this.interfaceInstance[d]=c(b,a[d]))}function b(a){SDFramework.jq.extend(this.interfaceInstance,a)}return function(c){function f(){}this.interfaceInstance=f.prototype=c;this.rep=new f;this.declarePrivate=a;this.declarePublic=d;this.declarePublicFinal=b}}();SDFramework.defineStruct=
function(){var a=arguments;return function(){for(var c=0;c<a.length;c++)this[a[c]]=arguments[c]}};SDFramework.defineClass=function(a){var c=function(){var c=a.initBase?a.initBase.apply(null,arguments):this,b=new SDFramework.Class(c);a.privateFunctions&&b.declarePrivate(a.privateFunctions);a.publicFunctions&&b.declarePublic(a.publicFunctions);a.publicFinal&&b.declarePublicFinal(a.publicFinal);if(a.events)for(var h=a.events,f=0;f<h.length;f++)c[h[f]]=new SDFramework.Event;a.init&&a.init.apply(b.rep,
arguments);a.publicInit&&a.publicInit.apply(c,arguments);return c};a.publicStatic&&SDFramework.jq.extend(c,a.publicStatic);return c}})();(function(){SDUtils.isEmptyObject=function(a){for(var c in a)if(a.hasOwnProperty(c))return!1;return!0};var a=SDFramework.defineClass({init:function(a){this.i=0;this.arr=a},publicFunctions:{hasNext:function(){return this.i<this.arr.length},next:function(){var a=this.arr[this.i];this.i++;return a}}});SDUtils.ArraySet=SDFramework.defineClass({init:function(){this.arr=
[]},publicFunctions:{add:function(a){if(this.contains(a))return!1;this.arr.push(a);return!0},remove:function(a){a=SDFramework.jq.inArray(a,this.arr);if(-1==a)return!1;this.arr[a]=this.arr[this.arr.length-1];this.arr.pop();return!0},contains:function(a){return-1!=SDFramework.jq.inArray(a,this.arr)},getCount:function(){return this.arr.length},isEmpty:function(){return 0===this.getCount()},iterator:function(){return new a(this.arr)},getAny:function(){return this.arr[0]},removeAny:function(){return this.arr.pop()}}});
SDFramework.Event=function(){this.handlers=new SDUtils.ArraySet;this.dispatch=function(){for(var a=this.handlers.iterator();a.hasNext();)a.next().apply(null,arguments)}};SDUtils.Cache=function(){function a(a,b){return function(c,d){return this.operate(c,d,a,b)}}function d(a,b,c){for(var d in b)!b.hasOwnProperty(d)||!c&&a.hasOwnProperty(d)||(a[d]=b[d])}var b={PRESERVE:q,REPLACE:1,MERGE_OVERWRITE:2,MERGE_NO_OVERWRITE:3},h={DO_NOT_ADD:q,ADD:!0};return SDFramework.defineClass({publicStatic:{IF_EXISTS:b,
IF_NEW:h},init:function(a){a.length||u.error("Invalid keyspec:",a);this.spec=a;this.buckets={}},privateFunctions:{primaryKey:function(a){return a[this.spec[0]]},supplementaryKeysAreEqual:function(a,b){for(var c=this.spec,d=1;d<c.length;d++)if(a[c[d]]!==b[c[d]])return!1;return!0},operateOnBucket:function(a,b,c,h,e){for(var f=0;f<a.length;f++){var g=a[f];if(this.supplementaryKeysAreEqual(g.key,b)){switch(h){case SDUtils.Cache.IF_EXISTS.REPLACE:g.value=c;break;case SDUtils.Cache.IF_EXISTS.MERGE_OVERWRITE:d(g.value,
c,!0);break;case SDUtils.Cache.IF_EXISTS.MERGE_NO_OVERWRITE:d(g.value,c,!1)}return g.value}}e===SDUtils.Cache.IF_NEW.ADD&&a.push({key:b,value:c});return c}},publicFunctions:{keysAreEqual:function(a,b){return this.primaryKey(a)==this.primaryKey(b)&&this.supplementaryKeysAreEqual(a,b)},operate:function(a,b,c,d){var f=this.primaryKey(a),k=this.buckets[f];return k===q?(d==h.ADD&&(this.buckets[f]=[{key:a,value:b}]),b):this.operateOnBucket(k,a,b,c,d)},set:a(b.REPLACE,h.ADD),update:a(b.MERGE_OVERWRITE,h.ADD),
get:a(b.PRESERVE,h.DO_NOT_ADD),clear:function(){this.buckets={}},forEachSubkey:function(a){for(var b=0;b<this.spec.length;b++)a(this.spec[b])}}})}()})();ScheduledDelivery.Fsm=SDFramework.defineClass({init:function(a){this.initMatrix(a.graph);this.triggers=a.triggers?a.triggers:{};this.slaves=a.slaves?a.slaves:[];a.options&&(this.state=a.options.initialState,this.defaultSearch=a.options.defaultSearch,this.context=a.options.context);this.state===q&&(this.state="init");this.defaultSearch===q&&(this.defaultSearch=
!1)},privateFunctions:{initMatrix:function(a){this.matrix={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];this.matrix[c]={};for(var b in d)d.hasOwnProperty(b)&&(this.matrix[c][b]={fn:d[b],enabled:!0})}},incrementSearch:function(a,c,d){var b=this.matrix[a.state];if(b)for(var h in b)if(b.hasOwnProperty(h)&&!d[h]&&b[h].enabled){var f={state:h,source:a};d[h]=!0;c.push(f)}return c.shift()},path:function(a){var c=[],d={state:this.state,source:null},b={};for(b[this.state]=!0;d.state!==a;)if(d=this.incrementSearch(d,
c,b),d===q)return;for(a=[];null!==d.source;)a.unshift(d.state),d=d.source;return a},getTransitionMetadata:function(a,c){if(a=this.matrix[a])return a[c]},driveSlaves:function(){for(var a=0;a<this.slaves.length;a++){var c=this.slaves[a],d=c.bindings[this.state];d!==q&&c.fsm.trySetState(d)}},doSingleStepTransition:function(a,c){var d=this.getTransitionMetadata(this.state,a);if(d&&d.enabled)return!1!==d.fn.apply(this.context,c)?(this.state=a,this.driveSlaves(),!0):!1},doMultiStepTransition:function(a,
c){a=this.path(a);if(a===q)return q;for(var d=0;d<a.length;d++)if(!this.doSingleStepTransition(a[d],c))return!1;return!0},logTransitionFailed:function(a,c){u.error('State transition from "'+a+'" to "'+c+'" failed.')},logTransitionNotDefined:function(a,c){u.error('State transition from "'+a+'" to "'+c+'" does not exist.')}},publicFunctions:{getState:function(){return this.state},setState:function(a,c){var d=this.state;(c=this.trySetState(a,c))||(!1===c?this.logTransitionFailed(d,a):this.logTransitionNotDefined(d,
a))},trySetState:function(a,c){var d=this.defaultSearch,b=[];c&&(c.search!==q&&(d=c.search),c.args!==q&&(b=c.args));c=this.doSingleStepTransition(a,b);if(c!==q)return c;if(this.state===a)return!0;if(d)return this.doMultiStepTransition(a,b)},setTransitionEnabled:function(a,c,d){var b=this.getTransitionMetadata(a,c);b?b.enabled=d:this.logTransitionNotDefined(a,c)},enableTransition:function(a,c){this.setTransitionEnabled(a,c,!0)},disableTransition:function(a,c){this.setTransitionEnabled(a,c,!1)},setTrigger:function(a,
c,d){var b=this.triggers[a];b||(b={},this.triggers[a]=b);b[c]=d},clearTrigger:function(a,c){(a=this.triggers[a])&&delete a[c]},trigger:function(a){var c=this.triggers[a];c?(c=c[this.state])?this.setState(c):u.error('State "'+this.state+'" cannot consume trigger "'+a+'".'):u.error('Trigger "'+a+'" is not defined.')},tryTrigger:function(a){if(a=this.triggers[a])if(a=a[this.state])return this.trySetState(a)}}});ScheduledDelivery.Data={};ScheduledDelivery.Data.ReservationIdParser=function(){return SDFramework.defineClass({init:function(a){this.parts=
a?a.split(";"):[]},publicFunctions:{getSlotId:function(){return this.parts[0]},getEncodedCarriers:function(){return this.parts[1]},getEncodedCharges:function(){return this.parts[2]},getEncodedServices:function(){return this.parts[3]},getCharges:function(){if(this.charges===q){var a=this.getEncodedCharges();a=a?a.split("^"):[];this.charges={perItem:parseFloat(a[0]),perShipment:parseFloat(a[1]),currencyCode:a[2]}}return this.charges},getCarriers:function(){if(this.carriers===q){var a=this.getEncodedCarriers();
this.carriers=a?a.split(","):[]}return this.carriers}}})}();ScheduledDelivery.Data.FulfillmentServiceSubclass=function(){function a(a){for(var b=0;b<c.length;b++)if(c[b]==a)return b;return q}var c=["FAST_TRACK_SAME_DAY","FAST_TRACK_FUTURE_DAY","NOT_FAST_TRACK",q];return{score:a,pickTightestSla:function(c){for(var b=c,d=1;d<arguments.length;d++){var f=arguments[d],r=a(f),m=a(b);if(m===q||r!==q&&r<m)b=f}return b}}}();ScheduledDelivery.Data.Json=function(){function a(a){b.lastIndex=0;return b.test(a)?
'"'+a.replace(b,function(a){var b=r[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(b,d){var e=h,g=d[b];g&&"object"===typeof g&&"function"===typeof g.toJSON&&(g=g.toJSON(b));"function"===typeof m&&(g=m.call(d,b,g));switch(typeof g){case "string":return a(g);case "number":return isFinite(g)?String(g):"null";case "boolean":case "null":return String(g);case "object":if(!g)return"null";h+=f;var k=[];if("[object Array]"===Object.prototype.toString.apply(g)){var l=
g.length;for(b=0;b<l;b+=1)k[b]=c(b,g)||"null";d=0===k.length?"[]":h?"[\n"+h+k.join(",\n"+h)+"\n"+e+"]":"["+k.join(",")+"]";h=e;return d}if(m&&"object"===typeof m)for(l=m.length,b=0;b<l;b+=1){if("string"===typeof m[b]){var r=m[b];(d=c(r,g))&&k.push(a(r)+(h?": ":":")+d)}}else for(r in g)Object.prototype.hasOwnProperty.call(g,r)&&(d=c(r,g))&&k.push(a(r)+(h?": ":":")+d);d=0===k.length?"{}":h?"{\n"+h+k.join(",\n"+h)+"\n"+e+"}":"{"+k.join(",")+"}";h=e;return d}}var d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
b=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,f,r={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},m;return{serialize:"object"===typeof JSON&&"function"===typeof JSON.stringify?function(a,b,c){return JSON.stringify(a,b,c)}:function(a,b,d){var e;f=h="";if("number"===typeof d)for(e=0;e<d;e+=1)f+=" ";else"string"===typeof d&&(f=d);if((m=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==
typeof b.length))throw Error("JSON.stringify");return c("",{"":a})},deserialize:"object"===typeof JSON&&"function"===typeof JSON.parse?function(a,b){return JSON.parse(a,b)}:function(a,b){function c(a,d){var f,e=a[d];if(e&&"object"===typeof e)for(f in e)if(Object.prototype.hasOwnProperty.call(e,f)){var h=c(e,f);h!==q?e[f]=h:delete e[f]}return b.call(a,d,e)}a=String(a);d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return a=eval("("+a+")"),"function"===typeof b?c({"":a},""):a;throw new SyntaxError("JSON.parse");}}}();(function(){function a(a){try{return encodeURIComponent(ScheduledDelivery.Data.Json.serialize(a)).replace(/[\\~]/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}catch(r){return u.error("Could not serialize SD data to JSON.",r,a),q}}function c(a,b){if(a){if(b===q||null===
b)b="";a.jquery?a.attr("value",b):d.each(a,function(a,c){c&&d("input[name\x3d'"+c+"']").attr("value",b)})}}var d=SDFramework.jq,b={SPECIAL:-2,DATA_MEMBER:-1,SLOT:"slot",QUALITY:"qualityInfo"},h={data:b.SPECIAL,refdataVersion:b.DATA_MEMBER,slotQuality:b.QUALITY,slotQualityDetail:b.QUALITY};ScheduledDelivery.Data.FormPersistence=SDFramework.defineClass({init:function(){this.data={}},privateFunctions:{updateFields:function(a,b){d.each(this.fields[a],function(a,d){c(d,b&&b[a])});this.data[a]=b},updateData:function(){var d=
this.fields[b.SPECIAL].data;d&&c(d,a(this.data))}},publicFunctions:{setMappings:function(a){var c={};d.each(b,function(a,b){c[b]={}});d.each(a,function(a,d){c[h[a]||b.SLOT][a]=d});this.fields=c},clearSlotFields:function(){this.updateSlotFields()},updateSlotFields:function(a){this.updateFields(b.SLOT,a);this.updateData()},updateSlotQuality:function(a,c,d){if(!a)return!1;"DEFERRED"===a.slotQuality&&d&&this.updateSlotFields(d);this.updateFields(b.QUALITY,a);return!0},updateDataMembers:function(a){var f=
this.fields[b.DATA_MEMBER],h=this;d.each(a,function(a,b){h.data[a]=b;c(f[a],b)});this.updateData()}}})})();ScheduledDelivery.BuyBox={};var J={};ScheduledDelivery.BuyBox.HoverPopover=function(){return SDFramework.defineClass({init:function(a){this.container=SDFramework.jq(ScheduledDelivery.Debug.requiredArg(a.containerHtml));a.contentHtml&&this.setContent(a.contentHtml)},publicFunctions:{setContentHtml:function(a){this.container.html(a)},bind:function(a){this.parent&&this.unbind();this.parent=a;a.amazonPopoverTrigger({location:["left",
"auto"],locationAlign:"middle",locationMargin:-10,width:null,skin:null,hoverHideDelay:0,hoverShowDelay:0,showOnHover:!0,showCloseButton:!1,literalContent:this.container})},unbind:function(){this.parent&&(this.parent.removeAmazonPopoverTrigger(),this.parent=null)}}})}();ScheduledDelivery.BuyBox.UIOverride=function(){function a(a){b.wrap(a)}function c(a){b.unwrap(a)}var d=SDFramework.defineClass({init:function(a){this.cssClass=a;this.html='\x3cspan class\x3d"'+a+'" /\x3e';var b="span."+a;this.wrapperSelector=
b;var c=function(){return SDFramework.jq(this).parent(b).length};this.contentFilter=c;this.nonContentFilter=function(){return!c.call(this)}},publicFunctions:{filterWrappedElements:function(a){return a.filter(this.contentFilter)},filterUnwrappedElements:function(a){return a.filter(this.nonContentFilter)},selectWrappers:function(a){return a.parent(this.wrapperSelector)},wrap:function(a){this.filterUnwrappedElements(a).wrap(this.html)},unwrap:function(a){a=this.filterWrappedElements(a);a.unwrap?a.unwrap():
a.each(function(){SDFramework.jq(this).parent().replaceWith(this)})}}}),b=new d("sdXuiVisibilityWrapper");return{WrapperTemplate:d,hide:a,show:c,setVisible:function(b,d){d?c(b):a(b)}}}();ScheduledDelivery.BuyBox.SDIntentCheckbox=SDFramework.defineClass({events:["onCheck","onClear"],privateFunctions:{dom:z("dom_sdCheckbox","check"),dispatchClick:function(){this.isChecked()?this.onCheck.dispatch():this.onClear.dispatch()}},publicFunctions:{config:y("checkbox"),bindDOM:function(){var a=this;this.dom().click(function(){a.dispatchClick()})},
isChecked:function(){var a=this.dom();return a.prop?a.prop("checked"):a.is(":checked")},exists:function(){return 0<this.dom().size()},setChecked:function(a){if(this.isChecked()!==a){var c=this.dom();c.prop?this.dom().prop("checked",a):a?c.attr("checked","checked"):c.removeAttr("checked");this.dispatchClick()}},setVisible:function(a){a?this.dom().show():this.dom().hide()}}});ScheduledDelivery.BuyBox.SlotStorage=SDFramework.defineClass({privateFunctions:{INPUT_VALUE_PREFIX:"custom-value",validSlotExists:function(a){a=
this.slots[a];var c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var b=a[d];0===d.indexOf(this.INPUT_VALUE_PREFIX)&&b&&(c=!0)}return c}},init:function(a,c){this.slotInputClass=a;this.rootElement=c;this.slots={}},publicFunctions:{config:y("slotstorage"),storeSlotInput:function(a){if(a){this.slots[a]={};var c=this;SDFramework.jq("#"+this.rootElement+" ."+this.slotInputClass).each(function(){var d=SDFramework.jq(this),b=d.attr("name");d=d.attr("value");c.slots[a][b]=d})}},repopulateSlotInput:function(a){if(a){var c=
this.slots[a],d;for(d in c)if(c.hasOwnProperty(d)){var b=c[d];var h=SDFramework.jq("#"+this.rootElement+" input[name\x3d'"+d+"']."+this.slotInputClass);0<h.size()&&(h=SDFramework.jq(h[0]),h.attr("name",d),h.attr("value",b))}return this.validSlotExists(a)}},clearSlotInput:function(a){if(a){var c=this;SDFramework.jq("#"+this.rootElement+" ."+this.slotInputClass).each(function(){var a=SDFramework.jq(this);0===a.attr("name").indexOf(c.INPUT_VALUE_PREFIX)&&a.attr("value","")})}}}});"use strict";SDUtils.isBeacon=
function(a){return 0<a.parents(".a-container").length};SDUtils.protectAgainstDoubleAction=function(){var a={};return function(c,d){if(!c)return t.console&&t.console.error&&console.error("Function is not used properly, use a unique owner to identify the caller."),!1;if(a.hasOwnProperty(c))return!0;a[c]=1;setTimeout(function(){delete a[c]},d||100);return!1}}();J.AddToCartWrapper=function(){return SDFramework.defineClass({init:function(){this.warningPopover=new ScheduledDelivery.BuyBox.HoverPopover({containerHtml:'\x3cdiv class\x3d"sd_bb_warn_pop" /\x3e'});
this.disabledDomFsm=new ScheduledDelivery.Fsm({graph:{hiddenNotLoaded:{shown:function(){this.disabledDOM=this.loadDisabledJQ()}},shown:{hidden:function(){this.disabledDOM.hide()}},hidden:{shown:function(){this.disabledDOM.show()}}},options:{context:this,initialState:"hiddenNotLoaded"}});this.enabledDomFsm=new ScheduledDelivery.Fsm({graph:{shown:{hidden:function(){this.overriddenUI=this.getAddToCartSelector();this.overriddenUI.hide()}},hidden:{shown:function(){this.overriddenUI.show()}}},options:{context:this,
initialState:"shown"}})},privateFunctions:{getAddToCartSelector:function(){var a=this.config({key:"element"});"undefined"==a&&(u.warn("shopping-cart: no element"),a=[]);return SDFramework.jq(a)},loadDisabledJQ:function(){var a=this.config({key:"disabledHTML"});if("undefined"!=a){var c=this.getAddToCartSelector();a=SDFramework.jq(a);c.after(a);c=a.is("img")?a:a.find("img");0===c.length?u.warn("Add to cart disabled image not found"):(this.warningPopover.bind(c),c.css("cursor",this.config({key:"cursorDisabled"})))}else u.warn("no disabledHTML"),
a=SDFramework.jq(document.createElement("span"));return a}},publicFunctions:{config:y("shoppingCart"),enable:function(a){a?this.enableAddToCart():this.disableAddToCart()},enableAddToCart:function(){this.disabledDomFsm.trySetState("hidden");this.enabledDomFsm.setState("shown")},disableAddToCart:function(){this.enabledDomFsm.setState("hidden");this.disabledDomFsm.setState("shown")},setWarningMessage:function(a){this.warningPopover.setContentHtml(a)}}})}();J.OneClickWrapper=function(){return SDFramework.defineClass({publicFunctions:{config:y("oneClick"),
enable:function(a){var c=this.config({key:"element"});c?ScheduledDelivery.BuyBox.UIOverride.setVisible(SDFramework.jq(c),a):u.warn("one-click: no element")}}})}();ScheduledDelivery.BuyBox.DomStringUpdater=function(){var a=ScheduledDelivery.Debug;return SDFramework.defineClass({init:function(c){this.merchantStringMappings=a.requiredArg(c.domMerchantStringMappings);this.afnLearnMoreNode=a.requiredArg(c.afnLearnMoreNode)},privateFunctions:{resolveMerchantString:function(a,d){return this.merchantStringMappings[a][d]},
updateMerchantTextElements:function(a,d){for(var b in a)a.hasOwnProperty(b)&&SDFramework.jq(b).text(this.resolveMerchantString(a[b],d))},resolveLearnMoreNode:function(a,d){return a?this.afnLearnMoreNode:this.resolveMerchantString("sd_mfn_learn_more_node",d)}},publicFunctions:{updateStrings:function(a,d){this.updateMerchantTextElements({"#sd_bb_intent_text":"schedule_delivery_34179","#sd_bb_select_delivery_date_text":"sd-select-delivery-date-buybox","#sd_bb_notify1":"notify1","#sd_bb_notify2":"notify2"},
d);var b=a?this.afnLearnMoreNode:this.resolveMerchantString("sd_mfn_learn_more_node",d);a=a||"Installation"!=d&&"LocalInstallation"!=d?"/gp/help/customer/display.html?nodeId\x3d":"/gp/feature.html?docId\x3d";SDFramework.jq("#sd_bb_learn_more").attr("href",a+b)}}})}();ScheduledDelivery.BuyBox.Widget=SDFramework.defineClass({initBase:function(a,c,d,b){return X(a,c,d,b)},init:function(a,c,d,b){this.weblabs=b;this.domStringUpdater=a.domStringUpdater;this.jsMerchantStringMappings=a.jsMerchantStringMappings;
this.marketplaceID=a.marketplaceID;this.strings=a.strings;this.initUI();c=function(){};this.visFsm=new ScheduledDelivery.Fsm({graph:{hidden:{hidden:c,visible:this.container.show},visible:{hidden:this.container.hide,visible:c}},options:{context:this.container,initialState:"hidden"}});this.calCacheFsm=new ScheduledDelivery.Fsm({graph:{init:{needNew:this.invalidateCalendars},needNew:{needNew:this.invalidateCalendars}},options:{context:this}});this.fsm=new ScheduledDelivery.Fsm({graph:{notLoaded:{enabled:c,
disabled:c,requiredEnabled:this.xToRequiredNt,requiredDisabled:c},enabled:{enabled:c,disabled:this.xToDisabledNt,requiredEnabled:this.xToRequiredNt,requiredDisabled:this.xToDisabledNt},disabled:{enabled:c,disabled:c,requiredEnabled:this.xToRequiredNt,requiredDisabled:c},requiredEnabled:{enabled:this.xFromRequiredNt,disabled:function(){this.xFromRequiredNt();this.toDisabledNt()},requiredEnabled:c,requiredDisabled:function(){this.xFromRequiredNt();this.toDisabledNt()}},requiredDisabled:{enabled:c,disabled:c,
requiredEnabled:this.xToRequiredNt,requiredDisabled:c}},slaves:[{fsm:this.visFsm,bindings:{enabled:"visible",disabled:"hidden",requiredEnabled:"visible",requiredDisabled:"hidden"}},{fsm:this.calCacheFsm,bindings:{enabled:"needNew",requiredEnabled:"needNew"}}],triggers:{require:{enabled:"requiredEnabled",disabled:"requiredDisabled"},unrequire:{requiredEnabled:"enabled",requiredDisabled:"disabled"},enable:{enabled:"enabled",disabled:"enabled",requiredEnabled:"requiredEnabled",requiredDisabled:"requiredEnabled"},
disable:{enabled:"disabled",requiredEnabled:"requiredDisabled"}},options:{context:this,initialState:"notLoaded"}});this.setEnabledTrigger(d);this.setMerchantType(a.merchantType)},publicInit:function(){},privateFunctions:{initUI:function(){this.container=SDFramework.jq("#sd_div");this.chkSdIntent=this.bbSDUI.checkbox},setRequiredTrigger:function(a){this.required=a;this.fsm.tryTrigger(a?"require":"unrequire")},setEnabledTrigger:function(a){this.enabled=a;this.fsm.tryTrigger(a?"enable":"disable")},xToDisabledNt:function(){this.chkSdIntent.setChecked(!1)},
xToRequiredNt:function(){this.bbSDUI.shoppingCart.setWarningMessage(this.strings.sd_required_buybox_disabled);this.chkSdIntent.setChecked(!0);this.chkSdIntent.setVisible(!1)},xFromRequiredNt:function(){this.chkSdIntent.setVisible(!0);this.bbSDUI.shoppingCart.setWarningMessage(this.nonRequiredShoppingCartWarning)},setMerchantType:function(a){this.merchantType=a;SDFramework.jq("#sd_bb_no_slots_message").text(this.calendarRef.config({key:"noSlotsAddressBB"}));SDFramework.jq("#sd_bb_retrieve_error").text(this.calendarRef.config({key:"retrieveError"}));
this.nonRequiredShoppingCartWarning=this.jsMerchantStringMappings?this.jsMerchantStringMappings.sd_buybox_disabled[a]:this.strings.sd_buybox_disabled;this.required||this.bbSDUI.shoppingCart.setWarningMessage(this.nonRequiredShoppingCartWarning)},invalidateCalendars:function(){this.bbSDUI.unselectCalendar();this.chkSdIntent.isChecked()&&this.bbSDUI.selectCalendar()},isCallbackWeblabConsistent:function(a){if(!a){if(!this.weblabs.sdTwisterOnChildSelect)return u.warn("Twister Ajax executed with inconsistent weblab state (T1)."),
!1}else if(this.weblabs.sdTwisterOnChildSelect&&a.sdInfo===q)return u.warn("Twister Ajax executed with inconsistent weblab state (non-T1)."),!1;return!0}},publicFunctions:{declareContainerReady:function(){this.fsm.setState(this.enabled?this.required?"requiredEnabled":"enabled":this.required?"requiredDisabled":"disabled")},updateBuyBoxObject:function(a){try{if(u.debug("Updating SD widget",a),this.isCallbackWeblabConsistent(a))if(this.weblabs.sdTwisterAjax){u.debug("SDTwister: T3");this.bbSDUI.config({key:"id_offerlist_id",
value:a.offerListingID});this.bbSDUI.config({key:"id_quantity",value:a.quantity});var c={asin:a.asin,merchantID:a.merchantID,sku:a.mSku,fmid:a.fmID,offerListingID:a.offerListingID,quantity:a.quantity},d=this.itemCache.update(c,c);d.isSDAvailable===q&&u.isWarnEnabled()&&u.warn("Cache miss on SD Availability for item:",a,"Cache state:",this.itemCache);this.bbSDUI.config({key:"id_merchant",value:d.merchantID});this.bbSDUI.config({key:"id_asin",value:d.asin});this.bbSDUI.config({key:"id_sku",value:d.sku});
this.bbSDUI.config({key:"id_fmid",value:d.fmid});this.bbSDUI.config({key:"shipoption",value:d.shipOption});this.bbSDUI.config({key:"isSDAvailable",value:d.isSDAvailable?!0:!1});this.domStringUpdater.updateStrings(d.isFBA,d.merchantType);this.setMerchantType(d.merchantType);this.setEnabledTrigger(this.bbSDUI.config({key:"isSDAvailable"}))}else this.weblabs.sdTwisterOnChildSelect?(u.debug("SDTwister: T1"),a?(this.bbSDUI.config({key:"id_merchant",value:a.merchantID}),this.bbSDUI.config({key:"id_asin",
value:a.asin}),this.bbSDUI.config({key:"id_sku",value:a.mSku}),this.bbSDUI.config({key:"id_fmid",value:a.fmID}),this.bbSDUI.config({key:"id_offerlist_id",value:a.offerListingID}),this.bbSDUI.config({key:"id_quantity",value:a.quantity}),this.bbSDUI.config({key:"shipoption",value:a.shipOption}),this.domStringUpdater.updateStrings(a.sdInfo.isFBA,a.sdInfo.merchantType),this.setMerchantType(a.sdInfo.merchantType),this.setEnabledTrigger(!0)):this.setEnabledTrigger(!1)):(u.debug("SDTwister: C"),SDFramework.jq("#sd_intent").removeAttr("disabled"),
this.bbSDUI.config({key:"id_merchant",value:a.merchantID}),this.bbSDUI.config({key:"id_asin",value:a.asin}),this.bbSDUI.config({key:"id_sku",value:a.mSku}),this.bbSDUI.config({key:"id_fmid",value:a.fmID}),this.bbSDUI.config({key:"id_offerlist_id",value:a.offerListingID}),this.bbSDUI.config({key:"id_quantity",value:a.quantity}),this.calendarRef.calData.clearCals(),0<SDFramework.jq("#sd_intent:checked").length&&SDFramework.jq("#sd_zipcode_go").click());else this.fsm.trigger("disable")}catch(b){u.error("Unable to update Scheduled Delivery widget.",
b.message,b.stack)}}}});F.prototype.initializeDom=function(){var a=this.domSettings?this.domSettings.widgetRoot:"sd_widgets_"+this.widgetIndex;SDFramework.jq("#"+a+" .sd_Loading").hide();SDFramework.jq("#"+a+" .sd_err_nojs").hide();SDFramework.jq("#"+a+" .sd_err_connect").hide()};F.prototype.establishDomHooks=function(a){a=this.domSettings?this.domSettings.widgetRoot:"sd_widgets_"+this.widgetIndex;this.calendarRef.icon({key:"dom_disabled",value:"#"+a+" .sd_calicon_disabled"});this.calendarRef.icon({key:"dom_enabled",
value:"#"+a+" .sd_calicon_enabled"});this.calendarRef.config({data:{dom_bar:a+" .sd_widget",dom_failbar:a+" .sd_err_connect",dom_noslots:a+" .sd_err_from_result",dom_inconsistent:a+" .sd_err_inconsistent",dom_reload:a+" .sd_reload",dom_loadbar:a+" .sd_Loading"}});1===this.UISettings.showDropdown&&this.calendarRef.dropdown.config({key:"element",value:"sduiDropdown"+this.widgetIndex})};F.prototype.injectDom=function(a,c,d,b,h,f,q){function m(a,b,c){n.push('\x3cimg class\x3d"sd_calicon ',a,'" src\x3d"',
c,'" width\x3d"25" alt\x3d"Calendar" height\x3d"17" border\x3d"0"');b||n.push(' style\x3d"display: none;"');n.push("/\x3e")}function k(){m("sd_calicon_disabled",!0,h)}function e(a,b,c,d){var e;if(SDUtils.isBeacon(z)){n.push('\x3cdiv class\x3d"',a," a-box ",c?"a-alert ":"","a-alert-",b,'" style\x3d"display: none;"\x3e');n.push('\x3cdiv class\x3d"a-box-inner"\x3e');c&&n.push('\x3ci class\x3d"a-icon a-icon-alert"\x3e\x3c/i\x3e');for(e=3;e<arguments.length;e++)n.push(arguments[e]);n.push("\x3c/div\x3e")}else for(n.push('\x3cdiv class\x3d"',
a,' sdWarn" style\x3d"display: none;"\x3e'),e=3;e<arguments.length;e++)n.push(arguments[e]);n.push("\x3c/div\x3e")}var r=this.calendarRef.config({key:"pickDateText"}),g=this.calendarRef.config({key:"learnMoreText"}),p=this.calendarRef.config({key:"reloadText"}),l=this.calendarRef.config({key:"noSlotsAddress"}),t=this.calendarRef.config({key:"inconsistentWithBuybox"}),u=this.calendarRef.config({key:"retrieveError"}),x=this.calendarRef.config({key:"tryAgain"}),y=this.calendarRef.config({key:"showDropdown"}),
z=SDFramework.jq("#"+(this.domSettings?this.domSettings.widgetRoot:"sd_widgets_"+this.widgetIndex)),n=[];n.push('\x3cinput type\x3d"hidden" name\x3d"SD-SlotID-',a,'" key\x3d"ScheduledDeliveryEntity.SlotId"                   value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-ResID-',a,'" key\x3d"ScheduledDeliveryEntity.ReservationId"            value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-ResType-',a,'" key\x3d"ScheduledDeliveryEntity.reservationType"          value\x3d""/\x3e');
n.push('\x3cinput type\x3d"hidden" name\x3d"SD-StartTime-',a,'" key\x3d"ScheduledDeliveryEntity.startDeliveryDate"        value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-EndTime-',a,'" key\x3d"ScheduledDeliveryEntity.endDeliveryDate"          value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-WindowTZ-',a,'" key\x3d"ScheduledDeliveryEntity.deliveryTimeZone"         value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-CutoffTime-',a,'" key\x3d"ScheduledDeliveryEntity.cutoffTime"               value\x3d""/\x3e');
n.push('\x3cinput type\x3d"hidden" name\x3d"SD-CutoffTZ-',a,'" key\x3d"ScheduledDeliveryEntity.deliveryTimeZone"         value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-SlotStartLTZ-',a,'" key\x3d"ScheduledDeliveryEntity.deliveryRange.startDate"  value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-SlotEndLTZ-',a,'" key\x3d"ScheduledDeliveryEntity.deliveryRange.endDate"    value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-SlotLongTZ-',a,'" key\x3d"ScheduledDeliveryEntity.deliveryRange.timezone"   value\x3d""/\x3e');
n.push('\x3cinput type\x3d"hidden" name\x3d"SD-Date-',a,'" value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-Cutoff-',a,'" value\x3d""/\x3e');c&&n.push('\x3cinput type\x3d"hidden" name\x3d"SD-OrderID-',a,'" value\x3d"',c,'"/\x3e');d&&n.push('\x3cinput type\x3d"hidden" name\x3d"SD-ItemList-',a,'" value\x3d"',d,'"/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"D_MinShipDtUTC-',a,'" key\x3d"ScheduledDeliveryEntity.promiseMinShipmentDate" value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"D_MaxShipDtUTC-',
a,'" key\x3d"ScheduledDeliveryEntity.promiseMaxShipmentDate" value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-PromiseLFSS-',a,'" key\x3d"ScheduledDeliveryEntity.promiseFulfillmentServiceSubclass" value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-SlotQuality-',a,'" key\x3d"ScheduledDeliveryEntity.slotQuality" value\x3d""/\x3e');n.push('\x3cinput type\x3d"hidden" name\x3d"SD-SlotQualityDetail-',a,'" key\x3d"ScheduledDeliveryEntity.slotQualityDetail" value\x3d""/\x3e');
(c=this.dataField)&&(c.id||c.name)&&(n.push('\x3cinput type\x3d"hidden"'),c.id&&n.push(' id\x3d"',c.id,'"'),c.name&&n.push(' name\x3d"',c.name,'"'),n.push("/\x3e"));n.push('\x3cspan class\x3d"sd_Loading" style\x3d"display: none;"\x3e');n.push('\x3cimg src\x3d"',b,'" width\x3d"114" height\x3d"9" alt\x3d"Loading" border\x3d"0" /\x3e');n.push("\x3c/span\x3e");1===y?(n.push('\x3cdiv class\x3d"sdMessage" style\x3d"display: none;"\x3e'),n.push('\x3cdiv class\x3d"sdMessage" style\x3d"display: none;"\x3e\x3cspan class\x3d"swSprite s_notifySm"\x3e\x3c/span\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e'),
n.push("\x3c/div\x3e")):(n.push('\x3cdiv class\x3d"sdMessage" style\x3d"display: none;"\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e'),n.push('\x3cdiv class\x3d"sdMessage_service" style\x3d"display: none;"\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e'));n.push('\x3cspan class\x3d"sd_controls v1"\x3e');n.push('\x3cspan class\x3d"sd_widget" style\x3d"display: none"\x3e');1===y?(n.push('\x3cspan class\x3d"sd_Active"\x3e'),n.push('\x3cselect id\x3d"sduiDropdown',a,'" name\x3d"sduiDate" disabled \x3e'),n.push('\x3coption value\x3d"" selected\x3e',
r,"\x3c/option\x3e"),n.push("\x3c/select\x3e"),n.push("\x3c/span\x3e"),k(),n.push('\x3ca href\x3d"#" class\x3d"sd_calendar_link" id\x3d"calendarLink',a,'" onclick\x3d"return false;"\x3e')):(n.push('\x3ca href\x3d"#" class\x3d"sd_calendar_link" id\x3d"calendarLink',a,'" onclick\x3d"return false;"\x3e'),n.push('\x3cspan class\x3d"sd_Active"\x3e \x3cu\x3e'),n.push(this.calendarRef.config({key:"sd_select_another_date_and_time"})),n.push("\x3c/u\x3e\x3c/span\x3e"),k());m("sd_calicon_enabled",!1,f);n.push("\x3c/a\x3e");
n.push("\x3c/span\x3e");n.push('\x3ca class\x3d"learnmore" href\x3d"',q,'" target\x3d"_blank"\x3e',g,"\x3c/a\x3e");n.push('\x3cspan class\x3d"sd_reload" id\x3d"sd_reload_',a,'" style\x3d"display: none;"\x3e');n.push(p);n.push("\x3c/span\x3e");n.push("\x3c/span\x3e");e("sd_err_noslots","info",!1,"\x3cp\x3e",l,"\x3c/p\x3e");e("sd_err_inconsistent","info",!1,"\x3cp\x3e",t,"\x3c/p\x3e");e("sd_err_connect","info",!1,"\x3cp\x3e",u,' \x3ca class\x3d"sdReloadLink" href\x3d"#"\x3e',x,"\x3c/a\x3e\x3c/p\x3e");
e("sd_err_from_result","info",!1,'\x3cdiv class\x3d"sd_err_from_result_content"/\x3e');n.push('\x3cdiv id\x3d"sdcal-popup',a,'" class\x3d"sdCalendarPopover" style\x3d"display: none"\x3e\x3c/div\x3e');z.prepend(n.join(""));z.find(".sdReloadLink").click(function(a){z.find(".sd_reload").click()})};sd_init_checkout_configure=function(a,c,d,b,h,f,r){function m(a){return a&&"false"!==a&&"0"!==a}function k(a,b,c,d,f){if(this.chkSDUI=Q("sd_loaded_"+a.currentSD)){this.chkSDUI.config({key:"sd_calendar",value:this.calendarRef});
this.calendarRef.config({key:"load_url",value:c.load_url});this.calendarRef.config({key:"message_hook",value:a.messageHook});this.calendarRef.config({key:"dom_widget_root",value:"sd_widgets_"+a.currentSD});this.calendarRef.config({key:"dom_no_widget_root",value:"sd_no_widgets_"+a.currentSD});this.calendarRef.config({key:"dom_popup_trigger",value:"calendarLink"+a.currentSD});this.calendarRef.config({key:"id_enable_fn",value:a.onEnableFn});this.calendarRef.config({key:"id_select_fn",value:a.onSelectFn});
this.calendarRef.config({key:"id_is_selected",value:m(a.isSelected)});this.calendarRef.config({key:"weblabs",value:r});if(this.chkSDUI.inputs){var g=a.currentSD,h=e.id?SDFramework.jq("#"+e.id):[e.name];this.chkSDUI.inputs.setMappings({slotId:["SD-SlotID-"+g],reservationId:["SD-ResID-"+g],reservationType:["SD-ResType-"+g],ultStart:["SD-StartTime-"+g],ultEnd:["SD-EndTime-"+g],ultCutoff:["SD-CutoffTime-"+g],timeZone:["SD-CutoffTZ-"+g,"SD-WindowTZ-"+g],minShip:["D_MinShipDtUTC-"+g],maxShip:["D_MaxShipDtUTC-"+
g],fss:["SD-PromiseLFSS-"+g],slotQuality:["SD-SlotQuality-"+g],slotQualityDetail:["SD-SlotQualityDetail-"+g],start:["SD-SlotStartLTZ-"+g],end:["SD-SlotEndLTZ-"+g],tz:["SD-SlotLongTZ-"+g],data:h});this.chkSDUI.inputs.updateDataMembers({refdataVersion:f.sdUseCase})}this.chkSDUI.message&&(this.chkSDUI.message.config({data:{element:"sd_widgets_"+a.currentSD+" .sdMessage p",element_service:"sd_widgets_"+a.currentSD+" .sdMessage_service p",timeslotDeterminationFn:this.isTimeslot}}),this.chkSDUI.message.showDropdown=
f.showDropdown!==q&&0===f.showDropdown?0:1)}this.chkSDUI.config({data:{dom_message_hook:a.messageHook,dom_sdso:"sd-shipop",id_address:c.addressId,id_merchant:b.merchant,id_marketplace:c.marketplaceId,id_request:c.requestId,id_asin:b.asin,id_sku:b.msku,id_fmid:b.fmid,id_quantity:b.quantity,id_offerlist_id:b.olid,id_itemList_id:b.itemListId,id_shipoption:a.speedKey,id_enable_fn:a.onEnableFn,id_select_fn:a.onSelectFn,id_is_selected:a.isSelected,id_template_slot:d&&d.reservationId?d.reservationId:null}})}
f=null===f?{}:f;var e=a.dataField;e&&(e.id||e.name)||(e={name:"SD-Data-"+a.currentSD});k.prototype=new F(a.currentSD,b,h,f,null,e);k.prototype.initializeSpecificDom=function(){this.initializeDom()};return new k(a,c,d,b,f)};C.declare("scheduledDeliveryWidget")})});
/* ******** */
(function(f){var h=window.AmazonUIPageJS||window.P,l=h._namespace||h.attributeErrors,c=l?l("DetailPageMobileIconFarmAssets@common","DetailPageMobileIconFarm"):h;c.guardFatal?c.guardFatal(f)(c,window):c.execute(function(){f(c,window)})})(function(f,h,l){f.when("A","ready").register("get-icon-farm-page-state",function(c){return{parseJSON:function(e,b){b="iconfarm-state-"+b;var d='script[data-a-state\x3d"{"key":"'+b+'"}"]',a;try{a=c.$("#"+e).find(d).html()}catch(k){console.log(k.message)}a?e=c.$.parseJSON(a):
(c.state.parse(),e=c.state(b));return e}}});f.declare("icon-farm-mod-constants",{selector:{BUYBOX_ACCORDION:"#buybox .a-accordion",BUYBOX_ACCORDION_ACTIVE:"#buybox .a-accordion-active",iconfarm:"#iconfarmv2_feature_div .offersConsistencyEnabled"}});f.declare("iconfarm-metrics-constants",{ICON_FARM_FEATURE_DIV:"iconFarm_feature_div",ICON_FARM_PAGE_STATE_HOLDER_DIV:"iconfarm-pagestate-holder",METRIC_TYPE:{GLANCE_VIEW:"GLANCE_VIEW",ICON_CLICK:"ICON_CLICK",SECONDARY_PAGE_OPEN:"SECONDARY_PAGE_OPEN",SECONDARY_PAGE_CLOSE:"SECONDARY_PAGE_CLOSE",
FULL_RETURN_POLICY:"FULL_RETURN_POLICY",PAGE_DATA_MISSING:"PAGE_DATA_MISSING",ABSENT:"ABSENT",EXPANDER_OPEN:"EXPANDER_OPEN"},REF_MARKER_PREFIX:{ICON_FARM_WIDGET:"iconfarm_wid",AMAZON_DELIVERED:"iconfarm_ad",RETURNS_POLICY:"iconfarm_rp",PAY_ON_DELIVERY:"iconfarm_pod",WARRANTY:"iconfarm_wr",EASY_CARE:"iconfarm_ec",AMAZON_PROTECT:"iconfarm_ap",NO_CONTACT_DELIVERY:"iconfarm_ncd",GENERIC_RETURN_POLICY:"iconfarm_grp",MULTIPLE_SPECIFIC_RETURN_POLICY:"iconfarm_msrp",SINGLE_SPECIFIC_RETURN_POLICY:"iconfarm_ssrp",
PAYMENTS_AND_SECURITY:"iconfarm_ps",PAY_ON_DELIVERY_ACTIVE:"iconfarm_pod_active",PAY_ON_DELIVERY_INACTIVE:"iconfarm_pod_inactive",WARRANTY_EU:"iconfarm_wr_eu",AMAZON_MANAGED_DELIVERY:"iconfarm_amd",AMAZON_DELIVERED_MENA:"iconfarm_ad_mena",SAFE_PAYMENTS:"iconfarm_sp",STATIC_RETURNS_POLICY:"iconfarm_srp",GENERIC_RETURNS_POLICY:"iconfarm_grp",SUPPORT_POLICY:"iconfarm_supp",WARRANTY360:"iconfarm_wr360",WORRY_FREE_GUARANTEE_JP:"iconfarm_wfg_jp",WARRANTY_JP:"iconfarm_wr_jp",DELIVERY_JP:"iconfarm_dl_jp",
RETURN_POLICY_JP:"iconfarm_rp_jp",SMALL_BUSINESS_JP:"iconfarm_sb_jp",DELIVERY_HIT:"iconfarm_dh",WARRANTY_HIT:"iconfarm_wh",RETURN_POLICY_HIT:"iconfarm_rph",CUSTOMER_SUPPORT:"iconfarm_cs",SERVICE:"iconfarm_serv",FREE_DELIVERY:"iconfarm_fd",FREE_DELIVERY_V2:"iconfarm_fdv2",TOP_BRAND:"iconfarm_tb",AUTHENTICITY:"iconfarm_auth"},REF_MARKER_SUFFIX:{GLANCE_VIEW:"_gv",ICON_CLICK:"_clk",SECONDARY_PAGE_OPEN:"_sp_op",SECONDARY_PAGE_CLOSE:"_sp_cl",FULL_RETURN_POLICY:"_frp",EXPANDER_OPEN:"_exp_op",ABSENT:"_noavail"},
NEXUS_CONFIG:{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3"},LOGGER_CONFIG:{NEXUS_LOGGER:"nexus"}});f.when("A","iconfarm-return-policy-metric-logger","iconfarm-pay-on-delivery-metric-logger","iconfarm-default-metric-logger").register("iconfarm-icon-metric-factory",function(c,e,b,d){return{getIconMetric:function(a){switch(a){case "RETURNS_POLICY":return e;case "PAY_ON_DELIVERY":return b;default:return d}}}});f.when("A","iconfarm-metrics-constants","get-icon-farm-page-state",
"iconfarm-icon-metric-factory","ready").register("iconfarm-metricLogger",function(c,e,b,d){return{log:function(a,k,m,g){if(a&&k&&null!==m&&e.REF_MARKER_PREFIX[a]&&e.REF_MARKER_SUFFIX[k]){var f=c.$("#icon-farm-widget-"+m),h=b.parseJSON(e.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+m,m);h?d.getIconMetric(a).log(a,k,m,c.$.extend(!0,{asin:h.asin,merchantId:h.merchantId,remoteAddress:h.remoteAddress,isInternal:h.isInternal,isRobot:h.isRobot,numOfShownIcons:h.numOfShownIcons,buyingOptionIndex:m},g)):f.length&&
console.warn("iconfarm state may not be available")}}}});f.when("A","ready").register("iconfarm-postmetric",function(){return{postCountMetric:function(c){if("undefined"!==typeof c){var e=h.ue;if(e){var b=e.count(c)||0;e.count(c,b+1)}}},postTimeMetric:function(c,e){if("undefined"!==typeof c&&"undefined"!==typeof e){var b=h.ue;b&&b.count(c,e)}}}});f.when("A","ready").register("iconfarm-metric-cache",function(c){var e=[],b=function(a){if(!d(a))return!1;var b=!1;c.each(e,function(c,d){c.asin===a.asin&&
c.merchantId===a.merchantId&&c.ref===a.ref&&c.loggerType===a.loggerType&&c.buyingOptionIndex===a.buyingOptionIndex&&(b=!0)});return b},d=function(a){return a&&a.asin&&a.merchantId&&a.ref&&a.loggerType&&null!==a.buyingOptionIndex};return{isPresent:b,add:function(a){return d(a)?b(a)?!1:(e.push(a),!0):!1},reset:function(){e=[]}}});"use strict";f.when("A","iconfarm-metric-cache","iconfarm-metrics-constants","ready").register("iconfarm-Nexus-Service",function(c,e,b){return{log:function(d){if(e.add(d)){var a=
{};a.producerId=b.NEXUS_CONFIG.NEXUS_PRODUCER_ID;a.schemaId=b.NEXUS_CONFIG.NEXUS_SCHEMA_ID;a.refMarker=d.ref;a.pageAsin=d.asin;a.pageType=c.capabilities?c.capabilities.mobile?c.capabilities.isAmazonApp?"DetailWebView":"DetailAW":"Detail":"";a.subPageType="IconFarm";a.server=h?h.ue_sn:"";a.merchantId=d.merchantId;a.remoteAddress=d.remoteAddress;a.isInternal=d.isInternal?1:0;a.isRobot=d.isRobot?1:0;var k={};k.numOfShownIcons=d.numOfShownIcons;k.buyingOptionIndex=d.buyingOptionIndex;d=JSON.stringify(k);
a.additionalRequestData=d;if(d=h.ue)try{d.event&&d.event(a,b.NEXUS_CONFIG.NEXUS_PRODUCER_ID,b.NEXUS_CONFIG.NEXUS_SCHEMA_ID)}catch(f){d.count("NexusLoggerFailure",1)}}}}});f.when("A","iconfarm-Nexus-Service","iconfarm-metrics-constants","iconfarm-postmetric","ready").register("iconfarm-default-metric-logger",function(c,e,b,d){return{log:function(a,k,f,g){f=JSON.parse(JSON.stringify(g));e.log(c.$.extend(!0,f,{ref:b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));
d.postCountMetric(b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k])}}});f.when("A","iconfarm-Nexus-Service","iconfarm-metrics-constants","iconfarm-postmetric","get-icon-farm-page-state","ready").register("iconfarm-return-policy-metric-logger",function(c,e,b,d,a){return{log:function(k,f,g,h){a:{if((g=a.parseJSON(b.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.RETURNS_POLICY&&g.RETURNS_POLICY.secondaryViewData&&g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies)switch(g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies.length){case 0:g=
"GENERIC_RETURN_POLICY";break a;case 1:g="SINGLE_SPECIFIC_RETURN_POLICY";break a;default:g="MULTIPLE_SPECIFIC_RETURN_POLICY";break a}g=void 0}k=g||k;h=JSON.parse(JSON.stringify(h));e.log(c.$.extend(!0,h,{ref:b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f])}}});f.when("A","iconfarm-Nexus-Service","iconfarm-metrics-constants","iconfarm-postmetric","get-icon-farm-page-state","ready").register("iconfarm-pay-on-delivery-metric-logger",
function(c,e,b,d,a){return{log:function(f,h,g,l){g=(g=a.parseJSON(b.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.PAY_ON_DELIVERY&&g.PAY_ON_DELIVERY.isEligible?g.PAY_ON_DELIVERY.isEligible?"PAY_ON_DELIVERY_ACTIVE":"PAY_ON_DELIVERY_INACTIVE":void 0;f=g||f;l=JSON.parse(JSON.stringify(l));e.log(c.$.extend(!0,l,{ref:b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h])}}})});
/* ******** */
(function(e){var k=window.AmazonUIPageJS||window.P,g=k._namespace||k.attributeErrors,a=g?g("DetailPageMobileIconFarmAssets@desktop","DetailPageMobileIconFarm"):k;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,k,g){e.when("A","a-popover","icon-farm-constants","iconfarm-metricLogger","iconfarm-metrics-constants","icon-farm-web-mod-util","ready").register("icon-farm-desktop-popover",function(a,l,b,c,d,f){var h=function(b){var h=b.data("name");a.off("a:popover:beforeShow:"+
h);a.on("a:popover:beforeShow:"+h,function(a){a=f.getCurrentBuyingOptionIndex();c.log(h,d.METRIC_TYPE.ICON_CLICK,a);c.log(h,d.METRIC_TYPE.SECONDARY_PAGE_OPEN,a)});a.off("a:popover:beforeHide:"+h);a.on("a:popover:beforeHide:"+h,function(a){a=f.getCurrentBuyingOptionIndex();c.log(h,d.METRIC_TYPE.SECONDARY_PAGE_CLOSE,a)})};return{init:function(){for(var c=a.$(b.ICON_FARM_CONTAINER_CLASS),f=0;f<c.length;f++){var d=a.$(c[f]),e=d.data(b.TYPE_PARAM);if(e&&e===b.TYPE_PARAM_VALUE_CUSTOM_POP_OVER){var e=d,
g=a.$("#"+e.data(b.POPOVER_CONTENT_PARAM)),g={activate:b.POPOVER_ACTIVATION,position:b.POPOVER_POSITION,width:b.POPOVER_WIDTH,inlineContent:g.html(),name:e.data("name")};l.create(e,g);h(d)}}}}});e.when("A","get-icon-farm-page-state","icon-farm-constants","iconfarm-metricLogger","iconfarm-metrics-constants","icon-farm-web-mod-util","ready").register("icon-farm-desktop-returns-policy",function(a,e,b,c,d,f){a.declarative("returns-policy-url","click",function(a){a=f.getCurrentBuyingOptionIndex();c.log("RETURNS_POLICY",
d.METRIC_TYPE.FULL_RETURN_POLICY,a);a=e.parseJSON(b.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+a,a);k.open(a.RETURNS_POLICY.genericReturnPolicyURL,"_blank")});a.off("a:popover:beforeShow:return-policy-secondary-view");a.on("a:popover:beforeShow:return-policy-secondary-view",function(a){a=f.getCurrentBuyingOptionIndex();c.log("RETURNS_POLICY",d.METRIC_TYPE.ICON_CLICK,a);c.log("RETURNS_POLICY",d.METRIC_TYPE.SECONDARY_PAGE_OPEN,a)});a.off("a:popover:beforeHide:return-policy-secondary-view");a.on("a:popover:beforeHide:return-policy-secondary-view",
function(a){a=f.getCurrentBuyingOptionIndex();c.log("RETURNS_POLICY",d.METRIC_TYPE.SECONDARY_PAGE_CLOSE,a)});return{init:function(){}}});e.when("A","IconFarmPageStateParserService","icon-farm-desktop-popover","icon-farm-desktop-returns-policy","iconfarm-metricLogger","icon-farm-constants","iconfarm-metrics-constants","iconfarm-metric-cache","icon-farm-web-mod-util","icon-farm-change-buying-option","atf","ready").execute(function(a,l,b,c,d,f,h,g,k,q){function m(){g.reset();a.loadImageManually(a.$(".icon-box"));
b.init();c.init();q.init();for(var f=0;f<n;f++)r(f)}var n=k.getBuyingOptionCounts(),r=function(f){var b="#icon-farm-widget-"+f,c=a.$(b);c&&c.length?d.log("ICON_FARM_WIDGET",h.METRIC_TYPE.GLANCE_VIEW,f):d.log("ICON_FARM_WIDGET",h.METRIC_TYPE.ABSENT,f);(b=a.$(b+" .icon-container"))&&b.length&&b.each(function(){d.log(a.$(this).data("name"),h.METRIC_TYPE.GLANCE_VIEW,f)})};m();a.on("a:pageUpdate",function(){var b;a:{try{if(a.$("#"+f.ICON_FARM_V2_FEATURE_DIV).find("script").length){b=f.ICON_FARM_V2_FEATURE_DIV;
break a}if(a.$("#"+f.ICON_FARM_V2_PRIMARY_FEATURE_DIV).find("script").length){b=f.ICON_FARM_V2_PRIMARY_FEATURE_DIV;break a}d.log("ICON_FARM_WIDGET",h.PAGE_DATA_MISSING,0)}catch(c){e.log(c,"ERROR","DetailPageMobileIconFarm")}b=void 0}if(b){for(var g=0;g<n;g++)if(l.isNewState(b,f.ICON_FARM_STATE+"-"+g)){var p=l.processState(b,f.ICON_FARM_STATE+"-"+g);if(a.objectIsEmpty(p))return}m()}})});e.declare("icon-farm-constants",{ICON_FARM_FEATURE_DIV:"iconFarm_feature_div",ICON_FARM_V2_FEATURE_DIV:"iconfarmv2_feature_div",
ICON_FARM_V2_PRIMARY_FEATURE_DIV:"iconFarmV2InsidePrimary_feature_div",ICON_FARM_PAGE_STATE_HOLDER_DIV:"iconfarm-pagestate-holder",ICON_FARM_CONTAINER_CLASS:".icon-container",ICON_FARM_SECONDARY_VIEW_HOLDER_ID:"#icon-farm-secondary-view-holder",ICON_FARM_STATE:"iconfarm-state",POPOVER_ACTIVATION:"onclick",POPOVER_POSITION:"triggerBottom",POPOVER_WIDTH:"533",POPOVER_CONTENT_PARAM:"iconContent",TYPE_PARAM:"type",TYPE_PARAM_VALUE:"bottom-sheet",TYPE_PARAM_VALUE_CUSTOM_POP_OVER:"custom-pop-over"});(function(){e.when("A",
"atf","ready").register("IconFarmPageStateParserService",function(a){function e(b,c){c='script[data-a-state\x3d"'+JSON.stringify({key:c})+'"]';return a.$("#"+b).find(c)}return{processState:function(b,c){var d;try{var f=e(b,c),h=f[0];d=f.html();var g=a.parseJSON(d);a.state(c,g);a.$.data(h,"state_processed",!0);return g}catch(k){console.log(k)}return a.state(c)},isNewState:function(b,c){try{return!a.$.data(e(b,c)[0],"state_processed")}catch(d){console.warn("Unable to determine state status",d)}return!1}}})})();
"use strict";e.when("A","icon-farm-mod-constants").register("icon-farm-web-mod-util",function(a,e){return{getBuyingOptionCounts:function(){if(!a.$(e.selector.iconfarm).length)return 1;var b=a.$(e.selector.BUYBOX_ACCORDION);if(0===b.length)return 1;b=b[0];if(a.$(e.selector.iconfarm).length){for(var b=b.children,c=0,d=0;d<b.length;d++)var f=a.$(b[d]).attr("data-buying-option-index"),c=Math.max(c,f);b=c}else b=0;return b+1},getCurrentBuyingOptionIndex:function(){var b=0;if(!a.$(e.selector.iconfarm).length)return 0;
var c=a.$(e.selector.BUYBOX_ACCORDION_ACTIVE);c.length&&(b=c.index());return b}}});e.when("A","icon-farm-mod-constants","icon-farm-web-mod-util","ready").register("icon-farm-change-buying-option",function(a,e,b){var c=b.getCurrentBuyingOptionIndex(),d=function(b){var d=a.$(e.selector.iconfarm);if(d.length){var k=d[0].children;k.length&&(d=k[c],b!==g&&b.selectedRow!==g&&b.selectedRow.$row!==g&&a.$(b.selectedRow.$row)!==g&&(b=a.$(b.selectedRow.$row).index(),b!==c&&(k=k[b],d.style.display="none",k.style.display=
"block",c=b)))}};return{init:function(){a.on("a:pageUpdate",d);a.on("PageRefresh:ATF",d);a.on("a:accordion:buybox-accordion:select",d)}}})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,b=g?g("DetailPageSocialProofingAssets@common","DetailPageSocialProofing"):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,g){d.declare("socialProofingConstants",{socialProofingAUIState:"social-proofing-page-state-cache",socialProofingState:"social-proofing-page-state",socialProofingTriggeredAsinsState:"social-proofing-triggered-asins-page-state",socialProofingBadgeClass:".social-proofing-badge",
socialProofingFaceoutClass:".social-proofing-faceout",socialProofingBadgeWeblabDivId:"#social-proofing-badge-weblab-data",MOBILE_APP:"mobileApp",ATTRIBUTION:"SocialProofing"});"use strict";d.when("A","socialProofingConstants","socialProofingPageState","ready").register("socialProofingUtil",function(b,e,h){function k(b,a){f.ue&&f.ue.trigger?f.ue.trigger(b,a):d.log("Failed to get ue and ue.trigger for weblab: "+b+"and treatment: "+a,"WARN",e.ATTRIBUTION)}return{getAttributeFromPageState:function(c){var a=
b.state(e.socialProofingState);if(a)return a[c]},triggerWebLab:k,triggerWeblabsBySectionId:function(c){c=b.$(c);if(c.length){if(!h.isWeblabTriggered()&&(c=c[0])){c=c.dataset;for(var a in c)k(a.toString().toUpperCase(),c[a]);h.updateWeblabTriggeredToTrue()}}else b.state.replace(e.socialProofingTriggeredAsinsState,{})}}});"use strict";d.when("A","socialProofingConstants","ready").register("socialProofingPageState",function(b,e){function d(){var a=b.state(c);if(a)return a.asin}function f(){var a=b.state(e.socialProofingTriggeredAsinsState);
return a?!0===a.weblabTriggered:(b.state.replace(e.socialProofingTriggeredAsinsState,{weblabTriggered:!1}),!1)}var c=e.socialProofingState;return{reloadPageState:function(){b.each(b.$(".social-proofing-badge").siblings("[data-a-state]"),function(a){b.parseJSON(b.$(a).attr("data-a-state")).key===c&&(a=b.parseJSON(b.$(a).html()))&&a.asin!==d()&&(b.state.replace(c,a,!0),b.state.replace(e.socialProofingTriggeredAsinsState,{}))});b.each(b.$(".social-proofing-faceout").siblings("[data-a-state]"),function(a){b.parseJSON(b.$(a).attr("data-a-state")).key===
c&&(a=b.parseJSON(b.$(a).html()))&&a.asin!==d()&&b.state.replace(c,a,!0)})},isMobileApp:function(){var a=b.state(c);if(a)return a.deviceType===e.MOBILE_APP},getAsin:d,getMerchantId:function(){var a=b.state(c);if(a)return a.merchantId},getRemoteAddress:function(){var a=b.state(c);if(a)return a.remoteAddress},getIsInternal:function(){var a=b.state(c);if(a)return a.isInternal},getIsRobot:function(){var a=b.state(c);if(a)return a.isRobot},getAvailableBadges:function(){var a=b.state(c);if(a)return a.availableBadges},
getAvailableFaceouts:function(){var a=b.state(c);if(a)return a.availableFaceouts},isWeblabTriggered:f,updateWeblabTriggeredToTrue:function(){var a=b.state(e.socialProofingTriggeredAsinsState);a&&!f()&&(a.weblabTriggered=!0,b.state.replace(e.socialProofingTriggeredAsinsState,a))}}})});
/* ******** */
(function(f){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,d=e?e("DetailPageSocialProofingAssets@logger","DetailPageSocialProofing"):c;d.guardFatal?d.guardFatal(f)(d,window):d.execute(function(){f(d,window)})})(function(f,c,e){f.when("A","ready").register("socialProofingNexusLogger",function(d){function f(b){var a=c.ue;if(a)try{a.event&&a.event(b,b.producerId,b.schemaId)}catch(d){a.count("NexusLoggerFailure",1)}}var a={};return{createEvent:function(b){a.producerId=b.producerId;
a.schemaId=b.schemaId;a.pageAsin=b.pageAsin;a.pageType=b.pageType;a.subPageType=b.subPageType;a.merchantId=b.merchantId;a.remoteAddress=b.remoteAddress;a.isInternal=b.isInternal?1:0;a.isRobot=b.isRobot?1:0;a.server=c?c.ue_sn:""},logNexusEvent:function(b,c){if(0!==Object.keys(a).length){var e=JSON.parse(JSON.stringify(a));e.refMarker=b;d.objectIsEmpty(c)||Object.keys(c).forEach(function(a){e[a]=c[a]});f(e)}}}})});
/* ******** */
(function(a){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,b=e?e("DetailPageSocialProofingAssets@badges","DetailPageSocialProofing"):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,e){a.when("A","socialProofingConstants","ready").register("socialProofingBadgeUtil",function(b,d){return{isSocialProofingBadgePresent:function(){return 0<b.$(d.socialProofingBadgeClass).length}}});"use strict";a.declare("socialProofingBadgeMetricConstants",
{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3",pageTypeWebview:"DetailWebview",pageTypeAW:"DetailAW",subPageType:"INAffordability",refMarker:{glanceView:"social_proofing_badge_present"}});"use strict";a.when("A","socialProofingPageState","socialProofingBadgeMetricConstants","socialProofingNexusLogger").register("socialProofingBadgeNexusLogger",function(b,d,a,c){return{createSocialProofingBadgeNexusEvent:function(){c.createEvent({producerId:a.NEXUS_PRODUCER_ID,schemaId:a.NEXUS_SCHEMA_ID,
pageType:d.isMobileApp()?a.pageTypeWebview:a.pageTypeAW,subPageType:a.subPageType,pageAsin:d.getAsin(),merchantId:d.getMerchantId(),remoteAddress:null,isInternal:d.getIsInternal(),isRobot:d.getIsRobot()})},logGlanceViewData:function(){var b=d.getAvailableBadges();b&&c.logNexusEvent(a.refMarker.glanceView,{additionalRequestData:b})},logMetrics:function(a,b){c.logNexusEvent(a,b)}}})});
/* ******** */
(function(a){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,b=e?e("DetailPageSocialProofingAssets@faceouts","DetailPageSocialProofing"):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,e){a.when("A","socialProofingConstants","ready").register("socialProofingFaceoutUtil",function(b,d){return{isSocialProofingFaceoutPresent:function(){return 0<b.$(d.socialProofingFaceoutClass).length}}});"use strict";a.declare("socialProofingFaceoutMetricConstants",
{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3",pageTypeWebview:"DetailWebview",pageTypeAW:"DetailAW",subPageType:"INAffordability",refMarker:{glanceView:"social_proofing_faceout_present"}});"use strict";a.when("A","socialProofingPageState","socialProofingFaceoutMetricConstants","socialProofingNexusLogger").register("socialProofingFaceoutNexusLogger",function(b,d,a,c){return{createSocialProofingFaceoutNexusEvent:function(){c.createEvent({producerId:a.NEXUS_PRODUCER_ID,schemaId:a.NEXUS_SCHEMA_ID,
pageType:d.isMobileApp()?a.pageTypeWebview:a.pageTypeAW,subPageType:a.subPageType,pageAsin:d.getAsin(),merchantId:d.getMerchantId(),remoteAddress:null,isInternal:d.getIsInternal(),isRobot:d.getIsRobot()})},logGlanceViewData:function(){var b=d.getAvailableFaceouts();b&&c.logNexusEvent(a.refMarker.glanceView,{additionalRequestData:b})},logMetrics:function(a,b){c.logNexusEvent(a,b)}}})});
/* ******** */
(function(b){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,c=d?d("DetailPageSocialProofingAssets@desktop","DetailPageSocialProofing"):a;c.guardFatal?c.guardFatal(b)(c,window):c.execute(function(){b(c,window)})})(function(b,a,d){b.when("A","socialProofingPageState","socialProofingBadgeNexusLogger","socialProofingFaceoutNexusLogger","socialProofingBadgeUtil","socialProofingFaceoutUtil","socialProofingUtil","socialProofingConstants","atf","ready").execute(function(c,b,a,e,d,
f,g,h){c.on("a:pageUpdate",function(){d.isSocialProofingBadgePresent()&&(b.reloadPageState(),a.createSocialProofingBadgeNexusEvent(),a.logGlanceViewData());g.triggerWeblabsBySectionId(h.socialProofingBadgeWeblabDivId);f.isSocialProofingFaceoutPresent()&&(b.reloadPageState(),e.createSocialProofingFaceoutNexusEvent(),e.logGlanceViewData())});d.isSocialProofingBadgePresent()&&(a.createSocialProofingBadgeNexusEvent(),a.logGlanceViewData());g.triggerWeblabsBySectionId(h.socialProofingBadgeWeblabDivId);
f.isSocialProofingFaceoutPresent()&&(e.createSocialProofingFaceoutNexusEvent(),e.logGlanceViewData())})});
/* ******** */
(function(e){var c=window.AmazonUIPageJS||window.P,g=c._namespace||c.attributeErrors,d=g?g("DetailPagePaymentOptionsDoDAssets@logger","DetailPagePaymentOptionsDoDAssets"):c;d.guardFatal?d.guardFatal(e)(d,window):d.execute(function(){e(d,window)})})(function(e,c,g){e.when("A","ready").register("paymentOptionsDoDNexusLogger",function(d){function e(b){var a=c.ue;if(a)try{a.event&&a.event(b,b.producerId,b.schemaId)}catch(f){a.count("NexusLoggerFailure",1)}}var a={};return{createEvent:function(b){a.producerId=
b.producerId;a.schemaId=b.schemaId;a.pageAsin=b.pageAsin;a.pageType=b.pageType;a.subPageType=b.subPageType;a.merchantId=b.merchantId;a.remoteAddress=b.remoteAddress;a.isInternal=b.isInternal?1:0;a.isRobot=b.isRobot?1:0;a.server=c?c.ue_sn:""},logNexusEvent:function(b,c){if(0!==Object.keys(a).length){var f=JSON.parse(JSON.stringify(a));f.refMarker=b;d.objectIsEmpty(c)||Object.keys(c).forEach(function(a){f[a]=c[a]});e(f)}}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPagePaymentOptionsDoDAssets@mobile","DetailPagePaymentOptionsDoDAssets"):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(h){var q=window.AmazonUIPageJS||window.P,x=q._namespace||q.attributeErrors,C=x?x("PhysicalGiftCardsDetailPageAssets",""):q;C.guardFatal?C.guardFatal(h)(C,window):C.execute(function(){h(C,window)})})(function(h,q,x){"use strict";h.when("A","dp-refresh-handler","gc-custom-twister-constants").register("gc-page-refresh-view",function(a,e,f){return function(a){var r=new e({featureName:"giftcard_vgc_custom_twister"});a.registerPassive({viewAttribution:"GiftCards",viewName:"GiftCardCustomTwister"},
{updateView:function(a,c){c=c||{};a===f.METADATA&&c.subType&&c.subType===f.GC_VGC_VGC_REFRESH_PAGE_SUBTYPE&&(r.addParams(c.addParams||{}),r.removeParams(c.removeParams||[]))}})}});"use strict";h.when("A","gc-custom-twister-constants","gc-metrics-util","pgc-util").register("gc-custom-twister-view",function(a,e,f,g){var r=a.$;a=function(a,c){c=c||{};var m=this;this.twisterCore=a;this.tvm=a.tvm;this.twisterUtil=a.util;this.viewMethods=a.registerActive({viewAttribution:"giftcards",viewName:"vgc-desktop-twister-view"},
{updateView:function(a,d){f.incrementCounter("view:variation-change-callback");a===e.VARIATION_CHANGE&&"function"===typeof c.variationChangeUpdateView&&c.variationChangeUpdateView.apply(m,arguments)}})};a.prototype.setVGCCustomAmount=function(a){if(a=a&&a.length&&a[0]){var c={subType:e.GC_VGC_VGC_REFRESH_PAGE_SUBTYPE};a.val===this.getDenomIndexFromMatrixByAmount(e.GC_VGC_DENOMINATION_VALUE)?(c.addParams={},c.addParams[e.GC_VGC_PAGE_REFRESH_PARAM_KEY]=a.gcCustomAmount):c.removeParams=[e.GC_VGC_PAGE_REFRESH_PARAM_KEY];
this.viewMethods.metaData(c)}else f.incrementCounter("view:setVgcCustomAmount:emptyDenomData")};a.prototype.reconcileAsinFromAmount=function(a,c){var m=this.getCurrentDimComboId();if("undefined"!==typeof m&&m.length){var g=this.getValueIndexFromDimComboId(e.GC_VGC_DESIGN_DIMENSION_KEY,m),d=this.getDenomIndexFromMatrixByAmount(a);(d=this.getReconciledDimensionCombo(d,g))?(a=this.createTwisterStateObject(d.denomIndex,d.designIndex,a)||[],this.setVGCCustomAmount(a),c&&this.sendDPStateViewEvent(e.GC_VGC_VARIABLE_DESIGN_VALUE_INDEX,
g),this.viewMethods.dimensionChanged(a)):(f.incrementCounter("view:amount-reconciliation-failed"),e.IS_AUI_DEBUG_ON&&console.error("No reconciled dimension combination with given currentDimCombo "+m+" and amount "+a))}};a.prototype.getCurrentDimComboId=function(){var a=this.twisterCore.state();try{return a[e.GC_VGC_VARIABLE_DENOM_VALUE_INDEX].val+"_"+a[e.GC_VGC_VARIABLE_DESIGN_VALUE_INDEX].val}catch(c){f.incrementCounter("view:getCurrentDimComboId:error"),e.IS_AUI_DEBUG_ON&&console.error("Exception caught in GCCustomTwisterView: "+
c)}};a.prototype.getValueIndexFromDimComboId=function(a,c){if(a&&c&&(c=c.split("_"),a=a===e.GC_VGC_DENOMINATION_DIMENSION_KEY?0:1,2<=c.length))return c[a]};a.prototype.reconcileAsinFromDesign=function(a,c,m){f.incrementCounter("view:design-swatch-selection");var u=this.getCurrentDimComboId();if("undefined"!==typeof u&&u.length){var d=this.getValueIndexFromDimComboId(e.GC_VGC_DENOMINATION_DIMENSION_KEY,u),b=this.getReconciledDimensionCombo(d,a);b?("undefined"===typeof c&&b.denomIndex===this.getDenomIndexFromMatrixByAmount(e.GC_VGC_DENOMINATION_VALUE)&&
(c=g.toInteger(this.getDenomValue(d))),c=this.createTwisterStateObject(b.denomIndex,b.designIndex,c)||[],this.setVGCCustomAmount(c),m&&this.sendDPStateViewEvent(e.GC_VGC_VARIABLE_DESIGN_VALUE_INDEX,a),this.viewMethods.dimensionChanged(c)):(f.incrementCounter("view:design-reconciliation-failed"),e.IS_AUI_DEBUG_ON&&console.error("No reconciled dimension combination with given currentDimCombo "+u+", designValueIndex "+a+", currentAmount "+c))}};a.prototype.sendDPStateViewEvent=function(a,c){this.viewMethods.metaData({subType:e.DP_STATE_VIEW_SUBTYPE,
eventType:e.EVENT_TYPE_CLICK,divMetadata:{dimIndex:g.toInteger(a),dimValueIndex:c},currDimCombId:this.getCurrentDimComboId(),dimensionsMap:[e.GC_VGC_DENOMINATION_DIMENSION_KEY,e.GC_VGC_DESIGN_DIMENSION_KEY]})};a.prototype.getReconciledDimensionCombo=function(a,c){if("undefined"!==typeof c){if(this.tvm.exists(this.createTwisterStateObject(a,c)))return{denomIndex:a.toString(),designIndex:c.toString()};if(c)return{denomIndex:this.getDenomIndexFromMatrixByAmount(e.GC_VGC_DENOMINATION_VALUE),designIndex:c.toString()}}};
a.prototype.createTwisterStateObject=function(a,c,m){var g={dimKey:e.GC_VGC_DENOMINATION_DIMENSION_KEY,val:a};c={dimKey:e.GC_VGC_DESIGN_DIMENSION_KEY,val:c};a===this.getDenomIndexFromMatrixByAmount(e.GC_VGC_DENOMINATION_VALUE)&&m&&(g.gcCustomAmount=m);return[g,c]};a.prototype.getDenomIndexFromMatrixByAmount=function(a){return r.inArray(a.toString(),this.tvm.dimtoValueMap[e.GC_VGC_DENOMINATION_DIMENSION_KEY]).toString()};a.prototype.getDimValue=function(a,c){try{return this.tvm.dimtoValueMap[a][c]}catch(m){f.incrementCounter("view:getDimValue:error"),
e.IS_AUI_DEBUG_ON&&console.error("Exception caught in GCCustomTwisterView: "+m)}};a.prototype.getDenomValue=function(a){return this.getDimValue(e.GC_VGC_DENOMINATION_DIMENSION_KEY,a)};a.prototype.getDesignValue=function(a){return this.getDimValue(e.GC_VGC_DESIGN_DIMENSION_KEY,a)};return a});"use strict";h.when("twister-dispatcher","twister-view-controller","gc-custom-twister-constants","gc-metrics-util","gc-twister-refresh-util").register("gc-custom-twister-store",function(a,e,f,g,r){function k(c,
e){var g=this;this.twisterCore=c;this.gcCustomAmount=e;this.storeMethods=a.registerStore("gc-custom-twister-state-machine",function(){g.dispatcherHandler.apply(g,arguments)})}k.prototype.getCustomAmountFromDimsel=function(a){try{var e=+a.selInfo[0].gcCustomAmount;if("number"===typeof e&&!isNaN(e))return e}catch(k){g.incrementCounter("store:getCustomAmountFromDimsel:error"),f.IS_AUI_DEBUG_ON&&console.error("Exception caught in GCCustomTwisterStore: "+k)}};k.prototype.getCustomAmount=function(){return this.gcCustomAmount};
k.prototype.setCustomAmount=function(a){this.gcCustomAmount=a};k.prototype.dispatcherHandler=function(a,m){var k=this.twisterCore.tsm,d=this.twisterCore.util;a===f.VARIATION_CHANGE&&(a=d.createSelectionInfo(m),k=k.currentState(),a=this.getCustomAmountFromDimsel(a),(m=parseFloat(this.getCustomAmount()))&&a&&m!==a&&(e.publishView(f.VARIATION_CHANGE,k),g.incrementCounter("store:triggered-custom-amount-variation-change")),a&&a!==m&&r.updateGpoQueryParam(a),this.setCustomAmount(a))};return k});"use strict";
h.when("A").register("gc-custom-twister-constants",function(a,e){return{VARIATION_CHANGE:"VARIATION_CHANGE",VARIATION_PEEK:"VARIATION_PEEK",METADATA:"METADATA",GC_VGC_DENOMINATION_DIMENSION_KEY:"denomination",GC_VGC_DESIGN_DIMENSION_KEY:"design_name",GC_VGC_DENOMINATION_VALUE:"0",GC_VGC_VARIABLE_DENOM_VALUE_INDEX:"0",GC_VGC_VARIABLE_DESIGN_VALUE_INDEX:"1",GC_VGC_VGC_REFRESH_PAGE_SUBTYPE:"VGC_REFRESH_PAGE_SUBTYPE",GC_VGC_STRING_IN_STOCK:"In Stock",GC_VGC_PAGE_REFRESH_PARAM_KEY:"gpo",GC_VGC_CLIENT_ID:"GiftCardCustomTwister",
DP_STATE_VIEW_SUBTYPE:"DETAILPAGE_STATE_VIEW_METADATA",PRODUCTIZED_TWISTER_METADATA:"PRODUCTIZED_VIEW_METADATA",EVENT_TYPE_CLICK:"click",GC_VISIBILITY_HIDDEN:"HIDDEN",GC_VISIBILITY_SHOWN:"SHOWN",GC_VISIBILITY_VGC_NO_STOCK:"VGC_OUT_OF_STOCK",AUI_HIDDEN_ELEMENT_CLASS:"aok-hidden",GC_VGC_OCCASION_DIMENSION_KEY:"occasion_type",TREATMENT_T2:"T2",TREATMENT_T3:"T3",BOTTOM_SHEET_ROW_ITEM_CLASS:"customBottomSheet-row-item",GC_OCCASION_STRING_ID:"gc-physical-occasion-filter-label",GC_OCCASION_DEFAULT_STRING:"Occasion",
GC_VALUE_INDEX_UNDEFINED_RESULT:"vgc::gcCustomBottomSheet::valueIndex::undefinedResult",BS_FIRST_DESIGN_CLASS:"customBottomSheet-first-shown-design",BS_LAST_DESIGN_CLASS:"customBottomSheet-last-shown-design",IS_AUI_DEBUG_ON:"boolean"!==x&&!1}});"use strict";var C;h.when("gc-metrics-util","gc-execute","ready").execute("gc-dependency-checker-timeout",function(a){C=setTimeout(function(){a.incrementCounter("setup:dependencies-timeout")},2E3)});h.when("A","gc-execute","a-popover-base","gc-page-refresh-view",
"gc-custom-twister-view","gc-custom-twister-store","gc-custom-twister-constants","desktop-twister","pgc-formatter","gc-metrics-util","gc-twister-refresh-util","detail-page-state-controller-view","twisterModule").execute("gc-custom-twister-view-controller",function(a,e,f,g,r,k,c,m,u,d,b,p){function y(a){a=h.format(a);z.amountDimensionText.text(a);z.twisterSwatchButtonText.text(a)}function n(a,b){b.length&&b.each(function(b,d){b=l.getDesignValue(t(w(d)));0<=w.inArray(b,a)?E[b]===c.GC_VISIBILITY_HIDDEN&&
(w(d).removeClass(c.AUI_HIDDEN_ELEMENT_CLASS),E[b]=c.GC_VISIBILITY_SHOWN):E[b]===c.GC_VISIBILITY_SHOWN&&(w(d).addClass(c.AUI_HIDDEN_ELEMENT_CLASS),E[b]=c.GC_VISIBILITY_HIDDEN)})}function t(b){b=b.attr("id");var a=b.lastIndexOf("_");return b.substr(a+1)}function D(b){var a;b.length&&b.each(function(b,d){b=t(w(d));d=l.getDesignValue(b);if(E[d]===c.GC_VISIBILITY_SHOWN)return a=b,!1});return a}clearTimeout(C);var w=a.$,h=u.getLocalizedFormatter("currency"),z={amountDimensionText:w("#gc-amount-dimension"),
twisterSwatchButtonText:w("#gc-twister-swatch-button-list .gc-twister-swatch-button .twisterSlotDiv .a-size-mini"),designNameLabelParent:w("#variation_"+c.GC_VGC_DESIGN_DIMENSION_KEY),vgcSwatches:w("#vgc_swatches"),occasionFilterDropdown:w("#gc_dropdown_selected_occasion_type")},I=a.state("gc-occasion-to-designs-map")||{},E=a.state("gc-design-visibility-map")||{},v=!!(a.state("gc-custom-twister-attributes")||{}).isOccasionFilterEnabled,H=q.twisterController,A,l,G;a.declarative("gc-select-design-swatch",
"click",function(b){b=b.$currentTarget.find("li").attr("id");var a=b.lastIndexOf("_");b=b.substr(a+1);l.reconcileAsinFromDesign(b,A.getCustomAmount(),!0)});a.declarative("gc-select-design-swatch-tablet","click",function(b){l.reconcileAsinFromDesign(b.data.dimValueIndex,A.getCustomAmount(),!0)});a.on("a:dropdown:selected:gc_dropdown_selected_design_name",function(b){if(typeof b!==x&&typeof b.value!==x&&b.value.length)try{var a=b.value.split(",")[0];l.reconcileAsinFromDesign(a,A.getCustomAmount(),!0)}catch(D){d.incrementCounter("view-controller:gc_dropdown_selected_design_name:error"),
c.IS_AUI_DEBUG_ON&&console.error("Exception caught in GCCustomTwisterViewController: "+D)}});a.on("gc:validate:amount:success",function(b){l.reconcileAsinFromAmount(b,!0);y(b)});a.on("TwisterRefresh:Success",function(){d.incrementCounter("view-controller:twister-refresh-handler-triggered");b.isPriceOverrideMatch(l.getCurrentDimComboId())?d.incrementCounter("view-controller:buyboxGcPriceOverrideMatch:success"):d.incrementCounter("view-controller:buyboxGcPriceOverrideMatch:error")});a.on("a:dropdown:selected:gc_dropdown_selected_occasion_type",
function(b){if(typeof b!==x&&typeof b.value!==x&&b.value.length){d.incrementCounter("vgc:customtwister:controller:gc_dropdown_selected_occasion_type:invoke");b=b.value;var a=document.createElement("div");a.innerHTML=b;b=a.textContent;if(b===G)return;var a=I[b]||[],F=z.vgcSwatches.find("li");n(a,F);a=D(F);a===x||null===a||isNaN(a)?d.incrementCounter("view-controller:reconcileAsinFromSwatchUpdate:error"):l.reconcileAsinFromDesign(a,A.getCustomAmount(),!0);G=b}d.incrementCounter("vgc:customtwister:controller:gc_dropdown_selected_occasion_type:no_data")});
(function(){H&&H.detailPageStateControllerView||new p(H.twisterJSInitData,m);v&&(G=z.occasionFilterDropdown.data("initialOccasionType"));A=new k(m,w("#gc-initial-vgc-amount").val());y(A.getCustomAmount());new g(m);l=new r(m,{variationChangeUpdateView:function(b,a){b=a.selected().dimSelectionMap[c.GC_VGC_DESIGN_DIMENSION_KEY];a=this.getDesignValue(b);z.designNameLabelParent.find(".selection").text(a);z.vgcSwatches.find(".swatchSelect").removeClass("swatchSelect").addClass("swatchAvailable");z.vgcSwatches.find("#"+
c.GC_VGC_DESIGN_DIMENSION_KEY+"_"+b).addClass("swatchSelect").removeClass("swatchAvailable")}})})()});"use strict";h.when("A","gc-execute","ready").register("gc-validation-utils",function(a,e){a=a.$;var f=a("#gc-order-form-custom-amount");return{KEYDOWN_TIMEOUT:500,disableBuyBoxOptions:{triggerPopoverOnId:"gc-disable-atc",triggerPosition:"triggerLeft"},showPopover:!0,addInputErrorHighlighting:function(){f.addClass("gc-input-error")},removeInputErrorHighlighting:function(){f.removeClass("gc-input-error")}}});
"use strict";h.when("A").execute(function(a){var e=a.$("#giftcardcustomtwister_feature_div");a=a.$("#gc-order-form-custom-amount");e.length&&a.length&&h.declare("gc-execute")});"use strict";h.when("A","gc-execute").execute(function(a){var e=a.$("#gc-custom-twister-button-sheet");a=a.$("#gc_variation_occasion_type");(e.length||a.length)&&h.declare("gc-occasion-filter-execute")});"use strict";h.when("A","gc-execute","vgc-validation","gc-validation-utils","gc-metrics-util","ready").execute(function(a,
e,f,g,r){var k=a.$,c,m=g.KEYDOWN_TIMEOUT,u=k("#gc-amount-picker"),d=k("#gc-order-form-custom-amount"),b=k("#gc-order-form-amount");k("#gc-custom-amout-currency-symbol");var p=function(a){var d=f.parseCustomInputAmount(a);""!==a&&b.val(d).trigger("change")};d.val()&&p(d.val());u&&r.incrementCounter("amount-picker:amount-swatches-container-displayed");d.parent().hasClass("aok-hidden")&&r.incrementCounter("amount-picker:vgc-custom-amount-input-hidden");d.focus(function(){u.find(".a-button-selected").removeClass("a-button-selected a-button-focus")});
d.keydown(function(b){var a=this;clearTimeout(c);c=setTimeout(function(){var b=k(a).val();p(b)},m)});d.blur(function(){var a=k(this).val(),a=f.parseCustomInputAmount(a);""===a&&b.val(a).trigger("change")});a.declarative("gc-select-amount-swatch","click",function(a){a.$event.preventDefault();var c=a.$target.data("value");if(c===x||null===c||isNaN(c))c=a.$target.val();b.val(c).trigger("change");d.val("");r.incrementCounter("amount-picker:amount-swatch-selection")})});"use strict";h.when("A","gc-execute",
"pgc-util","gc-validation-utils","pgc-string","a-popover","gc-metrics-util","ready").register("vgc-validation",function(a,e,f,g,r,k,c){function m(b,a){n.$amountWrapper.find(".gc-inline-error").remove();g.removeInputErrorHighlighting()}function u(){var a=b("#buybox");a.addClass("gc-buybox");a.append('\x3cdiv id\x3d"gc-disable-atc"\x3e\x3c/div\x3e');a.delegate("#gc-disable-atc","click mouseover",function(a){a.preventDefault();g.showPopover?(a=b("#"+g.disableBuyBoxOptions.triggerPopoverOnId),p=k.create(a,
{inlineContent:'Select or input a valid \x3cstrong style\x3d"color:#e8281e"\x3eAmount\x3c/strong\x3e to add to Shopping Cart',width:200,position:g.disableBuyBoxOptions.triggerPosition,closeButton:!1})):(f.scrollToElement(n.$customAmount,!0,50),n.$customAmount.trigger("click"))})}function d(b){var a=y&&y.decimalSeparator||".",d=(b+"").split(a);b=d[0]||"";var d=d[1]||"",e=y.defaultFractionalDigits!==x?y.defaultFractionalDigits:2;0<e&&0<d.length?b=b+a+d.substring(0,e):0<d.length&&c.incrementCounter("amount-picker:validation:fractional-truncated");
return b}var b=a.$,p,y=a.state("gc-formatter-config"),n={$customAmount:b("#gc-order-form-custom-amount"),$amountField:b("#gc-order-form-amount"),$amountWrapper:b("#gc-variable-amount-wrapper"),$amountDimensionText:b("#gc-amount-dimension")},t=b("#gc-tmpl-inline-error").html();b("#gc-tmpl-atc-error").html();a.on("gc:validate:success",function(D,e,g){if(null!==D){var t=n.$customAmount.val(),t=d(t);""!==n.$customAmount.val()&&n.$customAmount.val(t);"AmazonRetailLineItem.amount"===e&&a.trigger("gc:validate:amount:success",
g);m(D,e);b("#buybox").removeClass("gc-buybox");b("#gc-disable-atc").remove();k.remove(p);c.incrementCounter("amount-picker:validation:success")}});a.on("gc:validate:failure",function(a,d,e,p){null!==a&&(m(a,d),a=b(f.parseTemplate(t,{message:p[0]})),d&&a.attr("gc-field",d),g.addInputErrorHighlighting(),n.$amountWrapper.append(a),n.$amountDimensionText.text(""),u(),c.incrementCounter("amount-picker:validation:failure"))});return{parseCustomInputAmount:d}});"use strict";h.when("A","gc-execute").execute(function(a){a=
a.$;a("#twister").delegate("input","keyup keypress",function(a){if(13===a.keyCode)return a.preventDefault(),!1})});"use strict";h.when("A","gc-custom-twister-constants","gc-metrics-util","gc-occasion-filter-execute","ready").register("gc-occasion-filter-utils",function(a,e,f){function g(a,c,d){q.ueLogError&&q.ueLogError(a,{logLevel:"ERROR",attribution:d,message:c})}var r=a.$,k=a.state("gc-design-to-occasions-map")||{},c=a.state("gc-design-visibility-map")||{};return{getValueIndexFromDOM:function(a){a=
a.attr("id");var c=a.lastIndexOf("_");return a.substr(c+1)},getFirstShownDesignValueIndex:function(a){var g=void 0;r.each(a,function(a,b){if(c[b]===e.GC_VISIBILITY_SHOWN)return g=a,!1});return g},updateImageSwatchOnOccasionSelection:function(a,g,d){g=a[g];r.each(a[d],function(a,d){a=d.designName;d.designDom.addClass(e.AUI_HIDDEN_ELEMENT_CLASS);c[a]=e.GC_VISIBILITY_HIDDEN});r.each(g,function(a,d){a=d.designName;d.designDom.removeClass(e.AUI_HIDDEN_ELEMENT_CLASS);c[a]=e.GC_VISIBILITY_SHOWN})},hideDesignOnBottomSheetDesignRowCreation:function(a,
g){a=a.find("."+e.BOTTOM_SHEET_ROW_ITEM_CLASS);a.each(function(a){var b=r(this);a=g.getDesignValue(a);c[a]!==e.GC_VISIBILITY_SHOWN&&b.addClass(e.AUI_HIDDEN_ELEMENT_CLASS)});a=a.not("."+e.AUI_HIDDEN_ELEMENT_CLASS);a.first().addClass(e.BS_FIRST_DESIGN_CLASS);a.last().addClass(e.BS_LAST_DESIGN_CLASS)},validateValueIndex:function(a,c,d){return null===a||isNaN(a)?(f.incrementCounter(c),e.IS_AUI_DEBUG_ON&&console.error("gcCustomBottomSheet: "+d+". Validated value index: "+a+"."),!1):!0},isInStockDesign:function(a){return a in
c&&c[a]!==e.GC_VISIBILITY_VGC_NO_STOCK},logJsFatalException:function(a,c,d){q.ueLogError&&q.ueLogError(a,{logLevel:"FATAL",attribution:d,message:c})},logJsErrorException:g,getOccasionListByDesignName:function(a){var c=k[a];if(c&&c.length)return c;g(null,"gc custom bottom sheet failed to fetch occasion list for design name: "+a+", designToOccasionMap: "+k,"gcCustomBottomSheet");return[]}}});h.when("A","pgc-util","gc-twister-url-util","gc-custom-twister-constants","gc-execute").register("gc-twister-refresh-util",
function(a,e,f,g){var r=a.$;return{updateGpoQueryParam:function(a){var c=void 0;f.isUrlChangeable()&&(0<f.getCurrentUrlSearch().length?(c=e.parseQueryArguments(f.getCurrentUrl()),c.gpo=a,c=f.getOriginalPathName()+"?"+r.param(c)):c=f.getCurrentUrl()+"?"+g.GC_VGC_PAGE_REFRESH_PARAM_KEY+"\x3d"+a,f.changeUrl(c));return c},removeGpoQueryParam:function(){var a=void 0;f.isUrlChangeable()&&(0<f.getCurrentUrlSearch().length&&(a=e.parseQueryArguments(f.getCurrentUrl()),delete a[g.GC_VGC_PAGE_REFRESH_PARAM_KEY],
a=f.getOriginalPathName()+"?"+r.param(a)),f.changeUrl(a));return a},getGpoQueryParamValue:function(){var a=f.getCurrentUrlParameter(g.GC_VGC_PAGE_REFRESH_PARAM_KEY),c=r("#gcPriceOverride").val();return a&&a===c?a:""},isPriceOverrideMatch:function(a){var c=!0;if("undefined"!==typeof a&&a.length&&a.split("_")[0]===g.GC_VGC_DENOMINATION_VALUE){a=f.getCurrentUrlParameter(g.GC_VGC_PAGE_REFRESH_PARAM_KEY);var e=r("#gcPriceOverride").val();a&&(c=e===a)}return c}}});h.when("gc-execute").register("gc-twister-url-util",
function(){return{isUrlChangeable:function(){return q.history&&q.history.pushState},changeUrl:function(a){q.history.pushState({},document.title,a)},getCurrentUrl:function(){return q.location.href},getOriginalPathName:function(){return q.location.origin+q.location.pathname},getCurrentUrlSearch:function(){return q.location.search},getCurrentUrlParameter:function(a){return(new URLSearchParams(q.location.search)).get(a)}}});"use strict";h.when("A","ready").register("gc-metrics-util",function(a){function e(){return q.uet&&
"function"===typeof q.uet}var f={};return{incrementCounter:function(a){q.ue&&"function"===typeof q.ue.count&&(a="pgc-dp:"+a,q.ue.count(a,(q.ue.count(a)||0)+1))},stopWidgetTimer:function(a){e()&&f.hasOwnProperty(a)&&(delete f[a],q.uet("be",a,{wb:1}),q.uex("ld",a,{wb:1}))},startWidgetTimer:function(a){e()&&!f.hasOwnProperty(a)&&(f[a]=1,q.uet("bb",a,{wb:1}))}}});"use strict";h.when("A","pgc-util","ready").register("pgc-formatter",function(a,e){function f(a,b){if(-1===a.indexOf(b))return a;a=a.split(b);
return a.slice(0,-1).join("")+b+a.slice(-1)}function g(c,n,g){var t=b.CURRENCY_SIGN,p=b.GROUPING_SEPARATOR,k=b.DECIMAL_SEPARATOR,v=b.DIGIT_OPTIONAL,r=b.DIGIT_REQUIRED,m=n.split(b.SUBPATTERN_SEPARATOR);n=m[0];m=m[1]||"-"+n;n=0>c?m:n;var m=-1!==n.indexOf(t),l=/([,\.#0]+)/.exec(n)[1],l=f(l,p),l=f(l,k),k=l.split(k),l=k[0],k=k[1]||"",h=l.lastIndexOf(p),q=Infinity;-1!==h&&(q=l.length-1-h);l=l.replace(p,"");c=Math.abs(c);d.performRounding&&(c=e.round(c,k.length,"half_even"));c=(c+"").split(".");var u=c[0];
c=c[1]||"";c=e.toFixedLength(c,k.length,"0","right");h=Math.max(l.length,u.length);u=e.toFixedLength(u,h," ","left");l=e.toFixedLength(l,h,"#","left");p="";for(--h;0<=h;h--){var F=u.charAt(h),B=l.charAt(h);B===v?" "!==F&&(p=F+p):B===r&&(p=" "===F?"0"+p:F+p)}if(Infinity!==q&&0<q){l=p;p=d.groupingSeperator;h=[];for(B=q;l.length;){h.length&&h.unshift(p);if(l.length<=B){h.unshift(l);break}h.unshift(l.substr(l.length-B,B));l=l.substr(0,l.length-B);-1<y.indexOf("_IN")&&(B=q-1)}p=h.join("")}if(""!==c&&""!==
k){l="";q=!1;for(h=k.length-1;0<=h;h--)if(u=c.charAt(h),B=k.charAt(h),B===v){if(q||"0"!==u)q=!0,l=u+l}else B===r&&(l=u+l);""!==l&&(p=p+(m?d.currencyDecimalSeparator:d.decimalSeparator)+l)}v=n.replace(/[,\.#0]+/,p);v=v.replace(t,g?"":d.currencySymbol);return a.trim(v)}function r(a,b){if("number"===typeof a)return!1;b=b?d.currencyDecimalSeparator:d.decimalSeparator;a=""+a;if(-1!==a.indexOf(d.currencySymbol)||-1!==a.indexOf(b)&&-1!==a.indexOf(d.groupingSeperator))return!0;if(-1!==a.indexOf(d.groupingSeperator)){if(a=
a.split(d.groupingSeperator),2<a.length||2<a[1].length)return!0}else if(-1!==a.indexOf(b)&&(a=a.split(b),1===a.length))return!0;return!1}function k(a,b){b=b?d.currencyDecimalSeparator:d.decimalSeparator;return""!==b&&(b=b.replace(/\./g,"\\."),b=a.match(new RegExp("^(.*)"+b+"([^"+b+"]*)$")),null!==b)?b.slice(1):[a,""]}function c(a,b){return r(a)||isNaN(a)?(b=k(""+a,b),a=b[0],b=b[1]||"00",a=e.filterNumeric(a),b=e.filterNumeric(b),e.toDecimal(a+"."+b)):Number(a)}function m(a){t.hasOwnProperty(a)||h.error('No formatter with the name: "'+
a+'" for locale: '+y,"pgc-formatter","getLocalizedFormatter");return t[a]}var q=a.state("gc-formatter-config"),d={locale:"en_US",currencySymbol:"$",currencyDecimalSeparator:".",decimalSeparator:".",groupingSeperator:",",dateShortPattern:"M/d/yy",currencyPattern:"¤#,##0.00;(¤#,##0.00)",decimalPattern:"#,##0.###",performRounding:!0},b={CURRENCY_SIGN:"¤",GROUPING_SEPARATOR:",",DECIMAL_SEPARATOR:".",DIGIT_OPTIONAL:"#",DIGIT_REQUIRED:"0",SUBPATTERN_SEPARATOR:";",MONTH_REPLACE_SEPARATOR:"¤"},p=a.$;"object"===
typeof q&&p.extend(d,q);var y=d.locale,n=function(){var b=function(){function b(d){return a.trim(""+d)}return{interpret:b,format:function(a){return b(a)}}}(),d=function(){function a(b){return e.toInteger(e.filterNumeric(""+b))}return{interpret:a,format:function(b){return""+a(b)}}}();return{message:b,integer:d}}(),t=function(){var a=function(){function a(b){return c(b,!1)}return{interpret:a,format:function(b){b=a(b);return g(b,d.decimalPattern)}}}(),n=function(){function a(b){b=b.trim();if(!(new RegExp("^((\\d{1,3})(\\"+
d.groupingSeperator+"\\d{3})+|\\d+)?(\\"+d.decimalSeparator+"\\d{0,2})?$")).test(b))throw"gcui-strict-amount-input-errors";b=b.split(d.groupingSeperator).join("");b=k(""+b,!1);return Number(b[0]+"."+(b[1]||"00"))}return{interpret:a,format:function(b){b=a(b);return g(b,d.currencyPattern,!0)}}}(),p=function(){function a(b){return c(b,!1)}return{interpret:a,format:function(b){b=a(b);return g(b,d.currencyPattern,!0)}}}(),t=function(){function a(b){return c(b,!0)}return{interpret:a,format:function(b){b=
a(b);return g(b,d.currencyPattern)}}}(),f=function(){function a(b,c){var n=null;if(b&&"function"===typeof b.getMonth)n=b;else if(b===e.toInteger(b))n=new Date(e.toInteger(b));else if("string"===typeof b)if(c=c||d.dateShortPattern,c=c.split(/[^A-Za-z]+/),b=b.split(/[^0-9]+/),3!==b.length)n=null;else{for(var p,t,g,n=0;3>n;n++)switch(c[n]){case "yy":p=e.toInteger(b[n]);p=(60>=p?2E3:1900)+p;break;case "yyyy":p=e.toInteger(b[n]);break;case "MONTH":case "M":case "MM":t=e.toInteger(b[n])-1;break;case "d":case "dd":g=
e.toInteger(b[n])}n=new Date(p,t,g,0,0,0)}return n}return{interpret:a,format:function(c,n,p){c=a(c,n);n="";if(c){n=c.getFullYear();var t=c.getMonth()+1;c=c.getDate();n=(p?p:d.dateShortPattern).replace("yyyy",n).replace("yy",(""+n).substr(2,2)).replace("MONTH",b.MONTH_REPLACE_SEPARATOR+t+b.MONTH_REPLACE_SEPARATOR).replace("MM",e.toFixedLength(t,2,"0")).replace("M",t).replace("dd",e.toFixedLength(c,2,"0")).replace("d",c)}return n},monthSeparator:b.MONTH_REPLACE_SEPARATOR}}();return{decimal:a,amount:p,
currency:t,date:f,strictAmount:n}}();return{interpolateMessage:function(a,b){return a.replace(/\{([^{}]+)\}/g,function(a,d){var c=d.split(","),e=c[0];a=c[1];c=c[2];e="object"===typeof b?b[e]:b;if("number"===a)switch(c){case "integer":e=n.integer.format(e);break;case "currency":e=t.currency.format(e);break;case "percent":break;default:e=t.decimal.format(e)}else"date"===a&&(e="short"===c?t.date.format(e,d.dateShortPattern):t.date.format(e,c));return e})},getLocalizedFormatter:m,getFormatter:function(b){if(a.contains(b,
"locale:"))return m(b.split(":")[1]);n.hasOwnProperty(b)||h.error("No formatter with the name: "+b,"pgc-formatter","getFormatter");return n[b]},getLocale:function(){return d.locale},prettifyClaimCode:function(a){return 14>a.length?a:a.replace(/^(.{4})(.{6})(.+)?$/,"$1-$2-$3")}}});"use strict";h.when("A","pgc-formatter").register("pgc-string",function(a,e){function f(e){var f=a.state("gc-strings")||{};f.hasOwnProperty(e)||h.error("String does not exist: "+e,"pgc-string","getString");return f[e]}return{getStrings:function(e){for(var f=
a.state("gc-strings")||{},k={},c=0;c<e.length;c++){var m=e[c];f.hasOwnProperty(m)||h.error("String does not exist: "+m,"pgc-string","getStrings");k[m]=f[m]}return k},getString:f,addStrings:function(e){var f={};a.each(e,function(a,c){""===c&&h.error("String cannot be blank: "+a,"pgc-string","addStrings");f[a]=c});a.state("gc-strings",f)},addString:function(e,f){var k={};""===f&&h.error("String cannot be blank: "+f,"pgc-string","addString");k[e]=f;a.state("gc-strings",k)},getInterpolatedString:function(a,
h){return e.interpolateMessage(f(a),h)}}});"use strict";h.when("A").register("pgc-util",function(a){var e=a.$,f={keyCodes:{alt:18,backspace:8,ctrl:17,del:46,end:35,enter:13,escape:27,home:36,shift:16,tab:9,num_zero:48,num_nine:57,numpad_zero:96,numpad_nine:105,A:65,Z:90,arrow_left:37,arrow_up:38,arrow_right:39,arrow_down:40}},g=function(){function a(b){return isNaN(b)?0:Number(b)}function d(a,b){a=((a+"").split(".")[1]||"").length;b=((b+"").split(".")[1]||"").length;return a>b?a:b}function c(a,b,
d){b="number"!==typeof b?2:b;b=0>b?0:b;if(((a+"").split(".")[1]||"").length<b)return a;"string"===typeof d&&(d=d.toLowerCase());b=Math.pow(10,b);a*=b;switch(d){case "down":a=Math.floor(a);break;case "up":a=Math.ceil(a);break;case "half_even":var e=(a+"").split(".");d=e[0];e=e[1];a=5===(e?parseInt(e.charAt(0),10):0)?0===parseInt(d,10)%10%2?Math.floor(a):Math.ceil(a):Math.round(a);break;default:case "half_up":a=Math.round(a)}return a/b}return{add:function(c,e){c=a(c);e=a(e);var f=Math.pow(10,d(c,e));
return(Math.round(c*f)+Math.round(e*f))/f},subtract:function(c,e){c=a(c);e=a(e);var f=Math.pow(10,d(c,e));return(Math.round(c*f)-Math.round(e*f))/f},multiply:function(c,e){c=a(c);e=a(e);var f=Math.pow(10,d(c,e));return Math.round(c*f)*Math.round(e*f)/(f*f)},divide:function(c,e){c=a(c);e=a(e);var f=Math.pow(10,d(c,e));return 1/Math.round(e*f)*Math.round(c*f)},round:c,toDecimal:function(d){d=a(d);return c(100*d,0)/100},toInteger:function(a){return parseInt(a,10)||0}}}(),h=function(){return{arrayMove:function(a,
d,c){var e=a.length;e&&0<=d&&0<=c&&d<e&&c<e&&a.splice(c,0,a.splice(d,1)[0])},arrayIntersection:function(b,d){return!e.isArray(b)||!e.isArray(d)||a.objectIsEmpty(b)||a.objectIsEmpty(d)?[]:e.grep(b,function(a){return null===a?!1:-1<e.inArray(a,d)})}}}(),k=function(){return{parseTemplate:function(a,d){return a.replace(/\{([\w\.]*)\}/g,function(a,b){a=b.split(".");var c=d[a.shift()];if("undefined"===typeof c)return"";for(b=0;b<a.length;b++)if(c=c[a[b]],"undefined"===typeof c||null===c)return"";return c})},
filterNumeric:function(a){a=a.replace(/[^0-9\-]/g,"").replace(/(?!^)\-/g,"");return"-"===a?"":a},interpretString:function(b){return"boolean"===typeof b||"number"===typeof b||""===a.trim(b)?b:isNaN(b)?"true"===b||"false"===b?"true"===b:b:Number(b)},parseQueryArguments:function(a,c){var d={};if("string"!==typeof a)return d;var e=a.split("?");a=/&?([^=]+?)=([^&#]*)/g;if(2!==e.length)return d;for(var e=e[1],f,g;null!==(f=a.exec(e));)g=f[2],d[f[1]]=c?decodeURIComponent(g):g;return d},toFixedLength:function(a,
d,c,e){a+="";if(a.length>d)return a.substr(0,d);a.length<d&&(d=Array(d-a.length+1).join(c),a="right"===e?a+d:d+a);return a},extractFileNameFromFilePath:function(a){return a&&"string"===typeof a?a.replace(/^.*[\\\/]/,""):""}}}(),c=function(){return{renameProperty:function(a,d,c){if(!a.hasOwnProperty(d)||null===a[d])return!1;if(d===c)return!0;a[c]=a[d];delete a[d];return!0}}}(),m=function(){function a(b){return b.replace(d,".")}var d=/\._(.+)_\./g,c=/(.+?)\._(.+)_\.(.+)/,e=/(.+?)\.(jpg|png|gif|jpeg|bmp|ugc)(\?.*)?$/;
return{clearStyleCode:a,addStyleCode:function(d,f,g){if(!d)return"";if(!f)return d;g&&!c.test(d)&&(g=!1);g?"_"===f.charAt(0)&&(f=f.substr(1)):(d=a(d),f="."+f);return d.replace(e,"$1"+f+".$2$3")}}}(),q=function(){return{moveElToFront:function(a){0<a.index()&&a.parent().prepend(a)},toggleElements:function(a,d){return a&&a.length&&d&&d.length?(d.hide(),a.show(),!0):!1},scrollToElement:function(a,d,c){if(a.length){var f=e("html, body");a=a.offset().top-g.toInteger(c);d?f.animate({scrollTop:a},400):f.scrollTop(a)}},
pruneChildElements:function(a,d,c){d=g.toInteger(d);a=a.children(c?c:"");a.length<=d||a.slice(d).remove()},addImageStyleDimensions:function(b){var d=b.attr("data-src");if(d&&0===d.indexOf("http")){var c=g.toInteger(b.attr("width")),e=g.toInteger(b.attr("height")),f;a.capabilities.hires&&(c*=2,e*=2);0<c?f="_SX"+c+"_":0<e&&(f="_SY"+e+"_");f&&b.attr("data-src",m.addStyleCode(d,f))}},bindEventAndSuppressKey:function(a,d,c,e,f){if(!a||!d||!c)return!1;a.bind(d,function(a){(a.keyCode||a.which)===c&&(a.preventDefault(),
e&&e(a));f&&f(a)})}}}(),d=function(){return{isNumber:function(a){var d=a.keyCode||(a.$event?a.$event.keyCode:!1)||a;return!(a.shiftKey||a.$event&&a.$event.shiftKey)&&d>=f.keyCodes.num_zero&&d<=f.keyCodes.num_nine||d>=f.keyCodes.numpad_zero&&d<=f.keyCodes.numpad_nine?!0:!1},isArrowKey:function(a){a=a.keyCode||(a.$event?a.$event.keyCode:!1)||a;return a>=f.keyCodes.arrow_left&&a<=f.keyCodes.arrow_down?!0:!1}}}();return{constants:f,add:g.add,subtract:g.subtract,multiply:g.multiply,divide:g.divide,round:g.round,
toDecimal:g.toDecimal,toInteger:g.toInteger,arrayMove:h.arrayMove,arrayIntersection:h.arrayIntersection,parseTemplate:k.parseTemplate,filterNumeric:k.filterNumeric,interpretString:k.interpretString,extractFileNameFromFilePath:k.extractFileNameFromFilePath,renameProperty:c.renameProperty,parseQueryArguments:k.parseQueryArguments,toFixedLength:k.toFixedLength,moveElToFront:q.moveElToFront,toggleElements:q.toggleElements,scrollToElement:q.scrollToElement,pruneChildElements:q.pruneChildElements,addImageStyleDimensions:q.addImageStyleDimensions,
bindEventAndSuppressKey:q.bindEventAndSuppressKey,addImageStyleCode:m.addStyleCode,clearImageStyleCode:m.clearStyleCode,keyCodeIsNumber:d.isNumber,keyCodeIsArrowKey:d.isArrowKey}});"use strict";h.when("A","pgc-util").register("pgc-validations",function(a,e){function f(d,b){return a.contains(d,b)}function g(a){return new RegExp("^"+a+"$","i")}var h=g("[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+(\\.[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+)*"),k=g("(([a-z0-9\\-]+\\.)+([a-z]{2,63}))"),c=g("[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+(\\.[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+)*@(([a-z0-9\\-]+\\.)+([a-z]{2,63}))"),
m=g("[\\s,]*[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+(\\.[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+)*@(([a-z0-9\\-]+\\.)+([a-z]{2,63}))((\\s*,\\s*)+[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+(\\.[\\w!#$%\x26'*+\\/\x3d?\\^_`{|}~\\-]+)*@(([a-z0-9\\-]+\\.)+([a-z]{2,63})))*[\\s,]*"),q=g("([2-9][0-8][0-9])[-. ]?([2-9][0-9]{2})[-. ]?([0-9]{4})");return{notNull:function(a,b){return null!==a&&a!==x},notEmpty:function(a,b){return 0<(""+a).length},lengthAtMost:function(a,b){return(""+a).length<=b},lengthAtLeast:function(a,
b){return(""+a).length>=b},linesAtMost:function(d,b){d=d.split("\n");for(var c=d.length,e=a.state("gc-validator-fields")["AmazonDownloadLineItem.message"][1].constraint,f=0;f<d.length;f++)c+=Math.max(Math.ceil(d[f].length/e),1)-1;return c<=b},linesLengthAtMost:function(a,b){return!0},atLeast:function(a,b){return a>=b},atMost:function(a,b){return a<=b},equal:function(a,b){return a===b},notEqual:function(a,b){return a!==b},contains:f,containsOne:function(a,b){return 2===(""+a).split(b).length},excludes:function(a,
b){return!f(a,b)},isNumeric:function(a,b){return!isNaN(a)},isInteger:function(a,b){return!isNaN(a)&&0===Number(a)%1},isBoolean:function(a,b){return"boolean"===typeof a||"string"===typeof a&&("true"===a||"false"===a)},isOneEmail:function(a,b){return 1===(""+a).split(/[\s,;]+/).length},isPositive:function(a,b){return 0<a},hasEmailLocal:function(a,b){a=(""+a).split("@");return 1>a.length?!1:h.test(a[0])},hasEmailDomain:function(a,b){a=(""+a).split("@");return 2>a.length?!1:k.test(a[1])},isValidEmail:function(a,
b){return c.test(""+a)},isCommaSeparatedEmailList:function(a,b){return m.test(""+a)},dateAtLeast:function(a,b){return a&&b&&a.getTime()>=b.getTime()},dateAtMost:function(a,b){return a&&b&&a.getTime()<=b.getTime()},isValidPhoneNumber:function(a,b){return q.test(""+a)}}});"use strict";h.when("A","pgc-util","pgc-formatter","pgc-string","pgc-validations").register("pgc-validator",function(a,e,f,g,q){function k(b){var c=a.state("gc-validator-fields");c.hasOwnProperty(b)||h.error("No validator field exists with the name: "+
b,"gc-validator","getFieldValidations");return c[b]}function c(a){switch(a){case "DateToday":return a=new Date,a=new Date(a.getFullYear(),a.getMonth(),a.getDate());case "DateNextYear":return a=new Date,a=new Date(a.getFullYear()+1,a.getMonth(),a.getDate())}}function m(b){return a.contains(b,"dynamic:")?(b=b.split(":")[1],c(b)):e.interpretString(b)}function u(a){var b=[];v.each(H,function(c,d){if(a.is(c))return b=d,!1});return b}function d(a){var b={};v.each(A,function(c,d){a.is(c)&&v.extend(b,d)});
return b}function b(a,b){var c=a.parent("div.a-input-text-wrapper");(c.length?c:a).toggleClass("a-form-error",!b)}function p(c,d,k,m,q,n){var l=v.extend({formatter:x,field:x,optional:!1,events:"change",formatEvents:x,addClass:!0,listField:!1},d),p="*"!==k,t=l.formatEvents||l.events;if("undefined"===typeof k||!p||a.contains(l.events,k)){"string"!==typeof l.field&&h.error("Field is required for validation","gc-validator","validateElement");d=c.val();var r=l.field,u=l.optional,w=l.addClass,z=l.formatter;
k=!p||a.contains(t,k);l=l.listField;c.is(":checkbox")&&(d=c.is(":checked"));if((t=""===a.trim(""+d))&&p||t&&u&&!m||q)return a.trigger("gc:validate:ignored",c,r),a.trigger("gc:validate:"+r+":ignored",c,n),w&&b(c,!0),-1;if("string"===typeof z){m=f.getFormatter(z);try{k&&c.val(m.format(d)),d=m.interpret(d)}catch(A){return w=g.getString(A),a.trigger("gc:validate:failure",c,r,d,[w]),a.trigger("gc:validate:"+r+":failure",c,d,[w],n),-1}}else d=e.interpretString(d);l&&(d=d.split(/[ ,\n;]+/));n=y(c,r,d,n,
l);w&&b(c,n);return n?1:0}}function y(b,c,d,f,g){a.trigger("gc:validate:before",b,c,d);a.trigger("gc:validate:"+c+":before",b,d);var h=[],m=k(c);if(l.length&&!e.arrayIntersection(m[0].validationGroups,l).length)return a.trigger("gc:validate:skipped",b,c,d),a.trigger("gc:validate:"+c+":skipped",b,d,f),!0;if(g)for(g=0;g<d.length;g++)n(d[g],m,h);else n(d,m,h);(m=0===h.length)?(a.trigger("gc:validate:success",b,c,d),a.trigger("gc:validate:"+c+":success",b,d,f)):(a.trigger("gc:validate:failure",b,c,d,
h),a.trigger("gc:validate:"+c+":failure",b,d,h,f));return m}function n(a,b,c){for(var d=0;d<b.length;d++){var e=b[d],k=a,l=c,n,p=e.validation;q.hasOwnProperty(p)||h.error("No validation method exists with the name: "+p,"gc-validator","getValidationMethod");n=q[p];p=m(e.constraint);n.call({},k,p)||(e=g.getString(e.errorId),e=f.interpolateMessage(e,p),l.push(e))}}function t(a,b){return D(a,b)}function D(b,c,d,e){var f=b.attr("data-gc-validate");if("string"===typeof f)return f=a.parseJSON(f),p(b,f,"*",
!!c,!!d,e)}function w(a){var b=!0;a.find("[data-gc-validate]").each(function(){b=0!==t(v(this))&&b});return b}function C(b,c){var d={};b.find("[data-gc-validate]").each(function(){var b=v(this),c;c=b.attr("data-gc-validate");"string"!==typeof c?c=null:(c=a.parseJSON(c),c=c.field);d.hasOwnProperty(c)||(d[c]=[]);d[c].push(b)});var e=!0,f=a.parseJSON(b.attr("data-gc-validate-form")||"{}").requireOne||[];v.each(d,function(a,d){var g=-1!==v.inArray(a,f);a:{for(var h=u(b),k=0;k<h.length;k++)if(-1!==a.indexOf(h[k])){a=
!0;break a}a=!1}h=!1;for(k=d.length-1;0<=k;k--){var l=d[k];g?(l=D(l,0===k&&!h,a,c),h=h||1===l,e=0!==l&&e):e=0!==D(l,!1,a,c)&&e}});return e}function z(a,b){return a.is("form")?C(a,b):w(a)}function I(a){a=d(a);var b=!0;v.each(a,function(a,c){c=c.call({});b=y(null,a,c)&&b});return b}function E(a){return function(){if(J)return a.apply(null,arguments);a.apply(null,arguments)}}var v=a.$,H={},A={},l=[],G=!1,J=!1,K=!0;a.declarative("gc-validate-form","submit",function(b){var c=b.$target,d=b.$event,c=c.is("form")?
c:c.closest("form"),e=!0;G&&d.preventDefault();if(K){c.removeAttr("gc-invalid");a.trigger("gc:validate:form:before",c);try{e=(e=z(c)&&e)&&I(c)}catch(f){throw d.preventDefault(),f;}e?a.trigger("gc:validate:form:success",c,d):(c.attr("gc-invalid",""),d.preventDefault(),a.trigger("gc:validate:form:failure",c));a.trigger("gc:validate:form:after",c)}else a.trigger("gc:validate:form:disabled",b)});a.on("gc:validate:form:upload",function(b){var c=!1;b.removeAttr("gc-invalid");a.trigger("gc:validate:form:before",
b);try{c=(c=z(b,!0))&&I(b)}catch(d){throw d;}c?a.trigger("gc:validate:form:success",b):(b.attr("gc-invalid",""),a.trigger("gc:validate:form:failure",b))});a.declarative("gc-validate","click change keydown keyup keypress",function(a){"object"===typeof a.data&&p(a.$target,a.data,a.type,!1,!1)});return{validate:E(t),validateWithin:E(z),validateVirtualField:function(a,b){d(a)[b]||h.error("No virtual field exists: "+b,"gc-validator","validateVirtualField");a=d(a)[b].call({});y(null,b,a)},validateVirtualFields:E(I),
addVirtualField:function(a,b,c){A.hasOwnProperty(a)||(A[a]={});A[a][b]=c},setIgnoredFields:function(a,b){"string"===typeof b&&(b=[b]);H[a]=b},getValidationConstraint:function(a,b){for(var c=k(a),d=0;d<c.length;d++){var e=c[d];if(e.validation===b)return m(e.constraint)}h.error("Field "+a+" has no "+b+" validation","gc-validator","getValidationConstraint")},getDynamicConstraint:c,setEnabled:function(a){"boolean"===typeof a&&(K=a)},setValidationGroups:function(a){l=a},clearValidationGroups:function(){l=
[]},addValidationGroup:function(a){-1===v.inArray(a,l)&&l.push(a)},removeValidationGroup:function(a){a=v.inArray(a,l);-1<a&&l.splice(a,1)},getValidationGroups:function(){return l},getAlwaysPreventDefault:function(){return G},setAlwaysPreventDefault:function(a){G=a},getAlwaysReturnResult:function(){return J},setAlwaysReturnResult:function(a){J=a}}})});
/* ******** */
(function(e){var g=window.AmazonUIPageJS||window.P,l=g._namespace||g.attributeErrors,b=l?l("DetailPageOffersDPv2Assets",""):g;b.guardFatal?b.guardFatal(e)(b,window):b.execute(function(){e(b,window)})})(function(e,g,l){e.when("A","jQuery","a-popover","cf").register("actionpanel-modified-popover",function(b,d,c){return function(f,e){function l(){b.on.scroll(function(){var a=c.get(f);if(a&&a.isActive()){var b=a.$container.get(0).getBoundingClientRect();if(0>b.bottom||0>b.right)a.attrs("originalFocus",
null),a.hide()}})}function p(){var a=d(e);m.popoverHandle=c.create(a,{closeButton:!1,closeButtonLabel:a.attr("data-close-button-label")||"close",position:"triggerBottom",name:f,popoverLabel:a.attr("data-popover-label")||f,width:"400",activate:b.capabilities.touch?"onmouseover":"onclick"});b.capabilities.touch&&a.bind("touchend",function(b){m.popoverHandle.isActive()||a.trigger("mouseenter")});b.on("a:popover:afterShow:"+f,q);b.on("a:popover:afterHide:"+f,r);b.on("a:popover:afterUpdatePosition:"+f,
t)}function u(){k=d("#actionPanelOverlay");if(!k.length){var a=document.createElement("div");h.length&&(a.id="actionPanelOverlay",k=d(a).addClass("action-panel-overlay").css({width:h.outerWidth(),top:h.position().top}).bind("touchend click",function(a){return!1}),h.append(a))}}function t(a){var b,c=a.popover.$trigger.get(0).getBoundingClientRect();b=g.pageYOffset?g.pageYOffset:"CSS1Compat"===(document.compatMode||"")?document.documentElement.scrollTop:document.body.scrollTop;var d=h.get(0).getBoundingClientRect().left+
8;a.popover.$container.css({top:c.top+b+"px",left:d+"px"})}function n(){var a=h.get(0).getBoundingClientRect();k.css("height",a.bottom-a.top+"px")}function q(a){n();k.show();a.popover.$container.hasClass("burj-action-panel-modified-popover")||a.popover.$container.addClass("burj-action-panel-modified-popover");a.popover.$trigger.trigger("ActionPanelModifiedPopover.showPopover",a)}function r(a){k.hide();a.popover.$trigger.trigger("ActionPanelModifiedPopover.hidePopover",a)}var h=d("#actionPanel"),k,
m=this;h.length&&(p(),u(),l(),d(g).resize(n))}});e.when("jQuery").register("action-panel",function(b){var d="ap-onetime ap-sns ap-deal ap-pospromo ap-mom ap-fresh ap-oos ap-b2brd ap-used ap-sampling".split(" ");return{setPanelState:function(c){if(c.mode){for(var f=b("#actionPanel"),e=0;e<d.length;e++)f.removeClass(d[e]);c="ap-"+c.mode;0<=b.inArray(c,d)&&f.addClass(c)}}}});e.when("jQuery","action-panel").register("toggleBB",function(b,d){return{init:function(){b('input[name\x3d"toggleBuyBox"]:radio').change(function(){var c=
b(this).attr("value");d.setPanelState({mode:c});"onetime"===c||"used"===c?b("#csffsFeaturecontainer").removeClass("a-hidden"):b("#csffsFeaturecontainer").addClass("a-hidden")})}}})});
/* ******** */
(function(f){var c=window.AmazonUIPageJS||window.P,a=c._namespace||c.attributeErrors,b=a?a("DetailPageBTFDPv2Assets",""):c;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,c,a){f.when("jQuery","ready").register("btf-headings-burj",function(b){var c,a,g,h,n,k,l,p,m,q,e,d;f.when("page-refresh:page").execute(function(b){d=b});var t=function(){if(d&&d.config){var c=!1,a;for(a in d.config)if(d.config[a].affectedFeatures&&(b(d.config[a].affectedFeatures).each(function(a,
e){a=b(e);"none"!==a.css("display")&&"1"!==a.css("opacity")&&(c=!0)}),c))return!0}return!1},r=function(){if(t())setTimeout(function(){r()},200);else{c=b(".prestige_beauty.burj-body #session-sims-feature");c.length&&(a=c.find("h2.a-carousel-heading").parent(),g=c.find(".a-column.a-span4.a-span-last.a-text-right"),a.length&&g.length&&(a.addClass("a-push2"),g.removeClass("a-span4"),g.addClass("a-span2")));h=b(".prestige_beauty.burj-body #purchase-sims-feature");h.length&&(n=h.find("h2.a-carousel-heading").parent(),
k=h.find(".a-column.a-span4.a-span-last.a-text-right"),n.length&&k.length&&(n.addClass("a-push2"),k.removeClass("a-span4"),k.addClass("a-span2")));l=b(".prestige_beauty.burj-body #cm_cr_dpwidget");p=l.find("h2");if(l.length&&p.length){var d=p.first();d.remove();l.prepend(d)}m=b(".burj-body #product-description-iframe");m.length&&m[0].contentDocument&&(q=b(m[0].contentDocument.documentElement),q.length&&(e=q.find("h2"),e.length&&(e.css("color","#333"),e.css("font-size","21px"),e.css("font-weight",
"normal"),e.css("font-family","arial, verdana, helvetica, sans-serif"))))}};return{styleBTFHeadings:r}})});
/* ******** */
(function(e){var h=window.AmazonUIPageJS||window.P,n=h._namespace||h.attributeErrors,a=n?n("DetailPagePInfoDPv2Assets",""):h;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,h,n){e.when("jQuery","ready").register("burj-featurebullets",function(a){var f=!1,b,c,d=function(){c.fadeTo(200,.75,null,function(){f?(c.find(".closeFB").addClass("aok-hidden"),a("#featureBulletsPlaceholder").removeClass("FBplaceholder"),b.find(".a-vertical").addClass("collapsedFeatureBullets"),
a("#fbExpandableSection").removeClass("expanded"),c.removeClass("expandedFeatureBullets"),c.find("h1").removeClass("expandedFBHeader"),a(".fadeTextTopforFB").hide(),a(".fadeTextBottomforFB").hide(),b.find("#fbExpanderMoreButtonSection").show(),f=!1):(b.find(".a-vertical").removeClass("collapsedFeatureBullets"),c.addClass("expandedFeatureBullets"),a("#fbExpandableSection").addClass("expanded"),c.find("h1").addClass("expandedFBHeader"),a("#featureBulletsPlaceholder").addClass("FBplaceholder"),b.find("#fbExpanderMoreButtonSection").hide(),
a("#feature-bullets")[0].offsetHeight<a("#feature-bullets")[0].scrollHeight&&(a(".fadeTextTopforFB").show(),a(".fadeTextBottomforFB").show()),c.find(".closeFB").removeClass("aok-hidden"),f=!0);c.fadeTo(200,1)})};return{init:function(){b=a("#feature-bullets");c=a("#fbSection");a(".fadeTextTopforFB").hide();a(".fadeTextBottomforFB").hide();var k=a("#fbExpandableSection"),g=a("#fbExpandableSectionContent");g.height()>k.height()&&(g.addClass("expandableSection"),g.click(function(){d()}),a("#fbExpanderMoreButtonSection").removeClass("aok-hidden"),
b.find(".moreFB").click(function(){d()}),c.find(".closeFB").click(function(){d()}),c.hover(null,function(){f&&d()}))}}});e.when("jQuery","atf").register("title-burj",function(a){var f,b,c,d,k,g,q,n,r,l,m,p,u,v=function(){k.text(g);if(m&&f.height()<b.height()){l.removeClass("aok-hidden");if(r){n=g;for(var a=0,d=g.length-1;a<d;){k.text(g);var e=g,h=a+Math.floor((d-a)/2),p=e.indexOf(" ",h);e=e.substring(0,-1!==p?p:e.length-1);k.text(e+"...");f.height()<b.height()?d=h-1:(a=h+1,n=k.text())}r=!1}k.text(n);
c.addClass("showPointerOnHover");q=!0}else m&&(l.addClass("aok-hidden"),c.removeClass("showPointerOnHover"),q=!1)},t=function(){if(q){var a=f.position().top;b.fadeTo(200,.75,function(){m?(u(),l.removeClass("expand").addClass("collapse titleToggleClickedState"),f.addClass("expandedTitle"),b.css("top",a),d.css("top",a-8)):(p(),l.removeClass("collapse").addClass("expand titleToggleClickedState"),f.removeClass("expandedTitle"),b.css("top",""),d.css("top",""));m=!m;v();d.height(b.height()+16);b.fadeTo(200,
1,function(){l.removeClass("titleToggleClickedState")})})}},x=function(){m||t()},w=function(){r=!0;v()};return{init:function(){f=a("#title_feature_div");b=a("#titleSection");c=a("#title");d=a("#titleOverlay");k=a("#productTitle");g=k.text();q=!1;m=!0;l=a("#expandTitleToggle");e.when("A","a-tooltip","atf").execute(function(a,b){p=function(){b.create(l,{content:a.state("titleExpanderTooltipState").content,position:"triggerTop"})};u=function(){b.remove(l)};m&&p()});a("#socialFabric").append(a('\x3chr class\x3d"a-spacing-medium a-divider-normal"\x3e'));
w();a(h).resize(w);c.click(t);l.click(t);b.hover(null,x)}}})});
/* ******** */
(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(d){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,b=h?h("DetailPageABSMultiSelectionIngressAssets",""):e;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,e,h){d.when("A","dp-latency-marker","abs_msx_ingress_constants","abs_msx_html_builder","abs_msx_ingress_metrics","abs_msx_ingress_utils").register("abs_msx_ingress",function(b,g,a,v,k,p){function w(c){document.body.style.overflow="hidden";b.ajax(c,{method:"get",success:x,error:function(c){l=
!0;k.registerCounter(a.msxMetrics.MSX_AJAX_CALL_TO_FETCH_MSX_CONTENT_FAILED);m()}})}function x(c){n=!0;c=c.trim();/^\s*$/.test(c)?(l=!0,k.registerCounter(a.msxMetrics.MSX_EMPTY_RESPONSE_AFTER_AJAX_CALL_SUCCESS),m()):(h(c),d.when("msx_slotDataLoader").execute(function(a){a.initialLoad()}))}function h(c){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));var f=document.getElementById(a.MSX_SIDE_SHEET_TOP_CONTAINER_HTML_ID);f&&f.insertAdjacentHTML("beforeend",c)}function y(){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));
var c=document.getElementById(q),f=document.getElementById(r);c.style.display="block";p.deviceTypeMobile()?(null!==f&&(f.style.display="block",f.style.height="100vh"),c.style.height="100vh"):(b.show(document.getElementById(a.MSX_BACKGROUND_HTML_ID)),null!==f&&(f.style.width="605px"),c.style.width="605px");document.body.style.overflow="hidden"}function t(){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));var c=document.getElementById(q),f=document.getElementById(r);p.deviceTypeMobile()?(f&&(f.style.height=
"0"),c.style.height="0"):(b.hide(document.getElementById(a.MSX_BACKGROUND_HTML_ID)),f&&(f.style.width="0"),c.style.width="0");document.body.style.overflow="scroll"}function m(){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));document.getElementById(a.MSX_SIDE_SHEET_TOP_CONTAINER_HTML_ID).appendChild(document.getElementById(a.MSX_ERROR_MSG_ID));document.getElementById(a.MSX_ERROR_MSG_ID).classList.remove(a.MSX_AOK_HIDDEN_CLASS)}var u=!1,n=!1;g=a.viewEvents.CLICK;var r=a.msxSideSheetSelectors.MSX_SIDE_SHEET,
q=a.msxSideSheetSelectors.MSX_SIDE_SHEET_TOP_CONTAINER,l=!1;b.declarative("msxIngressClick",g,function(c){c=c.$event;c.stopPropagation();e.history.state&&e.history.state.page===a.MSX_STATE||e.history.pushState({page:a.MSX_STATE},null);e.onpopstate=function(){t()};k.registerCounter(a.msxMetrics.MSX_INGRESS_LINK_CLICKED);n||u||(d.register("msxIngressClick"),u=!0);v.createMsxContainer();c&&c.currentTarget&&c.currentTarget.dataset&&c.currentTarget.dataset.msxingressclick?(c=JSON.parse(c.currentTarget.dataset.msxingressclick).asin,
c=a.FLOW_INGRESS_URL_PREFIX+c+a.FLOW_INGRESS_URL_SUFFIX,b.show(document.getElementById(a.MSX_SPINNER_HTML_ID)),n||l?y():w(c)):(k.registerCounter(a.msxMetrics.MSX_INGRESS_CLICK_EVENT_FAILED),m())});b.declarative("close-multi-selection-experience",g,function(a){t()})});"use strict";d.when("dp-latency-marker").register("abs_msx_ingress_constants",function(b){return{MSX_SIDE_SHEET_OPENED:"msxSideSheetOpened",FLOW_INGRESS_URL_PREFIX:"/gp/product/ajax/absMultiSelection?asin\x3d",FLOW_INGRESS_URL_SUFFIX:"\x26showFeatures\x3dmsxPrimaryWidget",
viewEvents:{CLICK:"click"},msxSideSheetSelectors:{MSX_SIDE_SHEET:"multi-selection-experience",MSX_SIDE_SHEET_TOP_CONTAINER:"msx-top-container"},msxSideSheetBackgroundSelectors:{MSX_BACKGROUND_DECLARATIVE_CONTENT:"\x3cspan class\x3d'a-declarative' data-action\x3d'close-multi-selection-experience' data-close-multi-selection-experience\x3d'{}'\x3e\x3c/span\x3e",MSX_BACKGROUND_CONTENT:"\x3cdiv id\x3d'msx-background' class\x3d'a-section msx-darken-background'\x3e\x3c/div\x3e",MSX_SPINNER_CONTAINER_CONTENT:"\x3cdiv id\x3d'multi-selection-experience-spinner' class\x3d'a-spinner-wrapper aok-hidden'\x3e\x3c/div\x3e",
MSX_CONTAINER_CONTENT:"\x3cdiv id\x3d'msx-top-container' class\x3d'a-section'\x3e\x3c/div\x3e"},msxMetrics:{MSX_AJAX_CALL_TO_FETCH_MSX_CONTENT_FAILED:"ABDpxMsx.ajaxCallToFetchMsxContentFailed",MSX_EMPTY_RESPONSE_AFTER_AJAX_CALL_SUCCESS:"ABDpxMsx.emptyResponseAfterAjaxCallSuccess",MSX_INGRESS_CLICK_EVENT_FAILED:"ABDpxMsx.ingressClickEventFailed",MSX_INGRESS_LINK_CLICKED:"ABDpxMsx.ingressLinkClicked"},HTML_BODY_TAG:"body",MSX_ANIMATION_CONTAINER:"\x3cspan class\x3d'msx-spinner-container'\x3e",MSX_ANIMATION_CONTAINER_INNER:"\x3cspan class\x3d'msx-spinner-container-inner'\x3e",
MSX_PAGE_LOAD_ANIMATION_CUSTOM:"\x3cspan class\x3d'msx-animation msx-page-load'\x3e\x3c/span\x3e",HTML_SPAN_CLOSE_TAG:"\x3c/span\x3e",DIV_LOAD_TEXT:"\x3cdiv class\x3d'msx-load-text'\x3e",HTML_SIZE_BASE_COLOR_BASE:"\x3cspan class\x3d'a-size-base a-color-base'\x3e",MSX_FUN_STRING_SUSPENSEFUL_MUSIC:"MSX_FUN_STRING_SUSPENSEFUL_MUSIC",HTML_DIV_CLOSE_TAG:"\x3c/div\x3e",MSX_BACKGROUND_HTML_ID:"msx-background",MSX_SIDE_SHEET_TOP_CONTAINER_HTML_ID:"msx-top-container",MSX_SPINNER_HTML_ID:"multi-selection-experience-spinner",
MSX_ERROR_MSG_ID:"msx-error-msg-id",MSX_STATE:"MSX",MSX_AOK_HIDDEN_CLASS:"aok-hidden"}});"use strict";d.when("jQuery","dp-latency-marker","abs_msx_ingress_constants","abs_msx_spinner_builder").register("abs_msx_html_builder",function(b,d,a,e){var k=!1;return{createMsxContainer:function(){if(!k){var d=b(a.msxSideSheetBackgroundSelectors.MSX_BACKGROUND_CONTENT),g=b(a.msxSideSheetBackgroundSelectors.MSX_BACKGROUND_DECLARATIVE_CONTENT);d.appendTo(g);g.prependTo(a.HTML_BODY_TAG);d=e.getSpinnerComponent();
g=b(a.msxSideSheetBackgroundSelectors.MSX_SPINNER_CONTAINER_CONTENT);var h=b(a.msxSideSheetBackgroundSelectors.MSX_CONTAINER_CONTENT);d.appendTo(g);g.appendTo(h);h.prependTo(a.HTML_BODY_TAG);k=!0}}}});"use strict";d.when("jQuery","dp-latency-marker","abs_msx_ingress_constants","msx-spinner-string").register("abs_msx_spinner_builder",function(b,d,a,e){return{getSpinnerComponent:function(){var d=a.MSX_ANIMATION_CONTAINER+a.MSX_ANIMATION_CONTAINER_INNER+a.MSX_PAGE_LOAD_ANIMATION_CUSTOM+a.HTML_SPAN_CLOSE_TAG;
d+=a.DIV_LOAD_TEXT+a.HTML_SIZE_BASE_COLOR_BASE+e.getSpinnerString(a.MSX_FUN_STRING_SUSPENSEFUL_MUSIC)+a.HTML_SPAN_CLOSE_TAG+a.HTML_DIV_CLOSE_TAG;d+=a.HTML_SPAN_CLOSE_TAG;return b(d)}}});"use strict";d.when("dp-latency-marker").register("msx-spinner-string",function(b){var d={MSX_FUN_STRING_SUSPENSEFUL_MUSIC:"[Suspenseful music plays]"};return{getSpinnerString:function(a){return d[a]}}});"use strict";d.when("dp-latency-marker").register("abs_msx_ingress_metrics",function(b){return{registerCounter:function(b){e.ue&&
e.ue.count&&e.ue.count(b,(e.ue.count(b)||0)+1)}}});"use strict";d.when("dp-latency-marker").register("abs_msx_ingress_utils",function(b){return{deviceTypeMobile:function(){return!1}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageImageGalleryAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("A","3p-promise","ready").register("image-gallery-csm",function(a,b,c){function e(){try{var a=document.cookie.match("(^|[^;]+)\\s*(session-id|sessionId)\\s*\x3d\\s*([^;]+)");return a?a.pop():""}catch(h){return""}}function d(c){return new b(function(b,e){var h=a.now(),d=a.throttle(function(){if(!a.onScreen(c,
0)){var e=a.now()-h;a.off("DOMContentLoaded load resize scroll",d);b({timeInView:e})}},500);a.on("DOMContentLoaded load resize scroll",d)})}return{setupClientSideMetricsLogging:function(b){return function(){var c=a.$("#product-image-gallery"),g=a.$("#product-image-gallery-asin");if(c.length&&g.length){e();g.attr("data-asin");b?a.$(".image-gallery-slot"):a.$(".image-gallery-common-desktop-slot");var f=!1,k=0;a.on("DOMContentLoaded load resize scroll",function(){a.onScreen(c,0)&&!f&&(f=!0,d(c).then(function(a){f=
!1;2E3>a.timeInView||++k}))});a.on("a:pageUpdate",function(){k=0})}}}}});c.when("A","image-gallery-csm").execute(function(a,b){b.setupClientSideMetricsLogging(!1)()});"use strict";c.when("A","Zoomable","ready").register("DPImageGalleryPinchToZoomCommon",function(a,c){return{init:function(){function d(){a.$("#product-image-gallery").find(".product-image").each(function(a,b){c.enableZooming(b,e(b))})}function e(b){return a.extend({shouldStartZoom:function(){return!0},inputTarget:b.parentElement,loggingTag:"DPImageGallery"},
l)}if(a.capabilities.isAmazonApp)if(c.enabled&&"function"===typeof c.enableZooming){var l={persistent:!0,hideAppOverlays:!0};a.on("a:pageUpdate ready",function(){d()})}else b.ue&&b.ue.count&&b.ue.count("imageGallery:enableZoomingIsNotDefined",1);else b.ue&&b.ue.count&&b.ue.count("imageGallery:pinchToZoomInvalidDeviceType",1)}}})});
/* ******** */
(function(q){var u=window.AmazonUIPageJS||window.P,r=u._namespace||u.attributeErrors,b=r?r("DetailPagePaymentOptionsJavascript",""):u;b.guardFatal?b.guardFatal(q)(b,window):b.execute(function(){q(b,window)})})(function(q,u,r){"use strict";q.when("A","payment-options-constants").register("payment-options-client-side-metric",function(b,d){function e(){return Date.now().toString(10)+Math.random().toString(16).substring(2,13)}function g(c,a){m(d.metricPrefix,c,a)}function l(c,a){m(d.metricPrefixUFO,c,
a)}function m(c,a,b){if("undefined"!==typeof k&&"undefined"!==typeof k.count&&a&&c){if(b===r||null===b)b=1;c+=a;k.count(c,(k.count(c)||0)+b);"undefined"!==typeof u.csa&&(b=u.csa("Events",{producerId:"dp-rpcx"}),a=k.count(c),b("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:c,valueToLog:a},{ent:"all"}))}}function h(c){if(c)this.timerName=c,this.startTime=0;else throw Error("timerName must be non empty string");}function f(c){if(c)this.timerName=c,this.startTime=0;else throw Error("timerName must be non empty string");
}var k=u.ue;h.prototype={isStarted:!1,start:function(){this.isStarted=!0;this.startTime=Date.now()},stop:function(){this.startTime&&g(this.timerName,Date.now()-this.startTime)}};f.prototype={isStarted:!1,start:function(){this.isStarted=!0;this.startTime=Date.now()},stop:function(){this.startTime&&g(this.timerName,Date.now()-this.startTime)}};return{increment:function(c){g(c,1)},incrementWithValue:g,incrementWithValuePriceBlockMessaging:function(c,a){m(d.metricPrefixPriceblock,c,a)},logNexusEventForMonthlyPaymentSelection:function(c){if(u.ue&&
k.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId=c.data.optionId;a.ranking=parseInt(c.data.executionInfo.offerRank);a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=!0;a.isOfferSelected=!0;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=
!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!0;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;k.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("MonthlyPaymentSelection",
1)}},logNexusEventForComparePlansLink:function(c){if(u.ue&&k.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=
!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId=c.data.executionInfo.trackingId;a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!0;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;k.event(a,d.nexus.producerId,d.nexus.schemaId,
{ssd:!0});l("ComparePlansLink",1)}},logNexusEventForSwatchExpansion:function(c){if(u.ue&&k.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=!0;a.isOfferSelected=!1;
a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;k.event(a,d.nexus.producerId,
d.nexus.schemaId,{ssd:!0});l("SwatchExpansion",1)}},logNexusEventForComparePlansOfferSelection:function(c){if(u.ue&&k.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId=c.data.optionId;a.ranking=-1;a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=
!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!0;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=
!1;k.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("ComparePlansOfferSelection",1)}},logNexusEventForChangePlansLink:function(c){if(u.ue&&k.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType=c.data.deviceType;
a.isUfoSwatchExpanded=!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId=c.data.executionInfo.trackingId;a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!0;a.isCheckboxSelected=!1;a.isCheckboxDeselected=
!1;a.isCancelPlanClicked=!1;k.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("ComparePlansChangePlan",1)}},logNexusEventForCancelPlan:function(c){if(u.ue&&k.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType=
c.data.deviceType;a.isUfoSwatchExpanded=!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=
!1;a.isCancelPlanClicked=!0;k.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("ComparePlansCancelPlan",1)}},Timer:h,TimerPriceBlockMessaging:f}});"use strict";q.when("A","payment-options-constants","payment-options-expander-actions","payment-options-client-side-metric").register("multi-card-exp-payment-options",function(b,d,e,g){function l(){g.increment("Expander:Auto:Collapse");var d=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection;
e.collapsePaymentOptions(d);b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand=!1}function m(){if(document.getElementById("payment-options-expander-header")){var d=JSON.parse(b.$("[data-toggle-payment-options-expander]").attr("data-toggle-payment-options-expander"));d.isAutoExpand=!0;d.forceExpand=!0;b.trigger("a:declarative:expand-payment-options-expander",{data:d})}}return function(){var e=b.$(d.selector.multiCardExperimentElement).data(d.selector.multiCardExperimentData);
if(!e||!e.treatment)return{};var f=b.$(d.selector.activeTPlusCards).val();if(!f||!f.length)return{};f=f.split(",");return{expTreatment:e.treatment,isFirstCard:f[0]===d.featureRegistration.featureName,collapseCard:l,autoExpandCard:m}}()});"use strict";q.when("A").register("payment-options-constants",function(b){return{featureRegistration:{featureName:"paymentOptions",featureAttribution:"C/T/I"},nexus:{producerId:"ufo-dev",schemaId:"ufo_dev.DPXAwarenessAndConversion.6"},validators:{itemType:"paymentOfferInfo",
offerTypes:["EQUAL_PAY","ONE_TIME_PAYMENT"],cartTypes:["ADD_TO_CART"],cardTypes:["PLCC"]},metricConstants:{skipLearnMoreMetricForDesktop:"skipLearnMoreMetricForDesktop"},parameters:{itemType:"paymentOfferInfo",selectionType:{ADD:"add",DELETE:"delete"},offerTypes:{equalPay:"EQUAL_PAY",oneTimePayment:"ONE_TIME_PAYMENT"},cartTypes:{addToCart:"ADD_TO_CART",buyNow:"BUY_NOW"},cardTypes:{plcc:"PLCC"}},paymentOfferInputElement:{inputType:"hidden",name:"paymentOfferInfo"},imagesToLoad:".payment-options-financing-option-card-image .payment-options-expander-heading-image-container .payment-options-side-sheet-header .payment-options-side-sheet-option-summary .payment-options-side-sheet-comparison-group-container .payment-options-comparison-sheet-comparison-card-option".split(" "),
ajaxStatusText:{timeout:"Request Timeout"},selector:{expanderContainer:".payment-options-container",skeletonLoader:".payment-option-skeleton-loader",twisterPlusFadeIn:"twister-plus-cc-card-fadeIn",paymentOptionExpand:"payment-options-expander-content-expand",skeletonLoaderExpand:"payment-option-skeleton-loader-expand",checkmark:".payment-options-selected-checkmark",subtitle:".payment-options-subtitle",subtitleText:".payment-options-subtitle-text",cardImage:".payment-options-selected-card-image",expanderIcon:".payment-options-expander-icon",
toggleButton:"#payment-options-toggle-button",expanderContent:".payment-options-expander-content",swatch:".payment-options-swatch",oneTimePaymentOption:".payment-options-default-option",financingOptions:".payment-options-financing-option",financingOptionTitle:".payment-options-financing-option-title",swatchOption:".payment-options-option",swatchHeading:".payment-options-option-heading",selectedHeading:"payment-options-selected-heading",selectedOption:"payment-options-selected-option",unavailableOption:"payment-options-unavailable-option",
unselectedHeading:"payment-options-unselected-heading",swatchDetail:".payment-options-option-detail",refreshCCText:"#payment_options_refresh_cc_text",refreshToggle:"#payment_options_refresh_cc_text_container",multiCardExperimentData:"wireless-multi-card",multiCardExperimentElement:"[data-wireless-multi-card]",activeTPlusCards:"#twister-plus-active-cards",sideSheetButton:".payment-option-side-sheet-comparison-button",selectedButton:"payment-option-side-sheet-comparison-button-selected",unselectedButton:"payment-option-side-sheet-comparison-button-unselected",
disabledSwatch:"payment-option-disabled",monthlyPaymentAction:"payment-options-monthly-payment-action",paymentOptionsWeblabs:"#payment-options-weblabs",paymentOptionsWeblabsAttribute:"data-enabled-weblabs",paymentOptionsDefaultPickupBuyingOptionData:"#payment-options-default-buyingOption-pickup",isBuyingOptionOverridePresentAttribute:"data-is-pickup-buying-option-override-present",pickUpBuyingOptionIndex:"data-pickup-buying-option-index",payPlanColumnSelector:".payment-plan-column-selector",paymentDetailColumnSelector:".payment-details-column-selector",
interestColumnSelector:".interest-column-selector",payPlanAplliesSelector:".pay-plan-applies-to-column-selector",cardRewardColumnSelector:".card-reward-column-selector",oneTimePaymentHeadButton:".payment-option-onetimepayment-button",paymentOptionApplicabilityMessageLayout:".payment-option-applicibility-message-layout",paymentOptionApplicabilityMessage:".payment-option-applicibility-message-layout .payment-option-applicibility-message",swatchActionButton:".payment-options-swatch-action-button",toggleExpanderButton:".toggle-payment-options-expander-button",
setDynamicHeight:{paymentPlanRow:{rowElementsSelector:".payment-options-payment-plan-head, .payment-option-payment-plan-row-value"},paymentOptionDetailsRow:{columnValueElementsSelector:".monthly-payment-table-payment-details-column-value",rowElementsSelector:".payment-option-payment-details-row-value, .payment-options-payment-details-head"},interestRow:{rowElementsSelector:".payment-option-interest-row-value, .payment-options-interest-head"},planAppliesToRow:{rowElementsSelector:".payment-options-plan-applies-to-head, .payment-option-plan-applies-to-row-value"}}},
comparePlansSelector:{comparePlansSidesheetSelector:"#compare-all-plans-sideSheet",comparePlansContentSelector:"#compare-all-plans-content",viewModelFailedSelector:"#payment-options-viewmodel-failed",preselectiedOptionSelector:"#payment-options-preselected",paymentOptionsCountSelector:"#compare-all-plans-options-count",firsOfferIdSelector:"#payment-options-first-offer-id",ajaxErrorMessageSelector:".compare-plans-sidesheet-ajax-error",skeletonLoaderClass:".compare-plans-sidesheet-skeleton-loader",
comparePlansPaymentOptionSelector:".payment-plan-",comparePlansPaymentOptionWithLearnMoreSelector:".payment-plan-column-",comparePlansButtonIdSelector:"#monthlyPaymentOption",comparePlansColumnSelector:".payment-option-table-column",comparePlansColumnWithLearnMoreSelector:".payment-option-table-monthly-payments-column",comparePlansButtonSelector:".payment-option-side-sheet-comparison-button"},learnMoreSelector:{learnMoreSidesheetSelector:"#payment-option-learn-more-sideSheet",learnMoreContentSelector:"#payment-options-learn-more-ajax",
viewModelFailedSelector:"#payment-options-viewmodel-failed",preselectiedOptionSelector:"#payment-options-preselected",paymentOptionsCountSelector:"#payment-options-learn-more-options-count",firsOfferIdSelector:"#payment-options-first-offer-id",ajaxErrorMessageSelector:".learn-more-sidesheet-ajax-error",skeletonLoaderClass:".learn-more-sidesheet-skeleton-loader"},ajaxErrorReasons:{timeoutStatus:"Request Timeout"},classes:{hideSwatchMainViewClass:"payment-option-list-item-hidden",paymentOptionsList:".payment-options-list",
unavailableCompareAllPlansOption:"payment-options-comparison-sheet-unavailable-option",disabledComparisonPlanButton:"payment-option-comparison-sheet-disabled",auiDisabledButtonClass:"a-button-disabled",auiEnabledButtonClass:"a-button-normal",popOverHideClass:"popover-hide",popOverShowClass:"popover-show",colLeftRightBorder:"Payment-option-side-sheet-left-right-column-border",colTopBorder:"Payment-option-side-sheet-top-border",colBottomBorder:"Payment-option-side-sheet-bottom-border",cardRewardHideClass:"payment-options-card-reward-hide",
normalLeftBorder:"payment-option-column-normal-left-border",normalRightBorder:"payment-option-column-normal-right-border",selectedPaymentOptionBorder:"payment-option-selected-column-border",normalPaymentOptionBorder:"payment-option-column-normal-border",selectedButtonClass:"payment-option-side-sheet-comparison-button-selected",unselectedButtonClass:"payment-option-side-sheet-comparison-button-unselected",disabledPaymentOptionOrder:"payment-option-disabled-column-order",disabledPaymentOptionClass:"payment-option-disabled-column"},
animationTimeoutUnit:200,metricPrefix:"DPX:TwisterPlusCCCard:PaymentOptions:",metricPrefixPriceblock:"DPX:PriceBlockMessaging:PaymentOptions:",metricPrefixUFO:"DPX:UnifiedFinancingOffers:PaymentOptions:",classSelector:".",disabledPaymentOptionSelecter:"titleSupplement",popOverText:"popover",attributes:{ariaChecked:"aria-checked",ariaExpanded:"aria-expanded"}}});"use strict";q.when("A","cc-manager","payment-options-constants","payment-options-expander-state","payment-options-expander-actions","payment-options-client-side-metric",
"multi-card-exp-payment-options","payment-plan-state").register("payment-options-registration",function(b,d,e,g,l,m,h,f){function k(a){return"string"===typeof a}function c(a){for(var c=a.length-1;0<=c;c--){var b=a.get(c).id;if(b!==r&&!v("#"+b).parent().parent().parent().hasClass(e.classes.hideSwatchMainViewClass)){v("#"+b).parent().parent().parent().addClass(e.classes.hideSwatchMainViewClass);break}}}function a(){var a;var c=(a=v(e.selector.paymentOptionsDefaultPickupBuyingOptionData))&&"true"===
a.attr(e.selector.isBuyingOptionOverridePresentAttribute);a=a&&c?(a=a.attr(e.selector.pickUpBuyingOptionIndex))?a:r:void 0;return"#paymentOption_"+(a?a:b.$("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||0)}function n(a){var c=a.executionInfo;c.cartType=e.parameters.cartTypes.addToCart;return{itemType:e.parameters.itemType,price:a.price,selectionType:e.parameters.selectionType.ADD,enableIA:!1,priceAndTermCountDisplayString:a.priceAndTermCountDisplayString,interestDisplayString:a.interestDisplayString,
interestAmount:a.interestAmount,orderSummaryDisplayString:a.orderSummaryDisplayString,invalidSelectionTitle:a.cardName,isOrderLevel:a.isOrderLevel,bottomSheetFootnoteDisplayString:a.bottomSheetFootnoteDisplayString,termCount:a.termCount,termType:a.termType,formData:[{inputType:e.paymentOfferInputElement.inputType,inputName:e.paymentOfferInputElement.name,inputValue:c}]}}var v=b.$;h=h.expTreatment;var p="T2"!==h&&"T3"!==h,w=e.featureRegistration.featureName;d.registerFeature(e.featureRegistration,
{init:function(c){b.$(a()).removeClass("a-hidden")},validateInputParams:function(a){return a&&a.formData&&1===a.formData.length&&a.itemType===e.validators.itemType&&k(a.priceAndTermCountDisplayString)&&k(a.orderSummaryDisplayString)&&k(a.interestDisplayString)&&"number"===typeof a.price&&"number"===typeof a.interestAmount&&k(a.bottomSheetFootnoteDisplayString)?!0:!1},cardCollapse:function(){var a=f.paymentOptionSelected.paymentOptionClickedFromSideSheet;p&&!a&&(m.increment("Expander:Auto:Collapse"),
a=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection,l.collapsePaymentOptions(a),b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand=!1)},refreshCard:function(){b.$(e.selector.refreshToggle).removeClass("refresh-toggle");b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand&&b.$(e.selector.refreshCCText).removeClass("a-hidden")},switchBuyingOption:function(a,f,
m,h,k,p){h=p&&-1!==p?p:a;b.$("[id^\x3dpaymentOption_]").addClass("a-hidden");a=b.$(".payment-options-selected-option").closest("[data-action\x3d'payment-options-monthly-payment-action']").data("payment-options-monthly-payment-action");var q;b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander")!==r&&(f=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection,a===r&&!0===f&&(q=b.$("[data-payment-options-emp-action]").data("payment-options-emp-action")));
var u;a&&(u=a.offerGroup);b.$("#paymentOption_"+h).removeClass("a-hidden");var y=v("#paymentOption_"+h).find("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander");f=v("#paymentOption_"+h+" #oneTimePaymentOptionSwatch");b.$(f).click();b.delay(function(){y.isExpand||v(e.selector.subtitleText).text(y.collapseSubtitle)},100);m=f=!1;d.ccRemovedSelectionsClear(w);a===r&&q!==r&&(k=b.$("#paymentOption_"+h+" [data-payment-options-emp-action]").data("payment-options-emp-action"),
f=k!==r,!0===f&&(v(e.selector.subtitleText).text(k.preselectionSubtitle),g.expanderSubtitle.monthlyPaymentOptionsCollapsedSubtitle=k.preselectionSubtitle,g.expanderSubtitle.monthlyPaymentOptionsExpandedSubtitle=k.preselectionSubtitle),!1===f&&d.ccRemovedSelectionUpdate(w,n(q)));if(u){q=v("#paymentOption_"+h+" .payment-options-financing-option");h=q.length;f=0<h;for(k=0;k<h;k++){p=q.get(k);var z=b.$(p).closest("[data-action\x3d'payment-options-monthly-payment-action']").data("payment-options-monthly-payment-action"),
A=v("#"+p.id).parent().parent().parent(),C=A.hasClass(e.classes.hideSwatchMainViewClass);if(z&&u===z.offerGroup){m=!0;C&&(c(q),A.removeClass(e.classes.hideSwatchMainViewClass));b.$(p).click();var D=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection}}(!f||f&&!m)&&d.ccRemovedSelectionUpdate(w,n(a));l.collapsePaymentOptions(D)}}})});"use strict";q.when("A","cc-manager","payment-options-constants","payment-options-registration").register("cc-payment-options",
function(b,d,e){function g(c){var a=h("form#buyNowCheckout");if(0<a.length){var b=a.find("input[name\x3d"+e.parameters.itemType+"]");c=c.executionInfo;c.cartType=e.parameters.cartTypes.buyNow;c=JSON.stringify(c);1>b.length?h("\x3cinput\x3e").attr({type:e.paymentOfferInputElement.inputType,name:e.paymentOfferInputElement.name,value:c,id:"bnMshopPaymentOfferInfo"}).appendTo(a):(a=h("#bnMshopPaymentOfferInfo"),1<b.length?a.detach():a.val(c))}}function l(c){var a=c.executionInfo;a.sessionId=c.sessionId;
a.customerId=c.customerId;a.marketplaceId=c.marketplaceId;a.requestId=c.requestId;a.deviceType=c.deviceType;a.asin=c.asin;a.buyingOptionType=c.buyingOptionType;a.parentASIN=c.parentASIN;a.websiteDisplayGroup=c.websiteDisplayGroup}function m(c,a){return{itemType:e.parameters.itemType,price:c.price,selectionType:e.parameters.selectionType.ADD,enableIA:!1,priceAndTermCountDisplayString:c.priceAndTermCountDisplayString,interestDisplayString:c.interestDisplayString,interestAmount:c.interestAmount,orderSummaryDisplayString:c.orderSummaryDisplayString,
isOrderLevel:c.isOrderLevel,bottomSheetFootnoteDisplayString:c.bottomSheetFootnoteDisplayString,termCount:c.termCount,termType:"mo",formData:a}}var h=b.$,f=e.featureRegistration.featureName,k;return{updatePaymentOptionSelection:function(c){if(!c)return!1;d.ccSelectionsClear(f);clearTimeout(k);h("#bnMshopPaymentOfferInfo").detach();var a=[],b;if(c.hasOwnProperty("executionDetails")&&0!==Object.keys(c.executionDetails).length){var v=c.executionDetails;Object.keys(v).forEach(function(b){if("paymentOfferInfoType"===
b){var d=JSON.parse(c.executionDetails.paymentOfferInfoType);d.sessionId=c.sessionId;d.customerId=c.customerId;d.marketplaceId=c.marketplaceId;d.requestId=c.requestId;d.deviceType=c.deviceType;d.asin=c.asin;d.buyingOptionType=c.buyingOptionType;d.parentASIN=c.parentASIN;d.websiteDisplayGroup=c.websiteDisplayGroup;c.executionDetails.paymentOfferInfoType=JSON.stringify(d);a.push([{inputType:e.paymentOfferInputElement.inputType,inputName:e.paymentOfferInputElement.name,inputValue:JSON.parse(v[b])}])}else a.push([{inputType:e.paymentOfferInputElement.inputType,
inputName:b,inputValue:v[b]}])});for(var p=0;p<a.length;p++)if(b=m(c,a[p]),b=d.ccSelectionUpdate(f,b),!b)return!1}else if(c.hasOwnProperty("executionInfo")&&0!==Object.keys(c.executionInfo).length)l(c),a.push([{inputType:e.paymentOfferInputElement.inputType,inputName:e.paymentOfferInputElement.name,inputValue:c.executionInfo}]),b=m(c,a[0]),b=d.ccSelectionUpdate(f,b);else return!0;g(c);k=setTimeout(function(){g(c)},1E3);return b}}});"use strict";q.when("A","cc-payment-options").register("payment-options-actions",
function(b,d){b.declarative("select-payment-option","click",function(b){d.updatePaymentOptionSelection(b.data)})});"use strict";q.when("A","po-sidesheet-ajax-state","payment-plan-state","payment-options-constants","payment-options-state","payment-options-client-side-metric").register("po-compare-plans-actions",function(b,d,e,g,l,m){function h(){d.resetComparePlansState();t(g.comparePlansSelector.skeletonLoaderClass).addClass("aok-hidden");t(g.comparePlansSelector.ajaxErrorMessageSelector).removeClass("aok-hidden")}
function f(a,b){a=t(a);var d=g.comparePlansSelector.viewModelFailedSelector,e=g.comparePlansSelector.preselectiedOptionSelector,f=g.comparePlansSelector.paymentOptionsCountSelector,h=g.comparePlansSelector.firsOfferIdSelector,l=c(),e=e+"-"+l,f=f+"-"+l,h=h+"-"+l;return 0!==a.filter(d+"-"+l).length?(m.incrementWithValue("Ajax:Inconsistency:ViewModelFailed",1),!0):0!==a.filter(e).length?(m.incrementWithValue("Ajax:Inconsistency:PreselectionPresent",1),!0):a.filter(f).data("paymentPlansCount")!==b.numberOfPaymentOptions?
(m.incrementWithValue("Ajax:Inconsistency:OffersCountNotSame",1),!0):a.filter(h).data("firstOfferId")!==b.firstOfferId?(m.incrementWithValue("Ajax:Inconsistency:OfferIdNotSame",1),!0):!1}function k(e){t(g.comparePlansSelector.comparePlansSidesheetSelector).html(d.getComparePlansState("ajaxContent"));var f=g.comparePlansSelector.comparePlansContentSelector+"-"+c();t(f).removeClass("aok-hidden");b.loadDescendantImagesManually(t(".payment-options-side-sheet-header"));b.loadDescendantImagesManually(t(".payment-options-side-sheet-option-summary"));
b.loadDescendantImagesManually(t(".payment-options-side-sheet-comparison-group-container"));b.loadDescendantImagesManually(t(".payment-options-comparison-sheet-comparison-card-option"));a(e)}function c(){return b.$("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||0}function a(a){var c=e.paymentOptionSelected.paymentOptionSelectedButtonId,b=e.paymentOptionSelected.paymentOptionDisabledButtonId;w(a.data.selectText);B(c,a.data.selectedText);q(b);requestAnimationFrame(function(a){n(a)})}
function n(a){var c=g.selector.setDynamicHeight;Object.keys(c).forEach(function(a){var b=c[a];Object.keys(b).forEach(function(a){a=document.querySelectorAll(b[a]);if(0!==a.length){var c=v(a);0!==c&&p(a,c)}})});a=document.querySelectorAll(".payment-option-table-head");a=v(a);var b=document.querySelectorAll(".payment-option-table-column");p(b,a)}function v(a){for(var c=0,b=0;b<a.length;b++)void 0,void u.getComputedStyle(a[b]).height,a[b].offsetHeight>c&&(c=a[b].offsetHeight);return c}function p(a,c){for(var b=
0;b<a.length;b++)a[b].style.height=c.toString()+"px"}function w(a){t(r.oneTimePaymentHeadButton).removeClass(r.selectedButton);t(r.oneTimePaymentHeadButton).addClass(r.unselectedButton);t(r.oneTimePaymentHeadButton).text(a);t(g.comparePlansSelector.comparePlansColumnSelector).removeClass(g.classes.selectedPaymentOptionBorder);t(g.comparePlansSelector.comparePlansColumnSelector).addClass(g.classes.normalPaymentOptionBorder);t(g.comparePlansSelector.comparePlansColumnSelector).removeClass(g.classes.disabledPaymentOptionClass);
t(g.comparePlansSelector.comparePlansColumnWithLearnMoreSelector).removeClass(g.classes.disabledPaymentOptionOrder);t(g.comparePlansSelector.comparePlansButtonSelector).removeClass(g.classes.selectedButtonClass);t(g.comparePlansSelector.comparePlansButtonSelector).removeClass(g.classes.auiDisabledButtonClass);t(g.comparePlansSelector.comparePlansButtonSelector).addClass(g.classes.unselectedButtonClass);t(g.comparePlansSelector.comparePlansButtonSelector).text(a)}function B(a,b){if(""!==a)if("oneTimePaymentOption"===
a)t(r.oneTimePaymentHeadButton).addClass(r.selectedButton),t(r.oneTimePaymentHeadButton).removeClass(r.unselectedButton),t(r.oneTimePaymentHeadButton).text(b);else{var c=g.comparePlansSelector.comparePlansPaymentOptionSelector+a.match(/\d+/g)[0];t(c).addClass(g.classes.selectedPaymentOptionBorder);t(c).removeClass(g.classes.normalPaymentOptionBorder);t("#"+a).addClass(g.classes.selectedButtonClass);t("#"+a).removeClass(g.classes.unselectedButtonClass);t("#"+a).text(b)}}function q(a){if(a&&""!==a){a=
a.match(/\d+/g)[0];t("#"+g.disabledPaymentOptionSelecter+a).text("("+e.paymentOptionSelected.paymentOptionUnAvailableMsg+")");var b=g.comparePlansSelector.comparePlansPaymentOptionSelector+a,c=g.comparePlansSelector.comparePlansPaymentOptionWithLearnMoreSelector+a;t(g.comparePlansSelector.comparePlansButtonIdSelector+a).addClass(g.classes.auiDisabledButtonClass);t(c).addClass(g.classes.disabledPaymentOptionOrder);t(b).addClass(g.classes.disabledPaymentOptionClass);t("[id\x3d"+g.popOverText+a+"cell]").addClass(g.classes.popOverShowClass);
t("[id\x3d"+g.popOverText+a+"cell]").removeClass(g.classes.popOverHideClass)}}var t=b.$,r=g.selector;b.on("PageRefresh:ATF",function(){d.resetComparePlansState()});return{loadAjaxContent:function(a){var c=t("#twister-plus-asin").val();if(null===c||""===c)m.incrementWithValue("Ajax:Inconsistency:AsinEmpty",1),h();else if(d.getComparePlansState("isAjaxContentLoaded")&&!d.checkInconsistentState())k(a);else{var e=new m.Timer("Ajax:Loading:Time");e.start();t(g.comparePlansSelector.skeletonLoaderClass).removeClass("aok-hidden");
t(g.comparePlansSelector.ajaxErrorMessageSelector).addClass("aok-hidden");b.ajax("/gp/product/ajax?",{method:"get",timeout:1E4,params:{asin:c,showFeatures:"compareAllPlansSidesheetAjax,paymentOptions",experienceId:"paymentOptionsAjaxExperience"},success:function(b){null===b||/^\s*$/.test(b)?(m.incrementWithValue("Ajax:Inconsistency:EmptyResponse",1),h()):f(b,a.data)?h():(d.setComparePlansState("ajaxContent",b),d.setComparePlansState("isAjaxContentLoaded",!0),d.setComparePlansState("ajaxContentAsin",
c),k(a),e.stop())},error:function(a,b){b===g.ajaxErrorReasons.timeoutStatus?m.incrementWithValue("Ajax:Failure:Timeout",1):m.incrementWithValue("Ajax:Failure",1);h()}})}},renderPreselection:a}});"use strict";q.when("A","compare-plan-row-constants").register("compare-plan-row-height-updater",function(b,d){var e=[d.COMPARE_PLAN_PAYMENT_DETAILS,d.COMPARE_PLAN_INTEREST_ROW];return{updateRowHeight:function(d){for(var l=0;l<e.length;l++){for(var m=b.$(d).find(e[l]),h,f=h=0;f<m.length;f++)m[f].offsetHeight>
h&&(h=m[f].offsetHeight);if(0<h)for(f=0;f<m.length;f++)m[f].style.height=h.toString()+"px"}}}});"use strict";q.when("A").register("compare-plan-row-constants",function(b){return{COMPARE_PLAN_CARD_OPTION:".comparison-table-comparison-card-option",COMPARE_PLAN_PAYMENT_DETAILS:".comparison-table-payment-details",COMPARE_PLAN_INTEREST_ROW:".comparison-table-interest-row-value",COMPARE_PLAN_TOTAL_AMOUNT:".comparison-table-total-amount",COMPARE_PLAN_APPLIES_TO_ROW:".comparison-table-plan-applies-to-row-value",
COMPARE_PLAN_REWARD_ROW:".comparison-table-card-reward-row-value"}});"use strict";q.when("A").register("po-sidesheet-ajax-state",function(b){var d=b.$,e={ajaxContent:"",isAjaxContentLoaded:!1,ajaxContentAsin:""},g={ajaxContent:"",isAjaxContentLoaded:!1,ajaxContentAsin:""};return{getComparePlansState:function(b){return e[b]},setComparePlansState:function(b,d){e[b]=d},getLearnMoreState:function(b){return g[b]},setLearnMoreState:function(b,d){g[b]=d},checkInconsistentState:function(){if(e.isAjaxContentLoaded&&
g.isAjaxContentLoaded){if(e.ajaxContentAsin!==g.ajaxContentAsin)return this.resetComparePlansState(),this.resetLearnMoreState(),!0;var b=d("#twister-plus-asin").val();if(e.ajaxContentAsin!==b)return this.resetComparePlansState(),this.resetLearnMoreState(),!0}return!1},resetComparePlansState:function(){this.setComparePlansState("ajaxContent","");this.setComparePlansState("isAjaxContentLoaded",!1);this.setComparePlansState("ajaxContentAsin","")},resetLearnMoreState:function(){this.setLearnMoreState("ajaxContent",
"");this.setLearnMoreState("isAjaxContentLoaded",!1);this.setLearnMoreState("ajaxContentAsin","")}}});"use strict";q.when("A","payment-options-state","po-compare-plans-actions").register("ufo-compare-payment-plans",function(b,d,e){var g=b.$;b.declarative("compare-payment-plans","click",function(g){b.trigger("a:declarative:side-sheet:click",g);d.getWeblabData().isDesktopComparePlansAjaxEnabled?b.trigger("a:declarative:compare-payment-plans-ajax:click",g):e.renderPreselection(g)});b.declarative("price-block-compare-payment-plans",
"click",function(g){b.trigger("a:declarative:open-payment-options-side-sheet:click",g);d.getWeblabData().isDesktopComparePlansAjaxEnabled?b.trigger("a:declarative:compare-payment-plans-ajax:click",g):e.renderPreselection(g)});b.declarative("compare-payment-plans-ajax","click",function(b){e.loadAjaxContent(b)});b.declarative("overflow-sidesheet","click",function(d){var e=g(d.$currentTarget);e!==r&&null!==e&&(g("#"+d.data.paymentOptionSelectButtonId)[0].classList.contains("a-button-disabled")||b.trigger("a:declarative:monthly-payment-option-selection:click",
d))})});"use strict";q.when("A","po-sidesheet-ajax-state","payment-options-constants","payment-options-state","payment-options-client-side-metric","payment-plan-state").register("po-learn-more-actions",function(b,d,e,g,l,m){function h(){d.resetLearnMoreState();p(e.learnMoreSelector.skeletonLoaderClass).addClass("aok-hidden");p(e.learnMoreSelector.ajaxErrorMessageSelector).removeClass("aok-hidden")}function f(a,b){a=p(a);var d=c(),f=e.learnMoreSelector.preselectiedOptionSelector+"-"+d,h=e.learnMoreSelector.paymentOptionsCountSelector+
"-"+d,g=e.learnMoreSelector.firsOfferIdSelector+"-"+d;return 0!==a.filter(e.learnMoreSelector.viewModelFailedSelector+"-"+d).length?(l.incrementWithValue("Ajax:Inconsistency:ViewModelFailed",1),!0):0!==a.filter(f).length?(l.incrementWithValue("Ajax:Inconsistency:PreselectionPresent",1),!0):a.filter(h).data("paymentPlansCount")!==b.numberOfPaymentOptions?(l.incrementWithValue("Ajax:Inconsistency:OffersCountNotSame",1),!0):a.filter(g).data("firstOfferId")!==b.firstOfferId?(l.incrementWithValue("Ajax:Inconsistency:OfferIdNotSame",
1),!0):!1}function k(f,h,g){p(e.learnMoreSelector.learnMoreSidesheetSelector).html(d.getLearnMoreState("ajaxContent"));g=e.learnMoreSelector.learnMoreContentSelector+"-"+g;g+=c();p(g).removeClass("aok-hidden");b.loadDescendantImagesManually(p(".payment-options-side-sheet-header"));b.loadDescendantImagesManually(p(".payment-options-side-sheet-option-summary"));b.loadDescendantImagesManually(p(".payment-options-side-sheet-comparison-group-container"));b.loadDescendantImagesManually(p(".payment-options-comparison-sheet-comparison-card-option"));
a(f,h)}function c(){return b.$("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||0}function a(a,b){n(m.paymentOptionSelected.paymentOptionSelectedButtonId,a,b)}function n(a,b,c){v(b);p(function(){p("[id\x3d"+a+"]").removeClass(w.unselectedButton);p("[id\x3d"+a+"]").addClass(w.selectedButton);p("[id\x3d"+a+"]").children(0).children(0).text(c);p("[id\x3d"+a+"]").text(c)})}function v(a){p(w.sideSheetButton).removeClass(w.selectedButton);p(w.sideSheetButton).addClass(w.unselectedButton);
p(w.sideSheetButton).text(a);p(w.oneTimePaymentHeadButton).removeClass(w.selectedButton);p(w.oneTimePaymentHeadButton).addClass(w.unselectedButton);p(w.oneTimePaymentHeadButton).text(a)}var p=b.$,w=e.selector;b.on("PageRefresh:ATF",function(){d.resetLearnMoreState()});return{loadAjaxContent:function(a){var c=a.data.selectText,g=a.data.selectedText,m=p("#twister-plus-asin").val();null===m||""===m?(l.incrementWithValue("Ajax:Inconsistency:AsinEmpty",1),h()):d.getLearnMoreState("isAjaxContentLoaded")&&
!d.checkInconsistentState()?k(c,g,a.data.index):(p(e.learnMoreSelector.skeletonLoaderClass).removeClass("aok-hidden"),p(e.learnMoreSelector.ajaxErrorMessageSelector).addClass("aok-hidden"),b.ajax("/gp/product/ajax?",{method:"get",timeout:1E4,params:{asin:m,showFeatures:"paymentOptionsLearnMoreSidesheetAjax,paymentOptions",experienceId:"paymentOptionsAjaxExperience"},success:function(b){null===b||/^\s*$/.test(b)?(l.incrementWithValue("Ajax:Inconsistency:EmptyResponse",1),h()):f(b,a.data)?h():(d.setLearnMoreState("ajaxContent",
b),d.setLearnMoreState("isAjaxContentLoaded",!0),d.setLearnMoreState("ajaxContentAsin",m),k(c,g,a.data.index))},error:function(a,b){b===e.ajaxErrorReasons.timeoutStatus?l.incrementWithValue("Ajax:Failure:Timeout",1):l.incrementWithValue("Ajax:Failure",1);h()}}))},stopEventPropagation:function(a){a.$event.preventDefault();a.$event.stopImmediatePropagation()},preRenderSelectedFinancingOption:a}});"use strict";q.when("A","payment-options-state","po-learn-more-actions","payment-options-client-side-metric",
"payment-options-constants").register("payment-options-learn-more-events",function(b,d,e,g,l){b.declarative("payment-options-learn-more","click",function(m){g.increment("SideSheet:Link:Click");e.stopEventPropagation(m);b.trigger("a:declarative:side-sheet:click",m);!m.data.isComparePlansEvent&&d.getWeblabData().isDesktopLearnMoreAjaxEnabled?b.trigger("a:declarative:payment-options-learn-more-ajax:click",m):e.preRenderSelectedFinancingOption(m.data.selectText,m.data.selectedText)});b.declarative("payment-options-gil-skip-learn-more",
"click",function(b){g.incrementWithValue(l.metricConstants.skipLearnMoreMetricForDesktop,1);u.open(b.data.partnerUrl,"_blank","noopener")});b.declarative("payment-options-learn-more-ajax","click",function(b){e.loadAjaxContent(b)})});"use strict";q.when("A","payment-options-expander-actions","payment-options-expander-state","payment-options-client-side-metric","multi-card-exp-payment-options").execute(function(b,d,e,g,l){function m(b){if(a===r||null===a||null===b.data.isExpand||b.data.isExpand===r){if(null===
b.data.isExpand||b.data.isExpand===r)f("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand=!1,b.data.isExpand=!1;d.initSubtitle(b);n&&d.hideLoaderAnimation(b.data.isExpand)}}function h(b){a=!0;var c=b.data.renderPreselection;e.autoScroll=!b.data.isAutoExpand;c||n?d.expandPaymentOptions(n,c):(v.isStarted||v.start(),d.expandSkeletonLoader(c));g.logNexusEventForSwatchExpansion(b)}var f=b.$,k=l.expTreatment,c=l.isFirstCard&&"T1"===k||"T2"===k||"T3"===k,a,n=e.isLoaded,
v=new g.Timer("Desktop:Expander:Loading:UserWaiting:Time"),p=new g.Timer("Desktop:Expander:Loading:Time");p.start();q.when("cc-payment-options").execute(function(){p.stop();v.isStarted&&v.stop();n=!0;d.hideLoaderAnimation(a);g.incrementWithValue("Container:Swatch:Amount",f(".payment-options-list-item").length)});b.declarative("toggle-payment-options-expander",["click","keydown"],function(c){if("keydown"!==c.type||13===c.$event.keyCode||32===c.$event.keyCode){m(c);a=c.data.isExpand;var e=c.data.renderPreselection;
!0===a?(a=!1,g.increment("Desktop:Expander:Click:Collapse"),d.collapsePaymentOptions(e)):!1===a&&h(c);f("[data-toggle-payment-options-expander]").each(function(){f(this).data("toggle-payment-options-expander").isExpand=a});b.trigger("a:declarative:expander-update-visible-payment-options:click",c)}});b.declarative("expand-payment-options-expander",function(a){if(!k||a.data.forceExpand)m(a),h(a),f("[data-toggle-payment-options-expander]").each(function(){f(this).data("toggle-payment-options-expander").isExpand=
!0})});c&&l.autoExpandCard()});"use strict";q.when("A","payment-options-expander-state","payment-options-constants","payment-options-client-side-metric","payment-options-swatch-actions","cc-manager").register("payment-options-expander-actions",function(b,d,e,g,l,m){function h(){if(d.autoScroll){var b=a(n.expanderContainer),c=b.offset().top+b.outerHeight();if(a(u).scrollTop()+a(u).height()<c){var c=b.offset().top,e=a(u).height(),b=b.height(),b=c-(e-b)/2;a("html, body").animate({scrollTop:b},d.animationTimeoutUnit)}}}
function f(b,c){b=b?p.monthlyPaymentOptionsExpandedSubtitle:c?p.monthlyPaymentOptionsExpandedSubtitle:p.loadingSubtitle;a(n.subtitleText).text(b);!1===c&&a(n.cardImage).fadeOut(e.animationTimeoutUnit)}function k(b){""!==p.monthlyPaymentOptionsCollapsedSubtitle&&a(n.subtitleText).text(p.monthlyPaymentOptionsCollapsedSubtitle);!1===b&&a(n.cardImage).fadeIn(e.animationTimeoutUnit)}function c(b,c){a(b)&&a(b).attr(v.ariaExpanded,c)}var a=b.$,n=e.selector,v=e.attributes,p=d.expanderSubtitle;return{initSubtitle:function(a){var b=
a.data.expandSubtitle;p.monthlyPaymentOptionsCollapsedSubtitle=a.data.collapseSubtitle;p.monthlyPaymentOptionsExpandedSubtitle=b},expandPaymentOptions:function(d,l){g.increment("Desktop:Expander:Click:Expand");g.increment("Desktop:Expander:Click:Expand:loading");a(n.expanderContent).addClass(n.paymentOptionExpand);a(n.expanderIcon).addClass("rotate");m.cardExpanded(e.featureRegistration.featureName);b.delay(function(){a(n.swatch).addClass(n.twisterPlusFadeIn);f(d,l);h()},e.animationTimeoutUnit);b.$(n.refreshToggle).hasClass("refresh-toggle")||
b.$(n.refreshCCText).removeClass("a-hidden");c(n.toggleExpanderButton,!0)},expandSkeletonLoader:function(d){g.increment("Desktop:Expander:Click:Expand");a(n.expanderContent).addClass(n.skeletonLoaderExpand);a(n.expanderIcon).addClass("rotate");b.delay(function(){d||(a(n.skeletonLoader).addClass(n.twisterPlusFadeIn),f(!1,d),h())},e.animationTimeoutUnit);c(n.toggleExpanderButton,!0)},hideLoaderAnimation:function(c,d){c&&a(n.skeletonLoader).removeClass(n.twisterPlusFadeIn);b.delay(function(){a(n.skeletonLoader).hide();
a(n.swatch).removeClass("invisible");c&&(a(n.subtitleText).text(p.monthlyPaymentOptionsExpandedSubtitle),a(n.expanderContent).addClass(n.paymentOptionExpand),b.delay(function(){a(n.swatch).addClass(n.twisterPlusFadeIn);f(!0,d);h()},e.animationTimeoutUnit))},e.animationTimeoutUnit)},collapsePaymentOptions:function(f){a(n.swatch).removeClass(n.twisterPlusFadeIn);d.isLoaded||f||a(n.skeletonLoader).removeClass(n.twisterPlusFadeIn);a(n.expanderIcon).removeClass("rotate");b.delay(function(){a(n.expanderContent).removeClass(n.paymentOptionExpand);
a(n.expanderContent).removeClass(n.skeletonLoaderExpand);k(f)},e.animationTimeoutUnit);c(n.toggleExpanderButton,!1);b.$(n.refreshCCText).hasClass("a-hidden")||b.$(n.refreshCCText).addClass("a-hidden")},showSubtitleInCollapsedView:k,showSubtitleInExpandedView:f,scrollToShowCompleteExpander:h}});"use strict";q.when("A","payment-options-state","payment-options-client-side-metric","cc-manager","payment-options-constants","payment-options-actions").register("payment-options-auto-expand",function(b,d,e,
g,l){var m=!1,h=function(){var f=document.getElementById("payment-options-expander-header"),h=d.getWeblabData().isAutoExpandWeblabInT1||d.getWeblabData().isAutoExpandWeblabInT2;if(f){if(f=h)f=g.getRenderedFeaturesList(),h=f[0]===l.featureRegistration.featureName,f=1===f.length&&h;f&&(f=JSON.parse(b.$("[data-toggle-payment-options-expander]").attr("data-toggle-payment-options-expander")),f.isAutoExpand=!0,b.trigger("a:declarative:expand-payment-options-expander",{data:f}),e.increment("Expander:AutoExpanded"),
m=!0)}};h();b.on("a:pageUpdate",h);return{isAutoExpanded:m}});"use strict";q.when("A").register("payment-options-expander-state",function(b){return{expanderSubtitle:{monthlyPaymentOptionsCollapsedSubtitle:"",monthlyPaymentOptionsExpandedSubtitle:"",loadingSubtitle:"Loading options..."},get isLoaded(){return this.property},set isLoaded(b){this.property=b}}});"use strict";q.when("A","payment-options-swatch-actions","payment-options-client-side-metric","multi-card-exp-payment-options").execute(function(b,
d,e,g){var l=b.$,m=!g.expTreatment||"T3"===g.expTreatment;b.declarative("payment-options-otp-action",["click","keydown"],function(h){if("keydown"!==h.type||13===h.$event.keyCode||32===h.$event.keyCode){e.increment("Swatch:OneTimePayment:Click");b.trigger("a:declarative:select-payment-option:click",{data:{}});var f=l(h.$currentTarget);f!==r&&null!==f&&(d.updateDefaultOptionSubtitle(h.data.defaultPOSubtitle,h.data.oneTimePaymentPOSubtitle),b.trigger("a:declarative:otp-selection:click",h),m||g.collapseCard())}});
b.declarative("payment-options-monthly-payment-action",["click","keydown"],function(d){if("keydown"!==d.type||13===d.$event.keyCode||32===d.$event.keyCode){var f=l(d.$currentTarget);f!==r&&null!==f&&(b.trigger("a:declarative:monthly-payment-option-selection:click",d),m||g.collapseCard(),e.logNexusEventForMonthlyPaymentSelection(d))}});b.declarative("payment-options-overflow","click",function(b){d.manageOverflow(b)});b.declarative("expander-update-visible-payment-options","click",function(b){var e=
l(b.$currentTarget);e!==r&&null!==e&&d.resetOverflowDefaultOptions(b)});b.declarative("update-swatch","click",function(b){"oneTimePaymentOption"===b.data.selectedPaymentOptionId?d.updateSwatchStyle(b.data.selectedPaymentOptionId):(d.updateSwatchStyle(b.data.selectedPaymentOptionId),d.updateFinancingOptionSubtitle(b.data.subtitleMessage,b.data.cardImageUrl))});b.declarative("disable-swatch","click",function(b){d.disableSwatch(b.$currentTarget)});b.declarative("enable-swatch","click",function(b){d.enableSwatch(b.$currentTarget)})});
"use strict";q.when("A","payment-options-expander-state","payment-options-constants","payment-plan-state").register("payment-options-swatch-actions",function(b,d,e,g){function l(b){f(k.swatchOption).removeClass(k.selectedOption);var c=f(k.swatchActionButton);c&&c.attr(a.ariaChecked,!1);b="oneTimePaymentOption"===b?f(k.oneTimePaymentOption):f("#"+b+"Swatch");b.addClass(k.selectedOption);(b=b.closest(k.swatchActionButton))&&b.attr(a.ariaChecked,!0)}function m(a){a.addClass(c.hideSwatchMainViewClass)}
function h(a,b){a.removeClass(c.hideSwatchMainViewClass);l(b);g.paymentOptionSelected.paymentOptionSelectedButtonId=b;g.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0}var f=b.$,k=e.selector,c=e.classes,a=e.attributes,n=d.expanderSubtitle;return{updateSwatchStyle:l,updateDefaultOptionSubtitle:function(a,b){n.monthlyPaymentOptionsCollapsedSubtitle=a;n.monthlyPaymentOptionsExpandedSubtitle=b;f(k.subtitleText).text(b);f(k.subtitle).removeClass("a-color-success");f(k.subtitle).addClass("a-color-tertiary");
f(k.checkmark).addClass("a-hidden");f(k.cardImage).attr("src","https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/transparent-pixel._V192234675_.gif")},updateFinancingOptionSubtitle:function(a,b){n.monthlyPaymentOptionsCollapsedSubtitle=a;n.monthlyPaymentOptionsExpandedSubtitle=a;f(k.subtitleText).text(a);f(k.subtitle).removeClass("a-color-tertiary");f(k.subtitle).addClass("a-color-success");f(k.checkmark).removeClass("a-hidden");f(k.cardImage).attr("src",b)},disableSwatch:function(a){var b=
a.find(k.financingOptions);b.removeClass(k.selectedOption);b.addClass(k.unavailableOption);a.addClass(k.disabledSwatch)},enableSwatch:function(a){a.find(k.financingOptions).removeClass(k.unavailableOption);a.removeClass(k.disabledSwatch)},manageOverflow:function(a){g.paymentOptionSelected.paymentOptionUnAvailableMsg=a.data.unAvailableMsg;var b=f("#"+a.data.paymentOptionSelectButtonId+"Swatch").parent().parent().parent();if(b.hasClass(c.hideSwatchMainViewClass)){for(var d=f(c.paymentOptionsList)[0].children,
e="",k=d.length-2;0<=k;k--)if(!f(d[k]).hasClass(c.hideSwatchMainViewClass)){e=f(d[k]);break}m(e);h(b,a.data.paymentOptionSelectButtonId)}else l(a.data.paymentOptionSelectButtonId),g.paymentOptionSelected.paymentOptionSelectedButtonId=a.data.paymentOptionSelectButtonId,g.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0},hideLastSwatch:m,unhideCorrespondingSwatch:h,resetOverflowDefaultOptions:function(a){if(!(3>=parseInt(a.data.numberOfPaymentOptions))){var b=f(c.paymentOptionsList)[0].children;
a="";for(var d=b.length-2;0<=d;d--)if(!f(b[d]).hasClass(c.hideSwatchMainViewClass)){a=f(b[d]);break}b=f(f(f(a.children()[0]).children()[0]).children()[0])[0];b.classList.contains(k.selectedOption)||"3"===b.id.match(/\d+/g)[0]||(m(a),f("#monthlyPaymentOption03Swatch").parent().parent().parent().removeClass(c.hideSwatchMainViewClass))}}}});"use strict";q.when("A").register("payment-plan-state",function(b){return{paymentOptionSelected:{paymentOptionSelectedButtonId:"oneTimePaymentOption",paymentOptionClickedFromSideSheet:!1,
paymentOptionDisabledButtonId:"",paymentOptionDisabledTitleSuppliment:"",paymentOptionUnAvailableMsg:""},get isSelected(){return this.property},set isSelected(b){this.property=b}}});"use strict";q.when("A","payment-plan-state","payment-options-constants","payment-options-client-side-metric").execute(function(b,d,e,g){var l=b.$;b.declarative("otp-selection","click",function(e){var h=l(e.$currentTarget[0].parentNode);e=e.data.paymentOptionSelectButtonId;"payment-options-list-item"===h[0].parentNode.className?
d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!1:(g.increment("SideSheet:OneTimePayment:Click"),d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0);d.paymentOptionSelected.paymentOptionSelectedButtonId=e;b.trigger("a:declarative:update-swatch:click",{data:{selectedPaymentOptionId:d.paymentOptionSelected.paymentOptionSelectedButtonId}})});b.declarative("monthly-payment-option-selection","click",function(e){e.data.hasOwnProperty("optionId")&&""!==e.data.optionId&&g.increment("Swatch:Financing:"+
e.data.optionId+":Click");g.increment("Swatch:MonthlyPayment:Click");b.trigger("a:declarative:select-payment-option:click",e);var h=l(e.$currentTarget);if(h!==r&&null!==h){var h=e.data.posubtitle,f=e.data.cardImageUrl,k=l(e.$currentTarget[0].parentNode),c=e.data.paymentOptionSelectButtonId;"payment-options-list-item"===k[0].parentNode.className?d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!1:(e.data.hasOwnProperty("optionId")&&""!==e.data.optionId?g.increment("SideSheet:Financing:"+e.data.optionId+
":Click"):g.increment("SideSheet:Financing:"+e.data.executionInfo.offerType+":"+e.data.termType+":"+e.data.termCount+":Click"),d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0);d.paymentOptionSelected.paymentOptionSelectedButtonId=c;b.trigger("a:declarative:update-swatch:click",{data:{selectedPaymentOptionId:d.paymentOptionSelected.paymentOptionSelectedButtonId,subtitleMessage:h,cardImageUrl:f}});b.trigger("a:declarative:payment-options-overflow:click",e)}});b.declarative("compare-payment-plans-disable",
"click",function(b){d.paymentOptionSelected.paymentOptionUnAvailableMsg=b.data.paymentOptionUnAvailableMsg;b=b.data.disabledPaymentOptionId;var g=b.match(/\d+/g)[0],g="#"+e.disabledPaymentOptionSelecter+g;d.paymentOptionSelected.paymentOptionDisabledButtonId=b;d.paymentOptionSelected.paymentOptionDisabledTitleSuppliment=l(g).text()});b.declarative("compare-payment-plans-enable","click",function(b){(b=b.data.enablePaymentOptionId)&&""!==b&&(b=b.match(/\d+/g)[0],d.paymentOptionSelected.paymentOptionDisabledButtonId=
"",l("#"+e.disabledPaymentOptionSelecter+b).text(d.paymentOptionSelected.paymentOptionDisabledTitleSuppliment),d.paymentOptionSelected.paymentOptionDisabledTitleSuppliment="",l("[id\x3d"+e.popOverText+b+"cell]").removeClass(e.classes.popOverShowClass),l("[id\x3d"+e.popOverText+b+"cell]").addClass(e.classes.popOverHideClass))})});"use strict";q.when("A","cc-payment-options","payment-options-client-side-metric").execute(function(b,d,e){b.declarative("payment-options-emp-action","change",function(b){d.updatePaymentOptionSelection(b.data)});
var g=b.debounce(function(){var d=b.$,g=d("#PaymentOptionsEmpAction");0<g.length&&g.trigger("change");0<d("#monthly-payments-not-applicable").length&&e.increment("Container:Render:Error");0<d(".payment-options-container").length&&e.increment("Container:Render:Success")},100);g();b.on("PageRefresh:ATF",g)});"use strict";q.when("A","payment-options-client-side-metric","cc-payment-options","payment-options-constants").execute(function(b,d,e,g){var l=b.$;d=new d.Timer("Expander:Loading:Images:Time");
d.start();e=function(){b.loadDescendantImagesManually(l(".payment-options-financing-option-card-image"));b.loadDescendantImagesManually(l(".payment-options-expander-heading-image-container"));b.loadDescendantImagesManually(l(".payment-option-detailed-feature-scroll"));b.loadDescendantImagesManually(l(".payment-options-side-sheet-header"));b.loadDescendantImagesManually(l(".payment-options-side-sheet-option-summary"));b.loadDescendantImagesManually(l(".payment-options-side-sheet-comparison-group-container"));
b.loadDescendantImagesManually(l(".payment-options-comparison-sheet-comparison-card-option"))};e();b.on("a:pageUpdate",e);d.stop()});"use strict";q.when("A","payment-options-swatch-actions","payment-options-constants","payment-options-state","cc-manager").execute(function(b,d,e,g,l){function m(a){var b=a.executionInfo;b.cartType=e.parameters.cartTypes.addToCart;return{itemType:e.parameters.itemType,price:a.price,selectionType:e.parameters.selectionType.ADD,enableIA:!1,priceAndTermCountDisplayString:a.priceAndTermCountDisplayString,
interestDisplayString:a.interestDisplayString,interestAmount:a.interestAmount,orderSummaryDisplayString:a.orderSummaryDisplayString,invalidSelectionTitle:a.cardName,isOrderLevel:!0,bottomSheetFootnoteDisplayString:a.bottomSheetFootnoteDisplayString,termCount:a.termCount,termType:a.termType,maxQuantity:a.maxQuantity,displayQuantityMessage:!0,formData:[{inputType:e.paymentOfferInputElement.inputType,inputName:e.paymentOfferInputElement.name,inputValue:b}]}}var h=b.$,f=e.selector,k=e.featureRegistration.featureName,
c;b.on("a:dropdown:selected:quantity",function(a){var n=h("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||0,q=h("#paymentOption_"+n+" .payment-options-list-item"),n=h("#paymentOption_"+n+" #oneTimePaymentOptionSwatch");a=a.value;for(var p=b.$(e.classSelector+f.selectedOption).closest(".payment-options-list-item").find("span.a-declarative").data(f.monthlyPaymentAction),r=1;r<q.length;r++){var u=q.eq(r).find("span.a-declarative").data(f.monthlyPaymentAction),x=u.maxQuantity;
x&&(a>x?(d.disableSwatch(q.eq(r)),x={data:{paymentOptionUnAvailableMsg:u.unAvailableText,numberOfPaymentOptions:u.numberOfPaymentOptions,disabledPaymentOptionId:u.paymentOptionSelectButtonId}},g.getWeblabData().isComparePlansRefactorWeblabInT1?b.trigger("a:declarative:compare-payment-plans-disable:click",x):d.disableOptionInCompareAllPlans(x),p&&u.offerGroup===p.offerGroup&&(h(n).click(),l.ccRemovedSelectionUpdate(k,m(u)),c=u.offerGroup)):(d.enableSwatch(q.eq(r)),g.getWeblabData().isComparePlansRefactorWeblabInT1?
b.trigger("a:declarative:compare-payment-plans-enable:click",{data:{enablePaymentOptionId:u.paymentOptionSelectButtonId}}):d.enableOptionInCompareAllPlans(u.numberOfPaymentOptions),c&&u.offerGroup===c&&(h(".tp-bbm-info-message-quantity-restriction-container").hasClass("tp-bbm-info-message-displayable")&&b.trigger("a:declarative:payment-options-monthly-payment-action:click",{$currentTarget:q.eq(r).find("span.a-declarative"),data:u}),l.ccRemovedSelectionsClear(k))))}})});"use strict";q.when("A","payment-options-constants").register("payment-options-state",
function(b,d){function e(){if(!l||0===Object.keys(l).length){var b=g(d.selector.paymentOptionsWeblabs).attr(d.selector.paymentOptionsWeblabsAttribute);b&&(l=JSON.parse(b))}return l}var g=b.$,l={};b={getWeblabData:e};e();return b});"use strict";q.when("A").register("payment-options-opt-out-state",function(b){return{paymentOptionOptOutSelected:{isOneTimePaymentPreferenceSet:!1,changePlanEventData:""},secondaryViewInstance:null}});"use strict";q.when("A","a-modal","payment-options-opt-out-state","price-block-messaging-constants",
"payment-options-client-side-metric","ready").execute("payment-options-modal",function(b,d,e,g,l){var m={};b.declarative("open-priceblock-change-plan-modal","click",function(b){l.incrementWithValuePriceBlockMessaging("Modal:PaymentOptions:Optout:Link:Click");var e="priceblock-change-plan-modal-"+b.data.buyingOptionIndex;Object.hasOwn(m,e)||(m[e]=d.create(b.$target,{header:b.data.optOutModalHeader,name:e,dataStrategy:"preload",width:484}));m[e].show()});b.declarative("priceblock-change-plan-modal-cancel-button",
"click",function(b){l.incrementWithValuePriceBlockMessaging("Modal:PaymentOptions:Optout:CancelButton:Click");m["priceblock-change-plan-modal-"+b.data.buyingOptionIndex].hide()});b.declarative("priceblock-change-plan-modal-continue-button","click",function(h){l.incrementWithValuePriceBlockMessaging("Modal:PaymentOptions:Optout:ContinueButton:Click");h=e.paymentOptionOptOutSelected.changePlanEventData;for(var f=Object.keys(m),k=0;k<f.length;++k){var c=f[k];d.remove(c);delete m[c]}e.paymentOptionOptOutSelected.isOneTimePaymentPreferenceSet=
!0;f=b.copy(h);f.data.paymentOptionSelectButtonId=g.ONE_TIME_PAYMENT_OPTION_ID;b.trigger("a:declarative:price-block-otp-action:click",f);h=b.copy(h);b.trigger("a:declarative:price-block-compare-payment-plans:click",h)})});"use strict";q.when("A","price-block-messaging-constants","payment-options-client-side-metric").register("price-block-landing-page-events",function(b,d,e){b.declarative("acquisition-offer-see-details","click",function(b){e.incrementWithValuePriceBlockMessaging(d.metrics.ACQUISITION_OFFER_SEE_DETAILS_BUTTON_CLICK,
1);try{var l=JSON.parse(b.data.landingPageUrl.paymentOfferInfoType).bannerDetailsPageUrl;u.open(l,"_blank")}catch(m){e.incrementWithValue("AcquisitionOffer:Desktop:LandingPageUrlParsingError",1)}});b.declarative("acquisition-offer-learn-more","click",function(b){e.incrementWithValuePriceBlockMessaging(d.metrics.ACQUISITION_OFFER_LEARN_MORE_CLICK,1);try{var l=JSON.parse(b.data.landingPageUrl.paymentOfferInfoType).learnMoreUrl;u.open(l,"_blank")}catch(m){e.incrementWithValue("AcquisitionOffer:Desktop:LearnMoreUrlParsingError",
1)}})});"use strict";q.when("A","price-block-messaging-constants","payment-options-client-side-metric","comparison-plans-actions").register("checkbox-price-block-actions",function(b,d,e,g){function l(b){h(f.CHECKBOX_PRICE_BLOCK).data(f.CHECKBOX_PRICE_BLOCK_DATA_KEY,b)}function m(b){h(f.CHECKBOX_PRICE_BLOCK).data(f.CHECKBOX_PRICE_BLOCK_DATA_OPTION_NOT_SELECTED_STRING_KEY,b)}var h=b.$,f=d.selector,k=d.actionData;return{getComparePlansV1SelectedOfferButtonId:function(){var b=f.COMPARE_PLAN_OFFER_BUTTON_ID_PREFIX,
a=h(f.CHECKBOX_PRICE_BLOCK).data(f.CHECKBOX_PRICE_BLOCK_DATA_KEY);a||(a=b+"01",l(a));return a},getComparePlansV2SelectedOfferButtonId:function(){var b=h(f.CHECKBOX_PRICE_BLOCK).data(f.CHECKBOX_PRICE_BLOCK_DATA_KEY);b||(b=f.CHECKBOX_PRICE_BLOCK_INITIAL_CP2_BUTTON,l(b));return b},getOptionNotSelectedString:function(){return h(f.CHECKBOX_PRICE_BLOCK).data(f.CHECKBOX_PRICE_BLOCK_DATA_OPTION_NOT_SELECTED_STRING_KEY)},updateCheckboxPriceblockData:l,updateCheckboxPriceblockOptionNotSelectedString:m,updateCheckboxWithTopOffer:function(b){b=
b.find(f.COMPARE_PLAN_LINK).find(f.DECLARATIVE_CLASS).data(k.COMPARE_PLAN_LINK_ACTION_DATA).buyingOptionIndex;b=g.getTopEnabledOfferDataInComparisonTable(b);l(d.ID_PREFIX+b.paymentOptionSelectButtonId);m(b.optionNotSelectedString)},markCheckboxPriceblock:function(){document.getElementById(f.CHECKBOX_PRICE_BLOCK_INPUT_ID).checked=!0},unmarkCheckboxPriceblock:function(){document.getElementById(f.CHECKBOX_PRICE_BLOCK_INPUT_ID).checked=!1},triggerCheckboxSelectedActions:function(c,a){b.defer(function(){h(c).click();
h(a).click()})},triggerCheckboxUnCheckedActions:function(b){h(b).click()},hasCheckboxPriceblock:function(){return h(f.CHECKBOX_PRICE_BLOCK).length}}})});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,n=e._namespace||e.attributeErrors,a=n?n("DetailPageClimatePledgeFriendlyNewAssets",""):e;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,e,n){g.when("A","climate-pledge-friendly-csm-counters").register("cpf-dpx-handlers",function(a,c){function d(){return a.capabilities.isAmazonApp?"map":a.capabilities.tablet?"twb":a.capabilities.mobile?"mwb":"dsk"}a.declarative("CPF-ATF-LandingPageLink","click",{allowLinkDefault:!0},
function(a){c.incrementCounter("cpf_dp_"+d()+"_dpcd_aflk")});a.declarative("CPF-BTF-LandingPageLink","click",{allowLinkDefault:!0},function(a){c.incrementCounter("cpf_dp_"+d()+"_dpcd_bflk")});a.declarative("CPF-OpenExternalLink","click",function(l){var h=l.$currentTarget[0].firstChild.href;c.incrementCounter("cpf_dp_"+d()+"_dpcd_excf");a.capabilities.isAmazonApp?g.when("mash").execute(function(a){e.location=h}):e.open(h,"_blank")});g.when("A").execute(function(a){a.on("a:image:lazyLoaded",function(a){a.hasClass("climatePledgeFriendlyLazyload")&&
c.recordLazyLoad()});a.on("a:image:load:cpf-leaf",function(){c.recordImageLoad()})});c.recordLatency()});"use strict";g.when("dp-latency-marker").register("climate-pledge-friendly-csm-counters",function(){return{incrementCounter:function(a,c){c=c||1;c=(ue.count(a)||0)+c;ue.count(a,c)},recordLatency:function(){"function"===typeof e.uet&&e.uet("bb","climate-pledge-friendly-dpx",{wb:1});"function"===typeof e.uet&&e.uet("x1","climate-pledge-friendly-dpx",{wb:1});"function"===typeof e.uex&&e.uex("ld",
"climate-pledge-friendly-dpx",{wb:1})},recordClick:function(){"function"===typeof e.uet&&e.uet("af","climate-pledge-friendly-dpx-click",{wb:1});"function"===typeof e.uex&&e.uex("ld","climate-pledge-friendly-dpx-click",{wb:1})},recordImageLoad:function(){"function"===typeof e.uet&&e.uet("be","climate-pledge-friendly-dpx-image-loading",{wb:1});"function"===typeof e.uex&&e.uex("ld","climate-pledge-friendly-dpx-image-loading",{wb:1})},recordLazyLoad:function(){"function"===typeof e.uet&&e.uet("cf","climate-pledge-friendly-dpx-image-loading",
{wb:1});"function"===typeof e.uex&&e.uex("ld","climate-pledge-friendly-dpx-image-loading",{wb:1})}}});g.when("dp-latency-marker").register("cpf-dpx-common-constants",function(){return{ATTRIBUTION_STRING:"DetailPageClimatePledgeFriendly",EVENT_ID_BOTTOM_SHEET_SHOW:"cpf-dpx-sheet",EVENT_ID_BOTTOM_SHEET_SECONDARY_SHOW:"cpf-dpx-sheet-secondary",EVENT_ID_BOTTOM_SHEET_SECONDARY_BACK:"cpf-dpx-sheet-secondary-back",EVENT_ID_SIDE_SHEET_SHOW:"cpf-dpx-sidesheet-open",EVENT_ID_SIDE_SHEET_HIDE:"cpf-dpx-sidesheet-close",
EVENT_ID_SIDE_SHEET_CAPTURE:"cpf-dpx-sidesheet-capture",EVENT_ID_SIDE_SHEET_SECONDARY_SHOW:"cpf-dpx-sidesheet-secondary",EVENT_ID_SIDE_SHEET_SECONDARY_BACK:"cpf-dpx-sidesheet-secondary-back",EVENT_ID_SUST_CARD_TRIGGER:"cpf-dpx-wl-trigger",EVENT_ID_SUST_CARD_ADJUST:"cpf-dpx-sust-card-adjust",SELECTOR_BOTTOM_SHEET_CONTAINER:".cpf-dpx-container-bottom-sheet",SELECTOR_BOTTOM_SHEET_CONTAINER_SECONDARY:".cpf-dpx-container-bottom-sheet-secondary",SELECTOR_BOTTOM_SHEET_SECONDARY_BACK_BUTTON:".cpf-dpx-detail-view-secondary-back",
SELECTOR_BOTTOM_SHEET_CAROUSEL:".cpf-dpx-bottom-sheet-carousel",SELECTOR_PROGRAM_STICKY_FOOTER:".cpf-dpx-sticky-footer",SELECTOR_SIDE_SHEET_SECONDARY_BACK_BUTTON:".cpf-dpx-detail-view-secondary-back",SIDE_SHEET_CONTAINER_ID:"cpf-dpx-sidesheet-container",SIDE_SHEET_START_ANCHOR_CLASSNAME:"cpf-dpx-sidesheet-anchor-start",SIDE_SHEET_END_ANCHOR_CLASSNAME:"cpf-dpx-sidesheet-anchor-end",CAROUSEL_INITIALIZED_CLASS:"a-carousel-initialized",CAROUSEL_NOT_INITIALIZED_CLASS:"a-carousel-static",KEYCODE_ESCAPE:27,
KEYCODE_TAB:9,SCROLL_CORRECTION_OFFSET:5,SCROLL_EVENT_THROTTLE_MS:150,BOTTOM_SHEET_HEIGHT_CHANGE_DURATION:.3,SCROLL_EVENT_DELAY_MS:1E3,SIDE_SHEET_OPEN_ANIMATION_DELAY_MS:300,SIDE_SHEET_CLOSE_ANIMATION_DELAY_MS:200,MS_CONVERT:1E3,TRIGGER_URI:"/ussx/weblab-trigger?",QC_WEBLAB:"CONSUMABLES_CPF_QUANTIFIABLE_CLAIMS_1080213",SUST_CARD_WEBLAB:"CONSUMABLES_DP_CPF_SUST_CARD_EXP_1244410"}});g.when("A","cpf-dpx-common-constants","cpf-dpx-sidesheet-util","cpf-dpx-trigger-utils","ready").register("cpf-dpx-sidesheet",
function(a,c,d,l){var h=e.ue&&e.ue.count||function(){};a.declarative(c.EVENT_ID_SIDE_SHEET_SHOW,"click",function(b){var e=b.$currentTarget,m;b.data.preloadDomId?(b.data.ctMetric&&h(b.data.ctMetric,1),b.data.qcTrigger&&l.triggerQCWeblab(b.data.qcTrigger,c.QC_WEBLAB),d.preloadSheet(b.data.preloadDomId,b.data.popoverLabel,b.data.closeButtonLabel,!!b.data.removeBackButton),d.showSheet(),a.one("cpf-dpx-sidesheet:afterShow",function(b){a.loadDescendantImagesManually(b.sheet);m=a.now()}),a.one("cpf-dpx-sidesheet:afterHide",
function(){var d;e&&e.length&&(d=e.find("a").first())&&d.length&&d.focus();b.data.dwellMetric&&m&&h(b.data.dwellMetric,(a.now()-m)/c.MS_CONVERT)})):g.log("Sidesheet show error: missing DOM ID for loading","ERROR",c.ATTRIBUTION_STRING)});a.declarative(c.EVENT_ID_SIDE_SHEET_SECONDARY_SHOW,"click",function(b){b.data.preloadDomId&&b.data.previousPreloadDomId?a.$("#"+b.data.preloadDomId).length?(b.data.ctMetric&&h(b.data.ctMetric,1),d.preloadSecondaryContent(b.data.preloadDomId),d.addBackActionData(b.data.ctDwellMetric,
0!==b.$target.length?b.$target.attr("id"):b.data.previousPreloadDomId),d.showSecondaryContent()):(b.data.delayMetric&&h(b.data.delayMetric,1),g.log("Can not find secondary sheetContent by preloadDomId in desktop side sheet","INFO",c.ATTRIBUTION_STRING)):g.log("Sidesheet secondary show error: missing DOM ID for loading","ERROR",c.ATTRIBUTION_STRING)});a.declarative(c.EVENT_ID_SIDE_SHEET_SECONDARY_BACK,"click",function(b){b.data&&b.data.returnFocusId?d.hideSecondaryContent(b.data.returnFocusId):d.hideSecondaryContent();
b.data&&b.data.ctDwellMetric&&b.data.ctDwellStart&&h(b.data.ctDwellMetric,(a.now()-b.data.ctDwellStart)/c.MS_CONVERT)});a.declarative(c.EVENT_ID_SIDE_SHEET_HIDE,"click",function(){d.hideSheet()});a.declarative(c.EVENT_ID_SIDE_SHEET_CAPTURE,"keydown",function(a){"keydown"!==a.type||a.$event.keyCode!==c.KEYCODE_ESCAPE&&a.$event.key!==c.KEYCODE_ESCAPE||d.hideSheet()});a.declarative(c.EVENT_ID_SIDE_SHEET_CAPTURE,"focusin",function(b){b.$target.length&&b.$target.hasClass(c.SIDE_SHEET_END_ANCHOR_CLASSNAME)&&
a.delay(function(){d.focusOnFirst()},0)});a.declarative(c.EVENT_ID_SIDE_SHEET_CAPTURE,"focusout",function(b){b.$target.length&&a.delay(function(){a.$(document.activeElement).hasClass(c.SIDE_SHEET_START_ANCHOR_CLASSNAME)&&d.focusOnLast()},0)});a.on("a:expander:pc_sidesheet_expander:toggle:expand",function(a){a.expander&&a.expander.$expander&&a.expander.$expander.data("eometric")&&h(a.expander.$expander.data("eometric"),1)});a.on(c.EVENT_ID_SUST_CARD_TRIGGER,function(a){"sustExpanderTreatment"in a&&
l.triggerQCWeblab(a.sustExpanderTreatment,c.SUST_CARD_WEBLAB)})});"use strict";g.when("A","jQuery","cpf-dpx-common-constants").register("cpf-dpx-sidesheet-util",function(a,c,d){function e(){return c("#"+d.SIDE_SHEET_CONTAINER_ID)}function h(a){return a.find("#cpf-dpx-sidesheet-content-container")}function b(a){return a.find("#cpf-dpx-sidesheet-background")}function p(a){return a.find("#cpf-dpx-sidesheet-content")}function m(a){return a.find("#cpf-dpx-sidesheet-secondary-content")}function n(b){var d=
e(),f=p(d),g=m(d);a.hide(g);a.show(f);g.attr("aria-hidden","true");f.attr("aria-hidden","false");d.find(".cpf-dpx-sidesheet-anchor-start").focus();b&&(b=c("#"+b),b.length&&b.focus())}return{preloadSheet:function(b,h,k,l){var f=e();b=c("#"+b);f&&0!==f.length||(f=c(document.createElement("div")),f.attr("id",d.SIDE_SHEET_CONTAINER_ID),f.addClass("a-section a-spacing-none"),f.append('\x3cspan class\x3d"a-declarative" data-action\x3d"'+d.EVENT_ID_SIDE_SHEET_CAPTURE+'"\x3e\x3cspan class\x3d"a-declarative" data-action\x3d"cpf-dpx-sidesheet-close" aria-label\x3d"'+
k+'" tabindex\x3d"0"\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-background" class\x3d"cpf-dpx-sidesheet-background" aria-hidden\x3d"true"\x3e\x3c/div\x3e\x3c/span\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-content-container" class\x3d"cpf-dpx-sidesheet" aria-modal\x3d"true" role\x3d"dialog" aria-labelledby\x3d"cpf-dpx-sidesheet-label" aria-hidden\x3d"true"\x3e\x3cspan tabindex\x3d"0" class\x3d"'+d.SIDE_SHEET_START_ANCHOR_CLASSNAME+' cpf-dpx-sidesheet-a11y-label"\x3e\x3c/span\x3e\x3cheader\x3e\x3cspan id\x3d"cpf-dpx-sidesheet-label" class\x3d"cpf-dpx-sidesheet-a11y-label aok-block" aria-hidden\x3d"true"\x3e'+
h+'\x3c/span\x3e\x3cbutton class\x3d"a-declarative cpf-dpx-sidesheet-close-button" data-action\x3d"cpf-dpx-sidesheet-close" aria-label\x3d"'+k+'"\x3e\x3cdiv class\x3d"a-icon cpf-dpx-sidesheet-close-icon"\x3e\x3c/div\x3e\x3c/button\x3e\x3c/header\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-content" aria-hidden\x3d"true"\x3e\x3c/div\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-secondary-content" aria-hidden\x3d"true"\x3e\x3c/div\x3e\x3cspan tabindex\x3d"0" class\x3d"'+d.SIDE_SHEET_END_ANCHOR_CLASSNAME+' cpf-dpx-sidesheet-a11y-label"\x3e\x3c/span\x3e\x3c/div\x3e\x3c/span\x3e'),
c("body").prepend(f));b&&0!==b.length?(p(f).html(b.html()),l&&p(f).find(d.SELECTOR_SIDE_SHEET_SECONDARY_BACK_BUTTON).parent().remove(),a.loadDescendantImagesManually(f)):g.log("Can not find the sheetContent by preloadDomId in desktop side sheet","ERROR",d.ATTRIBUTION_STRING)},showSheet:function(){var f=e(),g=b(f),k=h(f),l=p(f);a.show(f);n();k.attr("aria-hidden","false");l.attr("aria-hidden","false");f.find(".cpf-dpx-sidesheet-close-button").focus();c("#a-page").attr("aria-hidden","true");c("body").css("overflow",
"hidden");a.show(g);k.show(function(){a.animate(k,{right:"0"},d.SIDE_SHEET_ANIMATION_DELAY_MS,"ease-out",function(){a.trigger("cpf-dpx-sidesheet:afterShow",{sheet:f})})})},hideSheet:function(){var f=e(),g=b(f),k=h(f);k.attr("aria-hidden","true");c("#a-page").attr("aria-hidden","false");c("body").css("overflow","");a.hide(g);a.animate(k,{right:"-500px"},d.SIDE_SHEET_ANIMATION_DELAY_MS,"ease-out",function(){a.hide(f);a.trigger("cpf-dpx-sidesheet:afterHide",{sheet:f})})},addBackActionData:function(b,
c){var f=e();f=m(f).find(d.SELECTOR_SIDE_SHEET_SECONDARY_BACK_BUTTON).parent();b={returnFocusId:c,ctDwellMetric:b,ctDwellStart:a.now()};a.declarative.create(f,d.EVENT_ID_SIDE_SHEET_SECONDARY_BACK,b);f.attr("data-action",d.EVENT_ID_SIDE_SHEET_SECONDARY_BACK);f.attr("data-"+d.EVENT_ID_SIDE_SHEET_SECONDARY_BACK,JSON.stringify(b));f.removeAttr("action-name");f.removeAttr("action-params")},preloadSecondaryContent:function(b){var f=e();b=c("#"+b);f=m(f);b&&0!==b.length?(f.html(b.html()),a.loadDescendantImagesManually(f)):
g.log("Can not find secondary sheetContent by preloadDomId in desktop side sheet","ERROR",d.ATTRIBUTION_STRING)},hideSecondaryContent:n,showSecondaryContent:function(){var b=e(),c=p(b),d=m(b);a.hide(c);a.show(d);d.attr("aria-hidden","false");c.attr("aria-hidden","true");b.find(".cpf-dpx-sidesheet-anchor-start").focus()},focusOnFirst:function(){var a=e();h(a).find("a[href], button").first().focus()},focusOnLast:function(){var a=e();h(a).find("a[href], button").last().focus()}}});g.when("A","cpf-dpx-common-constants").register("cpf-dpx-trigger-utils",
function(a,c){return{triggerQCWeblab:function(d,g){var h="";e.ue&&(h=e.ue.id);d=c.TRIGGER_URI+"weblabValue\x3d"+g+"\x26treatment\x3d"+d+"\x26requestId\x3d"+h;navigator&&navigator.sendBeacon?navigator.sendBeacon(d):a.$.ajax({url:d})}}});g.when("A","cpf-dpx-common-constants").execute("cpf-dpx-bond-initialization",function(a,c){var d=e.ue&&e.ue.count||function(){};a.on("a:expander:cpf_dpx_bond_expander:toggle:expand",function(a){a.expander&&a.expander.$expander&&a.expander.$expander.data("eometric")&&
d(a.expander.$expander.data("eometric"),1)})})});
/* ******** */
(function(f){var d=window.AmazonUIPageJS||window.P,F=d._namespace||d.attributeErrors,a=F?F("FreshDetailPageCommonAssets",""):d;a.guardFatal?a.guardFatal(f)(a,window):a.execute(function(){f(a,window)})})(function(f,d,F){f.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,e,d,c,u,m,n,b,r,q,g){var p;f.when("EWC").execute(function(b){p=
b});f.when("nav.getFlyout").execute(function(b){b("ewc")});var A={"itemPrice:priceUnavailable:1":"PRICE_UNAVAILABLE","itemDeleted:itemCountOverflow:6":"QUANTITY_OVERFLOW"};return{addToFreshCart:function(m){function h(b,a,k,l){x(b);m.error(b,a,k,l)}function x(l,c){c=c||{};var g=l.data.sessionID;c.title=D(l.data.title);c.asin=l.data.asin;c.offerListingID=l.data.offerListingID;c.sessionID=g;switch(c.reasonCode?c.reasonCode:F){case y.itemNotAvailable:b.increment(k.freshUATCItemNotAvailableErrorCountMetric);
break;case y.itemPartiallyAvailable:b.increment(k.freshUATCItemPartiallyAvailableErrorCountMetric);break;case y.itemPartiallyAvailableForReservation:b.increment(k.freshUATCItemPartiallyAvailableForReservationErrorCountMetric);break;case y.itemNotAvailableForReservation:b.increment(k.freshUATCItemNotAvailableForReservationErrorCountMetric);break;case y.itemPriceUnavailable:b.increment(k.freshUATCItemPriceUnavailableErrorCountMetric);break;case y.itemCountOverflow:b.increment(k.freshUATCItemCountOverflowErrorCountMetric);
break;default:b.increment(k.freshUATCEmptyItemStatusCodeErrorCountMetric),f.log("fresh-atc-handler: No error status code.","ERROR")}c=e.param(c);d.create(l.$currentTarget,{name:"fresh-add-to-cart-modal",sessionID:g,url:"/afx/cart/reservation_conflict?"+c}).show();a.on("a:popover:afterHide:fresh-add-to-cart-modal",function(b){v(g);d.remove(b.popover)})}function D(b){var a={"\x26amp;":"\x26"},l;for(l in a)a.hasOwnProperty(l)&&(b=b.replace(l,a[l]));return b}function B(b){return b.filter(function(b){return b.statusKey in
A})}function l(b,l,a){a+=" returned by UATC is not an array";f.log(a,"Error",l);h(b,"","",a)}function t(e,g,d){d||(d=function(){});try{var m=e.data.asin;if(m)if(e.data.title){var z=e.data.offerListingID;if(z){var r=e.data.sessionID;if(r){var n=q.val();n||(f.log('fresh-atc-handler: "quantity" action parameter is missing.',"ERROR"),n=1);b.setWidgetClickTimestamp(k.freshUATCTCallScope);c({asin:m,offerListingID:z,sessionID:r,quantity:n,reftag:"afx-dp-addtocart",success:function(c){try{b.sendWidgetMetrics(k.freshUATCTCallScope);
var m;if(c&&c.isOK){var z=c.extraErrorInfos;if(z&&z.constructor===Array&&0<z.length)m=!0;else{var q=c.statusList,C;if(q&&q.constructor===Array&&0<q.length){var y=B(q);C=y&&0<y.length}else C=!1;m=C?!0:!1}}else m=!0;if(m)if(b.increment(k.freshUATCInvalidErrorResponseCountMetric),c)if(c.isOK){var v=c.extraErrorInfos,t=c.statusList;if(v&&v.constructor!==Array)l(e,v,"extraErrorInfos");else if(0<v.length){if(v&&!(0>=v.length)){var u=v[0];"ADDRESS_NOT_SELECTED"===u.statusCode?(b.increment(k.freshUATCAddressNotSelectedErrorCountMetric),
f.log("fresh-atc-handler: Address is not selected.","INFO")):x(e,{reasonCode:u.itemStatusCode,quantityAdded:u.availableQuantity,quantityRequested:u.requestedQuantity})}}else if(t&&t.constructor!==Array)l(e,t,"statusList");else if(0<t.length&&t&&!(0>=t.length)){var p=B(t);p&&0<p.length&&x(e,{reasonCode:A[p[0].statusKey]})}}else b.increment(k.freshUATCFailureCountMetric),h(e,"","","isOK returned by UATC is false");else b.increment(k.freshUATCFailureCountMetric),h(e,"","","No response from UATC");else b.increment(k.freshUATCSuccessCountMetric),
g(c,r,n)}catch(w){b.increment(k.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+w,"ERROR")}finally{a.delay(d,E.reEnableDelay)}},error:function(l,c,g){try{b.sendWidgetMetrics(k.freshUATCTCallScope),b.increment(k.freshUATCFailureCountMetric),h(e,l,c,g)}catch(m){b.increment(k.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+m,"ERROR")}finally{a.delay(d,E.reEnableDelay)}}})}else f.log('fresh-atc-handler: Required "sessionID" action parameter is missing.',
"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),h(e)}else f.log('fresh-atc-handler: Required "offerListingID" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),h(e)}else f.log('fresh-atc-handler: Required "title" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),h(e);else f.log('fresh-atc-handler: Required "asin" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),
h(e)}catch(C){b.increment(k.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+C,"ERROR"),a.delay(d,E.reEnableDelay)}}function v(b){p&&"function"===typeof p.refresh?p.refresh():u(b)}var E={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"},y={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"},C=function(b,l,a){r(a);v(l);m.success(b)};a.declarative("fresh-atc-handler","click",n(function(l,a){q.valid()?(g.vibrate(),b.increment(k.freshAddToCartClickCountMetric),t(l,C,a)):a()}))}}});"use strict";f.when("A","jQuery","a-button","fresh-show-atl-changeover","ready").register("FreshAddToShoppingList",function(a,e,d,c){function u(b){e("#"+b.asin+"-afx-atl-dropdown").change(function(a){b.$alreadyInMessage.addClass("aok-hidden");
b.$errorMessage.addClass("aok-hidden")})}function m(b){var e=(a.state("baseWidgetState")||{}).csrfToken;a.post("/afx/lists/json/shoppinglists/additem",{cache:!1,timeout:5E3,params:{asin:b.asin,listID:b.shoppingListID,token:e},success:function(a){b.addButtonInstance.enable();a.successful?(b.$modalParent.find("#"+b.cancelButtonID).click(),c()):1===a.errorCodes[0]?b.$alreadyInMessage.removeClass("aok-hidden"):n(b)},error:function(){b.addButtonInstance.enable();n(b)}})}function n(b){b.$errorMessage.removeClass("aok-hidden");
f.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)f.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?(f.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:
(f.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"),u(b),m(b)))}})});"use strict";f.when("A",
"jQuery","fresh-add-to-cart","fresh-dp-quantity","fresh-show-atc-changeover").execute(function(a,e,d,c,u){d.addToFreshCart({success:function(a,c){u(a.data.renderableSellingQuantity?a.data.renderableSellingQuantity:a.data.quantity);a=c.couponClipStatus;if("CLIP_SUCCESSFUL"===a||"ALREADY_CLIPPED"===a)e("#unclippedCoupon").hide(),e("#clippedCoupon").show()},error:function(a,c,b,e){}});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())});f.when("fresh-atfc-hook").execute(function(a){a.callback()})});f.when("A","jQuery","a-dropdown","fresh-dp-constants","fresh-add-to-cart","a-button").register("fresh-dp-quantity",function(a,e,d,c,f,m){return function(){var n,b,r,q,g,p,A,w,h,x,D,B,l,t=function(){if(!n){b=e(c.addToCartButtonSelector);g=d.getSelect(c.dropdownID);if(r=!!g){q=e(c.dropdownDivSelector);var a=g.getOptions().size();
a&&(A=a-1)}w=e(c.freeTextDivSelector);if(p=0!==w.length)h=e(c.freeTextInputSelector),x=e(c.freeTextErrorDivsSelector),D=e(c.freeTextErrorMsgMin),B=e(c.freeTextErrorMsgMax)}},v=function(){a.on(c.dropdownSelectedID,function(a){e(a.nativeItemNode).index()===A?(h.attr("validValue",l),h.val(l),w.show(),x.hide(),q.hide(),h.focus().select(),g.val("1")):l=g.val()});var k=function(){var a=h.attr("validValue");a&&(g.val(a),g.val()===a?(l=a,q.show(),w.hide()):(f.updateQuantity("freshAddToCartButton",a),b.focus()))},
d=function(){var a=E(h.val());h.attr("validValue",a?a:"")};h.change(d);h.keyup(d);h.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&&(k(),b.click());return!1});h.blur(k)},E=function(){var a;a:{a=h.val();if(c.rxNumbersOnly.test(a)&&(a=parseInt(a,10),!isNaN(a)))break a;a=!1}x.hide();var b=m(c.addToCartButtonSelector);if(!1===a||0>=a)D.show(),b.isEnabled()&&b.disable();else if(1E3<=a)B.show();else return b.isEnabled()||
b.enable(),String(a);return!1};return{init:function(){n=!1;t();n=!0;if(p){w.hide().removeClass(c.auiHiddenClass);x.hide().removeClass(c.auiHiddenClass);var a=g.getOption(A),b=a.info()[0].text;a.update({value:"0",text:e.trim(b)+"+"});l=g.val();v()}},valid:function(){t();return p&&w.is(":visible")?!1!==E():!0},val:function(){t();return p&&w.is(":visible")?h.attr("validValue"):r?g.val():1}}}()});f.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"}});
f.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,e){a.on("a:expander:ingredients-expander:toggle:expand",function(a){e.increment("almIngredientsExpand")});a.on("a:expander:ingredients-expander:toggle:collapse",function(a){e.increment("almIngredientsCollapse")})});f.when("A","ready").register("fresh-dp-prevent-atc-default",function(a){return{init:function(){a.$("#addToFreshCart").submit(function(a){a.preventDefault()})}}});"use strict";f.when("A","jQuery","a-button","ready").register("fresh-multiselleroffers-pagination-handler",
function(a,e,d){function c(a){var c=parseInt(n.attr("data-currentPage"),10),d=parseInt(n.attr("data-pageCount"),10),c="next"===a?c+1:c-1;n.attr("data-currentPage",c);0===c?b.disable():b.enable();c===d-1?r.disable():r.enable();e(".freshMultiSellerOffer").addClass("hidden");e('.freshMultiSellerOffer[data-page\x3d"'+c+'"]').removeClass("hidden")}var f=e("#freshMultiSellerOffersPreviousPage"),m=e("#freshMultiSellerOffersNextPage"),n=e("#freshMultiSellerOffersPagination"),b=d(f),r=d(m);a.declarative.create(f,
"fresh-multiselleroffers-previous-page",{});a.declarative.create(m,"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){r.isEnabled()&&c("next")})});"use strict";f.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,e){d.ue&&d.uet&&a&&
e&&d.uet(a,e,{wb:1})},increment:function(a){d.ue&&d.ue.count&&a&&d.ue.count(a,(d.ue.count(a)||0)+1)},setCount:function(a,e){d.ue&&d.ue.count&&a&&e&&d.ue.count(a,e)},sendWidgetMetrics:function(a){d.ue&&d.uex&&a&&d.uex("ld",a,{wb:1})}}});"use strict";f.when("A","jQuery","a-button","ready").register("fresh-dp-double-click",function(a,e,d){return function(c){var e={disabled:"true"},d={};return function(f){var b=a.state("fresh-atc-status");b&&b.disabled||(b&&a.state("fresh-atc-status",e),c(f,function(){(b=
a.state("fresh-atc-status"))&&a.state.replace("fresh-atc-status",d)}))}}});"use strict";f.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";f.when("A","jQuery","fresh-show-atl-changeover","afx-dp-csm-metrics-utils","ready").register("FreshAddToAlexaLists",
function(a,e,z,c){function u(a){c.increment(g.countAddToAlexaList);a.data.isAlmInStoreMode&&c.increment(g.countISMAddToAlexaList);c.setWidgetClickTimestamp(g.addToAlexaListCallTime);r(a);var b=Date.now(),h=n(a);e.ajax({url:a.data.url,type:"POST",contentType:"application/json",Accept:"application/json",timeout:5E3,dataType:"json",data:JSON.stringify(a.data.alexaListV2Payload),headers:{"x-amzn-as-metadata":JSON.stringify(h)},success:function(e){c.sendWidgetMetrics(g.addToAlexaListCallTime);c.increment(g.addToAlexaListCallSuccess);
if(a.data.isUnifiedMobileCx){a.$currentTarget.find(".afx-dp-add-to-alexa-list-unified-mobile-text").addClass("aok-hidden");a.$currentTarget.find(".afx-dp-added-to-alexa-list-unified-mobile-text").removeClass("aok-hidden");var d=a.$currentTarget.find("button");d.prop("disabled",!0);a.data.isMobileWfm?d.addClass("afx-dp-add-to-alexa-list-unified-mobile-wfm-success"):d.addClass("afx-dp-add-to-alexa-list-unified-mobile-success")}else z();m(b,Date.now(),a,e);q(a)},error:function(b,e,h){c.sendWidgetMetrics(g.addToAlexaListCallTime);
c.increment(g.addToAlexaListCallFail);f.log("Error response: "+b.responseText,"ERROR");b.status===B?a&&a.data&&a.data.signInURL&&(d.location=a.data.signInURL):f.log("Failed to add item to shopping list "+a.data.title+", url : "+a.data.url,"ERROR");q(a)}})}function m(a,c,d,g){a=0<g.itemInfoList.length?b(a,c,d.data.underscoredBrandName,d.data.sessionId,g.itemInfoList[0]):{eventName:p+w,eventType:h,eventVersion:1,pageName:h+x+d.data.underscoredBrandName,eventStartTime:a,delay:c-a,listType:"SHOP",isDefaultList:!0,
sessionId:d.data.sessionId};d=n(d);e.ajax({url:D,type:"POST",contentType:"application/json",Accept:"application/json",timeout:5E3,dataType:"json",data:JSON.stringify(a),headers:{"x-amzn-as-metadata":JSON.stringify(d)},error:function(a,b,c){f.log("Error response: "+a.responseText,"ERROR")}})}function n(a){var b=a.data.alexaListV2Payload.items[0];return{requestType:a.data.requestType,applicationName:"unknown",applicationVersion:"unknown",ssnapVersion:0,rnVersion:"unknown",osName:"unknown",osVersion:"unknown",
appId:"unknown",bundleVersion:"unknown",isBeta:!1,localeInfo:{marketplaceId:a.data.marketplaceCountryCode,localeId:b.locale,marketplaceObfuscatedId:b.marketplaceId},deviceInfo:{model:"unknown",manufacturer:"unknown"},stage:"Prod"}}function b(a,b,c,e,d){return{eventName:p+A,eventType:h,eventVersion:1,pageName:h+x+c,eventStartTime:a,delay:b-a,listId:d.listId,listType:"SHOP",isDefaultList:!0,sessionId:e,item:{id:d.itemId,listId:d.listId,value:d.itemName,encryptedValue:d.encryptedItemName,updatedDateTime:d.updateAt,
createdDateTime:d.createAt,customerId:d.customerId,version:1,itemType:d.itemType}}}function r(a){a.data.isUnifiedMobileCx?(a.$currentTarget.addClass("aok-hidden"),a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-unified-mobile-spinner").removeClass("aok-hidden")):(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 q(a){a.data.isUnifiedMobileCx?(a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-unified-mobile-spinner").addClass("aok-hidden"),
a.$currentTarget.removeClass("aok-hidden")):(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"))}a.declarative("add-to-alexa-lists","click",function(a){q(a);u(a)});var g={countAddToAlexaList:"countAddToAlexaList",addToAlexaListCallTime:"addToAlexaListCallTime",addToAlexaListCallSuccess:"addToAlexaListCallSuccess",addToAlexaListCallFail:"addToAlexaListCallFail",countISMAddToAlexaList:"countISMAddToAlexaList"},
p="ADD_ITEM_",A="SUCCESS",w="FAILURE",h="F3_Detail_Page",x="_",D="/alexashoppinglists/api/logevents",B=401});f.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,d){a.on("a:expander:alm-nutrition-information-expander:toggle:expand",function(){document.querySelectorAll(".js-hide-when-nutrition-info-expanded").forEach(function(a){a.style.display="none"});d.increment("almNutritionalInformationExpand")});a.on("a:expander:alm-nutrition-information-expander:toggle:collapse",function(){document.querySelectorAll(".js-hide-when-nutrition-info-expanded").forEach(function(a){a.style.display=
""});d.increment("almNutritionalInformationCollapse")})});f.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,d){a.declarative("almCRIngress-click-metrics","click",{allowLinkDefault:!0},function(a){d.increment("almCustomerReviewsATF")})})});
/* ******** */
(function(r){var w=window.AmazonUIPageJS||window.P,F=w._namespace||w.attributeErrors,A=F?F("QuantitySelectorAssets",""):w;A.guardFatal?A.guardFatal(r)(A,window):A.execute(function(){r(A,window)})})(function(r,w,F){function A(p){var f=!1;r.now(p).execute("qsAssetDuplicationGuard",function(a){f=!!a});return f}function L(p,f){if(!A(p))try{r.register(p,f)}catch(a){if(!a.message.includes("reregistered by QuantitySelectorAssets"))throw a;}}function Ea(){var p=arguments;return{register:function(f,a){if(!A(f))try{r.when.apply(r,
p).register(f,a)}catch(c){if(!c.message.includes("reregistered by QuantitySelectorAssets"))throw c;}},execute:function(f,a){r.when.apply(r,p).execute(f,a)}}}L("QSAssetDuplicationGuard",function(){return{register:L,when:Ea}});"use strict";r.when("QSAssetDuplicationGuard").execute("qsAUIDeps-main-duplication-guard",function(p){p.when("A","QuantitySelectorConstants","a-util").execute("qsAUIDeps-main",function(f,a,c){function h(){v&&v.enableCheckoutCompatibility&&g()}function g(){f.$('span[id^\x3d"'+
a.getQsWidgetSummaryPriceId("")+'"][data-a-color\x3d"price"]').each(function(){f.$(this)[0].style.color="#B12704"});f.$('span[id^\x3d"'+a.getQsWidgetButtonId("")+'"]').each(function(){var a=f.$(this);a.hasClass("a-button-dropdown")&&a.hasClass("a-button-small")&&(a=a.attr("id"),f.$('button[id^\x3d"'+a+'-announce"]').each(function(){f.$(this)[0].style.paddingRight="17px"}))})}function k(a){function c(a){return f.$(a+"-announce")}return function(a){return new c(a)}}function G(c){var d=function(a,d){var e=
a+"-extradata",k=c.state(e);if(null==d)return e=c.state(a),d=f.$.extend({},e,k);k=f.$.extend({},k,d);c.state(e,k)};d.parse=function(){for(var d=f.$(a.getQsWidgetGenericStateSelectorQuery()),k=a.getQsWidgetConfigurationId(""),e=0;e<d.length;e++)try{var l=d[e].getAttribute("data-a-state"),q=JSON.parse(l).key;if(q&&q.substring(0,k.length)==k){var x=c.state(q);if(!x||!x.id){var g=JSON.parse(d[e].innerHTML);c.state(q,g)}}}catch(N){var v=a.getQsWidgetConfigurationJsonString(),G=a.getQsWidgetStateAttributeJsonString();
if(l.includes(G)||d[e].innerHTML.includes(v))throw N;}};d.replace=function(a,d){a+="-extradata";"function"===typeof c.state.replace?c.state.replace(a,d):c.state(a,d)};return{state:d}}var v;r.when("QuantitySelectorAUIDeps_AState","QuantitySelectorAUIDeps_AButton").execute("qsAUIDeps-register",function(a,d){p.register("QuantitySelectorAUIDeps",function(){return{aUtil:c,aState:a.object,aButton:d.object,initialize:h}})});(function(){for(var c=f.$(a.getQsWidgetGenericStateSelectorQuery()),d=a.getQsWidgetGlobalConfigurationId(),
k=0;k<c.length;k++)try{var g=c[k].getAttribute("data-a-state"),e=JSON.parse(g).key;if(e&&e.substring(0,d.length)==d){v=JSON.parse(c[k].innerHTML);break}}catch(x){var l=a.getQsWidgetConfigurationJsonString(),q=a.getQsWidgetStateAttributeJsonString();if(g.includes(q)||c[k].innerHTML.includes(l))throw x;}})();(function(){v&&v.enableCheckoutCompatibility?(r.when("a-state").execute("qsAUIDeps-checkout-compat-a-state-register",function(a){p.register("QuantitySelectorAUIDeps_AState",function(){return{object:G(a)}})}),
r.when("a-buttons").execute("qsAUIDeps-checkout-compat-a-button-register",function(a){p.register("QuantitySelectorAUIDeps_AButton",function(){return{object:k(a)}})}),f.on("checkout:afterReload",function(){f.trigger(a.getQsWidgetEventInitialize(),!1)})):(r.when("a-state").execute("qsAUIDeps-a-state-register",function(a){p.register("QuantitySelectorAUIDeps_AState",function(){return{object:a}})}),r.when("a-button").execute("qsAUIDeps-a-button-register",function(a){p.register("QuantitySelectorAUIDeps_AButton",
function(){return{object:a}})}));f.on("a:pageUpdate ready",function(){f.trigger(a.getQsWidgetEventInitialize(),!1)})})();h()})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsConstants-duplication-guard",function(p){p.when("A").register("QuantitySelectorConstants",function(f){function a(a){return"qs-widget-configuration-"+a}var c={height:358,heightWithAtc:410,disclaimerTextAdjustment:41,disclaimerTextAdjustmentWithAtc:40},h={height:303,heightWithAtc:355,disclaimerTextAdjustment:41,disclaimerTextAdjustmentWithAtc:40},
g={scrollEventStop:200,constant:19,increment:45,adjustment:20};return{getQsWidgetEventInitialize:function(){return"quantity-selector-widget:initialize"},getQsWidgetEventLoadStatesAndInitialize:function(){return"quantity-selector-widget:loadStatesAndInitialize"},getQsWidgetEventTriggerAction:function(){return"quantity-selector-widget:triggerAction"},getQsWidgetVariationEventTriggerAction:function(){return"quantity-selector-widget-variation-selector:triggerAction"},getQsWidgetEventConfigureList:function(){return"quantity-selector-widget:configure:list"},
getQsWidgetEventConfigureEnable:function(){return"quantity-selector-widget:configure:enable"},getQsWidgetEventConfigureDisable:function(){return"quantity-selector-widget:configure:disable"},getQsWidgetEventConfigureReset:function(){return"quantity-selector-widget:configure:reset"},getQsWidgetEventConfigureGet:function(){return"quantity-selector-widget:configure:get"},getQsWidgetEventConfigureSet:function(){return"quantity-selector-widget:configure:set"},getQsWidgetEventSelectId:function(){return"quantity-selector-widget:selectId"},
getQsWidgetVariationEventSelectId:function(){return"quantity-selector-widget-variation-selector:selectId"},getQsWidgetEventSelectQuantity:function(){return"quantity-selector-widget:selectQuantity"},getQsWidgetEventSelectQuantityClientUpdate:function(){return"quantity-selector-widget:selectQuantity:clientUpdate"},getQsWidgetEventHideDropdown:function(){return"quantity-selector-widget:hideDropdown"},getQsWidgetEventSyncStepperQuantity:function(){return"quantity-selector-widget:sync-stepper-quantity"},
getQsWidgetEventSyncStepperQuantityFromIcdpToHostPage:function(){return"quantity-selector-widget:sync-stepper-quantity:icdp-to-host"},getQsWidgetEventInitialized:function(){return"quantity-selector-widget:initialized"},getQsWidgetEventAction:function(a){return"quantity-selector-widget:action:"+a},getQsWidgetAuiInputTextWrapperClass:function(){return"a-input-text-wrapper"},getQsWidgetActivateDebounce:function(){return 100},getQsWidgetInitialViewDropdown:function(){return"dropdown"},getQsWidgetInitialViewTextLink:function(){return"text_link"},
getQsWidgetInitialViewChooseQuantity:function(){return"choose_quantity"},getQsWidgetActionTriggerOnConfirmation:function(){return"on_confirmation"},getQsWidgetActionTriggerOnSelect:function(){return"on_select"},getQsWidgetGlobalConfigurationId:function(){return"qs-widget-global-configuration"},getQsWidgetConfigurationId:a,getQsWidgetStateScriptSelectorQuery:function(c){return"script[data-a-state*\x3d'"+a(c)+"'], "+("div[data-a-state*\x3d'"+a(c)+"']")},getQsWidgetGenericStateSelectorQuery:function(){return"script[type\x3d'a-state'], div[data-a-state]"},
getQsWidgetStateAttributeJsonString:function(){return"qs-widget-"},getQsWidgetConfigurationJsonString:function(){return"qsItems"},getQsWidgetContainerId:function(a){return"qs-widget-container-"+a},getQsWidgetDivSelectorQueryForWidgetContainers:function(){return"div[id^\x3dqs-widget-container-]"},getQsWidgetSpinnerId:function(a){return"qs-widget-spinner-"+a},getQsWidgetDivSelectorQueryForSpinners:function(){return"div[id^\x3dqs-widget-spinner-]"},getQsWidgetCheckboxId:function(a){return"qs-widget-checkbox-"+
a},getQsWidgetInputSelectorQueryForCheckboxes:function(){return"input[id^\x3dqs-widget-checkbox-]"},getQsWidgetButtonContainerId:function(a){return"qs-widget-button-container-"+a},getQsWidgetButtonId:function(a){return"qs-widget-button-"+a},getQsWidgetStepperId:function(a){return"qs-widget-stepper-"+a},getQsWidgetAtcButtonId:function(a){return"qs-widget-atc-button-"+a},getQsWidgetPlusButtonId:function(a){return"qs-widget-plus-button-"+a},getQsWidgetMinusButtonId:function(a){return"qs-widget-minus-button-"+
a},getQsWidgetDropdownContainerGenericId:function(){return"qs-widget-dropdown-container-"},getQsWidgetDropdownContainerId:function(a){return"qs-widget-dropdown-container-"+a},getQsWidgetDropdownId:function(a){return"qs-widget-dropdown-"+a},getQsWidgetDropdownViewId:function(a){return"qs-widget-dropdown-view-"+a},getQsWidgetVariationDropdownViewId:function(a){return"qs-widget-dropdown-view-variation-"+a},getQsWidgetDropdownItemId:function(a,c){return"qs-widget-dropdown-item-"+c+"-"+a},getQsWidgetDropdownItemAriaId:function(a,
c){return"qs-widget-dropdown-item-aria-"+c+"-"+a},getQsWidgetDropdownItemQuantitySuffixId:function(a,c){return"qs-widget-dropdown-item-quantitySuffix-"+c+"-"+a},getQsWidgetDropdownUnorderedListId:function(a){return"qs-widget-dropdown-unorderedlist-"+a},getQsWidgetDropdownVariationUnorderedListId:function(a){return"qs-widget-dropdown-variation-unorderedlist-"+a},getQsWidgetTextInputId:function(a){return"qs-widget-text-input-"+a},getQsWidgetTextInputContainerId:function(a){return"qs-widget-text-input-container-"+
a},getQsWidgetTextInputUpdateButtonId:function(a){return"qs-widget-text-input-updatelink-"+a},getQsWidgetTextInputUpdateButtonContainerId:function(a){return"qs-widget-text-input-updatelink-container-"+a},getQsWidgetTextInputUpdateButtonDecl:function(){return"qs-widget-text-input-updatelink-decl"},getQsWidgetTextInputDecl:function(){return"qs-widget-text-input-decl"},getQsWidgetQuantityContainerId:function(a){return"qs-widget-quantity-container-"+a},getQsWidgetQuantityId:function(a){return"qs-widget-quantity-"+
a},getQsWidgetQuantitySuffixId:function(a){return"qs-widget-quantity-suffix-"+a},getQsWidgetInitialViewSuffixId:function(a){return"qs-widget-initialView-suffix-"+a},getQsWidgetSummaryPriceId:function(a){return"qs-widget-summary-price-"+a},getQsWidgetSummaryPriceSymbolId:function(a){return"qs-widget-summary-price-symbol-"+a},getQsWidgetSummaryPriceWholeId:function(a){return"qs-widget-summary-price-whole-"+a},getQsWidgetSummaryPriceFractionId:function(a){return"qs-widget-summary-price-fraction-"+a},
getQsWidgetSummaryPriceDecimalId:function(a){return"qs-widget-summary-price-decimal-"+a},getQsWidgetSummaryAtcId:function(a){return"qs-widget-summary-atc-"+a},getQsWidgetFooterPriceContainerId:function(a){return"qs-widget-footer-price-container-"+a},getQsWidgetFooterPriceSymbolId:function(a){return"qs-widget-footer-price-symbol-"+a},getQsWidgetFooterPriceWholeId:function(a){return"qs-widget-footer-price-whole-"+a},getQsWidgetFooterPriceFractionId:function(a){return"qs-widget-footer-price-fraction-"+
a},getQsWidgetFooterPriceDecimalId:function(a){return"qs-widget-footer-price-decimal-"+a},getQsWidgetFooterQuantitySuffixContainerId:function(a){return"qs-widget-footer-quantitySuffix-container-"+a},getQsWidgetFooterQuantitySuffixId:function(a){return"qs-widget-footer-quantitySuffix-"+a},getQsWidgetButtonDecl:function(){return"qs-widget-button-decl"},getQsWidgetSummaryAtcDecl:function(){return"qs-widget-summary-atc-decl"},getQsWidgetQuantityChangelinkId:function(a){return"qs-widget-quantity-changelink-"+
a},getQsWidgetQuantityChangelinkDecl:function(){return"qs-widget-quantity-changelink-decl"},getQsWidgetDropdownItemDecl:function(){return"qs-widget-dropdown-item-decl"},getQsWidgetVariationDropdownItemDecl:function(){return"qs-widget-dropdown-variation-item-decl"},getQsWidgetDropdownDecl:function(){return"qs-widget-dropdown-decl"},getQsWidgetDropdownScrollMetricThreshold:function(){return 20},getQsWidgetBottomSheetId:function(a){return"qs-widget-bottom-sheet-"+a},getQsWidgetBottomSheetPriceTextId:function(a){return"qs-widget-bottom-sheet-price-text-"+
a},getQsWidgetBottomSheetContainerId:function(a){return"qs-widget-bottom-sheet-container-"+a},getQsWidgetBottomSheetQuantitySuffixId:function(a){return"qs-widget-bottom-sheet-quantitySuffix-"+a},getQsWidgetBottomSheetBackButtonId:function(a){return"qs-widget-bottom-sheet-back-button-"+a},getQsWidgetBottomSheetBackButtonDecl:function(){return"qs-widget-bottom-sheet-back-button-decl"},getQsWidgetSummaryDisclaimerId:function(a){return"qs-widget-summary-disclaimer-"+a},getQsWidgetSummaryDisclaimerContainerId:function(a){return"qs-widget-summary-disclaimer-container-"+
a},getQsWidgetBottomSheetTemplateId:function(){return"qs-widget-bottom-sheet-container-qsUID"},getQsWidgetBottomSheetSelectQuantityTextId:function(a){return"qs-widget-bottom-sheet-select-quantity-text-"+a},getQsWidgetBottomSheetImageId:function(a){return"qs-widget-bottom-sheet-image-"+a},getQsWidgetBottomSheetUnitTextId:function(a){return"qs-widget-bottom-sheet-unit-text-"+a},getQsWidgetBottomSheetTableId:function(a){return"qs-widget-bottom-sheet-table-"+a},getQsWidgetBottomSheetPpuTextId:function(a){return"qs-widget-bottom-sheet-ppu-text-"+
a},getQsWidgetInitialViewTextLinkId:function(a){return"qs-widget-link-"+a},getQsWidgetBottomSheetHeightConfig:function(a){return a?c:h},getQsWidgetBottomSheetDropDownScrollFactor:function(){return g},getQsWidget1DBottomSheetSelectorCssClass:function(){return"qs-widget-new-1d-dropdown-li"},getQsWidget2DBottomSheetQuantitySelectorCssClass:function(){return"qs-widget-new-2d-dropdown-qs-li"},getQsWidget2DBottomSheetVariationSelectorCssClass:function(){return"qs-widget-new-2d-dropdown-vs-li"},getQsWidgetVariationSelectorListMapKey:function(){return"variationSelectorListsMap"},
getQsWidgetVariationSelectorSelectedIdKey:function(){return"selectedId"},getQsWidgetVariationSelectorDisplayTextKey:function(){return"displayText"},getQsWidgetVariationSelectorDisplayTextWithQuantityKey:function(){return"displayTextWithQuantity"},getQsWidgetStepperIncrementDecl:function(){return"qs-widget-increment-decl"},getQsWidgetStepperDecrementDecl:function(){return"qs-widget-decrement-decl"},getQsWidgetStepperDecrementMinusIconId:function(a){return"qs-widget-decrement-minus-icon-"+a},getQsWidgetStepperDecrementTrashIconId:function(a){return"qs-widget-decrement-trash-icon-"+
a},getQsWidgetStepperAddToCartReftag:function(){return"_qs_atc"},getQsWidgetStepperDecrementReftag:function(){return"_qs_rm"},getQsWidgetStepperIncrementReftag:function(){return"_qs_add"},getQsWidgetBottomSheetReftag:function(){return"_qs_udt"},getQsWidgetStepperShapeType:function(){return"QUANTITY_STEPPER"},getQsWidgetSimplifiedStepperShapeType:function(){return"SIMPLIFIED_QUANTITY_STEPPER"},getQsWidgetDropdownItemIdPrefix:function(){return"qs-widget-dropdown-item-"},getQsWidgetCadenceDropdownItemId:function(a,
c){return"qs-widget-cadence-dropdown-item-"+c+"-"+a},getTabKeyCode:function(){return 9},getReturnKeyCode:function(){return 13}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsMetadata-duplication-guard",function(p){p.when("A","QuantitySelectorState","QuantitySelectorAUIDeps").register("QuantitySelectorMetadata",function(f,a,c){function h(c){return(c=a.getQsWidgetConfiguration(c).metadata)?JSON.parse(c):null}return{isWeblabEnabled:function(a,c,f){a:{if((a=h(a))&&a.weblabs)for(var g=
0;g<a.weblabs.length;g++){var k=a.weblabs[g];if(k.weblabName==c){c=k.treatment;break a}}c=null}return null==c?f:"T1"==c?!0:!1},getMetaConfiguration:function(a,c){return(a=h(a))?a[c]:null}}})});"use strict";r.when("A","QSAssetDuplicationGuard").execute("qsMetrics-duplication-guard",function(p,f){f.when("A","QuantitySelectorAUIDeps","QuantitySelectorConstants").register("QuantitySelectorMetrics",function(a,c,f){function g(a){w.ue&&w.ue.count&&a&&ue.count(a,(ue.count(a)||0)+1)}r.when("ready").execute(function(){a.now()});
return{incrementInitializeCount:function(a,c){var f="QuantitySelector-Initialize";f=a?f+"-Success-Count":f+"-Failed-Count";g(c?f+":mobile":f+":desktop")},incrementInvalidIdCount:function(){g("QuantitySelector-InvalidID")},incrementTriggerActionCount:function(a,c,f){a="QuantitySelector-TriggerAction-"+a;a=c?a+"-Success-Count":a+"-Failed-Count";g(f?a+":mobile":a+":desktop")},incrementChangeLinkCount:function(){g("QuantitySelector-ChangeLink-Count")},incrementShowPopup:function(a){var c="QuantitySelector-ShowPopup-Count";
g(a?c+":mobile":c+":desktop")},incrementQsItemNotFound:function(a,c){var f="QuantitySelector-QsItemNotFound-Count";g(a?f+":mobile:"+c:f+":desktop:"+c)},logLatencyMetric:function(a,c,f){a="QuantitySelector-TimeTo-"+a;w.ue&&w.ue.count&&a&&"undefined"!==typeof w.ue_t0&&(c-=w.ue_t0,ue.count(a,c),ue.count(a+"Hundredths",Math.floor(c/10)))},incrementQsWidgetFailToRender:function(){g("QuantitySelector-QsWidgetFailToRender-Count")},logCsm:function(a,g){var h=c.aState.state(f.getQsWidgetConfigurationId(a));
if(h&&(a="mobile"==h.viewType.toLowerCase()?"mob":"dsk",(h=h.qsCsm)&&h.almBrandRefMarker&&h.pageRefMarker)){a:{var k=h.sellingUomDimension;var d=h.pricingUomDimension;if(k&&d){var n="s";switch(k){case "count":n+="u";break;case "weight":n+="w";break;default:k=void 0;break a}n+="p";switch(d){case "count":n+="u";break;case "weight":n+="w";break;default:k=void 0;break a}k=n}else k=void 0}k&&(g={pageType:h.pageType,subPageType:h.subPageType,pageTypeId:h.pageTypeId,storeName:h.tabId,programRegionId:h.programRegionId,
hitType:h.hitType,refMarker:h.almBrandRefMarker+"_"+a+"_"+h.pageRefMarker+"_qs_"+g+"_"+k,fromTabName:h.fromTabName,toTabName:h.toTabName},w.ue&&w.ue.event&&ue.event(g,"quantityselector_attr","quantityselector.QuantityselectorMetrics.2"))}}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsState-duplication-guard",function(p){p.when("A","QuantitySelectorConstants","QuantitySelectorMetrics","QuantitySelectorAUIDeps").register("QuantitySelectorState",function(f,a,c,h){function g(c){var d=
h.aState.state(a.getQsWidgetConfigurationId(c));G(c)||(k(c),d=h.aState.state(a.getQsWidgetConfigurationId(c)));return d}function k(c){if(c){var d=a.getQsWidgetConfigurationId(c),e=a.getQsWidgetStateScriptSelectorQuery(c);try{var l=f.$(e).first(),q=JSON.parse(l.html());h.aState.state(d,q);if(q&&q.staticData){var n=JSON.parse(q.staticData).asin;u(n,c)}}catch(O){if(c=a.getQsWidgetConfigurationJsonString(),l.html().includes(c))throw O;}}}function G(c){return(c=h.aState.state(a.getQsWidgetConfigurationId(c)))&&
c.id?!0:!1}function v(a){var c=g(a),e=c.selectedId;c=c.selectedQuantity;0==c||c?d(a,c):e&&m(a,e)}function m(c,d){d={previousSelectedId:d,previousSelectedQuantity:null};h.aState.state(a.getQsWidgetConfigurationId(c),d)}function d(c,d){d={previousSelectedQuantity:d,previousSelectedId:null};h.aState.state(a.getQsWidgetConfigurationId(c),d)}function n(){for(var c=[],d=f.$(a.getQsWidgetGenericStateSelectorQuery()),e=a.getQsWidgetConfigurationId(""),l=0;l<d.length;l++)try{var n=d[l].getAttribute("data-a-state"),
g=JSON.parse(n).key;if(g&&g.substring(0,e.length)==e){var h=g.substring(e.length);c.push(h)}}catch(D){var k=a.getQsWidgetStateAttributeJsonString();if(n.includes(k))throw D;}return c}function u(a,c){var d;if(d=a&&c)d="f3cart"!==g(c).clientId;d&&e(c)&&(l[a]||(l[a]=new Set),l[a].add(c))}function e(c){c=g(c);return c.shapeType===a.getQsWidgetStepperShapeType()||c.shapeType===a.getQsWidgetSimplifiedStepperShapeType()}var l={};f.on(a.getQsWidgetEventConfigureList(),function(a){"function"===typeof a&&a(n())});
f.on(a.getQsWidgetEventConfigureGet(),function(a,c){a=g(a);"function"===typeof c&&c(a)});f.on(a.getQsWidgetEventConfigureSet(),function(c,d){h.aState.state.replace(a.getQsWidgetConfigurationId(c),d);f.trigger(a.getQsWidgetEventInitialize(),!0,c)});return{getQsWidgetConfiguration:g,loadQsWidgetStateConfiguration:function(a){if(!G(a))k(a);else if(a)try{var c=g(a),d=JSON.parse(c.staticData).asin;u(d,a)}catch(y){}},reloadQsWidgetStateConfiguration:k,saveOriginalSettings:function(a){},setEnable:function(c,
d){d={enable:d};h.aState.state(a.getQsWidgetConfigurationId(c),d)},setInitialized:function(c){h.aState.state(a.getQsWidgetConfigurationId(c),{initialized:!0})},setSelectedId:function(c,d,e){"SIMPLIFIED_QUANTITY_STEPPER"!==g(c).shapeType&&(e||v(c),d={selectedId:d,selectedQuantity:null},h.aState.state(a.getQsWidgetConfigurationId(c),d))},setSelectedQuantity:function(c,d,e){e||v(c);d={selectedId:null,selectedQuantity:d};h.aState.state(a.getQsWidgetConfigurationId(c),d)},setPreviousSelectedId:m,setPreviousSelectedQuantity:d,
setData:function(c,d){h.aState.state(a.getQsWidgetConfigurationId(c),d)},getQsUIDs:n,getQsWidgetMapSet:function(a){return l[a]},isStepper:e}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsTemplates-duplication-guard",function(p){p.when("A","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorAUIDeps","QuantitySelectorUtils").register("QuantitySelectorTemplates",function(f,a,c,h,g){function k(a,c){f.$("#"+a+" .replace-qsUID").each(function(){var a=f.$(this).attr("id");
f.$(this).attr("id",a.replace("qsUID",c))})}return{generateBottomSheet:function(h){var v=g.getQsWidgetBottomSheetTemplateElement().clone(!0);v.appendTo(g.getQsWidgetContainer(h));v.attr("id",c.getQsWidgetBottomSheetContainerId(h));var m=a.getQsWidgetConfiguration(h);v.attr("cel_widget_id","qs-widget-metric-"+m.qsMetricID+"-bottomsheet");v.addClass(m.cssClass);k(c.getQsWidgetBottomSheetContainerId(h),h);g.getQsWidgetBottomSheetSelectQuantityTextElement(h).text(g.replaceNbspWithPlainTextNbsp(m.bottomSheetSelectQuantityText));
g.getQsWidgetBottomSheetUnitTextElement(h).text(g.replaceNbspWithPlainTextNbsp(m.bottomSheetSelectQuantityUnitText));g.getQsWidgetBottomSheetUnitTextElement(h).attr("aria-label",m.bottomSheetSelectQuantityUnitAriaLabelText);g.getQsWidgetBottomSheetPpuTextElement(h).text(g.replaceNbspWithPlainTextNbsp(m.bottomSheetPricePerUnitText));g.getQsWidgetBottomSheetPriceTextElement(h).text(g.replaceNbspWithPlainTextNbsp(m.estTotalPriceText));g.getQsWidgetBottomSheetImageElement(h).attr("src",m.bottomSheetImageUrl);
m.summaryDisclaimerText?g.getQsWidgetSummaryDisclaimerElement(h).text(g.replaceNbspWithPlainTextNbsp(m.summaryDisclaimerText)):(g.getQsWidgetBottomSheetTableElement(h).attr("style","border-bottom: 0px solid !important;"),g.getQsWidgetSummaryDisclaimerContainerElement(h).remove());"right"===m.currencySymbolPosition&&g.getQsWidgetSummaryPriceSymbolElement(h).insertAfter(g.getQsWidgetSummaryPriceFractionElement(h));v=g.getQsWidgetSummaryAtcButtonAsComponent(h);a.isStepper(h)?v.text(g.replaceNbspWithPlainTextNbsp(m.bottomSheetUpdateCartText)):
v.text(g.replaceNbspWithPlainTextNbsp(m.bottomSheetAddToCartText));f.declarative.create(g.getQsWidgetSummaryAtcButton(h),c.getQsWidgetSummaryAtcDecl(),{qsUID:h})}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsUtils-duplication-guard",function(p){p.when("A","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorAUIDeps","QuantitySelectorMetrics").register("QuantitySelectorUtils",function(f,a,c,h,g){function k(b){return"true"==b||1==b?!0:!1}function p(b){b=a.getQsWidgetConfiguration(b);
return b.clientId?b.clientId:"unrec-client"}function v(b){return"mobile"==a.getQsWidgetConfiguration(b).viewType.toLowerCase()?!0:!1}function m(b){return a.getQsWidgetConfiguration(b).shapeType===c.getQsWidgetSimplifiedStepperShapeType()}function d(b){var c=a.getQsWidgetConfiguration(b);return m(b)||"undefined"!=typeof c.showATCButtonWhenZeroQuantity&&c.showATCButtonWhenZeroQuantity?!0:!1}function n(b){b=a.getQsWidgetConfiguration(b);return k(b.showConfirmationView)?!0:!1}function u(b){b=a.getQsWidgetConfiguration(b);
return k(b.allowZeroQuantity)?!0:!1}function e(b){return a.getQsWidgetConfiguration(b).initialView.toLowerCase()==c.getQsWidgetInitialViewChooseQuantity()?!0:!1}function l(b){b=y(b);return null==b||1>b.length?!1:!0}function q(b){if(b)try{var c=a.getQsWidgetConfiguration(b);return JSON.parse(c.staticData).storeId}catch(P){}}function x(b){b=a.getQsWidgetConfiguration(b).variationSelectorListsMap;if(null==b)return null;b=Object.keys(b);return null==b||1>b.length?null:b[0]}function r(b,c){var t=a.getQsWidgetConfiguration(b).variationSelectorListsMap;
if(null==t)return null;null==c&&(c=x(b));return null==c?null:t[c]}function y(b,a){b=r(b,a);return null==b?null:b.selectorItems}function A(b){return a.getQsWidgetConfiguration(b).bottomSheetChangeCurrentQuantityText}function N(b,a){b=B(b,a).quantityText;return"+"==b.substr(b.length-1)?{result:!0,initialQuantityText:b.substr(0,b.length-1)}:{result:!1}}function O(b,c){var t=a.getQsWidgetConfiguration(b),d=t.qsItems.length;t=t.allowZeroQuantity;if(D(b)){if(1==c||t&&2==c)return!0}else if(c==d||c==d-1&&
t)return!0;return!1}function F(b,c){var t=a.getQsWidgetConfiguration(b).qsItems;if(D(b)){if(c==t.length)return!0}else if(1==c)return!0;return!1}function D(b){b=a.getQsWidgetConfiguration(b).qsItems;return z(b[b.length-1])>z(b[0])?!0:!1}function L(b){var a=Q(b);a&&f.trigger(c.getQsWidgetEventSelectQuantity(),b,a,!1);T(b);f.trigger(c.getQsWidgetEventInitialized(),b)}function U(b){b.removeClass("aok-hidden")}function ha(b){var a=f.$("#"+c.getQsWidgetQuantityChangelinkId(b));b=f.$("#"+c.getQsWidgetTextInputUpdateButtonId(b));
a.attr("draggable","false");b.attr("draggable","false")}function I(b){return f.$("#"+c.getQsWidgetContainerId(b))}function ia(b){return f.$("#"+c.getQsWidgetButtonContainerId(b))}function J(b){return h.aButton("#"+c.getQsWidgetButtonId(b))}function V(b){return f.$("#"+c.getQsWidgetStepperId(b))}function W(b){return h.aButton("#"+c.getQsWidgetAtcButtonId(b))}function X(b){return h.aButton("#"+c.getQsWidgetPlusButtonId(b))}function R(b){return f.$("#"+c.getQsWidgetButtonId(b)+"-announce")}function ja(b){return f.$("#"+
c.getQsWidgetDropdownContainerId(b))}function ka(b){return f.$("#"+c.getQsWidgetDropdownViewId(b))}function S(b){return f.$("#"+c.getQsWidgetVariationDropdownViewId(b))}function Y(b){return f.$("#"+c.getQsWidgetDropdownUnorderedListId(b))}function la(b,a){return f.$("#"+c.getQsWidgetDropdownItemId(b,a))}function ma(b){return f.$("#"+c.getQsWidgetTextInputContainerId(b))}function K(b){return f.$("#"+c.getQsWidgetTextInputId(b))}function na(b){return f.$("#"+c.getQsWidgetTextInputUpdateButtonContainerId(b))}
function oa(b){return f.$("#"+c.getQsWidgetSummaryAtcId(b))}function pa(b){return h.aButton("#"+c.getQsWidgetSummaryAtcId(b))}function qa(b){return f.$("#"+c.getQsWidgetBottomSheetPriceTextId(b))}function Z(b){return f.$("#"+c.getQsWidgetStepperDecrementMinusIconId(b))}function aa(b){return f.$("#"+c.getQsWidgetStepperDecrementTrashIconId(b))}function B(b,c){try{var d=a.getQsWidgetConfiguration(b);if(d.qsItems){var t=d.qsItems[parseInt(c)-1];return t.id===c?t:ra(b,c)}}catch(C){return ra(b,c)}}function ra(b,
c){b=a.getQsWidgetConfiguration(b);for(var d=0;d<b.qsItems.length;d++)if(b.qsItems[d].id==c)return b.qsItems[d]}function z(b){return parseFloat(JSON.parse(b.data).quantity)}function sa(b,a){var d=r(b,a);if(null==d)return null;d=d[c.getQsWidgetVariationSelectorSelectedIdKey()];if(null==d)return ta(b);b=y(b,a);if(null==b)return null;for(a=0;a<b.length;a++)if(b[a].id==d)return b[a];return null}function ta(b,a){b=y(b,a);if(null==b)return null;for(a=0;a<b.length;a++)if(k(b[a].isSelected))return b[a];return null}
function ba(b){var c=a.getQsWidgetConfiguration(b).selectedId;return c?c:ua(b)}function ua(b){b=a.getQsWidgetConfiguration(b);if(b.qsItems&&0!=b.qsItems.length){for(var c=0;c<b.qsItems.length;c++)if(k(b.qsItems[c].isSelected))return b.qsItems[c].id;return b.qsItems[0].id}}function va(b,a){var d=r(b,a);if(null==d)return null;d=d[c.getQsWidgetVariationSelectorSelectedIdKey()];return null!=d?d:wa(b,a)}function wa(b,a){b=ta(b);return null==b?null:b.id}function Q(b){return a.getQsWidgetConfiguration(b).selectedQuantity}
function xa(b,a){return 0>a?b[0].id:a>=b.length?b[b.length-1].id:b[a].id}function ya(b,a){if(null==b)return 0;for(var c=0;c<b.length;c++)if(a==b[c].id)return c}function ca(b,a){return(b=A(b))?a+b:"Current quantity "+a}function da(b,a){return(u(b)?/^(([0-9]\d{0,2}))$/:/^(([1-9]\d{0,2})|(0[1-9]\d?)|(00[1-9]))$/).test(a)}function za(b,a){var c=ma(b),d=na(b);ia(b).addClass("aok-hidden");U(c);var e=K(b);a&&e.val(a);a=e.val();da(b,a)&&Q(b)!==a?U(d):d.addClass("aok-hidden");v(b)?e.focus():setTimeout(function(){e.focus()},
200)}function T(b){if(b){var a=f.$("#"+c.getQsWidgetCheckboxId(b)),d=I(b);b=f.$("#"+c.getQsWidgetSpinnerId(b))}else a=f.$(c.getQsWidgetInputSelectorQueryForCheckboxes()),b=f.$(c.getQsWidgetDivSelectorQueryForSpinners()),d=f.$(c.getQsWidgetDivSelectorQueryForWidgetContainers());a.remove();b.remove();d.removeClass("qs-widget-hidden")}function Aa(b,c){c=c.displayTextWithQuantityList;var d=a.getQsWidgetConfiguration(b).qsItems;b=ba(b);for(var e=0;e<d.length;e++)if(d[e].id==b)return c[e];return null}function Ba(b,
a){null==a&&(a=x(b));if(null==a)return{};var d=sa(b,a);if(null==d)return{};var e=v(b)?d.displayTextForMobile:d.dissplayTextForDesktop;b=Aa(b,d);var t={};t[a]=JSON.parse(d.data);t[a][c.getQsWidgetVariationSelectorDisplayTextKey()]=e;t[a][c.getQsWidgetVariationSelectorDisplayTextWithQuantityKey()]=b;return t}function Ca(b,a){b=r(b,a);return null==b||null==b.actionTriggerId||""==b.actionTriggerId?null:b.actionTriggerId}function ea(b,d,e,h,n){n=a.getQsWidgetConfiguration(b);var t=n.selectedId,P=n.selectedQuantity,
g=a.isStepper(b);h=g&&h!=c.getQsWidgetStepperAddToCartReftag();var E=a.getQsWidgetConfiguration(b);var q=E.previousSelectedQuantity;E=E.previousSelectedId;q=q?q:E?z(B(b,E)):null;E=JSON.parse(n.staticData);var k=n.sellingUnit,u=n.sellingDimension;if(t)for(var x=0;x<n.qsItems.length;x++)if(n.qsItems[x].id==t){var C=JSON.parse(n.qsItems[x].data);C=f.$.extend({qsUID:b,prevSelectedQty:q,isStepperFlag:g,setQuantityFlag:h,tunneledData:d,quantityData:C,sellingUnit:k,sellingDimension:u},E,C);l(b)&&(C=f.$.extend(C,
Ba(b,e)))}if(P||0==P)C=f.$.extend({qsUID:b,prevSelectedQty:q,isStepperFlag:g,setQuantityFlag:h,tunneledData:d,sellingUnit:k,sellingDimension:u},E,{quantity:P}),l(b)&&(C=f.$.extend(C,Ba(b,e)));return C}function Da(b){var c=a.getQsWidgetConfiguration(b);if(m(b))return c.pricePerUnitText?c.pricePerUnitText:"bcPrice";b=B(b,1);if(!b||!b.price)return"";b=b.price;return b.currencySymbol+b.wholeValue+b.decimalSeparator+b.fractionValue}function fa(b){return b.replace(/&nbsp;/g," ")}var H=[];f.on(c.getQsWidgetEventTriggerAction(),
function(b,d,e,l,n){var t=a.getQsWidgetConfiguration(b);d||(d=t.actionId);t="mobile"==t.viewType.toLowerCase();var h=!1;(b=ea(b,e,null,l,n))&&b.ref&&null!=l&&(b.reftag=b.ref+l);b&&(f.trigger(c.getQsWidgetEventAction(d),b),g.incrementTriggerActionCount(d,!0,t),h=!0);h||g.incrementTriggerActionCount(d,!1,t)});f.on(c.getQsWidgetVariationEventTriggerAction(),function(b,d,e,l){var t="mobile"==a.getQsWidgetConfiguration(b).viewType.toLowerCase();e=ea(b,e);null==d&&(d=Ca(b,l));null!=d&&(f.trigger(c.getQsWidgetEventAction(d),
e),g.incrementTriggerActionCount(d,!1,t))});return{isInitialized:function(b){return(b=a.getQsWidgetConfiguration(b))?b.initialized:!1},isMobile:v,isSimplifiedStepper:m,isQsWidgetEnabled:function(b){b=a.getQsWidgetConfiguration(b);return b.hasOwnProperty("enable")?k(b.enable):!0},isQsWidgetQuantityZero:function(b){var c=a.getQsWidgetConfiguration(b);return c.selectedId&&0==z(B(b,c.selectedId))||c.selectedQuantity&&"0"==c.selectedQuantity?!0:!1},isConfirmationViewEnabled:n,isAllowZeroQuantityEnabled:u,
isInitialViewDropdown:function(b){return a.getQsWidgetConfiguration(b).initialView.toLowerCase()==c.getQsWidgetInitialViewDropdown()?!0:!1},isInitialViewTextLink:function(b){return a.getQsWidgetConfiguration(b).initialView.toLowerCase()==c.getQsWidgetInitialViewTextLink()?!0:!1},isInitialViewChooseQuantity:e,isVariationSelectorEnabled:l,getVariationSelectorItemList:r,getQsWidgetBottomSheetConfig:function(b){var d=a.getQsWidgetConfiguration(b),e=c.getQsWidgetBottomSheetHeightConfig(d.enabledBottomSheetWith2DSupport),
f=0;d.summaryDisclaimerText||(f=n(b)?e.disclaimerTextAdjustmentWithAtc:e.disclaimerTextAdjustment);return n(b)?{closeMessage:d.bottomSheetCancelText,height:e.heightWithAtc-f}:{closeMessage:d.bottomSheetDoneText,height:e.height-f}},getQsWidgetBottomSheetChangeCurrentQuantityText:A,isActionTriggerOnConfirmation:function(b){return a.getQsWidgetConfiguration(b).actionTrigger.toLowerCase()==c.getQsWidgetActionTriggerOnConfirmation()?!0:!1},isActionTriggerOnSelect:function(b){return a.getQsWidgetConfiguration(b).actionTrigger.toLowerCase()==
c.getQsWidgetActionTriggerOnSelect()?!0:!1},isVariationSelectorTriggerOnSelect:function(b){return null==b?!1:b.actionTriggerType.toLowerCase()==c.getQsWidgetActionTriggerOnSelect()},isVariationSelectorTriggerOnConfirmation:function(b){return null==b?!1:b.actionTriggerType.toLowerCase()==c.getQsWidgetActionTriggerOnConfirmation()},isTextInputRequired:N,isOrderMin:O,isOrderMax:F,isAscending:D,initializeWidget:function(b){if(m(b))L(b);else{var d=ba(b),e=Q(b),n=a.getQsWidgetConfiguration(b);if(n.qsItems)for(var h=
0;h<n.qsItems.length;h++)parseFloat(e)===z(n.qsItems[h])&&(d=n.qsItems[h].id,e=null);e?f.trigger(c.getQsWidgetEventSelectQuantity(),b,e,!1,function(){ha(b)}):d&&f.trigger(c.getQsWidgetEventSelectId(),b,d,!1,function(){ha(b)});l&&(d=va(b),null!=d&&f.trigger(c.getQsWidgetVariationEventSelectId(),b,d,!1,function(){}));T(b);f.trigger(c.getQsWidgetEventInitialized(),b)}},activateWidget:function(b){var a=H.indexOf(b);-1<a&&H.splice(a,1);setTimeout(function(){H.push(b)},c.getQsWidgetActivateDebounce())},
deactivateWidget:function(b){b=H.indexOf(b);-1<b&&H.splice(b,1)},getActivatedQsWidgets:function(){return H},hideComponent:function(b,a){b.addClass("aok-hidden")},showComponent:U,isComponentVisible:function(b){return!b.hasClass("aok-hidden")},isElementVisible:function(b){return"hidden"!==b.css("visibility")},setElementVisibility:function(b,a){a?b.css("visibility","visible"):b.css("visibility","hidden")},setHtml:function(b,a){b.html(a)},setAtcButtonStepperText:function(b){if(a.isStepper(b)&&e(b)){var c=
a.getQsWidgetConfiguration(b),d=pa(b);d.text(fa(c.bottomSheetUpdateCartText));(c.selectedId&&0==z(B(b,c.selectedId))||"0"==c.selectedQuantity)&&d.text(fa(c.bottomSheetAddToCartText))}},setQsWidgetContainerMinWidthAndHeight:function(b){b=I(b);b.css("min-width",b.width()+"px");b.css("min-height",b.height()+"px")},resetQsWidgetContainerMinWidthAndHeight:function(b){b=I(b);b.css("min-width","0px");b.css("min-height","0px")},enableQsWidget:function(b){a.setEnable(b,!0);if(!m()){var c=J(b);b=K(b);c.enable();
b.removeClass("a-form-disabled");b.addClass("a-form-normal");b.removeAttr("disabled")}},disableQsWidget:function(b){a.setEnable(b,!1);if(!m()){var c=J(b);b=K(b);c.disable();b.removeClass("a-form-normal");b.addClass("a-form-disabled");b.attr("disabled","disabled")}},popOutDropDownContainer:function(b){var c=I(b),d=c.offset(),e=ja(b),l=d.left,n=d.top,h="unset",g=f.$(w).height(),q=a.getQsWidgetConfiguration(b).dropdownAnchorId;b=q.startsWith("qs-widget-container")?c:f.$("#"+q);if(q&&b.length){for(q=
b;!q.is(document)&&"static"===q.css("position");)q=q.parent();n-=null===q.offset()?0:q.offset().top;l-=null===q.offset()?0:q.offset().left;e.appendTo(b);q.is(document)||(g=q.height())}else e.appendTo(document.body);l+e.width()>w.scrollX+f.$(w).width()&&(l=l+c.width()-e.width());d.top-w.scrollY+e.height()>f.$(w).height()&&(h=g-n-c.height(),n="unset");e.css({left:l,top:n,bottom:h})},getQsWidgetContainer:I,getQsWidgetButtonContainer:ia,getQsWidgetButtonAsComponent:J,getQsWidgetStepperElement:V,getQsWidgetAtcButtonAsComponent:W,
getQsWidgetButton:R,getQsWidgetDropdownContainer:ja,getQsWidgetDropdownElement:function(b){return f.$("#"+c.getQsWidgetDropdownId(b))},getQsWidgetDropdownViewSelector:ka,getQsWidgetVariationDropdownViewSelector:S,getQsWidgetDropdownUnorderedListElement:Y,getQsWidgetDropdownVariationUnorderedListElement:function(b){return f.$("#"+c.getQsWidgetDropdownVariationUnorderedListId(b))},getQsWidgetDropdownItemElement:function(b,a){return f.$("#"+c.getQsWidgetDropdownItemAriaId(b,a))},getQsWidgetPlusButtonAsComponent:X,
getQsWidgetTextInputContainer:ma,getQsWidgetTextInputElement:K,getQsWidgetTextInputUpdateButtonContainer:na,getQsWidgetQuantityContainer:function(b){return f.$("#"+c.getQsWidgetQuantityContainerId(b))},getQsWidgetQuantityElement:function(b){return f.$("#"+c.getQsWidgetQuantityId(b))},getQsWidgetQuantitySuffixElement:function(b){return f.$("#"+c.getQsWidgetQuantitySuffixId(b))},getQsWidgetInitialViewSuffixElement:function(b){return f.$("#"+c.getQsWidgetInitialViewSuffixId(b))},getQsWidgetSummaryAtcButton:oa,
getQsWidgetSummaryAtcButtonAsComponent:pa,getQsWidgetSummaryPriceContainerElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceId(b))},getQsWidgetSummaryPriceSymbolElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceSymbolId(b))},getQsWidgetSummaryPriceWholeElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceWholeId(b))},getQsWidgetSummaryPriceFractionElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceFractionId(b))},getQsWidgetSummaryPriceDecimalElement:function(b){return f.$("#"+
c.getQsWidgetSummaryPriceDecimalId(b))},getQsWidgetSummaryDisclaimerElement:function(b){return f.$("#"+c.getQsWidgetSummaryDisclaimerId(b))},getQsWidgetSummaryDisclaimerContainerElement:function(b){return f.$("#"+c.getQsWidgetSummaryDisclaimerContainerId(b))},getQsWidgetFooterPriceContainer:function(b){return f.$("#"+c.getQsWidgetFooterPriceContainerId(b))},getQsWidgetFooterPriceSymbolElement:function(b){return f.$("#"+c.getQsWidgetFooterPriceSymbolId(b))},getQsWidgetFooterPriceWholeElement:function(b){return f.$("#"+
c.getQsWidgetFooterPriceWholeId(b))},getQsWidgetFooterPriceFractionElement:function(b){return f.$("#"+c.getQsWidgetFooterPriceFractionId(b))},getQsWidgetFooterPriceDecimalElement:function(b){return f.$("#"+c.getQsWidgetFooterPriceDecimalId(b))},getQsWidgetFooterQuantitySuffixContainer:function(b){return f.$("#"+c.getQsWidgetFooterQuantitySuffixContainerId(b))},getQsWidgetFooterQuantitySuffixElement:function(b){return f.$("#"+c.getQsWidgetFooterQuantitySuffixId(b))},getQsWidgetBottomSheetQuantitySuffixElement:function(b){return f.$("#"+
c.getQsWidgetBottomSheetQuantitySuffixId(b))},getQsWidgetBottomSheetPriceTextElement:qa,getQsWidgetBottomSheetTemplateElement:function(){return f.$("#"+c.getQsWidgetBottomSheetTemplateId())},getQsWidgetBottomSheetSelectQuantityTextElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetSelectQuantityTextId(b))},getQsWidgetBottomSheetImageElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetImageId(b))},getQsWidgetBottomSheetUnitTextElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetUnitTextId(b))},
getQsWidgetBottomSheetTableElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetTableId(b))},getQsWidgetBottomSheetPpuTextElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetPpuTextId(b))},getQsWidgetInitialViewTextLinkElement:function(b){return f.$("#"+c.getQsWidgetInitialViewTextLinkId(b))},getQsWidgetAtcButton:function(b){return f.$("#"+c.getQsWidgetAtcButtonId(b))},getQsWidgetPlusButton:function(b){return f.$("#"+c.getQsWidgetPlusButtonId(b))},getQsWidgetMinusButton:function(b){return f.$("#"+
c.getQsWidgetMinusButtonId(b))},getQsWidgetStepperDecrementMinusIconElement:Z,getQsWidgetStepperDecrementTrashIconElement:aa,getQsItem:B,getQsItemQuantity:z,getClientId:p,getClosestDecrementalQsItem:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;for(var d=Number.MAX_SAFE_INTEGER,e=0,f=0;f<b.length;f++){var l=c-z(b[f]);0<=l&&l<d&&(d=l,e=f)}return b[e]},getClosestIncrementalQsItem:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;for(var d=Number.MAX_SAFE_INTEGER,e=0,f=0;f<b.length;f++){var l=
z(b[f])-c;0<=l&&l<d&&(d=l,e=f)}return b[e]},getNextDecrementQsItem:function(b,c){var d=a.getQsWidgetConfiguration(b).qsItems;c=parseInt(c);D(b)&&0<c-1?--c:!D(b)&&c+1<=d.length&&(c+=1);return B(b,c)},getNextIncrementQsItem:function(b,c){var d=a.getQsWidgetConfiguration(b).qsItems;c=parseInt(c);D(b)&&c+1<=d.length?c+=1:!D(b)&&0<c-1&&--c;return B(b,c)},getVariationSelectorItemById:function(b,a,c){b=y(b,c);if(null==b)return null;for(c=0;c<b.length;c++)if(b[c].id==a)return b[c];return null},getSelectedVariationSelectorItem:sa,
getSelectedQsItemId:ba,getInitialSelectedQsItemId:ua,getSelectedQuantity:Q,getInitialSelectedVariationSelectorItemId:wa,getSelectedVariationSelectorItemIdData:function(b,a,d){null==d&&(d=x(b));if(null==d)return null;b={};b[c.getQsWidgetVariationSelectorSelectedIdKey()]=a;a={};a[c.getQsWidgetVariationSelectorListMapKey()]={};a[c.getQsWidgetVariationSelectorListMapKey()][d]=b;return a},getSelectedVariationSelectorItemId:va,getQsItemFromQuantityTextOrQuantity:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;
if(!b)return null;for(var d=0;d<b.length;d++)if("string"===typeof c&&c.toLowerCase()==b[d].quantityText.toLowerCase()||parseFloat(c)==z(b[d]))return b[d]},getQsItemFromQuantity:function(b,c){b=a.getQsWidgetConfiguration(b);b=b.qsItems?b.qsItems:{};c=parseFloat(c);for(var d=0;d<b.length;d++)if(z(b[d])==c)return b[d]},getFocusedQsItemIdInBottomSheet:function(b){var d=ka(b).scrollTop(),e=c.getQsWidgetBottomSheetDropDownScrollFactor();d=parseInt((d-e.constant+e.adjustment)/e.increment);b=a.getQsWidgetConfiguration(b).qsItems;
return xa(b,d)},getFocusedVariationSelectorItemIdInBottomSheet:function(a,d){var b=S(a);if(null==b)return null;b=b.scrollTop();var e=c.getQsWidgetBottomSheetDropDownScrollFactor();b=parseInt((b-e.constant+e.adjustment)/e.increment);a=y(a,d);return xa(a,b)},getIndexFromIdInBottomSheet:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;return ya(b,c)},getAriaLabelTextForSelectOption:ca,getVariationSelectorIndexFromIdInBottomSheet:function(a,c,d){a=y(a,d);return ya(a,c)},saveQsWidgetDropdownTopPosition:function(b){var c=
Y(b);c&&c.position()&&(c=c.position().top,a.setData(b,{scrollTop:c}));return!1},setQsWidgetDropdownScrolled:function(b){a.setData(b,{scrollTop:-65536})},clearQsWidgetDropdownScrolled:function(b){a.setData(b,{scrollTop:c.getQsWidgetDropdownScrollMetricThreshold()})},isQsWidgetDropdownScrolled:function(b){var d=Y(b);return d?(d=d.position().top,(b=a.getQsWidgetConfiguration(b).scrollTop)?Math.abs(d-b)>c.getQsWidgetDropdownScrollMetricThreshold():!1):!1},generateQsDropdownDOM:function(b){var d="",e=
a.getQsWidgetConfiguration(b),f=e.qsItems;e=e.selectedId;var n=v(b);if(!f)return g.incrementQsWidgetFailToRender(),"";for(var h=0;h<f.length;h++){var q=f[h].id,k=f[h].quantityText,u=f[h].quantityTextAbbreviatedSuffix,x=f[h].id==e;if(n){var p=b;var m=u,r=B(p,q);u=k;if(m){var y=m.indexOf("\x3c");if(-1!=y){var w=m.indexOf("\x3c",y+1);if(m=m.substring(y,w))m=m.split("\x3e")[1],u+=". ",y=m,m=a.getQsWidgetConfiguration(p).estText,u+=m?m+" "+y:"Total est. "+y}else u=u+"."+m}r=r.price;m=qa(p).html();u=u+
". "+m+" "+(r.currencySymbol+r.wholeValue+r.decimalSeparator+r.fractionValue);r=l(p)?c.getQsWidget2DBottomSheetQuantitySelectorCssClass():c.getQsWidget1DBottomSheetSelectorCssClass();p=c.getQsWidgetDropdownItemId(p,q);p='\x3cli aria-selected\x3d"'+x+'" tabindex\x3d"-1" role\x3d"option" id\x3d"'+p+'" aria-label\x3d"'+u+'" class\x3d"'+r+'"\x3e'+k+"\x3c/li\x3e"}else{p=b;w=u;u=c.getQsWidgetDropdownItemId(p,q);r=c.getQsWidgetDropdownItemAriaId(p,q);var M=c.getQsWidgetDropdownItemQuantitySuffixId(p,q);
m=c.getQsWidgetDropdownDecl(p);y="";w&&(y='\x3cspan id\x3d"'+M+'" class\x3d"a-size-mini a-color-tertiary"\x3e'+w+"\x3c/span\x3e");w="false";M="qs-widget-dropdown-link";x&&(w="true",M+=" qs-widget-dropdown-link-active aok-block aok-nowrap");p='\x3cspan class\x3d"a-declarative" data-action\x3d"'+m+'" data-'+m+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+p+"\x26quot;,\x26quot;id\x26quot;:"+q+'}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+u+'" aria-labelledby\x3d"'+r+'" aria-checked\x3d"'+w+'" class\x3d"qs-widget-dropdown-item"\x3e\x3ca tabindex\x3d"0" href\x3d"javascript:void(0)" draggable\x3d"false" id\x3d"'+
r+'" class\x3d"'+M+'"\x3e'+k+"\x26nbsp;\x26nbsp;"+y+"\x3c/a\x3e\x3c/li\x3e\x3c/span\x3e"}d+=p}return d},generateVariationSelectorDOM:function(a,d){if(!v(a))return"";d=y(a,d);for(var b="",e=0;e<d.length;e++){var f=a,l=d[e].id,h=d[e].displayTextForMobile,n=d[e].ariaLabelText,g=c.getQsWidget2DBottomSheetVariationSelectorCssClass(),q=c.getQsWidgetCadenceDropdownItemId(f,l);c.getQsWidgetDropdownItemAriaId(f,l);var t=c.getQsWidgetVariationDropdownItemDecl();b+='\x3cspan class\x3d"a-declarative" data-action\x3d"'+
t+'" data-'+t+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+f+"\x26quot;,\x26quot;id\x26quot;:\x26quot;"+l+'\x26quot;}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+q+'" aria-label\x3d"'+n+'" class\x3d"'+g+'"\x3e'+h+"\x3c/li\x3e\x3c/span\x3e"}return b},isQsWidgetTextInputValid:da,validateQsWidgetTextInput:function(a){var b=K(a),d=b.val();a=da(a,d);var e=b.parent().hasClass(c.getQsWidgetAuiInputTextWrapperClass())?b.parent():b;if(a)return b.val(d.replace(/^0{2,}$/,"0").replace(/^0+(\d+)/g,"$1")),
e.removeClass("a-form-error"),e.addClass("a-form-normal"),!0;e.removeClass("a-form-normal");e.addClass("a-form-error");return!1},isUserClickInDropdown:function(a){var b=c.getQsWidgetDropdownContainerGenericId();for(a=null==a?null:a.target;null!=a;){if(a.id.substring(0,b.length)===b)return!0;a=a.parentElement}return!1},updateQsWidgetStepper:function(b,c){if(a.isStepper(b)){var e=B(b,c),f=e.selectedText;J(b).text(f);R(b).attr("aria-label",ca(b,f));var l=Z(b),h=aa(b),n=X(b);f=V(b);var g=W(b);O(b,c)||
0==z(e)?(l.addClass("aok-hidden"),h.removeClass("aok-hidden")):(l.removeClass("aok-hidden"),h.addClass("aok-hidden"));F(b,c)?(c=N(b,c),c.result?za(b,c.initialQuantityText):"icdp"==p(b)?n.hide():n.disable()):"icdp"==p(b)?n.show():n.enable();c=a.getQsWidgetConfiguration(b);d(b)&&(0==z(e)||"0"==c.selectedQuantity?(f.addClass("aok-hidden"),g.show()):(g.hide(),f.removeClass("aok-hidden")))}},updateSimplifiedQsWidgetStepper:function(b,c){if(m(b)){var d=a.getQsWidgetConfiguration(b);J(b).text(c);R(b).attr("aria-label",
ca(b,c));var e=Z(b),f=aa(b),l=X(b),n=V(b);b=W(b);0==c||1==c?(e.addClass("aok-hidden"),f.removeClass("aok-hidden")):(e.removeClass("aok-hidden"),f.addClass("aok-hidden"));c>=d.maxQuantity?l.disable():l.enable();0==c?(n.addClass("aok-hidden"),b.show()):(b.hide(),n.removeClass("aok-hidden"))}},showTextInput:za,hideSpinner:T,EnableVariationSelector:function(a){a&&S(a).removeClass("qs-widget-disable")},DisableVariationSelector:function(a){a&&S(a).addClass("qs-widget-disable")},getVariationSelectorDisplayTextWithQuantity:Aa,
getVariationSelectorActionTriggerId:Ca,getQsWidgetSelectionPayload:ea,isSUPU:function(b){var c=a.getQsWidgetConfiguration(b).qsCsm;if(c&&(b=c.sellingUomDimension,c=c.pricingUomDimension,b&&c))return"count"==b&&"count"==c?!0:!1},showATCButtonWhenZeroQuantity:d,isConfirmationVisible:function(a){return oa(a).is(":visible")},isBottomSheetExist:function(a){return h.aSheet.get(c.getQsWidgetBottomSheetId(a))?!0:!1},getStoreId:q,syncStepperQuantities:function(b,d,e,l,n,h,g){(b=a.getQsWidgetMapSet(b))&&(d||
0==d)&&b.forEach(function(b){var u=q(b),k=p(b).includes("fresh-dp"),x=a.isStepper(b)&&(g||l!=b),m;if(!(m=k||!l))a:{if(l&&b){m=Da(l);var t=Da(b);if("bcPrice"==m||"bcPrice"==t){m=!0;break a}if(m&&t){m=m===t;break a}}m=!1}x&&m&&(e&&u&&!k?e==u&&f.trigger(c.getQsWidgetEventSelectQuantityClientUpdate(),b,d,n,h):f.trigger(c.getQsWidgetEventSelectQuantityClientUpdate(),b,d,n,h))})},isStepper:function(b){return a.isStepper(b)},replaceNbspWithPlainTextNbsp:fa,getQsUidsFromDom:function(){var a=[],c=document.querySelectorAll('[id^\x3d"qs-widget-container-"]');
if(c)for(var d=0;d<c.length;d++)a.push(c[d].id.replace("qs-widget-container-",""));return a},setAriaExpanded:function(a,c){R(a).attr("aria-expanded",c)},parseQsItemIdFromDropdownItemId:function(a){var b=c.getQsWidgetDropdownItemIdPrefix().length,d=a.indexOf("-",b);a=a.substring(b,d);a=parseInt(a,10);return isNaN(a)?null:a},getQsWidgetMobileDropdownItemElement:la,getQsWidgetCadenceMobileDropdownItemElement:function(a,d){return f.$("#"+c.getQsWidgetCadenceDropdownItemId(a,d))},initializeMobileDropdownItemsDeclaratives:function(b,
d){var e=v(d);a.getQsWidgetConfiguration(d).qsItems.forEach(function(a){a=a.id;var b=la(d,a);e&&f.declarative.create(b,c.getQsWidgetDropdownItemDecl(),{qsUID:d,id:a})})},getBottomSheetCloseButton:function(){return f.$(".a-sheet-close")}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsWidget-duplication-guard",function(p){p.when("A","QuantitySelectorUtils","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorMetrics").register("QuantitySelectorWidget",function(f,a,c,
h,g){function k(c){a.deactivateWidget(c);a.setAriaExpanded(c,!1);var d=a.getQsWidgetButtonContainer(c),g=a.getQsWidgetDropdownContainer(c),e=a.getQsWidgetDropdownElement(c),l=a.getQsWidgetQuantityContainer(c),q=a.getQsWidgetSummaryAtcButton(c),k=a.getQsWidgetFooterPriceContainer(c),m=a.getQsWidgetFooterQuantitySuffixContainer(c);a.setElementVisibility(k,!0);a.setElementVisibility(m,!0);k=a.getQsWidgetTextInputContainer(c);a.isComponentVisible(k)||a.showComponent(d);a.hideComponent(g);a.hideComponent(e);
a.hideComponent(l);a.hideComponent(q);a.resetQsWidgetContainerMinWidthAndHeight(c);f.trigger(h.getQsWidgetEventHideDropdown(),c);c=a.getQsWidgetButton(c);c.length&&c.focus()}function p(d,n,g){var e=a.getQsItem(d,n),l=e.quantityText,q=e.quantityTextAbbreviatedSuffix,k=e.quantityTextFullSuffix,u=e.selectedText;e=e.price;var m=a.getQsWidgetSummaryPriceSymbolElement(d),p=a.getQsWidgetSummaryPriceWholeElement(d),r=a.getQsWidgetSummaryPriceFractionElement(d),v=a.getQsWidgetSummaryPriceDecimalElement(d);
a.setHtml(m,e.currencySymbol);a.setHtml(p,e.wholeValue);a.setHtml(r,e.fractionValue);a.setHtml(v,e.decimalSeparator);m=a.getQsWidgetQuantityElement(d);a.setHtml(m,l);l=a.getQsWidgetQuantitySuffixElement(d);q&&k?(a.setHtml(l,q),q=a.getQsWidgetInitialViewSuffixElement(d),a.setHtml(q,k)):a.setHtml(l,"");q=a.getQsWidgetFooterPriceSymbolElement(d);l=a.getQsWidgetFooterPriceWholeElement(d);m=a.getQsWidgetFooterPriceFractionElement(d);p=a.getQsWidgetFooterPriceDecimalElement(d);a.setHtml(q,e.currencySymbol);
a.setHtml(l,e.wholeValue);a.setHtml(m,e.fractionValue);a.setHtml(p,e.decimalSeparator);k&&(e=a.getQsWidgetFooterQuantitySuffixElement(d),a.setHtml(e,k));k="Current quantity "+u;a.isInitialViewDropdown(d)?(a.getQsWidgetButtonAsComponent(d).text(u),a.getQsWidgetButton(d).attr("aria-label",k+NaN)):a.isInitialViewTextLink(d)&&(e=a.getQsWidgetInitialViewTextLinkElement(d),e.text(u),e.attr("aria-label",k));a.setAtcButtonStepperText(d);c.setPreviousSelectedId(d,c.getQsWidgetConfiguration(d).selectedId);
c.setSelectedId(d,n);c.isStepper(d)&&a.updateQsWidgetStepper(d,n);g&&f.trigger(h.getQsWidgetEventTriggerAction(),d)}function r(d,n){if(!a.isSimplifiedStepper(d)){var g=a.getQsWidgetTextInputElement(d),e=g.val(),l=a.getQsWidgetButtonContainer(d),q=a.getQsWidgetTextInputContainer(d),k=a.getQsWidgetTextInputUpdateButtonContainer(d),m=a.getQsItemFromQuantityTextOrQuantity(d,e),r=c.isStepper(d);a.hideComponent(k);r&&a.getQsWidgetButtonAsComponent(d).text(e);m?(a.hideComponent(q),a.showComponent(l),p(d,
m.id,n)):(a.hideComponent(l),a.showComponent(q),g.blur(),c.setSelectedQuantity(d,e),g=c.getQsWidgetConfiguration(d),r&&a.isInitialViewChooseQuantity(d)&&0==g.selectedQuantity&&(g=a.getQsWidgetStepperElement(d),k=a.getQsWidgetAtcButtonAsComponent(d),a.hideComponent(q),a.showComponent(l),a.hideComponent(g),k.show()),n&&f.trigger(h.getQsWidgetEventTriggerAction(),d));r&&a.isInitialViewChooseQuantity(d)&&0<e&&(g=a.getQsWidgetStepperElement(d),k=a.getQsWidgetAtcButtonAsComponent(d),d=a.getQsWidgetAtcButton(d),
a.isComponentVisible(d)&&(a.showComponent(g),k.hide()))}}var m=null;f.on(h.getQsWidgetEventSelectId(),function(c,f,h,e){p(c,f,h);f=a.getQsWidgetButtonContainer(c);h=a.getQsWidgetTextInputContainer(c);c=a.getQsWidgetTextInputUpdateButtonContainer(c);a.hideComponent(c);a.hideComponent(h);a.showComponent(f);e&&e()});f.on(h.getQsWidgetEventSelectQuantity(),function(d,f,h,e){a.isSimplifiedStepper(d)?(f=f.toString(),c.setSelectedQuantity(d,f),a.updateSimplifiedQsWidgetStepper(d,f)):(g.incrementQsItemNotFound(!0,
a.getClientId(d)),a.getQsWidgetTextInputElement(d).val(f),r(d,h));e&&e()});f.on(h.getQsWidgetEventSyncStepperQuantity(),function(c,f,h,e,l,g,k){a.syncStepperQuantities(c,f,h,e,l,g,k)});f.on("commit-c5d19d5c",function(){});f.on(h.getQsWidgetEventSelectQuantityClientUpdate(),function(d,n,k,e){var l=a.getQsItemFromQuantityTextOrQuantity(d,n);l?f.trigger(h.getQsWidgetEventSelectId(),d,l.id,k,e):a.isSimplifiedStepper(d)?(n=n.toString(),c.setSelectedQuantity(d,n),a.updateSimplifiedQsWidgetStepper(d,n)):
(g.incrementQsItemNotFound(!0,a.getClientId(d)),a.getQsWidgetTextInputElement(d).val(n),r(d,k));e&&e()});return{hideAllPopover:function(){for(var c=a.getActivatedQsWidgets(),f=0;f<c.length;f++)k(c[f])},showPopover:function(d){a.activateWidget(d);a.setQsWidgetContainerMinWidthAndHeight(d);a.setAriaExpanded(d,!0);var f=a.getQsWidgetDropdownUnorderedListElement(d),h=a.getQsWidgetButtonContainer(d),e=a.getQsWidgetDropdownContainer(d),l=a.getQsWidgetDropdownElement(d),g=a.getQsWidgetQuantityContainer(d),
k=a.getQsWidgetSummaryAtcButton(d);a.setHtml(f,a.generateQsDropdownDOM(d));f=a.getQsWidgetFooterPriceContainer(d);var m=a.getQsWidgetFooterQuantitySuffixContainer(d);a.setElementVisibility(f,!1);a.setElementVisibility(m,!1);a.showComponent(l);a.hideComponent(g);a.hideComponent(k);a.showComponent(e);a.hideComponent(h);a.popOutDropDownContainer(d);e=c.getQsWidgetConfiguration(d);if((h=e.qsItems)||0!==h.length)e=e.selectedId,null===e&&(e=h[0].id),a.getQsWidgetDropdownItemElement(d,e).focus()},showConfirmation:function(c){a.activateWidget(c);
var d=a.getQsWidgetButtonContainer(c),f=a.getQsWidgetDropdownContainer(c),e=a.getQsWidgetDropdownElement(c),l=a.getQsWidgetQuantityContainer(c);c=a.getQsWidgetSummaryAtcButton(c);a.hideComponent(e);a.showComponent(l);a.showComponent(c);c.find("button").focus();a.showComponent(f);a.hideComponent(d)},showPrice:function(c,f){f=a.getQsItem(c,f).price;var d=a.getQsWidgetSummaryPriceSymbolElement(c),e=a.getQsWidgetSummaryPriceWholeElement(c),l=a.getQsWidgetSummaryPriceFractionElement(c);c=a.getQsWidgetSummaryPriceDecimalElement(c);
a.setHtml(d,f.currencySymbol);a.setHtml(e,f.wholeValue);a.setHtml(l,f.fractionValue);a.setHtml(c,f.decimalSeparator)},selectOption:p,validateAndSelectQuantity:r,selectConfirmation:function(d){if(a.isActionTriggerOnConfirmation(d)){if(c.isStepper(d)){var g=a.getSelectedQsItemId(d);a.updateQsWidgetStepper(d,g)}f.trigger(h.getQsWidgetEventTriggerAction(),d)}k(d)},stepperIncrement:function(d){var g=c.getQsWidgetConfiguration(d),k=a.isQsWidgetQuantityZero(d);if(a.isSimplifiedStepper(d)){var e=g.selectedQuantity;
if(!e)return;e=(parseInt(e)+1).toString();c.setSelectedQuantity(d,e);a.updateSimplifiedQsWidgetStepper(d,e)}else{if(g.selectedId){e=g.selectedId;var l=a.getNextIncrementQsItem(d,g.selectedId).id}else g.selectedQuantity||"0"==g.selectedQuantity?(e=g.selectedQuantity,l=a.getClosestIncrementalQsItem(d,g.selectedQuantity).id,a.getQsItemQuantity(a.getQsItem(d,l))==g.selectedQuantity&&(l=a.getNextIncrementQsItem(d,l).id)):l=a.getSelectedQsItemId(d);if(e===l)return;c.setSelectedId(d,l);a.updateQsWidgetStepper(d,
l)}if(a.showATCButtonWhenZeroQuantity(d)&&(e=a.getQsWidgetButton(d),a.getClientId(d).includes("p13n-buyagain-cards")&&(a.getQsWidgetPlusButton(d).find('input[type\x3d"submit"]').is(":focus")||e.length&&e.focus()),k)){c.isStepper(d)?(f.trigger(h.getQsWidgetEventTriggerAction(),d,null,null,h.getQsWidgetStepperAddToCartReftag()),e.length&&e.focus()):f.trigger(h.getQsWidgetEventTriggerAction(),d);return}null!=m&&clearTimeout(m);m=setTimeout(function(){f.trigger(h.getQsWidgetEventTriggerAction(),d)},g.stepperDebounceTime)},
stepperDecrement:function(d){var g=c.getQsWidgetConfiguration(d);if(a.isSimplifiedStepper(d)){var k=g.selectedQuantity;if(!k)return;k=parseInt(k)-1;var e=k.toString();if(0>=k){c.setSelectedQuantity(d,"0");f.trigger(h.getQsWidgetEventTriggerAction(),d);g=a.getQsWidgetStepperElement(d);g.addClass("aok-hidden");g=a.getQsWidgetAtcButtonAsComponent(d);g.show();return}c.setSelectedQuantity(d,e);a.updateSimplifiedQsWidgetStepper(d,e)}else{if(g.selectedId){if(k=a.getNextDecrementQsItem(d,g.selectedId).id,
k==g.selectedId){c.setSelectedId(d,null);c.setSelectedQuantity(d,"0");f.trigger(h.getQsWidgetEventTriggerAction(),d);a.showATCButtonWhenZeroQuantity(d)&&(g=a.getQsWidgetStepperElement(d),g.addClass("aok-hidden"),g=a.getQsWidgetAtcButtonAsComponent(d),g.show());return}}else if(g.selectedQuantity||"0"==g.selectedQuantity){if(k=a.getClosestDecrementalQsItem(d,g.selectedQuantity).id,"0"==g.selectedQuantity){c.setSelectedQuantity(d,"0");f.trigger(h.getQsWidgetEventTriggerAction(),d);a.showATCButtonWhenZeroQuantity(d)&&
(g=a.getQsWidgetStepperElement(d),g.addClass("aok-hidden"),g=a.getQsWidgetAtcButtonAsComponent(d),g.show());return}}else k=a.getSelectedQsItemId(d);a.updateQsWidgetStepper(d,k);c.setSelectedId(d,k)}null!=m&&clearTimeout(m);m=setTimeout(function(){f.trigger(h.getQsWidgetEventTriggerAction(),d)},g.stepperDebounceTime)}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("QuantitySelector-duplication-guard",function(p){p.when("A","QuantitySelectorWidget","QuantitySelectorUtils","QuantitySelectorState",
"QuantitySelectorConstants","QuantitySelectorMetrics","QuantitySelectorAUIDeps","QuantitySelectorMetadata","QuantitySelectorTemplates").register("QuantitySelector",function(f,a,c,h,g,k,p,v,m){function d(a,d){try{var e=c.isMobile(d)}catch(x){x instanceof TypeError&&k.incrementInvalidIdCount();return}try{if(!c.isInitialized(d)||a)eval(v.getMetaConfiguration(d,"script")),h.setInitialized(d),c.initializeWidget(d),c.isQsWidgetEnabled(d)?c.enableQsWidget(d):c.disableQsWidget(d),k.incrementInitializeCount(!0,
e)}catch(x){k.incrementInitializeCount(!1,e)}}function n(a){h.loadQsWidgetStateConfiguration(a);d(!0,a)}function u(){for(var a=h.getQsUIDs(),d=0;d<a.length;d++){var f=a[d];c.isInitialized(f)||n(f)}}f.declarative(g.getQsWidgetButtonDecl(),"click",function(d){var e=d.data.qsUID;d=c.isMobile(e);var f=h.isStepper(e),g=c.isSimplifiedStepper(e),m=c.isSUPU(e),n=h.getQsWidgetConfiguration(e).selectedId,p=c.isElementVisible(c.getQsWidgetAtcButton(e));if(g||m&&f&&!n){if(c.showATCButtonWhenZeroQuantity(e)&&
!p)return;d&&!c.isBottomSheetExist(e)&&a.getBottomSheet(e);a.stepperIncrement(e)}else d?a.showBottomSheet(e):a.showPopover(e);k.incrementShowPopup(d);c.isInitialViewDropdown(e)?k.logCsm(e,"cqd"):k.logCsm(e,"ccq");setTimeout(function(){c.saveQsWidgetDropdownTopPosition(e)},250)});f.declarative(g.getQsWidgetDropdownDecl(),"click",function(d){var e=d.data.qsUID;d=d.data.id;var f=c.isActionTriggerOnSelect(e),g=c.isTextInputRequired(e,d),h=c.isConfirmationViewEnabled(e),m=c.isQsWidgetDropdownScrolled(e);
h?m?(c.setQsWidgetDropdownScrolled(e),k.logCsm(e,"dcq_scl")):(c.clearQsWidgetDropdownScrolled(e),k.logCsm(e,"dcq")):m?k.logCsm(e,"dsq_scl"):k.logCsm(e,"dsq");a.selectOption(e,d,f&&!g.result);g.result?(c.showTextInput(e,g.initialQuantityText),a.hideAllPopover()):h?a.showConfirmation(e):a.hideAllPopover()});f.declarative(g.getQsWidgetStepperIncrementDecl(),"click",function(d){d=d.data.qsUID;var e=c.getQsWidgetPlusButtonAsComponent(d),f=c.getQsWidgetPlusButton(d);c.isElementVisible(f)&&e.isEnabled()&&
a.stepperIncrement(d)});f.declarative(g.getQsWidgetStepperDecrementDecl(),"click",function(d){d=d.data.qsUID;var e=c.getQsWidgetMinusButton(d);c.isElementVisible(e)&&a.stepperDecrement(d)});f.declarative(g.getQsWidgetDropdownItemDecl(),"click",function(d){var e=d.data.qsUID;a.alignQsItem(e,d.data.id);c.isConfirmationViewEnabled(e)?c.getQsWidgetSummaryAtcButton(e).attr("tabindex","-1").focus():a.getBottomSheetContainer(e).attr("tabindex","-1").focus()});f.declarative(g.getQsWidgetDropdownItemDecl(),
"keydown",function(d){var e=d.data.qsUID,f=d.$event.which;37<=f&&40>=f&&setTimeout(function(){var d=document.activeElement,f=d.getAttribute("aria-selected");d&&d.id&&d.id.startsWith("qs-widget-dropdown-item")&&"false"===f&&(d=c.parseQsItemIdFromDropdownItemId(d.id))&&a.alignQsItem(e,d)},50);f===g.getReturnKeyCode()&&(a.alignQsItem(e,d.data.id),c.isConfirmationViewEnabled(e)?c.getQsWidgetSummaryAtcButton(e).find("button").focus():(d=c.getBottomSheetCloseButton())&&d.focus())});f.declarative(g.getQsWidgetVariationDropdownItemDecl(),
"click",function(c){a.alignVariationSelectorItem(c.data.qsUID,c.data.id)});f.declarative(g.getQsWidgetDropdownDecl(),"focusin",function(c){a.showPrice(c.data.qsUID,c.data.id)});f.declarative(g.getQsWidgetDropdownDecl(),"mouseenter",function(c){a.showPrice(c.data.qsUID,c.data.id)});f.declarative(g.getQsWidgetDropdownDecl(),"mouseleave",function(d){d=d.data.qsUID;var e=c.getSelectedQsItemId(d);a.showPrice(d,e)});f.declarative(g.getQsWidgetQuantityChangelinkDecl(),"click",function(d){d=d.data.qsUID;
h.setSelectedId(d,h.getQsWidgetConfiguration(d).previousSelectedId);a.showPopover(d);k.incrementChangeLinkCount();c.saveQsWidgetDropdownTopPosition(d);k.logCsm(d,"ccl")});f.declarative(g.getQsWidgetSummaryAtcDecl(),"click",function(d){d=d.data.qsUID;a.selectConfirmation(d);c.isQsWidgetDropdownScrolled(d)?k.logCsm(d,"atc_scl"):k.logCsm(d,"atc")});f.declarative(g.getQsWidgetTextInputDecl(),"keydown",function(a){var d=a.data.qsUID,e=a.$event.which;8==e||9==e||13==e||37<=e&&40>=e||46==e||(!(48<=e&&57>=
e||96<=e&&105>=e)||a.$event.shiftKey||a.$event.altKey||a.$event.ctrlKey||a.$event.metaKey?a.$event.preventDefault():3<=c.getQsWidgetTextInputElement(d).val().length&&a.$event.preventDefault())});f.declarative(g.getQsWidgetTextInputDecl(),"keyup",function(d){var e=d.data.qsUID;c.validateQsWidgetTextInput(e)&&13==d.$event.keyCode?(d=c.isActionTriggerOnSelect(e)||h.isStepper(e),a.validateAndSelectQuantity(e,d)):c.showTextInput(e)});f.declarative(g.getQsWidgetTextInputDecl(),"focusout",function(a){a=
a.data.qsUID;if(""===c.getQsWidgetTextInputElement(a).val()){var d=(d=h.getQsWidgetConfiguration(a).selectedId)?c.getQsItem(a,d).selectedText:c.getSelectedQuantity(a);c.showTextInput(a,d);c.validateQsWidgetTextInput(a)}});f.declarative(g.getQsWidgetTextInputDecl(),"change",function(a){c.showTextInput(a.data.qsUID)});f.declarative(g.getQsWidgetTextInputUpdateButtonDecl(),"click",function(d){var e=d.data.qsUID;c.validateQsWidgetTextInput(e)&&(e=d.data.qsUID,d=c.isActionTriggerOnSelect(e)||c.isActionTriggerOnConfirmation(e),
a.validateAndSelectQuantity(e,d))});f.$(document).click(function(d){0==c.getActivatedQsWidgets().length||c.isUserClickInDropdown(d)||(d=c.getActivatedQsWidgets()[0],c.isConfirmationVisible(d)&&h.setSelectedId(d,h.getQsWidgetConfiguration(d).previousSelectedId),a.hideAllPopover())});f.$(w).resize(function(){a.hideAllPopover()});f.on(g.getQsWidgetEventInitialize(),function(a,c){p.initialize();if("string"==typeof c)d(a,c);else{c=h.getQsUIDs();for(var e=0;e<c.length;e++)d(a,c[e])}});f.on(g.getQsWidgetEventLoadStatesAndInitialize(),
function(){try{u()}catch(e){if(e instanceof SyntaxError)f.delay(function(){try{u()}catch(l){r.logError(l)}},200);else throw e;}});f.on(g.getQsWidgetEventConfigureEnable(),function(a){c.enableQsWidget(a)});f.on(g.getQsWidgetEventConfigureDisable(),function(a){c.disableQsWidget(a)});f.on(g.getQsWidgetEventConfigureReset(),function(a){for(var c=h.getQsUIDs(),d=0;d<c.length;d++){var e=c[d];if("string"!==typeof a||a==e)h.reloadQsWidgetStateConfiguration(e),f.trigger(g.getQsWidgetEventInitialize(),!0,e)}});
c.hideSpinner();m=f.now();k.logLatencyMetric("JSReady",m);return{loadStateAndInitializeWidget:n}})})});
/* ******** */
(function(e){var h=window.AmazonUIPageJS||window.P,n=h._namespace||h.attributeErrors,r=n?n("ALMCartActionAssets",""):h;r.guardFatal?r.guardFatal(e)(r,window):r.execute(function(){e(r,window)})})(function(e,h,n){function r(c,b){try{e.register(c,b)}catch(d){if(!d.message.includes("reregistered by ALMCartActionAssets"))throw d;}}function F(){var c=arguments;return{register:function(b,d){try{e.when.apply(e,c).register(b,d)}catch(a){if(!a.message.includes("reregistered by ALMCartActionAssets"))throw a;
}}}}e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-csm-metrics-utils").register("alm-cart-action-query-string-utils",function(b,d){function a(a,d){var k=f(a),c=g(a);k?d["discoveredAsins.0"]=a.asin:c&&(a=b.filter(a.items,function(a){return f(a)}),a=b.map(a,function(a){return a.asin}),b.each(a,function(a,b){d["discoveredAsins."+b.toString()]=a}));return d}function g(a){return a&&a.items&&b.$.isArray(a.items)&&0<a.items.length}function f(a){return a&&a.asin&&"string"===
typeof a.asin&&""!==a.asin}return{addQueryStringParamsToUrl:function(g,f){var c={};if(f&&f.reftag){var k=f.reftag;"string"===typeof k&&""!==k&&(c.ref_=k)}if(f&&f.queryLogInfoParams){k=f.queryLogInfoParams;for(var e in k)k.hasOwnProperty(e)&&"string"===typeof e&&""!==e&&"string"===typeof k[e]&&""!==k[e]&&(c[e]=k[e])}a(f,c);try{var l=(new URLSearchParams(h.location.search)).get("almBrandId");l&&(c.almBrandId=l)}catch(x){d.increment("ATFC_INVALID_URL_ALMBRANDID")}try{var q=(new URLSearchParams(h.location.search)).get("gsc");
q&&(c.gsc=q)}catch(x){d.increment("ATFC_INVALID_URL_GSC")}(f=b.$.param(c))&&"string"===typeof f&&""!==f&&(g+="?"+f);return g}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","jQuery").register("afx-add-all-helper",function(b,d){return{updateQuantityForAsin:function(a,b,f){a&&b&&!isNaN(f)&&d("#"+a).closest("form").find("#afx-add-all-"+b+"-quantity").attr("value",f)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A",
"jQuery","a-button").register("fx-atfc-button-utils",function(b,d,a){function g(a){return"atfc-spinner-"+(a.asin?a.asin:a.clientId?a.clientId:"noAsin")}var f=!1;return{hideButtonAndRenderSpinner:function(a){var b=a.$currentTarget.find(".a-button");if(b&&b.length){f=!0;a=g(a.data);var c=b.not(".aok-hidden").not(".non-spinner");c&&a.length&&(c.wrap('\x3cdiv id\x3d"'+a+'" class\x3d"atfc-spinner"\x3e\x3c/div\x3e'),d("#"+a).css({width:c.outerWidth()+"px"}),d("#"+a).css({height:c.outerHeight()+"px"}));
b.css("visibility","hidden")}},showButtonAndRemoveSpinner:function(a){var b=a.$currentTarget.find(".a-button"),c=g(a.data);c=d("#"+c);b&&b.length&&c&&c.length&&(f=!1,b.each(function(){d(this).parent().hasClass("atfc-spinner")&&d(this).unwrap()}),b.css("visibility","visible"));a.data&&a.data.qsUID&&!1===a.data.setQuantityFlag&&e.when("QuantitySelectorUtils").execute(function(b){b=b.getQsWidgetButton(a.data.qsUID);b.length&&b.focus()})},shouldDisableButtonClicks:function(){return f}}})});"use strict";
e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("fresh-shared-add-to-cart-v2","qs-fresh-shared-add-to-cart").register("fresh-add-to-cart",function(b,d){function a(a){b.attachCallbacks(a)}b.initialize("desktop");d.initialize("desktop");return{addToFreshCart:function(b){a(b)},attachCallbacks:a,attachPrehooks:function(a){b.attachPrehooks(a)},updateAddAllQuantityForAsin:b.updateAddAllQuantityForAsin,updateQuantity:b.updateQuantity}})});e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A",
"alm-cart-action-assets-device","afx-metrics-helper","afx-csm-metrics-utils").register("alm-cart-action-assets-metrics",function(b,d,a,g){b=a.getMetricsForDevice(d.getDevice());g.increment(b.ATFC_ASSET_LOAD);return{}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("shared-alm-multi-add-to-cart").register("alm-multi-add-to-cart",function(b){function d(a){b.attachCallbacks(a)}b.initialize("desktop");return{multiAddToCart:function(a){d(a)},attachCallbacks:d,attachPreHandler:function(a){b.attachPreHandler(a)}}})});
"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","alm-cart-action-query-string-utils").register("afx-atfc-v2-proxy",function(b,d){return{addToFreshCart:function(a){var g=d.addQueryStringParamsToUrl("/alm/addtofreshcart",a.data);b.$.ajax(g,{type:"POST",contentType:"application/json",data:JSON.stringify(a.data)}).done(a.success).fail(a.error)},showGenericErrorModal:function(a){b.post("/alm/atfcGenericErrorModal/",{timeout:5E3,success:a.success,error:a.error})}}})});
"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("fx-atfo-proxy",function(b){return{addToFreshOrder:function(d){var a="/fom/add-to-fresh-order";d.reftag!==n&&(a+="/ref\x3d"+d.reftag);d.data!==n&&d.data.csrfToken&&(a+="?csrf\x3d"+encodeURIComponent(d.data.csrfToken));b.post(a,{success:d.success,error:d.error,params:JSON.stringify(d.data),paramsFormat:"json",contentType:"application/json"})},getFallbackErrorModalHtml:function(){return{header:"Item was not added to the order",
errorMessage:"We're sorry, there was an error and \x3cb\x3ethis item was not added to your order.\x3c/b\x3e Please try again.",footer:"\x3cspan class\x3d'a-declarative' data-action\x3d'a-popover-close'data-a-popover-close\x3d'{}'\x3e\n\x3cspan class\x3d'a-button primary-fresh-btn'\x3e\x3cspan class\x3d'a-button-inner'\x3e\x3cinput class\x3d'a-button-input'type\x3d'submit'\x3e\x3cspan class\x3d'a-button-text' aria-hidden\x3d'true'\x3eOK\n\x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e"}}}})});
"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("afx-atfc-cart-conflicts-proxy",function(b){function d(a){a.ref=a.reftag;a.client="atfc";return a}return{getConflictSummary:function(a){var g=d(a.data);b.post("/afx/cartconflicts/getconflictsummary",{timeout:5E3,success:a.success,error:a.error,params:g})},resolve:function(a){var g=d(a.data);b.post("/afx/cartconflicts/resolve",{timeout:5E3,success:a.success,error:a.error,params:g})},substitute:function(a){a=
d(a.data);a.sourceUrl=h.location.pathname+h.location.search;a=b.$.param(a);h.location.href="/afx/cartconflicts/resolve/substitute?"+a}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("afx-get-cart-count",function(b){return function(d){b.get("/alm/addtofreshcart/cartcount",{timeout:5E3,success:function(a){d.success&&d.success({isOK:!0,total:{numActiveItem:a.cartCount}})},error:function(a){d.error&&d.error(a)}})}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A",
"alm-cart-action-query-string-utils").register("alm-multi-add-to-cart-proxy",function(b,d){return{multiAddToCart:function(a){var g=d.addQueryStringParamsToUrl("/alm/addtocart/multiple",a.data);b.$.ajax(g,{type:"POST",contentType:"application/json",data:JSON.stringify(a.data)}).done(a.success).fail(a.error)}}})});"use strict";r("ALMCartActionAssetDuplicationGuard",function(){return{register:r,when:F}});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-callbacks-helper",
function(b){function d(b){var g=b in a;!g&&e.log("Unable to retrieve callback for "+b,"Error");return g}var a={};return{addCallbacks:function(b){a[b.clientID||"default"]=b},success:function(b,c,e){b=b in a?b:"default";d(b)&&a[b].success&&a[b].success(c,e)},error:function(b,c,e,l){b=b in a?b:"default";d(b)&&a[b].error&&a[b].error(c,e,l)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("alm-cart-action-assets-device",function(b){return{getDevice:function(){return"desktop"}}})});
"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-preHandler-helper",function(b){var d={};return{addPreHandler:function(a){d[a.clientID||"default"]=a},getPreHandler:function(a){return d[a]}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-prehooks-helper",function(b){function d(b){var d=b in a?b:"default";d=d in a&&a[d].invoke;!d&&e.log("Unable to retrieve prehook for "+b,"Error");return d}var a={};return{addPrehooks:function(b){a[b.clientID||
"default"]=b},invoke:function(b,c){var g=b.clientId in a?b.clientId:"default";d(b.clientId)&&a[g].invoke(b.triggerEvent,c,b.scope,b.success,b.failure,b.device)},validatePrehook:d,prehooksWeblabEnabled:!1}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-csm-metrics-utils",function(){var b={},d=function(a,b){h.ue&&h.ue.count&&a&&b&&h.ue.count(a,b)};return{startWidgetTimer:function(a){b[a]=Date.now()},endWidgetTimer:function(a,c){a=Date.now()-b[a];d(c,
a)},setWidgetClickTimestamp:function(a){h.ue&&h.uet&&a&&h.uet("tc",a,{wb:1})},setWidgetTimestamp:function(a,b){h.ue&&h.uet&&a&&b&&h.uet(a,b,{wb:1})},increment:function(a){h.ue&&h.ue.count&&a&&h.ue.count(a,(h.ue.count(a)||0)+1)},setCount:d,sendWidgetMetrics:function(a){h.ue&&h.uex&&a&&h.uex("ld",a,{wb:1})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("add-to-cart-common-utils",function(){return{vibrate:function(){return h.amazon&&h.amazon.cordova&&h.amazon.cordova.notification&&
h.amazon.cordova.notification.vibrate&&h.amazon.cordova.notification.vibrate(50)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","a-modal").register("fresh-atfc-modal-utils",function(b,d){return{removeModal:function(){var a=d.get("fresh-add-to-cart-modal");a&&d.remove(a)},showModal:function(a,c,e){c&&(c={name:"fresh-add-to-cart-modal",header:c.header,inlineContent:c.body,footer:c.footer},"desktop"===e&&(c.width=325),d.create(a.$currentTarget,c).show(),
b.on("a:popover:afterHide:".concat("fresh-add-to-cart-modal"),function(a){d.remove(a.popover)}))}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","jQuery","afx-atfc-v2-proxy","afx-csm-metrics-utils","afx-metrics-helper","afx-quantity-helper","fresh-atfc-ewc-helper","fresh-atfc-fallback-error-modal-helper").register("fresh-atfc-error-modal-utils",function(b,d,a,c,f,k,l,h){function g(a,c,d,f){e.when("a-modal").execute("showModal",function(v){c||m(a);a.data.quantity&&
(k.updateQuantity("fresh-clear-slot-button",a.data.quantity),k.updateQuantity("alcohol-warning-fresh-add-to-cart-button",a.data.quantity),k.updateQuantity("regions-out-of-sync-inline-fresh-add-to-cart-button",a.data.quantity));var e={name:"fresh-add-to-cart-error-modal",header:c.header,inlineContent:c.errorMessage,footer:c.footer,data:{event:a,response:f}};"desktop"===d&&(e.width=325);v.create(a.$currentTarget,e).show();b.on("a:popover:afterHide:".concat("fresh-add-to-cart-error-modal"),function(b){l.refreshCart(a.data.sessionID);
v.remove(b.popover)})})}function m(c,v){a.showGenericErrorModal({success:function(a,b,e){a&&(a=d.parseJSON(e.http.response),q(c,a,v))},error:function(){e.log("Failed to get the generic error modal","Error");var a=h.getFallbackErrorModal();c.data.qsUID&&c.data.prevSelectedQty&&c.data.isStepperFlag&&(b.isListening("quantity-selector-widget:sync-stepper-quantity")?b.trigger("quantity-selector-widget:sync-stepper-quantity",c.data.asin,c.data.prevSelectedQty,c.data.storeId):b.trigger("quantity-selector-widget:selectQuantity:clientUpdate",
c.data.qsUID,c.data.prevSelectedQty,!1));g(c,a,v)}})}function t(a,b){if(a.data.asin&&a.data.storeId&&b.clientResponseModel&&b.clientResponseModel.items){var c=b.clientResponseModel.items.filter(function(b){return b.ASIN===a.data.asin});1<c.length&&(c=c.filter(function(b){return b.ASIN===a.data.asin&&b.storeId===a.data.storeId}));if(1===c.length&&c[0].hasOwnProperty("amountInCart"))return parseFloat(c[0].amountInCart);if(b.clientResponseModel.uberCartStatus&&a.data.prevSelectedQty&&"INTERNAL_SERVER_ERROR"===
b.clientResponseModel.uberCartStatus.errorStatusCode)return parseFloat(a.data.prevSelectedQty)}return 0}function q(a,d,e){var v=d.errorModalHtml,k=f.getMetricsForDevice(e);d.clientResponseModel&&d.clientResponseModel.uberCartStatus&&d.clientResponseModel.uberCartStatus.errorStatusCode in k&&c.increment(k[d.clientResponseModel.uberCartStatus.errorStatusCode]);a.data.qsUID&&(k=t(a,d),null!=k&&a.data.isStepperFlag&&(b.isListening("quantity-selector-widget:sync-stepper-quantity")?b.trigger("quantity-selector-widget:sync-stepper-quantity",
a.data.asin,k,a.data.storeId):b.trigger("quantity-selector-widget:selectQuantity:clientUpdate",a.data.qsUID,k,!1)));g(a,v,e,d)}return{removeModal:function(){e.when("a-modal").execute("removeModal",function(a){var b=a.get("fresh-add-to-cart-error-modal");b&&a.remove(b)})},showModal:g,showGenericErrorModal:m,parseResponseAndShowErrorModal:q,getItemInCartQuantityFromResponse:t}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","jQuery","afx-atfc-v2-proxy","afx-get-cart-count").register("fresh-atfc-ewc-helper",
function(b,c,a,g){function d(a){g({sessionID:a,success:function(a){a&&a.isOK&&a.total&&k(a.total.numActiveItem)},error:function(){e.log("Failed to get cart count","Error",a)}})}function k(a){e.when("nav.setCartCount").execute(function(b){b(a)});e.when("mash").execute(function(b){b.cart&&"function"===typeof b.cart.didUpdate&&b.cart.didUpdate({newCartQuantity:a})})}var l;e.when("EWC").execute("add-to-cart-refresh",function(a){l=a});e.when("nav.getFlyout").execute(function(a){a("ewc")});return{refreshCart:function(a){l!==
n&&"function"===typeof l.refresh?l.refresh():d(a)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-storeIntroductionSheet-helper","afx-cpi-helper","afx-notification-helper").register("f3-consumables-atc-helper",function(b,c,a,e){return{handleAddToCart:function(d,g,l){g.storeIntroductionSheetHtml&&g.storeIntroductionSheetHtml.content||d.additionalParams&&d.additionalParams.shouldRenderSIS?c.render(d,g,l):g.renderUFGCartProgressIndicator?a.render(d):
b.trigger("fresh-atfc:success","false",{almBrandId:d.brandId});e.handleAddToCart(g,l)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-metrics-helper",function(){var b={ATFC_COUNT:"afxAddToFreshCartCount",ALM_MULTI_ATC_COUNT:"almMultiAddToCartCount",ATFC_ASSET_LOAD:"almAssetLoadCount",ATFC_SUCCESSFUL_ADD_COUNT:"afxAddToFreshCartSuccessfulAddCount",ALM_MULTI_ATC_COUNT_SUCCESS:"almMultiAddToCartCountSuccess",ATFC_ERROR_MODAL_COUNT:"afxAddToFreshCartErrorModalCount",
ALM_MULTI_ATC_COUNT_ERROR_MODAL:"almMultiAddToCartCountErrorModal",ATFC_UNEXPECTED_ERROR_COUNT:"afxAddToFreshCartUnexpectedErrorCount",ALM_MULTI_ATC_COUNT_ERROR_UNEXPECTED:"almMultiAddToCartCountErrorUnexpected",ATFC_LATENCY_SCOPE:"afxAddToFreshCartLatencyScope",ATFC_ERROR_MODAL_LATENCY_SCOPE:"afxAddToFreshCartErrorModalLatencyScope",ATFC_CTCF:"afxAddToFreshCartCTCF",ATFC_STORE_INTRODUCTION_SHEET:"afxStoreIntroductionSheet",ATFC_OCX_STORE_INTRODUCTION_SHEET:"afxOfferComparisonStoreIntroductionSheet",
CLEAR_SLOT_ATFC_CTCF:"afxClearSlotAndAddToFreshCartCTFC",CART_SERVICE_RESPONSE_FALSE:"afxCartServiceResponseIsNotOKErrorCount",ATFC_NOTIFICATION_RETRY:"afxAddToCartNotificationRetryCount",ATFC_NOTIFICATION_FAILURE:"afxAddToCartNotificationFailureCount",ITEM_NOT_AVAILABLE:"afxItemNotAvailableErrorModalCount",ITEM_PARTIALLY_AVAILABLE:"afxItemPartiallyAvailableErrorModalCount",ITEM_PARTIALLY_AVAILABLE_FOR_RESERVATION:"afxItemPartiallyAvailableErrorModalCount",ADDRESS_NOT_SELECTED:"afxAddressNotSelectedErrorCount",
INPUT_INVALID:"afxGeneralErrorModalCount",ITEM_NOT_AVAILABLE_FOR_RESERVATION:"afxItemNotAvailableForReservationErrorModalCount",INTERNAL_SERVER_ERROR:"afxGeneralErrorModalCount",PRICE_UNAVAILABLE:"afxItemNotAvailableErrorModalCount",QUANTITY_OVERFLOW:"afxUniqueItemQuantityOverflowErrorModalCount"};return{getMetricsForDevice:function(c){var a={};Object.keys(b).forEach(function(d){a[d]=b[d]+":"+c});return a}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("afx-quantity-helper",
function(b){var c={};return{updateQuantity:function(a,b){"undefined"!==typeof a&&null!==a&&!isNaN(b)&&0<b&&(c[a]=b||1)},getQuantity:function(a){a=a.closest(".a-button");return 0<a.length?c[a.attr("id")]||1:1}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-csm-metrics-utils","afx-metrics-helper","f3-glowchangeaddress").register("afx-storeIntroductionSheet-helper",function(b,c,a,g){function d(a){e.when("a-sheet").execute(function(b){b.create({inlineContent:a,
closeType:"icon",height:190}).show();h("mobile",!1)})}function k(a,c,d){var f=a.additionalParams;if(a.asin&&a.brandId&&a.offerListingDiscriminator&&a.storeId){var g={almBrandId:a.brandId,almStoreId:a.storeId,asin:a.asin,isDelivery:c.delivery,offerListingDiscriminator:a.offerListingDiscriminator,isAlmDetailPageBopis:c.almDetailPageBopis};c.newGlowAddressId&&(g.newGlowAddressId=c.newGlowAddressId);a.clientID&&(g.clientId=a.clientID);f&&f.sisDeliveryMessage&&(g.deliveryMessage="DELIVERY_MESSAGE_PLACEHOLDER");
b.get("/fmc/sis",{params:g,accepts:"text/html; charset\x3dutf-8",timeout:3E3,success:function(a){var b=document.getElementById("almStoreIntroductionSheet");b||(b=document.createElement("div"),b.setAttribute("id","almStoreIntroductionSheet"),document.body.appendChild(b));l(b,a,f.sisDeliveryMessage);h(d,!0)},error:function(a,b,c){e.log("Failed to render store introduction sheet: "+c,"Error")}})}else e.log("Failed to render store introduction sheet: Missing Parameters","Error")}function l(a,b,c){a.innerHTML=
b;if(b=a.querySelector("#store-introduction-sheet-delivery-message span"))b.innerHTML=c;a.querySelectorAll("script").forEach(function(a){var b=document.createElement("script");Array.from(a.attributes).forEach(function(a){b.setAttribute(a.name,a.value)});b.appendChild(document.createTextNode(a.innerHTML));a.parentNode.replaceChild(b,a)})}function h(b,d){b=a.getMetricsForDevice(b);d?c.increment(b.ATFC_OCX_STORE_INTRODUCTION_SHEET):c.increment(b.ATFC_STORE_INTRODUCTION_SHEET)}function n(a,c){var d=a.newGlowAddressId,
e=a.storeFrontUrl,f=a.isAlmDetailPageBopis;if(d)if(g.setAddress({addressId:d,almBrandId:a.almBrandId}),b.capabilities.isAmazonApp)m(e,f,c);else b.on("packard:glow:destinationChangeNavAck",function(){m(e,f,c)});else m(e,f,c)}function m(a,b,c){b?c?q():p():a&&(location.href=a)}function p(){e.when("a-sheet").execute(function(a){var b=a.get("alm-store-introduction-sheet");a.hideSheet(b);b.destroy()})}function q(){var a=b.$("#store-introduction-sheet-side-sheet-container").width()+30;x({right:"-"+a+"px"},
function(){b.$("#store-introduction-sheet-side-sheet-container").remove()});b.$("body").css({overflow:"visible"});b.hide(b.$("#store-introduction-sheet-background"));b.$("#store-introduction-sheet-background").remove()}function x(a,c){b.animate(b.$("#store-introduction-sheet-side-sheet-container"),a,300,"ease-out",c)}b.declarative("sis-storefront-button-action","click",function(a){n(a.data,!0)});b.declarative("sis-storefront-button-action-mobile","click",function(a){n(a.data,!1)});return{render:function(a,
b,c){a.additionalParams&&a.additionalParams.shouldRenderSIS?b&&b.storeIntroductionSheetEnabled&&k(a,b,c):"mobile"===c&&d(b.storeIntroductionSheetHtml.content)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("afx-cpi-helper",function(b){return{render:function(b){}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("f3-glowchangeaddress",function(b){function c(c,d){var f={};c=g(c);""==c?e.log("CSRF Token not available in response from get-rendered-address-selections response",
"Error"):(f.addressId=d.addressId,f.almBrandId=d.almBrandId,f.actionSource="f3-pickup-conflict",f.locationType="ACCOUNT_ADDRESS",f.deviceType="web",f.pageType=h.ue_pty,b.post("/portal-migration/hz/glow/address-change?actionSource\x3dglow",{headers:{"Content-Type":"application/json","anti-csrftoken-a2z":c},params:f,paramsFormat:"json",success:function(b){a()},error:function(){e.log("Unable to set GLOW address","ERROR")}}))}function a(){b.capabilities.isAmazonApp?e.when("BottomSheetPlugin").execute(function(a){a.UpdateGlowIngress({})}.bind(this)):
b.trigger("packard:glow:destinationChangeNav")}function g(a){var b=a.indexOf('"',a.indexOf("CSRF_TOKEN"))+1;if(0!=b){var c=a.indexOf('"',b);return a.substring(b,c)}return""}return{setAddress:function(a){b.get("/portal-migration/hz/glow/get-rendered-address-selections?deviceType\x3ddesktop\x26pageType\x3dDetail\x26storeContext\x3dgrocery\x26actionSource\x3ddesktop-modal",{headers:{"Content-Type":"application/json","anti-csrftoken-a2z":b.$("#glowValidationToken").val()||""},success:function(b){c(b,
a)},error:function(){e.log("Unable to get rendered address content","ERROR")}})},refreshGlowIngress:a}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("search-add-to-cart-helper",function(b){return{start:function(){e.now("rush-framework","rush-dispatcher").execute(function(b,a){b!==n&&a!==n&&a.trigger("search-add-to-cart:start",{})})},success:function(b,a){e.now("rush-framework","rush-dispatcher").execute(function(c,d){c!==n&&d!==n&&d.trigger("search-add-to-cart:success",
{response:a,event:b})})},error:function(){e.now("rush-framework","rush-dispatcher").execute(function(b,a){b!==n&&a!==n&&a.trigger("search-add-to-cart:error",{})})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-csm-metrics-utils","afx-metrics-helper").register("afx-notification-helper",function(b,c,a){return{handleAddToCart:function(a,b){}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-atfc-cart-conflicts-proxy").register("afx-atfc-cart-conflicts-executor",
function(b,c){return{execute:function(a){c.getConflictSummary({data:a.data,success:function(d,e,h){!0===d.isSuccess?!0===d.hasConflicts?c.substitute({data:a.data}):c.resolve({data:a.data,success:function(){b.trigger("fresh-cart-conflict-resolution:success");location.reload()},error:a.error}):a.error(h,e,"Failed to call getconflictsummary")},error:a.error})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-atfc-v2-proxy","fx-atfo-proxy","fx-atfc-button-utils",
"afx-csm-metrics-utils","afx-metrics-helper","afx-quantity-helper","afx-prehooks-helper","afx-callbacks-helper","afx-atfc-cart-conflicts-executor","fresh-atfc-error-modal-utils","fresh-atfc-ewc-helper","afx-add-all-helper","f3-consumables-atc-helper","add-to-cart-common-utils","f3-glowchangeaddress","search-add-to-cart-helper").register("fresh-shared-add-to-cart-v2",function(b,c,a,g,f,k,l,t,y,m,p,q,x,v,r,G,B){return{updateQuantity:l.updateQuantity,attachPrehooks:t.addPrehooks,attachCallbacks:y.addCallbacks,
updateAddAllQuantityForAsin:x.updateQuantityForAsin,initialize:function(d){function x(a){return a.isItemSoldByCount?!JSON.parse(a.isItemSoldByCount):a.pickingStrategy?"bulk"===a.pickingStrategy||"catch"===a.pickingStrategy:!1}function A(a,b,c,e){r.vibrate();a.data.amountInUom===n&&x(a.data)&&(a.data.amountInUom=a.data.quantity,a.data.quantity=1);var u={clientId:a.data.clientID,triggerEvent:a,scope:b,success:c,failure:e,device:d};h.ue_pty&&(a.data.pageType=h.ue_pty);h.ue_spty&&(a.data.subPageType=
h.ue_spty);var g=D(a,b,e);t&&t.prehooksWeblabEnabled&&t.validatePrehook(u.clientId)?t.invoke(u,{success:E,error:function(a,b,c){g(a,b,c)}}):E(a,b,c,e)}function D(a,b,c){return function(e,u,h){var k=w.ATFC_CTCF,m=e.responseText;p.removeModal();if(m){var l=JSON.parse(m);k=w.ATFC_CTCF+":lineItemBucket:"+C(l.clientResponseModel)}400===e.status&&l?(f.increment(w.ATFC_ERROR_MODAL_COUNT),p.parseResponseAndShowErrorModal(a,l,d)):403===e.status?location.reload():(f.increment(w.ATFC_UNEXPECTED_ERROR_COUNT),
p.showGenericErrorModal(a,d),y.error(a.data.clientID,a,e,u,h),B.error());f.endWidgetTimer(b,k);a.data.setQuantityFlag||g.showButtonAndRemoveSpinner(a);c&&c()}}function E(a,e,h,k){var u=D(a,e,k);B.start();c.addToFreshCart({data:a.data,success:function(c,u,k){if(200===k.status)if(f.increment(w.ATFC_SUCCESSFUL_ADD_COUNT),u=w.ATFC_CTCF+":lineItemBucket:"+C(c),f.endWidgetTimer(e,u),u=p.getItemInCartQuantityFromResponse(a,c),b.isListening("commit-c5d19d5c")&&a.data.setQuantityFlag!==n&&a.data.qsUID?b.trigger("quantity-selector-widget:sync-stepper-quantity",
a.data.asin,u,a.data.storeId,a.data.qsUID,!1,!1,!a.data.setQuantityFlag,a.data.clientID):a.data.setQuantityFlag&&a.data.qsUID?b.trigger("quantity-selector-widget:sync-stepper-quantity",a.data.asin,u,a.data.storeId,a.data.qsUID):b.trigger("quantity-selector-widget:sync-stepper-quantity",a.data.asin,u,a.data.storeId),q.refreshCart(a.data.sessionID),y.success(a.data.clientID,a,c.clientResponseModel),B.success(a,c.clientResponseModel),c.refreshGlowLabel){if(G.refreshGlowIngress(),c.storefrontUrl)if(b.capabilities.isAmazonApp)location.href=
c.storefrontUrl;else b.on("packard:glow:destinationChangeNavAck",function(){location.href=c.storefrontUrl})}else c.shouldRedirectToOgs?c.ogsUrl?setTimeout(function(){location.href=c.ogsUrl},3E3):location.reload():v.handleAddToCart(a.data,c,d);p.removeModal();a.data.setQuantityFlag||g.showButtonAndRemoveSpinner(a);h&&h()},error:function(a,b,c){u(a,b,c)}})}function H(a,c){f.startWidgetTimer(c);b.post("/afx/slotselection/cancel",{timeout:5E3,params:{token:a.data.additionalParams.csrfToken},success:function(){a.data.quantity=
l.getQuantity(a.$target);A(a,c,function(){location.reload()})},error:function(){e.log("Failed to clear reservation");p.showGenericErrorModal(a,d)}})}function C(a){return a.items&&Math.ceil(a.items.length/5)}var w=k.getMetricsForDevice(d),z=w.ATFC_LATENCY_SCOPE+Date.now();b.on("quantity-selector-widget:action:AddToCartAction",function(a){a.additionalParams&&(a.additionalParams=b.$.parseJSON(a.additionalParams));a.queryLogInfoParams&&(a.queryLogInfoParams=b.$.parseJSON(a.queryLogInfoParams));var c=
{data:a};if(a.tunneledData&&a.tunneledData.$target){var d=a.tunneledData.$target;c=b.$.extend(c,{$target:d,$currentTarget:d,$declarativeTarget:d});delete a.tunneledData}else a=b.$("#qs-widget-button-container-"+a.qsUID),c=b.$.extend(c,{$target:a,$currentTarget:a,$declarativeTarget:a}),c.data.setQuantityFlag||g.hideButtonAndRenderSpinner(c);A(c,z)});b.declarative("fresh-clear-slot","click",function(a){a.$currentTarget.context.disabled=!0;H(a,z)});b.declarative("fresh-add-to-cart","click",function(a){f.startWidgetTimer(z);
f.increment(w.ATFC_COUNT);g.shouldDisableButtonClicks()||a.$currentTarget.find("input").is(":disabled")||(a.data.setQuantityFlag||g.hideButtonAndRenderSpinner(a),a.data.qsUID?b.trigger("quantity-selector-widget:triggerAction",a.data.qsUID,"AddToCartAction",{$target:a.$currentTarget}):(a.data.quantity=l.getQuantity(a.$target),A(a,z)))});b.declarative("fresh-add-to-cart-alcohol","click",function(a){a.$currentTarget.context.disabled=!0;f.startWidgetTimer(z);a.data.quantity=l.getQuantity(a.$target);b.trigger("quantity-selector-widget:sync-stepper-quantity",
a.data.asin,a.data.quantity);A(a,z)});b.declarative("fresh-add-to-cart-regions-resolve","click",function(a){a.$currentTarget.context.disabled=!0;p.removeModal();m.execute({data:a.data,error:function(b,c,e){p.showGenericErrorModal(a,d);y.error(a.data.clientID,a,b,c,e)}})});b.declarative("fresh-add-to-order","click",function(b){g.shouldDisableButtonClicks()||(g.hideButtonAndRenderSpinner(b),r.vibrate(),a.addToFreshOrder({data:b.data,success:function(a,c,d){200===d.http.status&&y.success(b.data.clientID,
b,a.clientResponseModel);g.showButtonAndRemoveSpinner(b)},error:function(c,e,f){p.removeModal();if(400===c.http.status)c=JSON.parse(c.responseText),p.parseResponseAndShowErrorModal(b,c,d);else if(401===c.http.status)location.reload();else{var h=a.getFallbackErrorModalHtml();p.showModal(b,h,d);y.error(b.data.clientID,b,c,e,f)}g.showButtonAndRemoveSpinner(b)}}))})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","alm-multi-add-to-cart-proxy","fx-atfc-button-utils",
"afx-csm-metrics-utils","afx-metrics-helper","afx-callbacks-helper","afx-preHandler-helper","fresh-atfc-error-modal-utils","fresh-atfc-ewc-helper","f3-consumables-atc-helper","add-to-cart-common-utils").register("shared-alm-multi-add-to-cart",function(b,c,a,e,f,h,l,t,r,m,p){return{attachCallbacks:h.addCallbacks,attachPreHandler:l.addPreHandler,initialize:function(d){function g(f,g,l,q){p.vibrate();c.multiAddToCart({data:f.data,success:function(c,g,p){200===p.status&&(e.increment(k.ALM_MULTI_ATC_COUNT_SUCCESS),
r.refreshCart(f.data.sessionID),b.trigger("multipleAddToCart:success",f.data),h.success(f.data.clientId,f,c),m.handleAddToCart(f.data,c,d));t.removeModal();a.showButtonAndRemoveSpinner(f);l&&l()},error:function(b,c,g){a.showButtonAndRemoveSpinner(f);t.removeModal();if(b.responseText)try{var m=JSON.parse(b.responseText)}catch(C){m=n}400===b.status&&m?(e.increment(k.ALM_MULTI_ATC_COUNT_ERROR_MODAL),t.parseResponseAndShowErrorModal(f,m,d)):403===b.status?location.reload():(e.increment(k.ALM_MULTI_ATC_COUNT_ERROR_UNEXPECTED),
t.showGenericErrorModal(f,d));h.error(f.data.clientId,f,b,c,g);q&&q()}})}var k=f.getMetricsForDevice(d),q=k.ATFC_LATENCY_SCOPE+Date.now();b.declarative("alm-multi-add-to-cart","click",function(b){e.increment(k.ALM_MULTI_ATC_COUNT);var c=l.getPreHandler(b.data.clientId);c&&c.preHandle&&(c=c.preHandle(b))&&(b=c);c=b.$currentTarget.find("input");!b.data.items||1>b.data.items.length||a.shouldDisableButtonClicks()||c.is(":disabled")||(a.hideButtonAndRenderSpinner(b),g(b,q))})}}})});e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A",
"f3-consumables-atc-helper","fresh-atfc-ewc-helper","afx-callbacks-helper","fresh-atfc-error-modal-utils","add-to-cart-common-utils").register("qs-fresh-shared-add-to-cart",function(b,c,a,e,f,h){return{initialize:function(d){function g(a){return"UFG"==a.cartType&&a.response&&a.request&&a.request.additionalInput?!0:!1}function k(b){if(g(b)&&b.response.rawResponse){var h=b.response.rawResponse,k=h.jqXHR,l=b.request,m=l.triggeringEvent;m.data=l.additionalInput;m.data&&(m.data.isDecreaseQuantityAction=
b.isDecreaseQuantityAction);200===k.status&&(a.refreshCart(l.sessionId),e.success(b.clientName,m,h.clientResponseModel),c.handleAddToCart(m.data,h,d));f.removeModal()}}b.on("quantity-slider:add-to-cart-start",function(a){h.vibrate()});b.on("quantity-slider:remove-from-cart-start",function(a){h.vibrate()});b.on("quantity-slider:remove-from-cart-success",function(a){k(a)});b.on("quantity-slider:add-to-cart-success",function(a){k(a)});b.on("quantity-slider:cart-submit-error",function(a){if(g(a)){var b=
a.request.triggeringEvent,c=a.response,h=c.responseText,k;f.removeModal();h&&(k=JSON.parse(h));b.data=a.request.additionalInput;400===c.status&&k?f.showModal(b,k.errorModalHtml,d):403===c.status?location.reload():(f.showGenericErrorModal(b,d),e.error(a.clientName,b,c,"error",c.statusText))}})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){var b={en:{header:"Item was not added to the cart",errorMessage:"We're sorry, there was an error and \x3cb\x3ethis item was not added to your cart.\x3c/b\x3e Please try again.",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},es:{header:"Producto no añadido a la cesta",errorMessage:"Se ha producido un error y este producto \x3cb\x3eno se ha añadido a tu cesta.\x3c/b\x3e Inténtalo de nuevo.",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eAceptar\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},ar:{header:"لم تتم إضافة السلعة إلى عربة التسوق",errorMessage:"عذرًا، حدث خطأ ولم تتم إضافة هذه السلعة إلى عربة التسوق الخاصة بك. يرجى المحاولة مرة أخرى",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3e\nموافق \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},bn:{header:"কার্টে আইটেম যোগ করা হয়নি",errorMessage:"আমরা দুঃখিত, একটি ত্রুটি ছিল এবং এই আইটেমটি আপনার কার্টে যোগ করা হয় নি। অনুগ্রহ করে পুনরায় চেষ্টা করুন।",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eঠিক আছে\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},cs:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},da:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},de:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},fr:{header:"Article non ajouté au panier",errorMessage:"Nous sommes désolés, il y a eu une erreur et cet article n'a pas été ajouté à votre panier. Veuillez réessayer.",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},hi:{header:"आइटम कार्ट से नहीं जोड़ा गया",errorMessage:"हमें खेद है, एक त्रुटि हुई थी और यह आइटम आपके कार्ट में जोड़ा नहीं गया था. कृपया फिर से कोशिश करें।",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eठीक है\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},it:{header:"Articolo non aggiunto al carrello",errorMessage:"Desculpe, ocorreu um erro e este item \x3cb\x3enão foi adicionado ao seu carrinho.\x3c/b\x3e Por favor, tente novamente.",
footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},ja:{header:"商品がカートに追加されていません",errorMessage:"申し訳ございません。エラーが発生したため、\x3cb\x3eこの商品はカートに追加されませんでした。\x3c/b\x3eもう一度お試しください。",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
kn:{header:"ಐಟಂ ಅನ್ನು ಕಾರ್ಟ್‍ಗೆ ಸೇರಿಸಿಲ್ಲ",errorMessage:"ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ, ಇದರಲ್ಲಿ ಒಂದು ದೋಷವಿದೆ ಮತ್ತು ಈ ಐಟಂ ಅನ್ನು ನಿಮ್ಮ ಕಾರ್ಟ್‍ಗೆ ಸೇರಿಸಿಲ್ಲ. ದಯವಿಟ್ಟು ಪುನಃ ಪ್ರಯತ್ನಿಸಿ.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eಸರಿ\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
ml:{header:"ബാസ്കറ്റിൽ ചേർക്കാത്ത ഇനം",errorMessage:"ക്ഷമിക്കണം,ഒരു പിശക് ഉണ്ടായി,നിങ്ങളുടെ കാർട്ടിൽ ഈ ഇനം ചേർത്തിട്ടില്ല. വീണ്ടും ശ്രമിക്കുക.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eശരി\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
mr:{header:"आयटम कार्टला जोडले गेलेले नाही",errorMessage:"आम्ही दिलगीर आहोत, एक चूक झाली आणि हे आयटम आपल्या कार्टमध्ये जोडले गेले नाही. कृपया पुन्हा प्रयत्न करा.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eठीक\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
nl:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
pl:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
pt:{header:"O item não foi adicionado ao carrinho",errorMessage:"Desculpe, ocorreu um erro e este item \x3cb\x3enão foi adicionado ao seu carrinho.\x3c/b\x3e Por favor, tente novamente.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
ta:{header:"பொருள் கார்ட்டில் சேர்க்கப்படவில்லை",errorMessage:"மன்னிக்கவும், பிழை ஏற்பட்டது, இந்த உருப்படி உங்கள் கார்ட்டில் சேர்க்கப்படவில்லை. மீண்டும் முயற்சிக்கவும்.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eசரி\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
te:{header:"వస్తువుని బాస్కెట్‌లో చేర్చలేదు",errorMessage:"మమ్మల్ని క్షమించండి, అక్కడ ఏదో ఎర్రర్ ఏర్పడింది అందుచేత మీ బాస్కెట్‌లో ఈ వస్తువును జోడించలేదు. దయచేసి మళ్లీ ప్రయత్నించండి.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eసరే\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
tr:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
zh:{header:"商品未加入购物车",errorMessage:"很抱歉，出现错误，\x3cb\x3e该商品未添加至您的购物车。\x3c/b\x3e请重试。",footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button primary-fresh-btn"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3e好\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'}};c.when("A").register("fresh-atfc-fallback-error-modal-helper",
function(c){return{getFallbackErrorModal:function(){var a=document.querySelector("html[lang]");return a&&(a=a.getAttribute("lang"),a!==n&&(a=a.split("-"),a.length))?b[a[0]]:b.en}}})})});
/* ******** */
(function(g){var k=window.AmazonUIPageJS||window.P,l=k._namespace||k.attributeErrors,b=l?l("PulseStaplesActionAssets",""):k;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,k,l){String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(b,f){f=0<f?f|0:0;return this.substring(f,f+b.length)===b}});"use strict";g.when("A","pulse-staple-action-constants").register("pulse-staples-action-proxy",function(b,f){var c=function(a,d){var c=
a.success,e=a.error;b.$.ajax({url:d,type:"POST",data:JSON.stringify(a.data),contentType:"application/json; charset\x3dutf-8",dataType:"json",success:c,error:e,timeout:1E4})};return{addStaples:function(a){var d=f.addStaplesBaseUrl+"?"+b.$.param({reftag_:a.data.reftag});c(a,d)},updateStaple:function(a){var d=f.updateStapleBaseUrl+"?"+b.$.param({reftag_:a.data.reftag});c(a,d)}}});"use strict";g.when("A","a-dropdown","pulse-staple-action-error-modal-utils","pulse-staple-action-constants").register("pulse-add-action-state-util",
function(b,f,c,a){var d=function(a){return a.prop("enabled")===l||!0===a.prop("enabled")},g=function(e,c){return setTimeout(function(){var d=e.$currentTarget.closest(a.stapleActionRowSelector),h=d.nextAll(a.eduContentInitialViewSelector);h=0<h.length?b.$.makeArray(d,h):d;b.fadeOut(h,150,a.auiEaseOutAnimation,function(){var e=b.$(c);e.height(d.outerHeight());var h=e.filter(a.stapleActionRowSelector),g=d.nextAll(a.eduContentManageStaplesViewSelector);h=0<g.length?b.$.makeArray(h,g):h;d.replaceWith(e);
e=e.find(".a-dropdown-container select");(e=f.getSelect(e))&&e.val(e.val());b.fadeIn(h,150,a.auiEaseOutAnimation)})},1E3)};return{addActionSuccessTransition:function(e,d){var c=e.$currentTarget.nextAll(a.spinnerSelector),h=e.$currentTarget.nextAll(a.successSelector);e.data&&Array.isArray(e.data.templates)&&e.data.templates.includes("DO_NOT_RENDER_QUANTITY_CADENCE_SELECTOR")?g(e,d):b.fadeOut(c,150,a.auiEaseOutAnimation,function(){b.fadeIn(h,150,a.auiEaseOutAnimation,function(){return g(e,d)})})},addActionFailureTransition:function(e,
b){var h=e.$currentTarget.nextAll(a.spinnerSelector),f=e.$currentTarget.find(a.auiButtonSelector);d(f)||(h.toggleClass(a.auiHiddenCssClass),f.prop("enabled",!0),f.show(),c.showModal(e.$target,b))},addActionInProgressTransition:function(b){var e=b.$currentTarget.nextAll(a.spinnerSelector),c=b.$currentTarget.find(a.auiButtonSelector);if(d(c)){var f=b.$currentTarget.find(a.auiButtonSelector).outerHeight();b.$currentTarget.closest(a.stapleActionRowSelector).height(f);e.toggleClass(a.auiHiddenCssClass);
c.prop("enabled",!1);c.hide()}},itemAlreadyRepeatedTransition:function(e,d){var c=e.$currentTarget.closest(a.stapleActionRowSelector);e=c.nextAll(a.eduContentInitialViewSelector);e=b.$.makeArray(c,e);b.fadeOut(e,150,a.auiEaseOutAnimation,function(){var e=b.$(d);e.height(c.outerHeight());c.replaceWith(e);b.fadeIn(e,150,a.auiEaseOutAnimation)})},isAddActionInProgress:function(b){return!d(b.$currentTarget.find(a.auiButtonSelector))}}});"use strict";g.when("A","pulse-staple-action-error-modal-utils",
"pulse-staple-action-constants").register("pulse-update-action-state-util",function(b,f,c){return{renderUpdatedNextDropDate:function(a,d){d&&b.$(c.nextAddDateRowTextSelectorPrefix+"-"+a).text(d)},showErrorModalOnFailure:function(a,b){return f.showModal(a,b)},renderUpdatedQuantityAndCadence:function(a,d){d&&b.$(c.cadenceRowTextSelectorPrefix+"-"+a).text(d)},toggleInProgressCx:function(a){var d=b.$(c.updateStapleComponentSelectorPrefix+"-"+a),f=d.outerHeight();d.height(f);b.$(c.updateSpinnerContainerSelectorPrefix+
"-"+a).add(c.updateActionRowSelectorPrefix+"-"+a).toggleClass(c.auiHiddenCssClass)}}});"use strict";g.when("A","a-modal").register("pulse-staple-action-error-modal-utils",function(b,f){b.on("a:popover:afterHide:pulse-staple-action-error-modal",function(b){f.remove(b.popover)});var c=function(a){try{return JSON.parse(a.responseText).errorModalHtml}catch(d){return b.state("pulse-staple-action-error-messages").generic}};return{removeModal:function(){var b=f.get("pulse-staple-action-error-modal");b&&
f.remove(b)},showModal:function(b,d){f.create(b,{name:"pulse-staple-action-error-modal",inlineContent:c(d)}).show()}}});"use strict";g.when("A","a-popover","pulse-staple-action-constants").register("pulse-staple-action-educational-content",function(b,f,c){b.declarative(c.educationalContentLearnMoreDecAction,["click","mouseenter"],function(b){f.create(b.$target,{url:c.educationalContentBaseUrl+"?learnMoreManageStaplesLink\x3d"+b.data.learnMoreManageStaplesLink,position:"triggerLeft",width:320,closeButton:!1,
padding:"none"}).show()})});"use strict";g.when("A").register("pulse-staple-action-constants",function(){return{addStaplesBaseUrl:"/repeatitems/psa/v1/add",updateStapleBaseUrl:"/repeatitems/psa/v1/update",educationalContentBaseUrl:"/repeatitems/psa/v1/educontent",educationalContentLearnMoreDecAction:"pulse-staple-action-learn-more",educationalContentBottomSheetName:"pulse-staple-action-learn-more-bottom-sheet",spinnerSelector:".atsl-spinner-element",successSelector:".atsl-success-element",stapleActionRowSelector:".staple-action-row",
eduContentInitialViewSelector:".staple-action-learn-more-initial-view",eduContentManageStaplesViewSelector:".update-staple-action-manage-staples-link",auiButtonSelector:".a-button",auiHiddenCssClass:"aok-hidden",auiEaseOutAnimation:"ease-out",nextAddDateRowTextSelectorPrefix:"#pulse-staples-action-next-add-date-row-text",cadenceRowTextSelectorPrefix:"#pulse-staple-action-qty-cadence-row-text",updateSpinnerContainerSelectorPrefix:"#pulse-staple-update-spinner-container",updateActionRowSelectorPrefix:"#pulse-staple-update-action-row",
updateStapleComponentSelectorPrefix:"#update-staple-component",updateStapleSuccessfulEventId:"UpdateStapleSuccessfulEvent"}});"use strict";g.when("A").register("pulse-staple-action-metric-util",function(){return{logAddStapleLatencyMetric:function(b,f){k.ue&&k.ue.count&&"undefined"!==typeof k.ue_t0&&ue.count("AddStaple-TimeTo-"+b,f-k.ue_t0)}}});"use strict";g.when("A","pulse-staples-action-proxy","pulse-add-action-state-util","pulse-staple-action-metric-util").register("pulse-add-staple-action",function(b,
f,c,a){var d=function(a){return b.$.extend({},a,{clientContext:a,asins:[a.asin]})};b.declarative("pulse-add-to-staples-action","click",function(a){c.isAddActionInProgress(a)||(c.addActionInProgressTransition(a),f.addStaples({data:d(a.data),success:function(d){"ItemAlreadyRepeated"===d.addOperationStatus?c.itemAlreadyRepeatedTransition(a,d.nextViewHtml):(c.addActionSuccessTransition(a,d.nextViewHtml),b.trigger("AddToStaplesSuccessfulEvent",a.data.asin))},error:function(b){return c.addActionFailureTransition(a,
b)}}))});var g=b.now();a.logAddStapleLatencyMetric("JSReady",g)});"use strict";g.when("A","pulse-staples-action-proxy","pulse-update-action-state-util","QuantitySelectorWidget","QuantitySelectorConstants","QuantitySelectorState","QuantitySelectorUtils","QuantitySelectorAUIDeps","a-dropdown","a-modal","pulse-staple-action-constants").register("pulse-update-staple-action",function(b,f,c,a,d,g,e,h,k,l,m){var n=function(b){return k.getSelect("pulse-staple-cadence-selector-desktop-"+b)},q=function(a){var d=
g.getQsWidgetConfiguration(a).selectedId;d=e.getQsItem(a,d);d=JSON.parse(d.data);var c=g.getQsWidgetConfiguration(a);c=JSON.parse(c.staticData);return b.$.extend({},c,d,{quantity:{quantity:d.quantity,unit:c.quantityUnit},cadence:JSON.parse(n(a).val()),clientContext:c})},p=function(a){var c=b.state("pulse-original-cadence-"+a);n(a).val(JSON.stringify(c));c=d.getQsWidgetConfigurationId(a)+"-original";(c=h.aState.state(c))&&c.id&&h.aState.state.replace(d.getQsWidgetConfigurationId(a),c);b.trigger(d.getQsWidgetEventInitialize(),
!0,a)};b.on("a:popover:afterShow",function(a){if((a=a.popover)&&a.name&&a.name.startsWith("pulse-staple-action-qs")){a=a.name.replace("pulse-staple-action-qs-","");var c=d.getQsWidgetConfigurationId(a)+"-original";h.aState.state(c);var e=g.getQsWidgetConfiguration(a);h.aState.state(c,e);b.state("pulse-original-cadence-"+a,JSON.parse(n(a).val()))}});b.on("a:popover:hide",function(a){(a=a.popover)&&a.name&&a.name.startsWith("pulse-staple-action-qs")&&(a=a.name.replace("pulse-staple-action-qs-",""),
b.$(m.updateSpinnerContainerSelectorPrefix+"-"+a).hasClass(m.auiHiddenCssClass)&&p(a))});b.declarative("pulse-update-staple-action","click",function(a){var d=a.data.qsUID,e=a.$currentTarget.closest(".a-popover-modal");e=l.get(e);c.toggleInProgressCx(d);e.hide();f.updateStaple({data:q(d),success:function(a){c.renderUpdatedQuantityAndCadence(d,a.renderableQuantityCadence);c.renderUpdatedNextDropDate(d,a.renderableNextDropDate);b.trigger(m.updateStapleSuccessfulEventId);c.toggleInProgressCx(d)},error:function(b){c.showErrorModalOnFailure(a.$target,
b);p(d);c.toggleInProgressCx(d)}})})})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,e=b._namespace||b.attributeErrors,a=e?e("ALMCustomizationAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,e){c.when("fresh-add-to-cart","customization-service","fresh-atfc-error-modal-utils","fx-atfc-button-utils").execute(function(a,c,e,q){var g=/^(?:[a-zA-Z0-9 .!$&?]{1,30})?$/,f=document.getElementById("customTextArea"),h=document.getElementById("customCakeProfanityMessage"),r=document.getElementById("customCakeSpecialCharErrorMessage"),
t=document.getElementById("customCakeErrorPopupTitle");f&&a.attachPrehooks({invoke:function(d,a,l,k,m,p){function n(a){b.ue&&b.ue.count&&a&&b.ue.count("WFMOAC_CakeCustomization_ATC",a)}"a-form-error"===f.getAttribute("class")?(a=g.test(f.value)?h.innerHTML:r.innerHTML,e.showModal(d,{header:t.innerHTML,errorMessage:a,footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button a-button-primary"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input"type\x3d"submit"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true"\x3eOK\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
p),q.showButtonAndRemoveSpinner(d)):f.value?(n(1),c.saveCustomization(a,{asin:d.data.asin,almStoreId:d.data.storeId,price:d.data.price,personalizedMessage:f.value,csrfToken:d.data.csrfToken},d,l,function(){f.value="";k&&k()},m)):(n(0),a.success(d,l,k,m))}})});"use strict";c.when("A").register("customization-service",function(a){return{saveCustomization:function(c,b,e,g,f,h){a.post("/alm/customization",{success:function(a){e.data.additionalParams=Object.assign(e.data.additionalParams||{},{customizationToken:a.customizationToken});
c.success(e,g,f,h)},error:function(a,b,d){c.error(a,b,d)},contentType:"application/json",params:b,paramsFormat:"json"})}}})});
/* ******** */
(function(e){var g=window.AmazonUIPageJS||window.P,m=g._namespace||g.attributeErrors,a=m?m("F3GLOWAssets",""):g;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,g,m){e.when("f3-glow-utils","f3-glow-url-utils","f3-glow-constants","f3-glow-window-utils").register("f3-glow-manager",function(a,d,b,h){var c=function(){var c="true"===d.getUrlParameter(b.OPEN_GLOW),f=d.getUrlParameter(b.ACTIVE_TAB),l=d.getUrlParameter(b.STORE_CONTEXT);return c&&null!==f?(a.openGlowToActiveTab(f,
l),h.ue.count(b.OPENING_GLOW_METRIC,1),!0):c?(a.openGlowToActiveTab(b.DELIVERY,l),h.ue.count(b.OPENING_GLOW_METRIC,1),!0):!1};if(c()){var f=d.getUrlWithoutParameters(b.OPEN_GLOW,b.ACTIVE_TAB,b.STORE_CONTEXT);g.history.replaceState(null,null,f)}return{openGlowGivenUrlParameters:c}});"use strict";e.register("f3-glow-constants",function(){var a=["FreshMerchandisedContent","FreshMerchandisedContentMobile","Detail","DetailAW","DetailWebView"],d={nowstore:a},b={amazonfresh:a,dia:a},h={amazonfresh:a,u2supermercato:a,
pampanorama:a},c={amazonfresh:a,watsons:a,littlefarms:a};return{OPEN_GLOW:"openGlow",ACTIVE_TAB:"activeTab",GLOW_CLASS_NAME:"#nav-global-location-slot",STORE_CONTEXT:"storeContext",DELIVERY:"deliveryTab",WAITING_FOR_STORE_CONTEXT_EVENT:"glow.waitingForStoreContext",STORE_CONTEXT_EVENT:"glow.storeContext",GLUX_BOTTOMSHEET_NAME:"glux_bottom_sheet",GET_ADDRESS_SELECTIONS_ENDPOINT:"/gp/glow/get-address-selections.html",GLOW_BOTTOMSHEET_ID:"#glow-bottom-sheet",OPENING_GLOW_METRIC:"f3glowassets.glow.open",
ALM_BRAND_ID:"almBrandId",MAP_BRAND_ID_TO_ALIAS:{ctnow:"nowstore",QW1hem9uIEZyZXNo:"amazonfresh",TGEgUGxhemEgZGUgRGlh:"dia",VTIgU3VwZXJtZXJjYXRv:"u2supermercato",UGFtIFBBTk9SQU1B:"pampanorama",TW9ub3ByaXg:"monoprix",Q2FzaW5v:"casino",TW9ycmlzb25z:"morrisons",Q29vcA:"co-op",ejEjkXsQmO:"iceland",dGVndXQuLi4:"tegut","5oiQ5Z1O551z5LqV":"seijoishii","44OQ44Ot44O8":"valor","44Op44Kk44OV":"life",KQENHJywk4:"watsons",WDpqStVxNA:"littlefarms",VUZHIFdob2xlIEZvb2Rz:"wholefoods"},CLOSING_BRACES:"}",WEBLAB_MAP_KEY:"WEBLABS",
PROGRAM_SPECIFIC_MODAL_NAME:"program_specific_modal",PROGRAM_SPECIFIC_SHEET_NAME:"program_specific_bottom_sheet",PROGRAM_SPECIFIC_MODAL_WIDTH:475,PROGRAM_SPECIFIC_SHEET_DEFAULT_HEIGHT:400,GLOW_DESTINATION_TYPE_ID:"#glowDestinationType",CONDO_DIV_ID:"#Condo",NO_PAGE_TYPE:"NoPageType",WEBLAB_TREATMENTS:{C:"C",T1:"T1",T2:"T2"},PROGRAM_SPECIFIC_SHEET_ENABLED_PAGES:{A21TJRUUN4KGV:d,A2XZLSVIQ0F4JT:d,A1RKKUPIHCS9HS:b,AJZF8LZ1EJVJN:b,APJ6JRA9NG5V4:h,A3HOBANJMCMD83:h,A13V1IB3VIYZZH:{monoprix:a,casino:a},A1F83G8C2ARO7P:{amazonfresh:a,
morrisons:a,"co-op":a,iceland:a},A1PA6795UKMFR9:{amazonfresh:a,tegut:a},A1VC38T7YXB528:{amazonfresh:a,seijoishii:a,valor:a,life:a},A19VAU5U5O7RUS:c,A1DQ6JV7I20JSG:c,ATVPDKIKX0DER:{amazonfresh:a,wholefoods:a}},PROGRAM_SPECIFIC_SHEET_ENABLED_PAGE_TYPES_BASED_ON_URL:["storefront","dp","gp/product"],GLOW_NOT_SET_LOCATION_TYPES:["IP2LOCATION","REALM_DEFAULT","COUNTRY"],GET_LOCATION_LABEL_ENDPOINT:"/portal-migration/hz/glow/get-location-label",PROGRAM_SPECIFIC_SHEET_LOCAL_STORAGE_KEY:"programSpecificSheetGenerationTime",
PROGRAM_SPECIFIC_SHEET_TTL:2592E6,CURRENT_TIME:(new Date).getTime(),SKIP_ID:"GLUXProgramSpecificSheetSkipLink",DEVICE_TYPE:{DESKTOP:"desktop",WEBVIEW:"webview",APP:"mobile"},PROGRAM_SPECIFIC_ACTION_SOURCE:{DESKTOP:"desktop-programspecific-modal",WEBVIEW:"mweb-programspecific-bottomsheet",APP:"mobile-app-programspecific-bottomsheet"},GLOW_ACTION_SOURCE:"glow",GET_REQUEST_TYPE:"GET",ADDRESS_SELECTIONS_VIEW_MODEL_ENDPOINT:"/portal-migration/hz/glow/get-address-selections-view-model",UNREC_ALM_BOTTOM_SHEET_WEBLAB:"UNREC_BOTTOM_SHEET_ALM_516161",
PROGRAM_SPECIFIC_SHEET_OPEN_METRICS:"f3glowassets.programspecificsheet.open",PROGRAM_SPECIFIC_SHEET_SKIP_METRICS:"f3glowassets.programspecificsheet.skip",ADDRESS_SELECTION_AJAX_CALL_FAILED_METRICS:"f3glowassets.programspecificsheet.addressselectionscall.failed",PROGRAM_SPECIFIC_MODAL_CLOSE_EVENT:"a:popover:afterHide:program_specific_modal",PROGRAM_SPECIFIC_SHEET_CLOSE_EVENT:"a:sheet:afterHide:program_specific_bottom_sheet",PROGRAM_SPECIFIC_SHEET_AFTER_OPEN_EVENT:"a:sheet:afterShow:program_specific_bottom_sheet"}});
"use strict";e.when("A","mash","f3-glow-constants").execute(function(a,d,b){function h(b){var a=!1;e.now(b).execute(function(b){a=!!b});return a}d.addEventListener(b.STORE_CONTEXT_EVENT,function(b){h("store-context")||e.register("store-context",function(){return{getStoreContext:function(){return b.detail.storeContext}}})});d.dispatchEvent({type:b.WAITING_FOR_STORE_CONTEXT_EVENT})});"use strict";e.when("f3-glow-common-utils","f3-glow-program-specific-sheet-utils","f3-glow-program-specific-sheet-renderer").execute("f3-glow-program-specific-sheet-manager",
function(a,d,b){a.getStoreContext(b.DEVICE_TYPE).then(function(a){a&&d.shouldRender(a).then(function(c){c&&b.renderSheet(a)})})});"use strict";e.when("A").register("f3-glow-address-selections-constants",function(a){return{REQUEST_TYPE:"GET",ENDPOINT:"/portal-migration/hz/glow/get-rendered-address-selections"}});"use strict";e.when("3p-promise","f3-glow-constants","f3-glow-window-utils").register("f3-glow-common-utils",function(a,d,b){return{getPageType:function(){return b.ue_pty?b.ue_pty:d.NO_PAGE_TYPE},
getStoreContext:function(b){return new a(function(a){switch(b){case d.DEVICE_TYPE.DESKTOP:e.when("packardGlowStoreName").execute(function(b){a(b)});break;case d.DEVICE_TYPE.WEBVIEW:e.when("glowMobileStoreName").execute(function(b){a(b)});break;case d.DEVICE_TYPE.APP:e.when("store-context").execute(function(b){a(b.getStoreContext())});e.when("f3-glow-url-utils").execute(function(b){a(d.MAP_BRAND_ID_TO_ALIAS[b.getUrlParameter(d.ALM_BRAND_ID)])});break;default:e.log("Invalid device type: "+b,"ERROR",
"F3GLOWAssets"),a(null)}})},logEvent:function(a){b.ue&&b.ue.count(a,(b.ue.count(a)||0)+1)}}});"use strict";e.when("A","a-modal","f3-glow-constants").register("f3-glow-utils",function(a,d,b){return{openGlowToActiveTab:function(h){var c=a.$(b.GLOW_CLASS_NAME),f=d.get(c);if(null===f||0===c.length)e.log("Unable to get GLOW on Desktop","ERROR","F3GLOWAssets");else try{var n=f.attributes.url;f.attributes.url+="\x26"+b.ACTIVE_TAB+"\x3d"+h;f.show();f.attributes.url=n}catch(k){e.log("Unable to open GLOW on Desktop: "+
k,"ERROR","F3GLOWAssets")}}}});"use strict";e.when("A","a-modal","f3-glow-address-selections-constants","f3-glow-common-utils","f3-glow-constants","f3-glow-program-specific-sheet-utils","f3-glow-window-utils").register("f3-glow-program-specific-sheet-renderer",function(a,d,b,e,c,f,n){return{DEVICE_TYPE:c.DEVICE_TYPE.DESKTOP,renderSheet:function(k){f.getResponse(b.ENDPOINT,b.REQUEST_TYPE,c.DEVICE_TYPE.DESKTOP,k,c.PROGRAM_SPECIFIC_ACTION_SOURCE.DESKTOP).then(function(b){var a=f.getWeblabTreatment(b,
c.UNREC_ALM_BOTTOM_SHEET_WEBLAB);!b||a!==c.WEBLAB_TREATMENTS.T1&&a!==c.WEBLAB_TREATMENTS.T2?a===c.WEBLAB_TREATMENTS.C&&f.storeSheetGenerationTime():(b={name:c.PROGRAM_SPECIFIC_MODAL_NAME,inlineContent:b,hideHeader:!0,width:c.PROGRAM_SPECIFIC_MODAL_WIDTH,closeButton:!1},d.create(document.createElement("span"),b).show(),f.storeSheetGenerationTime(),e.logEvent(c.PROGRAM_SPECIFIC_SHEET_OPEN_METRICS+":"+c.DEVICE_TYPE.DESKTOP))});a.declarative(c.SKIP_ID,"click touchend",function(){d.get(c.PROGRAM_SPECIFIC_MODAL_NAME).hide();
e.logEvent(c.PROGRAM_SPECIFIC_SHEET_SKIP_METRICS+":"+c.DEVICE_TYPE.DESKTOP)});a.on(c.PROGRAM_SPECIFIC_MODAL_CLOSE_EVENT,function(){n.refresh()})}}});"use strict";e.when("A","3p-promise","f3-glow-constants","f3-glow-common-utils","f3-glow-window-utils").register("f3-glow-program-specific-sheet-utils",function(a,d,b,g,c){var f=function(a,d){return d!==b.NO_PAGE_TYPE?a.includes(d):c.location.href?b.PROGRAM_SPECIFIC_SHEET_ENABLED_PAGE_TYPES_BASED_ON_URL.some(function(b){return c.location.href.includes(b)}):
!1};return{getResponse:function(c,f,l,h,p){return new d(function(d){a.ajax(c,{method:f,params:{deviceType:l,pageType:g.getPageType(),storeContext:h,actionSource:p,showProgramSpecificSheet:!0},headers:{"anti-csrftoken-a2z":a.$("#glowValidationToken").val()||""},success:function(b){d(b)},error:function(a){e.log("Unable to get response from "+c+" : "+a,"ERROR","F3GLOWAssets");g.logEvent(b.ADDRESS_SELECTION_AJAX_CALL_FAILED_METRICS+":"+l);d(null)}})})},getWeblabTreatment:function(a,c){if(a&&-1===a.indexOf(b.WEBLAB_MAP_KEY)&&
-1===a.indexOf(c))return null;var d=a.indexOf(b.WEBLAB_MAP_KEY)+b.WEBLAB_MAP_KEY.length,f=a.substring(d).indexOf(b.CLOSING_BRACES);try{return JSON.parse(a.substring(d+3,d+f+1))[c]}catch(p){return e.log("Failed to fetch the "+c+" weblab treatment : "+a,"ERROR","F3GLOWAssets"),null}},shouldRender:function(h){var k=b.PROGRAM_SPECIFIC_SHEET_ENABLED_PAGES[c.ue_mid];return new d(function(d){if(k&&k[h]&&f(k[h],g.getPageType()))if(c.isLocalStorageEnabled())if(b.CURRENT_TIME-c.localStorage.getItem(b.PROGRAM_SPECIFIC_SHEET_LOCAL_STORAGE_KEY)<
b.PROGRAM_SPECIFIC_SHEET_TTL)d(!1);else if(!a.capabilities.isAmazonApp&&a.$(b.GLOW_DESTINATION_TYPE_ID).length){var l=a.$(b.GLOW_DESTINATION_TYPE_ID).val()||"";d(b.GLOW_NOT_SET_LOCATION_TYPES.includes(l))}else a.get(b.GET_LOCATION_LABEL_ENDPOINT,{path:b.GET_LOCATION_LABEL_ENDPOINT,success:function(a){a.customerIntent?d(b.GLOW_NOT_SET_LOCATION_TYPES.includes(a.customerIntent.locationType)):(e.log("LocationType is not present","ERROR","F3GLOWAssets"),d(!1))},error:function(a){e.log("Unable to get response from get-location-label: "+
a,"ERROR","F3GLOWAssets");d(!1)}});else d(!1);else d(!1)})},storeSheetGenerationTime:function(){c.isLocalStorageEnabled()&&c.localStorage.setItem(b.PROGRAM_SPECIFIC_SHEET_LOCAL_STORAGE_KEY,b.CURRENT_TIME)}}});"use strict";e.when("A","f3-glow-window-utils").register("f3-glow-url-utils",function(a,d){return{getUrlParameter:function(a){a=(new RegExp("[?\x26]"+a+"\x3d([^\x26#]*)")).exec(d.location.href);return null===a?null:decodeURI(a[1])||0},getUrlWithoutParameters:function(){for(var a=arguments.length,
e=Array(a),c=0;c<a;c++)e[c]=arguments[c];return e.reduce(function(a,b){var d=a.split("?")[0];a=-1!==a.indexOf("?")?a.split("?")[1]:"";if(""!==a){var c=a.split("\x26");for(var e=c.length-1;0<=e;--e)a=c[e].split("\x3d")[0],a===b&&c.splice(e,1);d=d+"?"+c.join("\x26")}return d},d.location.href)}}});"use strict";e.when("A").register("f3-glow-window-utils",function(){var a=function(){try{var a=g.localStorage;a.setItem("__storage_test__","__storage_test__");a.removeItem("__storage_test__");return!0}catch(b){return e.log("Unable to access localStorage",
"WARN","F3GLOWAssets"),!1}};return{ue_pty:g.ue_pty,ue_mid:g.ue_mid,location:{href:g.location.href},lang:function(){if(g.top&&g.top.document&&g.top.document.documentElement)return g.top.document.documentElement.lang},ue:{count:g.ue.count},isLocalStorageEnabled:a,localStorage:a()?g.localStorage:null,refresh:function(){g.location.reload()}}})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,h=f._namespace||f.attributeErrors,a=h?h("FreshDetailPageDesktopAssets",""):f;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,f,h){d.when("A","afx-update-cart-count","fresh-dp-prevent-atc-default","ready").register("fresh-dp-add-to-cart",function(a,c,b){var e=!1;return{init:function(a){e||(d.when("fresh-atc-handler").execute(function(a){a.addToFreshCart({success:function(a){},error:function(a,e,g,c){d.log("Error adding to Cart on Fresh Detail Page",
"Error")}})}),e=!0);b.init()}}});d.when("A","afx-utils","ready").register("fresh-show-atc-changeover",function(a,c){var b=a.$,e=b("#afx-atc-changeover");return function(b){if(b&&0<e.length&&c.isFunction(e.find)){var g=a.state("fresh-atc-toast-text");g&&g.atcToastTextString&&(b=g.atcToastTextString.replace("FreshATCToastQuantity",b),(g=e.find(".a-changeover-inner"))&&c.isFunction(g.text)&&(g.text(b),c.isFunction(e.show)&&e.show()))}}});d.when("A","afx-utils","ready").register("fresh-show-atl-changeover",
function(a,c){a=a.$;var b=a("#afx-atl-changeover");return function(){0<b.length&&c.isFunction(b.show)&&b.show()}});"use strict";d.when("jQuery","ready").register("fresh-featurebullets",function(a){var c=function(){var a=!1;return{getIsExpanded:function(){return a},toggleExpanded:function(b){a=!a;b&&b(a)}}}(),b=function(b){var c=function(){var c=a("#fbSection");c.fadeTo(200,.75,null,function(){b.toggleExpanded(function(b){if(b){b=a("#fbSection");var d=a("#feature-bullets");d.find(".a-vertical").removeClass("collapsedFeatureBullets");
b.addClass("expandedFeatureBullets");a("#fbExpandableSection").addClass("expanded");b.find("h1").addClass("expandedFBHeader");a("#featureBulletsPlaceholder").addClass("FBplaceholder");d.find("#fbExpanderMoreButtonSection").hide();a("#feature-bullets")[0].offsetHeight<a("#feature-bullets")[0].scrollHeight&&(a(".fadeTextTopforFB").show(),a(".fadeTextBottomforFB").show());b.find(".closeFB").removeClass("aok-hidden")}else b=a("#fbSection"),d=a("#feature-bullets"),b.find(".closeFB").addClass("aok-hidden"),
a("#featureBulletsPlaceholder").removeClass("FBplaceholder"),d.find(".a-vertical").addClass("collapsedFeatureBullets"),a("#fbExpandableSection").removeClass("expanded"),b.removeClass("expandedFeatureBullets"),b.find("h1").removeClass("expandedFBHeader"),a(".fadeTextTopforFB").hide(),a(".fadeTextBottomforFB").hide(),d.find("#fbExpanderMoreButtonSection").show();c.fadeTo(200,1)})})};return{init:function(){a(".fadeTextTopforFB").hide();a(".fadeTextBottomforFB").hide();var d=a("#fbExpandableSection"),
f=a("#fbExpandableSectionContent");f.height()>d.height()&&(f.addClass("expandableSection"),f.click(c),a("#fbExpanderMoreButtonSection").removeClass("aok-hidden"),a("#feature-bullets").find(".moreFB").click(c),d=a("#fbSection"),d.find(".closeFB").click(c),d.hover(null,function(){b.getIsExpanded()&&c()}))}}};return{init:function(){(new b(c)).init()}}});d.when("A","a-modal","ready").execute(function(a,c){var b=a.$;a=a.state("glowEligibilityState");a!==h&&a.glowModalDisplayEligible&&"desktop"===a.deviceType&&
(c=c.get(b("#dpGlowModal")),c.attrs("ajaxHeaders",{"anti-csrftoken-a2z":b("#glowValidationToken").val()||""}),c.show())})});
/* ******** */
(function(c){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,b=h?h("DetailPageBuyBoxTabularLayoutDesktopAssets",""):e;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,e,h){c.when("A").execute("show-tabular-buybox-side-sheet",function(b){function f(a){g&&g.count&&g.count(a,(g.count(a)||0)+1)}function c(){d(".tabular-buybox").each(function(a,c){a=d(c);var k=!1;a.find(".tabular-buybox-text").each(function(a,b){a=d(b);if(a.css("line-clamp")!==
(3).toString()&&a.css("-webkit-line-clamp")!==(3).toString()){a=d(b).find(".tabular-buybox-text-message");var c=a.text();a.text("...");var e=b.offsetHeight;a.text(c);for(c=!1;b.offsetHeight>3*e;)c=!0,a.text(a.text().replace(/\W*\s(\S)*$/,"..."));k=c||b}else if(k=b.scrollHeight>b.clientHeight)return!1});a=a.find(".tabular-buybox-show-more");k?(b.show(a),f("DesktopTabularBuyBoxContentTruncated")):(b.hide(a),f("DesktopTabularBuyBoxContentExpanded"))})}var d=b.$,g=e.ue;d("#tabular-buybox-side-sheet-content a").attr("target",
"_blank");d("#tabular-buybox #sellerProfileTriggerId").click(function(){f("BuyBoxTabularLayoutDesktopLinkClicked")});b.declarative("close-tabular-buybox-side-sheet","click",function(a){function c(a){a.siblings("#tabular-buybox-side-sheet-content").show(function(){d(this).removeClass("tabular-buybox-side-sheet-content-display")})}(function(a){c(a);b.hide(a.find("#tabular-buybox-background"))})(d(a&&a.$currentTarget&&a.$currentTarget[0]));f("DesktopTabularSideSheetClosed")});b.declarative("show-tabular-buybox-side-sheet",
"click",function(a){function c(a){a.siblings("#tabular-buybox-side-sheet-content").show(function(){d(this).addClass("tabular-buybox-side-sheet-content-display")})}(function(a){var d=a.siblings('[data-action\x3d"close-tabular-buybox-side-sheet"]').find("#tabular-buybox-background");b.show(d);c(a)})(d(a&&a.$currentTarget&&a.$currentTarget[0]).closest("#tabular-buybox"));f("DesktopTabularSideSheetOpened")});c();b.on("a:accordion:buybox-accordion:select",c);b.on("a:tabs:offerDisplayGroup_tabs:select",
c);b.on("a:pageUpdate",c)})});
/* ******** */
(function(k){var g=window.AmazonUIPageJS||window.P,l=g._namespace||g.attributeErrors,b=l?l("CertifiedRefurbishedDetailPageAssets",""):g;b.guardFatal?b.guardFatal(k)(b,window):b.execute(function(){k(b,window)})})(function(k,g,l){k.when("A").register("renewed-side-sheet",function(b){for(var a=b.$,f={},e=1;4>=e;e++)f[e]={$content:a("#renewed-tabular-buybox-side-sheet-content-"+e),$background:a("#renewed-tabular-buybox-side-sheet-background-"+e)};b.declarative("show-renewed-side-sheet","click",function(a){var d=
f[a.data.tier].$content;b.show(d);b.animationFrameDelay(function(){d.addClass("renewed-side-sheet-content-display");b.show(f[a.data.tier].$background)})});b.declarative("close-renewed-side-sheet","click",function(a){var d=f[a.data.tier].$content;d.removeClass("renewed-side-sheet-content-display");b.hide(f[a.data.tier].$background);d.one("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",function(){b.hide(d)})})});k.when("A","jQuery").register("renewed-offer-consistency",function(b,a){function f(c){var a=
b.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");a.length&&0===a.index()&&(c+=1);return c}function e(c){b.$("div.renewedOfferConsistency").children().css("display","none");c=b.$(".renewedOfferConsistencyIndex_"+c);var d=a("#productSpecifications_dp_warranty_and_support");"undefined"===c||0===c.length?d.css("display",""):(c.css("display","block"),d.css("display","none"))}try{var h=a("#buybox .a-accordion-active");if("undefined"===typeof h||!h||"undefined"===typeof h[0]||!h[0]||"undefined"===
typeof h[0].id||!h[0].id)return;var d=b.$(h).index();d=f(d);e(d)}catch(c){g.ueLogError&&g.ueLogError(c,{logLevel:"ERROR",attribution:"renewed_offer_consistency",message:"[Error initializing renewed offer consistency ]"})}b.on("a:accordion:buybox-accordion:select",function(c){try{if("undefined"!==typeof c&&c&&"undefined"!==typeof c.selectedRow&&c.selectedRow&&"undefined"!==typeof c.selectedRow.$row&&c.selectedRow.$row){var a=b.$(c.selectedRow.$row).index();a=f(a);e(a)}}catch(m){g.ueLogError&&g.ueLogError(m,
{logLevel:"ERROR",attribution:"renewed_offer_consistency",message:"[Error responding to MOD change in renewed offer consistency ]"})}})});"use strict";k.when("A","atf").register("detailPageRefurbishedProductJourneyVideo-constants",function(b){return{UNDEFINED:"undefined",VIDEO_HIDDEN_LOCALE_FIELD:"#detailPageRefurbishedProductJourneyVideoLocale",VIDEO_HIDDEN_MARKETPLACE_ID_FIELD:"#detailPageRefurbishedProductJourneyVideoMarketPlaceId",VIDEO_HIDDEN_URL_FIELD:"#detailPageRefurbishedProductJourneyVideoUrl",
VIDEO_HIDDEN_THUMBNAIL_IMAGE_FIELD:"#detailPageRefurbishedProductJourneyVideoThumbnailImage",VIDEO_CONTAINER_ELEMENT_DP_ATF:"#detailPageRefurbishedProductJourneyVideo-video",VIDEO_CONTAINER_ELEMENT_DP_BTF:"#detailPageRefurbishedProductJourneyVideoBTF-video",VIDEO_CONTAINER_ELEMENT_DP_OUTER_SECONDARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-outer-secondary",VIDEO_CONTAINER_ELEMENT_DP_OUTER_PRIMARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-outer-primary",VIDEO_CONTAINER_ELEMENT_DP_INNER_SECONDARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-inner-secondary",
VIDEO_CONTAINER_ELEMENT_DP_INNER_PRIMARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-inner-primary",VIDEO_CLIENT_PREFIX:"renewed",VIDEO_REQUESTER_ID:"INRenewed",VIDEO_AJAX_REQUEST_PAGE:"Detail",VIDEO_AJAX_REQUEST_PLACEMENT:"detailPageRefurbishedProductJourneyVideo",VIDEO_AJAX_REQUEST_PARAMS_FORMAT:"json",VIDEO_AJAX_REQUEST_METHOD:"post",VIDEO_AJAX_REQUEST_CONTENT_TYPE:"application/json",VIDEO_AJAX_REQUEST_ENDPOINT:"/vap/ew/subcomponent/vseplayer",VSE_PREFIX:"vsePlayer-",VSE_FULL_SCREEN_CHANGE:"-fullscreenchange",
VSE_PLAYER_LOADED:"-playerLoaded",VIDEO_LOADED_SUCCESS_METRIC:"detailPageRefurbishedProductJourneyVideo.videoLoadedT1",VIDEO_LOADED_FAILURE_METRIC:"detailPageRefurbishedProductJourneyVideo.videoLoadFailedT1",REFURBISHED_BADGE_BOTTOM_SHEET_AFTER_SHOW:"a:sheet:afterShow:detailPageRefurbishedProductJourneyVideoBottomSheet",REFURBISHED_BADGE_POPOVER_AFTER_SHOW:"a:popover:afterShow:detailPageRefurbishedProductJourneyVideoBottomSheet",REFURBISHED_BADGE_BOTTOM_SHEET_AFTER_HIDE:"a:sheet:afterHide:detailPageRefurbishedProductJourneyVideoBottomSheet",
REFURBISHED_BADGE_POPOVER_AFTER_HIDE:"a:popover:afterHide:detailPageRefurbishedProductJourneyVideoBottomSheet"}});k.when("A","detailPageRefurbishedProductJourneyVideo-constants","postMetric").register("detailPageRefurbishedProductJourneyVideo-utils",function(b,a,f){function e(c){return typeof c!==a.UNDEFINED&&null!==c}function h(a,b){f.postCountMetric(a,b)}var d=b.$;return{pauseVideoPlayer:function(a){e(a)&&a.isPlaying()&&!a.isFullscreen()&&a.pause()},videoAjaxCall:function(c,f,g,k){!e(k)&&e(d(a.VIDEO_HIDDEN_LOCALE_FIELD).val())&&
e(d(a.VIDEO_HIDDEN_MARKETPLACE_ID_FIELD).val())&&e(d(a.VIDEO_HIDDEN_URL_FIELD).val())&&e(d(a.VIDEO_HIDDEN_THUMBNAIL_IMAGE_FIELD).val())&&(c={requester:c,clientPrefix:f,locale:String(d(a.VIDEO_HIDDEN_LOCALE_FIELD).val()),page:a.VIDEO_AJAX_REQUEST_PAGE,placement:a.VIDEO_AJAX_REQUEST_PLACEMENT,marketplaceID:String(d(a.VIDEO_HIDDEN_MARKETPLACE_ID_FIELD).val()),video:{videoURL:String(d(a.VIDEO_HIDDEN_URL_FIELD).val()),imageURL:String(d(a.VIDEO_HIDDEN_THUMBNAIL_IMAGE_FIELD).val())}},b.ajax(a.VIDEO_AJAX_REQUEST_ENDPOINT,
{params:c,paramsFormat:a.VIDEO_AJAX_REQUEST_PARAMS_FORMAT,method:a.VIDEO_AJAX_REQUEST_METHOD,contentType:a.VIDEO_AJAX_REQUEST_CONTENT_TYPE,success:function(b){d(g).html(b);h(a.VIDEO_LOADED_SUCCESS_METRIC,1)},error:function(b){b=d(g);e(b)&&b.hide();h(a.VIDEO_LOADED_FAILURE_METRIC,1)}}))},isDefined:e,isNotDefined:function(a){return!e(a)},logCountMetric:h}})});
/* ******** */
(function(m){var p=window.AmazonUIPageJS||window.P,u=p._namespace||p.attributeErrors,r=u?u("VasUpsellWidgetAsset",""):p;r.guardFatal?r.guardFatal(m)(r,window):r.execute(function(){m(r,window)})})(function(m,p,u){m.register("vas-widget-const",function(){return{COMMON:{DOM:{VAS_BUYBOX_SLOT:"vasBuyBox_feature_div",STS_BUYBOX_SLOT:"shipToStoreBuyBox_feature_div",ADDONS_WIDGET_SLOT:"addons_feature_div",VALUE_ADDS_SLOT:"valueAdds_feature_div",SERVICE_CAPABILITIES_SLOT:"serviceCapabilities_feature_div",
VALUE_PROP_T1_SLOT:"valuePropT1_feature_div",VALUE_PROP_PICKUP_SLOT:"valuePropPickUp_feature_div",VAS_PRODUCT_CONSULT_SLOT:"productConsult_feature_div",VALUE_PROP_BUY_BOX_SLOT:"valuePropBuybox_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"}}}});"use strict";m.when("A","vas-dp-instrumentation-builder").register("vas-metrics-publisher",function(c,d){var a=function(a,b,d){p.ueLogError&&p.ueLogError(a,{message:d,logLevel:"WARN",attribution:b})},g=function(a,b){a&&0<a.length?(b?(a=(new d.DetailPageInstrumentationBuilder(a)).setProductAsin(b.productAsin).setSelectedUpsellAsin(b.upsellAsin).setPageType(b.pageType).setSubPageType(b.subPageType).setMerchantId(b.merchantId).setSelectedUpsellPrice(b.upsellAsinPrice).setProductPrice(b.productAsinPrice).setHitType(b.hitType||
"popUp"),"undefined"!==typeof b.additionalRequestData&&(a=a.setPostalCode(b.additionalRequestData.zip).setPromo(b.additionalRequestData.promo).setIsCritical(b.additionalRequestData.crtcl).setDeviceType(b.additionalRequestData.dt).setIsBuyBoxAvailable(b.additionalRequestData.ibba).setIsMbcClick(b.additionalRequestData.mbc).setUpsellAsins(b.additionalRequestData.services).setProductAsin(b.productAsin||b.additionalRequestData.asin)),a=a.build()):a=(new d.DetailPageInstrumentationBuilder(a)).build(),
a.publishMetrics()):p.ueLogError&&p.ueLogError({message:"null or an empty string passed as metricId"},{logLevel:"ERROR",attribution:"Trying to log widget instrumentation metrics without a metricId"})},f=function(a,b,d){var c="";a&&b&&d&&(c=a+"_"+b+"_"+d);return c},h=function(a,b,d,c){var h="";a&&b&&d&&c&&(h=a+"_"+b+"_"+d+"_"+c);return h},b=function(a,b){"undefined"!==typeof p.ue&&"undefined"!==typeof p.ue.count&&("undefined"===typeof b?p.ue.count(a,1):p.ue.count(a,b))};return{metric:function(a){"undefined"!==
typeof p.ue&&"undefined"!==p.ue.count&&p.ue.count("vas_ppd_"+a,1)},increaseMetricBy:function(a,b){"undefined"!==typeof p.ue&&"undefined"!==p.ue.count&&p.ue.count("vas_ppd_"+a,b)},logWarning:a,logCustomWarning:function(b,d,c){a({message:b},d,c)},log:function(a){p.ueLogError&&p.ueLogError(a,{logLevel:"ERROR",attribution:"ppd-bundles"})},logFatal:function(a,b,d){p.ueLogError&&p.ueLogError({message:a},{message:d,logLevel:"FATAL",attribution:b})},logException:function(a,b,d){p.ueLogError&&p.ueLogError(a,
{message:d,logLevel:"ERROR",attribution:b})},logRefTag:function(a,b,c,h,g,f,z,t,I){a?(b=(new d.DetailPageInstrumentationBuilder(a)).setProductAsin(z).setSelectedUpsellAsin(h).setPageType(b).setSubPageType(c).setMerchantId(f).setSelectedUpsellPrice(t).setProductPrice(I).setHitType(g||"popUp"),b=b.build(),b.publishMetrics(),"undefined"!==typeof p.ue&&"undefined"!==p.ue.count&&p.ue.count(a,1)):p.ueLogError&&p.ueLogError({message:"null or an empty string passed as metricId"},{logLevel:"ERROR",attribution:"Trying to log widget instrumentation metrics without a metricId"})},
logUeMetricIncreaseCount:b,getCSMName:f,getRefMarker:h,increaseCSMCounterBy:function(a,b){a&&"undefined"!==typeof p.ue&&"undefined"!==typeof p.ue.count&&p.ue.count(a,(p.ue.count(a)||0)+b)},logCSMCounter:function(a){a&&"undefined"!==typeof p.ue&&"undefined"!==typeof p.ue.count&&p.ue.count(a,(p.ue.count(a)||0)+1)},createCSMNameAndLog:function(a,b,d){a=this.getCSMName(a,b,d);this.logCSMCounter(a);return a},logHit:g,createRefMarkerAndLog:function(a,b,d,c,h){a=this.getRefMarker(a,b,d,c);this.logHit(a,
h);return a},logReftagAndCSMMetricForWidgetAction:function(a,d,c,n,q){var v=f(n,d,a);b(v);a=h(n,c,d,a);g(a,q)},hitParameterKeys:{upsellAsin:"upsellAsin",productAsin:"productAsin",pageType:"pageType",subPageType:"subPageType",upsellAsinPrice:"upsellAsinPrice",productAsinPrice:"productAsinPrice",hitType:"hitType",additionalRequestData:"additionalRequestData",merchantId:"merchantId",zipCode:"zip",mappingSet:"mappingSet"},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"}}});"use strict";m.when("A","vas-widget-const","vas-value-prop-logger","vas-value-prop-constants",
"ready").register("vas-value-prop-controller",function(c,d,a,g){var f=c.$,h=d.COMMON.DOM.VALUE_PROP_BUY_BOX_SLOT,b=g.VALUE_PROP_T1_WIDGET_NAME,e=function(){var d,e;c.each(f("#"+h).find("[data-a-state]"),function(h,g){e=c.parseJSON(f(h).attr("data-a-state")).key;"vas-value-prop-widget-vm"===e&&(d=c.parseJSON(f(h).html()),a.logGlanceViewRefTagAndCSM(d,b))})};d=function(){e();c.off(g.POPOVER_SHOW_EVENT);c.on(g.POPOVER_SHOW_EVENT,function(d){a.logPopoverShowRefTagAndCSM(b)});f(document.body).undelegate(g.HYPERLINK_TEXT_ID,
g.CLICK_EVENT);f(document.body).delegate(g.HYPERLINK_TEXT_ID,g.CLICK_EVENT,function(){a.logHyperLinkClickRefTagAndCSM(b)})};d();return{initialize:d}});"use strict";m.when("A","vas-metrics-publisher").register("vas-value-prop-logger",function(c,d){var a=function(a){return{pageAsin:a.productAsin,services:g(a),zip:a.zipCode,additionalRequestData:{zip:a.zipCode,services:g(a)}}},g=function(a){var b=[];c.each(a.serviceOptions,function(a){b.push(a.serviceAsin)});return b},f=function(a,b){return["vas",b,
a].join("_")};return{logHyperLinkClickRefTagAndCSM:function(a){d.logHit(f(d.RefmarkerActionTypes.hyperLinkClick,a));d.logCSMCounter(f(d.RefmarkerActionTypes.hyperLinkClick,a))},logPopoverShowRefTagAndCSM:function(a){d.logHit(f(d.RefmarkerActionTypes.popoverShow,a));d.logCSMCounter(f(d.RefmarkerActionTypes.popoverShow,a))},logGlanceViewRefTagAndCSM:function(c,b){d.logHit(f(d.RefmarkerActionTypes.glanceView,b),a(c));d.logCSMCounter(f(d.RefmarkerActionTypes.glanceView,b))}}});"use strict";m.when("ready").register("vas-value-prop-constants",
function(){return{CLICK_EVENT:"click",VALUE_PROP_T1_WIDGET_NAME:"valuePropT1",HYPERLINK_TEXT_ID:"#vas-valueProp-hyperLink-text",POPOVER_SHOW_EVENT:"a:popover:afterShow:valuePropClickThrough"}});"use strict";var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"===typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};m.register("vas-utilities",function(c){return{generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
function(d){var a=16*Math.random()|0;return("x"===d?a:a&3|8).toString(16)})},getPriceValue:function(d){var a=/[+-]?\d+(\.\d+)?/g;if(null!==d.match(a))return d.match(a).map(function(a){return parseFloat(a)})[0]},validateZipCode:function(d,a){return(new RegExp(a.val())).test(d)?!0:!1},flattenObject:function a(c){var f={};if(null==c)return f;Object.keys(c).forEach(function(h){var b=c[h];if("object"===("undefined"===typeof b?"undefined":r(b))){var e="["+h+"]",k=a(b);Object.keys(k).forEach(function(a){f[e+
a]=k[a]})}else f["["+h+"]"]=c[h]});return f}}});"use strict";"use strict";m.when("A","vas-common-settings","vas-metrics-publisher","vas-mobile-config").register("vas-metric-utils",function(c,d,a,g){var f=g.mobileMetricConstants;return{createHitParameters:function(c){var b=d.getSetting("widgetCommonVM"),e=d.getSetting("winningWidgetVM"),f={},g={},e=e.baseAsinOfferData===u?e:e.baseAsinOfferData;g[c.additionalRequestDataKeys.zipCode]=b.zipCode;f[a.hitParameterKeys.productAsin]=b.productAsin;f[a.hitParameterKeys.upsellAsin]=
e.upsellAsin;f[a.hitParameterKeys.merchantId]=b.merchantId;f[a.hitParameterKeys.productAsinPrice]=b.buyboxPrice;f[a.hitParameterKeys.pageType]=c.hitRecordConstants.pageType;f[a.hitParameterKeys.upsellAsinPrice]=e.winningServiceMinPrice;f[a.hitParameterKeys.subPageType]=c.hitRecordConstants.subPageType;f[a.hitParameterKeys.additionalRequestData]=g;return f},createHitParametersForVSX:function(d,b){var e={},f={},g=c.state("vas-base-vm");"undefined"!==typeof g&&"undefined"!==typeof d&&(f[b.additionalRequestDataKeys.zipCode]=
g.zipCode,f[b.additionalRequestDataKeys.deviceType]="mobile",e[a.hitParameterKeys.productAsin]=g.productAsin,e[a.hitParameterKeys.upsellAsin]=d.asin,e[a.hitParameterKeys.additionalRequestData]=f);return e},createGlobalHitParameters:function(c){var b={},e=d.getSetting("widgetCommonVM");if(e){if(null===c||c===u)c={};c[a.hitParameterKeys.zipCode]=e.zipCode;b[a.hitParameterKeys.additionalRequestData]=c;b[a.hitParameterKeys.productAsin]=e.productAsin;b[a.hitParameterKeys.merchantId]=e.merchantId;if(c=
d.getSetting("winningWidgetVM"))b[a.hitParameterKeys.upsellAsin]=(c.baseAsinOfferData===u?c:c.baseAsinOfferData).upsellAsin}return b},getMobileMetricConstants:function(){d.getSetting("widgetCommonVM").isApp?(f.metricPrefixes.widget="mobiletwister"===d.getSetting("winningWidgetVM").winningWidgetName?"aft":"aftxl",f.refmarkerPrefixes.widget="mobiletwister"===d.getSetting("winningWidgetVM").winningWidgetName?"aft":"aftxl"):(f.metricPrefixes.widget="mobiletwister"===d.getSetting("winningWidgetVM").winningWidgetName?
"mft":"mftxl",f.refmarkerPrefixes.widget="mobiletwister"===d.getSetting("winningWidgetVM").winningWidgetName?"mft":"mftxl");return f},createHitParametersForServiceOptions:function(d,b,e){var f={},g={};if(d!==u&&b!==u&&e!==u)return f[a.hitParameterKeys.productAsin]=b.baseAsin,f[a.hitParameterKeys.merchantId]=b.encryptedMerchantId,f[a.hitParameterKeys.productAsinPrice]=b.displayPrice,g[e.additionalRequestDataKeys.services]=Object.keys(d),f[a.hitParameterKeys.additionalRequestData]=g,c.each(d,function(b,
d){b.selectionBehaviour===u||"MANDATORY"!==b.selectionBehaviour&&"RECOMMENDED"!==b.selectionBehaviour||(f[a.hitParameterKeys.upsellAsin]=d)}),f}}});"use strict";"use strict";m.when("A","ready").register("vas-url-util",function(c){function d(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 g(a,b){return a.replace(l.VAS_REGEX,"$1vas\x3d"+encodeURIComponent(b))}function f(a){a=a.replace(l.VAS_REGEX,"");return 0<a.length&&"\x26"===a.charAt(0)?
"?"+a.substring(1,a.length):a}function h(a,b,d){delete b[d];b=k(b);return g(a,b)}function b(a,b){return 0!==Object.keys(a).length&&b in a?!0:!1}function e(a){return JSON.parse(a.replace(/'/g,'"'))}function k(a){return JSON.stringify(a).replace(/"/g,"'")}var l={VAS_REGEX:/(\?|\&)vas=(.*?)(?=(&|$))/,Q_STRING_REGEX:/\?.*$/};return{getDecodedQueryParamString:function(){return decodeURIComponent(p.location.search)},getPathName:function(){return p.location.pathname},doesAnyQueryStringExist:d,doesVasQueryParamExist:function(a){return l.VAS_REGEX.test(a)},
getVasQueryParamValue:a,addOrUpdateKeyInVasQryParam:function(b,d,c){b=a(b);b=e(b);b[d]=c;return k(b)},replaceExistingVasParam:g,appendVasQueryParam:function(a,b){var e;e=d(a)?"\x26":"?";return a+e+"vas\x3d"+encodeURIComponent(b)},removeOrUpdateVasQryParamWithMarker:function(a,d,e){if(!b(d,e))throw Error("vas: specified key "+e+" does not exist");return 1===Object.keys(d).length?f(a):h(a,d,e)},removeVasQueryParam:f,removeMarkerFromVasQueryParam:h,doesKeyExist:b,parseSingleQuotedStringAsJson:e,stringifyJsonWithSingleQuotes:k}});
"use strict";m.when("A","vas-common-settings","ready").register("vas-detailpage-util",function(c,d){return{isMobbPresent:function(){var a=d.getSetting("widgetBaseVM").buyingOptionTypes;return"undefined"!==typeof a&&1<a.length?!0:!1}}});"use strict";m.register("vas-addItems-ajax-call-constants",function(){return{headers:{ADD_ITEMS_API_HEADER_CONTENT_TYPE:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"',ADD_ITEMS_API_HEADER_ACCEPT:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"'},
SLATE_TOKEN_SELECTOR:'meta[name\x3d"encrypted-slate-token"]',API_PATH:"/cart/carts/retail/items",REFTAG:"vas_add_upsell",AJAX_METHOD:"POST",METRICS:{SUCCESS:"vas_addupsell_cart_success:desktop",ERROR:"vas_addupsell_cart_fail:desktop",INCOMPLETE_ADD:"vas_addupsell_cart_incomplete_add:desktop"},FATAL_ATTRIBUTION:"vas-addUpsell-handler:desktop",SUCCESS_EVENT:"vas:ldbb-upsell-added:desktop"}});"use strict";m.when("A","vas-metrics-publisher","vas-utilities","vas-common-settings","vas-service-quantity-helper",
"vas_manage_forms").register("vas-core-buybox",function(c,d,a,g,f,h){function b(){var b=g.getSetting("widgetCommonVM"),d={};d.itemAssocId=a.generateUUID();d.addItemAssociation=b.isShipToStore||b.shouldAddItemAssociation||b.showUnifiedGuruExperience;return d}function e(a){try{"undefined"!==typeof a.offerlistingId&&z()&&v("add",a.offerlistingId),d.increaseMetricBy("mbcFormAppend_fail",0),d.metric("mbcFormAppend_success")}catch(b){d.increaseMetricBy("mbcFormAppend_success",0),d.metric("mbcFormAppend_fail"),
d.log(b)}}function k(){try{z()&&v("remove"),d.increaseMetricBy("mbcFormRemove_fail",0),d.metric("mbcFormRemove_success")}catch(a){d.increaseMetricBy("mbcFormRemove_success",0),d.metric("mbcFormRemove_fail"),d.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 e=f.getServiceQuantity(g.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled);b.append('\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+
d+'" name\x3d"quantity.'+d+'" value\x3d"'+e+'" /\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=c.$,q={PRODUCT_QUANTITY_ID:"#quantity",ADD_TO_CART_FORM_ID:"#addToCart",BUY_BACK_FORM_ID:"#buyBackBuyNow",MOBB_FORM_ID:"#second_new_accordion_form",MOBB_FORM_NAME:"second_new_accordion_form"},
v=function(a,b){n("#mbc .a-button").each(function(){var d=n(this);d.text();var d=d.find("a")[0],e,c,f;if(d&&d.href){var g=d.href;(f=g.match(/itemCount=([0-9]+)/i))&&f[1]&&((c=parseInt(f[1],10))&&"add"===a?e=c+1:c&&"remove"===a&&(e=c-1));e&&(g=g.replace(/itemCount=([0-9]+)/i,"itemCount\x3d"+e),"add"===a&&b?g+="\x26offeringID."+e+"\x3d"+b:"remove"===a&&(g=g.replace(new RegExp("\x26offeringID."+c+"\x3d[^\x26]*"),"")),d.href=g)}})},z=function(){var a=g.getSetting("widgetCommonVM");return(a.populateMBCATC||
a.showFakeTwisterBundles||a.showEnhancedUpsellBundle)&&!a.showUnifiedGuruExperience},t=function(a){h.removeFieldsFromBuyBoxForm("addToCart");k();h.addFieldsInBuyBoxForm("addToCart",a.data.asinOfferData,b(),!1);e(a.data.asinOfferData);l(a.data.asinOfferData)},I={addServiceAsinBuybox:function(a){h.addFieldsInBuyBoxForm("addToCart",a,b(),!1);e(a);h.addFieldsInBuyBoxForm(q.MOBB_FORM_NAME,a,b(),!1);g.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled&&(n(document.body).undelegate(q.PRODUCT_QUANTITY_ID,
"change",t),n(document.body).delegate(q.PRODUCT_QUANTITY_ID,"change",{asinOfferData:a},t))},removeServiceAsinBuybox:function(){h.removeFieldsFromBuyBoxForm("addToCart");h.removeFieldsFromBuyBoxForm(q.MOBB_FORM_NAME);k();n(document.body).undelegate(q.PRODUCT_QUANTITY_ID,"change",t)},addServiceAsinToBuyBack:function(a){l(a)}};return{registerBuyboxEventHandlers:function(){c.off("vas:add-service-asin-buybox-event");c.on("vas:add-service-asin-buybox-event",function(a){I.addServiceAsinBuybox(a)});c.off("vas:remove-service-asin-buybox-event");
c.on("vas:remove-service-asin-buybox-event",function(){I.removeServiceAsinBuybox()});c.off("vas:add-service-asin-buyback-form-event");c.on("vas:add-service-asin-buyback-form-event",function(a){h.addFieldsInBuyBoxForm("buyBackBuyNow",a,b(),!1)})}}});"use strict";m.when("A","vas-metrics-publisher","vas-common-settings","vas-service-quantity-helper","vas-add-item-data","vas-natc","vas-item-association","vas-item-assocation-group-migration-uds","ready").register("vas_manage_forms",function(c,d,a,g,f,
h,b,e){function k(a,b){var d=q("*[id\x3d"+a+"]");if("retailheavybulky"===b.mappingSet||"heavybulky"===b.mappingSet)d=d.not("#usedAccordionRow *[id\x3d"+a+"]");return d}function l(a,b,d){var e=document.createElement("input");e.type="hidden";e.id=a;e.name=a;e.value=b;e.className=d;return e}function n(a,b){var d=h.getNatcParameters(b);Object.keys(d).forEach(function(b){a.append(l(b,d[b],"atcFormServiceAsinData"))});b.additionalParameters!==u&&b.additionalParameters.itemAssociation!==u&&"HeavyBulky"===
b.additionalParameters.itemAssociation.programType&&(b=b.additionalParameters.itemAssociation,a.append(l("items[0.base][additionalParameters][itemAssociation][programType]",b.programType,"atcFormServiceAsinData")),a.append(l("items[0.base][additionalParameters][itemAssociation][associatedItemId]","","atcFormServiceAsinData")),a.append(l("items[0.base][additionalParameters][itemAssociation][renderType]",b.renderType,"atcFormServiceAsinData")),a.append(l("items[0.base][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive]",
!1,"atcFormServiceAsinData")))}var q=c.$,v={retailheavybulky:"RetailHeavyBulky",heavybulky:"HeavyBulky"},z="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(c,h,C,m){try{var p=a.getSetting("widgetCommonVM");k(c,p).each(function(){var d=q(this),c;c=m?d.find("input[name^\x3d'offeringID']").length:d.find("input[name^\x3d'offeringID']").length+1;var k=C.itemAssocId,t=c+1,x=C.addItemAssociation,w=g.getServiceQuantity(p.multiQuantityPurchaseEnabled),r=d.find('input[name\x3d"itemCount"]');0<z.indexOf(p.productWDG)&&(c=0===r.length?1:r[0].value);if("undefined"!==typeof h.offerlistingId){d.append('\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+
c+'" name\x3d"quantity.'+c+'" value\x3d"'+w+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+c+'" name\x3d"asin.'+c+'" value\x3d"'+h.serviceAsin+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+c+'" name\x3d"offeringID.'+c+'" value\x3d"'+h.offerlistingId+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"merchantID.'+c+'" name\x3d"merchantID.'+c+'" value\x3d"'+h.merchantId+'" /\x3e');var y="retailheavybulky"===
p.mappingSet||"heavybulky"===p.mappingSet;if(e.isEnabled){if(x=y?b.getItemAssociationData(h.asin):b.getItemAssociationData(h.upsellAsin))x=b.getIAGroupData(x),d.append(l("custom-name."+t+".1","itemAssociationGroup","atcFormServiceAsinData")),d.append(l("custom-value."+t+".1",JSON.stringify(x),"atcFormServiceAsinData"))}else if(!y){if(x=b.getItemAssociationData(h.upsellAsin))x=b.getIAGroupData(x),d.append(l("custom-name."+t+".1","itemAssociationGroup","atcFormServiceAsinData")),d.append(l("custom-value."+
t+".1",JSON.stringify(x),"atcFormServiceAsinData"))}else if(x){var x=d.find("input[name^\x3d'custom-name."+t+"']").length+1,y=d.find("input[name^\x3d'custom-name.1']").length+1,k='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+t+"."+x+'" name\x3d"custom-name.'+t+"."+x+'" value\x3d"itemAssoc" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+t+"."+x+'" name\x3d"custom-value.'+t+"."+x+'" value\x3d"'+k+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.'+
y+'" name\x3d"custom-name.1.'+y+'" value\x3d"itemAssoc" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.'+y+'" name\x3d"custom-value.1.'+y+'" value\x3d"'+k+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.'+(y+1)+'" name\x3d"custom-name.1.'+(y+1)+'" value\x3d"UNIQ-itemAssoc" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.'+(y+1)+'" name\x3d"custom-value.1.'+(y+1)+'" value\x3d"'+
k+'" /\x3e',B;a:{B=h.asin;var F=a.getSetting("winningWidgetVM");if(F&&F.vasTwisterOptions&&F.vasTwisterOptions[B]&&(B=F.vasTwisterOptions[B].mappingSet)&&v.hasOwnProperty(B)){B=v[B];break a}B=void 0}B&&(k+='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.'+(y+2)+'" name\x3d"custom-name.1.'+(y+2)+'" value\x3d"itemAssocType" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.'+(y+3)+'" name\x3d"custom-value.1.'+(y+2)+'" value\x3d"'+
B+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+t+"."+(x+1)+'" name\x3d"custom-name.'+t+"."+(x+1)+'" value\x3d"itemAssocType" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+t+"."+(x+1)+'" name\x3d"custom-value.'+t+"."+(x+1)+'" value\x3d"'+B+'" /\x3e');d.append(k)}0===r.length?d.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+c+'"\x3e'):r[0].value=Math.max(c,r[0].value);m||(t=h.offerlistingId,c=
h.upsellAsin,c===u&&(c=h.asin),w=(new f.AddItemData).construct(c,t,w),c=b.getItemAssociationData(c),c!==u&&(w=w.setItemAssociation(c)),n(d,w))}});d.increaseMetricBy("vas_"+c+"_FormAppend_fail",0);d.metric("vas_"+c+"_FormAppend_success")}catch(W){d.increaseMetricBy("vas_"+c+"_FormAppend_success",0),d.metric("vas_"+c+"_FormAppend_fail"),d.log(W)}},removeFieldsFromBuyBoxForm:function(b){try{q(".atcFormServiceAsinData").remove();var c=q("#"+b).find('input[name\x3d"itemCount"]');-1===z.indexOf(a.getSetting("widgetCommonVM").productWDG)&&
0!==c.length&&1<=c[0].value&&--c[0].value;d.increaseMetricBy("vas_"+b+"FormRemove_fail",0);d.metric("vas_"+b+"FormRemove_success")}catch(e){d.increaseMetricBy("vas_"+b+"FormRemove_success",0),d.metric("vas_"+b+"FormRemove_fail"),d.log(e)}},addItemDataInForm:n}});"use strict";m.when("A","vas-metrics-publisher","vas-url-util","ready").register("vas-persist-widget",function(c,d,a){return{initialize:function(){p.history&&p.history.replaceState?(c.on("vas:add-widget-state-url",function(c){try{var f;var h=
a.getDecodedQueryParamString(),b=c.preSelectedWidgetValue;if(a.doesVasQueryParamExist(h)){var e=a.addOrUpdateKeyInVasQryParam(h,"vw",b);f=a.replaceExistingVasParam(h,e)}else{c={};c.vw=b;var k=a.stringifyJsonWithSingleQuotes(c);f=a.appendVasQueryParam(h,k)}var l=a.getPathName()+f;p.history.replaceState({},document.title,l)}catch(n){d.metric("addWidgetStateInUrl_fail"),d.log(n)}}),c.on("vas:remove-widget-state-url",function(){var c=a.getDecodedQueryParamString();if(a.doesVasQueryParamExist(c))try{var f=
a.getVasQueryParamValue(c),h=a.parseSingleQuotedStringAsJson(f);if(a.doesKeyExist(h,"vw")){var b=a.removeOrUpdateVasQryParamWithMarker(c,h,"vw"),e=a.getPathName()+b;p.history.replaceState({},document.title,e)}}catch(k){d.metric("removeWidgetStateFromUrl_fail"),d.log(k)}})):d.metric("vas_unsupportedBrowser")}}});"use strict";m.when("A","vas-metrics-publisher","vas-common-settings","vas-atc-tracker","vas-atc-helper","vas-service-interstitial").register("vas-core-interstitial",function(c,d,a,g,f,h){var b=
c.$,e,k,l=!1,n,q,v=function(){var a=b("#ppdb-add-service-checkbox");if(!l){g.setHijacked();b(document.body).undelegate("#mbc .a-button","click.lsatc");g.logMetric("vas_si_atcClick");l=!0;e.isMBCClick=!1;e.atcButton=b(this);var h=e.atcButton.attr("id");if(h&&"add-to-cart-button"!==h)if("mobb.addToCart"!==h){if(e.isMBCClick=!0,(h=e.atcButton.text())&&!h.match(/cart/i))return document.body.style.cursor="default",f.safeATCClick(),!1}else e.isMOBBlick=!0;if(0<a.length&&a.is(":checked"))return a=!0===e.isUpsellCritical?
"1":"0",h="vas_bdlppd_",e.isMBCClick&&(h+="mbc_"),e.isMOBBClick&&(h+="mobb_"),d.logRefTag(h+"checked_atc_"+a+"_"+e.productAsin+"_"+e.serviceAsin),g.logMetric("vas_bdlppd_atc_click"),document.body.style.cursor="default",f.safeATCClick(),l?!0:!1;b(document.body).undelegate("#add-to-cart-button","click.lsatc");b(document.body).undelegate("#mobb\\.addToCart","click.lsatc");if(e.productAsin&&e.serviceAsin&&1===e.atcButton.length&&1===n.length){e.atcButton.bind("click.lsatc",f.lsATCHandlerSuppressATC);
if(a=b.parseJSON(b("#valueAddsInterstitial").attr("data-a-modal"))){if(a={name:a.name,header:a.header},b("#valueAddsInterstitial").attr("data-a-modal",JSON.stringify(a)).click(),c.$(".a-popover-inner").addClass("pdp-service-modal-instance"),e.showSTSServiceInterstitial&&(a=e.selectedOfferFulfillmentType,(h=b("#"+(e.showSTSServiceInterstitial?"sts-":"")+"pdp-service-siatc-modal-content"))&&h.length)){var k=h.find("."+a);k.length&&(h.find("."+e.selectedOfferFulfillmentType).addClass("vas-hidecomponent"),
k.removeClass("vas-hidecomponent"),e.selectedOfferFulfillmentType=a)}}else f.safeATCClick();return!1}document.body.style.cursor="default";f.safeATCClick();return!1}},z=function(){n=b("#addToCart");n.submit(function(){g.unsetHijacked();return!0});q=b("#second_new_accordion_form");q.submit(function(){g.unsetHijacked();return!0});e.hijackMBCATC&&(b(document).undelegate("#mbc .a-button","click.lsatc"),b(document.body).delegate("#mbc .a-button","click.lsatc",v),d.logRefTag("vas_mbc_ld_"+e.productAsin+
"_"+e.serviceAsin));b(document).undelegate("#add-to-cart-button","click.lsatc");b(document.body).delegate("#add-to-cart-button","click.lsatc",v);b(document).undelegate("#mobb\\.addToCart","click.lsatc");b(document.body).delegate("#mobb\\.addToCart","click.lsatc",v)};return{registerSIEventHandlers:function(){b(document.body).undelegate("#add-to-cart-button","click.lsatc");var c=0!==b("#abb-interstitial").length;c&&d.metric("devicesInterstitialPresentCount");if(c=!c)c="undefined"!==typeof a.getSetting("winningWidgetVM")?
a.getSetting("widgetCommonVM").hijackATC:!1;c&&(e=a.getSetting("widgetCommonVM"),e.isShipToStoreAsinSelected="in_store"===e.selectedOfferFulfillmentType,e.atcEventInProgress=!1,e.isMBCClick=!1,e.isMOBBClick=!1,k=e.isWarrantyPresent,f.setWidgetMetaData(e),g.setWidgetMetaData(e),h.setWidgetMetaData(e),e.doRedirect&&null===document.getElementById("servicesInterstitial")&&null===document.getElementById("attach-warranty-pane")&&!k&&(z(),h.registerSIEventHandlers()))}}});"use strict";m.when("vas-common-settings").register("vas-item-association",
function(c){return{getIAGroupData:function(d){return{type:d.programType,renderType:d.renderType,parentAsin:d.associatedItemId,constraintList:[{type:"DELETE",mutuallyInclusive:d.deleteConstraint.mutuallyInclusive}]}},getItemAssociationData:function(d){var a=c.getSetting("winningWidgetVM"),g=a.itemAssociationV2;g===u&&a.vasTwisterOptions&&a.vasTwisterOptions[d]&&(g=a.vasTwisterOptions[d].itemAssociationV2);return g}}});"use strict";m.when("vas-utilities").register("vas-natc",function(c){return{getNatcParameters:function(d){var a=
{asin:d.asin,offerListingId:d.offerListingId,quantity:d.quantity};d.additionalParameters!==u&&(a.additionalParameters=d.additionalParameters);var g={},f=c.flattenObject(a);Object.keys(f).forEach(function(a){g["items[0.vasItem]"+a]=f[a]});return g}}});"use strict";m.when("A","vas-add-item-data","vas-item-association","vas-metrics-publisher","vas-common-settings","vas-addItems-ajax-call-constants","ready").register("vas-addUpsell-to-cart",function(c,d,a,g,f,h){function b(){var a={"Content-Type":h.headers.ADD_ITEMS_API_HEADER_CONTENT_TYPE,
"Accept-Language":"en-US",Accept:h.headers.ADD_ITEMS_API_HEADER_ACCEPT,"x-api-csrf-token":n.csrfToken};"undefined"!==typeof document.querySelector(h.SLATE_TOKEN_SELECTOR)&&(a["x-amzn-encrypted-slate-token"]=document.querySelector(h.SLATE_TOKEN_SELECTOR).content);return a}function e(b,c,e){b=(new d.AddItemData).construct(b,c,e).setItemAssociation(a.getItemAssociationData(b));return JSON.stringify({items:[b]})}function k(){g.logUeMetricIncreaseCount(h.METRICS.SUCCESS,1);c.trigger(h.SUCCESS_EVENT)}function l(a){422===
a.status?g.logUeMetricIncreaseCount(h.METRICS.INCOMPLETE_ADD,1):(g.logUeMetricIncreaseCount(h.METRICS.ERROR,1),g.logFatal(a.responseText,h.FATAL_ATTRIBUTION,"[context:: productAsin\x3d"+q.productAsin+", zip\x3d"+q.zipCode+"] "))}var n,q;return{addUpsell:function(a,d,g){n=f.getSetting("addItemsAjaxCallVM");q=f.getSetting("widgetBaseVM");c.$.ajax({url:n.ajaxEndpoint+h.API_PATH+"?ref\x3d"+h.REFTAG,type:h.AJAX_METHOD,headers:b(),xhrFields:{withCredentials:!0},data:e(a,d,g),success:k,error:l})}}});"use strict";
m.register("vas-mobile-config",function(){return{mobileMetricConstants:{refmarkerPrefixes:{tenant:"vas"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",isCritical:"crtcl"},metricPrefixes:{tenant:"vas"}}}});"use strict";m.register("vas-common-settings",function(c){var d={};return{getSetting:function(a){return a?d[a]:d},setSetting:function(a,c,f){a&&f?d[a][f]=c:a&&(d[a]=c)},clearSettings:function(){d={}}}});"use strict";m.when("A","vas-metrics-publisher",
"vas-common-settings","vas-widget-const","ready").register("vas-common-metrics",function(c,d,a,g){c.off(g.COMMON.EVENT_NAME.NO_BUYBOX);c.on(g.COMMON.EVENT_NAME.NO_BUYBOX,function(){var c=g.COMMON.REFTAG_PREFIX.NO_BUYBOX,h=a.getSetting("widgetCommonVM").productAsin,b=a.getSetting("widgetCommonVM").zipCode;d.logRefTag(c+h+"_"+b,"LocalServicesWidget")});c.off(g.COMMON.EVENT_NAME.NO_PRODUCT);c.on(g.COMMON.EVENT_NAME.NO_PRODUCT,function(){var c=a.getSetting("widgetCommonVM").shouldSuppressWidget,h=a.getSetting("widgetCommonVM").isProductAvailable,
b;c?b=g.COMMON.REFTAG_PREFIX.WIDGET_SUPRESSED:h||(b=g.COMMON.REFTAG_PREFIX.WIDGET_NO_PRODUCT);d.logRefTag(b,"LocalServicesWidget")})});"use strict";m.when("A","vas-common-settings","vas-core-buybox","vas-core-interstitial","vas-widget-const","attach-to-ldbb","vas-persist-widget","vas-metrics-publisher","ready").register("vas-widgets",function(c,d,a,g,f,h,b,e){var k=c.$,l=function(){d.clearSettings();var a,b,h=!1;c.each(k("#"+f.COMMON.DOM.VALUE_ADDS_SLOT).find("[data-a-state]"),function(f,g){b=c.parseJSON(k(f).attr("data-a-state")).key;
"vas-common-vm"===b?(a=c.parseJSON(k(f).html()),d.setSetting("widgetCommonVM",a)):"vas-winning-widget-vm"===b?(a=c.parseJSON(k(f).html()),d.setSetting("winningWidgetVM",a),h=!0,e.logCSMCounter("vas_winningWidgetVM_"+a.winningWidgetName)):"vas-prepurchase-widget-vm"===b?(a=c.parseJSON(k(f).html()),d.setSetting("prepurchaseWidgetVM",a),h=!0):"vas-base-vm"===b&&(a=c.parseJSON(k(f).html()),d.setSetting("widgetBaseVM",a))});d.setSetting("addItemsAjaxCallVM",c.state("vas-aapi-ajax-call-data-vm"));return h},
n=function(){if(l()){a.registerBuyboxEventHandlers();g.registerSIEventHandlers();if("undefined"!==typeof d.getSetting("winningWidgetVM")){var k=d.getSetting("winningWidgetVM").winningWidgetName;c.trigger("vas:widgetname:"+k)}else c.trigger(f.COMMON.EVENT_NAME.NO_BUYBOX);c.trigger(f.COMMON.EVENT_NAME.NO_PRODUCT);"undefined"!==typeof d.getSetting("prepurchaseWidgetVM")&&(k=d.getSetting("prepurchaseWidgetVM").prepurchaseWidgetName,c.trigger("vas:widgetname:"+k));h.attachToLdbb();b.initialize();e.logCSMCounter("vas_widget_initialized")}};
c.on("a:pageUpdate",function(){n()});return{initialize:n}});"use strict";"use strict";m.when("A","vas-metrics-publisher","vas-widget-const","atf","ready").register("vas-base-data-publisher",function(c,d,a,g){var f=c.$;g=function(){var h,b;c.each(f("#"+a.COMMON.DOM.VALUE_ADDS_SLOT).find("[data-a-state]"),function(a,d){b=c.parseJSON(f(a).attr("data-a-state")).key;"vas-base-vm"===b&&(h=c.parseJSON(f(a).html()))});if(h){var e=!1,g={};if(0<f("#add-to-cart-button").length||0<f("#mbc .a-button").length)e=
!0;g[d.hitParameterKeys.productAsin]=h.productAsin;g[d.hitParameterKeys.additionalRequestData]={asin:h.productAsin,dt:"d",zip:h.zipCode,ibba:e};d.logHit("hbs_product_data",g)}};g();return{publish:g}});"use strict";m.when("A","vas-common-settings","vas-service-quantity-helper","vas-ldbb-constants").register("attach-to-ldbb",function(c,d,a,g){var f=c.$,h=function(){f(document.body).undelegate(g.ATC_BUTTON,g.EVENT_TYPE);var b=a.getServiceQuantity(d.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled,
"ldbb");c.on(g.SUCCESS_EVENT,function(){c.trigger(g.VAS_DEALS_A2C_EVENT,b)})};return{attachToLdbb:function(){d.getSetting("widgetCommonVM").attachToLdbb&&(f(document.body).undelegate(g.ATC_BUTTON,g.EVENT_TYPE),f(document.body).delegate(g.ATC_BUTTON,g.EVENT_TYPE,h))}}});"use strict";m.register("vas-ldbb-constants",function(){return{ATC_BUTTON:"#dealsx_atc_btn",SUCCESS_EVENT:"deals_claimDealSuccess",EVENT_TYPE:"click.attachServicesHandler",VAS_DEALS_A2C_EVENT:"vas:ldbb-a2c-event:desktop"}});"use strict";
m.when("A","service-options-ready").register("service-options-item-association-utils",function(){return{checkIAData:function(c){return c.itemAssociationV2&&c.itemAssociationV2.programType&&c.itemAssociationV2.renderType&&c.itemAssociationV2.associatedItemId?!0:!1},getIAData:function(c){return{parentAsin:c.itemAssociationV2.associatedItemId,type:c.itemAssociationV2.programType,renderType:c.itemAssociationV2.renderType,constraintList:[{type:"DELETE",mutuallyInclusive:c.itemAssociationV2.deleteConstraint.mutuallyInclusive}]}}}});
"use strict";r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"===typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};m.when("A","cc-manager","service-options-device-specific-constants","service-options-common-constants","service-options-cc-handler","service-options-card-toggler","service-options-ready").register("service-options-registration",function(c,d,a,g,f,h){var b={init:function(){},validateInputParams:function(a){return a&&
("undefined"===typeof a?"undefined":r(a))!==g.UNDEFINED&&a.itemType===g.ASIN&&r(a.asin)===g.STRING&&a.enableIA&&r(a.IAData)!==g.UNDEFINED&&r(a.offerListingId)===g.STRING?!0:!1},switchBuyingOption:function(b){d.ccSelectionsClear(a.FEATURE_NAME);var f=[a.FEATURE_NAME,g.SWITCH_BUYING_OPTION_EVENT].join("_");c.trigger(f,b)},cardCollapse:function(){var b=[a.FEATURE_NAME,g.COLLAPSE_CARD_EVENT].join("_");c.trigger(b)}};return{selectionUpdate:function(a,b){return d.ccSelectionUpdate(a,b)},registerFeature:function(a){d.registerFeature({featureName:a,
featureAttribution:g.FEATURE_ATTRIBUTION,isMultiSelection:1},b)},cardExpanderListener:function(a){d.cardExpanded(a)},ccSelectionsClear:function(a){d.ccSelectionsClear(a)},getRenderedFeaturesList:function(){return d.getRenderedFeaturesList().length}}});"use strict";var A=function(){return function(c,d){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c)){var a=[],g=!0,f=!1,h=u;try{for(var b=c[Symbol.iterator](),e;!(g=(e=b.next()).done)&&(a.push(e.value),!d||a.length!==d);g=!0);}catch(k){f=
!0,h=k}finally{try{if(!g&&b["return"])b["return"]()}finally{if(f)throw h;}}return a}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}();m.when("A","cc-manager","service-options-setting","service-options-common-constants","service-options-device-specific-constants","service-options-item-association-utils","service-options-metric-utils","vas-mandatory-uds-price-override-weblab","price-details-bottomsheet","service-options-ready").register("service-options-item-utils",function(c,
d,a,g,f,h,b,e,k){function l(a,b){return a!==g.NULL&&a!==g.UNDEFINED&&b!==g.NULL&&b!==g.UNDEFINED?!0:!1}var n=function(a,b){a={itemType:g.ASIN,asin:b.asin,offerListingId:b.offerListingId,quantity:1,price:Number(b.offerPrice),selectionType:a,enableIA:h.checkIAData(b)};a.enableIA&&(a.IAData=h.getIAData(b));k.isEnabled&&(a.renderInBottomSheet=!0,a.priceBottomSheetDisplayString=b.priceBreakdownLabel,a.savings=Number(b.savings));return a};return{updateCartItems:function(c,e){c=c.split(g.DELIMITER);var h=
A(c,2);c=h[0];h=h[1];return l(c,h)?(h=a.getBundleV2ServiceOptionData(c,h),e=n(e,h),b.updateHitParametersForServiceOptions(c,h),d.ccSelectionUpdate(f.FEATURE_NAME,e)):!1},createItemData:n,updateCartItemsWithOverrides:function(a,c,k,l){return c!==u&&k!==u&&e.isEnabled?(k={itemType:g.ASIN,asin:c.asin,offerListingId:c.offerListingId,quantity:1,price:l.price!==u?l.price:Number(c.offerPrice),selectionType:k,enableIA:h.checkIAData(c)},k.enableIA&&(k.IAData=h.getIAData(c)),b.updateHitParametersForServiceOptions(a,
c),d.ccSelectionUpdate(f.FEATURE_NAME,k)):!1},validateBuyingOptionIndexandServiceAsin:l}});"use strict";m.when("service-options-ready").register("vas-udm-refresh-handler",{});"use strict";m.when("atf","dp-latency-marker").register("service-options-ready",function(c){});"use strict";m.when("A","vas-metrics-publisher","ready").register("vas-atc-tracker",function(c,d){c=c.$;var a=!1,g=null,f=null,h=0,b=null,e=null,k=!1,l,n=function(){return 0===h?!1:!0},q=function(a,b){"undefined"!==typeof b?d.logUeMetricIncreaseCount(a+
(l.showSTSServiceInterstitial||l.isParentServiceAsin?"_sts":""),b):d.logUeMetricIncreaseCount(a+(l.showSTSServiceInterstitial||l.isParentServiceAsin?"_sts":""))},v=function(){if(a){var b=g;null!==b&&(b=((new Date).getTime()-b)/1E3,q("vas_si_hijack_interval_time",b),300<b&&(d.logRefTag("vas_si_hijack_interval_time_5M_"+l.productAsin+"_"+l.serviceAsin),d.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+"] ")))}},z=function(){if(n()){var a=f;null!==a&&(a=((new Date).getTime()-a)/1E3,q("vas_si_dismissal_interval_time",a),30<a&&(d.logRefTag("vas_si_hijack_dismissal_time_30S_"+l.productAsin+"_"+l.serviceAsin),d.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+"] ")))}},t=function(){if(!k&&(k=!0,a)){q("vas_si_hijack_unload");d.logRefTag("vas_si_hijack_unload"+
l.productAsin+"_"+l.serviceAsin);var b=g;if(null!==b){var c=(new Date).getTime();q("vas_si_hijack_unload_total_time",c-b);d.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};c(p).unbind("beforeunload");c(p).bind("beforeunload",t);c(p).unbind("unload");c(p).bind("unload",t);return{isHijacked:function(){return a},setHijacked:function(){a||(a=!0,q("vas_si_atcHijack"),d.logRefTag("vas_si_atcHijack"),
g=(new Date).getTime(),b=p.setInterval(v,6E4),e=p.setInterval(z,2E4))},unsetHijacked:function(){if(a){if(null!==g){var c=((new Date).getTime()-g)/1E3;q("vas_si_hijack_total_time",c)}a=!1;q("vas_si_atcUnHijack");d.logRefTag("vas_si_atcUnHijack");g=null;h=0;f=null;null!==b&&(p.clearInterval(b),b=null);null!==e&&(p.clearInterval(e),e=null)}},getHijackTime:function(){return g},logHijackMetricOnPageUnload:t,setHijackDismissalAttempt:function(){0===h&&(f=(new Date).getTime());h++;1<h?q("vas_si_dismissal_count",
1):q("vas_si_dismissal_count",0);2===h&&d.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 f},isDismissalAttempted:n,setWidgetMetaData:function(a){l=a},logMetric:q}});"use strict";m.when("A","vas-metrics-publisher","vas-atc-tracker","ready").register("vas-atc-helper",function(c,d,a){var g=c.$,f,h=function(){a.logMetric("vas_si_atcClick_returnFalse");f&&
(d.logFatal("Add to cart is clicked multiple times with vas SI","vas-si","[context::productAsin\x3d"+f.productAsin+",serviceAsin\x3d"+f.serviceAsin+",zip\x3d"+f.zipCode+"] "),d.logHit("vas_si_atcClick_returnFalse",{upsellAsin:f.serviceAsin,productAsin:f.productAsin,additionalRequestData:f.zipCode}));return!1},b=function(){a.logMetric("vas_si_forceSafeATC_click");f.isMBCClick&&f.atcButton.bind("click",function(){var a=g(this).find("a")[0];a&&a.href&&(p.location.href=a.href)});if(f.atcButton)f.atcButton.unbind("click.lsatc").click().bind("click.lsatc",
h);else{var b=g("#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()}},e=function(){a.logMetric("vas_si_safeATC_click");f.atcEventInProgress||b()},k=function(){var a,b,d,c;f.isMBCClick&&"undefined"!==typeof f.offerListingID&&(d=f.atcButton.find("a")[0])&&d.href&&(a=d.href,f.showSIATC&&(b=2,(c=a.match(/itemCount=([0-9]+)/i))&&c[1]&&(c=parseInt(c[1],10))&&(b=c+1),a=a.replace(/itemCount=([0-9]+)/i,"itemCount\x3d"+
b)+"\x26offeringID."+b+"\x3d"+f.offerListingID,d.href=a));return a},l=function(){var a={};a.upsellAsin=f.serviceAsin;a.offerlistingId=f.offerListingID;a.merchantId=f.merchantId;c.trigger("vas:add-service-asin-buybox-event",a)};return{addServiceToCart:function(d){var c=k();if(f.showSIATC)l(),a.logMetric("vas_siatc_service_added"),e();else{if(f.atcEventInProgress)return!1;f.atcEventInProgress=!0;a.logMetric("vas_si_addProduct");var h=function(b){document.body.style.cursor="default";a.logMetric("vas_siatc_sdp_redirect_ajaxFail",
0);if(f.productAsin&&f.serviceAsin){var c={dsc:1,productASIN:f.productAsin},e=f.zipCode;b=g(b);if(b=(b=(b=(b=(b=g(".giftableItem, .nonGiftableItem",b))&&b[0])&&b.outerHTML)&&g(b))&&b.attr("itemid"))c.itemID=b,c.newItems=b+",1",c.isHUC="true";e&&(c.area=e);c=JSON.stringify(c).replace(/"/g,"'");c="?vas\x3d"+encodeURIComponent(c)+"\x26psc\x3d1";a.unsetHijacked();p.location.href="/gp/product/"+f.serviceAsin+"/ref\x3d"+d+c;a.logMetric("vas_siatc_sdp_redirect")}else a.logMetric("vas_siatc_huc_redirect"),
a.unsetHijacked(),p.location.href="/gp/cart/view.html"},z=function(d){a.logMetric("vas_siatc_sdp_redirect_ajaxFail");document.body.style.cursor="default";b()};f.isMBCClick?g.get(c).done(h).fail(z):(c={"session-id":g("#session-id").attr("value"),ASIN:f.productAsin,offerListingID:g("#offerListingID").attr("value"),isMerchantExclusive:g("#isMerchantExclusive").attr("value"),merchantID:g("#merchantID").attr("value"),isAddon:g("#isAddon").attr("value"),nodeID:g("#nodeID").attr("value"),sellingCustomerID:g("#sellingCustomerID").attr("value"),
qid:g("#qid").attr("value"),sr:g("#sr").attr("value"),storeID:g("#storeID").attr("value"),tagActionCode:g("#tagActionCode").attr("value"),viewID:g("#viewID").attr("value"),rsid:g("#rsid").attr("value"),sourceCustomerOrgListID:g("#sourceCustomerOrgListID").attr("value"),sourceCustomerOrgListItemID:g("#sourceCustomerOrgListItemID").attr("value"),wlPopCommand:"",quantity:g("#quantity").attr("value"),"submit.add-to-cart":"Submit+Query"},g.post("/gp/product/handle-buy-box/ref\x3dvas_dphbb_"+f.productAsin+
"_"+f.serviceAsin,c).done(h).fail(z));document.body.style.cursor="progress"}return!1},lsATCHandlerSuppressATC:h,safeATCClick:e,forceSafeATCClick:b,setWidgetMetaData:function(a){f=a}}});"use strict";m.when("A","ready").register("vas-service-quantity-helper",function(c){return{getServiceQuantity:function(d,a){return 1}}});"use strict";A=function(){return function(c,d){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c)){var a=[],g=!0,f=!1,h=u;try{for(var b=c[Symbol.iterator](),e;!(g=(e=b.next()).done)&&
(a.push(e.value),!d||a.length!==d);g=!0);}catch(k){f=!0,h=k}finally{try{if(!g&&b["return"])b["return"]()}finally{if(f)throw h;}}return a}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}();m.when("A","service-options-item-utils","service-options-common-constants","service-options-css-update","service-options-subheader-update","service-options-metric-utils","vas-udm-refresh-handler","vas-udm-refresh-integration-weblab","service-options-ready").register("service-options-cart-handlers",
function(c,d,a,g,f,h,b,e){var k=c.$,l=function(c,k){var l=d.updateCartItems(c,k),z=c.split(a.DELIMITER),t=A(z,2),z=t[0],t=t[1];l?(g.cssUpdate(c,a.CC_CARD,k),h.captureServiceSelectionMetrics(z,k),f.subHeaderUpdate(t,k,z),e.isEnabled&&k===a.ADD_SELECTION_TYPE&&b.refresh(t,Number(z),a.TPLUS)):h.captureCartUpdateFailure(k)};return{changeInServiceOptionCheckbox:function(b,c){var e=c?a.ADD_SELECTION_TYPE:a.DELETE_SELECTION_TYPE,k=d.updateCartItems(b,e),l=b.split(a.DELIMITER),m=A(l,2),l=m[0],m=m[1];k?(c?
g.cssUpdate(b,a.CHECK_BOX,a.ADD_SELECTION_TYPE):g.cssUpdate(b,a.CHECK_BOX,a.DELETE_SELECTION_TYPE),h.captureServiceSelectionMetrics(l,e),f.subHeaderUpdate(m,e,l)):h.captureCartUpdateFailure(e)},changeInServiceOptionCard:function(d){for(var c=d.split(a.DELIMITER),c=A(c,2)[0],h=document.getElementsByClassName(a.SELECTED_SERVICE_OPTIONS+c),z=0;z<h.length;z++){var t=h[z].id,m=k("#"+t).hasClass(a.CC_CARD_COMMON_CLASS),C=k("#"+t).hasClass(a.PRODUCT_ONLY_CC_CARD_CLASS);m&&(C?g.cssUpdate(t,a.CC_CARD,a.DELETE_SELECTION_TYPE):
l(t,a.DELETE_SELECTION_TYPE))}k("#"+d).hasClass(a.PRODUCT_ONLY_CC_CARD_CLASS)?(f.subHeaderUpdate(null,a.ADD_SELECTION_TYPE,c),e.isEnabled&&b.serviceRemovalRefresh(Number(c),a.TPLUS),g.cssUpdate(d,a.CC_CARD,a.ADD_SELECTION_TYPE)):l(d,a.ADD_SELECTION_TYPE)}}});"use strict";m.when("A","cc-manager","service-options-setting","service-options-item-utils","service-options-device-specific-constants","service-options-common-constants","service-options-subheader-update","service-options-metric-utils","vas-metrics-publisher",
"service-options-ready").register("service-options-cc-handler",function(c,d,a,g,f,h,b,e,k){var l=c.$,n=h.TPLUS+"_"+h.SERVICE_OPTIONS;return{addMandatoryServices:function(a){var d=document.getElementsByClassName(h.SELECTED_SERVICE_OPTIONS+a);b.initializeBuyingOptionToCurrentSelectionState(a);for(var c=0;c<d.length;c++){var f=d[c],m;m=f.id;m=l("#"+m).hasClass(h.PRODUCT_ONLY_CC_CARD_CLASS)?null:m.split(h.DELIMITER)[1];m&&(g.updateCartItems(f.id,h.ADD_SELECTION_TYPE)?(b.subHeaderUpdate(m,h.ADD_SELECTION_TYPE,
a),k.logCSMCounter(n+"_"+h.SERVICE_DEFAULTED),k.logCSMCounter([n,h.SERVICE_DEFAULTED,a].join("_")),e.captureServiceSelectionMetrics(a,h.ADD_SELECTION_TYPE)):e.captureCartUpdateFailure(h.ADD_SELECTION_TYPE,m))}}}});"use strict";m.when("service-options-ready").register("service-options-common-constants",function(c){return{DELIMITER:"-",UNDEFINED:"undefined",STRING:"string",NULL:"null",FEATURE_ATTRIBUTION:"Value Added Services/Discovery/Value Adds Detail Page",ASIN:"asin",ADD_SELECTION_TYPE:"add",DELETE_SELECTION_TYPE:"delete",
DELETE:"DELETE",REMOVE:"REMOVE",ADD:"ADD",AUI_EXPANDER:"a:expander:",AUI_POPOVER:"a:popover",AUI_BOTTOM_SHEET:"a:sheet:",BEFORE_SHOW:"beforeShow:",AFTER_HIDE:"afterHide:",AUI_TOGGLE_EXPAND:":toggle:expand",AUI_COLLAPSE:":toggle:collapse",AUI_CARD_EXPANDED:"a-expander-content-expanded",DATA_EXPANDED_STATE:"data-expanded",COLLAPSE_HEADING_ICON:"a-icon-section-collapse",EXPAND_HEADING_ICON:"a-icon-section-expand",AOK_HIDDEN:"aok-hidden",PAGE_REFRESH_ATF:"PageRefresh:ATF",DATA_EXPANDED_STATE_VALUE_FALSE:"false",
DATA_EXPANDED_STATE_VALUE_TRUE:"true",STYLE:"style",CARD_HIDDEN_STYLE:"overflow: hidden; display: none;",CARD_SHOWN_STYLE:"overflow: hidden;",PAGE_REFRESH_SUCCESS:"PageRefresh:Success",CLICK:"click",CHANGE:"change",SERVICE_OPTIONS_EXPANDER:"serviceOptionsExpander",SERVICE_OPTIONS_BOTTOM_SHEET:"serviceOptionsBottomSheet",SERVICE_OPTIONS_ACCORDIAN_WIDGET:"serviceOptionsAccordionWidget-",SERVICE_OPTIONS_GXA_PAGESTATE_HOLDER_ID:"serviceOptions-gxa-pageState-holder-",SERVICE_OPTION_PAGE_STATE:"serviceOptions-gxa-state-",
SERVICE_OPTION_STATE:"serviceOptions-state-",SERVICE_OPTIONS:"serviceOptions",CC_CARD_DECLARATIVE_ACTION_POST_SELECTION:"a-tp-card-declarative-post",CC_CARD_DECLARATIVE_ACTION_PRE_SELECTION:"a-tp-card-declarative-pre",CC_CARD_DECLARATIVE_ACTION:"a-tp-card-declarative",CHECK_BOX_DECLARATIVE_ACTION:"a-tp-checkbox-declarative",CC_CARD:"CC_CARD",CHECK_BOX:"CHECK_BOX",SUFFIX_FOR_OUTER_CONTAINER:"-outerContainer",POST_SELECTION:"-postSelection",PRE_SELECTION:"-preSelection",SELECTED_ICON:"-selectedIcon",
DESELECTED_ICON:"-deselectedIcon",SERVICE_OPTIONS_SUB_HEADER_PRICE:"serviceOptions-subHeaderPrice-",SERVICE_OPTIONS_SUB_HEADER_PREFIX:"serviceOptionsSubHeaderPrefix-",SERVICE_OPTIONS_SUB_HEADER_ICON:"serviceoptionsSubHeaderIcon-",SELECTED_SERVICE_OPTIONS:"preSelected-",SELECTED_CARD_CSS_CLASS_BORDER:"vas-tp-swatch-select",CC_CARD_COMMON_CLASS:"vas-serviceOptions-cc-card",CHECK_BOX_COMMON_CLASS:"vas-serviceOptions-cc-checkBox",PRODUCT_ONLY_CC_CARD_CLASS:"vas-tp-selectable",CUSTOMER_SELECTED_CLASS:"vas-tp-customer-selected",
TOP_CONTAINER_TITLE:"-topContainerTitle",HEADER_SHIMMER:"headerShimmer-",SUB_HEADER_SHIMMER:"subheaderShimmer-",NO_SERVICES_AVAILABLE:"noServiceOption-",TPLUS_POPOVER:"tpPopoverContent-",POPOVER:"popover",BOTTOM_SHEET:"bottomSheet",EMPTY_RESPONSE_ERROR_MESSAGE:"GXA Call Failure: Empty response",SERVICE_DEFAULTED:"service_defaulted",SHOW:"show",DISMISS:"dismiss",TPLUS:"tPlus",OPEN:"open",CLOSE:"close",SUB_HEADER_UPDATED_FAILURE:"subHeader_update_failure",SUB_HEADER_UPDATED_SUCCESS:"subHeader_update_success",
additionalRequestDataKeys:{services:"services"},GXA_RESPONSE_SUCCESS_EVENT:"GXA_RESPONSE_SUCCESS_",SWITCH_BUYING_OPTION_EVENT:"SWITCH_BUYING_OPTION",COLLAPSE_CARD_EVENT:"COLLAPSE_CARD",BUNDLE_V2:"BUNDLE_V2"}});"use strict";A=function(){return function(c,d){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c)){var a=[],g=!0,f=!1,h=u;try{for(var b=c[Symbol.iterator](),e;!(g=(e=b.next()).done)&&(a.push(e.value),!d||a.length!==d);g=!0);}catch(k){f=!0,h=k}finally{try{if(!g&&b["return"])b["return"]()}finally{if(f)throw h;
}}return a}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}();m.when("A","service-options-device-specific-constants","service-options-common-constants","vas-metrics-publisher","service-options-ready").register("service-options-css-update",function(c,d,a,g){var f=c.$;return{cssUpdate:function(c,b,e){var k=c.split(a.DELIMITER),l=A(k,2),k="[context::serviceAsin\x3d"+l[1]+"] ",n=a.SELECTED_CARD_CSS_CLASS_BORDER,q=d.SELECTED_CARD_CSS_CLASS_BACKGROUND,l=a.SELECTED_SERVICE_OPTIONS+
l[0];switch(b){case a.CC_CARD:switch(e){case a.ADD_SELECTION_TYPE:f("#"+c).addClass(n+" "+q+" "+l);break;case a.DELETE_SELECTION_TYPE:f("#"+c).removeClass(n+" "+q+" "+l);break;default:g.logFatal("Invalid selectionType for CC_CARD",d.FATAL_ATTRIBUTION,k)}break;case a.CHECK_BOX:switch(e){case a.ADD_SELECTION_TYPE:f("#"+c).addClass(""+l);break;case a.DELETE_SELECTION_TYPE:f("#"+c).removeClass(""+l);break;default:g.logFatal("Invalid selectionType for CHECK_BOX",d.FATAL_ATTRIBUTION,k)}break;default:g.logFatal("Invalid serviceOptionType for serviceOptionId",
d.FATAL_ATTRIBUTION,k)}}}});"use strict";m.when("service-options-ready").register("service-options-device-specific-constants",function(c){return{FEATURE_NAME:"serviceOptionsWW",SELECTED_CARD_CSS_CLASS_BACKGROUND:"serviceOptions-buttonBG",FATAL_ATTRIBUTION:"vas-service-options-desktop",SERVICE_OPTIONS_EXPANDER_HEADER_ID:"#serviceOptions-expander-header",SERVICE_OPTIONS_EXPANDER_CONTENT_ID:"#serviceOptions-expander-content"}});"use strict";m.when("A","service-options-common-constants","service-options-setting",
"vas-metrics-publisher","vas-metric-utils","service-options-device-specific-constants","service-options-ready").register("service-options-metric-utils",function(c,d,a,g,f,h){function b(b){var c=a.buyingOptionToBundleV2Data[b].bundleOptionTypeData,h=a.getPageStateUsingElementId("serviceOptions-gxa-pageState-holder-",b);e[b]=f.createHitParametersForServiceOptions(c,h,d)}var e={},k=d.TPLUS+"_"+d.SERVICE_OPTIONS;return{captureServiceSelectionMetrics:function(a,b){if(e!==u&&e[a].mappingSet!==u){var c=
e[a].mappingSet;g.logHit([k,d.ASIN,b].join("_"),e[a]);g.logCSMCounter([k,c,d.ASIN,b].join("_"));g.logCSMCounter([k,d.ASIN,b].join("_"))}},updateHitParametersForServiceOptions:function(a,b){b!==u&&e!==u&&(e[a].upsellAsin=b.asin,e[a].mappingSet=b.key.mappingSet)},getHitParameters:function(){return e},captureGlanceViewMetrics:function(d){b(d);var f=a.buyingOptionToBundleV2Data[d].bundleOptionTypeData;g.logCSMCounter([k,g.CSMActionTypes.glanceView].join("_"));g.logCSMCounter([k,g.CSMActionTypes.glanceView,
d].join("_"));g.increaseCSMCounterBy(k+"_count",Object.keys(f).length);g.increaseCSMCounterBy([k,"count",d].join("_"),Object.keys(f).length);c.each(f,function(a,b){g.logCSMCounter([k,"renderStyle",a.renderStyle].join("_"));a.selectionBehaviour!==u&&g.logCSMCounter([k,"selection_behaviour",a.selectionBehaviour].join("_"))});g.logHit(k+"_"+g.RefmarkerActionTypes.glanceView,e[d])},captureGXALatency:function(a,b){a=(new Date).getTime()-a;g.logUeMetricIncreaseCount([k,"gxa_latency"].join("_"),a);g.logUeMetricIncreaseCount([k,
"gxa_latency",b].join("_"),a)},captureCartUpdateFailure:function(a,b){g.logFatal("Service Add To Cart Failure",h.FATAL_ATTRIBUTION,"Service ASIN: "+b);g.logCSMCounter([k,a,"failure"].join("_"))}}});"use strict";m.when("A","service-options-common-constants","service-options-setting","vas-metrics-publisher","service-options-ready").register("service-options-subheader-update",function(c,d,a,g){var f={};return{subHeaderUpdate:function(c,b,e){var k=f[e].selectedServicesCount,l=f[e].currentUnifiedSelection,
n=f[e].currentNonUnifiedSelection,q=a.isServiceUnified(c,e);c?b===d.ADD_SELECTION_TYPE?(q?l=c:n=c,k++):(q?l=null:n=null,k--):(l&&k--,l=null);f[e].currentUnifiedSelection=l;f[e].selectedServicesCount=k;f[e].currentNonUnifiedSelection=n;c=l;l="serviceOptions-subHeadericon-"+e;b=document.getElementById("serviceOptionsWidgetSubHeader-"+e);q=document.getElementById(l);l=a.getOriginalSubHeaderString(e);if(0===k)q.classList.add(d.AOK_HIDDEN);else{var v=c;1===k&&(v=n||c);a.checkSubHeaderUpdateStringsPresent(v,
e,2===k)&&(q.classList.remove(d.AOK_HIDDEN),l=a.getServiceSelectionMessage(v,e,1===k))}e=b.getElementsByTagName("span");if(0<e.length)for(e[0].textContent=l,g.logCSMCounter([d.TPLUS,d.SERVICE_OPTIONS,d.SUB_HEADER_UPDATED_SUCCESS].join("_")),c=1;c<e.length;c++)e[c].remove();else g.logCSMCounter([d.TPLUS,d.SERVICE_OPTIONS,d.SUB_HEADER_UPDATED_FAILURE].join("_"))},initializeBuyingOptionToCurrentSelectionState:function(a){f[a]={};f[a].selectedServicesCount=0;f[a].currentUnifiedSelection=null;f[a].currentNonUnifiedSelection=
null}}});"use strict";m.when("A","service-options-common-constants","service-options-device-specific-constants","service-options-setting","service-options-ready").register("service-options-card-toggler",function(c,d,a,g){var f=c.$;return{cardExpander:function(c){var b="#serviceOptionsOuterDiv-"+c;c=document.querySelector(b+" "+a.SERVICE_OPTIONS_EXPANDER_HEADER_ID+" .a-icon");b=document.querySelector(b+" "+a.SERVICE_OPTIONS_EXPANDER_CONTENT_ID);f(b).addClass(d.AUI_CARD_EXPANDED).attr(d.DATA_EXPANDED_STATE,
d.DATA_EXPANDED_STATE_VALUE_TRUE).attr(d.STYLE,d.CARD_SHOWN_STYLE);f(c).addClass(d.COLLAPSE_HEADING_ICON).removeClass(d.EXPAND_HEADING_ICON)},collapseCard:function(){var c="#serviceOptionsOuterDiv-"+g.getCurrentBuyingOptionIndex(),b=document.querySelector(c+" "+a.SERVICE_OPTIONS_EXPANDER_HEADER_ID+" .a-icon"),c=document.querySelector(c+" "+a.SERVICE_OPTIONS_EXPANDER_CONTENT_ID);f(c).removeClass(d.AUI_CARD_EXPANDED).attr(d.DATA_EXPANDED_STATE,d.DATA_EXPANDED_STATE_VALUE_FALSE).attr(d.STYLE,d.CARD_HIDDEN_STYLE);
f(b).removeClass(d.COLLAPSE_HEADING_ICON).addClass(d.EXPAND_HEADING_ICON)}}});"use strict";m.when("A","service-options-setting","service-options-cc-handler","service-options-registration","service-options-device-specific-constants","service-options-cart-handlers","service-options-common-constants","service-options-gxa-handler","service-options-subheader-update","vas-metrics-publisher","service-options-card-toggler","service-options-metric-utils","vas-udm-refresh-handler","vas-udm-refresh-integration-weblab",
"service-options-ready").execute("service-options-controller",function(c,d,a,g,f,h,b,e,k,l,n,q,v,m){function t(){c.off(b.AUI_EXPANDER+b.SERVICE_OPTIONS_EXPANDER+b.AUI_TOGGLE_EXPAND);c.on(b.AUI_EXPANDER+b.SERVICE_OPTIONS_EXPANDER+b.AUI_TOGGLE_EXPAND,function(){g.cardExpanderListener(f.FEATURE_NAME);l.logCSMCounter(x+"_"+b.CLICK+"_"+b.OPEN)});c.off(b.AUI_EXPANDER+b.SERVICE_OPTIONS_EXPANDER+b.AUI_COLLAPSE);c.on(b.AUI_EXPANDER+b.SERVICE_OPTIONS_EXPANDER+b.AUI_COLLAPSE,function(){l.logCSMCounter(x+"_"+
b.CLICK+"_"+b.CLOSE)});c.declarative(b.CC_CARD_DECLARATIVE_ACTION,b.CLICK,function(a){a!==b.UNDEFINED&&(a=a.$currentTarget[0],a=a===b.NULL||a===b.UNDEFINED?b.UNDEFINED:a.children[0],a=a===b.NULL||a===b.UNDEFINED?b.UNDEFINED:a.id,E("#"+a).hasClass(b.SELECTED_CARD_CSS_CLASS_BORDER)||h.changeInServiceOptionCard(a))});c.declarative(b.CHECK_BOX_DECLARATIVE_ACTION,b.CHANGE,function(a){if(a!==b.UNDEFINED){var c=a.$currentTarget[0];a=a.$target["0"];c=c===b.NULL||c===b.UNDEFINED?b.UNDEFINED:c.children[0];
(c=c===b.NULL||c===b.UNDEFINED?b.UNDEFINED:c.id)&&a&&h.changeInServiceOptionCheckbox(c,a.checked)}})}function I(a){E("#"+b.HEADER_SHIMMER+a).addClass(b.AOK_HIDDEN);E("#"+b.SUB_HEADER_SHIMMER+a).addClass(b.AOK_HIDDEN)}function C(a){var c=d.getPageStateUsingElementId("serviceOptions-gxa-pageState-holder-",a);a=E("#"+(b.HEADER_SHIMMER+a)).hasClass(b.AOK_HIDDEN);return c&&!a}function p(){d.fetchBuyingOptionIndicesList().forEach(function(a){J||(g.registerFeature(f.FEATURE_NAME),l.logCSMCounter([b.TPLUS,
f.FEATURE_NAME,w.REGISTERED].join("_")),J=!0);if(C(a)){var k=(new Date).getTime();e.fetchServiceOptionsContent(a).then(function(e){q.captureGXALatency(k,a);E("#"+b.SERVICE_OPTIONS_ACCORDIAN_WIDGET+a).append(e);I(a);var f=d.getPageStateUsingElementId(b.SERVICE_OPTIONS_GXA_PAGESTATE_HOLDER_ID,a);c.trigger(b.GXA_RESPONSE_SUCCESS_EVENT+f.userExperienceType,{pageState:f,response:e})}).catch(function(){E("#"+b.NO_SERVICES_AVAILABLE+a).removeClass(b.AOK_HIDDEN);l.logCSMCounter([x,w.NO_SERVICES,w.GV].join("_"));
I(a)})}})}function u(b){var c=d.getCurrentBuyingOptionIndex();b===c&&a.addMandatoryServices(c)}function r(){p();m.isEnabled&&v.register(d.fetchBuyingOptionIndicesList(),x)}var E=c.$,A=!1,J=!1,x=b.TPLUS+"_"+b.SERVICE_OPTIONS,w={REGISTERED:"registered",NO_SERVICES:"no_services",GV:"gv",GXA_SUCCESS_HANDLER_EXCEPTION:"gxa_success_handler_exception"},H=[f.FEATURE_NAME,b.SWITCH_BUYING_OPTION_EVENT].join("_"),y=[f.FEATURE_NAME,b.COLLAPSE_CARD_EVENT].join("_");r();c.on(b.PAGE_REFRESH_SUCCESS,function(){r()});
c.on(b.GXA_RESPONSE_SUCCESS_EVENT+b.BUNDLE_V2,function(a){try{var e=a.pageState;d.setBuyingOptionToBundleV2Data(e.buyingOptionIndex);q.captureGlanceViewMetrics(e.buyingOptionIndex);k.initializeBuyingOptionToCurrentSelectionState(e.buyingOptionIndex);u(e.buyingOptionIndex);A||(t(),A=!0);c.off(b.AUI_POPOVER+":"+b.SHOW+":"+b.TPLUS_POPOVER+e.buyingOptionIndex);c.on(b.AUI_POPOVER+":"+b.SHOW+":"+b.TPLUS_POPOVER+e.buyingOptionIndex,function(){l.logCSMCounter(x+"_"+b.POPOVER+"_"+b.SHOW)});c.off(b.AUI_POPOVER+
":"+b.DISMISS+":"+b.TPLUS_POPOVER+e.buyingOptionIndex);c.on(b.AUI_POPOVER+":"+b.DISMISS+":"+b.TPLUS_POPOVER+e.buyingOptionIndex,function(){l.logCSMCounter(x+"_"+b.POPOVER+"_"+b.DISMISS)});c.off(b.AUI_BOTTOM_SHEET+b.BEFORE_SHOW+b.SERVICE_OPTIONS_BOTTOM_SHEET+"-"+e.buyingOptionIndex);c.on(b.AUI_BOTTOM_SHEET+b.BEFORE_SHOW+b.SERVICE_OPTIONS_BOTTOM_SHEET+"-"+e.buyingOptionIndex,function(){l.logCSMCounter(x+"_"+b.BOTTOM_SHEET+"_"+b.SHOW)});c.off(b.AUI_BOTTOM_SHEET+b.AFTER_HIDE+b.SERVICE_OPTIONS_BOTTOM_SHEET+
"-"+e.buyingOptionIndex);c.on(b.AUI_BOTTOM_SHEET+b.AFTER_HIDE+b.SERVICE_OPTIONS_BOTTOM_SHEET+"-"+e.buyingOptionIndex,function(){l.logCSMCounter(x+"_"+b.BOTTOM_SHEET+"_"+b.DISMISS)});1===g.getRenderedFeaturesList()&&n.cardExpander(e.buyingOptionIndex)}catch(f){l.logException(f,"service-options-bundle-v2-handler","Error in GXA_RESPONSE_SUCCESS_BUNDLE_V2 event handler for buyingOptionIndex: "+(a&&a.pageState?a.pageState.buyingOptionIndex:"undefined")+", response: "+JSON.stringify(a?a.response:null)+
", pageState: "+JSON.stringify(a?a.pageState:null)),l.logCSMCounter([x,w.GXA_SUCCESS_HANDLER_EXCEPTION].join("_"))}});c.on(H,function(e){var f=d.getUserExperienceType(e);b.BUNDLE_V2===f?a.addMandatoryServices(e):(f=[H,f].join("_"),c.trigger(f,e))});c.on(y,function(){var a=d.getCurrentBuyingOptionIndex(),a=d.getUserExperienceType(a);b.BUNDLE_V2===a?n.collapseCard():(a=[y,a].join("_"),c.trigger(a))})});"use strict";m.when("A","service-options-common-constants","service-options-setting","vas-metrics-publisher",
"3p-promise","service-options-ready").register("service-options-gxa-handler",function(c,d,a,g,f){function h(a){var c=JSON.stringify(a),d={experienceId:"valueAddsGxa",showFeatures:"valueAddsGxa",userExperienceType:a.userExperienceType,vasProductData:c,asin:a.baseAsin,sr:a.requestId,language:a.language,buyingOptionIndex:a.buyingOptionIndex,psc:1};return"/gp/product/ajax?"+Object.keys(d).map(function(a){return a+"\x3d"+d[a]}).join("\x26")}return{fetchServiceOptionsContent:function(b){var e=a.getPageStateUsingElementId(d.SERVICE_OPTIONS_GXA_PAGESTATE_HOLDER_ID,
b),k=[d.SERVICE_OPTIONS,"gxa",e.userExperienceType].join("_"),l=h(e);return new f(function(a,e){c.get(l,{timeout:"10000",success:function(c){0===c.trim().length?(g.logCSMCounter([k,"success_noService"].join("_")),g.logCSMCounter([k,"success_noService",b].join("_")),e(Error(d.EMPTY_RESPONSE_ERROR_MESSAGE))):(g.logCSMCounter(k+"_success"),g.logCSMCounter([k,"success",b].join("_")),a(c))},error:function(a){g.logCSMCounter(k+"_failure");g.logCSMCounter([k,"failure",b].join("_"));g.logFatal("Service Options GXA Call failed for BuyingOptionIndex "+
b,d.FATAL_ATTRIBUTION,a);e(a)}})})}}});"use strict";m.when("A","service-options-common-constants","service-options-ready").register("service-options-setting",function(c,d){function a(a,b){return f.parseJSON(f("#"+(""+a+b)+" script").html())}function g(a,c){return b[a].bundleOptionTypeData[c]}var f=c.$,h=document.getElementsByClassName("serviceOptionsGXAPageState"),b={};return{getBundleV2ServiceOptionData:g,fetchBuyingOptionIndicesList:function(){for(var a=[],b=0;b<h.length;b++){var g=h[b].querySelector("script"),
g=c.parseJSON(f(g).html()).buyingOptionIndex;g!==d.UNDEFINED&&a.push(g)}return a},setBuyingOptionToBundleV2Data:function(c){b[c]=a("serviceOptions-pageState-holder-",c);var d="serviceOptionsWidgetSubHeader-"+c;document.getElementById(d).getElementsByTagName("span").length&&(b[c].originalSubHeaderString=f("#"+d+" span").text())},getCurrentBuyingOptionIndex:function(){var a=0,b=c.$("#buybox .a-accordion-active");b.length&&(a=b.index());return a},getServiceSelectionMessage:function(a,b,c){a=g(b,a);return c?
a.singleServiceSelectionMessage:a.twoServiceSelectionMessage},getPageStateUsingElementId:a,checkSubHeaderUpdateStringsPresent:function(a,b,c){a=g(b,a);return c?a&&"twoServiceSelectionMessage"in a:a&&"singleServiceSelectionMessage"in a},isServiceUnified:function(a,b){return a?g(b,a).key.unified:!1},getOriginalSubHeaderString:function(a){return b[a].originalSubHeaderString},buyingOptionToBundleV2Data:b,getUserExperienceType:function(b){return(b=a(d.SERVICE_OPTIONS_GXA_PAGESTATE_HOLDER_ID,b))?b.userExperienceType:
u},isUdmRefreshEnabled:function(a){a=f("script[data-a-state*\x3dserviceOptions-gxa-state-"+a+"]");a=0===a.length?null:c.parseJSON(a[0].innerHTML);return null!=a?a.isUdmRefreshEnabled:!1}}});"use strict";m.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"}}}}});"use strict";m.when("A","vas-metrics-publisher","vas-utilities","ready").register("vas-zipcode-helper",function(c,d,a){var g=c.$,f,h,b,e,k,l,n,q,v,m,t,p,C,u,r,A,E,R,J,x,w,H,y,B,F=function(a,b){"undefined"!==typeof b?d.logUeMetricIncreaseCount(a+(w.showSTSServiceInterstitial||w.isParentServiceAsin?"_sts":""),b):d.logUeMetricIncreaseCount(a+(w.showSTSServiceInterstitial||w.isParentServiceAsin?"_sts":""))},N=function(){k.hide();E.hide();
A.hide();p.addClass("a-button-disabled").prop("disabled",!0)},S=function(){N();q.hide();l.hide();v.show()};c.on("a:popover:show:VAS-SI-Zip-Update",function(a){B=a.popover});return{vasSIZipCodeUpdate:function(D,L){var M=D.bsi_prefixes.refmarkerPrefixes,T=D.additionalRequestDataKeys,K=D.bsi_prefixes.metricPrefixes;d.createCSMNameAndLog(K.tenant,K.widget,"updateZip");D=r.val();if(a.validateZipCode(D,R)){y=r.val();var O=w.zipCode,U="vas_sx_zc_"+O+"_"+y,P="undefined"!==typeof w.childServiceAsins?w.childServiceAsins:
[w.serviceAsin];d.logRefTag(U);if(y===H)return!1;c.ajax("/gp/ls/vas-ajax-handlers/vas-zipcode-refresh.html",{method:"get",params:{asinlist:P.join(","),vasZipcode:y,clientName:"vasBuyableSiZipRefresh",includeMerchantAddress:w.showSTSServiceInterstitial},success:function(a){var r,G,D=!(g.isEmptyObject(a)||"1"===a.hasError);if(D)for(var Q=0;Q<P.length;Q++)if(G=P[Q],a[G]&&!r||!r.merchantId||w.showSTSServiceInterstitial&&"in_store"===a[G].fulfillmentType)r=a[G],w.serviceAsin=G;G=g(".vas-siatc-zip");G.length&&
G.text(y);if(!D||c.objectIsEmpty(a)||1===a.hasError||c.objectIsEmpty(a[w.serviceAsin])||1===a[w.serviceAsin].hasError)return S(),d.logRefTag("vas_sx_zaf_"+O+"_"+y),F("vas-si-atc-zip-ajaxFail"),d.createCSMNameAndLog(K.tenant,K.widget,"updateZipFail"),!1;c.objectIsEmpty(r.offerListingId)?(L.additionalRequestData[T.zipCode]=y,d.createRefMarkerAndLog(M.tenant,w.mappingSet,M.widget,"zprfrsh0",L),N(),l.hide(),v.hide(),n.length&&n.text(y),q.show(),w.showSTSServiceInterstitial&&J.hide(),d.logRefTag("vas_sx_zfl_"+
O+"_"+y),F("vas-si-atc-zipchange-nooffer")):(L.additionalRequestData[T.zipCode]=y,d.createRefMarkerAndLog(M.tenant,w.mappingSet,M.widget,"zprfrsh1",L),B&&B.hide(),a=r,w.offerListingID=a.offerListingId,w.isCBM=a.isCBM,w.merchantId=a.merchantId,w.isShipToStoreAsinSelected="in_store"===a.fulfillmentType,w.shouldAddItemAssociation=w.isShipToStoreAsinSelected,a=r.isCBM,e.html(r.positiveRatingHtml),m.text(r.merchantName).prop("href",r.sellerReviewLink),f.html(r.price).className+="a-color-price",b.html(r.price).className+=
"a-color-price",a?(E.hide(),A.show(),C.hide(),u.show()):(A.hide(),E.show(),u.hide(),C.show()),c.objectIsEmpty(r.nextOfferPrice)||a?k.hide():(t.html(r.nextOfferPrice).className+="a-color-price",k.show()),q.hide(),l.hide(),p.removeClass("a-button-disabled").prop("disabled",!1),d.logRefTag(U),F("vas-si-atc-zipchange-offeravailable"),r.fulfillmentType&&(a=r.fulfillmentType,h&&h.length&&(D=h.find("."+a),D.length&&(h.find("."+w.selectedOfferFulfillmentType).addClass("vas-hidecomponent"),D.removeClass("vas-hidecomponent"),
w.selectedOfferFulfillmentType=a))),w.showSTSServiceInterstitial&&(J.show(),c.objectIsEmpty(r.merchantAddress)?x.hide():(x.text(r.merchantAddress.AddressLine1+", "+r.merchantAddress.City+", "+r.merchantAddress.StateOrRegion+" "+r.merchantAddress.PostalCode),x.show())));H=y},error:function(){H=y;S();d.createCSMNameAndLog(K.tenant,K.widget,"updateZipFail");F("vas-si-atc-zip-ajaxFail");B&&B.hide()}})}else H=D,N(),v.hide(),q.hide(),l.show();return!1},setZipCodeValuesFromDOM:function(){f=g("#vas-siatc-bestoffer-obm");
b=g("#vas-siatc-bestoffer-cbm");e=g("#vas-siatc-ratingandreview");k=g("#vas-si-atc-remainingoffers");l=g("#vas-siatc-invalidzip-message");n=g("#vas-siatc-nooffer-zip");q=g("#vas-siatc-offerunavailable-message");v=g("#vas-siatc-zip-ajaxfail-message");m=g("#vas-siatc-merchantname");t=g("#vas-si-atc-remainingoffer-price");p=g("#btnVasModalContinue");C=g("#vas-siatc-howitworks-obm");u=g("#vas-siatc-howitworks-cbm");A=g("#vas-siatc-cbm-gridrow");E=g("#vas-siatc-obm-gridrow");r=g("#vas-siatc-zip-input");
R=g("#vas-zipCodeValidationRegexString");w.showSTSServiceInterstitial&&(h=g("#sts-pdp-service-siatc-modal-content"),g("#vas-sts-zip-update-modal"),h&&h.length&&(J=h.find(".vas-si-merchant"),x=h.find(".vas-si-merchant-address")))},setWidgetMetaData:function(a){w=a;H=w.zipCode}}});"use strict";m.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(c,d,a,g,f,h,b){var e=c.$,
k,l,n=b.siMetricConstants.hitRecordConstants,q,v,m=b.siMetricConstants.additionalRequestDataKeys,t={addProductAndOpenSDPInNewTab:function(b,c){h.createRefMarkerAndLog(q.tenant,k.mappingSet,q.widget,h.RefmarkerActionTypes.redirect,k.hitParameters);h.createCSMNameAndLog(v.tenant,v.widget,h.CSMActionTypes.redirect);f.setHijackDismissalAttempt();f.logMetric(b);p.open("/dp/"+k.serviceAsin+"/ref\x3d"+c,"_blank");a.safeATCClick();return!1},triggerMetricsForPopoverShow:function(){f.logMetric("vas_si_show");
var a=l+"show_"+k.serviceAsin;k.showSIATC?(f.logMetric("vas_buyable_si_show"),a=l+k.zipCode+"_"+k.merchantId):f.logMetric("vas_normal_si_show");h.createCSMNameAndLog(v.tenant,v.widget,h.CSMActionTypes.glanceView);h.createRefMarkerAndLog(q.tenant,k.mappingSet,q.widget,h.RefmarkerActionTypes.glanceView,k.hitParameters);h.logRefTag(a);p.ue&&ue.trigger&&d.getSetting("widgetCommonVM").siRatingWeblabTreatment&&ue.trigger("DP_VAS_SI_RATING_235428",d.getSetting("widgetCommonVM").siRatingWeblabTreatment)},
triggerMetricsForPopoverhide:function(){f.setHijackDismissalAttempt();f.logMetric("vas_si_hide_click");h.createCSMNameAndLog(v.tenant,v.widget,h.CSMActionTypes.escape);var b=l+"x1_"+k.productAsin+"_"+k.serviceAsin;k.showSIATC&&(b=l+"no_"+k.productAsin+"_"+k.serviceAsin);h.logRefTag(b);h.createRefMarkerAndLog(q.tenant,k.mappingSet,q.widget,h.RefmarkerActionTypes.serviceNotIncluded,k.hitParameters);a.safeATCClick();return!1}};return{registerSIEventHandlers:function(){l="vas_si_";k.showSIATC&&(l="vas_sx_");
k.isMBCClick&&(l+="mbc_");if(k.showSIATC){var d=e("#vas-siatc-zip-input");g.setZipCodeValuesFromDOM();d.keyup(function(a){13===a.keyCode&&e("#vas-siatc-zip-update").click()});e(document).undelegate("#vas-siatc-zip-update","click.vas-siatc-zip-refresh");e(document).delegate("#vas-siatc-zip-update","click.vas-siatc-zip-refresh",function(a){g.vasSIZipCodeUpdate(b.siMetricConstants,k.hitParameters)});e(document).undelegate("#vas-si-moredetails","click.sdpredir");e(document).delegate("#vas-si-moredetails",
"click.sdpredir",function(a){t.addProductAndOpenSDPInNewTab("vas_siatc_see_more_details",l+"sm_"+k.productAsin+"_"+k.serviceAsin)})}e(document).undelegate("#btnVasModalSkip","click");e(document).delegate("#btnVasModalSkip","click",function(b){f.setHijackDismissalAttempt();f.logMetric("vas_si_skip_click");h.createCSMNameAndLog(v.tenant,v.widget,h.CSMActionTypes.skip);b=l+"x2_"+k.productAsin+"_"+k.serviceAsin;k.showSIATC&&(b=l+"no_"+k.productAsin+"_"+k.serviceAsin);h.logRefTag(b);h.createRefMarkerAndLog(q.tenant,
k.mappingSet,q.widget,h.RefmarkerActionTypes.serviceNotIncluded,k.hitParameters);a.safeATCClick();return!1});e(document).undelegate("#btnVasModalContinue","click.pdpVasNext");e(document).delegate("#btnVasModalContinue","click.pdpVasNext",function(b){f.setHijackDismissalAttempt();f.logMetric("vas_si_yes_click");b=l+"y1_"+k.productAsin+"_"+k.serviceAsin;var c,d;k.showSIATC?(b=l+"atc_"+k.productAsin+"_"+k.serviceAsin,c=h.CSMActionTypes.addToCart,d=h.RefmarkerActionTypes.addToCart):(c=h.CSMActionTypes.redirect,
d=h.RefmarkerActionTypes.redirect);h.createRefMarkerAndLog(q.tenant,k.mappingSet,q.widget,d,k.hitParameters);h.createCSMNameAndLog(v.tenant,v.widget,c);a.addServiceToCart(b);return!1});c.off("a:popover:hide:vasServiceInterstitial");c.on("a:popover:hide:vasServiceInterstitial",function(a){t.triggerMetricsForPopoverhide()});c.off("a:popover:afterShow:vasServiceInterstitial");c.on("a:popover:afterShow:vasServiceInterstitial",function(a){t.triggerMetricsForPopoverShow()});c.off("a:popover:hide:valueAddsInterstitial");
c.on("a:popover:hide:valueAddsInterstitial",function(a){t.triggerMetricsForPopoverhide()});c.off("a:popover:afterShow:valueAddsInterstitial");c.on("a:popover:afterShow:valueAddsInterstitial",function(a){t.triggerMetricsForPopoverShow()});e("#buyableSIAsinRatingLink").unbind("click");e("#buyableSIAsinRatingLink").bind("click",function(){f.logMetric("vas_sx_sdp_rating_redirect");h.createRefMarkerAndLog(q.tenant,k.mappingSet,q.widget,h.RefmarkerActionTypes.redirect,k.hitParameters);h.createCSMNameAndLog(v.tenant,
v.widget,h.CSMActionTypes.redirect)});e("#siAsinRatingLink").unbind("click");e("#siAsinRatingLink").bind("click",function(){f.logMetric("vas_si_sdp_rating_redirect");h.createRefMarkerAndLog(q.tenant,k.mappingSet,q.widget,h.RefmarkerActionTypes.redirect,k.hitParameters);h.createCSMNameAndLog(v.tenant,v.widget,h.CSMActionTypes.redirect)})},setWidgetMetaData:function(a){k=a;g.setWidgetMetaData(a);k.showSIATC?(q=b.siMetricConstants.bsi_prefixes.refmarkerPrefixes,v=b.siMetricConstants.bsi_prefixes.metricPrefixes):
(q=b.siMetricConstants.rsi_prefixes.refmarkerPrefixes,v=b.siMetricConstants.rsi_prefixes.metricPrefixes);q.tenant=k.showSTSServiceInterstitial||k.isParentServiceAsin?"sts":"vas";v.tenant=k.showSTSServiceInterstitial||k.isParentServiceAsin?"sts":"vas";a=k;var c={},d={};d[m.zipCode]=k.zipCode;d[m.isMBC]=k.isMBCClick?1:0;c[h.hitParameterKeys.upsellAsin]=k.serviceAsin;c[h.hitParameterKeys.productAsin]=k.productAsin;c[h.hitParameterKeys.merchantId]=k.merchantId;c[h.hitParameterKeys.pageType]=n.pageType;
c[h.hitParameterKeys.subPageType]=n.subPageType;c[h.hitParameterKeys.additionalRequestData]=d;a.hitParameters=c}}});"use strict";m.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"}}}});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher",
"vas-twister-config","vas-metric-utils","ready").register("vas-twister-setting",function(c,d,a,g,f){var h=c.$,b={baseAsinMetaData:{},isUpsellCritical:"",hasPrecheckEnabled:""},e=g.vasTwisterMetricConstants.refmarkerPrefixes,k=g.vasTwisterMetricConstants.additionalRequestDataKeys,l=g.vasTwisterMetricConstants.metricPrefixes;return{getSettings:function(a){return"undefined"!==typeof a?b[a]:b},fetchTwisterSetting:function(){var n=h("#ppdb-add-service-checkbox");n.is(":checked")&&n.prop("checked",!1);
var n=d.getSetting("winningWidgetVM"),q=n.winningServicePriceWithPromotionApplied;b.baseAsinMetaData.upsellAsin=n.upsellAsin;b.upsellAsin=n.serviceAsinToOffer;b.baseAsinMetaData.offerlistingId=n.offerListingID;b.baseAsinMetaData.merchantId=n.merchantId;b.baseAsinMetaData.price=n.winningServiceMinPrice;b.isUpsellCritical=n.isUpsellCritical;b.hasPrecheckEnabled=n.hasPrecheckEnabled;b.dynamicStringChangeOnTwisterSelection=n.dynamicStringChangeOnTwisterSelection;b.promotionMessagingWeblab="undefined"!==
typeof n.promotionMessagingWeblab?n.promotionMessagingWeblab:!1;b.isPromoPriceDisplayed=!c.objectIsEmpty(h.trim(q));b.productAsin=d.getSetting("widgetCommonVM").productAsin;b.zipCode=d.getSetting("widgetCommonVM").zipCode;b.buyboxPrice=d.getSetting("widgetCommonVM").buyboxPrice;b.mappingSet=d.getSetting("widgetCommonVM").mappingSet;b.sessionId=d.getSetting("widgetCommonVM").sessionId;b.vasTwisterMetricConstants=g.vasTwisterMetricConstants;b.hitParameters=f.createHitParameters(b.vasTwisterMetricConstants);
n=b.hitParameters[a.hitParameterKeys.additionalRequestData];n[k.isPromo]=b.isPromoPriceDisplayed;n[k.isCritical]=b.isUpsellCritical;b.hitParameters[a.hitParameterKeys.additionalRequestData]=n;var n=b.upsellAsin,q=b.productAsin,v=b.baseAsinMetaData.price,m=b.baseAsinMetaData.merchantId,t="vas_bdlppd_fake_twister_"+(!0===b.isUpsellCritical?"1":"0")+"_a_"+b.zipCode;a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(e.tenant,b.mappingSet,e.widget,a.RefmarkerActionTypes.glanceView,
b.hitParameters);a.metric("vas_bdlppd_fake_twister_");a.logRefTag(t,"LocalServicesWidget","Impression",n,"popUp",m,q,v,b.buyboxPrice)},logTwisterInteractionReftag:function(c){var d=b.isUpsellCritical,f=b.upsellAsin,g=b.productAsin,h=b.baseAsinMetaData.price,k=b.baseAsinMetaData.merchantId,m="vas_bdlppd_fake_twister_";b.isPromoPriceDisplayed&&(m="vas_bdplppd_fake_twister_promo_");a.logRefTag(m+(c?"y":"n")+"_"+(!0===d?"1":"0")+"_a","LocalServicesWidget","AddServiceCheck",f,"popUp",k,g,h);a.createCSMNameAndLog(l.tenant,
l.widget,c?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(e.tenant,b.mappingSet,e.widget,c?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,b.hitParameters)},logTwisterATCReftag:function(){var c=!0===b.isUpsellCritical?"1":"0",d="vas_bdlppd_fake_twister_atc_"+c,f=b.upsellAsin,g=b.productAsin,h=b.baseAsinMetaData.price,k=b.baseAsinMetaData.merchantId;b.isPromoPriceDisplayed&&(d="vas_bdlppd_fake_twister_atc_promo_"+c);a.createCSMNameAndLog(l.tenant,
l.widget,a.CSMActionTypes.addToCart);a.logRefTag(d,"LocalServicesWidget","CartAdd",f,"popUp",k,g,h,b.buyboxPrice);a.createRefMarkerAndLog(e.tenant,b.mappingSet,e.widget,a.RefmarkerActionTypes.addToCart,b.hitParameters);return!0},logTwisterExpanderReftagAndMetric:function(c){var d=b.upsellAsin,f=b.productAsin,g=b.baseAsinMetaData.merchantId,h=c?"vas_bdlppd_fake_twister_sm_click":"vas_bdlppd_fake_twister_sl_click";a.createCSMNameAndLog(l.tenant,l.widget,c?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints);
a.createRefMarkerAndLog(e.tenant,b.mappingSet,e.widget,c?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints,b.hitParameters);a.increaseMetricBy(h,1);a.logRefTag(h,"LocalServicesWidget","SeeMoreClick",d,"popUp",g,f)},logTwisterSDPRedirectReftagAndMetric:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(e.tenant,b.mappingSet,e.widget,a.RefmarkerActionTypes.redirect,b.hitParameters)}}});"use strict";m.when("A","vas-twister-setting",
"vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-twister-controller",function(c,d,a,g){var f=c.$,h=f("body"),b=!1,e=function(){d.logTwisterATCReftag()},k=function(){f("#ppdb-add-service-checkbox").prop("checked",!0);var b=d.getSettings("baseAsinMetaData");try{c.trigger("vas:add-service-asin-buybox-event",b),f("#addToCart").unbind("submit.ppdBundles"),f("#addToCart").bind("submit.ppdBundles",e),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",
0)}catch(g){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(g)}f("#vas-fake-twister-include-section").find("i").hasClass("a-icon-extender-collapse")||f("#vas-fake-twister-include-section").click();d.getSettings("isPromoPriceDisplayed")&&d.getSettings("promotionMessagingWeblab")&&(f("#vasTwisterSelectedPromotionMessage").removeClass("aok-hidden"),f("#vasTwisterNotSelectedPromotionMessage").addClass("aok-hidden"));c.trigger("vas:add-widget-state-url",
{preSelectedWidgetValue:d.getSettings("baseAsinMetaData").upsellAsin})},l=function(a){d.getSettings("dynamicStringChangeOnTwisterSelection")&&f("#vas-service-title-text").html(a.attr("data-title"))},n={vasTwisterTrigger:function(b){f(".vas-ppd-swatch-item").removeClass("vas-ppd-swatch-select");b.addClass("vas-ppd-swatch-select");l(b);if("removeOffer"===b.attr("data-twister-action")){f("#ppdb-add-service-checkbox").prop("checked",!1);try{c.trigger("vas:remove-service-asin-buybox-event"),f("#addToCart").unbind("submit.ppdBundles"),
a.increaseMetricBy("a2cFormRemoveEventSend_fail",0),a.metric("a2cFormRemoveEventSend_success"),c.trigger("vas:remove-widget-state-url")}catch(e){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(e)}d.getSettings("isPromoPriceDisplayed")&&d.getSettings("promotionMessagingWeblab")&&(f("#vasTwisterSelectedPromotionMessage").addClass("aok-hidden"),f("#vasTwisterNotSelectedPromotionMessage").removeClass("aok-hidden"));d.logTwisterInteractionReftag(!1)}else k(),
d.logTwisterInteractionReftag(!0)},vasTwisterExpander:function(){f("#vas-fake-twister-include-section").find("i").hasClass("a-icon-extender-collapse")?d.logTwisterExpanderReftagAndMetric(!1):d.logTwisterExpanderReftagAndMetric(!0)}},m=function(){f("#vas-fake-twister-include-section").unbind("click");f("#vas-fake-twister-include-section").bind("click",function(a){n.vasTwisterExpander()});f("#vas-fake-twiseter-detailLink").unbind("click");f("#vas-fake-twiseter-detailLink").bind("click",function(a){d.logTwisterSDPRedirectReftagAndMetric()})},
v=function(){b||(h.undelegate(".vas-ppd-swatch-item","click"),h.delegate(".vas-ppd-swatch-item","click",function(a){a=f(a.currentTarget);a.hasClass("vas-ppd-swatch-select")||n.vasTwisterTrigger(a)}),b=!0)},z=function(){c.off("vas:ldbb-a2c-event:desktop");c.on("vas:ldbb-a2c-event:desktop",function(a){if(f("#ppdb-add-service-checkbox").is(":checked")){var b=d.getSettings("baseAsinMetaData");g.addUpsell(b.upsellAsin,b.offerlistingId,a)}});c.off("vas:ldbb-upsell-added:desktop");c.on("vas:ldbb-upsell-added:desktop",
function(){d.logTwisterATCReftag()})};c.off("vas:widgetname:twister");c.on("vas:widgetname:twister",function(){f("#vas-service-title-text");v();d.fetchTwisterSetting();d.getSettings("hasPrecheckEnabled")&&(k(),l(f(".vas-ppd-swatch-select")));m();z();f("#vasTwisterRow").removeClass("vas-twister-disabled")})});"use strict";m.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"}}}});"use strict";m.when("A","vas-metrics-publisher","ready").register("vas-twister-page-refresh-common",function(c,d){function a(a){a=document.getElementById(a);var b=[];if(null===a||a===u)return b;a=a.getElementsByTagName("SCRIPT");c.each(a,function(a){b.push(a.innerHTML)});return b}function g(a,b){c.each(b,function(b){var c=document.createElement("script");c.type="text/javascript";c.text=b;b=document.getElementById(a);
null!==b&&b!==u&&b.appendChild(c)})}var f=c.$,h=null,b=function(b){try{var e=b.pageRefreshData,h=[];c.each(b.featuresWithScriptTags,function(b){h.push(a(b))});b.featuresToRefresh.forEach(function(a){f(a).replaceWith(f(e).find(a).prop("outerHTML"))});c.each(b.featuresWithScriptTags,function(a,b){g(a,h[b])});c.trigger("vas:vas-twister-page-refresh-complete",b);d.increaseMetricBy("vasTwisterUpdateFeatures_success",1);d.increaseMetricBy("vasTwisterUpdateFeatures_fail",0);c.loadImageManually(c.$(".icon-box"));
c.trigger("a:pageUpdate")}catch(m){c.trigger("vas:vas-twister-update-features-failed",b),d.increaseMetricBy("vasTwisterUpdateFeatures_success",0),d.increaseMetricBy("vasTwisterUpdateFeatures_fail",1),d.log(m)}},e=function(a){c.trigger("vas:vas-twister-page-refresh-start",a);null!==h&&h.abort();h=c.ajax(a.ajaxUrl,{method:"GET",timeout:"90000",params:{isVariationalParent:a.isVariationalParent},success:function(c){a.pageRefreshData=c;b(a);d.increaseMetricBy("vasTwisterPageRefresh_success",1);d.increaseMetricBy("vasTwisterPageRefresh_fail",
0)},error:function(){c.trigger("vas:vas-twister-page-refresh-failed",a);d.increaseMetricBy("vasTwisterPageRefresh_success",0);d.increaseMetricBy("vasTwisterPageRefresh_fail",1)}})};return{performPageRefresh:function(a){"undefined"===typeof a.pageRefreshData?e(a):b(a)},abortPageRefreshRequests:function(){null!==h&&h.abort()},restoreInitialData:function(a){try{var b=a.pageRefreshData;c.each(a.featuresToRefresh,function(a){"undefined"!==typeof b[a]&&f(a).replaceWith(b[a])});d.increaseMetricBy("vasTwisterRestoreInitialData_success",
1);d.increaseMetricBy("vasTwisterRestoreInitialData_fail",0);c.trigger("vas:vas-twister-initialdata-restore-complete")}catch(e){d.increaseMetricBy("vasTwisterRestoreInitialData_success",0),d.increaseMetricBy("vasTwisterRestoreInitialData_fail",1),d.log(e)}}}});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher","vas-twister-xl-config","vas-metric-utils","pre-check-disabled","ready").register("vas-twister-xl-setting",function(c,d,a,g,f,h){var b=c.$,e={vasTwisterOptions:{},baseAsinMetaData:{},
productAsinAndOfferData:{},productPriceInTwisterVariation:{}},k=g.vasTwisterXLMetricConstants.refmarkerPrefixes,l=g.vasTwisterXLMetricConstants.metricPrefixes,n=function(){var b=e.productAsinAndOfferData.asin,d=e.productAsinAndOfferData.merchantId,f="vas_bdlppd_fake_twister_a_"+e.productAsinAndOfferData.zipCode;a.metric("vas_bdlppd_vas_twister_");a.logRefTag(f,"LocalServicesWidget","Impression","","popUp",d,b,"","");a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);c.each(e.vasTwisterOptions,
function(b,c){var d=a.RefmarkerActionTypes.glanceView;b.isOfferAvailable||(d=a.RefmarkerActionTypes.glanceViewDisabled);e.hitParameters[a.hitParameterKeys.upsellAsin]=c;a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,d,e.hitParameters)})},m=function(){try{var c=e.productAsinAndOfferData.asin,d=b("li[data-defaultasin\x3d"+c+"] .a-size-mini");d.length&&e.productPriceInTwisterVariation[c]===u&&(e.productPriceInTwisterVariation[c]=d.text());a.increaseMetricBy("saveInitialProductPriceContent_fail",
0);a.metric("saveInitialProductPriceContent_success",1)}catch(f){a.createCSMNameAndLog(l.tenant,l.widget,"saveInitialProductError"),a.increaseMetricBy("saveInitialProductPriceContent_success",0),a.metric("saveInitialProductPriceContent_fail",1),a.log(f)}};return{getProductAsinAndOfferData:function(a){return"undefined"!==typeof a?e.productAsinAndOfferData[a]:e.productAsinAndOfferData},getSettings:function(a){if("undefined"!==typeof a){a=e.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 e.hasPrecheckEnabled},getVasTwisterOption:function(a){if("undefined"!==typeof a)return e.vasTwisterOptions[a]},getInitialProductPriceContent:function(){return e.productPriceInTwisterVariation},setInitialWidgetSettings:function(){b("#ppdb-add-service-checkbox").is(":checked")&&b("#ppdb-add-service-checkbox").prop("checked",!1);var a=d.getSetting("winningWidgetVM"),
k=a.vasTwisterOptions;e.productAsinAndOfferData=a.vasUpsellProductAsinAndOfferData;e.mappingSet=d.getSetting("widgetCommonVM").mappingSet;e.buyboxPrice=d.getSetting("widgetCommonVM").buyboxPrice;c.each(k,function(a,b){e.vasTwisterOptions[b]=a});e.vasTwisterXLMetricConstants=g.vasTwisterXLMetricConstants;e.hitParameters=f.createHitParameters(e.vasTwisterXLMetricConstants);e.hasPrecheckEnabled=!0===h.isDisabled?!1:a.hasPrecheckEnabled;m();n()},logVasTwisterInteractionReftag:function(b,c){b&&(b=e.vasTwisterOptions[c].offerData.price,
a.logRefTag("vas_bdlppd_vas_twister_a","LocalServicesWidget","AddServiceCheck",c,"popUp",e.vasTwisterOptions[c].offerData.merchantId,e.productAsinAndOfferData.asin,b),e.hitParameters[a.hitParameterKeys.upsellAsin]=c,e.hitParameters[a.hitParameterKeys.upsellAsinPrice]=b);c=a.CSMActionTypes.serviceIncluded;a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,a.RefmarkerActionTypes.serviceIncluded,e.hitParameters);a.createCSMNameAndLog(l.tenant,l.widget,c)},logVasTwistetATCReftag:function(b){a.createCSMNameAndLog(l.tenant,
l.widget,a.CSMActionTypes.addToCart);var c=e.productAsinAndOfferData.asin,f=e.vasTwisterOptions[b].offerData.price,g=e.vasTwisterOptions[b].offerData.merchantId,h="";d.getSetting("widgetCommonVM")&&(h=d.getSetting("widgetCommonVM").buyboxPrice||"");e.hitParameters[a.hitParameterKeys.upsellAsin]=b;e.hitParameters[a.hitParameterKeys.upsellAsinPrice]=f;a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,a.RefmarkerActionTypes.addToCart,e.hitParameters);a.logRefTag("vas_bdlppd_vas_twister_atc_","LocalServicesWidget",
"CartAdd",b,"popUp",g,c,f,h);return!0},logTwisterExpanderReftagAndMetric:function(b,c){var d=e.vasTwisterOptions[c].offerData.price;a.createCSMNameAndLog(l.tenant,l.widget,b?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints);e.hitParameters[a.hitParameterKeys.upsellAsin]=c;e.hitParameters[a.hitParameterKeys.upsellAsinPrice]=d;a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,b?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints,e.hitParameters)},
getVasTwisterXLMetricConstants:function(){return e.vasTwisterXLMetricConstants},getHitParameters:function(){return e.hitParameters},isMultiQuantityPurchaseEnabled:function(){return d.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled},isBusinessCustomer:function(){return d.getSetting("widgetCommonVM").businessCustomer}}});"use strict";m.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(c,d,a,g,f){var h=c.$,b={},e={},k=function(a){a.pageRefreshData=b;d.restoreInitialData(a);n("1.0",a.featuresToRefresh)},l=function(){var a=g.getProductAsinAndOfferData().asin,b=h("#twister_feature_div"),c=h("li[data-defaultasin\x3d"+a+"]"),a=h("li[data-defaultasin\x3d"+a+"] .a-size-mini"),d=h("#priceblock_ourprice"),e=h("#priceblock_saleprice");0>=b.length||0>=c.length||0>=a.length||(d.length?a.text(d.text()):e.length?a.text(e.text()):a.text(""))},n=function(a,b){c.each(b,function(b,c){h(b).css("opacity",
a)})},m=function(){try{var b=g.getInitialProductPriceContent();c.each(b,function(a,b){b=h("li[data-defaultasin\x3d"+b+"] .a-size-mini");b.length&&b.text(a)});a.increaseMetricBy("restoreInitialPriceInProductTwister_fail",0);a.metric("restoreInitialPriceInProductTwister_success",1)}catch(d){a.increaseMetricBy("restoreInitialPriceInProductTwister_success",0),a.metric("restoreInitialPriceInProductTwister_fail",1),a.log(d)}};c.off("vas:vas-twister-page-refresh-start");c.on("vas:vas-twister-page-refresh-start",
function(a){n("0.5",a.featuresToRefresh);h("#vasTwisterRow").addClass("vas-twister-disabled")});c.off("vas:vas-twister-page-refresh-complete");c.on("vas:vas-twister-page-refresh-complete",function(a){e[a.baseOfferMerchantId+a.asin]=a.pageRefreshData;l();n("1.0",a.featuresToRefresh);h("#vasTwisterRow").removeClass("vas-twister-disabled");c.trigger("vas:twister-update-widgets","hide");c.trigger("vas:add-asin-offer-data-to-cart",a.svcAsin)});c.off("vas:vas-twister-page-refresh-failed");c.on("vas:vas-twister-page-refresh-failed",
function(a){n("1.0",a.featuresToRefresh);h("#vasTwisterRow").removeClass("vas-twister-disabled")});c.off("vas:vas-twister-update-features-failed");c.on("vas:vas-twister-update-features-failed",function(a){k(a.featuresToRefresh);n("1.0",a.featuresToRefresh)});c.off("vas:vas-twister-initialdata-restore-complete");c.on("vas:vas-twister-initialdata-restore-complete",function(){m();c.trigger("vas:remove-asin-offer-data-to-cart");c.trigger("vas:twister-update-widgets","show")});c.off("vas:twister-update-widgets");
c.on("vas:twister-update-widgets",function(a){var b=h("#dpFastTrack_feature_div"),c=h("#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){c.each(a,function(a,c){b[a]=h(a).prop("outerHTML")});c.trigger("vas:twister-update-widgets","show")},performPageRefresh:function(a){a.ajaxUrl=f.getAjaxUrl(a.asin,a.baseOfferMerchantId);a.pageRefreshData=e[a.baseOfferMerchantId+a.asin];a.featuresWithScriptTags=
f.getFeaturesWithScriptTags();d.performPageRefresh(a)},abortPageRefreshRequests:function(){d.abortPageRefreshRequests()},restoreInitialPriceInProductTwister:m,restoreInitialData:k,updatePriceInProductTwisterDesktop:l,hideOfferUpdateWidget:function(){h("#vas-twister-price-update-div").hide()},showOfferUpdateWidget:function(){h("#vas-twister-price-update-div").show()}}});"use strict";m.when("A","vas-twister-xl-setting","vas-detailpage-util","ready").register("vas-twister-xl-util",function(c,d,a){function g(){return d.isBusinessCustomer()&&
d.isMultiQuantityPurchaseEnabled()}function f(){return"{%27disableFreeFormQtyPicker%27:true}"}return{isRefreshRequired:function(c,b){return d.isBusinessCustomer()?c!==b||d.isMultiQuantityPurchaseEnabled()&&!d.hasPrecheckEnabled():a.isMobbPresent()||c!==b},getAjaxUrl:function(a,b){a="/gp/product/"+a+"?m\x3d"+b;return g()?a+"\x26vas\x3d"+f():a},getFeaturesWithScriptTags:function(){return d.isMultiQuantityPurchaseEnabled()&&!d.isBusinessCustomer()?["soldByThirdParty_feature_div","quantityLayoutHigh_feature_div"]:
[]},disableQuantityRefresh:g,getQueryParamValueToDisableQuantityRefresh:f}});"use strict";m.when("A","vas-twister-xl-setting","vas-twister-page-refresh-webView","vas-metrics-publisher","vas-twister-xl-util","vas-detailpage-util","ready").execute("vas-twister-xl-controller",function(c,d,a,g,f,h){var b=c.$,e="#iconfarmv2_feature_div #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 #apex_desktop".split(" "),
k=!1,l="",n="",m=function(){d.logVasTwistetATCReftag(n)},p=function(){try{c.trigger("vas:remove-service-asin-buybox-event"),b("#addToCart").unbind("submit.ppdBundles"),g.increaseMetricBy("a2cFormRemoveEventSend_fail",0),g.metric("a2cFormRemoveEventSend_success")}catch(a){g.increaseMetricBy("a2cFormRemoveEventSend_success",0),g.metric("a2cFormRemoveEventSend_fail"),g.log(a)}},r=function(a){try{c.trigger("vas:add-service-asin-buybox-event",a),b("#addToCart").bind("submit.ppdBundles",m),g.increaseMetricBy("a2cFormAddEventSend_success",
1),g.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(d){g.increaseMetricBy("a2cFormAddEventSend_success",0),g.increaseMetricBy("a2cFormAddEventSend_fail",1),g.log(d)}},t={vasTwisterExpander:function(a,c){b("#vas-fake-twister-includesection-"+a.attr("data-twister-svcAsin")).find("i").hasClass("a-icon-extender-collapse")?d.logTwisterExpanderReftagAndMetric(!1,c):d.logTwisterExpanderReftagAndMetric(!0,c)},ppdFakeTwisterTrigger:function(g){var h=g.attr("data-twister-svcAsin"),m={};if("undefined"===
typeof h||d.getVasTwisterOption(h).isOfferAvailable)if(b(".vas-ppd-swatch-item").removeClass("vas-ppd-swatch-select"),g.addClass("vas-ppd-swatch-select"),b(".vas-twister-whatsincluded").hide(),b("#vas-twister-title").html(g.attr("data-twister-callToAction")),"removeOffer"===g.attr("data-twister-action"))a.abortPageRefreshRequests(),b("#ppdb-add-service-checkbox").prop("checked",!1),n="undefined",f.isRefreshRequired(l,d.getProductAsinAndOfferData("merchantId"))?(m.featuresToRefresh=e,a.restoreInitialData(m),
l=d.getProductAsinAndOfferData("merchantId"),a.showOfferUpdateWidget()):a.hideOfferUpdateWidget(),p(),d.logVasTwisterInteractionReftag(!1,"ItemOnly"),c.trigger("vas:twister-update-widgets","show");else{!1===k&&(a.setInitialFeaturesData(e),k=!0);b("#ppdb-add-service-checkbox").prop("checked",!0);p();b("#vas-fake-twister-whatsincluded-"+g.attr("data-twister-svcAsin")).show();b("#vas-fake-twister-includesection-"+g.attr("data-twister-svcAsin")).find("i").hasClass("a-icon-extender-collapse")||(b("#vas-fake-twister-includesection-"+
g.attr("data-twister-svcAsin")).unbind("click"),b("#vas-fake-twister-includesection-"+g.attr("data-twister-svcAsin")).bind("click",function(a){t.vasTwisterExpander(g,h)}),b("#vas-fake-twister-includesection-"+g.attr("data-twister-svcAsin")).click());n=h;var q=d.getVasTwisterOption(h).baseOfferMerchantId;f.isRefreshRequired(l,q)?(m.asin=d.getProductAsinAndOfferData("asin"),m.svcAsin=h,m.merchantId=d.getVasTwisterOption(h).offerData.merchantId,m.isVariationalParent=!1,m.featuresToRefresh=e,m.baseOfferMerchantId=
q,a.performPageRefresh(m),l=q,a.showOfferUpdateWidget()):(c.trigger("vas:twister-update-widgets","hide"),r(d.getSettings(g.attr("data-twister-svcAsin"))),a.hideOfferUpdateWidget());d.logVasTwisterInteractionReftag(!0,h)}}};c.off("vas:add-asin-offer-data-to-cart");c.on("vas:add-asin-offer-data-to-cart",function(a){r(d.getSettings(a))});c.off("vas:remove-asin-offer-data-to-cart");c.on("vas:remove-asin-offer-data-to-cart",function(){p()});var u=function(){b(".vas-ppd-swatch-item").unbind("click");b(".vas-ppd-swatch-item").bind("click",
function(a){a=b(a.currentTarget);a.hasClass("vas-ppd-swatch-select")||t.ppdFakeTwisterTrigger(a)})};c.off("vas:widgetname:twister_xl");c.on("vas:widgetname:twister_xl",function(){d.setInitialWidgetSettings();u();l=d.getProductAsinAndOfferData("merchantId");a.restoreInitialPriceInProductTwister();if(d.hasPrecheckEnabled()&&!h.isMobbPresent()){a.hideOfferUpdateWidget();var c=b(".vas-ppd-swatch-select");t.ppdFakeTwisterTrigger(c)}b("#vasTwisterRow").removeClass("vas-twister-disabled")})});"use strict";
m.register("vas-enhanceppd-config",function(){return{enhancedPPDMetricConstants:{refmarkerPrefixes:{tenant:"vas",widget:"eppdb",mandatory_widget:"mandatory_eppdb"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",isCritical:"crtcl"},metricPrefixes:{tenant:"vas",widget:"eppdb",mandatory_widget:"mandatory_eppdb"}}}});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher","vas-utilities","vas-enhanceppd-config","vas-metric-utils",
"ready").register("vas-enhanceppd-setting",function(c,d,a,g,f,h){var b={enhancePpdViewModel:{}},e=f.enhancedPPDMetricConstants.refmarkerPrefixes,k=f.enhancedPPDMetricConstants.metricPrefixes;return{getSettings:function(a){return b.hasOwnProperty(a)?b[a]:b},setSettings:function(a,c,d){a&&d?b[a][d]=c:a&&(b[a]=c)},fetchEnhancePpdSetting:function(){b.enhancePpdViewModel=d.getSetting("winningWidgetVM");b.productAsin=d.getSetting("widgetCommonVM").productAsin;b.zipCode=d.getSetting("widgetCommonVM").zipCode;
b.buyboxPrice=d.getSetting("widgetCommonVM").buyboxPrice;b.isEnhanceUpsellPresence="undefined"===typeof b.enhancePpdViewModel.upsellAsinOfferData?!1:!0;b.sessionId=d.getSetting("widgetCommonVM").sessionId;b.mappingSet=d.getSetting("widgetCommonVM").mappingSet;b.enhancedPPDMetricConstants=f.enhancedPPDMetricConstants;b.hitParameters=h.createHitParameters(f.enhancedPPDMetricConstants);var c,g=b.enhancePpdViewModel.baseAsinOfferData.isMandatory,m=!0===b.enhancePpdViewModel.isUpsellCritical?"1":"0",p=
b.enhancePpdViewModel.baseAsinOfferData.upsellAsin,r=b.enhancePpdViewModel.productAsin,t=b.enhancePpdViewModel.winningServiceMinPrice,u=b.enhancePpdViewModel.baseAsinOfferData.merchantId,C=b.buyboxPrice,A=b.zipCode;c=(!1===b.isEnhanceUpsellPresence?"vas_bdlppd_enh_":"vas_bdlppd_enh_upsell_")+m+"_a_"+A;a.logRefTag("vas_bdlppd_ld_"+m+"_a_"+A,"LocalServicesWidget","Impression",p,"popUp",u,r,t,C);a.logRefTag(c,"LocalServicesWidget","Impression",p,"popUp",u,r,t,C);c=b.isEnhanceUpsellPresence?"uppdb":g?
k.mandatory_widget:k.widget;a.createCSMNameAndLog(k.tenant,c,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(e.tenant,b.mappingSet,c,a.RefmarkerActionTypes.glanceView,b.hitParameters)},logPPDBundlesExpander:function(c,d){a.increaseMetricBy(!1===b.isEnhanceUpsellPresence?"vas_ppd_bdl_sm_clicks":"vas_ppd_bdl_sm_upg_clicks",1);a.createRefMarkerAndLog(e.tenant,b.mappingSet,d?e.mandatory_widget:e.widget,c?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints,b.hitParameters);a.createCSMNameAndLog(k.tenant,
d?k.mandatory_widget:k.widget,c?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints)},logPPDBundlesATCReftag:function(c){a.createCSMNameAndLog(k.tenant,c?k.mandatory_widget:k.widget,a.CSMActionTypes.addToCart);a.createRefMarkerAndLog(e.tenant,b.mappingSet,c?e.mandatory_widget:e.widget,a.RefmarkerActionTypes.addToCart,b.hitParameters)},logCheckboxInteractionReftag:function(c){a.logRefTag("vas_bdlppd_"+c+"_"+b.ppdBundlesInteractionSlice+"_"+(!0===b.enhancePpdViewModel.isUpsellCritical?
"1":"0")+"_a","LocalServicesWidget","AddServiceCheck",b.enhancePpdViewModel.baseAsinOfferData.upsellAsin,"popUp",b.enhancePpdViewModel.baseAsinOfferData.merchantId,b.enhancePpdViewModel.productAsin,b.enhancePpdViewModel.winningServiceMinPrice);a.createCSMNameAndLog(k.tenant,k.widget,"y"===c?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(e.tenant,b.mappingSet,e.widget,"y"===c?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,
b.hitParameters)},logBuyBackReftagHandler:function(c){var d=b.enhancePpdViewModel.baseAsinOfferData.upsellAsin,f=b.enhancePpdViewModel.productAsin;a.logRefTag("vas_bbk_"+f+"_"+d,"LocalServicesWidget","CartAdd",d,"popUp",b.enhancePpdViewModel.baseAsinOfferData.merchantId,f,b.enhancePpdViewModel.winningServiceMinPrice);a.createCSMNameAndLog(k.tenant,c?k.mandatory_widget:k.widget,a.CSMActionTypes.buyBack);a.createRefMarkerAndLog(e.tenant,b.mappingSet,c?e.mandatory_widget:e.widget,a.RefmarkerActionTypes.buyBack,
b.hitParameters);return!0},logPPDBundlesBuyNowReftag:function(c){a.createCSMNameAndLog(k.tenant,c?k.mandatory_widget:k.widget,a.CSMActionTypes.buyNow);a.createRefMarkerAndLog(e.tenant,b.mappingSet,c?e.mandatory_widget:e.widget,a.RefmarkerActionTypes.buyNow,b.hitParameters)}}});"use strict";m.when("A","vas-enhanceppd-setting","vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-enhanceppd-controller",function(c,d,a,g){var f=c.$,h=!1,b=function(){d.logPPDBundlesATCReftag(h)},e=function(){d.logPPDBundlesBuyNowReftag(h)},
k=function(){d.logBuyBackReftagHandler(h)},l=function(){try{c.trigger("vas:remove-service-asin-buybox-event"),f("#add-to-cart-button").unbind("click.ppdBundles"),f("#buy-now-button").unbind("click.ppdBundles"),f("#buyBackBuyNow").length&&f(document.body).undelegate("#buyBackBuyNow","submit.vasBuyBackReftag"),a.increaseMetricBy(h?"mandatory_eppdb_a2cFormRemoveEventSend_fail":"a2cFormRemoveEventSend_fail",0),a.metric(h?"mandatory_eppdb_a2cFormRemoveEventSend_success":"a2cFormRemoveEventSend_success")}catch(b){a.increaseMetricBy(h?
"mandatory_eppdb_a2cFormRemoveEventSend_success":"a2cFormRemoveEventSend_success",0),a.metric(h?"mandatory_eppdb_a2cFormRemoveEventSend_fail":"a2cFormRemoveEventSend_fail"),a.log(b)}},m=function(d){try{c.trigger("vas:add-service-asin-buybox-event",d),f("#add-to-cart-button").bind("click.ppdBundles",b),f("#buy-now-button").bind("click.ppdBundles",e),c.trigger("vas:add-service-asin-buyback-form-event",d),f(document.body).delegate("#buyBackBuyNow","submit.vasBuyBackReftag",k),a.increaseMetricBy(h?"mandatory_eppdb_a2cFormAddEventSend_success":
"a2cFormAddEventSend_success",1),a.increaseMetricBy(h?"mandatory_eppdb_a2cFormAddEventSend_fail":"a2cFormAddEventSend_fail",0)}catch(g){a.increaseMetricBy(h?"mandatory_eppdb_a2cFormAddEventSend_success":"a2cFormAddEventSend_success",0),a.increaseMetricBy(h?"mandatory_eppdb_a2cFormAddEventSend_fail":"a2cFormAddEventSend_fail",1),a.log(g)}},q={ppdBundlesCheckBoxHandler:function(){var a,b=f("#ppdBundlesEnhancedWrapper"),c=f("#ppdBundlesEnhancedBox");f("#ppdb-add-service-checkbox").is(":checked")?(a=
"y",l(),d.getSettings("isEnhanceUpsellPresence")&&f("#ppdb-upsell-service-checkbox").is(":checked")?m(d.getSettings("enhancePpdViewModel").upsellAsinOfferData):m(d.getSettings("enhancePpdViewModel").baseAsinOfferData),b.addClass("ppdBundlesOrangeBorder").removeClass("ppdBundlesGrayBorder"),c.addClass("ppdBundlesOrangeBox"),null===d.getSettings("ppdBundlesInteractionSlice")&&d.setSettings("ppdBundlesInteractionSlice",1),f("#ppdBundlesExpanderContent").is(":visible")||f("#ppdBundlesExpanderHeadingLink").click()):
(a="n",b.addClass("ppdBundlesGrayBorder").removeClass("ppdBundlesOrangeBorder"),c.removeClass("ppdBundlesOrangeBox"),d.getSettings("isEnhanceUpsellPresence")&&f("#ppdb-upsell-service-checkbox").is(":checked")&&f("#ppdb-upsell-service-checkbox").click(),l());d.logCheckboxInteractionReftag(a);d.setSettings("ppdBundlesInteractionSlice",1)},ppdBundlesUpsellCheckBoxHandler:function(){var a;f("#ppdb-upsell-service-checkbox").is(":checked")?(f("#ppdb-add-service-checkbox").is(":checked")?(l(),m(d.getSettings("enhancePpdViewModel").upsellAsinOfferData)):
f("#ppdb-add-service-checkbox").click(),a="y"):(l(),m(d.getSettings("enhancePpdViewModel").baseAsinOfferData),a="n");d.logCheckboxInteractionReftag(a)}},p=function(){c.off("a:expander:ppdBundlesExpander:toggle:expand");c.on("a:expander:ppdBundlesExpander:toggle:expand",function(a){d.logPPDBundlesExpander(!0,h)});c.off("a:expander:ppdBundlesExpander:toggle:collapse");c.on("a:expander:ppdBundlesExpander:toggle:collapse",function(a){d.logPPDBundlesExpander(!1,h)});f("#ppdb-add-service-checkbox").unbind("change");
f("#ppdb-add-service-checkbox").bind("change",function(){q.ppdBundlesCheckBoxHandler()});d.getSettings("isEnhanceUpsellPresence")&&(f("#ppdb-upsell-service-checkbox").unbind("change"),f("#ppdb-upsell-service-checkbox").bind("change",function(){q.ppdBundlesUpsellCheckBoxHandler()}))},r=function(){c.off("vas:ldbb-a2c-event:desktop");c.on("vas:ldbb-a2c-event:desktop",function(a){if(f("#ppdb-add-service-checkbox").is(":checked")){var b;b=d.getSettings("isEnhanceUpsellPresence")&&f("#ppdb-upsell-service-checkbox").is(":checked")?
d.getSettings("enhancePpdViewModel").upsellAsinOfferData:d.getSettings("enhancePpdViewModel").baseAsinOfferData;g.addUpsell(b.upsellAsin,b.offerlistingId,a)}});c.off("vas:ldbb-upsell-added:desktop");c.on("vas:ldbb-upsell-added:desktop",function(){b()})};c.off("vas:widgetname:enhancedPPD");c.on("vas:widgetname:enhancedPPD",function(){d.fetchEnhancePpdSetting();h=d.getSettings("enhancePpdViewModel").baseAsinOfferData.isMandatory;p();r();h?(l(),m(d.getSettings("enhancePpdViewModel").baseAsinOfferData)):
f("#ppdb-add-service-checkbox").is(":checked")?(l(),f("#ppdBundlesEnhancedWrapper").addClass("ppdBundlesOrangeBorder").removeClass("ppdBundlesGrayBorder"),f("#ppdBundlesEnhancedBox").addClass("ppdBundlesOrangeBox"),d.getSettings("isEnhanceUpsellPresence")&&f("#ppdb-upsell-service-checkbox").is(":checked")?m(d.getSettings("enhancePpdViewModel").upsellAsinOfferData):m(d.getSettings("enhancePpdViewModel").baseAsinOfferData)):(f("#ppdBundlesEnhancedWrapper").addClass("ppdBundlesGrayBorder").removeClass("ppdBundlesOrangeBorder"),
f("#ppdBundlesEnhancedBox").removeClass("ppdBundlesOrangeBox"));f("#ppdBundlesEnhancedContent").removeClass("ppd-bundles-disabled")})});"use strict";m.when("ready").register("vas-service-capabilities-constants",function(){return{CLICK_EVENT:"click",SERVICE_CAPABILITIES_WIDGET_NAME:"serviceCapabilities",SERVICE_CAPABILITIES_IMAGE_ID:"service-capabilities-image"}});"use strict";m.when("A","vas-service-capabilities-constants","vas-metrics-publisher","vas-widget-const","ready").register("vas-service-capabilities-controller",
function(c,d,a,g){var f=c.$,h=g.COMMON.DOM.SERVICE_CAPABILITIES_SLOT,b=d.SERVICE_CAPABILITIES_WIDGET_NAME,e=function(){var d;c.each(f("#"+h).find("[data-a-state]"),function(e,g){d=c.parseJSON(f(e).attr("data-a-state")).key;"vas-service-capabilities-model"===d&&a.logCSMCounter(["vas",b,a.RefmarkerActionTypes.glanceView].join("_"))})};g=function(){e();f("#"+d.SERVICE_CAPABILITIES_IMAGE_ID).unbind(d.CLICK_EVENT);f("#"+d.SERVICE_CAPABILITIES_IMAGE_ID).bind(d.CLICK_EVENT,function(){a.logCSMCounter(["vas",
b,d.CLICK_EVENT].join("_"))})};g();return{initialize:g}});"use strict";m.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"}}}});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher","vas-utilities","vas-ppdbundle-config","vas-metric-utils",
"ready").register("vas-ppdbundle-setting",function(c,d,a,g,f,h){var b=c.$,e={ppdBundleViewModel:{}},k=f.ppdBundlesMetricConstants.refmarkerPrefixes,l=f.ppdBundlesMetricConstants.metricPrefixes;return{getSettings:function(a){return e.hasOwnProperty(a)?e[a]:e},setSettings:function(a,b,c){a&&c?e[a][c]=b:a&&(e[a]=b)},fetchPpdBundleSetting:function(){e.ppdBundleViewModel=d.getSetting("winningWidgetVM");e.productAsin=d.getSetting("widgetCommonVM").productAsin;e.zipCode=d.getSetting("widgetCommonVM").zipCode;
e.buyboxPrice=d.getSetting("widgetCommonVM").buyboxPrice;e.sessionId=d.getSetting("widgetCommonVM").sessionId;e.mappingSet=d.getSetting("widgetCommonVM").mappingSet;e.ppdBundlesMetricConstants=f.ppdBundlesMetricConstants;e.hitParameters=h.createHitParameters(e.ppdBundlesMetricConstants);var c=b("#ppdb-add-service-checkbox");c.is(":checked")&&c.prop("checked",!1);var c=!0===e.ppdBundleViewModel.isUpsellCritical?"1":"0",m=e.zipCode,p=e.productAsin,r=g.getPriceValue(e.ppdBundleViewModel.baseAsinOfferData.price),
t=g.getPriceValue(e.buyboxPrice),u=e.ppdBundleViewModel.baseAsinOfferData.upsellAsin,A=e.ppdBundleViewModel.baseAsinOfferData.merchantId,V="vas_bdlppd_old_"+c+"_a_"+m;a.logRefTag("vas_bdlppd_ld_"+c+"_a_"+m,"LocalServicesWidget","Impression",u,"popUp",A,p,r,t);a.logRefTag(V,"LocalServicesWidget","Impression",u,"popUp",A,p,r,t);a.metric("bdl_old_gv");a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,a.RefmarkerActionTypes.glanceView,
e.hitParameters)},logCheckboxInteractionReftag:function(b){var c=!0===e.ppdBundleViewModel.isUpsellCritical?"1":"0",d=e.ppdBundleViewModel.baseAsinOfferData.upsellAsin,f=e.productAsin,h=g.getPriceValue(e.ppdBundleViewModel.baseAsinOfferData.price);g.getPriceValue(e.buyboxPrice);a.logRefTag("vas_bdlppd_"+b+"_1_"+c+"_a","LocalServicesWidget","AddServiceCheck",d,"popUp",e.ppdBundleViewModel.baseAsinOfferData.merchantId,f,h);a.createCSMNameAndLog(l.tenant,l.widget,"y"===b?a.CSMActionTypes.serviceIncluded:
a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,"y"===b?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,e.hitParameters)},logATCInteraction:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.addToCart);a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,a.RefmarkerActionTypes.addToCart,e.hitParameters)},logSDPRedirectReftagAndMetric:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.redirect);
a.createRefMarkerAndLog(k.tenant,e.mappingSet,k.widget,a.RefmarkerActionTypes.redirect,e.hitParameters);return!0}}});"use strict";m.when("A","vas-ppdbundle-setting","vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-ppdbundle-controller",function(c,d,a,g){var f=c.$,h={ppdBundlesCheckBoxHandler:function(){var b;if(f("#ppdb-add-service-checkbox").is(":checked")){b=d.getSettings("ppdBundleViewModel").baseAsinOfferData;d.logATCInteraction();try{c.trigger("vas:add-service-asin-buybox-event",
b),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(e){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(e)}b="y"}else{try{c.trigger("vas:remove-service-asin-buybox-event"),a.increaseMetricBy("a2cFormRemoveEventSend_fail",0),a.metric("a2cFormRemoveEventSend_success")}catch(e){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(e)}b="n"}d.logCheckboxInteractionReftag(b)}},
b=function(){f("#ppdb-add-service-checkbox").unbind("change");f("#ppdb-add-service-checkbox").bind("change",function(){h.ppdBundlesCheckBoxHandler()});f("#ppdBundles-estimate-SDP").unbind("click");f("#ppdBundles-estimate-SDP").bind("click",function(){d.logSDPRedirectReftagAndMetric()})},e=function(){c.off("vas:ldbb-a2c-event:desktop");c.on("vas:ldbb-a2c-event:desktop",function(a){if(f("#ppdb-add-service-checkbox").is(":checked")){var b=d.getSettings("ppdBundleViewModel").baseAsinOfferData;g.addUpsell(b.upsellAsin,
b.offerlistingId,a)}})};c.off("vas:widgetname:ppdBundle");c.on("vas:widgetname:ppdBundle",function(){d.fetchPpdBundleSetting();b();e()})});"use strict";m.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"}}}});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher",
"vas-regularPPD-config","vas-metric-utils","ready").register("vas-regularppd-setting",function(c,d,a,g,f){var h,b,e,k,l=g.regularPPDMetricConstants.refmarkerPrefixes,m=g.regularPPDMetricConstants.metricPrefixes;return{fetchRegularPpdSetting:function(){h=d.getSetting("widgetCommonVM").productAsin;b=d.getSetting("winningWidgetVM").upsellAsin;e=d.getSetting("widgetCommonVM").mappingSet;d.getSetting("widgetCommonVM");d.getSetting("widgetCommonVM");k=f.createHitParameters(g.regularPPDMetricConstants);
a.createRefMarkerAndLog(l.tenant,e,l.widget,a.RefmarkerActionTypes.glanceView,k);a.createCSMNameAndLog(m.tenant,m.widget,a.CSMActionTypes.glanceView);a.logRefTag("vas_ppd_cs_"+h+"_"+b);a.logUeMetricIncreaseCount("vas_standard_pdp_show")},logRedirectMetrics:function(){a.createCSMNameAndLog(m.tenant,m.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(l.tenant,e,l.widget,a.RefmarkerActionTypes.redirect,k)}}});"use strict";m.when("A","vas-regularppd-setting","vas-metrics-publisher","ready").execute("vas-regularppd-controller",
function(c,d,a){var g=c.$,f=function(){g(".sdpRedirect").unbind("click");g(".sdpRedirect").bind("click",function(){d.logRedirectMetrics();a.logUeMetricIncreaseCount("vas_pdp_sdp_redirect");d.logRedirectMetrics()})};c.off("vas:widgetname:regularPPD");c.on("vas:widgetname:regularPPD",function(){f();d.fetchRegularPpdSetting()})});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher","ready").register("vas-brandmessaging-setting",function(c,d,a){var g,f,h;return{fetchBrandMessagingSettings:function(){g=
d.getSetting("widgetCommonVM").productAsin;f=d.getSetting("winningWidgetVM").upsellAsin;h=d.getSetting("winningWidgetVM").impressionReftag;a.logRefTag(h,"LocalServicesWidget","Impression",f,null,null,g,null,null);a.logUeMetricIncreaseCount("vas_brand_gv")}}});"use strict";m.when("A","vas-brandmessaging-setting","vas-metrics-publisher","ready").execute("vas-brandmessaging-controller",function(c,d,a){var g=c.$,f=function(){g("#vas-brand-messaging-details-redirect").unbind("click");g("#vas-brand-messaging-details-redirect").bind("click",
function(){a.logUeMetricIncreaseCount("vas_brand_details_redir")})};c.off("vas:widgetname:brandMessagingDesktop");c.on("vas:widgetname:brandMessagingDesktop",function(){f();d.fetchBrandMessagingSettings()})});"use strict";m.when("ready").register("vas-service-banner-constants",function(){return{CLICK_EVENT:"click",SERVICE_BANNER_WIDGET_NAME:"serviceBanner",SERVICE_BANNER_IMAGE_DIV_ID:"vas-service-banner-image"}});"use strict";m.when("A","vas-metrics-publisher","vas-service-banner-constants","ready").execute("vas-serviceBanner-controller",
function(c,d,a){var g=c.$,f=function(){g("#"+a.SERVICE_BANNER_IMAGE_DIV_ID).unbind(a.CLICK_EVENT);g("#"+a.SERVICE_BANNER_IMAGE_DIV_ID).bind(a.CLICK_EVENT,function(){d.logCSMCounter(["vas",a.SERVICE_BANNER_WIDGET_NAME,a.CLICK_EVENT].join("_"))})};c.off("vas:widgetname:serviceBanner");c.on("vas:widgetname:serviceBanner",function(){f();d.logCSMCounter(["vas",a.SERVICE_BANNER_WIDGET_NAME,d.RefmarkerActionTypes.glanceView].join("_"))})});"use strict";"use strict";"use strict";"use strict";"use strict";
m.when("A").register("vsx-services-constants",function(c){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",DATA_EXPANDED_STATE:"data-expanded",DATA_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",PAGE_UPDATE_EVENT:"a:pageUpdate",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:"/hctp/log/refMarker?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",VIEWBOX:"viewBox",VSX_SERVICES_ICON_DIV_ID:"#vsx-services-icon",SELECTED_ICON_VIEWBOX:"0 0 24 24",
INSTALLATION_ICON_VIEWBOX:"0 100 24 24",vsxMetricConstants:{tenant:"vsx",widget:{bundle:"bundle",simpleMessaging:"simpleMessaging"},additionalRequestDataKeys:{zipCode:"zip",deviceType:"dt"},actions:{glanceView:"gv",asinMandatory:"asin_mandatory",asinAdded:"asin_added",asinRemoved:"asin_removed",vsxCardExpanded:"card_expanded",vsxCardCollapsed:"card_collapsed",vsxCardRedirection:"card_redirection",initializationFailure:"initialize_failure",inclusionFailure:"inclusion_failure",exclusionFailure:"exclusion_failure"}}}});
"use strict";r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"===typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};m.when("A","cc-manager","vsx-services-constants").register("vsx-services-twister-registration",function(c,d,a){var g=c.$,f={init:function(){},validateInputParams:function(b){return b&&("undefined"===typeof b?"undefined":r(b))!==a.UNDEFINED&&b.itemType===a.ASIN&&r(b.asin)===a.STRING&&
r(b.offerListingId)===a.STRING?1:0},cardCollapse:function(){h(a.BUNDLE_CARD_CONTENT_SELECTOR,a.BUNDLE_HEADING_ICON_SELECTOR);h(a.SIMPLE_MESSAGING_CARD_CONTENT_SELECTOR,a.SIMPLE_MESSAGING_HEADING_ICON_SELECTOR)}},h=function(b,c){g(b).removeClass(a.AUI_CARD_EXPANDED).attr(a.DATA_EXPANDED_STATE,a.DATA_EXPANDED_STATE_VALUE_FALSE).attr(a.STYLE,a.CARD_HIDDEN_STYLE);g(c).removeClass(a.COLLAPSE_HEADING_ICON).addClass(a.EXPAND_HEADING_ICON)};return{selectionUpdate:function(a,c){return d.ccSelectionUpdate(a,
c)},registerFeature:function(){d.registerFeature({featureName:a.FEATURE_NAME,featureAttribution:a.FEATURE_ATTRIBUTION},f)},cardExpanderListener:function(){d.cardExpanded(a.FEATURE_NAME)},ccSelectionsClear:function(){d.ccSelectionsClear(a.FEATURE_NAME)}}});"use strict";m.when("A","vas-metrics-publisher","vas-prepurchase-setting").execute("vas-prepurchase-controller",function(c,d,a){var g=c.$,f=function(){g("#vas-prepurchase-details-redirect").undelegate("click");g("#vas-prepurchase").delegate("#vas-prepurchase-details-redirect",
"click",function(){d.logUeMetricIncreaseCount("vas_prepurchase_details_redirect")})};c.off("vas:widgetname:prePurchase");c.on("vas:widgetname:prePurchase",function(){f();a.fetchPrepurchaseSettings()})});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher","ready").register("vas-prepurchase-setting",function(c,d,a){var g={};return{fetchPrepurchaseSettings:function(){"undefined"!==typeof d.getSetting("widgetBaseVM")&&(g.productAsin=d.getSetting("widgetBaseVM").productAsin);g.impressionReftag=
d.getSetting("prepurchaseWidgetVM").impressionReftag;a.logRefTag(g.impressionReftag,"LocalServicesWidget","Impression",g.serviceAsin,null,null,g.productAsin,null,null);a.logUeMetricIncreaseCount("vas_prepurchase_gv")}}});"use strict";m.register("pre-check-disabled",function(){return{isDisabled:!0}});"use strict";m.register("vas-item-assocation-group-migration-uds",function(){return{isEnabled:!1}});"use strict";m.register("price-details-bottomsheet",function(){return{isEnabled:!1}});"use strict";m.when("service-options-ready").register("vas-udm-refresh-integration-weblab",
function(){return{isEnabled:!1}});"use strict";m.register("vas-add-item-data",function(){return{AddItemData:function(){return{construct:function(c,d,a){this.asin=c;this.offerListingId=d;this.quantity=a;return this},setItemAssociation:function(c){this.additionalParameters===u&&(this.additionalParameters={});this.additionalParameters.itemAssociation=c;return this}}}}});"use strict";m.register("vas-mandatory-uds-price-override-weblab",function(){return{isEnabled:!1}})});
/* ******** */
(function(h){var p=window.AmazonUIPageJS||window.P,n=p._namespace||p.attributeErrors,c=n?n("DetailPageOfferDisplayFeatureCommonAssets",""):p;c.guardFatal?c.guardFatal(h)(c,window):c.execute(function(){h(c,window)})})(function(h,p,n){h.when("A","odf-metric-utils").register("progressive-display-utils",function(c,g){function m(b,f){e(".offer-display-features-expander").each(function(d,a){d=e(a);a=d.find(".a-expander-header.odf-expander-heading");if(a.is(":visible")){var c=d.attr("data-a-expander-collapsed-height");
if("undefined"===typeof c||!1===c||!0===f){var r=d.find(".offer-display-features-container").attr("displayable-row-count"),l=a.height()+4+6;d.find(".offer-display-feature-label").each(function(b,d){if(b>=parseInt(r))return!1;l+=e(d).outerHeight(!0)});d.attr("data-a-expander-collapsed-height",l);0<d.find('div[data-expanded\x3d"false"]').length&&(d.height(l),d.find(".a-expander-content-fade").remove());g.publishCountMetrics(b+"ProgressiveDisplayHeightSet")}g.publishCountMetrics(b+"ProgressiveDisplayAvailable")}else g.publishCountMetrics(b+
"ProgressiveDisplayNotAvailable")})}function h(b){e(".offer-display-features-expander").each(function(f,d){f=e(d);d=f.find(".offer-display-features-container").attr("displayable-row-count");var c=f.find(".offer-display-feature-label").not(".show-more .offer-display-feature-label").length;"undefined"!==typeof d&&c<=d?(d=f.find(".offer-display-features-show-more"),d.length&&d[0].classList.remove("a-spacing-small"),d=f.find(".a-expander-header.odf-expander-heading"),d.length&&d[0].classList.add("aok-hidden"),
f=f.find(".show-more"),0<f.length&&f.find(".offer-display-feature-label")[0].classList.add("aok-hidden"),g.publishCountMetrics(b+"ProgressiveDisplayHidden")):"undefined"!==typeof d&&a(f)})}function k(b){var f=0;e(".offer-display-dynamic-features").each(function(b,e){e.classList.remove("aok-hidden");f+=1});g.publishCountMetrics(b+"UnHidingDynamicFeatures",f)}function l(b){e(".collapsed-offer-display-features").each(function(f,d){f=e(d);var a=f.find(".offer-display-features-container").attr("displayable-row-count");
d=f.find(".offer-display-feature-label").length;"undefined"!==typeof a&&d>a&&(f.find(".offer-display-feature-label").each(function(b,d){b>=a&&e(d).parent()[0].classList.add("aok-hidden")}),g.publishCountMetrics(b+"FeaturesHiddenInCollapsedAccordion",d-a))})}function a(b){var a=b.find(".offer-display-features-container").attr("displayable-row-count");"undefined"!==typeof a&&b.find(".offer-display-feature-label").each(function(b,f){b>=a&&e(f).parent()[0].classList.add("aok-hidden")})}function q(b,a){b=
g.buildMetricPrefix(b,a);k(b);h(b);m(b,!1);l(b)}var e=c.$;return{initializeAndSetEventListeners:function(b){q(b,"pageLoad");c.on("a:pageUpdate",function(){q(b,"pageUpdate")});c.on("a:accordion:buybox-accordion:select",function(){m(g.buildMetricPrefix(b,"accordionSelect"),!1)});c.on("a:tabs:offerDisplayGroup_tabs:select",function(){m(g.buildMetricPrefix(b,"tabSelect"),!1)});c.on("a:odf:resetHeightForProgressiveFaceOut",function(){m(g.buildMetricPrefix(b,"resetHeightForProgressiveFaceOut"),!0)})},alignOverlappingElements:function(b,
a){var d=b.find(".a-expander-header.odf-expander-heading a")[0].getBoundingClientRect(),e=b.find(".offer-display-features-show-more a")[0].getBoundingClientRect();d=d.right-e.left;-10<=d&&(b.find(".offer-display-features-show-more a").css("paddingLeft",d+10),b=g.buildMetricPrefix(a),g.publishCountMetrics(b+"AlignedOverlappingElements"))},showFeaturesUnderProgressiveDisplay:function(b){var a=b.find(".offer-display-features-container").attr("displayable-row-count");"undefined"!==typeof a&&b.find(".offer-display-feature-label").each(function(b,
f){b>=a&&e(f).parent()[0].classList.remove("aok-hidden")})},hideFeaturesUnderProgressiveDisplay:a}});"use strict";h.when("A","odf-metric-utils").register("truncation-utils",function(c,g){function m(a,c){var e=l(a),b=!1;if(e.css("line-clamp")!==(3).toString()&&e.css("-webkit-line-clamp")!==(3).toString()){e=e.children("a").length?e.children("a").first():e;var f=e.text();e.text("...");var d=a.offsetHeight;for(e.text(f);a.offsetHeight>3*d;)b=!0,-1<e.text().indexOf(" ")?e.text(e.text().replace(/\W*\s(\S)*$/,
"...")):e.text(e.text().substring(0,e.text().length-6)+"...");c||e.text(f)}else b=a.scrollHeight>a.clientHeight;return b}function h(a,c,e){a.closest(".offer-display-feature-text[offer-display-attribute-name],.offer-display-feature-text[offer-display-feature-name]").find(".odf-truncation-popover").each(function(b,a){b=l(a);b.is(".offer-display-feature-text")?c?b.addClass("aok-hidden"):b.removeClass("aok-hidden"):c?(b.removeClass("aok-hidden"),g.publishCountMetrics(e+"TruncationPopoverShown")):(b.addClass("aok-hidden"),
g.publishCountMetrics(e+"TruncationPopoverNotShown"))})}function k(a,c){var e=g.buildMetricPrefix(a,c);l(".offer-display-features-container").each(function(b,a){var d=!1;l(a).find(".offer-display-feature-text-message").each(function(b,a){b=l(a);b.parent().is(".odf-truncation-popover")&&b.parent().is(".offer-display-feature-text")?(b.parent().removeClass("aok-hidden"),a=m(a,!1),h(b,a,e)):a=m(a,!0);a&&(d=!0)});d?g.publishCountMetrics(e+"ContentTruncated"):g.publishCountMetrics(e+"ContentNotTruncated")})}
var l=c.$;return{setEventsToUpdateTextVisibility:function(a){k(a,"pageLoad");if("Mobile"===a)c.on(c.constants.BROWSER_EVENTS.RESIZE,function(){k(a,"pageResize")});c.on("a:accordion:buybox-accordion:select",function(){k(a,"accordionSelect")});c.on("a:tabs:offerDisplayGroup_tabs:select",function(){k(a,"tabSelect")});c.on("a:pageUpdate",function(){k(a,"pageUpdate")})}}});"use strict";h.when("A").register("odf-metric-utils",function(c){function g(c,a){c="ODF."+c+".";a&&(c+=a+".");return c}function h(c,
a){k&&k.count&&k.count(c,a?a:1)}var n=c.$,k=p.ue;return{buildMetricPrefix:g,publishCountMetrics:h,publishFeatureLevelMetrics:function(c){n(".offer-display-features").find(".offer-display-feature-label").not(".show-more .offer-display-feature-label").each(function(a,k){a=n(k).attr("offer-display-feature-name");a=g(c)+a+".Display";h(a)})}}})});
/* ******** */
(function(b){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,c=g?g("DetailPageOfferDisplayFeatureDesktopAssets",""):f;c.guardFatal?c.guardFatal(b)(c,window):c.execute(function(){b(c,window)})})(function(b,f,g){b.when("A","progressive-display-utils","odf-metric-utils").execute("offer-display-features-expander",function(c,e,d){e.initializeAndSetEventListeners("Desktop");c.on("a:expander:offer-display-features-expander:toggle:expand",function(a){a=a.expander.$expander;var c=a.find(".a-expander-header.odf-expander-heading").height();
a.children(".a-row").css("paddingTop",c);e.showFeaturesUnderProgressiveDisplay(a);d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"ProgressiveDisplayExpand")});c.on("a:expander:offer-display-features-expander:toggle:collapse",function(a){a=a.expander.$expander;var c=a.attr("data-a-expander-collapsed-height");a.children(".a-row").css("paddingTop","0px");a.height(c);e.hideFeaturesUnderProgressiveDisplay(a);d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"ProgressiveDisplayCollapse")})});"use strict";
b.when("A","odf-metric-utils").execute("publish-feature-metrics",function(c,e){e.publishFeatureLevelMetrics("Desktop")});"use strict";b.when("A","truncation-utils","odf-metric-utils").execute("truncate-offer-display-features",function(c,e,d){var a=c.$,b=d.buildMetricPrefix("Desktop");e.setEventsToUpdateTextVisibility("Desktop");a("#offer-display-features #sellerProfileTriggerId").click(function(){d.publishCountMetrics(b+"SellerProfileTriggerIdClicked");0===a(this).closest(".offer-display-feature-text .odf-truncation-popover").length&&
d.publishCountMetrics(b+"TruncationPopoverSellerProfileTriggerIdClicked")});c.on("a:popover:visible",function(c){c.popover.$trigger.find(".odf-truncation-popover").length&&d.publishCountMetrics(b+"TruncationPopoverInteracted")})});"use strict";b.when("A","jQuery","odf-metric-utils").execute("giftingInfo",function(c,e,d){function a(){var a=e(".odf-gift-wrap input[type\x3d'checkbox']");1<a.length&&d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingMultipleBOWithCheckbox");a.each(function(){e(this).change(function(){if(0<
e(this).closest("div.odf-gift-wrap").length){var a=e(this).closest("div.odf-gift-wrap").attr("data-bo-index"),b=e('.offer-display-feature-text-message.gift-wrap-message[data-bo-index\x3d"'+a+'"]'),f=e('.gift-wrap-unchecked-message[data-bo-index\x3d"'+a+'"]'),g=e('.gift-wrap-checked-message[data-bo-index\x3d"'+a+'"]');a=e('div[data-bo-index\x3d"'+a+'"] input[type\x3d"checkbox"][id\x3d"gift-wrap"]');0<b.length&&e(this).is(":checked")?(0<g.length&&(b.text(g.text()),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+
"GiftingCheckedTextUpdate")),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingCheckboxChecked")):(0<f.length&&(b.text(f.text()),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingUncheckedTextUpdate")),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingCheckboxUnchecked"));if(b=0<a.length)b=e(this),b=b.is(":checked")&&!a.is(":checked")||!b.is(":checked")&&a.is(":checked");b&&a.click();c.trigger("a:odf:resetHeightForProgressiveFaceOut")}})})}a();c.on("a:pageUpdate",
function(){a()})})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,b=g?g("DetailPageLoyaltyRewardPointsEarningsAssets",""):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,g){d.when("A","a-modal","earnings-bottom-sheet-aapi-util").register("diamonds-earnings-modal",function(b,d,e){function f(a){var c=JSON.stringify({domain:a.currencyType,marketplaceId:a.marketplaceId,balanceTypes:[k.PRIMARY],consistencyType:k.CONSISTENCY_TYPE});e.getAAPIProductData(a.aapiEndpoint,
a.csrfToken,a.language,c).done(function(a){a=g(a,k.PRIMARY);b.$(h.ajaxTextPointsDiv).text(parseInt(a).toLocaleString("en-US"));b.$(h.earningsSheetContentSpinner).addClass("aok-hidden");b.$(h.earningsBottomSheetContent).removeClass("aok-hidden")})}function g(a,b){return a&&a.entity&&a.entity.balances?(a=a.entity.balances.find(function(a,c){return a.balanceType===b}))?a.amount:0:0}var k=Object.freeze({PRIMARY:"PRIMARY",LIFETIME_EARNINGS:"LIFETIME_EARNINGS",CONSISTENCY_TYPE:"STRICT"}),c=Object.freeze({MODAL_NAME:"diamonds-earnings-modal-content",
WIDTH:"390",PADDING:"none",HIDE_HEADER:!0,CLOSE_TYPE:"icon"}),h={earningsBottomSheetContent:".earnings-sheet-content",ajaxTextPointsDiv:".earningsPointsBalance",earningsSheetContentSpinner:".earnings-bottom-sheet-spinner"};b.declarative("diamonds-earnings-modal","click",function(a){var e;if(e=d.get(c.MODAL_NAME)||d.create(a.$target,{name:c.MODAL_NAME,height:c.HEIGHT,width:c.WIDTH,padding:c.PADDING,hideHeader:c.HIDE_HEADER,closeType:c.CLOSE_TYPE}))b.$(h.earningsSheetContentSpinner).removeClass("aok-hidden"),
b.$(h.earningsBottomSheetContent).addClass("aok-hidden"),e.show(),f(a.data)})});"use strict";d.when("A").register("earnings-bottom-sheet-aapi-util",function(b){var d=b.$,e=document.querySelector('meta[name\x3d"encrypted-slate-token"]'),e=e?e.content:e;return{getAAPIProductData:function(b,f,g,c){return d.ajax({url:"https://"+b+"/custom/marbleserviceaapicontracts/marblesservice-getbalances-aapi",type:"POST",headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.response/v1"',
"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.request/v1"',"x-api-csrf-token":f,"Accept-Language":g,"x-amzn-encrypted-slate-token":e},data:c,xhrFields:{withCredentials:!0}})}}})});
/* ******** */
(function(g){var k=window.AmazonUIPageJS||window.P,m=k._namespace||k.attributeErrors,b=m?m("DetailPageLoyaltyRewardPointsRedemptionAssets",""):k;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,k,m){var b=Object.freeze({PRIMARY:"PRIMARY",LIFETIME_EARNINGS:"LIFETIME_EARNINGS",CONSISTENCY_TYPE:"STRICT"}),l=Object.freeze({MODAL_NAME:"diamonds-redemption-modal-content",WIDTH:"395",PADDING:"none",HIDE_HEADER:!0,CLOSE_TYPE:"icon"});g.when("A","a-modal","redemption-bottom-sheet-aapi-util").register("redemption-bottom-sheet",
function(n,k,h){function m(f){function q(a,c){return a&&a.entity&&a.entity.balances?(a=a.entity.balances.find(function(a,e){return a.balanceType===c}))?a.amount:0:0}function r(a,d){if(a>=d)e(c.progressBarContents).addClass("aok-hidden");else{var b=a/d*100;g.when("a-meter").execute(function(){n.$(c.progressBar).find(".a-meter-bar")["0"].attributes["1"].nodeValue="width: "+b+"%;background-color: #008296; margin-left: -6%;";e(c.progressBarContents).removeClass("aok-hidden")})}}var d=f.data,p;p||(p=k.create(f.$target,
{name:l.MODAL_NAME,height:l.HEIGHT,width:l.WIDTH,padding:l.PADDING,hideHeader:l.HIDE_HEADER,closeType:l.CLOSE_TYPE}));e(c.redemptionSheetContentSpinnerClass).removeClass("aok-hidden");e(c.redemptionBottomSheetContentClass).addClass("aok-hidden");p.show();f=JSON.stringify({domain:d.currencyType,marketplaceId:d.marketplaceId,balanceTypes:[b.PRIMARY,b.LIFETIME_EARNINGS],consistencyType:b.CONSISTENCY_TYPE});h.getAAPIProductData(d.aapiEndpoint,d.csrfToken,d.language,f).done(function(a){var f=q(a,b.PRIMARY);
e(c.ajaxTextPointsDivClass).text(parseInt(f).toLocaleString(d.language));e(c.redemptionSheetContentSpinnerClass).addClass("aok-hidden");e(c.redemptionBottomSheetContentClass).removeClass("aok-hidden");d.lifetimeBalanceEnabled&&(a=q(a,b.LIFETIME_EARNINGS),f=parseInt(d.minimumLifetimeBalanceThreshold),e(c.remainingDiamondsTextDiv).text(parseInt(f-a).toLocaleString(d.language)),e(c.diamondsCollected).text(parseInt(a).toLocaleString(d.language)),e(c.minimumLifetimeBalanceRequired).text(parseInt(d.minimumLifetimeBalanceThreshold).toLocaleString(d.language)),
r(a,f))})}var e=n.$,c={redemptionBottomSheetContentClass:".redemption-bottom-sheet-container-class",ajaxTextPointsDivClass:".redemptionPointsTextDivClass",redemptionSheetContentSpinnerClass:".redemption-bottom-sheet-spinner-class",remainingDiamondsTextDiv:"#remainingDiamondsToCollect",diamondsCollected:"#diamondsCollectedNumerator",progressBarContents:"#progressBarContents",progressBar:"#progress-bar-bottom-sheet",minimumLifetimeBalanceRequired:"#diamondsCollectedDenominator"};n.declarative("diamonds-redemption-modal",
"click",function(c){m(c)})});"use strict";g.when("A").register("redemption-bottom-sheet-aapi-util",function(b){var g=b.$,h=document.querySelector('meta[name\x3d"encrypted-slate-token"]'),h=h?h.content:h;return{getAAPIProductData:function(b,e,c,f){return g.ajax({url:"https://"+b+"/custom/marbleserviceaapicontracts/marblesservice-getbalances-aapi",type:"POST",headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.response/v1"',
"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.request/v1"',"x-api-csrf-token":e,"Accept-Language":c,"x-amzn-encrypted-slate-token":h},data:f,xhrFields:{withCredentials:!0}})}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageRewardsCardAssets","DetailPageRewardsCard"):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("DetailPagePromotionNudgesAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(h){var f=window.AmazonUIPageJS||window.P,l=f._namespace||f.attributeErrors,c=l?l("DetailPageContextualTrustWidgetAssets@logger","DetailPageContextualTrustWidget"):f;c.guardFatal?c.guardFatal(h)(c,window):c.execute(function(){h(c,window)})})(function(h,f,l){h.when("A","ready").register("get-contextual-tw-page-state",function(c){return{parseJSON:function(e,b){b="contextual-tw-state-"+b;var d='script[data-a-state\x3d"{"key":"'+b+'"}"]',a;try{a=c.$("#"+e).find(d).html()}catch(k){console.log(k.message)}a?
e=c.$.parseJSON(a):(c.state.parse(),e=c.state(b));return e}}});h.declare("contextual-tw-metrics-constants",{CONTEXTUAL_TW_FEATURE_DIV:"contextualTrustWidget_feature_div",CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV:"contextual-tw-pagestate-holder",METRIC_TYPE:{GLANCE_VIEW:"GLANCE_VIEW",ICON_CLICK:"ICON_CLICK",SECONDARY_PAGE_OPEN:"SECONDARY_PAGE_OPEN",SECONDARY_PAGE_CLOSE:"SECONDARY_PAGE_CLOSE",ABSENT:"ABSENT",EXPANDER_OPEN:"EXPANDER_OPEN"},REF_MARKER_PREFIX:{CONTEXTUAL_TRUST_WIDGET:"contextual_tw_wid",RETURNS_POLICY:"contextual_tw_rp",
PAY_ON_DELIVERY:"contextual_tw_pod",GENERIC_RETURN_POLICY:"contextual_tw_grp",MULTIPLE_SPECIFIC_RETURN_POLICY:"contextual_tw_msrp",SINGLE_SPECIFIC_RETURN_POLICY:"contextual_tw_ssrp",PAY_ON_DELIVERY_ACTIVE:"contextual_tw_pod_active",PAY_ON_DELIVERY_INACTIVE:"contextual_tw_pod_inactive",STATIC_RETURNS_POLICY:"contextual_tw_srp",GENERIC_RETURNS_POLICY:"contextual_tw_grp",FREE_DELIVERY:"contextual_tw_fd",FREE_DELIVERY_V2:"contextual_tw_fdv2"},REF_MARKER_SUFFIX:{GLANCE_VIEW:"_gv",ICON_CLICK:"_clk",SECONDARY_PAGE_OPEN:"_sp_op",
SECONDARY_PAGE_CLOSE:"_sp_cl",FULL_RETURN_POLICY:"_frp",EXPANDER_OPEN:"_exp_op",ABSENT:"_noavail"},NEXUS_CONFIG:{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3"},LOGGER_CONFIG:{NEXUS_LOGGER:"nexus"}});h.when("A","contextual-tw-return-policy-metric-logger","contextual-tw-pay-on-delivery-metric-logger","contextual-tw-default-metric-logger").register("contextual-tw-icon-metric-factory",function(c,e,b,d){return{getIconMetric:function(a){switch(a){case "RETURNS_POLICY":return e;
case "PAY_ON_DELIVERY":return b;default:return d}}}});h.when("A","contextual-tw-metrics-constants","get-contextual-tw-page-state","contextual-tw-icon-metric-factory","ready").register("contextual-tw-metricLogger",function(c,e,b,d){return{log:function(a,k,m,g){if(a&&k&&null!==m&&e.REF_MARKER_PREFIX[a]&&e.REF_MARKER_SUFFIX[k]){var h=c.$("#contextual-trust-widget-"+m),f=b.parseJSON(e.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+m,m);f?d.getIconMetric(a).log(a,k,m,c.$.extend(!0,{asin:f.asin,merchantId:f.merchantId,
remoteAddress:f.remoteAddress,isInternal:f.isInternal,isRobot:f.isRobot,numOfShownIcons:f.numOfShownIcons,buyingOptionIndex:m},g)):h.length&&console.warn("contextualTrustWidget state may not be available")}}}});h.when("A","ready").register("contextual-tw-postmetric",function(){return{postCountMetric:function(c){if("undefined"!==typeof c){var e=f.ue;if(e){var b=e.count(c)||0;e.count(c,b+1)}}},postTimeMetric:function(c,e){if("undefined"!==typeof c&&"undefined"!==typeof e){var b=f.ue;b&&b.count(c,e)}}}});
h.when("A","ready").register("contextual-tw-metric-cache",function(c){var e=[],b=function(a){if(!d(a))return!1;var b=!1;c.each(e,function(c,d){c.asin===a.asin&&c.merchantId===a.merchantId&&c.ref===a.ref&&c.loggerType===a.loggerType&&c.buyingOptionIndex===a.buyingOptionIndex&&(b=!0)});return b},d=function(a){return a&&a.asin&&a.merchantId&&a.ref&&a.loggerType&&null!==a.buyingOptionIndex};return{isPresent:b,add:function(a){return d(a)?b(a)?!1:(e.push(a),!0):!1},reset:function(){e=[]}}});"use strict";
h.when("A","contextual-tw-metric-cache","contextual-tw-metrics-constants","ready").register("contextual-tw-Nexus-Service",function(c,e,b){return{log:function(d){if(e.add(d)){var a={};a.producerId=b.NEXUS_CONFIG.NEXUS_PRODUCER_ID;a.schemaId=b.NEXUS_CONFIG.NEXUS_SCHEMA_ID;a.refMarker=d.ref;a.pageAsin=d.asin;a.pageType=c.capabilities?c.capabilities.mobile?c.capabilities.isAmazonApp?"DetailWebView":"DetailAW":"Detail":"";a.subPageType="ContextualIconFarm";a.server=f?f.ue_sn:"";a.merchantId=d.merchantId;
a.remoteAddress=d.remoteAddress;a.isInternal=d.isInternal?1:0;a.isRobot=d.isRobot?1:0;var k={};k.numOfShownIcons=d.numOfShownIcons;k.buyingOptionIndex=d.buyingOptionIndex;d=JSON.stringify(k);a.additionalRequestData=d;if(d=f.ue)try{d.event&&d.event(a,b.NEXUS_CONFIG.NEXUS_PRODUCER_ID,b.NEXUS_CONFIG.NEXUS_SCHEMA_ID)}catch(m){d.count("NexusLoggerFailure",1)}}}}});h.when("A","contextual-tw-Nexus-Service","contextual-tw-metrics-constants","contextual-tw-postmetric","ready").register("contextual-tw-default-metric-logger",
function(c,e,b,d){return{log:function(a,k,f,g){f=JSON.parse(JSON.stringify(g));e.log(c.$.extend(!0,f,{ref:b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k])}}});h.when("A","contextual-tw-Nexus-Service","contextual-tw-metrics-constants","contextual-tw-postmetric","get-contextual-tw-page-state","ready").register("contextual-tw-return-policy-metric-logger",function(c,e,b,d,a){return{log:function(k,
f,g,h){a:{if((g=a.parseJSON(b.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.RETURNS_POLICY&&g.RETURNS_POLICY.secondaryViewData&&g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies)switch(g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies.length){case 0:g="GENERIC_RETURN_POLICY";break a;case 1:g="SINGLE_SPECIFIC_RETURN_POLICY";break a;default:g="MULTIPLE_SPECIFIC_RETURN_POLICY";break a}g=void 0}k=g||k;h=JSON.parse(JSON.stringify(h));e.log(c.$.extend(!0,h,{ref:b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f],
loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f])}}});h.when("A","contextual-tw-Nexus-Service","contextual-tw-metrics-constants","contextual-tw-postmetric","get-contextual-tw-page-state","ready").register("contextual-tw-pay-on-delivery-metric-logger",function(c,e,b,d,a){return{log:function(f,h,g,l){g=(g=a.parseJSON(b.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.PAY_ON_DELIVERY&&g.PAY_ON_DELIVERY.isEligible?g.PAY_ON_DELIVERY.isEligible?
"PAY_ON_DELIVERY_ACTIVE":"PAY_ON_DELIVERY_INACTIVE":void 0;f=g||f;l=JSON.parse(JSON.stringify(l));e.log(c.$.extend(!0,l,{ref:b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h])}}})});
/* ******** */
(function(a){var g=window.AmazonUIPageJS||window.P,k=g._namespace||g.attributeErrors,c=k?k("DetailPageContextualTrustWidgetAssets@mobile","DetailPageContextualTrustWidget"):g;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,g,k){a.when("A","atf","ready").execute(function(c){var d=!1;try{c.loadImageManually(c.$(".contextual-tw-icon-check-box")),c.loadImageManually(c.$(".contextual-tw-inline-icon-box"))}catch(a){console.warn("contextual trust widget image loads failed",
a)}c.on("a:pageUpdate",function(){if(d)try{c.loadImageManually(c.$(".contextual-tw-icon-check-box")),c.loadImageManually(c.$(".contextual-tw-inline-icon-box"))}catch(a){console.warn("contextual trust widget image loads failed",a)}else d=!0})});"use strict";a.when("A","jQuery","a-secondary-view","contextual-tw-metricLogger","contextual-tw-metrics-constants","contextual-tw-metric-cache","contextual-tw-expander-util","contextual-tw-expander-constants","get-contextual-tw-page-state","atf","ready").execute(function(c,
d,g,h,e,k,n,b,p){var f=!1,l=c.$(".accordion-row").length;0===l&&(l=1);(function(a){var l=[];a.create=function(c,m){var b="contextual-tw-composite-secondary-page-"+m,h="#contextual-tw-composite-secondary-page-content-"+m,f=p.parseJSON(e.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+m,m);l[b]?(f=g.get(b),a.expandCard(c,m)):(a.createHandlers(b),a.expandCard(c,m),f=g.create(d(h),{name:b,dataStrategy:"preload",backButtonText:f&&f.backButtonText?f.backButtonText:"Back",padding:"none"}),l[b]=h);f.show()};a.logGlanceMetrics=
function(b){var a="#contextual-trust-widget-"+b,d=c.$(a);d&&d.length?h.log("CONTEXTUAL_TRUST_WIDGET",e.METRIC_TYPE.GLANCE_VIEW,b):h.log("CONTEXTUAL_TRUST_WIDGET",e.METRIC_TYPE.ABSENT,b);(a=c.$(a+" .contextual-tw-icon-container"))&&a.length&&a.each(function(){h.log(c.$(this).data("name"),e.METRIC_TYPE.GLANCE_VIEW,b)})};a.initializeHandlers=function(b){d(".contextual-tw-icon-container").click(function(b){var d=c.$(this).data("name"),f=c.$(this).data("buying-option-index");h.log(d,e.METRIC_TYPE.ICON_CLICK,
f);b.stopPropagation();a.create(d,f)})};a.createHandlers=function(b){var a=0;c.on("a:secondary-view:beforeShow:"+b,function(b){a=c.$("#a-page").offset().top});c.on("a:secondary-view:afterHide:"+b,function(b){c.$("html, body").scrollTop(-a)})};a.expandCard=function(a,c){d(b.COLLECTIONS_CONTENT_SELECTOR).removeClass(b.EXPANDER_CONTENT_EXPANDED_CLASS).attr(b.ARIA_EXPANDED,"false").attr(b.STYLE,b.EXPANDER_CONTENT_COLLAPSED_STYLE);d(b.COLLECTIONS_EXPANDER_ICON_SELECTOR).removeClass(b.EXPANDER_ICON_COLLAPSE_CLASS).addClass(b.EXPANDER_ICON_EXPAND_CLASS);
d("#"+a+"_CONTENT_"+c).addClass(b.EXPANDER_CONTENT_EXPANDED_CLASS).attr(b.ARIA_EXPANDED,"true").attr(b.STYLE,b.EXPANDER_CONTENT_EXPANDED_STYLE);a="#"+a+"_HEADER_"+c;d(a).attr(b.ARIA_EXPANDED,"true");d(a+"\x3e i").removeClass(b.EXPANDER_ICON_EXPAND_CLASS).addClass(b.EXPANDER_ICON_COLLAPSE_CLASS)}})(a.ContextualTrustSecondaryPage=a.ContextualTrustSecondaryPage||{});(function(a){a.initializeHandlers();n.init();for(var b=0;b<l;b++)a.logGlanceMetrics(b);c.on("a:pageUpdate",function(){if(f){k.reset();a.initializeHandlers();
n.init();for(var b=0;b<l;b++)a.logGlanceMetrics(b)}else f=!0})})(a.ContextualTrustSecondaryPage)});a.when("A","jQuery","contextual-tw-metricLogger","contextual-tw-metrics-constants","contextual-tw-expander-constants","atf","ready").register("contextual-tw-expander-util",function(a,d,g,h,e){return{init:function(){if(d(".contextual-tw-composite-view-expander").length){var k=d(".contextual-tw-composite-view-expander").map(function(a,b){return b.id}).get();d.each(k,function(k,b){a.on("a:expander:"+b+
":toggle:expand",function(a){d(e.COLLECTIONS_CONTENT_SELECTOR).removeClass(e.EXPANDER_CONTENT_EXPANDED_CLASS).attr(e.ARIA_EXPANDED,"false").attr(e.STYLE,e.EXPANDER_CONTENT_COLLAPSED_STYLE);d(e.COLLECTIONS_EXPANDER_ICON_SELECTOR).removeClass(e.EXPANDER_ICON_COLLAPSE_CLASS).addClass(e.EXPANDER_ICON_EXPAND_CLASS);a=a.expander.expanderName;var b="#"+a.replace("EXPANDER","CONTENT"),c="#"+a.replace("EXPANDER","HEADER");d(b).addClass(e.EXPANDER_CONTENT_EXPANDED_CLASS).attr(e.ARIA_EXPANDED,"true").attr(e.STYLE,
e.EXPANDER_CONTENT_EXPANDED_STYLE);d(c).attr(e.ARIA_EXPANDED,"true");d(c+"\x3e i").removeClass(e.EXPANDER_ICON_EXPAND_CLASS).addClass(e.EXPANDER_ICON_COLLAPSE_CLASS);b=a.split("_EXPANDER_")[0];a=a.split("_EXPANDER_")[1];g.log(b,h.METRIC_TYPE.EXPANDER_OPEN,a)})})}}}});a.declare("contextual-tw-expander-constants",{EXPANDER_CONTENT_COLLAPSED_STYLE:"overflow: hidden; display: none;",EXPANDER_CONTENT_EXPANDED_STYLE:"overflow: hidden; display: block;",EXPANDER_ICON_COLLAPSE_CLASS:"a-icon-section-collapse",
EXPANDER_ICON_EXPAND_CLASS:"a-icon-section-expand",EXPANDER_CONTENT_EXPANDED_CLASS:"a-expander-content-expanded",ARIA_EXPANDED:"aria-expanded",STYLE:"style",COLLECTIONS_CONTENT_SELECTOR:".contextual-tw-composite-view-expander.a-expander-container .contextual-tw-composite-view-expander-content",COLLECTIONS_EXPANDER_ICON_SELECTOR:".contextual-tw-composite-view-expander.a-expander-container .contextual-tw-composite-view-expander-heading \x3e .a-icon"})});
/* ******** */
